zion-mcp 2.8.5 → 2.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/{chunk-3YRJIY6Z.js → chunk-6KY3QITQ.js} +1 -1
- package/dist/{chunk-Z6O4HLQ5.js → chunk-CUEKSRNI.js} +1 -1
- package/dist/{chunk-5TW2RK7G.js → chunk-HXRQLPVQ.js} +1 -1
- package/dist/{chunk-MF4TNILC.js → chunk-VSTPZDYO.js} +1 -1
- package/dist/{chunk-CCPB2BTC.js → chunk-WRU7YLUO.js} +1 -1
- package/dist/{chunk-K7ILN5SX.js → chunk-ZGX656ZG.js} +1 -1
- package/dist/{cli-O6EFVNG4.js → cli-5M4LKU27.js} +182 -136
- package/dist/{corpus-DCO5BVFL.js → corpus-WPOJHLAU.js} +314 -4
- package/dist/{index.cjs-L7NZYXV4.js → index.cjs-G7QKQQEI.js} +1 -1
- package/dist/{json-crdt-3ENUDB3K.js → json-crdt-UTIMH7MN.js} +1 -1
- package/dist/{json-crdt-patch-JB23VTH5.js → json-crdt-patch-N5S5AUJ4.js} +1 -1
- package/dist/server.js +1 -1
- package/dist/{surface-32BFSGWV.js → surface-TGGCJZR5.js} +1 -1
- package/dist/{ztype-IGART53N.js → ztype-DHYCSI44.js} +116 -116
- package/package.json +1 -1
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { createRequire as __nodeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __nodeCreateRequire(import.meta.url);
|
|
3
|
-
import{a as tp,b as ci,c as
|
|
4
|
-
`)}displayWidth(t){return
|
|
3
|
+
import{a as tp,b as ci,c as Ro,d as No,f as wv,g as Ov}from"./chunk-CUEKSRNI.js";import{A as Lv,B as kv,V as jv,W as op,X as Mv,Y as Fv,Z as qv,_ as Uv,a as Av,b as rp,c as xv,d as np,e as N,f as Nt,g as Cv,h as Pt,i as Rv,j as ip,k as Nv,l as Pv,s as Dv}from"./chunk-6KY3QITQ.js";import{a as Ur,b as bv,c as bn,d as Y,e as Tn,f as Tv,g as Oa,i as Iv}from"./chunk-ZGX656ZG.js";import{a as M,c as y,e as je,g as p}from"./chunk-WRU7YLUO.js";var Po=y(ap=>{p();var Aa=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}},sp=class extends Aa{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};ap.CommanderError=Aa;ap.InvalidArgumentError=sp});var xa=y(cp=>{p();var{InvalidArgumentError:ND}=Po(),up=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.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}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 ND(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function PD(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}cp.Argument=up;cp.humanReadableArgName=PD});var dp=y(pp=>{p();var{humanReadableArgName:DD}=xa(),lp=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,o)=>i.name().localeCompare(o.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),o=n.long&&t._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?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(o=>!o.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=>DD(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=[];if(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){let n=`(${r.join(", ")})`;return t.description?`${t.description} ${n}`:n}return 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}formatItemList(t,r,n){return r.length===0?[]:[n.styleTitle(t),...r,""]}groupItems(t,r,n){let i=new Map;return t.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[])}),r.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[]),i.get(s).push(o)}),i}formatHelp(t,r){let n=r.padWidth(t,r),i=r.helpWidth??80;function o(d,f){return r.formatItem(d,n,f,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],a=r.commandDescription(t);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let u=r.visibleArguments(t).map(d=>o(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",u,r)),this.groupItems(t.options,r.visibleOptions(t),d=>d.helpGroupHeading??"Options:").forEach((d,f)=>{let h=d.map(g=>o(r.styleOptionTerm(r.optionTerm(g)),r.styleOptionDescription(r.optionDescription(g))));s=s.concat(this.formatItemList(f,h,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(t).map(f=>o(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));s=s.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(t.commands,r.visibleCommands(t),d=>d.helpGroup()||"Commands:").forEach((d,f)=>{let h=d.map(g=>o(r.styleSubcommandTerm(r.subcommandTerm(g)),r.styleSubcommandDescription(r.subcommandDescription(g))));s=s.concat(this.formatItemList(f,h,r))}),s.join(`
|
|
4
|
+
`)}displayWidth(t){return Vv(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 s=" ".repeat(2);if(!n)return s+t;let a=t.padEnd(r+t.length-i.displayWidth(t)),u=2,l=(this.helpWidth??80)-r-u-2,d;return l<this.minWidthToWrap||i.preformatted(n)?d=n:d=i.boxWrap(n,l).replace(/\n/g,`
|
|
5
5
|
`+" ".repeat(r+u)),s+a+" ".repeat(u)+d.replace(/\n/g,`
|
|
6
6
|
${s}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let n=t.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,o=[];return n.forEach(s=>{let a=s.match(i);if(a===null){o.push("");return}let u=[a.shift()],c=this.displayWidth(u[0]);a.forEach(l=>{let d=this.displayWidth(l);if(c+d<=r){u.push(l),c+=d;return}o.push(u.join(""));let f=l.trimStart();u=[f],c=this.displayWidth(f)}),o.push(u.join(""))}),o.join(`
|
|
7
|
-
`)}};function
|
|
7
|
+
`)}};function Vv(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}pp.Help=lp;pp.stripColor=Vv});var gp=y(mp=>{p();var{InvalidArgumentError:LD}=Po(),fp=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=kD(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,this.helpGroupHeading=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}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new LD(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Gv(this.name().replace(/^no-/,"")):Gv(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},hp=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,o=i!==void 0?i:!1;return r.negate===(o===t)}};function Gv(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function kD(e){let t,r,n=/^-[^-]$/,i=/^--[^-]/,o=e.split(/[ |,]+/).concat("guard");if(n.test(o[0])&&(t=o.shift()),i.test(o[0])&&(r=o.shift()),!t&&n.test(o[0])&&(t=o.shift()),!t&&i.test(o[0])&&(t=r,r=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${e}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a}
|
|
8
8
|
- a short flag is a single dash and a single character
|
|
9
9
|
- either use a single dash and a single character (for a short flag)
|
|
10
10
|
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(s)?new Error(`${a}
|
|
11
11
|
- too many short flags`):i.test(s)?new Error(`${a}
|
|
12
12
|
- too many long flags`):new Error(`${a}
|
|
13
|
-
- 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}}mp.Option=fp;mp.DualOptions=hp});var
|
|
13
|
+
- 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}}mp.Option=fp;mp.DualOptions=hp});var Bv=y($v=>{p();function jD(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 o=1;e[i-1]===t[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),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 MD(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(s=>s.slice(2)));let n=[],i=3,o=.4;return t.forEach(s=>{if(s.length<=1)return;let a=jD(e,s),u=Math.max(e.length,s.length);(u-a)/u>o&&(a<i?(i=a,n=[s]):a===i&&n.push(s))}),n.sort((s,a)=>s.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?`
|
|
14
14
|
(Did you mean one of ${n.join(", ")}?)`:n.length===1?`
|
|
15
|
-
(Did you mean ${n[0]}?)`:""}
|
|
16
|
-
- 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
|
|
17
|
-
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 vp(t,r,n)),fe.exit(t)}action(t){let r=n=>{let i=this.registeredArguments.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),t.apply(this,o)};return this._actionHandler=r,this}createOption(t,r){return new
|
|
18
|
-
- already used by option '${r.flags}'`)}this._initOptionGroup(t),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("|"),o=r(t).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),n=t.attributeName();if(t.negate){let o=t.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(n,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(n,t.defaultValue,"default");let i=(o,s,a)=>{o==null&&t.presetArg!==void 0&&(o=t.presetArg);let u=this.getOptionValue(n);o!==null&&t.parseArg?o=this._callParseArg(t,o,u,s):o!==null&&t.variadic&&(o=t._collectValue(o,u)),o==null&&(t.negate?o=!1:t.isBoolean()||t.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${t.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),t.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${t.flags}' value '${o}' from env '${t.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(t,r,n,i,o){if(typeof r=="object"&&r instanceof
|
|
15
|
+
(Did you mean ${n[0]}?)`:""}$v.suggestSimilar=MD});var Wv=y(Sp=>{p();var FD=M("node:events").EventEmitter,yp=M("node:child_process"),_r=M("node:path"),Ca=M("node:fs"),fe=M("node:process"),{Argument:qD,humanReadableArgName:UD}=xa(),{CommanderError:vp}=Po(),{Help:VD,stripColor:GD}=dp(),{Option:Kv,DualOptions:$D}=gp(),{suggestSimilar:Hv}=Bv(),Ep=class e extends FD{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=>fe.stdout.write(r),writeErr:r=>fe.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>fe.stdout.isTTY?fe.stdout.columns:void 0,getErrHelpWidth:()=>fe.stderr.isTTY?fe.stderr.columns:void 0,getOutHasColors:()=>_p()??(fe.stdout.isTTY&&fe.stdout.hasColors?.()),getErrHasColors:()=>_p()??(fe.stderr.isTTY&&fe.stderr.hasColors?.()),stripColor:r=>GD(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=t.match(/([^ ]+) *(.*)/),u=this.createCommand(s);return i&&(u.description(i),u._executableHandler=!0),o.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),i?this:u}createCommand(t){return new e(t)}createHelp(){return Object.assign(new VD,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
16
|
+
- 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 qD(t,r)}argument(t,r,n,i){let o=this.createArgument(t,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(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,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=t??"help [command]",[,i,o]=n.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(i);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(t||r)&&this._initCommandGroup(a),this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
|
|
17
|
+
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 vp(t,r,n)),fe.exit(t)}action(t){let r=n=>{let i=this.registeredArguments.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),t.apply(this,o)};return this._actionHandler=r,this}createOption(t,r){return new Kv(t,r)}_callParseArg(t,r,n,i){try{return t.parseArg(r,n)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_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}'
|
|
18
|
+
- already used by option '${r.flags}'`)}this._initOptionGroup(t),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("|"),o=r(t).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),n=t.attributeName();if(t.negate){let o=t.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(n,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(n,t.defaultValue,"default");let i=(o,s,a)=>{o==null&&t.presetArg!==void 0&&(o=t.presetArg);let u=this.getOptionValue(n);o!==null&&t.parseArg?o=this._callParseArg(t,o,u,s):o!==null&&t.variadic&&(o=t._collectValue(o,u)),o==null&&(t.negate?o=!1:t.isBoolean()||t.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${t.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),t.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${t.flags}' value '${o}' from env '${t.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(t,r,n,i,o){if(typeof r=="object"&&r instanceof Kv)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!t.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(u,c)=>{let l=a.exec(u);return l?l[0]:c},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}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){fe.versions?.electron&&(r.from="electron");let i=fe.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}t===void 0&&(t=fe.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":fe.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.
|
|
19
19
|
- 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(Ca.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",o=`'${t}' does not exist
|
|
20
20
|
- if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
21
21
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
22
|
-
- ${i}`;throw new Error(o)}_executeSubCommand(t,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(l,d){let f=_r.resolve(l,d);if(Ca.existsSync(f))return f;if(i.includes(_r.extname(d)))return;let h=i.find(g=>Ca.existsSync(`${f}${g}`));if(h)return`${f}${h}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let l;try{l=Ca.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=_r.resolve(_r.dirname(l),a)}if(a){let l=o(a,s);if(!l&&!t._executableFile&&this._scriptPath){let d=_r.basename(this._scriptPath,_r.extname(this._scriptPath));d!==this._name&&(l=o(a,`${d}-${t._name}`))}s=l||s}n=i.includes(_r.extname(s));let u;fe.platform!=="win32"?n?(r.unshift(s),r=
|
|
22
|
+
- ${i}`;throw new Error(o)}_executeSubCommand(t,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(l,d){let f=_r.resolve(l,d);if(Ca.existsSync(f))return f;if(i.includes(_r.extname(d)))return;let h=i.find(g=>Ca.existsSync(`${f}${g}`));if(h)return`${f}${h}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let l;try{l=Ca.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=_r.resolve(_r.dirname(l),a)}if(a){let l=o(a,s);if(!l&&!t._executableFile&&this._scriptPath){let d=_r.basename(this._scriptPath,_r.extname(this._scriptPath));d!==this._name&&(l=o(a,`${d}-${t._name}`))}s=l||s}n=i.includes(_r.extname(s));let u;fe.platform!=="win32"?n?(r.unshift(s),r=Qv(fe.execArgv).concat(r),u=yp.spawn(fe.argv[0],r,{stdio:"inherit"})):u=yp.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,t._name),r.unshift(s),r=Qv(fe.execArgv).concat(r),u=yp.spawn(fe.execPath,r,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{fe.on(d,()=>{u.killed===!1&&u.exitCode===null&&u.kill(d)})});let c=this._exitCallback;u.on("close",l=>{l=l??1,c?c(new vp(l,"commander.executeSubCommandAsync","(close)")):fe.exit(l)}),u.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(s,a,t._name);else if(l.code==="EACCES")throw new Error(`'${s}' not executable`);if(!c)fe.exit(1);else{let d=new vp(1,"commander.executeSubCommandAsync","(error)");d.nestedError=l,c(d)}}),this.runningCommand=u}_dispatchSubcommand(t,r,n){let i=this._findCommand(t);i||this.help({error:!0}),i._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,i,"preSubcommand"),o=this._chainOrCall(o,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}),o}_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,o)=>{let s=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,i,o,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,i)=>{let o=n.defaultValue;n.variadic?i<this.args.length?(o=this.args.slice(i),n.parseArg&&(o=o.reduce((s,a)=>t(n,a,s),n.defaultValue))):o===void 0&&(o=[]):i<this.args.length&&(o=this.args[i],n.parseArg&&(o=t(n,o,n.defaultValue))),r[i]=o}),this.processedArgs=r}_chainOrCall(t,r){return t?.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let n=t,i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{i.push({hookedCommand:o,callback:s})})}),r==="postAction"&&i.reverse(),i.forEach(o=>{n=this._chainOrCall(n,()=>o.callback(o.hookedCommand,this))}),n}_chainOrCallSubCommandHook(t,r,n){let i=t;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(o=>{i=this._chainOrCall(i,()=>o(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])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,t,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,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(o=>n.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],n=[],i=r;function o(l){return l.length>1&&l[0]==="-"}let s=l=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(d=>d.options.map(f=>f.short).some(f=>/^-\d$/.test(f))):!1,a=null,u=null,c=0;for(;c<t.length||u;){let l=u??t[c++];if(u=null,l==="--"){i===n&&i.push(l),i.push(...t.slice(c));break}if(a&&(!o(l)||s(l))){this.emit(`option:${a.name()}`,l);continue}if(a=null,o(l)){let d=this._findOption(l);if(d){if(d.required){let f=t[c++];f===void 0&&this.optionMissingArgument(d),this.emit(`option:${d.name()}`,f)}else if(d.optional){let f=null;c<t.length&&(!o(t[c])||s(t[c]))&&(f=t[c++]),this.emit(`option:${d.name()}`,f)}else this.emit(`option:${d.name()}`);a=d.variadic?d:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let d=this._findOption(`-${l[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,l.slice(2)):(this.emit(`option:${d.name()}`),u=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let d=l.indexOf("="),f=this._findOption(l.slice(0,d));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,l.slice(d+1));continue}}if(i===r&&o(l)&&!(this.commands.length===0&&s(l))&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(l)){r.push(l),n.push(...t.slice(c));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l,...t.slice(c));break}else if(this._defaultCommandName){n.push(l,...t.slice(c));break}}if(this._passThroughOptions){i.push(l,...t.slice(c));break}i.push(l)}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}
|
|
23
23
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
24
24
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
25
|
-
`),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in fe.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()}`,fe.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new
|
|
26
|
-
`),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=>
|
|
25
|
+
`),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in fe.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()}`,fe.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new $D(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=s=>{let a=s.attributeName(),u=this.getOptionValue(a),c=this.options.find(d=>d.negate&&a===d.attributeName()),l=this.options.find(d=>!d.negate&&a===d.attributeName());return c&&(c.presetArg===void 0&&u===!1||c.presetArg!==void 0&&u===c.presetArg)?c:l||s},i=s=>{let a=n(s),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(t)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=Hv(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",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${t.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=Hv(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}
|
|
26
|
+
`),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=>UD(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)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=_r.basename(t,_r.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,o;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:o}}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(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:n.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(t,r){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",r??"display help for command"),(t||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let r=Number(fe.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.
|
|
27
27
|
Expecting one of '${n.join("', '")}'`);let i=`${t}Help`;return this.on(i,o=>{let s;typeof r=="function"?s=r({error:o.error,command:o.command}):s=r,s&&o.write(`${s}
|
|
28
|
-
`)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function
|
|
28
|
+
`)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Qv(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,n="127.0.0.1",i="9229",o;return(o=t.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:t})}function _p(){if(fe.env.NO_COLOR||fe.env.FORCE_COLOR==="0"||fe.env.FORCE_COLOR==="false")return!1;if(fe.env.FORCE_COLOR||fe.env.CLICOLOR_FORCE!==void 0)return!0}Sp.Command=Ep;Sp.useColor=_p});var Xv=y(Dt=>{p();var{Argument:zv}=xa(),{Command:bp}=Wv(),{CommanderError:BD,InvalidArgumentError:Yv}=Po(),{Help:KD}=dp(),{Option:Jv}=gp();Dt.program=new bp;Dt.createCommand=e=>new bp(e);Dt.createOption=(e,t)=>new Jv(e,t);Dt.createArgument=(e,t)=>new zv(e,t);Dt.Command=bp;Dt.Option=Jv;Dt.Argument=zv;Dt.Help=KD;Dt.CommanderError=BD;Dt.InvalidArgumentError=Yv;Dt.InvalidOptionArgumentError=Yv});var li=y((Ip,rE)=>{p();var Ra=M("buffer"),or=Ra.Buffer;function tE(e,t){for(var r in e)t[r]=e[r]}or.from&&or.alloc&&or.allocUnsafe&&or.allocUnsafeSlow?rE.exports=Ra:(tE(Ra,Ip),Ip.Buffer=In);function In(e,t,r){return or(e,t,r)}In.prototype=Object.create(or.prototype);tE(or,In);In.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return or(e,t,r)};In.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=or(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};In.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return or(e)};In.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Ra.SlowBuffer(e)}});var wp=y((d9,nE)=>{p();var Na=li().Buffer,HD=M("stream"),QD=M("util");function Pa(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=Na.alloc(0),this;if(typeof e.pipe=="function")return this.buffer=Na.alloc(0),e.pipe(this),this;if(e.length||typeof e=="object")return this.buffer=e,this.writable=!1,process.nextTick(function(){this.emit("end",e),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof e+")")}QD.inherits(Pa,HD);Pa.prototype.write=function(t){this.buffer=Na.concat([this.buffer,Na.from(t)]),this.emit("data",t)};Pa.prototype.end=function(t){t&&this.write(t),this.emit("end",t),this.emit("close"),this.writable=!1,this.readable=!1};nE.exports=Pa});var oE=y((h9,iE)=>{"use strict";p();function Op(e){var t=(e/8|0)+(e%8===0?0:1);return t}var WD={ES256:Op(256),ES384:Op(384),ES512:Op(521)};function zD(e){var t=WD[e];if(t)return t;throw new Error('Unknown algorithm "'+e+'"')}iE.exports=zD});var dE=y((g9,pE)=>{"use strict";p();var Da=li().Buffer,aE=oE(),La=128,uE=0,YD=32,JD=16,XD=2,cE=JD|YD|uE<<6,ka=XD|uE<<6;function ZD(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function lE(e){if(Da.isBuffer(e))return e;if(typeof e=="string")return Da.from(e,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function eL(e,t){e=lE(e);var r=aE(t),n=r+1,i=e.length,o=0;if(e[o++]!==cE)throw new Error('Could not find expected "seq"');var s=e[o++];if(s===(La|1)&&(s=e[o++]),i-o<s)throw new Error('"seq" specified length of "'+s+'", only "'+(i-o)+'" remaining');if(e[o++]!==ka)throw new Error('Could not find expected "int" for "r"');var a=e[o++];if(i-o-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(i-o-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var u=o;if(o+=a,e[o++]!==ka)throw new Error('Could not find expected "int" for "s"');var c=e[o++];if(i-o!==c)throw new Error('"s" specified length of "'+c+'", expected "'+(i-o)+'"');if(n<c)throw new Error('"s" specified length of "'+c+'", max of "'+n+'" is acceptable');var l=o;if(o+=c,o!==i)throw new Error('Expected to consume entire buffer, but "'+(i-o)+'" bytes remain');var d=r-a,f=r-c,h=Da.allocUnsafe(d+a+f+c);for(o=0;o<d;++o)h[o]=0;e.copy(h,o,u+Math.max(-d,0),u+a),o=r;for(var g=o;o<g+f;++o)h[o]=0;return e.copy(h,o,l+Math.max(-f,0),l+c),h=h.toString("base64"),h=ZD(h),h}function sE(e,t,r){for(var n=0;t+n<r&&e[t+n]===0;)++n;var i=e[t+n]>=La;return i&&--n,n}function tL(e,t){e=lE(e);var r=aE(t),n=e.length;if(n!==r*2)throw new TypeError('"'+t+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=sE(e,0,r),o=sE(e,r,e.length),s=r-i,a=r-o,u=2+s+1+1+a,c=u<La,l=Da.allocUnsafe((c?2:3)+u),d=0;return l[d++]=cE,c?l[d++]=u:(l[d++]=La|1,l[d++]=u&255),l[d++]=ka,l[d++]=s,i<0?(l[d++]=0,d+=e.copy(l,d,0,r)):d+=e.copy(l,d,i,r),l[d++]=ka,l[d++]=a,o<0?(l[d++]=0,e.copy(l,d,r)):e.copy(l,d,r+o),l}pE.exports={derToJose:eL,joseToDer:tL}});var hE=y((v9,fE)=>{"use strict";p();var Do=M("buffer").Buffer,Ap=M("buffer").SlowBuffer;fE.exports=ja;function ja(e,t){if(!Do.isBuffer(e)||!Do.isBuffer(t)||e.length!==t.length)return!1;for(var r=0,n=0;n<e.length;n++)r|=e[n]^t[n];return r===0}ja.install=function(){Do.prototype.equal=Ap.prototype.equal=function(t){return ja(this,t)}};var rL=Do.prototype.equal,nL=Ap.prototype.equal;ja.restore=function(){Do.prototype.equal=rL,Ap.prototype.equal=nL}});var Np=y((_9,TE)=>{p();var di=li().Buffer,Lt=M("crypto"),gE=dE(),mE=M("util"),iL=`"%s" is not a valid algorithm.
|
|
29
29
|
Supported algorithms are:
|
|
30
|
-
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Do="secret must be a string or buffer",pi="key must be a string or a buffer",tL="key must be a string, a buffer or an object",Cp=typeof Lt.createPublicKey=="function";Cp&&(pi+=" or a KeyObject",Do+="or a KeyObject");function gE(e){if(!di.isBuffer(e)&&typeof e!="string"&&(!Cp||typeof e!="object"||typeof e.type!="string"||typeof e.asymmetricKeyType!="string"||typeof e.export!="function"))throw Qt(pi)}function yE(e){if(!di.isBuffer(e)&&typeof e!="string"&&typeof e!="object")throw Qt(tL)}function rL(e){if(!di.isBuffer(e)){if(typeof e=="string")return e;if(!Cp||typeof e!="object"||e.type!=="secret"||typeof e.export!="function")throw Qt(Do)}}function Rp(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function vE(e){e=e.toString();var t=4-e.length%4;if(t!==4)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function Qt(e){var t=[].slice.call(arguments,1),r=hE.format.bind(hE,e).apply(null,t);return new TypeError(r)}function nL(e){return di.isBuffer(e)||typeof e=="string"}function Lo(e){return nL(e)||(e=JSON.stringify(e)),e}function EE(e){return function(r,n){rL(n),r=Lo(r);var i=Lt.createHmac("sha"+e,n),o=(i.update(r),i.digest("base64"));return Rp(o)}}var xp,iL="timingSafeEqual"in Lt?function(t,r){return t.byteLength!==r.byteLength?!1:Lt.timingSafeEqual(t,r)}:function(t,r){return xp||(xp=fE()),xp(t,r)};function oL(e){return function(r,n,i){var o=EE(e)(r,i);return iL(di.from(n),di.from(o))}}function _E(e){return function(r,n){yE(n),r=Lo(r);var i=Lt.createSign("RSA-SHA"+e),o=(i.update(r),i.sign(n,"base64"));return Rp(o)}}function bE(e){return function(r,n,i){gE(i),r=Lo(r),n=vE(n);var o=Lt.createVerify("RSA-SHA"+e);return o.update(r),o.verify(i,n,"base64")}}function sL(e){return function(r,n){yE(n),r=Lo(r);var i=Lt.createSign("RSA-SHA"+e),o=(i.update(r),i.sign({key:n,padding:Lt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Lt.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Rp(o)}}function aL(e){return function(r,n,i){gE(i),r=Lo(r),n=vE(n);var o=Lt.createVerify("RSA-SHA"+e);return o.update(r),o.verify({key:i,padding:Lt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Lt.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function uL(e){var t=_E(e);return function(){var n=t.apply(null,arguments);return n=mE.derToJose(n,"ES"+e),n}}function cL(e){var t=bE(e);return function(n,i,o){i=mE.joseToDer(i,"ES"+e).toString("base64");var s=t(n,i,o);return s}}function lL(){return function(){return""}}function pL(){return function(t,r){return r===""}}SE.exports=function(t){var r={hs:EE,rs:_E,ps:sL,es:uL,none:lL},n={hs:oL,rs:bE,ps:aL,es:cL,none:pL},i=t.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Qt(eL,t);var o=(i[1]||i[3]).toLowerCase(),s=i[2];return{sign:r[o](s),verify:n[o](s)}}});var Pp=y((v9,TE)=>{p();var dL=M("buffer").Buffer;TE.exports=function(t){return typeof t=="string"?t:typeof t=="number"||dL.isBuffer(t)?t.toString():JSON.stringify(t)}});var CE=y((_9,xE)=>{p();var fL=li().Buffer,IE=wp(),hL=Np(),mL=M("stream"),wE=Pp(),Dp=M("util");function OE(e,t){return fL.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function gL(e,t,r){r=r||"utf8";var n=OE(wE(e),"binary"),i=OE(wE(t),r);return Dp.format("%s.%s",n,i)}function AE(e){var t=e.header,r=e.payload,n=e.secret||e.privateKey,i=e.encoding,o=hL(t.alg),s=gL(t,r,i),a=o.sign(s,n);return Dp.format("%s.%s",s,a)}function Ma(e){var t=e.secret;if(t=t??e.privateKey,t=t??e.key,/^hs/i.test(e.header.alg)===!0&&t==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new IE(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new IE(e.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}Dp.inherits(Ma,mL);Ma.prototype.sign=function(){try{var t=AE({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",t),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}};Ma.sign=AE;xE.exports=Ma});var qE=y((S9,FE)=>{p();var NE=li().Buffer,RE=wp(),yL=Np(),vL=M("stream"),PE=Pp(),EL=M("util"),_L=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function bL(e){return Object.prototype.toString.call(e)==="[object Object]"}function SL(e){if(bL(e))return e;try{return JSON.parse(e)}catch{return}}function DE(e){var t=e.split(".",1)[0];return SL(NE.from(t,"base64").toString("binary"))}function TL(e){return e.split(".",2).join(".")}function LE(e){return e.split(".")[2]}function IL(e,t){t=t||"utf8";var r=e.split(".")[1];return NE.from(r,"base64").toString(t)}function kE(e){return _L.test(e)&&!!DE(e)}function jE(e,t,r){if(!t){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}e=PE(e);var i=LE(e),o=TL(e),s=yL(t);return s.verify(o,i,r)}function ME(e,t){if(t=t||{},e=PE(e),!kE(e))return null;var r=DE(e);if(!r)return null;var n=IL(e);return(r.typ==="JWT"||t.json)&&(n=JSON.parse(n,t.encoding)),{header:r,payload:n,signature:LE(e)}}function fi(e){e=e||{};var t=e.secret;if(t=t??e.publicKey,t=t??e.key,/^hs/i.test(e.algorithm)===!0&&t==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new RE(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new RE(e.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}EL.inherits(fi,vL);fi.prototype.verify=function(){try{var t=jE(this.signature.buffer,this.algorithm,this.key.buffer),r=ME(this.signature.buffer,this.encoding);return this.emit("done",t,r),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};fi.decode=ME;fi.isValid=kE;fi.verify=jE;FE.exports=fi});var qa=y(Vr=>{p();var UE=CE(),Fa=qE(),wL=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Vr.ALGORITHMS=wL;Vr.sign=UE.sign;Vr.verify=Fa.verify;Vr.decode=Fa.decode;Vr.isValid=Fa.isValid;Vr.createSign=function(t){return new UE(t)};Vr.createVerify=function(t){return new Fa(t)}});var Lp=y((O9,VE)=>{p();var OL=qa();VE.exports=function(e,t){t=t||{};var r=OL.decode(e,t);if(!r)return null;var n=r.payload;if(typeof n=="string")try{var i=JSON.parse(n);i!==null&&typeof i=="object"&&(n=i)}catch{}return t.complete===!0?{header:r.header,payload:n,signature:r.signature}:n}});var ko=y((x9,GE)=>{p();var Ua=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};Ua.prototype=Object.create(Error.prototype);Ua.prototype.constructor=Ua;GE.exports=Ua});var kp=y((R9,BE)=>{p();var $E=ko(),Va=function(e,t){$E.call(this,e),this.name="NotBeforeError",this.date=t};Va.prototype=Object.create($E.prototype);Va.prototype.constructor=Va;BE.exports=Va});var jp=y((P9,HE)=>{p();var KE=ko(),Ga=function(e,t){KE.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};Ga.prototype=Object.create(KE.prototype);Ga.prototype.constructor=Ga;HE.exports=Ga});var WE=y((L9,QE)=>{p();var hi=1e3,mi=hi*60,gi=mi*60,wn=gi*24,AL=wn*7,xL=wn*365.25;QE.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return CL(e);if(r==="number"&&isFinite(e))return t.long?NL(e):RL(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function CL(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*xL;case"weeks":case"week":case"w":return r*AL;case"days":case"day":case"d":return r*wn;case"hours":case"hour":case"hrs":case"hr":case"h":return r*gi;case"minutes":case"minute":case"mins":case"min":case"m":return r*mi;case"seconds":case"second":case"secs":case"sec":case"s":return r*hi;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function RL(e){var t=Math.abs(e);return t>=wn?Math.round(e/wn)+"d":t>=gi?Math.round(e/gi)+"h":t>=mi?Math.round(e/mi)+"m":t>=hi?Math.round(e/hi)+"s":e+"ms"}function NL(e){var t=Math.abs(e);return t>=wn?$a(e,t,wn,"day"):t>=gi?$a(e,t,gi,"hour"):t>=mi?$a(e,t,mi,"minute"):t>=hi?$a(e,t,hi,"second"):e+" ms"}function $a(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var Mp=y((j9,zE)=>{p();var PL=WE();zE.exports=function(e,t){var r=t||Math.floor(Date.now()/1e3);if(typeof e=="string"){var n=PL(e);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof e=="number"?r+e:void 0}});var yi=y((F9,YE)=>{"use strict";p();var DL="2.0.0",LL=Number.MAX_SAFE_INTEGER||9007199254740991,kL=16,jL=250,ML=["major","premajor","minor","preminor","patch","prepatch","prerelease"];YE.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:kL,MAX_SAFE_BUILD_LENGTH:jL,MAX_SAFE_INTEGER:LL,RELEASE_TYPES:ML,SEMVER_SPEC_VERSION:DL,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var jo=y((U9,JE)=>{"use strict";p();var FL=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};JE.exports=FL});var vi=y((sr,XE)=>{"use strict";p();var{MAX_SAFE_COMPONENT_LENGTH:Fp,MAX_SAFE_BUILD_LENGTH:qL,MAX_LENGTH:UL}=yi(),VL=jo();sr=XE.exports={};var GL=sr.re=[],$L=sr.safeRe=[],k=sr.src=[],BL=sr.safeSrc=[],j=sr.t={},KL=0,qp="[a-zA-Z0-9-]",HL=[["\\s",1],["\\d",UL],[qp,qL]],QL=e=>{for(let[t,r]of HL)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},z=(e,t,r)=>{let n=QL(t),i=KL++;VL(e,i,t),j[e]=i,k[i]=t,BL[i]=n,GL[i]=new RegExp(t,r?"g":void 0),$L[i]=new RegExp(n,r?"g":void 0)};z("NUMERICIDENTIFIER","0|[1-9]\\d*");z("NUMERICIDENTIFIERLOOSE","\\d+");z("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${qp}*`);z("MAINVERSION",`(${k[j.NUMERICIDENTIFIER]})\\.(${k[j.NUMERICIDENTIFIER]})\\.(${k[j.NUMERICIDENTIFIER]})`);z("MAINVERSIONLOOSE",`(${k[j.NUMERICIDENTIFIERLOOSE]})\\.(${k[j.NUMERICIDENTIFIERLOOSE]})\\.(${k[j.NUMERICIDENTIFIERLOOSE]})`);z("PRERELEASEIDENTIFIER",`(?:${k[j.NONNUMERICIDENTIFIER]}|${k[j.NUMERICIDENTIFIER]})`);z("PRERELEASEIDENTIFIERLOOSE",`(?:${k[j.NONNUMERICIDENTIFIER]}|${k[j.NUMERICIDENTIFIERLOOSE]})`);z("PRERELEASE",`(?:-(${k[j.PRERELEASEIDENTIFIER]}(?:\\.${k[j.PRERELEASEIDENTIFIER]})*))`);z("PRERELEASELOOSE",`(?:-?(${k[j.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${k[j.PRERELEASEIDENTIFIERLOOSE]})*))`);z("BUILDIDENTIFIER",`${qp}+`);z("BUILD",`(?:\\+(${k[j.BUILDIDENTIFIER]}(?:\\.${k[j.BUILDIDENTIFIER]})*))`);z("FULLPLAIN",`v?${k[j.MAINVERSION]}${k[j.PRERELEASE]}?${k[j.BUILD]}?`);z("FULL",`^${k[j.FULLPLAIN]}$`);z("LOOSEPLAIN",`[v=\\s]*${k[j.MAINVERSIONLOOSE]}${k[j.PRERELEASELOOSE]}?${k[j.BUILD]}?`);z("LOOSE",`^${k[j.LOOSEPLAIN]}$`);z("GTLT","((?:<|>)?=?)");z("XRANGEIDENTIFIERLOOSE",`${k[j.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);z("XRANGEIDENTIFIER",`${k[j.NUMERICIDENTIFIER]}|x|X|\\*`);z("XRANGEPLAIN",`[v=\\s]*(${k[j.XRANGEIDENTIFIER]})(?:\\.(${k[j.XRANGEIDENTIFIER]})(?:\\.(${k[j.XRANGEIDENTIFIER]})(?:${k[j.PRERELEASE]})?${k[j.BUILD]}?)?)?`);z("XRANGEPLAINLOOSE",`[v=\\s]*(${k[j.XRANGEIDENTIFIERLOOSE]})(?:\\.(${k[j.XRANGEIDENTIFIERLOOSE]})(?:\\.(${k[j.XRANGEIDENTIFIERLOOSE]})(?:${k[j.PRERELEASELOOSE]})?${k[j.BUILD]}?)?)?`);z("XRANGE",`^${k[j.GTLT]}\\s*${k[j.XRANGEPLAIN]}$`);z("XRANGELOOSE",`^${k[j.GTLT]}\\s*${k[j.XRANGEPLAINLOOSE]}$`);z("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Fp}})(?:\\.(\\d{1,${Fp}}))?(?:\\.(\\d{1,${Fp}}))?`);z("COERCE",`${k[j.COERCEPLAIN]}(?:$|[^\\d])`);z("COERCEFULL",k[j.COERCEPLAIN]+`(?:${k[j.PRERELEASE]})?(?:${k[j.BUILD]})?(?:$|[^\\d])`);z("COERCERTL",k[j.COERCE],!0);z("COERCERTLFULL",k[j.COERCEFULL],!0);z("LONETILDE","(?:~>?)");z("TILDETRIM",`(\\s*)${k[j.LONETILDE]}\\s+`,!0);sr.tildeTrimReplace="$1~";z("TILDE",`^${k[j.LONETILDE]}${k[j.XRANGEPLAIN]}$`);z("TILDELOOSE",`^${k[j.LONETILDE]}${k[j.XRANGEPLAINLOOSE]}$`);z("LONECARET","(?:\\^)");z("CARETTRIM",`(\\s*)${k[j.LONECARET]}\\s+`,!0);sr.caretTrimReplace="$1^";z("CARET",`^${k[j.LONECARET]}${k[j.XRANGEPLAIN]}$`);z("CARETLOOSE",`^${k[j.LONECARET]}${k[j.XRANGEPLAINLOOSE]}$`);z("COMPARATORLOOSE",`^${k[j.GTLT]}\\s*(${k[j.LOOSEPLAIN]})$|^$`);z("COMPARATOR",`^${k[j.GTLT]}\\s*(${k[j.FULLPLAIN]})$|^$`);z("COMPARATORTRIM",`(\\s*)${k[j.GTLT]}\\s*(${k[j.LOOSEPLAIN]}|${k[j.XRANGEPLAIN]})`,!0);sr.comparatorTrimReplace="$1$2$3";z("HYPHENRANGE",`^\\s*(${k[j.XRANGEPLAIN]})\\s+-\\s+(${k[j.XRANGEPLAIN]})\\s*$`);z("HYPHENRANGELOOSE",`^\\s*(${k[j.XRANGEPLAINLOOSE]})\\s+-\\s+(${k[j.XRANGEPLAINLOOSE]})\\s*$`);z("STAR","(<|>)?=?\\s*\\*");z("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");z("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ba=y(($9,ZE)=>{"use strict";p();var WL=Object.freeze({loose:!0}),zL=Object.freeze({}),YL=e=>e?typeof e!="object"?WL:e:zL;ZE.exports=YL});var Up=y((K9,r_)=>{"use strict";p();var e_=/^[0-9]+$/,t_=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;let r=e_.test(e),n=e_.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},JL=(e,t)=>t_(t,e);r_.exports={compareIdentifiers:t_,rcompareIdentifiers:JL}});var Je=y((Q9,i_)=>{"use strict";p();var Ka=jo(),{MAX_LENGTH:n_,MAX_SAFE_INTEGER:Ha}=yi(),{safeRe:Qa,t:Wa}=vi(),XL=Ba(),{compareIdentifiers:Vp}=Up(),Gp=class e{constructor(t,r){if(r=XL(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>n_)throw new TypeError(`version is longer than ${n_} characters`);Ka("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?Qa[Wa.LOOSE]:Qa[Wa.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ha||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ha||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ha||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<Ha)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Ka("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=t.prerelease[r];if(Ka("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Vp(n,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let n=this.build[r],i=t.build[r];if(Ka("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Vp(n,i)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=`-${r}`.match(this.options.loose?Qa[Wa.PRERELEASELOOSE]:Qa[Wa.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];n===!1&&(o=[r]),Vp(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};i_.exports=Gp});var Gr=y((z9,s_)=>{"use strict";p();var o_=Je(),ZL=(e,t,r=!1)=>{if(e instanceof o_)return e;try{return new o_(e,t)}catch(n){if(!r)return null;throw n}};s_.exports=ZL});var u_=y((J9,a_)=>{"use strict";p();var ek=Gr(),tk=(e,t)=>{let r=ek(e,t);return r?r.version:null};a_.exports=tk});var l_=y((Z9,c_)=>{"use strict";p();var rk=Gr(),nk=(e,t)=>{let r=rk(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};c_.exports=nk});var f_=y((t7,d_)=>{"use strict";p();var p_=Je(),ik=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new p_(e instanceof p_?e.version:e,r).inc(t,n,i).version}catch{return null}};d_.exports=ik});var g_=y((n7,m_)=>{"use strict";p();var h_=Gr(),ok=(e,t)=>{let r=h_(e,null,!0),n=h_(t,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,u=!!s.prerelease.length;if(!!a.prerelease.length&&!u){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let l=u?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};m_.exports=ok});var v_=y((o7,y_)=>{"use strict";p();var sk=Je(),ak=(e,t)=>new sk(e,t).major;y_.exports=ak});var __=y((a7,E_)=>{"use strict";p();var uk=Je(),ck=(e,t)=>new uk(e,t).minor;E_.exports=ck});var S_=y((c7,b_)=>{"use strict";p();var lk=Je(),pk=(e,t)=>new lk(e,t).patch;b_.exports=pk});var I_=y((p7,T_)=>{"use strict";p();var dk=Gr(),fk=(e,t)=>{let r=dk(e,t);return r&&r.prerelease.length?r.prerelease:null};T_.exports=fk});var kt=y((f7,O_)=>{"use strict";p();var w_=Je(),hk=(e,t,r)=>new w_(e,r).compare(new w_(t,r));O_.exports=hk});var x_=y((m7,A_)=>{"use strict";p();var mk=kt(),gk=(e,t,r)=>mk(t,e,r);A_.exports=gk});var R_=y((y7,C_)=>{"use strict";p();var yk=kt(),vk=(e,t)=>yk(e,t,!0);C_.exports=vk});var za=y((E7,P_)=>{"use strict";p();var N_=Je(),Ek=(e,t,r)=>{let n=new N_(e,r),i=new N_(t,r);return n.compare(i)||n.compareBuild(i)};P_.exports=Ek});var L_=y((b7,D_)=>{"use strict";p();var _k=za(),bk=(e,t)=>e.sort((r,n)=>_k(r,n,t));D_.exports=bk});var j_=y((T7,k_)=>{"use strict";p();var Sk=za(),Tk=(e,t)=>e.sort((r,n)=>Sk(n,r,t));k_.exports=Tk});var Mo=y((w7,M_)=>{"use strict";p();var Ik=kt(),wk=(e,t,r)=>Ik(e,t,r)>0;M_.exports=wk});var Ya=y((A7,F_)=>{"use strict";p();var Ok=kt(),Ak=(e,t,r)=>Ok(e,t,r)<0;F_.exports=Ak});var $p=y((C7,q_)=>{"use strict";p();var xk=kt(),Ck=(e,t,r)=>xk(e,t,r)===0;q_.exports=Ck});var Bp=y((N7,U_)=>{"use strict";p();var Rk=kt(),Nk=(e,t,r)=>Rk(e,t,r)!==0;U_.exports=Nk});var Ja=y((D7,V_)=>{"use strict";p();var Pk=kt(),Dk=(e,t,r)=>Pk(e,t,r)>=0;V_.exports=Dk});var Xa=y((k7,G_)=>{"use strict";p();var Lk=kt(),kk=(e,t,r)=>Lk(e,t,r)<=0;G_.exports=kk});var Kp=y((M7,$_)=>{"use strict";p();var jk=$p(),Mk=Bp(),Fk=Mo(),qk=Ja(),Uk=Ya(),Vk=Xa(),Gk=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return jk(e,r,n);case"!=":return Mk(e,r,n);case">":return Fk(e,r,n);case">=":return qk(e,r,n);case"<":return Uk(e,r,n);case"<=":return Vk(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};$_.exports=Gk});var K_=y((q7,B_)=>{"use strict";p();var $k=Je(),Bk=Gr(),{safeRe:Za,t:eu}=vi(),Kk=(e,t)=>{if(e instanceof $k)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Za[eu.COERCEFULL]:Za[eu.COERCE]);else{let u=t.includePrerelease?Za[eu.COERCERTLFULL]:Za[eu.COERCERTL],c;for(;(c=u.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||c.index+c[0].length!==r.index+r[0].length)&&(r=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Bk(`${n}.${i}.${o}${s}${a}`,t)};B_.exports=Kk});var Q_=y((V7,H_)=>{"use strict";p();var Hk=Gr(),Qk=yi(),Wk=Je(),zk=(e,t,r)=>{if(!Qk.RELEASE_TYPES.includes(t))return null;let n=Yk(e,r);return n&&Jk(n,t)},Yk=(e,t)=>{let r=e instanceof Wk?e.version:e;return Hk(r,t)},Jk=(e,t)=>{if(Xk(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},Xk=e=>e.startsWith("pre");H_.exports=zk});var z_=y(($7,W_)=>{"use strict";p();var Hp=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(t,r)}return this}};W_.exports=Hp});var jt=y((K7,Z_)=>{"use strict";p();var Zk=/\s+/g,Qp=class e{constructor(t,r){if(r=tj(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof Wp)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(Zk," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!J_(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&lj(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let r=this.set[t];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(cj,"");let n=((this.options.includePrerelease&&aj)|(this.options.loose&&uj))+":"+t,i=Y_.get(n);if(i)return i;let o=this.options.loose,s=o?ut[Xe.HYPHENRANGELOOSE]:ut[Xe.HYPHENRANGE];t=t.replace(s,_j(this.options.includePrerelease)),Ie("hyphen replace",t),t=t.replace(ut[Xe.COMPARATORTRIM],ij),Ie("comparator trim",t),t=t.replace(ut[Xe.TILDETRIM],oj),Ie("tilde trim",t),t=t.replace(ut[Xe.CARETTRIM],sj),Ie("caret trim",t);let a=t.split(" ").map(d=>pj(d,this.options)).join(" ").split(/\s+/).map(d=>Ej(d,this.options));o&&(a=a.filter(d=>(Ie("loose invalid filter",d,this.options),!!d.match(ut[Xe.COMPARATORLOOSE])))),Ie("range list",a);let u=new Map,c=a.map(d=>new Wp(d,this.options));for(let d of c){if(J_(d))return[d];u.set(d.value,d)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return Y_.set(n,l),l}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(n=>X_(n,r)&&t.set.some(i=>X_(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new rj(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(bj(this.set[r],t,this.options))return!0;return!1}};Z_.exports=Qp;var ej=z_(),Y_=new ej,tj=Ba(),Wp=Fo(),Ie=jo(),rj=Je(),{safeRe:ut,src:nj,t:Xe,comparatorTrimReplace:ij,tildeTrimReplace:oj,caretTrimReplace:sj}=vi(),{FLAG_INCLUDE_PRERELEASE:aj,FLAG_LOOSE:uj}=yi(),cj=new RegExp(nj[Xe.BUILD],"g"),J_=e=>e.value==="<0.0.0-0",lj=e=>e.value==="",X_=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,t)),i=n.pop();return r},pj=(e,t)=>(e=e.replace(ut[Xe.BUILD],""),Ie("comp",e,t),e=hj(e,t),Ie("caret",e),e=dj(e,t),Ie("tildes",e),e=gj(e,t),Ie("xrange",e),e=vj(e,t),Ie("stars",e),e),ct=e=>!e||e.toLowerCase()==="x"||e==="*",dj=(e,t)=>e.trim().split(/\s+/).map(r=>fj(r,t)).join(" "),fj=(e,t)=>{let r=t.loose?ut[Xe.TILDELOOSE]:ut[Xe.TILDE];return e.replace(r,(n,i,o,s,a)=>{Ie("tilde",e,n,i,o,s,a);let u;return ct(i)?u="":ct(o)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:ct(s)?u=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?(Ie("replaceTilde pr",a),u=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):u=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,Ie("tilde return",u),u})},hj=(e,t)=>e.trim().split(/\s+/).map(r=>mj(r,t)).join(" "),mj=(e,t)=>{Ie("caret",e,t);let r=t.loose?ut[Xe.CARETLOOSE]:ut[Xe.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,u)=>{Ie("caret",e,i,o,s,a,u);let c;return ct(o)?c="":ct(s)?c=`>=${o}.0.0${n} <${+o+1}.0.0-0`:ct(a)?o==="0"?c=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:u?(Ie("replaceCaret pr",u),o==="0"?s==="0"?c=`>=${o}.${s}.${a}-${u} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}-${u} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a}-${u} <${+o+1}.0.0-0`):(Ie("no pr"),o==="0"?s==="0"?c=`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),Ie("caret return",c),c})},gj=(e,t)=>(Ie("replaceXRanges",e,t),e.split(/\s+/).map(r=>yj(r,t)).join(" ")),yj=(e,t)=>{e=e.trim();let r=t.loose?ut[Xe.XRANGELOOSE]:ut[Xe.XRANGE];return e.replace(r,(n,i,o,s,a,u)=>{Ie("xRange",e,n,i,o,s,a,u);let c=ct(o),l=c||ct(s),d=l||ct(a),f=d;return i==="="&&f&&(i=""),u=t.includePrerelease?"-0":"",c?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&f?(l&&(s=0),a=0,i===">"?(i=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",l?o=+o+1:s=+s+1),i==="<"&&(u="-0"),n=`${i+o}.${s}.${a}${u}`):l?n=`>=${o}.0.0${u} <${+o+1}.0.0-0`:d&&(n=`>=${o}.${s}.0${u} <${o}.${+s+1}.0-0`),Ie("xRange return",n),n})},vj=(e,t)=>(Ie("replaceStars",e,t),e.trim().replace(ut[Xe.STAR],"")),Ej=(e,t)=>(Ie("replaceGTE0",e,t),e.trim().replace(ut[t.includePrerelease?Xe.GTE0PRE:Xe.GTE0],"")),_j=e=>(t,r,n,i,o,s,a,u,c,l,d,f)=>(ct(n)?r="":ct(i)?r=`>=${n}.0.0${e?"-0":""}`:ct(o)?r=`>=${n}.${i}.0${e?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,ct(c)?u="":ct(l)?u=`<${+c+1}.0.0-0`:ct(d)?u=`<${c}.${+l+1}.0-0`:f?u=`<=${c}.${l}.${d}-${f}`:e?u=`<${c}.${l}.${+d+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),bj=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++)if(Ie(e[n].semver),e[n].semver!==Wp.ANY&&e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}});var Fo=y((Q7,ob)=>{"use strict";p();var qo=Symbol("SemVer ANY"),Jp=class e{static get ANY(){return qo}constructor(t,r){if(r=eb(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),Yp("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===qo?this.value="":this.value=this.operator+this.semver.version,Yp("comp",this)}parse(t){let r=this.options.loose?tb[rb.COMPARATORLOOSE]:tb[rb.COMPARATOR],n=t.match(r);if(!n)throw new TypeError(`Invalid comparator: ${t}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new nb(n[2],this.options.loose):this.semver=qo}toString(){return this.value}test(t){if(Yp("Comparator.test",t,this.options.loose),this.semver===qo||t===qo)return!0;if(typeof t=="string")try{t=new nb(t,this.options)}catch{return!1}return zp(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new ib(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new ib(this.value,r).test(t.semver):(r=eb(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||zp(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||zp(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};ob.exports=Jp;var eb=Ba(),{safeRe:tb,t:rb}=vi(),zp=Kp(),Yp=jo(),nb=Je(),ib=jt()});var Uo=y((z7,sb)=>{"use strict";p();var Sj=jt(),Tj=(e,t,r)=>{try{t=new Sj(t,r)}catch{return!1}return t.test(e)};sb.exports=Tj});var ub=y((J7,ab)=>{"use strict";p();var Ij=jt(),wj=(e,t)=>new Ij(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));ab.exports=wj});var lb=y((Z7,cb)=>{"use strict";p();var Oj=Je(),Aj=jt(),xj=(e,t,r)=>{let n=null,i=null,o=null;try{o=new Aj(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new Oj(n,r))}),n};cb.exports=xj});var db=y((tee,pb)=>{"use strict";p();var Cj=Je(),Rj=jt(),Nj=(e,t,r)=>{let n=null,i=null,o=null;try{o=new Rj(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new Cj(n,r))}),n};pb.exports=Nj});var mb=y((nee,hb)=>{"use strict";p();var Xp=Je(),Pj=jt(),fb=Mo(),Dj=(e,t)=>{e=new Pj(e,t);let r=new Xp("0.0.0");if(e.test(r)||(r=new Xp("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],o=null;i.forEach(s=>{let a=new Xp(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||fb(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||fb(r,o))&&(r=o)}return r&&e.test(r)?r:null};hb.exports=Dj});var yb=y((oee,gb)=>{"use strict";p();var Lj=jt(),kj=(e,t)=>{try{return new Lj(e,t).range||"*"}catch{return null}};gb.exports=kj});var tu=y((aee,bb)=>{"use strict";p();var jj=Je(),_b=Fo(),{ANY:Mj}=_b,Fj=jt(),qj=Uo(),vb=Mo(),Eb=Ya(),Uj=Xa(),Vj=Ja(),Gj=(e,t,r,n)=>{e=new jj(e,n),t=new Fj(t,n);let i,o,s,a,u;switch(r){case">":i=vb,o=Uj,s=Eb,a=">",u=">=";break;case"<":i=Eb,o=Vj,s=vb,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(qj(e,t,n))return!1;for(let c=0;c<t.set.length;++c){let l=t.set[c],d=null,f=null;if(l.forEach(h=>{h.semver===Mj&&(h=new _b(">=0.0.0")),d=d||h,f=f||h,i(h.semver,d.semver,n)?d=h:s(h.semver,f.semver,n)&&(f=h)}),d.operator===a||d.operator===u||(!f.operator||f.operator===a)&&o(e,f.semver))return!1;if(f.operator===u&&s(e,f.semver))return!1}return!0};bb.exports=Gj});var Tb=y((cee,Sb)=>{"use strict";p();var $j=tu(),Bj=(e,t,r)=>$j(e,t,">",r);Sb.exports=Bj});var wb=y((pee,Ib)=>{"use strict";p();var Kj=tu(),Hj=(e,t,r)=>Kj(e,t,"<",r);Ib.exports=Hj});var xb=y((fee,Ab)=>{"use strict";p();var Ob=jt(),Qj=(e,t,r)=>(e=new Ob(e,r),t=new Ob(t,r),e.intersects(t,r));Ab.exports=Qj});var Rb=y((mee,Cb)=>{"use strict";p();var Wj=Uo(),zj=kt();Cb.exports=(e,t,r)=>{let n=[],i=null,o=null,s=e.sort((l,d)=>zj(l,d,r));for(let l of s)Wj(l,t,r)?(o=l,i||(i=l)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[l,d]of n)l===d?a.push(l):!d&&l===s[0]?a.push("*"):d?l===s[0]?a.push(`<=${d}`):a.push(`${l} - ${d}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof t.raw=="string"?t.raw:String(t);return u.length<c.length?u:t}});var jb=y((yee,kb)=>{"use strict";p();var Nb=jt(),td=Fo(),{ANY:Zp}=td,ed=Uo(),rd=kt(),Yj=(e,t,r={})=>{if(e===t)return!0;e=new Nb(e,r),t=new Nb(t,r);let n=!1;e:for(let i of e.set){for(let o of t.set){let s=Xj(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},Jj=[new td(">=0.0.0-0")],Pb=[new td(">=0.0.0")],Xj=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Zp){if(t.length===1&&t[0].semver===Zp)return!0;r.includePrerelease?e=Jj:e=Pb}if(t.length===1&&t[0].semver===Zp){if(r.includePrerelease)return!0;t=Pb}let n=new Set,i,o;for(let h of e)h.operator===">"||h.operator===">="?i=Db(i,h,r):h.operator==="<"||h.operator==="<="?o=Lb(o,h,r):n.add(h.semver);if(n.size>1)return null;let s;if(i&&o){if(s=rd(i.semver,o.semver,r),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let h of n){if(i&&!ed(h,String(i),r)||o&&!ed(h,String(o),r))return null;for(let g of t)if(!ed(h,String(g),r))return!1;return!0}let a,u,c,l,d=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,f=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&o.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let h of t){if(l=l||h.operator===">"||h.operator===">=",c=c||h.operator==="<"||h.operator==="<=",i){if(f&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch&&(f=!1),h.operator===">"||h.operator===">="){if(a=Db(i,h,r),a===h&&a!==i)return!1}else if(i.operator===">="&&!h.test(i.semver))return!1}if(o){if(d&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===d.major&&h.semver.minor===d.minor&&h.semver.patch===d.patch&&(d=!1),h.operator==="<"||h.operator==="<="){if(u=Lb(o,h,r),u===h&&u!==o)return!1}else if(o.operator==="<="&&!h.test(o.semver))return!1}if(!h.operator&&(o||i)&&s!==0)return!1}return!(i&&c&&!o&&s!==0||o&&l&&!i&&s!==0||f||d)},Db=(e,t,r)=>{if(!e)return t;let n=rd(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},Lb=(e,t,r)=>{if(!e)return t;let n=rd(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};kb.exports=Yj});var ru=y((Eee,qb)=>{"use strict";p();var nd=vi(),Mb=yi(),Zj=Je(),Fb=Up(),eM=Gr(),tM=u_(),rM=l_(),nM=f_(),iM=g_(),oM=v_(),sM=__(),aM=S_(),uM=I_(),cM=kt(),lM=x_(),pM=R_(),dM=za(),fM=L_(),hM=j_(),mM=Mo(),gM=Ya(),yM=$p(),vM=Bp(),EM=Ja(),_M=Xa(),bM=Kp(),SM=K_(),TM=Q_(),IM=Fo(),wM=jt(),OM=Uo(),AM=ub(),xM=lb(),CM=db(),RM=mb(),NM=yb(),PM=tu(),DM=Tb(),LM=wb(),kM=xb(),jM=Rb(),MM=jb();qb.exports={parse:eM,valid:tM,clean:rM,inc:nM,diff:iM,major:oM,minor:sM,patch:aM,prerelease:uM,compare:cM,rcompare:lM,compareLoose:pM,compareBuild:dM,sort:fM,rsort:hM,gt:mM,lt:gM,eq:yM,neq:vM,gte:EM,lte:_M,cmp:bM,coerce:SM,truncate:TM,Comparator:IM,Range:wM,satisfies:OM,toComparators:AM,maxSatisfying:xM,minSatisfying:CM,minVersion:RM,validRange:NM,outside:PM,gtr:DM,ltr:LM,intersects:kM,simplifyRange:jM,subset:MM,SemVer:Zj,re:nd.re,src:nd.src,tokens:nd.t,SEMVER_SPEC_VERSION:Mb.SEMVER_SPEC_VERSION,RELEASE_TYPES:Mb.RELEASE_TYPES,compareIdentifiers:Fb.compareIdentifiers,rcompareIdentifiers:Fb.rcompareIdentifiers}});var Vb=y((bee,Ub)=>{p();var FM=ru();Ub.exports=FM.satisfies(process.version,">=15.7.0")});var $b=y((Tee,Gb)=>{p();var qM=ru();Gb.exports=qM.satisfies(process.version,">=16.9.0")});var id=y((wee,Bb)=>{p();var UM=Vb(),VM=$b(),GM={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},$M={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};Bb.exports=function(e,t){if(!e||!t)return;let r=t.asymmetricKeyType;if(!r)return;let n=GM[r];if(!n)throw new Error(`Unknown key type "${r}".`);if(!n.includes(e))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(UM)switch(r){case"ec":let i=t.asymmetricKeyDetails.namedCurve,o=$M[e];if(i!==o)throw new Error(`"alg" parameter "${e}" requires curve "${o}".`);break;case"rsa-pss":if(VM){let s=parseInt(e.slice(-3),10),{hashAlgorithm:a,mgf1HashAlgorithm:u,saltLength:c}=t.asymmetricKeyDetails;if(a!==`sha${s}`||u!==a)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(c!==void 0&&c>s>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}break}}});var od=y((Aee,Kb)=>{p();var BM=ru();Kb.exports=BM.satisfies(process.version,"^6.12.0 || >=8.0.0")});var Wb=y((Cee,Qb)=>{p();var Te=ko(),KM=kp(),Hb=jp(),HM=Lp(),QM=Mp(),WM=id(),zM=od(),YM=qa(),{KeyObject:JM,createSecretKey:XM,createPublicKey:ZM}=M("crypto"),sd=["RS256","RS384","RS512"],eF=["ES256","ES384","ES512"],ad=["RS256","RS384","RS512"],tF=["HS256","HS384","HS512"];zM&&(sd.splice(sd.length,0,"PS256","PS384","PS512"),ad.splice(ad.length,0,"PS256","PS384","PS512"));Qb.exports=function(e,t,r,n){typeof r=="function"&&!n&&(n=r,r={}),r||(r={}),r=Object.assign({},r);let i;if(n?i=n:i=function(l,d){if(l)throw l;return d},r.clockTimestamp&&typeof r.clockTimestamp!="number")return i(new Te("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return i(new Te("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return i(new Te("allowInvalidAsymmetricKeyTypes must be a boolean"));let o=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return i(new Te("jwt must be provided"));if(typeof e!="string")return i(new Te("jwt must be a string"));let s=e.split(".");if(s.length!==3)return i(new Te("jwt malformed"));let a;try{a=HM(e,{complete:!0})}catch(l){return i(l)}if(!a)return i(new Te("invalid token"));let u=a.header,c;if(typeof t=="function"){if(!n)return i(new Te("verify must be called asynchronous if secret or public key is provided as a callback"));c=t}else c=function(l,d){return d(null,t)};return c(u,function(l,d){if(l)return i(new Te("error in secret or public key callback: "+l.message));let f=s[2].trim()!=="";if(!f&&d)return i(new Te("jwt signature is required"));if(f&&!d)return i(new Te("secret or public key must be provided"));if(!f&&!r.algorithms)return i(new Te('please specify "none" in "algorithms" to verify unsigned tokens'));if(d!=null&&!(d instanceof JM))try{d=ZM(d)}catch{try{d=XM(typeof d=="string"?Buffer.from(d):d)}catch{return i(new Te("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(d.type==="secret"?r.algorithms=tF:["rsa","rsa-pss"].includes(d.asymmetricKeyType)?r.algorithms=ad:d.asymmetricKeyType==="ec"?r.algorithms=eF:r.algorithms=sd),r.algorithms.indexOf(a.header.alg)===-1)return i(new Te("invalid algorithm"));if(u.alg.startsWith("HS")&&d.type!=="secret")return i(new Te(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)&&d.type!=="public")return i(new Te(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{WM(u.alg,d)}catch(v){return i(v)}let h;try{h=YM.verify(e,a.header.alg,d)}catch(v){return i(v)}if(!h)return i(new Te("invalid signature"));let g=a.payload;if(typeof g.nbf<"u"&&!r.ignoreNotBefore){if(typeof g.nbf!="number")return i(new Te("invalid nbf value"));if(g.nbf>o+(r.clockTolerance||0))return i(new KM("jwt not active",new Date(g.nbf*1e3)))}if(typeof g.exp<"u"&&!r.ignoreExpiration){if(typeof g.exp!="number")return i(new Te("invalid exp value"));if(o>=g.exp+(r.clockTolerance||0))return i(new Hb("jwt expired",new Date(g.exp*1e3)))}if(r.audience){let v=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(g.aud)?g.aud:[g.aud]).some(function(b){return v.some(function(A){return A instanceof RegExp?A.test(b):A===b})}))return i(new Te("jwt audience invalid. expected: "+v.join(" or ")))}if(r.issuer&&(typeof r.issuer=="string"&&g.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(g.iss)===-1))return i(new Te("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&g.sub!==r.subject)return i(new Te("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&g.jti!==r.jwtid)return i(new Te("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&g.nonce!==r.nonce)return i(new Te("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof g.iat!="number")return i(new Te("iat required when maxAge is specified"));let v=QM(r.maxAge,g.iat);if(typeof v>"u")return i(new Te('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(o>=v+(r.clockTolerance||0))return i(new Hb("maxAge exceeded",new Date(v*1e3)))}if(r.complete===!0){let v=a.signature;return i(null,{header:u,payload:g,signature:v})}return i(null,g)})}});var eS=y((Nee,Zb)=>{p();var zb=1/0,Jb=9007199254740991,rF=17976931348623157e292,Yb=NaN,nF="[object Arguments]",iF="[object Function]",oF="[object GeneratorFunction]",sF="[object String]",aF="[object Symbol]",uF=/^\s+|\s+$/g,cF=/^[-+]0x[0-9a-f]+$/i,lF=/^0b[01]+$/i,pF=/^0o[0-7]+$/i,dF=/^(?:0|[1-9]\d*)$/,fF=parseInt;function hF(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function mF(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function gF(e,t,r){if(t!==t)return mF(e,yF,r);for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}function yF(e){return e!==e}function vF(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function EF(e,t){return hF(t,function(r){return e[r]})}function _F(e,t){return function(r){return e(t(r))}}var nu=Object.prototype,cd=nu.hasOwnProperty,iu=nu.toString,bF=nu.propertyIsEnumerable,SF=_F(Object.keys,Object),TF=Math.max;function IF(e,t){var r=Xb(e)||CF(e)?vF(e.length,String):[],n=r.length,i=!!n;for(var o in e)(t||cd.call(e,o))&&!(i&&(o=="length"||OF(o,n)))&&r.push(o);return r}function wF(e){if(!AF(e))return SF(e);var t=[];for(var r in Object(e))cd.call(e,r)&&r!="constructor"&&t.push(r);return t}function OF(e,t){return t=t??Jb,!!t&&(typeof e=="number"||dF.test(e))&&e>-1&&e%1==0&&e<t}function AF(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||nu;return e===r}function xF(e,t,r,n){e=ld(e)?e:qF(e),r=r&&!n?jF(r):0;var i=e.length;return r<0&&(r=TF(i+r,0)),DF(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&gF(e,t,r)>-1}function CF(e){return RF(e)&&cd.call(e,"callee")&&(!bF.call(e,"callee")||iu.call(e)==nF)}var Xb=Array.isArray;function ld(e){return e!=null&&PF(e.length)&&!NF(e)}function RF(e){return pd(e)&&ld(e)}function NF(e){var t=ud(e)?iu.call(e):"";return t==iF||t==oF}function PF(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Jb}function ud(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function pd(e){return!!e&&typeof e=="object"}function DF(e){return typeof e=="string"||!Xb(e)&&pd(e)&&iu.call(e)==sF}function LF(e){return typeof e=="symbol"||pd(e)&&iu.call(e)==aF}function kF(e){if(!e)return e===0?e:0;if(e=MF(e),e===zb||e===-zb){var t=e<0?-1:1;return t*rF}return e===e?e:0}function jF(e){var t=kF(e),r=t%1;return t===t?r?t-r:t:0}function MF(e){if(typeof e=="number")return e;if(LF(e))return Yb;if(ud(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ud(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(uF,"");var r=lF.test(e);return r||pF.test(e)?fF(e.slice(2),r?2:8):cF.test(e)?Yb:+e}function FF(e){return ld(e)?IF(e):wF(e)}function qF(e){return e?EF(e,FF(e)):[]}Zb.exports=xF});var rS=y((Dee,tS)=>{p();var UF="[object Boolean]",VF=Object.prototype,GF=VF.toString;function $F(e){return e===!0||e===!1||BF(e)&&GF.call(e)==UF}function BF(e){return!!e&&typeof e=="object"}tS.exports=$F});var aS=y((kee,sS)=>{p();var nS=1/0,KF=17976931348623157e292,iS=NaN,HF="[object Symbol]",QF=/^\s+|\s+$/g,WF=/^[-+]0x[0-9a-f]+$/i,zF=/^0b[01]+$/i,YF=/^0o[0-7]+$/i,JF=parseInt,XF=Object.prototype,ZF=XF.toString;function eq(e){return typeof e=="number"&&e==iq(e)}function oS(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function tq(e){return!!e&&typeof e=="object"}function rq(e){return typeof e=="symbol"||tq(e)&&ZF.call(e)==HF}function nq(e){if(!e)return e===0?e:0;if(e=oq(e),e===nS||e===-nS){var t=e<0?-1:1;return t*KF}return e===e?e:0}function iq(e){var t=nq(e),r=t%1;return t===t?r?t-r:t:0}function oq(e){if(typeof e=="number")return e;if(rq(e))return iS;if(oS(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=oS(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(QF,"");var r=zF.test(e);return r||YF.test(e)?JF(e.slice(2),r?2:8):WF.test(e)?iS:+e}sS.exports=eq});var cS=y((Mee,uS)=>{p();var sq="[object Number]",aq=Object.prototype,uq=aq.toString;function cq(e){return!!e&&typeof e=="object"}function lq(e){return typeof e=="number"||cq(e)&&uq.call(e)==sq}uS.exports=lq});var fS=y((qee,dS)=>{p();var pq="[object Object]";function dq(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}function fq(e,t){return function(r){return e(t(r))}}var hq=Function.prototype,lS=Object.prototype,pS=hq.toString,mq=lS.hasOwnProperty,gq=pS.call(Object),yq=lS.toString,vq=fq(Object.getPrototypeOf,Object);function Eq(e){return!!e&&typeof e=="object"}function _q(e){if(!Eq(e)||yq.call(e)!=pq||dq(e))return!1;var t=vq(e);if(t===null)return!0;var r=mq.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&pS.call(r)==gq}dS.exports=_q});var mS=y((Vee,hS)=>{p();var bq="[object String]",Sq=Object.prototype,Tq=Sq.toString,Iq=Array.isArray;function wq(e){return!!e&&typeof e=="object"}function Oq(e){return typeof e=="string"||!Iq(e)&&wq(e)&&Tq.call(e)==bq}hS.exports=Oq});var _S=y(($ee,ES)=>{p();var Aq="Expected a function",gS=1/0,xq=17976931348623157e292,yS=NaN,Cq="[object Symbol]",Rq=/^\s+|\s+$/g,Nq=/^[-+]0x[0-9a-f]+$/i,Pq=/^0b[01]+$/i,Dq=/^0o[0-7]+$/i,Lq=parseInt,kq=Object.prototype,jq=kq.toString;function Mq(e,t){var r;if(typeof t!="function")throw new TypeError(Aq);return e=Gq(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}function Fq(e){return Mq(2,e)}function vS(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function qq(e){return!!e&&typeof e=="object"}function Uq(e){return typeof e=="symbol"||qq(e)&&jq.call(e)==Cq}function Vq(e){if(!e)return e===0?e:0;if(e=$q(e),e===gS||e===-gS){var t=e<0?-1:1;return t*xq}return e===e?e:0}function Gq(e){var t=Vq(e),r=t%1;return t===t?r?t-r:t:0}function $q(e){if(typeof e=="number")return e;if(Uq(e))return yS;if(vS(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=vS(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Rq,"");var r=Pq.test(e);return r||Dq.test(e)?Lq(e.slice(2),r?2:8):Nq.test(e)?yS:+e}ES.exports=Fq});var CS=y((Kee,xS)=>{p();var bS=Mp(),Bq=od(),Kq=id(),SS=qa(),Hq=eS(),ou=rS(),TS=aS(),dd=cS(),wS=fS(),$r=mS(),Qq=_S(),{KeyObject:Wq,createSecretKey:zq,createPrivateKey:Yq}=M("crypto"),OS=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];Bq&&OS.splice(3,0,"PS256","PS384","PS512");var Jq={expiresIn:{isValid:function(e){return TS(e)||$r(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return TS(e)||$r(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return $r(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:Hq.bind(null,OS),message:'"algorithm" must be a valid string enum value'},header:{isValid:wS,message:'"header" must be an object'},encoding:{isValid:$r,message:'"encoding" must be a string'},issuer:{isValid:$r,message:'"issuer" must be a string'},subject:{isValid:$r,message:'"subject" must be a string'},jwtid:{isValid:$r,message:'"jwtid" must be a string'},noTimestamp:{isValid:ou,message:'"noTimestamp" must be a boolean'},keyid:{isValid:$r,message:'"keyid" must be a string'},mutatePayload:{isValid:ou,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:ou,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:ou,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},Xq={iat:{isValid:dd,message:'"iat" should be a number of seconds'},exp:{isValid:dd,message:'"exp" should be a number of seconds'},nbf:{isValid:dd,message:'"nbf" should be a number of seconds'}};function AS(e,t,r,n){if(!wS(r))throw new Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(i){let o=e[i];if(!o){if(!t)throw new Error('"'+i+'" is not allowed in "'+n+'"');return}if(!o.isValid(r[i]))throw new Error(o.message)})}function Zq(e){return AS(Jq,!1,e,"options")}function eU(e){return AS(Xq,!0,e,"payload")}var IS={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},tU=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];xS.exports=function(e,t,r,n){typeof r=="function"?(n=r,r={}):r=r||{};let i=typeof e=="object"&&!Buffer.isBuffer(e),o=Object.assign({alg:r.algorithm||"HS256",typ:i?"JWT":void 0,kid:r.keyid},r.header);function s(c){if(n)return n(c);throw c}if(!t&&r.algorithm!=="none")return s(new Error("secretOrPrivateKey must have a value"));if(t!=null&&!(t instanceof Wq))try{t=Yq(t)}catch{try{t=zq(typeof t=="string"?Buffer.from(t):t)}catch{return s(new Error("secretOrPrivateKey is not valid key material"))}}if(o.alg.startsWith("HS")&&t.type!=="secret")return s(new Error(`secretOrPrivateKey must be a symmetric key when using ${o.alg}`));if(/^(?:RS|PS|ES)/.test(o.alg)){if(t.type!=="private")return s(new Error(`secretOrPrivateKey must be an asymmetric key when using ${o.alg}`));if(!r.allowInsecureKeySizes&&!o.alg.startsWith("ES")&&t.asymmetricKeyDetails!==void 0&&t.asymmetricKeyDetails.modulusLength<2048)return s(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`))}if(typeof e>"u")return s(new Error("payload is required"));if(i){try{eU(e)}catch(c){return s(c)}r.mutatePayload||(e=Object.assign({},e))}else{let c=tU.filter(function(l){return typeof r[l]<"u"});if(c.length>0)return s(new Error("invalid "+c.join(",")+" option for "+typeof e+" payload"))}if(typeof e.exp<"u"&&typeof r.expiresIn<"u")return s(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof e.nbf<"u"&&typeof r.notBefore<"u")return s(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{Zq(r)}catch(c){return s(c)}if(!r.allowInvalidAsymmetricKeyTypes)try{Kq(o.alg,t)}catch(c){return s(c)}let a=e.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete e.iat:i&&(e.iat=a),typeof r.notBefore<"u"){try{e.nbf=bS(r.notBefore,a)}catch(c){return s(c)}if(typeof e.nbf>"u")return s(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof r.expiresIn<"u"&&typeof e=="object"){try{e.exp=bS(r.expiresIn,a)}catch(c){return s(c)}if(typeof e.exp>"u")return s(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(IS).forEach(function(c){let l=IS[c];if(typeof r[c]<"u"){if(typeof e[l]<"u")return s(new Error('Bad "options.'+c+'" option. The payload already has an "'+l+'" property.'));e[l]=r[c]}});let u=r.encoding||"utf8";if(typeof n=="function")n=n&&Qq(n),SS.createSign({header:o,privateKey:t,payload:e,encoding:u}).once("error",n).once("done",function(c){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(o.alg)&&c.length<256)return n(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`));n(null,c)});else{let c=SS.sign({header:o,payload:e,secret:t,encoding:u});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(o.alg)&&c.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`);return c}}});var Vo=y((Qee,RS)=>{p();RS.exports={decode:Lp(),verify:Wb(),sign:CS(),JsonWebTokenError:ko(),NotBeforeError:kp(),TokenExpiredError:jp()}});var jS=y(Ei=>{"use strict";p();Object.defineProperty(Ei,"__esModule",{value:!0});Ei.versionInfo=Ei.version=void 0;var sU="15.10.2";Ei.version=sU;var aU=Object.freeze({major:15,minor:10,patch:2,preReleaseTag:null});Ei.versionInfo=aU});var uu=y(md=>{"use strict";p();Object.defineProperty(md,"__esModule",{value:!0});md.default=uU;function uU(e){return typeof e?.then=="function"}});var Mt=y(gd=>{"use strict";p();Object.defineProperty(gd,"__esModule",{value:!0});gd.default=cU;function cU(e,t){var r=!!e;if(!r)throw new Error(t)}});var ar=y(yd=>{"use strict";p();Object.defineProperty(yd,"__esModule",{value:!0});yd.default=lU;function cu(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?cu=function(r){return typeof r}:cu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},cu(e)}function lU(e){return cu(e)=="object"&&e!==null}});var ur=y(Kr=>{"use strict";p();Object.defineProperty(Kr,"__esModule",{value:!0});Kr.SYMBOL_TO_STRING_TAG=Kr.SYMBOL_ASYNC_ITERATOR=Kr.SYMBOL_ITERATOR=void 0;var pU=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator";Kr.SYMBOL_ITERATOR=pU;var dU=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator";Kr.SYMBOL_ASYNC_ITERATOR=dU;var fU=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";Kr.SYMBOL_TO_STRING_TAG=fU});var lu=y(vd=>{"use strict";p();Object.defineProperty(vd,"__esModule",{value:!0});vd.getLocation=hU;function hU(e,t){for(var r=/\r\n|[\n\r]/g,n=1,i=t+1,o;(o=r.exec(e.body))&&o.index<t;)n+=1,i=t+1-(o.index+o[0].length);return{line:n,column:i}}});var Ed=y(du=>{"use strict";p();Object.defineProperty(du,"__esModule",{value:!0});du.printLocation=gU;du.printSourceLocation=FS;var mU=lu();function gU(e){return FS(e.source,(0,mU.getLocation)(e.source,e.start))}function FS(e,t){var r=e.locationOffset.column-1,n=pu(r)+e.body,i=t.line-1,o=e.locationOffset.line-1,s=t.line+o,a=t.line===1?r:0,u=t.column+a,c="".concat(e.name,":").concat(s,":").concat(u,`
|
|
31
|
-
`),l=n.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){for(var f=Math.floor(u/80),h=u%80,g=[],v=0;v<d.length;v+=80)g.push(d.slice(v,v+80));return c+
|
|
32
|
-
`)}function pu(e){return Array(e+1).join(" ")}function
|
|
30
|
+
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Lo="secret must be a string or buffer",pi="key must be a string or a buffer",oL="key must be a string, a buffer or an object",Cp=typeof Lt.createPublicKey=="function";Cp&&(pi+=" or a KeyObject",Lo+="or a KeyObject");function yE(e){if(!di.isBuffer(e)&&typeof e!="string"&&(!Cp||typeof e!="object"||typeof e.type!="string"||typeof e.asymmetricKeyType!="string"||typeof e.export!="function"))throw Qt(pi)}function vE(e){if(!di.isBuffer(e)&&typeof e!="string"&&typeof e!="object")throw Qt(oL)}function sL(e){if(!di.isBuffer(e)){if(typeof e=="string")return e;if(!Cp||typeof e!="object"||e.type!=="secret"||typeof e.export!="function")throw Qt(Lo)}}function Rp(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function EE(e){e=e.toString();var t=4-e.length%4;if(t!==4)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function Qt(e){var t=[].slice.call(arguments,1),r=mE.format.bind(mE,e).apply(null,t);return new TypeError(r)}function aL(e){return di.isBuffer(e)||typeof e=="string"}function ko(e){return aL(e)||(e=JSON.stringify(e)),e}function _E(e){return function(r,n){sL(n),r=ko(r);var i=Lt.createHmac("sha"+e,n),o=(i.update(r),i.digest("base64"));return Rp(o)}}var xp,uL="timingSafeEqual"in Lt?function(t,r){return t.byteLength!==r.byteLength?!1:Lt.timingSafeEqual(t,r)}:function(t,r){return xp||(xp=hE()),xp(t,r)};function cL(e){return function(r,n,i){var o=_E(e)(r,i);return uL(di.from(n),di.from(o))}}function SE(e){return function(r,n){vE(n),r=ko(r);var i=Lt.createSign("RSA-SHA"+e),o=(i.update(r),i.sign(n,"base64"));return Rp(o)}}function bE(e){return function(r,n,i){yE(i),r=ko(r),n=EE(n);var o=Lt.createVerify("RSA-SHA"+e);return o.update(r),o.verify(i,n,"base64")}}function lL(e){return function(r,n){vE(n),r=ko(r);var i=Lt.createSign("RSA-SHA"+e),o=(i.update(r),i.sign({key:n,padding:Lt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Lt.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Rp(o)}}function pL(e){return function(r,n,i){yE(i),r=ko(r),n=EE(n);var o=Lt.createVerify("RSA-SHA"+e);return o.update(r),o.verify({key:i,padding:Lt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Lt.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function dL(e){var t=SE(e);return function(){var n=t.apply(null,arguments);return n=gE.derToJose(n,"ES"+e),n}}function fL(e){var t=bE(e);return function(n,i,o){i=gE.joseToDer(i,"ES"+e).toString("base64");var s=t(n,i,o);return s}}function hL(){return function(){return""}}function mL(){return function(t,r){return r===""}}TE.exports=function(t){var r={hs:_E,rs:SE,ps:lL,es:dL,none:hL},n={hs:cL,rs:bE,ps:pL,es:fL,none:mL},i=t.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Qt(iL,t);var o=(i[1]||i[3]).toLowerCase(),s=i[2];return{sign:r[o](s),verify:n[o](s)}}});var Pp=y((b9,IE)=>{p();var gL=M("buffer").Buffer;IE.exports=function(t){return typeof t=="string"?t:typeof t=="number"||gL.isBuffer(t)?t.toString():JSON.stringify(t)}});var RE=y((I9,CE)=>{p();var yL=li().Buffer,wE=wp(),vL=Np(),EL=M("stream"),OE=Pp(),Dp=M("util");function AE(e,t){return yL.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function _L(e,t,r){r=r||"utf8";var n=AE(OE(e),"binary"),i=AE(OE(t),r);return Dp.format("%s.%s",n,i)}function xE(e){var t=e.header,r=e.payload,n=e.secret||e.privateKey,i=e.encoding,o=vL(t.alg),s=_L(t,r,i),a=o.sign(s,n);return Dp.format("%s.%s",s,a)}function Ma(e){var t=e.secret;if(t=t??e.privateKey,t=t??e.key,/^hs/i.test(e.header.alg)===!0&&t==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new wE(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new wE(e.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}Dp.inherits(Ma,EL);Ma.prototype.sign=function(){try{var t=xE({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",t),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}};Ma.sign=xE;CE.exports=Ma});var UE=y((O9,qE)=>{p();var PE=li().Buffer,NE=wp(),SL=Np(),bL=M("stream"),DE=Pp(),TL=M("util"),IL=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function wL(e){return Object.prototype.toString.call(e)==="[object Object]"}function OL(e){if(wL(e))return e;try{return JSON.parse(e)}catch{return}}function LE(e){var t=e.split(".",1)[0];return OL(PE.from(t,"base64").toString("binary"))}function AL(e){return e.split(".",2).join(".")}function kE(e){return e.split(".")[2]}function xL(e,t){t=t||"utf8";var r=e.split(".")[1];return PE.from(r,"base64").toString(t)}function jE(e){return IL.test(e)&&!!LE(e)}function ME(e,t,r){if(!t){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}e=DE(e);var i=kE(e),o=AL(e),s=SL(t);return s.verify(o,i,r)}function FE(e,t){if(t=t||{},e=DE(e),!jE(e))return null;var r=LE(e);if(!r)return null;var n=xL(e);return(r.typ==="JWT"||t.json)&&(n=JSON.parse(n,t.encoding)),{header:r,payload:n,signature:kE(e)}}function fi(e){e=e||{};var t=e.secret;if(t=t??e.publicKey,t=t??e.key,/^hs/i.test(e.algorithm)===!0&&t==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new NE(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new NE(e.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}TL.inherits(fi,bL);fi.prototype.verify=function(){try{var t=ME(this.signature.buffer,this.algorithm,this.key.buffer),r=FE(this.signature.buffer,this.encoding);return this.emit("done",t,r),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};fi.decode=FE;fi.isValid=jE;fi.verify=ME;qE.exports=fi});var qa=y(Vr=>{p();var VE=RE(),Fa=UE(),CL=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Vr.ALGORITHMS=CL;Vr.sign=VE.sign;Vr.verify=Fa.verify;Vr.decode=Fa.decode;Vr.isValid=Fa.isValid;Vr.createSign=function(t){return new VE(t)};Vr.createVerify=function(t){return new Fa(t)}});var Lp=y((R9,GE)=>{p();var RL=qa();GE.exports=function(e,t){t=t||{};var r=RL.decode(e,t);if(!r)return null;var n=r.payload;if(typeof n=="string")try{var i=JSON.parse(n);i!==null&&typeof i=="object"&&(n=i)}catch{}return t.complete===!0?{header:r.header,payload:n,signature:r.signature}:n}});var jo=y((P9,$E)=>{p();var Ua=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};Ua.prototype=Object.create(Error.prototype);Ua.prototype.constructor=Ua;$E.exports=Ua});var kp=y((L9,KE)=>{p();var BE=jo(),Va=function(e,t){BE.call(this,e),this.name="NotBeforeError",this.date=t};Va.prototype=Object.create(BE.prototype);Va.prototype.constructor=Va;KE.exports=Va});var jp=y((j9,QE)=>{p();var HE=jo(),Ga=function(e,t){HE.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};Ga.prototype=Object.create(HE.prototype);Ga.prototype.constructor=Ga;QE.exports=Ga});var zE=y((F9,WE)=>{p();var hi=1e3,mi=hi*60,gi=mi*60,wn=gi*24,NL=wn*7,PL=wn*365.25;WE.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return DL(e);if(r==="number"&&isFinite(e))return t.long?kL(e):LL(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function DL(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*PL;case"weeks":case"week":case"w":return r*NL;case"days":case"day":case"d":return r*wn;case"hours":case"hour":case"hrs":case"hr":case"h":return r*gi;case"minutes":case"minute":case"mins":case"min":case"m":return r*mi;case"seconds":case"second":case"secs":case"sec":case"s":return r*hi;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function LL(e){var t=Math.abs(e);return t>=wn?Math.round(e/wn)+"d":t>=gi?Math.round(e/gi)+"h":t>=mi?Math.round(e/mi)+"m":t>=hi?Math.round(e/hi)+"s":e+"ms"}function kL(e){var t=Math.abs(e);return t>=wn?$a(e,t,wn,"day"):t>=gi?$a(e,t,gi,"hour"):t>=mi?$a(e,t,mi,"minute"):t>=hi?$a(e,t,hi,"second"):e+" ms"}function $a(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var Mp=y((U9,YE)=>{p();var jL=zE();YE.exports=function(e,t){var r=t||Math.floor(Date.now()/1e3);if(typeof e=="string"){var n=jL(e);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof e=="number"?r+e:void 0}});var yi=y((G9,JE)=>{"use strict";p();var ML="2.0.0",FL=Number.MAX_SAFE_INTEGER||9007199254740991,qL=16,UL=250,VL=["major","premajor","minor","preminor","patch","prepatch","prerelease"];JE.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:qL,MAX_SAFE_BUILD_LENGTH:UL,MAX_SAFE_INTEGER:FL,RELEASE_TYPES:VL,SEMVER_SPEC_VERSION:ML,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Mo=y((B9,XE)=>{"use strict";p();var GL=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};XE.exports=GL});var vi=y((sr,ZE)=>{"use strict";p();var{MAX_SAFE_COMPONENT_LENGTH:Fp,MAX_SAFE_BUILD_LENGTH:$L,MAX_LENGTH:BL}=yi(),KL=Mo();sr=ZE.exports={};var HL=sr.re=[],QL=sr.safeRe=[],k=sr.src=[],WL=sr.safeSrc=[],j=sr.t={},zL=0,qp="[a-zA-Z0-9-]",YL=[["\\s",1],["\\d",BL],[qp,$L]],JL=e=>{for(let[t,r]of YL)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},z=(e,t,r)=>{let n=JL(t),i=zL++;KL(e,i,t),j[e]=i,k[i]=t,WL[i]=n,HL[i]=new RegExp(t,r?"g":void 0),QL[i]=new RegExp(n,r?"g":void 0)};z("NUMERICIDENTIFIER","0|[1-9]\\d*");z("NUMERICIDENTIFIERLOOSE","\\d+");z("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${qp}*`);z("MAINVERSION",`(${k[j.NUMERICIDENTIFIER]})\\.(${k[j.NUMERICIDENTIFIER]})\\.(${k[j.NUMERICIDENTIFIER]})`);z("MAINVERSIONLOOSE",`(${k[j.NUMERICIDENTIFIERLOOSE]})\\.(${k[j.NUMERICIDENTIFIERLOOSE]})\\.(${k[j.NUMERICIDENTIFIERLOOSE]})`);z("PRERELEASEIDENTIFIER",`(?:${k[j.NONNUMERICIDENTIFIER]}|${k[j.NUMERICIDENTIFIER]})`);z("PRERELEASEIDENTIFIERLOOSE",`(?:${k[j.NONNUMERICIDENTIFIER]}|${k[j.NUMERICIDENTIFIERLOOSE]})`);z("PRERELEASE",`(?:-(${k[j.PRERELEASEIDENTIFIER]}(?:\\.${k[j.PRERELEASEIDENTIFIER]})*))`);z("PRERELEASELOOSE",`(?:-?(${k[j.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${k[j.PRERELEASEIDENTIFIERLOOSE]})*))`);z("BUILDIDENTIFIER",`${qp}+`);z("BUILD",`(?:\\+(${k[j.BUILDIDENTIFIER]}(?:\\.${k[j.BUILDIDENTIFIER]})*))`);z("FULLPLAIN",`v?${k[j.MAINVERSION]}${k[j.PRERELEASE]}?${k[j.BUILD]}?`);z("FULL",`^${k[j.FULLPLAIN]}$`);z("LOOSEPLAIN",`[v=\\s]*${k[j.MAINVERSIONLOOSE]}${k[j.PRERELEASELOOSE]}?${k[j.BUILD]}?`);z("LOOSE",`^${k[j.LOOSEPLAIN]}$`);z("GTLT","((?:<|>)?=?)");z("XRANGEIDENTIFIERLOOSE",`${k[j.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);z("XRANGEIDENTIFIER",`${k[j.NUMERICIDENTIFIER]}|x|X|\\*`);z("XRANGEPLAIN",`[v=\\s]*(${k[j.XRANGEIDENTIFIER]})(?:\\.(${k[j.XRANGEIDENTIFIER]})(?:\\.(${k[j.XRANGEIDENTIFIER]})(?:${k[j.PRERELEASE]})?${k[j.BUILD]}?)?)?`);z("XRANGEPLAINLOOSE",`[v=\\s]*(${k[j.XRANGEIDENTIFIERLOOSE]})(?:\\.(${k[j.XRANGEIDENTIFIERLOOSE]})(?:\\.(${k[j.XRANGEIDENTIFIERLOOSE]})(?:${k[j.PRERELEASELOOSE]})?${k[j.BUILD]}?)?)?`);z("XRANGE",`^${k[j.GTLT]}\\s*${k[j.XRANGEPLAIN]}$`);z("XRANGELOOSE",`^${k[j.GTLT]}\\s*${k[j.XRANGEPLAINLOOSE]}$`);z("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Fp}})(?:\\.(\\d{1,${Fp}}))?(?:\\.(\\d{1,${Fp}}))?`);z("COERCE",`${k[j.COERCEPLAIN]}(?:$|[^\\d])`);z("COERCEFULL",k[j.COERCEPLAIN]+`(?:${k[j.PRERELEASE]})?(?:${k[j.BUILD]})?(?:$|[^\\d])`);z("COERCERTL",k[j.COERCE],!0);z("COERCERTLFULL",k[j.COERCEFULL],!0);z("LONETILDE","(?:~>?)");z("TILDETRIM",`(\\s*)${k[j.LONETILDE]}\\s+`,!0);sr.tildeTrimReplace="$1~";z("TILDE",`^${k[j.LONETILDE]}${k[j.XRANGEPLAIN]}$`);z("TILDELOOSE",`^${k[j.LONETILDE]}${k[j.XRANGEPLAINLOOSE]}$`);z("LONECARET","(?:\\^)");z("CARETTRIM",`(\\s*)${k[j.LONECARET]}\\s+`,!0);sr.caretTrimReplace="$1^";z("CARET",`^${k[j.LONECARET]}${k[j.XRANGEPLAIN]}$`);z("CARETLOOSE",`^${k[j.LONECARET]}${k[j.XRANGEPLAINLOOSE]}$`);z("COMPARATORLOOSE",`^${k[j.GTLT]}\\s*(${k[j.LOOSEPLAIN]})$|^$`);z("COMPARATOR",`^${k[j.GTLT]}\\s*(${k[j.FULLPLAIN]})$|^$`);z("COMPARATORTRIM",`(\\s*)${k[j.GTLT]}\\s*(${k[j.LOOSEPLAIN]}|${k[j.XRANGEPLAIN]})`,!0);sr.comparatorTrimReplace="$1$2$3";z("HYPHENRANGE",`^\\s*(${k[j.XRANGEPLAIN]})\\s+-\\s+(${k[j.XRANGEPLAIN]})\\s*$`);z("HYPHENRANGELOOSE",`^\\s*(${k[j.XRANGEPLAINLOOSE]})\\s+-\\s+(${k[j.XRANGEPLAINLOOSE]})\\s*$`);z("STAR","(<|>)?=?\\s*\\*");z("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");z("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ba=y((Q9,e_)=>{"use strict";p();var XL=Object.freeze({loose:!0}),ZL=Object.freeze({}),ek=e=>e?typeof e!="object"?XL:e:ZL;e_.exports=ek});var Up=y((z9,n_)=>{"use strict";p();var t_=/^[0-9]+$/,r_=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;let r=t_.test(e),n=t_.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},tk=(e,t)=>r_(t,e);n_.exports={compareIdentifiers:r_,rcompareIdentifiers:tk}});var Je=y((J9,o_)=>{"use strict";p();var Ka=Mo(),{MAX_LENGTH:i_,MAX_SAFE_INTEGER:Ha}=yi(),{safeRe:Qa,t:Wa}=vi(),rk=Ba(),{compareIdentifiers:Vp}=Up(),Gp=class e{constructor(t,r){if(r=rk(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>i_)throw new TypeError(`version is longer than ${i_} characters`);Ka("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?Qa[Wa.LOOSE]:Qa[Wa.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ha||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ha||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ha||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<Ha)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Ka("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=t.prerelease[r];if(Ka("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Vp(n,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let n=this.build[r],i=t.build[r];if(Ka("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Vp(n,i)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=`-${r}`.match(this.options.loose?Qa[Wa.PRERELEASELOOSE]:Qa[Wa.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];n===!1&&(o=[r]),Vp(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};o_.exports=Gp});var Gr=y((Z9,a_)=>{"use strict";p();var s_=Je(),nk=(e,t,r=!1)=>{if(e instanceof s_)return e;try{return new s_(e,t)}catch(n){if(!r)return null;throw n}};a_.exports=nk});var c_=y((t7,u_)=>{"use strict";p();var ik=Gr(),ok=(e,t)=>{let r=ik(e,t);return r?r.version:null};u_.exports=ok});var p_=y((n7,l_)=>{"use strict";p();var sk=Gr(),ak=(e,t)=>{let r=sk(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};l_.exports=ak});var h_=y((o7,f_)=>{"use strict";p();var d_=Je(),uk=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new d_(e instanceof d_?e.version:e,r).inc(t,n,i).version}catch{return null}};f_.exports=uk});var y_=y((a7,g_)=>{"use strict";p();var m_=Gr(),ck=(e,t)=>{let r=m_(e,null,!0),n=m_(t,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,u=!!s.prerelease.length;if(!!a.prerelease.length&&!u){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let l=u?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};g_.exports=ck});var E_=y((c7,v_)=>{"use strict";p();var lk=Je(),pk=(e,t)=>new lk(e,t).major;v_.exports=pk});var S_=y((p7,__)=>{"use strict";p();var dk=Je(),fk=(e,t)=>new dk(e,t).minor;__.exports=fk});var T_=y((f7,b_)=>{"use strict";p();var hk=Je(),mk=(e,t)=>new hk(e,t).patch;b_.exports=mk});var w_=y((m7,I_)=>{"use strict";p();var gk=Gr(),yk=(e,t)=>{let r=gk(e,t);return r&&r.prerelease.length?r.prerelease:null};I_.exports=yk});var kt=y((y7,A_)=>{"use strict";p();var O_=Je(),vk=(e,t,r)=>new O_(e,r).compare(new O_(t,r));A_.exports=vk});var C_=y((E7,x_)=>{"use strict";p();var Ek=kt(),_k=(e,t,r)=>Ek(t,e,r);x_.exports=_k});var N_=y((S7,R_)=>{"use strict";p();var Sk=kt(),bk=(e,t)=>Sk(e,t,!0);R_.exports=bk});var za=y((T7,D_)=>{"use strict";p();var P_=Je(),Tk=(e,t,r)=>{let n=new P_(e,r),i=new P_(t,r);return n.compare(i)||n.compareBuild(i)};D_.exports=Tk});var k_=y((w7,L_)=>{"use strict";p();var Ik=za(),wk=(e,t)=>e.sort((r,n)=>Ik(r,n,t));L_.exports=wk});var M_=y((A7,j_)=>{"use strict";p();var Ok=za(),Ak=(e,t)=>e.sort((r,n)=>Ok(n,r,t));j_.exports=Ak});var Fo=y((C7,F_)=>{"use strict";p();var xk=kt(),Ck=(e,t,r)=>xk(e,t,r)>0;F_.exports=Ck});var Ya=y((N7,q_)=>{"use strict";p();var Rk=kt(),Nk=(e,t,r)=>Rk(e,t,r)<0;q_.exports=Nk});var $p=y((D7,U_)=>{"use strict";p();var Pk=kt(),Dk=(e,t,r)=>Pk(e,t,r)===0;U_.exports=Dk});var Bp=y((k7,V_)=>{"use strict";p();var Lk=kt(),kk=(e,t,r)=>Lk(e,t,r)!==0;V_.exports=kk});var Ja=y((M7,G_)=>{"use strict";p();var jk=kt(),Mk=(e,t,r)=>jk(e,t,r)>=0;G_.exports=Mk});var Xa=y((q7,$_)=>{"use strict";p();var Fk=kt(),qk=(e,t,r)=>Fk(e,t,r)<=0;$_.exports=qk});var Kp=y((V7,B_)=>{"use strict";p();var Uk=$p(),Vk=Bp(),Gk=Fo(),$k=Ja(),Bk=Ya(),Kk=Xa(),Hk=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return Uk(e,r,n);case"!=":return Vk(e,r,n);case">":return Gk(e,r,n);case">=":return $k(e,r,n);case"<":return Bk(e,r,n);case"<=":return Kk(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};B_.exports=Hk});var H_=y(($7,K_)=>{"use strict";p();var Qk=Je(),Wk=Gr(),{safeRe:Za,t:eu}=vi(),zk=(e,t)=>{if(e instanceof Qk)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Za[eu.COERCEFULL]:Za[eu.COERCE]);else{let u=t.includePrerelease?Za[eu.COERCERTLFULL]:Za[eu.COERCERTL],c;for(;(c=u.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||c.index+c[0].length!==r.index+r[0].length)&&(r=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Wk(`${n}.${i}.${o}${s}${a}`,t)};K_.exports=zk});var W_=y((K7,Q_)=>{"use strict";p();var Yk=Gr(),Jk=yi(),Xk=Je(),Zk=(e,t,r)=>{if(!Jk.RELEASE_TYPES.includes(t))return null;let n=ej(e,r);return n&&tj(n,t)},ej=(e,t)=>{let r=e instanceof Xk?e.version:e;return Yk(r,t)},tj=(e,t)=>{if(rj(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},rj=e=>e.startsWith("pre");Q_.exports=Zk});var Y_=y((Q7,z_)=>{"use strict";p();var Hp=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(t,r)}return this}};z_.exports=Hp});var jt=y((z7,eS)=>{"use strict";p();var nj=/\s+/g,Qp=class e{constructor(t,r){if(r=oj(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof Wp)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(nj," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!X_(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&hj(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let r=this.set[t];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(fj,"");let n=((this.options.includePrerelease&&pj)|(this.options.loose&&dj))+":"+t,i=J_.get(n);if(i)return i;let o=this.options.loose,s=o?ut[Xe.HYPHENRANGELOOSE]:ut[Xe.HYPHENRANGE];t=t.replace(s,Ij(this.options.includePrerelease)),Ie("hyphen replace",t),t=t.replace(ut[Xe.COMPARATORTRIM],uj),Ie("comparator trim",t),t=t.replace(ut[Xe.TILDETRIM],cj),Ie("tilde trim",t),t=t.replace(ut[Xe.CARETTRIM],lj),Ie("caret trim",t);let a=t.split(" ").map(d=>mj(d,this.options)).join(" ").split(/\s+/).map(d=>Tj(d,this.options));o&&(a=a.filter(d=>(Ie("loose invalid filter",d,this.options),!!d.match(ut[Xe.COMPARATORLOOSE])))),Ie("range list",a);let u=new Map,c=a.map(d=>new Wp(d,this.options));for(let d of c){if(X_(d))return[d];u.set(d.value,d)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return J_.set(n,l),l}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(n=>Z_(n,r)&&t.set.some(i=>Z_(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new sj(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(wj(this.set[r],t,this.options))return!0;return!1}};eS.exports=Qp;var ij=Y_(),J_=new ij,oj=Ba(),Wp=qo(),Ie=Mo(),sj=Je(),{safeRe:ut,src:aj,t:Xe,comparatorTrimReplace:uj,tildeTrimReplace:cj,caretTrimReplace:lj}=vi(),{FLAG_INCLUDE_PRERELEASE:pj,FLAG_LOOSE:dj}=yi(),fj=new RegExp(aj[Xe.BUILD],"g"),X_=e=>e.value==="<0.0.0-0",hj=e=>e.value==="",Z_=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,t)),i=n.pop();return r},mj=(e,t)=>(e=e.replace(ut[Xe.BUILD],""),Ie("comp",e,t),e=vj(e,t),Ie("caret",e),e=gj(e,t),Ie("tildes",e),e=_j(e,t),Ie("xrange",e),e=bj(e,t),Ie("stars",e),e),ct=e=>!e||e.toLowerCase()==="x"||e==="*",gj=(e,t)=>e.trim().split(/\s+/).map(r=>yj(r,t)).join(" "),yj=(e,t)=>{let r=t.loose?ut[Xe.TILDELOOSE]:ut[Xe.TILDE];return e.replace(r,(n,i,o,s,a)=>{Ie("tilde",e,n,i,o,s,a);let u;return ct(i)?u="":ct(o)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:ct(s)?u=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?(Ie("replaceTilde pr",a),u=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):u=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,Ie("tilde return",u),u})},vj=(e,t)=>e.trim().split(/\s+/).map(r=>Ej(r,t)).join(" "),Ej=(e,t)=>{Ie("caret",e,t);let r=t.loose?ut[Xe.CARETLOOSE]:ut[Xe.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,u)=>{Ie("caret",e,i,o,s,a,u);let c;return ct(o)?c="":ct(s)?c=`>=${o}.0.0${n} <${+o+1}.0.0-0`:ct(a)?o==="0"?c=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:u?(Ie("replaceCaret pr",u),o==="0"?s==="0"?c=`>=${o}.${s}.${a}-${u} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}-${u} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a}-${u} <${+o+1}.0.0-0`):(Ie("no pr"),o==="0"?s==="0"?c=`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),Ie("caret return",c),c})},_j=(e,t)=>(Ie("replaceXRanges",e,t),e.split(/\s+/).map(r=>Sj(r,t)).join(" ")),Sj=(e,t)=>{e=e.trim();let r=t.loose?ut[Xe.XRANGELOOSE]:ut[Xe.XRANGE];return e.replace(r,(n,i,o,s,a,u)=>{Ie("xRange",e,n,i,o,s,a,u);let c=ct(o),l=c||ct(s),d=l||ct(a),f=d;return i==="="&&f&&(i=""),u=t.includePrerelease?"-0":"",c?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&f?(l&&(s=0),a=0,i===">"?(i=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",l?o=+o+1:s=+s+1),i==="<"&&(u="-0"),n=`${i+o}.${s}.${a}${u}`):l?n=`>=${o}.0.0${u} <${+o+1}.0.0-0`:d&&(n=`>=${o}.${s}.0${u} <${o}.${+s+1}.0-0`),Ie("xRange return",n),n})},bj=(e,t)=>(Ie("replaceStars",e,t),e.trim().replace(ut[Xe.STAR],"")),Tj=(e,t)=>(Ie("replaceGTE0",e,t),e.trim().replace(ut[t.includePrerelease?Xe.GTE0PRE:Xe.GTE0],"")),Ij=e=>(t,r,n,i,o,s,a,u,c,l,d,f)=>(ct(n)?r="":ct(i)?r=`>=${n}.0.0${e?"-0":""}`:ct(o)?r=`>=${n}.${i}.0${e?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,ct(c)?u="":ct(l)?u=`<${+c+1}.0.0-0`:ct(d)?u=`<${c}.${+l+1}.0-0`:f?u=`<=${c}.${l}.${d}-${f}`:e?u=`<${c}.${l}.${+d+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),wj=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++)if(Ie(e[n].semver),e[n].semver!==Wp.ANY&&e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}});var qo=y((J7,sS)=>{"use strict";p();var Uo=Symbol("SemVer ANY"),Jp=class e{static get ANY(){return Uo}constructor(t,r){if(r=tS(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),Yp("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===Uo?this.value="":this.value=this.operator+this.semver.version,Yp("comp",this)}parse(t){let r=this.options.loose?rS[nS.COMPARATORLOOSE]:rS[nS.COMPARATOR],n=t.match(r);if(!n)throw new TypeError(`Invalid comparator: ${t}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new iS(n[2],this.options.loose):this.semver=Uo}toString(){return this.value}test(t){if(Yp("Comparator.test",t,this.options.loose),this.semver===Uo||t===Uo)return!0;if(typeof t=="string")try{t=new iS(t,this.options)}catch{return!1}return zp(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new oS(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new oS(this.value,r).test(t.semver):(r=tS(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||zp(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||zp(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};sS.exports=Jp;var tS=Ba(),{safeRe:rS,t:nS}=vi(),zp=Kp(),Yp=Mo(),iS=Je(),oS=jt()});var Vo=y((Z7,aS)=>{"use strict";p();var Oj=jt(),Aj=(e,t,r)=>{try{t=new Oj(t,r)}catch{return!1}return t.test(e)};aS.exports=Aj});var cS=y((tee,uS)=>{"use strict";p();var xj=jt(),Cj=(e,t)=>new xj(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));uS.exports=Cj});var pS=y((nee,lS)=>{"use strict";p();var Rj=Je(),Nj=jt(),Pj=(e,t,r)=>{let n=null,i=null,o=null;try{o=new Nj(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new Rj(n,r))}),n};lS.exports=Pj});var fS=y((oee,dS)=>{"use strict";p();var Dj=Je(),Lj=jt(),kj=(e,t,r)=>{let n=null,i=null,o=null;try{o=new Lj(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new Dj(n,r))}),n};dS.exports=kj});var gS=y((aee,mS)=>{"use strict";p();var Xp=Je(),jj=jt(),hS=Fo(),Mj=(e,t)=>{e=new jj(e,t);let r=new Xp("0.0.0");if(e.test(r)||(r=new Xp("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],o=null;i.forEach(s=>{let a=new Xp(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||hS(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||hS(r,o))&&(r=o)}return r&&e.test(r)?r:null};mS.exports=Mj});var vS=y((cee,yS)=>{"use strict";p();var Fj=jt(),qj=(e,t)=>{try{return new Fj(e,t).range||"*"}catch{return null}};yS.exports=qj});var tu=y((pee,bS)=>{"use strict";p();var Uj=Je(),SS=qo(),{ANY:Vj}=SS,Gj=jt(),$j=Vo(),ES=Fo(),_S=Ya(),Bj=Xa(),Kj=Ja(),Hj=(e,t,r,n)=>{e=new Uj(e,n),t=new Gj(t,n);let i,o,s,a,u;switch(r){case">":i=ES,o=Bj,s=_S,a=">",u=">=";break;case"<":i=_S,o=Kj,s=ES,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if($j(e,t,n))return!1;for(let c=0;c<t.set.length;++c){let l=t.set[c],d=null,f=null;if(l.forEach(h=>{h.semver===Vj&&(h=new SS(">=0.0.0")),d=d||h,f=f||h,i(h.semver,d.semver,n)?d=h:s(h.semver,f.semver,n)&&(f=h)}),d.operator===a||d.operator===u||(!f.operator||f.operator===a)&&o(e,f.semver))return!1;if(f.operator===u&&s(e,f.semver))return!1}return!0};bS.exports=Hj});var IS=y((fee,TS)=>{"use strict";p();var Qj=tu(),Wj=(e,t,r)=>Qj(e,t,">",r);TS.exports=Wj});var OS=y((mee,wS)=>{"use strict";p();var zj=tu(),Yj=(e,t,r)=>zj(e,t,"<",r);wS.exports=Yj});var CS=y((yee,xS)=>{"use strict";p();var AS=jt(),Jj=(e,t,r)=>(e=new AS(e,r),t=new AS(t,r),e.intersects(t,r));xS.exports=Jj});var NS=y((Eee,RS)=>{"use strict";p();var Xj=Vo(),Zj=kt();RS.exports=(e,t,r)=>{let n=[],i=null,o=null,s=e.sort((l,d)=>Zj(l,d,r));for(let l of s)Xj(l,t,r)?(o=l,i||(i=l)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[l,d]of n)l===d?a.push(l):!d&&l===s[0]?a.push("*"):d?l===s[0]?a.push(`<=${d}`):a.push(`${l} - ${d}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof t.raw=="string"?t.raw:String(t);return u.length<c.length?u:t}});var MS=y((See,jS)=>{"use strict";p();var PS=jt(),td=qo(),{ANY:Zp}=td,ed=Vo(),rd=kt(),eM=(e,t,r={})=>{if(e===t)return!0;e=new PS(e,r),t=new PS(t,r);let n=!1;e:for(let i of e.set){for(let o of t.set){let s=rM(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},tM=[new td(">=0.0.0-0")],DS=[new td(">=0.0.0")],rM=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Zp){if(t.length===1&&t[0].semver===Zp)return!0;r.includePrerelease?e=tM:e=DS}if(t.length===1&&t[0].semver===Zp){if(r.includePrerelease)return!0;t=DS}let n=new Set,i,o;for(let h of e)h.operator===">"||h.operator===">="?i=LS(i,h,r):h.operator==="<"||h.operator==="<="?o=kS(o,h,r):n.add(h.semver);if(n.size>1)return null;let s;if(i&&o){if(s=rd(i.semver,o.semver,r),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let h of n){if(i&&!ed(h,String(i),r)||o&&!ed(h,String(o),r))return null;for(let g of t)if(!ed(h,String(g),r))return!1;return!0}let a,u,c,l,d=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,f=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&o.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let h of t){if(l=l||h.operator===">"||h.operator===">=",c=c||h.operator==="<"||h.operator==="<=",i){if(f&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch&&(f=!1),h.operator===">"||h.operator===">="){if(a=LS(i,h,r),a===h&&a!==i)return!1}else if(i.operator===">="&&!h.test(i.semver))return!1}if(o){if(d&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===d.major&&h.semver.minor===d.minor&&h.semver.patch===d.patch&&(d=!1),h.operator==="<"||h.operator==="<="){if(u=kS(o,h,r),u===h&&u!==o)return!1}else if(o.operator==="<="&&!h.test(o.semver))return!1}if(!h.operator&&(o||i)&&s!==0)return!1}return!(i&&c&&!o&&s!==0||o&&l&&!i&&s!==0||f||d)},LS=(e,t,r)=>{if(!e)return t;let n=rd(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},kS=(e,t,r)=>{if(!e)return t;let n=rd(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};jS.exports=eM});var ru=y((Tee,US)=>{"use strict";p();var nd=vi(),FS=yi(),nM=Je(),qS=Up(),iM=Gr(),oM=c_(),sM=p_(),aM=h_(),uM=y_(),cM=E_(),lM=S_(),pM=T_(),dM=w_(),fM=kt(),hM=C_(),mM=N_(),gM=za(),yM=k_(),vM=M_(),EM=Fo(),_M=Ya(),SM=$p(),bM=Bp(),TM=Ja(),IM=Xa(),wM=Kp(),OM=H_(),AM=W_(),xM=qo(),CM=jt(),RM=Vo(),NM=cS(),PM=pS(),DM=fS(),LM=gS(),kM=vS(),jM=tu(),MM=IS(),FM=OS(),qM=CS(),UM=NS(),VM=MS();US.exports={parse:iM,valid:oM,clean:sM,inc:aM,diff:uM,major:cM,minor:lM,patch:pM,prerelease:dM,compare:fM,rcompare:hM,compareLoose:mM,compareBuild:gM,sort:yM,rsort:vM,gt:EM,lt:_M,eq:SM,neq:bM,gte:TM,lte:IM,cmp:wM,coerce:OM,truncate:AM,Comparator:xM,Range:CM,satisfies:RM,toComparators:NM,maxSatisfying:PM,minSatisfying:DM,minVersion:LM,validRange:kM,outside:jM,gtr:MM,ltr:FM,intersects:qM,simplifyRange:UM,subset:VM,SemVer:nM,re:nd.re,src:nd.src,tokens:nd.t,SEMVER_SPEC_VERSION:FS.SEMVER_SPEC_VERSION,RELEASE_TYPES:FS.RELEASE_TYPES,compareIdentifiers:qS.compareIdentifiers,rcompareIdentifiers:qS.rcompareIdentifiers}});var GS=y((wee,VS)=>{p();var GM=ru();VS.exports=GM.satisfies(process.version,">=15.7.0")});var BS=y((Aee,$S)=>{p();var $M=ru();$S.exports=$M.satisfies(process.version,">=16.9.0")});var id=y((Cee,KS)=>{p();var BM=GS(),KM=BS(),HM={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},QM={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};KS.exports=function(e,t){if(!e||!t)return;let r=t.asymmetricKeyType;if(!r)return;let n=HM[r];if(!n)throw new Error(`Unknown key type "${r}".`);if(!n.includes(e))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(BM)switch(r){case"ec":let i=t.asymmetricKeyDetails.namedCurve,o=QM[e];if(i!==o)throw new Error(`"alg" parameter "${e}" requires curve "${o}".`);break;case"rsa-pss":if(KM){let s=parseInt(e.slice(-3),10),{hashAlgorithm:a,mgf1HashAlgorithm:u,saltLength:c}=t.asymmetricKeyDetails;if(a!==`sha${s}`||u!==a)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(c!==void 0&&c>s>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}break}}});var od=y((Nee,HS)=>{p();var WM=ru();HS.exports=WM.satisfies(process.version,"^6.12.0 || >=8.0.0")});var zS=y((Dee,WS)=>{p();var Te=jo(),zM=kp(),QS=jp(),YM=Lp(),JM=Mp(),XM=id(),ZM=od(),eF=qa(),{KeyObject:tF,createSecretKey:rF,createPublicKey:nF}=M("crypto"),sd=["RS256","RS384","RS512"],iF=["ES256","ES384","ES512"],ad=["RS256","RS384","RS512"],oF=["HS256","HS384","HS512"];ZM&&(sd.splice(sd.length,0,"PS256","PS384","PS512"),ad.splice(ad.length,0,"PS256","PS384","PS512"));WS.exports=function(e,t,r,n){typeof r=="function"&&!n&&(n=r,r={}),r||(r={}),r=Object.assign({},r);let i;if(n?i=n:i=function(l,d){if(l)throw l;return d},r.clockTimestamp&&typeof r.clockTimestamp!="number")return i(new Te("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return i(new Te("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return i(new Te("allowInvalidAsymmetricKeyTypes must be a boolean"));let o=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return i(new Te("jwt must be provided"));if(typeof e!="string")return i(new Te("jwt must be a string"));let s=e.split(".");if(s.length!==3)return i(new Te("jwt malformed"));let a;try{a=YM(e,{complete:!0})}catch(l){return i(l)}if(!a)return i(new Te("invalid token"));let u=a.header,c;if(typeof t=="function"){if(!n)return i(new Te("verify must be called asynchronous if secret or public key is provided as a callback"));c=t}else c=function(l,d){return d(null,t)};return c(u,function(l,d){if(l)return i(new Te("error in secret or public key callback: "+l.message));let f=s[2].trim()!=="";if(!f&&d)return i(new Te("jwt signature is required"));if(f&&!d)return i(new Te("secret or public key must be provided"));if(!f&&!r.algorithms)return i(new Te('please specify "none" in "algorithms" to verify unsigned tokens'));if(d!=null&&!(d instanceof tF))try{d=nF(d)}catch{try{d=rF(typeof d=="string"?Buffer.from(d):d)}catch{return i(new Te("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(d.type==="secret"?r.algorithms=oF:["rsa","rsa-pss"].includes(d.asymmetricKeyType)?r.algorithms=ad:d.asymmetricKeyType==="ec"?r.algorithms=iF:r.algorithms=sd),r.algorithms.indexOf(a.header.alg)===-1)return i(new Te("invalid algorithm"));if(u.alg.startsWith("HS")&&d.type!=="secret")return i(new Te(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)&&d.type!=="public")return i(new Te(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{XM(u.alg,d)}catch(v){return i(v)}let h;try{h=eF.verify(e,a.header.alg,d)}catch(v){return i(v)}if(!h)return i(new Te("invalid signature"));let g=a.payload;if(typeof g.nbf<"u"&&!r.ignoreNotBefore){if(typeof g.nbf!="number")return i(new Te("invalid nbf value"));if(g.nbf>o+(r.clockTolerance||0))return i(new zM("jwt not active",new Date(g.nbf*1e3)))}if(typeof g.exp<"u"&&!r.ignoreExpiration){if(typeof g.exp!="number")return i(new Te("invalid exp value"));if(o>=g.exp+(r.clockTolerance||0))return i(new QS("jwt expired",new Date(g.exp*1e3)))}if(r.audience){let v=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(g.aud)?g.aud:[g.aud]).some(function(S){return v.some(function(I){return I instanceof RegExp?I.test(S):I===S})}))return i(new Te("jwt audience invalid. expected: "+v.join(" or ")))}if(r.issuer&&(typeof r.issuer=="string"&&g.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(g.iss)===-1))return i(new Te("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&g.sub!==r.subject)return i(new Te("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&g.jti!==r.jwtid)return i(new Te("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&g.nonce!==r.nonce)return i(new Te("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof g.iat!="number")return i(new Te("iat required when maxAge is specified"));let v=JM(r.maxAge,g.iat);if(typeof v>"u")return i(new Te('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(o>=v+(r.clockTolerance||0))return i(new QS("maxAge exceeded",new Date(v*1e3)))}if(r.complete===!0){let v=a.signature;return i(null,{header:u,payload:g,signature:v})}return i(null,g)})}});var tb=y((kee,eb)=>{p();var YS=1/0,XS=9007199254740991,sF=17976931348623157e292,JS=NaN,aF="[object Arguments]",uF="[object Function]",cF="[object GeneratorFunction]",lF="[object String]",pF="[object Symbol]",dF=/^\s+|\s+$/g,fF=/^[-+]0x[0-9a-f]+$/i,hF=/^0b[01]+$/i,mF=/^0o[0-7]+$/i,gF=/^(?:0|[1-9]\d*)$/,yF=parseInt;function vF(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function EF(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function _F(e,t,r){if(t!==t)return EF(e,SF,r);for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}function SF(e){return e!==e}function bF(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function TF(e,t){return vF(t,function(r){return e[r]})}function IF(e,t){return function(r){return e(t(r))}}var nu=Object.prototype,cd=nu.hasOwnProperty,iu=nu.toString,wF=nu.propertyIsEnumerable,OF=IF(Object.keys,Object),AF=Math.max;function xF(e,t){var r=ZS(e)||DF(e)?bF(e.length,String):[],n=r.length,i=!!n;for(var o in e)(t||cd.call(e,o))&&!(i&&(o=="length"||RF(o,n)))&&r.push(o);return r}function CF(e){if(!NF(e))return OF(e);var t=[];for(var r in Object(e))cd.call(e,r)&&r!="constructor"&&t.push(r);return t}function RF(e,t){return t=t??XS,!!t&&(typeof e=="number"||gF.test(e))&&e>-1&&e%1==0&&e<t}function NF(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||nu;return e===r}function PF(e,t,r,n){e=ld(e)?e:$F(e),r=r&&!n?UF(r):0;var i=e.length;return r<0&&(r=AF(i+r,0)),MF(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&_F(e,t,r)>-1}function DF(e){return LF(e)&&cd.call(e,"callee")&&(!wF.call(e,"callee")||iu.call(e)==aF)}var ZS=Array.isArray;function ld(e){return e!=null&&jF(e.length)&&!kF(e)}function LF(e){return pd(e)&&ld(e)}function kF(e){var t=ud(e)?iu.call(e):"";return t==uF||t==cF}function jF(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=XS}function ud(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function pd(e){return!!e&&typeof e=="object"}function MF(e){return typeof e=="string"||!ZS(e)&&pd(e)&&iu.call(e)==lF}function FF(e){return typeof e=="symbol"||pd(e)&&iu.call(e)==pF}function qF(e){if(!e)return e===0?e:0;if(e=VF(e),e===YS||e===-YS){var t=e<0?-1:1;return t*sF}return e===e?e:0}function UF(e){var t=qF(e),r=t%1;return t===t?r?t-r:t:0}function VF(e){if(typeof e=="number")return e;if(FF(e))return JS;if(ud(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ud(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(dF,"");var r=hF.test(e);return r||mF.test(e)?yF(e.slice(2),r?2:8):fF.test(e)?JS:+e}function GF(e){return ld(e)?xF(e):CF(e)}function $F(e){return e?TF(e,GF(e)):[]}eb.exports=PF});var nb=y((Mee,rb)=>{p();var BF="[object Boolean]",KF=Object.prototype,HF=KF.toString;function QF(e){return e===!0||e===!1||WF(e)&&HF.call(e)==BF}function WF(e){return!!e&&typeof e=="object"}rb.exports=QF});var ub=y((qee,ab)=>{p();var ib=1/0,zF=17976931348623157e292,ob=NaN,YF="[object Symbol]",JF=/^\s+|\s+$/g,XF=/^[-+]0x[0-9a-f]+$/i,ZF=/^0b[01]+$/i,eq=/^0o[0-7]+$/i,tq=parseInt,rq=Object.prototype,nq=rq.toString;function iq(e){return typeof e=="number"&&e==uq(e)}function sb(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function oq(e){return!!e&&typeof e=="object"}function sq(e){return typeof e=="symbol"||oq(e)&&nq.call(e)==YF}function aq(e){if(!e)return e===0?e:0;if(e=cq(e),e===ib||e===-ib){var t=e<0?-1:1;return t*zF}return e===e?e:0}function uq(e){var t=aq(e),r=t%1;return t===t?r?t-r:t:0}function cq(e){if(typeof e=="number")return e;if(sq(e))return ob;if(sb(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=sb(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(JF,"");var r=ZF.test(e);return r||eq.test(e)?tq(e.slice(2),r?2:8):XF.test(e)?ob:+e}ab.exports=iq});var lb=y((Vee,cb)=>{p();var lq="[object Number]",pq=Object.prototype,dq=pq.toString;function fq(e){return!!e&&typeof e=="object"}function hq(e){return typeof e=="number"||fq(e)&&dq.call(e)==lq}cb.exports=hq});var hb=y(($ee,fb)=>{p();var mq="[object Object]";function gq(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}function yq(e,t){return function(r){return e(t(r))}}var vq=Function.prototype,pb=Object.prototype,db=vq.toString,Eq=pb.hasOwnProperty,_q=db.call(Object),Sq=pb.toString,bq=yq(Object.getPrototypeOf,Object);function Tq(e){return!!e&&typeof e=="object"}function Iq(e){if(!Tq(e)||Sq.call(e)!=mq||gq(e))return!1;var t=bq(e);if(t===null)return!0;var r=Eq.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&db.call(r)==_q}fb.exports=Iq});var gb=y((Kee,mb)=>{p();var wq="[object String]",Oq=Object.prototype,Aq=Oq.toString,xq=Array.isArray;function Cq(e){return!!e&&typeof e=="object"}function Rq(e){return typeof e=="string"||!xq(e)&&Cq(e)&&Aq.call(e)==wq}mb.exports=Rq});var Sb=y((Qee,_b)=>{p();var Nq="Expected a function",yb=1/0,Pq=17976931348623157e292,vb=NaN,Dq="[object Symbol]",Lq=/^\s+|\s+$/g,kq=/^[-+]0x[0-9a-f]+$/i,jq=/^0b[01]+$/i,Mq=/^0o[0-7]+$/i,Fq=parseInt,qq=Object.prototype,Uq=qq.toString;function Vq(e,t){var r;if(typeof t!="function")throw new TypeError(Nq);return e=Hq(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}function Gq(e){return Vq(2,e)}function Eb(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function $q(e){return!!e&&typeof e=="object"}function Bq(e){return typeof e=="symbol"||$q(e)&&Uq.call(e)==Dq}function Kq(e){if(!e)return e===0?e:0;if(e=Qq(e),e===yb||e===-yb){var t=e<0?-1:1;return t*Pq}return e===e?e:0}function Hq(e){var t=Kq(e),r=t%1;return t===t?r?t-r:t:0}function Qq(e){if(typeof e=="number")return e;if(Bq(e))return vb;if(Eb(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Eb(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Lq,"");var r=jq.test(e);return r||Mq.test(e)?Fq(e.slice(2),r?2:8):kq.test(e)?vb:+e}_b.exports=Gq});var Rb=y((zee,Cb)=>{p();var bb=Mp(),Wq=od(),zq=id(),Tb=qa(),Yq=tb(),ou=nb(),Ib=ub(),dd=lb(),Ob=hb(),$r=gb(),Jq=Sb(),{KeyObject:Xq,createSecretKey:Zq,createPrivateKey:eU}=M("crypto"),Ab=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];Wq&&Ab.splice(3,0,"PS256","PS384","PS512");var tU={expiresIn:{isValid:function(e){return Ib(e)||$r(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return Ib(e)||$r(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return $r(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:Yq.bind(null,Ab),message:'"algorithm" must be a valid string enum value'},header:{isValid:Ob,message:'"header" must be an object'},encoding:{isValid:$r,message:'"encoding" must be a string'},issuer:{isValid:$r,message:'"issuer" must be a string'},subject:{isValid:$r,message:'"subject" must be a string'},jwtid:{isValid:$r,message:'"jwtid" must be a string'},noTimestamp:{isValid:ou,message:'"noTimestamp" must be a boolean'},keyid:{isValid:$r,message:'"keyid" must be a string'},mutatePayload:{isValid:ou,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:ou,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:ou,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},rU={iat:{isValid:dd,message:'"iat" should be a number of seconds'},exp:{isValid:dd,message:'"exp" should be a number of seconds'},nbf:{isValid:dd,message:'"nbf" should be a number of seconds'}};function xb(e,t,r,n){if(!Ob(r))throw new Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(i){let o=e[i];if(!o){if(!t)throw new Error('"'+i+'" is not allowed in "'+n+'"');return}if(!o.isValid(r[i]))throw new Error(o.message)})}function nU(e){return xb(tU,!1,e,"options")}function iU(e){return xb(rU,!0,e,"payload")}var wb={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},oU=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];Cb.exports=function(e,t,r,n){typeof r=="function"?(n=r,r={}):r=r||{};let i=typeof e=="object"&&!Buffer.isBuffer(e),o=Object.assign({alg:r.algorithm||"HS256",typ:i?"JWT":void 0,kid:r.keyid},r.header);function s(c){if(n)return n(c);throw c}if(!t&&r.algorithm!=="none")return s(new Error("secretOrPrivateKey must have a value"));if(t!=null&&!(t instanceof Xq))try{t=eU(t)}catch{try{t=Zq(typeof t=="string"?Buffer.from(t):t)}catch{return s(new Error("secretOrPrivateKey is not valid key material"))}}if(o.alg.startsWith("HS")&&t.type!=="secret")return s(new Error(`secretOrPrivateKey must be a symmetric key when using ${o.alg}`));if(/^(?:RS|PS|ES)/.test(o.alg)){if(t.type!=="private")return s(new Error(`secretOrPrivateKey must be an asymmetric key when using ${o.alg}`));if(!r.allowInsecureKeySizes&&!o.alg.startsWith("ES")&&t.asymmetricKeyDetails!==void 0&&t.asymmetricKeyDetails.modulusLength<2048)return s(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`))}if(typeof e>"u")return s(new Error("payload is required"));if(i){try{iU(e)}catch(c){return s(c)}r.mutatePayload||(e=Object.assign({},e))}else{let c=oU.filter(function(l){return typeof r[l]<"u"});if(c.length>0)return s(new Error("invalid "+c.join(",")+" option for "+typeof e+" payload"))}if(typeof e.exp<"u"&&typeof r.expiresIn<"u")return s(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof e.nbf<"u"&&typeof r.notBefore<"u")return s(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{nU(r)}catch(c){return s(c)}if(!r.allowInvalidAsymmetricKeyTypes)try{zq(o.alg,t)}catch(c){return s(c)}let a=e.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete e.iat:i&&(e.iat=a),typeof r.notBefore<"u"){try{e.nbf=bb(r.notBefore,a)}catch(c){return s(c)}if(typeof e.nbf>"u")return s(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof r.expiresIn<"u"&&typeof e=="object"){try{e.exp=bb(r.expiresIn,a)}catch(c){return s(c)}if(typeof e.exp>"u")return s(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(wb).forEach(function(c){let l=wb[c];if(typeof r[c]<"u"){if(typeof e[l]<"u")return s(new Error('Bad "options.'+c+'" option. The payload already has an "'+l+'" property.'));e[l]=r[c]}});let u=r.encoding||"utf8";if(typeof n=="function")n=n&&Jq(n),Tb.createSign({header:o,privateKey:t,payload:e,encoding:u}).once("error",n).once("done",function(c){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(o.alg)&&c.length<256)return n(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`));n(null,c)});else{let c=Tb.sign({header:o,payload:e,secret:t,encoding:u});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(o.alg)&&c.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`);return c}}});var Go=y((Jee,Nb)=>{p();Nb.exports={decode:Lp(),verify:zS(),sign:Rb(),JsonWebTokenError:jo(),NotBeforeError:kp(),TokenExpiredError:jp()}});var Mb=y(Ei=>{"use strict";p();Object.defineProperty(Ei,"__esModule",{value:!0});Ei.versionInfo=Ei.version=void 0;var lU="15.10.2";Ei.version=lU;var pU=Object.freeze({major:15,minor:10,patch:2,preReleaseTag:null});Ei.versionInfo=pU});var uu=y(md=>{"use strict";p();Object.defineProperty(md,"__esModule",{value:!0});md.default=dU;function dU(e){return typeof e?.then=="function"}});var Mt=y(gd=>{"use strict";p();Object.defineProperty(gd,"__esModule",{value:!0});gd.default=fU;function fU(e,t){var r=!!e;if(!r)throw new Error(t)}});var ar=y(yd=>{"use strict";p();Object.defineProperty(yd,"__esModule",{value:!0});yd.default=hU;function cu(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?cu=function(r){return typeof r}:cu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},cu(e)}function hU(e){return cu(e)=="object"&&e!==null}});var ur=y(Kr=>{"use strict";p();Object.defineProperty(Kr,"__esModule",{value:!0});Kr.SYMBOL_TO_STRING_TAG=Kr.SYMBOL_ASYNC_ITERATOR=Kr.SYMBOL_ITERATOR=void 0;var mU=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator";Kr.SYMBOL_ITERATOR=mU;var gU=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator";Kr.SYMBOL_ASYNC_ITERATOR=gU;var yU=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";Kr.SYMBOL_TO_STRING_TAG=yU});var lu=y(vd=>{"use strict";p();Object.defineProperty(vd,"__esModule",{value:!0});vd.getLocation=vU;function vU(e,t){for(var r=/\r\n|[\n\r]/g,n=1,i=t+1,o;(o=r.exec(e.body))&&o.index<t;)n+=1,i=t+1-(o.index+o[0].length);return{line:n,column:i}}});var Ed=y(du=>{"use strict";p();Object.defineProperty(du,"__esModule",{value:!0});du.printLocation=_U;du.printSourceLocation=qb;var EU=lu();function _U(e){return qb(e.source,(0,EU.getLocation)(e.source,e.start))}function qb(e,t){var r=e.locationOffset.column-1,n=pu(r)+e.body,i=t.line-1,o=e.locationOffset.line-1,s=t.line+o,a=t.line===1?r:0,u=t.column+a,c="".concat(e.name,":").concat(s,":").concat(u,`
|
|
31
|
+
`),l=n.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){for(var f=Math.floor(u/80),h=u%80,g=[],v=0;v<d.length;v+=80)g.push(d.slice(v,v+80));return c+Fb([["".concat(s),g[0]]].concat(g.slice(1,f+1).map(function(_){return["",_]}),[[" ",pu(h-1)+"^"],["",g[f+1]]]))}return c+Fb([["".concat(s-1),l[i-1]],["".concat(s),d],["",pu(u-1)+"^"],["".concat(s+1),l[i+1]]])}function Fb(e){var t=e.filter(function(n){var i=n[0],o=n[1];return o!==void 0}),r=Math.max.apply(Math,t.map(function(n){var i=n[0];return i.length}));return t.map(function(n){var i=n[0],o=n[1];return SU(r,i)+(o?" | "+o:" |")}).join(`
|
|
32
|
+
`)}function pu(e){return Array(e+1).join(" ")}function SU(e,t){return pu(e-t.length)+t}});var H=y(_i=>{"use strict";p();function fu(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fu=function(r){return typeof r}:fu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},fu(e)}Object.defineProperty(_i,"__esModule",{value:!0});_i.printError=Wb;_i.formatError=zb;_i.GraphQLError=void 0;var bU=Kb(Mt()),TU=Kb(ar()),IU=ur(),Ub=lu(),Vb=Ed();function Kb(e){return e&&e.__esModule?e:{default:e}}function Gb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function wU(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Gb(Object(r),!0).forEach(function(n){OU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function OU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $b(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function xU(e,t,r){return t&&$b(e.prototype,t),r&&$b(e,r),e}function CU(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ko(e,t)}function RU(e){var t=Qb();return function(){var n=Ho(e),i;if(t){var o=Ho(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Hb(this,i)}}function Hb(e,t){return t&&(fu(t)==="object"||typeof t=="function")?t:Bo(e)}function Bo(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _d(e){var t=typeof Map=="function"?new Map:void 0;return _d=function(n){if(n===null||!NU(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return hu(n,arguments,Ho(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ko(i,n)},_d(e)}function hu(e,t,r){return Qb()?hu=Reflect.construct:hu=function(i,o,s){var a=[null];a.push.apply(a,o);var u=Function.bind.apply(i,a),c=new u;return s&&Ko(c,s.prototype),c},hu.apply(null,arguments)}function Qb(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function NU(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Ko(e,t){return Ko=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Ko(e,t)}function Ho(e){return Ho=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ho(e)}var PU=(function(e){CU(r,e);var t=RU(r);function r(n,i,o,s,a,u,c){var l,d,f,h;AU(this,r),h=t.call(this,n),h.name="GraphQLError",h.originalError=u??void 0,h.nodes=Bb(Array.isArray(i)?i:i?[i]:void 0);for(var g=[],v=0,_=(b=h.nodes)!==null&&b!==void 0?b:[];v<_.length;v++){var b,S=_[v],I=S.loc;I!=null&&g.push(I)}g=Bb(g),h.source=o??((l=g)===null||l===void 0?void 0:l[0].source),h.positions=s??((d=g)===null||d===void 0?void 0:d.map(function(T){return T.start})),h.locations=s&&o?s.map(function(T){return(0,Ub.getLocation)(o,T)}):(f=g)===null||f===void 0?void 0:f.map(function(T){return(0,Ub.getLocation)(T.source,T.start)}),h.path=a??void 0;var A=u?.extensions;return c==null&&(0,TU.default)(A)?h.extensions=wU({},A):h.extensions=c??{},Object.defineProperties(Bo(h),{message:{enumerable:!0},locations:{enumerable:h.locations!=null},path:{enumerable:h.path!=null},extensions:{enumerable:h.extensions!=null&&Object.keys(h.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),u!=null&&u.stack?(Object.defineProperty(Bo(h),"stack",{value:u.stack,writable:!0,configurable:!0}),Hb(h)):(Error.captureStackTrace?Error.captureStackTrace(Bo(h),r):Object.defineProperty(Bo(h),"stack",{value:Error().stack,writable:!0,configurable:!0}),h)}return xU(r,[{key:"toString",value:function(){return Wb(this)}},{key:"toJSON",value:function(){return zb(this)}},{key:IU.SYMBOL_TO_STRING_TAG,get:function(){return"Object"}}]),r})(_d(Error));_i.GraphQLError=PU;function Bb(e){return e===void 0||e.length===0?void 0:e}function Wb(e){var t=e.message;if(e.nodes)for(var r=0,n=e.nodes;r<n.length;r++){var i=n[r];i.loc&&(t+=`
|
|
33
33
|
|
|
34
|
-
`+(0,
|
|
34
|
+
`+(0,Vb.printLocation)(i.loc))}else if(e.source&&e.locations)for(var o=0,s=e.locations;o<s.length;o++){var a=s[o];t+=`
|
|
35
35
|
|
|
36
|
-
`+(0,
|
|
36
|
+
`+(0,Vb.printSourceLocation)(e.source,a)}return t}function zb(e){var t;e||(0,bU.default)(0,"Received null or undefined error.");var r=(t=e.message)!==null&&t!==void 0?t:"An unknown error occurred.",n=e.locations,i=e.path,o=e.extensions;return o&&Object.keys(o).length>0?{message:r,locations:n,path:i,extensions:o}:{message:r,locations:n,path:i}}});var mu=y(Sd=>{"use strict";p();Object.defineProperty(Sd,"__esModule",{value:!0});Sd.syntaxError=LU;var DU=H();function LU(e,t,r){return new DU.GraphQLError("Syntax Error: ".concat(r),void 0,e,[t])}});var _e=y(gu=>{"use strict";p();Object.defineProperty(gu,"__esModule",{value:!0});gu.Kind=void 0;var kU=Object.freeze({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",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});gu.Kind=kU});var et=y(bd=>{"use strict";p();Object.defineProperty(bd,"__esModule",{value:!0});bd.default=jU;function jU(e,t){var r=!!e;if(!r)throw new Error(t??"Unexpected invariant triggered.")}});var Td=y(yu=>{"use strict";p();Object.defineProperty(yu,"__esModule",{value:!0});yu.default=void 0;var MU=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,FU=MU;yu.default=FU});var vu=y(Id=>{"use strict";p();Object.defineProperty(Id,"__esModule",{value:!0});Id.default=UU;var qU=Jb(et()),Yb=Jb(Td());function Jb(e){return e&&e.__esModule?e:{default:e}}function UU(e){var t=e.prototype.toJSON;typeof t=="function"||(0,qU.default)(0),e.prototype.inspect=t,Yb.default&&(e.prototype[Yb.default]=t)}});var Si=y(xn=>{"use strict";p();Object.defineProperty(xn,"__esModule",{value:!0});xn.isNode=GU;xn.Token=xn.Location=void 0;var Xb=VU(vu());function VU(e){return e&&e.__esModule?e:{default:e}}var Zb=(function(){function e(r,n,i){this.start=r.start,this.end=n.end,this.startToken=r,this.endToken=n,this.source=i}var t=e.prototype;return t.toJSON=function(){return{start:this.start,end:this.end}},e})();xn.Location=Zb;(0,Xb.default)(Zb);var eT=(function(){function e(r,n,i,o,s,a,u){this.kind=r,this.start=n,this.end=i,this.line=o,this.column=s,this.value=u,this.prev=a,this.next=null}var t=e.prototype;return t.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e})();xn.Token=eT;(0,Xb.default)(eT);function GU(e){return e!=null&&typeof e.kind=="string"}});var bi=y(Eu=>{"use strict";p();Object.defineProperty(Eu,"__esModule",{value:!0});Eu.TokenKind=void 0;var $U=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});Eu.TokenKind=$U});var ae=y(wd=>{"use strict";p();Object.defineProperty(wd,"__esModule",{value:!0});wd.default=QU;var BU=KU(Td());function KU(e){return e&&e.__esModule?e:{default:e}}function _u(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_u=function(r){return typeof r}:_u=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_u(e)}var HU=10,tT=2;function QU(e){return Su(e,[])}function Su(e,t){switch(_u(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return e===null?"null":WU(e,t);default:return String(e)}}function WU(e,t){if(t.indexOf(e)!==-1)return"[Circular]";var r=[].concat(t,[e]),n=JU(e);if(n!==void 0){var i=n.call(e);if(i!==e)return typeof i=="string"?i:Su(i,r)}else if(Array.isArray(e))return YU(e,r);return zU(e,r)}function zU(e,t){var r=Object.keys(e);if(r.length===0)return"{}";if(t.length>tT)return"["+XU(e)+"]";var n=r.map(function(i){var o=Su(e[i],t);return i+": "+o});return"{ "+n.join(", ")+" }"}function YU(e,t){if(e.length===0)return"[]";if(t.length>tT)return"[Array]";for(var r=Math.min(HU,e.length),n=e.length-r,i=[],o=0;o<r;++o)i.push(Su(e[o],t));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function JU(e){var t=e[String(BU.default)];if(typeof t=="function")return t;if(typeof e.inspect=="function")return e.inspect}function XU(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){var r=e.constructor.name;if(typeof r=="string"&&r!=="")return r}return t}});var Qo=y(Tu=>{"use strict";p();Object.defineProperty(Tu,"__esModule",{value:!0});Tu.default=void 0;var ZU=eV(ae());function eV(e){return e&&e.__esModule?e:{default:e}}function bu(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?bu=function(r){return typeof r}:bu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},bu(e)}var tV=process.env.NODE_ENV==="production"?function(t,r){return t instanceof r}:function(t,r){if(t instanceof r)return!0;if(bu(t)==="object"&&t!==null){var n,i=r.prototype[Symbol.toStringTag],o=Symbol.toStringTag in t?t[Symbol.toStringTag]:(n=t.constructor)===null||n===void 0?void 0:n.name;if(i===o){var s=(0,ZU.default)(t);throw new Error("Cannot use ".concat(i,' "').concat(s,`" from another module or realm.
|
|
37
37
|
|
|
38
38
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
39
39
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -44,22 +44,22 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
|
44
44
|
Duplicate "graphql" modules cannot be used at the same time since different
|
|
45
45
|
versions may have different capabilities and behavior. The data from one
|
|
46
46
|
version used in the function from another could produce confusing and
|
|
47
|
-
spurious results.`))}}return!1};Tu.default=
|
|
48
|
-
`)}function
|
|
47
|
+
spurious results.`))}}return!1};Tu.default=tV});var Iu=y(Wo=>{"use strict";p();Object.defineProperty(Wo,"__esModule",{value:!0});Wo.isSource=sV;Wo.Source=void 0;var rV=ur(),nV=Ad(ae()),Od=Ad(Mt()),iV=Ad(Qo());function Ad(e){return e&&e.__esModule?e:{default:e}}function rT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function oV(e,t,r){return t&&rT(e.prototype,t),r&&rT(e,r),e}var nT=(function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof t=="string"||(0,Od.default)(0,"Body must be a string. Received: ".concat((0,nV.default)(t),".")),this.body=t,this.name=r,this.locationOffset=n,this.locationOffset.line>0||(0,Od.default)(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,Od.default)(0,"column in locationOffset is 1-indexed and must be positive.")}return oV(e,[{key:rV.SYMBOL_TO_STRING_TAG,get:function(){return"Source"}}]),e})();Wo.Source=nT;function sV(e){return(0,iV.default)(e,nT)}});var Ti=y(wu=>{"use strict";p();Object.defineProperty(wu,"__esModule",{value:!0});wu.DirectiveLocation=void 0;var aV=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});wu.DirectiveLocation=aV});var Ii=y(zo=>{"use strict";p();Object.defineProperty(zo,"__esModule",{value:!0});zo.dedentBlockStringValue=uV;zo.getBlockStringIndentation=oT;zo.printBlockString=cV;function uV(e){var t=e.split(/\r\n|[\n\r]/g),r=oT(e);if(r!==0)for(var n=1;n<t.length;n++)t[n]=t[n].slice(r);for(var i=0;i<t.length&&iT(t[i]);)++i;for(var o=t.length;o>i&&iT(t[o-1]);)--o;return t.slice(i,o).join(`
|
|
48
|
+
`)}function iT(e){for(var t=0;t<e.length;++t)if(e[t]!==" "&&e[t]!==" ")return!1;return!0}function oT(e){for(var t,r=!0,n=!0,i=0,o=null,s=0;s<e.length;++s)switch(e.charCodeAt(s)){case 13:e.charCodeAt(s+1)===10&&++s;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(o===null||i<o)&&(o=i),n=!1}return(t=o)!==null&&t!==void 0?t:0}function cV(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=e.indexOf(`
|
|
49
49
|
`)===-1,i=e[0]===" "||e[0]===" ",o=e[e.length-1]==='"',s=e[e.length-1]==="\\",a=!n||o||s||r,u="";return a&&!(n&&i)&&(u+=`
|
|
50
50
|
`+t),u+=t?e.replace(/\n/g,`
|
|
51
51
|
`+t):e,a&&(u+=`
|
|
52
|
-
`),'"""'+u.replace(/"""/g,'\\"""')+'"""'}});var Au=y(
|
|
53
|
-
`;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:{var l=mV(o.charCodeAt(s+1),o.charCodeAt(s+2),o.charCodeAt(s+3),o.charCodeAt(s+4));if(l<0){var d=o.slice(s+1,s+5);throw(0,cr.syntaxError)(e,s,"Invalid character escape sequence: \\u".concat(d,"."))}c+=String.fromCharCode(l),s+=4;break}default:throw(0,cr.syntaxError)(e,s,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++s,a=s}}throw(0,cr.syntaxError)(e,s,"Unterminated string.")}function hV(e,t,r,n,i,o){for(var s=e.body,a=t+3,u=a,c=0,l="";a<s.length&&!isNaN(c=s.charCodeAt(a));){if(c===34&&s.charCodeAt(a+1)===34&&s.charCodeAt(a+2)===34)return l+=s.slice(u,a),new Me.Token(Z.TokenKind.BLOCK_STRING,t,a+3,r,n,i,(0,sV.dedentBlockStringValue)(l));if(c<32&&c!==9&&c!==10&&c!==13)throw(0,cr.syntaxError)(e,a,"Invalid character within String: ".concat(Cn(c),"."));c===10?(++a,++o.line,o.lineStart=a):c===13?(s.charCodeAt(a+1)===10?a+=2:++a,++o.line,o.lineStart=a):c===92&&s.charCodeAt(a+1)===34&&s.charCodeAt(a+2)===34&&s.charCodeAt(a+3)===34?(l+=s.slice(u,a)+'"""',a+=4,u=a):++a}throw(0,cr.syntaxError)(e,a,"Unterminated string.")}function mV(e,t,r,n){return Ou(e)<<12|Ou(t)<<8|Ou(r)<<4|Ou(n)}function Ou(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function gV(e,t,r,n,i){for(var o=e.body,s=o.length,a=t+1,u=0;a!==s&&!isNaN(u=o.charCodeAt(a))&&(u===95||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++a;return new Me.Token(Z.TokenKind.NAME,t,a,r,n,i,o.slice(t,a))}function yV(e){return e===95||e>=65&&e<=90||e>=97&&e<=122}});var wi=y(Rn=>{"use strict";p();Object.defineProperty(Rn,"__esModule",{value:!0});Rn.parse=_V;Rn.parseValue=bV;Rn.parseType=SV;Rn.Parser=void 0;var Cd=mu(),Q=_e(),vV=bi(),D=Si(),oT=Iu(),EV=Ti(),sT=Au();function _V(e,t){var r=new xu(e,t);return r.parseDocument()}function bV(e,t){var r=new xu(e,t);r.expectToken(D.TokenKind.SOF);var n=r.parseValueLiteral(!1);return r.expectToken(D.TokenKind.EOF),n}function SV(e,t){var r=new xu(e,t);r.expectToken(D.TokenKind.SOF);var n=r.parseTypeReference();return r.expectToken(D.TokenKind.EOF),n}var xu=(function(){function e(r,n){var i=(0,oT.isSource)(r)?r:new oT.Source(r);this._lexer=new sT.Lexer(i),this._options=n}var t=e.prototype;return t.parseName=function(){var n=this.expectToken(D.TokenKind.NAME);return{kind:Q.Kind.NAME,value:n.value,loc:this.loc(n)}},t.parseDocument=function(){var n=this._lexer.token;return{kind:Q.Kind.DOCUMENT,definitions:this.many(D.TokenKind.SOF,this.parseDefinition,D.TokenKind.EOF),loc:this.loc(n)}},t.parseDefinition=function(){if(this.peek(D.TokenKind.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(D.TokenKind.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var n=this._lexer.token;if(this.peek(D.TokenKind.BRACE_L))return{kind:Q.Kind.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),o;return this.peek(D.TokenKind.NAME)&&(o=this.parseName()),{kind:Q.Kind.OPERATION_DEFINITION,operation:i,name:o,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},t.parseOperationType=function(){var n=this.expectToken(D.TokenKind.NAME);switch(n.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(n)},t.parseVariableDefinitions=function(){return this.optionalMany(D.TokenKind.PAREN_L,this.parseVariableDefinition,D.TokenKind.PAREN_R)},t.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:Q.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(D.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(D.TokenKind.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(n)}},t.parseVariable=function(){var n=this._lexer.token;return this.expectToken(D.TokenKind.DOLLAR),{kind:Q.Kind.VARIABLE,name:this.parseName(),loc:this.loc(n)}},t.parseSelectionSet=function(){var n=this._lexer.token;return{kind:Q.Kind.SELECTION_SET,selections:this.many(D.TokenKind.BRACE_L,this.parseSelection,D.TokenKind.BRACE_R),loc:this.loc(n)}},t.parseSelection=function(){return this.peek(D.TokenKind.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var n=this._lexer.token,i=this.parseName(),o,s;return this.expectOptionalToken(D.TokenKind.COLON)?(o=i,s=this.parseName()):s=i,{kind:Q.Kind.FIELD,alias:o,name:s,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(D.TokenKind.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(D.TokenKind.PAREN_L,i,D.TokenKind.PAREN_R)},t.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(D.TokenKind.COLON),{kind:Q.Kind.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},t.parseConstArgument=function(){var n=this._lexer.token;return{kind:Q.Kind.ARGUMENT,name:this.parseName(),value:(this.expectToken(D.TokenKind.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},t.parseFragment=function(){var n=this._lexer.token;this.expectToken(D.TokenKind.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(D.TokenKind.NAME)?{kind:Q.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:Q.Kind.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},t.parseFragmentDefinition=function(){var n,i=this._lexer.token;return this.expectKeyword("fragment"),((n=this._options)===null||n===void 0?void 0:n.experimentalFragmentVariables)===!0?{kind:Q.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}:{kind:Q.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},t.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(n){var i=this._lexer.token;switch(i.kind){case D.TokenKind.BRACKET_L:return this.parseList(n);case D.TokenKind.BRACE_L:return this.parseObject(n);case D.TokenKind.INT:return this._lexer.advance(),{kind:Q.Kind.INT,value:i.value,loc:this.loc(i)};case D.TokenKind.FLOAT:return this._lexer.advance(),{kind:Q.Kind.FLOAT,value:i.value,loc:this.loc(i)};case D.TokenKind.STRING:case D.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case D.TokenKind.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:Q.Kind.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:Q.Kind.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:Q.Kind.NULL,loc:this.loc(i)};default:return{kind:Q.Kind.ENUM,value:i.value,loc:this.loc(i)}}case D.TokenKind.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},t.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:Q.Kind.STRING,value:n.value,block:n.kind===D.TokenKind.BLOCK_STRING,loc:this.loc(n)}},t.parseList=function(n){var i=this,o=this._lexer.token,s=function(){return i.parseValueLiteral(n)};return{kind:Q.Kind.LIST,values:this.any(D.TokenKind.BRACKET_L,s,D.TokenKind.BRACKET_R),loc:this.loc(o)}},t.parseObject=function(n){var i=this,o=this._lexer.token,s=function(){return i.parseObjectField(n)};return{kind:Q.Kind.OBJECT,fields:this.any(D.TokenKind.BRACE_L,s,D.TokenKind.BRACE_R),loc:this.loc(o)}},t.parseObjectField=function(n){var i=this._lexer.token,o=this.parseName();return this.expectToken(D.TokenKind.COLON),{kind:Q.Kind.OBJECT_FIELD,name:o,value:this.parseValueLiteral(n),loc:this.loc(i)}},t.parseDirectives=function(n){for(var i=[];this.peek(D.TokenKind.AT);)i.push(this.parseDirective(n));return i},t.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(D.TokenKind.AT),{kind:Q.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},t.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(D.TokenKind.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(D.TokenKind.BRACKET_R),i={kind:Q.Kind.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(D.TokenKind.BANG)?{kind:Q.Kind.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},t.parseNamedType=function(){var n=this._lexer.token;return{kind:Q.Kind.NAMED_TYPE,name:this.parseName(),loc:this.loc(n)}},t.parseTypeSystemDefinition=function(){var n=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(n.kind===D.TokenKind.NAME)switch(n.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()}throw this.unexpected(n)},t.peekDescription=function(){return this.peek(D.TokenKind.STRING)||this.peek(D.TokenKind.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");var o=this.parseDirectives(!0),s=this.many(D.TokenKind.BRACE_L,this.parseOperationTypeDefinition,D.TokenKind.BRACE_R);return{kind:Q.Kind.SCHEMA_DEFINITION,description:i,directives:o,operationTypes:s,loc:this.loc(n)}},t.parseOperationTypeDefinition=function(){var n=this._lexer.token,i=this.parseOperationType();this.expectToken(D.TokenKind.COLON);var o=this.parseNamedType();return{kind:Q.Kind.OPERATION_TYPE_DEFINITION,operation:i,type:o,loc:this.loc(n)}},t.parseScalarTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");var o=this.parseName(),s=this.parseDirectives(!0);return{kind:Q.Kind.SCALAR_TYPE_DEFINITION,description:i,name:o,directives:s,loc:this.loc(n)}},t.parseObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");var o=this.parseName(),s=this.parseImplementsInterfaces(),a=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:Q.Kind.OBJECT_TYPE_DEFINITION,description:i,name:o,interfaces:s,directives:a,fields:u,loc:this.loc(n)}},t.parseImplementsInterfaces=function(){var n;if(!this.expectOptionalKeyword("implements"))return[];if(((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLImplementsInterfaces)===!0){var i=[];this.expectOptionalToken(D.TokenKind.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(D.TokenKind.AMP)||this.peek(D.TokenKind.NAME));return i}return this.delimitedMany(D.TokenKind.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(D.TokenKind.BRACE_L)&&this._lexer.lookahead().kind===D.TokenKind.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(D.TokenKind.BRACE_L,this.parseFieldDefinition,D.TokenKind.BRACE_R)},t.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),o=this.parseName(),s=this.parseArgumentDefs();this.expectToken(D.TokenKind.COLON);var a=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:Q.Kind.FIELD_DEFINITION,description:i,name:o,arguments:s,type:a,directives:u,loc:this.loc(n)}},t.parseArgumentDefs=function(){return this.optionalMany(D.TokenKind.PAREN_L,this.parseInputValueDef,D.TokenKind.PAREN_R)},t.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),o=this.parseName();this.expectToken(D.TokenKind.COLON);var s=this.parseTypeReference(),a;this.expectOptionalToken(D.TokenKind.EQUALS)&&(a=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:Q.Kind.INPUT_VALUE_DEFINITION,description:i,name:o,type:s,defaultValue:a,directives:u,loc:this.loc(n)}},t.parseInterfaceTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");var o=this.parseName(),s=this.parseImplementsInterfaces(),a=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:Q.Kind.INTERFACE_TYPE_DEFINITION,description:i,name:o,interfaces:s,directives:a,fields:u,loc:this.loc(n)}},t.parseUnionTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");var o=this.parseName(),s=this.parseDirectives(!0),a=this.parseUnionMemberTypes();return{kind:Q.Kind.UNION_TYPE_DEFINITION,description:i,name:o,directives:s,types:a,loc:this.loc(n)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(D.TokenKind.EQUALS)?this.delimitedMany(D.TokenKind.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");var o=this.parseName(),s=this.parseDirectives(!0),a=this.parseEnumValuesDefinition();return{kind:Q.Kind.ENUM_TYPE_DEFINITION,description:i,name:o,directives:s,values:a,loc:this.loc(n)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(D.TokenKind.BRACE_L,this.parseEnumValueDefinition,D.TokenKind.BRACE_R)},t.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),o=this.parseName(),s=this.parseDirectives(!0);return{kind:Q.Kind.ENUM_VALUE_DEFINITION,description:i,name:o,directives:s,loc:this.loc(n)}},t.parseInputObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");var o=this.parseName(),s=this.parseDirectives(!0),a=this.parseInputFieldsDefinition();return{kind:Q.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:o,directives:s,fields:a,loc:this.loc(n)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(D.TokenKind.BRACE_L,this.parseInputValueDef,D.TokenKind.BRACE_R)},t.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===D.TokenKind.NAME)switch(n.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(n)},t.parseSchemaExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var i=this.parseDirectives(!0),o=this.optionalMany(D.TokenKind.BRACE_L,this.parseOperationTypeDefinition,D.TokenKind.BRACE_R);if(i.length===0&&o.length===0)throw this.unexpected();return{kind:Q.Kind.SCHEMA_EXTENSION,directives:i,operationTypes:o,loc:this.loc(n)}},t.parseScalarTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var i=this.parseName(),o=this.parseDirectives(!0);if(o.length===0)throw this.unexpected();return{kind:Q.Kind.SCALAR_TYPE_EXTENSION,name:i,directives:o,loc:this.loc(n)}},t.parseObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var i=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),a=this.parseFieldsDefinition();if(o.length===0&&s.length===0&&a.length===0)throw this.unexpected();return{kind:Q.Kind.OBJECT_TYPE_EXTENSION,name:i,interfaces:o,directives:s,fields:a,loc:this.loc(n)}},t.parseInterfaceTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var i=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),a=this.parseFieldsDefinition();if(o.length===0&&s.length===0&&a.length===0)throw this.unexpected();return{kind:Q.Kind.INTERFACE_TYPE_EXTENSION,name:i,interfaces:o,directives:s,fields:a,loc:this.loc(n)}},t.parseUnionTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var i=this.parseName(),o=this.parseDirectives(!0),s=this.parseUnionMemberTypes();if(o.length===0&&s.length===0)throw this.unexpected();return{kind:Q.Kind.UNION_TYPE_EXTENSION,name:i,directives:o,types:s,loc:this.loc(n)}},t.parseEnumTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var i=this.parseName(),o=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();if(o.length===0&&s.length===0)throw this.unexpected();return{kind:Q.Kind.ENUM_TYPE_EXTENSION,name:i,directives:o,values:s,loc:this.loc(n)}},t.parseInputObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var i=this.parseName(),o=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();if(o.length===0&&s.length===0)throw this.unexpected();return{kind:Q.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:o,fields:s,loc:this.loc(n)}},t.parseDirectiveDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(D.TokenKind.AT);var o=this.parseName(),s=this.parseArgumentDefs(),a=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:Q.Kind.DIRECTIVE_DEFINITION,description:i,name:o,arguments:s,repeatable:a,locations:u,loc:this.loc(n)}},t.parseDirectiveLocations=function(){return this.delimitedMany(D.TokenKind.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(EV.DirectiveLocation[i.value]!==void 0)return i;throw this.unexpected(n)},t.loc=function(n){var i;if(((i=this._options)===null||i===void 0?void 0:i.noLocation)!==!0)return new vV.Location(n,this._lexer.lastToken,this._lexer.source)},t.peek=function(n){return this._lexer.token.kind===n},t.expectToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i;throw(0,Cd.syntaxError)(this._lexer.source,i.start,"Expected ".concat(aT(n),", found ").concat(Rd(i),"."))},t.expectOptionalToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i},t.expectKeyword=function(n){var i=this._lexer.token;if(i.kind===D.TokenKind.NAME&&i.value===n)this._lexer.advance();else throw(0,Cd.syntaxError)(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Rd(i),"."))},t.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===D.TokenKind.NAME&&i.value===n?(this._lexer.advance(),!0):!1},t.unexpected=function(n){var i=n??this._lexer.token;return(0,Cd.syntaxError)(this._lexer.source,i.start,"Unexpected ".concat(Rd(i),"."))},t.any=function(n,i,o){this.expectToken(n);for(var s=[];!this.expectOptionalToken(o);)s.push(i.call(this));return s},t.optionalMany=function(n,i,o){if(this.expectOptionalToken(n)){var s=[];do s.push(i.call(this));while(!this.expectOptionalToken(o));return s}return[]},t.many=function(n,i,o){this.expectToken(n);var s=[];do s.push(i.call(this));while(!this.expectOptionalToken(o));return s},t.delimitedMany=function(n,i){this.expectOptionalToken(n);var o=[];do o.push(i.call(this));while(this.expectOptionalToken(n));return o},e})();Rn.Parser=xu;function Rd(e){var t=e.value;return aT(e.kind)+(t!=null?' "'.concat(t,'"'):"")}function aT(e){return(0,sT.isPunctuatorTokenKind)(e)?'"'.concat(e,'"'):e}});var Hr=y(Tr=>{"use strict";p();Object.defineProperty(Tr,"__esModule",{value:!0});Tr.visit=wV;Tr.visitInParallel=OV;Tr.getVisitFn=Cu;Tr.BREAK=Tr.QueryDocumentKeys=void 0;var TV=IV(ae()),uT=bi();function IV(e){return e&&e.__esModule?e:{default:e}}var cT={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["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:["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"]};Tr.QueryDocumentKeys=cT;var Oi=Object.freeze({});Tr.BREAK=Oi;function wV(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:cT,n=void 0,i=Array.isArray(e),o=[e],s=-1,a=[],u=void 0,c=void 0,l=void 0,d=[],f=[],h=e;do{s++;var g=s===o.length,v=g&&a.length!==0;if(g){if(c=f.length===0?void 0:d[d.length-1],u=l,l=f.pop(),v){if(i)u=u.slice();else{for(var _={},S=0,b=Object.keys(u);S<b.length;S++){var A=b[S];_[A]=u[A]}u=_}for(var O=0,T=0;T<a.length;T++){var x=a[T][0],U=a[T][1];i&&(x-=O),i&&U===null?(u.splice(x,1),O++):u[x]=U}}s=n.index,o=n.keys,a=n.edits,i=n.inArray,n=n.prev}else{if(c=l?i?s:o[s]:void 0,u=l?l[c]:h,u==null)continue;l&&d.push(c)}var C=void 0;if(!Array.isArray(u)){if(!(0,uT.isNode)(u))throw new Error("Invalid AST Node: ".concat((0,TV.default)(u),"."));var te=Cu(t,u.kind,g);if(te){if(C=te.call(t,u,c,l,d,f),C===Oi)break;if(C===!1){if(!g){d.pop();continue}}else if(C!==void 0&&(a.push([c,C]),!g))if((0,uT.isNode)(C))u=C;else{d.pop();continue}}}if(C===void 0&&v&&a.push([c,u]),g)d.pop();else{var de;n={inArray:i,index:s,keys:o,edits:a,prev:n},i=Array.isArray(u),o=i?u:(de=r[u.kind])!==null&&de!==void 0?de:[],s=-1,a=[],l&&f.push(l),l=u}}while(n!==void 0);return a.length!==0&&(h=a[a.length-1][1]),h}function OV(e){var t=new Array(e.length);return{enter:function(n){for(var i=0;i<e.length;i++)if(t[i]==null){var o=Cu(e[i],n.kind,!1);if(o){var s=o.apply(e[i],arguments);if(s===!1)t[i]=n;else if(s===Oi)t[i]=Oi;else if(s!==void 0)return s}}},leave:function(n){for(var i=0;i<e.length;i++)if(t[i]==null){var o=Cu(e[i],n.kind,!0);if(o){var s=o.apply(e[i],arguments);if(s===Oi)t[i]=Oi;else if(s!==void 0&&s!==!1)return s}}else t[i]===n&&(t[i]=null)}}}function Cu(e,t,r){var n=e[t];if(n){if(!r&&typeof n=="function")return n;var i=r?n.leave:n.enter;if(typeof i=="function")return i}else{var o=r?e.leave:e.enter;if(o){if(typeof o=="function")return o;var s=o[t];if(typeof s=="function")return s}}}});var Ai=y(Ru=>{"use strict";p();Object.defineProperty(Ru,"__esModule",{value:!0});Ru.default=void 0;var AV=Array.prototype.find?function(e,t){return Array.prototype.find.call(e,t)}:function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(t(n))return n}},xV=AV;Ru.default=xV});var St=y(Nu=>{"use strict";p();Object.defineProperty(Nu,"__esModule",{value:!0});Nu.default=void 0;var CV=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},RV=CV;Nu.default=RV});var Yo=y(Nd=>{"use strict";p();Object.defineProperty(Nd,"__esModule",{value:!0});Nd.locatedError=LV;var NV=DV(ae()),PV=H();function DV(e){return e&&e.__esModule?e:{default:e}}function LV(e,t,r){var n,i=e instanceof Error?e:new Error("Unexpected error value: "+(0,NV.default)(e));return Array.isArray(i.path)?i:new PV.GraphQLError(i.message,(n=i.nodes)!==null&&n!==void 0?n:t,i.source,i.positions,r,i)}});var Pd=y(Pu=>{"use strict";p();Object.defineProperty(Pu,"__esModule",{value:!0});Pu.assertValidName=FV;Pu.isValidNameError=pT;var kV=jV(Mt()),lT=H();function jV(e){return e&&e.__esModule?e:{default:e}}var MV=/^[_a-zA-Z][_a-zA-Z0-9]*$/;function FV(e){var t=pT(e);if(t)throw t;return e}function pT(e){if(typeof e=="string"||(0,kV.default)(0,"Expected name to be a string."),e.length>1&&e[0]==="_"&&e[1]==="_")return new lT.GraphQLError('Name "'.concat(e,'" must not begin with "__", which is reserved by GraphQL introspection.'));if(!MV.test(e))return new lT.GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'.concat(e,'" does not.'))}});var xi=y(Du=>{"use strict";p();Object.defineProperty(Du,"__esModule",{value:!0});Du.default=void 0;var qV=Object.entries||function(e){return Object.keys(e).map(function(t){return[t,e[t]]})},UV=qV;Du.default=UV});var Qr=y(Dd=>{"use strict";p();Object.defineProperty(Dd,"__esModule",{value:!0});Dd.default=VV;function VV(e,t){return e.reduce(function(r,n){return r[t(n)]=n,r},Object.create(null))}});var kd=y(Ld=>{"use strict";p();Object.defineProperty(Ld,"__esModule",{value:!0});Ld.default=BV;var GV=$V(xi());function $V(e){return e&&e.__esModule?e:{default:e}}function BV(e,t){for(var r=Object.create(null),n=0,i=(0,GV.default)(e);n<i.length;n++){var o=i[n],s=o[0],a=o[1];r[s]=t(a,s)}return r}});var Lu=y(jd=>{"use strict";p();Object.defineProperty(jd,"__esModule",{value:!0});jd.default=QV;var KV=HV(xi());function HV(e){return e&&e.__esModule?e:{default:e}}function QV(e){if(Object.getPrototypeOf(e)===null)return e;for(var t=Object.create(null),r=0,n=(0,KV.default)(e);r<n.length;r++){var i=n[r],o=i[0],s=i[1];t[o]=s}return t}});var Jo=y(Md=>{"use strict";p();Object.defineProperty(Md,"__esModule",{value:!0});Md.default=WV;function WV(e,t,r){return e.reduce(function(n,i){return n[t(i)]=r(i),n},Object.create(null))}});var Wr=y(Fd=>{"use strict";p();Object.defineProperty(Fd,"__esModule",{value:!0});Fd.default=YV;var zV=5;function YV(e,t){var r=typeof e=="string"?[e,t]:[void 0,e],n=r[0],i=r[1],o=" Did you mean ";n&&(o+=n+" ");var s=i.map(function(c){return'"'.concat(c,'"')});switch(s.length){case 0:return"";case 1:return o+s[0]+"?";case 2:return o+s[0]+" or "+s[1]+"?"}var a=s.slice(0,zV),u=a.pop();return o+a.join(", ")+", or "+u+"?"}});var dT=y(qd=>{"use strict";p();Object.defineProperty(qd,"__esModule",{value:!0});qd.default=JV;function JV(e){return e}});var Xo=y(Vd=>{"use strict";p();Object.defineProperty(Vd,"__esModule",{value:!0});Vd.default=XV;function XV(e,t){for(var r=0,n=0;r<e.length&&n<t.length;){var i=e.charCodeAt(r),o=t.charCodeAt(n);if(ku(i)&&ku(o)){var s=0;do++r,s=s*10+i-Ud,i=e.charCodeAt(r);while(ku(i)&&s>0);var a=0;do++n,a=a*10+o-Ud,o=t.charCodeAt(n);while(ku(o)&&a>0);if(s<a)return-1;if(s>a)return 1}else{if(i<o)return-1;if(i>o)return 1;++r,++n}}return e.length-t.length}var Ud=48,ZV=57;function ku(e){return!isNaN(e)&&Ud<=e&&e<=ZV}});var zr=y(Gd=>{"use strict";p();Object.defineProperty(Gd,"__esModule",{value:!0});Gd.default=rG;var eG=tG(Xo());function tG(e){return e&&e.__esModule?e:{default:e}}function rG(e,t){for(var r=Object.create(null),n=new nG(e),i=Math.floor(e.length*.4)+1,o=0;o<t.length;o++){var s=t[o],a=n.measure(s,i);a!==void 0&&(r[s]=a)}return Object.keys(r).sort(function(u,c){var l=r[u]-r[c];return l!==0?l:(0,eG.default)(u,c)})}var nG=(function(){function e(r){this._input=r,this._inputLowerCase=r.toLowerCase(),this._inputArray=fT(this._inputLowerCase),this._rows=[new Array(r.length+1).fill(0),new Array(r.length+1).fill(0),new Array(r.length+1).fill(0)]}var t=e.prototype;return t.measure=function(n,i){if(this._input===n)return 0;var o=n.toLowerCase();if(this._inputLowerCase===o)return 1;var s=fT(o),a=this._inputArray;if(s.length<a.length){var u=s;s=a,a=u}var c=s.length,l=a.length;if(!(c-l>i)){for(var d=this._rows,f=0;f<=l;f++)d[0][f]=f;for(var h=1;h<=c;h++){for(var g=d[(h-1)%3],v=d[h%3],_=v[0]=h,S=1;S<=l;S++){var b=s[h-1]===a[S-1]?0:1,A=Math.min(g[S]+1,v[S-1]+1,g[S-1]+b);if(h>1&&S>1&&s[h-1]===a[S-2]&&s[h-2]===a[S-1]){var O=d[(h-2)%3][S-2];A=Math.min(A,O+1)}A<_&&(_=A),v[S]=A}if(_>i)return}var T=d[c%3][l];return T<=i?T:void 0}},e})();function fT(e){for(var t=e.length,r=new Array(t),n=0;n<t;++n)r[n]=e.charCodeAt(n);return r}});var mt=y($d=>{"use strict";p();Object.defineProperty($d,"__esModule",{value:!0});$d.print=sG;var iG=Hr(),oG=Ii();function sG(e){return(0,iG.visit)(e,{leave:uG})}var aG=80,uG={Name:function(t){return t.value},Variable:function(t){return"$"+t.name},Document:function(t){return F(t.definitions,`
|
|
52
|
+
`),'"""'+u.replace(/"""/g,'\\"""')+'"""'}});var Au=y(Yo=>{"use strict";p();Object.defineProperty(Yo,"__esModule",{value:!0});Yo.isPunctuatorTokenKind=dV;Yo.Lexer=void 0;var cr=mu(),Me=Si(),Z=bi(),lV=Ii(),pV=(function(){function e(r){var n=new Me.Token(Z.TokenKind.SOF,0,0,0,0,null);this.source=r,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){this.lastToken=this.token;var n=this.token=this.lookahead();return n},t.lookahead=function(){var n=this.token;if(n.kind!==Z.TokenKind.EOF)do{var i;n=(i=n.next)!==null&&i!==void 0?i:n.next=fV(this,n)}while(n.kind===Z.TokenKind.COMMENT);return n},e})();Yo.Lexer=pV;function dV(e){return e===Z.TokenKind.BANG||e===Z.TokenKind.DOLLAR||e===Z.TokenKind.AMP||e===Z.TokenKind.PAREN_L||e===Z.TokenKind.PAREN_R||e===Z.TokenKind.SPREAD||e===Z.TokenKind.COLON||e===Z.TokenKind.EQUALS||e===Z.TokenKind.AT||e===Z.TokenKind.BRACKET_L||e===Z.TokenKind.BRACKET_R||e===Z.TokenKind.BRACE_L||e===Z.TokenKind.PIPE||e===Z.TokenKind.BRACE_R}function Cn(e){return isNaN(e)?Z.TokenKind.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function fV(e,t){for(var r=e.source,n=r.body,i=n.length,o=t.end;o<i;){var s=n.charCodeAt(o),a=e.line,u=1+o-e.lineStart;switch(s){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++e.line,e.lineStart=o;continue;case 13:n.charCodeAt(o+1)===10?o+=2:++o,++e.line,e.lineStart=o;continue;case 33:return new Me.Token(Z.TokenKind.BANG,o,o+1,a,u,t);case 35:return mV(r,o,a,u,t);case 36:return new Me.Token(Z.TokenKind.DOLLAR,o,o+1,a,u,t);case 38:return new Me.Token(Z.TokenKind.AMP,o,o+1,a,u,t);case 40:return new Me.Token(Z.TokenKind.PAREN_L,o,o+1,a,u,t);case 41:return new Me.Token(Z.TokenKind.PAREN_R,o,o+1,a,u,t);case 46:if(n.charCodeAt(o+1)===46&&n.charCodeAt(o+2)===46)return new Me.Token(Z.TokenKind.SPREAD,o,o+3,a,u,t);break;case 58:return new Me.Token(Z.TokenKind.COLON,o,o+1,a,u,t);case 61:return new Me.Token(Z.TokenKind.EQUALS,o,o+1,a,u,t);case 64:return new Me.Token(Z.TokenKind.AT,o,o+1,a,u,t);case 91:return new Me.Token(Z.TokenKind.BRACKET_L,o,o+1,a,u,t);case 93:return new Me.Token(Z.TokenKind.BRACKET_R,o,o+1,a,u,t);case 123:return new Me.Token(Z.TokenKind.BRACE_L,o,o+1,a,u,t);case 124:return new Me.Token(Z.TokenKind.PIPE,o,o+1,a,u,t);case 125:return new Me.Token(Z.TokenKind.BRACE_R,o,o+1,a,u,t);case 34:return n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34?vV(r,o,a,u,t,e):yV(r,o,a,u,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return gV(r,o,s,a,u,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return _V(r,o,a,u,t)}throw(0,cr.syntaxError)(r,o,hV(s))}var c=e.line,l=1+o-e.lineStart;return new Me.Token(Z.TokenKind.EOF,i,i,c,l,t)}function hV(e){return e<32&&e!==9&&e!==10&&e!==13?"Cannot contain the invalid character ".concat(Cn(e),"."):e===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(Cn(e),".")}function mV(e,t,r,n,i){var o=e.body,s,a=t;do s=o.charCodeAt(++a);while(!isNaN(s)&&(s>31||s===9));return new Me.Token(Z.TokenKind.COMMENT,t,a,r,n,i,o.slice(t+1,a))}function gV(e,t,r,n,i,o){var s=e.body,a=r,u=t,c=!1;if(a===45&&(a=s.charCodeAt(++u)),a===48){if(a=s.charCodeAt(++u),a>=48&&a<=57)throw(0,cr.syntaxError)(e,u,"Invalid number, unexpected digit after 0: ".concat(Cn(a),"."))}else u=xd(e,u,a),a=s.charCodeAt(u);if(a===46&&(c=!0,a=s.charCodeAt(++u),u=xd(e,u,a),a=s.charCodeAt(u)),(a===69||a===101)&&(c=!0,a=s.charCodeAt(++u),(a===43||a===45)&&(a=s.charCodeAt(++u)),u=xd(e,u,a),a=s.charCodeAt(u)),a===46||SV(a))throw(0,cr.syntaxError)(e,u,"Invalid number, expected digit but got: ".concat(Cn(a),"."));return new Me.Token(c?Z.TokenKind.FLOAT:Z.TokenKind.INT,t,u,n,i,o,s.slice(t,u))}function xd(e,t,r){var n=e.body,i=t,o=r;if(o>=48&&o<=57){do o=n.charCodeAt(++i);while(o>=48&&o<=57);return i}throw(0,cr.syntaxError)(e,i,"Invalid number, expected digit but got: ".concat(Cn(o),"."))}function yV(e,t,r,n,i){for(var o=e.body,s=t+1,a=s,u=0,c="";s<o.length&&!isNaN(u=o.charCodeAt(s))&&u!==10&&u!==13;){if(u===34)return c+=o.slice(a,s),new Me.Token(Z.TokenKind.STRING,t,s+1,r,n,i,c);if(u<32&&u!==9)throw(0,cr.syntaxError)(e,s,"Invalid character within String: ".concat(Cn(u),"."));if(++s,u===92){switch(c+=o.slice(a,s-1),u=o.charCodeAt(s),u){case 34:c+='"';break;case 47:c+="/";break;case 92:c+="\\";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+=`
|
|
53
|
+
`;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:{var l=EV(o.charCodeAt(s+1),o.charCodeAt(s+2),o.charCodeAt(s+3),o.charCodeAt(s+4));if(l<0){var d=o.slice(s+1,s+5);throw(0,cr.syntaxError)(e,s,"Invalid character escape sequence: \\u".concat(d,"."))}c+=String.fromCharCode(l),s+=4;break}default:throw(0,cr.syntaxError)(e,s,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++s,a=s}}throw(0,cr.syntaxError)(e,s,"Unterminated string.")}function vV(e,t,r,n,i,o){for(var s=e.body,a=t+3,u=a,c=0,l="";a<s.length&&!isNaN(c=s.charCodeAt(a));){if(c===34&&s.charCodeAt(a+1)===34&&s.charCodeAt(a+2)===34)return l+=s.slice(u,a),new Me.Token(Z.TokenKind.BLOCK_STRING,t,a+3,r,n,i,(0,lV.dedentBlockStringValue)(l));if(c<32&&c!==9&&c!==10&&c!==13)throw(0,cr.syntaxError)(e,a,"Invalid character within String: ".concat(Cn(c),"."));c===10?(++a,++o.line,o.lineStart=a):c===13?(s.charCodeAt(a+1)===10?a+=2:++a,++o.line,o.lineStart=a):c===92&&s.charCodeAt(a+1)===34&&s.charCodeAt(a+2)===34&&s.charCodeAt(a+3)===34?(l+=s.slice(u,a)+'"""',a+=4,u=a):++a}throw(0,cr.syntaxError)(e,a,"Unterminated string.")}function EV(e,t,r,n){return Ou(e)<<12|Ou(t)<<8|Ou(r)<<4|Ou(n)}function Ou(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function _V(e,t,r,n,i){for(var o=e.body,s=o.length,a=t+1,u=0;a!==s&&!isNaN(u=o.charCodeAt(a))&&(u===95||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++a;return new Me.Token(Z.TokenKind.NAME,t,a,r,n,i,o.slice(t,a))}function SV(e){return e===95||e>=65&&e<=90||e>=97&&e<=122}});var wi=y(Rn=>{"use strict";p();Object.defineProperty(Rn,"__esModule",{value:!0});Rn.parse=IV;Rn.parseValue=wV;Rn.parseType=OV;Rn.Parser=void 0;var Cd=mu(),Q=_e(),bV=Si(),D=bi(),sT=Iu(),TV=Ti(),aT=Au();function IV(e,t){var r=new xu(e,t);return r.parseDocument()}function wV(e,t){var r=new xu(e,t);r.expectToken(D.TokenKind.SOF);var n=r.parseValueLiteral(!1);return r.expectToken(D.TokenKind.EOF),n}function OV(e,t){var r=new xu(e,t);r.expectToken(D.TokenKind.SOF);var n=r.parseTypeReference();return r.expectToken(D.TokenKind.EOF),n}var xu=(function(){function e(r,n){var i=(0,sT.isSource)(r)?r:new sT.Source(r);this._lexer=new aT.Lexer(i),this._options=n}var t=e.prototype;return t.parseName=function(){var n=this.expectToken(D.TokenKind.NAME);return{kind:Q.Kind.NAME,value:n.value,loc:this.loc(n)}},t.parseDocument=function(){var n=this._lexer.token;return{kind:Q.Kind.DOCUMENT,definitions:this.many(D.TokenKind.SOF,this.parseDefinition,D.TokenKind.EOF),loc:this.loc(n)}},t.parseDefinition=function(){if(this.peek(D.TokenKind.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(D.TokenKind.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var n=this._lexer.token;if(this.peek(D.TokenKind.BRACE_L))return{kind:Q.Kind.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),o;return this.peek(D.TokenKind.NAME)&&(o=this.parseName()),{kind:Q.Kind.OPERATION_DEFINITION,operation:i,name:o,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},t.parseOperationType=function(){var n=this.expectToken(D.TokenKind.NAME);switch(n.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(n)},t.parseVariableDefinitions=function(){return this.optionalMany(D.TokenKind.PAREN_L,this.parseVariableDefinition,D.TokenKind.PAREN_R)},t.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:Q.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(D.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(D.TokenKind.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(n)}},t.parseVariable=function(){var n=this._lexer.token;return this.expectToken(D.TokenKind.DOLLAR),{kind:Q.Kind.VARIABLE,name:this.parseName(),loc:this.loc(n)}},t.parseSelectionSet=function(){var n=this._lexer.token;return{kind:Q.Kind.SELECTION_SET,selections:this.many(D.TokenKind.BRACE_L,this.parseSelection,D.TokenKind.BRACE_R),loc:this.loc(n)}},t.parseSelection=function(){return this.peek(D.TokenKind.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var n=this._lexer.token,i=this.parseName(),o,s;return this.expectOptionalToken(D.TokenKind.COLON)?(o=i,s=this.parseName()):s=i,{kind:Q.Kind.FIELD,alias:o,name:s,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(D.TokenKind.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(D.TokenKind.PAREN_L,i,D.TokenKind.PAREN_R)},t.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(D.TokenKind.COLON),{kind:Q.Kind.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},t.parseConstArgument=function(){var n=this._lexer.token;return{kind:Q.Kind.ARGUMENT,name:this.parseName(),value:(this.expectToken(D.TokenKind.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},t.parseFragment=function(){var n=this._lexer.token;this.expectToken(D.TokenKind.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(D.TokenKind.NAME)?{kind:Q.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:Q.Kind.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},t.parseFragmentDefinition=function(){var n,i=this._lexer.token;return this.expectKeyword("fragment"),((n=this._options)===null||n===void 0?void 0:n.experimentalFragmentVariables)===!0?{kind:Q.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}:{kind:Q.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},t.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(n){var i=this._lexer.token;switch(i.kind){case D.TokenKind.BRACKET_L:return this.parseList(n);case D.TokenKind.BRACE_L:return this.parseObject(n);case D.TokenKind.INT:return this._lexer.advance(),{kind:Q.Kind.INT,value:i.value,loc:this.loc(i)};case D.TokenKind.FLOAT:return this._lexer.advance(),{kind:Q.Kind.FLOAT,value:i.value,loc:this.loc(i)};case D.TokenKind.STRING:case D.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case D.TokenKind.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:Q.Kind.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:Q.Kind.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:Q.Kind.NULL,loc:this.loc(i)};default:return{kind:Q.Kind.ENUM,value:i.value,loc:this.loc(i)}}case D.TokenKind.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},t.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:Q.Kind.STRING,value:n.value,block:n.kind===D.TokenKind.BLOCK_STRING,loc:this.loc(n)}},t.parseList=function(n){var i=this,o=this._lexer.token,s=function(){return i.parseValueLiteral(n)};return{kind:Q.Kind.LIST,values:this.any(D.TokenKind.BRACKET_L,s,D.TokenKind.BRACKET_R),loc:this.loc(o)}},t.parseObject=function(n){var i=this,o=this._lexer.token,s=function(){return i.parseObjectField(n)};return{kind:Q.Kind.OBJECT,fields:this.any(D.TokenKind.BRACE_L,s,D.TokenKind.BRACE_R),loc:this.loc(o)}},t.parseObjectField=function(n){var i=this._lexer.token,o=this.parseName();return this.expectToken(D.TokenKind.COLON),{kind:Q.Kind.OBJECT_FIELD,name:o,value:this.parseValueLiteral(n),loc:this.loc(i)}},t.parseDirectives=function(n){for(var i=[];this.peek(D.TokenKind.AT);)i.push(this.parseDirective(n));return i},t.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(D.TokenKind.AT),{kind:Q.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},t.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(D.TokenKind.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(D.TokenKind.BRACKET_R),i={kind:Q.Kind.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(D.TokenKind.BANG)?{kind:Q.Kind.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},t.parseNamedType=function(){var n=this._lexer.token;return{kind:Q.Kind.NAMED_TYPE,name:this.parseName(),loc:this.loc(n)}},t.parseTypeSystemDefinition=function(){var n=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(n.kind===D.TokenKind.NAME)switch(n.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()}throw this.unexpected(n)},t.peekDescription=function(){return this.peek(D.TokenKind.STRING)||this.peek(D.TokenKind.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");var o=this.parseDirectives(!0),s=this.many(D.TokenKind.BRACE_L,this.parseOperationTypeDefinition,D.TokenKind.BRACE_R);return{kind:Q.Kind.SCHEMA_DEFINITION,description:i,directives:o,operationTypes:s,loc:this.loc(n)}},t.parseOperationTypeDefinition=function(){var n=this._lexer.token,i=this.parseOperationType();this.expectToken(D.TokenKind.COLON);var o=this.parseNamedType();return{kind:Q.Kind.OPERATION_TYPE_DEFINITION,operation:i,type:o,loc:this.loc(n)}},t.parseScalarTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");var o=this.parseName(),s=this.parseDirectives(!0);return{kind:Q.Kind.SCALAR_TYPE_DEFINITION,description:i,name:o,directives:s,loc:this.loc(n)}},t.parseObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");var o=this.parseName(),s=this.parseImplementsInterfaces(),a=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:Q.Kind.OBJECT_TYPE_DEFINITION,description:i,name:o,interfaces:s,directives:a,fields:u,loc:this.loc(n)}},t.parseImplementsInterfaces=function(){var n;if(!this.expectOptionalKeyword("implements"))return[];if(((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLImplementsInterfaces)===!0){var i=[];this.expectOptionalToken(D.TokenKind.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(D.TokenKind.AMP)||this.peek(D.TokenKind.NAME));return i}return this.delimitedMany(D.TokenKind.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(D.TokenKind.BRACE_L)&&this._lexer.lookahead().kind===D.TokenKind.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(D.TokenKind.BRACE_L,this.parseFieldDefinition,D.TokenKind.BRACE_R)},t.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),o=this.parseName(),s=this.parseArgumentDefs();this.expectToken(D.TokenKind.COLON);var a=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:Q.Kind.FIELD_DEFINITION,description:i,name:o,arguments:s,type:a,directives:u,loc:this.loc(n)}},t.parseArgumentDefs=function(){return this.optionalMany(D.TokenKind.PAREN_L,this.parseInputValueDef,D.TokenKind.PAREN_R)},t.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),o=this.parseName();this.expectToken(D.TokenKind.COLON);var s=this.parseTypeReference(),a;this.expectOptionalToken(D.TokenKind.EQUALS)&&(a=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:Q.Kind.INPUT_VALUE_DEFINITION,description:i,name:o,type:s,defaultValue:a,directives:u,loc:this.loc(n)}},t.parseInterfaceTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");var o=this.parseName(),s=this.parseImplementsInterfaces(),a=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:Q.Kind.INTERFACE_TYPE_DEFINITION,description:i,name:o,interfaces:s,directives:a,fields:u,loc:this.loc(n)}},t.parseUnionTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");var o=this.parseName(),s=this.parseDirectives(!0),a=this.parseUnionMemberTypes();return{kind:Q.Kind.UNION_TYPE_DEFINITION,description:i,name:o,directives:s,types:a,loc:this.loc(n)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(D.TokenKind.EQUALS)?this.delimitedMany(D.TokenKind.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");var o=this.parseName(),s=this.parseDirectives(!0),a=this.parseEnumValuesDefinition();return{kind:Q.Kind.ENUM_TYPE_DEFINITION,description:i,name:o,directives:s,values:a,loc:this.loc(n)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(D.TokenKind.BRACE_L,this.parseEnumValueDefinition,D.TokenKind.BRACE_R)},t.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),o=this.parseName(),s=this.parseDirectives(!0);return{kind:Q.Kind.ENUM_VALUE_DEFINITION,description:i,name:o,directives:s,loc:this.loc(n)}},t.parseInputObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");var o=this.parseName(),s=this.parseDirectives(!0),a=this.parseInputFieldsDefinition();return{kind:Q.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:o,directives:s,fields:a,loc:this.loc(n)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(D.TokenKind.BRACE_L,this.parseInputValueDef,D.TokenKind.BRACE_R)},t.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===D.TokenKind.NAME)switch(n.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(n)},t.parseSchemaExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var i=this.parseDirectives(!0),o=this.optionalMany(D.TokenKind.BRACE_L,this.parseOperationTypeDefinition,D.TokenKind.BRACE_R);if(i.length===0&&o.length===0)throw this.unexpected();return{kind:Q.Kind.SCHEMA_EXTENSION,directives:i,operationTypes:o,loc:this.loc(n)}},t.parseScalarTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var i=this.parseName(),o=this.parseDirectives(!0);if(o.length===0)throw this.unexpected();return{kind:Q.Kind.SCALAR_TYPE_EXTENSION,name:i,directives:o,loc:this.loc(n)}},t.parseObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var i=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),a=this.parseFieldsDefinition();if(o.length===0&&s.length===0&&a.length===0)throw this.unexpected();return{kind:Q.Kind.OBJECT_TYPE_EXTENSION,name:i,interfaces:o,directives:s,fields:a,loc:this.loc(n)}},t.parseInterfaceTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var i=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),a=this.parseFieldsDefinition();if(o.length===0&&s.length===0&&a.length===0)throw this.unexpected();return{kind:Q.Kind.INTERFACE_TYPE_EXTENSION,name:i,interfaces:o,directives:s,fields:a,loc:this.loc(n)}},t.parseUnionTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var i=this.parseName(),o=this.parseDirectives(!0),s=this.parseUnionMemberTypes();if(o.length===0&&s.length===0)throw this.unexpected();return{kind:Q.Kind.UNION_TYPE_EXTENSION,name:i,directives:o,types:s,loc:this.loc(n)}},t.parseEnumTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var i=this.parseName(),o=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();if(o.length===0&&s.length===0)throw this.unexpected();return{kind:Q.Kind.ENUM_TYPE_EXTENSION,name:i,directives:o,values:s,loc:this.loc(n)}},t.parseInputObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var i=this.parseName(),o=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();if(o.length===0&&s.length===0)throw this.unexpected();return{kind:Q.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:o,fields:s,loc:this.loc(n)}},t.parseDirectiveDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(D.TokenKind.AT);var o=this.parseName(),s=this.parseArgumentDefs(),a=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:Q.Kind.DIRECTIVE_DEFINITION,description:i,name:o,arguments:s,repeatable:a,locations:u,loc:this.loc(n)}},t.parseDirectiveLocations=function(){return this.delimitedMany(D.TokenKind.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(TV.DirectiveLocation[i.value]!==void 0)return i;throw this.unexpected(n)},t.loc=function(n){var i;if(((i=this._options)===null||i===void 0?void 0:i.noLocation)!==!0)return new bV.Location(n,this._lexer.lastToken,this._lexer.source)},t.peek=function(n){return this._lexer.token.kind===n},t.expectToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i;throw(0,Cd.syntaxError)(this._lexer.source,i.start,"Expected ".concat(uT(n),", found ").concat(Rd(i),"."))},t.expectOptionalToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i},t.expectKeyword=function(n){var i=this._lexer.token;if(i.kind===D.TokenKind.NAME&&i.value===n)this._lexer.advance();else throw(0,Cd.syntaxError)(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Rd(i),"."))},t.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===D.TokenKind.NAME&&i.value===n?(this._lexer.advance(),!0):!1},t.unexpected=function(n){var i=n??this._lexer.token;return(0,Cd.syntaxError)(this._lexer.source,i.start,"Unexpected ".concat(Rd(i),"."))},t.any=function(n,i,o){this.expectToken(n);for(var s=[];!this.expectOptionalToken(o);)s.push(i.call(this));return s},t.optionalMany=function(n,i,o){if(this.expectOptionalToken(n)){var s=[];do s.push(i.call(this));while(!this.expectOptionalToken(o));return s}return[]},t.many=function(n,i,o){this.expectToken(n);var s=[];do s.push(i.call(this));while(!this.expectOptionalToken(o));return s},t.delimitedMany=function(n,i){this.expectOptionalToken(n);var o=[];do o.push(i.call(this));while(this.expectOptionalToken(n));return o},e})();Rn.Parser=xu;function Rd(e){var t=e.value;return uT(e.kind)+(t!=null?' "'.concat(t,'"'):"")}function uT(e){return(0,aT.isPunctuatorTokenKind)(e)?'"'.concat(e,'"'):e}});var Hr=y(Tr=>{"use strict";p();Object.defineProperty(Tr,"__esModule",{value:!0});Tr.visit=CV;Tr.visitInParallel=RV;Tr.getVisitFn=Cu;Tr.BREAK=Tr.QueryDocumentKeys=void 0;var AV=xV(ae()),cT=Si();function xV(e){return e&&e.__esModule?e:{default:e}}var lT={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["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:["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"]};Tr.QueryDocumentKeys=lT;var Oi=Object.freeze({});Tr.BREAK=Oi;function CV(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:lT,n=void 0,i=Array.isArray(e),o=[e],s=-1,a=[],u=void 0,c=void 0,l=void 0,d=[],f=[],h=e;do{s++;var g=s===o.length,v=g&&a.length!==0;if(g){if(c=f.length===0?void 0:d[d.length-1],u=l,l=f.pop(),v){if(i)u=u.slice();else{for(var _={},b=0,S=Object.keys(u);b<S.length;b++){var I=S[b];_[I]=u[I]}u=_}for(var A=0,T=0;T<a.length;T++){var x=a[T][0],U=a[T][1];i&&(x-=A),i&&U===null?(u.splice(x,1),A++):u[x]=U}}s=n.index,o=n.keys,a=n.edits,i=n.inArray,n=n.prev}else{if(c=l?i?s:o[s]:void 0,u=l?l[c]:h,u==null)continue;l&&d.push(c)}var C=void 0;if(!Array.isArray(u)){if(!(0,cT.isNode)(u))throw new Error("Invalid AST Node: ".concat((0,AV.default)(u),"."));var te=Cu(t,u.kind,g);if(te){if(C=te.call(t,u,c,l,d,f),C===Oi)break;if(C===!1){if(!g){d.pop();continue}}else if(C!==void 0&&(a.push([c,C]),!g))if((0,cT.isNode)(C))u=C;else{d.pop();continue}}}if(C===void 0&&v&&a.push([c,u]),g)d.pop();else{var de;n={inArray:i,index:s,keys:o,edits:a,prev:n},i=Array.isArray(u),o=i?u:(de=r[u.kind])!==null&&de!==void 0?de:[],s=-1,a=[],l&&f.push(l),l=u}}while(n!==void 0);return a.length!==0&&(h=a[a.length-1][1]),h}function RV(e){var t=new Array(e.length);return{enter:function(n){for(var i=0;i<e.length;i++)if(t[i]==null){var o=Cu(e[i],n.kind,!1);if(o){var s=o.apply(e[i],arguments);if(s===!1)t[i]=n;else if(s===Oi)t[i]=Oi;else if(s!==void 0)return s}}},leave:function(n){for(var i=0;i<e.length;i++)if(t[i]==null){var o=Cu(e[i],n.kind,!0);if(o){var s=o.apply(e[i],arguments);if(s===Oi)t[i]=Oi;else if(s!==void 0&&s!==!1)return s}}else t[i]===n&&(t[i]=null)}}}function Cu(e,t,r){var n=e[t];if(n){if(!r&&typeof n=="function")return n;var i=r?n.leave:n.enter;if(typeof i=="function")return i}else{var o=r?e.leave:e.enter;if(o){if(typeof o=="function")return o;var s=o[t];if(typeof s=="function")return s}}}});var Ai=y(Ru=>{"use strict";p();Object.defineProperty(Ru,"__esModule",{value:!0});Ru.default=void 0;var NV=Array.prototype.find?function(e,t){return Array.prototype.find.call(e,t)}:function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(t(n))return n}},PV=NV;Ru.default=PV});var Tt=y(Nu=>{"use strict";p();Object.defineProperty(Nu,"__esModule",{value:!0});Nu.default=void 0;var DV=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},LV=DV;Nu.default=LV});var Jo=y(Nd=>{"use strict";p();Object.defineProperty(Nd,"__esModule",{value:!0});Nd.locatedError=FV;var kV=MV(ae()),jV=H();function MV(e){return e&&e.__esModule?e:{default:e}}function FV(e,t,r){var n,i=e instanceof Error?e:new Error("Unexpected error value: "+(0,kV.default)(e));return Array.isArray(i.path)?i:new jV.GraphQLError(i.message,(n=i.nodes)!==null&&n!==void 0?n:t,i.source,i.positions,r,i)}});var Pd=y(Pu=>{"use strict";p();Object.defineProperty(Pu,"__esModule",{value:!0});Pu.assertValidName=GV;Pu.isValidNameError=dT;var qV=UV(Mt()),pT=H();function UV(e){return e&&e.__esModule?e:{default:e}}var VV=/^[_a-zA-Z][_a-zA-Z0-9]*$/;function GV(e){var t=dT(e);if(t)throw t;return e}function dT(e){if(typeof e=="string"||(0,qV.default)(0,"Expected name to be a string."),e.length>1&&e[0]==="_"&&e[1]==="_")return new pT.GraphQLError('Name "'.concat(e,'" must not begin with "__", which is reserved by GraphQL introspection.'));if(!VV.test(e))return new pT.GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'.concat(e,'" does not.'))}});var xi=y(Du=>{"use strict";p();Object.defineProperty(Du,"__esModule",{value:!0});Du.default=void 0;var $V=Object.entries||function(e){return Object.keys(e).map(function(t){return[t,e[t]]})},BV=$V;Du.default=BV});var Qr=y(Dd=>{"use strict";p();Object.defineProperty(Dd,"__esModule",{value:!0});Dd.default=KV;function KV(e,t){return e.reduce(function(r,n){return r[t(n)]=n,r},Object.create(null))}});var kd=y(Ld=>{"use strict";p();Object.defineProperty(Ld,"__esModule",{value:!0});Ld.default=WV;var HV=QV(xi());function QV(e){return e&&e.__esModule?e:{default:e}}function WV(e,t){for(var r=Object.create(null),n=0,i=(0,HV.default)(e);n<i.length;n++){var o=i[n],s=o[0],a=o[1];r[s]=t(a,s)}return r}});var Lu=y(jd=>{"use strict";p();Object.defineProperty(jd,"__esModule",{value:!0});jd.default=JV;var zV=YV(xi());function YV(e){return e&&e.__esModule?e:{default:e}}function JV(e){if(Object.getPrototypeOf(e)===null)return e;for(var t=Object.create(null),r=0,n=(0,zV.default)(e);r<n.length;r++){var i=n[r],o=i[0],s=i[1];t[o]=s}return t}});var Xo=y(Md=>{"use strict";p();Object.defineProperty(Md,"__esModule",{value:!0});Md.default=XV;function XV(e,t,r){return e.reduce(function(n,i){return n[t(i)]=r(i),n},Object.create(null))}});var Wr=y(Fd=>{"use strict";p();Object.defineProperty(Fd,"__esModule",{value:!0});Fd.default=eG;var ZV=5;function eG(e,t){var r=typeof e=="string"?[e,t]:[void 0,e],n=r[0],i=r[1],o=" Did you mean ";n&&(o+=n+" ");var s=i.map(function(c){return'"'.concat(c,'"')});switch(s.length){case 0:return"";case 1:return o+s[0]+"?";case 2:return o+s[0]+" or "+s[1]+"?"}var a=s.slice(0,ZV),u=a.pop();return o+a.join(", ")+", or "+u+"?"}});var fT=y(qd=>{"use strict";p();Object.defineProperty(qd,"__esModule",{value:!0});qd.default=tG;function tG(e){return e}});var Zo=y(Vd=>{"use strict";p();Object.defineProperty(Vd,"__esModule",{value:!0});Vd.default=rG;function rG(e,t){for(var r=0,n=0;r<e.length&&n<t.length;){var i=e.charCodeAt(r),o=t.charCodeAt(n);if(ku(i)&&ku(o)){var s=0;do++r,s=s*10+i-Ud,i=e.charCodeAt(r);while(ku(i)&&s>0);var a=0;do++n,a=a*10+o-Ud,o=t.charCodeAt(n);while(ku(o)&&a>0);if(s<a)return-1;if(s>a)return 1}else{if(i<o)return-1;if(i>o)return 1;++r,++n}}return e.length-t.length}var Ud=48,nG=57;function ku(e){return!isNaN(e)&&Ud<=e&&e<=nG}});var zr=y(Gd=>{"use strict";p();Object.defineProperty(Gd,"__esModule",{value:!0});Gd.default=sG;var iG=oG(Zo());function oG(e){return e&&e.__esModule?e:{default:e}}function sG(e,t){for(var r=Object.create(null),n=new aG(e),i=Math.floor(e.length*.4)+1,o=0;o<t.length;o++){var s=t[o],a=n.measure(s,i);a!==void 0&&(r[s]=a)}return Object.keys(r).sort(function(u,c){var l=r[u]-r[c];return l!==0?l:(0,iG.default)(u,c)})}var aG=(function(){function e(r){this._input=r,this._inputLowerCase=r.toLowerCase(),this._inputArray=hT(this._inputLowerCase),this._rows=[new Array(r.length+1).fill(0),new Array(r.length+1).fill(0),new Array(r.length+1).fill(0)]}var t=e.prototype;return t.measure=function(n,i){if(this._input===n)return 0;var o=n.toLowerCase();if(this._inputLowerCase===o)return 1;var s=hT(o),a=this._inputArray;if(s.length<a.length){var u=s;s=a,a=u}var c=s.length,l=a.length;if(!(c-l>i)){for(var d=this._rows,f=0;f<=l;f++)d[0][f]=f;for(var h=1;h<=c;h++){for(var g=d[(h-1)%3],v=d[h%3],_=v[0]=h,b=1;b<=l;b++){var S=s[h-1]===a[b-1]?0:1,I=Math.min(g[b]+1,v[b-1]+1,g[b-1]+S);if(h>1&&b>1&&s[h-1]===a[b-2]&&s[h-2]===a[b-1]){var A=d[(h-2)%3][b-2];I=Math.min(I,A+1)}I<_&&(_=I),v[b]=I}if(_>i)return}var T=d[c%3][l];return T<=i?T:void 0}},e})();function hT(e){for(var t=e.length,r=new Array(t),n=0;n<t;++n)r[n]=e.charCodeAt(n);return r}});var mt=y($d=>{"use strict";p();Object.defineProperty($d,"__esModule",{value:!0});$d.print=lG;var uG=Hr(),cG=Ii();function lG(e){return(0,uG.visit)(e,{leave:dG})}var pG=80,dG={Name:function(t){return t.value},Variable:function(t){return"$"+t.name},Document:function(t){return F(t.definitions,`
|
|
54
54
|
|
|
55
55
|
`)+`
|
|
56
|
-
`},OperationDefinition:function(t){var r=t.operation,n=t.name,i=Pe("(",F(t.variableDefinitions,", "),")"),o=F(t.directives," "),s=t.selectionSet;return!n&&!o&&!i&&r==="query"?s:F([r,F([n,i]),o,s]," ")},VariableDefinition:function(t){var r=t.variable,n=t.type,i=t.defaultValue,o=t.directives;return r+": "+n+Pe(" = ",i)+Pe(" ",F(o," "))},SelectionSet:function(t){var r=t.selections;return zt(r)},Field:function(t){var r=t.alias,n=t.name,i=t.arguments,o=t.directives,s=t.selectionSet,a=Pe("",r,": ")+n,u=a+Pe("(",F(i,", "),")");return u.length>
|
|
56
|
+
`},OperationDefinition:function(t){var r=t.operation,n=t.name,i=Pe("(",F(t.variableDefinitions,", "),")"),o=F(t.directives," "),s=t.selectionSet;return!n&&!o&&!i&&r==="query"?s:F([r,F([n,i]),o,s]," ")},VariableDefinition:function(t){var r=t.variable,n=t.type,i=t.defaultValue,o=t.directives;return r+": "+n+Pe(" = ",i)+Pe(" ",F(o," "))},SelectionSet:function(t){var r=t.selections;return zt(r)},Field:function(t){var r=t.alias,n=t.name,i=t.arguments,o=t.directives,s=t.selectionSet,a=Pe("",r,": ")+n,u=a+Pe("(",F(i,", "),")");return u.length>pG&&(u=a+Pe(`(
|
|
57
57
|
`,ju(F(i,`
|
|
58
58
|
`)),`
|
|
59
|
-
)`)),F([u,F(o," "),s]," ")},Argument:function(t){var r=t.name,n=t.value;return r+": "+n},FragmentSpread:function(t){var r=t.name,n=t.directives;return"..."+r+Pe(" ",F(n," "))},InlineFragment:function(t){var r=t.typeCondition,n=t.directives,i=t.selectionSet;return F(["...",Pe("on ",r),F(n," "),i]," ")},FragmentDefinition:function(t){var r=t.name,n=t.typeCondition,i=t.variableDefinitions,o=t.directives,s=t.selectionSet;return"fragment ".concat(r).concat(Pe("(",F(i,", "),")")," ")+"on ".concat(n," ").concat(Pe("",F(o," ")," "))+s},IntValue:function(t){var r=t.value;return r},FloatValue:function(t){var r=t.value;return r},StringValue:function(t,r){var n=t.value,i=t.block;return i?(0,
|
|
59
|
+
)`)),F([u,F(o," "),s]," ")},Argument:function(t){var r=t.name,n=t.value;return r+": "+n},FragmentSpread:function(t){var r=t.name,n=t.directives;return"..."+r+Pe(" ",F(n," "))},InlineFragment:function(t){var r=t.typeCondition,n=t.directives,i=t.selectionSet;return F(["...",Pe("on ",r),F(n," "),i]," ")},FragmentDefinition:function(t){var r=t.name,n=t.typeCondition,i=t.variableDefinitions,o=t.directives,s=t.selectionSet;return"fragment ".concat(r).concat(Pe("(",F(i,", "),")")," ")+"on ".concat(n," ").concat(Pe("",F(o," ")," "))+s},IntValue:function(t){var r=t.value;return r},FloatValue:function(t){var r=t.value;return r},StringValue:function(t,r){var n=t.value,i=t.block;return i?(0,cG.printBlockString)(n,r==="description"?"":" "):JSON.stringify(n)},BooleanValue:function(t){var r=t.value;return r?"true":"false"},NullValue:function(){return"null"},EnumValue:function(t){var r=t.value;return r},ListValue:function(t){var r=t.values;return"["+F(r,", ")+"]"},ObjectValue:function(t){var r=t.fields;return"{"+F(r,", ")+"}"},ObjectField:function(t){var r=t.name,n=t.value;return r+": "+n},Directive:function(t){var r=t.name,n=t.arguments;return"@"+r+Pe("(",F(n,", "),")")},NamedType:function(t){var r=t.name;return r},ListType:function(t){var r=t.type;return"["+r+"]"},NonNullType:function(t){var r=t.type;return r+"!"},SchemaDefinition:Wt(function(e){var t=e.directives,r=e.operationTypes;return F(["schema",F(t," "),zt(r)]," ")}),OperationTypeDefinition:function(t){var r=t.operation,n=t.type;return r+": "+n},ScalarTypeDefinition:Wt(function(e){var t=e.name,r=e.directives;return F(["scalar",t,F(r," ")]," ")}),ObjectTypeDefinition:Wt(function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return F(["type",t,Pe("implements ",F(r," & ")),F(n," "),zt(i)]," ")}),FieldDefinition:Wt(function(e){var t=e.name,r=e.arguments,n=e.type,i=e.directives;return t+(mT(r)?Pe(`(
|
|
60
60
|
`,ju(F(r,`
|
|
61
61
|
`)),`
|
|
62
|
-
)`):Pe("(",F(r,", "),")"))+": "+n+Pe(" ",F(i," "))}),InputValueDefinition:Wt(function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return F([t+": "+r,Pe("= ",n),F(i," ")]," ")}),InterfaceTypeDefinition:Wt(function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return F(["interface",t,Pe("implements ",F(r," & ")),F(n," "),zt(i)]," ")}),UnionTypeDefinition:Wt(function(e){var t=e.name,r=e.directives,n=e.types;return F(["union",t,F(r," "),n&&n.length!==0?"= "+F(n," | "):""]," ")}),EnumTypeDefinition:Wt(function(e){var t=e.name,r=e.directives,n=e.values;return F(["enum",t,F(r," "),zt(n)]," ")}),EnumValueDefinition:Wt(function(e){var t=e.name,r=e.directives;return F([t,F(r," ")]," ")}),InputObjectTypeDefinition:Wt(function(e){var t=e.name,r=e.directives,n=e.fields;return F(["input",t,F(r," "),zt(n)]," ")}),DirectiveDefinition:Wt(function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(
|
|
62
|
+
)`):Pe("(",F(r,", "),")"))+": "+n+Pe(" ",F(i," "))}),InputValueDefinition:Wt(function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return F([t+": "+r,Pe("= ",n),F(i," ")]," ")}),InterfaceTypeDefinition:Wt(function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return F(["interface",t,Pe("implements ",F(r," & ")),F(n," "),zt(i)]," ")}),UnionTypeDefinition:Wt(function(e){var t=e.name,r=e.directives,n=e.types;return F(["union",t,F(r," "),n&&n.length!==0?"= "+F(n," | "):""]," ")}),EnumTypeDefinition:Wt(function(e){var t=e.name,r=e.directives,n=e.values;return F(["enum",t,F(r," "),zt(n)]," ")}),EnumValueDefinition:Wt(function(e){var t=e.name,r=e.directives;return F([t,F(r," ")]," ")}),InputObjectTypeDefinition:Wt(function(e){var t=e.name,r=e.directives,n=e.fields;return F(["input",t,F(r," "),zt(n)]," ")}),DirectiveDefinition:Wt(function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(mT(r)?Pe(`(
|
|
63
63
|
`,ju(F(r,`
|
|
64
64
|
`)),`
|
|
65
65
|
)`):Pe("(",F(r,", "),")"))+(n?" repeatable":"")+" on "+F(i," | ")}),SchemaExtension:function(t){var r=t.directives,n=t.operationTypes;return F(["extend schema",F(r," "),zt(n)]," ")},ScalarTypeExtension:function(t){var r=t.name,n=t.directives;return F(["extend scalar",r,F(n," ")]," ")},ObjectTypeExtension:function(t){var r=t.name,n=t.interfaces,i=t.directives,o=t.fields;return F(["extend type",r,Pe("implements ",F(n," & ")),F(i," "),zt(o)]," ")},InterfaceTypeExtension:function(t){var r=t.name,n=t.interfaces,i=t.directives,o=t.fields;return F(["extend interface",r,Pe("implements ",F(n," & ")),F(i," "),zt(o)]," ")},UnionTypeExtension:function(t){var r=t.name,n=t.directives,i=t.types;return F(["extend union",r,F(n," "),i&&i.length!==0?"= "+F(i," | "):""]," ")},EnumTypeExtension:function(t){var r=t.name,n=t.directives,i=t.values;return F(["extend enum",r,F(n," "),zt(i)]," ")},InputObjectTypeExtension:function(t){var r=t.name,n=t.directives,i=t.fields;return F(["extend input",r,F(n," "),zt(i)]," ")}};function Wt(e){return function(t){return F([t.description,e(t)],`
|
|
@@ -67,16 +67,16 @@ spurious results.`))}}return!1};Tu.default=JU});var Iu=y(Qo=>{"use strict";p();O
|
|
|
67
67
|
`,ju(F(e,`
|
|
68
68
|
`)),`
|
|
69
69
|
}`)}function Pe(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return t!=null&&t!==""?e+t+r:""}function ju(e){return Pe(" ",e.replace(/\n/g,`
|
|
70
|
-
`))}function
|
|
71
|
-
`)!==-1}function hT(e){return e!=null&&e.some(cG)}});var Qd=y(Hd=>{"use strict";p();Object.defineProperty(Hd,"__esModule",{value:!0});Hd.valueFromASTUntyped=Bd;var lG=Kd(ae()),pG=Kd(et()),dG=Kd(Jo()),Ir=_e();function Kd(e){return e&&e.__esModule?e:{default:e}}function Bd(e,t){switch(e.kind){case Ir.Kind.NULL:return null;case Ir.Kind.INT:return parseInt(e.value,10);case Ir.Kind.FLOAT:return parseFloat(e.value);case Ir.Kind.STRING:case Ir.Kind.ENUM:case Ir.Kind.BOOLEAN:return e.value;case Ir.Kind.LIST:return e.values.map(function(r){return Bd(r,t)});case Ir.Kind.OBJECT:return(0,dG.default)(e.fields,function(r){return r.name.value},function(r){return Bd(r.value,t)});case Ir.Kind.VARIABLE:return t?.[e.name.value]}(0,pG.default)(0,"Unexpected value node: "+(0,lG.default)(e))}});var ie=y(B=>{"use strict";p();Object.defineProperty(B,"__esModule",{value:!0});B.isType=Wd;B.assertType=_T;B.isScalarType=Nn;B.assertScalarType=EG;B.isObjectType=Ni;B.assertObjectType=_G;B.isInterfaceType=Pn;B.assertInterfaceType=bG;B.isUnionType=Dn;B.assertUnionType=SG;B.isEnumType=Ln;B.assertEnumType=TG;B.isInputObjectType=es;B.assertInputObjectType=IG;B.isListType=qu;B.assertListType=wG;B.isNonNullType=tn;B.assertNonNullType=OG;B.isInputType=zd;B.assertInputType=AG;B.isOutputType=Yd;B.assertOutputType=xG;B.isLeafType=bT;B.assertLeafType=CG;B.isCompositeType=ST;B.assertCompositeType=RG;B.isAbstractType=TT;B.assertAbstractType=NG;B.GraphQLList=Yr;B.GraphQLNonNull=Jr;B.isWrappingType=ts;B.assertWrappingType=PG;B.isNullableType=IT;B.assertNullableType=wT;B.getNullableType=DG;B.isNamedType=OT;B.assertNamedType=LG;B.getNamedType=kG;B.argsToArgsConfig=RT;B.isRequiredArgument=jG;B.isRequiredInputField=UG;B.GraphQLInputObjectType=B.GraphQLEnumType=B.GraphQLUnionType=B.GraphQLInterfaceType=B.GraphQLObjectType=B.GraphQLScalarType=void 0;var vT=Tt(xi()),Xr=ur(),we=Tt(ae()),fG=Tt(Qr()),Fu=Tt(kd()),lr=Tt(Lu()),Ae=Tt(Mt()),ET=Tt(Jo()),Zr=Tt(Ho()),hG=Tt(Wr()),mG=Tt(ar()),mT=Tt(dT()),en=Tt(vu()),gG=Tt(zr()),Zo=H(),yG=_e(),gT=mt(),vG=Qd();function Tt(e){return e&&e.__esModule?e:{default:e}}function yT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ri(e,t,r){return t&&yT(e.prototype,t),r&&yT(e,r),e}function Wd(e){return Nn(e)||Ni(e)||Pn(e)||Dn(e)||Ln(e)||es(e)||qu(e)||tn(e)}function _T(e){if(!Wd(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL type."));return e}function Nn(e){return(0,Zr.default)(e,Jd)}function EG(e){if(!Nn(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL Scalar type."));return e}function Ni(e){return(0,Zr.default)(e,Xd)}function _G(e){if(!Ni(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL Object type."));return e}function Pn(e){return(0,Zr.default)(e,Zd)}function bG(e){if(!Pn(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL Interface type."));return e}function Dn(e){return(0,Zr.default)(e,ef)}function SG(e){if(!Dn(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL Union type."));return e}function Ln(e){return(0,Zr.default)(e,tf)}function TG(e){if(!Ln(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL Enum type."));return e}function es(e){return(0,Zr.default)(e,rf)}function IG(e){if(!es(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL Input Object type."));return e}function qu(e){return(0,Zr.default)(e,Yr)}function wG(e){if(!qu(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL List type."));return e}function tn(e){return(0,Zr.default)(e,Jr)}function OG(e){if(!tn(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL Non-Null type."));return e}function zd(e){return Nn(e)||Ln(e)||es(e)||ts(e)&&zd(e.ofType)}function AG(e){if(!zd(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL input type."));return e}function Yd(e){return Nn(e)||Ni(e)||Pn(e)||Dn(e)||Ln(e)||ts(e)&&Yd(e.ofType)}function xG(e){if(!Yd(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL output type."));return e}function bT(e){return Nn(e)||Ln(e)}function CG(e){if(!bT(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL leaf type."));return e}function ST(e){return Ni(e)||Pn(e)||Dn(e)}function RG(e){if(!ST(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL composite type."));return e}function TT(e){return Pn(e)||Dn(e)}function NG(e){if(!TT(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL abstract type."));return e}function Yr(e){if(this instanceof Yr)this.ofType=_T(e);else return new Yr(e)}Yr.prototype.toString=function(){return"["+String(this.ofType)+"]"};Yr.prototype.toJSON=function(){return this.toString()};Object.defineProperty(Yr.prototype,Xr.SYMBOL_TO_STRING_TAG,{get:function(){return"GraphQLList"}});(0,en.default)(Yr);function Jr(e){if(this instanceof Jr)this.ofType=wT(e);else return new Jr(e)}Jr.prototype.toString=function(){return String(this.ofType)+"!"};Jr.prototype.toJSON=function(){return this.toString()};Object.defineProperty(Jr.prototype,Xr.SYMBOL_TO_STRING_TAG,{get:function(){return"GraphQLNonNull"}});(0,en.default)(Jr);function ts(e){return qu(e)||tn(e)}function PG(e){if(!ts(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL wrapping type."));return e}function IT(e){return Wd(e)&&!tn(e)}function wT(e){if(!IT(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL nullable type."));return e}function DG(e){if(e)return tn(e)?e.ofType:e}function OT(e){return Nn(e)||Ni(e)||Pn(e)||Dn(e)||Ln(e)||es(e)}function LG(e){if(!OT(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL named type."));return e}function kG(e){if(e){for(var t=e;ts(t);)t=t.ofType;return t}}function Uu(e){return typeof e=="function"?e():e}function Pi(e){return e&&e.length>0?e:void 0}var Jd=(function(){function e(r){var n,i,o,s=(n=r.parseValue)!==null&&n!==void 0?n:mT.default;this.name=r.name,this.description=r.description,this.specifiedByUrl=r.specifiedByUrl,this.serialize=(i=r.serialize)!==null&&i!==void 0?i:mT.default,this.parseValue=s,this.parseLiteral=(o=r.parseLiteral)!==null&&o!==void 0?o:function(a,u){return s((0,vG.valueFromASTUntyped)(a,u))},this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Pi(r.extensionASTNodes),typeof r.name=="string"||(0,Ae.default)(0,"Must provide name."),r.specifiedByUrl==null||typeof r.specifiedByUrl=="string"||(0,Ae.default)(0,"".concat(this.name,' must provide "specifiedByUrl" as a string, ')+"but got: ".concat((0,we.default)(r.specifiedByUrl),".")),r.serialize==null||typeof r.serialize=="function"||(0,Ae.default)(0,"".concat(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.')),r.parseLiteral&&(typeof r.parseValue=="function"&&typeof r.parseLiteral=="function"||(0,Ae.default)(0,"".concat(this.name,' must provide both "parseValue" and "parseLiteral" functions.')))}var t=e.prototype;return t.toConfig=function(){var n;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:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ri(e,[{key:Xr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLScalarType"}}]),e})();B.GraphQLScalarType=Jd;(0,en.default)(Jd);var Xd=(function(){function e(r){this.name=r.name,this.description=r.description,this.isTypeOf=r.isTypeOf,this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Pi(r.extensionASTNodes),this._fields=xT.bind(void 0,r),this._interfaces=AT.bind(void 0,r),typeof r.name=="string"||(0,Ae.default)(0,"Must provide name."),r.isTypeOf==null||typeof r.isTypeOf=="function"||(0,Ae.default)(0,"".concat(this.name,' must provide "isTypeOf" as a function, ')+"but got: ".concat((0,we.default)(r.isTypeOf),"."))}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},t.toConfig=function(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:CT(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes||[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ri(e,[{key:Xr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLObjectType"}}]),e})();B.GraphQLObjectType=Xd;(0,en.default)(Xd);function AT(e){var t,r=(t=Uu(e.interfaces))!==null&&t!==void 0?t:[];return Array.isArray(r)||(0,Ae.default)(0,"".concat(e.name," interfaces must be an Array or a function which returns an Array.")),r}function xT(e){var t=Uu(e.fields);return Ci(t)||(0,Ae.default)(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),(0,Fu.default)(t,function(r,n){var i;Ci(r)||(0,Ae.default)(0,"".concat(e.name,".").concat(n," field config must be an object.")),!("isDeprecated"in r)||(0,Ae.default)(0,"".concat(e.name,".").concat(n,' should provide "deprecationReason" instead of "isDeprecated".')),r.resolve==null||typeof r.resolve=="function"||(0,Ae.default)(0,"".concat(e.name,".").concat(n," field resolver must be a function if ")+"provided, but got: ".concat((0,we.default)(r.resolve),"."));var o=(i=r.args)!==null&&i!==void 0?i:{};Ci(o)||(0,Ae.default)(0,"".concat(e.name,".").concat(n," args must be an object with argument names as keys."));var s=(0,vT.default)(o).map(function(a){var u=a[0],c=a[1];return{name:u,description:c.description,type:c.type,defaultValue:c.defaultValue,deprecationReason:c.deprecationReason,extensions:c.extensions&&(0,lr.default)(c.extensions),astNode:c.astNode}});return{name:n,description:r.description,type:r.type,args:s,resolve:r.resolve,subscribe:r.subscribe,isDeprecated:r.deprecationReason!=null,deprecationReason:r.deprecationReason,extensions:r.extensions&&(0,lr.default)(r.extensions),astNode:r.astNode}})}function Ci(e){return(0,mG.default)(e)&&!Array.isArray(e)}function CT(e){return(0,Fu.default)(e,function(t){return{description:t.description,type:t.type,args:RT(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}})}function RT(e){return(0,ET.default)(e,function(t){return t.name},function(t){return{description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}})}function jG(e){return tn(e.type)&&e.defaultValue===void 0}var Zd=(function(){function e(r){this.name=r.name,this.description=r.description,this.resolveType=r.resolveType,this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Pi(r.extensionASTNodes),this._fields=xT.bind(void 0,r),this._interfaces=AT.bind(void 0,r),typeof r.name=="string"||(0,Ae.default)(0,"Must provide name."),r.resolveType==null||typeof r.resolveType=="function"||(0,Ae.default)(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat((0,we.default)(r.resolveType),"."))}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},t.toConfig=function(){var n;return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:CT(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ri(e,[{key:Xr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLInterfaceType"}}]),e})();B.GraphQLInterfaceType=Zd;(0,en.default)(Zd);var ef=(function(){function e(r){this.name=r.name,this.description=r.description,this.resolveType=r.resolveType,this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Pi(r.extensionASTNodes),this._types=MG.bind(void 0,r),typeof r.name=="string"||(0,Ae.default)(0,"Must provide name."),r.resolveType==null||typeof r.resolveType=="function"||(0,Ae.default)(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat((0,we.default)(r.resolveType),"."))}var t=e.prototype;return t.getTypes=function(){return typeof this._types=="function"&&(this._types=this._types()),this._types},t.toConfig=function(){var n;return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ri(e,[{key:Xr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLUnionType"}}]),e})();B.GraphQLUnionType=ef;(0,en.default)(ef);function MG(e){var t=Uu(e.types);return Array.isArray(t)||(0,Ae.default)(0,"Must provide Array of types or a function which returns such an array for Union ".concat(e.name,".")),t}var tf=(function(){function e(r){this.name=r.name,this.description=r.description,this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Pi(r.extensionASTNodes),this._values=FG(this.name,r.values),this._valueLookup=new Map(this._values.map(function(n){return[n.value,n]})),this._nameLookup=(0,fG.default)(this._values,function(n){return n.name}),typeof r.name=="string"||(0,Ae.default)(0,"Must provide name.")}var t=e.prototype;return t.getValues=function(){return this._values},t.getValue=function(n){return this._nameLookup[n]},t.serialize=function(n){var i=this._valueLookup.get(n);if(i===void 0)throw new Zo.GraphQLError('Enum "'.concat(this.name,'" cannot represent value: ').concat((0,we.default)(n)));return i.name},t.parseValue=function(n){if(typeof n!="string"){var i=(0,we.default)(n);throw new Zo.GraphQLError('Enum "'.concat(this.name,'" cannot represent non-string value: ').concat(i,".")+Mu(this,i))}var o=this.getValue(n);if(o==null)throw new Zo.GraphQLError('Value "'.concat(n,'" does not exist in "').concat(this.name,'" enum.')+Mu(this,n));return o.value},t.parseLiteral=function(n,i){if(n.kind!==yG.Kind.ENUM){var o=(0,gT.print)(n);throw new Zo.GraphQLError('Enum "'.concat(this.name,'" cannot represent non-enum value: ').concat(o,".")+Mu(this,o),n)}var s=this.getValue(n.value);if(s==null){var a=(0,gT.print)(n);throw new Zo.GraphQLError('Value "'.concat(a,'" does not exist in "').concat(this.name,'" enum.')+Mu(this,a),n)}return s.value},t.toConfig=function(){var n,i=(0,ET.default)(this.getValues(),function(o){return o.name},function(o){return{description:o.description,value:o.value,deprecationReason:o.deprecationReason,extensions:o.extensions,astNode:o.astNode}});return{name:this.name,description:this.description,values:i,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ri(e,[{key:Xr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLEnumType"}}]),e})();B.GraphQLEnumType=tf;(0,en.default)(tf);function Mu(e,t){var r=e.getValues().map(function(i){return i.name}),n=(0,gG.default)(t,r);return(0,hG.default)("the enum value",n)}function FG(e,t){return Ci(t)||(0,Ae.default)(0,"".concat(e," values must be an object with value names as keys.")),(0,vT.default)(t).map(function(r){var n=r[0],i=r[1];return Ci(i)||(0,Ae.default)(0,"".concat(e,".").concat(n,' must refer to an object with a "value" key ')+"representing an internal value but got: ".concat((0,we.default)(i),".")),!("isDeprecated"in i)||(0,Ae.default)(0,"".concat(e,".").concat(n,' should provide "deprecationReason" instead of "isDeprecated".')),{name:n,description:i.description,value:i.value!==void 0?i.value:n,isDeprecated:i.deprecationReason!=null,deprecationReason:i.deprecationReason,extensions:i.extensions&&(0,lr.default)(i.extensions),astNode:i.astNode}})}var rf=(function(){function e(r){this.name=r.name,this.description=r.description,this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Pi(r.extensionASTNodes),this._fields=qG.bind(void 0,r),typeof r.name=="string"||(0,Ae.default)(0,"Must provide name.")}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.toConfig=function(){var n,i=(0,Fu.default)(this.getFields(),function(o){return{description:o.description,type:o.type,defaultValue:o.defaultValue,deprecationReason:o.deprecationReason,extensions:o.extensions,astNode:o.astNode}});return{name:this.name,description:this.description,fields:i,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ri(e,[{key:Xr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLInputObjectType"}}]),e})();B.GraphQLInputObjectType=rf;(0,en.default)(rf);function qG(e){var t=Uu(e.fields);return Ci(t)||(0,Ae.default)(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),(0,Fu.default)(t,function(r,n){return!("resolve"in r)||(0,Ae.default)(0,"".concat(e.name,".").concat(n," field has a resolve property, but Input Types cannot define resolvers.")),{name:n,description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions&&(0,lr.default)(r.extensions),astNode:r.astNode}})}function UG(e){return tn(e.type)&&e.defaultValue===void 0}});var ns=y(rs=>{"use strict";p();Object.defineProperty(rs,"__esModule",{value:!0});rs.isEqualType=nf;rs.isTypeSubTypeOf=Vu;rs.doTypesOverlap=VG;var nt=ie();function nf(e,t){return e===t?!0:(0,nt.isNonNullType)(e)&&(0,nt.isNonNullType)(t)||(0,nt.isListType)(e)&&(0,nt.isListType)(t)?nf(e.ofType,t.ofType):!1}function Vu(e,t,r){return t===r?!0:(0,nt.isNonNullType)(r)?(0,nt.isNonNullType)(t)?Vu(e,t.ofType,r.ofType):!1:(0,nt.isNonNullType)(t)?Vu(e,t.ofType,r):(0,nt.isListType)(r)?(0,nt.isListType)(t)?Vu(e,t.ofType,r.ofType):!1:(0,nt.isListType)(t)?!1:(0,nt.isAbstractType)(r)&&((0,nt.isInterfaceType)(t)||(0,nt.isObjectType)(t))&&e.isSubType(r,t)}function VG(e,t,r){return t===r?!0:(0,nt.isAbstractType)(t)?(0,nt.isAbstractType)(r)?e.getPossibleTypes(t).some(function(n){return e.isSubType(r,n)}):e.isSubType(t,r):(0,nt.isAbstractType)(r)?e.isSubType(r,t):!1}});var of=y(Gu=>{"use strict";p();Object.defineProperty(Gu,"__esModule",{value:!0});Gu.default=void 0;var GG=ur(),$G=Array.from||function(e,t,r){if(e==null)throw new TypeError("Array.from requires an array-like object - not null or undefined");var n=e[GG.SYMBOL_ITERATOR];if(typeof n=="function"){for(var i=n.call(e),o=[],s,a=0;!(s=i.next()).done;++a)if(o.push(t.call(r,s.value,a)),a>9999999)throw new TypeError("Near-infinite iteration.");return o}var u=e.length;if(typeof u=="number"&&u>=0&&u%1===0){for(var c=[],l=0;l<u;++l)Object.prototype.hasOwnProperty.call(e,l)&&c.push(t.call(r,e[l],l));return c}return[]},BG=$G;Gu.default=BG});var sf=y($u=>{"use strict";p();Object.defineProperty($u,"__esModule",{value:!0});$u.default=void 0;var KG=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},HG=KG;$u.default=HG});var Ku=y(af=>{"use strict";p();Object.defineProperty(af,"__esModule",{value:!0});af.default=WG;var QG=ur();function Bu(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Bu=function(r){return typeof r}:Bu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Bu(e)}function WG(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(l){return l};if(e==null||Bu(e)!=="object")return null;if(Array.isArray(e))return e.map(t);var r=e[QG.SYMBOL_ITERATOR];if(typeof r=="function"){for(var n=r.call(e),i=[],o,s=0;!(o=n.next()).done;++s)i.push(t(o.value,s));return i}var a=e.length;if(typeof a=="number"&&a>=0&&a%1===0){for(var u=[],c=0;c<a;++c){if(!Object.prototype.hasOwnProperty.call(e,c))return null;u.push(t(e[String(c)],c))}return u}return null}});var NT=y(Hu=>{"use strict";p();Object.defineProperty(Hu,"__esModule",{value:!0});Hu.default=void 0;var zG=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},YG=zG;Hu.default=YG});var pr=y(lt=>{"use strict";p();Object.defineProperty(lt,"__esModule",{value:!0});lt.isSpecifiedScalarType=a1;lt.specifiedScalarTypes=lt.GraphQLID=lt.GraphQLBoolean=lt.GraphQLString=lt.GraphQLFloat=lt.GraphQLInt=void 0;var Qu=zu(sf()),Wu=zu(NT()),Yt=zu(ae()),PT=zu(ar()),kn=_e(),is=mt(),ze=H(),os=ie();function zu(e){return e&&e.__esModule?e:{default:e}}var uf=2147483647,cf=-2147483648;function JG(e){var t=ss(e);if(typeof t=="boolean")return t?1:0;var r=t;if(typeof t=="string"&&t!==""&&(r=Number(t)),!(0,Wu.default)(r))throw new ze.GraphQLError("Int cannot represent non-integer value: ".concat((0,Yt.default)(t)));if(r>uf||r<cf)throw new ze.GraphQLError("Int cannot represent non 32-bit signed integer value: "+(0,Yt.default)(t));return r}function XG(e){if(!(0,Wu.default)(e))throw new ze.GraphQLError("Int cannot represent non-integer value: ".concat((0,Yt.default)(e)));if(e>uf||e<cf)throw new ze.GraphQLError("Int cannot represent non 32-bit signed integer value: ".concat(e));return e}var DT=new os.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:JG,parseValue:XG,parseLiteral:function(t){if(t.kind!==kn.Kind.INT)throw new ze.GraphQLError("Int cannot represent non-integer value: ".concat((0,is.print)(t)),t);var r=parseInt(t.value,10);if(r>uf||r<cf)throw new ze.GraphQLError("Int cannot represent non 32-bit signed integer value: ".concat(t.value),t);return r}});lt.GraphQLInt=DT;function ZG(e){var t=ss(e);if(typeof t=="boolean")return t?1:0;var r=t;if(typeof t=="string"&&t!==""&&(r=Number(t)),!(0,Qu.default)(r))throw new ze.GraphQLError("Float cannot represent non numeric value: ".concat((0,Yt.default)(t)));return r}function e1(e){if(!(0,Qu.default)(e))throw new ze.GraphQLError("Float cannot represent non numeric value: ".concat((0,Yt.default)(e)));return e}var LT=new os.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:ZG,parseValue:e1,parseLiteral:function(t){if(t.kind!==kn.Kind.FLOAT&&t.kind!==kn.Kind.INT)throw new ze.GraphQLError("Float cannot represent non numeric value: ".concat((0,is.print)(t)),t);return parseFloat(t.value)}});lt.GraphQLFloat=LT;function ss(e){if((0,PT.default)(e)){if(typeof e.valueOf=="function"){var t=e.valueOf();if(!(0,PT.default)(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}function t1(e){var t=ss(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if((0,Qu.default)(t))return t.toString();throw new ze.GraphQLError("String cannot represent value: ".concat((0,Yt.default)(e)))}function r1(e){if(typeof e!="string")throw new ze.GraphQLError("String cannot represent a non string value: ".concat((0,Yt.default)(e)));return e}var kT=new os.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:t1,parseValue:r1,parseLiteral:function(t){if(t.kind!==kn.Kind.STRING)throw new ze.GraphQLError("String cannot represent a non string value: ".concat((0,is.print)(t)),t);return t.value}});lt.GraphQLString=kT;function n1(e){var t=ss(e);if(typeof t=="boolean")return t;if((0,Qu.default)(t))return t!==0;throw new ze.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0,Yt.default)(t)))}function i1(e){if(typeof e!="boolean")throw new ze.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0,Yt.default)(e)));return e}var jT=new os.GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:n1,parseValue:i1,parseLiteral:function(t){if(t.kind!==kn.Kind.BOOLEAN)throw new ze.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0,is.print)(t)),t);return t.value}});lt.GraphQLBoolean=jT;function o1(e){var t=ss(e);if(typeof t=="string")return t;if((0,Wu.default)(t))return String(t);throw new ze.GraphQLError("ID cannot represent value: ".concat((0,Yt.default)(e)))}function s1(e){if(typeof e=="string")return e;if((0,Wu.default)(e))return e.toString();throw new ze.GraphQLError("ID cannot represent value: ".concat((0,Yt.default)(e)))}var MT=new os.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:o1,parseValue:s1,parseLiteral:function(t){if(t.kind!==kn.Kind.STRING&&t.kind!==kn.Kind.INT)throw new ze.GraphQLError("ID cannot represent a non-string and non-integer value: "+(0,is.print)(t),t);return t.value}});lt.GraphQLID=MT;var FT=Object.freeze([kT,DT,LT,jT,MT]);lt.specifiedScalarTypes=FT;function a1(e){return FT.some(function(t){var r=t.name;return e.name===r})}});var cs=y(lf=>{"use strict";p();Object.defineProperty(lf,"__esModule",{value:!0});lf.astFromValue=us;var u1=Di(sf()),c1=Di(St()),qT=Di(ae()),l1=Di(et()),p1=Di(ar()),d1=Di(Ku()),Ft=_e(),f1=pr(),as=ie();function Di(e){return e&&e.__esModule?e:{default:e}}function us(e,t){if((0,as.isNonNullType)(t)){var r=us(e,t.ofType);return r?.kind===Ft.Kind.NULL?null:r}if(e===null)return{kind:Ft.Kind.NULL};if(e===void 0)return null;if((0,as.isListType)(t)){var n=t.ofType,i=(0,d1.default)(e);if(i!=null){for(var o=[],s=0;s<i.length;s++){var a=i[s],u=us(a,n);u!=null&&o.push(u)}return{kind:Ft.Kind.LIST,values:o}}return us(e,n)}if((0,as.isInputObjectType)(t)){if(!(0,p1.default)(e))return null;for(var c=[],l=0,d=(0,c1.default)(t.getFields());l<d.length;l++){var f=d[l],h=us(e[f.name],f.type);h&&c.push({kind:Ft.Kind.OBJECT_FIELD,name:{kind:Ft.Kind.NAME,value:f.name},value:h})}return{kind:Ft.Kind.OBJECT,fields:c}}if((0,as.isLeafType)(t)){var g=t.serialize(e);if(g==null)return null;if(typeof g=="boolean")return{kind:Ft.Kind.BOOLEAN,value:g};if(typeof g=="number"&&(0,u1.default)(g)){var v=String(g);return UT.test(v)?{kind:Ft.Kind.INT,value:v}:{kind:Ft.Kind.FLOAT,value:v}}if(typeof g=="string")return(0,as.isEnumType)(t)?{kind:Ft.Kind.ENUM,value:g}:t===f1.GraphQLID&&UT.test(g)?{kind:Ft.Kind.INT,value:g}:{kind:Ft.Kind.STRING,value:g};throw new TypeError("Cannot convert value to AST: ".concat((0,qT.default)(g),"."))}(0,l1.default)(0,"Unexpected input type: "+(0,qT.default)(t))}var UT=/^-?(?:0|[1-9][0-9]*)$/});var Ut=y(ve=>{"use strict";p();Object.defineProperty(ve,"__esModule",{value:!0});ve.isIntrospectionType=b1;ve.introspectionTypes=ve.TypeNameMetaFieldDef=ve.TypeMetaFieldDef=ve.SchemaMetaFieldDef=ve.__TypeKind=ve.TypeKind=ve.__EnumValue=ve.__InputValue=ve.__Field=ve.__Type=ve.__DirectiveLocation=ve.__Directive=ve.__Schema=void 0;var pf=df(St()),h1=df(ae()),m1=df(et()),g1=mt(),Be=Ti(),y1=cs(),be=pr(),q=ie();function df(e){return e&&e.__esModule?e:{default:e}}var ff=new q.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:function(){return{description:{type:be.GraphQLString,resolve:function(r){return r.description}},types:{description:"A list of all types supported by this server.",type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(qt))),resolve:function(r){return(0,pf.default)(r.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new q.GraphQLNonNull(qt),resolve:function(r){return r.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:qt,resolve:function(r){return r.getMutationType()}},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:qt,resolve:function(r){return r.getSubscriptionType()}},directives:{description:"A list of all directives supported by this server.",type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(hf))),resolve:function(r){return r.getDirectives()}}}}});ve.__Schema=ff;var hf=new q.GraphQLObjectType({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
70
|
+
`))}function fG(e){return e.indexOf(`
|
|
71
|
+
`)!==-1}function mT(e){return e!=null&&e.some(fG)}});var Qd=y(Hd=>{"use strict";p();Object.defineProperty(Hd,"__esModule",{value:!0});Hd.valueFromASTUntyped=Bd;var hG=Kd(ae()),mG=Kd(et()),gG=Kd(Xo()),Ir=_e();function Kd(e){return e&&e.__esModule?e:{default:e}}function Bd(e,t){switch(e.kind){case Ir.Kind.NULL:return null;case Ir.Kind.INT:return parseInt(e.value,10);case Ir.Kind.FLOAT:return parseFloat(e.value);case Ir.Kind.STRING:case Ir.Kind.ENUM:case Ir.Kind.BOOLEAN:return e.value;case Ir.Kind.LIST:return e.values.map(function(r){return Bd(r,t)});case Ir.Kind.OBJECT:return(0,gG.default)(e.fields,function(r){return r.name.value},function(r){return Bd(r.value,t)});case Ir.Kind.VARIABLE:return t?.[e.name.value]}(0,mG.default)(0,"Unexpected value node: "+(0,hG.default)(e))}});var ie=y(B=>{"use strict";p();Object.defineProperty(B,"__esModule",{value:!0});B.isType=Wd;B.assertType=ST;B.isScalarType=Nn;B.assertScalarType=TG;B.isObjectType=Ni;B.assertObjectType=IG;B.isInterfaceType=Pn;B.assertInterfaceType=wG;B.isUnionType=Dn;B.assertUnionType=OG;B.isEnumType=Ln;B.assertEnumType=AG;B.isInputObjectType=ts;B.assertInputObjectType=xG;B.isListType=qu;B.assertListType=CG;B.isNonNullType=tn;B.assertNonNullType=RG;B.isInputType=zd;B.assertInputType=NG;B.isOutputType=Yd;B.assertOutputType=PG;B.isLeafType=bT;B.assertLeafType=DG;B.isCompositeType=TT;B.assertCompositeType=LG;B.isAbstractType=IT;B.assertAbstractType=kG;B.GraphQLList=Yr;B.GraphQLNonNull=Jr;B.isWrappingType=rs;B.assertWrappingType=jG;B.isNullableType=wT;B.assertNullableType=OT;B.getNullableType=MG;B.isNamedType=AT;B.assertNamedType=FG;B.getNamedType=qG;B.argsToArgsConfig=NT;B.isRequiredArgument=UG;B.isRequiredInputField=BG;B.GraphQLInputObjectType=B.GraphQLEnumType=B.GraphQLUnionType=B.GraphQLInterfaceType=B.GraphQLObjectType=B.GraphQLScalarType=void 0;var ET=It(xi()),Xr=ur(),we=It(ae()),yG=It(Qr()),Fu=It(kd()),lr=It(Lu()),Ae=It(Mt()),_T=It(Xo()),Zr=It(Qo()),vG=It(Wr()),EG=It(ar()),gT=It(fT()),en=It(vu()),_G=It(zr()),es=H(),SG=_e(),yT=mt(),bG=Qd();function It(e){return e&&e.__esModule?e:{default:e}}function vT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ri(e,t,r){return t&&vT(e.prototype,t),r&&vT(e,r),e}function Wd(e){return Nn(e)||Ni(e)||Pn(e)||Dn(e)||Ln(e)||ts(e)||qu(e)||tn(e)}function ST(e){if(!Wd(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL type."));return e}function Nn(e){return(0,Zr.default)(e,Jd)}function TG(e){if(!Nn(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL Scalar type."));return e}function Ni(e){return(0,Zr.default)(e,Xd)}function IG(e){if(!Ni(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL Object type."));return e}function Pn(e){return(0,Zr.default)(e,Zd)}function wG(e){if(!Pn(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL Interface type."));return e}function Dn(e){return(0,Zr.default)(e,ef)}function OG(e){if(!Dn(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL Union type."));return e}function Ln(e){return(0,Zr.default)(e,tf)}function AG(e){if(!Ln(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL Enum type."));return e}function ts(e){return(0,Zr.default)(e,rf)}function xG(e){if(!ts(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL Input Object type."));return e}function qu(e){return(0,Zr.default)(e,Yr)}function CG(e){if(!qu(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL List type."));return e}function tn(e){return(0,Zr.default)(e,Jr)}function RG(e){if(!tn(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL Non-Null type."));return e}function zd(e){return Nn(e)||Ln(e)||ts(e)||rs(e)&&zd(e.ofType)}function NG(e){if(!zd(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL input type."));return e}function Yd(e){return Nn(e)||Ni(e)||Pn(e)||Dn(e)||Ln(e)||rs(e)&&Yd(e.ofType)}function PG(e){if(!Yd(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL output type."));return e}function bT(e){return Nn(e)||Ln(e)}function DG(e){if(!bT(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL leaf type."));return e}function TT(e){return Ni(e)||Pn(e)||Dn(e)}function LG(e){if(!TT(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL composite type."));return e}function IT(e){return Pn(e)||Dn(e)}function kG(e){if(!IT(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL abstract type."));return e}function Yr(e){if(this instanceof Yr)this.ofType=ST(e);else return new Yr(e)}Yr.prototype.toString=function(){return"["+String(this.ofType)+"]"};Yr.prototype.toJSON=function(){return this.toString()};Object.defineProperty(Yr.prototype,Xr.SYMBOL_TO_STRING_TAG,{get:function(){return"GraphQLList"}});(0,en.default)(Yr);function Jr(e){if(this instanceof Jr)this.ofType=OT(e);else return new Jr(e)}Jr.prototype.toString=function(){return String(this.ofType)+"!"};Jr.prototype.toJSON=function(){return this.toString()};Object.defineProperty(Jr.prototype,Xr.SYMBOL_TO_STRING_TAG,{get:function(){return"GraphQLNonNull"}});(0,en.default)(Jr);function rs(e){return qu(e)||tn(e)}function jG(e){if(!rs(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL wrapping type."));return e}function wT(e){return Wd(e)&&!tn(e)}function OT(e){if(!wT(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL nullable type."));return e}function MG(e){if(e)return tn(e)?e.ofType:e}function AT(e){return Nn(e)||Ni(e)||Pn(e)||Dn(e)||Ln(e)||ts(e)}function FG(e){if(!AT(e))throw new Error("Expected ".concat((0,we.default)(e)," to be a GraphQL named type."));return e}function qG(e){if(e){for(var t=e;rs(t);)t=t.ofType;return t}}function Uu(e){return typeof e=="function"?e():e}function Pi(e){return e&&e.length>0?e:void 0}var Jd=(function(){function e(r){var n,i,o,s=(n=r.parseValue)!==null&&n!==void 0?n:gT.default;this.name=r.name,this.description=r.description,this.specifiedByUrl=r.specifiedByUrl,this.serialize=(i=r.serialize)!==null&&i!==void 0?i:gT.default,this.parseValue=s,this.parseLiteral=(o=r.parseLiteral)!==null&&o!==void 0?o:function(a,u){return s((0,bG.valueFromASTUntyped)(a,u))},this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Pi(r.extensionASTNodes),typeof r.name=="string"||(0,Ae.default)(0,"Must provide name."),r.specifiedByUrl==null||typeof r.specifiedByUrl=="string"||(0,Ae.default)(0,"".concat(this.name,' must provide "specifiedByUrl" as a string, ')+"but got: ".concat((0,we.default)(r.specifiedByUrl),".")),r.serialize==null||typeof r.serialize=="function"||(0,Ae.default)(0,"".concat(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.')),r.parseLiteral&&(typeof r.parseValue=="function"&&typeof r.parseLiteral=="function"||(0,Ae.default)(0,"".concat(this.name,' must provide both "parseValue" and "parseLiteral" functions.')))}var t=e.prototype;return t.toConfig=function(){var n;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:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ri(e,[{key:Xr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLScalarType"}}]),e})();B.GraphQLScalarType=Jd;(0,en.default)(Jd);var Xd=(function(){function e(r){this.name=r.name,this.description=r.description,this.isTypeOf=r.isTypeOf,this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Pi(r.extensionASTNodes),this._fields=CT.bind(void 0,r),this._interfaces=xT.bind(void 0,r),typeof r.name=="string"||(0,Ae.default)(0,"Must provide name."),r.isTypeOf==null||typeof r.isTypeOf=="function"||(0,Ae.default)(0,"".concat(this.name,' must provide "isTypeOf" as a function, ')+"but got: ".concat((0,we.default)(r.isTypeOf),"."))}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},t.toConfig=function(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:RT(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes||[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ri(e,[{key:Xr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLObjectType"}}]),e})();B.GraphQLObjectType=Xd;(0,en.default)(Xd);function xT(e){var t,r=(t=Uu(e.interfaces))!==null&&t!==void 0?t:[];return Array.isArray(r)||(0,Ae.default)(0,"".concat(e.name," interfaces must be an Array or a function which returns an Array.")),r}function CT(e){var t=Uu(e.fields);return Ci(t)||(0,Ae.default)(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),(0,Fu.default)(t,function(r,n){var i;Ci(r)||(0,Ae.default)(0,"".concat(e.name,".").concat(n," field config must be an object.")),!("isDeprecated"in r)||(0,Ae.default)(0,"".concat(e.name,".").concat(n,' should provide "deprecationReason" instead of "isDeprecated".')),r.resolve==null||typeof r.resolve=="function"||(0,Ae.default)(0,"".concat(e.name,".").concat(n," field resolver must be a function if ")+"provided, but got: ".concat((0,we.default)(r.resolve),"."));var o=(i=r.args)!==null&&i!==void 0?i:{};Ci(o)||(0,Ae.default)(0,"".concat(e.name,".").concat(n," args must be an object with argument names as keys."));var s=(0,ET.default)(o).map(function(a){var u=a[0],c=a[1];return{name:u,description:c.description,type:c.type,defaultValue:c.defaultValue,deprecationReason:c.deprecationReason,extensions:c.extensions&&(0,lr.default)(c.extensions),astNode:c.astNode}});return{name:n,description:r.description,type:r.type,args:s,resolve:r.resolve,subscribe:r.subscribe,isDeprecated:r.deprecationReason!=null,deprecationReason:r.deprecationReason,extensions:r.extensions&&(0,lr.default)(r.extensions),astNode:r.astNode}})}function Ci(e){return(0,EG.default)(e)&&!Array.isArray(e)}function RT(e){return(0,Fu.default)(e,function(t){return{description:t.description,type:t.type,args:NT(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}})}function NT(e){return(0,_T.default)(e,function(t){return t.name},function(t){return{description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}})}function UG(e){return tn(e.type)&&e.defaultValue===void 0}var Zd=(function(){function e(r){this.name=r.name,this.description=r.description,this.resolveType=r.resolveType,this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Pi(r.extensionASTNodes),this._fields=CT.bind(void 0,r),this._interfaces=xT.bind(void 0,r),typeof r.name=="string"||(0,Ae.default)(0,"Must provide name."),r.resolveType==null||typeof r.resolveType=="function"||(0,Ae.default)(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat((0,we.default)(r.resolveType),"."))}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},t.toConfig=function(){var n;return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:RT(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ri(e,[{key:Xr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLInterfaceType"}}]),e})();B.GraphQLInterfaceType=Zd;(0,en.default)(Zd);var ef=(function(){function e(r){this.name=r.name,this.description=r.description,this.resolveType=r.resolveType,this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Pi(r.extensionASTNodes),this._types=VG.bind(void 0,r),typeof r.name=="string"||(0,Ae.default)(0,"Must provide name."),r.resolveType==null||typeof r.resolveType=="function"||(0,Ae.default)(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat((0,we.default)(r.resolveType),"."))}var t=e.prototype;return t.getTypes=function(){return typeof this._types=="function"&&(this._types=this._types()),this._types},t.toConfig=function(){var n;return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ri(e,[{key:Xr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLUnionType"}}]),e})();B.GraphQLUnionType=ef;(0,en.default)(ef);function VG(e){var t=Uu(e.types);return Array.isArray(t)||(0,Ae.default)(0,"Must provide Array of types or a function which returns such an array for Union ".concat(e.name,".")),t}var tf=(function(){function e(r){this.name=r.name,this.description=r.description,this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Pi(r.extensionASTNodes),this._values=GG(this.name,r.values),this._valueLookup=new Map(this._values.map(function(n){return[n.value,n]})),this._nameLookup=(0,yG.default)(this._values,function(n){return n.name}),typeof r.name=="string"||(0,Ae.default)(0,"Must provide name.")}var t=e.prototype;return t.getValues=function(){return this._values},t.getValue=function(n){return this._nameLookup[n]},t.serialize=function(n){var i=this._valueLookup.get(n);if(i===void 0)throw new es.GraphQLError('Enum "'.concat(this.name,'" cannot represent value: ').concat((0,we.default)(n)));return i.name},t.parseValue=function(n){if(typeof n!="string"){var i=(0,we.default)(n);throw new es.GraphQLError('Enum "'.concat(this.name,'" cannot represent non-string value: ').concat(i,".")+Mu(this,i))}var o=this.getValue(n);if(o==null)throw new es.GraphQLError('Value "'.concat(n,'" does not exist in "').concat(this.name,'" enum.')+Mu(this,n));return o.value},t.parseLiteral=function(n,i){if(n.kind!==SG.Kind.ENUM){var o=(0,yT.print)(n);throw new es.GraphQLError('Enum "'.concat(this.name,'" cannot represent non-enum value: ').concat(o,".")+Mu(this,o),n)}var s=this.getValue(n.value);if(s==null){var a=(0,yT.print)(n);throw new es.GraphQLError('Value "'.concat(a,'" does not exist in "').concat(this.name,'" enum.')+Mu(this,a),n)}return s.value},t.toConfig=function(){var n,i=(0,_T.default)(this.getValues(),function(o){return o.name},function(o){return{description:o.description,value:o.value,deprecationReason:o.deprecationReason,extensions:o.extensions,astNode:o.astNode}});return{name:this.name,description:this.description,values:i,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ri(e,[{key:Xr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLEnumType"}}]),e})();B.GraphQLEnumType=tf;(0,en.default)(tf);function Mu(e,t){var r=e.getValues().map(function(i){return i.name}),n=(0,_G.default)(t,r);return(0,vG.default)("the enum value",n)}function GG(e,t){return Ci(t)||(0,Ae.default)(0,"".concat(e," values must be an object with value names as keys.")),(0,ET.default)(t).map(function(r){var n=r[0],i=r[1];return Ci(i)||(0,Ae.default)(0,"".concat(e,".").concat(n,' must refer to an object with a "value" key ')+"representing an internal value but got: ".concat((0,we.default)(i),".")),!("isDeprecated"in i)||(0,Ae.default)(0,"".concat(e,".").concat(n,' should provide "deprecationReason" instead of "isDeprecated".')),{name:n,description:i.description,value:i.value!==void 0?i.value:n,isDeprecated:i.deprecationReason!=null,deprecationReason:i.deprecationReason,extensions:i.extensions&&(0,lr.default)(i.extensions),astNode:i.astNode}})}var rf=(function(){function e(r){this.name=r.name,this.description=r.description,this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Pi(r.extensionASTNodes),this._fields=$G.bind(void 0,r),typeof r.name=="string"||(0,Ae.default)(0,"Must provide name.")}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.toConfig=function(){var n,i=(0,Fu.default)(this.getFields(),function(o){return{description:o.description,type:o.type,defaultValue:o.defaultValue,deprecationReason:o.deprecationReason,extensions:o.extensions,astNode:o.astNode}});return{name:this.name,description:this.description,fields:i,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ri(e,[{key:Xr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLInputObjectType"}}]),e})();B.GraphQLInputObjectType=rf;(0,en.default)(rf);function $G(e){var t=Uu(e.fields);return Ci(t)||(0,Ae.default)(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),(0,Fu.default)(t,function(r,n){return!("resolve"in r)||(0,Ae.default)(0,"".concat(e.name,".").concat(n," field has a resolve property, but Input Types cannot define resolvers.")),{name:n,description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions&&(0,lr.default)(r.extensions),astNode:r.astNode}})}function BG(e){return tn(e.type)&&e.defaultValue===void 0}});var is=y(ns=>{"use strict";p();Object.defineProperty(ns,"__esModule",{value:!0});ns.isEqualType=nf;ns.isTypeSubTypeOf=Vu;ns.doTypesOverlap=KG;var nt=ie();function nf(e,t){return e===t?!0:(0,nt.isNonNullType)(e)&&(0,nt.isNonNullType)(t)||(0,nt.isListType)(e)&&(0,nt.isListType)(t)?nf(e.ofType,t.ofType):!1}function Vu(e,t,r){return t===r?!0:(0,nt.isNonNullType)(r)?(0,nt.isNonNullType)(t)?Vu(e,t.ofType,r.ofType):!1:(0,nt.isNonNullType)(t)?Vu(e,t.ofType,r):(0,nt.isListType)(r)?(0,nt.isListType)(t)?Vu(e,t.ofType,r.ofType):!1:(0,nt.isListType)(t)?!1:(0,nt.isAbstractType)(r)&&((0,nt.isInterfaceType)(t)||(0,nt.isObjectType)(t))&&e.isSubType(r,t)}function KG(e,t,r){return t===r?!0:(0,nt.isAbstractType)(t)?(0,nt.isAbstractType)(r)?e.getPossibleTypes(t).some(function(n){return e.isSubType(r,n)}):e.isSubType(t,r):(0,nt.isAbstractType)(r)?e.isSubType(r,t):!1}});var of=y(Gu=>{"use strict";p();Object.defineProperty(Gu,"__esModule",{value:!0});Gu.default=void 0;var HG=ur(),QG=Array.from||function(e,t,r){if(e==null)throw new TypeError("Array.from requires an array-like object - not null or undefined");var n=e[HG.SYMBOL_ITERATOR];if(typeof n=="function"){for(var i=n.call(e),o=[],s,a=0;!(s=i.next()).done;++a)if(o.push(t.call(r,s.value,a)),a>9999999)throw new TypeError("Near-infinite iteration.");return o}var u=e.length;if(typeof u=="number"&&u>=0&&u%1===0){for(var c=[],l=0;l<u;++l)Object.prototype.hasOwnProperty.call(e,l)&&c.push(t.call(r,e[l],l));return c}return[]},WG=QG;Gu.default=WG});var sf=y($u=>{"use strict";p();Object.defineProperty($u,"__esModule",{value:!0});$u.default=void 0;var zG=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},YG=zG;$u.default=YG});var Ku=y(af=>{"use strict";p();Object.defineProperty(af,"__esModule",{value:!0});af.default=XG;var JG=ur();function Bu(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Bu=function(r){return typeof r}:Bu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Bu(e)}function XG(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(l){return l};if(e==null||Bu(e)!=="object")return null;if(Array.isArray(e))return e.map(t);var r=e[JG.SYMBOL_ITERATOR];if(typeof r=="function"){for(var n=r.call(e),i=[],o,s=0;!(o=n.next()).done;++s)i.push(t(o.value,s));return i}var a=e.length;if(typeof a=="number"&&a>=0&&a%1===0){for(var u=[],c=0;c<a;++c){if(!Object.prototype.hasOwnProperty.call(e,c))return null;u.push(t(e[String(c)],c))}return u}return null}});var PT=y(Hu=>{"use strict";p();Object.defineProperty(Hu,"__esModule",{value:!0});Hu.default=void 0;var ZG=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},e1=ZG;Hu.default=e1});var pr=y(lt=>{"use strict";p();Object.defineProperty(lt,"__esModule",{value:!0});lt.isSpecifiedScalarType=p1;lt.specifiedScalarTypes=lt.GraphQLID=lt.GraphQLBoolean=lt.GraphQLString=lt.GraphQLFloat=lt.GraphQLInt=void 0;var Qu=zu(sf()),Wu=zu(PT()),Yt=zu(ae()),DT=zu(ar()),kn=_e(),os=mt(),ze=H(),ss=ie();function zu(e){return e&&e.__esModule?e:{default:e}}var uf=2147483647,cf=-2147483648;function t1(e){var t=as(e);if(typeof t=="boolean")return t?1:0;var r=t;if(typeof t=="string"&&t!==""&&(r=Number(t)),!(0,Wu.default)(r))throw new ze.GraphQLError("Int cannot represent non-integer value: ".concat((0,Yt.default)(t)));if(r>uf||r<cf)throw new ze.GraphQLError("Int cannot represent non 32-bit signed integer value: "+(0,Yt.default)(t));return r}function r1(e){if(!(0,Wu.default)(e))throw new ze.GraphQLError("Int cannot represent non-integer value: ".concat((0,Yt.default)(e)));if(e>uf||e<cf)throw new ze.GraphQLError("Int cannot represent non 32-bit signed integer value: ".concat(e));return e}var LT=new ss.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:t1,parseValue:r1,parseLiteral:function(t){if(t.kind!==kn.Kind.INT)throw new ze.GraphQLError("Int cannot represent non-integer value: ".concat((0,os.print)(t)),t);var r=parseInt(t.value,10);if(r>uf||r<cf)throw new ze.GraphQLError("Int cannot represent non 32-bit signed integer value: ".concat(t.value),t);return r}});lt.GraphQLInt=LT;function n1(e){var t=as(e);if(typeof t=="boolean")return t?1:0;var r=t;if(typeof t=="string"&&t!==""&&(r=Number(t)),!(0,Qu.default)(r))throw new ze.GraphQLError("Float cannot represent non numeric value: ".concat((0,Yt.default)(t)));return r}function i1(e){if(!(0,Qu.default)(e))throw new ze.GraphQLError("Float cannot represent non numeric value: ".concat((0,Yt.default)(e)));return e}var kT=new ss.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:n1,parseValue:i1,parseLiteral:function(t){if(t.kind!==kn.Kind.FLOAT&&t.kind!==kn.Kind.INT)throw new ze.GraphQLError("Float cannot represent non numeric value: ".concat((0,os.print)(t)),t);return parseFloat(t.value)}});lt.GraphQLFloat=kT;function as(e){if((0,DT.default)(e)){if(typeof e.valueOf=="function"){var t=e.valueOf();if(!(0,DT.default)(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}function o1(e){var t=as(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if((0,Qu.default)(t))return t.toString();throw new ze.GraphQLError("String cannot represent value: ".concat((0,Yt.default)(e)))}function s1(e){if(typeof e!="string")throw new ze.GraphQLError("String cannot represent a non string value: ".concat((0,Yt.default)(e)));return e}var jT=new ss.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:o1,parseValue:s1,parseLiteral:function(t){if(t.kind!==kn.Kind.STRING)throw new ze.GraphQLError("String cannot represent a non string value: ".concat((0,os.print)(t)),t);return t.value}});lt.GraphQLString=jT;function a1(e){var t=as(e);if(typeof t=="boolean")return t;if((0,Qu.default)(t))return t!==0;throw new ze.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0,Yt.default)(t)))}function u1(e){if(typeof e!="boolean")throw new ze.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0,Yt.default)(e)));return e}var MT=new ss.GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:a1,parseValue:u1,parseLiteral:function(t){if(t.kind!==kn.Kind.BOOLEAN)throw new ze.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0,os.print)(t)),t);return t.value}});lt.GraphQLBoolean=MT;function c1(e){var t=as(e);if(typeof t=="string")return t;if((0,Wu.default)(t))return String(t);throw new ze.GraphQLError("ID cannot represent value: ".concat((0,Yt.default)(e)))}function l1(e){if(typeof e=="string")return e;if((0,Wu.default)(e))return e.toString();throw new ze.GraphQLError("ID cannot represent value: ".concat((0,Yt.default)(e)))}var FT=new ss.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:c1,parseValue:l1,parseLiteral:function(t){if(t.kind!==kn.Kind.STRING&&t.kind!==kn.Kind.INT)throw new ze.GraphQLError("ID cannot represent a non-string and non-integer value: "+(0,os.print)(t),t);return t.value}});lt.GraphQLID=FT;var qT=Object.freeze([jT,LT,kT,MT,FT]);lt.specifiedScalarTypes=qT;function p1(e){return qT.some(function(t){var r=t.name;return e.name===r})}});var ls=y(lf=>{"use strict";p();Object.defineProperty(lf,"__esModule",{value:!0});lf.astFromValue=cs;var d1=Di(sf()),f1=Di(Tt()),UT=Di(ae()),h1=Di(et()),m1=Di(ar()),g1=Di(Ku()),Ft=_e(),y1=pr(),us=ie();function Di(e){return e&&e.__esModule?e:{default:e}}function cs(e,t){if((0,us.isNonNullType)(t)){var r=cs(e,t.ofType);return r?.kind===Ft.Kind.NULL?null:r}if(e===null)return{kind:Ft.Kind.NULL};if(e===void 0)return null;if((0,us.isListType)(t)){var n=t.ofType,i=(0,g1.default)(e);if(i!=null){for(var o=[],s=0;s<i.length;s++){var a=i[s],u=cs(a,n);u!=null&&o.push(u)}return{kind:Ft.Kind.LIST,values:o}}return cs(e,n)}if((0,us.isInputObjectType)(t)){if(!(0,m1.default)(e))return null;for(var c=[],l=0,d=(0,f1.default)(t.getFields());l<d.length;l++){var f=d[l],h=cs(e[f.name],f.type);h&&c.push({kind:Ft.Kind.OBJECT_FIELD,name:{kind:Ft.Kind.NAME,value:f.name},value:h})}return{kind:Ft.Kind.OBJECT,fields:c}}if((0,us.isLeafType)(t)){var g=t.serialize(e);if(g==null)return null;if(typeof g=="boolean")return{kind:Ft.Kind.BOOLEAN,value:g};if(typeof g=="number"&&(0,d1.default)(g)){var v=String(g);return VT.test(v)?{kind:Ft.Kind.INT,value:v}:{kind:Ft.Kind.FLOAT,value:v}}if(typeof g=="string")return(0,us.isEnumType)(t)?{kind:Ft.Kind.ENUM,value:g}:t===y1.GraphQLID&&VT.test(g)?{kind:Ft.Kind.INT,value:g}:{kind:Ft.Kind.STRING,value:g};throw new TypeError("Cannot convert value to AST: ".concat((0,UT.default)(g),"."))}(0,h1.default)(0,"Unexpected input type: "+(0,UT.default)(t))}var VT=/^-?(?:0|[1-9][0-9]*)$/});var Ut=y(ve=>{"use strict";p();Object.defineProperty(ve,"__esModule",{value:!0});ve.isIntrospectionType=w1;ve.introspectionTypes=ve.TypeNameMetaFieldDef=ve.TypeMetaFieldDef=ve.SchemaMetaFieldDef=ve.__TypeKind=ve.TypeKind=ve.__EnumValue=ve.__InputValue=ve.__Field=ve.__Type=ve.__DirectiveLocation=ve.__Directive=ve.__Schema=void 0;var pf=df(Tt()),v1=df(ae()),E1=df(et()),_1=mt(),Be=Ti(),S1=ls(),Se=pr(),q=ie();function df(e){return e&&e.__esModule?e:{default:e}}var ff=new q.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:function(){return{description:{type:Se.GraphQLString,resolve:function(r){return r.description}},types:{description:"A list of all types supported by this server.",type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(qt))),resolve:function(r){return(0,pf.default)(r.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new q.GraphQLNonNull(qt),resolve:function(r){return r.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:qt,resolve:function(r){return r.getMutationType()}},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:qt,resolve:function(r){return r.getSubscriptionType()}},directives:{description:"A list of all directives supported by this server.",type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(hf))),resolve:function(r){return r.getDirectives()}}}}});ve.__Schema=ff;var hf=new q.GraphQLObjectType({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
72
72
|
|
|
73
|
-
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:function(){return{name:{type:new q.GraphQLNonNull(be.GraphQLString),resolve:function(r){return r.name}},description:{type:be.GraphQLString,resolve:function(r){return r.description}},isRepeatable:{type:new q.GraphQLNonNull(be.GraphQLBoolean),resolve:function(r){return r.isRepeatable}},locations:{type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(mf))),resolve:function(r){return r.locations}},args:{type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(ls))),args:{includeDeprecated:{type:be.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;return i?r.args:r.args.filter(function(o){return o.deprecationReason==null})}}}}});ve.__Directive=hf;var mf=new q.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:Be.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:Be.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:Be.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:Be.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:Be.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:Be.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:Be.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:Be.DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:Be.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:Be.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:Be.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:Be.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:Be.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:Be.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:Be.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:Be.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:Be.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:Be.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:Be.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}});ve.__DirectiveLocation=mf;var qt=new q.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:function(){return{kind:{type:new q.GraphQLNonNull(vf),resolve:function(r){if((0,q.isScalarType)(r))return tt.SCALAR;if((0,q.isObjectType)(r))return tt.OBJECT;if((0,q.isInterfaceType)(r))return tt.INTERFACE;if((0,q.isUnionType)(r))return tt.UNION;if((0,q.isEnumType)(r))return tt.ENUM;if((0,q.isInputObjectType)(r))return tt.INPUT_OBJECT;if((0,q.isListType)(r))return tt.LIST;if((0,q.isNonNullType)(r))return tt.NON_NULL;(0,m1.default)(0,'Unexpected type: "'.concat((0,h1.default)(r),'".'))}},name:{type:be.GraphQLString,resolve:function(r){return r.name!==void 0?r.name:void 0}},description:{type:be.GraphQLString,resolve:function(r){return r.description!==void 0?r.description:void 0}},specifiedByUrl:{type:be.GraphQLString,resolve:function(r){return r.specifiedByUrl!==void 0?r.specifiedByUrl:void 0}},fields:{type:new q.GraphQLList(new q.GraphQLNonNull(gf)),args:{includeDeprecated:{type:be.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;if((0,q.isObjectType)(r)||(0,q.isInterfaceType)(r)){var o=(0,pf.default)(r.getFields());return i?o:o.filter(function(s){return s.deprecationReason==null})}}},interfaces:{type:new q.GraphQLList(new q.GraphQLNonNull(qt)),resolve:function(r){if((0,q.isObjectType)(r)||(0,q.isInterfaceType)(r))return r.getInterfaces()}},possibleTypes:{type:new q.GraphQLList(new q.GraphQLNonNull(qt)),resolve:function(r,n,i,o){var s=o.schema;if((0,q.isAbstractType)(r))return s.getPossibleTypes(r)}},enumValues:{type:new q.GraphQLList(new q.GraphQLNonNull(yf)),args:{includeDeprecated:{type:be.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;if((0,q.isEnumType)(r)){var o=r.getValues();return i?o:o.filter(function(s){return s.deprecationReason==null})}}},inputFields:{type:new q.GraphQLList(new q.GraphQLNonNull(ls)),args:{includeDeprecated:{type:be.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;if((0,q.isInputObjectType)(r)){var o=(0,pf.default)(r.getFields());return i?o:o.filter(function(s){return s.deprecationReason==null})}}},ofType:{type:qt,resolve:function(r){return r.ofType!==void 0?r.ofType:void 0}}}}});ve.__Type=qt;var gf=new q.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:function(){return{name:{type:new q.GraphQLNonNull(be.GraphQLString),resolve:function(r){return r.name}},description:{type:be.GraphQLString,resolve:function(r){return r.description}},args:{type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(ls))),args:{includeDeprecated:{type:be.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;return i?r.args:r.args.filter(function(o){return o.deprecationReason==null})}},type:{type:new q.GraphQLNonNull(qt),resolve:function(r){return r.type}},isDeprecated:{type:new q.GraphQLNonNull(be.GraphQLBoolean),resolve:function(r){return r.deprecationReason!=null}},deprecationReason:{type:be.GraphQLString,resolve:function(r){return r.deprecationReason}}}}});ve.__Field=gf;var ls=new q.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:function(){return{name:{type:new q.GraphQLNonNull(be.GraphQLString),resolve:function(r){return r.name}},description:{type:be.GraphQLString,resolve:function(r){return r.description}},type:{type:new q.GraphQLNonNull(qt),resolve:function(r){return r.type}},defaultValue:{type:be.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(r){var n=r.type,i=r.defaultValue,o=(0,y1.astFromValue)(i,n);return o?(0,g1.print)(o):null}},isDeprecated:{type:new q.GraphQLNonNull(be.GraphQLBoolean),resolve:function(r){return r.deprecationReason!=null}},deprecationReason:{type:be.GraphQLString,resolve:function(r){return r.deprecationReason}}}}});ve.__InputValue=ls;var yf=new q.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:function(){return{name:{type:new q.GraphQLNonNull(be.GraphQLString),resolve:function(r){return r.name}},description:{type:be.GraphQLString,resolve:function(r){return r.description}},isDeprecated:{type:new q.GraphQLNonNull(be.GraphQLBoolean),resolve:function(r){return r.deprecationReason!=null}},deprecationReason:{type:be.GraphQLString,resolve:function(r){return r.deprecationReason}}}}});ve.__EnumValue=yf;var tt=Object.freeze({SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"});ve.TypeKind=tt;var vf=new q.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:tt.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:tt.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:tt.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:tt.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:tt.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:tt.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:tt.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:tt.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});ve.__TypeKind=vf;var v1={name:"__schema",type:new q.GraphQLNonNull(ff),description:"Access the current type schema of this server.",args:[],resolve:function(t,r,n,i){var o=i.schema;return o},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0};ve.SchemaMetaFieldDef=v1;var E1={name:"__type",type:qt,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new q.GraphQLNonNull(be.GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:void 0,astNode:void 0}],resolve:function(t,r,n,i){var o=r.name,s=i.schema;return s.getType(o)},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0};ve.TypeMetaFieldDef=E1;var _1={name:"__typename",type:new q.GraphQLNonNull(be.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:function(t,r,n,i){var o=i.parentType;return o.name},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0};ve.TypeNameMetaFieldDef=_1;var VT=Object.freeze([ff,hf,mf,qt,gf,ls,yf,vf]);ve.introspectionTypes=VT;function b1(e){return VT.some(function(t){var r=t.name;return e.name===r})}});var gt=y(Ke=>{"use strict";p();Object.defineProperty(Ke,"__esModule",{value:!0});Ke.isDirective=BT;Ke.assertDirective=C1;Ke.isSpecifiedDirective=R1;Ke.specifiedDirectives=Ke.GraphQLSpecifiedByDirective=Ke.GraphQLDeprecatedDirective=Ke.DEFAULT_DEPRECATION_REASON=Ke.GraphQLSkipDirective=Ke.GraphQLIncludeDirective=Ke.GraphQLDirective=void 0;var S1=jn(xi()),T1=ur(),I1=jn(ae()),GT=jn(Lu()),Ef=jn(Mt()),w1=jn(Ho()),O1=jn(ar()),A1=jn(vu()),Jt=Ti(),Yu=pr(),Ju=ie();function jn(e){return e&&e.__esModule?e:{default:e}}function $T(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function x1(e,t,r){return t&&$T(e.prototype,t),r&&$T(e,r),e}function BT(e){return(0,w1.default)(e,Mn)}function C1(e){if(!BT(e))throw new Error("Expected ".concat((0,I1.default)(e)," to be a GraphQL directive."));return e}var Mn=(function(){function e(r){var n,i;this.name=r.name,this.description=r.description,this.locations=r.locations,this.isRepeatable=(n=r.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=r.extensions&&(0,GT.default)(r.extensions),this.astNode=r.astNode,r.name||(0,Ef.default)(0,"Directive must be named."),Array.isArray(r.locations)||(0,Ef.default)(0,"@".concat(r.name," locations must be an Array."));var o=(i=r.args)!==null&&i!==void 0?i:{};(0,O1.default)(o)&&!Array.isArray(o)||(0,Ef.default)(0,"@".concat(r.name," args must be an object with argument names as keys.")),this.args=(0,S1.default)(o).map(function(s){var a=s[0],u=s[1];return{name:a,description:u.description,type:u.type,defaultValue:u.defaultValue,deprecationReason:u.deprecationReason,extensions:u.extensions&&(0,GT.default)(u.extensions),astNode:u.astNode}})}var t=e.prototype;return t.toConfig=function(){return{name:this.name,description:this.description,locations:this.locations,args:(0,Ju.argsToArgsConfig)(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},t.toString=function(){return"@"+this.name},t.toJSON=function(){return this.toString()},x1(e,[{key:T1.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLDirective"}}]),e})();Ke.GraphQLDirective=Mn;(0,A1.default)(Mn);var KT=new Mn({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[Jt.DirectiveLocation.FIELD,Jt.DirectiveLocation.FRAGMENT_SPREAD,Jt.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new Ju.GraphQLNonNull(Yu.GraphQLBoolean),description:"Included when true."}}});Ke.GraphQLIncludeDirective=KT;var HT=new Mn({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[Jt.DirectiveLocation.FIELD,Jt.DirectiveLocation.FRAGMENT_SPREAD,Jt.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new Ju.GraphQLNonNull(Yu.GraphQLBoolean),description:"Skipped when true."}}});Ke.GraphQLSkipDirective=HT;var QT="No longer supported";Ke.DEFAULT_DEPRECATION_REASON=QT;var WT=new Mn({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[Jt.DirectiveLocation.FIELD_DEFINITION,Jt.DirectiveLocation.ARGUMENT_DEFINITION,Jt.DirectiveLocation.INPUT_FIELD_DEFINITION,Jt.DirectiveLocation.ENUM_VALUE],args:{reason:{type:Yu.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:QT}}});Ke.GraphQLDeprecatedDirective=WT;var zT=new Mn({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[Jt.DirectiveLocation.SCALAR],args:{url:{type:new Ju.GraphQLNonNull(Yu.GraphQLString),description:"The URL that specifies the behaviour of this scalar."}}});Ke.GraphQLSpecifiedByDirective=zT;var YT=Object.freeze([KT,HT,WT,zT]);Ke.specifiedDirectives=YT;function R1(e){return YT.some(function(t){var r=t.name;return r===e.name})}});var Fn=y(Li=>{"use strict";p();Object.defineProperty(Li,"__esModule",{value:!0});Li.isSchema=ZT;Li.assertSchema=q1;Li.GraphQLSchema=void 0;var N1=rn(Ai()),P1=rn(of()),_f=rn(St()),D1=ur(),bf=rn(ae()),L1=rn(Lu()),Xu=rn(Mt()),k1=rn(Ho()),j1=rn(ar()),M1=Ut(),JT=gt(),Xt=ie();function rn(e){return e&&e.__esModule?e:{default:e}}function XT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function F1(e,t,r){return t&&XT(e.prototype,t),r&&XT(e,r),e}function ZT(e){return(0,k1.default)(e,eI)}function q1(e){if(!ZT(e))throw new Error("Expected ".concat((0,bf.default)(e)," to be a GraphQL schema."));return e}var eI=(function(){function e(r){var n;this.__validationErrors=r.assumeValid===!0?[]:void 0,(0,j1.default)(r)||(0,Xu.default)(0,"Must provide configuration object."),!r.types||Array.isArray(r.types)||(0,Xu.default)(0,'"types" must be Array if provided but got: '.concat((0,bf.default)(r.types),".")),!r.directives||Array.isArray(r.directives)||(0,Xu.default)(0,'"directives" must be Array if provided but got: '+"".concat((0,bf.default)(r.directives),".")),this.description=r.description,this.extensions=r.extensions&&(0,L1.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=r.extensionASTNodes,this._queryType=r.query,this._mutationType=r.mutation,this._subscriptionType=r.subscription,this._directives=(n=r.directives)!==null&&n!==void 0?n:JT.specifiedDirectives;var i=new Set(r.types);if(r.types!=null)for(var o=0,s=r.types;o<s.length;o++){var a=s[o];i.delete(a),Zt(a,i)}this._queryType!=null&&Zt(this._queryType,i),this._mutationType!=null&&Zt(this._mutationType,i),this._subscriptionType!=null&&Zt(this._subscriptionType,i);for(var u=0,c=this._directives;u<c.length;u++){var l=c[u];if((0,JT.isDirective)(l))for(var d=0,f=l.args;d<f.length;d++){var h=f[d];Zt(h.type,i)}}Zt(M1.__Schema,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var g=0,v=(0,P1.default)(i);g<v.length;g++){var _=v[g];if(_!=null){var S=_.name;if(S||(0,Xu.default)(0,"One of the provided types for building the Schema is missing a name."),this._typeMap[S]!==void 0)throw new Error('Schema must contain uniquely named types but contains multiple types named "'.concat(S,'".'));if(this._typeMap[S]=_,(0,Xt.isInterfaceType)(_))for(var b=0,A=_.getInterfaces();b<A.length;b++){var O=A[b];if((0,Xt.isInterfaceType)(O)){var T=this._implementationsMap[O.name];T===void 0&&(T=this._implementationsMap[O.name]={objects:[],interfaces:[]}),T.interfaces.push(_)}}else if((0,Xt.isObjectType)(_))for(var x=0,U=_.getInterfaces();x<U.length;x++){var C=U[x];if((0,Xt.isInterfaceType)(C)){var te=this._implementationsMap[C.name];te===void 0&&(te=this._implementationsMap[C.name]={objects:[],interfaces:[]}),te.objects.push(_)}}}}}var t=e.prototype;return t.getQueryType=function(){return this._queryType},t.getMutationType=function(){return this._mutationType},t.getSubscriptionType=function(){return this._subscriptionType},t.getTypeMap=function(){return this._typeMap},t.getType=function(n){return this.getTypeMap()[n]},t.getPossibleTypes=function(n){return(0,Xt.isUnionType)(n)?n.getTypes():this.getImplementations(n).objects},t.getImplementations=function(n){var i=this._implementationsMap[n.name];return i??{objects:[],interfaces:[]}},t.isPossibleType=function(n,i){return this.isSubType(n,i)},t.isSubType=function(n,i){var o=this._subTypeMap[n.name];if(o===void 0){if(o=Object.create(null),(0,Xt.isUnionType)(n))for(var s=0,a=n.getTypes();s<a.length;s++){var u=a[s];o[u.name]=!0}else{for(var c=this.getImplementations(n),l=0,d=c.objects;l<d.length;l++){var f=d[l];o[f.name]=!0}for(var h=0,g=c.interfaces;h<g.length;h++){var v=g[h];o[v.name]=!0}}this._subTypeMap[n.name]=o}return o[i.name]!==void 0},t.getDirectives=function(){return this._directives},t.getDirective=function(n){return(0,N1.default)(this.getDirectives(),function(i){return i.name===n})},t.toConfig=function(){var n;return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:(0,_f.default)(this.getTypeMap()),directives:this.getDirectives().slice(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[],assumeValid:this.__validationErrors!==void 0}},F1(e,[{key:D1.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLSchema"}}]),e})();Li.GraphQLSchema=eI;function Zt(e,t){var r=(0,Xt.getNamedType)(e);if(!t.has(r)){if(t.add(r),(0,Xt.isUnionType)(r))for(var n=0,i=r.getTypes();n<i.length;n++){var o=i[n];Zt(o,t)}else if((0,Xt.isObjectType)(r)||(0,Xt.isInterfaceType)(r)){for(var s=0,a=r.getInterfaces();s<a.length;s++){var u=a[s];Zt(u,t)}for(var c=0,l=(0,_f.default)(r.getFields());c<l.length;c++){var d=l[c];Zt(d.type,t);for(var f=0,h=d.args;f<h.length;f++){var g=h[f];Zt(g.type,t)}}}else if((0,Xt.isInputObjectType)(r))for(var v=0,_=(0,_f.default)(r.getFields());v<_.length;v++){var S=_[v];Zt(S.type,t)}}return t}});var fs=y(Zu=>{"use strict";p();Object.defineProperty(Zu,"__esModule",{value:!0});Zu.validateSchema=aI;Zu.assertValidSchema=K1;var tI=Tf(Ai()),ds=Tf(St()),it=Tf(ae()),U1=H(),V1=Yo(),G1=Pd(),rI=ns(),$1=Fn(),B1=Ut(),sI=gt(),Fe=ie();function Tf(e){return e&&e.__esModule?e:{default:e}}function aI(e){if((0,$1.assertSchema)(e),e.__validationErrors)return e.__validationErrors;var t=new H1(e);Q1(t),W1(t),z1(t);var r=t.getErrors();return e.__validationErrors=r,r}function K1(e){var t=aI(e);if(t.length!==0)throw new Error(t.map(function(r){return r.message}).join(`
|
|
73
|
+
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:function(){return{name:{type:new q.GraphQLNonNull(Se.GraphQLString),resolve:function(r){return r.name}},description:{type:Se.GraphQLString,resolve:function(r){return r.description}},isRepeatable:{type:new q.GraphQLNonNull(Se.GraphQLBoolean),resolve:function(r){return r.isRepeatable}},locations:{type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(mf))),resolve:function(r){return r.locations}},args:{type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(ps))),args:{includeDeprecated:{type:Se.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;return i?r.args:r.args.filter(function(o){return o.deprecationReason==null})}}}}});ve.__Directive=hf;var mf=new q.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:Be.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:Be.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:Be.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:Be.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:Be.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:Be.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:Be.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:Be.DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:Be.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:Be.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:Be.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:Be.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:Be.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:Be.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:Be.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:Be.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:Be.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:Be.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:Be.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}});ve.__DirectiveLocation=mf;var qt=new q.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:function(){return{kind:{type:new q.GraphQLNonNull(vf),resolve:function(r){if((0,q.isScalarType)(r))return tt.SCALAR;if((0,q.isObjectType)(r))return tt.OBJECT;if((0,q.isInterfaceType)(r))return tt.INTERFACE;if((0,q.isUnionType)(r))return tt.UNION;if((0,q.isEnumType)(r))return tt.ENUM;if((0,q.isInputObjectType)(r))return tt.INPUT_OBJECT;if((0,q.isListType)(r))return tt.LIST;if((0,q.isNonNullType)(r))return tt.NON_NULL;(0,E1.default)(0,'Unexpected type: "'.concat((0,v1.default)(r),'".'))}},name:{type:Se.GraphQLString,resolve:function(r){return r.name!==void 0?r.name:void 0}},description:{type:Se.GraphQLString,resolve:function(r){return r.description!==void 0?r.description:void 0}},specifiedByUrl:{type:Se.GraphQLString,resolve:function(r){return r.specifiedByUrl!==void 0?r.specifiedByUrl:void 0}},fields:{type:new q.GraphQLList(new q.GraphQLNonNull(gf)),args:{includeDeprecated:{type:Se.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;if((0,q.isObjectType)(r)||(0,q.isInterfaceType)(r)){var o=(0,pf.default)(r.getFields());return i?o:o.filter(function(s){return s.deprecationReason==null})}}},interfaces:{type:new q.GraphQLList(new q.GraphQLNonNull(qt)),resolve:function(r){if((0,q.isObjectType)(r)||(0,q.isInterfaceType)(r))return r.getInterfaces()}},possibleTypes:{type:new q.GraphQLList(new q.GraphQLNonNull(qt)),resolve:function(r,n,i,o){var s=o.schema;if((0,q.isAbstractType)(r))return s.getPossibleTypes(r)}},enumValues:{type:new q.GraphQLList(new q.GraphQLNonNull(yf)),args:{includeDeprecated:{type:Se.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;if((0,q.isEnumType)(r)){var o=r.getValues();return i?o:o.filter(function(s){return s.deprecationReason==null})}}},inputFields:{type:new q.GraphQLList(new q.GraphQLNonNull(ps)),args:{includeDeprecated:{type:Se.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;if((0,q.isInputObjectType)(r)){var o=(0,pf.default)(r.getFields());return i?o:o.filter(function(s){return s.deprecationReason==null})}}},ofType:{type:qt,resolve:function(r){return r.ofType!==void 0?r.ofType:void 0}}}}});ve.__Type=qt;var gf=new q.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:function(){return{name:{type:new q.GraphQLNonNull(Se.GraphQLString),resolve:function(r){return r.name}},description:{type:Se.GraphQLString,resolve:function(r){return r.description}},args:{type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(ps))),args:{includeDeprecated:{type:Se.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;return i?r.args:r.args.filter(function(o){return o.deprecationReason==null})}},type:{type:new q.GraphQLNonNull(qt),resolve:function(r){return r.type}},isDeprecated:{type:new q.GraphQLNonNull(Se.GraphQLBoolean),resolve:function(r){return r.deprecationReason!=null}},deprecationReason:{type:Se.GraphQLString,resolve:function(r){return r.deprecationReason}}}}});ve.__Field=gf;var ps=new q.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:function(){return{name:{type:new q.GraphQLNonNull(Se.GraphQLString),resolve:function(r){return r.name}},description:{type:Se.GraphQLString,resolve:function(r){return r.description}},type:{type:new q.GraphQLNonNull(qt),resolve:function(r){return r.type}},defaultValue:{type:Se.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(r){var n=r.type,i=r.defaultValue,o=(0,S1.astFromValue)(i,n);return o?(0,_1.print)(o):null}},isDeprecated:{type:new q.GraphQLNonNull(Se.GraphQLBoolean),resolve:function(r){return r.deprecationReason!=null}},deprecationReason:{type:Se.GraphQLString,resolve:function(r){return r.deprecationReason}}}}});ve.__InputValue=ps;var yf=new q.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:function(){return{name:{type:new q.GraphQLNonNull(Se.GraphQLString),resolve:function(r){return r.name}},description:{type:Se.GraphQLString,resolve:function(r){return r.description}},isDeprecated:{type:new q.GraphQLNonNull(Se.GraphQLBoolean),resolve:function(r){return r.deprecationReason!=null}},deprecationReason:{type:Se.GraphQLString,resolve:function(r){return r.deprecationReason}}}}});ve.__EnumValue=yf;var tt=Object.freeze({SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"});ve.TypeKind=tt;var vf=new q.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:tt.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:tt.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:tt.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:tt.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:tt.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:tt.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:tt.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:tt.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});ve.__TypeKind=vf;var b1={name:"__schema",type:new q.GraphQLNonNull(ff),description:"Access the current type schema of this server.",args:[],resolve:function(t,r,n,i){var o=i.schema;return o},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0};ve.SchemaMetaFieldDef=b1;var T1={name:"__type",type:qt,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new q.GraphQLNonNull(Se.GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:void 0,astNode:void 0}],resolve:function(t,r,n,i){var o=r.name,s=i.schema;return s.getType(o)},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0};ve.TypeMetaFieldDef=T1;var I1={name:"__typename",type:new q.GraphQLNonNull(Se.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:function(t,r,n,i){var o=i.parentType;return o.name},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0};ve.TypeNameMetaFieldDef=I1;var GT=Object.freeze([ff,hf,mf,qt,gf,ps,yf,vf]);ve.introspectionTypes=GT;function w1(e){return GT.some(function(t){var r=t.name;return e.name===r})}});var gt=y(Ke=>{"use strict";p();Object.defineProperty(Ke,"__esModule",{value:!0});Ke.isDirective=KT;Ke.assertDirective=D1;Ke.isSpecifiedDirective=L1;Ke.specifiedDirectives=Ke.GraphQLSpecifiedByDirective=Ke.GraphQLDeprecatedDirective=Ke.DEFAULT_DEPRECATION_REASON=Ke.GraphQLSkipDirective=Ke.GraphQLIncludeDirective=Ke.GraphQLDirective=void 0;var O1=jn(xi()),A1=ur(),x1=jn(ae()),$T=jn(Lu()),Ef=jn(Mt()),C1=jn(Qo()),R1=jn(ar()),N1=jn(vu()),Jt=Ti(),Yu=pr(),Ju=ie();function jn(e){return e&&e.__esModule?e:{default:e}}function BT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function P1(e,t,r){return t&&BT(e.prototype,t),r&&BT(e,r),e}function KT(e){return(0,C1.default)(e,Mn)}function D1(e){if(!KT(e))throw new Error("Expected ".concat((0,x1.default)(e)," to be a GraphQL directive."));return e}var Mn=(function(){function e(r){var n,i;this.name=r.name,this.description=r.description,this.locations=r.locations,this.isRepeatable=(n=r.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=r.extensions&&(0,$T.default)(r.extensions),this.astNode=r.astNode,r.name||(0,Ef.default)(0,"Directive must be named."),Array.isArray(r.locations)||(0,Ef.default)(0,"@".concat(r.name," locations must be an Array."));var o=(i=r.args)!==null&&i!==void 0?i:{};(0,R1.default)(o)&&!Array.isArray(o)||(0,Ef.default)(0,"@".concat(r.name," args must be an object with argument names as keys.")),this.args=(0,O1.default)(o).map(function(s){var a=s[0],u=s[1];return{name:a,description:u.description,type:u.type,defaultValue:u.defaultValue,deprecationReason:u.deprecationReason,extensions:u.extensions&&(0,$T.default)(u.extensions),astNode:u.astNode}})}var t=e.prototype;return t.toConfig=function(){return{name:this.name,description:this.description,locations:this.locations,args:(0,Ju.argsToArgsConfig)(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},t.toString=function(){return"@"+this.name},t.toJSON=function(){return this.toString()},P1(e,[{key:A1.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLDirective"}}]),e})();Ke.GraphQLDirective=Mn;(0,N1.default)(Mn);var HT=new Mn({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[Jt.DirectiveLocation.FIELD,Jt.DirectiveLocation.FRAGMENT_SPREAD,Jt.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new Ju.GraphQLNonNull(Yu.GraphQLBoolean),description:"Included when true."}}});Ke.GraphQLIncludeDirective=HT;var QT=new Mn({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[Jt.DirectiveLocation.FIELD,Jt.DirectiveLocation.FRAGMENT_SPREAD,Jt.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new Ju.GraphQLNonNull(Yu.GraphQLBoolean),description:"Skipped when true."}}});Ke.GraphQLSkipDirective=QT;var WT="No longer supported";Ke.DEFAULT_DEPRECATION_REASON=WT;var zT=new Mn({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[Jt.DirectiveLocation.FIELD_DEFINITION,Jt.DirectiveLocation.ARGUMENT_DEFINITION,Jt.DirectiveLocation.INPUT_FIELD_DEFINITION,Jt.DirectiveLocation.ENUM_VALUE],args:{reason:{type:Yu.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:WT}}});Ke.GraphQLDeprecatedDirective=zT;var YT=new Mn({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[Jt.DirectiveLocation.SCALAR],args:{url:{type:new Ju.GraphQLNonNull(Yu.GraphQLString),description:"The URL that specifies the behaviour of this scalar."}}});Ke.GraphQLSpecifiedByDirective=YT;var JT=Object.freeze([HT,QT,zT,YT]);Ke.specifiedDirectives=JT;function L1(e){return JT.some(function(t){var r=t.name;return r===e.name})}});var Fn=y(Li=>{"use strict";p();Object.defineProperty(Li,"__esModule",{value:!0});Li.isSchema=eI;Li.assertSchema=$1;Li.GraphQLSchema=void 0;var k1=rn(Ai()),j1=rn(of()),_f=rn(Tt()),M1=ur(),Sf=rn(ae()),F1=rn(Lu()),Xu=rn(Mt()),q1=rn(Qo()),U1=rn(ar()),V1=Ut(),XT=gt(),Xt=ie();function rn(e){return e&&e.__esModule?e:{default:e}}function ZT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function G1(e,t,r){return t&&ZT(e.prototype,t),r&&ZT(e,r),e}function eI(e){return(0,q1.default)(e,tI)}function $1(e){if(!eI(e))throw new Error("Expected ".concat((0,Sf.default)(e)," to be a GraphQL schema."));return e}var tI=(function(){function e(r){var n;this.__validationErrors=r.assumeValid===!0?[]:void 0,(0,U1.default)(r)||(0,Xu.default)(0,"Must provide configuration object."),!r.types||Array.isArray(r.types)||(0,Xu.default)(0,'"types" must be Array if provided but got: '.concat((0,Sf.default)(r.types),".")),!r.directives||Array.isArray(r.directives)||(0,Xu.default)(0,'"directives" must be Array if provided but got: '+"".concat((0,Sf.default)(r.directives),".")),this.description=r.description,this.extensions=r.extensions&&(0,F1.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=r.extensionASTNodes,this._queryType=r.query,this._mutationType=r.mutation,this._subscriptionType=r.subscription,this._directives=(n=r.directives)!==null&&n!==void 0?n:XT.specifiedDirectives;var i=new Set(r.types);if(r.types!=null)for(var o=0,s=r.types;o<s.length;o++){var a=s[o];i.delete(a),Zt(a,i)}this._queryType!=null&&Zt(this._queryType,i),this._mutationType!=null&&Zt(this._mutationType,i),this._subscriptionType!=null&&Zt(this._subscriptionType,i);for(var u=0,c=this._directives;u<c.length;u++){var l=c[u];if((0,XT.isDirective)(l))for(var d=0,f=l.args;d<f.length;d++){var h=f[d];Zt(h.type,i)}}Zt(V1.__Schema,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var g=0,v=(0,j1.default)(i);g<v.length;g++){var _=v[g];if(_!=null){var b=_.name;if(b||(0,Xu.default)(0,"One of the provided types for building the Schema is missing a name."),this._typeMap[b]!==void 0)throw new Error('Schema must contain uniquely named types but contains multiple types named "'.concat(b,'".'));if(this._typeMap[b]=_,(0,Xt.isInterfaceType)(_))for(var S=0,I=_.getInterfaces();S<I.length;S++){var A=I[S];if((0,Xt.isInterfaceType)(A)){var T=this._implementationsMap[A.name];T===void 0&&(T=this._implementationsMap[A.name]={objects:[],interfaces:[]}),T.interfaces.push(_)}}else if((0,Xt.isObjectType)(_))for(var x=0,U=_.getInterfaces();x<U.length;x++){var C=U[x];if((0,Xt.isInterfaceType)(C)){var te=this._implementationsMap[C.name];te===void 0&&(te=this._implementationsMap[C.name]={objects:[],interfaces:[]}),te.objects.push(_)}}}}}var t=e.prototype;return t.getQueryType=function(){return this._queryType},t.getMutationType=function(){return this._mutationType},t.getSubscriptionType=function(){return this._subscriptionType},t.getTypeMap=function(){return this._typeMap},t.getType=function(n){return this.getTypeMap()[n]},t.getPossibleTypes=function(n){return(0,Xt.isUnionType)(n)?n.getTypes():this.getImplementations(n).objects},t.getImplementations=function(n){var i=this._implementationsMap[n.name];return i??{objects:[],interfaces:[]}},t.isPossibleType=function(n,i){return this.isSubType(n,i)},t.isSubType=function(n,i){var o=this._subTypeMap[n.name];if(o===void 0){if(o=Object.create(null),(0,Xt.isUnionType)(n))for(var s=0,a=n.getTypes();s<a.length;s++){var u=a[s];o[u.name]=!0}else{for(var c=this.getImplementations(n),l=0,d=c.objects;l<d.length;l++){var f=d[l];o[f.name]=!0}for(var h=0,g=c.interfaces;h<g.length;h++){var v=g[h];o[v.name]=!0}}this._subTypeMap[n.name]=o}return o[i.name]!==void 0},t.getDirectives=function(){return this._directives},t.getDirective=function(n){return(0,k1.default)(this.getDirectives(),function(i){return i.name===n})},t.toConfig=function(){var n;return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:(0,_f.default)(this.getTypeMap()),directives:this.getDirectives().slice(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[],assumeValid:this.__validationErrors!==void 0}},G1(e,[{key:M1.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLSchema"}}]),e})();Li.GraphQLSchema=tI;function Zt(e,t){var r=(0,Xt.getNamedType)(e);if(!t.has(r)){if(t.add(r),(0,Xt.isUnionType)(r))for(var n=0,i=r.getTypes();n<i.length;n++){var o=i[n];Zt(o,t)}else if((0,Xt.isObjectType)(r)||(0,Xt.isInterfaceType)(r)){for(var s=0,a=r.getInterfaces();s<a.length;s++){var u=a[s];Zt(u,t)}for(var c=0,l=(0,_f.default)(r.getFields());c<l.length;c++){var d=l[c];Zt(d.type,t);for(var f=0,h=d.args;f<h.length;f++){var g=h[f];Zt(g.type,t)}}}else if((0,Xt.isInputObjectType)(r))for(var v=0,_=(0,_f.default)(r.getFields());v<_.length;v++){var b=_[v];Zt(b.type,t)}}return t}});var hs=y(Zu=>{"use strict";p();Object.defineProperty(Zu,"__esModule",{value:!0});Zu.validateSchema=uI;Zu.assertValidSchema=z1;var rI=Tf(Ai()),fs=Tf(Tt()),it=Tf(ae()),B1=H(),K1=Jo(),H1=Pd(),nI=is(),Q1=Fn(),W1=Ut(),aI=gt(),Fe=ie();function Tf(e){return e&&e.__esModule?e:{default:e}}function uI(e){if((0,Q1.assertSchema)(e),e.__validationErrors)return e.__validationErrors;var t=new Y1(e);J1(t),X1(t),Z1(t);var r=t.getErrors();return e.__validationErrors=r,r}function z1(e){var t=uI(e);if(t.length!==0)throw new Error(t.map(function(r){return r.message}).join(`
|
|
74
74
|
|
|
75
|
-
`))}var H1=(function(){function e(r){this._errors=[],this.schema=r}var t=e.prototype;return t.reportError=function(n,i){var o=Array.isArray(i)?i.filter(Boolean):i;this.addError(new U1.GraphQLError(n,o))},t.addError=function(n){this._errors.push(n)},t.getErrors=function(){return this._errors},e})();function Q1(e){var t=e.schema,r=t.getQueryType();if(!r)e.reportError("Query root type must be provided.",t.astNode);else if(!(0,Fe.isObjectType)(r)){var n;e.reportError("Query root type must be Object type, it cannot be ".concat((0,it.default)(r),"."),(n=Sf(t,"query"))!==null&&n!==void 0?n:r.astNode)}var i=t.getMutationType();if(i&&!(0,Fe.isObjectType)(i)){var o;e.reportError("Mutation root type must be Object type if provided, it cannot be "+"".concat((0,it.default)(i),"."),(o=Sf(t,"mutation"))!==null&&o!==void 0?o:i.astNode)}var s=t.getSubscriptionType();if(s&&!(0,Fe.isObjectType)(s)){var a;e.reportError("Subscription root type must be Object type if provided, it cannot be "+"".concat((0,it.default)(s),"."),(a=Sf(t,"subscription"))!==null&&a!==void 0?a:s.astNode)}}function Sf(e,t){for(var r=If(e,function(o){return o.operationTypes}),n=0;n<r.length;n++){var i=r[n];if(i.operation===t)return i.type}}function W1(e){for(var t=0,r=e.schema.getDirectives();t<r.length;t++){var n=r[t];if(!(0,sI.isDirective)(n)){e.reportError("Expected directive but got: ".concat((0,it.default)(n),"."),n?.astNode);continue}qn(e,n);for(var i=0,o=n.args;i<o.length;i++){var s=o[i];if(qn(e,s),(0,Fe.isInputType)(s.type)||e.reportError("The type of @".concat(n.name,"(").concat(s.name,":) must be Input Type ")+"but got: ".concat((0,it.default)(s.type),"."),s.astNode),(0,Fe.isRequiredArgument)(s)&&s.deprecationReason!=null){var a;e.reportError("Required argument @".concat(n.name,"(").concat(s.name,":) cannot be deprecated."),[wf(s.astNode),(a=s.astNode)===null||a===void 0?void 0:a.type])}}}}function qn(e,t){var r=(0,G1.isValidNameError)(t.name);r&&e.addError((0,V1.locatedError)(r,t.astNode))}function z1(e){for(var t=t$(e),r=e.schema.getTypeMap(),n=0,i=(0,ds.default)(r);n<i.length;n++){var o=i[n];if(!(0,Fe.isNamedType)(o)){e.reportError("Expected GraphQL named type but got: ".concat((0,it.default)(o),"."),o.astNode);continue}(0,B1.isIntrospectionType)(o)||qn(e,o),(0,Fe.isObjectType)(o)||(0,Fe.isInterfaceType)(o)?(nI(e,o),iI(e,o)):(0,Fe.isUnionType)(o)?X1(e,o):(0,Fe.isEnumType)(o)?Z1(e,o):(0,Fe.isInputObjectType)(o)&&(e$(e,o),t(o))}}function nI(e,t){var r=(0,ds.default)(t.getFields());r.length===0&&e.reportError("Type ".concat(t.name," must define one or more fields."),ki(t));for(var n=0;n<r.length;n++){var i=r[n];if(qn(e,i),!(0,Fe.isOutputType)(i.type)){var o;e.reportError("The type of ".concat(t.name,".").concat(i.name," must be Output Type ")+"but got: ".concat((0,it.default)(i.type),"."),(o=i.astNode)===null||o===void 0?void 0:o.type)}for(var s=0,a=i.args;s<a.length;s++){var u=a[s],c=u.name;if(qn(e,u),!(0,Fe.isInputType)(u.type)){var l;e.reportError("The type of ".concat(t.name,".").concat(i.name,"(").concat(c,":) must be Input ")+"Type but got: ".concat((0,it.default)(u.type),"."),(l=u.astNode)===null||l===void 0?void 0:l.type)}if((0,Fe.isRequiredArgument)(u)&&u.deprecationReason!=null){var d;e.reportError("Required argument ".concat(t.name,".").concat(i.name,"(").concat(c,":) cannot be deprecated."),[wf(u.astNode),(d=u.astNode)===null||d===void 0?void 0:d.type])}}}}function iI(e,t){for(var r=Object.create(null),n=0,i=t.getInterfaces();n<i.length;n++){var o=i[n];if(!(0,Fe.isInterfaceType)(o)){e.reportError("Type ".concat((0,it.default)(t)," must only implement Interface types, ")+"it cannot implement ".concat((0,it.default)(o),"."),ps(t,o));continue}if(t===o){e.reportError("Type ".concat(t.name," cannot implement itself because it would create a circular reference."),ps(t,o));continue}if(r[o.name]){e.reportError("Type ".concat(t.name," can only implement ").concat(o.name," once."),ps(t,o));continue}r[o.name]=!0,J1(e,t,o),Y1(e,t,o)}}function Y1(e,t,r){for(var n=t.getFields(),i=0,o=(0,ds.default)(r.getFields());i<o.length;i++){var s=o[i],a=s.name,u=n[a];if(!u){e.reportError("Interface field ".concat(r.name,".").concat(a," expected but ").concat(t.name," does not provide it."),[s.astNode].concat(ki(t)));continue}if(!(0,rI.isTypeSubTypeOf)(e.schema,u.type,s.type)){var c,l;e.reportError("Interface field ".concat(r.name,".").concat(a," expects type ")+"".concat((0,it.default)(s.type)," but ").concat(t.name,".").concat(a," ")+"is type ".concat((0,it.default)(u.type),"."),[(c=s.astNode)===null||c===void 0?void 0:c.type,(l=u.astNode)===null||l===void 0?void 0:l.type])}for(var d=function(A,O){var T=O[A],x=T.name,U=(0,tI.default)(u.args,function(de){return de.name===x});if(!U)return e.reportError("Interface field argument ".concat(r.name,".").concat(a,"(").concat(x,":) expected but ").concat(t.name,".").concat(a," does not provide it."),[T.astNode,u.astNode]),"continue";if(!(0,rI.isEqualType)(T.type,U.type)){var C,te;e.reportError("Interface field argument ".concat(r.name,".").concat(a,"(").concat(x,":) ")+"expects type ".concat((0,it.default)(T.type)," but ")+"".concat(t.name,".").concat(a,"(").concat(x,":) is type ")+"".concat((0,it.default)(U.type),"."),[(C=T.astNode)===null||C===void 0?void 0:C.type,(te=U.astNode)===null||te===void 0?void 0:te.type])}},f=0,h=s.args;f<h.length;f++)var g=d(f,h);for(var v=function(A,O){var T=O[A],x=T.name,U=(0,tI.default)(s.args,function(C){return C.name===x});!U&&(0,Fe.isRequiredArgument)(T)&&e.reportError("Object field ".concat(t.name,".").concat(a," includes required argument ").concat(x," that is missing from the Interface field ").concat(r.name,".").concat(a,"."),[T.astNode,s.astNode])},_=0,S=u.args;_<S.length;_++)v(_,S)}}function J1(e,t,r){for(var n=t.getInterfaces(),i=0,o=r.getInterfaces();i<o.length;i++){var s=o[i];n.indexOf(s)===-1&&e.reportError(s===t?"Type ".concat(t.name," cannot implement ").concat(r.name," because it would create a circular reference."):"Type ".concat(t.name," must implement ").concat(s.name," because it is implemented by ").concat(r.name,"."),[].concat(ps(r,s),ps(t,r)))}}function X1(e,t){var r=t.getTypes();r.length===0&&e.reportError("Union type ".concat(t.name," must define one or more member types."),ki(t));for(var n=Object.create(null),i=0;i<r.length;i++){var o=r[i];if(n[o.name]){e.reportError("Union type ".concat(t.name," can only include type ").concat(o.name," once."),oI(t,o.name));continue}n[o.name]=!0,(0,Fe.isObjectType)(o)||e.reportError("Union type ".concat(t.name," can only include Object types, ")+"it cannot include ".concat((0,it.default)(o),"."),oI(t,String(o)))}}function Z1(e,t){var r=t.getValues();r.length===0&&e.reportError("Enum type ".concat(t.name," must define one or more values."),ki(t));for(var n=0;n<r.length;n++){var i=r[n],o=i.name;qn(e,i),(o==="true"||o==="false"||o==="null")&&e.reportError("Enum type ".concat(t.name," cannot include value: ").concat(o,"."),i.astNode)}}function e$(e,t){var r=(0,ds.default)(t.getFields());r.length===0&&e.reportError("Input Object type ".concat(t.name," must define one or more fields."),ki(t));for(var n=0;n<r.length;n++){var i=r[n];if(qn(e,i),!(0,Fe.isInputType)(i.type)){var o;e.reportError("The type of ".concat(t.name,".").concat(i.name," must be Input Type ")+"but got: ".concat((0,it.default)(i.type),"."),(o=i.astNode)===null||o===void 0?void 0:o.type)}if((0,Fe.isRequiredInputField)(i)&&i.deprecationReason!=null){var s;e.reportError("Required input field ".concat(t.name,".").concat(i.name," cannot be deprecated."),[wf(i.astNode),(s=i.astNode)===null||s===void 0?void 0:s.type])}}}function t$(e){var t=Object.create(null),r=[],n=Object.create(null);return i;function i(o){if(!t[o.name]){t[o.name]=!0,n[o.name]=r.length;for(var s=(0,ds.default)(o.getFields()),a=0;a<s.length;a++){var u=s[a];if((0,Fe.isNonNullType)(u.type)&&(0,Fe.isInputObjectType)(u.type.ofType)){var c=u.type.ofType,l=n[c.name];if(r.push(u),l===void 0)i(c);else{var d=r.slice(l),f=d.map(function(h){return h.name}).join(".");e.reportError('Cannot reference Input Object "'.concat(c.name,'" within itself through a series of non-null fields: "').concat(f,'".'),d.map(function(h){return h.astNode}))}r.pop()}}n[o.name]=void 0}}}function ki(e){var t=e.astNode,r=e.extensionASTNodes;return t?r?[t].concat(r):[t]:r??[]}function If(e,t){for(var r=[],n=0,i=ki(e);n<i.length;n++){var o,s=i[n];r=r.concat((o=t(s))!==null&&o!==void 0?o:[])}return r}function ps(e,t){return If(e,function(r){return r.interfaces}).filter(function(r){return r.name.value===t.name})}function oI(e,t){return If(e,function(r){return r.types}).filter(function(r){return r.name.value===t})}function wf(e){var t;return e==null||(t=e.directives)===null||t===void 0?void 0:t.find(function(r){return r.name.value===sI.GraphQLDeprecatedDirective.name})}});var dr=y(xf=>{"use strict";p();Object.defineProperty(xf,"__esModule",{value:!0});xf.typeFromAST=Af;var r$=cI(ae()),n$=cI(et()),Of=_e(),uI=ie();function cI(e){return e&&e.__esModule?e:{default:e}}function Af(e,t){var r;if(t.kind===Of.Kind.LIST_TYPE)return r=Af(e,t.type),r&&new uI.GraphQLList(r);if(t.kind===Of.Kind.NON_NULL_TYPE)return r=Af(e,t.type),r&&new uI.GraphQLNonNull(r);if(t.kind===Of.Kind.NAMED_TYPE)return e.getType(t.name.value);(0,n$.default)(0,"Unexpected type node: "+(0,r$.default)(t))}});var ec=y(hs=>{"use strict";p();Object.defineProperty(hs,"__esModule",{value:!0});hs.visitWithTypeInfo=c$;hs.TypeInfo=void 0;var i$=s$(Ai()),De=_e(),o$=bi(),lI=Hr(),Le=ie(),ji=Ut(),pI=dr();function s$(e){return e&&e.__esModule?e:{default:e}}var a$=(function(){function e(r,n,i){this._schema=r,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=n??u$,i&&((0,Le.isInputType)(i)&&this._inputTypeStack.push(i),(0,Le.isCompositeType)(i)&&this._parentTypeStack.push(i),(0,Le.isOutputType)(i)&&this._typeStack.push(i))}var t=e.prototype;return t.getType=function(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]},t.getParentType=function(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]},t.getInputType=function(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]},t.getParentInputType=function(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]},t.getFieldDef=function(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]},t.getDefaultValue=function(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]},t.getDirective=function(){return this._directive},t.getArgument=function(){return this._argument},t.getEnumValue=function(){return this._enumValue},t.enter=function(n){var i=this._schema;switch(n.kind){case De.Kind.SELECTION_SET:{var o=(0,Le.getNamedType)(this.getType());this._parentTypeStack.push((0,Le.isCompositeType)(o)?o:void 0);break}case De.Kind.FIELD:{var s=this.getParentType(),a,u;s&&(a=this._getFieldDef(i,s,n),a&&(u=a.type)),this._fieldDefStack.push(a),this._typeStack.push((0,Le.isOutputType)(u)?u:void 0);break}case De.Kind.DIRECTIVE:this._directive=i.getDirective(n.name.value);break;case De.Kind.OPERATION_DEFINITION:{var c;switch(n.operation){case"query":c=i.getQueryType();break;case"mutation":c=i.getMutationType();break;case"subscription":c=i.getSubscriptionType();break}this._typeStack.push((0,Le.isObjectType)(c)?c:void 0);break}case De.Kind.INLINE_FRAGMENT:case De.Kind.FRAGMENT_DEFINITION:{var l=n.typeCondition,d=l?(0,pI.typeFromAST)(i,l):(0,Le.getNamedType)(this.getType());this._typeStack.push((0,Le.isOutputType)(d)?d:void 0);break}case De.Kind.VARIABLE_DEFINITION:{var f=(0,pI.typeFromAST)(i,n.type);this._inputTypeStack.push((0,Le.isInputType)(f)?f:void 0);break}case De.Kind.ARGUMENT:{var h,g,v,_=(h=this.getDirective())!==null&&h!==void 0?h:this.getFieldDef();_&&(g=(0,i$.default)(_.args,function(C){return C.name===n.name.value}),g&&(v=g.type)),this._argument=g,this._defaultValueStack.push(g?g.defaultValue:void 0),this._inputTypeStack.push((0,Le.isInputType)(v)?v:void 0);break}case De.Kind.LIST:{var S=(0,Le.getNullableType)(this.getInputType()),b=(0,Le.isListType)(S)?S.ofType:S;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,Le.isInputType)(b)?b:void 0);break}case De.Kind.OBJECT_FIELD:{var A=(0,Le.getNamedType)(this.getInputType()),O,T;(0,Le.isInputObjectType)(A)&&(T=A.getFields()[n.name.value],T&&(O=T.type)),this._defaultValueStack.push(T?T.defaultValue:void 0),this._inputTypeStack.push((0,Le.isInputType)(O)?O:void 0);break}case De.Kind.ENUM:{var x=(0,Le.getNamedType)(this.getInputType()),U;(0,Le.isEnumType)(x)&&(U=x.getValue(n.value)),this._enumValue=U;break}}},t.leave=function(n){switch(n.kind){case De.Kind.SELECTION_SET:this._parentTypeStack.pop();break;case De.Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case De.Kind.DIRECTIVE:this._directive=null;break;case De.Kind.OPERATION_DEFINITION:case De.Kind.INLINE_FRAGMENT:case De.Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case De.Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case De.Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case De.Kind.LIST:case De.Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case De.Kind.ENUM:this._enumValue=null;break}},e})();hs.TypeInfo=a$;function u$(e,t,r){var n=r.name.value;if(n===ji.SchemaMetaFieldDef.name&&e.getQueryType()===t)return ji.SchemaMetaFieldDef;if(n===ji.TypeMetaFieldDef.name&&e.getQueryType()===t)return ji.TypeMetaFieldDef;if(n===ji.TypeNameMetaFieldDef.name&&(0,Le.isCompositeType)(t))return ji.TypeNameMetaFieldDef;if((0,Le.isObjectType)(t)||(0,Le.isInterfaceType)(t))return t.getFields()[n]}function c$(e,t){return{enter:function(n){e.enter(n);var i=(0,lI.getVisitFn)(t,n.kind,!1);if(i){var o=i.apply(t,arguments);return o!==void 0&&(e.leave(n),(0,o$.isNode)(o)&&e.enter(o)),o}},leave:function(n){var i=(0,lI.getVisitFn)(t,n.kind,!0),o;return i&&(o=i.apply(t,arguments)),e.leave(n),o}}}});var Un=y(er=>{"use strict";p();Object.defineProperty(er,"__esModule",{value:!0});er.isDefinitionNode=l$;er.isExecutableDefinitionNode=dI;er.isSelectionNode=p$;er.isValueNode=d$;er.isTypeNode=f$;er.isTypeSystemDefinitionNode=fI;er.isTypeDefinitionNode=hI;er.isTypeSystemExtensionNode=mI;er.isTypeExtensionNode=gI;var ue=_e();function l$(e){return dI(e)||fI(e)||mI(e)}function dI(e){return e.kind===ue.Kind.OPERATION_DEFINITION||e.kind===ue.Kind.FRAGMENT_DEFINITION}function p$(e){return e.kind===ue.Kind.FIELD||e.kind===ue.Kind.FRAGMENT_SPREAD||e.kind===ue.Kind.INLINE_FRAGMENT}function d$(e){return e.kind===ue.Kind.VARIABLE||e.kind===ue.Kind.INT||e.kind===ue.Kind.FLOAT||e.kind===ue.Kind.STRING||e.kind===ue.Kind.BOOLEAN||e.kind===ue.Kind.NULL||e.kind===ue.Kind.ENUM||e.kind===ue.Kind.LIST||e.kind===ue.Kind.OBJECT}function f$(e){return e.kind===ue.Kind.NAMED_TYPE||e.kind===ue.Kind.LIST_TYPE||e.kind===ue.Kind.NON_NULL_TYPE}function fI(e){return e.kind===ue.Kind.SCHEMA_DEFINITION||hI(e)||e.kind===ue.Kind.DIRECTIVE_DEFINITION}function hI(e){return e.kind===ue.Kind.SCALAR_TYPE_DEFINITION||e.kind===ue.Kind.OBJECT_TYPE_DEFINITION||e.kind===ue.Kind.INTERFACE_TYPE_DEFINITION||e.kind===ue.Kind.UNION_TYPE_DEFINITION||e.kind===ue.Kind.ENUM_TYPE_DEFINITION||e.kind===ue.Kind.INPUT_OBJECT_TYPE_DEFINITION}function mI(e){return e.kind===ue.Kind.SCHEMA_EXTENSION||gI(e)}function gI(e){return e.kind===ue.Kind.SCALAR_TYPE_EXTENSION||e.kind===ue.Kind.OBJECT_TYPE_EXTENSION||e.kind===ue.Kind.INTERFACE_TYPE_EXTENSION||e.kind===ue.Kind.UNION_TYPE_EXTENSION||e.kind===ue.Kind.ENUM_TYPE_EXTENSION||e.kind===ue.Kind.INPUT_OBJECT_TYPE_EXTENSION}});var Rf=y(Cf=>{"use strict";p();Object.defineProperty(Cf,"__esModule",{value:!0});Cf.ExecutableDefinitionsRule=g$;var h$=H(),yI=_e(),m$=Un();function g$(e){return{Document:function(r){for(var n=0,i=r.definitions;n<i.length;n++){var o=i[n];if(!(0,m$.isExecutableDefinitionNode)(o)){var s=o.kind===yI.Kind.SCHEMA_DEFINITION||o.kind===yI.Kind.SCHEMA_EXTENSION?"schema":'"'+o.name.value+'"';e.reportError(new h$.GraphQLError("The ".concat(s," definition is not executable."),o))}}return!1}}}});var Pf=y(Nf=>{"use strict";p();Object.defineProperty(Nf,"__esModule",{value:!0});Nf.UniqueOperationNamesRule=v$;var y$=H();function v$(e){var t=Object.create(null);return{OperationDefinition:function(n){var i=n.name;return i&&(t[i.value]?e.reportError(new y$.GraphQLError('There can be only one operation named "'.concat(i.value,'".'),[t[i.value],i])):t[i.value]=i),!1},FragmentDefinition:function(){return!1}}}});var Lf=y(Df=>{"use strict";p();Object.defineProperty(Df,"__esModule",{value:!0});Df.LoneAnonymousOperationRule=b$;var E$=H(),_$=_e();function b$(e){var t=0;return{Document:function(n){t=n.definitions.filter(function(i){return i.kind===_$.Kind.OPERATION_DEFINITION}).length},OperationDefinition:function(n){!n.name&&t>1&&e.reportError(new E$.GraphQLError("This anonymous operation must be the only defined operation.",n))}}}});var jf=y(kf=>{"use strict";p();Object.defineProperty(kf,"__esModule",{value:!0});kf.SingleFieldSubscriptionsRule=T$;var S$=H();function T$(e){return{OperationDefinition:function(r){r.operation==="subscription"&&r.selectionSet.selections.length!==1&&e.reportError(new S$.GraphQLError(r.name?'Subscription "'.concat(r.name.value,'" must select only one top level field.'):"Anonymous Subscription must select only one top level field.",r.selectionSet.selections.slice(1)))}}}});var qf=y(Ff=>{"use strict";p();Object.defineProperty(Ff,"__esModule",{value:!0});Ff.KnownTypeNamesRule=C$;var I$=vI(Wr()),w$=vI(zr()),O$=H(),Mf=Un(),A$=pr(),x$=Ut();function vI(e){return e&&e.__esModule?e:{default:e}}function C$(e){for(var t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null),i=0,o=e.getDocument().definitions;i<o.length;i++){var s=o[i];(0,Mf.isTypeDefinitionNode)(s)&&(n[s.name.value]=!0)}var a=Object.keys(r).concat(Object.keys(n));return{NamedType:function(c,l,d,f,h){var g=c.name.value;if(!r[g]&&!n[g]){var v,_=(v=h[2])!==null&&v!==void 0?v:d,S=_!=null&&N$(_);if(S&&R$(g))return;var b=(0,w$.default)(g,S?EI.concat(a):a);e.reportError(new O$.GraphQLError('Unknown type "'.concat(g,'".')+(0,I$.default)(b),c))}}}}var EI=[].concat(A$.specifiedScalarTypes,x$.introspectionTypes).map(function(e){return e.name});function R$(e){return EI.indexOf(e)!==-1}function N$(e){return!Array.isArray(e)&&((0,Mf.isTypeSystemDefinitionNode)(e)||(0,Mf.isTypeSystemExtensionNode)(e))}});var Vf=y(Uf=>{"use strict";p();Object.defineProperty(Uf,"__esModule",{value:!0});Uf.FragmentsOnCompositeTypesRule=P$;var _I=H(),bI=mt(),SI=ie(),TI=dr();function P$(e){return{InlineFragment:function(r){var n=r.typeCondition;if(n){var i=(0,TI.typeFromAST)(e.getSchema(),n);if(i&&!(0,SI.isCompositeType)(i)){var o=(0,bI.print)(n);e.reportError(new _I.GraphQLError('Fragment cannot condition on non composite type "'.concat(o,'".'),n))}}},FragmentDefinition:function(r){var n=(0,TI.typeFromAST)(e.getSchema(),r.typeCondition);if(n&&!(0,SI.isCompositeType)(n)){var i=(0,bI.print)(r.typeCondition);e.reportError(new _I.GraphQLError('Fragment "'.concat(r.name.value,'" cannot condition on non composite type "').concat(i,'".'),r.typeCondition))}}}}});var $f=y(Gf=>{"use strict";p();Object.defineProperty(Gf,"__esModule",{value:!0});Gf.VariablesAreInputTypesRule=M$;var D$=H(),L$=mt(),k$=ie(),j$=dr();function M$(e){return{VariableDefinition:function(r){var n=(0,j$.typeFromAST)(e.getSchema(),r.type);if(n&&!(0,k$.isInputType)(n)){var i=r.variable.name.value,o=(0,L$.print)(r.type);e.reportError(new D$.GraphQLError('Variable "$'.concat(i,'" cannot be non-input type "').concat(o,'".'),r.type))}}}}});var Kf=y(Bf=>{"use strict";p();Object.defineProperty(Bf,"__esModule",{value:!0});Bf.ScalarLeafsRule=q$;var II=F$(ae()),wI=H(),OI=ie();function F$(e){return e&&e.__esModule?e:{default:e}}function q$(e){return{Field:function(r){var n=e.getType(),i=r.selectionSet;if(n){if((0,OI.isLeafType)((0,OI.getNamedType)(n))){if(i){var o=r.name.value,s=(0,II.default)(n);e.reportError(new wI.GraphQLError('Field "'.concat(o,'" must not have a selection since type "').concat(s,'" has no subfields.'),i))}}else if(!i){var a=r.name.value,u=(0,II.default)(n);e.reportError(new wI.GraphQLError('Field "'.concat(a,'" of type "').concat(u,'" must have a selection of subfields. Did you mean "').concat(a,' { ... }"?'),r))}}}}}});var Qf=y(Hf=>{"use strict";p();Object.defineProperty(Hf,"__esModule",{value:!0});Hf.FieldsOnCorrectTypeRule=B$;var U$=tc(of()),AI=tc(Wr()),V$=tc(zr()),G$=tc(Xo()),$$=H(),ms=ie();function tc(e){return e&&e.__esModule?e:{default:e}}function B$(e){return{Field:function(r){var n=e.getParentType();if(n){var i=e.getFieldDef();if(!i){var o=e.getSchema(),s=r.name.value,a=(0,AI.default)("to use an inline fragment on",K$(o,n,s));a===""&&(a=(0,AI.default)(H$(n,s))),e.reportError(new $$.GraphQLError('Cannot query field "'.concat(s,'" on type "').concat(n.name,'".')+a,r))}}}}}function K$(e,t,r){if(!(0,ms.isAbstractType)(t))return[];for(var n=new Set,i=Object.create(null),o=0,s=e.getPossibleTypes(t);o<s.length;o++){var a=s[o];if(a.getFields()[r]){n.add(a),i[a.name]=1;for(var u=0,c=a.getInterfaces();u<c.length;u++){var l,d=c[u];d.getFields()[r]&&(n.add(d),i[d.name]=((l=i[d.name])!==null&&l!==void 0?l:0)+1)}}}return(0,U$.default)(n).sort(function(f,h){var g=i[h.name]-i[f.name];return g!==0?g:(0,ms.isInterfaceType)(f)&&e.isSubType(f,h)?-1:(0,ms.isInterfaceType)(h)&&e.isSubType(h,f)?1:(0,G$.default)(f.name,h.name)}).map(function(f){return f.name})}function H$(e,t){if((0,ms.isObjectType)(e)||(0,ms.isInterfaceType)(e)){var r=Object.keys(e.getFields());return(0,V$.default)(t,r)}return[]}});var zf=y(Wf=>{"use strict";p();Object.defineProperty(Wf,"__esModule",{value:!0});Wf.UniqueFragmentNamesRule=W$;var Q$=H();function W$(e){var t=Object.create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(n){var i=n.name.value;return t[i]?e.reportError(new Q$.GraphQLError('There can be only one fragment named "'.concat(i,'".'),[t[i],n.name])):t[i]=n.name,!1}}}});var Jf=y(Yf=>{"use strict";p();Object.defineProperty(Yf,"__esModule",{value:!0});Yf.KnownFragmentNamesRule=Y$;var z$=H();function Y$(e){return{FragmentSpread:function(r){var n=r.name.value,i=e.getFragment(n);i||e.reportError(new z$.GraphQLError('Unknown fragment "'.concat(n,'".'),r.name))}}}});var Zf=y(Xf=>{"use strict";p();Object.defineProperty(Xf,"__esModule",{value:!0});Xf.NoUnusedFragmentsRule=X$;var J$=H();function X$(e){var t=[],r=[];return{OperationDefinition:function(i){return t.push(i),!1},FragmentDefinition:function(i){return r.push(i),!1},Document:{leave:function(){for(var i=Object.create(null),o=0;o<t.length;o++)for(var s=t[o],a=0,u=e.getRecursivelyReferencedFragments(s);a<u.length;a++){var c=u[a];i[c.name.value]=!0}for(var l=0;l<r.length;l++){var d=r[l],f=d.name.value;i[f]!==!0&&e.reportError(new J$.GraphQLError('Fragment "'.concat(f,'" is never used.'),d))}}}}}});var rh=y(th=>{"use strict";p();Object.defineProperty(th,"__esModule",{value:!0});th.PossibleFragmentSpreadsRule=tB;var rc=eB(ae()),xI=H(),eh=ie(),Z$=dr(),CI=ns();function eB(e){return e&&e.__esModule?e:{default:e}}function tB(e){return{InlineFragment:function(r){var n=e.getType(),i=e.getParentType();if((0,eh.isCompositeType)(n)&&(0,eh.isCompositeType)(i)&&!(0,CI.doTypesOverlap)(e.getSchema(),n,i)){var o=(0,rc.default)(i),s=(0,rc.default)(n);e.reportError(new xI.GraphQLError('Fragment cannot be spread here as objects of type "'.concat(o,'" can never be of type "').concat(s,'".'),r))}},FragmentSpread:function(r){var n=r.name.value,i=rB(e,n),o=e.getParentType();if(i&&o&&!(0,CI.doTypesOverlap)(e.getSchema(),i,o)){var s=(0,rc.default)(o),a=(0,rc.default)(i);e.reportError(new xI.GraphQLError('Fragment "'.concat(n,'" cannot be spread here as objects of type "').concat(s,'" can never be of type "').concat(a,'".'),r))}}}}function rB(e,t){var r=e.getFragment(t);if(r){var n=(0,Z$.typeFromAST)(e.getSchema(),r.typeCondition);if((0,eh.isCompositeType)(n))return n}}});var ih=y(nh=>{"use strict";p();Object.defineProperty(nh,"__esModule",{value:!0});nh.NoFragmentCyclesRule=iB;var nB=H();function iB(e){var t=Object.create(null),r=[],n=Object.create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(s){return i(s),!1}};function i(o){if(!t[o.name.value]){var s=o.name.value;t[s]=!0;var a=e.getFragmentSpreads(o.selectionSet);if(a.length!==0){n[s]=r.length;for(var u=0;u<a.length;u++){var c=a[u],l=c.name.value,d=n[l];if(r.push(c),d===void 0){var f=e.getFragment(l);f&&i(f)}else{var h=r.slice(d),g=h.slice(0,-1).map(function(v){return'"'+v.name.value+'"'}).join(", ");e.reportError(new nB.GraphQLError('Cannot spread fragment "'.concat(l,'" within itself')+(g!==""?" via ".concat(g,"."):"."),h))}r.pop()}n[s]=void 0}}}}});var sh=y(oh=>{"use strict";p();Object.defineProperty(oh,"__esModule",{value:!0});oh.UniqueVariableNamesRule=sB;var oB=H();function sB(e){var t=Object.create(null);return{OperationDefinition:function(){t=Object.create(null)},VariableDefinition:function(n){var i=n.variable.name.value;t[i]?e.reportError(new oB.GraphQLError('There can be only one variable named "$'.concat(i,'".'),[t[i],n.variable.name])):t[i]=n.variable.name}}}});var uh=y(ah=>{"use strict";p();Object.defineProperty(ah,"__esModule",{value:!0});ah.NoUndefinedVariablesRule=uB;var aB=H();function uB(e){var t=Object.create(null);return{OperationDefinition:{enter:function(){t=Object.create(null)},leave:function(n){for(var i=e.getRecursiveVariableUsages(n),o=0;o<i.length;o++){var s=i[o],a=s.node,u=a.name.value;t[u]!==!0&&e.reportError(new aB.GraphQLError(n.name?'Variable "$'.concat(u,'" is not defined by operation "').concat(n.name.value,'".'):'Variable "$'.concat(u,'" is not defined.'),[a,n]))}}},VariableDefinition:function(n){t[n.variable.name.value]=!0}}}});var lh=y(ch=>{"use strict";p();Object.defineProperty(ch,"__esModule",{value:!0});ch.NoUnusedVariablesRule=lB;var cB=H();function lB(e){var t=[];return{OperationDefinition:{enter:function(){t=[]},leave:function(n){for(var i=Object.create(null),o=e.getRecursiveVariableUsages(n),s=0;s<o.length;s++){var a=o[s],u=a.node;i[u.name.value]=!0}for(var c=0,l=t;c<l.length;c++){var d=l[c],f=d.variable.name.value;i[f]!==!0&&e.reportError(new cB.GraphQLError(n.name?'Variable "$'.concat(f,'" is never used in operation "').concat(n.name.value,'".'):'Variable "$'.concat(f,'" is never used.'),d))}}},VariableDefinition:function(n){t.push(n)}}}});var dh=y(ph=>{"use strict";p();Object.defineProperty(ph,"__esModule",{value:!0});ph.KnownDirectivesRule=fB;var pB=PI(ae()),NI=PI(et()),RI=H(),Oe=_e(),He=Ti(),dB=gt();function PI(e){return e&&e.__esModule?e:{default:e}}function fB(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():dB.specifiedDirectives,i=0;i<n.length;i++){var o=n[i];t[o.name]=o.locations}for(var s=e.getDocument().definitions,a=0;a<s.length;a++){var u=s[a];u.kind===Oe.Kind.DIRECTIVE_DEFINITION&&(t[u.name.value]=u.locations.map(function(c){return c.value}))}return{Directive:function(l,d,f,h,g){var v=l.name.value,_=t[v];if(!_){e.reportError(new RI.GraphQLError('Unknown directive "@'.concat(v,'".'),l));return}var S=hB(g);S&&_.indexOf(S)===-1&&e.reportError(new RI.GraphQLError('Directive "@'.concat(v,'" may not be used on ').concat(S,"."),l))}}}function hB(e){var t=e[e.length-1];switch(!Array.isArray(t)||(0,NI.default)(0),t.kind){case Oe.Kind.OPERATION_DEFINITION:return mB(t.operation);case Oe.Kind.FIELD:return He.DirectiveLocation.FIELD;case Oe.Kind.FRAGMENT_SPREAD:return He.DirectiveLocation.FRAGMENT_SPREAD;case Oe.Kind.INLINE_FRAGMENT:return He.DirectiveLocation.INLINE_FRAGMENT;case Oe.Kind.FRAGMENT_DEFINITION:return He.DirectiveLocation.FRAGMENT_DEFINITION;case Oe.Kind.VARIABLE_DEFINITION:return He.DirectiveLocation.VARIABLE_DEFINITION;case Oe.Kind.SCHEMA_DEFINITION:case Oe.Kind.SCHEMA_EXTENSION:return He.DirectiveLocation.SCHEMA;case Oe.Kind.SCALAR_TYPE_DEFINITION:case Oe.Kind.SCALAR_TYPE_EXTENSION:return He.DirectiveLocation.SCALAR;case Oe.Kind.OBJECT_TYPE_DEFINITION:case Oe.Kind.OBJECT_TYPE_EXTENSION:return He.DirectiveLocation.OBJECT;case Oe.Kind.FIELD_DEFINITION:return He.DirectiveLocation.FIELD_DEFINITION;case Oe.Kind.INTERFACE_TYPE_DEFINITION:case Oe.Kind.INTERFACE_TYPE_EXTENSION:return He.DirectiveLocation.INTERFACE;case Oe.Kind.UNION_TYPE_DEFINITION:case Oe.Kind.UNION_TYPE_EXTENSION:return He.DirectiveLocation.UNION;case Oe.Kind.ENUM_TYPE_DEFINITION:case Oe.Kind.ENUM_TYPE_EXTENSION:return He.DirectiveLocation.ENUM;case Oe.Kind.ENUM_VALUE_DEFINITION:return He.DirectiveLocation.ENUM_VALUE;case Oe.Kind.INPUT_OBJECT_TYPE_DEFINITION:case Oe.Kind.INPUT_OBJECT_TYPE_EXTENSION:return He.DirectiveLocation.INPUT_OBJECT;case Oe.Kind.INPUT_VALUE_DEFINITION:{var r=e[e.length-3];return r.kind===Oe.Kind.INPUT_OBJECT_TYPE_DEFINITION?He.DirectiveLocation.INPUT_FIELD_DEFINITION:He.DirectiveLocation.ARGUMENT_DEFINITION}}}function mB(e){switch(e){case"query":return He.DirectiveLocation.QUERY;case"mutation":return He.DirectiveLocation.MUTATION;case"subscription":return He.DirectiveLocation.SUBSCRIPTION}(0,NI.default)(0,"Unexpected operation: "+(0,pB.default)(e))}});var mh=y(hh=>{"use strict";p();Object.defineProperty(hh,"__esModule",{value:!0});hh.UniqueDirectivesPerLocationRule=vB;var gB=H(),fh=_e(),DI=Un(),yB=gt();function vB(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():yB.specifiedDirectives,i=0;i<n.length;i++){var o=n[i];t[o.name]=!o.isRepeatable}for(var s=e.getDocument().definitions,a=0;a<s.length;a++){var u=s[a];u.kind===fh.Kind.DIRECTIVE_DEFINITION&&(t[u.name.value]=!u.repeatable)}var c=Object.create(null),l=Object.create(null);return{enter:function(f){if(f.directives!=null){var h;if(f.kind===fh.Kind.SCHEMA_DEFINITION||f.kind===fh.Kind.SCHEMA_EXTENSION)h=c;else if((0,DI.isTypeDefinitionNode)(f)||(0,DI.isTypeExtensionNode)(f)){var g=f.name.value;h=l[g],h===void 0&&(l[g]=h=Object.create(null))}else h=Object.create(null);for(var v=0,_=f.directives;v<_.length;v++){var S=_[v],b=S.name.value;t[b]&&(h[b]?e.reportError(new gB.GraphQLError('The directive "@'.concat(b,'" can only be used once at this location.'),[h[b],S])):h[b]=S)}}}}}});var gh=y(nc=>{"use strict";p();Object.defineProperty(nc,"__esModule",{value:!0});nc.KnownArgumentNamesRule=SB;nc.KnownArgumentNamesOnDirectivesRule=UI;var jI=qI(Wr()),MI=qI(zr()),FI=H(),EB=_e(),_B=gt();function qI(e){return e&&e.__esModule?e:{default:e}}function LI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function kI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?LI(Object(r),!0).forEach(function(n){bB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):LI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SB(e){return kI(kI({},UI(e)),{},{Argument:function(r){var n=e.getArgument(),i=e.getFieldDef(),o=e.getParentType();if(!n&&i&&o){var s=r.name.value,a=i.args.map(function(c){return c.name}),u=(0,MI.default)(s,a);e.reportError(new FI.GraphQLError('Unknown argument "'.concat(s,'" on field "').concat(o.name,".").concat(i.name,'".')+(0,jI.default)(u),r))}}})}function UI(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():_B.specifiedDirectives,i=0;i<n.length;i++){var o=n[i];t[o.name]=o.args.map(function(d){return d.name})}for(var s=e.getDocument().definitions,a=0;a<s.length;a++){var u=s[a];if(u.kind===EB.Kind.DIRECTIVE_DEFINITION){var c,l=(c=u.arguments)!==null&&c!==void 0?c:[];t[u.name.value]=l.map(function(d){return d.name.value})}}return{Directive:function(f){var h=f.name.value,g=t[h];if(f.arguments&&g)for(var v=0,_=f.arguments;v<_.length;v++){var S=_[v],b=S.name.value;if(g.indexOf(b)===-1){var A=(0,MI.default)(b,g);e.reportError(new FI.GraphQLError('Unknown argument "'.concat(b,'" on directive "@').concat(h,'".')+(0,jI.default)(A),S))}}return!1}}}});var vh=y(yh=>{"use strict";p();Object.defineProperty(yh,"__esModule",{value:!0});yh.UniqueArgumentNamesRule=IB;var TB=H();function IB(e){var t=Object.create(null);return{Field:function(){t=Object.create(null)},Directive:function(){t=Object.create(null)},Argument:function(n){var i=n.name.value;return t[i]?e.reportError(new TB.GraphQLError('There can be only one argument named "'.concat(i,'".'),[t[i],n.name])):t[i]=n.name,!1}}}});var _h=y(Eh=>{"use strict";p();Object.defineProperty(Eh,"__esModule",{value:!0});Eh.ValuesOfCorrectTypeRule=CB;var wB=ys(St()),OB=ys(Qr()),gs=ys(ae()),AB=ys(Wr()),xB=ys(zr()),Gn=H(),ic=mt(),fr=ie();function ys(e){return e&&e.__esModule?e:{default:e}}function CB(e){return{ListValue:function(r){var n=(0,fr.getNullableType)(e.getParentInputType());if(!(0,fr.isListType)(n))return Vn(e,r),!1},ObjectValue:function(r){var n=(0,fr.getNamedType)(e.getInputType());if(!(0,fr.isInputObjectType)(n))return Vn(e,r),!1;for(var i=(0,OB.default)(r.fields,function(l){return l.name.value}),o=0,s=(0,wB.default)(n.getFields());o<s.length;o++){var a=s[o],u=i[a.name];if(!u&&(0,fr.isRequiredInputField)(a)){var c=(0,gs.default)(a.type);e.reportError(new Gn.GraphQLError('Field "'.concat(n.name,".").concat(a.name,'" of required type "').concat(c,'" was not provided.'),r))}}},ObjectField:function(r){var n=(0,fr.getNamedType)(e.getParentInputType()),i=e.getInputType();if(!i&&(0,fr.isInputObjectType)(n)){var o=(0,xB.default)(r.name.value,Object.keys(n.getFields()));e.reportError(new Gn.GraphQLError('Field "'.concat(r.name.value,'" is not defined by type "').concat(n.name,'".')+(0,AB.default)(o),r))}},NullValue:function(r){var n=e.getInputType();(0,fr.isNonNullType)(n)&&e.reportError(new Gn.GraphQLError('Expected value of type "'.concat((0,gs.default)(n),'", found ').concat((0,ic.print)(r),"."),r))},EnumValue:function(r){return Vn(e,r)},IntValue:function(r){return Vn(e,r)},FloatValue:function(r){return Vn(e,r)},StringValue:function(r){return Vn(e,r)},BooleanValue:function(r){return Vn(e,r)}}}function Vn(e,t){var r=e.getInputType();if(r){var n=(0,fr.getNamedType)(r);if(!(0,fr.isLeafType)(n)){var i=(0,gs.default)(r);e.reportError(new Gn.GraphQLError('Expected value of type "'.concat(i,'", found ').concat((0,ic.print)(t),"."),t));return}try{var o=n.parseLiteral(t,void 0);if(o===void 0){var s=(0,gs.default)(r);e.reportError(new Gn.GraphQLError('Expected value of type "'.concat(s,'", found ').concat((0,ic.print)(t),"."),t))}}catch(u){var a=(0,gs.default)(r);u instanceof Gn.GraphQLError?e.reportError(u):e.reportError(new Gn.GraphQLError('Expected value of type "'.concat(a,'", found ').concat((0,ic.print)(t),"; ")+u.message,t,void 0,void 0,void 0,u))}}}});var Sh=y(sc=>{"use strict";p();Object.defineProperty(sc,"__esModule",{value:!0});sc.ProvidedRequiredArgumentsRule=DB;sc.ProvidedRequiredArgumentsOnDirectivesRule=QI;var $I=HI(ae()),oc=HI(Qr()),BI=H(),KI=_e(),RB=mt(),NB=gt(),bh=ie();function HI(e){return e&&e.__esModule?e:{default:e}}function VI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function GI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?VI(Object(r),!0).forEach(function(n){PB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):VI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function PB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DB(e){return GI(GI({},QI(e)),{},{Field:{leave:function(r){var n,i=e.getFieldDef();if(!i)return!1;for(var o=(n=r.arguments)!==null&&n!==void 0?n:[],s=(0,oc.default)(o,function(f){return f.name.value}),a=0,u=i.args;a<u.length;a++){var c=u[a],l=s[c.name];if(!l&&(0,bh.isRequiredArgument)(c)){var d=(0,$I.default)(c.type);e.reportError(new BI.GraphQLError('Field "'.concat(i.name,'" argument "').concat(c.name,'" of type "').concat(d,'" is required, but it was not provided.'),r))}}}}})}function QI(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():NB.specifiedDirectives,i=0;i<n.length;i++){var o=n[i];t[o.name]=(0,oc.default)(o.args.filter(bh.isRequiredArgument),function(d){return d.name})}for(var s=e.getDocument().definitions,a=0;a<s.length;a++){var u=s[a];if(u.kind===KI.Kind.DIRECTIVE_DEFINITION){var c,l=(c=u.arguments)!==null&&c!==void 0?c:[];t[u.name.value]=(0,oc.default)(l.filter(LB),function(d){return d.name.value})}}return{Directive:{leave:function(f){var h=f.name.value,g=t[h];if(g)for(var v,_=(v=f.arguments)!==null&&v!==void 0?v:[],S=(0,oc.default)(_,function(U){return U.name.value}),b=0,A=Object.keys(g);b<A.length;b++){var O=A[b];if(!S[O]){var T=g[O].type,x=(0,bh.isType)(T)?(0,$I.default)(T):(0,RB.print)(T);e.reportError(new BI.GraphQLError('Directive "@'.concat(h,'" argument "').concat(O,'" of type "').concat(x,'" is required, but it was not provided.'),f))}}}}}}function LB(e){return e.type.kind===KI.Kind.NON_NULL_TYPE&&e.defaultValue==null}});var Ih=y(Th=>{"use strict";p();Object.defineProperty(Th,"__esModule",{value:!0});Th.VariablesInAllowedPositionRule=qB;var WI=FB(ae()),kB=H(),jB=_e(),zI=ie(),MB=dr(),YI=ns();function FB(e){return e&&e.__esModule?e:{default:e}}function qB(e){var t=Object.create(null);return{OperationDefinition:{enter:function(){t=Object.create(null)},leave:function(n){for(var i=e.getRecursiveVariableUsages(n),o=0;o<i.length;o++){var s=i[o],a=s.node,u=s.type,c=s.defaultValue,l=a.name.value,d=t[l];if(d&&u){var f=e.getSchema(),h=(0,MB.typeFromAST)(f,d.type);if(h&&!UB(f,h,d.defaultValue,u,c)){var g=(0,WI.default)(h),v=(0,WI.default)(u);e.reportError(new kB.GraphQLError('Variable "$'.concat(l,'" of type "').concat(g,'" used in position expecting type "').concat(v,'".'),[d,a]))}}}}},VariableDefinition:function(n){t[n.variable.name.value]=n}}}function UB(e,t,r,n,i){if((0,zI.isNonNullType)(n)&&!(0,zI.isNonNullType)(t)){var o=r!=null&&r.kind!==jB.Kind.NULL,s=i!==void 0;if(!o&&!s)return!1;var a=n.ofType;return(0,YI.isTypeSubTypeOf)(e,t,a)}return(0,YI.isTypeSubTypeOf)(e,t,n)}});var Nh=y(Rh=>{"use strict";p();Object.defineProperty(Rh,"__esModule",{value:!0});Rh.OverlappingFieldsCanBeMergedRule=BB;var VB=xh(Ai()),GB=xh(xi()),JI=xh(ae()),$B=H(),wh=_e(),XI=mt(),yt=ie(),ZI=dr();function xh(e){return e&&e.__esModule?e:{default:e}}function ew(e){return Array.isArray(e)?e.map(function(t){var r=t[0],n=t[1];return'subfields "'.concat(r,'" conflict because ')+ew(n)}).join(" and "):e}function BB(e){var t=new JB,r=new Map;return{SelectionSet:function(i){for(var o=KB(e,r,t,e.getParentType(),i),s=0;s<o.length;s++){var a=o[s],u=a[0],c=u[0],l=u[1],d=a[1],f=a[2],h=ew(l);e.reportError(new $B.GraphQLError('Fields "'.concat(c,'" conflict because ').concat(h,". Use different aliases on the fields to fetch both if this was intentional."),d.concat(f)))}}}}function KB(e,t,r,n,i){var o=[],s=cc(e,t,n,i),a=s[0],u=s[1];if(QB(e,o,t,r,a),u.length!==0)for(var c=0;c<u.length;c++){ac(e,o,t,r,!1,a,u[c]);for(var l=c+1;l<u.length;l++)uc(e,o,t,r,!1,u[c],u[l])}return o}function ac(e,t,r,n,i,o,s){var a=e.getFragment(s);if(a){var u=Ah(e,r,a),c=u[0],l=u[1];if(o!==c){Ch(e,t,r,n,i,o,c);for(var d=0;d<l.length;d++){var f=l[d];n.has(f,s,i)||(n.add(f,s,i),ac(e,t,r,n,i,o,l[d]))}}}}function uc(e,t,r,n,i,o,s){if(o!==s&&!n.has(o,s,i)){n.add(o,s,i);var a=e.getFragment(o),u=e.getFragment(s);if(!(!a||!u)){var c=Ah(e,r,a),l=c[0],d=c[1],f=Ah(e,r,u),h=f[0],g=f[1];Ch(e,t,r,n,i,l,h);for(var v=0;v<g.length;v++)uc(e,t,r,n,i,o,g[v]);for(var _=0;_<d.length;_++)uc(e,t,r,n,i,d[_],s)}}}function HB(e,t,r,n,i,o,s,a){var u=[],c=cc(e,t,i,o),l=c[0],d=c[1],f=cc(e,t,s,a),h=f[0],g=f[1];if(Ch(e,u,t,r,n,l,h),g.length!==0)for(var v=0;v<g.length;v++)ac(e,u,t,r,n,l,g[v]);if(d.length!==0)for(var _=0;_<d.length;_++)ac(e,u,t,r,n,h,d[_]);for(var S=0;S<d.length;S++)for(var b=0;b<g.length;b++)uc(e,u,t,r,n,d[S],g[b]);return u}function QB(e,t,r,n,i){for(var o=0,s=(0,GB.default)(i);o<s.length;o++){var a=s[o],u=a[0],c=a[1];if(c.length>1)for(var l=0;l<c.length;l++)for(var d=l+1;d<c.length;d++){var f=tw(e,r,n,!1,u,c[l],c[d]);f&&t.push(f)}}}function Ch(e,t,r,n,i,o,s){for(var a=0,u=Object.keys(o);a<u.length;a++){var c=u[a],l=s[c];if(l)for(var d=o[c],f=0;f<d.length;f++)for(var h=0;h<l.length;h++){var g=tw(e,r,n,i,c,d[f],l[h]);g&&t.push(g)}}}function tw(e,t,r,n,i,o,s){var a=o[0],u=o[1],c=o[2],l=s[0],d=s[1],f=s[2],h=n||a!==l&&(0,yt.isObjectType)(a)&&(0,yt.isObjectType)(l);if(!h){var g,v,_=u.name.value,S=d.name.value;if(_!==S)return[[i,'"'.concat(_,'" and "').concat(S,'" are different fields')],[u],[d]];var b=(g=u.arguments)!==null&&g!==void 0?g:[],A=(v=d.arguments)!==null&&v!==void 0?v:[];if(!WB(b,A))return[[i,"they have differing arguments"],[u],[d]]}var O=c?.type,T=f?.type;if(O&&T&&Oh(O,T))return[[i,'they return conflicting types "'.concat((0,JI.default)(O),'" and "').concat((0,JI.default)(T),'"')],[u],[d]];var x=u.selectionSet,U=d.selectionSet;if(x&&U){var C=HB(e,t,r,h,(0,yt.getNamedType)(O),x,(0,yt.getNamedType)(T),U);return YB(C,i,u,d)}}function WB(e,t){return e.length!==t.length?!1:e.every(function(r){var n=(0,VB.default)(t,function(i){return i.name.value===r.name.value});return n?zB(r.value,n.value):!1})}function zB(e,t){return(0,XI.print)(e)===(0,XI.print)(t)}function Oh(e,t){return(0,yt.isListType)(e)?(0,yt.isListType)(t)?Oh(e.ofType,t.ofType):!0:(0,yt.isListType)(t)?!0:(0,yt.isNonNullType)(e)?(0,yt.isNonNullType)(t)?Oh(e.ofType,t.ofType):!0:(0,yt.isNonNullType)(t)?!0:(0,yt.isLeafType)(e)||(0,yt.isLeafType)(t)?e!==t:!1}function cc(e,t,r,n){var i=t.get(n);if(!i){var o=Object.create(null),s=Object.create(null);rw(e,r,n,o,s),i=[o,Object.keys(s)],t.set(n,i)}return i}function Ah(e,t,r){var n=t.get(r.selectionSet);if(n)return n;var i=(0,ZI.typeFromAST)(e.getSchema(),r.typeCondition);return cc(e,t,i,r.selectionSet)}function rw(e,t,r,n,i){for(var o=0,s=r.selections;o<s.length;o++){var a=s[o];switch(a.kind){case wh.Kind.FIELD:{var u=a.name.value,c=void 0;((0,yt.isObjectType)(t)||(0,yt.isInterfaceType)(t))&&(c=t.getFields()[u]);var l=a.alias?a.alias.value:u;n[l]||(n[l]=[]),n[l].push([t,a,c]);break}case wh.Kind.FRAGMENT_SPREAD:i[a.name.value]=!0;break;case wh.Kind.INLINE_FRAGMENT:{var d=a.typeCondition,f=d?(0,ZI.typeFromAST)(e.getSchema(),d):t;rw(e,f,a.selectionSet,n,i);break}}}}function YB(e,t,r,n){if(e.length>0)return[[t,e.map(function(i){var o=i[0];return o})],e.reduce(function(i,o){var s=o[1];return i.concat(s)},[r]),e.reduce(function(i,o){var s=o[2];return i.concat(s)},[n])]}var JB=(function(){function e(){this._data=Object.create(null)}var t=e.prototype;return t.has=function(n,i,o){var s=this._data[n],a=s&&s[i];return a===void 0?!1:o===!1?a===!1:!0},t.add=function(n,i,o){this._pairSetAdd(n,i,o),this._pairSetAdd(i,n,o)},t._pairSetAdd=function(n,i,o){var s=this._data[n];s||(s=Object.create(null),this._data[n]=s),s[i]=o},e})()});var Dh=y(Ph=>{"use strict";p();Object.defineProperty(Ph,"__esModule",{value:!0});Ph.UniqueInputFieldNamesRule=ZB;var XB=H();function ZB(e){var t=[],r=Object.create(null);return{ObjectValue:{enter:function(){t.push(r),r=Object.create(null)},leave:function(){r=t.pop()}},ObjectField:function(i){var o=i.name.value;r[o]?e.reportError(new XB.GraphQLError('There can be only one input field named "'.concat(o,'".'),[r[o],i.name])):r[o]=i.name}}}});var kh=y(Lh=>{"use strict";p();Object.defineProperty(Lh,"__esModule",{value:!0});Lh.MaxIntrospectionDepthRule=rK;var eK=H(),nw=_e(),tK=3;function rK(e){function t(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Object.create(null),i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(r.kind===nw.Kind.FRAGMENT_SPREAD){var o=r.name.value;if(n[o]===!0)return!1;var s=e.getFragment(o);if(!s)return!1;try{return n[o]=!0,t(s,n,i)}finally{n[o]=null}}if(r.kind===nw.Kind.FIELD&&(r.name.value==="fields"||r.name.value==="interfaces"||r.name.value==="possibleTypes"||r.name.value==="inputFields")&&(i++,i>=tK))return!0;if("selectionSet"in r&&r.selectionSet)for(var a=0,u=r.selectionSet.selections;a<u.length;a++){var c=u[a];if(t(c,n,i))return!0}return!1}return{Field:function(n){if((n.name.value==="__schema"||n.name.value==="__type")&&t(n))return e.reportError(new eK.GraphQLError("Maximum introspection depth exceeded",[n])),!1}}}});var Mh=y(jh=>{"use strict";p();Object.defineProperty(jh,"__esModule",{value:!0});jh.LoneSchemaDefinitionRule=nK;var iw=H();function nK(e){var t,r,n,i=e.getSchema(),o=(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(),s=0;return{SchemaDefinition:function(u){if(o){e.reportError(new iw.GraphQLError("Cannot define a new schema within a schema extension.",u));return}s>0&&e.reportError(new iw.GraphQLError("Must provide only one schema definition.",u)),++s}}}});var qh=y(Fh=>{"use strict";p();Object.defineProperty(Fh,"__esModule",{value:!0});Fh.UniqueOperationTypesRule=iK;var ow=H();function iK(e){var 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(o){for(var s,a=(s=o.operationTypes)!==null&&s!==void 0?s:[],u=0;u<a.length;u++){var c=a[u],l=c.operation,d=r[l];n[l]?e.reportError(new ow.GraphQLError("Type for ".concat(l," already defined in the schema. It cannot be redefined."),c)):d?e.reportError(new ow.GraphQLError("There can be only one ".concat(l," type in schema."),[d,c])):r[l]=c}return!1}}});var Vh=y(Uh=>{"use strict";p();Object.defineProperty(Uh,"__esModule",{value:!0});Uh.UniqueTypeNamesRule=oK;var sw=H();function oK(e){var t=Object.create(null),r=e.getSchema();return{ScalarTypeDefinition:n,ObjectTypeDefinition:n,InterfaceTypeDefinition:n,UnionTypeDefinition:n,EnumTypeDefinition:n,InputObjectTypeDefinition:n};function n(i){var o=i.name.value;if(r!=null&&r.getType(o)){e.reportError(new sw.GraphQLError('Type "'.concat(o,'" already exists in the schema. It cannot also be defined in this type definition.'),i.name));return}return t[o]?e.reportError(new sw.GraphQLError('There can be only one type named "'.concat(o,'".'),[t[o],i.name])):t[o]=i.name,!1}}});var $h=y(Gh=>{"use strict";p();Object.defineProperty(Gh,"__esModule",{value:!0});Gh.UniqueEnumValueNamesRule=aK;var aw=H(),sK=ie();function aK(e){var t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(o){var s,a=o.name.value;n[a]||(n[a]=Object.create(null));for(var u=(s=o.values)!==null&&s!==void 0?s:[],c=n[a],l=0;l<u.length;l++){var d=u[l],f=d.name.value,h=r[a];(0,sK.isEnumType)(h)&&h.getValue(f)?e.reportError(new aw.GraphQLError('Enum value "'.concat(a,".").concat(f,'" already exists in the schema. It cannot also be defined in this type extension.'),d.name)):c[f]?e.reportError(new aw.GraphQLError('Enum value "'.concat(a,".").concat(f,'" can only be defined once.'),[c[f],d.name])):c[f]=d.name}return!1}}});var Hh=y(Kh=>{"use strict";p();Object.defineProperty(Kh,"__esModule",{value:!0});Kh.UniqueFieldDefinitionNamesRule=uK;var uw=H(),Bh=ie();function uK(e){var 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(o){var s,a=o.name.value;n[a]||(n[a]=Object.create(null));for(var u=(s=o.fields)!==null&&s!==void 0?s:[],c=n[a],l=0;l<u.length;l++){var d=u[l],f=d.name.value;cK(r[a],f)?e.reportError(new uw.GraphQLError('Field "'.concat(a,".").concat(f,'" already exists in the schema. It cannot also be defined in this type extension.'),d.name)):c[f]?e.reportError(new uw.GraphQLError('Field "'.concat(a,".").concat(f,'" can only be defined once.'),[c[f],d.name])):c[f]=d.name}return!1}}function cK(e,t){return(0,Bh.isObjectType)(e)||(0,Bh.isInterfaceType)(e)||(0,Bh.isInputObjectType)(e)?e.getFields()[t]!=null:!1}});var Wh=y(Qh=>{"use strict";p();Object.defineProperty(Qh,"__esModule",{value:!0});Qh.UniqueDirectiveNamesRule=lK;var cw=H();function lK(e){var t=Object.create(null),r=e.getSchema();return{DirectiveDefinition:function(i){var o=i.name.value;if(r!=null&&r.getDirective(o)){e.reportError(new cw.GraphQLError('Directive "@'.concat(o,'" already exists in the schema. It cannot be redefined.'),i.name));return}return t[o]?e.reportError(new cw.GraphQLError('There can be only one directive named "@'.concat(o,'".'),[t[o],i.name])):t[o]=i.name,!1}}}});var Yh=y(zh=>{"use strict";p();Object.defineProperty(zh,"__esModule",{value:!0});zh.PossibleTypeExtensionsRule=hK;var pw=lc(ae()),dw=lc(et()),pK=lc(Wr()),dK=lc(zr()),lw=H(),xe=_e(),fK=Un(),Mi=ie(),nn;function lc(e){return e&&e.__esModule?e:{default:e}}function Fi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hK(e){for(var t=e.getSchema(),r=Object.create(null),n=0,i=e.getDocument().definitions;n<i.length;n++){var o=i[n];(0,fK.isTypeDefinitionNode)(o)&&(r[o.name.value]=o)}return{ScalarTypeExtension:s,ObjectTypeExtension:s,InterfaceTypeExtension:s,UnionTypeExtension:s,EnumTypeExtension:s,InputObjectTypeExtension:s};function s(a){var u=a.name.value,c=r[u],l=t?.getType(u),d;if(c?d=mK[c.kind]:l&&(d=gK(l)),d){if(d!==a.kind){var f=yK(a.kind);e.reportError(new lw.GraphQLError("Cannot extend non-".concat(f,' type "').concat(u,'".'),c?[c,a]:a))}}else{var h=Object.keys(r);t&&(h=h.concat(Object.keys(t.getTypeMap())));var g=(0,dK.default)(u,h);e.reportError(new lw.GraphQLError('Cannot extend type "'.concat(u,'" because it is not defined.')+(0,pK.default)(g),a.name))}}}var mK=(nn={},Fi(nn,xe.Kind.SCALAR_TYPE_DEFINITION,xe.Kind.SCALAR_TYPE_EXTENSION),Fi(nn,xe.Kind.OBJECT_TYPE_DEFINITION,xe.Kind.OBJECT_TYPE_EXTENSION),Fi(nn,xe.Kind.INTERFACE_TYPE_DEFINITION,xe.Kind.INTERFACE_TYPE_EXTENSION),Fi(nn,xe.Kind.UNION_TYPE_DEFINITION,xe.Kind.UNION_TYPE_EXTENSION),Fi(nn,xe.Kind.ENUM_TYPE_DEFINITION,xe.Kind.ENUM_TYPE_EXTENSION),Fi(nn,xe.Kind.INPUT_OBJECT_TYPE_DEFINITION,xe.Kind.INPUT_OBJECT_TYPE_EXTENSION),nn);function gK(e){if((0,Mi.isScalarType)(e))return xe.Kind.SCALAR_TYPE_EXTENSION;if((0,Mi.isObjectType)(e))return xe.Kind.OBJECT_TYPE_EXTENSION;if((0,Mi.isInterfaceType)(e))return xe.Kind.INTERFACE_TYPE_EXTENSION;if((0,Mi.isUnionType)(e))return xe.Kind.UNION_TYPE_EXTENSION;if((0,Mi.isEnumType)(e))return xe.Kind.ENUM_TYPE_EXTENSION;if((0,Mi.isInputObjectType)(e))return xe.Kind.INPUT_OBJECT_TYPE_EXTENSION;(0,dw.default)(0,"Unexpected type: "+(0,pw.default)(e))}function yK(e){switch(e){case xe.Kind.SCALAR_TYPE_EXTENSION:return"scalar";case xe.Kind.OBJECT_TYPE_EXTENSION:return"object";case xe.Kind.INTERFACE_TYPE_EXTENSION:return"interface";case xe.Kind.UNION_TYPE_EXTENSION:return"union";case xe.Kind.ENUM_TYPE_EXTENSION:return"enum";case xe.Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object"}(0,dw.default)(0,"Unexpected kind: "+(0,pw.default)(e))}});var Jh=y(on=>{"use strict";p();Object.defineProperty(on,"__esModule",{value:!0});on.specifiedSDLRules=on.specifiedRules=on.recommendedRules=void 0;var vK=Rf(),EK=Pf(),_K=Lf(),bK=jf(),fw=qf(),SK=Vf(),TK=$f(),IK=Kf(),wK=Qf(),OK=zf(),AK=Jf(),xK=Zf(),CK=rh(),RK=ih(),NK=sh(),PK=uh(),DK=lh(),hw=dh(),mw=mh(),gw=gh(),yw=vh(),LK=_h(),vw=Sh(),kK=Ih(),jK=Nh(),Ew=Dh(),MK=kh(),FK=Mh(),qK=qh(),UK=Vh(),VK=$h(),GK=Hh(),$K=Wh(),BK=Yh(),_w=Object.freeze([MK.MaxIntrospectionDepthRule]);on.recommendedRules=_w;var KK=Object.freeze([vK.ExecutableDefinitionsRule,EK.UniqueOperationNamesRule,_K.LoneAnonymousOperationRule,bK.SingleFieldSubscriptionsRule,fw.KnownTypeNamesRule,SK.FragmentsOnCompositeTypesRule,TK.VariablesAreInputTypesRule,IK.ScalarLeafsRule,wK.FieldsOnCorrectTypeRule,OK.UniqueFragmentNamesRule,AK.KnownFragmentNamesRule,xK.NoUnusedFragmentsRule,CK.PossibleFragmentSpreadsRule,RK.NoFragmentCyclesRule,NK.UniqueVariableNamesRule,PK.NoUndefinedVariablesRule,DK.NoUnusedVariablesRule,hw.KnownDirectivesRule,mw.UniqueDirectivesPerLocationRule,gw.KnownArgumentNamesRule,yw.UniqueArgumentNamesRule,LK.ValuesOfCorrectTypeRule,vw.ProvidedRequiredArgumentsRule,kK.VariablesInAllowedPositionRule,jK.OverlappingFieldsCanBeMergedRule,Ew.UniqueInputFieldNamesRule].concat(_w));on.specifiedRules=KK;var HK=Object.freeze([FK.LoneSchemaDefinitionRule,qK.UniqueOperationTypesRule,UK.UniqueTypeNamesRule,VK.UniqueEnumValueNamesRule,GK.UniqueFieldDefinitionNamesRule,$K.UniqueDirectiveNamesRule,fw.KnownTypeNamesRule,hw.KnownDirectivesRule,mw.UniqueDirectivesPerLocationRule,BK.PossibleTypeExtensionsRule,gw.KnownArgumentNamesOnDirectivesRule,yw.UniqueArgumentNamesRule,Ew.UniqueInputFieldNamesRule,vw.ProvidedRequiredArgumentsOnDirectivesRule]);on.specifiedSDLRules=HK});var Zh=y(sn=>{"use strict";p();Object.defineProperty(sn,"__esModule",{value:!0});sn.ValidationContext=sn.SDLValidationContext=sn.ASTValidationContext=void 0;var bw=_e(),QK=Hr(),Sw=ec();function Tw(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Xh=(function(){function e(r,n){this._ast=r,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}var t=e.prototype;return t.reportError=function(n){this._onError(n)},t.getDocument=function(){return this._ast},t.getFragment=function(n){var i=this._fragments;return i||(this._fragments=i=this.getDocument().definitions.reduce(function(o,s){return s.kind===bw.Kind.FRAGMENT_DEFINITION&&(o[s.name.value]=s),o},Object.create(null))),i[n]},t.getFragmentSpreads=function(n){var i=this._fragmentSpreads.get(n);if(!i){i=[];for(var o=[n];o.length!==0;)for(var s=o.pop(),a=0,u=s.selections;a<u.length;a++){var c=u[a];c.kind===bw.Kind.FRAGMENT_SPREAD?i.push(c):c.selectionSet&&o.push(c.selectionSet)}this._fragmentSpreads.set(n,i)}return i},t.getRecursivelyReferencedFragments=function(n){var i=this._recursivelyReferencedFragments.get(n);if(!i){i=[];for(var o=Object.create(null),s=[n.selectionSet];s.length!==0;)for(var a=s.pop(),u=0,c=this.getFragmentSpreads(a);u<c.length;u++){var l=c[u],d=l.name.value;if(o[d]!==!0){o[d]=!0;var f=this.getFragment(d);f&&(i.push(f),s.push(f.selectionSet))}}this._recursivelyReferencedFragments.set(n,i)}return i},e})();sn.ASTValidationContext=Xh;var WK=(function(e){Tw(t,e);function t(n,i,o){var s;return s=e.call(this,n,o)||this,s._schema=i,s}var r=t.prototype;return r.getSchema=function(){return this._schema},t})(Xh);sn.SDLValidationContext=WK;var zK=(function(e){Tw(t,e);function t(n,i,o,s){var a;return a=e.call(this,i,s)||this,a._schema=n,a._typeInfo=o,a._variableUsages=new Map,a._recursiveVariableUsages=new Map,a}var r=t.prototype;return r.getSchema=function(){return this._schema},r.getVariableUsages=function(i){var o=this._variableUsages.get(i);if(!o){var s=[],a=new Sw.TypeInfo(this._schema);(0,QK.visit)(i,(0,Sw.visitWithTypeInfo)(a,{VariableDefinition:function(){return!1},Variable:function(c){s.push({node:c,type:a.getInputType(),defaultValue:a.getDefaultValue()})}})),o=s,this._variableUsages.set(i,o)}return o},r.getRecursiveVariableUsages=function(i){var o=this._recursiveVariableUsages.get(i);if(!o){o=this.getVariableUsages(i);for(var s=0,a=this.getRecursivelyReferencedFragments(i);s<a.length;s++){var u=a[s];o=o.concat(this.getVariableUsages(u))}this._recursiveVariableUsages.set(i,o)}return o},r.getType=function(){return this._typeInfo.getType()},r.getParentType=function(){return this._typeInfo.getParentType()},r.getInputType=function(){return this._typeInfo.getInputType()},r.getParentInputType=function(){return this._typeInfo.getParentInputType()},r.getFieldDef=function(){return this._typeInfo.getFieldDef()},r.getDirective=function(){return this._typeInfo.getDirective()},r.getArgument=function(){return this._typeInfo.getArgument()},r.getEnumValue=function(){return this._typeInfo.getEnumValue()},t})(Xh);sn.ValidationContext=zK});var Ui=y(qi=>{"use strict";p();Object.defineProperty(qi,"__esModule",{value:!0});qi.validate=eH;qi.validateSDL=em;qi.assertValidSDL=tH;qi.assertValidSDLExtension=rH;var YK=ZK(Mt()),JK=H(),pc=Hr(),XK=fs(),Iw=ec(),ww=Jh(),Ow=Zh();function ZK(e){return e&&e.__esModule?e:{default:e}}function eH(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ww.specifiedRules,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Iw.TypeInfo(e),i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{maxErrors:void 0};t||(0,YK.default)(0,"Must provide document."),(0,XK.assertValidSchema)(e);var o=Object.freeze({}),s=[],a=new Ow.ValidationContext(e,t,n,function(c){if(i.maxErrors!=null&&s.length>=i.maxErrors)throw s.push(new JK.GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),o;s.push(c)}),u=(0,pc.visitInParallel)(r.map(function(c){return c(a)}));try{(0,pc.visit)(t,(0,Iw.visitWithTypeInfo)(n,u))}catch(c){if(c!==o)throw c}return s}function em(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ww.specifiedSDLRules,n=[],i=new Ow.SDLValidationContext(e,t,function(s){n.push(s)}),o=r.map(function(s){return s(i)});return(0,pc.visit)(e,(0,pc.visitInParallel)(o)),n}function tH(e){var t=em(e);if(t.length!==0)throw new Error(t.map(function(r){return r.message}).join(`
|
|
75
|
+
`))}var Y1=(function(){function e(r){this._errors=[],this.schema=r}var t=e.prototype;return t.reportError=function(n,i){var o=Array.isArray(i)?i.filter(Boolean):i;this.addError(new B1.GraphQLError(n,o))},t.addError=function(n){this._errors.push(n)},t.getErrors=function(){return this._errors},e})();function J1(e){var t=e.schema,r=t.getQueryType();if(!r)e.reportError("Query root type must be provided.",t.astNode);else if(!(0,Fe.isObjectType)(r)){var n;e.reportError("Query root type must be Object type, it cannot be ".concat((0,it.default)(r),"."),(n=bf(t,"query"))!==null&&n!==void 0?n:r.astNode)}var i=t.getMutationType();if(i&&!(0,Fe.isObjectType)(i)){var o;e.reportError("Mutation root type must be Object type if provided, it cannot be "+"".concat((0,it.default)(i),"."),(o=bf(t,"mutation"))!==null&&o!==void 0?o:i.astNode)}var s=t.getSubscriptionType();if(s&&!(0,Fe.isObjectType)(s)){var a;e.reportError("Subscription root type must be Object type if provided, it cannot be "+"".concat((0,it.default)(s),"."),(a=bf(t,"subscription"))!==null&&a!==void 0?a:s.astNode)}}function bf(e,t){for(var r=If(e,function(o){return o.operationTypes}),n=0;n<r.length;n++){var i=r[n];if(i.operation===t)return i.type}}function X1(e){for(var t=0,r=e.schema.getDirectives();t<r.length;t++){var n=r[t];if(!(0,aI.isDirective)(n)){e.reportError("Expected directive but got: ".concat((0,it.default)(n),"."),n?.astNode);continue}qn(e,n);for(var i=0,o=n.args;i<o.length;i++){var s=o[i];if(qn(e,s),(0,Fe.isInputType)(s.type)||e.reportError("The type of @".concat(n.name,"(").concat(s.name,":) must be Input Type ")+"but got: ".concat((0,it.default)(s.type),"."),s.astNode),(0,Fe.isRequiredArgument)(s)&&s.deprecationReason!=null){var a;e.reportError("Required argument @".concat(n.name,"(").concat(s.name,":) cannot be deprecated."),[wf(s.astNode),(a=s.astNode)===null||a===void 0?void 0:a.type])}}}}function qn(e,t){var r=(0,H1.isValidNameError)(t.name);r&&e.addError((0,K1.locatedError)(r,t.astNode))}function Z1(e){for(var t=o$(e),r=e.schema.getTypeMap(),n=0,i=(0,fs.default)(r);n<i.length;n++){var o=i[n];if(!(0,Fe.isNamedType)(o)){e.reportError("Expected GraphQL named type but got: ".concat((0,it.default)(o),"."),o.astNode);continue}(0,W1.isIntrospectionType)(o)||qn(e,o),(0,Fe.isObjectType)(o)||(0,Fe.isInterfaceType)(o)?(iI(e,o),oI(e,o)):(0,Fe.isUnionType)(o)?r$(e,o):(0,Fe.isEnumType)(o)?n$(e,o):(0,Fe.isInputObjectType)(o)&&(i$(e,o),t(o))}}function iI(e,t){var r=(0,fs.default)(t.getFields());r.length===0&&e.reportError("Type ".concat(t.name," must define one or more fields."),ki(t));for(var n=0;n<r.length;n++){var i=r[n];if(qn(e,i),!(0,Fe.isOutputType)(i.type)){var o;e.reportError("The type of ".concat(t.name,".").concat(i.name," must be Output Type ")+"but got: ".concat((0,it.default)(i.type),"."),(o=i.astNode)===null||o===void 0?void 0:o.type)}for(var s=0,a=i.args;s<a.length;s++){var u=a[s],c=u.name;if(qn(e,u),!(0,Fe.isInputType)(u.type)){var l;e.reportError("The type of ".concat(t.name,".").concat(i.name,"(").concat(c,":) must be Input ")+"Type but got: ".concat((0,it.default)(u.type),"."),(l=u.astNode)===null||l===void 0?void 0:l.type)}if((0,Fe.isRequiredArgument)(u)&&u.deprecationReason!=null){var d;e.reportError("Required argument ".concat(t.name,".").concat(i.name,"(").concat(c,":) cannot be deprecated."),[wf(u.astNode),(d=u.astNode)===null||d===void 0?void 0:d.type])}}}}function oI(e,t){for(var r=Object.create(null),n=0,i=t.getInterfaces();n<i.length;n++){var o=i[n];if(!(0,Fe.isInterfaceType)(o)){e.reportError("Type ".concat((0,it.default)(t)," must only implement Interface types, ")+"it cannot implement ".concat((0,it.default)(o),"."),ds(t,o));continue}if(t===o){e.reportError("Type ".concat(t.name," cannot implement itself because it would create a circular reference."),ds(t,o));continue}if(r[o.name]){e.reportError("Type ".concat(t.name," can only implement ").concat(o.name," once."),ds(t,o));continue}r[o.name]=!0,t$(e,t,o),e$(e,t,o)}}function e$(e,t,r){for(var n=t.getFields(),i=0,o=(0,fs.default)(r.getFields());i<o.length;i++){var s=o[i],a=s.name,u=n[a];if(!u){e.reportError("Interface field ".concat(r.name,".").concat(a," expected but ").concat(t.name," does not provide it."),[s.astNode].concat(ki(t)));continue}if(!(0,nI.isTypeSubTypeOf)(e.schema,u.type,s.type)){var c,l;e.reportError("Interface field ".concat(r.name,".").concat(a," expects type ")+"".concat((0,it.default)(s.type)," but ").concat(t.name,".").concat(a," ")+"is type ".concat((0,it.default)(u.type),"."),[(c=s.astNode)===null||c===void 0?void 0:c.type,(l=u.astNode)===null||l===void 0?void 0:l.type])}for(var d=function(I,A){var T=A[I],x=T.name,U=(0,rI.default)(u.args,function(de){return de.name===x});if(!U)return e.reportError("Interface field argument ".concat(r.name,".").concat(a,"(").concat(x,":) expected but ").concat(t.name,".").concat(a," does not provide it."),[T.astNode,u.astNode]),"continue";if(!(0,nI.isEqualType)(T.type,U.type)){var C,te;e.reportError("Interface field argument ".concat(r.name,".").concat(a,"(").concat(x,":) ")+"expects type ".concat((0,it.default)(T.type)," but ")+"".concat(t.name,".").concat(a,"(").concat(x,":) is type ")+"".concat((0,it.default)(U.type),"."),[(C=T.astNode)===null||C===void 0?void 0:C.type,(te=U.astNode)===null||te===void 0?void 0:te.type])}},f=0,h=s.args;f<h.length;f++)var g=d(f,h);for(var v=function(I,A){var T=A[I],x=T.name,U=(0,rI.default)(s.args,function(C){return C.name===x});!U&&(0,Fe.isRequiredArgument)(T)&&e.reportError("Object field ".concat(t.name,".").concat(a," includes required argument ").concat(x," that is missing from the Interface field ").concat(r.name,".").concat(a,"."),[T.astNode,s.astNode])},_=0,b=u.args;_<b.length;_++)v(_,b)}}function t$(e,t,r){for(var n=t.getInterfaces(),i=0,o=r.getInterfaces();i<o.length;i++){var s=o[i];n.indexOf(s)===-1&&e.reportError(s===t?"Type ".concat(t.name," cannot implement ").concat(r.name," because it would create a circular reference."):"Type ".concat(t.name," must implement ").concat(s.name," because it is implemented by ").concat(r.name,"."),[].concat(ds(r,s),ds(t,r)))}}function r$(e,t){var r=t.getTypes();r.length===0&&e.reportError("Union type ".concat(t.name," must define one or more member types."),ki(t));for(var n=Object.create(null),i=0;i<r.length;i++){var o=r[i];if(n[o.name]){e.reportError("Union type ".concat(t.name," can only include type ").concat(o.name," once."),sI(t,o.name));continue}n[o.name]=!0,(0,Fe.isObjectType)(o)||e.reportError("Union type ".concat(t.name," can only include Object types, ")+"it cannot include ".concat((0,it.default)(o),"."),sI(t,String(o)))}}function n$(e,t){var r=t.getValues();r.length===0&&e.reportError("Enum type ".concat(t.name," must define one or more values."),ki(t));for(var n=0;n<r.length;n++){var i=r[n],o=i.name;qn(e,i),(o==="true"||o==="false"||o==="null")&&e.reportError("Enum type ".concat(t.name," cannot include value: ").concat(o,"."),i.astNode)}}function i$(e,t){var r=(0,fs.default)(t.getFields());r.length===0&&e.reportError("Input Object type ".concat(t.name," must define one or more fields."),ki(t));for(var n=0;n<r.length;n++){var i=r[n];if(qn(e,i),!(0,Fe.isInputType)(i.type)){var o;e.reportError("The type of ".concat(t.name,".").concat(i.name," must be Input Type ")+"but got: ".concat((0,it.default)(i.type),"."),(o=i.astNode)===null||o===void 0?void 0:o.type)}if((0,Fe.isRequiredInputField)(i)&&i.deprecationReason!=null){var s;e.reportError("Required input field ".concat(t.name,".").concat(i.name," cannot be deprecated."),[wf(i.astNode),(s=i.astNode)===null||s===void 0?void 0:s.type])}}}function o$(e){var t=Object.create(null),r=[],n=Object.create(null);return i;function i(o){if(!t[o.name]){t[o.name]=!0,n[o.name]=r.length;for(var s=(0,fs.default)(o.getFields()),a=0;a<s.length;a++){var u=s[a];if((0,Fe.isNonNullType)(u.type)&&(0,Fe.isInputObjectType)(u.type.ofType)){var c=u.type.ofType,l=n[c.name];if(r.push(u),l===void 0)i(c);else{var d=r.slice(l),f=d.map(function(h){return h.name}).join(".");e.reportError('Cannot reference Input Object "'.concat(c.name,'" within itself through a series of non-null fields: "').concat(f,'".'),d.map(function(h){return h.astNode}))}r.pop()}}n[o.name]=void 0}}}function ki(e){var t=e.astNode,r=e.extensionASTNodes;return t?r?[t].concat(r):[t]:r??[]}function If(e,t){for(var r=[],n=0,i=ki(e);n<i.length;n++){var o,s=i[n];r=r.concat((o=t(s))!==null&&o!==void 0?o:[])}return r}function ds(e,t){return If(e,function(r){return r.interfaces}).filter(function(r){return r.name.value===t.name})}function sI(e,t){return If(e,function(r){return r.types}).filter(function(r){return r.name.value===t})}function wf(e){var t;return e==null||(t=e.directives)===null||t===void 0?void 0:t.find(function(r){return r.name.value===aI.GraphQLDeprecatedDirective.name})}});var dr=y(xf=>{"use strict";p();Object.defineProperty(xf,"__esModule",{value:!0});xf.typeFromAST=Af;var s$=lI(ae()),a$=lI(et()),Of=_e(),cI=ie();function lI(e){return e&&e.__esModule?e:{default:e}}function Af(e,t){var r;if(t.kind===Of.Kind.LIST_TYPE)return r=Af(e,t.type),r&&new cI.GraphQLList(r);if(t.kind===Of.Kind.NON_NULL_TYPE)return r=Af(e,t.type),r&&new cI.GraphQLNonNull(r);if(t.kind===Of.Kind.NAMED_TYPE)return e.getType(t.name.value);(0,a$.default)(0,"Unexpected type node: "+(0,s$.default)(t))}});var ec=y(ms=>{"use strict";p();Object.defineProperty(ms,"__esModule",{value:!0});ms.visitWithTypeInfo=f$;ms.TypeInfo=void 0;var u$=l$(Ai()),De=_e(),c$=Si(),pI=Hr(),Le=ie(),ji=Ut(),dI=dr();function l$(e){return e&&e.__esModule?e:{default:e}}var p$=(function(){function e(r,n,i){this._schema=r,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=n??d$,i&&((0,Le.isInputType)(i)&&this._inputTypeStack.push(i),(0,Le.isCompositeType)(i)&&this._parentTypeStack.push(i),(0,Le.isOutputType)(i)&&this._typeStack.push(i))}var t=e.prototype;return t.getType=function(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]},t.getParentType=function(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]},t.getInputType=function(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]},t.getParentInputType=function(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]},t.getFieldDef=function(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]},t.getDefaultValue=function(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]},t.getDirective=function(){return this._directive},t.getArgument=function(){return this._argument},t.getEnumValue=function(){return this._enumValue},t.enter=function(n){var i=this._schema;switch(n.kind){case De.Kind.SELECTION_SET:{var o=(0,Le.getNamedType)(this.getType());this._parentTypeStack.push((0,Le.isCompositeType)(o)?o:void 0);break}case De.Kind.FIELD:{var s=this.getParentType(),a,u;s&&(a=this._getFieldDef(i,s,n),a&&(u=a.type)),this._fieldDefStack.push(a),this._typeStack.push((0,Le.isOutputType)(u)?u:void 0);break}case De.Kind.DIRECTIVE:this._directive=i.getDirective(n.name.value);break;case De.Kind.OPERATION_DEFINITION:{var c;switch(n.operation){case"query":c=i.getQueryType();break;case"mutation":c=i.getMutationType();break;case"subscription":c=i.getSubscriptionType();break}this._typeStack.push((0,Le.isObjectType)(c)?c:void 0);break}case De.Kind.INLINE_FRAGMENT:case De.Kind.FRAGMENT_DEFINITION:{var l=n.typeCondition,d=l?(0,dI.typeFromAST)(i,l):(0,Le.getNamedType)(this.getType());this._typeStack.push((0,Le.isOutputType)(d)?d:void 0);break}case De.Kind.VARIABLE_DEFINITION:{var f=(0,dI.typeFromAST)(i,n.type);this._inputTypeStack.push((0,Le.isInputType)(f)?f:void 0);break}case De.Kind.ARGUMENT:{var h,g,v,_=(h=this.getDirective())!==null&&h!==void 0?h:this.getFieldDef();_&&(g=(0,u$.default)(_.args,function(C){return C.name===n.name.value}),g&&(v=g.type)),this._argument=g,this._defaultValueStack.push(g?g.defaultValue:void 0),this._inputTypeStack.push((0,Le.isInputType)(v)?v:void 0);break}case De.Kind.LIST:{var b=(0,Le.getNullableType)(this.getInputType()),S=(0,Le.isListType)(b)?b.ofType:b;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,Le.isInputType)(S)?S:void 0);break}case De.Kind.OBJECT_FIELD:{var I=(0,Le.getNamedType)(this.getInputType()),A,T;(0,Le.isInputObjectType)(I)&&(T=I.getFields()[n.name.value],T&&(A=T.type)),this._defaultValueStack.push(T?T.defaultValue:void 0),this._inputTypeStack.push((0,Le.isInputType)(A)?A:void 0);break}case De.Kind.ENUM:{var x=(0,Le.getNamedType)(this.getInputType()),U;(0,Le.isEnumType)(x)&&(U=x.getValue(n.value)),this._enumValue=U;break}}},t.leave=function(n){switch(n.kind){case De.Kind.SELECTION_SET:this._parentTypeStack.pop();break;case De.Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case De.Kind.DIRECTIVE:this._directive=null;break;case De.Kind.OPERATION_DEFINITION:case De.Kind.INLINE_FRAGMENT:case De.Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case De.Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case De.Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case De.Kind.LIST:case De.Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case De.Kind.ENUM:this._enumValue=null;break}},e})();ms.TypeInfo=p$;function d$(e,t,r){var n=r.name.value;if(n===ji.SchemaMetaFieldDef.name&&e.getQueryType()===t)return ji.SchemaMetaFieldDef;if(n===ji.TypeMetaFieldDef.name&&e.getQueryType()===t)return ji.TypeMetaFieldDef;if(n===ji.TypeNameMetaFieldDef.name&&(0,Le.isCompositeType)(t))return ji.TypeNameMetaFieldDef;if((0,Le.isObjectType)(t)||(0,Le.isInterfaceType)(t))return t.getFields()[n]}function f$(e,t){return{enter:function(n){e.enter(n);var i=(0,pI.getVisitFn)(t,n.kind,!1);if(i){var o=i.apply(t,arguments);return o!==void 0&&(e.leave(n),(0,c$.isNode)(o)&&e.enter(o)),o}},leave:function(n){var i=(0,pI.getVisitFn)(t,n.kind,!0),o;return i&&(o=i.apply(t,arguments)),e.leave(n),o}}}});var Un=y(er=>{"use strict";p();Object.defineProperty(er,"__esModule",{value:!0});er.isDefinitionNode=h$;er.isExecutableDefinitionNode=fI;er.isSelectionNode=m$;er.isValueNode=g$;er.isTypeNode=y$;er.isTypeSystemDefinitionNode=hI;er.isTypeDefinitionNode=mI;er.isTypeSystemExtensionNode=gI;er.isTypeExtensionNode=yI;var ue=_e();function h$(e){return fI(e)||hI(e)||gI(e)}function fI(e){return e.kind===ue.Kind.OPERATION_DEFINITION||e.kind===ue.Kind.FRAGMENT_DEFINITION}function m$(e){return e.kind===ue.Kind.FIELD||e.kind===ue.Kind.FRAGMENT_SPREAD||e.kind===ue.Kind.INLINE_FRAGMENT}function g$(e){return e.kind===ue.Kind.VARIABLE||e.kind===ue.Kind.INT||e.kind===ue.Kind.FLOAT||e.kind===ue.Kind.STRING||e.kind===ue.Kind.BOOLEAN||e.kind===ue.Kind.NULL||e.kind===ue.Kind.ENUM||e.kind===ue.Kind.LIST||e.kind===ue.Kind.OBJECT}function y$(e){return e.kind===ue.Kind.NAMED_TYPE||e.kind===ue.Kind.LIST_TYPE||e.kind===ue.Kind.NON_NULL_TYPE}function hI(e){return e.kind===ue.Kind.SCHEMA_DEFINITION||mI(e)||e.kind===ue.Kind.DIRECTIVE_DEFINITION}function mI(e){return e.kind===ue.Kind.SCALAR_TYPE_DEFINITION||e.kind===ue.Kind.OBJECT_TYPE_DEFINITION||e.kind===ue.Kind.INTERFACE_TYPE_DEFINITION||e.kind===ue.Kind.UNION_TYPE_DEFINITION||e.kind===ue.Kind.ENUM_TYPE_DEFINITION||e.kind===ue.Kind.INPUT_OBJECT_TYPE_DEFINITION}function gI(e){return e.kind===ue.Kind.SCHEMA_EXTENSION||yI(e)}function yI(e){return e.kind===ue.Kind.SCALAR_TYPE_EXTENSION||e.kind===ue.Kind.OBJECT_TYPE_EXTENSION||e.kind===ue.Kind.INTERFACE_TYPE_EXTENSION||e.kind===ue.Kind.UNION_TYPE_EXTENSION||e.kind===ue.Kind.ENUM_TYPE_EXTENSION||e.kind===ue.Kind.INPUT_OBJECT_TYPE_EXTENSION}});var Rf=y(Cf=>{"use strict";p();Object.defineProperty(Cf,"__esModule",{value:!0});Cf.ExecutableDefinitionsRule=_$;var v$=H(),vI=_e(),E$=Un();function _$(e){return{Document:function(r){for(var n=0,i=r.definitions;n<i.length;n++){var o=i[n];if(!(0,E$.isExecutableDefinitionNode)(o)){var s=o.kind===vI.Kind.SCHEMA_DEFINITION||o.kind===vI.Kind.SCHEMA_EXTENSION?"schema":'"'+o.name.value+'"';e.reportError(new v$.GraphQLError("The ".concat(s," definition is not executable."),o))}}return!1}}}});var Pf=y(Nf=>{"use strict";p();Object.defineProperty(Nf,"__esModule",{value:!0});Nf.UniqueOperationNamesRule=b$;var S$=H();function b$(e){var t=Object.create(null);return{OperationDefinition:function(n){var i=n.name;return i&&(t[i.value]?e.reportError(new S$.GraphQLError('There can be only one operation named "'.concat(i.value,'".'),[t[i.value],i])):t[i.value]=i),!1},FragmentDefinition:function(){return!1}}}});var Lf=y(Df=>{"use strict";p();Object.defineProperty(Df,"__esModule",{value:!0});Df.LoneAnonymousOperationRule=w$;var T$=H(),I$=_e();function w$(e){var t=0;return{Document:function(n){t=n.definitions.filter(function(i){return i.kind===I$.Kind.OPERATION_DEFINITION}).length},OperationDefinition:function(n){!n.name&&t>1&&e.reportError(new T$.GraphQLError("This anonymous operation must be the only defined operation.",n))}}}});var jf=y(kf=>{"use strict";p();Object.defineProperty(kf,"__esModule",{value:!0});kf.SingleFieldSubscriptionsRule=A$;var O$=H();function A$(e){return{OperationDefinition:function(r){r.operation==="subscription"&&r.selectionSet.selections.length!==1&&e.reportError(new O$.GraphQLError(r.name?'Subscription "'.concat(r.name.value,'" must select only one top level field.'):"Anonymous Subscription must select only one top level field.",r.selectionSet.selections.slice(1)))}}}});var qf=y(Ff=>{"use strict";p();Object.defineProperty(Ff,"__esModule",{value:!0});Ff.KnownTypeNamesRule=D$;var x$=EI(Wr()),C$=EI(zr()),R$=H(),Mf=Un(),N$=pr(),P$=Ut();function EI(e){return e&&e.__esModule?e:{default:e}}function D$(e){for(var t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null),i=0,o=e.getDocument().definitions;i<o.length;i++){var s=o[i];(0,Mf.isTypeDefinitionNode)(s)&&(n[s.name.value]=!0)}var a=Object.keys(r).concat(Object.keys(n));return{NamedType:function(c,l,d,f,h){var g=c.name.value;if(!r[g]&&!n[g]){var v,_=(v=h[2])!==null&&v!==void 0?v:d,b=_!=null&&k$(_);if(b&&L$(g))return;var S=(0,C$.default)(g,b?_I.concat(a):a);e.reportError(new R$.GraphQLError('Unknown type "'.concat(g,'".')+(0,x$.default)(S),c))}}}}var _I=[].concat(N$.specifiedScalarTypes,P$.introspectionTypes).map(function(e){return e.name});function L$(e){return _I.indexOf(e)!==-1}function k$(e){return!Array.isArray(e)&&((0,Mf.isTypeSystemDefinitionNode)(e)||(0,Mf.isTypeSystemExtensionNode)(e))}});var Vf=y(Uf=>{"use strict";p();Object.defineProperty(Uf,"__esModule",{value:!0});Uf.FragmentsOnCompositeTypesRule=j$;var SI=H(),bI=mt(),TI=ie(),II=dr();function j$(e){return{InlineFragment:function(r){var n=r.typeCondition;if(n){var i=(0,II.typeFromAST)(e.getSchema(),n);if(i&&!(0,TI.isCompositeType)(i)){var o=(0,bI.print)(n);e.reportError(new SI.GraphQLError('Fragment cannot condition on non composite type "'.concat(o,'".'),n))}}},FragmentDefinition:function(r){var n=(0,II.typeFromAST)(e.getSchema(),r.typeCondition);if(n&&!(0,TI.isCompositeType)(n)){var i=(0,bI.print)(r.typeCondition);e.reportError(new SI.GraphQLError('Fragment "'.concat(r.name.value,'" cannot condition on non composite type "').concat(i,'".'),r.typeCondition))}}}}});var $f=y(Gf=>{"use strict";p();Object.defineProperty(Gf,"__esModule",{value:!0});Gf.VariablesAreInputTypesRule=V$;var M$=H(),F$=mt(),q$=ie(),U$=dr();function V$(e){return{VariableDefinition:function(r){var n=(0,U$.typeFromAST)(e.getSchema(),r.type);if(n&&!(0,q$.isInputType)(n)){var i=r.variable.name.value,o=(0,F$.print)(r.type);e.reportError(new M$.GraphQLError('Variable "$'.concat(i,'" cannot be non-input type "').concat(o,'".'),r.type))}}}}});var Kf=y(Bf=>{"use strict";p();Object.defineProperty(Bf,"__esModule",{value:!0});Bf.ScalarLeafsRule=$$;var wI=G$(ae()),OI=H(),AI=ie();function G$(e){return e&&e.__esModule?e:{default:e}}function $$(e){return{Field:function(r){var n=e.getType(),i=r.selectionSet;if(n){if((0,AI.isLeafType)((0,AI.getNamedType)(n))){if(i){var o=r.name.value,s=(0,wI.default)(n);e.reportError(new OI.GraphQLError('Field "'.concat(o,'" must not have a selection since type "').concat(s,'" has no subfields.'),i))}}else if(!i){var a=r.name.value,u=(0,wI.default)(n);e.reportError(new OI.GraphQLError('Field "'.concat(a,'" of type "').concat(u,'" must have a selection of subfields. Did you mean "').concat(a,' { ... }"?'),r))}}}}}});var Qf=y(Hf=>{"use strict";p();Object.defineProperty(Hf,"__esModule",{value:!0});Hf.FieldsOnCorrectTypeRule=W$;var B$=tc(of()),xI=tc(Wr()),K$=tc(zr()),H$=tc(Zo()),Q$=H(),gs=ie();function tc(e){return e&&e.__esModule?e:{default:e}}function W$(e){return{Field:function(r){var n=e.getParentType();if(n){var i=e.getFieldDef();if(!i){var o=e.getSchema(),s=r.name.value,a=(0,xI.default)("to use an inline fragment on",z$(o,n,s));a===""&&(a=(0,xI.default)(Y$(n,s))),e.reportError(new Q$.GraphQLError('Cannot query field "'.concat(s,'" on type "').concat(n.name,'".')+a,r))}}}}}function z$(e,t,r){if(!(0,gs.isAbstractType)(t))return[];for(var n=new Set,i=Object.create(null),o=0,s=e.getPossibleTypes(t);o<s.length;o++){var a=s[o];if(a.getFields()[r]){n.add(a),i[a.name]=1;for(var u=0,c=a.getInterfaces();u<c.length;u++){var l,d=c[u];d.getFields()[r]&&(n.add(d),i[d.name]=((l=i[d.name])!==null&&l!==void 0?l:0)+1)}}}return(0,B$.default)(n).sort(function(f,h){var g=i[h.name]-i[f.name];return g!==0?g:(0,gs.isInterfaceType)(f)&&e.isSubType(f,h)?-1:(0,gs.isInterfaceType)(h)&&e.isSubType(h,f)?1:(0,H$.default)(f.name,h.name)}).map(function(f){return f.name})}function Y$(e,t){if((0,gs.isObjectType)(e)||(0,gs.isInterfaceType)(e)){var r=Object.keys(e.getFields());return(0,K$.default)(t,r)}return[]}});var zf=y(Wf=>{"use strict";p();Object.defineProperty(Wf,"__esModule",{value:!0});Wf.UniqueFragmentNamesRule=X$;var J$=H();function X$(e){var t=Object.create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(n){var i=n.name.value;return t[i]?e.reportError(new J$.GraphQLError('There can be only one fragment named "'.concat(i,'".'),[t[i],n.name])):t[i]=n.name,!1}}}});var Jf=y(Yf=>{"use strict";p();Object.defineProperty(Yf,"__esModule",{value:!0});Yf.KnownFragmentNamesRule=eB;var Z$=H();function eB(e){return{FragmentSpread:function(r){var n=r.name.value,i=e.getFragment(n);i||e.reportError(new Z$.GraphQLError('Unknown fragment "'.concat(n,'".'),r.name))}}}});var Zf=y(Xf=>{"use strict";p();Object.defineProperty(Xf,"__esModule",{value:!0});Xf.NoUnusedFragmentsRule=rB;var tB=H();function rB(e){var t=[],r=[];return{OperationDefinition:function(i){return t.push(i),!1},FragmentDefinition:function(i){return r.push(i),!1},Document:{leave:function(){for(var i=Object.create(null),o=0;o<t.length;o++)for(var s=t[o],a=0,u=e.getRecursivelyReferencedFragments(s);a<u.length;a++){var c=u[a];i[c.name.value]=!0}for(var l=0;l<r.length;l++){var d=r[l],f=d.name.value;i[f]!==!0&&e.reportError(new tB.GraphQLError('Fragment "'.concat(f,'" is never used.'),d))}}}}}});var rh=y(th=>{"use strict";p();Object.defineProperty(th,"__esModule",{value:!0});th.PossibleFragmentSpreadsRule=oB;var rc=iB(ae()),CI=H(),eh=ie(),nB=dr(),RI=is();function iB(e){return e&&e.__esModule?e:{default:e}}function oB(e){return{InlineFragment:function(r){var n=e.getType(),i=e.getParentType();if((0,eh.isCompositeType)(n)&&(0,eh.isCompositeType)(i)&&!(0,RI.doTypesOverlap)(e.getSchema(),n,i)){var o=(0,rc.default)(i),s=(0,rc.default)(n);e.reportError(new CI.GraphQLError('Fragment cannot be spread here as objects of type "'.concat(o,'" can never be of type "').concat(s,'".'),r))}},FragmentSpread:function(r){var n=r.name.value,i=sB(e,n),o=e.getParentType();if(i&&o&&!(0,RI.doTypesOverlap)(e.getSchema(),i,o)){var s=(0,rc.default)(o),a=(0,rc.default)(i);e.reportError(new CI.GraphQLError('Fragment "'.concat(n,'" cannot be spread here as objects of type "').concat(s,'" can never be of type "').concat(a,'".'),r))}}}}function sB(e,t){var r=e.getFragment(t);if(r){var n=(0,nB.typeFromAST)(e.getSchema(),r.typeCondition);if((0,eh.isCompositeType)(n))return n}}});var ih=y(nh=>{"use strict";p();Object.defineProperty(nh,"__esModule",{value:!0});nh.NoFragmentCyclesRule=uB;var aB=H();function uB(e){var t=Object.create(null),r=[],n=Object.create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(s){return i(s),!1}};function i(o){if(!t[o.name.value]){var s=o.name.value;t[s]=!0;var a=e.getFragmentSpreads(o.selectionSet);if(a.length!==0){n[s]=r.length;for(var u=0;u<a.length;u++){var c=a[u],l=c.name.value,d=n[l];if(r.push(c),d===void 0){var f=e.getFragment(l);f&&i(f)}else{var h=r.slice(d),g=h.slice(0,-1).map(function(v){return'"'+v.name.value+'"'}).join(", ");e.reportError(new aB.GraphQLError('Cannot spread fragment "'.concat(l,'" within itself')+(g!==""?" via ".concat(g,"."):"."),h))}r.pop()}n[s]=void 0}}}}});var sh=y(oh=>{"use strict";p();Object.defineProperty(oh,"__esModule",{value:!0});oh.UniqueVariableNamesRule=lB;var cB=H();function lB(e){var t=Object.create(null);return{OperationDefinition:function(){t=Object.create(null)},VariableDefinition:function(n){var i=n.variable.name.value;t[i]?e.reportError(new cB.GraphQLError('There can be only one variable named "$'.concat(i,'".'),[t[i],n.variable.name])):t[i]=n.variable.name}}}});var uh=y(ah=>{"use strict";p();Object.defineProperty(ah,"__esModule",{value:!0});ah.NoUndefinedVariablesRule=dB;var pB=H();function dB(e){var t=Object.create(null);return{OperationDefinition:{enter:function(){t=Object.create(null)},leave:function(n){for(var i=e.getRecursiveVariableUsages(n),o=0;o<i.length;o++){var s=i[o],a=s.node,u=a.name.value;t[u]!==!0&&e.reportError(new pB.GraphQLError(n.name?'Variable "$'.concat(u,'" is not defined by operation "').concat(n.name.value,'".'):'Variable "$'.concat(u,'" is not defined.'),[a,n]))}}},VariableDefinition:function(n){t[n.variable.name.value]=!0}}}});var lh=y(ch=>{"use strict";p();Object.defineProperty(ch,"__esModule",{value:!0});ch.NoUnusedVariablesRule=hB;var fB=H();function hB(e){var t=[];return{OperationDefinition:{enter:function(){t=[]},leave:function(n){for(var i=Object.create(null),o=e.getRecursiveVariableUsages(n),s=0;s<o.length;s++){var a=o[s],u=a.node;i[u.name.value]=!0}for(var c=0,l=t;c<l.length;c++){var d=l[c],f=d.variable.name.value;i[f]!==!0&&e.reportError(new fB.GraphQLError(n.name?'Variable "$'.concat(f,'" is never used in operation "').concat(n.name.value,'".'):'Variable "$'.concat(f,'" is never used.'),d))}}},VariableDefinition:function(n){t.push(n)}}}});var dh=y(ph=>{"use strict";p();Object.defineProperty(ph,"__esModule",{value:!0});ph.KnownDirectivesRule=yB;var mB=DI(ae()),PI=DI(et()),NI=H(),Oe=_e(),He=Ti(),gB=gt();function DI(e){return e&&e.__esModule?e:{default:e}}function yB(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():gB.specifiedDirectives,i=0;i<n.length;i++){var o=n[i];t[o.name]=o.locations}for(var s=e.getDocument().definitions,a=0;a<s.length;a++){var u=s[a];u.kind===Oe.Kind.DIRECTIVE_DEFINITION&&(t[u.name.value]=u.locations.map(function(c){return c.value}))}return{Directive:function(l,d,f,h,g){var v=l.name.value,_=t[v];if(!_){e.reportError(new NI.GraphQLError('Unknown directive "@'.concat(v,'".'),l));return}var b=vB(g);b&&_.indexOf(b)===-1&&e.reportError(new NI.GraphQLError('Directive "@'.concat(v,'" may not be used on ').concat(b,"."),l))}}}function vB(e){var t=e[e.length-1];switch(!Array.isArray(t)||(0,PI.default)(0),t.kind){case Oe.Kind.OPERATION_DEFINITION:return EB(t.operation);case Oe.Kind.FIELD:return He.DirectiveLocation.FIELD;case Oe.Kind.FRAGMENT_SPREAD:return He.DirectiveLocation.FRAGMENT_SPREAD;case Oe.Kind.INLINE_FRAGMENT:return He.DirectiveLocation.INLINE_FRAGMENT;case Oe.Kind.FRAGMENT_DEFINITION:return He.DirectiveLocation.FRAGMENT_DEFINITION;case Oe.Kind.VARIABLE_DEFINITION:return He.DirectiveLocation.VARIABLE_DEFINITION;case Oe.Kind.SCHEMA_DEFINITION:case Oe.Kind.SCHEMA_EXTENSION:return He.DirectiveLocation.SCHEMA;case Oe.Kind.SCALAR_TYPE_DEFINITION:case Oe.Kind.SCALAR_TYPE_EXTENSION:return He.DirectiveLocation.SCALAR;case Oe.Kind.OBJECT_TYPE_DEFINITION:case Oe.Kind.OBJECT_TYPE_EXTENSION:return He.DirectiveLocation.OBJECT;case Oe.Kind.FIELD_DEFINITION:return He.DirectiveLocation.FIELD_DEFINITION;case Oe.Kind.INTERFACE_TYPE_DEFINITION:case Oe.Kind.INTERFACE_TYPE_EXTENSION:return He.DirectiveLocation.INTERFACE;case Oe.Kind.UNION_TYPE_DEFINITION:case Oe.Kind.UNION_TYPE_EXTENSION:return He.DirectiveLocation.UNION;case Oe.Kind.ENUM_TYPE_DEFINITION:case Oe.Kind.ENUM_TYPE_EXTENSION:return He.DirectiveLocation.ENUM;case Oe.Kind.ENUM_VALUE_DEFINITION:return He.DirectiveLocation.ENUM_VALUE;case Oe.Kind.INPUT_OBJECT_TYPE_DEFINITION:case Oe.Kind.INPUT_OBJECT_TYPE_EXTENSION:return He.DirectiveLocation.INPUT_OBJECT;case Oe.Kind.INPUT_VALUE_DEFINITION:{var r=e[e.length-3];return r.kind===Oe.Kind.INPUT_OBJECT_TYPE_DEFINITION?He.DirectiveLocation.INPUT_FIELD_DEFINITION:He.DirectiveLocation.ARGUMENT_DEFINITION}}}function EB(e){switch(e){case"query":return He.DirectiveLocation.QUERY;case"mutation":return He.DirectiveLocation.MUTATION;case"subscription":return He.DirectiveLocation.SUBSCRIPTION}(0,PI.default)(0,"Unexpected operation: "+(0,mB.default)(e))}});var mh=y(hh=>{"use strict";p();Object.defineProperty(hh,"__esModule",{value:!0});hh.UniqueDirectivesPerLocationRule=bB;var _B=H(),fh=_e(),LI=Un(),SB=gt();function bB(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():SB.specifiedDirectives,i=0;i<n.length;i++){var o=n[i];t[o.name]=!o.isRepeatable}for(var s=e.getDocument().definitions,a=0;a<s.length;a++){var u=s[a];u.kind===fh.Kind.DIRECTIVE_DEFINITION&&(t[u.name.value]=!u.repeatable)}var c=Object.create(null),l=Object.create(null);return{enter:function(f){if(f.directives!=null){var h;if(f.kind===fh.Kind.SCHEMA_DEFINITION||f.kind===fh.Kind.SCHEMA_EXTENSION)h=c;else if((0,LI.isTypeDefinitionNode)(f)||(0,LI.isTypeExtensionNode)(f)){var g=f.name.value;h=l[g],h===void 0&&(l[g]=h=Object.create(null))}else h=Object.create(null);for(var v=0,_=f.directives;v<_.length;v++){var b=_[v],S=b.name.value;t[S]&&(h[S]?e.reportError(new _B.GraphQLError('The directive "@'.concat(S,'" can only be used once at this location.'),[h[S],b])):h[S]=b)}}}}}});var gh=y(nc=>{"use strict";p();Object.defineProperty(nc,"__esModule",{value:!0});nc.KnownArgumentNamesRule=OB;nc.KnownArgumentNamesOnDirectivesRule=VI;var MI=UI(Wr()),FI=UI(zr()),qI=H(),TB=_e(),IB=gt();function UI(e){return e&&e.__esModule?e:{default:e}}function kI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function jI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kI(Object(r),!0).forEach(function(n){wB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OB(e){return jI(jI({},VI(e)),{},{Argument:function(r){var n=e.getArgument(),i=e.getFieldDef(),o=e.getParentType();if(!n&&i&&o){var s=r.name.value,a=i.args.map(function(c){return c.name}),u=(0,FI.default)(s,a);e.reportError(new qI.GraphQLError('Unknown argument "'.concat(s,'" on field "').concat(o.name,".").concat(i.name,'".')+(0,MI.default)(u),r))}}})}function VI(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():IB.specifiedDirectives,i=0;i<n.length;i++){var o=n[i];t[o.name]=o.args.map(function(d){return d.name})}for(var s=e.getDocument().definitions,a=0;a<s.length;a++){var u=s[a];if(u.kind===TB.Kind.DIRECTIVE_DEFINITION){var c,l=(c=u.arguments)!==null&&c!==void 0?c:[];t[u.name.value]=l.map(function(d){return d.name.value})}}return{Directive:function(f){var h=f.name.value,g=t[h];if(f.arguments&&g)for(var v=0,_=f.arguments;v<_.length;v++){var b=_[v],S=b.name.value;if(g.indexOf(S)===-1){var I=(0,FI.default)(S,g);e.reportError(new qI.GraphQLError('Unknown argument "'.concat(S,'" on directive "@').concat(h,'".')+(0,MI.default)(I),b))}}return!1}}}});var vh=y(yh=>{"use strict";p();Object.defineProperty(yh,"__esModule",{value:!0});yh.UniqueArgumentNamesRule=xB;var AB=H();function xB(e){var t=Object.create(null);return{Field:function(){t=Object.create(null)},Directive:function(){t=Object.create(null)},Argument:function(n){var i=n.name.value;return t[i]?e.reportError(new AB.GraphQLError('There can be only one argument named "'.concat(i,'".'),[t[i],n.name])):t[i]=n.name,!1}}}});var _h=y(Eh=>{"use strict";p();Object.defineProperty(Eh,"__esModule",{value:!0});Eh.ValuesOfCorrectTypeRule=DB;var CB=vs(Tt()),RB=vs(Qr()),ys=vs(ae()),NB=vs(Wr()),PB=vs(zr()),Gn=H(),ic=mt(),fr=ie();function vs(e){return e&&e.__esModule?e:{default:e}}function DB(e){return{ListValue:function(r){var n=(0,fr.getNullableType)(e.getParentInputType());if(!(0,fr.isListType)(n))return Vn(e,r),!1},ObjectValue:function(r){var n=(0,fr.getNamedType)(e.getInputType());if(!(0,fr.isInputObjectType)(n))return Vn(e,r),!1;for(var i=(0,RB.default)(r.fields,function(l){return l.name.value}),o=0,s=(0,CB.default)(n.getFields());o<s.length;o++){var a=s[o],u=i[a.name];if(!u&&(0,fr.isRequiredInputField)(a)){var c=(0,ys.default)(a.type);e.reportError(new Gn.GraphQLError('Field "'.concat(n.name,".").concat(a.name,'" of required type "').concat(c,'" was not provided.'),r))}}},ObjectField:function(r){var n=(0,fr.getNamedType)(e.getParentInputType()),i=e.getInputType();if(!i&&(0,fr.isInputObjectType)(n)){var o=(0,PB.default)(r.name.value,Object.keys(n.getFields()));e.reportError(new Gn.GraphQLError('Field "'.concat(r.name.value,'" is not defined by type "').concat(n.name,'".')+(0,NB.default)(o),r))}},NullValue:function(r){var n=e.getInputType();(0,fr.isNonNullType)(n)&&e.reportError(new Gn.GraphQLError('Expected value of type "'.concat((0,ys.default)(n),'", found ').concat((0,ic.print)(r),"."),r))},EnumValue:function(r){return Vn(e,r)},IntValue:function(r){return Vn(e,r)},FloatValue:function(r){return Vn(e,r)},StringValue:function(r){return Vn(e,r)},BooleanValue:function(r){return Vn(e,r)}}}function Vn(e,t){var r=e.getInputType();if(r){var n=(0,fr.getNamedType)(r);if(!(0,fr.isLeafType)(n)){var i=(0,ys.default)(r);e.reportError(new Gn.GraphQLError('Expected value of type "'.concat(i,'", found ').concat((0,ic.print)(t),"."),t));return}try{var o=n.parseLiteral(t,void 0);if(o===void 0){var s=(0,ys.default)(r);e.reportError(new Gn.GraphQLError('Expected value of type "'.concat(s,'", found ').concat((0,ic.print)(t),"."),t))}}catch(u){var a=(0,ys.default)(r);u instanceof Gn.GraphQLError?e.reportError(u):e.reportError(new Gn.GraphQLError('Expected value of type "'.concat(a,'", found ').concat((0,ic.print)(t),"; ")+u.message,t,void 0,void 0,void 0,u))}}}});var bh=y(sc=>{"use strict";p();Object.defineProperty(sc,"__esModule",{value:!0});sc.ProvidedRequiredArgumentsRule=MB;sc.ProvidedRequiredArgumentsOnDirectivesRule=WI;var BI=QI(ae()),oc=QI(Qr()),KI=H(),HI=_e(),LB=mt(),kB=gt(),Sh=ie();function QI(e){return e&&e.__esModule?e:{default:e}}function GI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $I(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?GI(Object(r),!0).forEach(function(n){jB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):GI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MB(e){return $I($I({},WI(e)),{},{Field:{leave:function(r){var n,i=e.getFieldDef();if(!i)return!1;for(var o=(n=r.arguments)!==null&&n!==void 0?n:[],s=(0,oc.default)(o,function(f){return f.name.value}),a=0,u=i.args;a<u.length;a++){var c=u[a],l=s[c.name];if(!l&&(0,Sh.isRequiredArgument)(c)){var d=(0,BI.default)(c.type);e.reportError(new KI.GraphQLError('Field "'.concat(i.name,'" argument "').concat(c.name,'" of type "').concat(d,'" is required, but it was not provided.'),r))}}}}})}function WI(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():kB.specifiedDirectives,i=0;i<n.length;i++){var o=n[i];t[o.name]=(0,oc.default)(o.args.filter(Sh.isRequiredArgument),function(d){return d.name})}for(var s=e.getDocument().definitions,a=0;a<s.length;a++){var u=s[a];if(u.kind===HI.Kind.DIRECTIVE_DEFINITION){var c,l=(c=u.arguments)!==null&&c!==void 0?c:[];t[u.name.value]=(0,oc.default)(l.filter(FB),function(d){return d.name.value})}}return{Directive:{leave:function(f){var h=f.name.value,g=t[h];if(g)for(var v,_=(v=f.arguments)!==null&&v!==void 0?v:[],b=(0,oc.default)(_,function(U){return U.name.value}),S=0,I=Object.keys(g);S<I.length;S++){var A=I[S];if(!b[A]){var T=g[A].type,x=(0,Sh.isType)(T)?(0,BI.default)(T):(0,LB.print)(T);e.reportError(new KI.GraphQLError('Directive "@'.concat(h,'" argument "').concat(A,'" of type "').concat(x,'" is required, but it was not provided.'),f))}}}}}}function FB(e){return e.type.kind===HI.Kind.NON_NULL_TYPE&&e.defaultValue==null}});var Ih=y(Th=>{"use strict";p();Object.defineProperty(Th,"__esModule",{value:!0});Th.VariablesInAllowedPositionRule=$B;var zI=GB(ae()),qB=H(),UB=_e(),YI=ie(),VB=dr(),JI=is();function GB(e){return e&&e.__esModule?e:{default:e}}function $B(e){var t=Object.create(null);return{OperationDefinition:{enter:function(){t=Object.create(null)},leave:function(n){for(var i=e.getRecursiveVariableUsages(n),o=0;o<i.length;o++){var s=i[o],a=s.node,u=s.type,c=s.defaultValue,l=a.name.value,d=t[l];if(d&&u){var f=e.getSchema(),h=(0,VB.typeFromAST)(f,d.type);if(h&&!BB(f,h,d.defaultValue,u,c)){var g=(0,zI.default)(h),v=(0,zI.default)(u);e.reportError(new qB.GraphQLError('Variable "$'.concat(l,'" of type "').concat(g,'" used in position expecting type "').concat(v,'".'),[d,a]))}}}}},VariableDefinition:function(n){t[n.variable.name.value]=n}}}function BB(e,t,r,n,i){if((0,YI.isNonNullType)(n)&&!(0,YI.isNonNullType)(t)){var o=r!=null&&r.kind!==UB.Kind.NULL,s=i!==void 0;if(!o&&!s)return!1;var a=n.ofType;return(0,JI.isTypeSubTypeOf)(e,t,a)}return(0,JI.isTypeSubTypeOf)(e,t,n)}});var Nh=y(Rh=>{"use strict";p();Object.defineProperty(Rh,"__esModule",{value:!0});Rh.OverlappingFieldsCanBeMergedRule=WB;var KB=xh(Ai()),HB=xh(xi()),XI=xh(ae()),QB=H(),wh=_e(),ZI=mt(),yt=ie(),ew=dr();function xh(e){return e&&e.__esModule?e:{default:e}}function tw(e){return Array.isArray(e)?e.map(function(t){var r=t[0],n=t[1];return'subfields "'.concat(r,'" conflict because ')+tw(n)}).join(" and "):e}function WB(e){var t=new tK,r=new Map;return{SelectionSet:function(i){for(var o=zB(e,r,t,e.getParentType(),i),s=0;s<o.length;s++){var a=o[s],u=a[0],c=u[0],l=u[1],d=a[1],f=a[2],h=tw(l);e.reportError(new QB.GraphQLError('Fields "'.concat(c,'" conflict because ').concat(h,". Use different aliases on the fields to fetch both if this was intentional."),d.concat(f)))}}}}function zB(e,t,r,n,i){var o=[],s=cc(e,t,n,i),a=s[0],u=s[1];if(JB(e,o,t,r,a),u.length!==0)for(var c=0;c<u.length;c++){ac(e,o,t,r,!1,a,u[c]);for(var l=c+1;l<u.length;l++)uc(e,o,t,r,!1,u[c],u[l])}return o}function ac(e,t,r,n,i,o,s){var a=e.getFragment(s);if(a){var u=Ah(e,r,a),c=u[0],l=u[1];if(o!==c){Ch(e,t,r,n,i,o,c);for(var d=0;d<l.length;d++){var f=l[d];n.has(f,s,i)||(n.add(f,s,i),ac(e,t,r,n,i,o,l[d]))}}}}function uc(e,t,r,n,i,o,s){if(o!==s&&!n.has(o,s,i)){n.add(o,s,i);var a=e.getFragment(o),u=e.getFragment(s);if(!(!a||!u)){var c=Ah(e,r,a),l=c[0],d=c[1],f=Ah(e,r,u),h=f[0],g=f[1];Ch(e,t,r,n,i,l,h);for(var v=0;v<g.length;v++)uc(e,t,r,n,i,o,g[v]);for(var _=0;_<d.length;_++)uc(e,t,r,n,i,d[_],s)}}}function YB(e,t,r,n,i,o,s,a){var u=[],c=cc(e,t,i,o),l=c[0],d=c[1],f=cc(e,t,s,a),h=f[0],g=f[1];if(Ch(e,u,t,r,n,l,h),g.length!==0)for(var v=0;v<g.length;v++)ac(e,u,t,r,n,l,g[v]);if(d.length!==0)for(var _=0;_<d.length;_++)ac(e,u,t,r,n,h,d[_]);for(var b=0;b<d.length;b++)for(var S=0;S<g.length;S++)uc(e,u,t,r,n,d[b],g[S]);return u}function JB(e,t,r,n,i){for(var o=0,s=(0,HB.default)(i);o<s.length;o++){var a=s[o],u=a[0],c=a[1];if(c.length>1)for(var l=0;l<c.length;l++)for(var d=l+1;d<c.length;d++){var f=rw(e,r,n,!1,u,c[l],c[d]);f&&t.push(f)}}}function Ch(e,t,r,n,i,o,s){for(var a=0,u=Object.keys(o);a<u.length;a++){var c=u[a],l=s[c];if(l)for(var d=o[c],f=0;f<d.length;f++)for(var h=0;h<l.length;h++){var g=rw(e,r,n,i,c,d[f],l[h]);g&&t.push(g)}}}function rw(e,t,r,n,i,o,s){var a=o[0],u=o[1],c=o[2],l=s[0],d=s[1],f=s[2],h=n||a!==l&&(0,yt.isObjectType)(a)&&(0,yt.isObjectType)(l);if(!h){var g,v,_=u.name.value,b=d.name.value;if(_!==b)return[[i,'"'.concat(_,'" and "').concat(b,'" are different fields')],[u],[d]];var S=(g=u.arguments)!==null&&g!==void 0?g:[],I=(v=d.arguments)!==null&&v!==void 0?v:[];if(!XB(S,I))return[[i,"they have differing arguments"],[u],[d]]}var A=c?.type,T=f?.type;if(A&&T&&Oh(A,T))return[[i,'they return conflicting types "'.concat((0,XI.default)(A),'" and "').concat((0,XI.default)(T),'"')],[u],[d]];var x=u.selectionSet,U=d.selectionSet;if(x&&U){var C=YB(e,t,r,h,(0,yt.getNamedType)(A),x,(0,yt.getNamedType)(T),U);return eK(C,i,u,d)}}function XB(e,t){return e.length!==t.length?!1:e.every(function(r){var n=(0,KB.default)(t,function(i){return i.name.value===r.name.value});return n?ZB(r.value,n.value):!1})}function ZB(e,t){return(0,ZI.print)(e)===(0,ZI.print)(t)}function Oh(e,t){return(0,yt.isListType)(e)?(0,yt.isListType)(t)?Oh(e.ofType,t.ofType):!0:(0,yt.isListType)(t)?!0:(0,yt.isNonNullType)(e)?(0,yt.isNonNullType)(t)?Oh(e.ofType,t.ofType):!0:(0,yt.isNonNullType)(t)?!0:(0,yt.isLeafType)(e)||(0,yt.isLeafType)(t)?e!==t:!1}function cc(e,t,r,n){var i=t.get(n);if(!i){var o=Object.create(null),s=Object.create(null);nw(e,r,n,o,s),i=[o,Object.keys(s)],t.set(n,i)}return i}function Ah(e,t,r){var n=t.get(r.selectionSet);if(n)return n;var i=(0,ew.typeFromAST)(e.getSchema(),r.typeCondition);return cc(e,t,i,r.selectionSet)}function nw(e,t,r,n,i){for(var o=0,s=r.selections;o<s.length;o++){var a=s[o];switch(a.kind){case wh.Kind.FIELD:{var u=a.name.value,c=void 0;((0,yt.isObjectType)(t)||(0,yt.isInterfaceType)(t))&&(c=t.getFields()[u]);var l=a.alias?a.alias.value:u;n[l]||(n[l]=[]),n[l].push([t,a,c]);break}case wh.Kind.FRAGMENT_SPREAD:i[a.name.value]=!0;break;case wh.Kind.INLINE_FRAGMENT:{var d=a.typeCondition,f=d?(0,ew.typeFromAST)(e.getSchema(),d):t;nw(e,f,a.selectionSet,n,i);break}}}}function eK(e,t,r,n){if(e.length>0)return[[t,e.map(function(i){var o=i[0];return o})],e.reduce(function(i,o){var s=o[1];return i.concat(s)},[r]),e.reduce(function(i,o){var s=o[2];return i.concat(s)},[n])]}var tK=(function(){function e(){this._data=Object.create(null)}var t=e.prototype;return t.has=function(n,i,o){var s=this._data[n],a=s&&s[i];return a===void 0?!1:o===!1?a===!1:!0},t.add=function(n,i,o){this._pairSetAdd(n,i,o),this._pairSetAdd(i,n,o)},t._pairSetAdd=function(n,i,o){var s=this._data[n];s||(s=Object.create(null),this._data[n]=s),s[i]=o},e})()});var Dh=y(Ph=>{"use strict";p();Object.defineProperty(Ph,"__esModule",{value:!0});Ph.UniqueInputFieldNamesRule=nK;var rK=H();function nK(e){var t=[],r=Object.create(null);return{ObjectValue:{enter:function(){t.push(r),r=Object.create(null)},leave:function(){r=t.pop()}},ObjectField:function(i){var o=i.name.value;r[o]?e.reportError(new rK.GraphQLError('There can be only one input field named "'.concat(o,'".'),[r[o],i.name])):r[o]=i.name}}}});var kh=y(Lh=>{"use strict";p();Object.defineProperty(Lh,"__esModule",{value:!0});Lh.MaxIntrospectionDepthRule=sK;var iK=H(),iw=_e(),oK=3;function sK(e){function t(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Object.create(null),i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(r.kind===iw.Kind.FRAGMENT_SPREAD){var o=r.name.value;if(n[o]===!0)return!1;var s=e.getFragment(o);if(!s)return!1;try{return n[o]=!0,t(s,n,i)}finally{n[o]=null}}if(r.kind===iw.Kind.FIELD&&(r.name.value==="fields"||r.name.value==="interfaces"||r.name.value==="possibleTypes"||r.name.value==="inputFields")&&(i++,i>=oK))return!0;if("selectionSet"in r&&r.selectionSet)for(var a=0,u=r.selectionSet.selections;a<u.length;a++){var c=u[a];if(t(c,n,i))return!0}return!1}return{Field:function(n){if((n.name.value==="__schema"||n.name.value==="__type")&&t(n))return e.reportError(new iK.GraphQLError("Maximum introspection depth exceeded",[n])),!1}}}});var Mh=y(jh=>{"use strict";p();Object.defineProperty(jh,"__esModule",{value:!0});jh.LoneSchemaDefinitionRule=aK;var ow=H();function aK(e){var t,r,n,i=e.getSchema(),o=(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(),s=0;return{SchemaDefinition:function(u){if(o){e.reportError(new ow.GraphQLError("Cannot define a new schema within a schema extension.",u));return}s>0&&e.reportError(new ow.GraphQLError("Must provide only one schema definition.",u)),++s}}}});var qh=y(Fh=>{"use strict";p();Object.defineProperty(Fh,"__esModule",{value:!0});Fh.UniqueOperationTypesRule=uK;var sw=H();function uK(e){var 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(o){for(var s,a=(s=o.operationTypes)!==null&&s!==void 0?s:[],u=0;u<a.length;u++){var c=a[u],l=c.operation,d=r[l];n[l]?e.reportError(new sw.GraphQLError("Type for ".concat(l," already defined in the schema. It cannot be redefined."),c)):d?e.reportError(new sw.GraphQLError("There can be only one ".concat(l," type in schema."),[d,c])):r[l]=c}return!1}}});var Vh=y(Uh=>{"use strict";p();Object.defineProperty(Uh,"__esModule",{value:!0});Uh.UniqueTypeNamesRule=cK;var aw=H();function cK(e){var t=Object.create(null),r=e.getSchema();return{ScalarTypeDefinition:n,ObjectTypeDefinition:n,InterfaceTypeDefinition:n,UnionTypeDefinition:n,EnumTypeDefinition:n,InputObjectTypeDefinition:n};function n(i){var o=i.name.value;if(r!=null&&r.getType(o)){e.reportError(new aw.GraphQLError('Type "'.concat(o,'" already exists in the schema. It cannot also be defined in this type definition.'),i.name));return}return t[o]?e.reportError(new aw.GraphQLError('There can be only one type named "'.concat(o,'".'),[t[o],i.name])):t[o]=i.name,!1}}});var $h=y(Gh=>{"use strict";p();Object.defineProperty(Gh,"__esModule",{value:!0});Gh.UniqueEnumValueNamesRule=pK;var uw=H(),lK=ie();function pK(e){var t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(o){var s,a=o.name.value;n[a]||(n[a]=Object.create(null));for(var u=(s=o.values)!==null&&s!==void 0?s:[],c=n[a],l=0;l<u.length;l++){var d=u[l],f=d.name.value,h=r[a];(0,lK.isEnumType)(h)&&h.getValue(f)?e.reportError(new uw.GraphQLError('Enum value "'.concat(a,".").concat(f,'" already exists in the schema. It cannot also be defined in this type extension.'),d.name)):c[f]?e.reportError(new uw.GraphQLError('Enum value "'.concat(a,".").concat(f,'" can only be defined once.'),[c[f],d.name])):c[f]=d.name}return!1}}});var Hh=y(Kh=>{"use strict";p();Object.defineProperty(Kh,"__esModule",{value:!0});Kh.UniqueFieldDefinitionNamesRule=dK;var cw=H(),Bh=ie();function dK(e){var 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(o){var s,a=o.name.value;n[a]||(n[a]=Object.create(null));for(var u=(s=o.fields)!==null&&s!==void 0?s:[],c=n[a],l=0;l<u.length;l++){var d=u[l],f=d.name.value;fK(r[a],f)?e.reportError(new cw.GraphQLError('Field "'.concat(a,".").concat(f,'" already exists in the schema. It cannot also be defined in this type extension.'),d.name)):c[f]?e.reportError(new cw.GraphQLError('Field "'.concat(a,".").concat(f,'" can only be defined once.'),[c[f],d.name])):c[f]=d.name}return!1}}function fK(e,t){return(0,Bh.isObjectType)(e)||(0,Bh.isInterfaceType)(e)||(0,Bh.isInputObjectType)(e)?e.getFields()[t]!=null:!1}});var Wh=y(Qh=>{"use strict";p();Object.defineProperty(Qh,"__esModule",{value:!0});Qh.UniqueDirectiveNamesRule=hK;var lw=H();function hK(e){var t=Object.create(null),r=e.getSchema();return{DirectiveDefinition:function(i){var o=i.name.value;if(r!=null&&r.getDirective(o)){e.reportError(new lw.GraphQLError('Directive "@'.concat(o,'" already exists in the schema. It cannot be redefined.'),i.name));return}return t[o]?e.reportError(new lw.GraphQLError('There can be only one directive named "@'.concat(o,'".'),[t[o],i.name])):t[o]=i.name,!1}}}});var Yh=y(zh=>{"use strict";p();Object.defineProperty(zh,"__esModule",{value:!0});zh.PossibleTypeExtensionsRule=vK;var dw=lc(ae()),fw=lc(et()),mK=lc(Wr()),gK=lc(zr()),pw=H(),xe=_e(),yK=Un(),Mi=ie(),nn;function lc(e){return e&&e.__esModule?e:{default:e}}function Fi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vK(e){for(var t=e.getSchema(),r=Object.create(null),n=0,i=e.getDocument().definitions;n<i.length;n++){var o=i[n];(0,yK.isTypeDefinitionNode)(o)&&(r[o.name.value]=o)}return{ScalarTypeExtension:s,ObjectTypeExtension:s,InterfaceTypeExtension:s,UnionTypeExtension:s,EnumTypeExtension:s,InputObjectTypeExtension:s};function s(a){var u=a.name.value,c=r[u],l=t?.getType(u),d;if(c?d=EK[c.kind]:l&&(d=_K(l)),d){if(d!==a.kind){var f=SK(a.kind);e.reportError(new pw.GraphQLError("Cannot extend non-".concat(f,' type "').concat(u,'".'),c?[c,a]:a))}}else{var h=Object.keys(r);t&&(h=h.concat(Object.keys(t.getTypeMap())));var g=(0,gK.default)(u,h);e.reportError(new pw.GraphQLError('Cannot extend type "'.concat(u,'" because it is not defined.')+(0,mK.default)(g),a.name))}}}var EK=(nn={},Fi(nn,xe.Kind.SCALAR_TYPE_DEFINITION,xe.Kind.SCALAR_TYPE_EXTENSION),Fi(nn,xe.Kind.OBJECT_TYPE_DEFINITION,xe.Kind.OBJECT_TYPE_EXTENSION),Fi(nn,xe.Kind.INTERFACE_TYPE_DEFINITION,xe.Kind.INTERFACE_TYPE_EXTENSION),Fi(nn,xe.Kind.UNION_TYPE_DEFINITION,xe.Kind.UNION_TYPE_EXTENSION),Fi(nn,xe.Kind.ENUM_TYPE_DEFINITION,xe.Kind.ENUM_TYPE_EXTENSION),Fi(nn,xe.Kind.INPUT_OBJECT_TYPE_DEFINITION,xe.Kind.INPUT_OBJECT_TYPE_EXTENSION),nn);function _K(e){if((0,Mi.isScalarType)(e))return xe.Kind.SCALAR_TYPE_EXTENSION;if((0,Mi.isObjectType)(e))return xe.Kind.OBJECT_TYPE_EXTENSION;if((0,Mi.isInterfaceType)(e))return xe.Kind.INTERFACE_TYPE_EXTENSION;if((0,Mi.isUnionType)(e))return xe.Kind.UNION_TYPE_EXTENSION;if((0,Mi.isEnumType)(e))return xe.Kind.ENUM_TYPE_EXTENSION;if((0,Mi.isInputObjectType)(e))return xe.Kind.INPUT_OBJECT_TYPE_EXTENSION;(0,fw.default)(0,"Unexpected type: "+(0,dw.default)(e))}function SK(e){switch(e){case xe.Kind.SCALAR_TYPE_EXTENSION:return"scalar";case xe.Kind.OBJECT_TYPE_EXTENSION:return"object";case xe.Kind.INTERFACE_TYPE_EXTENSION:return"interface";case xe.Kind.UNION_TYPE_EXTENSION:return"union";case xe.Kind.ENUM_TYPE_EXTENSION:return"enum";case xe.Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object"}(0,fw.default)(0,"Unexpected kind: "+(0,dw.default)(e))}});var Jh=y(on=>{"use strict";p();Object.defineProperty(on,"__esModule",{value:!0});on.specifiedSDLRules=on.specifiedRules=on.recommendedRules=void 0;var bK=Rf(),TK=Pf(),IK=Lf(),wK=jf(),hw=qf(),OK=Vf(),AK=$f(),xK=Kf(),CK=Qf(),RK=zf(),NK=Jf(),PK=Zf(),DK=rh(),LK=ih(),kK=sh(),jK=uh(),MK=lh(),mw=dh(),gw=mh(),yw=gh(),vw=vh(),FK=_h(),Ew=bh(),qK=Ih(),UK=Nh(),_w=Dh(),VK=kh(),GK=Mh(),$K=qh(),BK=Vh(),KK=$h(),HK=Hh(),QK=Wh(),WK=Yh(),Sw=Object.freeze([VK.MaxIntrospectionDepthRule]);on.recommendedRules=Sw;var zK=Object.freeze([bK.ExecutableDefinitionsRule,TK.UniqueOperationNamesRule,IK.LoneAnonymousOperationRule,wK.SingleFieldSubscriptionsRule,hw.KnownTypeNamesRule,OK.FragmentsOnCompositeTypesRule,AK.VariablesAreInputTypesRule,xK.ScalarLeafsRule,CK.FieldsOnCorrectTypeRule,RK.UniqueFragmentNamesRule,NK.KnownFragmentNamesRule,PK.NoUnusedFragmentsRule,DK.PossibleFragmentSpreadsRule,LK.NoFragmentCyclesRule,kK.UniqueVariableNamesRule,jK.NoUndefinedVariablesRule,MK.NoUnusedVariablesRule,mw.KnownDirectivesRule,gw.UniqueDirectivesPerLocationRule,yw.KnownArgumentNamesRule,vw.UniqueArgumentNamesRule,FK.ValuesOfCorrectTypeRule,Ew.ProvidedRequiredArgumentsRule,qK.VariablesInAllowedPositionRule,UK.OverlappingFieldsCanBeMergedRule,_w.UniqueInputFieldNamesRule].concat(Sw));on.specifiedRules=zK;var YK=Object.freeze([GK.LoneSchemaDefinitionRule,$K.UniqueOperationTypesRule,BK.UniqueTypeNamesRule,KK.UniqueEnumValueNamesRule,HK.UniqueFieldDefinitionNamesRule,QK.UniqueDirectiveNamesRule,hw.KnownTypeNamesRule,mw.KnownDirectivesRule,gw.UniqueDirectivesPerLocationRule,WK.PossibleTypeExtensionsRule,yw.KnownArgumentNamesOnDirectivesRule,vw.UniqueArgumentNamesRule,_w.UniqueInputFieldNamesRule,Ew.ProvidedRequiredArgumentsOnDirectivesRule]);on.specifiedSDLRules=YK});var Zh=y(sn=>{"use strict";p();Object.defineProperty(sn,"__esModule",{value:!0});sn.ValidationContext=sn.SDLValidationContext=sn.ASTValidationContext=void 0;var bw=_e(),JK=Hr(),Tw=ec();function Iw(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Xh=(function(){function e(r,n){this._ast=r,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}var t=e.prototype;return t.reportError=function(n){this._onError(n)},t.getDocument=function(){return this._ast},t.getFragment=function(n){var i=this._fragments;return i||(this._fragments=i=this.getDocument().definitions.reduce(function(o,s){return s.kind===bw.Kind.FRAGMENT_DEFINITION&&(o[s.name.value]=s),o},Object.create(null))),i[n]},t.getFragmentSpreads=function(n){var i=this._fragmentSpreads.get(n);if(!i){i=[];for(var o=[n];o.length!==0;)for(var s=o.pop(),a=0,u=s.selections;a<u.length;a++){var c=u[a];c.kind===bw.Kind.FRAGMENT_SPREAD?i.push(c):c.selectionSet&&o.push(c.selectionSet)}this._fragmentSpreads.set(n,i)}return i},t.getRecursivelyReferencedFragments=function(n){var i=this._recursivelyReferencedFragments.get(n);if(!i){i=[];for(var o=Object.create(null),s=[n.selectionSet];s.length!==0;)for(var a=s.pop(),u=0,c=this.getFragmentSpreads(a);u<c.length;u++){var l=c[u],d=l.name.value;if(o[d]!==!0){o[d]=!0;var f=this.getFragment(d);f&&(i.push(f),s.push(f.selectionSet))}}this._recursivelyReferencedFragments.set(n,i)}return i},e})();sn.ASTValidationContext=Xh;var XK=(function(e){Iw(t,e);function t(n,i,o){var s;return s=e.call(this,n,o)||this,s._schema=i,s}var r=t.prototype;return r.getSchema=function(){return this._schema},t})(Xh);sn.SDLValidationContext=XK;var ZK=(function(e){Iw(t,e);function t(n,i,o,s){var a;return a=e.call(this,i,s)||this,a._schema=n,a._typeInfo=o,a._variableUsages=new Map,a._recursiveVariableUsages=new Map,a}var r=t.prototype;return r.getSchema=function(){return this._schema},r.getVariableUsages=function(i){var o=this._variableUsages.get(i);if(!o){var s=[],a=new Tw.TypeInfo(this._schema);(0,JK.visit)(i,(0,Tw.visitWithTypeInfo)(a,{VariableDefinition:function(){return!1},Variable:function(c){s.push({node:c,type:a.getInputType(),defaultValue:a.getDefaultValue()})}})),o=s,this._variableUsages.set(i,o)}return o},r.getRecursiveVariableUsages=function(i){var o=this._recursiveVariableUsages.get(i);if(!o){o=this.getVariableUsages(i);for(var s=0,a=this.getRecursivelyReferencedFragments(i);s<a.length;s++){var u=a[s];o=o.concat(this.getVariableUsages(u))}this._recursiveVariableUsages.set(i,o)}return o},r.getType=function(){return this._typeInfo.getType()},r.getParentType=function(){return this._typeInfo.getParentType()},r.getInputType=function(){return this._typeInfo.getInputType()},r.getParentInputType=function(){return this._typeInfo.getParentInputType()},r.getFieldDef=function(){return this._typeInfo.getFieldDef()},r.getDirective=function(){return this._typeInfo.getDirective()},r.getArgument=function(){return this._typeInfo.getArgument()},r.getEnumValue=function(){return this._typeInfo.getEnumValue()},t})(Xh);sn.ValidationContext=ZK});var Ui=y(qi=>{"use strict";p();Object.defineProperty(qi,"__esModule",{value:!0});qi.validate=iH;qi.validateSDL=em;qi.assertValidSDL=oH;qi.assertValidSDLExtension=sH;var eH=nH(Mt()),tH=H(),pc=Hr(),rH=hs(),ww=ec(),Ow=Jh(),Aw=Zh();function nH(e){return e&&e.__esModule?e:{default:e}}function iH(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ow.specifiedRules,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new ww.TypeInfo(e),i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{maxErrors:void 0};t||(0,eH.default)(0,"Must provide document."),(0,rH.assertValidSchema)(e);var o=Object.freeze({}),s=[],a=new Aw.ValidationContext(e,t,n,function(c){if(i.maxErrors!=null&&s.length>=i.maxErrors)throw s.push(new tH.GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),o;s.push(c)}),u=(0,pc.visitInParallel)(r.map(function(c){return c(a)}));try{(0,pc.visit)(t,(0,ww.visitWithTypeInfo)(n,u))}catch(c){if(c!==o)throw c}return s}function em(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ow.specifiedSDLRules,n=[],i=new Aw.SDLValidationContext(e,t,function(s){n.push(s)}),o=r.map(function(s){return s(i)});return(0,pc.visit)(e,(0,pc.visitInParallel)(o)),n}function oH(e){var t=em(e);if(t.length!==0)throw new Error(t.map(function(r){return r.message}).join(`
|
|
76
76
|
|
|
77
|
-
`))}function
|
|
77
|
+
`))}function sH(e,t){var r=em(e,t);if(r.length!==0)throw new Error(r.map(function(n){return n.message}).join(`
|
|
78
78
|
|
|
79
|
-
`))}});var Aw=y(tm=>{"use strict";p();Object.defineProperty(tm,"__esModule",{value:!0});tm.default=nH;function nH(e){var t;return function(n,i,o){t||(t=new WeakMap);var s=t.get(n),a;if(s){if(a=s.get(i),a){var u=a.get(o);if(u!==void 0)return u}}else s=new WeakMap,t.set(n,s);a||(a=new WeakMap,s.set(i,a));var c=e(n,i,o);return a.set(o,c),c}}});var xw=y(rm=>{"use strict";p();Object.defineProperty(rm,"__esModule",{value:!0});rm.default=sH;var iH=oH(uu());function oH(e){return e&&e.__esModule?e:{default:e}}function sH(e,t,r){return e.reduce(function(n,i){return(0,iH.default)(n)?n.then(function(o){return t(o,i)}):t(n,i)},r)}});var Cw=y(nm=>{"use strict";p();Object.defineProperty(nm,"__esModule",{value:!0});nm.default=aH;function aH(e){var t=Object.keys(e),r=t.map(function(n){return e[n]});return Promise.all(r).then(function(n){return n.reduce(function(i,o,s){return i[t[s]]=o,i},Object.create(null))})}});var vs=y(dc=>{"use strict";p();Object.defineProperty(dc,"__esModule",{value:!0});dc.addPath=uH;dc.pathToArray=cH;function uH(e,t,r){return{prev:e,key:t,typename:r}}function cH(e){for(var t=[],r=e;r;)t.push(r.key),r=r.prev;return t.reverse()}});var hc=y(im=>{"use strict";p();Object.defineProperty(im,"__esModule",{value:!0});im.getOperationRootType=lH;var fc=H();function lH(e,t){if(t.operation==="query"){var r=e.getQueryType();if(!r)throw new fc.GraphQLError("Schema does not define the required query root type.",t);return r}if(t.operation==="mutation"){var n=e.getMutationType();if(!n)throw new fc.GraphQLError("Schema is not configured for mutations.",t);return n}if(t.operation==="subscription"){var i=e.getSubscriptionType();if(!i)throw new fc.GraphQLError("Schema is not configured for subscriptions.",t);return i}throw new fc.GraphQLError("Can only have query, mutation and subscription operations.",t)}});var sm=y(om=>{"use strict";p();Object.defineProperty(om,"__esModule",{value:!0});om.default=pH;function pH(e){return e.map(function(t){return typeof t=="number"?"["+t.toString()+"]":"."+t}).join("")}});var _s=y(am=>{"use strict";p();Object.defineProperty(am,"__esModule",{value:!0});am.valueFromAST=Es;var dH=mc(St()),fH=mc(Qr()),hH=mc(ae()),mH=mc(et()),Vi=_e(),$n=ie();function mc(e){return e&&e.__esModule?e:{default:e}}function Es(e,t,r){if(e){if(e.kind===Vi.Kind.VARIABLE){var n=e.name.value;if(r==null||r[n]===void 0)return;var i=r[n];return i===null&&(0,$n.isNonNullType)(t)?void 0:i}if((0,$n.isNonNullType)(t))return e.kind===Vi.Kind.NULL?void 0:Es(e,t.ofType,r);if(e.kind===Vi.Kind.NULL)return null;if((0,$n.isListType)(t)){var o=t.ofType;if(e.kind===Vi.Kind.LIST){for(var s=[],a=0,u=e.values;a<u.length;a++){var c=u[a];if(Rw(c,r)){if((0,$n.isNonNullType)(o))return;s.push(null)}else{var l=Es(c,o,r);if(l===void 0)return;s.push(l)}}return s}var d=Es(e,o,r);return d===void 0?void 0:[d]}if((0,$n.isInputObjectType)(t)){if(e.kind!==Vi.Kind.OBJECT)return;for(var f=Object.create(null),h=(0,fH.default)(e.fields,function(O){return O.name.value}),g=0,v=(0,dH.default)(t.getFields());g<v.length;g++){var _=v[g],S=h[_.name];if(!S||Rw(S.value,r)){if(_.defaultValue!==void 0)f[_.name]=_.defaultValue;else if((0,$n.isNonNullType)(_.type))return;continue}var b=Es(S.value,_.type,r);if(b===void 0)return;f[_.name]=b}return f}if((0,$n.isLeafType)(t)){var A;try{A=t.parseLiteral(e,r)}catch{return}return A===void 0?void 0:A}(0,mH.default)(0,"Unexpected input type: "+(0,hH.default)(t))}}function Rw(e,t){return e.kind===Vi.Kind.VARIABLE&&(t==null||t[e.name.value]===void 0)}});var cm=y(um=>{"use strict";p();Object.defineProperty(um,"__esModule",{value:!0});um.coerceInputValue=wH;var gH=an(St()),gc=an(ae()),yH=an(et()),vH=an(Wr()),EH=an(ar()),_H=an(Ku()),bH=an(zr()),SH=an(sm()),wr=vs(),Bn=H(),bs=ie();function an(e){return e&&e.__esModule?e:{default:e}}function Nw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function TH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Nw(Object(r),!0).forEach(function(n){IH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function IH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wH(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:OH;return Ss(e,t,r)}function OH(e,t,r){var n="Invalid value "+(0,gc.default)(t);throw e.length>0&&(n+=' at "value'.concat((0,SH.default)(e),'"')),r.message=n+": "+r.message,r}function Ss(e,t,r,n){if((0,bs.isNonNullType)(t)){if(e!=null)return Ss(e,t.ofType,r,n);r((0,wr.pathToArray)(n),e,new Bn.GraphQLError('Expected non-nullable type "'.concat((0,gc.default)(t),'" not to be null.')));return}if(e==null)return null;if((0,bs.isListType)(t)){var i=t.ofType,o=(0,_H.default)(e,function(b,A){var O=(0,wr.addPath)(n,A,void 0);return Ss(b,i,r,O)});return o??[Ss(e,i,r,n)]}if((0,bs.isInputObjectType)(t)){if(!(0,EH.default)(e)){r((0,wr.pathToArray)(n),e,new Bn.GraphQLError('Expected type "'.concat(t.name,'" to be an object.')));return}for(var s=Object.create(null),a=t.getFields(),u=0,c=(0,gH.default)(a);u<c.length;u++){var l=c[u],d=e[l.name];if(d===void 0){if(l.defaultValue!==void 0)s[l.name]=l.defaultValue;else if((0,bs.isNonNullType)(l.type)){var f=(0,gc.default)(l.type);r((0,wr.pathToArray)(n),e,new Bn.GraphQLError('Field "'.concat(l.name,'" of required type "').concat(f,'" was not provided.')))}continue}s[l.name]=Ss(d,l.type,r,(0,wr.addPath)(n,l.name,t.name))}for(var h=0,g=Object.keys(e);h<g.length;h++){var v=g[h];if(!a[v]){var _=(0,bH.default)(v,Object.keys(t.getFields()));r((0,wr.pathToArray)(n),e,new Bn.GraphQLError('Field "'.concat(v,'" is not defined by type "').concat(t.name,'".')+(0,vH.default)(_)))}}return TH({},s)}if((0,bs.isLeafType)(t)){var S;try{S=t.parseValue(e)}catch(b){b instanceof Bn.GraphQLError?r((0,wr.pathToArray)(n),e,b):r((0,wr.pathToArray)(n),e,new Bn.GraphQLError('Expected type "'.concat(t.name,'". ')+b.message,void 0,void 0,void 0,void 0,b));return}return S===void 0&&r((0,wr.pathToArray)(n),e,new Bn.GraphQLError('Expected type "'.concat(t.name,'".'))),S}(0,yH.default)(0,"Unexpected input type: "+(0,gc.default)(t))}});var Is=y(Ts=>{"use strict";p();Object.defineProperty(Ts,"__esModule",{value:!0});Ts.getVariableValues=DH;Ts.getArgumentValues=Mw;Ts.getDirectiveValues=kH;var AH=yc(Ai()),xH=yc(Qr()),Gi=yc(ae()),CH=yc(sm()),Or=H(),Pw=_e(),Lw=mt(),$i=ie(),RH=dr(),kw=_s(),NH=cm();function yc(e){return e&&e.__esModule?e:{default:e}}function Dw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function jw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Dw(Object(r),!0).forEach(function(n){PH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function PH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DH(e,t,r,n){var i=[],o=n?.maxErrors;try{var s=LH(e,t,r,function(a){if(o!=null&&i.length>=o)throw new Or.GraphQLError("Too many errors processing variables, error limit reached. Execution aborted.");i.push(a)});if(i.length===0)return{coerced:s}}catch(a){i.push(a)}return{errors:i}}function LH(e,t,r,n){for(var i=Object.create(null),o=function(c){var l=t[c],d=l.variable.name.value,f=(0,RH.typeFromAST)(e,l.type);if(!(0,$i.isInputType)(f)){var h=(0,Lw.print)(l.type);return n(new Or.GraphQLError('Variable "$'.concat(d,'" expected value of type "').concat(h,'" which cannot be used as an input type.'),l.type)),"continue"}if(!Fw(r,d)){if(l.defaultValue)i[d]=(0,kw.valueFromAST)(l.defaultValue,f);else if((0,$i.isNonNullType)(f)){var g=(0,Gi.default)(f);n(new Or.GraphQLError('Variable "$'.concat(d,'" of required type "').concat(g,'" was not provided.'),l))}return"continue"}var v=r[d];if(v===null&&(0,$i.isNonNullType)(f)){var _=(0,Gi.default)(f);return n(new Or.GraphQLError('Variable "$'.concat(d,'" of non-null type "').concat(_,'" must not be null.'),l)),"continue"}i[d]=(0,NH.coerceInputValue)(v,f,function(S,b,A){var O='Variable "$'.concat(d,'" got invalid value ')+(0,Gi.default)(b);S.length>0&&(O+=' at "'.concat(d).concat((0,CH.default)(S),'"')),n(new Or.GraphQLError(O+"; "+A.message,l,void 0,void 0,void 0,A.originalError))})},s=0;s<t.length;s++)var a=o(s);return jw({},i)}function Mw(e,t,r){for(var n,i=Object.create(null),o=(n=t.arguments)!==null&&n!==void 0?n:[],s=(0,xH.default)(o,function(S){return S.name.value}),a=0,u=e.args;a<u.length;a++){var c=u[a],l=c.name,d=c.type,f=s[l];if(!f){if(c.defaultValue!==void 0)i[l]=c.defaultValue;else if((0,$i.isNonNullType)(d))throw new Or.GraphQLError('Argument "'.concat(l,'" of required type "').concat((0,Gi.default)(d),'" ')+"was not provided.",t);continue}var h=f.value,g=h.kind===Pw.Kind.NULL;if(h.kind===Pw.Kind.VARIABLE){var v=h.name.value;if(r==null||!Fw(r,v)){if(c.defaultValue!==void 0)i[l]=c.defaultValue;else if((0,$i.isNonNullType)(d))throw new Or.GraphQLError('Argument "'.concat(l,'" of required type "').concat((0,Gi.default)(d),'" ')+'was provided the variable "$'.concat(v,'" which was not provided a runtime value.'),h);continue}g=r[v]==null}if(g&&(0,$i.isNonNullType)(d))throw new Or.GraphQLError('Argument "'.concat(l,'" of non-null type "').concat((0,Gi.default)(d),'" ')+"must not be null.",h);var _=(0,kw.valueFromAST)(h,d,r);if(_===void 0)throw new Or.GraphQLError('Argument "'.concat(l,'" has invalid value ').concat((0,Lw.print)(h),"."),h);i[l]=_}return jw({},i)}function kH(e,t,r){var n=t.directives&&(0,AH.default)(t.directives,function(i){return i.name.value===e.name});if(n)return Mw(e,n,r)}function Fw(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var xs=y(It=>{"use strict";p();Object.defineProperty(It,"__esModule",{value:!0});It.execute=$H;It.executeSync=BH;It.assertValidExecutionArguments=Qw;It.buildExecutionContext=Ww;It.collectFields=Os;It.buildResolveInfo=Jw;It.getFieldDef=eO;It.defaultFieldResolver=It.defaultTypeResolver=void 0;var Ki=xr(ae()),jH=xr(Aw()),MH=xr(et()),qw=xr(Mt()),Vt=xr(uu()),fm=xr(ar()),FH=xr(Ku()),qH=xr(xw()),Uw=xr(Cw()),Kn=vs(),hr=H(),vc=Yo(),ws=_e(),UH=fs(),Bi=Ut(),Vw=gt(),Ar=ie(),VH=dr(),GH=hc(),Ec=Is();function xr(e){return e&&e.__esModule?e:{default:e}}function $H(e,t,r,n,i,o,s,a){return arguments.length===1?pm(e):pm({schema:e,document:t,rootValue:r,contextValue:n,variableValues:i,operationName:o,fieldResolver:s,typeResolver:a})}function BH(e){var t=pm(e);if((0,Vt.default)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function pm(e){var t=e.schema,r=e.document,n=e.rootValue,i=e.contextValue,o=e.variableValues,s=e.operationName,a=e.fieldResolver,u=e.typeResolver;Qw(t,r,o);var c=Ww(t,r,n,i,o,s,a,u);if(Array.isArray(c))return{errors:c};var l=KH(c,c.operation,n);return Hw(c,l)}function Hw(e,t){return(0,Vt.default)(t)?t.then(function(r){return Hw(e,r)}):e.errors.length===0?{data:t}:{errors:e.errors,data:t}}function Qw(e,t,r){t||(0,qw.default)(0,"Must provide document."),(0,UH.assertValidSchema)(e),r==null||(0,fm.default)(r)||(0,qw.default)(0,"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 Ww(e,t,r,n,i,o,s,a){for(var u,c,l,d=Object.create(null),f=0,h=t.definitions;f<h.length;f++){var g=h[f];switch(g.kind){case ws.Kind.OPERATION_DEFINITION:if(o==null){if(l!==void 0)return[new hr.GraphQLError("Must provide operation name if query contains multiple operations.")];l=g}else((u=g.name)===null||u===void 0?void 0:u.value)===o&&(l=g);break;case ws.Kind.FRAGMENT_DEFINITION:d[g.name.value]=g;break}}if(!l)return o!=null?[new hr.GraphQLError('Unknown operation named "'.concat(o,'".'))]:[new hr.GraphQLError("Must provide an operation.")];var v=(c=l.variableDefinitions)!==null&&c!==void 0?c:[],_=(0,Ec.getVariableValues)(e,v,i??{},{maxErrors:50});return _.errors?_.errors:{schema:e,fragments:d,rootValue:r,contextValue:n,operation:l,variableValues:_.coerced,fieldResolver:s??Zw,typeResolver:a??Xw,errors:[]}}function KH(e,t,r){var n=(0,GH.getOperationRootType)(e.schema,t),i=Os(e,n,t.selectionSet,Object.create(null),Object.create(null)),o=void 0;try{var s=t.operation==="mutation"?HH(e,n,r,o,i):zw(e,n,r,o,i);return(0,Vt.default)(s)?s.then(void 0,function(a){return e.errors.push(a),Promise.resolve(null)}):s}catch(a){return e.errors.push(a),null}}function HH(e,t,r,n,i){return(0,qH.default)(Object.keys(i),function(o,s){var a=i[s],u=(0,Kn.addPath)(n,s,t.name),c=Yw(e,t,r,a,u);return c===void 0?o:(0,Vt.default)(c)?c.then(function(l){return o[s]=l,o}):(o[s]=c,o)},Object.create(null))}function zw(e,t,r,n,i){var o=Object.create(null),s=!1;try{for(var a=0,u=Object.keys(i);a<u.length;a++){var c=u[a],l=i[c],d=(0,Kn.addPath)(n,c,t.name),f=Yw(e,t,r,l,d);f!==void 0&&(o[c]=f,(0,Vt.default)(f)&&(s=!0))}}catch(h){if(s)return(0,Uw.default)(o).finally(function(){throw h});throw h}return s?(0,Uw.default)(o):o}function Os(e,t,r,n,i){for(var o=0,s=r.selections;o<s.length;o++){var a=s[o];switch(a.kind){case ws.Kind.FIELD:{if(!lm(e,a))continue;var u=QH(a);n[u]||(n[u]=[]),n[u].push(a);break}case ws.Kind.INLINE_FRAGMENT:{if(!lm(e,a)||!Gw(e,a,t))continue;Os(e,t,a.selectionSet,n,i);break}case ws.Kind.FRAGMENT_SPREAD:{var c=a.name.value;if(i[c]||!lm(e,a))continue;i[c]=!0;var l=e.fragments[c];if(!l||!Gw(e,l,t))continue;Os(e,t,l.selectionSet,n,i);break}}}return n}function lm(e,t){var r=(0,Ec.getDirectiveValues)(Vw.GraphQLSkipDirective,t,e.variableValues);if(r?.if===!0)return!1;var n=(0,Ec.getDirectiveValues)(Vw.GraphQLIncludeDirective,t,e.variableValues);return n?.if!==!1}function Gw(e,t,r){var n=t.typeCondition;if(!n)return!0;var i=(0,VH.typeFromAST)(e.schema,n);return i===r?!0:(0,Ar.isAbstractType)(i)?e.schema.isSubType(i,r):!1}function QH(e){return e.alias?e.alias.value:e.name.value}function Yw(e,t,r,n,i){var o,s=n[0],a=s.name.value,u=eO(e.schema,t,a);if(u){var c=u.type,l=(o=u.resolve)!==null&&o!==void 0?o:e.fieldResolver,d=Jw(e,u,n,t,i);try{var f=(0,Ec.getArgumentValues)(u,n[0],e.variableValues),h=e.contextValue,g=l(r,f,h,d),v;return(0,Vt.default)(g)?v=g.then(function(S){return As(e,c,n,d,i,S)}):v=As(e,c,n,d,i,g),(0,Vt.default)(v)?v.then(void 0,function(S){var b=(0,vc.locatedError)(S,n,(0,Kn.pathToArray)(i));return _c(b,c,e)}):v}catch(S){var _=(0,vc.locatedError)(S,n,(0,Kn.pathToArray)(i));return _c(_,c,e)}}}function Jw(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 _c(e,t,r){if((0,Ar.isNonNullType)(t))throw e;return r.errors.push(e),null}function As(e,t,r,n,i,o){if(o instanceof Error)throw o;if((0,Ar.isNonNullType)(t)){var s=As(e,t.ofType,r,n,i,o);if(s===null)throw new Error("Cannot return null for non-nullable field ".concat(n.parentType.name,".").concat(n.fieldName,"."));return s}if(o==null)return null;if((0,Ar.isListType)(t))return WH(e,t,r,n,i,o);if((0,Ar.isLeafType)(t))return zH(t,o);if((0,Ar.isAbstractType)(t))return YH(e,t,r,n,i,o);if((0,Ar.isObjectType)(t))return dm(e,t,r,n,i,o);(0,MH.default)(0,"Cannot complete value of unexpected output type: "+(0,Ki.default)(t))}function WH(e,t,r,n,i,o){var s=t.ofType,a=!1,u=(0,FH.default)(o,function(c,l){var d=(0,Kn.addPath)(i,l,void 0);try{var f;return(0,Vt.default)(c)?f=c.then(function(g){return As(e,s,r,n,d,g)}):f=As(e,s,r,n,d,c),(0,Vt.default)(f)?(a=!0,f.then(void 0,function(g){var v=(0,vc.locatedError)(g,r,(0,Kn.pathToArray)(d));return _c(v,s,e)})):f}catch(g){var h=(0,vc.locatedError)(g,r,(0,Kn.pathToArray)(d));return _c(h,s,e)}});if(u==null)throw new hr.GraphQLError('Expected Iterable, but did not find one for field "'.concat(n.parentType.name,".").concat(n.fieldName,'".'));return a?Promise.all(u):u}function zH(e,t){var r=e.serialize(t);if(r===void 0)throw new Error('Expected a value of type "'.concat((0,Ki.default)(e),'" but ')+"received: ".concat((0,Ki.default)(t)));return r}function YH(e,t,r,n,i,o){var s,a=(s=t.resolveType)!==null&&s!==void 0?s:e.typeResolver,u=e.contextValue,c=a(o,u,n,t);return(0,Vt.default)(c)?c.then(function(l){return dm(e,$w(l,e,t,r,n,o),r,n,i,o)}):dm(e,$w(c,e,t,r,n,o),r,n,i,o)}function $w(e,t,r,n,i,o){if(e==null)throw new hr.GraphQLError('Abstract type "'.concat(r.name,'" must resolve to an Object type at runtime for field "').concat(i.parentType.name,".").concat(i.fieldName,'". Either the "').concat(r.name,'" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.'),n);var s=(0,Ar.isNamedType)(e)?e.name:e;if(typeof s!="string")throw new hr.GraphQLError('Abstract type "'.concat(r.name,'" must resolve to an Object type at runtime for field "').concat(i.parentType.name,".").concat(i.fieldName,'" with ')+"value ".concat((0,Ki.default)(o),', received "').concat((0,Ki.default)(e),'".'));var a=t.schema.getType(s);if(a==null)throw new hr.GraphQLError('Abstract type "'.concat(r.name,'" was resolve to a type "').concat(s,'" that does not exist inside schema.'),n);if(!(0,Ar.isObjectType)(a))throw new hr.GraphQLError('Abstract type "'.concat(r.name,'" was resolve to a non-object type "').concat(s,'".'),n);if(!t.schema.isSubType(r,a))throw new hr.GraphQLError('Runtime Object type "'.concat(a.name,'" is not a possible type for "').concat(r.name,'".'),n);return a}function dm(e,t,r,n,i,o){if(t.isTypeOf){var s=t.isTypeOf(o,e.contextValue,n);if((0,Vt.default)(s))return s.then(function(a){if(!a)throw Bw(t,o,r);return Kw(e,t,r,i,o)});if(!s)throw Bw(t,o,r)}return Kw(e,t,r,i,o)}function Bw(e,t,r){return new hr.GraphQLError('Expected value of type "'.concat(e.name,'" but got: ').concat((0,Ki.default)(t),"."),r)}function Kw(e,t,r,n,i){var o=JH(e,t,r);return zw(e,t,i,n,o)}var JH=(0,jH.default)(XH);function XH(e,t,r){for(var n=Object.create(null),i=Object.create(null),o=0;o<r.length;o++){var s=r[o];s.selectionSet&&(n=Os(e,t,s.selectionSet,n,i))}return n}var Xw=function(t,r,n,i){if((0,fm.default)(t)&&typeof t.__typename=="string")return t.__typename;for(var o=n.schema.getPossibleTypes(i),s=[],a=0;a<o.length;a++){var u=o[a];if(u.isTypeOf){var c=u.isTypeOf(t,r,n);if((0,Vt.default)(c))s[a]=c;else if(c)return u.name}}if(s.length)return Promise.all(s).then(function(l){for(var d=0;d<l.length;d++)if(l[d])return o[d].name})};It.defaultTypeResolver=Xw;var Zw=function(t,r,n,i){if((0,fm.default)(t)||typeof t=="function"){var o=t[i.fieldName];return typeof o=="function"?t[i.fieldName](r,n,i):o}};It.defaultFieldResolver=Zw;function eO(e,t,r){return r===Bi.SchemaMetaFieldDef.name&&e.getQueryType()===t?Bi.SchemaMetaFieldDef:r===Bi.TypeMetaFieldDef.name&&e.getQueryType()===t?Bi.TypeMetaFieldDef:r===Bi.TypeNameMetaFieldDef.name?Bi.TypeNameMetaFieldDef:t.getFields()[r]}});var tO=y(Sc=>{"use strict";p();Object.defineProperty(Sc,"__esModule",{value:!0});Sc.graphql=oQ;Sc.graphqlSync=sQ;var ZH=iQ(uu()),eQ=wi(),tQ=Ui(),rQ=fs(),nQ=xs();function iQ(e){return e&&e.__esModule?e:{default:e}}function oQ(e,t,r,n,i,o,s,a){var u=arguments;return new Promise(function(c){return c(u.length===1?bc(e):bc({schema:e,source:t,rootValue:r,contextValue:n,variableValues:i,operationName:o,fieldResolver:s,typeResolver:a}))})}function sQ(e,t,r,n,i,o,s,a){var u=arguments.length===1?bc(e):bc({schema:e,source:t,rootValue:r,contextValue:n,variableValues:i,operationName:o,fieldResolver:s,typeResolver:a});if((0,ZH.default)(u))throw new Error("GraphQL execution failed to complete synchronously.");return u}function bc(e){var t=e.schema,r=e.source,n=e.rootValue,i=e.contextValue,o=e.variableValues,s=e.operationName,a=e.fieldResolver,u=e.typeResolver,c=(0,rQ.validateSchema)(t);if(c.length>0)return{errors:c};var l;try{l=(0,eQ.parse)(r)}catch(f){return{errors:[f]}}var d=(0,tQ.validate)(t,l);return d.length>0?{errors:d}:(0,nQ.execute)({schema:t,document:l,rootValue:n,contextValue:i,variableValues:o,operationName:s,fieldResolver:a,typeResolver:u})}});var nO=y(R=>{"use strict";p();Object.defineProperty(R,"__esModule",{value:!0});Object.defineProperty(R,"isSchema",{enumerable:!0,get:function(){return hm.isSchema}});Object.defineProperty(R,"assertSchema",{enumerable:!0,get:function(){return hm.assertSchema}});Object.defineProperty(R,"GraphQLSchema",{enumerable:!0,get:function(){return hm.GraphQLSchema}});Object.defineProperty(R,"isType",{enumerable:!0,get:function(){return W.isType}});Object.defineProperty(R,"isScalarType",{enumerable:!0,get:function(){return W.isScalarType}});Object.defineProperty(R,"isObjectType",{enumerable:!0,get:function(){return W.isObjectType}});Object.defineProperty(R,"isInterfaceType",{enumerable:!0,get:function(){return W.isInterfaceType}});Object.defineProperty(R,"isUnionType",{enumerable:!0,get:function(){return W.isUnionType}});Object.defineProperty(R,"isEnumType",{enumerable:!0,get:function(){return W.isEnumType}});Object.defineProperty(R,"isInputObjectType",{enumerable:!0,get:function(){return W.isInputObjectType}});Object.defineProperty(R,"isListType",{enumerable:!0,get:function(){return W.isListType}});Object.defineProperty(R,"isNonNullType",{enumerable:!0,get:function(){return W.isNonNullType}});Object.defineProperty(R,"isInputType",{enumerable:!0,get:function(){return W.isInputType}});Object.defineProperty(R,"isOutputType",{enumerable:!0,get:function(){return W.isOutputType}});Object.defineProperty(R,"isLeafType",{enumerable:!0,get:function(){return W.isLeafType}});Object.defineProperty(R,"isCompositeType",{enumerable:!0,get:function(){return W.isCompositeType}});Object.defineProperty(R,"isAbstractType",{enumerable:!0,get:function(){return W.isAbstractType}});Object.defineProperty(R,"isWrappingType",{enumerable:!0,get:function(){return W.isWrappingType}});Object.defineProperty(R,"isNullableType",{enumerable:!0,get:function(){return W.isNullableType}});Object.defineProperty(R,"isNamedType",{enumerable:!0,get:function(){return W.isNamedType}});Object.defineProperty(R,"isRequiredArgument",{enumerable:!0,get:function(){return W.isRequiredArgument}});Object.defineProperty(R,"isRequiredInputField",{enumerable:!0,get:function(){return W.isRequiredInputField}});Object.defineProperty(R,"assertType",{enumerable:!0,get:function(){return W.assertType}});Object.defineProperty(R,"assertScalarType",{enumerable:!0,get:function(){return W.assertScalarType}});Object.defineProperty(R,"assertObjectType",{enumerable:!0,get:function(){return W.assertObjectType}});Object.defineProperty(R,"assertInterfaceType",{enumerable:!0,get:function(){return W.assertInterfaceType}});Object.defineProperty(R,"assertUnionType",{enumerable:!0,get:function(){return W.assertUnionType}});Object.defineProperty(R,"assertEnumType",{enumerable:!0,get:function(){return W.assertEnumType}});Object.defineProperty(R,"assertInputObjectType",{enumerable:!0,get:function(){return W.assertInputObjectType}});Object.defineProperty(R,"assertListType",{enumerable:!0,get:function(){return W.assertListType}});Object.defineProperty(R,"assertNonNullType",{enumerable:!0,get:function(){return W.assertNonNullType}});Object.defineProperty(R,"assertInputType",{enumerable:!0,get:function(){return W.assertInputType}});Object.defineProperty(R,"assertOutputType",{enumerable:!0,get:function(){return W.assertOutputType}});Object.defineProperty(R,"assertLeafType",{enumerable:!0,get:function(){return W.assertLeafType}});Object.defineProperty(R,"assertCompositeType",{enumerable:!0,get:function(){return W.assertCompositeType}});Object.defineProperty(R,"assertAbstractType",{enumerable:!0,get:function(){return W.assertAbstractType}});Object.defineProperty(R,"assertWrappingType",{enumerable:!0,get:function(){return W.assertWrappingType}});Object.defineProperty(R,"assertNullableType",{enumerable:!0,get:function(){return W.assertNullableType}});Object.defineProperty(R,"assertNamedType",{enumerable:!0,get:function(){return W.assertNamedType}});Object.defineProperty(R,"getNullableType",{enumerable:!0,get:function(){return W.getNullableType}});Object.defineProperty(R,"getNamedType",{enumerable:!0,get:function(){return W.getNamedType}});Object.defineProperty(R,"GraphQLScalarType",{enumerable:!0,get:function(){return W.GraphQLScalarType}});Object.defineProperty(R,"GraphQLObjectType",{enumerable:!0,get:function(){return W.GraphQLObjectType}});Object.defineProperty(R,"GraphQLInterfaceType",{enumerable:!0,get:function(){return W.GraphQLInterfaceType}});Object.defineProperty(R,"GraphQLUnionType",{enumerable:!0,get:function(){return W.GraphQLUnionType}});Object.defineProperty(R,"GraphQLEnumType",{enumerable:!0,get:function(){return W.GraphQLEnumType}});Object.defineProperty(R,"GraphQLInputObjectType",{enumerable:!0,get:function(){return W.GraphQLInputObjectType}});Object.defineProperty(R,"GraphQLList",{enumerable:!0,get:function(){return W.GraphQLList}});Object.defineProperty(R,"GraphQLNonNull",{enumerable:!0,get:function(){return W.GraphQLNonNull}});Object.defineProperty(R,"isDirective",{enumerable:!0,get:function(){return mr.isDirective}});Object.defineProperty(R,"assertDirective",{enumerable:!0,get:function(){return mr.assertDirective}});Object.defineProperty(R,"GraphQLDirective",{enumerable:!0,get:function(){return mr.GraphQLDirective}});Object.defineProperty(R,"isSpecifiedDirective",{enumerable:!0,get:function(){return mr.isSpecifiedDirective}});Object.defineProperty(R,"specifiedDirectives",{enumerable:!0,get:function(){return mr.specifiedDirectives}});Object.defineProperty(R,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return mr.GraphQLIncludeDirective}});Object.defineProperty(R,"GraphQLSkipDirective",{enumerable:!0,get:function(){return mr.GraphQLSkipDirective}});Object.defineProperty(R,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return mr.GraphQLDeprecatedDirective}});Object.defineProperty(R,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return mr.GraphQLSpecifiedByDirective}});Object.defineProperty(R,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return mr.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(R,"isSpecifiedScalarType",{enumerable:!0,get:function(){return Hn.isSpecifiedScalarType}});Object.defineProperty(R,"specifiedScalarTypes",{enumerable:!0,get:function(){return Hn.specifiedScalarTypes}});Object.defineProperty(R,"GraphQLInt",{enumerable:!0,get:function(){return Hn.GraphQLInt}});Object.defineProperty(R,"GraphQLFloat",{enumerable:!0,get:function(){return Hn.GraphQLFloat}});Object.defineProperty(R,"GraphQLString",{enumerable:!0,get:function(){return Hn.GraphQLString}});Object.defineProperty(R,"GraphQLBoolean",{enumerable:!0,get:function(){return Hn.GraphQLBoolean}});Object.defineProperty(R,"GraphQLID",{enumerable:!0,get:function(){return Hn.GraphQLID}});Object.defineProperty(R,"isIntrospectionType",{enumerable:!0,get:function(){return vt.isIntrospectionType}});Object.defineProperty(R,"introspectionTypes",{enumerable:!0,get:function(){return vt.introspectionTypes}});Object.defineProperty(R,"__Schema",{enumerable:!0,get:function(){return vt.__Schema}});Object.defineProperty(R,"__Directive",{enumerable:!0,get:function(){return vt.__Directive}});Object.defineProperty(R,"__DirectiveLocation",{enumerable:!0,get:function(){return vt.__DirectiveLocation}});Object.defineProperty(R,"__Type",{enumerable:!0,get:function(){return vt.__Type}});Object.defineProperty(R,"__Field",{enumerable:!0,get:function(){return vt.__Field}});Object.defineProperty(R,"__InputValue",{enumerable:!0,get:function(){return vt.__InputValue}});Object.defineProperty(R,"__EnumValue",{enumerable:!0,get:function(){return vt.__EnumValue}});Object.defineProperty(R,"__TypeKind",{enumerable:!0,get:function(){return vt.__TypeKind}});Object.defineProperty(R,"TypeKind",{enumerable:!0,get:function(){return vt.TypeKind}});Object.defineProperty(R,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return vt.SchemaMetaFieldDef}});Object.defineProperty(R,"TypeMetaFieldDef",{enumerable:!0,get:function(){return vt.TypeMetaFieldDef}});Object.defineProperty(R,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return vt.TypeNameMetaFieldDef}});Object.defineProperty(R,"validateSchema",{enumerable:!0,get:function(){return rO.validateSchema}});Object.defineProperty(R,"assertValidSchema",{enumerable:!0,get:function(){return rO.assertValidSchema}});var hm=Fn(),W=ie(),mr=gt(),Hn=pr(),vt=Ut(),rO=fs()});var sO=y(Ee=>{"use strict";p();Object.defineProperty(Ee,"__esModule",{value:!0});Object.defineProperty(Ee,"Source",{enumerable:!0,get:function(){return aQ.Source}});Object.defineProperty(Ee,"getLocation",{enumerable:!0,get:function(){return uQ.getLocation}});Object.defineProperty(Ee,"printLocation",{enumerable:!0,get:function(){return iO.printLocation}});Object.defineProperty(Ee,"printSourceLocation",{enumerable:!0,get:function(){return iO.printSourceLocation}});Object.defineProperty(Ee,"Kind",{enumerable:!0,get:function(){return cQ.Kind}});Object.defineProperty(Ee,"TokenKind",{enumerable:!0,get:function(){return lQ.TokenKind}});Object.defineProperty(Ee,"Lexer",{enumerable:!0,get:function(){return pQ.Lexer}});Object.defineProperty(Ee,"parse",{enumerable:!0,get:function(){return mm.parse}});Object.defineProperty(Ee,"parseValue",{enumerable:!0,get:function(){return mm.parseValue}});Object.defineProperty(Ee,"parseType",{enumerable:!0,get:function(){return mm.parseType}});Object.defineProperty(Ee,"print",{enumerable:!0,get:function(){return dQ.print}});Object.defineProperty(Ee,"visit",{enumerable:!0,get:function(){return Tc.visit}});Object.defineProperty(Ee,"visitInParallel",{enumerable:!0,get:function(){return Tc.visitInParallel}});Object.defineProperty(Ee,"getVisitFn",{enumerable:!0,get:function(){return Tc.getVisitFn}});Object.defineProperty(Ee,"BREAK",{enumerable:!0,get:function(){return Tc.BREAK}});Object.defineProperty(Ee,"Location",{enumerable:!0,get:function(){return oO.Location}});Object.defineProperty(Ee,"Token",{enumerable:!0,get:function(){return oO.Token}});Object.defineProperty(Ee,"isDefinitionNode",{enumerable:!0,get:function(){return Cr.isDefinitionNode}});Object.defineProperty(Ee,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return Cr.isExecutableDefinitionNode}});Object.defineProperty(Ee,"isSelectionNode",{enumerable:!0,get:function(){return Cr.isSelectionNode}});Object.defineProperty(Ee,"isValueNode",{enumerable:!0,get:function(){return Cr.isValueNode}});Object.defineProperty(Ee,"isTypeNode",{enumerable:!0,get:function(){return Cr.isTypeNode}});Object.defineProperty(Ee,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return Cr.isTypeSystemDefinitionNode}});Object.defineProperty(Ee,"isTypeDefinitionNode",{enumerable:!0,get:function(){return Cr.isTypeDefinitionNode}});Object.defineProperty(Ee,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return Cr.isTypeSystemExtensionNode}});Object.defineProperty(Ee,"isTypeExtensionNode",{enumerable:!0,get:function(){return Cr.isTypeExtensionNode}});Object.defineProperty(Ee,"DirectiveLocation",{enumerable:!0,get:function(){return fQ.DirectiveLocation}});var aQ=Iu(),uQ=lu(),iO=Ed(),cQ=_e(),lQ=Si(),pQ=Au(),mm=wi(),dQ=mt(),Tc=Hr(),oO=bi(),Cr=Un(),fQ=Ti()});var aO=y(un=>{"use strict";p();Object.defineProperty(un,"__esModule",{value:!0});Object.defineProperty(un,"responsePathAsArray",{enumerable:!0,get:function(){return hQ.pathToArray}});Object.defineProperty(un,"execute",{enumerable:!0,get:function(){return Ic.execute}});Object.defineProperty(un,"executeSync",{enumerable:!0,get:function(){return Ic.executeSync}});Object.defineProperty(un,"defaultFieldResolver",{enumerable:!0,get:function(){return Ic.defaultFieldResolver}});Object.defineProperty(un,"defaultTypeResolver",{enumerable:!0,get:function(){return Ic.defaultTypeResolver}});Object.defineProperty(un,"getDirectiveValues",{enumerable:!0,get:function(){return mQ.getDirectiveValues}});var hQ=vs(),Ic=xs(),mQ=Is()});var uO=y(gm=>{"use strict";p();Object.defineProperty(gm,"__esModule",{value:!0});gm.default=yQ;var gQ=ur();function yQ(e){return typeof e?.[gQ.SYMBOL_ASYNC_ITERATOR]=="function"}});var dO=y(ym=>{"use strict";p();Object.defineProperty(ym,"__esModule",{value:!0});ym.default=EQ;var cO=ur();function vQ(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EQ(e,t,r){var n=e[cO.SYMBOL_ASYNC_ITERATOR],i=n.call(e),o,s;typeof i.return=="function"&&(o=i.return,s=function(d){var f=function(){return Promise.reject(d)};return o.call(i).then(f,f)});function a(l){return l.done?l:lO(l.value,t).then(pO,s)}var u;if(r){var c=r;u=function(d){return lO(d,c).then(pO,s)}}return vQ({next:function(){return i.next().then(a,u)},return:function(){return o?o.call(i).then(a,u):Promise.resolve({value:void 0,done:!0})},throw:function(d){return typeof i.throw=="function"?i.throw(d).then(a,u):Promise.reject(d).catch(s)}},cO.SYMBOL_ASYNC_ITERATOR,function(){return this})}function lO(e,t){return new Promise(function(r){return r(t(e))})}function pO(e){return{value:e,done:!1}}});var EO=y(wc=>{"use strict";p();Object.defineProperty(wc,"__esModule",{value:!0});wc.subscribe=IQ;wc.createSourceEventStream=vO;var _Q=Em(ae()),mO=Em(uO()),vm=vs(),gO=H(),fO=Yo(),bQ=Is(),Hi=xs(),SQ=hc(),TQ=Em(dO());function Em(e){return e&&e.__esModule?e:{default:e}}function IQ(e,t,r,n,i,o,s,a){return arguments.length===1?hO(e):hO({schema:e,document:t,rootValue:r,contextValue:n,variableValues:i,operationName:o,fieldResolver:s,subscribeFieldResolver:a})}function yO(e){if(e instanceof gO.GraphQLError)return{errors:[e]};throw e}function hO(e){var t=e.schema,r=e.document,n=e.rootValue,i=e.contextValue,o=e.variableValues,s=e.operationName,a=e.fieldResolver,u=e.subscribeFieldResolver,c=vO(t,r,n,i,o,s,u),l=function(f){return(0,Hi.execute)({schema:t,document:r,rootValue:f,contextValue:i,variableValues:o,operationName:s,fieldResolver:a})};return c.then(function(d){return(0,mO.default)(d)?(0,TQ.default)(d,l,yO):d})}function vO(e,t,r,n,i,o,s){return(0,Hi.assertValidExecutionArguments)(e,t,i),new Promise(function(a){var u=(0,Hi.buildExecutionContext)(e,t,r,n,i,o,s);a(Array.isArray(u)?{errors:u}:wQ(u))}).catch(yO)}function wQ(e){var t=e.schema,r=e.operation,n=e.variableValues,i=e.rootValue,o=(0,SQ.getOperationRootType)(t,r),s=(0,Hi.collectFields)(e,o,r.selectionSet,Object.create(null),Object.create(null)),a=Object.keys(s),u=a[0],c=s[u],l=c[0],d=l.name.value,f=(0,Hi.getFieldDef)(t,o,d);if(!f)throw new gO.GraphQLError('The subscription field "'.concat(d,'" is not defined.'),c);var h=(0,vm.addPath)(void 0,u,o.name),g=(0,Hi.buildResolveInfo)(e,f,c,o,h);return new Promise(function(v){var _,S=(0,bQ.getArgumentValues)(f,c[0],n),b=e.contextValue,A=(_=f.subscribe)!==null&&_!==void 0?_:e.fieldResolver;v(A(i,S,b,g))}).then(function(v){if(v instanceof Error)throw(0,fO.locatedError)(v,c,(0,vm.pathToArray)(h));if(!(0,mO.default)(v))throw new Error("Subscription field must return Async Iterable. "+"Received: ".concat((0,_Q.default)(v),"."));return v},function(v){throw(0,fO.locatedError)(v,c,(0,vm.pathToArray)(h))})}});var bO=y(Oc=>{"use strict";p();Object.defineProperty(Oc,"__esModule",{value:!0});Object.defineProperty(Oc,"subscribe",{enumerable:!0,get:function(){return _O.subscribe}});Object.defineProperty(Oc,"createSourceEventStream",{enumerable:!0,get:function(){return _O.createSourceEventStream}});var _O=EO()});var Tm=y(Sm=>{"use strict";p();Object.defineProperty(Sm,"__esModule",{value:!0});Sm.NoDeprecatedCustomRule=AQ;var _m=OQ(et()),Cs=H(),bm=ie();function OQ(e){return e&&e.__esModule?e:{default:e}}function AQ(e){return{Field:function(r){var n=e.getFieldDef(),i=n?.deprecationReason;if(n&&i!=null){var o=e.getParentType();o!=null||(0,_m.default)(0),e.reportError(new Cs.GraphQLError("The field ".concat(o.name,".").concat(n.name," is deprecated. ").concat(i),r))}},Argument:function(r){var n=e.getArgument(),i=n?.deprecationReason;if(n&&i!=null){var o=e.getDirective();if(o!=null)e.reportError(new Cs.GraphQLError('Directive "@'.concat(o.name,'" argument "').concat(n.name,'" is deprecated. ').concat(i),r));else{var s=e.getParentType(),a=e.getFieldDef();s!=null&&a!=null||(0,_m.default)(0),e.reportError(new Cs.GraphQLError('Field "'.concat(s.name,".").concat(a.name,'" argument "').concat(n.name,'" is deprecated. ').concat(i),r))}}},ObjectField:function(r){var n=(0,bm.getNamedType)(e.getParentInputType());if((0,bm.isInputObjectType)(n)){var i=n.getFields()[r.name.value],o=i?.deprecationReason;o!=null&&e.reportError(new Cs.GraphQLError("The input field ".concat(n.name,".").concat(i.name," is deprecated. ").concat(o),r))}},EnumValue:function(r){var n=e.getEnumValue(),i=n?.deprecationReason;if(n&&i!=null){var o=(0,bm.getNamedType)(e.getInputType());o!=null||(0,_m.default)(0),e.reportError(new Cs.GraphQLError('The enum value "'.concat(o.name,".").concat(n.name,'" is deprecated. ').concat(i),r))}}}}});var SO=y(Im=>{"use strict";p();Object.defineProperty(Im,"__esModule",{value:!0});Im.NoSchemaIntrospectionCustomRule=NQ;var xQ=H(),CQ=ie(),RQ=Ut();function NQ(e){return{Field:function(r){var n=(0,CQ.getNamedType)(e.getType());n&&(0,RQ.isIntrospectionType)(n)&&e.reportError(new xQ.GraphQLError('GraphQL introspection has been disabled, but the requested query contained the field "'.concat(r.name.value,'".'),r))}}}});var IO=y(J=>{"use strict";p();Object.defineProperty(J,"__esModule",{value:!0});Object.defineProperty(J,"validate",{enumerable:!0,get:function(){return PQ.validate}});Object.defineProperty(J,"ValidationContext",{enumerable:!0,get:function(){return DQ.ValidationContext}});Object.defineProperty(J,"specifiedRules",{enumerable:!0,get:function(){return TO.specifiedRules}});Object.defineProperty(J,"recommendedRules",{enumerable:!0,get:function(){return TO.recommendedRules}});Object.defineProperty(J,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return LQ.ExecutableDefinitionsRule}});Object.defineProperty(J,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return kQ.FieldsOnCorrectTypeRule}});Object.defineProperty(J,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return jQ.FragmentsOnCompositeTypesRule}});Object.defineProperty(J,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return MQ.KnownArgumentNamesRule}});Object.defineProperty(J,"KnownDirectivesRule",{enumerable:!0,get:function(){return FQ.KnownDirectivesRule}});Object.defineProperty(J,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return qQ.KnownFragmentNamesRule}});Object.defineProperty(J,"KnownTypeNamesRule",{enumerable:!0,get:function(){return UQ.KnownTypeNamesRule}});Object.defineProperty(J,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return VQ.LoneAnonymousOperationRule}});Object.defineProperty(J,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return GQ.NoFragmentCyclesRule}});Object.defineProperty(J,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return $Q.NoUndefinedVariablesRule}});Object.defineProperty(J,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return BQ.NoUnusedFragmentsRule}});Object.defineProperty(J,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return KQ.NoUnusedVariablesRule}});Object.defineProperty(J,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return HQ.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(J,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return QQ.PossibleFragmentSpreadsRule}});Object.defineProperty(J,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return WQ.ProvidedRequiredArgumentsRule}});Object.defineProperty(J,"ScalarLeafsRule",{enumerable:!0,get:function(){return zQ.ScalarLeafsRule}});Object.defineProperty(J,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return YQ.SingleFieldSubscriptionsRule}});Object.defineProperty(J,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return JQ.UniqueArgumentNamesRule}});Object.defineProperty(J,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return XQ.UniqueDirectivesPerLocationRule}});Object.defineProperty(J,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return ZQ.UniqueFragmentNamesRule}});Object.defineProperty(J,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return eW.UniqueInputFieldNamesRule}});Object.defineProperty(J,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return tW.UniqueOperationNamesRule}});Object.defineProperty(J,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return rW.UniqueVariableNamesRule}});Object.defineProperty(J,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return nW.ValuesOfCorrectTypeRule}});Object.defineProperty(J,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return iW.VariablesAreInputTypesRule}});Object.defineProperty(J,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return oW.VariablesInAllowedPositionRule}});Object.defineProperty(J,"MaxIntrospectionDepthRule",{enumerable:!0,get:function(){return sW.MaxIntrospectionDepthRule}});Object.defineProperty(J,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return aW.LoneSchemaDefinitionRule}});Object.defineProperty(J,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return uW.UniqueOperationTypesRule}});Object.defineProperty(J,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return cW.UniqueTypeNamesRule}});Object.defineProperty(J,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return lW.UniqueEnumValueNamesRule}});Object.defineProperty(J,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return pW.UniqueFieldDefinitionNamesRule}});Object.defineProperty(J,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return dW.UniqueDirectiveNamesRule}});Object.defineProperty(J,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return fW.PossibleTypeExtensionsRule}});Object.defineProperty(J,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return hW.NoDeprecatedCustomRule}});Object.defineProperty(J,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return mW.NoSchemaIntrospectionCustomRule}});var PQ=Ui(),DQ=Zh(),TO=Jh(),LQ=Rf(),kQ=Qf(),jQ=Vf(),MQ=gh(),FQ=dh(),qQ=Jf(),UQ=qf(),VQ=Lf(),GQ=ih(),$Q=uh(),BQ=Zf(),KQ=lh(),HQ=Nh(),QQ=rh(),WQ=Sh(),zQ=Kf(),YQ=jf(),JQ=vh(),XQ=mh(),ZQ=zf(),eW=Dh(),tW=Pf(),rW=sh(),nW=_h(),iW=$f(),oW=Ih(),sW=kh(),aW=Mh(),uW=qh(),cW=Vh(),lW=$h(),pW=Hh(),dW=Wh(),fW=Yh(),hW=Tm(),mW=SO()});var wO=y(wm=>{"use strict";p();Object.defineProperty(wm,"__esModule",{value:!0});Object.defineProperty(wm,"formatError",{enumerable:!0,get:function(){return gW.formatError}});var gW=H()});var AO=y(Qn=>{"use strict";p();Object.defineProperty(Qn,"__esModule",{value:!0});Object.defineProperty(Qn,"GraphQLError",{enumerable:!0,get:function(){return OO.GraphQLError}});Object.defineProperty(Qn,"printError",{enumerable:!0,get:function(){return OO.printError}});Object.defineProperty(Qn,"syntaxError",{enumerable:!0,get:function(){return yW.syntaxError}});Object.defineProperty(Qn,"locatedError",{enumerable:!0,get:function(){return vW.locatedError}});Object.defineProperty(Qn,"formatError",{enumerable:!0,get:function(){return EW.formatError}});var OO=H(),yW=mu(),vW=Yo(),EW=wO()});var Am=y(Om=>{"use strict";p();Object.defineProperty(Om,"__esModule",{value:!0});Om.getIntrospectionQuery=SW;function xO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _W(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xO(Object(r),!0).forEach(function(n){bW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SW(e){var t=_W({descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1},e),r=t.descriptions?"description":"",n=t.specifiedByUrl?"specifiedByUrl":"",i=t.directiveIsRepeatable?"isRepeatable":"",o=t.schemaDescription?r:"";function s(a){return t.inputValueDeprecation?a:""}return`
|
|
79
|
+
`))}});var xw=y(tm=>{"use strict";p();Object.defineProperty(tm,"__esModule",{value:!0});tm.default=aH;function aH(e){var t;return function(n,i,o){t||(t=new WeakMap);var s=t.get(n),a;if(s){if(a=s.get(i),a){var u=a.get(o);if(u!==void 0)return u}}else s=new WeakMap,t.set(n,s);a||(a=new WeakMap,s.set(i,a));var c=e(n,i,o);return a.set(o,c),c}}});var Cw=y(rm=>{"use strict";p();Object.defineProperty(rm,"__esModule",{value:!0});rm.default=lH;var uH=cH(uu());function cH(e){return e&&e.__esModule?e:{default:e}}function lH(e,t,r){return e.reduce(function(n,i){return(0,uH.default)(n)?n.then(function(o){return t(o,i)}):t(n,i)},r)}});var Rw=y(nm=>{"use strict";p();Object.defineProperty(nm,"__esModule",{value:!0});nm.default=pH;function pH(e){var t=Object.keys(e),r=t.map(function(n){return e[n]});return Promise.all(r).then(function(n){return n.reduce(function(i,o,s){return i[t[s]]=o,i},Object.create(null))})}});var Es=y(dc=>{"use strict";p();Object.defineProperty(dc,"__esModule",{value:!0});dc.addPath=dH;dc.pathToArray=fH;function dH(e,t,r){return{prev:e,key:t,typename:r}}function fH(e){for(var t=[],r=e;r;)t.push(r.key),r=r.prev;return t.reverse()}});var hc=y(im=>{"use strict";p();Object.defineProperty(im,"__esModule",{value:!0});im.getOperationRootType=hH;var fc=H();function hH(e,t){if(t.operation==="query"){var r=e.getQueryType();if(!r)throw new fc.GraphQLError("Schema does not define the required query root type.",t);return r}if(t.operation==="mutation"){var n=e.getMutationType();if(!n)throw new fc.GraphQLError("Schema is not configured for mutations.",t);return n}if(t.operation==="subscription"){var i=e.getSubscriptionType();if(!i)throw new fc.GraphQLError("Schema is not configured for subscriptions.",t);return i}throw new fc.GraphQLError("Can only have query, mutation and subscription operations.",t)}});var sm=y(om=>{"use strict";p();Object.defineProperty(om,"__esModule",{value:!0});om.default=mH;function mH(e){return e.map(function(t){return typeof t=="number"?"["+t.toString()+"]":"."+t}).join("")}});var Ss=y(am=>{"use strict";p();Object.defineProperty(am,"__esModule",{value:!0});am.valueFromAST=_s;var gH=mc(Tt()),yH=mc(Qr()),vH=mc(ae()),EH=mc(et()),Vi=_e(),$n=ie();function mc(e){return e&&e.__esModule?e:{default:e}}function _s(e,t,r){if(e){if(e.kind===Vi.Kind.VARIABLE){var n=e.name.value;if(r==null||r[n]===void 0)return;var i=r[n];return i===null&&(0,$n.isNonNullType)(t)?void 0:i}if((0,$n.isNonNullType)(t))return e.kind===Vi.Kind.NULL?void 0:_s(e,t.ofType,r);if(e.kind===Vi.Kind.NULL)return null;if((0,$n.isListType)(t)){var o=t.ofType;if(e.kind===Vi.Kind.LIST){for(var s=[],a=0,u=e.values;a<u.length;a++){var c=u[a];if(Nw(c,r)){if((0,$n.isNonNullType)(o))return;s.push(null)}else{var l=_s(c,o,r);if(l===void 0)return;s.push(l)}}return s}var d=_s(e,o,r);return d===void 0?void 0:[d]}if((0,$n.isInputObjectType)(t)){if(e.kind!==Vi.Kind.OBJECT)return;for(var f=Object.create(null),h=(0,yH.default)(e.fields,function(A){return A.name.value}),g=0,v=(0,gH.default)(t.getFields());g<v.length;g++){var _=v[g],b=h[_.name];if(!b||Nw(b.value,r)){if(_.defaultValue!==void 0)f[_.name]=_.defaultValue;else if((0,$n.isNonNullType)(_.type))return;continue}var S=_s(b.value,_.type,r);if(S===void 0)return;f[_.name]=S}return f}if((0,$n.isLeafType)(t)){var I;try{I=t.parseLiteral(e,r)}catch{return}return I===void 0?void 0:I}(0,EH.default)(0,"Unexpected input type: "+(0,vH.default)(t))}}function Nw(e,t){return e.kind===Vi.Kind.VARIABLE&&(t==null||t[e.name.value]===void 0)}});var cm=y(um=>{"use strict";p();Object.defineProperty(um,"__esModule",{value:!0});um.coerceInputValue=CH;var _H=an(Tt()),gc=an(ae()),SH=an(et()),bH=an(Wr()),TH=an(ar()),IH=an(Ku()),wH=an(zr()),OH=an(sm()),wr=Es(),Bn=H(),bs=ie();function an(e){return e&&e.__esModule?e:{default:e}}function Pw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function AH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pw(Object(r),!0).forEach(function(n){xH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CH(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:RH;return Ts(e,t,r)}function RH(e,t,r){var n="Invalid value "+(0,gc.default)(t);throw e.length>0&&(n+=' at "value'.concat((0,OH.default)(e),'"')),r.message=n+": "+r.message,r}function Ts(e,t,r,n){if((0,bs.isNonNullType)(t)){if(e!=null)return Ts(e,t.ofType,r,n);r((0,wr.pathToArray)(n),e,new Bn.GraphQLError('Expected non-nullable type "'.concat((0,gc.default)(t),'" not to be null.')));return}if(e==null)return null;if((0,bs.isListType)(t)){var i=t.ofType,o=(0,IH.default)(e,function(S,I){var A=(0,wr.addPath)(n,I,void 0);return Ts(S,i,r,A)});return o??[Ts(e,i,r,n)]}if((0,bs.isInputObjectType)(t)){if(!(0,TH.default)(e)){r((0,wr.pathToArray)(n),e,new Bn.GraphQLError('Expected type "'.concat(t.name,'" to be an object.')));return}for(var s=Object.create(null),a=t.getFields(),u=0,c=(0,_H.default)(a);u<c.length;u++){var l=c[u],d=e[l.name];if(d===void 0){if(l.defaultValue!==void 0)s[l.name]=l.defaultValue;else if((0,bs.isNonNullType)(l.type)){var f=(0,gc.default)(l.type);r((0,wr.pathToArray)(n),e,new Bn.GraphQLError('Field "'.concat(l.name,'" of required type "').concat(f,'" was not provided.')))}continue}s[l.name]=Ts(d,l.type,r,(0,wr.addPath)(n,l.name,t.name))}for(var h=0,g=Object.keys(e);h<g.length;h++){var v=g[h];if(!a[v]){var _=(0,wH.default)(v,Object.keys(t.getFields()));r((0,wr.pathToArray)(n),e,new Bn.GraphQLError('Field "'.concat(v,'" is not defined by type "').concat(t.name,'".')+(0,bH.default)(_)))}}return AH({},s)}if((0,bs.isLeafType)(t)){var b;try{b=t.parseValue(e)}catch(S){S instanceof Bn.GraphQLError?r((0,wr.pathToArray)(n),e,S):r((0,wr.pathToArray)(n),e,new Bn.GraphQLError('Expected type "'.concat(t.name,'". ')+S.message,void 0,void 0,void 0,void 0,S));return}return b===void 0&&r((0,wr.pathToArray)(n),e,new Bn.GraphQLError('Expected type "'.concat(t.name,'".'))),b}(0,SH.default)(0,"Unexpected input type: "+(0,gc.default)(t))}});var ws=y(Is=>{"use strict";p();Object.defineProperty(Is,"__esModule",{value:!0});Is.getVariableValues=MH;Is.getArgumentValues=Fw;Is.getDirectiveValues=qH;var NH=yc(Ai()),PH=yc(Qr()),Gi=yc(ae()),DH=yc(sm()),Or=H(),Dw=_e(),kw=mt(),$i=ie(),LH=dr(),jw=Ss(),kH=cm();function yc(e){return e&&e.__esModule?e:{default:e}}function Lw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Mw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lw(Object(r),!0).forEach(function(n){jH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MH(e,t,r,n){var i=[],o=n?.maxErrors;try{var s=FH(e,t,r,function(a){if(o!=null&&i.length>=o)throw new Or.GraphQLError("Too many errors processing variables, error limit reached. Execution aborted.");i.push(a)});if(i.length===0)return{coerced:s}}catch(a){i.push(a)}return{errors:i}}function FH(e,t,r,n){for(var i=Object.create(null),o=function(c){var l=t[c],d=l.variable.name.value,f=(0,LH.typeFromAST)(e,l.type);if(!(0,$i.isInputType)(f)){var h=(0,kw.print)(l.type);return n(new Or.GraphQLError('Variable "$'.concat(d,'" expected value of type "').concat(h,'" which cannot be used as an input type.'),l.type)),"continue"}if(!qw(r,d)){if(l.defaultValue)i[d]=(0,jw.valueFromAST)(l.defaultValue,f);else if((0,$i.isNonNullType)(f)){var g=(0,Gi.default)(f);n(new Or.GraphQLError('Variable "$'.concat(d,'" of required type "').concat(g,'" was not provided.'),l))}return"continue"}var v=r[d];if(v===null&&(0,$i.isNonNullType)(f)){var _=(0,Gi.default)(f);return n(new Or.GraphQLError('Variable "$'.concat(d,'" of non-null type "').concat(_,'" must not be null.'),l)),"continue"}i[d]=(0,kH.coerceInputValue)(v,f,function(b,S,I){var A='Variable "$'.concat(d,'" got invalid value ')+(0,Gi.default)(S);b.length>0&&(A+=' at "'.concat(d).concat((0,DH.default)(b),'"')),n(new Or.GraphQLError(A+"; "+I.message,l,void 0,void 0,void 0,I.originalError))})},s=0;s<t.length;s++)var a=o(s);return Mw({},i)}function Fw(e,t,r){for(var n,i=Object.create(null),o=(n=t.arguments)!==null&&n!==void 0?n:[],s=(0,PH.default)(o,function(b){return b.name.value}),a=0,u=e.args;a<u.length;a++){var c=u[a],l=c.name,d=c.type,f=s[l];if(!f){if(c.defaultValue!==void 0)i[l]=c.defaultValue;else if((0,$i.isNonNullType)(d))throw new Or.GraphQLError('Argument "'.concat(l,'" of required type "').concat((0,Gi.default)(d),'" ')+"was not provided.",t);continue}var h=f.value,g=h.kind===Dw.Kind.NULL;if(h.kind===Dw.Kind.VARIABLE){var v=h.name.value;if(r==null||!qw(r,v)){if(c.defaultValue!==void 0)i[l]=c.defaultValue;else if((0,$i.isNonNullType)(d))throw new Or.GraphQLError('Argument "'.concat(l,'" of required type "').concat((0,Gi.default)(d),'" ')+'was provided the variable "$'.concat(v,'" which was not provided a runtime value.'),h);continue}g=r[v]==null}if(g&&(0,$i.isNonNullType)(d))throw new Or.GraphQLError('Argument "'.concat(l,'" of non-null type "').concat((0,Gi.default)(d),'" ')+"must not be null.",h);var _=(0,jw.valueFromAST)(h,d,r);if(_===void 0)throw new Or.GraphQLError('Argument "'.concat(l,'" has invalid value ').concat((0,kw.print)(h),"."),h);i[l]=_}return Mw({},i)}function qH(e,t,r){var n=t.directives&&(0,NH.default)(t.directives,function(i){return i.name.value===e.name});if(n)return Fw(e,n,r)}function qw(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var Cs=y(wt=>{"use strict";p();Object.defineProperty(wt,"__esModule",{value:!0});wt.execute=QH;wt.executeSync=WH;wt.assertValidExecutionArguments=Ww;wt.buildExecutionContext=zw;wt.collectFields=As;wt.buildResolveInfo=Xw;wt.getFieldDef=tO;wt.defaultFieldResolver=wt.defaultTypeResolver=void 0;var Ki=xr(ae()),UH=xr(xw()),VH=xr(et()),Uw=xr(Mt()),Vt=xr(uu()),fm=xr(ar()),GH=xr(Ku()),$H=xr(Cw()),Vw=xr(Rw()),Kn=Es(),hr=H(),vc=Jo(),Os=_e(),BH=hs(),Bi=Ut(),Gw=gt(),Ar=ie(),KH=dr(),HH=hc(),Ec=ws();function xr(e){return e&&e.__esModule?e:{default:e}}function QH(e,t,r,n,i,o,s,a){return arguments.length===1?pm(e):pm({schema:e,document:t,rootValue:r,contextValue:n,variableValues:i,operationName:o,fieldResolver:s,typeResolver:a})}function WH(e){var t=pm(e);if((0,Vt.default)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function pm(e){var t=e.schema,r=e.document,n=e.rootValue,i=e.contextValue,o=e.variableValues,s=e.operationName,a=e.fieldResolver,u=e.typeResolver;Ww(t,r,o);var c=zw(t,r,n,i,o,s,a,u);if(Array.isArray(c))return{errors:c};var l=zH(c,c.operation,n);return Qw(c,l)}function Qw(e,t){return(0,Vt.default)(t)?t.then(function(r){return Qw(e,r)}):e.errors.length===0?{data:t}:{errors:e.errors,data:t}}function Ww(e,t,r){t||(0,Uw.default)(0,"Must provide document."),(0,BH.assertValidSchema)(e),r==null||(0,fm.default)(r)||(0,Uw.default)(0,"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 zw(e,t,r,n,i,o,s,a){for(var u,c,l,d=Object.create(null),f=0,h=t.definitions;f<h.length;f++){var g=h[f];switch(g.kind){case Os.Kind.OPERATION_DEFINITION:if(o==null){if(l!==void 0)return[new hr.GraphQLError("Must provide operation name if query contains multiple operations.")];l=g}else((u=g.name)===null||u===void 0?void 0:u.value)===o&&(l=g);break;case Os.Kind.FRAGMENT_DEFINITION:d[g.name.value]=g;break}}if(!l)return o!=null?[new hr.GraphQLError('Unknown operation named "'.concat(o,'".'))]:[new hr.GraphQLError("Must provide an operation.")];var v=(c=l.variableDefinitions)!==null&&c!==void 0?c:[],_=(0,Ec.getVariableValues)(e,v,i??{},{maxErrors:50});return _.errors?_.errors:{schema:e,fragments:d,rootValue:r,contextValue:n,operation:l,variableValues:_.coerced,fieldResolver:s??eO,typeResolver:a??Zw,errors:[]}}function zH(e,t,r){var n=(0,HH.getOperationRootType)(e.schema,t),i=As(e,n,t.selectionSet,Object.create(null),Object.create(null)),o=void 0;try{var s=t.operation==="mutation"?YH(e,n,r,o,i):Yw(e,n,r,o,i);return(0,Vt.default)(s)?s.then(void 0,function(a){return e.errors.push(a),Promise.resolve(null)}):s}catch(a){return e.errors.push(a),null}}function YH(e,t,r,n,i){return(0,$H.default)(Object.keys(i),function(o,s){var a=i[s],u=(0,Kn.addPath)(n,s,t.name),c=Jw(e,t,r,a,u);return c===void 0?o:(0,Vt.default)(c)?c.then(function(l){return o[s]=l,o}):(o[s]=c,o)},Object.create(null))}function Yw(e,t,r,n,i){var o=Object.create(null),s=!1;try{for(var a=0,u=Object.keys(i);a<u.length;a++){var c=u[a],l=i[c],d=(0,Kn.addPath)(n,c,t.name),f=Jw(e,t,r,l,d);f!==void 0&&(o[c]=f,(0,Vt.default)(f)&&(s=!0))}}catch(h){if(s)return(0,Vw.default)(o).finally(function(){throw h});throw h}return s?(0,Vw.default)(o):o}function As(e,t,r,n,i){for(var o=0,s=r.selections;o<s.length;o++){var a=s[o];switch(a.kind){case Os.Kind.FIELD:{if(!lm(e,a))continue;var u=JH(a);n[u]||(n[u]=[]),n[u].push(a);break}case Os.Kind.INLINE_FRAGMENT:{if(!lm(e,a)||!$w(e,a,t))continue;As(e,t,a.selectionSet,n,i);break}case Os.Kind.FRAGMENT_SPREAD:{var c=a.name.value;if(i[c]||!lm(e,a))continue;i[c]=!0;var l=e.fragments[c];if(!l||!$w(e,l,t))continue;As(e,t,l.selectionSet,n,i);break}}}return n}function lm(e,t){var r=(0,Ec.getDirectiveValues)(Gw.GraphQLSkipDirective,t,e.variableValues);if(r?.if===!0)return!1;var n=(0,Ec.getDirectiveValues)(Gw.GraphQLIncludeDirective,t,e.variableValues);return n?.if!==!1}function $w(e,t,r){var n=t.typeCondition;if(!n)return!0;var i=(0,KH.typeFromAST)(e.schema,n);return i===r?!0:(0,Ar.isAbstractType)(i)?e.schema.isSubType(i,r):!1}function JH(e){return e.alias?e.alias.value:e.name.value}function Jw(e,t,r,n,i){var o,s=n[0],a=s.name.value,u=tO(e.schema,t,a);if(u){var c=u.type,l=(o=u.resolve)!==null&&o!==void 0?o:e.fieldResolver,d=Xw(e,u,n,t,i);try{var f=(0,Ec.getArgumentValues)(u,n[0],e.variableValues),h=e.contextValue,g=l(r,f,h,d),v;return(0,Vt.default)(g)?v=g.then(function(b){return xs(e,c,n,d,i,b)}):v=xs(e,c,n,d,i,g),(0,Vt.default)(v)?v.then(void 0,function(b){var S=(0,vc.locatedError)(b,n,(0,Kn.pathToArray)(i));return _c(S,c,e)}):v}catch(b){var _=(0,vc.locatedError)(b,n,(0,Kn.pathToArray)(i));return _c(_,c,e)}}}function Xw(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 _c(e,t,r){if((0,Ar.isNonNullType)(t))throw e;return r.errors.push(e),null}function xs(e,t,r,n,i,o){if(o instanceof Error)throw o;if((0,Ar.isNonNullType)(t)){var s=xs(e,t.ofType,r,n,i,o);if(s===null)throw new Error("Cannot return null for non-nullable field ".concat(n.parentType.name,".").concat(n.fieldName,"."));return s}if(o==null)return null;if((0,Ar.isListType)(t))return XH(e,t,r,n,i,o);if((0,Ar.isLeafType)(t))return ZH(t,o);if((0,Ar.isAbstractType)(t))return eQ(e,t,r,n,i,o);if((0,Ar.isObjectType)(t))return dm(e,t,r,n,i,o);(0,VH.default)(0,"Cannot complete value of unexpected output type: "+(0,Ki.default)(t))}function XH(e,t,r,n,i,o){var s=t.ofType,a=!1,u=(0,GH.default)(o,function(c,l){var d=(0,Kn.addPath)(i,l,void 0);try{var f;return(0,Vt.default)(c)?f=c.then(function(g){return xs(e,s,r,n,d,g)}):f=xs(e,s,r,n,d,c),(0,Vt.default)(f)?(a=!0,f.then(void 0,function(g){var v=(0,vc.locatedError)(g,r,(0,Kn.pathToArray)(d));return _c(v,s,e)})):f}catch(g){var h=(0,vc.locatedError)(g,r,(0,Kn.pathToArray)(d));return _c(h,s,e)}});if(u==null)throw new hr.GraphQLError('Expected Iterable, but did not find one for field "'.concat(n.parentType.name,".").concat(n.fieldName,'".'));return a?Promise.all(u):u}function ZH(e,t){var r=e.serialize(t);if(r===void 0)throw new Error('Expected a value of type "'.concat((0,Ki.default)(e),'" but ')+"received: ".concat((0,Ki.default)(t)));return r}function eQ(e,t,r,n,i,o){var s,a=(s=t.resolveType)!==null&&s!==void 0?s:e.typeResolver,u=e.contextValue,c=a(o,u,n,t);return(0,Vt.default)(c)?c.then(function(l){return dm(e,Bw(l,e,t,r,n,o),r,n,i,o)}):dm(e,Bw(c,e,t,r,n,o),r,n,i,o)}function Bw(e,t,r,n,i,o){if(e==null)throw new hr.GraphQLError('Abstract type "'.concat(r.name,'" must resolve to an Object type at runtime for field "').concat(i.parentType.name,".").concat(i.fieldName,'". Either the "').concat(r.name,'" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.'),n);var s=(0,Ar.isNamedType)(e)?e.name:e;if(typeof s!="string")throw new hr.GraphQLError('Abstract type "'.concat(r.name,'" must resolve to an Object type at runtime for field "').concat(i.parentType.name,".").concat(i.fieldName,'" with ')+"value ".concat((0,Ki.default)(o),', received "').concat((0,Ki.default)(e),'".'));var a=t.schema.getType(s);if(a==null)throw new hr.GraphQLError('Abstract type "'.concat(r.name,'" was resolve to a type "').concat(s,'" that does not exist inside schema.'),n);if(!(0,Ar.isObjectType)(a))throw new hr.GraphQLError('Abstract type "'.concat(r.name,'" was resolve to a non-object type "').concat(s,'".'),n);if(!t.schema.isSubType(r,a))throw new hr.GraphQLError('Runtime Object type "'.concat(a.name,'" is not a possible type for "').concat(r.name,'".'),n);return a}function dm(e,t,r,n,i,o){if(t.isTypeOf){var s=t.isTypeOf(o,e.contextValue,n);if((0,Vt.default)(s))return s.then(function(a){if(!a)throw Kw(t,o,r);return Hw(e,t,r,i,o)});if(!s)throw Kw(t,o,r)}return Hw(e,t,r,i,o)}function Kw(e,t,r){return new hr.GraphQLError('Expected value of type "'.concat(e.name,'" but got: ').concat((0,Ki.default)(t),"."),r)}function Hw(e,t,r,n,i){var o=tQ(e,t,r);return Yw(e,t,i,n,o)}var tQ=(0,UH.default)(rQ);function rQ(e,t,r){for(var n=Object.create(null),i=Object.create(null),o=0;o<r.length;o++){var s=r[o];s.selectionSet&&(n=As(e,t,s.selectionSet,n,i))}return n}var Zw=function(t,r,n,i){if((0,fm.default)(t)&&typeof t.__typename=="string")return t.__typename;for(var o=n.schema.getPossibleTypes(i),s=[],a=0;a<o.length;a++){var u=o[a];if(u.isTypeOf){var c=u.isTypeOf(t,r,n);if((0,Vt.default)(c))s[a]=c;else if(c)return u.name}}if(s.length)return Promise.all(s).then(function(l){for(var d=0;d<l.length;d++)if(l[d])return o[d].name})};wt.defaultTypeResolver=Zw;var eO=function(t,r,n,i){if((0,fm.default)(t)||typeof t=="function"){var o=t[i.fieldName];return typeof o=="function"?t[i.fieldName](r,n,i):o}};wt.defaultFieldResolver=eO;function tO(e,t,r){return r===Bi.SchemaMetaFieldDef.name&&e.getQueryType()===t?Bi.SchemaMetaFieldDef:r===Bi.TypeMetaFieldDef.name&&e.getQueryType()===t?Bi.TypeMetaFieldDef:r===Bi.TypeNameMetaFieldDef.name?Bi.TypeNameMetaFieldDef:t.getFields()[r]}});var rO=y(bc=>{"use strict";p();Object.defineProperty(bc,"__esModule",{value:!0});bc.graphql=cQ;bc.graphqlSync=lQ;var nQ=uQ(uu()),iQ=wi(),oQ=Ui(),sQ=hs(),aQ=Cs();function uQ(e){return e&&e.__esModule?e:{default:e}}function cQ(e,t,r,n,i,o,s,a){var u=arguments;return new Promise(function(c){return c(u.length===1?Sc(e):Sc({schema:e,source:t,rootValue:r,contextValue:n,variableValues:i,operationName:o,fieldResolver:s,typeResolver:a}))})}function lQ(e,t,r,n,i,o,s,a){var u=arguments.length===1?Sc(e):Sc({schema:e,source:t,rootValue:r,contextValue:n,variableValues:i,operationName:o,fieldResolver:s,typeResolver:a});if((0,nQ.default)(u))throw new Error("GraphQL execution failed to complete synchronously.");return u}function Sc(e){var t=e.schema,r=e.source,n=e.rootValue,i=e.contextValue,o=e.variableValues,s=e.operationName,a=e.fieldResolver,u=e.typeResolver,c=(0,sQ.validateSchema)(t);if(c.length>0)return{errors:c};var l;try{l=(0,iQ.parse)(r)}catch(f){return{errors:[f]}}var d=(0,oQ.validate)(t,l);return d.length>0?{errors:d}:(0,aQ.execute)({schema:t,document:l,rootValue:n,contextValue:i,variableValues:o,operationName:s,fieldResolver:a,typeResolver:u})}});var iO=y(R=>{"use strict";p();Object.defineProperty(R,"__esModule",{value:!0});Object.defineProperty(R,"isSchema",{enumerable:!0,get:function(){return hm.isSchema}});Object.defineProperty(R,"assertSchema",{enumerable:!0,get:function(){return hm.assertSchema}});Object.defineProperty(R,"GraphQLSchema",{enumerable:!0,get:function(){return hm.GraphQLSchema}});Object.defineProperty(R,"isType",{enumerable:!0,get:function(){return W.isType}});Object.defineProperty(R,"isScalarType",{enumerable:!0,get:function(){return W.isScalarType}});Object.defineProperty(R,"isObjectType",{enumerable:!0,get:function(){return W.isObjectType}});Object.defineProperty(R,"isInterfaceType",{enumerable:!0,get:function(){return W.isInterfaceType}});Object.defineProperty(R,"isUnionType",{enumerable:!0,get:function(){return W.isUnionType}});Object.defineProperty(R,"isEnumType",{enumerable:!0,get:function(){return W.isEnumType}});Object.defineProperty(R,"isInputObjectType",{enumerable:!0,get:function(){return W.isInputObjectType}});Object.defineProperty(R,"isListType",{enumerable:!0,get:function(){return W.isListType}});Object.defineProperty(R,"isNonNullType",{enumerable:!0,get:function(){return W.isNonNullType}});Object.defineProperty(R,"isInputType",{enumerable:!0,get:function(){return W.isInputType}});Object.defineProperty(R,"isOutputType",{enumerable:!0,get:function(){return W.isOutputType}});Object.defineProperty(R,"isLeafType",{enumerable:!0,get:function(){return W.isLeafType}});Object.defineProperty(R,"isCompositeType",{enumerable:!0,get:function(){return W.isCompositeType}});Object.defineProperty(R,"isAbstractType",{enumerable:!0,get:function(){return W.isAbstractType}});Object.defineProperty(R,"isWrappingType",{enumerable:!0,get:function(){return W.isWrappingType}});Object.defineProperty(R,"isNullableType",{enumerable:!0,get:function(){return W.isNullableType}});Object.defineProperty(R,"isNamedType",{enumerable:!0,get:function(){return W.isNamedType}});Object.defineProperty(R,"isRequiredArgument",{enumerable:!0,get:function(){return W.isRequiredArgument}});Object.defineProperty(R,"isRequiredInputField",{enumerable:!0,get:function(){return W.isRequiredInputField}});Object.defineProperty(R,"assertType",{enumerable:!0,get:function(){return W.assertType}});Object.defineProperty(R,"assertScalarType",{enumerable:!0,get:function(){return W.assertScalarType}});Object.defineProperty(R,"assertObjectType",{enumerable:!0,get:function(){return W.assertObjectType}});Object.defineProperty(R,"assertInterfaceType",{enumerable:!0,get:function(){return W.assertInterfaceType}});Object.defineProperty(R,"assertUnionType",{enumerable:!0,get:function(){return W.assertUnionType}});Object.defineProperty(R,"assertEnumType",{enumerable:!0,get:function(){return W.assertEnumType}});Object.defineProperty(R,"assertInputObjectType",{enumerable:!0,get:function(){return W.assertInputObjectType}});Object.defineProperty(R,"assertListType",{enumerable:!0,get:function(){return W.assertListType}});Object.defineProperty(R,"assertNonNullType",{enumerable:!0,get:function(){return W.assertNonNullType}});Object.defineProperty(R,"assertInputType",{enumerable:!0,get:function(){return W.assertInputType}});Object.defineProperty(R,"assertOutputType",{enumerable:!0,get:function(){return W.assertOutputType}});Object.defineProperty(R,"assertLeafType",{enumerable:!0,get:function(){return W.assertLeafType}});Object.defineProperty(R,"assertCompositeType",{enumerable:!0,get:function(){return W.assertCompositeType}});Object.defineProperty(R,"assertAbstractType",{enumerable:!0,get:function(){return W.assertAbstractType}});Object.defineProperty(R,"assertWrappingType",{enumerable:!0,get:function(){return W.assertWrappingType}});Object.defineProperty(R,"assertNullableType",{enumerable:!0,get:function(){return W.assertNullableType}});Object.defineProperty(R,"assertNamedType",{enumerable:!0,get:function(){return W.assertNamedType}});Object.defineProperty(R,"getNullableType",{enumerable:!0,get:function(){return W.getNullableType}});Object.defineProperty(R,"getNamedType",{enumerable:!0,get:function(){return W.getNamedType}});Object.defineProperty(R,"GraphQLScalarType",{enumerable:!0,get:function(){return W.GraphQLScalarType}});Object.defineProperty(R,"GraphQLObjectType",{enumerable:!0,get:function(){return W.GraphQLObjectType}});Object.defineProperty(R,"GraphQLInterfaceType",{enumerable:!0,get:function(){return W.GraphQLInterfaceType}});Object.defineProperty(R,"GraphQLUnionType",{enumerable:!0,get:function(){return W.GraphQLUnionType}});Object.defineProperty(R,"GraphQLEnumType",{enumerable:!0,get:function(){return W.GraphQLEnumType}});Object.defineProperty(R,"GraphQLInputObjectType",{enumerable:!0,get:function(){return W.GraphQLInputObjectType}});Object.defineProperty(R,"GraphQLList",{enumerable:!0,get:function(){return W.GraphQLList}});Object.defineProperty(R,"GraphQLNonNull",{enumerable:!0,get:function(){return W.GraphQLNonNull}});Object.defineProperty(R,"isDirective",{enumerable:!0,get:function(){return mr.isDirective}});Object.defineProperty(R,"assertDirective",{enumerable:!0,get:function(){return mr.assertDirective}});Object.defineProperty(R,"GraphQLDirective",{enumerable:!0,get:function(){return mr.GraphQLDirective}});Object.defineProperty(R,"isSpecifiedDirective",{enumerable:!0,get:function(){return mr.isSpecifiedDirective}});Object.defineProperty(R,"specifiedDirectives",{enumerable:!0,get:function(){return mr.specifiedDirectives}});Object.defineProperty(R,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return mr.GraphQLIncludeDirective}});Object.defineProperty(R,"GraphQLSkipDirective",{enumerable:!0,get:function(){return mr.GraphQLSkipDirective}});Object.defineProperty(R,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return mr.GraphQLDeprecatedDirective}});Object.defineProperty(R,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return mr.GraphQLSpecifiedByDirective}});Object.defineProperty(R,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return mr.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(R,"isSpecifiedScalarType",{enumerable:!0,get:function(){return Hn.isSpecifiedScalarType}});Object.defineProperty(R,"specifiedScalarTypes",{enumerable:!0,get:function(){return Hn.specifiedScalarTypes}});Object.defineProperty(R,"GraphQLInt",{enumerable:!0,get:function(){return Hn.GraphQLInt}});Object.defineProperty(R,"GraphQLFloat",{enumerable:!0,get:function(){return Hn.GraphQLFloat}});Object.defineProperty(R,"GraphQLString",{enumerable:!0,get:function(){return Hn.GraphQLString}});Object.defineProperty(R,"GraphQLBoolean",{enumerable:!0,get:function(){return Hn.GraphQLBoolean}});Object.defineProperty(R,"GraphQLID",{enumerable:!0,get:function(){return Hn.GraphQLID}});Object.defineProperty(R,"isIntrospectionType",{enumerable:!0,get:function(){return vt.isIntrospectionType}});Object.defineProperty(R,"introspectionTypes",{enumerable:!0,get:function(){return vt.introspectionTypes}});Object.defineProperty(R,"__Schema",{enumerable:!0,get:function(){return vt.__Schema}});Object.defineProperty(R,"__Directive",{enumerable:!0,get:function(){return vt.__Directive}});Object.defineProperty(R,"__DirectiveLocation",{enumerable:!0,get:function(){return vt.__DirectiveLocation}});Object.defineProperty(R,"__Type",{enumerable:!0,get:function(){return vt.__Type}});Object.defineProperty(R,"__Field",{enumerable:!0,get:function(){return vt.__Field}});Object.defineProperty(R,"__InputValue",{enumerable:!0,get:function(){return vt.__InputValue}});Object.defineProperty(R,"__EnumValue",{enumerable:!0,get:function(){return vt.__EnumValue}});Object.defineProperty(R,"__TypeKind",{enumerable:!0,get:function(){return vt.__TypeKind}});Object.defineProperty(R,"TypeKind",{enumerable:!0,get:function(){return vt.TypeKind}});Object.defineProperty(R,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return vt.SchemaMetaFieldDef}});Object.defineProperty(R,"TypeMetaFieldDef",{enumerable:!0,get:function(){return vt.TypeMetaFieldDef}});Object.defineProperty(R,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return vt.TypeNameMetaFieldDef}});Object.defineProperty(R,"validateSchema",{enumerable:!0,get:function(){return nO.validateSchema}});Object.defineProperty(R,"assertValidSchema",{enumerable:!0,get:function(){return nO.assertValidSchema}});var hm=Fn(),W=ie(),mr=gt(),Hn=pr(),vt=Ut(),nO=hs()});var aO=y(Ee=>{"use strict";p();Object.defineProperty(Ee,"__esModule",{value:!0});Object.defineProperty(Ee,"Source",{enumerable:!0,get:function(){return pQ.Source}});Object.defineProperty(Ee,"getLocation",{enumerable:!0,get:function(){return dQ.getLocation}});Object.defineProperty(Ee,"printLocation",{enumerable:!0,get:function(){return oO.printLocation}});Object.defineProperty(Ee,"printSourceLocation",{enumerable:!0,get:function(){return oO.printSourceLocation}});Object.defineProperty(Ee,"Kind",{enumerable:!0,get:function(){return fQ.Kind}});Object.defineProperty(Ee,"TokenKind",{enumerable:!0,get:function(){return hQ.TokenKind}});Object.defineProperty(Ee,"Lexer",{enumerable:!0,get:function(){return mQ.Lexer}});Object.defineProperty(Ee,"parse",{enumerable:!0,get:function(){return mm.parse}});Object.defineProperty(Ee,"parseValue",{enumerable:!0,get:function(){return mm.parseValue}});Object.defineProperty(Ee,"parseType",{enumerable:!0,get:function(){return mm.parseType}});Object.defineProperty(Ee,"print",{enumerable:!0,get:function(){return gQ.print}});Object.defineProperty(Ee,"visit",{enumerable:!0,get:function(){return Tc.visit}});Object.defineProperty(Ee,"visitInParallel",{enumerable:!0,get:function(){return Tc.visitInParallel}});Object.defineProperty(Ee,"getVisitFn",{enumerable:!0,get:function(){return Tc.getVisitFn}});Object.defineProperty(Ee,"BREAK",{enumerable:!0,get:function(){return Tc.BREAK}});Object.defineProperty(Ee,"Location",{enumerable:!0,get:function(){return sO.Location}});Object.defineProperty(Ee,"Token",{enumerable:!0,get:function(){return sO.Token}});Object.defineProperty(Ee,"isDefinitionNode",{enumerable:!0,get:function(){return Cr.isDefinitionNode}});Object.defineProperty(Ee,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return Cr.isExecutableDefinitionNode}});Object.defineProperty(Ee,"isSelectionNode",{enumerable:!0,get:function(){return Cr.isSelectionNode}});Object.defineProperty(Ee,"isValueNode",{enumerable:!0,get:function(){return Cr.isValueNode}});Object.defineProperty(Ee,"isTypeNode",{enumerable:!0,get:function(){return Cr.isTypeNode}});Object.defineProperty(Ee,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return Cr.isTypeSystemDefinitionNode}});Object.defineProperty(Ee,"isTypeDefinitionNode",{enumerable:!0,get:function(){return Cr.isTypeDefinitionNode}});Object.defineProperty(Ee,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return Cr.isTypeSystemExtensionNode}});Object.defineProperty(Ee,"isTypeExtensionNode",{enumerable:!0,get:function(){return Cr.isTypeExtensionNode}});Object.defineProperty(Ee,"DirectiveLocation",{enumerable:!0,get:function(){return yQ.DirectiveLocation}});var pQ=Iu(),dQ=lu(),oO=Ed(),fQ=_e(),hQ=bi(),mQ=Au(),mm=wi(),gQ=mt(),Tc=Hr(),sO=Si(),Cr=Un(),yQ=Ti()});var uO=y(un=>{"use strict";p();Object.defineProperty(un,"__esModule",{value:!0});Object.defineProperty(un,"responsePathAsArray",{enumerable:!0,get:function(){return vQ.pathToArray}});Object.defineProperty(un,"execute",{enumerable:!0,get:function(){return Ic.execute}});Object.defineProperty(un,"executeSync",{enumerable:!0,get:function(){return Ic.executeSync}});Object.defineProperty(un,"defaultFieldResolver",{enumerable:!0,get:function(){return Ic.defaultFieldResolver}});Object.defineProperty(un,"defaultTypeResolver",{enumerable:!0,get:function(){return Ic.defaultTypeResolver}});Object.defineProperty(un,"getDirectiveValues",{enumerable:!0,get:function(){return EQ.getDirectiveValues}});var vQ=Es(),Ic=Cs(),EQ=ws()});var cO=y(gm=>{"use strict";p();Object.defineProperty(gm,"__esModule",{value:!0});gm.default=SQ;var _Q=ur();function SQ(e){return typeof e?.[_Q.SYMBOL_ASYNC_ITERATOR]=="function"}});var fO=y(ym=>{"use strict";p();Object.defineProperty(ym,"__esModule",{value:!0});ym.default=TQ;var lO=ur();function bQ(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TQ(e,t,r){var n=e[lO.SYMBOL_ASYNC_ITERATOR],i=n.call(e),o,s;typeof i.return=="function"&&(o=i.return,s=function(d){var f=function(){return Promise.reject(d)};return o.call(i).then(f,f)});function a(l){return l.done?l:pO(l.value,t).then(dO,s)}var u;if(r){var c=r;u=function(d){return pO(d,c).then(dO,s)}}return bQ({next:function(){return i.next().then(a,u)},return:function(){return o?o.call(i).then(a,u):Promise.resolve({value:void 0,done:!0})},throw:function(d){return typeof i.throw=="function"?i.throw(d).then(a,u):Promise.reject(d).catch(s)}},lO.SYMBOL_ASYNC_ITERATOR,function(){return this})}function pO(e,t){return new Promise(function(r){return r(t(e))})}function dO(e){return{value:e,done:!1}}});var _O=y(wc=>{"use strict";p();Object.defineProperty(wc,"__esModule",{value:!0});wc.subscribe=xQ;wc.createSourceEventStream=EO;var IQ=Em(ae()),gO=Em(cO()),vm=Es(),yO=H(),hO=Jo(),wQ=ws(),Hi=Cs(),OQ=hc(),AQ=Em(fO());function Em(e){return e&&e.__esModule?e:{default:e}}function xQ(e,t,r,n,i,o,s,a){return arguments.length===1?mO(e):mO({schema:e,document:t,rootValue:r,contextValue:n,variableValues:i,operationName:o,fieldResolver:s,subscribeFieldResolver:a})}function vO(e){if(e instanceof yO.GraphQLError)return{errors:[e]};throw e}function mO(e){var t=e.schema,r=e.document,n=e.rootValue,i=e.contextValue,o=e.variableValues,s=e.operationName,a=e.fieldResolver,u=e.subscribeFieldResolver,c=EO(t,r,n,i,o,s,u),l=function(f){return(0,Hi.execute)({schema:t,document:r,rootValue:f,contextValue:i,variableValues:o,operationName:s,fieldResolver:a})};return c.then(function(d){return(0,gO.default)(d)?(0,AQ.default)(d,l,vO):d})}function EO(e,t,r,n,i,o,s){return(0,Hi.assertValidExecutionArguments)(e,t,i),new Promise(function(a){var u=(0,Hi.buildExecutionContext)(e,t,r,n,i,o,s);a(Array.isArray(u)?{errors:u}:CQ(u))}).catch(vO)}function CQ(e){var t=e.schema,r=e.operation,n=e.variableValues,i=e.rootValue,o=(0,OQ.getOperationRootType)(t,r),s=(0,Hi.collectFields)(e,o,r.selectionSet,Object.create(null),Object.create(null)),a=Object.keys(s),u=a[0],c=s[u],l=c[0],d=l.name.value,f=(0,Hi.getFieldDef)(t,o,d);if(!f)throw new yO.GraphQLError('The subscription field "'.concat(d,'" is not defined.'),c);var h=(0,vm.addPath)(void 0,u,o.name),g=(0,Hi.buildResolveInfo)(e,f,c,o,h);return new Promise(function(v){var _,b=(0,wQ.getArgumentValues)(f,c[0],n),S=e.contextValue,I=(_=f.subscribe)!==null&&_!==void 0?_:e.fieldResolver;v(I(i,b,S,g))}).then(function(v){if(v instanceof Error)throw(0,hO.locatedError)(v,c,(0,vm.pathToArray)(h));if(!(0,gO.default)(v))throw new Error("Subscription field must return Async Iterable. "+"Received: ".concat((0,IQ.default)(v),"."));return v},function(v){throw(0,hO.locatedError)(v,c,(0,vm.pathToArray)(h))})}});var bO=y(Oc=>{"use strict";p();Object.defineProperty(Oc,"__esModule",{value:!0});Object.defineProperty(Oc,"subscribe",{enumerable:!0,get:function(){return SO.subscribe}});Object.defineProperty(Oc,"createSourceEventStream",{enumerable:!0,get:function(){return SO.createSourceEventStream}});var SO=_O()});var Tm=y(bm=>{"use strict";p();Object.defineProperty(bm,"__esModule",{value:!0});bm.NoDeprecatedCustomRule=NQ;var _m=RQ(et()),Rs=H(),Sm=ie();function RQ(e){return e&&e.__esModule?e:{default:e}}function NQ(e){return{Field:function(r){var n=e.getFieldDef(),i=n?.deprecationReason;if(n&&i!=null){var o=e.getParentType();o!=null||(0,_m.default)(0),e.reportError(new Rs.GraphQLError("The field ".concat(o.name,".").concat(n.name," is deprecated. ").concat(i),r))}},Argument:function(r){var n=e.getArgument(),i=n?.deprecationReason;if(n&&i!=null){var o=e.getDirective();if(o!=null)e.reportError(new Rs.GraphQLError('Directive "@'.concat(o.name,'" argument "').concat(n.name,'" is deprecated. ').concat(i),r));else{var s=e.getParentType(),a=e.getFieldDef();s!=null&&a!=null||(0,_m.default)(0),e.reportError(new Rs.GraphQLError('Field "'.concat(s.name,".").concat(a.name,'" argument "').concat(n.name,'" is deprecated. ').concat(i),r))}}},ObjectField:function(r){var n=(0,Sm.getNamedType)(e.getParentInputType());if((0,Sm.isInputObjectType)(n)){var i=n.getFields()[r.name.value],o=i?.deprecationReason;o!=null&&e.reportError(new Rs.GraphQLError("The input field ".concat(n.name,".").concat(i.name," is deprecated. ").concat(o),r))}},EnumValue:function(r){var n=e.getEnumValue(),i=n?.deprecationReason;if(n&&i!=null){var o=(0,Sm.getNamedType)(e.getInputType());o!=null||(0,_m.default)(0),e.reportError(new Rs.GraphQLError('The enum value "'.concat(o.name,".").concat(n.name,'" is deprecated. ').concat(i),r))}}}}});var TO=y(Im=>{"use strict";p();Object.defineProperty(Im,"__esModule",{value:!0});Im.NoSchemaIntrospectionCustomRule=kQ;var PQ=H(),DQ=ie(),LQ=Ut();function kQ(e){return{Field:function(r){var n=(0,DQ.getNamedType)(e.getType());n&&(0,LQ.isIntrospectionType)(n)&&e.reportError(new PQ.GraphQLError('GraphQL introspection has been disabled, but the requested query contained the field "'.concat(r.name.value,'".'),r))}}}});var wO=y(J=>{"use strict";p();Object.defineProperty(J,"__esModule",{value:!0});Object.defineProperty(J,"validate",{enumerable:!0,get:function(){return jQ.validate}});Object.defineProperty(J,"ValidationContext",{enumerable:!0,get:function(){return MQ.ValidationContext}});Object.defineProperty(J,"specifiedRules",{enumerable:!0,get:function(){return IO.specifiedRules}});Object.defineProperty(J,"recommendedRules",{enumerable:!0,get:function(){return IO.recommendedRules}});Object.defineProperty(J,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return FQ.ExecutableDefinitionsRule}});Object.defineProperty(J,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return qQ.FieldsOnCorrectTypeRule}});Object.defineProperty(J,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return UQ.FragmentsOnCompositeTypesRule}});Object.defineProperty(J,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return VQ.KnownArgumentNamesRule}});Object.defineProperty(J,"KnownDirectivesRule",{enumerable:!0,get:function(){return GQ.KnownDirectivesRule}});Object.defineProperty(J,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return $Q.KnownFragmentNamesRule}});Object.defineProperty(J,"KnownTypeNamesRule",{enumerable:!0,get:function(){return BQ.KnownTypeNamesRule}});Object.defineProperty(J,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return KQ.LoneAnonymousOperationRule}});Object.defineProperty(J,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return HQ.NoFragmentCyclesRule}});Object.defineProperty(J,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return QQ.NoUndefinedVariablesRule}});Object.defineProperty(J,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return WQ.NoUnusedFragmentsRule}});Object.defineProperty(J,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return zQ.NoUnusedVariablesRule}});Object.defineProperty(J,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return YQ.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(J,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return JQ.PossibleFragmentSpreadsRule}});Object.defineProperty(J,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return XQ.ProvidedRequiredArgumentsRule}});Object.defineProperty(J,"ScalarLeafsRule",{enumerable:!0,get:function(){return ZQ.ScalarLeafsRule}});Object.defineProperty(J,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return eW.SingleFieldSubscriptionsRule}});Object.defineProperty(J,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return tW.UniqueArgumentNamesRule}});Object.defineProperty(J,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return rW.UniqueDirectivesPerLocationRule}});Object.defineProperty(J,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return nW.UniqueFragmentNamesRule}});Object.defineProperty(J,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return iW.UniqueInputFieldNamesRule}});Object.defineProperty(J,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return oW.UniqueOperationNamesRule}});Object.defineProperty(J,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return sW.UniqueVariableNamesRule}});Object.defineProperty(J,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return aW.ValuesOfCorrectTypeRule}});Object.defineProperty(J,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return uW.VariablesAreInputTypesRule}});Object.defineProperty(J,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return cW.VariablesInAllowedPositionRule}});Object.defineProperty(J,"MaxIntrospectionDepthRule",{enumerable:!0,get:function(){return lW.MaxIntrospectionDepthRule}});Object.defineProperty(J,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return pW.LoneSchemaDefinitionRule}});Object.defineProperty(J,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return dW.UniqueOperationTypesRule}});Object.defineProperty(J,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return fW.UniqueTypeNamesRule}});Object.defineProperty(J,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return hW.UniqueEnumValueNamesRule}});Object.defineProperty(J,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return mW.UniqueFieldDefinitionNamesRule}});Object.defineProperty(J,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return gW.UniqueDirectiveNamesRule}});Object.defineProperty(J,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return yW.PossibleTypeExtensionsRule}});Object.defineProperty(J,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return vW.NoDeprecatedCustomRule}});Object.defineProperty(J,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return EW.NoSchemaIntrospectionCustomRule}});var jQ=Ui(),MQ=Zh(),IO=Jh(),FQ=Rf(),qQ=Qf(),UQ=Vf(),VQ=gh(),GQ=dh(),$Q=Jf(),BQ=qf(),KQ=Lf(),HQ=ih(),QQ=uh(),WQ=Zf(),zQ=lh(),YQ=Nh(),JQ=rh(),XQ=bh(),ZQ=Kf(),eW=jf(),tW=vh(),rW=mh(),nW=zf(),iW=Dh(),oW=Pf(),sW=sh(),aW=_h(),uW=$f(),cW=Ih(),lW=kh(),pW=Mh(),dW=qh(),fW=Vh(),hW=$h(),mW=Hh(),gW=Wh(),yW=Yh(),vW=Tm(),EW=TO()});var OO=y(wm=>{"use strict";p();Object.defineProperty(wm,"__esModule",{value:!0});Object.defineProperty(wm,"formatError",{enumerable:!0,get:function(){return _W.formatError}});var _W=H()});var xO=y(Qn=>{"use strict";p();Object.defineProperty(Qn,"__esModule",{value:!0});Object.defineProperty(Qn,"GraphQLError",{enumerable:!0,get:function(){return AO.GraphQLError}});Object.defineProperty(Qn,"printError",{enumerable:!0,get:function(){return AO.printError}});Object.defineProperty(Qn,"syntaxError",{enumerable:!0,get:function(){return SW.syntaxError}});Object.defineProperty(Qn,"locatedError",{enumerable:!0,get:function(){return bW.locatedError}});Object.defineProperty(Qn,"formatError",{enumerable:!0,get:function(){return TW.formatError}});var AO=H(),SW=mu(),bW=Jo(),TW=OO()});var Am=y(Om=>{"use strict";p();Object.defineProperty(Om,"__esModule",{value:!0});Om.getIntrospectionQuery=OW;function CO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function IW(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?CO(Object(r),!0).forEach(function(n){wW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):CO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OW(e){var t=IW({descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1},e),r=t.descriptions?"description":"",n=t.specifiedByUrl?"specifiedByUrl":"",i=t.directiveIsRepeatable?"isRepeatable":"",o=t.schemaDescription?r:"";function s(a){return t.inputValueDeprecation?a:""}return`
|
|
80
80
|
query IntrospectionQuery {
|
|
81
81
|
__schema {
|
|
82
82
|
`.concat(o,`
|
|
@@ -173,68 +173,68 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
`)}});var Cm=y(xm=>{"use strict";p();Object.defineProperty(xm,"__esModule",{value:!0});xm.getOperationAST=IW;var TW=_e();function IW(e,t){for(var r=null,n=0,i=e.definitions;n<i.length;n++){var o=i[n];if(o.kind===TW.Kind.OPERATION_DEFINITION){var s;if(t==null){if(r)return null;r=o}else if(((s=o.name)===null||s===void 0?void 0:s.value)===t)return o}}return r}});var RO=y(Rm=>{"use strict";p();Object.defineProperty(Rm,"__esModule",{value:!0});Rm.introspectionFromSchema=PW;var wW=CW(et()),OW=wi(),AW=xs(),xW=Am();function CW(e){return e&&e.__esModule?e:{default:e}}function CO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function RW(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?CO(Object(r),!0).forEach(function(n){NW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):CO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function NW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PW(e,t){var r=RW({specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0},t),n=(0,OW.parse)((0,xW.getIntrospectionQuery)(r)),i=(0,AW.executeSync)({schema:e,document:n});return!i.errors&&i.data||(0,wW.default)(0),i.data}});var PO=y(Nm=>{"use strict";p();Object.defineProperty(Nm,"__esModule",{value:!0});Nm.buildClientSchema=UW;var DW=Rs(St()),wt=Rs(ae()),LW=Rs(Mt()),Ac=Rs(Jo()),NO=Rs(ar()),kW=wi(),jW=Fn(),MW=gt(),FW=pr(),gr=Ut(),Ot=ie(),qW=_s();function Rs(e){return e&&e.__esModule?e:{default:e}}function UW(e,t){(0,NO.default)(e)&&(0,NO.default)(e.__schema)||(0,LW.default)(0,'Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: '.concat((0,wt.default)(e),"."));for(var r=e.__schema,n=(0,Ac.default)(r.types,function(I){return I.name},function(I){return v(I)}),i=0,o=[].concat(FW.specifiedScalarTypes,gr.introspectionTypes);i<o.length;i++){var s=o[i];n[s.name]&&(n[s.name]=s)}var a=r.queryType?h(r.queryType):null,u=r.mutationType?h(r.mutationType):null,c=r.subscriptionType?h(r.subscriptionType):null,l=r.directives?r.directives.map(ye):[];return new jW.GraphQLSchema({description:r.description,query:a,mutation:u,subscription:c,types:(0,DW.default)(n),directives:l,assumeValid:t?.assumeValid});function d(I){if(I.kind===gr.TypeKind.LIST){var ee=I.ofType;if(!ee)throw new Error("Decorated type deeper than introspection query.");return new Ot.GraphQLList(d(ee))}if(I.kind===gr.TypeKind.NON_NULL){var Ne=I.ofType;if(!Ne)throw new Error("Decorated type deeper than introspection query.");var bn=d(Ne);return new Ot.GraphQLNonNull((0,Ot.assertNullableType)(bn))}return f(I)}function f(I){var ee=I.name;if(!ee)throw new Error("Unknown type reference: ".concat((0,wt.default)(I),"."));var Ne=n[ee];if(!Ne)throw new Error("Invalid or incomplete schema, unknown type: ".concat(ee,". Ensure that a full introspection query is used in order to build a client schema."));return Ne}function h(I){return(0,Ot.assertObjectType)(f(I))}function g(I){return(0,Ot.assertInterfaceType)(f(I))}function v(I){if(I!=null&&I.name!=null&&I.kind!=null)switch(I.kind){case gr.TypeKind.SCALAR:return _(I);case gr.TypeKind.OBJECT:return b(I);case gr.TypeKind.INTERFACE:return A(I);case gr.TypeKind.UNION:return O(I);case gr.TypeKind.ENUM:return T(I);case gr.TypeKind.INPUT_OBJECT:return x(I)}var ee=(0,wt.default)(I);throw new Error("Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ".concat(ee,"."))}function _(I){return new Ot.GraphQLScalarType({name:I.name,description:I.description,specifiedByUrl:I.specifiedByUrl})}function S(I){if(I.interfaces===null&&I.kind===gr.TypeKind.INTERFACE)return[];if(!I.interfaces){var ee=(0,wt.default)(I);throw new Error("Introspection result missing interfaces: ".concat(ee,"."))}return I.interfaces.map(g)}function b(I){return new Ot.GraphQLObjectType({name:I.name,description:I.description,interfaces:function(){return S(I)},fields:function(){return U(I)}})}function A(I){return new Ot.GraphQLInterfaceType({name:I.name,description:I.description,interfaces:function(){return S(I)},fields:function(){return U(I)}})}function O(I){if(!I.possibleTypes){var ee=(0,wt.default)(I);throw new Error("Introspection result missing possibleTypes: ".concat(ee,"."))}return new Ot.GraphQLUnionType({name:I.name,description:I.description,types:function(){return I.possibleTypes.map(h)}})}function T(I){if(!I.enumValues){var ee=(0,wt.default)(I);throw new Error("Introspection result missing enumValues: ".concat(ee,"."))}return new Ot.GraphQLEnumType({name:I.name,description:I.description,values:(0,Ac.default)(I.enumValues,function(Ne){return Ne.name},function(Ne){return{description:Ne.description,deprecationReason:Ne.deprecationReason}})})}function x(I){if(!I.inputFields){var ee=(0,wt.default)(I);throw new Error("Introspection result missing inputFields: ".concat(ee,"."))}return new Ot.GraphQLInputObjectType({name:I.name,description:I.description,fields:function(){return te(I.inputFields)}})}function U(I){if(!I.fields)throw new Error("Introspection result missing fields: ".concat((0,wt.default)(I),"."));return(0,Ac.default)(I.fields,function(ee){return ee.name},C)}function C(I){var ee=d(I.type);if(!(0,Ot.isOutputType)(ee)){var Ne=(0,wt.default)(ee);throw new Error("Introspection must provide output type for fields, but received: ".concat(Ne,"."))}if(!I.args){var bn=(0,wt.default)(I);throw new Error("Introspection result missing field args: ".concat(bn,"."))}return{description:I.description,deprecationReason:I.deprecationReason,type:ee,args:te(I.args)}}function te(I){return(0,Ac.default)(I,function(ee){return ee.name},de)}function de(I){var ee=d(I.type);if(!(0,Ot.isInputType)(ee)){var Ne=(0,wt.default)(ee);throw new Error("Introspection must provide input type for arguments, but received: ".concat(Ne,"."))}var bn=I.defaultValue!=null?(0,qW.valueFromAST)((0,kW.parseValue)(I.defaultValue),ee):void 0;return{description:I.description,type:ee,defaultValue:bn,deprecationReason:I.deprecationReason}}function ye(I){if(!I.args){var ee=(0,wt.default)(I);throw new Error("Introspection result missing directive args: ".concat(ee,"."))}if(!I.locations){var Ne=(0,wt.default)(I);throw new Error("Introspection result missing directive locations: ".concat(Ne,"."))}return new MW.GraphQLDirective({name:I.name,description:I.description,isRepeatable:I.isRepeatable,locations:I.locations.slice(),args:te(I.args)})}}});var Pm=y(Ps=>{"use strict";p();Object.defineProperty(Ps,"__esModule",{value:!0});Ps.extendSchema=WW;Ps.extendSchemaImpl=BO;Ps.getDescription=Wn;var VW=Qi(St()),GW=Qi(Qr()),DO=Qi(ae()),Ns=Qi(kd()),LO=Qi(et()),$W=Qi(Mt()),Gt=_e(),BW=Si(),KW=Ii(),kO=Un(),HW=Ui(),VO=Is(),jO=Fn(),GO=pr(),$O=Ut(),Cc=gt(),Ce=ie(),MO=_s();function Qi(e){return e&&e.__esModule?e:{default:e}}function FO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ce(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?FO(Object(r),!0).forEach(function(n){QW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):FO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function QW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WW(e,t,r){(0,jO.assertSchema)(e),t!=null&&t.kind===Gt.Kind.DOCUMENT||(0,$W.default)(0,"Must provide valid Document AST."),r?.assumeValid!==!0&&r?.assumeValidSDL!==!0&&(0,HW.assertValidSDLExtension)(t,e);var n=e.toConfig(),i=BO(n,t,r);return n===i?e:new jO.GraphQLSchema(i)}function BO(e,t,r){for(var n,i,o,s,a=[],u=Object.create(null),c=[],l,d=[],f=0,h=t.definitions;f<h.length;f++){var g=h[f];if(g.kind===Gt.Kind.SCHEMA_DEFINITION)l=g;else if(g.kind===Gt.Kind.SCHEMA_EXTENSION)d.push(g);else if((0,kO.isTypeDefinitionNode)(g))a.push(g);else if((0,kO.isTypeExtensionNode)(g)){var v=g.name.value,_=u[v];u[v]=_?_.concat([g]):[g]}else g.kind===Gt.Kind.DIRECTIVE_DEFINITION&&c.push(g)}if(Object.keys(u).length===0&&a.length===0&&c.length===0&&d.length===0&&l==null)return e;for(var S=Object.create(null),b=0,A=e.types;b<A.length;b++){var O=A[b];S[O.name]=ee(O)}for(var T=0;T<a.length;T++){var x,U=a[T],C=U.name.value;S[C]=(x=qO[C])!==null&&x!==void 0?x:SD(U)}var te=ce(ce({query:e.query&&ye(e.query),mutation:e.mutation&&ye(e.mutation),subscription:e.subscription&&ye(e.subscription)},l&&fv([l])),fv(d));return ce(ce({description:(n=l)===null||n===void 0||(i=n.description)===null||i===void 0?void 0:i.value},te),{},{types:(0,VW.default)(S),directives:[].concat(e.directives.map(I),c.map(bD)),extensions:void 0,astNode:(o=l)!==null&&o!==void 0?o:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(d),assumeValid:(s=r?.assumeValid)!==null&&s!==void 0?s:!1});function de(w){return(0,Ce.isListType)(w)?new Ce.GraphQLList(de(w.ofType)):(0,Ce.isNonNullType)(w)?new Ce.GraphQLNonNull(de(w.ofType)):ye(w)}function ye(w){return S[w.name]}function I(w){var G=w.toConfig();return new Cc.GraphQLDirective(ce(ce({},G),{},{args:(0,Ns.default)(G.args,dv)}))}function ee(w){if((0,$O.isIntrospectionType)(w)||(0,GO.isSpecifiedScalarType)(w))return w;if((0,Ce.isScalarType)(w))return yD(w);if((0,Ce.isObjectType)(w))return vD(w);if((0,Ce.isInterfaceType)(w))return ED(w);if((0,Ce.isUnionType)(w))return _D(w);if((0,Ce.isEnumType)(w))return bn(w);if((0,Ce.isInputObjectType)(w))return Ne(w);(0,LO.default)(0,"Unexpected type: "+(0,DO.default)(w))}function Ne(w){var G,L=w.toConfig(),V=(G=u[L.name])!==null&&G!==void 0?G:[];return new Ce.GraphQLInputObjectType(ce(ce({},L),{},{fields:function(){return ce(ce({},(0,Ns.default)(L.fields,function(he){return ce(ce({},he),{},{type:de(he.type)})})),mv(V))},extensionASTNodes:L.extensionASTNodes.concat(V)}))}function bn(w){var G,L=w.toConfig(),V=(G=u[w.name])!==null&&G!==void 0?G:[];return new Ce.GraphQLEnumType(ce(ce({},L),{},{values:ce(ce({},L.values),gv(V)),extensionASTNodes:L.extensionASTNodes.concat(V)}))}function yD(w){for(var G,L=w.toConfig(),V=(G=u[L.name])!==null&&G!==void 0?G:[],re=L.specifiedByUrl,he=0;he<V.length;he++){var me,ge=V[he];re=(me=UO(ge))!==null&&me!==void 0?me:re}return new Ce.GraphQLScalarType(ce(ce({},L),{},{specifiedByUrl:re,extensionASTNodes:L.extensionASTNodes.concat(V)}))}function vD(w){var G,L=w.toConfig(),V=(G=u[L.name])!==null&&G!==void 0?G:[];return new Ce.GraphQLObjectType(ce(ce({},L),{},{interfaces:function(){return[].concat(w.getInterfaces().map(ye),wa(V))},fields:function(){return ce(ce({},(0,Ns.default)(L.fields,pv)),Ia(V))},extensionASTNodes:L.extensionASTNodes.concat(V)}))}function ED(w){var G,L=w.toConfig(),V=(G=u[L.name])!==null&&G!==void 0?G:[];return new Ce.GraphQLInterfaceType(ce(ce({},L),{},{interfaces:function(){return[].concat(w.getInterfaces().map(ye),wa(V))},fields:function(){return ce(ce({},(0,Ns.default)(L.fields,pv)),Ia(V))},extensionASTNodes:L.extensionASTNodes.concat(V)}))}function _D(w){var G,L=w.toConfig(),V=(G=u[L.name])!==null&&G!==void 0?G:[];return new Ce.GraphQLUnionType(ce(ce({},L),{},{types:function(){return[].concat(w.getTypes().map(ye),yv(V))},extensionASTNodes:L.extensionASTNodes.concat(V)}))}function pv(w){return ce(ce({},w),{},{type:de(w.type),args:(0,Ns.default)(w.args,dv)})}function dv(w){return ce(ce({},w),{},{type:de(w.type)})}function fv(w){for(var G={},L=0;L<w.length;L++)for(var V,re=w[L],he=(V=re.operationTypes)!==null&&V!==void 0?V:[],me=0;me<he.length;me++){var ge=he[me];G[ge.operation]=Ta(ge.type)}return G}function Ta(w){var G,L=w.name.value,V=(G=qO[L])!==null&&G!==void 0?G:S[L];if(V===void 0)throw new Error('Unknown type: "'.concat(L,'".'));return V}function Oo(w){return w.kind===Gt.Kind.LIST_TYPE?new Ce.GraphQLList(Oo(w.type)):w.kind===Gt.Kind.NON_NULL_TYPE?new Ce.GraphQLNonNull(Oo(w.type)):Ta(w)}function bD(w){var G=w.locations.map(function(L){var V=L.value;return V});return new Cc.GraphQLDirective({name:w.name.value,description:Wn(w,r),locations:G,isRepeatable:w.repeatable,args:hv(w.arguments),astNode:w})}function Ia(w){for(var G=Object.create(null),L=0;L<w.length;L++)for(var V,re=w[L],he=(V=re.fields)!==null&&V!==void 0?V:[],me=0;me<he.length;me++){var ge=he[me];G[ge.name.value]={type:Oo(ge.type),description:Wn(ge,r),args:hv(ge.arguments),deprecationReason:xc(ge),astNode:ge}}return G}function hv(w){for(var G=w??[],L=Object.create(null),V=0;V<G.length;V++){var re=G[V],he=Oo(re.type);L[re.name.value]={type:he,description:Wn(re,r),defaultValue:(0,MO.valueFromAST)(re.defaultValue,he),deprecationReason:xc(re),astNode:re}}return L}function mv(w){for(var G=Object.create(null),L=0;L<w.length;L++)for(var V,re=w[L],he=(V=re.fields)!==null&&V!==void 0?V:[],me=0;me<he.length;me++){var ge=he[me],Ao=Oo(ge.type);G[ge.name.value]={type:Ao,description:Wn(ge,r),defaultValue:(0,MO.valueFromAST)(ge.defaultValue,Ao),deprecationReason:xc(ge),astNode:ge}}return G}function gv(w){for(var G=Object.create(null),L=0;L<w.length;L++)for(var V,re=w[L],he=(V=re.values)!==null&&V!==void 0?V:[],me=0;me<he.length;me++){var ge=he[me];G[ge.name.value]={description:Wn(ge,r),deprecationReason:xc(ge),astNode:ge}}return G}function wa(w){for(var G=[],L=0;L<w.length;L++)for(var V,re=w[L],he=(V=re.interfaces)!==null&&V!==void 0?V:[],me=0;me<he.length;me++){var ge=he[me];G.push(Ta(ge))}return G}function yv(w){for(var G=[],L=0;L<w.length;L++)for(var V,re=w[L],he=(V=re.types)!==null&&V!==void 0?V:[],me=0;me<he.length;me++){var ge=he[me];G.push(Ta(ge))}return G}function SD(w){var G,L=w.name.value,V=Wn(w,r),re=(G=u[L])!==null&&G!==void 0?G:[];switch(w.kind){case Gt.Kind.OBJECT_TYPE_DEFINITION:{var he=re,me=[w].concat(he);return new Ce.GraphQLObjectType({name:L,description:V,interfaces:function(){return wa(me)},fields:function(){return Ia(me)},astNode:w,extensionASTNodes:he})}case Gt.Kind.INTERFACE_TYPE_DEFINITION:{var ge=re,Ao=[w].concat(ge);return new Ce.GraphQLInterfaceType({name:L,description:V,interfaces:function(){return wa(Ao)},fields:function(){return Ia(Ao)},astNode:w,extensionASTNodes:ge})}case Gt.Kind.ENUM_TYPE_DEFINITION:{var vv=re,TD=[w].concat(vv);return new Ce.GraphQLEnumType({name:L,description:V,values:gv(TD),astNode:w,extensionASTNodes:vv})}case Gt.Kind.UNION_TYPE_DEFINITION:{var Ev=re,ID=[w].concat(Ev);return new Ce.GraphQLUnionType({name:L,description:V,types:function(){return yv(ID)},astNode:w,extensionASTNodes:Ev})}case Gt.Kind.SCALAR_TYPE_DEFINITION:{var wD=re;return new Ce.GraphQLScalarType({name:L,description:V,specifiedByUrl:UO(w),astNode:w,extensionASTNodes:wD})}case Gt.Kind.INPUT_OBJECT_TYPE_DEFINITION:{var _v=re,OD=[w].concat(_v);return new Ce.GraphQLInputObjectType({name:L,description:V,fields:function(){return mv(OD)},astNode:w,extensionASTNodes:_v})}}(0,LO.default)(0,"Unexpected type definition node: "+(0,DO.default)(w))}}var qO=(0,GW.default)(GO.specifiedScalarTypes.concat($O.introspectionTypes),function(e){return e.name});function xc(e){var t=(0,VO.getDirectiveValues)(Cc.GraphQLDeprecatedDirective,e);return t?.reason}function UO(e){var t=(0,VO.getDirectiveValues)(Cc.GraphQLSpecifiedByDirective,e);return t?.url}function Wn(e,t){if(e.description)return e.description.value;if(t?.commentDescriptions===!0){var r=zW(e);if(r!==void 0)return(0,KW.dedentBlockStringValue)(`
|
|
177
|
-
`+r)}}function
|
|
178
|
-
`):void 0}}});var
|
|
176
|
+
`)}});var Cm=y(xm=>{"use strict";p();Object.defineProperty(xm,"__esModule",{value:!0});xm.getOperationAST=xW;var AW=_e();function xW(e,t){for(var r=null,n=0,i=e.definitions;n<i.length;n++){var o=i[n];if(o.kind===AW.Kind.OPERATION_DEFINITION){var s;if(t==null){if(r)return null;r=o}else if(((s=o.name)===null||s===void 0?void 0:s.value)===t)return o}}return r}});var NO=y(Rm=>{"use strict";p();Object.defineProperty(Rm,"__esModule",{value:!0});Rm.introspectionFromSchema=jW;var CW=DW(et()),RW=wi(),NW=Cs(),PW=Am();function DW(e){return e&&e.__esModule?e:{default:e}}function RO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function LW(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?RO(Object(r),!0).forEach(function(n){kW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):RO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jW(e,t){var r=LW({specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0},t),n=(0,RW.parse)((0,PW.getIntrospectionQuery)(r)),i=(0,NW.executeSync)({schema:e,document:n});return!i.errors&&i.data||(0,CW.default)(0),i.data}});var DO=y(Nm=>{"use strict";p();Object.defineProperty(Nm,"__esModule",{value:!0});Nm.buildClientSchema=BW;var MW=Ns(Tt()),Ot=Ns(ae()),FW=Ns(Mt()),Ac=Ns(Xo()),PO=Ns(ar()),qW=wi(),UW=Fn(),VW=gt(),GW=pr(),gr=Ut(),At=ie(),$W=Ss();function Ns(e){return e&&e.__esModule?e:{default:e}}function BW(e,t){(0,PO.default)(e)&&(0,PO.default)(e.__schema)||(0,FW.default)(0,'Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: '.concat((0,Ot.default)(e),"."));for(var r=e.__schema,n=(0,Ac.default)(r.types,function(w){return w.name},function(w){return v(w)}),i=0,o=[].concat(GW.specifiedScalarTypes,gr.introspectionTypes);i<o.length;i++){var s=o[i];n[s.name]&&(n[s.name]=s)}var a=r.queryType?h(r.queryType):null,u=r.mutationType?h(r.mutationType):null,c=r.subscriptionType?h(r.subscriptionType):null,l=r.directives?r.directives.map(ye):[];return new UW.GraphQLSchema({description:r.description,query:a,mutation:u,subscription:c,types:(0,MW.default)(n),directives:l,assumeValid:t?.assumeValid});function d(w){if(w.kind===gr.TypeKind.LIST){var ee=w.ofType;if(!ee)throw new Error("Decorated type deeper than introspection query.");return new At.GraphQLList(d(ee))}if(w.kind===gr.TypeKind.NON_NULL){var Ne=w.ofType;if(!Ne)throw new Error("Decorated type deeper than introspection query.");var Sn=d(Ne);return new At.GraphQLNonNull((0,At.assertNullableType)(Sn))}return f(w)}function f(w){var ee=w.name;if(!ee)throw new Error("Unknown type reference: ".concat((0,Ot.default)(w),"."));var Ne=n[ee];if(!Ne)throw new Error("Invalid or incomplete schema, unknown type: ".concat(ee,". Ensure that a full introspection query is used in order to build a client schema."));return Ne}function h(w){return(0,At.assertObjectType)(f(w))}function g(w){return(0,At.assertInterfaceType)(f(w))}function v(w){if(w!=null&&w.name!=null&&w.kind!=null)switch(w.kind){case gr.TypeKind.SCALAR:return _(w);case gr.TypeKind.OBJECT:return S(w);case gr.TypeKind.INTERFACE:return I(w);case gr.TypeKind.UNION:return A(w);case gr.TypeKind.ENUM:return T(w);case gr.TypeKind.INPUT_OBJECT:return x(w)}var ee=(0,Ot.default)(w);throw new Error("Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ".concat(ee,"."))}function _(w){return new At.GraphQLScalarType({name:w.name,description:w.description,specifiedByUrl:w.specifiedByUrl})}function b(w){if(w.interfaces===null&&w.kind===gr.TypeKind.INTERFACE)return[];if(!w.interfaces){var ee=(0,Ot.default)(w);throw new Error("Introspection result missing interfaces: ".concat(ee,"."))}return w.interfaces.map(g)}function S(w){return new At.GraphQLObjectType({name:w.name,description:w.description,interfaces:function(){return b(w)},fields:function(){return U(w)}})}function I(w){return new At.GraphQLInterfaceType({name:w.name,description:w.description,interfaces:function(){return b(w)},fields:function(){return U(w)}})}function A(w){if(!w.possibleTypes){var ee=(0,Ot.default)(w);throw new Error("Introspection result missing possibleTypes: ".concat(ee,"."))}return new At.GraphQLUnionType({name:w.name,description:w.description,types:function(){return w.possibleTypes.map(h)}})}function T(w){if(!w.enumValues){var ee=(0,Ot.default)(w);throw new Error("Introspection result missing enumValues: ".concat(ee,"."))}return new At.GraphQLEnumType({name:w.name,description:w.description,values:(0,Ac.default)(w.enumValues,function(Ne){return Ne.name},function(Ne){return{description:Ne.description,deprecationReason:Ne.deprecationReason}})})}function x(w){if(!w.inputFields){var ee=(0,Ot.default)(w);throw new Error("Introspection result missing inputFields: ".concat(ee,"."))}return new At.GraphQLInputObjectType({name:w.name,description:w.description,fields:function(){return te(w.inputFields)}})}function U(w){if(!w.fields)throw new Error("Introspection result missing fields: ".concat((0,Ot.default)(w),"."));return(0,Ac.default)(w.fields,function(ee){return ee.name},C)}function C(w){var ee=d(w.type);if(!(0,At.isOutputType)(ee)){var Ne=(0,Ot.default)(ee);throw new Error("Introspection must provide output type for fields, but received: ".concat(Ne,"."))}if(!w.args){var Sn=(0,Ot.default)(w);throw new Error("Introspection result missing field args: ".concat(Sn,"."))}return{description:w.description,deprecationReason:w.deprecationReason,type:ee,args:te(w.args)}}function te(w){return(0,Ac.default)(w,function(ee){return ee.name},de)}function de(w){var ee=d(w.type);if(!(0,At.isInputType)(ee)){var Ne=(0,Ot.default)(ee);throw new Error("Introspection must provide input type for arguments, but received: ".concat(Ne,"."))}var Sn=w.defaultValue!=null?(0,$W.valueFromAST)((0,qW.parseValue)(w.defaultValue),ee):void 0;return{description:w.description,type:ee,defaultValue:Sn,deprecationReason:w.deprecationReason}}function ye(w){if(!w.args){var ee=(0,Ot.default)(w);throw new Error("Introspection result missing directive args: ".concat(ee,"."))}if(!w.locations){var Ne=(0,Ot.default)(w);throw new Error("Introspection result missing directive locations: ".concat(Ne,"."))}return new VW.GraphQLDirective({name:w.name,description:w.description,isRepeatable:w.isRepeatable,locations:w.locations.slice(),args:te(w.args)})}}});var Pm=y(Ds=>{"use strict";p();Object.defineProperty(Ds,"__esModule",{value:!0});Ds.extendSchema=XW;Ds.extendSchemaImpl=KO;Ds.getDescription=Wn;var KW=Qi(Tt()),HW=Qi(Qr()),LO=Qi(ae()),Ps=Qi(kd()),kO=Qi(et()),QW=Qi(Mt()),Gt=_e(),WW=bi(),zW=Ii(),jO=Un(),YW=Ui(),GO=ws(),MO=Fn(),$O=pr(),BO=Ut(),Cc=gt(),Ce=ie(),FO=Ss();function Qi(e){return e&&e.__esModule?e:{default:e}}function qO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ce(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qO(Object(r),!0).forEach(function(n){JW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function JW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XW(e,t,r){(0,MO.assertSchema)(e),t!=null&&t.kind===Gt.Kind.DOCUMENT||(0,QW.default)(0,"Must provide valid Document AST."),r?.assumeValid!==!0&&r?.assumeValidSDL!==!0&&(0,YW.assertValidSDLExtension)(t,e);var n=e.toConfig(),i=KO(n,t,r);return n===i?e:new MO.GraphQLSchema(i)}function KO(e,t,r){for(var n,i,o,s,a=[],u=Object.create(null),c=[],l,d=[],f=0,h=t.definitions;f<h.length;f++){var g=h[f];if(g.kind===Gt.Kind.SCHEMA_DEFINITION)l=g;else if(g.kind===Gt.Kind.SCHEMA_EXTENSION)d.push(g);else if((0,jO.isTypeDefinitionNode)(g))a.push(g);else if((0,jO.isTypeExtensionNode)(g)){var v=g.name.value,_=u[v];u[v]=_?_.concat([g]):[g]}else g.kind===Gt.Kind.DIRECTIVE_DEFINITION&&c.push(g)}if(Object.keys(u).length===0&&a.length===0&&c.length===0&&d.length===0&&l==null)return e;for(var b=Object.create(null),S=0,I=e.types;S<I.length;S++){var A=I[S];b[A.name]=ee(A)}for(var T=0;T<a.length;T++){var x,U=a[T],C=U.name.value;b[C]=(x=UO[C])!==null&&x!==void 0?x:OD(U)}var te=ce(ce({query:e.query&&ye(e.query),mutation:e.mutation&&ye(e.mutation),subscription:e.subscription&&ye(e.subscription)},l&&hv([l])),hv(d));return ce(ce({description:(n=l)===null||n===void 0||(i=n.description)===null||i===void 0?void 0:i.value},te),{},{types:(0,KW.default)(b),directives:[].concat(e.directives.map(w),c.map(wD)),extensions:void 0,astNode:(o=l)!==null&&o!==void 0?o:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(d),assumeValid:(s=r?.assumeValid)!==null&&s!==void 0?s:!1});function de(O){return(0,Ce.isListType)(O)?new Ce.GraphQLList(de(O.ofType)):(0,Ce.isNonNullType)(O)?new Ce.GraphQLNonNull(de(O.ofType)):ye(O)}function ye(O){return b[O.name]}function w(O){var $=O.toConfig();return new Cc.GraphQLDirective(ce(ce({},$),{},{args:(0,Ps.default)($.args,fv)}))}function ee(O){if((0,BO.isIntrospectionType)(O)||(0,$O.isSpecifiedScalarType)(O))return O;if((0,Ce.isScalarType)(O))return SD(O);if((0,Ce.isObjectType)(O))return bD(O);if((0,Ce.isInterfaceType)(O))return TD(O);if((0,Ce.isUnionType)(O))return ID(O);if((0,Ce.isEnumType)(O))return Sn(O);if((0,Ce.isInputObjectType)(O))return Ne(O);(0,kO.default)(0,"Unexpected type: "+(0,LO.default)(O))}function Ne(O){var $,L=O.toConfig(),V=($=u[L.name])!==null&&$!==void 0?$:[];return new Ce.GraphQLInputObjectType(ce(ce({},L),{},{fields:function(){return ce(ce({},(0,Ps.default)(L.fields,function(he){return ce(ce({},he),{},{type:de(he.type)})})),gv(V))},extensionASTNodes:L.extensionASTNodes.concat(V)}))}function Sn(O){var $,L=O.toConfig(),V=($=u[O.name])!==null&&$!==void 0?$:[];return new Ce.GraphQLEnumType(ce(ce({},L),{},{values:ce(ce({},L.values),yv(V)),extensionASTNodes:L.extensionASTNodes.concat(V)}))}function SD(O){for(var $,L=O.toConfig(),V=($=u[L.name])!==null&&$!==void 0?$:[],re=L.specifiedByUrl,he=0;he<V.length;he++){var me,ge=V[he];re=(me=VO(ge))!==null&&me!==void 0?me:re}return new Ce.GraphQLScalarType(ce(ce({},L),{},{specifiedByUrl:re,extensionASTNodes:L.extensionASTNodes.concat(V)}))}function bD(O){var $,L=O.toConfig(),V=($=u[L.name])!==null&&$!==void 0?$:[];return new Ce.GraphQLObjectType(ce(ce({},L),{},{interfaces:function(){return[].concat(O.getInterfaces().map(ye),wa(V))},fields:function(){return ce(ce({},(0,Ps.default)(L.fields,dv)),Ia(V))},extensionASTNodes:L.extensionASTNodes.concat(V)}))}function TD(O){var $,L=O.toConfig(),V=($=u[L.name])!==null&&$!==void 0?$:[];return new Ce.GraphQLInterfaceType(ce(ce({},L),{},{interfaces:function(){return[].concat(O.getInterfaces().map(ye),wa(V))},fields:function(){return ce(ce({},(0,Ps.default)(L.fields,dv)),Ia(V))},extensionASTNodes:L.extensionASTNodes.concat(V)}))}function ID(O){var $,L=O.toConfig(),V=($=u[L.name])!==null&&$!==void 0?$:[];return new Ce.GraphQLUnionType(ce(ce({},L),{},{types:function(){return[].concat(O.getTypes().map(ye),vv(V))},extensionASTNodes:L.extensionASTNodes.concat(V)}))}function dv(O){return ce(ce({},O),{},{type:de(O.type),args:(0,Ps.default)(O.args,fv)})}function fv(O){return ce(ce({},O),{},{type:de(O.type)})}function hv(O){for(var $={},L=0;L<O.length;L++)for(var V,re=O[L],he=(V=re.operationTypes)!==null&&V!==void 0?V:[],me=0;me<he.length;me++){var ge=he[me];$[ge.operation]=Ta(ge.type)}return $}function Ta(O){var $,L=O.name.value,V=($=UO[L])!==null&&$!==void 0?$:b[L];if(V===void 0)throw new Error('Unknown type: "'.concat(L,'".'));return V}function Ao(O){return O.kind===Gt.Kind.LIST_TYPE?new Ce.GraphQLList(Ao(O.type)):O.kind===Gt.Kind.NON_NULL_TYPE?new Ce.GraphQLNonNull(Ao(O.type)):Ta(O)}function wD(O){var $=O.locations.map(function(L){var V=L.value;return V});return new Cc.GraphQLDirective({name:O.name.value,description:Wn(O,r),locations:$,isRepeatable:O.repeatable,args:mv(O.arguments),astNode:O})}function Ia(O){for(var $=Object.create(null),L=0;L<O.length;L++)for(var V,re=O[L],he=(V=re.fields)!==null&&V!==void 0?V:[],me=0;me<he.length;me++){var ge=he[me];$[ge.name.value]={type:Ao(ge.type),description:Wn(ge,r),args:mv(ge.arguments),deprecationReason:xc(ge),astNode:ge}}return $}function mv(O){for(var $=O??[],L=Object.create(null),V=0;V<$.length;V++){var re=$[V],he=Ao(re.type);L[re.name.value]={type:he,description:Wn(re,r),defaultValue:(0,FO.valueFromAST)(re.defaultValue,he),deprecationReason:xc(re),astNode:re}}return L}function gv(O){for(var $=Object.create(null),L=0;L<O.length;L++)for(var V,re=O[L],he=(V=re.fields)!==null&&V!==void 0?V:[],me=0;me<he.length;me++){var ge=he[me],xo=Ao(ge.type);$[ge.name.value]={type:xo,description:Wn(ge,r),defaultValue:(0,FO.valueFromAST)(ge.defaultValue,xo),deprecationReason:xc(ge),astNode:ge}}return $}function yv(O){for(var $=Object.create(null),L=0;L<O.length;L++)for(var V,re=O[L],he=(V=re.values)!==null&&V!==void 0?V:[],me=0;me<he.length;me++){var ge=he[me];$[ge.name.value]={description:Wn(ge,r),deprecationReason:xc(ge),astNode:ge}}return $}function wa(O){for(var $=[],L=0;L<O.length;L++)for(var V,re=O[L],he=(V=re.interfaces)!==null&&V!==void 0?V:[],me=0;me<he.length;me++){var ge=he[me];$.push(Ta(ge))}return $}function vv(O){for(var $=[],L=0;L<O.length;L++)for(var V,re=O[L],he=(V=re.types)!==null&&V!==void 0?V:[],me=0;me<he.length;me++){var ge=he[me];$.push(Ta(ge))}return $}function OD(O){var $,L=O.name.value,V=Wn(O,r),re=($=u[L])!==null&&$!==void 0?$:[];switch(O.kind){case Gt.Kind.OBJECT_TYPE_DEFINITION:{var he=re,me=[O].concat(he);return new Ce.GraphQLObjectType({name:L,description:V,interfaces:function(){return wa(me)},fields:function(){return Ia(me)},astNode:O,extensionASTNodes:he})}case Gt.Kind.INTERFACE_TYPE_DEFINITION:{var ge=re,xo=[O].concat(ge);return new Ce.GraphQLInterfaceType({name:L,description:V,interfaces:function(){return wa(xo)},fields:function(){return Ia(xo)},astNode:O,extensionASTNodes:ge})}case Gt.Kind.ENUM_TYPE_DEFINITION:{var Ev=re,AD=[O].concat(Ev);return new Ce.GraphQLEnumType({name:L,description:V,values:yv(AD),astNode:O,extensionASTNodes:Ev})}case Gt.Kind.UNION_TYPE_DEFINITION:{var _v=re,xD=[O].concat(_v);return new Ce.GraphQLUnionType({name:L,description:V,types:function(){return vv(xD)},astNode:O,extensionASTNodes:_v})}case Gt.Kind.SCALAR_TYPE_DEFINITION:{var CD=re;return new Ce.GraphQLScalarType({name:L,description:V,specifiedByUrl:VO(O),astNode:O,extensionASTNodes:CD})}case Gt.Kind.INPUT_OBJECT_TYPE_DEFINITION:{var Sv=re,RD=[O].concat(Sv);return new Ce.GraphQLInputObjectType({name:L,description:V,fields:function(){return gv(RD)},astNode:O,extensionASTNodes:Sv})}}(0,kO.default)(0,"Unexpected type definition node: "+(0,LO.default)(O))}}var UO=(0,HW.default)($O.specifiedScalarTypes.concat(BO.introspectionTypes),function(e){return e.name});function xc(e){var t=(0,GO.getDirectiveValues)(Cc.GraphQLDeprecatedDirective,e);return t?.reason}function VO(e){var t=(0,GO.getDirectiveValues)(Cc.GraphQLSpecifiedByDirective,e);return t?.url}function Wn(e,t){if(e.description)return e.description.value;if(t?.commentDescriptions===!0){var r=ZW(e);if(r!==void 0)return(0,zW.dedentBlockStringValue)(`
|
|
177
|
+
`+r)}}function ZW(e){var t=e.loc;if(t){for(var r=[],n=t.startToken.prev;n!=null&&n.kind===WW.TokenKind.COMMENT&&n.next&&n.prev&&n.line+1===n.next.line&&n.line!==n.prev.line;){var i=String(n.value);r.push(i),n=n.prev}return r.length>0?r.reverse().join(`
|
|
178
|
+
`):void 0}}});var WO=y(Rc=>{"use strict";p();Object.defineProperty(Rc,"__esModule",{value:!0});Rc.buildASTSchema=QO;Rc.buildSchema=az;var ez=sz(Mt()),tz=_e(),rz=wi(),nz=Ui(),iz=Fn(),HO=gt(),oz=Pm();function sz(e){return e&&e.__esModule?e:{default:e}}function QO(e,t){e!=null&&e.kind===tz.Kind.DOCUMENT||(0,ez.default)(0,"Must provide valid Document AST."),t?.assumeValid!==!0&&t?.assumeValidSDL!==!0&&(0,nz.assertValidSDL)(e);var r={description:void 0,types:[],directives:[],extensions:void 0,extensionASTNodes:[],assumeValid:!1},n=(0,oz.extendSchemaImpl)(r,e,t);if(n.astNode==null)for(var i=0,o=n.types;i<o.length;i++){var s=o[i];switch(s.name){case"Query":n.query=s;break;case"Mutation":n.mutation=s;break;case"Subscription":n.subscription=s;break}}for(var a=n.directives,u=function(d){var f=HO.specifiedDirectives[d];a.every(function(h){return h.name!==f.name})&&a.push(f)},c=0;c<HO.specifiedDirectives.length;c++)u(c);return new iz.GraphQLSchema(n)}function az(e,t){var r=(0,rz.parse)(e,{noLocation:t?.noLocation,allowLegacySDLEmptyFields:t?.allowLegacySDLEmptyFields,allowLegacySDLImplementsInterfaces:t?.allowLegacySDLImplementsInterfaces,experimentalFragmentVariables:t?.experimentalFragmentVariables});return QO(r,{commentDescriptions:t?.commentDescriptions,assumeValidSDL:t?.assumeValidSDL,assumeValid:t?.assumeValid})}});var YO=y(km=>{"use strict";p();Object.defineProperty(km,"__esModule",{value:!0});km.lexicographicSortSchema=yz;var uz=Ls(Tt()),cz=Ls(ae()),lz=Ls(et()),pz=Ls(Xo()),dz=Ls(Zo()),fz=Fn(),hz=gt(),mz=Ut(),pt=ie();function Ls(e){return e&&e.__esModule?e:{default:e}}function zO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ve(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zO(Object(r),!0).forEach(function(n){gz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yz(e){var t=e.toConfig(),r=(0,pz.default)(Dm(t.types),function(f){return f.name},d);return new fz.GraphQLSchema(Ve(Ve({},t),{},{types:(0,uz.default)(r),directives:Dm(t.directives).map(s),query:o(t.query),mutation:o(t.mutation),subscription:o(t.subscription)}));function n(f){return(0,pt.isListType)(f)?new pt.GraphQLList(n(f.ofType)):(0,pt.isNonNullType)(f)?new pt.GraphQLNonNull(n(f.ofType)):i(f)}function i(f){return r[f.name]}function o(f){return f&&i(f)}function s(f){var h=f.toConfig();return new hz.GraphQLDirective(Ve(Ve({},h),{},{locations:Lm(h.locations,function(g){return g}),args:a(h.args)}))}function a(f){return Nc(f,function(h){return Ve(Ve({},h),{},{type:n(h.type)})})}function u(f){return Nc(f,function(h){return Ve(Ve({},h),{},{type:n(h.type),args:a(h.args)})})}function c(f){return Nc(f,function(h){return Ve(Ve({},h),{},{type:n(h.type)})})}function l(f){return Dm(f).map(i)}function d(f){if((0,pt.isScalarType)(f)||(0,mz.isIntrospectionType)(f))return f;if((0,pt.isObjectType)(f)){var h=f.toConfig();return new pt.GraphQLObjectType(Ve(Ve({},h),{},{interfaces:function(){return l(h.interfaces)},fields:function(){return u(h.fields)}}))}if((0,pt.isInterfaceType)(f)){var g=f.toConfig();return new pt.GraphQLInterfaceType(Ve(Ve({},g),{},{interfaces:function(){return l(g.interfaces)},fields:function(){return u(g.fields)}}))}if((0,pt.isUnionType)(f)){var v=f.toConfig();return new pt.GraphQLUnionType(Ve(Ve({},v),{},{types:function(){return l(v.types)}}))}if((0,pt.isEnumType)(f)){var _=f.toConfig();return new pt.GraphQLEnumType(Ve(Ve({},_),{},{values:Nc(_.values)}))}if((0,pt.isInputObjectType)(f)){var b=f.toConfig();return new pt.GraphQLInputObjectType(Ve(Ve({},b),{},{fields:function(){return c(b.fields)}}))}(0,lz.default)(0,"Unexpected type: "+(0,cz.default)(f))}}function Nc(e,t){for(var r=Object.create(null),n=Lm(Object.keys(e),function(a){return a}),i=0;i<n.length;i++){var o=n[i],s=e[o];r[o]=t?t(s):s}return r}function Dm(e){return Lm(e,function(t){return t.name})}function Lm(e,t){return e.slice().sort(function(r,n){var i=t(r),o=t(n);return(0,dz.default)(i,o)})}});var iA=y(ks=>{"use strict";p();Object.defineProperty(ks,"__esModule",{value:!0});ks.printSchema=_z;ks.printIntrospectionSchema=Sz;ks.printType=eA;var Mm=Gm(Tt()),vz=Gm(ae()),JO=Gm(et()),Fm=mt(),Ez=Ii(),XO=Ut(),qm=pr(),Um=gt(),Wi=ie(),Vm=ls();function Gm(e){return e&&e.__esModule?e:{default:e}}function _z(e,t){return ZO(e,function(r){return!(0,Um.isSpecifiedDirective)(r)},bz,t)}function Sz(e,t){return ZO(e,Um.isSpecifiedDirective,XO.isIntrospectionType,t)}function bz(e){return!(0,qm.isSpecifiedScalarType)(e)&&!(0,XO.isIntrospectionType)(e)}function ZO(e,t,r,n){var i=e.getDirectives().filter(t),o=(0,Mm.default)(e.getTypeMap()).filter(r);return[Tz(e)].concat(i.map(function(s){return Nz(s,n)}),o.map(function(s){return eA(s,n)})).filter(Boolean).join(`
|
|
179
179
|
|
|
180
180
|
`)+`
|
|
181
|
-
`}function
|
|
181
|
+
`}function Tz(e){if(!(e.description==null&&Iz(e))){var t=[],r=e.getQueryType();r&&t.push(" query: ".concat(r.name));var n=e.getMutationType();n&&t.push(" mutation: ".concat(n.name));var i=e.getSubscriptionType();return i&&t.push(" subscription: ".concat(i.name)),$t({},e)+`schema {
|
|
182
182
|
`.concat(t.join(`
|
|
183
183
|
`),`
|
|
184
|
-
}`)}}function
|
|
184
|
+
}`)}}function Iz(e){var t=e.getQueryType();if(t&&t.name!=="Query")return!1;var r=e.getMutationType();if(r&&r.name!=="Mutation")return!1;var n=e.getSubscriptionType();return!(n&&n.name!=="Subscription")}function eA(e,t){if((0,Wi.isScalarType)(e))return wz(e,t);if((0,Wi.isObjectType)(e))return Oz(e,t);if((0,Wi.isInterfaceType)(e))return Az(e,t);if((0,Wi.isUnionType)(e))return xz(e,t);if((0,Wi.isEnumType)(e))return Cz(e,t);if((0,Wi.isInputObjectType)(e))return Rz(e,t);(0,JO.default)(0,"Unexpected type: "+(0,vz.default)(e))}function wz(e,t){return $t(t,e)+"scalar ".concat(e.name)+Pz(e)}function tA(e){var t=e.getInterfaces();return t.length?" implements "+t.map(function(r){return r.name}).join(" & "):""}function Oz(e,t){return $t(t,e)+"type ".concat(e.name)+tA(e)+rA(t,e)}function Az(e,t){return $t(t,e)+"interface ".concat(e.name)+tA(e)+rA(t,e)}function xz(e,t){var r=e.getTypes(),n=r.length?" = "+r.join(" | "):"";return $t(t,e)+"union "+e.name+n}function Cz(e,t){var r=e.getValues().map(function(n,i){return $t(t,n," ",!i)+" "+n.name+Bm(n.deprecationReason)});return $t(t,e)+"enum ".concat(e.name)+$m(r)}function Rz(e,t){var r=(0,Mm.default)(e.getFields()).map(function(n,i){return $t(t,n," ",!i)+" "+jm(n)});return $t(t,e)+"input ".concat(e.name)+$m(r)}function rA(e,t){var r=(0,Mm.default)(t.getFields()).map(function(n,i){return $t(e,n," ",!i)+" "+n.name+nA(e,n.args," ")+": "+String(n.type)+Bm(n.deprecationReason)});return $m(r)}function $m(e){return e.length!==0?` {
|
|
185
185
|
`+e.join(`
|
|
186
186
|
`)+`
|
|
187
|
-
}`:""}function
|
|
187
|
+
}`:""}function nA(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return t.length===0?"":t.every(function(n){return!n.description})?"("+t.map(jm).join(", ")+")":`(
|
|
188
188
|
`+t.map(function(n,i){return $t(e,n," "+r,!i)+" "+r+jm(n)}).join(`
|
|
189
189
|
`)+`
|
|
190
|
-
`+r+")"}function jm(e){var t=(0,Vm.astFromValue)(e.defaultValue,e.type),r=e.name+": "+String(e.type);return t&&(r+=" = ".concat((0,Fm.print)(t))),r+Bm(e.deprecationReason)}function
|
|
190
|
+
`+r+")"}function jm(e){var t=(0,Vm.astFromValue)(e.defaultValue,e.type),r=e.name+": "+String(e.type);return t&&(r+=" = ".concat((0,Fm.print)(t))),r+Bm(e.deprecationReason)}function Nz(e,t){return $t(t,e)+"directive @"+e.name+nA(t,e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}function Bm(e){if(e==null)return"";var t=(0,Vm.astFromValue)(e,qm.GraphQLString);return t&&e!==Um.DEFAULT_DEPRECATION_REASON?" @deprecated(reason: "+(0,Fm.print)(t)+")":" @deprecated"}function Pz(e){if(e.specifiedByUrl==null)return"";var t=e.specifiedByUrl,r=(0,Vm.astFromValue)(t,qm.GraphQLString);return r||(0,JO.default)(0,"Unexpected null value returned from `astFromValue` for specifiedByUrl")," @specifiedBy(url: "+(0,Fm.print)(r)+")"}function $t(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=t.description;if(i==null)return"";if(e?.commentDescriptions===!0)return Dz(i,r,n);var o=i.length>70,s=(0,Ez.printBlockString)(i,"",o),a=r&&!n?`
|
|
191
191
|
`+r:r;return a+s.replace(/\n/g,`
|
|
192
192
|
`+r)+`
|
|
193
|
-
`}function
|
|
193
|
+
`}function Dz(e,t,r){var n=t&&!r?`
|
|
194
194
|
`:"",i=e.split(`
|
|
195
195
|
`).map(function(o){return t+(o!==""?"# "+o:"#")}).join(`
|
|
196
196
|
`);return n+i+`
|
|
197
|
-
`}});var
|
|
197
|
+
`}});var oA=y(Km=>{"use strict";p();Object.defineProperty(Km,"__esModule",{value:!0});Km.concatAST=Lz;function Lz(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t=t.concat(n.definitions)}return{kind:"Document",definitions:t}}});var uA=y(Hm=>{"use strict";p();Object.defineProperty(Hm,"__esModule",{value:!0});Hm.separateOperations=jz;var Pc=_e(),kz=Hr();function jz(e){for(var t=[],r=Object.create(null),n=0,i=e.definitions;n<i.length;n++){var o=i[n];switch(o.kind){case Pc.Kind.OPERATION_DEFINITION:t.push(o);break;case Pc.Kind.FRAGMENT_DEFINITION:r[o.name.value]=sA(o.selectionSet);break}}for(var s=Object.create(null),a=function(l){for(var d=t[l],f=new Set,h=0,g=sA(d.selectionSet);h<g.length;h++){var v=g[h];aA(f,r,v)}var _=d.name?d.name.value:"";s[_]={kind:Pc.Kind.DOCUMENT,definitions:e.definitions.filter(function(b){return b===d||b.kind===Pc.Kind.FRAGMENT_DEFINITION&&f.has(b.name.value)})}},u=0;u<t.length;u++)a(u);return s}function aA(e,t,r){if(!e.has(r)){e.add(r);var n=t[r];if(n!==void 0)for(var i=0;i<n.length;i++){var o=n[i];aA(e,t,o)}}}function sA(e){var t=[];return(0,kz.visit)(e,{FragmentSpread:function(n){t.push(n.name.value)}}),t}});var dA=y(Wm=>{"use strict";p();Object.defineProperty(Wm,"__esModule",{value:!0});Wm.stripIgnoredCharacters=Mz;var cA=Iu(),Qm=bi(),lA=Au(),pA=Ii();function Mz(e){for(var t=(0,cA.isSource)(e)?e:new cA.Source(e),r=t.body,n=new lA.Lexer(t),i="",o=!1;n.advance().kind!==Qm.TokenKind.EOF;){var s=n.token,a=s.kind,u=!(0,lA.isPunctuatorTokenKind)(s.kind);o&&(u||s.kind===Qm.TokenKind.SPREAD)&&(i+=" ");var c=r.slice(s.start,s.end);a===Qm.TokenKind.BLOCK_STRING?i+=Fz(c):i+=c,o=u}return i}function Fz(e){var t=e.slice(3,-3),r=(0,pA.dedentBlockStringValue)(t);(0,pA.getBlockStringIndentation)(r)>0&&(r=`
|
|
198
198
|
`+r);var n=r[r.length-1],i=n==='"'&&r.slice(-4)!=='\\"""';return(i||n==="\\")&&(r+=`
|
|
199
|
-
`),'"""'+r+'"""'}});var bA=y(cn=>{"use strict";p();Object.defineProperty(cn,"__esModule",{value:!0});cn.findBreakingChanges=Gz;cn.findDangerousChanges=$z;cn.DangerousChangeType=cn.BreakingChangeType=void 0;var zi=Ms(St()),dA=Ms(Qr()),kz=Ms(ae()),EA=Ms(et()),jz=Ms(Xo()),Mz=mt(),Fz=Hr(),qz=pr(),le=ie(),Uz=cs();function Ms(e){return e&&e.__esModule?e:{default:e}}function fA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fA(Object(r),!0).forEach(function(n){Vz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Vz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ge=Object.freeze({TYPE_REMOVED:"TYPE_REMOVED",TYPE_CHANGED_KIND:"TYPE_CHANGED_KIND",TYPE_REMOVED_FROM_UNION:"TYPE_REMOVED_FROM_UNION",VALUE_REMOVED_FROM_ENUM:"VALUE_REMOVED_FROM_ENUM",REQUIRED_INPUT_FIELD_ADDED:"REQUIRED_INPUT_FIELD_ADDED",IMPLEMENTED_INTERFACE_REMOVED:"IMPLEMENTED_INTERFACE_REMOVED",FIELD_REMOVED:"FIELD_REMOVED",FIELD_CHANGED_KIND:"FIELD_CHANGED_KIND",REQUIRED_ARG_ADDED:"REQUIRED_ARG_ADDED",ARG_REMOVED:"ARG_REMOVED",ARG_CHANGED_KIND:"ARG_CHANGED_KIND",DIRECTIVE_REMOVED:"DIRECTIVE_REMOVED",DIRECTIVE_ARG_REMOVED:"DIRECTIVE_ARG_REMOVED",REQUIRED_DIRECTIVE_ARG_ADDED:"REQUIRED_DIRECTIVE_ARG_ADDED",DIRECTIVE_REPEATABLE_REMOVED:"DIRECTIVE_REPEATABLE_REMOVED",DIRECTIVE_LOCATION_REMOVED:"DIRECTIVE_LOCATION_REMOVED"});cn.BreakingChangeType=Ge;var Rr=Object.freeze({VALUE_ADDED_TO_ENUM:"VALUE_ADDED_TO_ENUM",TYPE_ADDED_TO_UNION:"TYPE_ADDED_TO_UNION",OPTIONAL_INPUT_FIELD_ADDED:"OPTIONAL_INPUT_FIELD_ADDED",OPTIONAL_ARG_ADDED:"OPTIONAL_ARG_ADDED",IMPLEMENTED_INTERFACE_ADDED:"IMPLEMENTED_INTERFACE_ADDED",ARG_DEFAULT_VALUE_CHANGE:"ARG_DEFAULT_VALUE_CHANGE"});cn.DangerousChangeType=Rr;function Gz(e,t){var r=_A(e,t).filter(function(n){return n.type in Ge});return r}function $z(e,t){var r=_A(e,t).filter(function(n){return n.type in Rr});return r}function _A(e,t){return[].concat(Kz(e,t),Bz(e,t))}function Bz(e,t){for(var r=[],n=Nr(e.getDirectives(),t.getDirectives()),i=0,o=n.removed;i<o.length;i++){var s=o[i];r.push({type:Ge.DIRECTIVE_REMOVED,description:"".concat(s.name," was removed.")})}for(var a=0,u=n.persisted;a<u.length;a++){for(var c=u[a],l=c[0],d=c[1],f=Nr(l.args,d.args),h=0,g=f.added;h<g.length;h++){var v=g[h];(0,le.isRequiredArgument)(v)&&r.push({type:Ge.REQUIRED_DIRECTIVE_ARG_ADDED,description:"A required arg ".concat(v.name," on directive ").concat(l.name," was added.")})}for(var _=0,S=f.removed;_<S.length;_++){var b=S[_];r.push({type:Ge.DIRECTIVE_ARG_REMOVED,description:"".concat(b.name," was removed from ").concat(l.name,".")})}l.isRepeatable&&!d.isRepeatable&&r.push({type:Ge.DIRECTIVE_REPEATABLE_REMOVED,description:"Repeatable flag was removed from ".concat(l.name,".")});for(var A=0,O=l.locations;A<O.length;A++){var T=O[A];d.locations.indexOf(T)===-1&&r.push({type:Ge.DIRECTIVE_LOCATION_REMOVED,description:"".concat(T," was removed from ").concat(l.name,".")})}}return r}function Kz(e,t){for(var r=[],n=Nr((0,zi.default)(e.getTypeMap()),(0,zi.default)(t.getTypeMap())),i=0,o=n.removed;i<o.length;i++){var s=o[i];r.push({type:Ge.TYPE_REMOVED,description:(0,qz.isSpecifiedScalarType)(s)?"Standard scalar ".concat(s.name," was removed because it is not referenced anymore."):"".concat(s.name," was removed.")})}for(var a=0,u=n.persisted;a<u.length;a++){var c=u[a],l=c[0],d=c[1];(0,le.isEnumType)(l)&&(0,le.isEnumType)(d)?r.push.apply(r,Wz(l,d)):(0,le.isUnionType)(l)&&(0,le.isUnionType)(d)?r.push.apply(r,Qz(l,d)):(0,le.isInputObjectType)(l)&&(0,le.isInputObjectType)(d)?r.push.apply(r,Hz(l,d)):(0,le.isObjectType)(l)&&(0,le.isObjectType)(d)||(0,le.isInterfaceType)(l)&&(0,le.isInterfaceType)(d)?r.push.apply(r,gA(l,d).concat(mA(l,d))):l.constructor!==d.constructor&&r.push({type:Ge.TYPE_CHANGED_KIND,description:"".concat(l.name," changed from ")+"".concat(yA(l)," to ").concat(yA(d),".")})}return r}function Hz(e,t){for(var r=[],n=Nr((0,zi.default)(e.getFields()),(0,zi.default)(t.getFields())),i=0,o=n.added;i<o.length;i++){var s=o[i];(0,le.isRequiredInputField)(s)?r.push({type:Ge.REQUIRED_INPUT_FIELD_ADDED,description:"A required field ".concat(s.name," on input type ").concat(e.name," was added.")}):r.push({type:Rr.OPTIONAL_INPUT_FIELD_ADDED,description:"An optional field ".concat(s.name," on input type ").concat(e.name," was added.")})}for(var a=0,u=n.removed;a<u.length;a++){var c=u[a];r.push({type:Ge.FIELD_REMOVED,description:"".concat(e.name,".").concat(c.name," was removed.")})}for(var l=0,d=n.persisted;l<d.length;l++){var f=d[l],h=f[0],g=f[1],v=js(h.type,g.type);v||r.push({type:Ge.FIELD_CHANGED_KIND,description:"".concat(e.name,".").concat(h.name," changed type from ")+"".concat(String(h.type)," to ").concat(String(g.type),".")})}return r}function Qz(e,t){for(var r=[],n=Nr(e.getTypes(),t.getTypes()),i=0,o=n.added;i<o.length;i++){var s=o[i];r.push({type:Rr.TYPE_ADDED_TO_UNION,description:"".concat(s.name," was added to union type ").concat(e.name,".")})}for(var a=0,u=n.removed;a<u.length;a++){var c=u[a];r.push({type:Ge.TYPE_REMOVED_FROM_UNION,description:"".concat(c.name," was removed from union type ").concat(e.name,".")})}return r}function Wz(e,t){for(var r=[],n=Nr(e.getValues(),t.getValues()),i=0,o=n.added;i<o.length;i++){var s=o[i];r.push({type:Rr.VALUE_ADDED_TO_ENUM,description:"".concat(s.name," was added to enum type ").concat(e.name,".")})}for(var a=0,u=n.removed;a<u.length;a++){var c=u[a];r.push({type:Ge.VALUE_REMOVED_FROM_ENUM,description:"".concat(c.name," was removed from enum type ").concat(e.name,".")})}return r}function mA(e,t){for(var r=[],n=Nr(e.getInterfaces(),t.getInterfaces()),i=0,o=n.added;i<o.length;i++){var s=o[i];r.push({type:Rr.IMPLEMENTED_INTERFACE_ADDED,description:"".concat(s.name," added to interfaces implemented by ").concat(e.name,".")})}for(var a=0,u=n.removed;a<u.length;a++){var c=u[a];r.push({type:Ge.IMPLEMENTED_INTERFACE_REMOVED,description:"".concat(e.name," no longer implements interface ").concat(c.name,".")})}return r}function gA(e,t){for(var r=[],n=Nr((0,zi.default)(e.getFields()),(0,zi.default)(t.getFields())),i=0,o=n.removed;i<o.length;i++){var s=o[i];r.push({type:Ge.FIELD_REMOVED,description:"".concat(e.name,".").concat(s.name," was removed.")})}for(var a=0,u=n.persisted;a<u.length;a++){var c=u[a],l=c[0],d=c[1];r.push.apply(r,zz(e,l,d));var f=ks(l.type,d.type);f||r.push({type:Ge.FIELD_CHANGED_KIND,description:"".concat(e.name,".").concat(l.name," changed type from ")+"".concat(String(l.type)," to ").concat(String(d.type),".")})}return r}function zz(e,t,r){for(var n=[],i=Nr(t.args,r.args),o=0,s=i.removed;o<s.length;o++){var a=s[o];n.push({type:Ge.ARG_REMOVED,description:"".concat(e.name,".").concat(t.name," arg ").concat(a.name," was removed.")})}for(var u=0,c=i.persisted;u<c.length;u++){var l=c[u],d=l[0],f=l[1],h=js(d.type,f.type);if(!h)n.push({type:Ge.ARG_CHANGED_KIND,description:"".concat(e.name,".").concat(t.name," arg ").concat(d.name," has changed type from ")+"".concat(String(d.type)," to ").concat(String(f.type),".")});else if(d.defaultValue!==void 0)if(f.defaultValue===void 0)n.push({type:Rr.ARG_DEFAULT_VALUE_CHANGE,description:"".concat(e.name,".").concat(t.name," arg ").concat(d.name," defaultValue was removed.")});else{var g=vA(d.defaultValue,d.type),v=vA(f.defaultValue,f.type);g!==v&&n.push({type:Rr.ARG_DEFAULT_VALUE_CHANGE,description:"".concat(e.name,".").concat(t.name," arg ").concat(d.name," has changed defaultValue from ").concat(g," to ").concat(v,".")})}}for(var _=0,S=i.added;_<S.length;_++){var b=S[_];(0,le.isRequiredArgument)(b)?n.push({type:Ge.REQUIRED_ARG_ADDED,description:"A required arg ".concat(b.name," on ").concat(e.name,".").concat(t.name," was added.")}):n.push({type:Rr.OPTIONAL_ARG_ADDED,description:"An optional arg ".concat(b.name," on ").concat(e.name,".").concat(t.name," was added.")})}return n}function ks(e,t){return(0,le.isListType)(e)?(0,le.isListType)(t)&&ks(e.ofType,t.ofType)||(0,le.isNonNullType)(t)&&ks(e,t.ofType):(0,le.isNonNullType)(e)?(0,le.isNonNullType)(t)&&ks(e.ofType,t.ofType):(0,le.isNamedType)(t)&&e.name===t.name||(0,le.isNonNullType)(t)&&ks(e,t.ofType)}function js(e,t){return(0,le.isListType)(e)?(0,le.isListType)(t)&&js(e.ofType,t.ofType):(0,le.isNonNullType)(e)?(0,le.isNonNullType)(t)&&js(e.ofType,t.ofType)||!(0,le.isNonNullType)(t)&&js(e.ofType,t):(0,le.isNamedType)(t)&&e.name===t.name}function yA(e){if((0,le.isScalarType)(e))return"a Scalar type";if((0,le.isObjectType)(e))return"an Object type";if((0,le.isInterfaceType)(e))return"an Interface type";if((0,le.isUnionType)(e))return"a Union type";if((0,le.isEnumType)(e))return"an Enum type";if((0,le.isInputObjectType)(e))return"an Input type";(0,EA.default)(0,"Unexpected type: "+(0,kz.default)(e))}function vA(e,t){var r=(0,Uz.astFromValue)(e,t);r!=null||(0,EA.default)(0);var n=(0,Fz.visit)(r,{ObjectValue:function(o){var s=[].concat(o.fields);return s.sort(function(a,u){return(0,jz.default)(a.name.value,u.name.value)}),hA(hA({},o),{},{fields:s})}});return(0,Mz.print)(n)}function Nr(e,t){for(var r=[],n=[],i=[],o=(0,dA.default)(e,function(f){var h=f.name;return h}),s=(0,dA.default)(t,function(f){var h=f.name;return h}),a=0;a<e.length;a++){var u=e[a],c=s[u.name];c===void 0?n.push(u):i.push([u,c])}for(var l=0;l<t.length;l++){var d=t[l];o[d.name]===void 0&&r.push(d)}return{added:r,persisted:i,removed:n}}});var SA=y(zm=>{"use strict";p();Object.defineProperty(zm,"__esModule",{value:!0});zm.findDeprecatedUsages=Xz;var Yz=Ui(),Jz=Tm();function Xz(e,t){return(0,Yz.validate)(e,t,[Jz.NoDeprecatedCustomRule])}});var AA=y(ne=>{"use strict";p();Object.defineProperty(ne,"__esModule",{value:!0});Object.defineProperty(ne,"getIntrospectionQuery",{enumerable:!0,get:function(){return Zz.getIntrospectionQuery}});Object.defineProperty(ne,"getOperationAST",{enumerable:!0,get:function(){return eY.getOperationAST}});Object.defineProperty(ne,"getOperationRootType",{enumerable:!0,get:function(){return tY.getOperationRootType}});Object.defineProperty(ne,"introspectionFromSchema",{enumerable:!0,get:function(){return rY.introspectionFromSchema}});Object.defineProperty(ne,"buildClientSchema",{enumerable:!0,get:function(){return nY.buildClientSchema}});Object.defineProperty(ne,"buildASTSchema",{enumerable:!0,get:function(){return TA.buildASTSchema}});Object.defineProperty(ne,"buildSchema",{enumerable:!0,get:function(){return TA.buildSchema}});Object.defineProperty(ne,"extendSchema",{enumerable:!0,get:function(){return IA.extendSchema}});Object.defineProperty(ne,"getDescription",{enumerable:!0,get:function(){return IA.getDescription}});Object.defineProperty(ne,"lexicographicSortSchema",{enumerable:!0,get:function(){return iY.lexicographicSortSchema}});Object.defineProperty(ne,"printSchema",{enumerable:!0,get:function(){return Ym.printSchema}});Object.defineProperty(ne,"printType",{enumerable:!0,get:function(){return Ym.printType}});Object.defineProperty(ne,"printIntrospectionSchema",{enumerable:!0,get:function(){return Ym.printIntrospectionSchema}});Object.defineProperty(ne,"typeFromAST",{enumerable:!0,get:function(){return oY.typeFromAST}});Object.defineProperty(ne,"valueFromAST",{enumerable:!0,get:function(){return sY.valueFromAST}});Object.defineProperty(ne,"valueFromASTUntyped",{enumerable:!0,get:function(){return aY.valueFromASTUntyped}});Object.defineProperty(ne,"astFromValue",{enumerable:!0,get:function(){return uY.astFromValue}});Object.defineProperty(ne,"TypeInfo",{enumerable:!0,get:function(){return wA.TypeInfo}});Object.defineProperty(ne,"visitWithTypeInfo",{enumerable:!0,get:function(){return wA.visitWithTypeInfo}});Object.defineProperty(ne,"coerceInputValue",{enumerable:!0,get:function(){return cY.coerceInputValue}});Object.defineProperty(ne,"concatAST",{enumerable:!0,get:function(){return lY.concatAST}});Object.defineProperty(ne,"separateOperations",{enumerable:!0,get:function(){return pY.separateOperations}});Object.defineProperty(ne,"stripIgnoredCharacters",{enumerable:!0,get:function(){return dY.stripIgnoredCharacters}});Object.defineProperty(ne,"isEqualType",{enumerable:!0,get:function(){return Jm.isEqualType}});Object.defineProperty(ne,"isTypeSubTypeOf",{enumerable:!0,get:function(){return Jm.isTypeSubTypeOf}});Object.defineProperty(ne,"doTypesOverlap",{enumerable:!0,get:function(){return Jm.doTypesOverlap}});Object.defineProperty(ne,"assertValidName",{enumerable:!0,get:function(){return OA.assertValidName}});Object.defineProperty(ne,"isValidNameError",{enumerable:!0,get:function(){return OA.isValidNameError}});Object.defineProperty(ne,"BreakingChangeType",{enumerable:!0,get:function(){return Dc.BreakingChangeType}});Object.defineProperty(ne,"DangerousChangeType",{enumerable:!0,get:function(){return Dc.DangerousChangeType}});Object.defineProperty(ne,"findBreakingChanges",{enumerable:!0,get:function(){return Dc.findBreakingChanges}});Object.defineProperty(ne,"findDangerousChanges",{enumerable:!0,get:function(){return Dc.findDangerousChanges}});Object.defineProperty(ne,"findDeprecatedUsages",{enumerable:!0,get:function(){return fY.findDeprecatedUsages}});var Zz=Am(),eY=Cm(),tY=hc(),rY=RO(),nY=PO(),TA=QO(),IA=Pm(),iY=zO(),Ym=nA(),oY=dr(),sY=_s(),aY=Qd(),uY=cs(),wA=ec(),cY=cm(),lY=iA(),pY=aA(),dY=pA(),Jm=ns(),OA=Pd(),Dc=bA(),fY=SA()});var ln=y(E=>{"use strict";p();Object.defineProperty(E,"__esModule",{value:!0});Object.defineProperty(E,"version",{enumerable:!0,get:function(){return xA.version}});Object.defineProperty(E,"versionInfo",{enumerable:!0,get:function(){return xA.versionInfo}});Object.defineProperty(E,"graphql",{enumerable:!0,get:function(){return CA.graphql}});Object.defineProperty(E,"graphqlSync",{enumerable:!0,get:function(){return CA.graphqlSync}});Object.defineProperty(E,"GraphQLSchema",{enumerable:!0,get:function(){return P.GraphQLSchema}});Object.defineProperty(E,"GraphQLDirective",{enumerable:!0,get:function(){return P.GraphQLDirective}});Object.defineProperty(E,"GraphQLScalarType",{enumerable:!0,get:function(){return P.GraphQLScalarType}});Object.defineProperty(E,"GraphQLObjectType",{enumerable:!0,get:function(){return P.GraphQLObjectType}});Object.defineProperty(E,"GraphQLInterfaceType",{enumerable:!0,get:function(){return P.GraphQLInterfaceType}});Object.defineProperty(E,"GraphQLUnionType",{enumerable:!0,get:function(){return P.GraphQLUnionType}});Object.defineProperty(E,"GraphQLEnumType",{enumerable:!0,get:function(){return P.GraphQLEnumType}});Object.defineProperty(E,"GraphQLInputObjectType",{enumerable:!0,get:function(){return P.GraphQLInputObjectType}});Object.defineProperty(E,"GraphQLList",{enumerable:!0,get:function(){return P.GraphQLList}});Object.defineProperty(E,"GraphQLNonNull",{enumerable:!0,get:function(){return P.GraphQLNonNull}});Object.defineProperty(E,"specifiedScalarTypes",{enumerable:!0,get:function(){return P.specifiedScalarTypes}});Object.defineProperty(E,"GraphQLInt",{enumerable:!0,get:function(){return P.GraphQLInt}});Object.defineProperty(E,"GraphQLFloat",{enumerable:!0,get:function(){return P.GraphQLFloat}});Object.defineProperty(E,"GraphQLString",{enumerable:!0,get:function(){return P.GraphQLString}});Object.defineProperty(E,"GraphQLBoolean",{enumerable:!0,get:function(){return P.GraphQLBoolean}});Object.defineProperty(E,"GraphQLID",{enumerable:!0,get:function(){return P.GraphQLID}});Object.defineProperty(E,"specifiedDirectives",{enumerable:!0,get:function(){return P.specifiedDirectives}});Object.defineProperty(E,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return P.GraphQLIncludeDirective}});Object.defineProperty(E,"GraphQLSkipDirective",{enumerable:!0,get:function(){return P.GraphQLSkipDirective}});Object.defineProperty(E,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return P.GraphQLDeprecatedDirective}});Object.defineProperty(E,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return P.GraphQLSpecifiedByDirective}});Object.defineProperty(E,"TypeKind",{enumerable:!0,get:function(){return P.TypeKind}});Object.defineProperty(E,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return P.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(E,"introspectionTypes",{enumerable:!0,get:function(){return P.introspectionTypes}});Object.defineProperty(E,"__Schema",{enumerable:!0,get:function(){return P.__Schema}});Object.defineProperty(E,"__Directive",{enumerable:!0,get:function(){return P.__Directive}});Object.defineProperty(E,"__DirectiveLocation",{enumerable:!0,get:function(){return P.__DirectiveLocation}});Object.defineProperty(E,"__Type",{enumerable:!0,get:function(){return P.__Type}});Object.defineProperty(E,"__Field",{enumerable:!0,get:function(){return P.__Field}});Object.defineProperty(E,"__InputValue",{enumerable:!0,get:function(){return P.__InputValue}});Object.defineProperty(E,"__EnumValue",{enumerable:!0,get:function(){return P.__EnumValue}});Object.defineProperty(E,"__TypeKind",{enumerable:!0,get:function(){return P.__TypeKind}});Object.defineProperty(E,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return P.SchemaMetaFieldDef}});Object.defineProperty(E,"TypeMetaFieldDef",{enumerable:!0,get:function(){return P.TypeMetaFieldDef}});Object.defineProperty(E,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return P.TypeNameMetaFieldDef}});Object.defineProperty(E,"isSchema",{enumerable:!0,get:function(){return P.isSchema}});Object.defineProperty(E,"isDirective",{enumerable:!0,get:function(){return P.isDirective}});Object.defineProperty(E,"isType",{enumerable:!0,get:function(){return P.isType}});Object.defineProperty(E,"isScalarType",{enumerable:!0,get:function(){return P.isScalarType}});Object.defineProperty(E,"isObjectType",{enumerable:!0,get:function(){return P.isObjectType}});Object.defineProperty(E,"isInterfaceType",{enumerable:!0,get:function(){return P.isInterfaceType}});Object.defineProperty(E,"isUnionType",{enumerable:!0,get:function(){return P.isUnionType}});Object.defineProperty(E,"isEnumType",{enumerable:!0,get:function(){return P.isEnumType}});Object.defineProperty(E,"isInputObjectType",{enumerable:!0,get:function(){return P.isInputObjectType}});Object.defineProperty(E,"isListType",{enumerable:!0,get:function(){return P.isListType}});Object.defineProperty(E,"isNonNullType",{enumerable:!0,get:function(){return P.isNonNullType}});Object.defineProperty(E,"isInputType",{enumerable:!0,get:function(){return P.isInputType}});Object.defineProperty(E,"isOutputType",{enumerable:!0,get:function(){return P.isOutputType}});Object.defineProperty(E,"isLeafType",{enumerable:!0,get:function(){return P.isLeafType}});Object.defineProperty(E,"isCompositeType",{enumerable:!0,get:function(){return P.isCompositeType}});Object.defineProperty(E,"isAbstractType",{enumerable:!0,get:function(){return P.isAbstractType}});Object.defineProperty(E,"isWrappingType",{enumerable:!0,get:function(){return P.isWrappingType}});Object.defineProperty(E,"isNullableType",{enumerable:!0,get:function(){return P.isNullableType}});Object.defineProperty(E,"isNamedType",{enumerable:!0,get:function(){return P.isNamedType}});Object.defineProperty(E,"isRequiredArgument",{enumerable:!0,get:function(){return P.isRequiredArgument}});Object.defineProperty(E,"isRequiredInputField",{enumerable:!0,get:function(){return P.isRequiredInputField}});Object.defineProperty(E,"isSpecifiedScalarType",{enumerable:!0,get:function(){return P.isSpecifiedScalarType}});Object.defineProperty(E,"isIntrospectionType",{enumerable:!0,get:function(){return P.isIntrospectionType}});Object.defineProperty(E,"isSpecifiedDirective",{enumerable:!0,get:function(){return P.isSpecifiedDirective}});Object.defineProperty(E,"assertSchema",{enumerable:!0,get:function(){return P.assertSchema}});Object.defineProperty(E,"assertDirective",{enumerable:!0,get:function(){return P.assertDirective}});Object.defineProperty(E,"assertType",{enumerable:!0,get:function(){return P.assertType}});Object.defineProperty(E,"assertScalarType",{enumerable:!0,get:function(){return P.assertScalarType}});Object.defineProperty(E,"assertObjectType",{enumerable:!0,get:function(){return P.assertObjectType}});Object.defineProperty(E,"assertInterfaceType",{enumerable:!0,get:function(){return P.assertInterfaceType}});Object.defineProperty(E,"assertUnionType",{enumerable:!0,get:function(){return P.assertUnionType}});Object.defineProperty(E,"assertEnumType",{enumerable:!0,get:function(){return P.assertEnumType}});Object.defineProperty(E,"assertInputObjectType",{enumerable:!0,get:function(){return P.assertInputObjectType}});Object.defineProperty(E,"assertListType",{enumerable:!0,get:function(){return P.assertListType}});Object.defineProperty(E,"assertNonNullType",{enumerable:!0,get:function(){return P.assertNonNullType}});Object.defineProperty(E,"assertInputType",{enumerable:!0,get:function(){return P.assertInputType}});Object.defineProperty(E,"assertOutputType",{enumerable:!0,get:function(){return P.assertOutputType}});Object.defineProperty(E,"assertLeafType",{enumerable:!0,get:function(){return P.assertLeafType}});Object.defineProperty(E,"assertCompositeType",{enumerable:!0,get:function(){return P.assertCompositeType}});Object.defineProperty(E,"assertAbstractType",{enumerable:!0,get:function(){return P.assertAbstractType}});Object.defineProperty(E,"assertWrappingType",{enumerable:!0,get:function(){return P.assertWrappingType}});Object.defineProperty(E,"assertNullableType",{enumerable:!0,get:function(){return P.assertNullableType}});Object.defineProperty(E,"assertNamedType",{enumerable:!0,get:function(){return P.assertNamedType}});Object.defineProperty(E,"getNullableType",{enumerable:!0,get:function(){return P.getNullableType}});Object.defineProperty(E,"getNamedType",{enumerable:!0,get:function(){return P.getNamedType}});Object.defineProperty(E,"validateSchema",{enumerable:!0,get:function(){return P.validateSchema}});Object.defineProperty(E,"assertValidSchema",{enumerable:!0,get:function(){return P.assertValidSchema}});Object.defineProperty(E,"Token",{enumerable:!0,get:function(){return Se.Token}});Object.defineProperty(E,"Source",{enumerable:!0,get:function(){return Se.Source}});Object.defineProperty(E,"Location",{enumerable:!0,get:function(){return Se.Location}});Object.defineProperty(E,"getLocation",{enumerable:!0,get:function(){return Se.getLocation}});Object.defineProperty(E,"printLocation",{enumerable:!0,get:function(){return Se.printLocation}});Object.defineProperty(E,"printSourceLocation",{enumerable:!0,get:function(){return Se.printSourceLocation}});Object.defineProperty(E,"Lexer",{enumerable:!0,get:function(){return Se.Lexer}});Object.defineProperty(E,"TokenKind",{enumerable:!0,get:function(){return Se.TokenKind}});Object.defineProperty(E,"parse",{enumerable:!0,get:function(){return Se.parse}});Object.defineProperty(E,"parseValue",{enumerable:!0,get:function(){return Se.parseValue}});Object.defineProperty(E,"parseType",{enumerable:!0,get:function(){return Se.parseType}});Object.defineProperty(E,"print",{enumerable:!0,get:function(){return Se.print}});Object.defineProperty(E,"visit",{enumerable:!0,get:function(){return Se.visit}});Object.defineProperty(E,"visitInParallel",{enumerable:!0,get:function(){return Se.visitInParallel}});Object.defineProperty(E,"getVisitFn",{enumerable:!0,get:function(){return Se.getVisitFn}});Object.defineProperty(E,"BREAK",{enumerable:!0,get:function(){return Se.BREAK}});Object.defineProperty(E,"Kind",{enumerable:!0,get:function(){return Se.Kind}});Object.defineProperty(E,"DirectiveLocation",{enumerable:!0,get:function(){return Se.DirectiveLocation}});Object.defineProperty(E,"isDefinitionNode",{enumerable:!0,get:function(){return Se.isDefinitionNode}});Object.defineProperty(E,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return Se.isExecutableDefinitionNode}});Object.defineProperty(E,"isSelectionNode",{enumerable:!0,get:function(){return Se.isSelectionNode}});Object.defineProperty(E,"isValueNode",{enumerable:!0,get:function(){return Se.isValueNode}});Object.defineProperty(E,"isTypeNode",{enumerable:!0,get:function(){return Se.isTypeNode}});Object.defineProperty(E,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return Se.isTypeSystemDefinitionNode}});Object.defineProperty(E,"isTypeDefinitionNode",{enumerable:!0,get:function(){return Se.isTypeDefinitionNode}});Object.defineProperty(E,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return Se.isTypeSystemExtensionNode}});Object.defineProperty(E,"isTypeExtensionNode",{enumerable:!0,get:function(){return Se.isTypeExtensionNode}});Object.defineProperty(E,"execute",{enumerable:!0,get:function(){return Yi.execute}});Object.defineProperty(E,"executeSync",{enumerable:!0,get:function(){return Yi.executeSync}});Object.defineProperty(E,"defaultFieldResolver",{enumerable:!0,get:function(){return Yi.defaultFieldResolver}});Object.defineProperty(E,"defaultTypeResolver",{enumerable:!0,get:function(){return Yi.defaultTypeResolver}});Object.defineProperty(E,"responsePathAsArray",{enumerable:!0,get:function(){return Yi.responsePathAsArray}});Object.defineProperty(E,"getDirectiveValues",{enumerable:!0,get:function(){return Yi.getDirectiveValues}});Object.defineProperty(E,"subscribe",{enumerable:!0,get:function(){return RA.subscribe}});Object.defineProperty(E,"createSourceEventStream",{enumerable:!0,get:function(){return RA.createSourceEventStream}});Object.defineProperty(E,"validate",{enumerable:!0,get:function(){return X.validate}});Object.defineProperty(E,"ValidationContext",{enumerable:!0,get:function(){return X.ValidationContext}});Object.defineProperty(E,"specifiedRules",{enumerable:!0,get:function(){return X.specifiedRules}});Object.defineProperty(E,"recommendedRules",{enumerable:!0,get:function(){return X.recommendedRules}});Object.defineProperty(E,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return X.ExecutableDefinitionsRule}});Object.defineProperty(E,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return X.FieldsOnCorrectTypeRule}});Object.defineProperty(E,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return X.FragmentsOnCompositeTypesRule}});Object.defineProperty(E,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return X.KnownArgumentNamesRule}});Object.defineProperty(E,"KnownDirectivesRule",{enumerable:!0,get:function(){return X.KnownDirectivesRule}});Object.defineProperty(E,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return X.KnownFragmentNamesRule}});Object.defineProperty(E,"KnownTypeNamesRule",{enumerable:!0,get:function(){return X.KnownTypeNamesRule}});Object.defineProperty(E,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return X.LoneAnonymousOperationRule}});Object.defineProperty(E,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return X.NoFragmentCyclesRule}});Object.defineProperty(E,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return X.NoUndefinedVariablesRule}});Object.defineProperty(E,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return X.NoUnusedFragmentsRule}});Object.defineProperty(E,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return X.NoUnusedVariablesRule}});Object.defineProperty(E,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return X.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(E,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return X.PossibleFragmentSpreadsRule}});Object.defineProperty(E,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return X.ProvidedRequiredArgumentsRule}});Object.defineProperty(E,"ScalarLeafsRule",{enumerable:!0,get:function(){return X.ScalarLeafsRule}});Object.defineProperty(E,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return X.SingleFieldSubscriptionsRule}});Object.defineProperty(E,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return X.UniqueArgumentNamesRule}});Object.defineProperty(E,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return X.UniqueDirectivesPerLocationRule}});Object.defineProperty(E,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return X.UniqueFragmentNamesRule}});Object.defineProperty(E,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return X.UniqueInputFieldNamesRule}});Object.defineProperty(E,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return X.UniqueOperationNamesRule}});Object.defineProperty(E,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return X.UniqueVariableNamesRule}});Object.defineProperty(E,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return X.ValuesOfCorrectTypeRule}});Object.defineProperty(E,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return X.VariablesAreInputTypesRule}});Object.defineProperty(E,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return X.VariablesInAllowedPositionRule}});Object.defineProperty(E,"MaxIntrospectionDepthRule",{enumerable:!0,get:function(){return X.MaxIntrospectionDepthRule}});Object.defineProperty(E,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return X.LoneSchemaDefinitionRule}});Object.defineProperty(E,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return X.UniqueOperationTypesRule}});Object.defineProperty(E,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return X.UniqueTypeNamesRule}});Object.defineProperty(E,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return X.UniqueEnumValueNamesRule}});Object.defineProperty(E,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return X.UniqueFieldDefinitionNamesRule}});Object.defineProperty(E,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return X.UniqueDirectiveNamesRule}});Object.defineProperty(E,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return X.PossibleTypeExtensionsRule}});Object.defineProperty(E,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return X.NoDeprecatedCustomRule}});Object.defineProperty(E,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return X.NoSchemaIntrospectionCustomRule}});Object.defineProperty(E,"GraphQLError",{enumerable:!0,get:function(){return Fs.GraphQLError}});Object.defineProperty(E,"syntaxError",{enumerable:!0,get:function(){return Fs.syntaxError}});Object.defineProperty(E,"locatedError",{enumerable:!0,get:function(){return Fs.locatedError}});Object.defineProperty(E,"printError",{enumerable:!0,get:function(){return Fs.printError}});Object.defineProperty(E,"formatError",{enumerable:!0,get:function(){return Fs.formatError}});Object.defineProperty(E,"getIntrospectionQuery",{enumerable:!0,get:function(){return se.getIntrospectionQuery}});Object.defineProperty(E,"getOperationAST",{enumerable:!0,get:function(){return se.getOperationAST}});Object.defineProperty(E,"getOperationRootType",{enumerable:!0,get:function(){return se.getOperationRootType}});Object.defineProperty(E,"introspectionFromSchema",{enumerable:!0,get:function(){return se.introspectionFromSchema}});Object.defineProperty(E,"buildClientSchema",{enumerable:!0,get:function(){return se.buildClientSchema}});Object.defineProperty(E,"buildASTSchema",{enumerable:!0,get:function(){return se.buildASTSchema}});Object.defineProperty(E,"buildSchema",{enumerable:!0,get:function(){return se.buildSchema}});Object.defineProperty(E,"getDescription",{enumerable:!0,get:function(){return se.getDescription}});Object.defineProperty(E,"extendSchema",{enumerable:!0,get:function(){return se.extendSchema}});Object.defineProperty(E,"lexicographicSortSchema",{enumerable:!0,get:function(){return se.lexicographicSortSchema}});Object.defineProperty(E,"printSchema",{enumerable:!0,get:function(){return se.printSchema}});Object.defineProperty(E,"printType",{enumerable:!0,get:function(){return se.printType}});Object.defineProperty(E,"printIntrospectionSchema",{enumerable:!0,get:function(){return se.printIntrospectionSchema}});Object.defineProperty(E,"typeFromAST",{enumerable:!0,get:function(){return se.typeFromAST}});Object.defineProperty(E,"valueFromAST",{enumerable:!0,get:function(){return se.valueFromAST}});Object.defineProperty(E,"valueFromASTUntyped",{enumerable:!0,get:function(){return se.valueFromASTUntyped}});Object.defineProperty(E,"astFromValue",{enumerable:!0,get:function(){return se.astFromValue}});Object.defineProperty(E,"TypeInfo",{enumerable:!0,get:function(){return se.TypeInfo}});Object.defineProperty(E,"visitWithTypeInfo",{enumerable:!0,get:function(){return se.visitWithTypeInfo}});Object.defineProperty(E,"coerceInputValue",{enumerable:!0,get:function(){return se.coerceInputValue}});Object.defineProperty(E,"concatAST",{enumerable:!0,get:function(){return se.concatAST}});Object.defineProperty(E,"separateOperations",{enumerable:!0,get:function(){return se.separateOperations}});Object.defineProperty(E,"stripIgnoredCharacters",{enumerable:!0,get:function(){return se.stripIgnoredCharacters}});Object.defineProperty(E,"isEqualType",{enumerable:!0,get:function(){return se.isEqualType}});Object.defineProperty(E,"isTypeSubTypeOf",{enumerable:!0,get:function(){return se.isTypeSubTypeOf}});Object.defineProperty(E,"doTypesOverlap",{enumerable:!0,get:function(){return se.doTypesOverlap}});Object.defineProperty(E,"assertValidName",{enumerable:!0,get:function(){return se.assertValidName}});Object.defineProperty(E,"isValidNameError",{enumerable:!0,get:function(){return se.isValidNameError}});Object.defineProperty(E,"BreakingChangeType",{enumerable:!0,get:function(){return se.BreakingChangeType}});Object.defineProperty(E,"DangerousChangeType",{enumerable:!0,get:function(){return se.DangerousChangeType}});Object.defineProperty(E,"findBreakingChanges",{enumerable:!0,get:function(){return se.findBreakingChanges}});Object.defineProperty(E,"findDangerousChanges",{enumerable:!0,get:function(){return se.findDangerousChanges}});Object.defineProperty(E,"findDeprecatedUsages",{enumerable:!0,get:function(){return se.findDeprecatedUsages}});var xA=jS(),CA=tO(),P=nO(),Se=sO(),Yi=aO(),RA=bO(),X=IO(),Fs=AO(),se=AA()});var KA=y(($se,Pr)=>{p();var rg=M("fs"),Fc=M("path"),_Y=M("os"),bY=M("crypto"),UA=["\u25C8 encrypted .env [www.dotenvx.com]","\u25C8 secrets for agents [www.dotenvx.com]","\u2301 auth for agents [www.vestauth.com]","\u2318 custom filepath { path: '/custom/path/.env' }","\u2318 enable debugging { debug: true }","\u2318 override existing { override: true }","\u2318 suppress logs { quiet: true }","\u2318 multiple files { path: ['.env.local', '.env'] }"];function SY(){return UA[Math.floor(Math.random()*UA.length)]}function Ji(e){return typeof e=="string"?!["false","0","no","off",""].includes(e.toLowerCase()):!!e}function TY(){return process.stdout.isTTY}function IY(e){return TY()?`\x1B[2m${e}\x1B[0m`:e}var wY=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function OY(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
|
|
200
|
-
`);let n;for(;(n=
|
|
201
|
-
`),o=o.replace(/\\r/g,"\r")),t[i]=o}return t}function AY(e){e=e||{};let t=BA(e);e.path=t;let r=Qe.configDotenv(e);if(!r.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=$A(e).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),u=CY(r,a);o=Qe.decrypt(u.ciphertext,u.key);break}catch(a){if(s+1>=i)throw a}return Qe.parse(o)}function xY(e){console.error(`\u26A0 ${e}`)}function Vs(e){console.log(`\u2506 ${e}`)}function GA(e){console.log(`\u25C7 ${e}`)}function $A(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function CY(e,t){let r;try{r=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let u=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw u.code="INVALID_DOTENV_KEY",u}throw a}let n=r.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=r.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let o=`DOTENV_VAULT_${i.toUpperCase()}`,s=e.parsed[o];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function BA(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)rg.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=Fc.resolve(process.cwd(),".env.vault");return rg.existsSync(t)?t:null}function VA(e){return e[0]==="~"?Fc.join(_Y.homedir(),e.slice(1)):e}function RY(e){let t=Ji(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),r=Ji(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);(t||!r)&&GA("loading env from encrypted .env.vault");let n=Qe._parseVault(e),i=process.env;return e&&e.processEnv!=null&&(i=e.processEnv),Qe.populate(i,n,e),{parsed:n}}function NY(e){let t=Fc.resolve(process.cwd(),".env"),r="utf8",n=process.env;e&&e.processEnv!=null&&(n=e.processEnv);let i=Ji(n.DOTENV_CONFIG_DEBUG||e&&e.debug),o=Ji(n.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?r=e.encoding:i&&Vs("no encoding is specified (UTF-8 is used by default)");let s=[t];if(e&&e.path)if(!Array.isArray(e.path))s=[VA(e.path)];else{s=[];for(let l of e.path)s.push(VA(l))}let a,u={};for(let l of s)try{let d=Qe.parse(rg.readFileSync(l,{encoding:r}));Qe.populate(u,d,e)}catch(d){i&&Vs(`failed to load ${l} ${d.message}`),a=d}let c=Qe.populate(n,u,e);if(i=Ji(n.DOTENV_CONFIG_DEBUG||i),o=Ji(n.DOTENV_CONFIG_QUIET||o),i||!o){let l=Object.keys(c).length,d=[];for(let f of s)try{let h=Fc.relative(process.cwd(),f);d.push(h)}catch(h){i&&Vs(`failed to load ${f} ${h.message}`),a=h}GA(`injected env (${l}) from ${d.join(",")} ${IY(`// tip: ${SY()}`)}`)}return a?{parsed:u,error:a}:{parsed:u}}function PY(e){if($A(e).length===0)return Qe.configDotenv(e);let t=BA(e);return t?Qe._configVault(e):(xY(`you set DOTENV_KEY but you are missing a .env.vault file at ${t}`),Qe.configDotenv(e))}function DY(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{let s=bY.createDecipheriv("aes-256-gcm",r,i);return s.setAuthTag(o),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,u=s.message==="Invalid key length",c=s.message==="Unsupported state or unable to authenticate data";if(a||u){let l=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw l.code="INVALID_DOTENV_KEY",l}else if(c){let l=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw l.code="DECRYPTION_FAILED",l}else throw s}}function LY(e,t,r={}){let n=!!(r&&r.debug),i=!!(r&&r.override),o={};if(typeof t!="object"){let s=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw s.code="OBJECT_REQUIRED",s}for(let s of Object.keys(t))Object.prototype.hasOwnProperty.call(e,s)?(i===!0&&(e[s]=t[s],o[s]=t[s]),n&&Vs(i===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):(e[s]=t[s],o[s]=t[s]);return o}var Qe={configDotenv:NY,_configVault:RY,_parseVault:AY,config:PY,decrypt:DY,parse:OY,populate:LY};Pr.exports.configDotenv=Qe.configDotenv;Pr.exports._configVault=Qe._configVault;Pr.exports._parseVault=Qe._parseVault;Pr.exports.config=Qe.config;Pr.exports.decrypt=Qe.decrypt;Pr.exports.parse=Qe.parse;Pr.exports.populate=Qe.populate;Pr.exports=Qe});var F0=y((aae,M0)=>{p();M0.exports=Zi;function Zi(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Zi.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-r:e+r}return Math.min(e,this.max)|0};Zi.prototype.reset=function(){this.attempts=0};Zi.prototype.setMin=function(e){this.ms=e};Zi.prototype.setMax=function(e){this.max=e};Zi.prototype.setJitter=function(e){this.jitter=e}});var U0=y((cae,og)=>{"use strict";p();var VY=Object.prototype.hasOwnProperty,dt="~";function $s(){}Object.create&&($s.prototype=Object.create(null),new $s().__proto__||(dt=!1));function GY(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function q0(e,t,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var o=new GY(r,n||e,i),s=dt?dt+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],o]:e._events[s].push(o):(e._events[s]=o,e._eventsCount++),e}function Gc(e,t){--e._eventsCount===0?e._events=new $s:delete e._events[t]}function ot(){this._events=new $s,this._eventsCount=0}ot.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)VY.call(r,n)&&t.push(dt?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};ot.prototype.listeners=function(t){var r=dt?dt+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i<o;i++)s[i]=n[i].fn;return s};ot.prototype.listenerCount=function(t){var r=dt?dt+t:t,n=this._events[r];return n?n.fn?1:n.length:0};ot.prototype.emit=function(t,r,n,i,o,s){var a=dt?dt+t:t;if(!this._events[a])return!1;var u=this._events[a],c=arguments.length,l,d;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,r),!0;case 3:return u.fn.call(u.context,r,n),!0;case 4:return u.fn.call(u.context,r,n,i),!0;case 5:return u.fn.call(u.context,r,n,i,o),!0;case 6:return u.fn.call(u.context,r,n,i,o,s),!0}for(d=1,l=new Array(c-1);d<c;d++)l[d-1]=arguments[d];u.fn.apply(u.context,l)}else{var f=u.length,h;for(d=0;d<f;d++)switch(u[d].once&&this.removeListener(t,u[d].fn,void 0,!0),c){case 1:u[d].fn.call(u[d].context);break;case 2:u[d].fn.call(u[d].context,r);break;case 3:u[d].fn.call(u[d].context,r,n);break;case 4:u[d].fn.call(u[d].context,r,n,i);break;default:if(!l)for(h=1,l=new Array(c-1);h<c;h++)l[h-1]=arguments[h];u[d].fn.apply(u[d].context,l)}}return!0};ot.prototype.on=function(t,r,n){return q0(this,t,r,n,!1)};ot.prototype.once=function(t,r,n){return q0(this,t,r,n,!0)};ot.prototype.removeListener=function(t,r,n,i){var o=dt?dt+t:t;if(!this._events[o])return this;if(!r)return Gc(this,o),this;var s=this._events[o];if(s.fn)s.fn===r&&(!i||s.once)&&(!n||s.context===n)&&Gc(this,o);else{for(var a=0,u=[],c=s.length;a<c;a++)(s[a].fn!==r||i&&!s[a].once||n&&s[a].context!==n)&&u.push(s[a]);u.length?this._events[o]=u.length===1?u[0]:u:Gc(this,o)}return this};ot.prototype.removeAllListeners=function(t){var r;return t?(r=dt?dt+t:t,this._events[r]&&Gc(this,r)):(this._events=new $s,this._eventsCount=0),this};ot.prototype.off=ot.prototype.removeListener;ot.prototype.addListener=ot.prototype.on;ot.prefixed=dt;ot.EventEmitter=ot;typeof og<"u"&&(og.exports=ot)});var V0=y(sg=>{"use strict";p();Object.defineProperty(sg,"__esModule",{value:!0});function $Y(e){return typeof e=="string"}sg.default=$Y});var ug=y(ag=>{"use strict";p();Object.defineProperty(ag,"__esModule",{value:!0});function BY(e){return e!==null&&typeof e=="object"}ag.default=BY});var G0=y(cg=>{"use strict";p();Object.defineProperty(cg,"__esModule",{value:!0});cg.default=KY;function KY(e){var t,r=e.Symbol;return typeof r=="function"?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}});var $0=y((pg,lg)=>{"use strict";p();Object.defineProperty(pg,"__esModule",{value:!0});var HY=G0(),QY=WY(HY);function WY(e){return e&&e.__esModule?e:{default:e}}var eo;typeof self<"u"?eo=self:typeof window<"u"?eo=window:typeof global<"u"?eo=global:typeof lg<"u"?eo=lg:eo=Function("return this")();var zY=(0,QY.default)(eo);pg.default=zY});var $c=y(to=>{"use strict";p();Object.defineProperty(to,"__esModule",{value:!0});to.GRAPHQL_SUBSCRIPTIONS=to.GRAPHQL_WS=void 0;var YY="graphql-ws";to.GRAPHQL_WS=YY;var JY="graphql-subscriptions";to.GRAPHQL_SUBSCRIPTIONS=JY});var B0=y(ro=>{"use strict";p();Object.defineProperty(ro,"__esModule",{value:!0});ro.WS_TIMEOUT=ro.MIN_WS_TIMEOUT=void 0;var XY=1e3;ro.MIN_WS_TIMEOUT=XY;var ZY=3e4;ro.WS_TIMEOUT=ZY});var Bs=y(dg=>{"use strict";p();Object.defineProperty(dg,"__esModule",{value:!0});var eJ=(function(){function e(){throw new Error("Static Class")}return e.GQL_CONNECTION_INIT="connection_init",e.GQL_CONNECTION_ACK="connection_ack",e.GQL_CONNECTION_ERROR="connection_error",e.GQL_CONNECTION_KEEP_ALIVE="ka",e.GQL_CONNECTION_TERMINATE="connection_terminate",e.GQL_START="start",e.GQL_DATA="data",e.GQL_ERROR="error",e.GQL_COMPLETE="complete",e.GQL_STOP="stop",e.SUBSCRIPTION_START="subscription_start",e.SUBSCRIPTION_DATA="subscription_data",e.SUBSCRIPTION_SUCCESS="subscription_success",e.SUBSCRIPTION_FAIL="subscription_fail",e.SUBSCRIPTION_END="subscription_end",e.INIT="init",e.INIT_SUCCESS="init_success",e.INIT_FAIL="init_fail",e.KEEP_ALIVE="keepalive",e})();dg.default=eJ});var Y0=y(Bt=>{"use strict";p();var no=Bt&&Bt.__assign||function(){return no=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},no.apply(this,arguments)},tJ=Bt&&Bt.__awaiter||function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(d){s(d)}}function u(l){try{c(n.throw(l))}catch(d){s(d)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(e,t||[])).next())})},rJ=Bt&&Bt.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},K0=Bt&&Bt.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.SubscriptionClient=void 0;var H0=typeof global<"u"?global:typeof window<"u"?window:{},nJ=H0.WebSocket||H0.MozWebSocket,Q0=F0(),iJ=U0(),W0=V0(),oJ=ug(),sJ=mt(),aJ=Cm(),uJ=$0(),cJ=$c(),z0=B0(),ft=Bs(),lJ=(function(){function e(t,r,n,i){var o=r||{},s=o.connectionCallback,a=s===void 0?void 0:s,u=o.connectionParams,c=u===void 0?{}:u,l=o.minTimeout,d=l===void 0?z0.MIN_WS_TIMEOUT:l,f=o.timeout,h=f===void 0?z0.WS_TIMEOUT:f,g=o.reconnect,v=g===void 0?!1:g,_=o.reconnectionAttempts,S=_===void 0?1/0:_,b=o.lazy,A=b===void 0?!1:b,O=o.inactivityTimeout,T=O===void 0?0:O,x=o.wsOptionArguments,U=x===void 0?[]:x;if(this.wsImpl=n||nJ,!this.wsImpl)throw new Error("Unable to find native implementation, or alternative implementation for WebSocket!");this.wsProtocols=i||cJ.GRAPHQL_WS,this.connectionCallback=a,this.url=t,this.operations={},this.nextOperationId=0,this.minWsTimeout=d,this.wsTimeout=h,this.unsentMessagesQueue=[],this.reconnect=v,this.reconnecting=!1,this.reconnectionAttempts=S,this.lazy=!!A,this.inactivityTimeout=T,this.closedByUser=!1,this.backoff=new Q0({jitter:.5}),this.eventEmitter=new iJ.EventEmitter,this.middlewares=[],this.client=null,this.maxConnectTimeGenerator=this.createMaxConnectTimeGenerator(),this.connectionParams=this.getConnectionParams(c),this.wsOptionArguments=U,this.lazy||this.connect()}return Object.defineProperty(e.prototype,"status",{get:function(){return this.client===null?this.wsImpl.CLOSED:this.client.readyState},enumerable:!1,configurable:!0}),e.prototype.close=function(t,r){t===void 0&&(t=!0),r===void 0&&(r=!0),this.clearInactivityTimeout(),this.client!==null&&(this.closedByUser=r,t&&(this.clearCheckConnectionInterval(),this.clearMaxConnectTimeout(),this.clearTryReconnectTimeout(),this.unsubscribeAll(),this.sendMessage(void 0,ft.default.GQL_CONNECTION_TERMINATE,null)),this.client.close(),this.client.onopen=null,this.client.onclose=null,this.client.onerror=null,this.client.onmessage=null,this.client=null,this.eventEmitter.emit("disconnected"),t||this.tryReconnect())},e.prototype.request=function(t){var r,n=this.getObserver.bind(this),i=this.executeOperation.bind(this),o=this.unsubscribe.bind(this),s;return this.clearInactivityTimeout(),r={},r[uJ.default]=function(){return this},r.subscribe=function(a,u,c){var l=n(a,u,c);return s=i(t,function(d,f){d===null&&f===null?l.complete&&l.complete():d?l.error&&l.error(d[0]):l.next&&l.next(f)}),{unsubscribe:function(){s&&(o(s),s=null)}}},r},e.prototype.on=function(t,r,n){var i=this.eventEmitter.on(t,r,n);return function(){i.off(t,r,n)}},e.prototype.onConnected=function(t,r){return this.on("connected",t,r)},e.prototype.onConnecting=function(t,r){return this.on("connecting",t,r)},e.prototype.onDisconnected=function(t,r){return this.on("disconnected",t,r)},e.prototype.onReconnected=function(t,r){return this.on("reconnected",t,r)},e.prototype.onReconnecting=function(t,r){return this.on("reconnecting",t,r)},e.prototype.onError=function(t,r){return this.on("error",t,r)},e.prototype.unsubscribeAll=function(){var t=this;Object.keys(this.operations).forEach(function(r){t.unsubscribe(r)})},e.prototype.applyMiddlewares=function(t){var r=this;return new Promise(function(n,i){var o=function(s,a){var u=function(c){if(c)i(c);else if(s.length>0){var l=s.shift();l&&l.applyMiddleware.apply(a,[t,u])}else n(t)};u()};o(K0([],r.middlewares,!0),r)})},e.prototype.use=function(t){var r=this;return t.map(function(n){if(typeof n.applyMiddleware=="function")r.middlewares.push(n);else throw new Error("Middleware must implement the applyMiddleware function.")}),this},e.prototype.getConnectionParams=function(t){return function(){return new Promise(function(r,n){if(typeof t=="function")try{return r(t.call(null))}catch(i){return n(i)}r(t)})}},e.prototype.executeOperation=function(t,r){var n=this;this.client===null&&this.connect();var i=this.generateOperationId();return this.operations[i]={options:t,handler:r},this.applyMiddlewares(t).then(function(o){n.checkOperationOptions(o,r),n.operations[i]&&(n.operations[i]={options:o,handler:r},n.sendMessage(i,ft.default.GQL_START,o))}).catch(function(o){n.unsubscribe(i),r(n.formatErrors(o))}),i},e.prototype.getObserver=function(t,r,n){return typeof t=="function"?{next:function(i){return t(i)},error:function(i){return r&&r(i)},complete:function(){return n&&n()}}:t},e.prototype.createMaxConnectTimeGenerator=function(){var t=this.minWsTimeout,r=this.wsTimeout;return new Q0({min:t,max:r,factor:1.2})},e.prototype.clearCheckConnectionInterval=function(){this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnectionIntervalId=null)},e.prototype.clearMaxConnectTimeout=function(){this.maxConnectTimeoutId&&(clearTimeout(this.maxConnectTimeoutId),this.maxConnectTimeoutId=null)},e.prototype.clearTryReconnectTimeout=function(){this.tryReconnectTimeoutId&&(clearTimeout(this.tryReconnectTimeoutId),this.tryReconnectTimeoutId=null)},e.prototype.clearInactivityTimeout=function(){this.inactivityTimeoutId&&(clearTimeout(this.inactivityTimeoutId),this.inactivityTimeoutId=null)},e.prototype.setInactivityTimeout=function(){var t=this;this.inactivityTimeout>0&&Object.keys(this.operations).length===0&&(this.inactivityTimeoutId=setTimeout(function(){Object.keys(t.operations).length===0&&t.close()},this.inactivityTimeout))},e.prototype.checkOperationOptions=function(t,r){var n=t.query,i=t.variables,o=t.operationName;if(!n)throw new Error("Must provide a query.");if(!r)throw new Error("Must provide an handler.");if(!(0,W0.default)(n)&&!(0,aJ.getOperationAST)(n,o)||o&&!(0,W0.default)(o)||i&&!(0,oJ.default)(i))throw new Error("Incorrect option types. query must be a string or a document,`operationName` must be a string, and `variables` must be an object.")},e.prototype.buildMessage=function(t,r,n){var i=n&&n.query?no(no({},n),{query:typeof n.query=="string"?n.query:(0,sJ.print)(n.query)}):n;return{id:t,type:r,payload:i}},e.prototype.formatErrors=function(t){return Array.isArray(t)?t:t&&t.errors?this.formatErrors(t.errors):t&&t.message?[t]:[{name:"FormatedError",message:"Unknown error",originalError:t}]},e.prototype.sendMessage=function(t,r,n){this.sendMessageRaw(this.buildMessage(t,r,n))},e.prototype.sendMessageRaw=function(t){switch(this.status){case this.wsImpl.OPEN:var r=JSON.stringify(t);try{JSON.parse(r)}catch{this.eventEmitter.emit("error",new Error("Message must be JSON-serializable. Got: "+t))}this.client.send(r);break;case this.wsImpl.CONNECTING:this.unsentMessagesQueue.push(t);break;default:this.reconnecting||this.eventEmitter.emit("error",new Error("A message was not sent because socket is not connected, is closing or is already closed. Message was: "+JSON.stringify(t)))}},e.prototype.generateOperationId=function(){return String(++this.nextOperationId)},e.prototype.tryReconnect=function(){var t=this;if(!(!this.reconnect||this.backoff.attempts>=this.reconnectionAttempts)){this.reconnecting||(Object.keys(this.operations).forEach(function(n){t.unsentMessagesQueue.push(t.buildMessage(n,ft.default.GQL_START,t.operations[n].options))}),this.reconnecting=!0),this.clearTryReconnectTimeout();var r=this.backoff.duration();this.tryReconnectTimeoutId=setTimeout(function(){t.connect()},r)}},e.prototype.flushUnsentMessagesQueue=function(){var t=this;this.unsentMessagesQueue.forEach(function(r){t.sendMessageRaw(r)}),this.unsentMessagesQueue=[]},e.prototype.checkConnection=function(){if(this.wasKeepAliveReceived){this.wasKeepAliveReceived=!1;return}this.reconnecting||this.close(!1,!0)},e.prototype.checkMaxConnectTimeout=function(){var t=this;this.clearMaxConnectTimeout(),this.maxConnectTimeoutId=setTimeout(function(){t.status!==t.wsImpl.OPEN&&(t.reconnecting=!0,t.close(!1,!0))},this.maxConnectTimeGenerator.duration())},e.prototype.connect=function(){var t,r=this;this.client=new((t=this.wsImpl).bind.apply(t,K0([void 0,this.url,this.wsProtocols],this.wsOptionArguments,!1))),this.checkMaxConnectTimeout(),this.client.onopen=function(){return tJ(r,void 0,void 0,function(){var n,i;return rJ(this,function(o){switch(o.label){case 0:if(this.status!==this.wsImpl.OPEN)return[3,4];this.clearMaxConnectTimeout(),this.closedByUser=!1,this.eventEmitter.emit(this.reconnecting?"reconnecting":"connecting"),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.connectionParams()];case 2:return n=o.sent(),this.sendMessage(void 0,ft.default.GQL_CONNECTION_INIT,n),this.flushUnsentMessagesQueue(),[3,4];case 3:return i=o.sent(),this.sendMessage(void 0,ft.default.GQL_CONNECTION_ERROR,i),this.flushUnsentMessagesQueue(),[3,4];case 4:return[2]}})})},this.client.onclose=function(){r.closedByUser||r.close(!1,!1)},this.client.onerror=function(n){r.eventEmitter.emit("error",n)},this.client.onmessage=function(n){var i=n.data;r.processReceivedData(i)}},e.prototype.processReceivedData=function(t){var r,n;try{r=JSON.parse(t),n=r.id}catch{throw new Error("Message must be JSON-parseable. Got: "+t)}if([ft.default.GQL_DATA,ft.default.GQL_COMPLETE,ft.default.GQL_ERROR].indexOf(r.type)!==-1&&!this.operations[n]){this.unsubscribe(n);return}switch(r.type){case ft.default.GQL_CONNECTION_ERROR:this.connectionCallback&&this.connectionCallback(r.payload);break;case ft.default.GQL_CONNECTION_ACK:this.eventEmitter.emit(this.reconnecting?"reconnected":"connected",r.payload),this.reconnecting=!1,this.backoff.reset(),this.maxConnectTimeGenerator.reset(),this.connectionCallback&&this.connectionCallback();break;case ft.default.GQL_COMPLETE:var i=this.operations[n].handler;delete this.operations[n],i.call(this,null,null);break;case ft.default.GQL_ERROR:this.operations[n].handler(this.formatErrors(r.payload),null),delete this.operations[n];break;case ft.default.GQL_DATA:var o=r.payload.errors?no(no({},r.payload),{errors:this.formatErrors(r.payload.errors)}):r.payload;this.operations[n].handler(null,o);break;case ft.default.GQL_CONNECTION_KEEP_ALIVE:var s=typeof this.wasKeepAliveReceived>"u";this.wasKeepAliveReceived=!0,s&&this.checkConnection(),this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnection()),this.checkConnectionIntervalId=setInterval(this.checkConnection.bind(this),this.wsTimeout);break;default:throw new Error("Invalid message type!")}},e.prototype.unsubscribe=function(t){this.operations[t]&&(delete this.operations[t],this.setInactivityTimeout(),this.sendMessage(t,ft.default.GQL_STOP,void 0))},e})();Bt.SubscriptionClient=lJ});var zn=y((Oae,J0)=>{"use strict";p();J0.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),EMPTY_BUFFER:Buffer.alloc(0),NOOP:()=>{}}});var Ks=y((xae,fg)=>{"use strict";p();var{EMPTY_BUFFER:pJ}=zn();function X0(e,t){if(e.length===0)return pJ;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),n=0;for(let i=0;i<e.length;i++){let o=e[i];r.set(o,n),n+=o.length}return n<t?r.slice(0,n):r}function Z0(e,t,r,n,i){for(let o=0;o<i;o++)r[n+o]=e[o]^t[o&3]}function ex(e,t){let r=e.length;for(let n=0;n<r;n++)e[n]^=t[n&3]}function tx(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function Bc(e){if(Bc.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=Buffer.from(e):ArrayBuffer.isView(e)?t=Buffer.from(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Bc.readOnly=!1),t}try{let e=M("bufferutil"),t=e.BufferUtil||e;fg.exports={concat:X0,mask(r,n,i,o,s){s<48?Z0(r,n,i,o,s):t.mask(r,n,i,o,s)},toArrayBuffer:tx,toBuffer:Bc,unmask(r,n){r.length<32?ex(r,n):t.unmask(r,n)}}}catch{fg.exports={concat:X0,mask:Z0,toArrayBuffer:tx,toBuffer:Bc,unmask:ex}}});var ix=y((Rae,nx)=>{"use strict";p();var rx=Symbol("kDone"),hg=Symbol("kRun"),mg=class{constructor(t){this[rx]=()=>{this.pending--,this[hg]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[hg]()}[hg](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[rx])}}};nx.exports=mg});var Ws=y((Pae,ux)=>{"use strict";p();var Hs=M("zlib"),ox=Ks(),dJ=ix(),{kStatusCode:sx,NOOP:fJ}=zn(),hJ=Buffer.from([0,0,255,255]),Qc=Symbol("permessage-deflate"),Dr=Symbol("total-length"),Qs=Symbol("callback"),pn=Symbol("buffers"),Hc=Symbol("error"),Kc,gg=class{constructor(t,r,n){if(this._maxPayload=n|0,this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!Kc){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Kc=new dJ(i)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[Qs];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,n=t.find(i=>!(r.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>i.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(n.server_no_context_takeover=!0),r.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(n.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?n.client_max_window_bits=r.clientMaxWindowBits:(n.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(n=>{let i=r[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);r[n]=i})}),t}decompress(t,r,n){Kc.add(i=>{this._decompress(t,r,(o,s)=>{i(),n(o,s)})})}compress(t,r,n){Kc.add(i=>{this._compress(t,r,(o,s)=>{i(),n(o,s)})})}_decompress(t,r,n){let i=this._isServer?"client":"server";if(!this._inflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?Hs.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=Hs.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[Qc]=this,this._inflate[Dr]=0,this._inflate[pn]=[],this._inflate.on("error",gJ),this._inflate.on("data",ax)}this._inflate[Qs]=n,this._inflate.write(t),r&&this._inflate.write(hJ),this._inflate.flush(()=>{let o=this._inflate[Hc];if(o){this._inflate.close(),this._inflate=null,n(o);return}let s=ox.concat(this._inflate[pn],this._inflate[Dr]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Dr]=0,this._inflate[pn]=[],r&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,s)})}_compress(t,r,n){let i=this._isServer?"server":"client";if(!this._deflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?Hs.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=Hs.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[Dr]=0,this._deflate[pn]=[],this._deflate.on("error",fJ),this._deflate.on("data",mJ)}this._deflate[Qs]=n,this._deflate.write(t),this._deflate.flush(Hs.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=ox.concat(this._deflate[pn],this._deflate[Dr]);r&&(o=o.slice(0,o.length-4)),this._deflate[Qs]=null,this._deflate[Dr]=0,this._deflate[pn]=[],r&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,o)})}};ux.exports=gg;function mJ(e){this[pn].push(e),this[Dr]+=e.length}function ax(e){if(this[Dr]+=e.length,this[Qc]._maxPayload<1||this[Dr]<=this[Qc]._maxPayload){this[pn].push(e);return}this[Hc]=new RangeError("Max payload size exceeded"),this[Hc].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Hc][sx]=1009,this.removeListener("data",ax),this.reset()}function gJ(e){this[Qc]._inflate=null,e[sx]=1007,this[Qs](e)}});var vg=y((Lae,yg)=>{"use strict";p();function cx(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function lx(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}try{let e=M("utf-8-validate");typeof e=="object"&&(e=e.Validation.isValidUTF8),yg.exports={isValidStatusCode:cx,isValidUTF8(t){return t.length<150?lx(t):e(t)}}}catch{yg.exports={isValidStatusCode:cx,isValidUTF8:lx}}});var Sg=y((jae,gx)=>{"use strict";p();var{Writable:yJ}=M("stream"),px=Ws(),{BINARY_TYPES:vJ,EMPTY_BUFFER:EJ,kStatusCode:_J,kWebSocket:bJ}=zn(),{concat:Eg,toArrayBuffer:SJ,unmask:TJ}=Ks(),{isValidStatusCode:IJ,isValidUTF8:dx}=vg(),zs=0,fx=1,hx=2,mx=3,_g=4,wJ=5,bg=class extends yJ{constructor(t,r,n,i,o,s){super(),this._binaryType=t||vJ[0],this[bJ]=void 0,this._extensions=r||{},this._isServer=!!n,this._maxBufferedChunks=o|0,this._maxFragments=s|0,this._maxPayload=i|0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=zs,this._loop=!1}_write(t,r,n){if(this._opcode===8&&this._state==zs)return n();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks)return n(ke(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(n)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=n.slice(t),n.slice(0,t)}let r=Buffer.allocUnsafe(t);do{let n=this._buffers[0],i=r.length-t;t>=n.length?r.set(this._buffers.shift(),i):(r.set(new Uint8Array(n.buffer,n.byteOffset,t),i),this._buffers[0]=n.slice(t)),t-=n.length}while(t>0);return r}startLoop(t){let r;this._loop=!0;do switch(this._state){case zs:r=this.getInfo();break;case fx:r=this.getPayloadLength16();break;case hx:r=this.getPayloadLength64();break;case mx:this.getMask();break;case _g:r=this.getData(t);break;default:this._loop=!1;return}while(this._loop);t(r)}getInfo(){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0)return this._loop=!1,ke(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");let r=(t[0]&64)===64;if(r&&!this._extensions[px.extensionName])return this._loop=!1,ke(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(r)return this._loop=!1,ke(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,ke(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented)return this._loop=!1,ke(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin)return this._loop=!1,ke(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(r)return this._loop=!1,ke(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125)return this._loop=!1,ke(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}else return this._loop=!1,ke(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked)return this._loop=!1,ke(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,ke(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(this._payloadLength===126)this._state=fx;else if(this._payloadLength===127)this._state=hx;else return this.haveLength()}getPayloadLength16(){if(this._bufferedBytes<2){this._loop=!1;return}return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength()}getPayloadLength64(){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),r=t.readUInt32BE(0);return r>Math.pow(2,21)-1?(this._loop=!1,ke(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=r*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,ke(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=mx:this._state=_g}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=_g}getData(t){let r=EJ;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&TJ(r,this._mask)}if(this._opcode>7)return this.controlMessage(r);if(this._compressed){this._state=wJ,this.decompress(r,t);return}if(r.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments)return this._loop=!1,ke(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");this._messageLength=this._totalPayloadLength,this._fragments.push(r)}return this.dataMessage()}decompress(t,r){this._extensions[px.extensionName].decompress(t,this._fin,(i,o)=>{if(i)return r(i);if(o.length){if(this._messageLength+=o.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return r(ke(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));if(this._maxFragments>0&&this._fragments.length>=this._maxFragments)return r(ke(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));this._fragments.push(o)}let s=this.dataMessage();if(s)return r(s);this.startLoop(r)})}dataMessage(){if(this._fin){let t=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=Eg(r,t):this._binaryType==="arraybuffer"?n=SJ(Eg(r,t)):n=r,this.emit("message",n)}else{let n=Eg(r,t);if(!dx(n))return this._loop=!1,ke(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",n.toString())}}this._state=zs}controlMessage(t){if(this._opcode===8)if(this._loop=!1,t.length===0)this.emit("conclude",1005,""),this.end();else{if(t.length===1)return ke(RangeError,"invalid payload length 1",!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");{let r=t.readUInt16BE(0);if(!IJ(r))return ke(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");let n=t.slice(2);if(!dx(n))return ke(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("conclude",r,n.toString()),this.end()}}else this._opcode===9?this.emit("ping",t):this.emit("pong",t);this._state=zs}};gx.exports=bg;function ke(e,t,r,n,i){let o=new e(r?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,ke),o.code=i,o[_J]=n,o}});var Ig=y((Uae,Ex)=>{"use strict";p();var Fae=M("net"),qae=M("tls"),{randomFillSync:OJ}=M("crypto"),yx=Ws(),{EMPTY_BUFFER:AJ}=zn(),{isValidStatusCode:xJ}=vg(),{mask:vx,toBuffer:Lr}=Ks(),Yn=Buffer.alloc(4),Tg=class e{constructor(t,r){this._extensions=r||{},this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(t,r){let n=r.mask&&r.readOnly,i=r.mask?6:2,o=t.length;t.length>=65536?(i+=8,o=127):t.length>125&&(i+=2,o=126);let s=Buffer.allocUnsafe(n?t.length+i:i);return s[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(s[0]|=64),s[1]=o,o===126?s.writeUInt16BE(t.length,2):o===127&&(s.writeUInt32BE(0,2),s.writeUInt32BE(t.length,6)),r.mask?(OJ(Yn,0,4),s[1]|=128,s[i-4]=Yn[0],s[i-3]=Yn[1],s[i-2]=Yn[2],s[i-1]=Yn[3],n?(vx(t,Yn,s,i,t.length),[s]):(vx(t,Yn,t,0,t.length),[s,t])):[s,t]}close(t,r,n,i){let o;if(t===void 0)o=AJ;else{if(typeof t!="number"||!xJ(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||r==="")o=Buffer.allocUnsafe(2),o.writeUInt16BE(t,0);else{let s=Buffer.byteLength(r);if(s>123)throw new RangeError("The message must not be greater than 123 bytes");o=Buffer.allocUnsafe(2+s),o.writeUInt16BE(t,0),o.write(r,2)}}this._deflating?this.enqueue([this.doClose,o,n,i]):this.doClose(o,n,i)}doClose(t,r,n){this.sendFrame(e.frame(t,{fin:!0,rsv1:!1,opcode:8,mask:r,readOnly:!1}),n)}ping(t,r,n){let i=Lr(t);if(i.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPing,i,r,Lr.readOnly,n]):this.doPing(i,r,Lr.readOnly,n)}doPing(t,r,n,i){this.sendFrame(e.frame(t,{fin:!0,rsv1:!1,opcode:9,mask:r,readOnly:n}),i)}pong(t,r,n){let i=Lr(t);if(i.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPong,i,r,Lr.readOnly,n]):this.doPong(i,r,Lr.readOnly,n)}doPong(t,r,n,i){this.sendFrame(e.frame(t,{fin:!0,rsv1:!1,opcode:10,mask:r,readOnly:n}),i)}send(t,r,n){let i=Lr(t),o=this._extensions[yx.extensionName],s=r.binary?2:1,a=r.compress;if(this._firstFragment?(this._firstFragment=!1,a&&o&&(a=i.length>=o._threshold),this._compress=a):(a=!1,s=0),r.fin&&(this._firstFragment=!0),o){let u={fin:r.fin,rsv1:a,opcode:s,mask:r.mask,readOnly:Lr.readOnly};this._deflating?this.enqueue([this.dispatch,i,this._compress,u,n]):this.dispatch(i,this._compress,u,n)}else this.sendFrame(e.frame(i,{fin:r.fin,rsv1:!1,opcode:s,mask:r.mask,readOnly:Lr.readOnly}),n)}dispatch(t,r,n,i){if(!r){this.sendFrame(e.frame(t,n),i);return}let o=this._extensions[yx.extensionName];this._bufferedBytes+=t.length,this._deflating=!0,o.compress(t,n.fin,(s,a)=>{if(this._socket.destroyed){let u=new Error("The socket was closed while data was being compressed");typeof i=="function"&&i(u);for(let c=0;c<this._queue.length;c++){let l=this._queue[c][4];typeof l=="function"&&l(u)}return}this._bufferedBytes-=t.length,this._deflating=!1,n.readOnly=!1,this.sendFrame(e.frame(a,n),i),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[1].length,Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[1].length,this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};Ex.exports=Tg});var bx=y((Gae,_x)=>{"use strict";p();var io=class{constructor(t,r){this.target=r,this.type=t}},wg=class extends io{constructor(t,r){super("message",r),this.data=t}},Og=class extends io{constructor(t,r,n){super("close",n),this.wasClean=n._closeFrameReceived&&n._closeFrameSent,this.reason=r,this.code=t}},Ag=class extends io{constructor(t){super("open",t)}},xg=class extends io{constructor(t,r){super("error",r),this.message=t.message,this.error=t}},CJ={addEventListener(e,t,r){if(typeof t!="function")return;function n(u){t.call(this,new wg(u,this))}function i(u,c){t.call(this,new Og(u,c,this))}function o(u){t.call(this,new xg(u,this))}function s(){t.call(this,new Ag(this))}let a=r&&r.once?"once":"on";e==="message"?(n._listener=t,this[a](e,n)):e==="close"?(i._listener=t,this[a](e,i)):e==="error"?(o._listener=t,this[a](e,o)):e==="open"?(s._listener=t,this[a](e,s)):this[a](e,t)},removeEventListener(e,t){let r=this.listeners(e);for(let n=0;n<r.length;n++)(r[n]===t||r[n]._listener===t)&&this.removeListener(e,r[n])}};_x.exports=CJ});var Cg=y((Bae,Sx)=>{"use strict";p();var Ys=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function vr(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function RJ(e){let t=Object.create(null);if(e===void 0||e==="")return t;let r=Object.create(null),n=!1,i=!1,o=!1,s,a,u=-1,c=-1,l=0;for(;l<e.length;l++){let f=e.charCodeAt(l);if(s===void 0)if(c===-1&&Ys[f]===1)u===-1&&(u=l);else if(f===32||f===9)c===-1&&u!==-1&&(c=l);else if(f===59||f===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${l}`);c===-1&&(c=l);let h=e.slice(u,c);f===44?(vr(t,h,r),r=Object.create(null)):s=h,u=c=-1}else throw new SyntaxError(`Unexpected character at index ${l}`);else if(a===void 0)if(c===-1&&Ys[f]===1)u===-1&&(u=l);else if(f===32||f===9)c===-1&&u!==-1&&(c=l);else if(f===59||f===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${l}`);c===-1&&(c=l),vr(r,e.slice(u,c),!0),f===44&&(vr(t,s,r),r=Object.create(null),s=void 0),u=c=-1}else if(f===61&&u!==-1&&c===-1)a=e.slice(u,l),u=c=-1;else throw new SyntaxError(`Unexpected character at index ${l}`);else if(i){if(Ys[f]!==1)throw new SyntaxError(`Unexpected character at index ${l}`);u===-1?u=l:n||(n=!0),i=!1}else if(o)if(Ys[f]===1)u===-1&&(u=l);else if(f===34&&u!==-1)o=!1,c=l;else if(f===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${l}`);else if(f===34&&e.charCodeAt(l-1)===61)o=!0;else if(c===-1&&Ys[f]===1)u===-1&&(u=l);else if(u!==-1&&(f===32||f===9))c===-1&&(c=l);else if(f===59||f===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${l}`);c===-1&&(c=l);let h=e.slice(u,c);n&&(h=h.replace(/\\/g,""),n=!1),vr(r,a,h),f===44&&(vr(t,s,r),r=Object.create(null),s=void 0),a=void 0,u=c=-1}else throw new SyntaxError(`Unexpected character at index ${l}`)}if(u===-1||o)throw new SyntaxError("Unexpected end of input");c===-1&&(c=l);let d=e.slice(u,c);return s===void 0?vr(t,d,r):(a===void 0?vr(r,d,!0):n?vr(r,a,d.replace(/\\/g,"")):vr(r,a,d),vr(t,s,r)),t}function NJ(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(n=>[t].concat(Object.keys(n).map(i=>{let o=n[i];return Array.isArray(o)||(o=[o]),o.map(s=>s===!0?i:`${i}=${s}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Sx.exports={format:NJ,parse:RJ}});var kg=y((Qae,Px)=>{"use strict";p();var PJ=M("events"),DJ=M("https"),LJ=M("http"),wx=M("net"),kJ=M("tls"),{randomBytes:jJ,createHash:MJ}=M("crypto"),{Readable:Hae}=M("stream"),{URL:Rg}=M("url"),dn=Ws(),FJ=Sg(),qJ=Ig(),{BINARY_TYPES:Tx,EMPTY_BUFFER:Ng,GUID:UJ,kStatusCode:VJ,kWebSocket:st,NOOP:Ox}=zn(),{addEventListener:GJ,removeEventListener:$J}=bx(),{format:BJ,parse:KJ}=Cg(),{toBuffer:HJ}=Ks(),kr=["CONNECTING","OPEN","CLOSING","CLOSED"],Pg=[8,13],QJ=30*1e3,qe=class e extends PJ{constructor(t,r,n){super(),this._binaryType=Tx[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage="",this._closeTimer=null,this._extensions={},this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,Array.isArray(r)?r=r.join(", "):typeof r=="object"&&r!==null&&(n=r,r=void 0),Ax(this,t,r,n)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(t){Tx.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get onclose(){}set onclose(t){}get onerror(){}set onerror(t){}get onopen(){}set onopen(t){}get onmessage(){}set onmessage(t){}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,n,i,o){let s=new FJ(this.binaryType,this._extensions,this._isServer,n,i,o);this._sender=new qJ(t,this._extensions),this._receiver=s,this._socket=t,s[st]=this,t[st]=this,s.on("conclude",YJ),s.on("drain",JJ),s.on("error",XJ),s.on("message",ZJ),s.on("ping",e2),s.on("pong",t2),t.setTimeout(0),t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",Cx),t.on("data",Wc),t.on("end",Rx),t.on("error",Nx),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[dn.extensionName]&&this._extensions[dn.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING)return At(this,this._req,"WebSocket was closed before the connection was established");if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),QJ)}}ping(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Lg(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||Ng,r,n)}pong(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Lg(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||Ng,r,n)}send(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(n=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Lg(this,t,n);return}let i={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[dn.extensionName]||(i.compress=!1),this._sender.send(t||Ng,i,n)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING)return At(this,this._req,"WebSocket was closed before the connection was established");this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(qe,"CONNECTING",{enumerable:!0,value:kr.indexOf("CONNECTING")});Object.defineProperty(qe.prototype,"CONNECTING",{enumerable:!0,value:kr.indexOf("CONNECTING")});Object.defineProperty(qe,"OPEN",{enumerable:!0,value:kr.indexOf("OPEN")});Object.defineProperty(qe.prototype,"OPEN",{enumerable:!0,value:kr.indexOf("OPEN")});Object.defineProperty(qe,"CLOSING",{enumerable:!0,value:kr.indexOf("CLOSING")});Object.defineProperty(qe.prototype,"CLOSING",{enumerable:!0,value:kr.indexOf("CLOSING")});Object.defineProperty(qe,"CLOSED",{enumerable:!0,value:kr.indexOf("CLOSED")});Object.defineProperty(qe.prototype,"CLOSED",{enumerable:!0,value:kr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","protocol","readyState","url"].forEach(e=>{Object.defineProperty(qe.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(qe.prototype,`on${e}`,{enumerable:!0,get(){let t=this.listeners(e);for(let r=0;r<t.length;r++)if(t[r]._listener)return t[r]._listener},set(t){let r=this.listeners(e);for(let n=0;n<r.length;n++)r[n]._listener&&this.removeListener(e,r[n]);this.addEventListener(e,t)}})});qe.prototype.addEventListener=GJ;qe.prototype.removeEventListener=$J;Px.exports=qe;function Ax(e,t,r,n){let i={protocolVersion:Pg[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:void 0,host:void 0,path:void 0,port:void 0};if(!Pg.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Pg.join(", ")})`);let o;t instanceof Rg?(o=t,e._url=t.href):(o=new Rg(t),e._url=t);let s=o.protocol==="ws+unix:";if(!o.host&&(!s||!o.pathname)){let h=new Error(`Invalid URL: ${e.url}`);if(e._redirects===0)throw h;Dg(e,h);return}let a=o.protocol==="wss:"||o.protocol==="https:",u=a?443:80,c=jJ(16).toString("base64"),l=a?DJ.get:LJ.get,d;if(i.createConnection=a?zJ:WJ,i.defaultPort=i.defaultPort||u,i.port=o.port||u,i.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,i.headers={"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":c,Connection:"Upgrade",Upgrade:"websocket",...i.headers},i.path=o.pathname+o.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(d=new dn(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=BJ({[dn.extensionName]:d.offer()})),r&&(i.headers["Sec-WebSocket-Protocol"]=r),i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(o.username||o.password)&&(i.auth=`${o.username}:${o.password}`),s){let h=i.path.split(":");i.socketPath=h[0],i.path=h[1]}if(i.followRedirects){if(e._redirects===0){e._originalUnixSocket=s,e._originalSecure=a,e._originalHostOrSocketPath=s?i.socketPath:o.host;let h=n&&n.headers;if(n={...n,headers:{}},h)for(let[g,v]of Object.entries(h))n.headers[g.toLowerCase()]=v}else{let h=s?e._originalUnixSocket?i.socketPath===e._originalHostOrSocketPath:!1:e._originalUnixSocket?!1:o.host===e._originalHostOrSocketPath;(!h||e._originalSecure&&!a)&&(delete i.headers.authorization,delete i.headers.cookie,h||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64"))}let f=e._req=l(i);i.timeout&&f.on("timeout",()=>{At(e,f,"Opening handshake has timed out")}),f.on("error",h=>{f===null||f.aborted||(f=e._req=null,Dg(e,h))}),f.on("response",h=>{let g=h.headers.location,v=h.statusCode;if(g&&i.followRedirects&&v>=300&&v<400){if(++e._redirects>i.maxRedirects){At(e,f,"Maximum redirects exceeded");return}f.abort();let _;try{_=new Rg(g,t)}catch(S){Dg(e,S);return}Ax(e,_,r,n)}else e.emit("unexpected-response",f,h)||At(e,f,`Unexpected server response: ${h.statusCode}`)}),f.on("upgrade",(h,g,v)=>{if(e.emit("upgrade",h),e.readyState!==qe.CONNECTING)return;f=e._req=null;let _=h.headers.upgrade;if(_===void 0||_.toLowerCase()!=="websocket"){At(e,g,"Invalid Upgrade header");return}let S=MJ("sha1").update(c+UJ).digest("base64");if(h.headers["sec-websocket-accept"]!==S){At(e,g,"Invalid Sec-WebSocket-Accept header");return}let b=h.headers["sec-websocket-protocol"],A=(r||"").split(/, */),O;if(!r&&b?O="Server sent a subprotocol but none was requested":r&&!b?O="Server sent no subprotocol":b&&!A.includes(b)&&(O="Server sent an invalid subprotocol"),O){At(e,g,O);return}b&&(e._protocol=b);let T=h.headers["sec-websocket-extensions"];if(T!==void 0){if(!d){At(e,g,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let x;try{x=KJ(T)}catch{At(e,g,"Invalid Sec-WebSocket-Extensions header");return}let U=Object.keys(x);if(U.length){if(U.length!==1||U[0]!==dn.extensionName){At(e,g,"Server indicated an extension that was not requested");return}try{d.accept(x[dn.extensionName])}catch{At(e,g,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[dn.extensionName]=d}}e.setSocket(g,v,i.maxPayload,i.maxBufferedChunks,i.maxFragments)})}function Dg(e,t){e._readyState=qe.CLOSING,e.emit("error",t),e.emitClose()}function WJ(e){return e.path=e.socketPath,wx.connect(e)}function zJ(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=wx.isIP(e.host)?"":e.host),kJ.connect(e)}function At(e,t,r){e._readyState=qe.CLOSING;let n=new Error(r);Error.captureStackTrace(n,At),t.setHeader?(t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),t.once("abort",e.emitClose.bind(e)),e.emit("error",n)):(t.destroy(n),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function Lg(e,t,r){if(t){let n=HJ(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${e.readyState} (${kr[e.readyState]})`);r(n)}}function YJ(e,t){let r=this[st];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[st]!==void 0&&(r._socket.removeListener("data",Wc),process.nextTick(xx,r._socket),e===1005?r.close():r.close(e,t))}function JJ(){this[st]._socket.resume()}function XJ(e){let t=this[st];t._socket[st]!==void 0&&(t._socket.removeListener("data",Wc),process.nextTick(xx,t._socket),t.close(e[VJ])),t.emit("error",e)}function Ix(){this[st].emitClose()}function ZJ(e){this[st].emit("message",e)}function e2(e){let t=this[st];t.pong(e,!t._isServer,Ox),t.emit("ping",e)}function t2(e){this[st].emit("pong",e)}function xx(e){e.resume()}function Cx(){let e=this[st];this.removeListener("close",Cx),this.removeListener("data",Wc),this.removeListener("end",Rx),e._readyState=qe.CLOSING;let t;!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&(t=e._socket.read())!==null&&e._receiver.write(t),e._receiver.end(),this[st]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",Ix),e._receiver.on("finish",Ix))}function Wc(e){this[st]._receiver.write(e)||this.pause()}function Rx(){let e=this[st];e._readyState=qe.CLOSING,e._receiver.end(),this.end()}function Nx(){let e=this[st];this.removeListener("error",Nx),this.on("error",Ox),e&&(e._readyState=qe.CLOSING,this.destroy())}});var jx=y((zae,kx)=>{"use strict";p();var{Duplex:r2}=M("stream");function Dx(e){e.emit("close")}function n2(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Lx(e){this.removeListener("error",Lx),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function i2(e,t){let r=!0,n=!0;function i(){r&&e._socket.resume()}e.readyState===e.CONNECTING?e.once("open",function(){e._receiver.removeAllListeners("drain"),e._receiver.on("drain",i)}):(e._receiver.removeAllListeners("drain"),e._receiver.on("drain",i));let o=new r2({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(a){o.push(a)||(r=!1,e._socket.pause())}),e.once("error",function(a){o.destroyed||(n=!1,o.destroy(a))}),e.once("close",function(){o.destroyed||o.push(null)}),o._destroy=function(s,a){if(e.readyState===e.CLOSED){a(s),process.nextTick(Dx,o);return}let u=!1;e.once("error",function(l){u=!0,a(l)}),e.once("close",function(){u||a(s),process.nextTick(Dx,o)}),n&&e.terminate()},o._final=function(s){if(e.readyState===e.CONNECTING){e.once("open",function(){o._final(s)});return}e._socket!==null&&(e._socket._writableState.finished?(s(),o._readableState.endEmitted&&o.destroy()):(e._socket.once("finish",function(){s()}),e.close()))},o._read=function(){(e.readyState===e.OPEN||e.readyState===e.CLOSING)&&!r&&(r=!0,e._receiver._writableState.needDrain||e._socket.resume())},o._write=function(s,a,u){if(e.readyState===e.CONNECTING){e.once("open",function(){o._write(s,a,u)});return}e.send(s,u)},o.on("end",n2),o.on("error",Lx),o}kx.exports=i2});var Vx=y((eue,Ux)=>{"use strict";p();var o2=M("events"),zc=M("http"),Jae=M("https"),Xae=M("net"),Zae=M("tls"),{createHash:s2}=M("crypto"),Jn=Ws(),a2=kg(),{format:u2,parse:c2}=Cg(),{GUID:l2,kWebSocket:p2}=zn(),d2=/^[+/0-9A-Za-z]{22}==$/,Mx=0,Fx=1,qx=2,Mg=class extends o2{constructor(t,r){if(super(),t={maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=zc.createServer((n,i)=>{let o=zc.STATUS_CODES[426];i.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),i.end(o)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=f2(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,o,s)=>{this.handleUpgrade(i,o,s,n)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set),this.options=t,this._state=Mx}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(t&&this.once("close",t),this._state===qx){process.nextTick(jg,this);return}if(this._state===Fx)return;if(this._state=Fx,this.clients)for(let n of this.clients)n.terminate();let r=this._server;if(r&&(this._removeListeners(),this._removeListeners=this._server=null,this.options.port!=null)){r.close(jg.bind(void 0,this));return}process.nextTick(jg,this)}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,n,i){r.on("error",Fg);let o=t.headers["sec-websocket-key"]!==void 0?t.headers["sec-websocket-key"].trim():!1,s=t.headers.upgrade,a=+t.headers["sec-websocket-version"],u={};if(t.method!=="GET"||s===void 0||s.toLowerCase()!=="websocket"||!o||!d2.test(o)||a!==8&&a!==13||!this.shouldHandle(t))return Js(r,400);if(this.options.perMessageDeflate){let c=new Jn(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let l=c2(t.headers["sec-websocket-extensions"]);l[Jn.extensionName]&&(c.accept(l[Jn.extensionName]),u[Jn.extensionName]=c)}catch{return Js(r,400)}}if(this.options.verifyClient){let c={origin:t.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(c,(l,d,f,h)=>{if(!l)return Js(r,d||401,f,h);this.completeUpgrade(o,u,t,r,n,i)});return}if(!this.options.verifyClient(c))return Js(r,401)}this.completeUpgrade(o,u,t,r,n,i)}completeUpgrade(t,r,n,i,o,s){if(!i.readable||!i.writable)return i.destroy();if(i[p2])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Mx)return Js(i,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${s2("sha1").update(t+l2).digest("base64")}`],c=new a2(null),l=n.headers["sec-websocket-protocol"];if(l&&(l=l.split(",").map(h2),this.options.handleProtocols?l=this.options.handleProtocols(l,n):l=l[0],l&&(u.push(`Sec-WebSocket-Protocol: ${l}`),c._protocol=l)),r[Jn.extensionName]){let d=r[Jn.extensionName].params,f=u2({[Jn.extensionName]:[d]});u.push(`Sec-WebSocket-Extensions: ${f}`),c._extensions=r}this.emit("headers",u,n),i.write(u.concat(`\r
|
|
199
|
+
`),'"""'+r+'"""'}});var bA=y(cn=>{"use strict";p();Object.defineProperty(cn,"__esModule",{value:!0});cn.findBreakingChanges=Hz;cn.findDangerousChanges=Qz;cn.DangerousChangeType=cn.BreakingChangeType=void 0;var zi=Fs(Tt()),fA=Fs(Qr()),qz=Fs(ae()),_A=Fs(et()),Uz=Fs(Zo()),Vz=mt(),Gz=Hr(),$z=pr(),le=ie(),Bz=ls();function Fs(e){return e&&e.__esModule?e:{default:e}}function hA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function mA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hA(Object(r),!0).forEach(function(n){Kz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Kz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ge=Object.freeze({TYPE_REMOVED:"TYPE_REMOVED",TYPE_CHANGED_KIND:"TYPE_CHANGED_KIND",TYPE_REMOVED_FROM_UNION:"TYPE_REMOVED_FROM_UNION",VALUE_REMOVED_FROM_ENUM:"VALUE_REMOVED_FROM_ENUM",REQUIRED_INPUT_FIELD_ADDED:"REQUIRED_INPUT_FIELD_ADDED",IMPLEMENTED_INTERFACE_REMOVED:"IMPLEMENTED_INTERFACE_REMOVED",FIELD_REMOVED:"FIELD_REMOVED",FIELD_CHANGED_KIND:"FIELD_CHANGED_KIND",REQUIRED_ARG_ADDED:"REQUIRED_ARG_ADDED",ARG_REMOVED:"ARG_REMOVED",ARG_CHANGED_KIND:"ARG_CHANGED_KIND",DIRECTIVE_REMOVED:"DIRECTIVE_REMOVED",DIRECTIVE_ARG_REMOVED:"DIRECTIVE_ARG_REMOVED",REQUIRED_DIRECTIVE_ARG_ADDED:"REQUIRED_DIRECTIVE_ARG_ADDED",DIRECTIVE_REPEATABLE_REMOVED:"DIRECTIVE_REPEATABLE_REMOVED",DIRECTIVE_LOCATION_REMOVED:"DIRECTIVE_LOCATION_REMOVED"});cn.BreakingChangeType=Ge;var Rr=Object.freeze({VALUE_ADDED_TO_ENUM:"VALUE_ADDED_TO_ENUM",TYPE_ADDED_TO_UNION:"TYPE_ADDED_TO_UNION",OPTIONAL_INPUT_FIELD_ADDED:"OPTIONAL_INPUT_FIELD_ADDED",OPTIONAL_ARG_ADDED:"OPTIONAL_ARG_ADDED",IMPLEMENTED_INTERFACE_ADDED:"IMPLEMENTED_INTERFACE_ADDED",ARG_DEFAULT_VALUE_CHANGE:"ARG_DEFAULT_VALUE_CHANGE"});cn.DangerousChangeType=Rr;function Hz(e,t){var r=SA(e,t).filter(function(n){return n.type in Ge});return r}function Qz(e,t){var r=SA(e,t).filter(function(n){return n.type in Rr});return r}function SA(e,t){return[].concat(zz(e,t),Wz(e,t))}function Wz(e,t){for(var r=[],n=Nr(e.getDirectives(),t.getDirectives()),i=0,o=n.removed;i<o.length;i++){var s=o[i];r.push({type:Ge.DIRECTIVE_REMOVED,description:"".concat(s.name," was removed.")})}for(var a=0,u=n.persisted;a<u.length;a++){for(var c=u[a],l=c[0],d=c[1],f=Nr(l.args,d.args),h=0,g=f.added;h<g.length;h++){var v=g[h];(0,le.isRequiredArgument)(v)&&r.push({type:Ge.REQUIRED_DIRECTIVE_ARG_ADDED,description:"A required arg ".concat(v.name," on directive ").concat(l.name," was added.")})}for(var _=0,b=f.removed;_<b.length;_++){var S=b[_];r.push({type:Ge.DIRECTIVE_ARG_REMOVED,description:"".concat(S.name," was removed from ").concat(l.name,".")})}l.isRepeatable&&!d.isRepeatable&&r.push({type:Ge.DIRECTIVE_REPEATABLE_REMOVED,description:"Repeatable flag was removed from ".concat(l.name,".")});for(var I=0,A=l.locations;I<A.length;I++){var T=A[I];d.locations.indexOf(T)===-1&&r.push({type:Ge.DIRECTIVE_LOCATION_REMOVED,description:"".concat(T," was removed from ").concat(l.name,".")})}}return r}function zz(e,t){for(var r=[],n=Nr((0,zi.default)(e.getTypeMap()),(0,zi.default)(t.getTypeMap())),i=0,o=n.removed;i<o.length;i++){var s=o[i];r.push({type:Ge.TYPE_REMOVED,description:(0,$z.isSpecifiedScalarType)(s)?"Standard scalar ".concat(s.name," was removed because it is not referenced anymore."):"".concat(s.name," was removed.")})}for(var a=0,u=n.persisted;a<u.length;a++){var c=u[a],l=c[0],d=c[1];(0,le.isEnumType)(l)&&(0,le.isEnumType)(d)?r.push.apply(r,Xz(l,d)):(0,le.isUnionType)(l)&&(0,le.isUnionType)(d)?r.push.apply(r,Jz(l,d)):(0,le.isInputObjectType)(l)&&(0,le.isInputObjectType)(d)?r.push.apply(r,Yz(l,d)):(0,le.isObjectType)(l)&&(0,le.isObjectType)(d)||(0,le.isInterfaceType)(l)&&(0,le.isInterfaceType)(d)?r.push.apply(r,yA(l,d).concat(gA(l,d))):l.constructor!==d.constructor&&r.push({type:Ge.TYPE_CHANGED_KIND,description:"".concat(l.name," changed from ")+"".concat(vA(l)," to ").concat(vA(d),".")})}return r}function Yz(e,t){for(var r=[],n=Nr((0,zi.default)(e.getFields()),(0,zi.default)(t.getFields())),i=0,o=n.added;i<o.length;i++){var s=o[i];(0,le.isRequiredInputField)(s)?r.push({type:Ge.REQUIRED_INPUT_FIELD_ADDED,description:"A required field ".concat(s.name," on input type ").concat(e.name," was added.")}):r.push({type:Rr.OPTIONAL_INPUT_FIELD_ADDED,description:"An optional field ".concat(s.name," on input type ").concat(e.name," was added.")})}for(var a=0,u=n.removed;a<u.length;a++){var c=u[a];r.push({type:Ge.FIELD_REMOVED,description:"".concat(e.name,".").concat(c.name," was removed.")})}for(var l=0,d=n.persisted;l<d.length;l++){var f=d[l],h=f[0],g=f[1],v=Ms(h.type,g.type);v||r.push({type:Ge.FIELD_CHANGED_KIND,description:"".concat(e.name,".").concat(h.name," changed type from ")+"".concat(String(h.type)," to ").concat(String(g.type),".")})}return r}function Jz(e,t){for(var r=[],n=Nr(e.getTypes(),t.getTypes()),i=0,o=n.added;i<o.length;i++){var s=o[i];r.push({type:Rr.TYPE_ADDED_TO_UNION,description:"".concat(s.name," was added to union type ").concat(e.name,".")})}for(var a=0,u=n.removed;a<u.length;a++){var c=u[a];r.push({type:Ge.TYPE_REMOVED_FROM_UNION,description:"".concat(c.name," was removed from union type ").concat(e.name,".")})}return r}function Xz(e,t){for(var r=[],n=Nr(e.getValues(),t.getValues()),i=0,o=n.added;i<o.length;i++){var s=o[i];r.push({type:Rr.VALUE_ADDED_TO_ENUM,description:"".concat(s.name," was added to enum type ").concat(e.name,".")})}for(var a=0,u=n.removed;a<u.length;a++){var c=u[a];r.push({type:Ge.VALUE_REMOVED_FROM_ENUM,description:"".concat(c.name," was removed from enum type ").concat(e.name,".")})}return r}function gA(e,t){for(var r=[],n=Nr(e.getInterfaces(),t.getInterfaces()),i=0,o=n.added;i<o.length;i++){var s=o[i];r.push({type:Rr.IMPLEMENTED_INTERFACE_ADDED,description:"".concat(s.name," added to interfaces implemented by ").concat(e.name,".")})}for(var a=0,u=n.removed;a<u.length;a++){var c=u[a];r.push({type:Ge.IMPLEMENTED_INTERFACE_REMOVED,description:"".concat(e.name," no longer implements interface ").concat(c.name,".")})}return r}function yA(e,t){for(var r=[],n=Nr((0,zi.default)(e.getFields()),(0,zi.default)(t.getFields())),i=0,o=n.removed;i<o.length;i++){var s=o[i];r.push({type:Ge.FIELD_REMOVED,description:"".concat(e.name,".").concat(s.name," was removed.")})}for(var a=0,u=n.persisted;a<u.length;a++){var c=u[a],l=c[0],d=c[1];r.push.apply(r,Zz(e,l,d));var f=js(l.type,d.type);f||r.push({type:Ge.FIELD_CHANGED_KIND,description:"".concat(e.name,".").concat(l.name," changed type from ")+"".concat(String(l.type)," to ").concat(String(d.type),".")})}return r}function Zz(e,t,r){for(var n=[],i=Nr(t.args,r.args),o=0,s=i.removed;o<s.length;o++){var a=s[o];n.push({type:Ge.ARG_REMOVED,description:"".concat(e.name,".").concat(t.name," arg ").concat(a.name," was removed.")})}for(var u=0,c=i.persisted;u<c.length;u++){var l=c[u],d=l[0],f=l[1],h=Ms(d.type,f.type);if(!h)n.push({type:Ge.ARG_CHANGED_KIND,description:"".concat(e.name,".").concat(t.name," arg ").concat(d.name," has changed type from ")+"".concat(String(d.type)," to ").concat(String(f.type),".")});else if(d.defaultValue!==void 0)if(f.defaultValue===void 0)n.push({type:Rr.ARG_DEFAULT_VALUE_CHANGE,description:"".concat(e.name,".").concat(t.name," arg ").concat(d.name," defaultValue was removed.")});else{var g=EA(d.defaultValue,d.type),v=EA(f.defaultValue,f.type);g!==v&&n.push({type:Rr.ARG_DEFAULT_VALUE_CHANGE,description:"".concat(e.name,".").concat(t.name," arg ").concat(d.name," has changed defaultValue from ").concat(g," to ").concat(v,".")})}}for(var _=0,b=i.added;_<b.length;_++){var S=b[_];(0,le.isRequiredArgument)(S)?n.push({type:Ge.REQUIRED_ARG_ADDED,description:"A required arg ".concat(S.name," on ").concat(e.name,".").concat(t.name," was added.")}):n.push({type:Rr.OPTIONAL_ARG_ADDED,description:"An optional arg ".concat(S.name," on ").concat(e.name,".").concat(t.name," was added.")})}return n}function js(e,t){return(0,le.isListType)(e)?(0,le.isListType)(t)&&js(e.ofType,t.ofType)||(0,le.isNonNullType)(t)&&js(e,t.ofType):(0,le.isNonNullType)(e)?(0,le.isNonNullType)(t)&&js(e.ofType,t.ofType):(0,le.isNamedType)(t)&&e.name===t.name||(0,le.isNonNullType)(t)&&js(e,t.ofType)}function Ms(e,t){return(0,le.isListType)(e)?(0,le.isListType)(t)&&Ms(e.ofType,t.ofType):(0,le.isNonNullType)(e)?(0,le.isNonNullType)(t)&&Ms(e.ofType,t.ofType)||!(0,le.isNonNullType)(t)&&Ms(e.ofType,t):(0,le.isNamedType)(t)&&e.name===t.name}function vA(e){if((0,le.isScalarType)(e))return"a Scalar type";if((0,le.isObjectType)(e))return"an Object type";if((0,le.isInterfaceType)(e))return"an Interface type";if((0,le.isUnionType)(e))return"a Union type";if((0,le.isEnumType)(e))return"an Enum type";if((0,le.isInputObjectType)(e))return"an Input type";(0,_A.default)(0,"Unexpected type: "+(0,qz.default)(e))}function EA(e,t){var r=(0,Bz.astFromValue)(e,t);r!=null||(0,_A.default)(0);var n=(0,Gz.visit)(r,{ObjectValue:function(o){var s=[].concat(o.fields);return s.sort(function(a,u){return(0,Uz.default)(a.name.value,u.name.value)}),mA(mA({},o),{},{fields:s})}});return(0,Vz.print)(n)}function Nr(e,t){for(var r=[],n=[],i=[],o=(0,fA.default)(e,function(f){var h=f.name;return h}),s=(0,fA.default)(t,function(f){var h=f.name;return h}),a=0;a<e.length;a++){var u=e[a],c=s[u.name];c===void 0?n.push(u):i.push([u,c])}for(var l=0;l<t.length;l++){var d=t[l];o[d.name]===void 0&&r.push(d)}return{added:r,persisted:i,removed:n}}});var TA=y(zm=>{"use strict";p();Object.defineProperty(zm,"__esModule",{value:!0});zm.findDeprecatedUsages=rY;var eY=Ui(),tY=Tm();function rY(e,t){return(0,eY.validate)(e,t,[tY.NoDeprecatedCustomRule])}});var xA=y(ne=>{"use strict";p();Object.defineProperty(ne,"__esModule",{value:!0});Object.defineProperty(ne,"getIntrospectionQuery",{enumerable:!0,get:function(){return nY.getIntrospectionQuery}});Object.defineProperty(ne,"getOperationAST",{enumerable:!0,get:function(){return iY.getOperationAST}});Object.defineProperty(ne,"getOperationRootType",{enumerable:!0,get:function(){return oY.getOperationRootType}});Object.defineProperty(ne,"introspectionFromSchema",{enumerable:!0,get:function(){return sY.introspectionFromSchema}});Object.defineProperty(ne,"buildClientSchema",{enumerable:!0,get:function(){return aY.buildClientSchema}});Object.defineProperty(ne,"buildASTSchema",{enumerable:!0,get:function(){return IA.buildASTSchema}});Object.defineProperty(ne,"buildSchema",{enumerable:!0,get:function(){return IA.buildSchema}});Object.defineProperty(ne,"extendSchema",{enumerable:!0,get:function(){return wA.extendSchema}});Object.defineProperty(ne,"getDescription",{enumerable:!0,get:function(){return wA.getDescription}});Object.defineProperty(ne,"lexicographicSortSchema",{enumerable:!0,get:function(){return uY.lexicographicSortSchema}});Object.defineProperty(ne,"printSchema",{enumerable:!0,get:function(){return Ym.printSchema}});Object.defineProperty(ne,"printType",{enumerable:!0,get:function(){return Ym.printType}});Object.defineProperty(ne,"printIntrospectionSchema",{enumerable:!0,get:function(){return Ym.printIntrospectionSchema}});Object.defineProperty(ne,"typeFromAST",{enumerable:!0,get:function(){return cY.typeFromAST}});Object.defineProperty(ne,"valueFromAST",{enumerable:!0,get:function(){return lY.valueFromAST}});Object.defineProperty(ne,"valueFromASTUntyped",{enumerable:!0,get:function(){return pY.valueFromASTUntyped}});Object.defineProperty(ne,"astFromValue",{enumerable:!0,get:function(){return dY.astFromValue}});Object.defineProperty(ne,"TypeInfo",{enumerable:!0,get:function(){return OA.TypeInfo}});Object.defineProperty(ne,"visitWithTypeInfo",{enumerable:!0,get:function(){return OA.visitWithTypeInfo}});Object.defineProperty(ne,"coerceInputValue",{enumerable:!0,get:function(){return fY.coerceInputValue}});Object.defineProperty(ne,"concatAST",{enumerable:!0,get:function(){return hY.concatAST}});Object.defineProperty(ne,"separateOperations",{enumerable:!0,get:function(){return mY.separateOperations}});Object.defineProperty(ne,"stripIgnoredCharacters",{enumerable:!0,get:function(){return gY.stripIgnoredCharacters}});Object.defineProperty(ne,"isEqualType",{enumerable:!0,get:function(){return Jm.isEqualType}});Object.defineProperty(ne,"isTypeSubTypeOf",{enumerable:!0,get:function(){return Jm.isTypeSubTypeOf}});Object.defineProperty(ne,"doTypesOverlap",{enumerable:!0,get:function(){return Jm.doTypesOverlap}});Object.defineProperty(ne,"assertValidName",{enumerable:!0,get:function(){return AA.assertValidName}});Object.defineProperty(ne,"isValidNameError",{enumerable:!0,get:function(){return AA.isValidNameError}});Object.defineProperty(ne,"BreakingChangeType",{enumerable:!0,get:function(){return Dc.BreakingChangeType}});Object.defineProperty(ne,"DangerousChangeType",{enumerable:!0,get:function(){return Dc.DangerousChangeType}});Object.defineProperty(ne,"findBreakingChanges",{enumerable:!0,get:function(){return Dc.findBreakingChanges}});Object.defineProperty(ne,"findDangerousChanges",{enumerable:!0,get:function(){return Dc.findDangerousChanges}});Object.defineProperty(ne,"findDeprecatedUsages",{enumerable:!0,get:function(){return yY.findDeprecatedUsages}});var nY=Am(),iY=Cm(),oY=hc(),sY=NO(),aY=DO(),IA=WO(),wA=Pm(),uY=YO(),Ym=iA(),cY=dr(),lY=Ss(),pY=Qd(),dY=ls(),OA=ec(),fY=cm(),hY=oA(),mY=uA(),gY=dA(),Jm=is(),AA=Pd(),Dc=bA(),yY=TA()});var ln=y(E=>{"use strict";p();Object.defineProperty(E,"__esModule",{value:!0});Object.defineProperty(E,"version",{enumerable:!0,get:function(){return CA.version}});Object.defineProperty(E,"versionInfo",{enumerable:!0,get:function(){return CA.versionInfo}});Object.defineProperty(E,"graphql",{enumerable:!0,get:function(){return RA.graphql}});Object.defineProperty(E,"graphqlSync",{enumerable:!0,get:function(){return RA.graphqlSync}});Object.defineProperty(E,"GraphQLSchema",{enumerable:!0,get:function(){return P.GraphQLSchema}});Object.defineProperty(E,"GraphQLDirective",{enumerable:!0,get:function(){return P.GraphQLDirective}});Object.defineProperty(E,"GraphQLScalarType",{enumerable:!0,get:function(){return P.GraphQLScalarType}});Object.defineProperty(E,"GraphQLObjectType",{enumerable:!0,get:function(){return P.GraphQLObjectType}});Object.defineProperty(E,"GraphQLInterfaceType",{enumerable:!0,get:function(){return P.GraphQLInterfaceType}});Object.defineProperty(E,"GraphQLUnionType",{enumerable:!0,get:function(){return P.GraphQLUnionType}});Object.defineProperty(E,"GraphQLEnumType",{enumerable:!0,get:function(){return P.GraphQLEnumType}});Object.defineProperty(E,"GraphQLInputObjectType",{enumerable:!0,get:function(){return P.GraphQLInputObjectType}});Object.defineProperty(E,"GraphQLList",{enumerable:!0,get:function(){return P.GraphQLList}});Object.defineProperty(E,"GraphQLNonNull",{enumerable:!0,get:function(){return P.GraphQLNonNull}});Object.defineProperty(E,"specifiedScalarTypes",{enumerable:!0,get:function(){return P.specifiedScalarTypes}});Object.defineProperty(E,"GraphQLInt",{enumerable:!0,get:function(){return P.GraphQLInt}});Object.defineProperty(E,"GraphQLFloat",{enumerable:!0,get:function(){return P.GraphQLFloat}});Object.defineProperty(E,"GraphQLString",{enumerable:!0,get:function(){return P.GraphQLString}});Object.defineProperty(E,"GraphQLBoolean",{enumerable:!0,get:function(){return P.GraphQLBoolean}});Object.defineProperty(E,"GraphQLID",{enumerable:!0,get:function(){return P.GraphQLID}});Object.defineProperty(E,"specifiedDirectives",{enumerable:!0,get:function(){return P.specifiedDirectives}});Object.defineProperty(E,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return P.GraphQLIncludeDirective}});Object.defineProperty(E,"GraphQLSkipDirective",{enumerable:!0,get:function(){return P.GraphQLSkipDirective}});Object.defineProperty(E,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return P.GraphQLDeprecatedDirective}});Object.defineProperty(E,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return P.GraphQLSpecifiedByDirective}});Object.defineProperty(E,"TypeKind",{enumerable:!0,get:function(){return P.TypeKind}});Object.defineProperty(E,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return P.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(E,"introspectionTypes",{enumerable:!0,get:function(){return P.introspectionTypes}});Object.defineProperty(E,"__Schema",{enumerable:!0,get:function(){return P.__Schema}});Object.defineProperty(E,"__Directive",{enumerable:!0,get:function(){return P.__Directive}});Object.defineProperty(E,"__DirectiveLocation",{enumerable:!0,get:function(){return P.__DirectiveLocation}});Object.defineProperty(E,"__Type",{enumerable:!0,get:function(){return P.__Type}});Object.defineProperty(E,"__Field",{enumerable:!0,get:function(){return P.__Field}});Object.defineProperty(E,"__InputValue",{enumerable:!0,get:function(){return P.__InputValue}});Object.defineProperty(E,"__EnumValue",{enumerable:!0,get:function(){return P.__EnumValue}});Object.defineProperty(E,"__TypeKind",{enumerable:!0,get:function(){return P.__TypeKind}});Object.defineProperty(E,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return P.SchemaMetaFieldDef}});Object.defineProperty(E,"TypeMetaFieldDef",{enumerable:!0,get:function(){return P.TypeMetaFieldDef}});Object.defineProperty(E,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return P.TypeNameMetaFieldDef}});Object.defineProperty(E,"isSchema",{enumerable:!0,get:function(){return P.isSchema}});Object.defineProperty(E,"isDirective",{enumerable:!0,get:function(){return P.isDirective}});Object.defineProperty(E,"isType",{enumerable:!0,get:function(){return P.isType}});Object.defineProperty(E,"isScalarType",{enumerable:!0,get:function(){return P.isScalarType}});Object.defineProperty(E,"isObjectType",{enumerable:!0,get:function(){return P.isObjectType}});Object.defineProperty(E,"isInterfaceType",{enumerable:!0,get:function(){return P.isInterfaceType}});Object.defineProperty(E,"isUnionType",{enumerable:!0,get:function(){return P.isUnionType}});Object.defineProperty(E,"isEnumType",{enumerable:!0,get:function(){return P.isEnumType}});Object.defineProperty(E,"isInputObjectType",{enumerable:!0,get:function(){return P.isInputObjectType}});Object.defineProperty(E,"isListType",{enumerable:!0,get:function(){return P.isListType}});Object.defineProperty(E,"isNonNullType",{enumerable:!0,get:function(){return P.isNonNullType}});Object.defineProperty(E,"isInputType",{enumerable:!0,get:function(){return P.isInputType}});Object.defineProperty(E,"isOutputType",{enumerable:!0,get:function(){return P.isOutputType}});Object.defineProperty(E,"isLeafType",{enumerable:!0,get:function(){return P.isLeafType}});Object.defineProperty(E,"isCompositeType",{enumerable:!0,get:function(){return P.isCompositeType}});Object.defineProperty(E,"isAbstractType",{enumerable:!0,get:function(){return P.isAbstractType}});Object.defineProperty(E,"isWrappingType",{enumerable:!0,get:function(){return P.isWrappingType}});Object.defineProperty(E,"isNullableType",{enumerable:!0,get:function(){return P.isNullableType}});Object.defineProperty(E,"isNamedType",{enumerable:!0,get:function(){return P.isNamedType}});Object.defineProperty(E,"isRequiredArgument",{enumerable:!0,get:function(){return P.isRequiredArgument}});Object.defineProperty(E,"isRequiredInputField",{enumerable:!0,get:function(){return P.isRequiredInputField}});Object.defineProperty(E,"isSpecifiedScalarType",{enumerable:!0,get:function(){return P.isSpecifiedScalarType}});Object.defineProperty(E,"isIntrospectionType",{enumerable:!0,get:function(){return P.isIntrospectionType}});Object.defineProperty(E,"isSpecifiedDirective",{enumerable:!0,get:function(){return P.isSpecifiedDirective}});Object.defineProperty(E,"assertSchema",{enumerable:!0,get:function(){return P.assertSchema}});Object.defineProperty(E,"assertDirective",{enumerable:!0,get:function(){return P.assertDirective}});Object.defineProperty(E,"assertType",{enumerable:!0,get:function(){return P.assertType}});Object.defineProperty(E,"assertScalarType",{enumerable:!0,get:function(){return P.assertScalarType}});Object.defineProperty(E,"assertObjectType",{enumerable:!0,get:function(){return P.assertObjectType}});Object.defineProperty(E,"assertInterfaceType",{enumerable:!0,get:function(){return P.assertInterfaceType}});Object.defineProperty(E,"assertUnionType",{enumerable:!0,get:function(){return P.assertUnionType}});Object.defineProperty(E,"assertEnumType",{enumerable:!0,get:function(){return P.assertEnumType}});Object.defineProperty(E,"assertInputObjectType",{enumerable:!0,get:function(){return P.assertInputObjectType}});Object.defineProperty(E,"assertListType",{enumerable:!0,get:function(){return P.assertListType}});Object.defineProperty(E,"assertNonNullType",{enumerable:!0,get:function(){return P.assertNonNullType}});Object.defineProperty(E,"assertInputType",{enumerable:!0,get:function(){return P.assertInputType}});Object.defineProperty(E,"assertOutputType",{enumerable:!0,get:function(){return P.assertOutputType}});Object.defineProperty(E,"assertLeafType",{enumerable:!0,get:function(){return P.assertLeafType}});Object.defineProperty(E,"assertCompositeType",{enumerable:!0,get:function(){return P.assertCompositeType}});Object.defineProperty(E,"assertAbstractType",{enumerable:!0,get:function(){return P.assertAbstractType}});Object.defineProperty(E,"assertWrappingType",{enumerable:!0,get:function(){return P.assertWrappingType}});Object.defineProperty(E,"assertNullableType",{enumerable:!0,get:function(){return P.assertNullableType}});Object.defineProperty(E,"assertNamedType",{enumerable:!0,get:function(){return P.assertNamedType}});Object.defineProperty(E,"getNullableType",{enumerable:!0,get:function(){return P.getNullableType}});Object.defineProperty(E,"getNamedType",{enumerable:!0,get:function(){return P.getNamedType}});Object.defineProperty(E,"validateSchema",{enumerable:!0,get:function(){return P.validateSchema}});Object.defineProperty(E,"assertValidSchema",{enumerable:!0,get:function(){return P.assertValidSchema}});Object.defineProperty(E,"Token",{enumerable:!0,get:function(){return be.Token}});Object.defineProperty(E,"Source",{enumerable:!0,get:function(){return be.Source}});Object.defineProperty(E,"Location",{enumerable:!0,get:function(){return be.Location}});Object.defineProperty(E,"getLocation",{enumerable:!0,get:function(){return be.getLocation}});Object.defineProperty(E,"printLocation",{enumerable:!0,get:function(){return be.printLocation}});Object.defineProperty(E,"printSourceLocation",{enumerable:!0,get:function(){return be.printSourceLocation}});Object.defineProperty(E,"Lexer",{enumerable:!0,get:function(){return be.Lexer}});Object.defineProperty(E,"TokenKind",{enumerable:!0,get:function(){return be.TokenKind}});Object.defineProperty(E,"parse",{enumerable:!0,get:function(){return be.parse}});Object.defineProperty(E,"parseValue",{enumerable:!0,get:function(){return be.parseValue}});Object.defineProperty(E,"parseType",{enumerable:!0,get:function(){return be.parseType}});Object.defineProperty(E,"print",{enumerable:!0,get:function(){return be.print}});Object.defineProperty(E,"visit",{enumerable:!0,get:function(){return be.visit}});Object.defineProperty(E,"visitInParallel",{enumerable:!0,get:function(){return be.visitInParallel}});Object.defineProperty(E,"getVisitFn",{enumerable:!0,get:function(){return be.getVisitFn}});Object.defineProperty(E,"BREAK",{enumerable:!0,get:function(){return be.BREAK}});Object.defineProperty(E,"Kind",{enumerable:!0,get:function(){return be.Kind}});Object.defineProperty(E,"DirectiveLocation",{enumerable:!0,get:function(){return be.DirectiveLocation}});Object.defineProperty(E,"isDefinitionNode",{enumerable:!0,get:function(){return be.isDefinitionNode}});Object.defineProperty(E,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return be.isExecutableDefinitionNode}});Object.defineProperty(E,"isSelectionNode",{enumerable:!0,get:function(){return be.isSelectionNode}});Object.defineProperty(E,"isValueNode",{enumerable:!0,get:function(){return be.isValueNode}});Object.defineProperty(E,"isTypeNode",{enumerable:!0,get:function(){return be.isTypeNode}});Object.defineProperty(E,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return be.isTypeSystemDefinitionNode}});Object.defineProperty(E,"isTypeDefinitionNode",{enumerable:!0,get:function(){return be.isTypeDefinitionNode}});Object.defineProperty(E,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return be.isTypeSystemExtensionNode}});Object.defineProperty(E,"isTypeExtensionNode",{enumerable:!0,get:function(){return be.isTypeExtensionNode}});Object.defineProperty(E,"execute",{enumerable:!0,get:function(){return Yi.execute}});Object.defineProperty(E,"executeSync",{enumerable:!0,get:function(){return Yi.executeSync}});Object.defineProperty(E,"defaultFieldResolver",{enumerable:!0,get:function(){return Yi.defaultFieldResolver}});Object.defineProperty(E,"defaultTypeResolver",{enumerable:!0,get:function(){return Yi.defaultTypeResolver}});Object.defineProperty(E,"responsePathAsArray",{enumerable:!0,get:function(){return Yi.responsePathAsArray}});Object.defineProperty(E,"getDirectiveValues",{enumerable:!0,get:function(){return Yi.getDirectiveValues}});Object.defineProperty(E,"subscribe",{enumerable:!0,get:function(){return NA.subscribe}});Object.defineProperty(E,"createSourceEventStream",{enumerable:!0,get:function(){return NA.createSourceEventStream}});Object.defineProperty(E,"validate",{enumerable:!0,get:function(){return X.validate}});Object.defineProperty(E,"ValidationContext",{enumerable:!0,get:function(){return X.ValidationContext}});Object.defineProperty(E,"specifiedRules",{enumerable:!0,get:function(){return X.specifiedRules}});Object.defineProperty(E,"recommendedRules",{enumerable:!0,get:function(){return X.recommendedRules}});Object.defineProperty(E,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return X.ExecutableDefinitionsRule}});Object.defineProperty(E,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return X.FieldsOnCorrectTypeRule}});Object.defineProperty(E,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return X.FragmentsOnCompositeTypesRule}});Object.defineProperty(E,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return X.KnownArgumentNamesRule}});Object.defineProperty(E,"KnownDirectivesRule",{enumerable:!0,get:function(){return X.KnownDirectivesRule}});Object.defineProperty(E,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return X.KnownFragmentNamesRule}});Object.defineProperty(E,"KnownTypeNamesRule",{enumerable:!0,get:function(){return X.KnownTypeNamesRule}});Object.defineProperty(E,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return X.LoneAnonymousOperationRule}});Object.defineProperty(E,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return X.NoFragmentCyclesRule}});Object.defineProperty(E,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return X.NoUndefinedVariablesRule}});Object.defineProperty(E,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return X.NoUnusedFragmentsRule}});Object.defineProperty(E,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return X.NoUnusedVariablesRule}});Object.defineProperty(E,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return X.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(E,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return X.PossibleFragmentSpreadsRule}});Object.defineProperty(E,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return X.ProvidedRequiredArgumentsRule}});Object.defineProperty(E,"ScalarLeafsRule",{enumerable:!0,get:function(){return X.ScalarLeafsRule}});Object.defineProperty(E,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return X.SingleFieldSubscriptionsRule}});Object.defineProperty(E,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return X.UniqueArgumentNamesRule}});Object.defineProperty(E,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return X.UniqueDirectivesPerLocationRule}});Object.defineProperty(E,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return X.UniqueFragmentNamesRule}});Object.defineProperty(E,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return X.UniqueInputFieldNamesRule}});Object.defineProperty(E,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return X.UniqueOperationNamesRule}});Object.defineProperty(E,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return X.UniqueVariableNamesRule}});Object.defineProperty(E,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return X.ValuesOfCorrectTypeRule}});Object.defineProperty(E,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return X.VariablesAreInputTypesRule}});Object.defineProperty(E,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return X.VariablesInAllowedPositionRule}});Object.defineProperty(E,"MaxIntrospectionDepthRule",{enumerable:!0,get:function(){return X.MaxIntrospectionDepthRule}});Object.defineProperty(E,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return X.LoneSchemaDefinitionRule}});Object.defineProperty(E,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return X.UniqueOperationTypesRule}});Object.defineProperty(E,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return X.UniqueTypeNamesRule}});Object.defineProperty(E,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return X.UniqueEnumValueNamesRule}});Object.defineProperty(E,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return X.UniqueFieldDefinitionNamesRule}});Object.defineProperty(E,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return X.UniqueDirectiveNamesRule}});Object.defineProperty(E,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return X.PossibleTypeExtensionsRule}});Object.defineProperty(E,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return X.NoDeprecatedCustomRule}});Object.defineProperty(E,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return X.NoSchemaIntrospectionCustomRule}});Object.defineProperty(E,"GraphQLError",{enumerable:!0,get:function(){return qs.GraphQLError}});Object.defineProperty(E,"syntaxError",{enumerable:!0,get:function(){return qs.syntaxError}});Object.defineProperty(E,"locatedError",{enumerable:!0,get:function(){return qs.locatedError}});Object.defineProperty(E,"printError",{enumerable:!0,get:function(){return qs.printError}});Object.defineProperty(E,"formatError",{enumerable:!0,get:function(){return qs.formatError}});Object.defineProperty(E,"getIntrospectionQuery",{enumerable:!0,get:function(){return se.getIntrospectionQuery}});Object.defineProperty(E,"getOperationAST",{enumerable:!0,get:function(){return se.getOperationAST}});Object.defineProperty(E,"getOperationRootType",{enumerable:!0,get:function(){return se.getOperationRootType}});Object.defineProperty(E,"introspectionFromSchema",{enumerable:!0,get:function(){return se.introspectionFromSchema}});Object.defineProperty(E,"buildClientSchema",{enumerable:!0,get:function(){return se.buildClientSchema}});Object.defineProperty(E,"buildASTSchema",{enumerable:!0,get:function(){return se.buildASTSchema}});Object.defineProperty(E,"buildSchema",{enumerable:!0,get:function(){return se.buildSchema}});Object.defineProperty(E,"getDescription",{enumerable:!0,get:function(){return se.getDescription}});Object.defineProperty(E,"extendSchema",{enumerable:!0,get:function(){return se.extendSchema}});Object.defineProperty(E,"lexicographicSortSchema",{enumerable:!0,get:function(){return se.lexicographicSortSchema}});Object.defineProperty(E,"printSchema",{enumerable:!0,get:function(){return se.printSchema}});Object.defineProperty(E,"printType",{enumerable:!0,get:function(){return se.printType}});Object.defineProperty(E,"printIntrospectionSchema",{enumerable:!0,get:function(){return se.printIntrospectionSchema}});Object.defineProperty(E,"typeFromAST",{enumerable:!0,get:function(){return se.typeFromAST}});Object.defineProperty(E,"valueFromAST",{enumerable:!0,get:function(){return se.valueFromAST}});Object.defineProperty(E,"valueFromASTUntyped",{enumerable:!0,get:function(){return se.valueFromASTUntyped}});Object.defineProperty(E,"astFromValue",{enumerable:!0,get:function(){return se.astFromValue}});Object.defineProperty(E,"TypeInfo",{enumerable:!0,get:function(){return se.TypeInfo}});Object.defineProperty(E,"visitWithTypeInfo",{enumerable:!0,get:function(){return se.visitWithTypeInfo}});Object.defineProperty(E,"coerceInputValue",{enumerable:!0,get:function(){return se.coerceInputValue}});Object.defineProperty(E,"concatAST",{enumerable:!0,get:function(){return se.concatAST}});Object.defineProperty(E,"separateOperations",{enumerable:!0,get:function(){return se.separateOperations}});Object.defineProperty(E,"stripIgnoredCharacters",{enumerable:!0,get:function(){return se.stripIgnoredCharacters}});Object.defineProperty(E,"isEqualType",{enumerable:!0,get:function(){return se.isEqualType}});Object.defineProperty(E,"isTypeSubTypeOf",{enumerable:!0,get:function(){return se.isTypeSubTypeOf}});Object.defineProperty(E,"doTypesOverlap",{enumerable:!0,get:function(){return se.doTypesOverlap}});Object.defineProperty(E,"assertValidName",{enumerable:!0,get:function(){return se.assertValidName}});Object.defineProperty(E,"isValidNameError",{enumerable:!0,get:function(){return se.isValidNameError}});Object.defineProperty(E,"BreakingChangeType",{enumerable:!0,get:function(){return se.BreakingChangeType}});Object.defineProperty(E,"DangerousChangeType",{enumerable:!0,get:function(){return se.DangerousChangeType}});Object.defineProperty(E,"findBreakingChanges",{enumerable:!0,get:function(){return se.findBreakingChanges}});Object.defineProperty(E,"findDangerousChanges",{enumerable:!0,get:function(){return se.findDangerousChanges}});Object.defineProperty(E,"findDeprecatedUsages",{enumerable:!0,get:function(){return se.findDeprecatedUsages}});var CA=Mb(),RA=rO(),P=iO(),be=aO(),Yi=uO(),NA=bO(),X=wO(),qs=xO(),se=xA()});var HA=y((Qse,Pr)=>{p();var rg=M("fs"),Fc=M("path"),IY=M("os"),wY=M("crypto"),VA=["\u25C8 encrypted .env [www.dotenvx.com]","\u25C8 secrets for agents [www.dotenvx.com]","\u2301 auth for agents [www.vestauth.com]","\u2318 custom filepath { path: '/custom/path/.env' }","\u2318 enable debugging { debug: true }","\u2318 override existing { override: true }","\u2318 suppress logs { quiet: true }","\u2318 multiple files { path: ['.env.local', '.env'] }"];function OY(){return VA[Math.floor(Math.random()*VA.length)]}function Ji(e){return typeof e=="string"?!["false","0","no","off",""].includes(e.toLowerCase()):!!e}function AY(){return process.stdout.isTTY}function xY(e){return AY()?`\x1B[2m${e}\x1B[0m`:e}var CY=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function RY(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
|
|
200
|
+
`);let n;for(;(n=CY.exec(r))!=null;){let i=n[1],o=n[2]||"";o=o.trim();let s=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(o=o.replace(/\\n/g,`
|
|
201
|
+
`),o=o.replace(/\\r/g,"\r")),t[i]=o}return t}function NY(e){e=e||{};let t=KA(e);e.path=t;let r=Qe.configDotenv(e);if(!r.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=BA(e).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),u=DY(r,a);o=Qe.decrypt(u.ciphertext,u.key);break}catch(a){if(s+1>=i)throw a}return Qe.parse(o)}function PY(e){console.error(`\u26A0 ${e}`)}function Gs(e){console.log(`\u2506 ${e}`)}function $A(e){console.log(`\u25C7 ${e}`)}function BA(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function DY(e,t){let r;try{r=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let u=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw u.code="INVALID_DOTENV_KEY",u}throw a}let n=r.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=r.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let o=`DOTENV_VAULT_${i.toUpperCase()}`,s=e.parsed[o];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function KA(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)rg.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=Fc.resolve(process.cwd(),".env.vault");return rg.existsSync(t)?t:null}function GA(e){return e[0]==="~"?Fc.join(IY.homedir(),e.slice(1)):e}function LY(e){let t=Ji(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),r=Ji(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);(t||!r)&&$A("loading env from encrypted .env.vault");let n=Qe._parseVault(e),i=process.env;return e&&e.processEnv!=null&&(i=e.processEnv),Qe.populate(i,n,e),{parsed:n}}function kY(e){let t=Fc.resolve(process.cwd(),".env"),r="utf8",n=process.env;e&&e.processEnv!=null&&(n=e.processEnv);let i=Ji(n.DOTENV_CONFIG_DEBUG||e&&e.debug),o=Ji(n.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?r=e.encoding:i&&Gs("no encoding is specified (UTF-8 is used by default)");let s=[t];if(e&&e.path)if(!Array.isArray(e.path))s=[GA(e.path)];else{s=[];for(let l of e.path)s.push(GA(l))}let a,u={};for(let l of s)try{let d=Qe.parse(rg.readFileSync(l,{encoding:r}));Qe.populate(u,d,e)}catch(d){i&&Gs(`failed to load ${l} ${d.message}`),a=d}let c=Qe.populate(n,u,e);if(i=Ji(n.DOTENV_CONFIG_DEBUG||i),o=Ji(n.DOTENV_CONFIG_QUIET||o),i||!o){let l=Object.keys(c).length,d=[];for(let f of s)try{let h=Fc.relative(process.cwd(),f);d.push(h)}catch(h){i&&Gs(`failed to load ${f} ${h.message}`),a=h}$A(`injected env (${l}) from ${d.join(",")} ${xY(`// tip: ${OY()}`)}`)}return a?{parsed:u,error:a}:{parsed:u}}function jY(e){if(BA(e).length===0)return Qe.configDotenv(e);let t=KA(e);return t?Qe._configVault(e):(PY(`you set DOTENV_KEY but you are missing a .env.vault file at ${t}`),Qe.configDotenv(e))}function MY(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{let s=wY.createDecipheriv("aes-256-gcm",r,i);return s.setAuthTag(o),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,u=s.message==="Invalid key length",c=s.message==="Unsupported state or unable to authenticate data";if(a||u){let l=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw l.code="INVALID_DOTENV_KEY",l}else if(c){let l=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw l.code="DECRYPTION_FAILED",l}else throw s}}function FY(e,t,r={}){let n=!!(r&&r.debug),i=!!(r&&r.override),o={};if(typeof t!="object"){let s=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw s.code="OBJECT_REQUIRED",s}for(let s of Object.keys(t))Object.prototype.hasOwnProperty.call(e,s)?(i===!0&&(e[s]=t[s],o[s]=t[s]),n&&Gs(i===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):(e[s]=t[s],o[s]=t[s]);return o}var Qe={configDotenv:kY,_configVault:LY,_parseVault:NY,config:jY,decrypt:MY,parse:RY,populate:FY};Pr.exports.configDotenv=Qe.configDotenv;Pr.exports._configVault=Qe._configVault;Pr.exports._parseVault=Qe._parseVault;Pr.exports.config=Qe.config;Pr.exports.decrypt=Qe.decrypt;Pr.exports.parse=Qe.parse;Pr.exports.populate=Qe.populate;Pr.exports=Qe});var G0=y((pae,V0)=>{p();V0.exports=Zi;function Zi(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Zi.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-r:e+r}return Math.min(e,this.max)|0};Zi.prototype.reset=function(){this.attempts=0};Zi.prototype.setMin=function(e){this.ms=e};Zi.prototype.setMax=function(e){this.max=e};Zi.prototype.setJitter=function(e){this.jitter=e}});var B0=y((fae,og)=>{"use strict";p();var KY=Object.prototype.hasOwnProperty,dt="~";function Bs(){}Object.create&&(Bs.prototype=Object.create(null),new Bs().__proto__||(dt=!1));function HY(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function $0(e,t,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var o=new HY(r,n||e,i),s=dt?dt+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],o]:e._events[s].push(o):(e._events[s]=o,e._eventsCount++),e}function Gc(e,t){--e._eventsCount===0?e._events=new Bs:delete e._events[t]}function ot(){this._events=new Bs,this._eventsCount=0}ot.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)KY.call(r,n)&&t.push(dt?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};ot.prototype.listeners=function(t){var r=dt?dt+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i<o;i++)s[i]=n[i].fn;return s};ot.prototype.listenerCount=function(t){var r=dt?dt+t:t,n=this._events[r];return n?n.fn?1:n.length:0};ot.prototype.emit=function(t,r,n,i,o,s){var a=dt?dt+t:t;if(!this._events[a])return!1;var u=this._events[a],c=arguments.length,l,d;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,r),!0;case 3:return u.fn.call(u.context,r,n),!0;case 4:return u.fn.call(u.context,r,n,i),!0;case 5:return u.fn.call(u.context,r,n,i,o),!0;case 6:return u.fn.call(u.context,r,n,i,o,s),!0}for(d=1,l=new Array(c-1);d<c;d++)l[d-1]=arguments[d];u.fn.apply(u.context,l)}else{var f=u.length,h;for(d=0;d<f;d++)switch(u[d].once&&this.removeListener(t,u[d].fn,void 0,!0),c){case 1:u[d].fn.call(u[d].context);break;case 2:u[d].fn.call(u[d].context,r);break;case 3:u[d].fn.call(u[d].context,r,n);break;case 4:u[d].fn.call(u[d].context,r,n,i);break;default:if(!l)for(h=1,l=new Array(c-1);h<c;h++)l[h-1]=arguments[h];u[d].fn.apply(u[d].context,l)}}return!0};ot.prototype.on=function(t,r,n){return $0(this,t,r,n,!1)};ot.prototype.once=function(t,r,n){return $0(this,t,r,n,!0)};ot.prototype.removeListener=function(t,r,n,i){var o=dt?dt+t:t;if(!this._events[o])return this;if(!r)return Gc(this,o),this;var s=this._events[o];if(s.fn)s.fn===r&&(!i||s.once)&&(!n||s.context===n)&&Gc(this,o);else{for(var a=0,u=[],c=s.length;a<c;a++)(s[a].fn!==r||i&&!s[a].once||n&&s[a].context!==n)&&u.push(s[a]);u.length?this._events[o]=u.length===1?u[0]:u:Gc(this,o)}return this};ot.prototype.removeAllListeners=function(t){var r;return t?(r=dt?dt+t:t,this._events[r]&&Gc(this,r)):(this._events=new Bs,this._eventsCount=0),this};ot.prototype.off=ot.prototype.removeListener;ot.prototype.addListener=ot.prototype.on;ot.prefixed=dt;ot.EventEmitter=ot;typeof og<"u"&&(og.exports=ot)});var K0=y(sg=>{"use strict";p();Object.defineProperty(sg,"__esModule",{value:!0});function QY(e){return typeof e=="string"}sg.default=QY});var ug=y(ag=>{"use strict";p();Object.defineProperty(ag,"__esModule",{value:!0});function WY(e){return e!==null&&typeof e=="object"}ag.default=WY});var H0=y(cg=>{"use strict";p();Object.defineProperty(cg,"__esModule",{value:!0});cg.default=zY;function zY(e){var t,r=e.Symbol;return typeof r=="function"?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}});var Q0=y((pg,lg)=>{"use strict";p();Object.defineProperty(pg,"__esModule",{value:!0});var YY=H0(),JY=XY(YY);function XY(e){return e&&e.__esModule?e:{default:e}}var eo;typeof self<"u"?eo=self:typeof window<"u"?eo=window:typeof global<"u"?eo=global:typeof lg<"u"?eo=lg:eo=Function("return this")();var ZY=(0,JY.default)(eo);pg.default=ZY});var $c=y(to=>{"use strict";p();Object.defineProperty(to,"__esModule",{value:!0});to.GRAPHQL_SUBSCRIPTIONS=to.GRAPHQL_WS=void 0;var eJ="graphql-ws";to.GRAPHQL_WS=eJ;var tJ="graphql-subscriptions";to.GRAPHQL_SUBSCRIPTIONS=tJ});var W0=y(ro=>{"use strict";p();Object.defineProperty(ro,"__esModule",{value:!0});ro.WS_TIMEOUT=ro.MIN_WS_TIMEOUT=void 0;var rJ=1e3;ro.MIN_WS_TIMEOUT=rJ;var nJ=3e4;ro.WS_TIMEOUT=nJ});var Ks=y(dg=>{"use strict";p();Object.defineProperty(dg,"__esModule",{value:!0});var iJ=(function(){function e(){throw new Error("Static Class")}return e.GQL_CONNECTION_INIT="connection_init",e.GQL_CONNECTION_ACK="connection_ack",e.GQL_CONNECTION_ERROR="connection_error",e.GQL_CONNECTION_KEEP_ALIVE="ka",e.GQL_CONNECTION_TERMINATE="connection_terminate",e.GQL_START="start",e.GQL_DATA="data",e.GQL_ERROR="error",e.GQL_COMPLETE="complete",e.GQL_STOP="stop",e.SUBSCRIPTION_START="subscription_start",e.SUBSCRIPTION_DATA="subscription_data",e.SUBSCRIPTION_SUCCESS="subscription_success",e.SUBSCRIPTION_FAIL="subscription_fail",e.SUBSCRIPTION_END="subscription_end",e.INIT="init",e.INIT_SUCCESS="init_success",e.INIT_FAIL="init_fail",e.KEEP_ALIVE="keepalive",e})();dg.default=iJ});var ex=y(Bt=>{"use strict";p();var no=Bt&&Bt.__assign||function(){return no=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},no.apply(this,arguments)},oJ=Bt&&Bt.__awaiter||function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(d){s(d)}}function u(l){try{c(n.throw(l))}catch(d){s(d)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(e,t||[])).next())})},sJ=Bt&&Bt.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},z0=Bt&&Bt.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.SubscriptionClient=void 0;var Y0=typeof global<"u"?global:typeof window<"u"?window:{},aJ=Y0.WebSocket||Y0.MozWebSocket,J0=G0(),uJ=B0(),X0=K0(),cJ=ug(),lJ=mt(),pJ=Cm(),dJ=Q0(),fJ=$c(),Z0=W0(),ft=Ks(),hJ=(function(){function e(t,r,n,i){var o=r||{},s=o.connectionCallback,a=s===void 0?void 0:s,u=o.connectionParams,c=u===void 0?{}:u,l=o.minTimeout,d=l===void 0?Z0.MIN_WS_TIMEOUT:l,f=o.timeout,h=f===void 0?Z0.WS_TIMEOUT:f,g=o.reconnect,v=g===void 0?!1:g,_=o.reconnectionAttempts,b=_===void 0?1/0:_,S=o.lazy,I=S===void 0?!1:S,A=o.inactivityTimeout,T=A===void 0?0:A,x=o.wsOptionArguments,U=x===void 0?[]:x;if(this.wsImpl=n||aJ,!this.wsImpl)throw new Error("Unable to find native implementation, or alternative implementation for WebSocket!");this.wsProtocols=i||fJ.GRAPHQL_WS,this.connectionCallback=a,this.url=t,this.operations={},this.nextOperationId=0,this.minWsTimeout=d,this.wsTimeout=h,this.unsentMessagesQueue=[],this.reconnect=v,this.reconnecting=!1,this.reconnectionAttempts=b,this.lazy=!!I,this.inactivityTimeout=T,this.closedByUser=!1,this.backoff=new J0({jitter:.5}),this.eventEmitter=new uJ.EventEmitter,this.middlewares=[],this.client=null,this.maxConnectTimeGenerator=this.createMaxConnectTimeGenerator(),this.connectionParams=this.getConnectionParams(c),this.wsOptionArguments=U,this.lazy||this.connect()}return Object.defineProperty(e.prototype,"status",{get:function(){return this.client===null?this.wsImpl.CLOSED:this.client.readyState},enumerable:!1,configurable:!0}),e.prototype.close=function(t,r){t===void 0&&(t=!0),r===void 0&&(r=!0),this.clearInactivityTimeout(),this.client!==null&&(this.closedByUser=r,t&&(this.clearCheckConnectionInterval(),this.clearMaxConnectTimeout(),this.clearTryReconnectTimeout(),this.unsubscribeAll(),this.sendMessage(void 0,ft.default.GQL_CONNECTION_TERMINATE,null)),this.client.close(),this.client.onopen=null,this.client.onclose=null,this.client.onerror=null,this.client.onmessage=null,this.client=null,this.eventEmitter.emit("disconnected"),t||this.tryReconnect())},e.prototype.request=function(t){var r,n=this.getObserver.bind(this),i=this.executeOperation.bind(this),o=this.unsubscribe.bind(this),s;return this.clearInactivityTimeout(),r={},r[dJ.default]=function(){return this},r.subscribe=function(a,u,c){var l=n(a,u,c);return s=i(t,function(d,f){d===null&&f===null?l.complete&&l.complete():d?l.error&&l.error(d[0]):l.next&&l.next(f)}),{unsubscribe:function(){s&&(o(s),s=null)}}},r},e.prototype.on=function(t,r,n){var i=this.eventEmitter.on(t,r,n);return function(){i.off(t,r,n)}},e.prototype.onConnected=function(t,r){return this.on("connected",t,r)},e.prototype.onConnecting=function(t,r){return this.on("connecting",t,r)},e.prototype.onDisconnected=function(t,r){return this.on("disconnected",t,r)},e.prototype.onReconnected=function(t,r){return this.on("reconnected",t,r)},e.prototype.onReconnecting=function(t,r){return this.on("reconnecting",t,r)},e.prototype.onError=function(t,r){return this.on("error",t,r)},e.prototype.unsubscribeAll=function(){var t=this;Object.keys(this.operations).forEach(function(r){t.unsubscribe(r)})},e.prototype.applyMiddlewares=function(t){var r=this;return new Promise(function(n,i){var o=function(s,a){var u=function(c){if(c)i(c);else if(s.length>0){var l=s.shift();l&&l.applyMiddleware.apply(a,[t,u])}else n(t)};u()};o(z0([],r.middlewares,!0),r)})},e.prototype.use=function(t){var r=this;return t.map(function(n){if(typeof n.applyMiddleware=="function")r.middlewares.push(n);else throw new Error("Middleware must implement the applyMiddleware function.")}),this},e.prototype.getConnectionParams=function(t){return function(){return new Promise(function(r,n){if(typeof t=="function")try{return r(t.call(null))}catch(i){return n(i)}r(t)})}},e.prototype.executeOperation=function(t,r){var n=this;this.client===null&&this.connect();var i=this.generateOperationId();return this.operations[i]={options:t,handler:r},this.applyMiddlewares(t).then(function(o){n.checkOperationOptions(o,r),n.operations[i]&&(n.operations[i]={options:o,handler:r},n.sendMessage(i,ft.default.GQL_START,o))}).catch(function(o){n.unsubscribe(i),r(n.formatErrors(o))}),i},e.prototype.getObserver=function(t,r,n){return typeof t=="function"?{next:function(i){return t(i)},error:function(i){return r&&r(i)},complete:function(){return n&&n()}}:t},e.prototype.createMaxConnectTimeGenerator=function(){var t=this.minWsTimeout,r=this.wsTimeout;return new J0({min:t,max:r,factor:1.2})},e.prototype.clearCheckConnectionInterval=function(){this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnectionIntervalId=null)},e.prototype.clearMaxConnectTimeout=function(){this.maxConnectTimeoutId&&(clearTimeout(this.maxConnectTimeoutId),this.maxConnectTimeoutId=null)},e.prototype.clearTryReconnectTimeout=function(){this.tryReconnectTimeoutId&&(clearTimeout(this.tryReconnectTimeoutId),this.tryReconnectTimeoutId=null)},e.prototype.clearInactivityTimeout=function(){this.inactivityTimeoutId&&(clearTimeout(this.inactivityTimeoutId),this.inactivityTimeoutId=null)},e.prototype.setInactivityTimeout=function(){var t=this;this.inactivityTimeout>0&&Object.keys(this.operations).length===0&&(this.inactivityTimeoutId=setTimeout(function(){Object.keys(t.operations).length===0&&t.close()},this.inactivityTimeout))},e.prototype.checkOperationOptions=function(t,r){var n=t.query,i=t.variables,o=t.operationName;if(!n)throw new Error("Must provide a query.");if(!r)throw new Error("Must provide an handler.");if(!(0,X0.default)(n)&&!(0,pJ.getOperationAST)(n,o)||o&&!(0,X0.default)(o)||i&&!(0,cJ.default)(i))throw new Error("Incorrect option types. query must be a string or a document,`operationName` must be a string, and `variables` must be an object.")},e.prototype.buildMessage=function(t,r,n){var i=n&&n.query?no(no({},n),{query:typeof n.query=="string"?n.query:(0,lJ.print)(n.query)}):n;return{id:t,type:r,payload:i}},e.prototype.formatErrors=function(t){return Array.isArray(t)?t:t&&t.errors?this.formatErrors(t.errors):t&&t.message?[t]:[{name:"FormatedError",message:"Unknown error",originalError:t}]},e.prototype.sendMessage=function(t,r,n){this.sendMessageRaw(this.buildMessage(t,r,n))},e.prototype.sendMessageRaw=function(t){switch(this.status){case this.wsImpl.OPEN:var r=JSON.stringify(t);try{JSON.parse(r)}catch{this.eventEmitter.emit("error",new Error("Message must be JSON-serializable. Got: "+t))}this.client.send(r);break;case this.wsImpl.CONNECTING:this.unsentMessagesQueue.push(t);break;default:this.reconnecting||this.eventEmitter.emit("error",new Error("A message was not sent because socket is not connected, is closing or is already closed. Message was: "+JSON.stringify(t)))}},e.prototype.generateOperationId=function(){return String(++this.nextOperationId)},e.prototype.tryReconnect=function(){var t=this;if(!(!this.reconnect||this.backoff.attempts>=this.reconnectionAttempts)){this.reconnecting||(Object.keys(this.operations).forEach(function(n){t.unsentMessagesQueue.push(t.buildMessage(n,ft.default.GQL_START,t.operations[n].options))}),this.reconnecting=!0),this.clearTryReconnectTimeout();var r=this.backoff.duration();this.tryReconnectTimeoutId=setTimeout(function(){t.connect()},r)}},e.prototype.flushUnsentMessagesQueue=function(){var t=this;this.unsentMessagesQueue.forEach(function(r){t.sendMessageRaw(r)}),this.unsentMessagesQueue=[]},e.prototype.checkConnection=function(){if(this.wasKeepAliveReceived){this.wasKeepAliveReceived=!1;return}this.reconnecting||this.close(!1,!0)},e.prototype.checkMaxConnectTimeout=function(){var t=this;this.clearMaxConnectTimeout(),this.maxConnectTimeoutId=setTimeout(function(){t.status!==t.wsImpl.OPEN&&(t.reconnecting=!0,t.close(!1,!0))},this.maxConnectTimeGenerator.duration())},e.prototype.connect=function(){var t,r=this;this.client=new((t=this.wsImpl).bind.apply(t,z0([void 0,this.url,this.wsProtocols],this.wsOptionArguments,!1))),this.checkMaxConnectTimeout(),this.client.onopen=function(){return oJ(r,void 0,void 0,function(){var n,i;return sJ(this,function(o){switch(o.label){case 0:if(this.status!==this.wsImpl.OPEN)return[3,4];this.clearMaxConnectTimeout(),this.closedByUser=!1,this.eventEmitter.emit(this.reconnecting?"reconnecting":"connecting"),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.connectionParams()];case 2:return n=o.sent(),this.sendMessage(void 0,ft.default.GQL_CONNECTION_INIT,n),this.flushUnsentMessagesQueue(),[3,4];case 3:return i=o.sent(),this.sendMessage(void 0,ft.default.GQL_CONNECTION_ERROR,i),this.flushUnsentMessagesQueue(),[3,4];case 4:return[2]}})})},this.client.onclose=function(){r.closedByUser||r.close(!1,!1)},this.client.onerror=function(n){r.eventEmitter.emit("error",n)},this.client.onmessage=function(n){var i=n.data;r.processReceivedData(i)}},e.prototype.processReceivedData=function(t){var r,n;try{r=JSON.parse(t),n=r.id}catch{throw new Error("Message must be JSON-parseable. Got: "+t)}if([ft.default.GQL_DATA,ft.default.GQL_COMPLETE,ft.default.GQL_ERROR].indexOf(r.type)!==-1&&!this.operations[n]){this.unsubscribe(n);return}switch(r.type){case ft.default.GQL_CONNECTION_ERROR:this.connectionCallback&&this.connectionCallback(r.payload);break;case ft.default.GQL_CONNECTION_ACK:this.eventEmitter.emit(this.reconnecting?"reconnected":"connected",r.payload),this.reconnecting=!1,this.backoff.reset(),this.maxConnectTimeGenerator.reset(),this.connectionCallback&&this.connectionCallback();break;case ft.default.GQL_COMPLETE:var i=this.operations[n].handler;delete this.operations[n],i.call(this,null,null);break;case ft.default.GQL_ERROR:this.operations[n].handler(this.formatErrors(r.payload),null),delete this.operations[n];break;case ft.default.GQL_DATA:var o=r.payload.errors?no(no({},r.payload),{errors:this.formatErrors(r.payload.errors)}):r.payload;this.operations[n].handler(null,o);break;case ft.default.GQL_CONNECTION_KEEP_ALIVE:var s=typeof this.wasKeepAliveReceived>"u";this.wasKeepAliveReceived=!0,s&&this.checkConnection(),this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnection()),this.checkConnectionIntervalId=setInterval(this.checkConnection.bind(this),this.wsTimeout);break;default:throw new Error("Invalid message type!")}},e.prototype.unsubscribe=function(t){this.operations[t]&&(delete this.operations[t],this.setInactivityTimeout(),this.sendMessage(t,ft.default.GQL_STOP,void 0))},e})();Bt.SubscriptionClient=hJ});var zn=y((Rae,tx)=>{"use strict";p();tx.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),EMPTY_BUFFER:Buffer.alloc(0),NOOP:()=>{}}});var Hs=y((Pae,fg)=>{"use strict";p();var{EMPTY_BUFFER:mJ}=zn();function rx(e,t){if(e.length===0)return mJ;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),n=0;for(let i=0;i<e.length;i++){let o=e[i];r.set(o,n),n+=o.length}return n<t?r.slice(0,n):r}function nx(e,t,r,n,i){for(let o=0;o<i;o++)r[n+o]=e[o]^t[o&3]}function ix(e,t){let r=e.length;for(let n=0;n<r;n++)e[n]^=t[n&3]}function ox(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function Bc(e){if(Bc.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=Buffer.from(e):ArrayBuffer.isView(e)?t=Buffer.from(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Bc.readOnly=!1),t}try{let e=M("bufferutil"),t=e.BufferUtil||e;fg.exports={concat:rx,mask(r,n,i,o,s){s<48?nx(r,n,i,o,s):t.mask(r,n,i,o,s)},toArrayBuffer:ox,toBuffer:Bc,unmask(r,n){r.length<32?ix(r,n):t.unmask(r,n)}}}catch{fg.exports={concat:rx,mask:nx,toArrayBuffer:ox,toBuffer:Bc,unmask:ix}}});var ux=y((Lae,ax)=>{"use strict";p();var sx=Symbol("kDone"),hg=Symbol("kRun"),mg=class{constructor(t){this[sx]=()=>{this.pending--,this[hg]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[hg]()}[hg](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[sx])}}};ax.exports=mg});var zs=y((jae,dx)=>{"use strict";p();var Qs=M("zlib"),cx=Hs(),gJ=ux(),{kStatusCode:lx,NOOP:yJ}=zn(),vJ=Buffer.from([0,0,255,255]),Qc=Symbol("permessage-deflate"),Dr=Symbol("total-length"),Ws=Symbol("callback"),pn=Symbol("buffers"),Hc=Symbol("error"),Kc,gg=class{constructor(t,r,n){if(this._maxPayload=n|0,this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!Kc){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Kc=new gJ(i)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[Ws];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,n=t.find(i=>!(r.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>i.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(n.server_no_context_takeover=!0),r.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(n.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?n.client_max_window_bits=r.clientMaxWindowBits:(n.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(n=>{let i=r[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);r[n]=i})}),t}decompress(t,r,n){Kc.add(i=>{this._decompress(t,r,(o,s)=>{i(),n(o,s)})})}compress(t,r,n){Kc.add(i=>{this._compress(t,r,(o,s)=>{i(),n(o,s)})})}_decompress(t,r,n){let i=this._isServer?"client":"server";if(!this._inflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?Qs.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=Qs.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[Qc]=this,this._inflate[Dr]=0,this._inflate[pn]=[],this._inflate.on("error",_J),this._inflate.on("data",px)}this._inflate[Ws]=n,this._inflate.write(t),r&&this._inflate.write(vJ),this._inflate.flush(()=>{let o=this._inflate[Hc];if(o){this._inflate.close(),this._inflate=null,n(o);return}let s=cx.concat(this._inflate[pn],this._inflate[Dr]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Dr]=0,this._inflate[pn]=[],r&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,s)})}_compress(t,r,n){let i=this._isServer?"server":"client";if(!this._deflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?Qs.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=Qs.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[Dr]=0,this._deflate[pn]=[],this._deflate.on("error",yJ),this._deflate.on("data",EJ)}this._deflate[Ws]=n,this._deflate.write(t),this._deflate.flush(Qs.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=cx.concat(this._deflate[pn],this._deflate[Dr]);r&&(o=o.slice(0,o.length-4)),this._deflate[Ws]=null,this._deflate[Dr]=0,this._deflate[pn]=[],r&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,o)})}};dx.exports=gg;function EJ(e){this[pn].push(e),this[Dr]+=e.length}function px(e){if(this[Dr]+=e.length,this[Qc]._maxPayload<1||this[Dr]<=this[Qc]._maxPayload){this[pn].push(e);return}this[Hc]=new RangeError("Max payload size exceeded"),this[Hc].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Hc][lx]=1009,this.removeListener("data",px),this.reset()}function _J(e){this[Qc]._inflate=null,e[lx]=1007,this[Ws](e)}});var vg=y((Fae,yg)=>{"use strict";p();function fx(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function hx(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}try{let e=M("utf-8-validate");typeof e=="object"&&(e=e.Validation.isValidUTF8),yg.exports={isValidStatusCode:fx,isValidUTF8(t){return t.length<150?hx(t):e(t)}}}catch{yg.exports={isValidStatusCode:fx,isValidUTF8:hx}}});var bg=y((Uae,_x)=>{"use strict";p();var{Writable:SJ}=M("stream"),mx=zs(),{BINARY_TYPES:bJ,EMPTY_BUFFER:TJ,kStatusCode:IJ,kWebSocket:wJ}=zn(),{concat:Eg,toArrayBuffer:OJ,unmask:AJ}=Hs(),{isValidStatusCode:xJ,isValidUTF8:gx}=vg(),Ys=0,yx=1,vx=2,Ex=3,_g=4,CJ=5,Sg=class extends SJ{constructor(t,r,n,i,o,s){super(),this._binaryType=t||bJ[0],this[wJ]=void 0,this._extensions=r||{},this._isServer=!!n,this._maxBufferedChunks=o|0,this._maxFragments=s|0,this._maxPayload=i|0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=Ys,this._loop=!1}_write(t,r,n){if(this._opcode===8&&this._state==Ys)return n();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks)return n(ke(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(n)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=n.slice(t),n.slice(0,t)}let r=Buffer.allocUnsafe(t);do{let n=this._buffers[0],i=r.length-t;t>=n.length?r.set(this._buffers.shift(),i):(r.set(new Uint8Array(n.buffer,n.byteOffset,t),i),this._buffers[0]=n.slice(t)),t-=n.length}while(t>0);return r}startLoop(t){let r;this._loop=!0;do switch(this._state){case Ys:r=this.getInfo();break;case yx:r=this.getPayloadLength16();break;case vx:r=this.getPayloadLength64();break;case Ex:this.getMask();break;case _g:r=this.getData(t);break;default:this._loop=!1;return}while(this._loop);t(r)}getInfo(){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0)return this._loop=!1,ke(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");let r=(t[0]&64)===64;if(r&&!this._extensions[mx.extensionName])return this._loop=!1,ke(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(r)return this._loop=!1,ke(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,ke(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented)return this._loop=!1,ke(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin)return this._loop=!1,ke(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(r)return this._loop=!1,ke(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125)return this._loop=!1,ke(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}else return this._loop=!1,ke(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked)return this._loop=!1,ke(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,ke(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(this._payloadLength===126)this._state=yx;else if(this._payloadLength===127)this._state=vx;else return this.haveLength()}getPayloadLength16(){if(this._bufferedBytes<2){this._loop=!1;return}return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength()}getPayloadLength64(){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),r=t.readUInt32BE(0);return r>Math.pow(2,21)-1?(this._loop=!1,ke(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=r*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,ke(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=Ex:this._state=_g}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=_g}getData(t){let r=TJ;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&AJ(r,this._mask)}if(this._opcode>7)return this.controlMessage(r);if(this._compressed){this._state=CJ,this.decompress(r,t);return}if(r.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments)return this._loop=!1,ke(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");this._messageLength=this._totalPayloadLength,this._fragments.push(r)}return this.dataMessage()}decompress(t,r){this._extensions[mx.extensionName].decompress(t,this._fin,(i,o)=>{if(i)return r(i);if(o.length){if(this._messageLength+=o.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return r(ke(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));if(this._maxFragments>0&&this._fragments.length>=this._maxFragments)return r(ke(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));this._fragments.push(o)}let s=this.dataMessage();if(s)return r(s);this.startLoop(r)})}dataMessage(){if(this._fin){let t=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=Eg(r,t):this._binaryType==="arraybuffer"?n=OJ(Eg(r,t)):n=r,this.emit("message",n)}else{let n=Eg(r,t);if(!gx(n))return this._loop=!1,ke(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",n.toString())}}this._state=Ys}controlMessage(t){if(this._opcode===8)if(this._loop=!1,t.length===0)this.emit("conclude",1005,""),this.end();else{if(t.length===1)return ke(RangeError,"invalid payload length 1",!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");{let r=t.readUInt16BE(0);if(!xJ(r))return ke(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");let n=t.slice(2);if(!gx(n))return ke(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("conclude",r,n.toString()),this.end()}}else this._opcode===9?this.emit("ping",t):this.emit("pong",t);this._state=Ys}};_x.exports=Sg;function ke(e,t,r,n,i){let o=new e(r?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,ke),o.code=i,o[IJ]=n,o}});var Ig=y((Bae,Tx)=>{"use strict";p();var Gae=M("net"),$ae=M("tls"),{randomFillSync:RJ}=M("crypto"),Sx=zs(),{EMPTY_BUFFER:NJ}=zn(),{isValidStatusCode:PJ}=vg(),{mask:bx,toBuffer:Lr}=Hs(),Yn=Buffer.alloc(4),Tg=class e{constructor(t,r){this._extensions=r||{},this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(t,r){let n=r.mask&&r.readOnly,i=r.mask?6:2,o=t.length;t.length>=65536?(i+=8,o=127):t.length>125&&(i+=2,o=126);let s=Buffer.allocUnsafe(n?t.length+i:i);return s[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(s[0]|=64),s[1]=o,o===126?s.writeUInt16BE(t.length,2):o===127&&(s.writeUInt32BE(0,2),s.writeUInt32BE(t.length,6)),r.mask?(RJ(Yn,0,4),s[1]|=128,s[i-4]=Yn[0],s[i-3]=Yn[1],s[i-2]=Yn[2],s[i-1]=Yn[3],n?(bx(t,Yn,s,i,t.length),[s]):(bx(t,Yn,t,0,t.length),[s,t])):[s,t]}close(t,r,n,i){let o;if(t===void 0)o=NJ;else{if(typeof t!="number"||!PJ(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||r==="")o=Buffer.allocUnsafe(2),o.writeUInt16BE(t,0);else{let s=Buffer.byteLength(r);if(s>123)throw new RangeError("The message must not be greater than 123 bytes");o=Buffer.allocUnsafe(2+s),o.writeUInt16BE(t,0),o.write(r,2)}}this._deflating?this.enqueue([this.doClose,o,n,i]):this.doClose(o,n,i)}doClose(t,r,n){this.sendFrame(e.frame(t,{fin:!0,rsv1:!1,opcode:8,mask:r,readOnly:!1}),n)}ping(t,r,n){let i=Lr(t);if(i.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPing,i,r,Lr.readOnly,n]):this.doPing(i,r,Lr.readOnly,n)}doPing(t,r,n,i){this.sendFrame(e.frame(t,{fin:!0,rsv1:!1,opcode:9,mask:r,readOnly:n}),i)}pong(t,r,n){let i=Lr(t);if(i.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPong,i,r,Lr.readOnly,n]):this.doPong(i,r,Lr.readOnly,n)}doPong(t,r,n,i){this.sendFrame(e.frame(t,{fin:!0,rsv1:!1,opcode:10,mask:r,readOnly:n}),i)}send(t,r,n){let i=Lr(t),o=this._extensions[Sx.extensionName],s=r.binary?2:1,a=r.compress;if(this._firstFragment?(this._firstFragment=!1,a&&o&&(a=i.length>=o._threshold),this._compress=a):(a=!1,s=0),r.fin&&(this._firstFragment=!0),o){let u={fin:r.fin,rsv1:a,opcode:s,mask:r.mask,readOnly:Lr.readOnly};this._deflating?this.enqueue([this.dispatch,i,this._compress,u,n]):this.dispatch(i,this._compress,u,n)}else this.sendFrame(e.frame(i,{fin:r.fin,rsv1:!1,opcode:s,mask:r.mask,readOnly:Lr.readOnly}),n)}dispatch(t,r,n,i){if(!r){this.sendFrame(e.frame(t,n),i);return}let o=this._extensions[Sx.extensionName];this._bufferedBytes+=t.length,this._deflating=!0,o.compress(t,n.fin,(s,a)=>{if(this._socket.destroyed){let u=new Error("The socket was closed while data was being compressed");typeof i=="function"&&i(u);for(let c=0;c<this._queue.length;c++){let l=this._queue[c][4];typeof l=="function"&&l(u)}return}this._bufferedBytes-=t.length,this._deflating=!1,n.readOnly=!1,this.sendFrame(e.frame(a,n),i),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[1].length,Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[1].length,this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};Tx.exports=Tg});var wx=y((Hae,Ix)=>{"use strict";p();var io=class{constructor(t,r){this.target=r,this.type=t}},wg=class extends io{constructor(t,r){super("message",r),this.data=t}},Og=class extends io{constructor(t,r,n){super("close",n),this.wasClean=n._closeFrameReceived&&n._closeFrameSent,this.reason=r,this.code=t}},Ag=class extends io{constructor(t){super("open",t)}},xg=class extends io{constructor(t,r){super("error",r),this.message=t.message,this.error=t}},DJ={addEventListener(e,t,r){if(typeof t!="function")return;function n(u){t.call(this,new wg(u,this))}function i(u,c){t.call(this,new Og(u,c,this))}function o(u){t.call(this,new xg(u,this))}function s(){t.call(this,new Ag(this))}let a=r&&r.once?"once":"on";e==="message"?(n._listener=t,this[a](e,n)):e==="close"?(i._listener=t,this[a](e,i)):e==="error"?(o._listener=t,this[a](e,o)):e==="open"?(s._listener=t,this[a](e,s)):this[a](e,t)},removeEventListener(e,t){let r=this.listeners(e);for(let n=0;n<r.length;n++)(r[n]===t||r[n]._listener===t)&&this.removeListener(e,r[n])}};Ix.exports=DJ});var Cg=y((Wae,Ox)=>{"use strict";p();var Js=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function vr(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function LJ(e){let t=Object.create(null);if(e===void 0||e==="")return t;let r=Object.create(null),n=!1,i=!1,o=!1,s,a,u=-1,c=-1,l=0;for(;l<e.length;l++){let f=e.charCodeAt(l);if(s===void 0)if(c===-1&&Js[f]===1)u===-1&&(u=l);else if(f===32||f===9)c===-1&&u!==-1&&(c=l);else if(f===59||f===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${l}`);c===-1&&(c=l);let h=e.slice(u,c);f===44?(vr(t,h,r),r=Object.create(null)):s=h,u=c=-1}else throw new SyntaxError(`Unexpected character at index ${l}`);else if(a===void 0)if(c===-1&&Js[f]===1)u===-1&&(u=l);else if(f===32||f===9)c===-1&&u!==-1&&(c=l);else if(f===59||f===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${l}`);c===-1&&(c=l),vr(r,e.slice(u,c),!0),f===44&&(vr(t,s,r),r=Object.create(null),s=void 0),u=c=-1}else if(f===61&&u!==-1&&c===-1)a=e.slice(u,l),u=c=-1;else throw new SyntaxError(`Unexpected character at index ${l}`);else if(i){if(Js[f]!==1)throw new SyntaxError(`Unexpected character at index ${l}`);u===-1?u=l:n||(n=!0),i=!1}else if(o)if(Js[f]===1)u===-1&&(u=l);else if(f===34&&u!==-1)o=!1,c=l;else if(f===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${l}`);else if(f===34&&e.charCodeAt(l-1)===61)o=!0;else if(c===-1&&Js[f]===1)u===-1&&(u=l);else if(u!==-1&&(f===32||f===9))c===-1&&(c=l);else if(f===59||f===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${l}`);c===-1&&(c=l);let h=e.slice(u,c);n&&(h=h.replace(/\\/g,""),n=!1),vr(r,a,h),f===44&&(vr(t,s,r),r=Object.create(null),s=void 0),a=void 0,u=c=-1}else throw new SyntaxError(`Unexpected character at index ${l}`)}if(u===-1||o)throw new SyntaxError("Unexpected end of input");c===-1&&(c=l);let d=e.slice(u,c);return s===void 0?vr(t,d,r):(a===void 0?vr(r,d,!0):n?vr(r,a,d.replace(/\\/g,"")):vr(r,a,d),vr(t,s,r)),t}function kJ(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(n=>[t].concat(Object.keys(n).map(i=>{let o=n[i];return Array.isArray(o)||(o=[o]),o.map(s=>s===!0?i:`${i}=${s}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Ox.exports={format:kJ,parse:LJ}});var kg=y((Jae,jx)=>{"use strict";p();var jJ=M("events"),MJ=M("https"),FJ=M("http"),Cx=M("net"),qJ=M("tls"),{randomBytes:UJ,createHash:VJ}=M("crypto"),{Readable:Yae}=M("stream"),{URL:Rg}=M("url"),dn=zs(),GJ=bg(),$J=Ig(),{BINARY_TYPES:Ax,EMPTY_BUFFER:Ng,GUID:BJ,kStatusCode:KJ,kWebSocket:st,NOOP:Rx}=zn(),{addEventListener:HJ,removeEventListener:QJ}=wx(),{format:WJ,parse:zJ}=Cg(),{toBuffer:YJ}=Hs(),kr=["CONNECTING","OPEN","CLOSING","CLOSED"],Pg=[8,13],JJ=30*1e3,qe=class e extends jJ{constructor(t,r,n){super(),this._binaryType=Ax[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage="",this._closeTimer=null,this._extensions={},this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,Array.isArray(r)?r=r.join(", "):typeof r=="object"&&r!==null&&(n=r,r=void 0),Nx(this,t,r,n)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(t){Ax.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get onclose(){}set onclose(t){}get onerror(){}set onerror(t){}get onopen(){}set onopen(t){}get onmessage(){}set onmessage(t){}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,n,i,o){let s=new GJ(this.binaryType,this._extensions,this._isServer,n,i,o);this._sender=new $J(t,this._extensions),this._receiver=s,this._socket=t,s[st]=this,t[st]=this,s.on("conclude",e2),s.on("drain",t2),s.on("error",r2),s.on("message",n2),s.on("ping",i2),s.on("pong",o2),t.setTimeout(0),t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",Dx),t.on("data",Wc),t.on("end",Lx),t.on("error",kx),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[dn.extensionName]&&this._extensions[dn.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING)return xt(this,this._req,"WebSocket was closed before the connection was established");if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),JJ)}}ping(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Lg(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||Ng,r,n)}pong(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Lg(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||Ng,r,n)}send(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(n=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Lg(this,t,n);return}let i={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[dn.extensionName]||(i.compress=!1),this._sender.send(t||Ng,i,n)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING)return xt(this,this._req,"WebSocket was closed before the connection was established");this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(qe,"CONNECTING",{enumerable:!0,value:kr.indexOf("CONNECTING")});Object.defineProperty(qe.prototype,"CONNECTING",{enumerable:!0,value:kr.indexOf("CONNECTING")});Object.defineProperty(qe,"OPEN",{enumerable:!0,value:kr.indexOf("OPEN")});Object.defineProperty(qe.prototype,"OPEN",{enumerable:!0,value:kr.indexOf("OPEN")});Object.defineProperty(qe,"CLOSING",{enumerable:!0,value:kr.indexOf("CLOSING")});Object.defineProperty(qe.prototype,"CLOSING",{enumerable:!0,value:kr.indexOf("CLOSING")});Object.defineProperty(qe,"CLOSED",{enumerable:!0,value:kr.indexOf("CLOSED")});Object.defineProperty(qe.prototype,"CLOSED",{enumerable:!0,value:kr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","protocol","readyState","url"].forEach(e=>{Object.defineProperty(qe.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(qe.prototype,`on${e}`,{enumerable:!0,get(){let t=this.listeners(e);for(let r=0;r<t.length;r++)if(t[r]._listener)return t[r]._listener},set(t){let r=this.listeners(e);for(let n=0;n<r.length;n++)r[n]._listener&&this.removeListener(e,r[n]);this.addEventListener(e,t)}})});qe.prototype.addEventListener=HJ;qe.prototype.removeEventListener=QJ;jx.exports=qe;function Nx(e,t,r,n){let i={protocolVersion:Pg[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:void 0,host:void 0,path:void 0,port:void 0};if(!Pg.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Pg.join(", ")})`);let o;t instanceof Rg?(o=t,e._url=t.href):(o=new Rg(t),e._url=t);let s=o.protocol==="ws+unix:";if(!o.host&&(!s||!o.pathname)){let h=new Error(`Invalid URL: ${e.url}`);if(e._redirects===0)throw h;Dg(e,h);return}let a=o.protocol==="wss:"||o.protocol==="https:",u=a?443:80,c=UJ(16).toString("base64"),l=a?MJ.get:FJ.get,d;if(i.createConnection=a?ZJ:XJ,i.defaultPort=i.defaultPort||u,i.port=o.port||u,i.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,i.headers={"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":c,Connection:"Upgrade",Upgrade:"websocket",...i.headers},i.path=o.pathname+o.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(d=new dn(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=WJ({[dn.extensionName]:d.offer()})),r&&(i.headers["Sec-WebSocket-Protocol"]=r),i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(o.username||o.password)&&(i.auth=`${o.username}:${o.password}`),s){let h=i.path.split(":");i.socketPath=h[0],i.path=h[1]}if(i.followRedirects){if(e._redirects===0){e._originalUnixSocket=s,e._originalSecure=a,e._originalHostOrSocketPath=s?i.socketPath:o.host;let h=n&&n.headers;if(n={...n,headers:{}},h)for(let[g,v]of Object.entries(h))n.headers[g.toLowerCase()]=v}else{let h=s?e._originalUnixSocket?i.socketPath===e._originalHostOrSocketPath:!1:e._originalUnixSocket?!1:o.host===e._originalHostOrSocketPath;(!h||e._originalSecure&&!a)&&(delete i.headers.authorization,delete i.headers.cookie,h||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64"))}let f=e._req=l(i);i.timeout&&f.on("timeout",()=>{xt(e,f,"Opening handshake has timed out")}),f.on("error",h=>{f===null||f.aborted||(f=e._req=null,Dg(e,h))}),f.on("response",h=>{let g=h.headers.location,v=h.statusCode;if(g&&i.followRedirects&&v>=300&&v<400){if(++e._redirects>i.maxRedirects){xt(e,f,"Maximum redirects exceeded");return}f.abort();let _;try{_=new Rg(g,t)}catch(b){Dg(e,b);return}Nx(e,_,r,n)}else e.emit("unexpected-response",f,h)||xt(e,f,`Unexpected server response: ${h.statusCode}`)}),f.on("upgrade",(h,g,v)=>{if(e.emit("upgrade",h),e.readyState!==qe.CONNECTING)return;f=e._req=null;let _=h.headers.upgrade;if(_===void 0||_.toLowerCase()!=="websocket"){xt(e,g,"Invalid Upgrade header");return}let b=VJ("sha1").update(c+BJ).digest("base64");if(h.headers["sec-websocket-accept"]!==b){xt(e,g,"Invalid Sec-WebSocket-Accept header");return}let S=h.headers["sec-websocket-protocol"],I=(r||"").split(/, */),A;if(!r&&S?A="Server sent a subprotocol but none was requested":r&&!S?A="Server sent no subprotocol":S&&!I.includes(S)&&(A="Server sent an invalid subprotocol"),A){xt(e,g,A);return}S&&(e._protocol=S);let T=h.headers["sec-websocket-extensions"];if(T!==void 0){if(!d){xt(e,g,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let x;try{x=zJ(T)}catch{xt(e,g,"Invalid Sec-WebSocket-Extensions header");return}let U=Object.keys(x);if(U.length){if(U.length!==1||U[0]!==dn.extensionName){xt(e,g,"Server indicated an extension that was not requested");return}try{d.accept(x[dn.extensionName])}catch{xt(e,g,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[dn.extensionName]=d}}e.setSocket(g,v,i.maxPayload,i.maxBufferedChunks,i.maxFragments)})}function Dg(e,t){e._readyState=qe.CLOSING,e.emit("error",t),e.emitClose()}function XJ(e){return e.path=e.socketPath,Cx.connect(e)}function ZJ(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=Cx.isIP(e.host)?"":e.host),qJ.connect(e)}function xt(e,t,r){e._readyState=qe.CLOSING;let n=new Error(r);Error.captureStackTrace(n,xt),t.setHeader?(t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),t.once("abort",e.emitClose.bind(e)),e.emit("error",n)):(t.destroy(n),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function Lg(e,t,r){if(t){let n=YJ(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${e.readyState} (${kr[e.readyState]})`);r(n)}}function e2(e,t){let r=this[st];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[st]!==void 0&&(r._socket.removeListener("data",Wc),process.nextTick(Px,r._socket),e===1005?r.close():r.close(e,t))}function t2(){this[st]._socket.resume()}function r2(e){let t=this[st];t._socket[st]!==void 0&&(t._socket.removeListener("data",Wc),process.nextTick(Px,t._socket),t.close(e[KJ])),t.emit("error",e)}function xx(){this[st].emitClose()}function n2(e){this[st].emit("message",e)}function i2(e){let t=this[st];t.pong(e,!t._isServer,Rx),t.emit("ping",e)}function o2(e){this[st].emit("pong",e)}function Px(e){e.resume()}function Dx(){let e=this[st];this.removeListener("close",Dx),this.removeListener("data",Wc),this.removeListener("end",Lx),e._readyState=qe.CLOSING;let t;!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&(t=e._socket.read())!==null&&e._receiver.write(t),e._receiver.end(),this[st]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",xx),e._receiver.on("finish",xx))}function Wc(e){this[st]._receiver.write(e)||this.pause()}function Lx(){let e=this[st];e._readyState=qe.CLOSING,e._receiver.end(),this.end()}function kx(){let e=this[st];this.removeListener("error",kx),this.on("error",Rx),e&&(e._readyState=qe.CLOSING,this.destroy())}});var Ux=y((Zae,qx)=>{"use strict";p();var{Duplex:s2}=M("stream");function Mx(e){e.emit("close")}function a2(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Fx(e){this.removeListener("error",Fx),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function u2(e,t){let r=!0,n=!0;function i(){r&&e._socket.resume()}e.readyState===e.CONNECTING?e.once("open",function(){e._receiver.removeAllListeners("drain"),e._receiver.on("drain",i)}):(e._receiver.removeAllListeners("drain"),e._receiver.on("drain",i));let o=new s2({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(a){o.push(a)||(r=!1,e._socket.pause())}),e.once("error",function(a){o.destroyed||(n=!1,o.destroy(a))}),e.once("close",function(){o.destroyed||o.push(null)}),o._destroy=function(s,a){if(e.readyState===e.CLOSED){a(s),process.nextTick(Mx,o);return}let u=!1;e.once("error",function(l){u=!0,a(l)}),e.once("close",function(){u||a(s),process.nextTick(Mx,o)}),n&&e.terminate()},o._final=function(s){if(e.readyState===e.CONNECTING){e.once("open",function(){o._final(s)});return}e._socket!==null&&(e._socket._writableState.finished?(s(),o._readableState.endEmitted&&o.destroy()):(e._socket.once("finish",function(){s()}),e.close()))},o._read=function(){(e.readyState===e.OPEN||e.readyState===e.CLOSING)&&!r&&(r=!0,e._receiver._writableState.needDrain||e._socket.resume())},o._write=function(s,a,u){if(e.readyState===e.CONNECTING){e.once("open",function(){o._write(s,a,u)});return}e.send(s,u)},o.on("end",a2),o.on("error",Fx),o}qx.exports=u2});var Kx=y((iue,Bx)=>{"use strict";p();var c2=M("events"),zc=M("http"),tue=M("https"),rue=M("net"),nue=M("tls"),{createHash:l2}=M("crypto"),Jn=zs(),p2=kg(),{format:d2,parse:f2}=Cg(),{GUID:h2,kWebSocket:m2}=zn(),g2=/^[+/0-9A-Za-z]{22}==$/,Vx=0,Gx=1,$x=2,Mg=class extends c2{constructor(t,r){if(super(),t={maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=zc.createServer((n,i)=>{let o=zc.STATUS_CODES[426];i.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),i.end(o)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=y2(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,o,s)=>{this.handleUpgrade(i,o,s,n)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set),this.options=t,this._state=Vx}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(t&&this.once("close",t),this._state===$x){process.nextTick(jg,this);return}if(this._state===Gx)return;if(this._state=Gx,this.clients)for(let n of this.clients)n.terminate();let r=this._server;if(r&&(this._removeListeners(),this._removeListeners=this._server=null,this.options.port!=null)){r.close(jg.bind(void 0,this));return}process.nextTick(jg,this)}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,n,i){r.on("error",Fg);let o=t.headers["sec-websocket-key"]!==void 0?t.headers["sec-websocket-key"].trim():!1,s=t.headers.upgrade,a=+t.headers["sec-websocket-version"],u={};if(t.method!=="GET"||s===void 0||s.toLowerCase()!=="websocket"||!o||!g2.test(o)||a!==8&&a!==13||!this.shouldHandle(t))return Xs(r,400);if(this.options.perMessageDeflate){let c=new Jn(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let l=f2(t.headers["sec-websocket-extensions"]);l[Jn.extensionName]&&(c.accept(l[Jn.extensionName]),u[Jn.extensionName]=c)}catch{return Xs(r,400)}}if(this.options.verifyClient){let c={origin:t.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(c,(l,d,f,h)=>{if(!l)return Xs(r,d||401,f,h);this.completeUpgrade(o,u,t,r,n,i)});return}if(!this.options.verifyClient(c))return Xs(r,401)}this.completeUpgrade(o,u,t,r,n,i)}completeUpgrade(t,r,n,i,o,s){if(!i.readable||!i.writable)return i.destroy();if(i[m2])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Vx)return Xs(i,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${l2("sha1").update(t+h2).digest("base64")}`],c=new p2(null),l=n.headers["sec-websocket-protocol"];if(l&&(l=l.split(",").map(v2),this.options.handleProtocols?l=this.options.handleProtocols(l,n):l=l[0],l&&(u.push(`Sec-WebSocket-Protocol: ${l}`),c._protocol=l)),r[Jn.extensionName]){let d=r[Jn.extensionName].params,f=d2({[Jn.extensionName]:[d]});u.push(`Sec-WebSocket-Extensions: ${f}`),c._extensions=r}this.emit("headers",u,n),i.write(u.concat(`\r
|
|
202
202
|
`).join(`\r
|
|
203
|
-
`)),i.removeListener("error",Fg),c.setSocket(i,o,this.options.maxPayload,this.options.maxBufferedChunks,this.options.maxFragments),this.clients&&(this.clients.add(c),c.on("close",()=>this.clients.delete(c))),s(c,n)}};
|
|
203
|
+
`)),i.removeListener("error",Fg),c.setSocket(i,o,this.options.maxPayload,this.options.maxBufferedChunks,this.options.maxFragments),this.clients&&(this.clients.add(c),c.on("close",()=>this.clients.delete(c))),s(c,n)}};Bx.exports=Mg;function y2(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return function(){for(let n of Object.keys(t))e.removeListener(n,t[n])}}function jg(e){e._state=$x,e.emit("close")}function Fg(){this.destroy()}function Xs(e,t,r,n){e.writable&&(r=r||zc.STATUS_CODES[t],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...n},e.write(`HTTP/1.1 ${t} ${zc.STATUS_CODES[t]}\r
|
|
204
204
|
`+Object.keys(n).map(i=>`${i}: ${n[i]}`).join(`\r
|
|
205
205
|
`)+`\r
|
|
206
206
|
\r
|
|
207
|
-
`+r)),e.removeListener("error",Fg),e.destroy()}function h2(e){return e.trim()}});var $x=y((rue,Gx)=>{"use strict";p();var Xs=kg();Xs.createWebSocketStream=jx();Xs.Server=Vx();Xs.Receiver=Sg();Xs.Sender=Ig();Gx.exports=Xs});var Hg=y(ht=>{"use strict";p();ht.isIterable=Bx;ht.isArrayLike=Jc;ht.isCollection=g2;ht.getIterator=Vg;ht.getIteratorMethod=Gg;ht.createIterator=Kx;ht.forEach=y2;ht.isAsyncIterable=E2;ht.getAsyncIterator=Hx;ht.getAsyncIteratorMethod=Bg;ht.createAsyncIterator=Qx;ht.forAwaitEach=_2;var Yc=typeof Symbol=="function"?Symbol:void 0,qg=Yc&&Yc.iterator,m2=ht.$$iterator=qg||"@@iterator";function Bx(e){return!!Gg(e)}function Jc(e){var t=e!=null&&e.length;return typeof t=="number"&&t>=0&&t%1===0}function g2(e){return Object(e)===e&&(Jc(e)||Bx(e))}function Vg(e){var t=Gg(e);if(t)return t.call(e)}function Gg(e){if(e!=null){var t=qg&&e[qg]||e["@@iterator"];if(typeof t=="function")return t}}function Kx(e){if(e!=null){var t=Vg(e);if(t)return t;if(Jc(e))return new $g(e)}}function $g(e){this._o=e,this._i=0}$g.prototype[m2]=function(){return this};$g.prototype.next=function(){return this._o===void 0||this._i>=this._o.length?(this._o=void 0,{value:void 0,done:!0}):{value:this._o[this._i++],done:!1}};function y2(e,t,r){if(e!=null){if(typeof e.forEach=="function")return e.forEach(t,r);var n=0,i=Vg(e);if(i){for(var o;!(o=i.next()).done;)if(t.call(r,o.value,n++,e),n>9999999)throw new TypeError("Near-infinite iteration.")}else if(Jc(e))for(;n<e.length;n++)e.hasOwnProperty(n)&&t.call(r,e[n],n,e)}}var Ug=Yc&&Yc.asyncIterator,v2=ht.$$asyncIterator=Ug||"@@asyncIterator";function E2(e){return!!Bg(e)}function Hx(e){var t=Bg(e);if(t)return t.call(e)}function Bg(e){if(e!=null){var t=Ug&&e[Ug]||e["@@asyncIterator"];if(typeof t=="function")return t}}function Qx(e){if(e!=null){var t=Hx(e);if(t)return t;var r=Kx(e);if(r)return new Zs(r)}}function Zs(e){this._i=e}Zs.prototype[v2]=function(){return this};Zs.prototype.next=function(e){return Kg(this._i,"next",e)};Zs.prototype.return=function(e){return this._i.return?Kg(this._i,"return",e):Promise.resolve({value:e,done:!0})};Zs.prototype.throw=function(e){return this._i.throw?Kg(this._i,"throw",e):Promise.reject(e)};function Kg(e,t,r){var n;return new Promise(function(i){n=e[t](r),i(n.value)}).then(function(i){return{value:i,done:n.done}})}function _2(e,t,r){var n=Qx(e);if(n){var i=0;return new Promise(function(o,s){function a(){return n.next().then(function(u){return u.done?o():Promise.resolve(t.call(r,u.value,i++,e)).then(a).catch(s),null}).catch(s),null}a()})}}});var Wx=y(Xc=>{"use strict";p();Object.defineProperty(Xc,"__esModule",{value:!0});Xc.createEmptyIterable=void 0;var b2=Hg(),S2=function(){var e;return e={next:function(){return Promise.resolve({value:void 0,done:!0})},return:function(){return Promise.resolve({value:void 0,done:!0})},throw:function(t){return Promise.reject(t)}},e[b2.$$asyncIterator]=function(){return this},e};Xc.createEmptyIterable=S2});var zx=y(Zc=>{"use strict";p();Object.defineProperty(Zc,"__esModule",{value:!0});Zc.isASubscriptionOperation=void 0;var T2=ln(),I2=function(e,t){var r=(0,T2.getOperationAST)(e,t);return!!r&&r.operation==="subscription"};Zc.isASubscriptionOperation=I2});var Yx=y(oo=>{"use strict";p();var Et=oo&&oo.__assign||function(){return Et=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Et.apply(this,arguments)};Object.defineProperty(oo,"__esModule",{value:!0});oo.parseLegacyProtocolMessage=void 0;var at=Bs(),w2=function(e,t){var r=t;switch(t.type){case at.default.INIT:e.isLegacy=!0,r=Et(Et({},t),{type:at.default.GQL_CONNECTION_INIT});break;case at.default.SUBSCRIPTION_START:r={id:t.id,type:at.default.GQL_START,payload:{query:t.query,operationName:t.operationName,variables:t.variables}};break;case at.default.SUBSCRIPTION_END:r=Et(Et({},t),{type:at.default.GQL_STOP});break;case at.default.GQL_CONNECTION_ACK:e.isLegacy&&(r=Et(Et({},t),{type:at.default.INIT_SUCCESS}));break;case at.default.GQL_CONNECTION_ERROR:e.isLegacy&&(r=Et(Et({},t),{type:at.default.INIT_FAIL,payload:t.payload.message?{error:t.payload.message}:t.payload}));break;case at.default.GQL_ERROR:e.isLegacy&&(r=Et(Et({},t),{type:at.default.SUBSCRIPTION_FAIL}));break;case at.default.GQL_DATA:e.isLegacy&&(r=Et(Et({},t),{type:at.default.SUBSCRIPTION_DATA}));break;case at.default.GQL_COMPLETE:e.isLegacy&&(r=null);break;case at.default.SUBSCRIPTION_SUCCESS:e.isLegacy||(r=null);break;default:break}return r};oo.parseLegacyProtocolMessage=w2});var Zx=y(el=>{"use strict";p();Object.defineProperty(el,"__esModule",{value:!0});el.SubscriptionServer=void 0;var Qg=$x(),rt=Bs(),Jx=$c(),O2=ug(),Wg=ln(),A2=Wx(),zg=Hg(),x2=zx(),Xx=Yx(),C2=function(e){return e.on},R2=(function(){function e(t,r){var n=this,i=t.onOperation,o=t.onOperationComplete,s=t.onConnect,a=t.onDisconnect,u=t.keepAlive;this.specifiedRules=t.validationRules||Wg.specifiedRules,this.loadExecutor(t),this.onOperation=i,this.onOperationComplete=o,this.onConnect=s,this.onDisconnect=a,this.keepAlive=u,C2(r)?this.wsServer=r:this.wsServer=new Qg.Server(r||{});var c=(function(l,d){if(l.upgradeReq=d,l.protocol===void 0||l.protocol.indexOf(Jx.GRAPHQL_WS)===-1&&l.protocol.indexOf(Jx.GRAPHQL_SUBSCRIPTIONS)===-1){l.close(1002);return}var f=Object.create(null);f.initPromise=Promise.resolve(!0),f.isLegacy=!1,f.socket=l,f.request=d,f.operations={};var h=function(g){g&&(n.sendError(f,"",{message:g.message?g.message:g},rt.default.GQL_CONNECTION_ERROR),setTimeout(function(){f.socket.close(1011)},10)),n.onClose(f),n.onDisconnect&&n.onDisconnect(l,f)};l.on("error",h),l.on("close",h),l.on("message",n.onMessage(f))});this.wsServer.on("connection",c),this.closeHandler=function(){n.wsServer.removeListener("connection",c),n.wsServer.close()}}return e.create=function(t,r){return new e(t,r)},Object.defineProperty(e.prototype,"server",{get:function(){return this.wsServer},enumerable:!1,configurable:!0}),e.prototype.close=function(){this.closeHandler()},e.prototype.loadExecutor=function(t){var r=t.execute,n=t.subscribe,i=t.schema,o=t.rootValue;if(!r)throw new Error("Must provide `execute` for websocket server constructor.");this.schema=i,this.rootValue=o,this.execute=r,this.subscribe=n},e.prototype.unsubscribe=function(t,r){t.operations&&t.operations[r]&&(t.operations[r].return&&t.operations[r].return(),delete t.operations[r],this.onOperationComplete&&this.onOperationComplete(t.socket,r))},e.prototype.onClose=function(t){var r=this;Object.keys(t.operations).forEach(function(n){r.unsubscribe(t,n)})},e.prototype.onMessage=function(t){var r=this;return function(n){var i;try{i=(0,Xx.parseLegacyProtocolMessage)(t,JSON.parse(n))}catch(s){r.sendError(t,null,{message:s.message},rt.default.GQL_CONNECTION_ERROR);return}var o=i.id;switch(i.type){case rt.default.GQL_CONNECTION_INIT:r.onConnect&&(t.initPromise=new Promise(function(s,a){try{s(r.onConnect(i.payload,t.socket,t))}catch(u){a(u)}})),t.initPromise.then(function(s){if(s===!1)throw new Error("Prohibited connection!");if(r.sendMessage(t,void 0,rt.default.GQL_CONNECTION_ACK,void 0),r.keepAlive){r.sendKeepAlive(t);var a=setInterval(function(){t.socket.readyState===Qg.OPEN?r.sendKeepAlive(t):clearInterval(a)},r.keepAlive)}}).catch(function(s){r.sendError(t,o,{message:s.message},rt.default.GQL_CONNECTION_ERROR),setTimeout(function(){t.socket.close(1011)},10)});break;case rt.default.GQL_CONNECTION_TERMINATE:t.socket.close();break;case rt.default.GQL_START:t.initPromise.then(function(s){t.operations&&t.operations[o]&&r.unsubscribe(t,o);var a={query:i.payload.query,variables:i.payload.variables,operationName:i.payload.operationName,context:(0,O2.default)(s)?Object.assign(Object.create(Object.getPrototypeOf(s)),s):{},formatResponse:void 0,formatError:void 0,callback:void 0,schema:r.schema},u=Promise.resolve(a);if(t.operations[o]=(0,A2.createEmptyIterable)(),r.onOperation){var c=i;u=Promise.resolve(r.onOperation(c,a,t.socket))}return u.then(function(l){if(typeof l!="object"){var d="Invalid params returned from onOperation! return values must be an object!";throw r.sendError(t,o,{message:d}),new Error(d)}if(!l.schema){var d="Missing schema information. The GraphQL schema should be provided either statically in the `SubscriptionServer` constructor or as a property on the object returned from onOperation!";throw r.sendError(t,o,{message:d}),new Error(d)}var f=typeof a.query!="string"?a.query:(0,Wg.parse)(a.query),h,g=(0,Wg.validate)(l.schema,f,r.specifiedRules);if(g.length>0)h=Promise.resolve({errors:g});else{var v=r.execute;r.subscribe&&(0,x2.isASubscriptionOperation)(f,l.operationName)&&(v=r.subscribe),h=Promise.resolve(v({schema:l.schema,document:f,rootValue:r.rootValue,contextValue:l.context,variableValues:l.variables,operationName:l.operationName}))}return h.then(function(_){return{executionIterable:(0,zg.isAsyncIterable)(_)?_:(0,zg.createAsyncIterator)([_]),params:l}})}).then(function(l){var d=l.executionIterable,f=l.params;return(0,zg.forAwaitEach)(d,function(h){var g=h;if(f.formatResponse)try{g=f.formatResponse(h,f)}catch(v){console.error("Error in formatResponse function:",v)}r.sendMessage(t,o,rt.default.GQL_DATA,g)}).then(function(){r.sendMessage(t,o,rt.default.GQL_COMPLETE,null)}).catch(function(h){var g=h;if(f.formatError)try{g=f.formatError(h,f)}catch(v){console.error("Error in formatError function: ",v)}Object.keys(g).length===0&&(g={name:g.name,message:g.message}),r.sendError(t,o,g)}),d}).then(function(l){t.operations[o]=l}).then(function(){r.sendMessage(t,o,rt.default.SUBSCRIPTION_SUCCESS,void 0)}).catch(function(l){l.errors?r.sendMessage(t,o,rt.default.GQL_DATA,{errors:l.errors}):r.sendError(t,o,{message:l.message}),r.unsubscribe(t,o)})}).catch(function(s){r.sendError(t,o,{message:s.message}),r.unsubscribe(t,o)});break;case rt.default.GQL_STOP:r.unsubscribe(t,o);break;default:r.sendError(t,o,{message:"Invalid message type!"})}}},e.prototype.sendKeepAlive=function(t){t.isLegacy?this.sendMessage(t,void 0,rt.default.KEEP_ALIVE,void 0):this.sendMessage(t,void 0,rt.default.GQL_CONNECTION_KEEP_ALIVE,void 0)},e.prototype.sendMessage=function(t,r,n,i){var o=(0,Xx.parseLegacyProtocolMessage)(t,{type:n,id:r,payload:i});o&&t.socket.readyState===Qg.OPEN&&t.socket.send(JSON.stringify(o))},e.prototype.sendError=function(t,r,n,i){var o=i||rt.default.GQL_ERROR;if([rt.default.GQL_CONNECTION_ERROR,rt.default.GQL_ERROR].indexOf(o)===-1)throw new Error("overrideDefaultErrorType should be one of the allowed error messages GQL_CONNECTION_ERROR or GQL_ERROR");this.sendMessage(t,r,o,n)},e})();el.SubscriptionServer=R2});var Jg=y(tr=>{"use strict";p();var N2=tr&&tr.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),Yg=tr&&tr.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&N2(t,e,r)};Object.defineProperty(tr,"__esModule",{value:!0});tr.MessageTypes=void 0;Yg(Y0(),tr);Yg(Zx(),tr);var P2=Bs();Object.defineProperty(tr,"MessageTypes",{enumerable:!0,get:function(){return P2.default}});Yg($c(),tr)});var jr=y((gue,rC)=>{"use strict";p();var eC=["nodebuffer","arraybuffer","fragments"],tC=typeof Blob<"u";tC&&eC.push("blob");rC.exports={BINARY_TYPES:eC,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:tC,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var ea=y((vue,tl)=>{"use strict";p();var{EMPTY_BUFFER:D2}=jr(),Xg=Buffer[Symbol.species];function L2(e,t){if(e.length===0)return D2;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),n=0;for(let i=0;i<e.length;i++){let o=e[i];r.set(o,n),n+=o.length}return n<t?new Xg(r.buffer,r.byteOffset,n):r}function nC(e,t,r,n,i){for(let o=0;o<i;o++)r[n+o]=e[o]^t[o&3]}function iC(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function k2(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function Zg(e){if(Zg.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new Xg(e):ArrayBuffer.isView(e)?t=new Xg(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Zg.readOnly=!1),t}tl.exports={concat:L2,mask:nC,toArrayBuffer:k2,toBuffer:Zg,unmask:iC};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=M("bufferutil");tl.exports.mask=function(t,r,n,i,o){o<48?nC(t,r,n,i,o):e.mask(t,r,n,i,o)},tl.exports.unmask=function(t,r){t.length<32?iC(t,r):e.unmask(t,r)}}catch{}});var aC=y((_ue,sC)=>{"use strict";p();var oC=Symbol("kDone"),ey=Symbol("kRun"),ty=class{constructor(t){this[oC]=()=>{this.pending--,this[ey]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[ey]()}[ey](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[oC])}}};sC.exports=ty});var uo=y((Sue,pC)=>{"use strict";p();var ta=M("zlib"),uC=ea(),j2=aC(),{kStatusCode:cC}=jr(),M2=Buffer[Symbol.species],F2=Buffer.from([0,0,255,255]),nl=Symbol("permessage-deflate"),Mr=Symbol("total-length"),so=Symbol("callback"),fn=Symbol("buffers"),ao=Symbol("error"),rl,ry=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!rl){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;rl=new j2(r)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[so];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,n=t.find(i=>!(r.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>i.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(n.server_no_context_takeover=!0),r.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(n.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?n.client_max_window_bits=r.clientMaxWindowBits:(n.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(n=>{let i=r[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);r[n]=i})}),t}decompress(t,r,n){rl.add(i=>{this._decompress(t,r,(o,s)=>{i(),n(o,s)})})}compress(t,r,n){rl.add(i=>{this._compress(t,r,(o,s)=>{i(),n(o,s)})})}_decompress(t,r,n){let i=this._isServer?"client":"server";if(!this._inflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?ta.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=ta.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[nl]=this,this._inflate[Mr]=0,this._inflate[fn]=[],this._inflate.on("error",U2),this._inflate.on("data",lC)}this._inflate[so]=n,this._inflate.write(t),r&&this._inflate.write(F2),this._inflate.flush(()=>{let o=this._inflate[ao];if(o){this._inflate.close(),this._inflate=null,n(o);return}let s=uC.concat(this._inflate[fn],this._inflate[Mr]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Mr]=0,this._inflate[fn]=[],r&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,s)})}_compress(t,r,n){let i=this._isServer?"server":"client";if(!this._deflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?ta.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=ta.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[Mr]=0,this._deflate[fn]=[],this._deflate.on("data",q2)}this._deflate[so]=n,this._deflate.write(t),this._deflate.flush(ta.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=uC.concat(this._deflate[fn],this._deflate[Mr]);r&&(o=new M2(o.buffer,o.byteOffset,o.length-4)),this._deflate[so]=null,this._deflate[Mr]=0,this._deflate[fn]=[],r&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,o)})}};pC.exports=ry;function q2(e){this[fn].push(e),this[Mr]+=e.length}function lC(e){if(this[Mr]+=e.length,this[nl]._maxPayload<1||this[Mr]<=this[nl]._maxPayload){this[fn].push(e);return}this[ao]=new RangeError("Max payload size exceeded"),this[ao].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[ao][cC]=1009,this.removeListener("data",lC),this.reset()}function U2(e){if(this[nl]._inflate=null,this[ao]){this[so](this[ao]);return}e[cC]=1007,this[so](e)}});var co=y((Iue,il)=>{"use strict";p();var{isUtf8:dC}=M("buffer"),{hasBlob:V2}=jr(),G2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function $2(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function ny(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}function B2(e){return V2&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}il.exports={isBlob:B2,isValidStatusCode:$2,isValidUTF8:ny,tokenChars:G2};if(dC)il.exports.isValidUTF8=function(e){return e.length<24?ny(e):dC(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=M("utf-8-validate");il.exports.isValidUTF8=function(t){return t.length<32?ny(t):e(t)}}catch{}});var uy=y((Oue,EC)=>{"use strict";p();var{Writable:K2}=M("stream"),fC=uo(),{BINARY_TYPES:H2,EMPTY_BUFFER:hC,kStatusCode:Q2,kWebSocket:W2}=jr(),{concat:iy,toArrayBuffer:z2,unmask:Y2}=ea(),{isValidStatusCode:J2,isValidUTF8:mC}=co(),ol=Buffer[Symbol.species],Kt=0,gC=1,yC=2,vC=3,oy=4,sy=5,sl=6,ay=class extends K2{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||H2[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[W2]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Kt}_write(t,r,n){if(this._opcode===8&&this._state==Kt)return n();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){n(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(n)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new ol(n.buffer,n.byteOffset+t,n.length-t),new ol(n.buffer,n.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let n=this._buffers[0],i=r.length-t;t>=n.length?r.set(this._buffers.shift(),i):(r.set(new Uint8Array(n.buffer,n.byteOffset,t),i),this._buffers[0]=new ol(n.buffer,n.byteOffset+t,n.length-t)),t-=n.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case Kt:this.getInfo(t);break;case gC:this.getPayloadLength16(t);break;case yC:this.getPayloadLength64(t);break;case vC:this.getMask();break;case oy:this.getData(t);break;case sy:case sl:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(i);return}let n=(r[0]&64)===64;if(n&&!this._extensions[fC.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(i);return}this._payloadLength===126?this._state=gC:this._payloadLength===127?this._state=yC:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),n=r.readUInt32BE(0);if(n>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(i);return}this._payloadLength=n*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=vC:this._state=oy}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=oy}getData(t){let r=hC;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&Y2(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=sy,this.decompress(r,t);return}if(r.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let n=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(n);return}this._messageLength=this._totalPayloadLength,this._fragments.push(r)}this.dataMessage(t)}decompress(t,r){this._extensions[fC.extensionName].decompress(t,this._fin,(i,o)=>{if(i)return r(i);if(o.length){if(this._messageLength+=o.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let s=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(s);return}if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let s=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");r(s);return}this._fragments.push(o)}this.dataMessage(r),this._state===Kt&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=Kt;return}let r=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=iy(n,r):this._binaryType==="arraybuffer"?i=z2(iy(n,r)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=Kt):(this._state=sl,setImmediate(()=>{this.emit("message",i,!0),this._state=Kt,this.startLoop(t)}))}else{let i=iy(n,r);if(!this._skipUTF8Validation&&!mC(i)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(o);return}this._state===sy||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=Kt):(this._state=sl,setImmediate(()=>{this.emit("message",i,!1),this._state=Kt,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,hC),this.end();else{let n=t.readUInt16BE(0);if(!J2(n)){let o=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(o);return}let i=new ol(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!mC(i)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(o);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=Kt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=Kt):(this._state=sl,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=Kt,this.startLoop(r)}))}createError(t,r,n,i,o){this._loop=!1,this._errored=!0;let s=new t(n?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(s,this.createError),s.code=o,s[Q2]=i,s}};EC.exports=ay});var py=y((Cue,SC)=>{"use strict";p();var{Duplex:xue}=M("stream"),{randomFillSync:X2}=M("crypto"),{types:{isUint8Array:Z2}}=M("util"),_C=uo(),{EMPTY_BUFFER:e4,kWebSocket:t4,NOOP:r4}=jr(),{isBlob:lo,isValidStatusCode:n4}=co(),{mask:bC,toBuffer:Xn}=ea(),Ht=Symbol("kByteLength"),i4=Buffer.alloc(4),al=8*1024,Zn,po=al,rr=0,o4=1,s4=2,cy=class e{constructor(t,r,n){this._extensions=r||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=rr,this.onerror=r4,this[t4]=void 0}static frame(t,r){let n,i=!1,o=2,s=!1;r.mask&&(n=r.maskBuffer||i4,r.generateMask?r.generateMask(n):(po===al&&(Zn===void 0&&(Zn=Buffer.alloc(al)),X2(Zn,0,al),po=0),n[0]=Zn[po++],n[1]=Zn[po++],n[2]=Zn[po++],n[3]=Zn[po++]),s=(n[0]|n[1]|n[2]|n[3])===0,o=6);let a;typeof t=="string"?(!r.mask||s)&&r[Ht]!==void 0?a=r[Ht]:(t=Buffer.from(t),a=t.length):(a=t.length,i=r.mask&&r.readOnly&&!s);let u=a;a>=65536?(o+=8,u=127):a>125&&(o+=2,u=126);let c=Buffer.allocUnsafe(i?a+o:o);return c[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(c[0]|=64),c[1]=u,u===126?c.writeUInt16BE(a,2):u===127&&(c[2]=c[3]=0,c.writeUIntBE(a,4,6)),r.mask?(c[1]|=128,c[o-4]=n[0],c[o-3]=n[1],c[o-2]=n[2],c[o-1]=n[3],s?[c,t]:i?(bC(t,n,c,o,a),[c]):(bC(t,n,t,0,a),[c,t])):[c,t]}close(t,r,n,i){let o;if(t===void 0)o=e4;else{if(typeof t!="number"||!n4(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)o=Buffer.allocUnsafe(2),o.writeUInt16BE(t,0);else{let a=Buffer.byteLength(r);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");if(o=Buffer.allocUnsafe(2+a),o.writeUInt16BE(t,0),typeof r=="string")o.write(r,2);else if(Z2(r))o.set(r,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let s={[Ht]:o.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==rr?this.enqueue([this.dispatch,o,!1,s,i]):this.sendFrame(e.frame(o,s),i)}ping(t,r,n){let i,o;if(typeof t=="string"?(i=Buffer.byteLength(t),o=!1):lo(t)?(i=t.size,o=!1):(t=Xn(t),i=t.length,o=Xn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Ht]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};lo(t)?this._state!==rr?this.enqueue([this.getBlobData,t,!1,s,n]):this.getBlobData(t,!1,s,n):this._state!==rr?this.enqueue([this.dispatch,t,!1,s,n]):this.sendFrame(e.frame(t,s),n)}pong(t,r,n){let i,o;if(typeof t=="string"?(i=Buffer.byteLength(t),o=!1):lo(t)?(i=t.size,o=!1):(t=Xn(t),i=t.length,o=Xn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Ht]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};lo(t)?this._state!==rr?this.enqueue([this.getBlobData,t,!1,s,n]):this.getBlobData(t,!1,s,n):this._state!==rr?this.enqueue([this.dispatch,t,!1,s,n]):this.sendFrame(e.frame(t,s),n)}send(t,r,n){let i=this._extensions[_C.extensionName],o=r.binary?2:1,s=r.compress,a,u;typeof t=="string"?(a=Buffer.byteLength(t),u=!1):lo(t)?(a=t.size,u=!1):(t=Xn(t),a=t.length,u=Xn.readOnly),this._firstFragment?(this._firstFragment=!1,s&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(s=a>=i._threshold),this._compress=s):(s=!1,o=0),r.fin&&(this._firstFragment=!0);let c={[Ht]:a,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:u,rsv1:s};lo(t)?this._state!==rr?this.enqueue([this.getBlobData,t,this._compress,c,n]):this.getBlobData(t,this._compress,c,n):this._state!==rr?this.enqueue([this.dispatch,t,this._compress,c,n]):this.dispatch(t,this._compress,c,n)}getBlobData(t,r,n,i){this._bufferedBytes+=n[Ht],this._state=s4,t.arrayBuffer().then(o=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(ly,this,a,i);return}this._bufferedBytes-=n[Ht];let s=Xn(o);r?this.dispatch(s,r,n,i):(this._state=rr,this.sendFrame(e.frame(s,n),i),this.dequeue())}).catch(o=>{process.nextTick(a4,this,o,i)})}dispatch(t,r,n,i){if(!r){this.sendFrame(e.frame(t,n),i);return}let o=this._extensions[_C.extensionName];this._bufferedBytes+=n[Ht],this._state=o4,o.compress(t,n.fin,(s,a)=>{if(this._socket.destroyed){let u=new Error("The socket was closed while data was being compressed");ly(this,u,i);return}this._bufferedBytes-=n[Ht],this._state=rr,n.readOnly=!1,this.sendFrame(e.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===rr&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][Ht],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Ht],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};SC.exports=cy;function ly(e,t,r){typeof r=="function"&&r(t);for(let n=0;n<e._queue.length;n++){let i=e._queue[n],o=i[i.length-1];typeof o=="function"&&o(t)}}function a4(e,t,r){ly(e,t,r),e.onerror(t)}});var NC=y((Nue,RC)=>{"use strict";p();var{kForOnEventAttribute:ra,kListener:dy}=jr(),TC=Symbol("kCode"),IC=Symbol("kData"),wC=Symbol("kError"),OC=Symbol("kMessage"),AC=Symbol("kReason"),fo=Symbol("kTarget"),xC=Symbol("kType"),CC=Symbol("kWasClean"),Fr=class{constructor(t){this[fo]=null,this[xC]=t}get target(){return this[fo]}get type(){return this[xC]}};Object.defineProperty(Fr.prototype,"target",{enumerable:!0});Object.defineProperty(Fr.prototype,"type",{enumerable:!0});var ei=class extends Fr{constructor(t,r={}){super(t),this[TC]=r.code===void 0?0:r.code,this[AC]=r.reason===void 0?"":r.reason,this[CC]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[TC]}get reason(){return this[AC]}get wasClean(){return this[CC]}};Object.defineProperty(ei.prototype,"code",{enumerable:!0});Object.defineProperty(ei.prototype,"reason",{enumerable:!0});Object.defineProperty(ei.prototype,"wasClean",{enumerable:!0});var ho=class extends Fr{constructor(t,r={}){super(t),this[wC]=r.error===void 0?null:r.error,this[OC]=r.message===void 0?"":r.message}get error(){return this[wC]}get message(){return this[OC]}};Object.defineProperty(ho.prototype,"error",{enumerable:!0});Object.defineProperty(ho.prototype,"message",{enumerable:!0});var na=class extends Fr{constructor(t,r={}){super(t),this[IC]=r.data===void 0?null:r.data}get data(){return this[IC]}};Object.defineProperty(na.prototype,"data",{enumerable:!0});var u4={addEventListener(e,t,r={}){for(let i of this.listeners(e))if(!r[ra]&&i[dy]===t&&!i[ra])return;let n;if(e==="message")n=function(o,s){let a=new na("message",{data:s?o:o.toString()});a[fo]=this,ul(t,this,a)};else if(e==="close")n=function(o,s){let a=new ei("close",{code:o,reason:s.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[fo]=this,ul(t,this,a)};else if(e==="error")n=function(o){let s=new ho("error",{error:o,message:o.message});s[fo]=this,ul(t,this,s)};else if(e==="open")n=function(){let o=new Fr("open");o[fo]=this,ul(t,this,o)};else return;n[ra]=!!r[ra],n[dy]=t,r.once?this.once(e,n):this.on(e,n)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[dy]===t&&!r[ra]){this.removeListener(e,r);break}}};RC.exports={CloseEvent:ei,ErrorEvent:ho,Event:Fr,EventTarget:u4,MessageEvent:na};function ul(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var cl=y((Due,PC)=>{"use strict";p();var{tokenChars:ia}=co();function Er(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function c4(e){let t=Object.create(null),r=Object.create(null),n=!1,i=!1,o=!1,s,a,u=-1,c=-1,l=-1,d=0;for(;d<e.length;d++)if(c=e.charCodeAt(d),s===void 0)if(l===-1&&ia[c]===1)u===-1&&(u=d);else if(d!==0&&(c===32||c===9))l===-1&&u!==-1&&(l=d);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d);let h=e.slice(u,l);c===44?(Er(t,h,r),r=Object.create(null)):s=h,u=l=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);else if(a===void 0)if(l===-1&&ia[c]===1)u===-1&&(u=d);else if(c===32||c===9)l===-1&&u!==-1&&(l=d);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d),Er(r,e.slice(u,l),!0),c===44&&(Er(t,s,r),r=Object.create(null),s=void 0),u=l=-1}else if(c===61&&u!==-1&&l===-1)a=e.slice(u,d),u=l=-1;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(i){if(ia[c]!==1)throw new SyntaxError(`Unexpected character at index ${d}`);u===-1?u=d:n||(n=!0),i=!1}else if(o)if(ia[c]===1)u===-1&&(u=d);else if(c===34&&u!==-1)o=!1,l=d;else if(c===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(c===34&&e.charCodeAt(d-1)===61)o=!0;else if(l===-1&&ia[c]===1)u===-1&&(u=d);else if(u!==-1&&(c===32||c===9))l===-1&&(l=d);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d);let h=e.slice(u,l);n&&(h=h.replace(/\\/g,""),n=!1),Er(r,a,h),c===44&&(Er(t,s,r),r=Object.create(null),s=void 0),a=void 0,u=l=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);if(u===-1||o||c===32||c===9)throw new SyntaxError("Unexpected end of input");l===-1&&(l=d);let f=e.slice(u,l);return s===void 0?Er(t,f,r):(a===void 0?Er(r,f,!0):n?Er(r,a,f.replace(/\\/g,"")):Er(r,a,f),Er(t,s,r)),t}function l4(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(n=>[t].concat(Object.keys(n).map(i=>{let o=n[i];return Array.isArray(o)||(o=[o]),o.map(s=>s===!0?i:`${i}=${s}`).join("; ")})).join("; ")).join(", ")}).join(", ")}PC.exports={format:l4,parse:c4}});var fl=y((Mue,BC)=>{"use strict";p();var p4=M("events"),d4=M("https"),f4=M("http"),kC=M("net"),h4=M("tls"),{randomBytes:m4,createHash:g4}=M("crypto"),{Duplex:kue,Readable:jue}=M("stream"),{URL:fy}=M("url"),hn=uo(),y4=uy(),v4=py(),{isBlob:E4}=co(),{BINARY_TYPES:DC,CLOSE_TIMEOUT:_4,EMPTY_BUFFER:ll,GUID:b4,kForOnEventAttribute:hy,kListener:S4,kStatusCode:T4,kWebSocket:Ye,NOOP:jC}=jr(),{EventTarget:{addEventListener:I4,removeEventListener:w4}}=NC(),{format:O4,parse:A4}=cl(),{toBuffer:x4}=ea(),MC=Symbol("kAborted"),my=[8,13],qr=["CONNECTING","OPEN","CLOSING","CLOSED"],C4=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Re=class e extends p4{constructor(t,r,n){super(),this._binaryType=DC[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=ll,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(n=r,r=[]):r=[r]),FC(this,t,r,n)):(this._autoPong=n.autoPong,this._closeTimeout=n.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){DC.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,n){let i=new y4({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:n.maxBufferedChunks,maxFragments:n.maxFragments,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),o=new v4(t,this._extensions,n.generateMask);this._receiver=i,this._sender=o,this._socket=t,i[Ye]=this,o[Ye]=this,t[Ye]=this,i.on("conclude",P4),i.on("drain",D4),i.on("error",L4),i.on("message",k4),i.on("ping",j4),i.on("pong",M4),o.onerror=F4,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",VC),t.on("data",dl),t.on("end",GC),t.on("error",$C),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[hn.extensionName]&&this._extensions[hn.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){xt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),UC(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){gy(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||ll,r,n)}pong(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){gy(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||ll,r,n)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(n=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){gy(this,t,n);return}let i={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[hn.extensionName]||(i.compress=!1),this._sender.send(t||ll,i,n)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){xt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(Re,"CONNECTING",{enumerable:!0,value:qr.indexOf("CONNECTING")});Object.defineProperty(Re.prototype,"CONNECTING",{enumerable:!0,value:qr.indexOf("CONNECTING")});Object.defineProperty(Re,"OPEN",{enumerable:!0,value:qr.indexOf("OPEN")});Object.defineProperty(Re.prototype,"OPEN",{enumerable:!0,value:qr.indexOf("OPEN")});Object.defineProperty(Re,"CLOSING",{enumerable:!0,value:qr.indexOf("CLOSING")});Object.defineProperty(Re.prototype,"CLOSING",{enumerable:!0,value:qr.indexOf("CLOSING")});Object.defineProperty(Re,"CLOSED",{enumerable:!0,value:qr.indexOf("CLOSED")});Object.defineProperty(Re.prototype,"CLOSED",{enumerable:!0,value:qr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(Re.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(Re.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[hy])return t[S4];return null},set(t){for(let r of this.listeners(e))if(r[hy]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[hy]:!0})}})});Re.prototype.addEventListener=I4;Re.prototype.removeEventListener=w4;BC.exports=Re;function FC(e,t,r,n){let i={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:_4,protocolVersion:my[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=i.autoPong,e._closeTimeout=i.closeTimeout,!my.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${my.join(", ")})`);let o;if(t instanceof fy)o=t;else try{o=new fy(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}o.protocol==="http:"?o.protocol="ws:":o.protocol==="https:"&&(o.protocol="wss:"),e._url=o.href;let s=o.protocol==="wss:",a=o.protocol==="ws+unix:",u;if(o.protocol!=="ws:"&&!s&&!a?u=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!o.pathname?u="The URL's pathname is empty":o.hash&&(u="The URL contains a fragment identifier"),u){let v=new SyntaxError(u);if(e._redirects===0)throw v;pl(e,v);return}let c=s?443:80,l=m4(16).toString("base64"),d=s?d4.request:f4.request,f=new Set,h;if(i.createConnection=i.createConnection||(s?N4:R4),i.defaultPort=i.defaultPort||c,i.port=o.port||c,i.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},i.path=o.pathname+o.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(h=new hn({...i.perMessageDeflate,isServer:!1,maxPayload:i.maxPayload}),i.headers["Sec-WebSocket-Extensions"]=O4({[hn.extensionName]:h.offer()})),r.length){for(let v of r){if(typeof v!="string"||!C4.test(v)||f.has(v))throw new SyntaxError("An invalid or duplicated subprotocol was specified");f.add(v)}i.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(o.username||o.password)&&(i.auth=`${o.username}:${o.password}`),a){let v=i.path.split(":");i.socketPath=v[0],i.path=v[1]}let g;if(i.followRedirects){if(e._redirects===0){e._originalIpc=a,e._originalSecure=s,e._originalHostOrSocketPath=a?i.socketPath:o.host;let v=n&&n.headers;if(n={...n,headers:{}},v)for(let[_,S]of Object.entries(v))n.headers[_.toLowerCase()]=S}else if(e.listenerCount("redirect")===0){let v=a?e._originalIpc?i.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:o.host===e._originalHostOrSocketPath;(!v||e._originalSecure&&!s)&&(delete i.headers.authorization,delete i.headers.cookie,v||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),g=e._req=d(i),e._redirects&&e.emit("redirect",e.url,g)}else g=e._req=d(i);i.timeout&&g.on("timeout",()=>{xt(e,g,"Opening handshake has timed out")}),g.on("error",v=>{g===null||g[MC]||(g=e._req=null,pl(e,v))}),g.on("response",v=>{let _=v.headers.location,S=v.statusCode;if(_&&i.followRedirects&&S>=300&&S<400){if(++e._redirects>i.maxRedirects){xt(e,g,"Maximum redirects exceeded");return}g.abort();let b;try{b=new fy(_,t)}catch{let O=new SyntaxError(`Invalid URL: ${_}`);pl(e,O);return}FC(e,b,r,n)}else e.emit("unexpected-response",g,v)||xt(e,g,`Unexpected server response: ${v.statusCode}`)}),g.on("upgrade",(v,_,S)=>{if(e.emit("upgrade",v),e.readyState!==Re.CONNECTING)return;g=e._req=null;let b=v.headers.upgrade;if(b===void 0||b.toLowerCase()!=="websocket"){xt(e,_,"Invalid Upgrade header");return}let A=g4("sha1").update(l+b4).digest("base64");if(v.headers["sec-websocket-accept"]!==A){xt(e,_,"Invalid Sec-WebSocket-Accept header");return}let O=v.headers["sec-websocket-protocol"],T;if(O!==void 0?f.size?f.has(O)||(T="Server sent an invalid subprotocol"):T="Server sent a subprotocol but none was requested":f.size&&(T="Server sent no subprotocol"),T){xt(e,_,T);return}O&&(e._protocol=O);let x=v.headers["sec-websocket-extensions"];if(x!==void 0){if(!h){xt(e,_,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let U;try{U=A4(x)}catch{xt(e,_,"Invalid Sec-WebSocket-Extensions header");return}let C=Object.keys(U);if(C.length!==1||C[0]!==hn.extensionName){xt(e,_,"Server indicated an extension that was not requested");return}try{h.accept(U[hn.extensionName])}catch{xt(e,_,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[hn.extensionName]=h}e.setSocket(_,S,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxBufferedChunks:i.maxBufferedChunks,maxFragments:i.maxFragments,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(g,e):g.end()}function pl(e,t){e._readyState=Re.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function R4(e){return e.path=e.socketPath,kC.connect(e)}function N4(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=kC.isIP(e.host)?"":e.host),h4.connect(e)}function xt(e,t,r){e._readyState=Re.CLOSING;let n=new Error(r);Error.captureStackTrace(n,xt),t.setHeader?(t[MC]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(pl,e,n)):(t.destroy(n),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function gy(e,t,r){if(t){let n=E4(t)?t.size:x4(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${e.readyState} (${qr[e.readyState]})`);process.nextTick(r,n)}}function P4(e,t){let r=this[Ye];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[Ye]!==void 0&&(r._socket.removeListener("data",dl),process.nextTick(qC,r._socket),e===1005?r.close():r.close(e,t))}function D4(){let e=this[Ye];e.isPaused||e._socket.resume()}function L4(e){let t=this[Ye];t._socket[Ye]!==void 0&&(t._socket.removeListener("data",dl),process.nextTick(qC,t._socket),t.close(e[T4])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function LC(){this[Ye].emitClose()}function k4(e,t){this[Ye].emit("message",e,t)}function j4(e){let t=this[Ye];t._autoPong&&t.pong(e,!this._isServer,jC),t.emit("ping",e)}function M4(e){this[Ye].emit("pong",e)}function qC(e){e.resume()}function F4(e){let t=this[Ye];t.readyState!==Re.CLOSED&&(t.readyState===Re.OPEN&&(t._readyState=Re.CLOSING,UC(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function UC(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function VC(){let e=this[Ye];if(this.removeListener("close",VC),this.removeListener("data",dl),this.removeListener("end",GC),e._readyState=Re.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[Ye]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",LC),e._receiver.on("finish",LC))}function dl(e){this[Ye]._receiver.write(e)||this.pause()}function GC(){let e=this[Ye];e._readyState=Re.CLOSING,e._receiver.end(),this.end()}function $C(){let e=this[Ye];this.removeListener("error",$C),this.on("error",jC),e&&(e._readyState=Re.CLOSING,this.destroy())}});var WC=y((Uue,QC)=>{"use strict";p();var que=fl(),{Duplex:q4}=M("stream");function KC(e){e.emit("close")}function U4(){!this.destroyed&&this._writableState.finished&&this.destroy()}function HC(e){this.removeListener("error",HC),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function V4(e,t){let r=!0,n=new q4({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(o,s){let a=!s&&n._readableState.objectMode?o.toString():o;n.push(a)||e.pause()}),e.once("error",function(o){n.destroyed||(r=!1,n.destroy(o))}),e.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,o){if(e.readyState===e.CLOSED){o(i),process.nextTick(KC,n);return}let s=!1;e.once("error",function(u){s=!0,o(u)}),e.once("close",function(){s||o(i),process.nextTick(KC,n)}),r&&e.terminate()},n._final=function(i){if(e.readyState===e.CONNECTING){e.once("open",function(){n._final(i)});return}e._socket!==null&&(e._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(e._socket.once("finish",function(){i()}),e.close()))},n._read=function(){e.isPaused&&e.resume()},n._write=function(i,o,s){if(e.readyState===e.CONNECTING){e.once("open",function(){n._write(i,o,s)});return}e.send(i,s)},n.on("end",U4),n.on("error",HC),n}QC.exports=V4});var yy=y((Gue,zC)=>{"use strict";p();var{tokenChars:G4}=co();function $4(e){let t=new Set,r=-1,n=-1,i=0;for(i;i<e.length;i++){let s=e.charCodeAt(i);if(n===-1&&G4[s]===1)r===-1&&(r=i);else if(i!==0&&(s===32||s===9))n===-1&&r!==-1&&(n=i);else if(s===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let a=e.slice(r,n);if(t.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);t.add(a),r=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(r===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let o=e.slice(r,i);if(t.has(o))throw new SyntaxError(`The "${o}" subprotocol is duplicated`);return t.add(o),t}zC.exports={parse:$4}});var rR=y((Kue,tR)=>{"use strict";p();var B4=M("events"),hl=M("http"),{Duplex:Bue}=M("stream"),{createHash:K4}=M("crypto"),YC=cl(),ti=uo(),H4=yy(),Q4=fl(),{CLOSE_TIMEOUT:W4,GUID:z4,kWebSocket:Y4}=jr(),J4=/^[+/0-9A-Za-z]{22}==$/,JC=0,XC=1,eR=2,vy=class extends B4{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:W4,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Q4,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=hl.createServer((n,i)=>{let o=hl.STATUS_CODES[426];i.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),i.end(o)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=X4(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,o,s)=>{this.handleUpgrade(i,o,s,n)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=JC}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===eR){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(oa,this);return}if(t&&this.once("close",t),this._state!==XC)if(this._state=XC,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(oa,this):process.nextTick(oa,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{oa(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,n,i){r.on("error",ZC);let o=t.headers["sec-websocket-key"],s=t.headers.upgrade,a=+t.headers["sec-websocket-version"];if(t.method!=="GET"){ri(this,t,r,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){ri(this,t,r,400,"Invalid Upgrade header");return}if(o===void 0||!J4.test(o)){ri(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){ri(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){sa(r,400);return}let u=t.headers["sec-websocket-protocol"],c=new Set;if(u!==void 0)try{c=H4.parse(u)}catch{ri(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let l=t.headers["sec-websocket-extensions"],d={};if(this.options.perMessageDeflate&&l!==void 0){let f=new ti({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let h=YC.parse(l);h[ti.extensionName]&&(f.accept(h[ti.extensionName]),d[ti.extensionName]=f)}catch{ri(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let f={origin:t.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(f,(h,g,v,_)=>{if(!h)return sa(r,g||401,v,_);this.completeUpgrade(d,o,c,t,r,n,i)});return}if(!this.options.verifyClient(f))return sa(r,401)}this.completeUpgrade(d,o,c,t,r,n,i)}completeUpgrade(t,r,n,i,o,s,a){if(!o.readable||!o.writable)return o.destroy();if(o[Y4])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>JC)return sa(o,503);let c=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${K4("sha1").update(r+z4).digest("base64")}`],l=new this.options.WebSocket(null,void 0,this.options);if(n.size){let d=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;d&&(c.push(`Sec-WebSocket-Protocol: ${d}`),l._protocol=d)}if(t[ti.extensionName]){let d=t[ti.extensionName].params,f=YC.format({[ti.extensionName]:[d]});c.push(`Sec-WebSocket-Extensions: ${f}`),l._extensions=t}this.emit("headers",c,i),o.write(c.concat(`\r
|
|
207
|
+
`+r)),e.removeListener("error",Fg),e.destroy()}function v2(e){return e.trim()}});var Qx=y((sue,Hx)=>{"use strict";p();var Zs=kg();Zs.createWebSocketStream=Ux();Zs.Server=Kx();Zs.Receiver=bg();Zs.Sender=Ig();Hx.exports=Zs});var Hg=y(ht=>{"use strict";p();ht.isIterable=Wx;ht.isArrayLike=Jc;ht.isCollection=_2;ht.getIterator=Vg;ht.getIteratorMethod=Gg;ht.createIterator=zx;ht.forEach=S2;ht.isAsyncIterable=T2;ht.getAsyncIterator=Yx;ht.getAsyncIteratorMethod=Bg;ht.createAsyncIterator=Jx;ht.forAwaitEach=I2;var Yc=typeof Symbol=="function"?Symbol:void 0,qg=Yc&&Yc.iterator,E2=ht.$$iterator=qg||"@@iterator";function Wx(e){return!!Gg(e)}function Jc(e){var t=e!=null&&e.length;return typeof t=="number"&&t>=0&&t%1===0}function _2(e){return Object(e)===e&&(Jc(e)||Wx(e))}function Vg(e){var t=Gg(e);if(t)return t.call(e)}function Gg(e){if(e!=null){var t=qg&&e[qg]||e["@@iterator"];if(typeof t=="function")return t}}function zx(e){if(e!=null){var t=Vg(e);if(t)return t;if(Jc(e))return new $g(e)}}function $g(e){this._o=e,this._i=0}$g.prototype[E2]=function(){return this};$g.prototype.next=function(){return this._o===void 0||this._i>=this._o.length?(this._o=void 0,{value:void 0,done:!0}):{value:this._o[this._i++],done:!1}};function S2(e,t,r){if(e!=null){if(typeof e.forEach=="function")return e.forEach(t,r);var n=0,i=Vg(e);if(i){for(var o;!(o=i.next()).done;)if(t.call(r,o.value,n++,e),n>9999999)throw new TypeError("Near-infinite iteration.")}else if(Jc(e))for(;n<e.length;n++)e.hasOwnProperty(n)&&t.call(r,e[n],n,e)}}var Ug=Yc&&Yc.asyncIterator,b2=ht.$$asyncIterator=Ug||"@@asyncIterator";function T2(e){return!!Bg(e)}function Yx(e){var t=Bg(e);if(t)return t.call(e)}function Bg(e){if(e!=null){var t=Ug&&e[Ug]||e["@@asyncIterator"];if(typeof t=="function")return t}}function Jx(e){if(e!=null){var t=Yx(e);if(t)return t;var r=zx(e);if(r)return new ea(r)}}function ea(e){this._i=e}ea.prototype[b2]=function(){return this};ea.prototype.next=function(e){return Kg(this._i,"next",e)};ea.prototype.return=function(e){return this._i.return?Kg(this._i,"return",e):Promise.resolve({value:e,done:!0})};ea.prototype.throw=function(e){return this._i.throw?Kg(this._i,"throw",e):Promise.reject(e)};function Kg(e,t,r){var n;return new Promise(function(i){n=e[t](r),i(n.value)}).then(function(i){return{value:i,done:n.done}})}function I2(e,t,r){var n=Jx(e);if(n){var i=0;return new Promise(function(o,s){function a(){return n.next().then(function(u){return u.done?o():Promise.resolve(t.call(r,u.value,i++,e)).then(a).catch(s),null}).catch(s),null}a()})}}});var Xx=y(Xc=>{"use strict";p();Object.defineProperty(Xc,"__esModule",{value:!0});Xc.createEmptyIterable=void 0;var w2=Hg(),O2=function(){var e;return e={next:function(){return Promise.resolve({value:void 0,done:!0})},return:function(){return Promise.resolve({value:void 0,done:!0})},throw:function(t){return Promise.reject(t)}},e[w2.$$asyncIterator]=function(){return this},e};Xc.createEmptyIterable=O2});var Zx=y(Zc=>{"use strict";p();Object.defineProperty(Zc,"__esModule",{value:!0});Zc.isASubscriptionOperation=void 0;var A2=ln(),x2=function(e,t){var r=(0,A2.getOperationAST)(e,t);return!!r&&r.operation==="subscription"};Zc.isASubscriptionOperation=x2});var eC=y(oo=>{"use strict";p();var Et=oo&&oo.__assign||function(){return Et=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Et.apply(this,arguments)};Object.defineProperty(oo,"__esModule",{value:!0});oo.parseLegacyProtocolMessage=void 0;var at=Ks(),C2=function(e,t){var r=t;switch(t.type){case at.default.INIT:e.isLegacy=!0,r=Et(Et({},t),{type:at.default.GQL_CONNECTION_INIT});break;case at.default.SUBSCRIPTION_START:r={id:t.id,type:at.default.GQL_START,payload:{query:t.query,operationName:t.operationName,variables:t.variables}};break;case at.default.SUBSCRIPTION_END:r=Et(Et({},t),{type:at.default.GQL_STOP});break;case at.default.GQL_CONNECTION_ACK:e.isLegacy&&(r=Et(Et({},t),{type:at.default.INIT_SUCCESS}));break;case at.default.GQL_CONNECTION_ERROR:e.isLegacy&&(r=Et(Et({},t),{type:at.default.INIT_FAIL,payload:t.payload.message?{error:t.payload.message}:t.payload}));break;case at.default.GQL_ERROR:e.isLegacy&&(r=Et(Et({},t),{type:at.default.SUBSCRIPTION_FAIL}));break;case at.default.GQL_DATA:e.isLegacy&&(r=Et(Et({},t),{type:at.default.SUBSCRIPTION_DATA}));break;case at.default.GQL_COMPLETE:e.isLegacy&&(r=null);break;case at.default.SUBSCRIPTION_SUCCESS:e.isLegacy||(r=null);break;default:break}return r};oo.parseLegacyProtocolMessage=C2});var nC=y(el=>{"use strict";p();Object.defineProperty(el,"__esModule",{value:!0});el.SubscriptionServer=void 0;var Qg=Qx(),rt=Ks(),tC=$c(),R2=ug(),Wg=ln(),N2=Xx(),zg=Hg(),P2=Zx(),rC=eC(),D2=function(e){return e.on},L2=(function(){function e(t,r){var n=this,i=t.onOperation,o=t.onOperationComplete,s=t.onConnect,a=t.onDisconnect,u=t.keepAlive;this.specifiedRules=t.validationRules||Wg.specifiedRules,this.loadExecutor(t),this.onOperation=i,this.onOperationComplete=o,this.onConnect=s,this.onDisconnect=a,this.keepAlive=u,D2(r)?this.wsServer=r:this.wsServer=new Qg.Server(r||{});var c=(function(l,d){if(l.upgradeReq=d,l.protocol===void 0||l.protocol.indexOf(tC.GRAPHQL_WS)===-1&&l.protocol.indexOf(tC.GRAPHQL_SUBSCRIPTIONS)===-1){l.close(1002);return}var f=Object.create(null);f.initPromise=Promise.resolve(!0),f.isLegacy=!1,f.socket=l,f.request=d,f.operations={};var h=function(g){g&&(n.sendError(f,"",{message:g.message?g.message:g},rt.default.GQL_CONNECTION_ERROR),setTimeout(function(){f.socket.close(1011)},10)),n.onClose(f),n.onDisconnect&&n.onDisconnect(l,f)};l.on("error",h),l.on("close",h),l.on("message",n.onMessage(f))});this.wsServer.on("connection",c),this.closeHandler=function(){n.wsServer.removeListener("connection",c),n.wsServer.close()}}return e.create=function(t,r){return new e(t,r)},Object.defineProperty(e.prototype,"server",{get:function(){return this.wsServer},enumerable:!1,configurable:!0}),e.prototype.close=function(){this.closeHandler()},e.prototype.loadExecutor=function(t){var r=t.execute,n=t.subscribe,i=t.schema,o=t.rootValue;if(!r)throw new Error("Must provide `execute` for websocket server constructor.");this.schema=i,this.rootValue=o,this.execute=r,this.subscribe=n},e.prototype.unsubscribe=function(t,r){t.operations&&t.operations[r]&&(t.operations[r].return&&t.operations[r].return(),delete t.operations[r],this.onOperationComplete&&this.onOperationComplete(t.socket,r))},e.prototype.onClose=function(t){var r=this;Object.keys(t.operations).forEach(function(n){r.unsubscribe(t,n)})},e.prototype.onMessage=function(t){var r=this;return function(n){var i;try{i=(0,rC.parseLegacyProtocolMessage)(t,JSON.parse(n))}catch(s){r.sendError(t,null,{message:s.message},rt.default.GQL_CONNECTION_ERROR);return}var o=i.id;switch(i.type){case rt.default.GQL_CONNECTION_INIT:r.onConnect&&(t.initPromise=new Promise(function(s,a){try{s(r.onConnect(i.payload,t.socket,t))}catch(u){a(u)}})),t.initPromise.then(function(s){if(s===!1)throw new Error("Prohibited connection!");if(r.sendMessage(t,void 0,rt.default.GQL_CONNECTION_ACK,void 0),r.keepAlive){r.sendKeepAlive(t);var a=setInterval(function(){t.socket.readyState===Qg.OPEN?r.sendKeepAlive(t):clearInterval(a)},r.keepAlive)}}).catch(function(s){r.sendError(t,o,{message:s.message},rt.default.GQL_CONNECTION_ERROR),setTimeout(function(){t.socket.close(1011)},10)});break;case rt.default.GQL_CONNECTION_TERMINATE:t.socket.close();break;case rt.default.GQL_START:t.initPromise.then(function(s){t.operations&&t.operations[o]&&r.unsubscribe(t,o);var a={query:i.payload.query,variables:i.payload.variables,operationName:i.payload.operationName,context:(0,R2.default)(s)?Object.assign(Object.create(Object.getPrototypeOf(s)),s):{},formatResponse:void 0,formatError:void 0,callback:void 0,schema:r.schema},u=Promise.resolve(a);if(t.operations[o]=(0,N2.createEmptyIterable)(),r.onOperation){var c=i;u=Promise.resolve(r.onOperation(c,a,t.socket))}return u.then(function(l){if(typeof l!="object"){var d="Invalid params returned from onOperation! return values must be an object!";throw r.sendError(t,o,{message:d}),new Error(d)}if(!l.schema){var d="Missing schema information. The GraphQL schema should be provided either statically in the `SubscriptionServer` constructor or as a property on the object returned from onOperation!";throw r.sendError(t,o,{message:d}),new Error(d)}var f=typeof a.query!="string"?a.query:(0,Wg.parse)(a.query),h,g=(0,Wg.validate)(l.schema,f,r.specifiedRules);if(g.length>0)h=Promise.resolve({errors:g});else{var v=r.execute;r.subscribe&&(0,P2.isASubscriptionOperation)(f,l.operationName)&&(v=r.subscribe),h=Promise.resolve(v({schema:l.schema,document:f,rootValue:r.rootValue,contextValue:l.context,variableValues:l.variables,operationName:l.operationName}))}return h.then(function(_){return{executionIterable:(0,zg.isAsyncIterable)(_)?_:(0,zg.createAsyncIterator)([_]),params:l}})}).then(function(l){var d=l.executionIterable,f=l.params;return(0,zg.forAwaitEach)(d,function(h){var g=h;if(f.formatResponse)try{g=f.formatResponse(h,f)}catch(v){console.error("Error in formatResponse function:",v)}r.sendMessage(t,o,rt.default.GQL_DATA,g)}).then(function(){r.sendMessage(t,o,rt.default.GQL_COMPLETE,null)}).catch(function(h){var g=h;if(f.formatError)try{g=f.formatError(h,f)}catch(v){console.error("Error in formatError function: ",v)}Object.keys(g).length===0&&(g={name:g.name,message:g.message}),r.sendError(t,o,g)}),d}).then(function(l){t.operations[o]=l}).then(function(){r.sendMessage(t,o,rt.default.SUBSCRIPTION_SUCCESS,void 0)}).catch(function(l){l.errors?r.sendMessage(t,o,rt.default.GQL_DATA,{errors:l.errors}):r.sendError(t,o,{message:l.message}),r.unsubscribe(t,o)})}).catch(function(s){r.sendError(t,o,{message:s.message}),r.unsubscribe(t,o)});break;case rt.default.GQL_STOP:r.unsubscribe(t,o);break;default:r.sendError(t,o,{message:"Invalid message type!"})}}},e.prototype.sendKeepAlive=function(t){t.isLegacy?this.sendMessage(t,void 0,rt.default.KEEP_ALIVE,void 0):this.sendMessage(t,void 0,rt.default.GQL_CONNECTION_KEEP_ALIVE,void 0)},e.prototype.sendMessage=function(t,r,n,i){var o=(0,rC.parseLegacyProtocolMessage)(t,{type:n,id:r,payload:i});o&&t.socket.readyState===Qg.OPEN&&t.socket.send(JSON.stringify(o))},e.prototype.sendError=function(t,r,n,i){var o=i||rt.default.GQL_ERROR;if([rt.default.GQL_CONNECTION_ERROR,rt.default.GQL_ERROR].indexOf(o)===-1)throw new Error("overrideDefaultErrorType should be one of the allowed error messages GQL_CONNECTION_ERROR or GQL_ERROR");this.sendMessage(t,r,o,n)},e})();el.SubscriptionServer=L2});var Jg=y(tr=>{"use strict";p();var k2=tr&&tr.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),Yg=tr&&tr.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&k2(t,e,r)};Object.defineProperty(tr,"__esModule",{value:!0});tr.MessageTypes=void 0;Yg(ex(),tr);Yg(nC(),tr);var j2=Ks();Object.defineProperty(tr,"MessageTypes",{enumerable:!0,get:function(){return j2.default}});Yg($c(),tr)});var jr=y((_ue,sC)=>{"use strict";p();var iC=["nodebuffer","arraybuffer","fragments"],oC=typeof Blob<"u";oC&&iC.push("blob");sC.exports={BINARY_TYPES:iC,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:oC,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var ta=y((bue,tl)=>{"use strict";p();var{EMPTY_BUFFER:M2}=jr(),Xg=Buffer[Symbol.species];function F2(e,t){if(e.length===0)return M2;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),n=0;for(let i=0;i<e.length;i++){let o=e[i];r.set(o,n),n+=o.length}return n<t?new Xg(r.buffer,r.byteOffset,n):r}function aC(e,t,r,n,i){for(let o=0;o<i;o++)r[n+o]=e[o]^t[o&3]}function uC(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function q2(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function Zg(e){if(Zg.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new Xg(e):ArrayBuffer.isView(e)?t=new Xg(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Zg.readOnly=!1),t}tl.exports={concat:F2,mask:aC,toArrayBuffer:q2,toBuffer:Zg,unmask:uC};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=M("bufferutil");tl.exports.mask=function(t,r,n,i,o){o<48?aC(t,r,n,i,o):e.mask(t,r,n,i,o)},tl.exports.unmask=function(t,r){t.length<32?uC(t,r):e.unmask(t,r)}}catch{}});var pC=y((Iue,lC)=>{"use strict";p();var cC=Symbol("kDone"),ey=Symbol("kRun"),ty=class{constructor(t){this[cC]=()=>{this.pending--,this[ey]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[ey]()}[ey](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[cC])}}};lC.exports=ty});var uo=y((Oue,mC)=>{"use strict";p();var ra=M("zlib"),dC=ta(),U2=pC(),{kStatusCode:fC}=jr(),V2=Buffer[Symbol.species],G2=Buffer.from([0,0,255,255]),nl=Symbol("permessage-deflate"),Mr=Symbol("total-length"),so=Symbol("callback"),fn=Symbol("buffers"),ao=Symbol("error"),rl,ry=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!rl){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;rl=new U2(r)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[so];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,n=t.find(i=>!(r.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>i.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(n.server_no_context_takeover=!0),r.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(n.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?n.client_max_window_bits=r.clientMaxWindowBits:(n.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(n=>{let i=r[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);r[n]=i})}),t}decompress(t,r,n){rl.add(i=>{this._decompress(t,r,(o,s)=>{i(),n(o,s)})})}compress(t,r,n){rl.add(i=>{this._compress(t,r,(o,s)=>{i(),n(o,s)})})}_decompress(t,r,n){let i=this._isServer?"client":"server";if(!this._inflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?ra.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=ra.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[nl]=this,this._inflate[Mr]=0,this._inflate[fn]=[],this._inflate.on("error",B2),this._inflate.on("data",hC)}this._inflate[so]=n,this._inflate.write(t),r&&this._inflate.write(G2),this._inflate.flush(()=>{let o=this._inflate[ao];if(o){this._inflate.close(),this._inflate=null,n(o);return}let s=dC.concat(this._inflate[fn],this._inflate[Mr]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Mr]=0,this._inflate[fn]=[],r&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,s)})}_compress(t,r,n){let i=this._isServer?"server":"client";if(!this._deflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?ra.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=ra.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[Mr]=0,this._deflate[fn]=[],this._deflate.on("data",$2)}this._deflate[so]=n,this._deflate.write(t),this._deflate.flush(ra.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=dC.concat(this._deflate[fn],this._deflate[Mr]);r&&(o=new V2(o.buffer,o.byteOffset,o.length-4)),this._deflate[so]=null,this._deflate[Mr]=0,this._deflate[fn]=[],r&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,o)})}};mC.exports=ry;function $2(e){this[fn].push(e),this[Mr]+=e.length}function hC(e){if(this[Mr]+=e.length,this[nl]._maxPayload<1||this[Mr]<=this[nl]._maxPayload){this[fn].push(e);return}this[ao]=new RangeError("Max payload size exceeded"),this[ao].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[ao][fC]=1009,this.removeListener("data",hC),this.reset()}function B2(e){if(this[nl]._inflate=null,this[ao]){this[so](this[ao]);return}e[fC]=1007,this[so](e)}});var co=y((xue,il)=>{"use strict";p();var{isUtf8:gC}=M("buffer"),{hasBlob:K2}=jr(),H2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Q2(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function ny(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}function W2(e){return K2&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}il.exports={isBlob:W2,isValidStatusCode:Q2,isValidUTF8:ny,tokenChars:H2};if(gC)il.exports.isValidUTF8=function(e){return e.length<24?ny(e):gC(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=M("utf-8-validate");il.exports.isValidUTF8=function(t){return t.length<32?ny(t):e(t)}}catch{}});var uy=y((Rue,TC)=>{"use strict";p();var{Writable:z2}=M("stream"),yC=uo(),{BINARY_TYPES:Y2,EMPTY_BUFFER:vC,kStatusCode:J2,kWebSocket:X2}=jr(),{concat:iy,toArrayBuffer:Z2,unmask:e4}=ta(),{isValidStatusCode:t4,isValidUTF8:EC}=co(),ol=Buffer[Symbol.species],Kt=0,_C=1,SC=2,bC=3,oy=4,sy=5,sl=6,ay=class extends z2{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||Y2[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[X2]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Kt}_write(t,r,n){if(this._opcode===8&&this._state==Kt)return n();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){n(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(n)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new ol(n.buffer,n.byteOffset+t,n.length-t),new ol(n.buffer,n.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let n=this._buffers[0],i=r.length-t;t>=n.length?r.set(this._buffers.shift(),i):(r.set(new Uint8Array(n.buffer,n.byteOffset,t),i),this._buffers[0]=new ol(n.buffer,n.byteOffset+t,n.length-t)),t-=n.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case Kt:this.getInfo(t);break;case _C:this.getPayloadLength16(t);break;case SC:this.getPayloadLength64(t);break;case bC:this.getMask();break;case oy:this.getData(t);break;case sy:case sl:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(i);return}let n=(r[0]&64)===64;if(n&&!this._extensions[yC.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(i);return}this._payloadLength===126?this._state=_C:this._payloadLength===127?this._state=SC:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),n=r.readUInt32BE(0);if(n>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(i);return}this._payloadLength=n*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=bC:this._state=oy}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=oy}getData(t){let r=vC;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&e4(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=sy,this.decompress(r,t);return}if(r.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let n=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(n);return}this._messageLength=this._totalPayloadLength,this._fragments.push(r)}this.dataMessage(t)}decompress(t,r){this._extensions[yC.extensionName].decompress(t,this._fin,(i,o)=>{if(i)return r(i);if(o.length){if(this._messageLength+=o.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let s=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(s);return}if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let s=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");r(s);return}this._fragments.push(o)}this.dataMessage(r),this._state===Kt&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=Kt;return}let r=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=iy(n,r):this._binaryType==="arraybuffer"?i=Z2(iy(n,r)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=Kt):(this._state=sl,setImmediate(()=>{this.emit("message",i,!0),this._state=Kt,this.startLoop(t)}))}else{let i=iy(n,r);if(!this._skipUTF8Validation&&!EC(i)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(o);return}this._state===sy||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=Kt):(this._state=sl,setImmediate(()=>{this.emit("message",i,!1),this._state=Kt,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,vC),this.end();else{let n=t.readUInt16BE(0);if(!t4(n)){let o=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(o);return}let i=new ol(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!EC(i)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(o);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=Kt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=Kt):(this._state=sl,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=Kt,this.startLoop(r)}))}createError(t,r,n,i,o){this._loop=!1,this._errored=!0;let s=new t(n?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(s,this.createError),s.code=o,s[J2]=i,s}};TC.exports=ay});var py=y((Due,OC)=>{"use strict";p();var{Duplex:Pue}=M("stream"),{randomFillSync:r4}=M("crypto"),{types:{isUint8Array:n4}}=M("util"),IC=uo(),{EMPTY_BUFFER:i4,kWebSocket:o4,NOOP:s4}=jr(),{isBlob:lo,isValidStatusCode:a4}=co(),{mask:wC,toBuffer:Xn}=ta(),Ht=Symbol("kByteLength"),u4=Buffer.alloc(4),al=8*1024,Zn,po=al,rr=0,c4=1,l4=2,cy=class e{constructor(t,r,n){this._extensions=r||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=rr,this.onerror=s4,this[o4]=void 0}static frame(t,r){let n,i=!1,o=2,s=!1;r.mask&&(n=r.maskBuffer||u4,r.generateMask?r.generateMask(n):(po===al&&(Zn===void 0&&(Zn=Buffer.alloc(al)),r4(Zn,0,al),po=0),n[0]=Zn[po++],n[1]=Zn[po++],n[2]=Zn[po++],n[3]=Zn[po++]),s=(n[0]|n[1]|n[2]|n[3])===0,o=6);let a;typeof t=="string"?(!r.mask||s)&&r[Ht]!==void 0?a=r[Ht]:(t=Buffer.from(t),a=t.length):(a=t.length,i=r.mask&&r.readOnly&&!s);let u=a;a>=65536?(o+=8,u=127):a>125&&(o+=2,u=126);let c=Buffer.allocUnsafe(i?a+o:o);return c[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(c[0]|=64),c[1]=u,u===126?c.writeUInt16BE(a,2):u===127&&(c[2]=c[3]=0,c.writeUIntBE(a,4,6)),r.mask?(c[1]|=128,c[o-4]=n[0],c[o-3]=n[1],c[o-2]=n[2],c[o-1]=n[3],s?[c,t]:i?(wC(t,n,c,o,a),[c]):(wC(t,n,t,0,a),[c,t])):[c,t]}close(t,r,n,i){let o;if(t===void 0)o=i4;else{if(typeof t!="number"||!a4(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)o=Buffer.allocUnsafe(2),o.writeUInt16BE(t,0);else{let a=Buffer.byteLength(r);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");if(o=Buffer.allocUnsafe(2+a),o.writeUInt16BE(t,0),typeof r=="string")o.write(r,2);else if(n4(r))o.set(r,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let s={[Ht]:o.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==rr?this.enqueue([this.dispatch,o,!1,s,i]):this.sendFrame(e.frame(o,s),i)}ping(t,r,n){let i,o;if(typeof t=="string"?(i=Buffer.byteLength(t),o=!1):lo(t)?(i=t.size,o=!1):(t=Xn(t),i=t.length,o=Xn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Ht]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};lo(t)?this._state!==rr?this.enqueue([this.getBlobData,t,!1,s,n]):this.getBlobData(t,!1,s,n):this._state!==rr?this.enqueue([this.dispatch,t,!1,s,n]):this.sendFrame(e.frame(t,s),n)}pong(t,r,n){let i,o;if(typeof t=="string"?(i=Buffer.byteLength(t),o=!1):lo(t)?(i=t.size,o=!1):(t=Xn(t),i=t.length,o=Xn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Ht]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};lo(t)?this._state!==rr?this.enqueue([this.getBlobData,t,!1,s,n]):this.getBlobData(t,!1,s,n):this._state!==rr?this.enqueue([this.dispatch,t,!1,s,n]):this.sendFrame(e.frame(t,s),n)}send(t,r,n){let i=this._extensions[IC.extensionName],o=r.binary?2:1,s=r.compress,a,u;typeof t=="string"?(a=Buffer.byteLength(t),u=!1):lo(t)?(a=t.size,u=!1):(t=Xn(t),a=t.length,u=Xn.readOnly),this._firstFragment?(this._firstFragment=!1,s&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(s=a>=i._threshold),this._compress=s):(s=!1,o=0),r.fin&&(this._firstFragment=!0);let c={[Ht]:a,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:u,rsv1:s};lo(t)?this._state!==rr?this.enqueue([this.getBlobData,t,this._compress,c,n]):this.getBlobData(t,this._compress,c,n):this._state!==rr?this.enqueue([this.dispatch,t,this._compress,c,n]):this.dispatch(t,this._compress,c,n)}getBlobData(t,r,n,i){this._bufferedBytes+=n[Ht],this._state=l4,t.arrayBuffer().then(o=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(ly,this,a,i);return}this._bufferedBytes-=n[Ht];let s=Xn(o);r?this.dispatch(s,r,n,i):(this._state=rr,this.sendFrame(e.frame(s,n),i),this.dequeue())}).catch(o=>{process.nextTick(p4,this,o,i)})}dispatch(t,r,n,i){if(!r){this.sendFrame(e.frame(t,n),i);return}let o=this._extensions[IC.extensionName];this._bufferedBytes+=n[Ht],this._state=c4,o.compress(t,n.fin,(s,a)=>{if(this._socket.destroyed){let u=new Error("The socket was closed while data was being compressed");ly(this,u,i);return}this._bufferedBytes-=n[Ht],this._state=rr,n.readOnly=!1,this.sendFrame(e.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===rr&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][Ht],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Ht],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};OC.exports=cy;function ly(e,t,r){typeof r=="function"&&r(t);for(let n=0;n<e._queue.length;n++){let i=e._queue[n],o=i[i.length-1];typeof o=="function"&&o(t)}}function p4(e,t,r){ly(e,t,r),e.onerror(t)}});var kC=y((kue,LC)=>{"use strict";p();var{kForOnEventAttribute:na,kListener:dy}=jr(),AC=Symbol("kCode"),xC=Symbol("kData"),CC=Symbol("kError"),RC=Symbol("kMessage"),NC=Symbol("kReason"),fo=Symbol("kTarget"),PC=Symbol("kType"),DC=Symbol("kWasClean"),Fr=class{constructor(t){this[fo]=null,this[PC]=t}get target(){return this[fo]}get type(){return this[PC]}};Object.defineProperty(Fr.prototype,"target",{enumerable:!0});Object.defineProperty(Fr.prototype,"type",{enumerable:!0});var ei=class extends Fr{constructor(t,r={}){super(t),this[AC]=r.code===void 0?0:r.code,this[NC]=r.reason===void 0?"":r.reason,this[DC]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[AC]}get reason(){return this[NC]}get wasClean(){return this[DC]}};Object.defineProperty(ei.prototype,"code",{enumerable:!0});Object.defineProperty(ei.prototype,"reason",{enumerable:!0});Object.defineProperty(ei.prototype,"wasClean",{enumerable:!0});var ho=class extends Fr{constructor(t,r={}){super(t),this[CC]=r.error===void 0?null:r.error,this[RC]=r.message===void 0?"":r.message}get error(){return this[CC]}get message(){return this[RC]}};Object.defineProperty(ho.prototype,"error",{enumerable:!0});Object.defineProperty(ho.prototype,"message",{enumerable:!0});var ia=class extends Fr{constructor(t,r={}){super(t),this[xC]=r.data===void 0?null:r.data}get data(){return this[xC]}};Object.defineProperty(ia.prototype,"data",{enumerable:!0});var d4={addEventListener(e,t,r={}){for(let i of this.listeners(e))if(!r[na]&&i[dy]===t&&!i[na])return;let n;if(e==="message")n=function(o,s){let a=new ia("message",{data:s?o:o.toString()});a[fo]=this,ul(t,this,a)};else if(e==="close")n=function(o,s){let a=new ei("close",{code:o,reason:s.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[fo]=this,ul(t,this,a)};else if(e==="error")n=function(o){let s=new ho("error",{error:o,message:o.message});s[fo]=this,ul(t,this,s)};else if(e==="open")n=function(){let o=new Fr("open");o[fo]=this,ul(t,this,o)};else return;n[na]=!!r[na],n[dy]=t,r.once?this.once(e,n):this.on(e,n)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[dy]===t&&!r[na]){this.removeListener(e,r);break}}};LC.exports={CloseEvent:ei,ErrorEvent:ho,Event:Fr,EventTarget:d4,MessageEvent:ia};function ul(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var cl=y((Mue,jC)=>{"use strict";p();var{tokenChars:oa}=co();function Er(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function f4(e){let t=Object.create(null),r=Object.create(null),n=!1,i=!1,o=!1,s,a,u=-1,c=-1,l=-1,d=0;for(;d<e.length;d++)if(c=e.charCodeAt(d),s===void 0)if(l===-1&&oa[c]===1)u===-1&&(u=d);else if(d!==0&&(c===32||c===9))l===-1&&u!==-1&&(l=d);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d);let h=e.slice(u,l);c===44?(Er(t,h,r),r=Object.create(null)):s=h,u=l=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);else if(a===void 0)if(l===-1&&oa[c]===1)u===-1&&(u=d);else if(c===32||c===9)l===-1&&u!==-1&&(l=d);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d),Er(r,e.slice(u,l),!0),c===44&&(Er(t,s,r),r=Object.create(null),s=void 0),u=l=-1}else if(c===61&&u!==-1&&l===-1)a=e.slice(u,d),u=l=-1;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(i){if(oa[c]!==1)throw new SyntaxError(`Unexpected character at index ${d}`);u===-1?u=d:n||(n=!0),i=!1}else if(o)if(oa[c]===1)u===-1&&(u=d);else if(c===34&&u!==-1)o=!1,l=d;else if(c===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(c===34&&e.charCodeAt(d-1)===61)o=!0;else if(l===-1&&oa[c]===1)u===-1&&(u=d);else if(u!==-1&&(c===32||c===9))l===-1&&(l=d);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d);let h=e.slice(u,l);n&&(h=h.replace(/\\/g,""),n=!1),Er(r,a,h),c===44&&(Er(t,s,r),r=Object.create(null),s=void 0),a=void 0,u=l=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);if(u===-1||o||c===32||c===9)throw new SyntaxError("Unexpected end of input");l===-1&&(l=d);let f=e.slice(u,l);return s===void 0?Er(t,f,r):(a===void 0?Er(r,f,!0):n?Er(r,a,f.replace(/\\/g,"")):Er(r,a,f),Er(t,s,r)),t}function h4(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(n=>[t].concat(Object.keys(n).map(i=>{let o=n[i];return Array.isArray(o)||(o=[o]),o.map(s=>s===!0?i:`${i}=${s}`).join("; ")})).join("; ")).join(", ")}).join(", ")}jC.exports={format:h4,parse:f4}});var fl=y((Vue,WC)=>{"use strict";p();var m4=M("events"),g4=M("https"),y4=M("http"),qC=M("net"),v4=M("tls"),{randomBytes:E4,createHash:_4}=M("crypto"),{Duplex:que,Readable:Uue}=M("stream"),{URL:fy}=M("url"),hn=uo(),S4=uy(),b4=py(),{isBlob:T4}=co(),{BINARY_TYPES:MC,CLOSE_TIMEOUT:I4,EMPTY_BUFFER:ll,GUID:w4,kForOnEventAttribute:hy,kListener:O4,kStatusCode:A4,kWebSocket:Ye,NOOP:UC}=jr(),{EventTarget:{addEventListener:x4,removeEventListener:C4}}=kC(),{format:R4,parse:N4}=cl(),{toBuffer:P4}=ta(),VC=Symbol("kAborted"),my=[8,13],qr=["CONNECTING","OPEN","CLOSING","CLOSED"],D4=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Re=class e extends m4{constructor(t,r,n){super(),this._binaryType=MC[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=ll,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(n=r,r=[]):r=[r]),GC(this,t,r,n)):(this._autoPong=n.autoPong,this._closeTimeout=n.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){MC.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,n){let i=new S4({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:n.maxBufferedChunks,maxFragments:n.maxFragments,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),o=new b4(t,this._extensions,n.generateMask);this._receiver=i,this._sender=o,this._socket=t,i[Ye]=this,o[Ye]=this,t[Ye]=this,i.on("conclude",j4),i.on("drain",M4),i.on("error",F4),i.on("message",q4),i.on("ping",U4),i.on("pong",V4),o.onerror=G4,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",KC),t.on("data",dl),t.on("end",HC),t.on("error",QC),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[hn.extensionName]&&this._extensions[hn.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){Ct(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),BC(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){gy(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||ll,r,n)}pong(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){gy(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||ll,r,n)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(n=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){gy(this,t,n);return}let i={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[hn.extensionName]||(i.compress=!1),this._sender.send(t||ll,i,n)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){Ct(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(Re,"CONNECTING",{enumerable:!0,value:qr.indexOf("CONNECTING")});Object.defineProperty(Re.prototype,"CONNECTING",{enumerable:!0,value:qr.indexOf("CONNECTING")});Object.defineProperty(Re,"OPEN",{enumerable:!0,value:qr.indexOf("OPEN")});Object.defineProperty(Re.prototype,"OPEN",{enumerable:!0,value:qr.indexOf("OPEN")});Object.defineProperty(Re,"CLOSING",{enumerable:!0,value:qr.indexOf("CLOSING")});Object.defineProperty(Re.prototype,"CLOSING",{enumerable:!0,value:qr.indexOf("CLOSING")});Object.defineProperty(Re,"CLOSED",{enumerable:!0,value:qr.indexOf("CLOSED")});Object.defineProperty(Re.prototype,"CLOSED",{enumerable:!0,value:qr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(Re.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(Re.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[hy])return t[O4];return null},set(t){for(let r of this.listeners(e))if(r[hy]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[hy]:!0})}})});Re.prototype.addEventListener=x4;Re.prototype.removeEventListener=C4;WC.exports=Re;function GC(e,t,r,n){let i={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:I4,protocolVersion:my[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=i.autoPong,e._closeTimeout=i.closeTimeout,!my.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${my.join(", ")})`);let o;if(t instanceof fy)o=t;else try{o=new fy(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}o.protocol==="http:"?o.protocol="ws:":o.protocol==="https:"&&(o.protocol="wss:"),e._url=o.href;let s=o.protocol==="wss:",a=o.protocol==="ws+unix:",u;if(o.protocol!=="ws:"&&!s&&!a?u=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!o.pathname?u="The URL's pathname is empty":o.hash&&(u="The URL contains a fragment identifier"),u){let v=new SyntaxError(u);if(e._redirects===0)throw v;pl(e,v);return}let c=s?443:80,l=E4(16).toString("base64"),d=s?g4.request:y4.request,f=new Set,h;if(i.createConnection=i.createConnection||(s?k4:L4),i.defaultPort=i.defaultPort||c,i.port=o.port||c,i.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},i.path=o.pathname+o.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(h=new hn({...i.perMessageDeflate,isServer:!1,maxPayload:i.maxPayload}),i.headers["Sec-WebSocket-Extensions"]=R4({[hn.extensionName]:h.offer()})),r.length){for(let v of r){if(typeof v!="string"||!D4.test(v)||f.has(v))throw new SyntaxError("An invalid or duplicated subprotocol was specified");f.add(v)}i.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(o.username||o.password)&&(i.auth=`${o.username}:${o.password}`),a){let v=i.path.split(":");i.socketPath=v[0],i.path=v[1]}let g;if(i.followRedirects){if(e._redirects===0){e._originalIpc=a,e._originalSecure=s,e._originalHostOrSocketPath=a?i.socketPath:o.host;let v=n&&n.headers;if(n={...n,headers:{}},v)for(let[_,b]of Object.entries(v))n.headers[_.toLowerCase()]=b}else if(e.listenerCount("redirect")===0){let v=a?e._originalIpc?i.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:o.host===e._originalHostOrSocketPath;(!v||e._originalSecure&&!s)&&(delete i.headers.authorization,delete i.headers.cookie,v||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),g=e._req=d(i),e._redirects&&e.emit("redirect",e.url,g)}else g=e._req=d(i);i.timeout&&g.on("timeout",()=>{Ct(e,g,"Opening handshake has timed out")}),g.on("error",v=>{g===null||g[VC]||(g=e._req=null,pl(e,v))}),g.on("response",v=>{let _=v.headers.location,b=v.statusCode;if(_&&i.followRedirects&&b>=300&&b<400){if(++e._redirects>i.maxRedirects){Ct(e,g,"Maximum redirects exceeded");return}g.abort();let S;try{S=new fy(_,t)}catch{let A=new SyntaxError(`Invalid URL: ${_}`);pl(e,A);return}GC(e,S,r,n)}else e.emit("unexpected-response",g,v)||Ct(e,g,`Unexpected server response: ${v.statusCode}`)}),g.on("upgrade",(v,_,b)=>{if(e.emit("upgrade",v),e.readyState!==Re.CONNECTING)return;g=e._req=null;let S=v.headers.upgrade;if(S===void 0||S.toLowerCase()!=="websocket"){Ct(e,_,"Invalid Upgrade header");return}let I=_4("sha1").update(l+w4).digest("base64");if(v.headers["sec-websocket-accept"]!==I){Ct(e,_,"Invalid Sec-WebSocket-Accept header");return}let A=v.headers["sec-websocket-protocol"],T;if(A!==void 0?f.size?f.has(A)||(T="Server sent an invalid subprotocol"):T="Server sent a subprotocol but none was requested":f.size&&(T="Server sent no subprotocol"),T){Ct(e,_,T);return}A&&(e._protocol=A);let x=v.headers["sec-websocket-extensions"];if(x!==void 0){if(!h){Ct(e,_,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let U;try{U=N4(x)}catch{Ct(e,_,"Invalid Sec-WebSocket-Extensions header");return}let C=Object.keys(U);if(C.length!==1||C[0]!==hn.extensionName){Ct(e,_,"Server indicated an extension that was not requested");return}try{h.accept(U[hn.extensionName])}catch{Ct(e,_,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[hn.extensionName]=h}e.setSocket(_,b,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxBufferedChunks:i.maxBufferedChunks,maxFragments:i.maxFragments,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(g,e):g.end()}function pl(e,t){e._readyState=Re.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function L4(e){return e.path=e.socketPath,qC.connect(e)}function k4(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=qC.isIP(e.host)?"":e.host),v4.connect(e)}function Ct(e,t,r){e._readyState=Re.CLOSING;let n=new Error(r);Error.captureStackTrace(n,Ct),t.setHeader?(t[VC]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(pl,e,n)):(t.destroy(n),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function gy(e,t,r){if(t){let n=T4(t)?t.size:P4(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${e.readyState} (${qr[e.readyState]})`);process.nextTick(r,n)}}function j4(e,t){let r=this[Ye];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[Ye]!==void 0&&(r._socket.removeListener("data",dl),process.nextTick($C,r._socket),e===1005?r.close():r.close(e,t))}function M4(){let e=this[Ye];e.isPaused||e._socket.resume()}function F4(e){let t=this[Ye];t._socket[Ye]!==void 0&&(t._socket.removeListener("data",dl),process.nextTick($C,t._socket),t.close(e[A4])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function FC(){this[Ye].emitClose()}function q4(e,t){this[Ye].emit("message",e,t)}function U4(e){let t=this[Ye];t._autoPong&&t.pong(e,!this._isServer,UC),t.emit("ping",e)}function V4(e){this[Ye].emit("pong",e)}function $C(e){e.resume()}function G4(e){let t=this[Ye];t.readyState!==Re.CLOSED&&(t.readyState===Re.OPEN&&(t._readyState=Re.CLOSING,BC(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function BC(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function KC(){let e=this[Ye];if(this.removeListener("close",KC),this.removeListener("data",dl),this.removeListener("end",HC),e._readyState=Re.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[Ye]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",FC),e._receiver.on("finish",FC))}function dl(e){this[Ye]._receiver.write(e)||this.pause()}function HC(){let e=this[Ye];e._readyState=Re.CLOSING,e._receiver.end(),this.end()}function QC(){let e=this[Ye];this.removeListener("error",QC),this.on("error",UC),e&&(e._readyState=Re.CLOSING,this.destroy())}});var XC=y((Bue,JC)=>{"use strict";p();var $ue=fl(),{Duplex:$4}=M("stream");function zC(e){e.emit("close")}function B4(){!this.destroyed&&this._writableState.finished&&this.destroy()}function YC(e){this.removeListener("error",YC),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function K4(e,t){let r=!0,n=new $4({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(o,s){let a=!s&&n._readableState.objectMode?o.toString():o;n.push(a)||e.pause()}),e.once("error",function(o){n.destroyed||(r=!1,n.destroy(o))}),e.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,o){if(e.readyState===e.CLOSED){o(i),process.nextTick(zC,n);return}let s=!1;e.once("error",function(u){s=!0,o(u)}),e.once("close",function(){s||o(i),process.nextTick(zC,n)}),r&&e.terminate()},n._final=function(i){if(e.readyState===e.CONNECTING){e.once("open",function(){n._final(i)});return}e._socket!==null&&(e._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(e._socket.once("finish",function(){i()}),e.close()))},n._read=function(){e.isPaused&&e.resume()},n._write=function(i,o,s){if(e.readyState===e.CONNECTING){e.once("open",function(){n._write(i,o,s)});return}e.send(i,s)},n.on("end",B4),n.on("error",YC),n}JC.exports=K4});var yy=y((Hue,ZC)=>{"use strict";p();var{tokenChars:H4}=co();function Q4(e){let t=new Set,r=-1,n=-1,i=0;for(i;i<e.length;i++){let s=e.charCodeAt(i);if(n===-1&&H4[s]===1)r===-1&&(r=i);else if(i!==0&&(s===32||s===9))n===-1&&r!==-1&&(n=i);else if(s===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let a=e.slice(r,n);if(t.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);t.add(a),r=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(r===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let o=e.slice(r,i);if(t.has(o))throw new SyntaxError(`The "${o}" subprotocol is duplicated`);return t.add(o),t}ZC.exports={parse:Q4}});var sR=y((zue,oR)=>{"use strict";p();var W4=M("events"),hl=M("http"),{Duplex:Wue}=M("stream"),{createHash:z4}=M("crypto"),eR=cl(),ti=uo(),Y4=yy(),J4=fl(),{CLOSE_TIMEOUT:X4,GUID:Z4,kWebSocket:e5}=jr(),t5=/^[+/0-9A-Za-z]{22}==$/,tR=0,rR=1,iR=2,vy=class extends W4{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:X4,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:J4,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=hl.createServer((n,i)=>{let o=hl.STATUS_CODES[426];i.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),i.end(o)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=r5(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,o,s)=>{this.handleUpgrade(i,o,s,n)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=tR}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===iR){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(sa,this);return}if(t&&this.once("close",t),this._state!==rR)if(this._state=rR,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(sa,this):process.nextTick(sa,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{sa(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,n,i){r.on("error",nR);let o=t.headers["sec-websocket-key"],s=t.headers.upgrade,a=+t.headers["sec-websocket-version"];if(t.method!=="GET"){ri(this,t,r,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){ri(this,t,r,400,"Invalid Upgrade header");return}if(o===void 0||!t5.test(o)){ri(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){ri(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){aa(r,400);return}let u=t.headers["sec-websocket-protocol"],c=new Set;if(u!==void 0)try{c=Y4.parse(u)}catch{ri(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let l=t.headers["sec-websocket-extensions"],d={};if(this.options.perMessageDeflate&&l!==void 0){let f=new ti({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let h=eR.parse(l);h[ti.extensionName]&&(f.accept(h[ti.extensionName]),d[ti.extensionName]=f)}catch{ri(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let f={origin:t.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(f,(h,g,v,_)=>{if(!h)return aa(r,g||401,v,_);this.completeUpgrade(d,o,c,t,r,n,i)});return}if(!this.options.verifyClient(f))return aa(r,401)}this.completeUpgrade(d,o,c,t,r,n,i)}completeUpgrade(t,r,n,i,o,s,a){if(!o.readable||!o.writable)return o.destroy();if(o[e5])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>tR)return aa(o,503);let c=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${z4("sha1").update(r+Z4).digest("base64")}`],l=new this.options.WebSocket(null,void 0,this.options);if(n.size){let d=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;d&&(c.push(`Sec-WebSocket-Protocol: ${d}`),l._protocol=d)}if(t[ti.extensionName]){let d=t[ti.extensionName].params,f=eR.format({[ti.extensionName]:[d]});c.push(`Sec-WebSocket-Extensions: ${f}`),l._extensions=t}this.emit("headers",c,i),o.write(c.concat(`\r
|
|
208
208
|
`).join(`\r
|
|
209
|
-
`)),o.removeListener("error",
|
|
209
|
+
`)),o.removeListener("error",nR),l.setSocket(o,s,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(l),l.on("close",()=>{this.clients.delete(l),this._shouldEmitClose&&!this.clients.size&&process.nextTick(sa,this)})),a(l,i)}};oR.exports=vy;function r5(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return function(){for(let n of Object.keys(t))e.removeListener(n,t[n])}}function sa(e){e._state=iR,e.emit("close")}function nR(){this.destroy()}function aa(e,t,r,n){r=r||hl.STATUS_CODES[t],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...n},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${hl.STATUS_CODES[t]}\r
|
|
210
210
|
`+Object.keys(n).map(i=>`${i}: ${n[i]}`).join(`\r
|
|
211
211
|
`)+`\r
|
|
212
212
|
\r
|
|
213
|
-
`+r)}function ri(e,t,r,n,i,o){if(e.listenerCount("wsClientError")){let s=new Error(i);Error.captureStackTrace(s,ri),e.emit("wsClientError",s,r,t)}else
|
|
213
|
+
`+r)}function ri(e,t,r,n,i,o){if(e.listenerCount("wsClientError")){let s=new Error(i);Error.captureStackTrace(s,ri),e.emit("wsClientError",s,r,t)}else aa(r,n,i,o)}});p();import{spawn as IZ}from"child_process";import{randomUUID as wZ}from"crypto";import{closeSync as OZ,openSync as AZ}from"fs";import{promises as xZ}from"fs";import yD from"path";p();var Zv=je(Xv(),1),{program:e9,createCommand:t9,createArgument:r9,createOption:n9,CommanderError:i9,InvalidArgumentError:Tp,InvalidOptionArgumentError:o9,Command:eE,Argument:s9,Option:a9,Help:u9}=Zv.default;p();p();var Pb=je(Go(),1);import{promises as Br}from"fs";import sU from"os";import On from"path";import{randomUUID as aU}from"crypto";var Sr=class{workspaceRoot;mcpConfigDir;credentialsPath;configPath;projectContextPath;globalConfigDir=On.join(sU.homedir(),`.${Y}`);globalCredentialsPath=On.join(this.globalConfigDir,"credentials.json");constructor(t){this.setWorkspaceRoot(t)}setWorkspaceRoot(t){this.workspaceRoot=t,this.mcpConfigDir=On.join(t,`.${Y}`),this.credentialsPath=On.join(this.mcpConfigDir,"credentials.json"),this.configPath=On.join(this.mcpConfigDir,"config.json"),this.projectContextPath=On.join(this.mcpConfigDir,"project-context.json")}async ensureInitialized(){await Br.mkdir(this.mcpConfigDir,{recursive:!0});let t=On.join(this.mcpConfigDir,".gitignore"),r="*";try{await Br.writeFile(t,r,{flag:"wx"})}catch(n){if(n.code!=="EEXIST")throw n}}tempPathFor(t){return`${t}.${process.pid}.${aU()}.tmp`}async atomicWrite(t,r,n){let i=this.tempPathFor(t);await Br.writeFile(i,JSON.stringify(r,null,2),n!==void 0?{mode:n}:void 0),await Br.rename(i,t)}async readJsonFile(t){try{let r=await Br.readFile(t,"utf8");return JSON.parse(r)}catch(r){if(r.code==="ENOENT")return null;throw r}}async unlinkIfExists(t){try{await Br.unlink(t)}catch(r){if(r.code!=="ENOENT")throw r}}async fileExists(t){try{return await Br.access(t),!0}catch{return!1}}async saveCredentials(t){if(!t.access_token||t.access_token.trim()==="")throw new Error("Invalid credentials: access_token is required");let r={access_token:t.access_token,token_type:t.token_type||"Bearer",savedAt:new Date().toISOString()};if(!this.validateCredentials(r))throw new Error("Invalid credentials: JWT token validation failed");await this.fileExists(this.credentialsPath)?(await this.ensureInitialized(),await this.atomicWrite(this.credentialsPath,r,384)):(await Br.mkdir(this.globalConfigDir,{recursive:!0}),await this.atomicWrite(this.globalCredentialsPath,r,384)),N.info("[CredentialStore] Credentials saved successfully")}async loadCredentials(){let t=await this.readJsonFile(this.credentialsPath);if(t){if(this.validateCredentials(t))return t;N.error("[CredentialStore] Workspace credentials are invalid or expired")}let r=await this.readJsonFile(this.globalCredentialsPath);if(r){if(this.validateCredentials(r))return r;N.error("[CredentialStore] Global credentials are invalid or expired")}return null}validateCredentials(t){if(!t||!t.access_token)return N.error("[CredentialStore] Missing access token"),!1;if(t.token_type!=="Bearer")return N.error("[CredentialStore] Invalid token type:",t.token_type),!1;try{let r=Pb.default.decode(t.access_token,{complete:!0});if(!r||typeof r=="string")return N.error("[CredentialStore] Failed to decode JWT token"),!1;let n=r.payload;if(n.exp){let i=n.exp*1e3,o=Date.now();if(o>=i)return N.error("[CredentialStore] JWT token has expired"),!1;let s=Math.floor((i-o)/1e3/60);N.debug(`[CredentialStore] Token valid for ${s} more minutes`)}else console.warn("[CredentialStore] JWT token does not have expiration field");return n.iss&&N.debug(`[CredentialStore] Token issued by: ${n.iss}`),n.sub&&N.debug(`[CredentialStore] Token subject: ${n.sub}`),!0}catch(r){return N.error("[CredentialStore] Error validating JWT token:",r.message),!1}}async deleteCredentials(){await this.unlinkIfExists(this.credentialsPath),await this.unlinkIfExists(this.globalCredentialsPath),N.info("[CredentialStore] Credentials deleted")}async areCredentialsValid(){return await this.loadCredentials()!==null}async saveConfig(t){await this.ensureInitialized(),await this.atomicWrite(this.configPath,t)}async loadConfig(){return this.readJsonFile(this.configPath)}async saveProjectContext(t,r){await this.ensureInitialized();let n={projectExId:t,appExId:r,lastUsed:new Date().toISOString()};await this.atomicWrite(this.projectContextPath,n)}async loadProjectContext(){let t=await this.readJsonFile(this.projectContextPath);return t&&{...t,appExId:t.appExId??null}}async deleteProjectContext(){await this.unlinkIfExists(this.projectContextPath)}getWorkspaceRoot(){return this.workspaceRoot}getMcpConfigDir(){return this.mcpConfigDir}};p();var WA=je(Go(),1);p();p();var br=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)})`}};p();p();p();var fd=e=>e.toUpperCase(),su=e=>typeof e=="function"?e():e,hd=(e,t)=>e.map((r,n)=>[r,t[n]]),An=e=>{let t={};return e instanceof Headers?t=uU(e):Array.isArray(e)?e.forEach(([r,n])=>{r&&n!==void 0&&(t[r]=n)}):e&&(t=e),t},uU=e=>{let t={};return e.forEach((r,n)=>{t[n]=r}),t},Lb=e=>{try{let t=e();return cU(t)?t.catch(r=>Db(r)):t}catch(t){return Db(t)}},Db=e=>e instanceof Error?e:new Error(String(e)),cU=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",au=e=>{throw new Error(`Unhandled case: ${String(e)}`)},$o=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);p();var kb=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0};p();var jb=(e,t,r)=>e.query?e:{query:e,variables:t,requestHeaders:r,signal:void 0};p();p();var LA=je(ln(),1);p();var Xm="Accept",Lc="Content-Type",Us="application/json",kc="application/graphql-response+json";var Zm=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),kA=e=>{let t=e.toLowerCase();return t.includes(kc)||t.includes(Us)},eg=e=>{try{if(Array.isArray(e))return{_tag:"Batch",executionResults:e.map(PA)};if($o(e))return{_tag:"Single",executionResult:PA(e)};throw new Error(`Invalid execution result: result is not object or array.
|
|
214
214
|
Got:
|
|
215
|
-
${String(e)}`)}catch(t){return t}},
|
|
215
|
+
${String(e)}`)}catch(t){return t}},PA=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(!$o(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(!$o(e.data)&&e.data!==null)throw new Error("Invalid execution result: data is not plain object");r=e.data}if("extensions"in e){if(!$o(e.extensions))throw new Error("Invalid execution result: extensions is not plain object");n=e.extensions}return{data:r,errors:t,extensions:n}},jA=e=>e._tag==="Batch"?e.executionResults.some(DA):DA(e.executionResult),DA=e=>Array.isArray(e.errors)?e.errors.length>0:!!e.errors,tg=e=>typeof e=="object"&&e!==null&&"kind"in e&&e.kind===LA.Kind.OPERATION_DEFINITION;var MA=je(ln(),1),FA=je(ln(),1),vY=e=>{let t,r=e.definitions.filter(tg);return r.length===1&&(t=r[0].name?.value),t},EY=e=>{let t=!1,r=e.definitions.filter(tg);return r.length===1&&(t=r[0].operation==="mutation"),t},Vs=(e,t)=>{let r=typeof e=="string"||"kind"in e?e:String(e),n=typeof r=="string"?r:(0,FA.print)(r),i=!1,o;if(t)return{expression:n,isMutation:i,operationName:o};let s=Lb(()=>typeof r=="string"?(0,MA.parse)(r):r);return s instanceof Error?{expression:n,isMutation:i,operationName:o}:(o=vY(s),i=EY(s),{expression:n,operationName:o,isMutation:i})};p();p();var jc=JSON;var Mc=async e=>{let t={...e,method:e.request._tag==="Single"?e.request.document.isMutation?"POST":fd(e.method??"post"):e.request.hasMutations?"POST":fd(e.method??"post"),fetchOptions:{...e.fetchOptions,errorPolicy:e.fetchOptions.errorPolicy??"none"}},n=await SY(t.method)(t),i=await n.text(),o;try{o=_Y(i,n.headers.get(Lc),e.fetchOptions.jsonSerializer??jc)}catch(a){o=a}let s={status:n.status,headers:n.headers,body:i};if(!n.ok){if(o instanceof Error)return new br({...s},{query:e.request._tag==="Single"?e.request.document.expression:e.request.query,variables:e.request.variables});let a=o._tag==="Batch"?{...o.executionResults,...s}:{...o.executionResult,...s};return new br(a,{query:e.request._tag==="Single"?e.request.document.expression:e.request.query,variables:e.request.variables})}if(o instanceof Error)throw o;if(jA(o)&&t.fetchOptions.errorPolicy==="none"){let a=o._tag==="Batch"?{...o.executionResults,...s}:{...o.executionResult,...s};return new br(a,{query:e.request._tag==="Single"?e.request.document.expression:e.request.query,variables:e.request.variables})}switch(o._tag){case"Single":return{...s,...qA(t)(o.executionResult)};case"Batch":return{...s,data:o.executionResults.map(qA(t))};default:au(o)}},qA=e=>t=>({extensions:t.extensions,data:t.data,errors:e.fetchOptions.errorPolicy==="all"?t.errors:void 0}),_Y=(e,t,r)=>t&&kA(t)?eg(r.parse(e)):eg(e),SY=e=>async t=>{let r=new Headers(t.headers),n=null,i;r.has(Xm)||r.set(Xm,[kc,Us].join(", ")),e==="POST"?(i=(t.fetchOptions.jsonSerializer??jc).stringify(bY(t)),typeof i=="string"&&!r.has(Lc)&&r.set(Lc,Us)):n=TY(t);let o={method:e,headers:r,body:i,...t.fetchOptions},s=new URL(t.url),a=o;if(t.middleware){let c=await Promise.resolve(t.middleware({...o,url:t.url,operationName:t.request._tag==="Single"?t.request.document.operationName:void 0,variables:t.request.variables})),{url:l,...d}=c;s=new URL(l),a=d}return n&&n.forEach((c,l)=>{s.searchParams.append(l,c)}),await(t.fetch??fetch)(s,a)},bY=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 hd(e.request.query,e.request.variables??[]).map(([t,r])=>({query:t,variables:r}));default:throw au(e.request)}},TY=e=>{let t=e.fetchOptions.jsonSerializer??jc,r=new URLSearchParams;switch(e.request._tag){case"Single":return r.append("query",Zm(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(s=>t.stringify(s))??[],i=e.request.query.map(Zm),o=hd(i,n).map(([s,a])=>({query:s,variables:a}));return r.append("query",t.stringify(o)),r}default:throw au(e.request)}};var Ze=class{url;requestConfig;constructor(t,r={}){this.url=t,this.requestConfig=r}rawRequest=async(...t)=>{let[r,n,i]=t,o=jb(r,n,i),{headers:s,fetch:a=globalThis.fetch,method:u="POST",requestMiddleware:c,responseMiddleware:l,excludeOperationName:d,...f}=this.requestConfig,{url:h}=this;o.signal!==void 0&&(f.signal=o.signal);let g=Vs(o.query,d),v=await Mc({url:h,request:{_tag:"Single",document:g,variables:o.variables},headers:{...An(su(s)),...An(o.requestHeaders)},fetch:a,method:u,fetchOptions:f,middleware:c});if(l&&await l(v,{operationName:g.operationName,variables:n,url:this.url}),v instanceof Error)throw v;return v};async request(t,...r){let[n,i]=r,o=UA(t,n,i),{headers:s,fetch:a=globalThis.fetch,method:u="POST",requestMiddleware:c,responseMiddleware:l,excludeOperationName:d,...f}=this.requestConfig,{url:h}=this;o.signal!==void 0&&(f.signal=o.signal);let g=Vs(o.document,d),v=await Mc({url:h,request:{_tag:"Single",document:g,variables:o.variables},headers:{...An(su(s)),...An(o.requestHeaders)},fetch:a,method:u,fetchOptions:f,middleware:c});if(l&&await l(v,{operationName:g.operationName,variables:o.variables,url:this.url}),v instanceof Error)throw v;return v.data}async batchRequests(t,r){let n=kb(t,r),{headers:i,excludeOperationName:o,...s}=this.requestConfig;n.signal!==void 0&&(s.signal=n.signal);let a=n.documents.map(({document:f})=>Vs(f,o)),u=a.map(({expression:f})=>f),c=a.some(({isMutation:f})=>f),l=n.documents.map(({variables:f})=>f),d=await Mc({url:this.url,request:{_tag:"Batch",operationName:void 0,query:u,hasMutations:c,variables:l},headers:{...An(su(i)),...An(n.requestHeaders)},fetch:this.requestConfig.fetch??globalThis.fetch,method:this.requestConfig.method||"POST",fetchOptions:s,middleware:this.requestConfig.requestMiddleware});if(this.requestConfig.responseMiddleware&&await this.requestConfig.responseMiddleware(d,{operationName:void 0,variables:l,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}};var UA=(e,t,r)=>e.document?e:{document:e,variables:t,requestHeaders:r,signal:void 0};p();var G=(e,...t)=>e.reduce((r,n,i)=>`${r}${n}${i in t?String(t[i]):""}`,"");p();var QA=je(HA(),1);(0,QA.config)({quiet:!0});async function yr(e){let t=await e.loadConfig();if(!t){let r=Nt();t={authEndpoint:r.authEndpoint,apiBaseUrl:r.apiBaseUrl,callbackPort:process.env.LOCAL_CALLBACK_PORT?parseInt(process.env.LOCAL_CALLBACK_PORT,10):8088}}return t}var qY=.25,UY=300*1e3,VY=3600*1e3,GY="query { refreshToken { accessToken } }",Xi=class{store;lastRefreshAt=Date.now();constructor(t){this.store=t}async getValidToken(){let t=await this.store.loadCredentials();if(!t)throw new Error(Oa);return await this.refreshIfDue(t.access_token)??t.access_token}async refreshIfNeeded(){try{let t=await this.store.loadCredentials();if(!t)return;await this.refreshIfDue(t.access_token)}catch(t){N.debug(`[TokenManager] background refresh check failed: ${t.message}`)}}async refreshIfDue(t){if(!this.isDue(t))return null;try{let r=await yr(this.store),o=(await new Ze(`${r.apiBaseUrl}/api/graphql`,{headers:{Authorization:`Bearer ${t}`}}).request(GY)).refreshToken?.accessToken;return o?(await this.store.saveCredentials({access_token:o,token_type:"Bearer"}),this.lastRefreshAt=Date.now(),N.info("[TokenManager] Access token refreshed"),o):(N.debug("[TokenManager] refreshToken returned no accessToken - keeping current token"),null)}catch(r){return N.debug(`[TokenManager] Token refresh failed - keeping current token: ${r.message}`),null}}isDue(t){try{let r=WA.default.decode(t,{complete:!0});if(!r||typeof r=="string")return!1;let n=r.payload;if(!n.exp)return!1;let i=Date.now(),o=n.exp*1e3-i;if(o<=0)return!1;let s=n.iat!=null?(n.exp-n.iat)*1e3*qY:UY;if(o<s)return!0;let a=n.iat!=null?n.iat*1e3:this.lastRefreshAt;return i-a>=VY}catch{return!1}}};p();import{EventEmitter as Y5}from"events";p();import{randomUUID as So}from"crypto";p();p();var zA=G`
|
|
216
216
|
query TabBarIcons {
|
|
217
217
|
getTabBarIcons {
|
|
218
218
|
exId
|
|
219
219
|
url
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
-
`,
|
|
222
|
+
`,YA=G`
|
|
223
223
|
fragment SchemaCrdtPatch on SchemaCrdtPatch {
|
|
224
224
|
exId
|
|
225
225
|
createdAt
|
|
226
226
|
content
|
|
227
227
|
patchBase64
|
|
228
228
|
}
|
|
229
|
-
|
|
229
|
+
`,$Y=G`
|
|
230
230
|
fragment SchemaCrdtPatches on SchemaCrdtPatches {
|
|
231
231
|
lastPatchExId
|
|
232
232
|
patches {
|
|
233
233
|
...SchemaCrdtPatch
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
${
|
|
237
|
-
`,ng
|
|
236
|
+
${YA}
|
|
237
|
+
`,ng=G`
|
|
238
238
|
fragment ActiveCommit on CrdtSchema {
|
|
239
239
|
activeCommit {
|
|
240
240
|
commitExId
|
|
@@ -244,7 +244,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
`,qc
|
|
247
|
+
`,qc=G`
|
|
248
248
|
query FuzzySearchProjectName(
|
|
249
249
|
$projectName: String!
|
|
250
250
|
$paginator: ConnectionPaginatorInput
|
|
@@ -269,7 +269,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
|
|
272
|
+
`,$s=G`
|
|
273
273
|
query FetchAppDetailByExId(
|
|
274
274
|
$projectExId: String!
|
|
275
275
|
$appExId: String
|
|
@@ -468,7 +468,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
468
468
|
wechatBetaAppExpireAt
|
|
469
469
|
wechatBetaAppId
|
|
470
470
|
}
|
|
471
|
-
`,
|
|
471
|
+
`,BY=G`
|
|
472
472
|
fragment OrganizationForAgent on Organization {
|
|
473
473
|
exId
|
|
474
474
|
displayName
|
|
@@ -485,7 +485,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
|
-
`,Uc
|
|
488
|
+
`,Uc=G`
|
|
489
489
|
query FetchCurrentUserInfoForAgent {
|
|
490
490
|
user {
|
|
491
491
|
exId
|
|
@@ -510,7 +510,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
`,
|
|
513
|
+
`,JA=G`
|
|
514
514
|
query FetchAccountProfileForAgent {
|
|
515
515
|
user {
|
|
516
516
|
exId
|
|
@@ -527,27 +527,27 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
529
|
|
|
530
|
-
${
|
|
531
|
-
`,
|
|
530
|
+
${BY}
|
|
531
|
+
`,XA=G`
|
|
532
532
|
mutation CreateMultiClientProjectForAgent(
|
|
533
533
|
$createProjectDetail: CreateProjectInputInput!
|
|
534
534
|
) {
|
|
535
535
|
createMultiClientProjectAsync(createProjectDetail: $createProjectDetail)
|
|
536
536
|
}
|
|
537
|
-
`,
|
|
537
|
+
`,ZA=G`
|
|
538
538
|
query GetFeaturesForAgent($projectExId: String) {
|
|
539
539
|
features(projectExId: $projectExId) {
|
|
540
540
|
featureName
|
|
541
541
|
enabled
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
|
-
`,
|
|
544
|
+
`,e0=G`
|
|
545
545
|
mutation RenameProjectForAgent($projectExId: String!, $projectName: String!) {
|
|
546
546
|
renameProject(projectExId: $projectExId, projectName: $projectName) {
|
|
547
547
|
projectName
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
-
`,
|
|
550
|
+
`,t0=G`
|
|
551
551
|
mutation RenameAppForAgent(
|
|
552
552
|
$projectExId: String!
|
|
553
553
|
$appExId: String!
|
|
@@ -557,18 +557,18 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
557
557
|
name
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
|
-
`,
|
|
560
|
+
`,r0=G`
|
|
561
561
|
mutation DeleteProjectForAgent($projectExId: String!) {
|
|
562
562
|
deleteProject(projectExId: $projectExId)
|
|
563
563
|
}
|
|
564
|
-
`,
|
|
564
|
+
`,n0=G`
|
|
565
565
|
mutation ResetProjectForAgent(
|
|
566
566
|
$projectExId: String!
|
|
567
567
|
$languageType: LanguageType!
|
|
568
568
|
) {
|
|
569
569
|
resetProject(projectExId: $projectExId, languageType: $languageType)
|
|
570
570
|
}
|
|
571
|
-
`,
|
|
571
|
+
`,i0=G`
|
|
572
572
|
query FetchProjectRuntimeAdminAccess(
|
|
573
573
|
$projectExId: String!
|
|
574
574
|
$appVersionExId: String
|
|
@@ -586,7 +586,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
586
586
|
}
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
|
-
`,
|
|
589
|
+
`,o0=G`
|
|
590
590
|
query FetchLatestSchemaPatchesAfter(
|
|
591
591
|
$projectExId: String!
|
|
592
592
|
$appExId: String
|
|
@@ -629,9 +629,9 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
629
629
|
}
|
|
630
630
|
...ActiveCommit
|
|
631
631
|
}
|
|
632
|
-
${
|
|
632
|
+
${$Y}
|
|
633
633
|
${ng}
|
|
634
|
-
`,
|
|
634
|
+
`,s0=G`
|
|
635
635
|
query CrdtSchemaFields {
|
|
636
636
|
__type(name: "CrdtSchema") {
|
|
637
637
|
fields {
|
|
@@ -639,7 +639,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
639
639
|
}
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
|
-
`,
|
|
642
|
+
`,a0=G`
|
|
643
643
|
query SchemaCrdtPatchInputFields {
|
|
644
644
|
__type(name: "SchemaCrdtPatchCreationDtoInput") {
|
|
645
645
|
inputFields {
|
|
@@ -647,7 +647,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
|
-
`,
|
|
650
|
+
`,u0=G`
|
|
651
651
|
mutation BatchCreateSchemaCrdtPatch(
|
|
652
652
|
$projectExId: String!
|
|
653
653
|
$appExId: String
|
|
@@ -663,8 +663,8 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
663
663
|
...SchemaCrdtPatch
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
|
-
${
|
|
667
|
-
`,ig
|
|
666
|
+
${YA}
|
|
667
|
+
`,ig=G`
|
|
668
668
|
mutation SaveSchema(
|
|
669
669
|
$projectExId: String!
|
|
670
670
|
$appExId: String
|
|
@@ -676,7 +676,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
676
676
|
versionExId: $versionExId
|
|
677
677
|
)
|
|
678
678
|
}
|
|
679
|
-
`,
|
|
679
|
+
`,c0=G`
|
|
680
680
|
subscription OnNewCrdtPatchV2(
|
|
681
681
|
$projectExId: String!
|
|
682
682
|
$appExId: String
|
|
@@ -693,7 +693,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
693
693
|
lastPatchExId
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
|
-
`,
|
|
696
|
+
`,l0=G`
|
|
697
697
|
subscription OnSchemaUploadV3(
|
|
698
698
|
$projectExId: String!
|
|
699
699
|
$appExId: String
|
|
@@ -715,7 +715,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
715
715
|
}
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
|
-
`,
|
|
718
|
+
`,p0=G`
|
|
719
719
|
mutation DeployV2ForAgent(
|
|
720
720
|
$schemaExId: String!
|
|
721
721
|
$projectExId: String!
|
|
@@ -729,7 +729,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
729
729
|
buildTarget: $buildTarget
|
|
730
730
|
)
|
|
731
731
|
}
|
|
732
|
-
`,
|
|
732
|
+
`,d0=G`
|
|
733
733
|
mutation ValidateAndDeploySupportServiceForAgent(
|
|
734
734
|
$schemaExId: String!
|
|
735
735
|
$projectExId: String!
|
|
@@ -743,7 +743,53 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
743
743
|
appExId
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
|
-
`,
|
|
746
|
+
`,f0=G`
|
|
747
|
+
mutation DeployV2AtCommitForAgent(
|
|
748
|
+
$schemaExId: String!
|
|
749
|
+
$commitExId: String
|
|
750
|
+
$projectExId: String!
|
|
751
|
+
$appExId: String
|
|
752
|
+
$buildTarget: BuildTarget!
|
|
753
|
+
) {
|
|
754
|
+
deployV2(
|
|
755
|
+
schemaExId: $schemaExId
|
|
756
|
+
commitExId: $commitExId
|
|
757
|
+
projectExId: $projectExId
|
|
758
|
+
appExId: $appExId
|
|
759
|
+
buildTarget: $buildTarget
|
|
760
|
+
)
|
|
761
|
+
}
|
|
762
|
+
`,h0=G`
|
|
763
|
+
mutation ValidateAndDeploySupportServiceAtCommitForAgent(
|
|
764
|
+
$schemaExId: String!
|
|
765
|
+
$commitExId: String
|
|
766
|
+
$projectExId: String!
|
|
767
|
+
$appExId: String
|
|
768
|
+
) {
|
|
769
|
+
validateAndDeploy(
|
|
770
|
+
schemaExId: $schemaExId
|
|
771
|
+
commitExId: $commitExId
|
|
772
|
+
projectExId: $projectExId
|
|
773
|
+
appExId: $appExId
|
|
774
|
+
) {
|
|
775
|
+
appExId
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
`,m0=G`
|
|
779
|
+
mutation TakeSchemaCommitForAgent(
|
|
780
|
+
$projectExId: String!
|
|
781
|
+
$appExId: String
|
|
782
|
+
$groupId: String
|
|
783
|
+
$fromDeploy: Boolean
|
|
784
|
+
) {
|
|
785
|
+
takeSchemaCommit(
|
|
786
|
+
projectExId: $projectExId
|
|
787
|
+
appExId: $appExId
|
|
788
|
+
groupId: $groupId
|
|
789
|
+
fromDeploy: $fromDeploy
|
|
790
|
+
)
|
|
791
|
+
}
|
|
792
|
+
`,g0=G`
|
|
747
793
|
query ResourceUsageAndBurstInfoForAgent(
|
|
748
794
|
$projectExId: String!
|
|
749
795
|
$nonRealTimeDisplayedResourceTypes: [ResourceType]
|
|
@@ -763,11 +809,11 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
763
809
|
visitTimesSupportedByComputingPower
|
|
764
810
|
}
|
|
765
811
|
}
|
|
766
|
-
`,
|
|
812
|
+
`,y0=G`
|
|
767
813
|
mutation RefreshAllProjectResourcesForAgent($projectExId: String!) {
|
|
768
814
|
refreshAllProjectResources(projectExId: $projectExId)
|
|
769
815
|
}
|
|
770
|
-
`,
|
|
816
|
+
`,v0=G`
|
|
771
817
|
query MonthlyResourceUsageHistoryForAgent(
|
|
772
818
|
$projectExId: String!
|
|
773
819
|
$resourceType: ResourceType!
|
|
@@ -777,7 +823,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
777
823
|
resourceType: $resourceType
|
|
778
824
|
)
|
|
779
825
|
}
|
|
780
|
-
`,
|
|
826
|
+
`,E0=G`
|
|
781
827
|
query DailyResourceUsageHistoryForAgent(
|
|
782
828
|
$projectExId: String!
|
|
783
829
|
$resourceType: ResourceType!
|
|
@@ -787,7 +833,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
787
833
|
resourceType: $resourceType
|
|
788
834
|
)
|
|
789
835
|
}
|
|
790
|
-
`,
|
|
836
|
+
`,_0=G`
|
|
791
837
|
query ActiveSingleTenantResourceInfoForAgent($projectExId: String!) {
|
|
792
838
|
findActiveSingleTenantResourceInfoAndThrowOnExpireTimeMismatch(
|
|
793
839
|
projectExId: $projectExId
|
|
@@ -797,7 +843,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
797
843
|
resourceType
|
|
798
844
|
}
|
|
799
845
|
}
|
|
800
|
-
`,
|
|
846
|
+
`,S0=G`
|
|
801
847
|
query ProjectPlanAndCapabilityForAgentQuery(
|
|
802
848
|
$projectExId: String!
|
|
803
849
|
$appExId: String
|
|
@@ -844,7 +890,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
844
890
|
projectPlanType
|
|
845
891
|
}
|
|
846
892
|
}
|
|
847
|
-
`,
|
|
893
|
+
`,oae=G`
|
|
848
894
|
query ProjectRpsStatsForAgent($projectExId: String!) {
|
|
849
895
|
project(projectExId: $projectExId) {
|
|
850
896
|
rpsStatsInLast30Days {
|
|
@@ -853,14 +899,14 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
853
899
|
}
|
|
854
900
|
}
|
|
855
901
|
}
|
|
856
|
-
`,
|
|
902
|
+
`,b0=G`
|
|
857
903
|
query SupportedCustomModelDescriptor {
|
|
858
904
|
supportedCustomModelDescriptor {
|
|
859
905
|
chatModelDescriptors
|
|
860
906
|
embeddingModelDescriptors
|
|
861
907
|
}
|
|
862
908
|
}
|
|
863
|
-
`,Vc
|
|
909
|
+
`,Vc=G`
|
|
864
910
|
query ProjectMetadataForAgent($projectExId: String!, $appExId: String) {
|
|
865
911
|
fetchAppDetailByExId: fetchAppDetailByExIdWithoutReconcile(
|
|
866
912
|
projectExId: $projectExId
|
|
@@ -980,7 +1026,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
980
1026
|
projectPlanType
|
|
981
1027
|
}
|
|
982
1028
|
}
|
|
983
|
-
`,
|
|
1029
|
+
`,T0=G`
|
|
984
1030
|
mutation CreateStaticSiteDeploymentForAgent(
|
|
985
1031
|
$projectExId: String!
|
|
986
1032
|
$appExId: String
|
|
@@ -1001,7 +1047,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1001
1047
|
totalBytes
|
|
1002
1048
|
}
|
|
1003
1049
|
}
|
|
1004
|
-
`,
|
|
1050
|
+
`,I0=G`
|
|
1005
1051
|
mutation GetStaticSiteUploadUrlsForAgent(
|
|
1006
1052
|
$projectExId: String!
|
|
1007
1053
|
$appExId: String
|
|
@@ -1029,7 +1075,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1029
1075
|
totalCount
|
|
1030
1076
|
}
|
|
1031
1077
|
}
|
|
1032
|
-
`,
|
|
1078
|
+
`,w0=G`
|
|
1033
1079
|
mutation CompleteStaticSiteDeploymentForAgent(
|
|
1034
1080
|
$projectExId: String!
|
|
1035
1081
|
$appExId: String
|
|
@@ -1050,7 +1096,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1050
1096
|
previousDeploymentExId
|
|
1051
1097
|
}
|
|
1052
1098
|
}
|
|
1053
|
-
`,
|
|
1099
|
+
`,O0=G`
|
|
1054
1100
|
mutation AbortStaticSiteDeploymentForAgent(
|
|
1055
1101
|
$projectExId: String!
|
|
1056
1102
|
$appExId: String
|
|
@@ -1066,7 +1112,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1066
1112
|
target
|
|
1067
1113
|
}
|
|
1068
1114
|
}
|
|
1069
|
-
`,
|
|
1115
|
+
`,A0=G`
|
|
1070
1116
|
query GetStaticSiteStatusForAgent(
|
|
1071
1117
|
$projectExId: String!
|
|
1072
1118
|
$appExId: String
|
|
@@ -1103,7 +1149,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1103
1149
|
activatedAt
|
|
1104
1150
|
}
|
|
1105
1151
|
}
|
|
1106
|
-
`,
|
|
1152
|
+
`,x0=G`
|
|
1107
1153
|
mutation StartAgentSession(
|
|
1108
1154
|
$projectExId: String!
|
|
1109
1155
|
$client: String!
|
|
@@ -1119,7 +1165,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1119
1165
|
agent: $agent
|
|
1120
1166
|
)
|
|
1121
1167
|
}
|
|
1122
|
-
`,
|
|
1168
|
+
`,C0=G`
|
|
1123
1169
|
mutation SaveSecretForAgent(
|
|
1124
1170
|
$projectExId: String!
|
|
1125
1171
|
$schemaExId: String!
|
|
@@ -1133,7 +1179,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1133
1179
|
secretKey
|
|
1134
1180
|
}
|
|
1135
1181
|
}
|
|
1136
|
-
`,
|
|
1182
|
+
`,R0=G`
|
|
1137
1183
|
mutation CreateWechatSourceCodeDeploymentForAgent(
|
|
1138
1184
|
$projectExId: String!
|
|
1139
1185
|
$appExId: String
|
|
@@ -1150,7 +1196,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1150
1196
|
totalBytes
|
|
1151
1197
|
}
|
|
1152
1198
|
}
|
|
1153
|
-
`,
|
|
1199
|
+
`,N0=G`
|
|
1154
1200
|
mutation GetWechatSourceCodeUploadUrlsForAgent(
|
|
1155
1201
|
$projectExId: String!
|
|
1156
1202
|
$appExId: String
|
|
@@ -1178,7 +1224,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1178
1224
|
totalCount
|
|
1179
1225
|
}
|
|
1180
1226
|
}
|
|
1181
|
-
`,
|
|
1227
|
+
`,P0=G`
|
|
1182
1228
|
mutation CompleteWechatSourceCodeUploadForAgent(
|
|
1183
1229
|
$projectExId: String!
|
|
1184
1230
|
$appExId: String
|
|
@@ -1198,7 +1244,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1198
1244
|
deploymentRecordExId
|
|
1199
1245
|
}
|
|
1200
1246
|
}
|
|
1201
|
-
`,
|
|
1247
|
+
`,D0=G`
|
|
1202
1248
|
mutation AbortWechatSourceCodeDeploymentForAgent(
|
|
1203
1249
|
$projectExId: String!
|
|
1204
1250
|
$appExId: String
|
|
@@ -1213,7 +1259,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1213
1259
|
status
|
|
1214
1260
|
}
|
|
1215
1261
|
}
|
|
1216
|
-
`,
|
|
1262
|
+
`,L0=G`
|
|
1217
1263
|
query GetWechatSourceCodeStatusForAgent(
|
|
1218
1264
|
$projectExId: String!
|
|
1219
1265
|
$appExId: String
|
|
@@ -1247,7 +1293,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1247
1293
|
deploymentRecordExId
|
|
1248
1294
|
}
|
|
1249
1295
|
}
|
|
1250
|
-
`,
|
|
1296
|
+
`,k0=G`
|
|
1251
1297
|
query GetWechatSourceCodeDeploymentForAgent(
|
|
1252
1298
|
$projectExId: String!
|
|
1253
1299
|
$appExId: String
|
|
@@ -1267,7 +1313,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1267
1313
|
deploymentRecordExId
|
|
1268
1314
|
}
|
|
1269
1315
|
}
|
|
1270
|
-
`,
|
|
1316
|
+
`,j0=G`
|
|
1271
1317
|
query GetWechatTrialVersionForAgent($projectExId: String!) {
|
|
1272
1318
|
project(projectExId: $projectExId) {
|
|
1273
1319
|
exId
|
|
@@ -1276,7 +1322,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1276
1322
|
wechatMiniAppQRCodeBase64
|
|
1277
1323
|
}
|
|
1278
1324
|
}
|
|
1279
|
-
`,
|
|
1325
|
+
`,M0=G`
|
|
1280
1326
|
query GetWechatTrialVersionMetaForAgent($projectExId: String!) {
|
|
1281
1327
|
project(projectExId: $projectExId) {
|
|
1282
1328
|
exId
|
|
@@ -1284,7 +1330,7 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1284
1330
|
wechatMiniAppPreviewTime
|
|
1285
1331
|
}
|
|
1286
1332
|
}
|
|
1287
|
-
`,
|
|
1333
|
+
`,F0=G`
|
|
1288
1334
|
query SupportServicePipelineStatusForAgent($projectExId: String!) {
|
|
1289
1335
|
project(projectExId: $projectExId) {
|
|
1290
1336
|
lastAllPipelinePlatformStatus {
|
|
@@ -1294,14 +1340,14 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1294
1340
|
}
|
|
1295
1341
|
}
|
|
1296
1342
|
}
|
|
1297
|
-
`,
|
|
1343
|
+
`,q0=G`
|
|
1298
1344
|
query DeployedServerSchemaForAgent($projectExId: String!) {
|
|
1299
1345
|
project(projectExId: $projectExId) {
|
|
1300
1346
|
exId
|
|
1301
1347
|
lastDeployedServerSchema
|
|
1302
1348
|
}
|
|
1303
1349
|
}
|
|
1304
|
-
`;p();var
|
|
1350
|
+
`;p();var U0=G`
|
|
1305
1351
|
query FetchLogsByPaginator(
|
|
1306
1352
|
$queryCreation: QueryCreationInputType
|
|
1307
1353
|
$paginator: PaginatorType
|
|
@@ -1318,8 +1364,8 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1318
1364
|
}
|
|
1319
1365
|
}
|
|
1320
1366
|
}
|
|
1321
|
-
`;p();var El=je(ln(),1);import{randomUUID as l5}from"crypto";var _R=je(Jg(),1);p();var Z4=je(WC(),1),e5=je(cl(),1),t5=je(uo(),1),r5=je(uy(),1),n5=je(py(),1),i5=je(yy(),1),nR=je(fl(),1),o5=je(rR(),1);var iR=nR.default;p();var oR=100*1024*1024,ml=class{current=Promise.resolve();async run(t){let r=this.current,n=()=>{};this.current=new Promise(i=>{n=i}),await r;try{return await t()}finally{n()}}},Ey=async e=>{let t=await fetch(e);if(!t.ok)throw new Error(`Failed to download CRDT model: ${t.status} ${t.statusText}`);let r=t.body?.getReader();if(!r)throw new Error("Failed to read CRDT model response body");let n=[],i=0;for(;;){let{done:a,value:u}=await r.read();if(a)break;if(i+=u.length,i>oR)throw new Error(`CRDT model is larger than ${oR} bytes`);n.push(u)}let o=new Uint8Array(i),s=0;for(let a of n)o.set(a,s),s+=a.length;return o},aa=async(e,t)=>{try{return await t()}catch(r){return N.warn(`Optional runtime package unavailable: ${e}`,r.message),null}},sR=null,Ct=async()=>(sR??=aa("@functorz/ztype",()=>import("./ztype-IGART53N.js")).then(e=>(e?.default??e)?.com?.functorz?.ztype??null),sR),aR=null,pR=async()=>(aR??=aa("@functorz/ztype",()=>import("./ztype-IGART53N.js")).then(e=>(e?.default??e)?.kotlin?.collections??null),aR),uR=null,dR=async()=>(uR??=Ct().then(e=>e?.typesystem?.schema?.SCHEMA_VERSION??null),uR),cR=null,ua=async()=>(cR??=aa("@functorz/crdt-helper",()=>import("./index.cjs-L7NZYXV4.js")).then(e=>e?.Crdt??e?.default?.Crdt??null),cR),lR=null,_y=async()=>(lR??=aa("json-joy/lib/json-crdt-patch/index.js",()=>import("./json-crdt-patch-JB23VTH5.js")).then(e=>e??aa("json-joy/lib/json-crdt/index.js",()=>import("./json-crdt-3ENUDB3K.js"))).then(e=>e?.Patch??e?.default?.Patch??null),lR),by=e=>e?.lastUploadedSchema??null,Sy=e=>{if(!e)return null;let t=e.activeCommit;return t?{commitExId:t.commitExId,crdtModelUrl:t.crdtModelUrl,crdtPatches:t.crdtPatches??null}:{commitExId:null,crdtModelUrl:e.crdtModelUrl,crdtPatches:e.crdtPatches??null}},fR=e=>[e?.project?.lastDeployedServerSchemaExId,e?.lastDeployedServerSchemaExId,e?.project?.latestDeployedServerSchema?.exId,e?.latestDeployedServerSchema?.exId].find(r=>typeof r=="string"&&r.length>0)??null,hR=e=>e==null?e:structuredClone(e),Ty=(e,t)=>e?.appExId?e.appExId:t?.name??"",Iy=(e,t)=>{let r=e?.typesystem?.schema?.ClientType;if(r)return t==="WECHAT_MINI_PROGRAM"?r.WECHAT_MINI_PROGRAM??r.WECHAT??r.WEB:t==="MOBILE"?r.MOBILE??r.WEB:r.WEB},mo=e=>{let t=e?.typesystem?.schema?.Product?.[Tn];if(!t)throw new Error(`ztype runtime has no Product enum member for ${Tn}`);return t},mR=e=>{let t=e?.typesystem?.schema?.Locale?.EN;if(!t)throw new Error("ztype runtime has no Locale enum member for EN");return t},s5=e=>{try{return JSON.parse(JSON.stringify(e))}catch{return String(e)}},gl=e=>({componentId:e?.componentId??null,message:typeof e?.getLocalizedErrorMessage=="function"?e.getLocalizedErrorMessage("EN"):e?.message??String(e),zhMessage:typeof e?.getLocalizedErrorMessage=="function"?e.getLocalizedErrorMessage("ZH"):void 0,platform:e?.platform??null,isBackendError:!!e?.isBackendError,fullPath:s5(e?.fullPath??[])}),yl=e=>e.stableErrors.concat(e.betaErrors).filter(t=>!!t.isBackendError),gR=e=>yl(e).length,yR=(e,t)=>{if(t.__typename==="DiffItem"){let r=t.pathComponents?.at(-1)?.key??"";if(t.operation==="delete"){delete e[r];return}e[r]=structuredClone(t.newValue);return}if(t.__typename==="ArrayDiffItem"){let r=t.pathComponents?.at(-1)?.index??-1;if(!Array.isArray(e)||r<0)throw new Error("Invalid array diff target");if(t.operation==="delete"){e.splice(r,1);return}if(t.operation==="insert"){e.splice(r,0,structuredClone(t.newValue));return}e[r]=structuredClone(t.newValue)}};p();var vR=je(Vo(),1);import{createRequire as a5}from"module";var u5=a5(import.meta.url);var vl=e=>{if(Ur){if(e==="@functorz/ztype")return Ur.ztype;if(e==="@functorz/crdt-helper")return Ur.crdtHelper;if(e==="json-joy")return Ur.jsonJoy}try{let t=u5(`${e}/package.json`);return t.ztypeBuild??t.version??"unknown"}catch{return"unavailable"}},c5=async()=>{if(Ur)return{ztypeVersion:Ur.ztype,ztypeSchemaVersion:Ur.ztypeSchemaVersion};try{let e=await Ct();return{ztypeVersion:vl("@functorz/ztype"),ztypeSchemaVersion:e?.ZTypeSystem?.getSchemaVersion?.()??"unknown"}}catch{return{ztypeVersion:vl("@functorz/ztype"),ztypeSchemaVersion:"unavailable"}}};async function wy(){let e=bv(),t=await c5();return{agentVersion:e.version??"0.0.0",nodeMajor:process.versions.node.split(".")[0],platform:process.platform,arch:process.arch,ztypeVersion:t.ztypeVersion,ztypeSchemaVersion:t.ztypeSchemaVersion,crdtHelperVersion:vl("@functorz/crdt-helper"),jsonJoyVersion:vl("json-joy")}}async function go(e,t){let[r,n,i]=await Promise.all([wy(),yr(e),e.loadCredentials()]),o=i?vR.default.decode(i.access_token):null,s=typeof o=="object"&&o!==null?String(o.sub??o.exId??o.id??"authenticated"):"anonymous";return{...r,product:Y,apiBaseUrl:n.apiBaseUrl,authUserId:s,workspaceRoot:e.getWorkspaceRoot(),startupFlags:[...t].sort()}}function ER(e,t){return JSON.stringify(e)===JSON.stringify(t)}p();var ni=async(e,t)=>{let n=(await e.request(Vc,{projectExId:t,appExId:null})).fetchAppDetailByExId;return((n?.__typename==="Project"?n.appList:null)??[]).filter(o=>o.appExId!=null)},yo=e=>e.length===1?e[0].appExId:null;var Oy=l5(),bR=`${Y}/${Sn()}`,p5=e=>{if(!e)return e;if(Array.isArray(e))return e.map(([r,n])=>[r,String(r).toLowerCase()==="authorization"?"Bearer <redacted>":n]);if(typeof e=="object"&&"forEach"in e&&typeof e.forEach=="function"){let r={};return e.forEach((n,i)=>{r[i]=i.toLowerCase()==="authorization"?"Bearer <redacted>":String(n)}),r}let t={};for(let[r,n]of Object.entries(e))t[r]=r.toLowerCase()==="authorization"?"Bearer <redacted>":String(n);return t},_l=(e,t)=>{let r=e?.response?.errors;return Array.isArray(r)&&r.some(n=>n?.errorType===t)};function Ay(e){if(!Array.isArray(e)||e.length===0)return null;let t=e.map(r=>{let n=r,i=typeof n.operation=="string"?n.operation:null,o=typeof n.errorType=="string"?n.errorType:typeof n.extensions?.classification=="string"?n.extensions.classification:null,s=typeof n.message=="string"?n.message:null;return!s&&!i&&!o?null:`${i?`${i}: `:""}${s??"GraphQL error"}${o?` (${o})`:""}`}).filter(r=>!!r);return t.length>0?t.join("; "):null}var d5=e=>{if(typeof e=="string")return e;if(e instanceof Uint8Array)return Buffer.from(e).toString("utf8");try{return String(e)}catch{return"<unserializable body>"}},f5=new Set(["ECONNRESET","EPIPE","UND_ERR_SOCKET"]),h5=e=>{let t=e?.cause?.code;return typeof t=="string"&&f5.has(t)},m5=e=>{if(typeof e!="string")return!1;try{let{query:t,operationName:r}=JSON.parse(e);return typeof t!="string"?!1:(0,El.getOperationAST)((0,El.parse)(t),typeof r=="string"?r:void 0)?.operation==="query"}catch{return!1}},vo=async(e,t)=>{let r=rp();N.debug(`[HTTP] Request URL: ${e.toString()}`),t?.headers&&N.debug(`[HTTP] Request Headers: ${JSON.stringify(p5(t.headers))}`),r&&t?.body!=null&&N.debug(`[GQL] Request Body: ${d5(t.body)}`);let n=await fetch(e,t).catch(o=>{if(!h5(o)||!m5(t?.body))throw o;return N.info(`[HTTP] Connection reset; resending the query to ${e.toString()}`),fetch(e,t)}),i=null;try{i=await n.clone().text()}catch(o){N.debug(`[GQL] Response read failed: ${String(o)}`)}if(r&&N.debug(`[GQL] Response ${n.status}: ${i??"<read failed>"}`),i&&i.includes('"errors"')){let o=null;try{o=JSON.parse(i).errors}catch{o=null}let s=Ay(o);s&&N.warn(`[GQL] ${n.status} errors: ${s}`)}return n};async function xy(e,t){let r=await yr(t),n={"User-Locale":"en_US","X-SESSION-ID":Oy,"X-Client":bR},i=await dR();return i&&(n["X-ZED-VERSION"]=i),process.env.REACT_APP_VERSION&&(n["X-REACT-APP-VERSION"]=process.env.REACT_APP_VERSION),new Ze(`${r.apiBaseUrl}/api/graphql`,{headers:n,fetch:vo,requestMiddleware:async o=>{let s=new Headers(o.headers);return s.set("Authorization",`Bearer ${await e.getValidToken()}`),{...o,headers:s}}})}var ca=class extends iR{constructor(...t){super(...t),this.on("error",r=>N.debug(`[SUB] socket error: ${r.message}`))}};async function SR(e,t){let n=`${(await yr(t)).apiBaseUrl.replace(/^http:/,"ws:").replace(/^https:/,"wss:")}/api/graphql-subscription`;return async(i,o,s)=>{let a=rp(),u={"X-SESSION-ID":Oy,"X-Client":bR};N.debug(`[SUB] connecting ${n} params=${JSON.stringify(u)}`);let c=new _R.SubscriptionClient(n,{lazy:!0,reconnect:!0,minTimeout:3e3,connectionParams:async()=>({...u,authToken:await e.getValidToken()})},ca);c.onConnected(()=>N.debug("[SUB] connected")),c.onReconnected(()=>N.debug("[SUB] reconnected")),c.onDisconnected(()=>N.debug("[SUB] disconnected")),c.onError(f=>N.debug(`[SUB] error ${f?.message??String(f)}`));let d=[{name:"onNewCrdtPatchV2",query:u0,variables:{projectExId:i.projectExId,appExId:i.appExId??null,versionExId:i.appVersionExId??null,latestPatchExIdInClient:o}},{name:"onSchemaUploadV3",query:c0,variables:{projectExId:i.projectExId,appExId:i.appExId??null,appVersionExId:i.appVersionExId??null}}].map(f=>(N.debug(`[SUB] subscribe ${f.name} vars=${JSON.stringify(f.variables)}`),c.request({query:f.query,variables:f.variables}).subscribe({next:h=>{a&&N.debug(`[SUB] ${f.name} event: ${JSON.stringify(h)}`),s()},error:h=>{N.warn("Schema subscription event failed",String(h)),s()}})));return{unsubscribe(){for(let f of d)f.unsubscribe();c.close(!1,!1)}}}}async function TR(e,t,r){let n=await e.loadProjectContext();if(t.projectExId)return n?.projectExId!==t.projectExId&&await e.saveProjectContext(t.projectExId,r?yo(await ni(r,t.projectExId)):null),t.projectExId;if(!n?.projectExId)throw new Error("No projectExId provided and no current project is set");return n.projectExId}async function Cy(e,t,r,n){try{await e.request(I0,{projectExId:t,client:Y,clientVersion:Sn(),sessionId:n??Oy,agent:r??null}),N.debug(`[agent-session] started for project ${t}`)}catch(i){N.debug(`[agent-session] skipped: ${String(i)}`)}}p();p();p();import{createHash as g5}from"crypto";var y5=e=>!!(e&&typeof e=="object"&&!Array.isArray(e)),Ry=e=>{if(Array.isArray(e))return e.map(r=>r===void 0?null:Ry(r));if(!y5(e))return e;let t={};for(let r of Object.keys(e).sort()){let n=e[r];n!==void 0&&(t[r]=Ry(n))}return t},v5=e=>JSON.stringify(Ry(e)),E5=e=>g5("sha256").update(v5(e)).digest("hex"),IR=e=>({projectExId:e.projectExId,appExId:e.appExId??null,appVersionExId:e.appVersionExId??null,schemaExId:e.schemaExId??null,lastPatchExId:e.lastPatchExId??null,snapshotHash:E5(e.snapshot),deployedSchemaExId:e.deployedSchemaExId??null,checkedAt:e.checkedAt??new Date().toISOString()}),wR=(e,t)=>!e||!t?e!==t:e.schemaExId!==t.schemaExId||e.lastPatchExId!==t.lastPatchExId||e.snapshotHash!==t.snapshotHash||e.deployedSchemaExId!==t.deployedSchemaExId,bl=e=>e.changes.length>0;var OR=null,_5=()=>(OR??=Ct().then(e=>{let t=e?.typesystem?.schema?.diff?.computeSemanticSchemaChanges;return typeof t=="function"?t:null}),OR),b5=async(e,t)=>{let r=await _5();return r?r(e,t):{changes:[]}},Ny=(e,t)=>b5(JSON.stringify(e),JSON.stringify(t));p();var Py=null,S5=e=>(Py??=e.request(o0).then(t=>(t.__type?.fields??[]).some(r=>r.name==="activeCommit")).catch(t=>{throw Py=null,t}),Py),Eo=async(e,t)=>await S5(e)?t:t.replace(ng,"").replace(/^[ \t]*\.\.\.ActiveCommit\n/gm,"");p();var T5="Functorz";function AR(e,t,r,n){let i=e?.typesystem?.settings,o=e?.typesystem?.schema,s=t?.KtList,a=t?.KtMap;if(!i?.ExtraContext||!o?.CustomChatModelDescriptor||!o?.AIModelDescriptors||!s||!a)return N.warn("ztype ExtraContext symbols missing; schema graph will be built without custom models"),null;try{let{ExtraContext:u}=i,{AIModelDescriptors:c,CustomChatModelDescriptor:l,CustomEmbeddingModelDescriptor:d,ModelCustomParamDescriptor:f,CustomModelParam:h,CustomChatCompletionFeatures:g,Identifier:v,MediaOutputCardinality:_}=o,S=C=>a.fromJsMap(new Map(Object.entries(C??{}))),b=C=>typeof C=="string"?C==="single"?_.SINGLE:C==="multiple"?_.MULTIPLE:_.NONE:typeof C=="boolean"&&C?_.MULTIPLE:_.NONE,A=C=>new f(C.name,S(C.displayName),C.type,S(C.description)),O=C=>new h(A(C.serverUrl),A(C.apiToken),s.fromJsArray((C.extensionParams??[]).map(te=>new f(te.name,S(te.displayName),te.type,S(te.displayName))))),T=C=>C.provider===T5&&C.customModelIdentifier?new v(C.customModelIdentifier.id,C.customModelIdentifier.namespace):null,x=(r?.chatModelDescriptors??[]).map(C=>new l(C.provider,C.name,O(C.paramToConfigure),C.delisted,new g(C.features.streamResponse,C.features.multiModal,C.features.imageInput??!1,!1,C.features.videoInput??!1,C.features.imageMessageInput??!1,!1,C.features.videoMessageInput??!1,C.features.tools,C.features.reasoningContent,C.features.imageOutput,C.features.videoOutput,b(C.features.imageOutput),b(C.features.videoOutput),null,C.features.structuredOutput),T(C))),U=(r?.embeddingModelDescriptors??[]).map(C=>new d(C.provider,C.name,O(C.paramToConfigure),T(C),C.delisted));return new u(new c(s.fromJsArray(x),s.fromJsArray(U)),a.fromJsMap(new Map),n)}catch(u){return N.warn("ztype ExtraContext construction failed; schema graph will be built without custom models",u.message),null}}p();var mn=class extends Error{constructor(r,n){super(r);this.diagnostics=n;this.name="ZtypeValidationError"}};p();function Sl(e,t,r,n=null){let i=Iy(e,r?.appType);return e.api.ZTypeCoreApi.genZTypeApiContext(t,mo(e),i,Ty(r,i),mR(e),n)}function xR(e,t){return Ty(t,Iy(e,t?.appType))}p();var gn=e=>e==null,Dy=(e,t)=>{if(gn(e)&&gn(t)||e===t)return!0;if(gn(e)||gn(t)||typeof e!="object"||typeof t!="object")return!1;let r=e,n=t,i=new Set([...Object.keys(r),...Object.keys(n)]);for(let o of i)if(!Dy(r[o],n[o]))return!1;return!0};var Ly=e=>{let t=new Set;for(let r of e)if(t.add(r.pathComponents.map(n=>n.index!==void 0?`[${n.index}]`:`.${n.key}`).join("").replace(/^\./,"")),t.size>=20)break;return[...t]},CR=e=>{if(e.__typename==="DiffItem")switch(e.operation){case"add":return{__typename:"DiffItem",oldValue:e.newValue,newValue:null,operation:"delete",pathComponents:e.pathComponents};case"delete":return{__typename:"DiffItem",oldValue:null,newValue:e.oldValue,operation:"add",pathComponents:e.pathComponents};case"update":return{__typename:"DiffItem",oldValue:e.newValue,newValue:e.oldValue,operation:"update",pathComponents:e.pathComponents}}else switch(e.operation){case"insert":return{__typename:"ArrayDiffItem",oldValue:e.newValue,newValue:null,previousValue:e.previousValue,nextValue:e.nextValue,operation:"delete",pathComponents:e.pathComponents};case"delete":return{__typename:"ArrayDiffItem",oldValue:null,newValue:e.oldValue,previousValue:e.previousValue,nextValue:e.nextValue,operation:"insert",pathComponents:e.pathComponents};case"update":return{__typename:"ArrayDiffItem",oldValue:e.newValue,newValue:e.oldValue,operation:"update",pathComponents:e.pathComponents}}throw new Error(`Cannot reverse diff item: ${JSON.stringify(e)}`)},I5=e=>e.key??e.index??"",w5=(e,t)=>{let r=e;for(let n of t){if(r===null||typeof r!="object")return;r=r[n]}return r},O5=(e,t)=>{if(t.__typename!=="DiffItem")return null;let r=t.pathComponents.at(-1)?.key;if(r===void 0)return null;let n=Dy(e[r],t.oldValue);switch(t.operation){case"add":e[r]=t.newValue;break;case"update":if(!n)return null;e[r]=t.newValue;break;case"delete":if(!Object.prototype.hasOwnProperty.call(e,r)||!n)return null;delete e[r];break;default:return null}return t},A5=(e,t)=>{if(t.__typename!=="ArrayDiffItem")return null;let r=t.pathComponents.at(-1)?.index;if(r===void 0||r>e.length)return null;let n=()=>Dy(e[r],t.oldValue);switch(t.operation){case"insert":e.splice(r,0,t.newValue);break;case"delete":if(!n())return null;e.splice(r,1);break;case"update":if(!n())return null;e.splice(r,1,t.newValue);break;default:return null}return t},RR=(e,t)=>{let r=e,n=new WeakSet,i=s=>{if(r===null||typeof r!="object")return r;n.has(r)||(r=Array.isArray(r)?[...r]:{...r},n.add(r));let a=r;for(let u of s){let c=a[u];if(c!==null&&typeof c=="object"){if(!n.has(c)){let l=Array.isArray(c)?[...c]:{...c};n.add(l),a[u]=l}a=a[u]}else a=c}return a},o=[];for(let s of t)try{let u=s.pathComponents.map(I5).slice(0,-1);if(gn(w5(r,u)))continue;let c=i(u);if(Array.isArray(c)){let l=A5(c,s);l&&o.push(l)}else if(c!==null&&typeof c=="object"){let l=O5(c,s);l&&o.push(l)}}catch{continue}return o};p();var x5=3e4,Tl=class{constructor(t){this.options=t}timer=null;subscriptionHandle=null;running=!1;isActive(){return this.timer!==null||this.subscriptionHandle!==null}start(){this.timer||this.subscriptionHandle||!this.options.subscriptionFactory||this.options.subscriptionFactory(this.options.sessionKey,this.options.getLastPatchExId(),()=>{this.run()}).then(t=>{this.subscriptionHandle=t}).catch(t=>{N.warn("Schema subscription failed; falling back to polling",t.message)}).finally(()=>{this.schedulePoll()})}dispose(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.subscriptionHandle?.unsubscribe(),this.subscriptionHandle=null}schedulePoll(){!this.options.subscriptionFactory||this.timer||(this.timer=setTimeout(()=>{this.timer=null,this.run().finally(()=>this.schedulePoll())},x5),this.timer.unref())}async run(){if(!this.running){this.running=!0;try{await this.options.refresh()}finally{this.running=!1}}}};p();var NR=(e,t)=>{let r=new WeakMap,n=s=>{let a=r.get(s);return a||(a=Array.isArray(s)?[...s]:{...s},r.set(s,a)),a},i=new WeakMap,o=n(e);for(let s of t){let a=(s?.pathComponents??[]).slice(0,-1),u=e,c=o;for(let l of a){let d=l.key??l.index??"",f=u[d];if(f===null||typeof f!="object")break;if(Array.isArray(f)){let h=i.get(f);h||(h=structuredClone(f),i.set(f,h)),c[d]=h;break}c[d]=n(f),u=f,c=c[d]}}return o};p();p();var R5=new Set(["WEB","WECHAT_MINI_PROGRAM","MOBILE"]),_o=e=>R5.has(e?.appType??""),DR=(e,t)=>{if(!t)return e;let r=t.model.view();return{...e,server:r?.server??null}},Il=e=>e?.pathComponents?.[0]?.key==="server",LR=e=>e?.pathComponents?.[0]?.key==="clients",kR=e=>e?.appType==="BACKEND_ONLY",PR=e=>typeof e=="string"&&e.length>0?e:null,ky=(e,t)=>{let r=e.serverDoc;if(r){let i=PR(r.schemaExId);return i?{ok:!0,appExId:null,schemaExId:i}:{ok:!1,error:"the backend app document has no schemaExId"}}if(e.serverDocRequired===!0)return{ok:!1,error:"this client app's server lives in the backend app's document, which did not load, so there is nothing to sync; retry, or run project sync-backend without appExId"};let n=PR(e.schemaExId);return n?{ok:!0,appExId:t,schemaExId:n}:{ok:!1,error:"the session has no schemaExId"}};p();var jy=null,jR=async e=>(jy??=e.request(s0).then(t=>(t.__type?.inputFields??[]).some(r=>r.name==="origin")).catch(()=>(jy=null,!1)),await jy?{origin:"MCP"}:{});p();function MR(e,t){let r=new Set;for(let n of e){let i=n&&typeof n=="object"?n.name:void 0;if(typeof i!="string")continue;let o=Cv[i];o!==void 0&&!t.includes(o)&&r.add(i)}return[...r]}function FR(e){return`${e.join(", ")} ${e.length===1?"is":"are"} not available to this project yet: the feature is still being rolled out and has not been opened to this account or project. Nothing was applied. Do not retry or work around it; tell the user it is not available to them yet.`}var My=300*1e3,N5=100,P5=50,D5=["dataModel","types"];function L5(e){let t=e.server;if(!t||typeof t!="object"||Array.isArray(t))return e;let r={};for(let i of D5){let o=t[i];o!==void 0&&(r[i]=o)}let n={};return e.version!==void 0&&(n.version=e.version),n.server=r,n}function k5(e){if(typeof e!="string")return e;let t=e.trim();if(!/^[[{]|^(true|false|null|-?\d)/.test(t))return e;try{return JSON.parse(t)}catch{return e}}function VR(e){if(typeof e!="string")return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!="object")return null;let r={};for(let[n,i]of Object.entries(t))r[n]=k5(i);return r}function j5(e){let t=new Set;return e.map(r=>{if(!r||typeof r!="object")return r;let n=r,i=typeof n.toolCallId=="string"&&n.toolCallId?n.toolCallId:null;if(i!==null&&t.has(i))throw new Error(`Duplicate toolCallId: ${i}`);let o=i??la();return t.add(o),i===o?n:{...n,toolCallId:o}})}function M5(e,t){if(!e)return;let r=new Map(Object.entries(e)),n=t.map((i,o)=>{if(!r.has(i))throw new Error(`Missing ztype response for tool call ${o}`);let s=r.get(i);return r.delete(i),s});if(r.size>0)throw new Error(`Unexpected ztype responses: ${[...r.keys()].join(", ")}`);return n}function F5(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?Object.values(t).find(n=>typeof n=="string")??t:t):[]}function q5(e){let t=e??{},r=t.data??{},n={},i=VR(r.responseByToolCallId??t.responseByToolCallId);i&&Object.keys(i).length>0&&(n.responses=i);let o=r.schemaDiff??t.schemaDiff;o&&(n.schemaDiff=o);let s=F5(t.errors??r.errors);return s.length>0&&(n.errors=s),n}function U5(e){let t=e??{},r=t.data?.updatedReadState;if(r!=null)return r;if(typeof t.updatedReadStateJson=="string")try{return JSON.parse(t.updatedReadStateJson)}catch{return}}function V5(e){return(e??{}).data?.touchesComponents===!0}function G5(e,t){let r=e??{};if(r.isSuccess!==!1)return{};let n={},i=VR(r.readResponseByToolCallId);if(i&&(n.readResponses=t.map(o=>i[o]??null)),typeof r.readFailureByToolCallIdJson=="string"){let o=JSON.parse(r.readFailureByToolCallIdJson);n.readErrors=t.map(s=>o[s]??null)}return n}function $5(e,t){let r=e??{};if(r.isSuccess!==!1)return{};let n={},i=typeof r.failedToolCallId=="string"?t.indexOf(r.failedToolCallId):-1;i>=0&&(n.failedIndex=i),typeof r.errorCode=="string"&&(n.errorCode=r.errorCode),r.failedBeforeExecution===!0&&(n.failedBeforeExecution=!0);let o=Array.isArray(r.detailKeys)?r.detailKeys:[],s=Array.isArray(r.detailValues)?r.detailValues:[];if(o.length>0&&o.length===s.length){let a={};o.forEach((u,c)=>{typeof u=="string"&&typeof s[c]=="string"&&(a[u]=s[c])}),Object.keys(a).length>0&&(n.errorDetails=a)}return n}async function B5(e){let r=(await Ct())?.application?.schemaops?.SchemaOpsErrorCode?.DEPENDENCY_CONFLICT?.name,i=(e.diagnostics?.stableErrors??[]).map(o=>{let s=o??{};return[s.componentId,s.message].filter(a=>typeof a=="string"&&a!=="").join(": ")}).filter(o=>o!=="");return{applied:{applied:!1,reason:"ztype validation interrupted the batch"},errors:i.length>0?i:[e.message],...typeof r=="string"?{errorCode:r}:{},errorDetails:{dependents:i.join("; ")},ztypeDiagnostics:e.diagnostics}}function K5(e){return e?e.available===!1||(e.stableErrors?.length??0)>0||(e.betaErrors?.length??0)>0:!1}var qR=e=>e.activeCommit?.commitExId??null,UR=e=>e.filter(t=>!!t?.exId).at(-1)?.exId??null,pa=class e{constructor(t,r,n,i){this.client=t;this.sessionKey=r;this.onSchemaEvent=i;this.key=e.stringifyKey(r),this.watcher=new Tl({sessionKey:r,subscriptionFactory:n,getLastPatchExId:()=>this.lastPatchExId,refresh:()=>this.runWatchRefresh()})}crdtBinary=null;model=null;serverDoc=null;schemaGraph=null;extraContext=null;extraContextLoaded=!1;enabledProjectFeatureNames=[];appDetail=null;snapshot=null;schemaExId=null;commitExId=null;lastPatchExId=null;remotePatchCursor=null;appliedPatchExIds=new Set;staleReason="not loaded";lastError=null;lastZtypeDiagnostics=null;diagnosedFor=null;lastRevision=null;events=[];undoStack=[];redoStack=[];projectCapabilitiesCache;watcher;loadedAt=0;lastUsedAt=Date.now();mutex=new ml;key;static stringifyKey(t){return[t.projectExId,t.appExId??"",t.appVersionExId??""].join(":")}isExpired(t=Date.now()){return t-this.lastUsedAt>My}currentView(){if(!this.model)throw new Error("CRDT model not loaded");return DR(this.model.view(),this.serverDoc)}lastPatchExIds(){return[this.lastPatchExId,this.serverDoc?.lastPatchExId??null].filter(t=>typeof t=="string")}serverSchemaExId(){return _o(this.appDetail)?this.serverDoc?.schemaExId??null:this.schemaExId}status(){return{key:this.key,projectExId:this.sessionKey.projectExId,appExId:this.sessionKey.appExId??null,appVersionExId:this.sessionKey.appVersionExId??null,schemaExId:this.schemaExId,lastPatchExId:this.lastPatchExId,serverDocRequired:_o(this.appDetail),serverDoc:this.serverDoc?{schemaExId:this.serverDoc.schemaExId,lastPatchExId:this.serverDoc.lastPatchExId}:null,loadedAt:this.loadedAt?new Date(this.loadedAt).toISOString():null,lastUsedAt:new Date(this.lastUsedAt).toISOString(),staleReason:this.staleReason,lastError:this.lastError,schemaRevision:this.lastRevision,ztypeDiagnostics:this.lastZtypeDiagnostics,crdtBinaryBytes:this.crdtBinary?.byteLength??null,hasCrdtModel:this.model!==null,hasZtypeGraph:this.schemaGraph!==null,schemaEventCount:this.events.length,undoDepth:this.undoStack.length,redoDepth:this.redoStack.length,watcherActive:this.watcher.isActive()}}state(){return{...this.status(),latestEvent:this.events.at(-1)??null}}listEvents(t,r=100){if(!t)return this.events.slice(-r);let n=this.events.findIndex(i=>i.id===t);return(n>=0?this.events.slice(n+1):this.events).slice(-r)}async checkRemoteAndSync(){return this.mutex.run(async()=>this.withErrorState(async()=>this.checkRemoteAndSyncLocked("remote")))}async load(t=!1){return this.mutex.run(async()=>this.withErrorState(()=>this.loadLocked(t)))}async sync(){return this.mutex.run(async()=>this.withErrorState(async()=>{if(this.touch(),!this.schemaExId)return this.loadLocked();let t=await this.pullPatchesAfterRemoteCursorLocked();return t?(await this.syncServerDocLocked(),this.model&&(this.snapshot=this.currentView(),await this.resolveZtypeGraph(),await this.refreshZtypeDiagnostics()),this.lastPatchExId=t.remoteLastPatchExId,this.updateRevision(),this.status()):this.status()}))}getSnapshot(t=!1){if(this.touch(),this.model?.view&&(this.snapshot=this.currentView()),!this.snapshot)throw new Error("Project schema is not loaded");return t?this.snapshot:L5(this.snapshot)}dataModel(){let t=this.getSnapshot().server;return!t||typeof t!="object"?null:t.dataModel??null}async save(){return this.mutex.run(async()=>this.withErrorState(async()=>{this.touch();let t=await this.currentZtypeDiagnostics(),r=await this.client.request(ig,{projectExId:this.sessionKey.projectExId,appExId:this.sessionKey.appExId??null,versionExId:this.sessionKey.appVersionExId??null});if(r.saveSchema!==this.schemaExId&&(this.schemaExId=r.saveSchema,this.commitExId=null),this.serverDoc){let n=await this.client.request(ig,{projectExId:this.sessionKey.projectExId,appExId:null,versionExId:null});n.saveSchema!==this.serverDoc.schemaExId&&(this.serverDoc.schemaExId=n.saveSchema,this.serverDoc.commitExId=null)}return this.updateRevision(),{...this.status(),ztypeDiagnostics:t}}))}async validate(){return this.mutex.run(async()=>this.withErrorState(async()=>(this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked(),this.currentZtypeDiagnostics())))}async fetchProjectCapabilities(){try{let r=(await this.client.request(y0,{projectExId:this.sessionKey.projectExId,appExId:this.sessionKey.appExId??null})).fetchAppDetailByExId;if(!r)return null;let n="project"in r?r.project:r,i={};for(let o of n.capabilities??[])!o?.capability||!o.limit||(i[o.capability]=o.limit.unlimited?{unlimited:!0}:{unlimited:!1,amount:o.limit.amount??0});return Object.keys(i).length===0?null:i}catch(t){return N.warn("Could not load project capabilities for the schemaops gate",t.message),null}}async resolveProjectCapabilities(){if(this.projectCapabilitiesCache!==void 0)return this.projectCapabilitiesCache;let t=await this.fetchProjectCapabilities();return t!==null&&(this.projectCapabilitiesCache=t),t}async ztypeToolCalls(t,r=!1,n=null,i=!1,o=null){return this.mutex.run(async()=>this.withErrorState(async()=>{if(this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked(),!this.schemaGraph)throw new Error("ztype runtime is unavailable; install @functorz/ztype in this package");let s=await Ct(),a=s?.api;if(!a?.ZTypeCoreApi||!a?.ZTypeSchemaOpsApi)throw new Error("ztype SchemaOps API is unavailable");let u=o??await this.resolveProjectCapabilities(),c=u===null?this.schemaGraph:a.ZTypeCoreApi.withProjectCapabilities(this.schemaGraph,u),l=Sl(s,c,this.appDetail,await this.getExtraContext(s)),d=MR(t,this.enabledProjectFeatureNames);if(d.length)throw new Error(FR(d));let f=j5(t),h=f.map(x=>x&&typeof x=="object"?x.toolCallId:void 0).filter(x=>typeof x=="string"),g=this.withProjectFeatures(a.ZTypeCoreApi,()=>a.ZTypeSchemaOpsApi.toolCalls(l,f,n??null)),v=q5(g),_=$5(g,h),S=s?.application?.schemaops?.SchemaOpsErrorCode?.CAPABILITY_LIMITED?.name;S!==void 0&&_.errorCode===S&&(this.projectCapabilitiesCache=void 0);let b=v.schemaDiff,A=M5(v.responses,h),O={},T=U5(g);if(T!=null&&(O.updatedReadState=T),A&&(O.responses=A),v.errors&&(O.errors=v.errors,Object.assign(O,_,G5(g,h)),O.applied={applied:!1,reason:"batch rejected by ztype"}),b&&r&&(O.schemaDiff=b),b)try{O.applied=await this.applySchemaDiffLocked(b,{skipValidation:i}),V5(g)&&(O.touchesComponents=!0)}catch(x){if(!(x instanceof mn))throw x;let U=await B5(x);return Object.assign(O,U,{errors:[...Array.isArray(O.errors)?O.errors:[],...U.errors]}),O}return await this.attachValidationErrorIfAny(O),O}))}async attachValidationErrorIfAny(t){let r=await this.currentZtypeDiagnostics();K5(r)&&(t.ztypeDiagnostics=r)}async undo(){return this.mutex.run(async()=>this.withErrorState(async()=>{if(this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked(),this.undoStack.length===0)return{...this.status(),undone:!1,reason:"nothing to undo"};let t=this.undoStack[this.undoStack.length-1],r=t.dataSource.map(CR).reverse(),n=await this.applyReversibleLocked(r);return n?(this.undoStack.pop(),this.redoStack.push(t),{...n,undone:!0,undoDepth:this.undoStack.length,redoDepth:this.redoStack.length,reverted:t.semanticChanges??void 0,revertedPaths:Ly(t.dataSource)}):{...this.status(),undone:!1,reason:"schema diverged since this change; undo no longer applies cleanly"}}))}async redo(){return this.mutex.run(async()=>this.withErrorState(async()=>{if(this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked(),this.redoStack.length===0)return{...this.status(),redone:!1,reason:"nothing to redo"};let t=this.redoStack[this.redoStack.length-1],r=await this.applyReversibleLocked(t.dataSource);return r?(this.redoStack.pop(),this.undoStack.push(t),{...r,redone:!0,undoDepth:this.undoStack.length,redoDepth:this.redoStack.length,reapplied:t.semanticChanges??void 0,reappliedPaths:Ly(t.dataSource)}):{...this.status(),redone:!1,reason:"schema diverged since this change; redo no longer applies cleanly"}}))}async applyReversibleLocked(t){if(!this.model)throw new Error("CRDT model not loaded");let r=this.currentView(),n=RR(r,t);if(n.length!==t.length)return null;let i=n.filter(o=>!(o.__typename==="DiffItem"&&gn(o.oldValue)&&gn(o.newValue)));return i.length===0?null:this.applySchemaDiffLocked({id:la(),dataSource:i},{recordUndo:!1})}async recordUndoEntry(t,r,n){let i=await ua();if(!i?.generateDiff)return;let o=[];i.generateDiff({before:t,after:r,prefix:[],result:o}),o.length!==0&&(this.undoStack.push({id:la(),dataSource:o,semanticChanges:n}),this.undoStack.length>P5&&this.undoStack.shift(),this.redoStack=[])}async loadLocked(t=!1){if(this.touch(),this.model&&!t&&!this.staleReason)return this.status();let n=(await this.client.request(await Eo(this.client,Gs),this.sessionKey)).fetchAppDetailByExId;if(!n)throw new Error(`Project not found: ${this.sessionKey.projectExId}`);let i=await this.fetchLatestSchemaPatchesAfter(this.sessionKey,null),o=Sy(i);if(!o?.crdtModelUrl||!i?.exId)throw new Error("Project has no uploaded CRDT schema");let s=await Ey(o.crdtModelUrl);return this.crdtBinary=s,this.appliedPatchExIds.clear(),this.lastPatchExId=null,this.remotePatchCursor=null,this.serverDoc=null,this.undoStack=[],this.redoStack=[],this.projectCapabilitiesCache=void 0,this.appDetail=n,await this.initializeRuntime(s,o.crdtPatches?.patches??[],n),this.schemaExId=i.exId,this.commitExId=o.commitExId,this.lastPatchExId=o.crdtPatches?.lastPatchExId??null,this.remotePatchCursor=this.lastPatchExId,this.loadedAt=Date.now(),this.model&&this.schemaGraph?this.staleReason=!this.serverDoc&&_o(n)?"backend app document unavailable":null:this.model&&!this.schemaGraph&&(this.staleReason="ztype runtime unavailable"),this.updateRevision(),this.watcher.start(),this.status()}async applySchemaDiffLocked(t,r={}){if(Array.isArray(t.dataSource)&&t.dataSource.length===0)return{...this.status(),applied:!1,reason:"empty schema diff"};if(!this.serverDoc&&_o(this.appDetail)&&(t.dataSource??[]).some(Il))throw new Error("This client app's server lives in the backend app's document, which is not loaded; refusing to write server changes into the client document. Run schema load again.");if(kR(this.appDetail)&&(t.dataSource??[]).some(LR))throw new Error("This session is on the project's own document, which holds the project's backend and no client, so pages and components written here would belong to nothing and never render. Pin the client they belong to with set_current_project (appExId), or pass appExId on this call; take it from `project metadata` -> apps[]. A project with no client app has nowhere to hold them at all.");let i=(r.recordUndo??process.env.MOMEN_MCP_UNDO!=="0")&&this.snapshot?NR(this.snapshot,t.dataSource??[]):null,o=this.currentRevision(),s=await Ct(),a=s?.api?.ZTypeCoreApi,u=await ua();if(!a||!u?.executeCrdtNodeUpdateAndTransformDiff||!u.generateDiff)throw new Error("CRDT/ztype write runtime is unavailable");let c=Sl(s,this.schemaGraph,this.appDetail,await this.getExtraContext(s)),l=this.withProjectFeatures(a,()=>a.batchUpdateSchemaGraph(c,[t]));if(l?.interruptErrors?.length>0){let g={available:!0,stableErrors:[...l.interruptErrors].map(gl),betaErrors:[]};if(r.skipValidation!==!0)throw new mn("ztype validation interrupted schema update",g)}if(!this.model)throw new Error("CRDT model not loaded");N.debug(`[Session] applying schemaDiff dataSource: ${JSON.stringify(t.dataSource).slice(0,4e3)}`);try{await this.uploadByDoc(u,t.dataSource??[],this.model)}catch(g){N.error(`[Session] CRDT apply/upload failed; reloading session to discard the diverged graph: ${g.message}`);let{undoStack:v,redoStack:_}=this;try{await this.loadLocked(!0),this.undoStack=v,this.redoStack=_}catch(S){N.error(`[Session] reload after the failed write failed too; unloading the session so the next command loads it again: ${S.message}`),this.model=null,this.snapshot=null,this.schemaGraph=null,this.schemaExId=null,this.diagnosedFor=null,this.staleReason="a write failed and the reload after it failed too"}throw g}this.schemaGraph=l.updatedGraph,this.snapshot=this.currentView();let d=await this.refreshZtypeDiagnostics(),f=this.updateRevision(),h=i&&o&&i.server!==this.snapshot.server?await Ny({version:i.version,server:i.server},{version:this.snapshot.version,server:this.snapshot.server}):null;return h&&bl(h)&&o&&f&&this.appendSchemaEvent("local",o,f,h),i&&await this.recordUndoEntry(i,this.snapshot,h&&bl(h)?h:null).catch(g=>N.warn(`[Session] the write landed but its undo entry could not be recorded: ${g.message}`)),{...this.status(),ztypeDiagnostics:d,backendErrorCount:gR(d),_schema:h&&bl(h)?{change:h}:void 0}}async uploadByDoc(t,r,n){let i=this.serverDoc,o=i?r.filter(Il):[],s=i?r.filter(u=>!Il(u)):r,a=i&&o.length>0&&s.length>0?hR(i.model.view()):null;if(i&&o.length>0)for(let u of await this.uploadDocPatch(t,o,i.model,null,i.schemaExId))i.appliedPatchExIds.add(u.exId),i.lastPatchExId=u.exId;if(s.length!==0)try{for(let u of await this.uploadDocPatch(t,s,n,this.sessionKey.appExId??null,this.schemaExId))this.appliedPatchExIds.add(u.exId),this.lastPatchExId=u.exId}catch(u){if(i&&a){let c=[];t.generateDiff({before:i.model.view(),after:a,prefix:[],result:c}),c.length>0&&await this.uploadDocPatch(t,c,i.model,null,i.schemaExId).catch(l=>{throw new Error(`The server half of this change was saved to the backend app's document, but the client half failed (${u.message}) and reverting the server half failed too (${l.message}). Those server changes are live without their client counterparts: read the schema again before retrying, or the retry applies them a second time.`)})}throw u}}async uploadDocPatch(t,r,n,i,o){let s=t.executeCrdtNodeUpdateAndTransformDiff(r,n,this.snapshot,yR),a=la(),u=await jR(this.client);return(await this.client.request(a0,{projectExId:this.sessionKey.projectExId,appExId:i,schemaExId:o,patches:[{content:{id:a,dataSource:s.diffsFromCrdt},patchBase64:s.patchBase64,uuid:a,...u}]})).batchCreateSchemaCrdtPatch??[]}async checkRemoteAndSyncLocked(t){if(!this.model||!this.schemaExId||!this.snapshot)return await this.loadLocked(),null;let r=this.currentRevision();if(!r)return null;let n={version:this.snapshot.version,server:this.snapshot.server},o=(await this.client.request(await Eo(this.client,Gs),this.sessionKey)).fetchAppDetailByExId,s=by(o);if(!s?.exId)return null;let a=await this.syncServerDocLocked();if(this.appDetail=o??this.appDetail,s.exId!==this.schemaExId||!s.crdtModelUrl)await this.loadLocked(!0);else{let l=await this.pullPatchesAfterRemoteCursorLocked();l&&((l.applied||a)&&this.model&&(this.snapshot=this.currentView(),await this.resolveZtypeGraph(),await this.refreshZtypeDiagnostics()),this.lastPatchExId=l.remoteLastPatchExId,this.updateRevision())}let u=this.currentRevision();if(!u||!wR(r,u))return null;let c=await Ny(n,{version:this.snapshot?.version,server:this.snapshot?.server});return this.appendSchemaEvent(t==="watch"?"remote":t,r,u,c),{type:"SCHEMA_STALE",message:"Project schema changed since this session last used it; session was refreshed before executing the command.",projectExId:this.sessionKey.projectExId,fromRevision:r,toRevision:u,semanticChanges:c,detectedAt:new Date().toISOString()}}currentRevision(){return this.lastRevision??this.updateRevision()}updateRevision(){return!this.snapshot&&!this.crdtBinary?(this.lastRevision=null,null):(this.lastRevision=IR({projectExId:this.sessionKey.projectExId,appExId:this.sessionKey.appExId??this.appDetail?.appExId??null,appVersionExId:this.sessionKey.appVersionExId??null,schemaExId:this.schemaExId,lastPatchExId:this.lastPatchExId,snapshot:this.snapshot??{binaryBytes:this.crdtBinary?.byteLength??null},deployedSchemaExId:fR(this.appDetail)}),this.lastRevision)}appendSchemaEvent(t,r,n,i){let o={id:la(),type:"SCHEMA_CHANGED",source:t,projectExId:this.sessionKey.projectExId,fromRevision:r,toRevision:n,semanticChanges:i,detectedAt:new Date().toISOString()};this.events.push(o),this.events=this.events.slice(-N5),this.onSchemaEvent?.(o)}async runWatchRefresh(){let t=this.lastUsedAt;try{await this.mutex.run(async()=>{await this.withErrorState(async()=>this.checkRemoteAndSyncLocked("watch"))})}catch(r){N.warn("Schema watch refresh failed",r.message)}finally{this.lastUsedAt=t}}dispose(){this.watcher.dispose()}async initializeRuntime(t,r,n){let i=await ua();if(!i?.initModelByBinary){this.model=null,this.snapshot={binaryBytes:t.length,patches:r},this.schemaGraph=null,this.diagnosedFor=null,this.appDetail=n,this.staleReason="CRDT runtime unavailable";return}this.model=i.initModelByBinary(t),await this.applyNetworkPatches(r),this.model&&(_o(n)&&(this.serverDoc=await this.loadServerDoc(i).catch(o=>{if(_l(o,"CLIENT_VERSION_TOO_OLD"))throw this.staleReason="backend app document unavailable",o;return N.warn("Backend app document unavailable; loading this client app's own document alone",o.message),null})),this.snapshot=this.currentView(),await this.resolveZtypeGraph(),await this.refreshZtypeDiagnostics())}async applyNetworkPatches(t){let r=t.filter(i=>!!(i?.exId&&!this.appliedPatchExIds.has(i.exId)));if(!this.model||r.length===0)return;let n=await _y();if(!n?.fromBinary)throw new Error("json-joy Patch runtime is unavailable");this.model.applyBatch(r.map(i=>n.fromBinary(Buffer.from(i.patchBase64,"base64"))));for(let i of r)this.appliedPatchExIds.add(i.exId),this.lastPatchExId=i.exId;this.snapshot=this.currentView()}async loadServerDoc(t){let r=await this.fetchLatestSchemaPatchesAfter({projectExId:this.sessionKey.projectExId},null),n=Sy(r);if(!n?.crdtModelUrl||!r?.exId||!t.initModelByBinary)throw new Error("Could not load the backend app's document this client app's server half lives in");let i={model:t.initModelByBinary(await Ey(n.crdtModelUrl)),schemaExId:r.exId,commitExId:n.commitExId,lastPatchExId:null,remotePatchCursor:null,appliedPatchExIds:new Set};return await this.applyServerPatches(i,n.crdtPatches?.patches??[]),i.lastPatchExId=n.crdtPatches?.lastPatchExId??i.lastPatchExId,i.remotePatchCursor=i.lastPatchExId,i}async applyServerPatches(t,r){let n=r.filter(o=>!!(o?.exId&&!t.appliedPatchExIds.has(o.exId)));if(n.length===0)return!1;let i=await _y();if(!i?.fromBinary)throw new Error("json-joy Patch runtime is unavailable");t.model.applyBatch(n.map(o=>i.fromBinary(Buffer.from(o.patchBase64,"base64"))));for(let o of n)t.appliedPatchExIds.add(o.exId),t.lastPatchExId=o.exId;return!0}async syncServerDocLocked(){let t=this.serverDoc;if(!t)return!1;let r=await this.fetchLatestSchemaPatchesAfter({projectExId:this.sessionKey.projectExId},t.remotePatchCursor);if(!r?.exId)return!1;if(r.exId!==t.schemaExId||qR(r)!==t.commitExId)return this.serverDoc=await this.loadServerDoc(await ua()),!0;let n=r.crdtPatches?.patches??[],i=await this.applyServerPatches(t,n);t.remotePatchCursor=UR(n)??t.remotePatchCursor;let o=r.crdtPatches?.lastPatchExId??null,s=i||o!==t.lastPatchExId;return t.lastPatchExId=o,s}async pullPatchesAfterRemoteCursorLocked(){let t=await this.fetchLatestSchemaPatchesAfter(this.sessionKey,this.remotePatchCursor);if(!t?.exId||!t.crdtModelUrl||t.exId!==this.schemaExId||qR(t)!==this.commitExId)return await this.loadLocked(!0),null;let r=t.crdtPatches?.patches??[],n=this.appliedPatchExIds.size;return await this.applyNetworkPatches(r),this.remotePatchCursor=UR(r)??this.remotePatchCursor,{applied:this.appliedPatchExIds.size>n,remoteLastPatchExId:t.crdtPatches?.lastPatchExId??null}}async fetchLatestSchemaPatchesAfter(t,r){let n=await this.client.request(await Eo(this.client,i0),{projectExId:t.projectExId,appExId:t.appExId??null,appVersionExId:t.appVersionExId??null,afterPatchExId:r});return by(n.fetchAppDetailByExId)}async resolveZtypeGraph(){let t=await Ct(),r=t?.api;if(!r?.ZTypeCoreApi||!this.snapshot){this.schemaGraph=null,this.diagnosedFor=null,this.staleReason="ztype runtime unavailable";return}let n=r.ZTypeCoreApi.parseZSchemaFromJsObject(this.snapshot),i=await this.getExtraContext(t);this.schemaGraph=this.withProjectFeatures(r.ZTypeCoreApi,()=>r.ZTypeCoreApi.resolveZSchemaToSchemaGraph(n,i))}withProjectFeatures(t,r){return t.withEnabledFeatures(this.enabledProjectFeatureNames,r)}async getExtraContext(t){if(this.extraContextLoaded)return this.extraContext;this.extraContextLoaded=!0;try{let[r,n,i]=await Promise.all([pR(),this.client.request(v0).then(o=>o.supportedCustomModelDescriptor??null).catch(o=>(N.warn("extraContext: model descriptors unavailable",o.message),null)),this.client.request(XA,{projectExId:this.sessionKey.projectExId}).then(o=>(o.features??[]).filter(s=>s.enabled).map(s=>s.featureName)).catch(o=>(N.warn("extraContext: project features unavailable; ztype runs with every feature off",o.message),[]))]);this.enabledProjectFeatureNames=i,this.extraContext=AR(t,r,n,mo(t))}catch(r){N.warn("extraContext build failed; resolving schema without it",r.message),this.extraContext=null}return this.extraContext}diagnosticsInputs(){return{graph:this.schemaGraph,target:`${this.appDetail?.appType??""}:${this.appDetail?.appExId??""}`,extraContext:this.extraContext,featureNames:this.enabledProjectFeatureNames}}async currentZtypeDiagnostics(){let t=this.diagnosedFor,r=this.diagnosticsInputs();return this.lastZtypeDiagnostics&&t&&Object.keys(r).every(n=>t[n]===r[n])?this.lastZtypeDiagnostics:this.refreshZtypeDiagnostics()}async refreshZtypeDiagnostics(){if(this.diagnosedFor=null,this.lastZtypeDiagnostics=null,!this.schemaGraph||!this.appDetail)return this.lastZtypeDiagnostics={available:!1,stableErrors:[],betaErrors:[],error:this.staleReason??"ztype schema graph is not loaded"},this.lastZtypeDiagnostics;let t=await Ct(),r=t?.api;if(!r?.ZTypeCoreApi||!r?.ZTypeValidationApi)return this.lastZtypeDiagnostics={available:!1,stableErrors:[],betaErrors:[],error:"ztype validation API is unavailable"},this.lastZtypeDiagnostics;let n=Sl(t,this.schemaGraph,this.appDetail,await this.getExtraContext(t)),i=this.withProjectFeatures(r.ZTypeCoreApi,()=>r.ZTypeValidationApi.validateSchemaGraph(n,xR(t,this.appDetail)));return this.lastZtypeDiagnostics={available:!0,stableErrors:[...i?.errors??i?.stableErrors??[]].map(gl),betaErrors:[...i?.warnings??i?.betaErrors??[]].map(gl)},this.diagnosedFor=this.diagnosticsInputs(),this.lastZtypeDiagnostics}touch(){this.lastUsedAt=Date.now()}async withErrorState(t){try{let r=await t();return this.lastError=null,r}catch(r){throw this.lastError=r instanceof Error?r.message:String(r),r}}};var wl=class{constructor(t,r){this.clientFactory=t;this.subscriptionFactory=r}sessions=new Map;emitter=new H5;clear(){for(let t of this.sessions.values())t.dispose();this.sessions.clear()}sweep(){let t=Date.now();for(let[r,n]of this.sessions.entries())n.isExpired(t)&&(n.dispose(),this.sessions.delete(r))}status(){return this.sweep(),{projectSessionIdleTtlMs:My,sessions:[...this.sessions.values()].map(t=>t.status())}}async load(t,r=!1){return(await this.getSession(t)).load(r)}async sync(t){return(await this.getSession(t)).sync()}async snapshot(t,r=!1){return(await this.getSession(t)).getSnapshot(r)}async dataModel(t){return(await this.getSession(t)).dataModel()}async save(t){return(await this.getSession(t)).save()}async validate(t){return(await this.getSession(t)).validate()}async ztypeToolCalls(t,r,n=!1,i=null,o=!1,s=null){return(await this.getSession(t)).ztypeToolCalls(r,n,i,o,s)}async serverSchemaExId(t){let r=await this.getSession(t);return await r.load(!1),r.serverSchemaExId()}async lastPatchExIds(t){let r=await this.getSession(t);return await r.load(!1),await r.checkRemoteAndSync(),r.lastPatchExIds()}async undo(t){return(await this.getSession(t)).undo()}async redo(t){return(await this.getSession(t)).redo()}async checkRemoteAndSync(t){return(await this.getSession(t)).checkRemoteAndSync()}schemaState(t){this.sweep();let r=[...this.sessions.values()].filter(n=>!t||n.status().projectExId===t);return{projectExId:t??null,sessions:r.map(n=>n.state())}}schemaEvents(t,r,n=100){this.sweep();let i=[...this.sessions.values()].filter(o=>!t||o.status().projectExId===t);return{projectExId:t??null,events:i.flatMap(o=>o.listEvents(r,n))}}async getSession(t){this.sweep();let r=pa.stringifyKey(t),n=this.sessions.get(r);if(n)return n;let i=new pa(await this.clientFactory(),t,this.subscriptionFactory,o=>{this.emitter.emit("schemaChanged",o)});return this.sessions.set(r,i),i}};function nr(e,t){return{projectExId:e,appExId:t.appExId??null,appVersionExId:t.appVersionExId??null}}p();import{execSync as Q5}from"node:child_process";import{createRequire as W5}from"node:module";import z5 from"node:path";var Uy=1e5,Y5=15e3,J5=3e4,GR=["--js-flags=--max-old-space-size=1024","--renderer-process-limit=1"],X5=5*6e4,Z5=["chrome","msedge"],da=e=>Math.max(1,e-Date.now()),Fy=(e,t)=>{let r;return Promise.race([e,new Promise((n,i)=>{r=setTimeout(()=>i(new Error(`The canvas did not answer within ${Uy/1e3}s.`)),da(t))})]).finally(()=>clearTimeout(r))},e3=async()=>{try{return await import("playwright")}catch{let e=Q5("npm root -g",{stdio:"pipe"}).toString().trim();return W5(z5.join(e,"noop.js"))("playwright")}},$R=e=>(e instanceof Error?e.message:String(e)).split(`
|
|
1322
|
-
`)[0]??"",
|
|
1367
|
+
`;p();var El=je(ln(),1);import{randomUUID as h5}from"crypto";var IR=je(Jg(),1);p();var n5=je(XC(),1),i5=je(cl(),1),o5=je(uo(),1),s5=je(uy(),1),a5=je(py(),1),u5=je(yy(),1),aR=je(fl(),1),c5=je(sR(),1);var uR=aR.default;p();var cR=100*1024*1024,ml=class{current=Promise.resolve();async run(t){let r=this.current,n=()=>{};this.current=new Promise(i=>{n=i}),await r;try{return await t()}finally{n()}}},Ey=async e=>{let t=await fetch(e);if(!t.ok)throw new Error(`Failed to download CRDT model: ${t.status} ${t.statusText}`);let r=t.body?.getReader();if(!r)throw new Error("Failed to read CRDT model response body");let n=[],i=0;for(;;){let{done:a,value:u}=await r.read();if(a)break;if(i+=u.length,i>cR)throw new Error(`CRDT model is larger than ${cR} bytes`);n.push(u)}let o=new Uint8Array(i),s=0;for(let a of n)o.set(a,s),s+=a.length;return o},ua=async(e,t)=>{try{return await t()}catch(r){return N.warn(`Optional runtime package unavailable: ${e}`,r.message),null}},lR=null,_t=async()=>(lR??=ua("@functorz/ztype",()=>import("./ztype-DHYCSI44.js")).then(e=>(e?.default??e)?.com?.functorz?.ztype??null),lR),pR=null,mR=async()=>(pR??=ua("@functorz/ztype",()=>import("./ztype-DHYCSI44.js")).then(e=>(e?.default??e)?.kotlin?.collections??null),pR),dR=null,gR=async()=>(dR??=_t().then(e=>e?.typesystem?.schema?.SCHEMA_VERSION??null),dR),fR=null,ca=async()=>(fR??=ua("@functorz/crdt-helper",()=>import("./index.cjs-G7QKQQEI.js")).then(e=>e?.Crdt??e?.default?.Crdt??null),fR),hR=null,_y=async()=>(hR??=ua("json-joy/lib/json-crdt-patch/index.js",()=>import("./json-crdt-patch-N5S5AUJ4.js")).then(e=>e??ua("json-joy/lib/json-crdt/index.js",()=>import("./json-crdt-UTIMH7MN.js"))).then(e=>e?.Patch??e?.default?.Patch??null),hR),Sy=e=>e?.lastUploadedSchema??null,by=e=>{if(!e)return null;let t=e.activeCommit;return t?{commitExId:t.commitExId,crdtModelUrl:t.crdtModelUrl,crdtPatches:t.crdtPatches??null}:{commitExId:null,crdtModelUrl:e.crdtModelUrl,crdtPatches:e.crdtPatches??null}},yR=e=>[e?.project?.lastDeployedServerSchemaExId,e?.lastDeployedServerSchemaExId,e?.project?.latestDeployedServerSchema?.exId,e?.latestDeployedServerSchema?.exId].find(r=>typeof r=="string"&&r.length>0)??null,vR=e=>e==null?e:structuredClone(e),Ty=(e,t)=>e?.appExId?e.appExId:t?.name??"",Iy=(e,t)=>{let r=e?.typesystem?.schema?.ClientType;if(r)return t==="WECHAT_MINI_PROGRAM"?r.WECHAT_MINI_PROGRAM??r.WECHAT??r.WEB:t==="MOBILE"?r.MOBILE??r.WEB:r.WEB},mo=e=>{let t=e?.typesystem?.schema?.Product?.[Tn];if(!t)throw new Error(`ztype runtime has no Product enum member for ${Tn}`);return t},ER=e=>{let t=e?.typesystem?.schema?.Locale?.EN;if(!t)throw new Error("ztype runtime has no Locale enum member for EN");return t},l5=e=>{try{return JSON.parse(JSON.stringify(e))}catch{return String(e)}},gl=e=>({componentId:e?.componentId??null,message:typeof e?.getLocalizedErrorMessage=="function"?e.getLocalizedErrorMessage("EN"):e?.message??String(e),zhMessage:typeof e?.getLocalizedErrorMessage=="function"?e.getLocalizedErrorMessage("ZH"):void 0,platform:e?.platform??null,isBackendError:!!e?.isBackendError,fullPath:l5(e?.fullPath??[])}),yl=e=>e.stableErrors.concat(e.betaErrors).filter(t=>!!t.isBackendError),_R=e=>yl(e).length,SR=(e,t)=>{if(t.__typename==="DiffItem"){let r=t.pathComponents?.at(-1)?.key??"";if(t.operation==="delete"){delete e[r];return}e[r]=structuredClone(t.newValue);return}if(t.__typename==="ArrayDiffItem"){let r=t.pathComponents?.at(-1)?.index??-1;if(!Array.isArray(e)||r<0)throw new Error("Invalid array diff target");if(t.operation==="delete"){e.splice(r,1);return}if(t.operation==="insert"){e.splice(r,0,structuredClone(t.newValue));return}e[r]=structuredClone(t.newValue)}};p();var bR=je(Go(),1);import{createRequire as p5}from"module";var d5=p5(import.meta.url);var vl=e=>{if(Ur){if(e==="@functorz/ztype")return Ur.ztype;if(e==="@functorz/crdt-helper")return Ur.crdtHelper;if(e==="json-joy")return Ur.jsonJoy}try{let t=d5(`${e}/package.json`);return t.ztypeBuild??t.version??"unknown"}catch{return"unavailable"}},f5=async()=>{if(Ur)return{ztypeVersion:Ur.ztype,ztypeSchemaVersion:Ur.ztypeSchemaVersion};try{let e=await _t();return{ztypeVersion:vl("@functorz/ztype"),ztypeSchemaVersion:e?.ZTypeSystem?.getSchemaVersion?.()??"unknown"}}catch{return{ztypeVersion:vl("@functorz/ztype"),ztypeSchemaVersion:"unavailable"}}};async function wy(){let e=bv(),t=await f5();return{agentVersion:e.version??"0.0.0",nodeMajor:process.versions.node.split(".")[0],platform:process.platform,arch:process.arch,ztypeVersion:t.ztypeVersion,ztypeSchemaVersion:t.ztypeSchemaVersion,crdtHelperVersion:vl("@functorz/crdt-helper"),jsonJoyVersion:vl("json-joy")}}async function go(e,t){let[r,n,i]=await Promise.all([wy(),yr(e),e.loadCredentials()]),o=i?bR.default.decode(i.access_token):null,s=typeof o=="object"&&o!==null?String(o.sub??o.exId??o.id??"authenticated"):"anonymous";return{...r,product:Y,apiBaseUrl:n.apiBaseUrl,authUserId:s,workspaceRoot:e.getWorkspaceRoot(),startupFlags:[...t].sort()}}function TR(e,t){return JSON.stringify(e)===JSON.stringify(t)}p();var ni=async(e,t)=>{let n=(await e.request(Vc,{projectExId:t,appExId:null})).fetchAppDetailByExId;return((n?.__typename==="Project"?n.appList:null)??[]).filter(o=>o.appExId!=null)},yo=e=>e.length===1?e[0].appExId:null;var Oy=h5(),wR=`${Y}/${bn()}`,m5=e=>{if(!e)return e;if(Array.isArray(e))return e.map(([r,n])=>[r,String(r).toLowerCase()==="authorization"?"Bearer <redacted>":n]);if(typeof e=="object"&&"forEach"in e&&typeof e.forEach=="function"){let r={};return e.forEach((n,i)=>{r[i]=i.toLowerCase()==="authorization"?"Bearer <redacted>":String(n)}),r}let t={};for(let[r,n]of Object.entries(e))t[r]=r.toLowerCase()==="authorization"?"Bearer <redacted>":String(n);return t},_l=(e,t)=>{let r=e?.response?.errors;return Array.isArray(r)&&r.some(n=>n?.errorType===t)};function Ay(e){if(!Array.isArray(e)||e.length===0)return null;let t=e.map(r=>{let n=r,i=typeof n.operation=="string"?n.operation:null,o=typeof n.errorType=="string"?n.errorType:typeof n.extensions?.classification=="string"?n.extensions.classification:null,s=typeof n.message=="string"?n.message:null;return!s&&!i&&!o?null:`${i?`${i}: `:""}${s??"GraphQL error"}${o?` (${o})`:""}`}).filter(r=>!!r);return t.length>0?t.join("; "):null}var g5=e=>{if(typeof e=="string")return e;if(e instanceof Uint8Array)return Buffer.from(e).toString("utf8");try{return String(e)}catch{return"<unserializable body>"}},y5=new Set(["ECONNRESET","EPIPE","UND_ERR_SOCKET"]),v5=e=>{let t=e?.cause?.code;return typeof t=="string"&&y5.has(t)},E5=e=>{if(typeof e!="string")return!1;try{let{query:t,operationName:r}=JSON.parse(e);return typeof t!="string"?!1:(0,El.getOperationAST)((0,El.parse)(t),typeof r=="string"?r:void 0)?.operation==="query"}catch{return!1}},vo=async(e,t)=>{let r=rp();N.debug(`[HTTP] Request URL: ${e.toString()}`),t?.headers&&N.debug(`[HTTP] Request Headers: ${JSON.stringify(m5(t.headers))}`),r&&t?.body!=null&&N.debug(`[GQL] Request Body: ${g5(t.body)}`);let n=await fetch(e,t).catch(o=>{if(!v5(o)||!E5(t?.body))throw o;return N.info(`[HTTP] Connection reset; resending the query to ${e.toString()}`),fetch(e,t)}),i=null;try{i=await n.clone().text()}catch(o){N.debug(`[GQL] Response read failed: ${String(o)}`)}if(r&&N.debug(`[GQL] Response ${n.status}: ${i??"<read failed>"}`),i&&i.includes('"errors"')){let o=null;try{o=JSON.parse(i).errors}catch{o=null}let s=Ay(o);s&&N.warn(`[GQL] ${n.status} errors: ${s}`)}return n};async function xy(e,t){let r=await yr(t),n={"User-Locale":"en_US","X-SESSION-ID":Oy,"X-Client":wR},i=await gR();return i&&(n["X-ZED-VERSION"]=i),process.env.REACT_APP_VERSION&&(n["X-REACT-APP-VERSION"]=process.env.REACT_APP_VERSION),new Ze(`${r.apiBaseUrl}/api/graphql`,{headers:n,fetch:vo,requestMiddleware:async o=>{let s=new Headers(o.headers);return s.set("Authorization",`Bearer ${await e.getValidToken()}`),{...o,headers:s}}})}var la=class extends uR{constructor(...t){super(...t),this.on("error",r=>N.debug(`[SUB] socket error: ${r.message}`))}};async function OR(e,t){let n=`${(await yr(t)).apiBaseUrl.replace(/^http:/,"ws:").replace(/^https:/,"wss:")}/api/graphql-subscription`;return async(i,o,s)=>{let a=rp(),u={"X-SESSION-ID":Oy,"X-Client":wR};N.debug(`[SUB] connecting ${n} params=${JSON.stringify(u)}`);let c=new IR.SubscriptionClient(n,{lazy:!0,reconnect:!0,minTimeout:3e3,connectionParams:async()=>({...u,authToken:await e.getValidToken()})},la);c.onConnected(()=>N.debug("[SUB] connected")),c.onReconnected(()=>N.debug("[SUB] reconnected")),c.onDisconnected(()=>N.debug("[SUB] disconnected")),c.onError(f=>N.debug(`[SUB] error ${f?.message??String(f)}`));let d=[{name:"onNewCrdtPatchV2",query:c0,variables:{projectExId:i.projectExId,appExId:i.appExId??null,versionExId:i.appVersionExId??null,latestPatchExIdInClient:o}},{name:"onSchemaUploadV3",query:l0,variables:{projectExId:i.projectExId,appExId:i.appExId??null,appVersionExId:i.appVersionExId??null}}].map(f=>(N.debug(`[SUB] subscribe ${f.name} vars=${JSON.stringify(f.variables)}`),c.request({query:f.query,variables:f.variables}).subscribe({next:h=>{a&&N.debug(`[SUB] ${f.name} event: ${JSON.stringify(h)}`),s()},error:h=>{N.warn("Schema subscription event failed",String(h)),s()}})));return{unsubscribe(){for(let f of d)f.unsubscribe();c.close(!1,!1)}}}}async function AR(e,t,r){let n=await e.loadProjectContext();if(t.projectExId)return n?.projectExId!==t.projectExId&&await e.saveProjectContext(t.projectExId,r?yo(await ni(r,t.projectExId)):null),t.projectExId;if(!n?.projectExId)throw new Error("No projectExId provided and no current project is set");return n.projectExId}async function Cy(e,t,r,n){try{await e.request(x0,{projectExId:t,client:Y,clientVersion:bn(),sessionId:n??Oy,agent:r??null}),N.debug(`[agent-session] started for project ${t}`)}catch(i){N.debug(`[agent-session] skipped: ${String(i)}`)}}p();p();p();import{createHash as _5}from"crypto";var S5=e=>!!(e&&typeof e=="object"&&!Array.isArray(e)),Ry=e=>{if(Array.isArray(e))return e.map(r=>r===void 0?null:Ry(r));if(!S5(e))return e;let t={};for(let r of Object.keys(e).sort()){let n=e[r];n!==void 0&&(t[r]=Ry(n))}return t},b5=e=>JSON.stringify(Ry(e)),T5=e=>_5("sha256").update(b5(e)).digest("hex"),xR=e=>({projectExId:e.projectExId,appExId:e.appExId??null,appVersionExId:e.appVersionExId??null,schemaExId:e.schemaExId??null,lastPatchExId:e.lastPatchExId??null,snapshotHash:T5(e.snapshot),deployedSchemaExId:e.deployedSchemaExId??null,checkedAt:e.checkedAt??new Date().toISOString()}),CR=(e,t)=>!e||!t?e!==t:e.schemaExId!==t.schemaExId||e.lastPatchExId!==t.lastPatchExId||e.snapshotHash!==t.snapshotHash||e.deployedSchemaExId!==t.deployedSchemaExId,Sl=e=>e.changes.length>0;var RR=null,I5=()=>(RR??=_t().then(e=>{let t=e?.typesystem?.schema?.diff?.computeSemanticSchemaChanges;return typeof t=="function"?t:null}),RR),w5=async(e,t)=>{let r=await I5();return r?r(e,t):{changes:[]}},Ny=(e,t)=>w5(JSON.stringify(e),JSON.stringify(t));p();var Py=null,Dy=e=>(Py??=e.request(s0).then(t=>(t.__type?.fields??[]).some(r=>r.name==="activeCommit")).catch(t=>{throw Py=null,t}),Py),Eo=async(e,t)=>await Dy(e)?t:t.replace(ng,"").replace(/^[ \t]*\.\.\.ActiveCommit\n/gm,"");p();var O5="Functorz";function NR(e,t,r,n){let i=e?.typesystem?.settings,o=e?.typesystem?.schema,s=t?.KtList,a=t?.KtMap;if(!i?.ExtraContext||!o?.CustomChatModelDescriptor||!o?.AIModelDescriptors||!s||!a)return N.warn("ztype ExtraContext symbols missing; schema graph will be built without custom models"),null;try{let{ExtraContext:u}=i,{AIModelDescriptors:c,CustomChatModelDescriptor:l,CustomEmbeddingModelDescriptor:d,ModelCustomParamDescriptor:f,CustomModelParam:h,CustomChatCompletionFeatures:g,Identifier:v,MediaOutputCardinality:_}=o,b=C=>a.fromJsMap(new Map(Object.entries(C??{}))),S=C=>typeof C=="string"?C==="single"?_.SINGLE:C==="multiple"?_.MULTIPLE:_.NONE:typeof C=="boolean"&&C?_.MULTIPLE:_.NONE,I=C=>new f(C.name,b(C.displayName),C.type,b(C.description)),A=C=>new h(I(C.serverUrl),I(C.apiToken),s.fromJsArray((C.extensionParams??[]).map(te=>new f(te.name,b(te.displayName),te.type,b(te.displayName))))),T=C=>C.provider===O5&&C.customModelIdentifier?new v(C.customModelIdentifier.id,C.customModelIdentifier.namespace):null,x=(r?.chatModelDescriptors??[]).map(C=>new l(C.provider,C.name,A(C.paramToConfigure),C.delisted,new g(C.features.streamResponse,C.features.multiModal,C.features.imageInput??!1,!1,C.features.videoInput??!1,C.features.imageMessageInput??!1,!1,C.features.videoMessageInput??!1,C.features.tools,C.features.reasoningContent,C.features.imageOutput,C.features.videoOutput,S(C.features.imageOutput),S(C.features.videoOutput),null,C.features.structuredOutput),T(C))),U=(r?.embeddingModelDescriptors??[]).map(C=>new d(C.provider,C.name,A(C.paramToConfigure),T(C),C.delisted));return new u(new c(s.fromJsArray(x),s.fromJsArray(U)),a.fromJsMap(new Map),n)}catch(u){return N.warn("ztype ExtraContext construction failed; schema graph will be built without custom models",u.message),null}}p();var mn=class extends Error{constructor(r,n){super(r);this.diagnostics=n;this.name="ZtypeValidationError"}};p();function bl(e,t,r,n=null){let i=Iy(e,r?.appType);return e.api.ZTypeCoreApi.genZTypeApiContext(t,mo(e),i,Ty(r,i),ER(e),n)}function PR(e,t){return Ty(t,Iy(e,t?.appType))}p();var gn=e=>e==null,Ly=(e,t)=>{if(gn(e)&&gn(t)||e===t)return!0;if(gn(e)||gn(t)||typeof e!="object"||typeof t!="object")return!1;let r=e,n=t,i=new Set([...Object.keys(r),...Object.keys(n)]);for(let o of i)if(!Ly(r[o],n[o]))return!1;return!0};var ky=e=>{let t=new Set;for(let r of e)if(t.add(r.pathComponents.map(n=>n.index!==void 0?`[${n.index}]`:`.${n.key}`).join("").replace(/^\./,"")),t.size>=20)break;return[...t]},DR=e=>{if(e.__typename==="DiffItem")switch(e.operation){case"add":return{__typename:"DiffItem",oldValue:e.newValue,newValue:null,operation:"delete",pathComponents:e.pathComponents};case"delete":return{__typename:"DiffItem",oldValue:null,newValue:e.oldValue,operation:"add",pathComponents:e.pathComponents};case"update":return{__typename:"DiffItem",oldValue:e.newValue,newValue:e.oldValue,operation:"update",pathComponents:e.pathComponents}}else switch(e.operation){case"insert":return{__typename:"ArrayDiffItem",oldValue:e.newValue,newValue:null,previousValue:e.previousValue,nextValue:e.nextValue,operation:"delete",pathComponents:e.pathComponents};case"delete":return{__typename:"ArrayDiffItem",oldValue:null,newValue:e.oldValue,previousValue:e.previousValue,nextValue:e.nextValue,operation:"insert",pathComponents:e.pathComponents};case"update":return{__typename:"ArrayDiffItem",oldValue:e.newValue,newValue:e.oldValue,operation:"update",pathComponents:e.pathComponents}}throw new Error(`Cannot reverse diff item: ${JSON.stringify(e)}`)},A5=e=>e.key??e.index??"",x5=(e,t)=>{let r=e;for(let n of t){if(r===null||typeof r!="object")return;r=r[n]}return r},C5=(e,t)=>{if(t.__typename!=="DiffItem")return null;let r=t.pathComponents.at(-1)?.key;if(r===void 0)return null;let n=Ly(e[r],t.oldValue);switch(t.operation){case"add":e[r]=t.newValue;break;case"update":if(!n)return null;e[r]=t.newValue;break;case"delete":if(!Object.prototype.hasOwnProperty.call(e,r)||!n)return null;delete e[r];break;default:return null}return t},R5=(e,t)=>{if(t.__typename!=="ArrayDiffItem")return null;let r=t.pathComponents.at(-1)?.index;if(r===void 0||r>e.length)return null;let n=()=>Ly(e[r],t.oldValue);switch(t.operation){case"insert":e.splice(r,0,t.newValue);break;case"delete":if(!n())return null;e.splice(r,1);break;case"update":if(!n())return null;e.splice(r,1,t.newValue);break;default:return null}return t},LR=(e,t)=>{let r=e,n=new WeakSet,i=s=>{if(r===null||typeof r!="object")return r;n.has(r)||(r=Array.isArray(r)?[...r]:{...r},n.add(r));let a=r;for(let u of s){let c=a[u];if(c!==null&&typeof c=="object"){if(!n.has(c)){let l=Array.isArray(c)?[...c]:{...c};n.add(l),a[u]=l}a=a[u]}else a=c}return a},o=[];for(let s of t)try{let u=s.pathComponents.map(A5).slice(0,-1);if(gn(x5(r,u)))continue;let c=i(u);if(Array.isArray(c)){let l=R5(c,s);l&&o.push(l)}else if(c!==null&&typeof c=="object"){let l=C5(c,s);l&&o.push(l)}}catch{continue}return o};p();var N5=3e4,Tl=class{constructor(t){this.options=t}timer=null;subscriptionHandle=null;running=!1;isActive(){return this.timer!==null||this.subscriptionHandle!==null}start(){this.timer||this.subscriptionHandle||!this.options.subscriptionFactory||this.options.subscriptionFactory(this.options.sessionKey,this.options.getLastPatchExId(),()=>{this.run()}).then(t=>{this.subscriptionHandle=t}).catch(t=>{N.warn("Schema subscription failed; falling back to polling",t.message)}).finally(()=>{this.schedulePoll()})}dispose(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.subscriptionHandle?.unsubscribe(),this.subscriptionHandle=null}schedulePoll(){!this.options.subscriptionFactory||this.timer||(this.timer=setTimeout(()=>{this.timer=null,this.run().finally(()=>this.schedulePoll())},N5),this.timer.unref())}async run(){if(!this.running){this.running=!0;try{await this.options.refresh()}finally{this.running=!1}}}};p();var kR=(e,t)=>{let r=new WeakMap,n=s=>{let a=r.get(s);return a||(a=Array.isArray(s)?[...s]:{...s},r.set(s,a)),a},i=new WeakMap,o=n(e);for(let s of t){let a=(s?.pathComponents??[]).slice(0,-1),u=e,c=o;for(let l of a){let d=l.key??l.index??"",f=u[d];if(f===null||typeof f!="object")break;if(Array.isArray(f)){let h=i.get(f);h||(h=structuredClone(f),i.set(f,h)),c[d]=h;break}c[d]=n(f),u=f,c=c[d]}}return o};p();p();var D5=new Set(["WEB","WECHAT_MINI_PROGRAM","MOBILE"]),_o=e=>D5.has(e?.appType??""),MR=(e,t)=>{if(!t)return e;let r=t.model.view();return{...e,server:r?.server??null}},Il=e=>e?.pathComponents?.[0]?.key==="server",FR=e=>e?.pathComponents?.[0]?.key==="clients",qR=e=>e?.appType==="BACKEND_ONLY",jR=e=>typeof e=="string"&&e.length>0?e:null,jy=(e,t)=>{let r=e.serverDoc;if(r){let i=jR(r.schemaExId);return i?{ok:!0,appExId:null,schemaExId:i}:{ok:!1,error:"the backend app document has no schemaExId"}}if(e.serverDocRequired===!0)return{ok:!1,error:"this client app's server lives in the backend app's document, which did not load, so there is nothing to sync; retry, or run project sync-backend without appExId"};let n=jR(e.schemaExId);return n?{ok:!0,appExId:t,schemaExId:n}:{ok:!1,error:"the session has no schemaExId"}};p();var My=null,UR=async e=>(My??=e.request(a0).then(t=>(t.__type?.inputFields??[]).some(r=>r.name==="origin")).catch(()=>(My=null,!1)),await My?{origin:"MCP"}:{});p();function VR(e,t){let r=new Set;for(let n of e){let i=n&&typeof n=="object"?n.name:void 0;if(typeof i!="string")continue;let o=Rv[i];o!==void 0&&!t.includes(o)&&r.add(i)}return[...r]}function GR(e){return`${e.join(", ")} ${e.length===1?"is":"are"} not available to this project yet: the feature is still being rolled out and has not been opened to this account or project. Nothing was applied. Do not retry or work around it; tell the user it is not available to them yet.`}var Fy=300*1e3,L5=100,k5=50,j5="SCHEMA_COMMIT_VERSIONING",M5=["dataModel","types"];function F5(e){let t=e.server;if(!t||typeof t!="object"||Array.isArray(t))return e;let r={};for(let i of M5){let o=t[i];o!==void 0&&(r[i]=o)}let n={};return e.version!==void 0&&(n.version=e.version),n.server=r,n}function q5(e){if(typeof e!="string")return e;let t=e.trim();if(!/^[[{]|^(true|false|null|-?\d)/.test(t))return e;try{return JSON.parse(t)}catch{return e}}function KR(e){if(typeof e!="string")return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!="object")return null;let r={};for(let[n,i]of Object.entries(t))r[n]=q5(i);return r}function U5(e){let t=new Set;return e.map(r=>{if(!r||typeof r!="object")return r;let n=r,i=typeof n.toolCallId=="string"&&n.toolCallId?n.toolCallId:null;if(i!==null&&t.has(i))throw new Error(`Duplicate toolCallId: ${i}`);let o=i??So();return t.add(o),i===o?n:{...n,toolCallId:o}})}function V5(e,t){if(!e)return;let r=new Map(Object.entries(e)),n=t.map((i,o)=>{if(!r.has(i))throw new Error(`Missing ztype response for tool call ${o}`);let s=r.get(i);return r.delete(i),s});if(r.size>0)throw new Error(`Unexpected ztype responses: ${[...r.keys()].join(", ")}`);return n}function G5(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?Object.values(t).find(n=>typeof n=="string")??t:t):[]}function $5(e){let t=e??{},r=t.data??{},n={},i=KR(r.responseByToolCallId??t.responseByToolCallId);i&&Object.keys(i).length>0&&(n.responses=i);let o=r.schemaDiff??t.schemaDiff;o&&(n.schemaDiff=o);let s=G5(t.errors??r.errors);return s.length>0&&(n.errors=s),n}function B5(e){let t=e??{},r=t.data?.updatedReadState;if(r!=null)return r;if(typeof t.updatedReadStateJson=="string")try{return JSON.parse(t.updatedReadStateJson)}catch{return}}function K5(e){return(e??{}).data?.touchesComponents===!0}function H5(e,t){let r=e??{};if(r.isSuccess!==!1)return{};let n={},i=KR(r.readResponseByToolCallId);if(i&&(n.readResponses=t.map(o=>i[o]??null)),typeof r.readFailureByToolCallIdJson=="string"){let o=JSON.parse(r.readFailureByToolCallIdJson);n.readErrors=t.map(s=>o[s]??null)}return n}function Q5(e,t){let r=e??{};if(r.isSuccess!==!1)return{};let n={},i=typeof r.failedToolCallId=="string"?t.indexOf(r.failedToolCallId):-1;i>=0&&(n.failedIndex=i),typeof r.errorCode=="string"&&(n.errorCode=r.errorCode),r.failedBeforeExecution===!0&&(n.failedBeforeExecution=!0);let o=Array.isArray(r.detailKeys)?r.detailKeys:[],s=Array.isArray(r.detailValues)?r.detailValues:[];if(o.length>0&&o.length===s.length){let a={};o.forEach((u,c)=>{typeof u=="string"&&typeof s[c]=="string"&&(a[u]=s[c])}),Object.keys(a).length>0&&(n.errorDetails=a)}return n}async function W5(e){let r=(await _t())?.application?.schemaops?.SchemaOpsErrorCode?.DEPENDENCY_CONFLICT?.name,i=(e.diagnostics?.stableErrors??[]).map(o=>{let s=o??{};return[s.componentId,s.message].filter(a=>typeof a=="string"&&a!=="").join(": ")}).filter(o=>o!=="");return{applied:{applied:!1,reason:"ztype validation interrupted the batch"},errors:i.length>0?i:[e.message],...typeof r=="string"?{errorCode:r}:{},errorDetails:{dependents:i.join("; ")},ztypeDiagnostics:e.diagnostics}}function z5(e){return e?e.available===!1||(e.stableErrors?.length??0)>0||(e.betaErrors?.length??0)>0:!1}var $R=e=>e.activeCommit?.commitExId??null,BR=e=>e.filter(t=>!!t?.exId).at(-1)?.exId??null,pa=class e{constructor(t,r,n,i){this.client=t;this.sessionKey=r;this.onSchemaEvent=i;this.key=e.stringifyKey(r),this.watcher=new Tl({sessionKey:r,subscriptionFactory:n,getLastPatchExId:()=>this.lastPatchExId,refresh:()=>this.runWatchRefresh()})}crdtBinary=null;model=null;serverDoc=null;schemaGraph=null;extraContext=null;extraContextLoaded=!1;enabledProjectFeatureNames=[];appDetail=null;snapshot=null;schemaExId=null;commitExId=null;lastPatchExId=null;remotePatchCursor=null;appliedPatchExIds=new Set;staleReason="not loaded";lastError=null;lastZtypeDiagnostics=null;diagnosedFor=null;lastRevision=null;events=[];undoStack=[];redoStack=[];projectCapabilitiesCache;watcher;loadedAt=0;lastUsedAt=Date.now();mutex=new ml;key;static stringifyKey(t){return[t.projectExId,t.appExId??"",t.appVersionExId??""].join(":")}isExpired(t=Date.now()){return t-this.lastUsedAt>Fy}currentView(){if(!this.model)throw new Error("CRDT model not loaded");return MR(this.model.view(),this.serverDoc)}lastPatchExIds(){return[this.lastPatchExId,this.serverDoc?.lastPatchExId??null].filter(t=>typeof t=="string")}serverSchemaExId(){return _o(this.appDetail)?this.serverDoc?.schemaExId??null:this.schemaExId}status(){return{key:this.key,projectExId:this.sessionKey.projectExId,appExId:this.sessionKey.appExId??null,appVersionExId:this.sessionKey.appVersionExId??null,schemaExId:this.schemaExId,lastPatchExId:this.lastPatchExId,serverDocRequired:_o(this.appDetail),serverDoc:this.serverDoc?{schemaExId:this.serverDoc.schemaExId,lastPatchExId:this.serverDoc.lastPatchExId}:null,loadedAt:this.loadedAt?new Date(this.loadedAt).toISOString():null,lastUsedAt:new Date(this.lastUsedAt).toISOString(),staleReason:this.staleReason,lastError:this.lastError,schemaRevision:this.lastRevision,ztypeDiagnostics:this.lastZtypeDiagnostics,crdtBinaryBytes:this.crdtBinary?.byteLength??null,hasCrdtModel:this.model!==null,hasZtypeGraph:this.schemaGraph!==null,schemaEventCount:this.events.length,undoDepth:this.undoStack.length,redoDepth:this.redoStack.length,watcherActive:this.watcher.isActive()}}state(){return{...this.status(),latestEvent:this.events.at(-1)??null}}listEvents(t,r=100){if(!t)return this.events.slice(-r);let n=this.events.findIndex(i=>i.id===t);return(n>=0?this.events.slice(n+1):this.events).slice(-r)}async checkRemoteAndSync(){return this.mutex.run(async()=>this.withErrorState(async()=>this.checkRemoteAndSyncLocked("remote")))}async load(t=!1){return this.mutex.run(async()=>this.withErrorState(()=>this.loadLocked(t)))}async sync(){return this.mutex.run(async()=>this.withErrorState(async()=>{if(this.touch(),!this.schemaExId)return this.loadLocked();let t=await this.pullPatchesAfterRemoteCursorLocked();return t?(await this.syncServerDocLocked(),this.model&&(this.snapshot=this.currentView(),await this.resolveZtypeGraph(),await this.refreshZtypeDiagnostics()),this.lastPatchExId=t.remoteLastPatchExId,this.updateRevision(),this.status()):this.status()}))}getSnapshot(t=!1){if(this.touch(),this.model?.view&&(this.snapshot=this.currentView()),!this.snapshot)throw new Error("Project schema is not loaded");return t?this.snapshot:F5(this.snapshot)}dataModel(){let t=this.getSnapshot().server;return!t||typeof t!="object"?null:t.dataModel??null}async save(){return this.mutex.run(async()=>this.withErrorState(async()=>{this.touch();let t=await this.currentZtypeDiagnostics();return await this.saveOwnDocLocked(),this.serverDoc&&await this.saveServerDocLocked(this.serverDoc),this.updateRevision(),{...this.status(),ztypeDiagnostics:t}}))}async saveForDeploy(){return this.mutex.run(async()=>this.withErrorState(async()=>{this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked();let t=await this.currentZtypeDiagnostics(),r=await Dy(this.client)&&await this.schemaCommitVersioningOnLocked(),n=this.serverDoc,i=r||this.commitExId!==null,o=n!==null&&(r||n.commitExId!==null);if(i&&this.sessionKey.appVersionExId)throw new Error(`version history does not cover app versions: this session edits appVersionExId ${this.sessionKey.appVersionExId}, which takeSchemaCommit cannot address`);let s=i&&o?So():null,a={};return i?(this.commitExId=await this.takeDeployCommit(this.sessionKey.appExId??null,s),this.schemaExId&&(a[this.schemaExId]=this.commitExId)):await this.saveOwnDocLocked(),n&&o?(n.commitExId=await this.takeDeployCommit(null,s),a[n.schemaExId]=n.commitExId):n&&await this.saveServerDocLocked(n),this.updateRevision(),{...this.status(),commitExIds:a,ztypeDiagnostics:t}}))}async schemaCommitVersioningOnLocked(){return await this.getExtraContext(await _t()),this.enabledProjectFeatureNames.includes(j5)}async takeDeployCommit(t,r){let{takeSchemaCommit:n}=await this.client.request(m0,{projectExId:this.sessionKey.projectExId,appExId:t,groupId:r,fromDeploy:!0});if(!n)throw new Error(`takeSchemaCommit returned no version for ${t??"the project"} document`);return n}async saveOwnDocLocked(){let t=await this.client.request(ig,{projectExId:this.sessionKey.projectExId,appExId:this.sessionKey.appExId??null,versionExId:this.sessionKey.appVersionExId??null});t.saveSchema!==this.schemaExId&&(this.schemaExId=t.saveSchema,this.commitExId=null)}async saveServerDocLocked(t){let r=await this.client.request(ig,{projectExId:this.sessionKey.projectExId,appExId:null,versionExId:null});r.saveSchema!==t.schemaExId&&(t.schemaExId=r.saveSchema,t.commitExId=null)}async validate(){return this.mutex.run(async()=>this.withErrorState(async()=>(this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked(),this.currentZtypeDiagnostics())))}async fetchProjectCapabilities(){try{let r=(await this.client.request(S0,{projectExId:this.sessionKey.projectExId,appExId:this.sessionKey.appExId??null})).fetchAppDetailByExId;if(!r)return null;let n="project"in r?r.project:r,i={};for(let o of n.capabilities??[])!o?.capability||!o.limit||(i[o.capability]=o.limit.unlimited?{unlimited:!0}:{unlimited:!1,amount:o.limit.amount??0});return Object.keys(i).length===0?null:i}catch(t){return N.warn("Could not load project capabilities for the schemaops gate",t.message),null}}async resolveProjectCapabilities(){if(this.projectCapabilitiesCache!==void 0)return this.projectCapabilitiesCache;let t=await this.fetchProjectCapabilities();return t!==null&&(this.projectCapabilitiesCache=t),t}async ztypeToolCalls(t,r=!1,n=null,i=!1,o=null){return this.mutex.run(async()=>this.withErrorState(async()=>{if(this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked(),!this.schemaGraph)throw new Error("ztype runtime is unavailable; install @functorz/ztype in this package");let s=await _t(),a=s?.api;if(!a?.ZTypeCoreApi||!a?.ZTypeSchemaOpsApi)throw new Error("ztype SchemaOps API is unavailable");let u=o??await this.resolveProjectCapabilities(),c=u===null?this.schemaGraph:a.ZTypeCoreApi.withProjectCapabilities(this.schemaGraph,u),l=bl(s,c,this.appDetail,await this.getExtraContext(s)),d=VR(t,this.enabledProjectFeatureNames);if(d.length)throw new Error(GR(d));let f=U5(t),h=f.map(x=>x&&typeof x=="object"?x.toolCallId:void 0).filter(x=>typeof x=="string"),g=this.withProjectFeatures(a.ZTypeCoreApi,()=>a.ZTypeSchemaOpsApi.toolCalls(l,f,n??null)),v=$5(g),_=Q5(g,h),b=s?.application?.schemaops?.SchemaOpsErrorCode?.CAPABILITY_LIMITED?.name;b!==void 0&&_.errorCode===b&&(this.projectCapabilitiesCache=void 0);let S=v.schemaDiff,I=V5(v.responses,h),A={},T=B5(g);if(T!=null&&(A.updatedReadState=T),I&&(A.responses=I),v.errors&&(A.errors=v.errors,Object.assign(A,_,H5(g,h)),A.applied={applied:!1,reason:"batch rejected by ztype"}),S&&r&&(A.schemaDiff=S),S)try{A.applied=await this.applySchemaDiffLocked(S,{skipValidation:i}),K5(g)&&(A.touchesComponents=!0)}catch(x){if(!(x instanceof mn))throw x;let U=await W5(x);return Object.assign(A,U,{errors:[...Array.isArray(A.errors)?A.errors:[],...U.errors]}),A}return await this.attachValidationErrorIfAny(A),A}))}async attachValidationErrorIfAny(t){let r=await this.currentZtypeDiagnostics();z5(r)&&(t.ztypeDiagnostics=r)}async undo(){return this.mutex.run(async()=>this.withErrorState(async()=>{if(this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked(),this.undoStack.length===0)return{...this.status(),undone:!1,reason:"nothing to undo"};let t=this.undoStack[this.undoStack.length-1],r=t.dataSource.map(DR).reverse(),n=await this.applyReversibleLocked(r);return n?(this.undoStack.pop(),this.redoStack.push(t),{...n,undone:!0,undoDepth:this.undoStack.length,redoDepth:this.redoStack.length,reverted:t.semanticChanges??void 0,revertedPaths:ky(t.dataSource)}):{...this.status(),undone:!1,reason:"schema diverged since this change; undo no longer applies cleanly"}}))}async redo(){return this.mutex.run(async()=>this.withErrorState(async()=>{if(this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked(),this.redoStack.length===0)return{...this.status(),redone:!1,reason:"nothing to redo"};let t=this.redoStack[this.redoStack.length-1],r=await this.applyReversibleLocked(t.dataSource);return r?(this.redoStack.pop(),this.undoStack.push(t),{...r,redone:!0,undoDepth:this.undoStack.length,redoDepth:this.redoStack.length,reapplied:t.semanticChanges??void 0,reappliedPaths:ky(t.dataSource)}):{...this.status(),redone:!1,reason:"schema diverged since this change; redo no longer applies cleanly"}}))}async applyReversibleLocked(t){if(!this.model)throw new Error("CRDT model not loaded");let r=this.currentView(),n=LR(r,t);if(n.length!==t.length)return null;let i=n.filter(o=>!(o.__typename==="DiffItem"&&gn(o.oldValue)&&gn(o.newValue)));return i.length===0?null:this.applySchemaDiffLocked({id:So(),dataSource:i},{recordUndo:!1})}async recordUndoEntry(t,r,n){let i=await ca();if(!i?.generateDiff)return;let o=[];i.generateDiff({before:t,after:r,prefix:[],result:o}),o.length!==0&&(this.undoStack.push({id:So(),dataSource:structuredClone(o),semanticChanges:n}),this.undoStack.length>k5&&this.undoStack.shift(),this.redoStack=[])}async loadLocked(t=!1){if(this.touch(),this.model&&!t&&!this.staleReason)return this.status();let n=(await this.client.request(await Eo(this.client,$s),this.sessionKey)).fetchAppDetailByExId;if(!n)throw new Error(`Project not found: ${this.sessionKey.projectExId}`);let i=await this.fetchLatestSchemaPatchesAfter(this.sessionKey,null),o=by(i);if(!o?.crdtModelUrl||!i?.exId)throw new Error("Project has no uploaded CRDT schema");let s=await Ey(o.crdtModelUrl);return this.crdtBinary=s,this.appliedPatchExIds.clear(),this.lastPatchExId=null,this.remotePatchCursor=null,this.serverDoc=null,this.undoStack=[],this.redoStack=[],this.projectCapabilitiesCache=void 0,this.appDetail=n,await this.initializeRuntime(s,o.crdtPatches?.patches??[],n),this.schemaExId=i.exId,this.commitExId=o.commitExId,this.lastPatchExId=o.crdtPatches?.lastPatchExId??null,this.remotePatchCursor=this.lastPatchExId,this.loadedAt=Date.now(),this.model&&this.schemaGraph?this.staleReason=!this.serverDoc&&_o(n)?"backend app document unavailable":null:this.model&&!this.schemaGraph&&(this.staleReason="ztype runtime unavailable"),this.updateRevision(),this.watcher.start(),this.status()}async applySchemaDiffLocked(t,r={}){if(Array.isArray(t.dataSource)&&t.dataSource.length===0)return{...this.status(),applied:!1,reason:"empty schema diff"};if(!this.serverDoc&&_o(this.appDetail)&&(t.dataSource??[]).some(Il))throw new Error("This client app's server lives in the backend app's document, which is not loaded; refusing to write server changes into the client document. Run schema load again.");if(qR(this.appDetail)&&(t.dataSource??[]).some(FR))throw new Error("This session is on the project's own document, which holds the project's backend and no client, so pages and components written here would belong to nothing and never render. Pin the client they belong to with set_current_project (appExId), or pass appExId on this call; take it from `project metadata` -> apps[]. A project with no client app has nowhere to hold them at all.");let i=(r.recordUndo??process.env.MOMEN_MCP_UNDO!=="0")&&this.snapshot?kR(this.snapshot,t.dataSource??[]):null,o=this.currentRevision(),s=await _t(),a=s?.api?.ZTypeCoreApi,u=await ca();if(!a||!u?.executeCrdtNodeUpdateAndTransformDiff||!u.generateDiff)throw new Error("CRDT/ztype write runtime is unavailable");let c=bl(s,this.schemaGraph,this.appDetail,await this.getExtraContext(s)),l=this.withProjectFeatures(a,()=>a.batchUpdateSchemaGraph(c,[t]));if(l?.interruptErrors?.length>0){let g={available:!0,stableErrors:[...l.interruptErrors].map(gl),betaErrors:[]};if(r.skipValidation!==!0)throw new mn("ztype validation interrupted schema update",g)}if(!this.model)throw new Error("CRDT model not loaded");N.debug(`[Session] applying schemaDiff dataSource: ${JSON.stringify(t.dataSource).slice(0,4e3)}`);try{await this.uploadByDoc(u,t.dataSource??[],this.model)}catch(g){N.error(`[Session] CRDT apply/upload failed; reloading session to discard the diverged graph: ${g.message}`);let{undoStack:v,redoStack:_}=this;try{await this.loadLocked(!0),this.undoStack=v,this.redoStack=_}catch(b){N.error(`[Session] reload after the failed write failed too; unloading the session so the next command loads it again: ${b.message}`),this.model=null,this.snapshot=null,this.schemaGraph=null,this.schemaExId=null,this.diagnosedFor=null,this.staleReason="a write failed and the reload after it failed too"}throw g}this.schemaGraph=l.updatedGraph,this.snapshot=this.currentView();let d=await this.refreshZtypeDiagnostics(),f=this.updateRevision(),h=i&&o&&i.server!==this.snapshot.server?await Ny({version:i.version,server:i.server},{version:this.snapshot.version,server:this.snapshot.server}):null;return h&&Sl(h)&&o&&f&&this.appendSchemaEvent("local",o,f,h),i&&await this.recordUndoEntry(i,this.snapshot,h&&Sl(h)?h:null).catch(g=>N.warn(`[Session] the write landed but its undo entry could not be recorded: ${g.message}`)),{...this.status(),ztypeDiagnostics:d,backendErrorCount:_R(d),_schema:h&&Sl(h)?{change:h}:void 0}}async uploadByDoc(t,r,n){let i=this.serverDoc,o=i?r.filter(Il):[],s=i?r.filter(u=>!Il(u)):r,a=i&&o.length>0&&s.length>0?vR(i.model.view()):null;if(i&&o.length>0)for(let u of await this.uploadDocPatch(t,o,i.model,null,i.schemaExId))i.appliedPatchExIds.add(u.exId),i.lastPatchExId=u.exId;if(s.length!==0)try{for(let u of await this.uploadDocPatch(t,s,n,this.sessionKey.appExId??null,this.schemaExId))this.appliedPatchExIds.add(u.exId),this.lastPatchExId=u.exId}catch(u){if(i&&a){let c=[];t.generateDiff({before:i.model.view(),after:a,prefix:[],result:c}),c.length>0&&await this.uploadDocPatch(t,c,i.model,null,i.schemaExId).catch(l=>{throw new Error(`The server half of this change was saved to the backend app's document, but the client half failed (${u.message}) and reverting the server half failed too (${l.message}). Those server changes are live without their client counterparts: read the schema again before retrying, or the retry applies them a second time.`)})}throw u}}async uploadDocPatch(t,r,n,i,o){let s=t.executeCrdtNodeUpdateAndTransformDiff(r,n,this.snapshot,SR),a=So(),u=await UR(this.client);return(await this.client.request(u0,{projectExId:this.sessionKey.projectExId,appExId:i,schemaExId:o,patches:[{content:{id:a,dataSource:s.diffsFromCrdt},patchBase64:s.patchBase64,uuid:a,...u}]})).batchCreateSchemaCrdtPatch??[]}async checkRemoteAndSyncLocked(t){if(!this.model||!this.schemaExId||!this.snapshot)return await this.loadLocked(),null;let r=this.currentRevision();if(!r)return null;let n={version:this.snapshot.version,server:this.snapshot.server},o=(await this.client.request(await Eo(this.client,$s),this.sessionKey)).fetchAppDetailByExId,s=Sy(o);if(!s?.exId)return null;let a=await this.syncServerDocLocked();if(this.appDetail=o??this.appDetail,s.exId!==this.schemaExId||!s.crdtModelUrl)await this.loadLocked(!0);else{let l=await this.pullPatchesAfterRemoteCursorLocked();l&&((l.applied||a)&&this.model&&(this.snapshot=this.currentView(),await this.resolveZtypeGraph(),await this.refreshZtypeDiagnostics()),this.lastPatchExId=l.remoteLastPatchExId,this.updateRevision())}let u=this.currentRevision();if(!u||!CR(r,u))return null;let c=await Ny(n,{version:this.snapshot?.version,server:this.snapshot?.server});return this.appendSchemaEvent(t==="watch"?"remote":t,r,u,c),{type:"SCHEMA_STALE",message:"Project schema changed since this session last used it; session was refreshed before executing the command.",projectExId:this.sessionKey.projectExId,fromRevision:r,toRevision:u,semanticChanges:c,detectedAt:new Date().toISOString()}}currentRevision(){return this.lastRevision??this.updateRevision()}updateRevision(){return!this.snapshot&&!this.crdtBinary?(this.lastRevision=null,null):(this.lastRevision=xR({projectExId:this.sessionKey.projectExId,appExId:this.sessionKey.appExId??this.appDetail?.appExId??null,appVersionExId:this.sessionKey.appVersionExId??null,schemaExId:this.schemaExId,lastPatchExId:this.lastPatchExId,snapshot:this.snapshot??{binaryBytes:this.crdtBinary?.byteLength??null},deployedSchemaExId:yR(this.appDetail)}),this.lastRevision)}appendSchemaEvent(t,r,n,i){let o={id:So(),type:"SCHEMA_CHANGED",source:t,projectExId:this.sessionKey.projectExId,fromRevision:r,toRevision:n,semanticChanges:i,detectedAt:new Date().toISOString()};this.events.push(o),this.events=this.events.slice(-L5),this.onSchemaEvent?.(o)}async runWatchRefresh(){let t=this.lastUsedAt;try{await this.mutex.run(async()=>{await this.withErrorState(async()=>this.checkRemoteAndSyncLocked("watch"))})}catch(r){N.warn("Schema watch refresh failed",r.message)}finally{this.lastUsedAt=t}}dispose(){this.watcher.dispose()}async initializeRuntime(t,r,n){let i=await ca();if(!i?.initModelByBinary){this.model=null,this.snapshot={binaryBytes:t.length,patches:r},this.schemaGraph=null,this.diagnosedFor=null,this.appDetail=n,this.staleReason="CRDT runtime unavailable";return}this.model=i.initModelByBinary(t),await this.applyNetworkPatches(r),this.model&&(_o(n)&&(this.serverDoc=await this.loadServerDoc(i).catch(o=>{if(_l(o,"CLIENT_VERSION_TOO_OLD"))throw this.staleReason="backend app document unavailable",o;return N.warn("Backend app document unavailable; loading this client app's own document alone",o.message),null})),this.snapshot=this.currentView(),await this.resolveZtypeGraph(),await this.refreshZtypeDiagnostics())}async applyNetworkPatches(t){let r=t.filter(i=>!!(i?.exId&&!this.appliedPatchExIds.has(i.exId)));if(!this.model||r.length===0)return;let n=await _y();if(!n?.fromBinary)throw new Error("json-joy Patch runtime is unavailable");this.model.applyBatch(r.map(i=>n.fromBinary(Buffer.from(i.patchBase64,"base64"))));for(let i of r)this.appliedPatchExIds.add(i.exId),this.lastPatchExId=i.exId;this.snapshot=this.currentView()}async loadServerDoc(t){let r=await this.fetchLatestSchemaPatchesAfter({projectExId:this.sessionKey.projectExId},null),n=by(r);if(!n?.crdtModelUrl||!r?.exId||!t.initModelByBinary)throw new Error("Could not load the backend app's document this client app's server half lives in");let i={model:t.initModelByBinary(await Ey(n.crdtModelUrl)),schemaExId:r.exId,commitExId:n.commitExId,lastPatchExId:null,remotePatchCursor:null,appliedPatchExIds:new Set};return await this.applyServerPatches(i,n.crdtPatches?.patches??[]),i.lastPatchExId=n.crdtPatches?.lastPatchExId??i.lastPatchExId,i.remotePatchCursor=i.lastPatchExId,i}async applyServerPatches(t,r){let n=r.filter(o=>!!(o?.exId&&!t.appliedPatchExIds.has(o.exId)));if(n.length===0)return!1;let i=await _y();if(!i?.fromBinary)throw new Error("json-joy Patch runtime is unavailable");t.model.applyBatch(n.map(o=>i.fromBinary(Buffer.from(o.patchBase64,"base64"))));for(let o of n)t.appliedPatchExIds.add(o.exId),t.lastPatchExId=o.exId;return!0}async syncServerDocLocked(){let t=this.serverDoc;if(!t)return!1;let r=await this.fetchLatestSchemaPatchesAfter({projectExId:this.sessionKey.projectExId},t.remotePatchCursor);if(!r?.exId)return!1;if(r.exId!==t.schemaExId||$R(r)!==t.commitExId)return this.serverDoc=await this.loadServerDoc(await ca()),!0;let n=r.crdtPatches?.patches??[],i=await this.applyServerPatches(t,n);t.remotePatchCursor=BR(n)??t.remotePatchCursor;let o=r.crdtPatches?.lastPatchExId??null,s=i||o!==t.lastPatchExId;return t.lastPatchExId=o,s}async pullPatchesAfterRemoteCursorLocked(){let t=await this.fetchLatestSchemaPatchesAfter(this.sessionKey,this.remotePatchCursor);if(!t?.exId||!t.crdtModelUrl||t.exId!==this.schemaExId||$R(t)!==this.commitExId)return await this.loadLocked(!0),null;let r=t.crdtPatches?.patches??[],n=this.appliedPatchExIds.size;return await this.applyNetworkPatches(r),this.remotePatchCursor=BR(r)??this.remotePatchCursor,{applied:this.appliedPatchExIds.size>n,remoteLastPatchExId:t.crdtPatches?.lastPatchExId??null}}async fetchLatestSchemaPatchesAfter(t,r){let n=await this.client.request(await Eo(this.client,o0),{projectExId:t.projectExId,appExId:t.appExId??null,appVersionExId:t.appVersionExId??null,afterPatchExId:r});return Sy(n.fetchAppDetailByExId)}async resolveZtypeGraph(){let t=await _t(),r=t?.api;if(!r?.ZTypeCoreApi||!this.snapshot){this.schemaGraph=null,this.diagnosedFor=null,this.staleReason="ztype runtime unavailable";return}let n=r.ZTypeCoreApi.parseZSchemaFromJsObject(this.snapshot),i=await this.getExtraContext(t);this.schemaGraph=this.withProjectFeatures(r.ZTypeCoreApi,()=>r.ZTypeCoreApi.resolveZSchemaToSchemaGraph(n,i))}withProjectFeatures(t,r){return t.withEnabledFeatures(this.enabledProjectFeatureNames,r)}async getExtraContext(t){if(this.extraContextLoaded)return this.extraContext;this.extraContextLoaded=!0;try{let[r,n,i]=await Promise.all([mR(),this.client.request(b0).then(o=>o.supportedCustomModelDescriptor??null).catch(o=>(N.warn("extraContext: model descriptors unavailable",o.message),null)),this.client.request(ZA,{projectExId:this.sessionKey.projectExId}).then(o=>(o.features??[]).filter(s=>s.enabled).map(s=>s.featureName)).catch(o=>(N.warn("extraContext: project features unavailable; ztype runs with every feature off",o.message),[]))]);this.enabledProjectFeatureNames=i,this.extraContext=NR(t,r,n,mo(t))}catch(r){N.warn("extraContext build failed; resolving schema without it",r.message),this.extraContext=null}return this.extraContext}diagnosticsInputs(){return{graph:this.schemaGraph,target:`${this.appDetail?.appType??""}:${this.appDetail?.appExId??""}`,extraContext:this.extraContext,featureNames:this.enabledProjectFeatureNames}}async currentZtypeDiagnostics(){let t=this.diagnosedFor,r=this.diagnosticsInputs();return this.lastZtypeDiagnostics&&t&&Object.keys(r).every(n=>t[n]===r[n])?this.lastZtypeDiagnostics:this.refreshZtypeDiagnostics()}async refreshZtypeDiagnostics(){if(this.diagnosedFor=null,this.lastZtypeDiagnostics=null,!this.schemaGraph||!this.appDetail)return this.lastZtypeDiagnostics={available:!1,stableErrors:[],betaErrors:[],error:this.staleReason??"ztype schema graph is not loaded"},this.lastZtypeDiagnostics;let t=await _t(),r=t?.api;if(!r?.ZTypeCoreApi||!r?.ZTypeValidationApi)return this.lastZtypeDiagnostics={available:!1,stableErrors:[],betaErrors:[],error:"ztype validation API is unavailable"},this.lastZtypeDiagnostics;let n=bl(t,this.schemaGraph,this.appDetail,await this.getExtraContext(t)),i=this.withProjectFeatures(r.ZTypeCoreApi,()=>r.ZTypeValidationApi.validateSchemaGraph(n,PR(t,this.appDetail)));return this.lastZtypeDiagnostics={available:!0,stableErrors:[...i?.errors??i?.stableErrors??[]].map(gl),betaErrors:[...i?.warnings??i?.betaErrors??[]].map(gl)},this.diagnosedFor=this.diagnosticsInputs(),this.lastZtypeDiagnostics}touch(){this.lastUsedAt=Date.now()}async withErrorState(t){try{let r=await t();return this.lastError=null,r}catch(r){throw this.lastError=r instanceof Error?r.message:String(r),r}}};var wl=class{constructor(t,r){this.clientFactory=t;this.subscriptionFactory=r}sessions=new Map;emitter=new Y5;clear(){for(let t of this.sessions.values())t.dispose();this.sessions.clear()}sweep(){let t=Date.now();for(let[r,n]of this.sessions.entries())n.isExpired(t)&&(n.dispose(),this.sessions.delete(r))}status(){return this.sweep(),{projectSessionIdleTtlMs:Fy,sessions:[...this.sessions.values()].map(t=>t.status())}}async load(t,r=!1){return(await this.getSession(t)).load(r)}async sync(t){return(await this.getSession(t)).sync()}async snapshot(t,r=!1){return(await this.getSession(t)).getSnapshot(r)}async dataModel(t){return(await this.getSession(t)).dataModel()}async save(t){return(await this.getSession(t)).save()}async saveForDeploy(t){return(await this.getSession(t)).saveForDeploy()}async validate(t){return(await this.getSession(t)).validate()}async ztypeToolCalls(t,r,n=!1,i=null,o=!1,s=null){return(await this.getSession(t)).ztypeToolCalls(r,n,i,o,s)}async serverSchemaExId(t){let r=await this.getSession(t);return await r.load(!1),r.serverSchemaExId()}async lastPatchExIds(t){let r=await this.getSession(t);return await r.load(!1),await r.checkRemoteAndSync(),r.lastPatchExIds()}async undo(t){return(await this.getSession(t)).undo()}async redo(t){return(await this.getSession(t)).redo()}async checkRemoteAndSync(t){return(await this.getSession(t)).checkRemoteAndSync()}schemaState(t){this.sweep();let r=[...this.sessions.values()].filter(n=>!t||n.status().projectExId===t);return{projectExId:t??null,sessions:r.map(n=>n.state())}}schemaEvents(t,r,n=100){this.sweep();let i=[...this.sessions.values()].filter(o=>!t||o.status().projectExId===t);return{projectExId:t??null,events:i.flatMap(o=>o.listEvents(r,n))}}async getSession(t){this.sweep();let r=pa.stringifyKey(t),n=this.sessions.get(r);if(n)return n;let i=new pa(await this.clientFactory(),t,this.subscriptionFactory,o=>{this.emitter.emit("schemaChanged",o)});return this.sessions.set(r,i),i}};function nr(e,t){return{projectExId:e,appExId:t.appExId??null,appVersionExId:t.appVersionExId??null}}p();import{execSync as J5}from"node:child_process";import{createRequire as X5}from"node:module";import Z5 from"node:path";var Vy=1e5,e3=15e3,t3=3e4,HR=["--js-flags=--max-old-space-size=1024","--renderer-process-limit=1"],r3=5*6e4,n3=["chrome","msedge"],da=e=>Math.max(1,e-Date.now()),qy=(e,t)=>{let r;return Promise.race([e,new Promise((n,i)=>{r=setTimeout(()=>i(new Error(`The canvas did not answer within ${Vy/1e3}s.`)),da(t))})]).finally(()=>clearTimeout(r))},i3=async()=>{try{return await import("playwright")}catch{let e=J5("npm root -g",{stdio:"pipe"}).toString().trim();return X5(Z5.join(e,"noop.js"))("playwright")}},QR=e=>(e instanceof Error?e.message:String(e)).split(`
|
|
1368
|
+
`)[0]??"",o3=async e=>{if(Number(process.versions.node.split(".")[0])<20)throw new Error(`Rendering the canvas needs Node.js 20 or newer; this is Node ${process.versions.node}.`);let t=[];try{return await(await i3()).chromium.launch(e)}catch(n){t.push(`playwright: ${QR(n)}`)}let r=await import("playwright-core");for(let n of n3)try{return await r.chromium.launch({...e,channel:n})}catch(i){t.push(`${n}: ${QR(i)}`)}throw new Error(`No browser could be started to render the canvas. Install Google Chrome or Microsoft Edge and try again. (${t.join("; ")})`)},s3=async()=>({chromium:{launch:o3}}),Uy=class{constructor(t=s3,r=r3){this.playwright=t;this.idleCloseMs=r}browser=null;context=null;page=null;loadedFor=null;loadedWithPatches=new Set;queue=Promise.resolve();pending=0;idleTimer=null;run(t,r){this.pending+=1,this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null);let n=this.queue.then(()=>this.runNow(t,r).catch(async i=>{throw await this.discard(this.page),i}));return this.queue=n.catch(()=>{}).finally(()=>{this.pending-=1,this.pending===0&&r.rpc==="CAPTURE"&&this.scheduleIdleClose()}),n}scheduleIdleClose(){this.idleTimer=setTimeout(()=>{this.idleTimer=null,this.queue=this.queue.then(()=>this.close())},this.idleCloseMs),this.idleTimer.unref?.()}async discard(t){t&&(this.page===t&&(this.page=null,this.loadedFor=null),await t.close().catch(()=>{}))}async close(){await this.browser?.close().catch(()=>{}),this.browser=null,this.context=null,this.page=null,this.loadedFor=null}async runNow(t,r){let n=await this.pageFor(t,r);if(!await qy(n.evaluate(()=>globalThis.__ZION_AGENT_CANVAS__.isInSync()),r.deadline).catch(()=>!1))n=await this.load(t,r);else for(let o of r.lastPatchExIds)if(!this.loadedWithPatches.has(o)&&!await this.waitForPatch(n,o,r.deadline)){n=await this.load(t,r);break}return r.pageId&&(await qy(n.evaluate(({pageId:o,breakpoint:s})=>globalThis.__ZION_AGENT_CANVAS__.focus(o,s),{pageId:r.pageId,breakpoint:r.breakpoint}),r.deadline),await n.waitForFunction(({pageId:o,breakpoint:s})=>globalThis.__ZION_AGENT_CANVAS__.isFocused(o,s),{pageId:r.pageId,breakpoint:r.breakpoint},{timeout:Math.min(t3,da(r.deadline))})),qy(n.evaluate(({rpc:o,args:s,sessionExId:a})=>{let u=globalThis.__ZION_AGENT_CANVAS__;if(o!=="CAPTURE")return u.dispatch(o,s,a);if(!u.capture)throw new Error("Canvas capture is not available on this deployment yet.");return u.capture(s)},{rpc:r.rpc,args:r.args,sessionExId:r.sessionExId}),r.deadline)}async pageFor(t,r){let n=`${t.projectExId}/${t.appExId}`;return this.page&&!this.page.isClosed()&&this.browser?.isConnected()&&this.loadedFor===n?this.page:this.load(t,r)}async waitForPatch(t,r,n){try{return await t.waitForFunction(i=>globalThis.__ZION_AGENT_CANVAS__.hasAppliedPatch(i),r,{timeout:Math.min(e3,da(n))}),!0}catch{return!1}}async load(t,r){let n=Nt().editorBaseUrl;if(!this.browser?.isConnected()||!this.context){await this.close();let{chromium:s}=await this.playwright(),a=process.env.EDITOR_HOST_RESOLVER_RULES;this.browser=await s.launch({headless:!0,args:a?[...HR,`--host-resolver-rules=${a}`]:HR}),this.context=await this.browser.newContext({viewport:{width:1280,height:800}})}if(await this.context.addCookies([{name:"loggedInUserStorageKey",value:encodeURIComponent(JSON.stringify({exId:t.user.exId,username:t.user.username,token:t.token,roleNames:[],registeredWithInLastMinute:!1})),url:n}]),!this.page||this.page.isClosed()){let s=await this.context.newPage();s.on("crash",()=>void this.discard(s)),this.page=s}let i=this.page,o=new URLSearchParams({mode:"AGENT_CANVAS",leftSideTab:"page"});return r.pageId&&o.set("componentId",r.pageId),r.breakpoint&&o.set("breakpoint",r.breakpoint),this.loadedWithPatches=new Set(r.lastPatchExIds),this.loadedFor=null,await i.goto(`${n}/multi-client/tool/${t.projectExId}/${t.appExId}/design?${o}`,{waitUntil:"domcontentloaded",timeout:da(r.deadline)}),await i.waitForFunction(()=>!!globalThis.__ZION_AGENT_CANVAS__&&!!globalThis.document.querySelector("#canvas-viewport [data-meta-id]"),void 0,{timeout:da(r.deadline)}),this.loadedFor=`${t.projectExId}/${t.appExId}`,i}},Ol=new Uy;p();var WR=e=>e??{},K=e=>typeof e=="string"&&e.length>0?e:void 0,pe=e=>typeof e=="string"&&e.length>0?e:null,$e=(e,t=!1)=>typeof e=="boolean"?e:t,Ue=(e,t)=>typeof e=="number"&&Number.isFinite(e)?e:t,ii=e=>Array.isArray(e)&&e.every(t=>typeof t=="string")?e:void 0,oe=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},oi=(e,t)=>{let r=K(e);if(!r)throw new Error(`${t} is required`);return r},Rt=(e,t)=>{if(!t)return e;if(e&&typeof e=="object"&&!Array.isArray(e)){let r=e,n=oe(r._schema);return{...r,_schema:{...n,warning:t}}}return{result:e,_schema:{warning:t}}},a3=e=>new Promise(t=>{setTimeout(t,e)}),Al=e=>{let t=e?.name;if(typeof t!="string"||t.length===0)return null;let r=typeof e?.type=="string"?e.type:"";return/IMAGE|VIDEO|FILE/.test(r)?r.includes("LIST")?`${t}_ids`:`${t}_id`:t},zR=(e,t)=>{let n=e?.tableMetadata?.find(i=>i?.name===t)?.columnMetadata?.map(i=>Al(i))?.filter(i=>i!==null);return n?.length?n.slice(0,20):["id"]},u3=/token|secret|password|privatekey|merchantkey|mchkey|apikey/i,Gy=e=>{if(Array.isArray(e))return e.map(Gy);if(!e||typeof e!="object")return e;let t={};for(let[r,n]of Object.entries(e))t[r]=u3.test(r)?"<redacted>":Gy(n);return t},$y=(e,t)=>$e(t.includeSecrets,!1)?e:Gy(e),By=async(e,t,r)=>{let n={projectExId:K(t.projectExId),appExId:pe(t.appExId),appVersionExId:pe(t.appVersionExId)},i="appExId"in t,o=await AR(e,n,r);if(!i){let s=await e.loadProjectContext();n.appExId=s?.projectExId===o?s.appExId??null:null}if(n.appExId!==null&&n.appExId===o)throw new Error(`appExId was given the project exId (${o}). appExId names a client app inside the project, never the project itself: pass appExId: null to address the project's own document (its backend alone), or take an app exId from \`project metadata\` -> apps[] whose appExId is non-null.`);return{...n,projectExId:o}},YR=async(e,t)=>{let r=K(t.organizationExId),n=K(t.projectSpaceType);if(r&&n)return{organizationExId:r,projectSpaceType:n};let o=(await e.request(Uc))?.user,s=o?.currentOrganization??o?.organization??o?.organizations?.[0]??o?.joinedOrganizations?.[0];if(!s?.exId)throw new Error("No default organization found; pass organizationExId and projectSpaceType");return{organizationExId:r??s.exId,projectSpaceType:n??"PERSONAL"}},c3=async(e,t)=>((await e.request(qc,{projectName:t,paginator:{first:20}}))?.fuzzySearchProjectName?.edges??[]).find(o=>o?.node?.projectName===t)?.node??null,JR=async(e,t,r)=>{let n=Date.now()+r;for(;Date.now()<n;){let i=await c3(e,t);if(i)return i;await a3(2e3)}return null},XR=(e,t,r,n=!0)=>{if(K(t.confirmProjectExId)!==e&&!(n&&$e(t.force,!1)))throw new Error(`${r} is destructive; pass confirmProjectExId=${e}`+(n?" or force=true":""))},l3=e=>e.replace(/\/api\/graphql-v2(\/?)$/,"/api/graphql-admin$1"),yn=async(e,t)=>{let n=(await e.request(i0,{projectExId:t.projectExId,appVersionExId:t.appVersionExId}))?.fetchAppDetailByExIdWithoutReconcile,i=n?.__typename==="Project"?n:null;if(!i?.adminToken)throw new Error(`Runtime commands need the project admin token, which only project editors get; none was returned for project ${t.projectExId}`);let o=i.zeroUrl??Nt().zeroApiUrlTemplate.replace("{projectExId}",t.projectExId),s={authorization:`Bearer ${i.adminToken}`};return{adminToken:i.adminToken,zeroUrl:o,adminSubscriptionUrl:i.adminZeroSubscriptionUrl,dataClient:new Ze(o,{headers:s,fetch:vo}),adminClient:new Ze(i.adminZeroUrl??l3(o),{headers:s,fetch:vo})}};p();p();import{promises as p3}from"fs";import d3 from"path";var f3=async(e,t)=>{let r=K(e.cwd);if(!r)throw new Error("cwd is required");let n=d3.resolve(r);if(!(await p3.stat(n)).isDirectory())throw new Error(`Path is not a directory: ${n}`);return t.credentialStore.setWorkspaceRoot(n),t.schemaManager.clear(),t.ok({cwd:n},`Current working directory set to ${n}`)},ZR={"workspace.set":f3};p();var sN=je(Go(),1);p();import{createServer as eN}from"http";import h3 from"open";var fa=class{config;constructor(t){this.config=t}async findAvailablePort(t){let r=t||this.config.callbackPort||8088;return new Promise((n,i)=>{let o=eN();o.on("error",s=>{s.code==="EADDRINUSE"?n(this.findAvailablePort(r+1)):i(s)}),o.listen(r,()=>{let s=o.address(),a=typeof s=="object"&&s!==null?s.port:r;o.close(()=>n(a))})})}async authenticate(){let t=await this.findAvailablePort(),r=`http://localhost:${t}/callback`;N.info(`[JwtAuth] Using callback URL: ${r}`),N.info("[JwtAuth] Opening browser for authentication...");let n=await new Promise((i,o)=>{let s=null,a=!1,u=eN(async(c,l)=>{if(!c.url)return;let d=new URL(c.url,`http://localhost:${t}`);if(d.pathname==="/callback"){N.info(`[JwtAuth] Callback received: ${c.url}`);let f=d.searchParams.get("token");if(!f||f.trim()===""){N.info("[JwtAuth] No token parameter found in callback URL"),N.info("[JwtAuth] Available parameters:",Array.from(d.searchParams.keys()).join(", "));let g=this.errorPage("No authentication token received");l.writeHead(400,{"Content-Type":"text/html"}),l.end(g),a||(a=!0,s&&clearTimeout(s),u.close(),o(new Error("No token parameter in callback")));return}N.info(`[JwtAuth] Token received (length: ${f.length} chars)`);let h=this.successPage();l.writeHead(200,{"Content-Type":"text/html"}),l.end(h),setTimeout(()=>{a||(a=!0,s&&clearTimeout(s),u.close(),i(f))},1e3)}});u.on("error",c=>{a||(a=!0,s&&clearTimeout(s),o(c))}),u.listen(t,async()=>{let c=new URL(this.config.authEndpoint);c.searchParams.set("redirect_uri",r),N.info(`[JwtAuth] Opening: ${c.toString()}`);try{await h3(c.toString())}catch{N.info("[JwtAuth] Could not open browser automatically"),N.info("[JwtAuth] Please open this URL manually:"),N.info(c.toString())}}),s=setTimeout(()=>{a||(a=!0,u.close(),o(new Error("Authentication timeout - no response after 5 minutes")))},3e5)});return N.info("[JwtAuth] JWT token received successfully"),{access_token:n,token_type:"Bearer"}}renderPage(t){let r=t.autoClose?`
|
|
1323
1369
|
<script>
|
|
1324
1370
|
setTimeout(() => {
|
|
1325
1371
|
window.close();
|
|
@@ -1372,55 +1418,55 @@ ${String(e)}`)}catch(t){return t}},NA=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1372
1418
|
<p style="margin-top: 1rem; font-size: 0.9em; opacity: 0.8;">${t.footer}</p>
|
|
1373
1419
|
</div>${r}
|
|
1374
1420
|
</body>
|
|
1375
|
-
</html>`}successPage(){return this.renderPage({title:"Token Received",gradient:"#667eea 0%, #764ba2 100%",headingColor:"#333",icon:"\u2713",heading:"Token Received",body:"MCP server authenticated successfully.",footer:"You can close this window.",autoClose:!0})}errorPage(t){return this.renderPage({title:"Authentication Error",gradient:"#f093fb 0%, #f5576c 100%",headingColor:"#d93025",icon:"\u26A0\uFE0F",heading:"Authentication Error",body:t,footer:"Please try again."})}};p();var We=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},ha=e=>Array.isArray(e)?e:[];function
|
|
1421
|
+
</html>`}successPage(){return this.renderPage({title:"Token Received",gradient:"#667eea 0%, #764ba2 100%",headingColor:"#333",icon:"\u2713",heading:"Token Received",body:"MCP server authenticated successfully.",footer:"You can close this window.",autoClose:!0})}errorPage(t){return this.renderPage({title:"Authentication Error",gradient:"#f093fb 0%, #f5576c 100%",headingColor:"#d93025",icon:"\u26A0\uFE0F",heading:"Authentication Error",body:t,footer:"Please try again."})}};p();var We=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},ha=e=>Array.isArray(e)?e:[];function tN(e){let t={};for(let r of ha(e)){let n=We(r),i=n.capability;if(typeof i!="string")continue;let o=We(n.limit);t[i]=o.unlimited?"unlimited":o.amount??0}return t}function xl(e,t){if(Array.isArray(e))return e.map(r=>xl(r,t));if(e&&typeof e=="object"){let r={};for(let[n,i]of Object.entries(e))t.has(n)||(r[n]=xl(i,t));return r}return e}var rN=new Set(["crdtPatches","crdtModelUrl","latestDeployedServerSchema","additional"]);function nN(e){let t=We(e),r=We(t.fetchAppDetailByExId),n=We(r.project),i=v=>r[v]??n[v],o=We(i("projectConfig")),s=We(r.config).customDomain??We(o.webConfig).customDomain??i("webFreeProdDomain")??null,a=r.__typename==="Project",u=i("lastDeployedServerSchemaExId")??null,c=We(r.lastUploadedSchema).exId??null,l=a?{deployedSchemaExId:u,uploadedSchemaExId:c,hasUndeployedChanges:c!=null&&c!==u,deploymentEnvs:ha(i("deploymentEnvConfigs")).map(v=>We(v).userDeploymentEnvironment).filter(v=>v!=null)}:{},d=ha(i("appList")).map(v=>{let _=We(v);return{appExId:_.appExId,appType:_.appType,name:_.name,published:_.hasPublished??!1,expired:_.isExpired??!1}}),f=We(i("projectPlan")),h=We(We(t.project).rpsStatsInLast30Days),g={projectExId:r.projectExId??n.exId??null,projectName:i("projectName")??null,appType:r.appType??null,supportedPlatforms:o.supportedPlatforms??null,createdAt:i("createdAt")??null,updatedAt:i("updatedAt")??null,published:i("hasPublished")??!1,expired:i("isExpired")??!1,webDomain:s,...l,integrations:{stripe:o.stripePayConfig!=null,alipay:o.aliPayConfig!=null,wechatPay:o.wechatPayConfig!=null,wechatApp:o.wechatAppConfig!=null,sms:o.aliyunSmsConfig!=null,email:o.emailConfig!=null},plan:{type:f.projectPlanType??null,expireAt:f.expireAt??null,highestPurchased:i("highestPurchasedProjectPlanType")??null},capabilities:tN(i("capabilities")),rpsLast30Days:{exceededDays:h.exceededNumOfDays??0,exceededTotal:h.exceededTotal??0}};return d.length>0&&(g.apps=d),g}function iN(e){let t=We(e),r={};for(let n of ha(t.projectResourceUsageInfo)){let i=We(n),o=i.resourceType;typeof o=="string"&&(r[o]={used:i.usedAmount??0,available:i.availableAmountWithNoExhaustionBurst??null,status:i.resourceUsageStatus??null,unlimited:i.unlimited??!1})}return{resources:r,unitComputingPower:t.unitComputingPower??null,visitTimesSupportedByComputingPower:t.visitTimesSupportedByComputingPower??null}}function oN(e){let t=We(We(e).user),r=ha(t.joinedOrganizations).map(n=>{let i=We(n);return{exId:i.exId,displayName:i.displayName,ownerName:i.ownerName,planType:i.planType,planExpireAt:i.planExpireAt,permissionEnabled:i.permissionEnabled,permissionRoleLimit:i.permissionRoleLimit,capabilities:tN(i.capabilities)}});return{exId:t.exId,email:t.email,phoneNumber:t.phoneNumber,username:t.username,displayName:t.displayName,availableTechnicalSupportHours:t.availableTechnicalSupportHours,daysSinceRegistration:t.daysSinceRegistration,involvedProjectCount:t.involvedProjectCount,organizations:r}}async function Ky(e){let t=await e.loadCredentials();if(!t)return null;let r=sN.default.decode(t.access_token),n=r&&typeof r=="object"?r:null;return{tokenType:t.token_type,savedAt:t.savedAt,jwt:n?{sub:n.sub,roles:n.roles,iat:n.iat,exp:n.exp}:r}}var m3=async(e,t)=>{let r=await yr(t.credentialStore),n=await new fa(r).authenticate();return await t.credentialStore.saveCredentials(n),t.ok(await Ky(t.credentialStore),"Authenticated")},g3=async(e,t)=>{await t.credentialStore.deleteCredentials();let r=await yr(t.credentialStore),n=await new fa(r).authenticate();return await t.credentialStore.saveCredentials(n),t.ok(await Ky(t.credentialStore),"Authenticated")},y3=async(e,t)=>(await t.credentialStore.deleteCredentials(),await t.credentialStore.deleteProjectContext(),t.schemaManager.clear(),t.ok(void 0,"Logged out")),v3=async(e,t)=>{let r=await Ky(t.credentialStore);return r?t.ok(r):t.fail(new Error(Oa))},E3=async(e,t)=>t.ok(oN(await t.client.request(JA))),aN={"auth.login":m3,"auth.reauth":g3,"auth.logout":y3,"auth.whoami":v3,"account.profile":E3};p();p();import{spawn as _3}from"child_process";var uN=18e4,Rl=Math.floor(uN/1e3),S3=uN+5e3,cN=()=>(process.env.MCP_HITL??"").trim().toLowerCase()==="off";function vn(e,t){return new Promise(r=>{let n="",i="",o=!1,s=_3(e,t,{stdio:["ignore","pipe","pipe"]}),a=setTimeout(()=>{o||(s.kill("SIGKILL"),o=!0,r({code:null,stdout:n,stderr:i,timedOut:!0}))},S3);a.unref(),s.stdout?.on("data",u=>{n+=u.toString()}),s.stderr?.on("data",u=>{i+=u.toString()}),s.on("error",u=>{o||(o=!0,clearTimeout(a),r({code:null,stdout:n,stderr:i,spawnError:u}))}),s.on("close",u=>{o||(o=!0,clearTimeout(a),r({code:u,stdout:n,stderr:i}))})})}async function b3(e,t){let n=["on run argv","set pid to item 1 of argv","set verb to item 2 of argv",'set msg to "This will " & verb & " project " & pid & "." & return & "This action is IRREVERSIBLE." & return & return & "Type the project id to confirm:"',"try",`set dlg to display dialog msg with title "Human approval required" default answer "" buttons {"Cancel", "Confirm"} default button "Cancel" cancel button "Cancel" with icon caution giving up after ${Rl}`,"on error number -128",'return "__CANCELLED__"',"end try",'if (gave up of dlg) then return "__CANCELLED__"',"return text returned of dlg","end run"].flatMap(s=>["-e",s]);n.push(e,t);let i=await vn("osascript",n);if(i.spawnError)return"unavailable";if(i.timedOut)return"denied";if(i.code!==0)return"unavailable";let o=i.stdout.trim();return o==="__CANCELLED__"?"denied":o===e?"approved":"denied"}async function T3(e,t){if(!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY)return"unavailable";let r=`This will ${t} project ${e}.
|
|
1376
1422
|
This action is IRREVERSIBLE.
|
|
1377
1423
|
|
|
1378
|
-
Type the project id to confirm:`,n=await vn("zenity",["--entry","--title=Human approval required",`--text=${r}`,`--timeout=${Rl}`]);if(!n.spawnError)return n.timedOut?"denied":n.code===0&&n.stdout.trim()===e?"approved":"denied";let i=await vn("kdialog",["--title","Human approval required","--inputbox",r,""]);return i.spawnError?"unavailable":i.timedOut?"denied":i.code===0&&i.stdout.trim()===e?"approved":"denied"}async function
|
|
1424
|
+
Type the project id to confirm:`,n=await vn("zenity",["--entry","--title=Human approval required",`--text=${r}`,`--timeout=${Rl}`]);if(!n.spawnError)return n.timedOut?"denied":n.code===0&&n.stdout.trim()===e?"approved":"denied";let i=await vn("kdialog",["--title","Human approval required","--inputbox",r,""]);return i.spawnError?"unavailable":i.timedOut?"denied":i.code===0&&i.stdout.trim()===e?"approved":"denied"}async function I3(e,t){let r=`This will ${t} project ${e}. This action is IRREVERSIBLE.
|
|
1379
1425
|
|
|
1380
|
-
Type the project id to confirm:`,i=`Add-Type -AssemblyName Microsoft.VisualBasic;$r=[Microsoft.VisualBasic.Interaction]::InputBox('${(s=>s.replace(/'/g,"''"))(r)}','Human approval required','');Write-Output $r`,o=await vn("powershell",["-NoProfile","-NonInteractive","-Command",i]);return o.spawnError?"unavailable":o.timedOut?"denied":o.code!==0?"unavailable":o.stdout.trim()===e?"approved":"denied"}async function b3(e,t){switch(process.platform){case"darwin":return v3(e,t);case"linux":return E3(e,t);case"win32":return _3(e,t);default:return"unavailable"}}async function ma(e,t,r,n={}){if(oN()){WR(e,t,r,n.allowForce??!0);return}let i=await b3(e,r);if(i==="approved"){np("notice",`Human approved ${r} of project ${e}`);return}throw i==="unavailable"?new Error(`${r} requires human approval via a GUI dialog, but no dialog could be shown on this host (headless/SSH/CI). Set MCP_HITL=off to bypass with the confirmProjectExId/force text gate.`):new Error(`${r} was not approved: the confirmation dialog was cancelled or the project id was not entered correctly.`)}var Cl=e=>e.replace(/\r?\n$/,"");async function S3(e){let r=["on run argv","set lbl to item 1 of argv",'set msg to "Enter the value for secret " & quote & lbl & quote & ":"',"try",`set dlg to display dialog msg with title "Set secret value" default answer "" with hidden answer buttons {"Cancel", "Save"} default button "Save" cancel button "Cancel" with icon note giving up after ${Rl}`,"on error number -128",'return "__CANCELLED__"',"end try",'if (gave up of dlg) then return "__CANCELLED__"',"return text returned of dlg","end run"].flatMap(o=>["-e",o]);r.push(e);let n=await vn("osascript",r);if(n.spawnError||n.code!==0)return{ok:!1,reason:"unavailable"};if(n.timedOut)return{ok:!1,reason:"cancelled"};let i=Cl(n.stdout);return i==="__CANCELLED__"?{ok:!1,reason:"cancelled"}:{ok:!0,value:i}}async function T3(e){if(!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY)return{ok:!1,reason:"unavailable"};let t=`Enter the value for secret "${e}":`,r=await vn("zenity",["--entry","--hide-text","--title=Set secret value",`--text=${t}`,`--timeout=${Rl}`]);if(!r.spawnError)return r.timedOut?{ok:!1,reason:"cancelled"}:r.code===0?{ok:!0,value:Cl(r.stdout)}:{ok:!1,reason:"cancelled"};let n=await vn("kdialog",["--title","Set secret value","--password",t]);return n.spawnError?{ok:!1,reason:"unavailable"}:n.timedOut?{ok:!1,reason:"cancelled"}:n.code===0?{ok:!0,value:Cl(n.stdout)}:{ok:!1,reason:"cancelled"}}async function I3(e){let t=s=>s.replace(/'/g,"''"),r=`Enter the value for secret "${e}":`,n=["Add-Type -AssemblyName System.Windows.Forms;","Add-Type -AssemblyName System.Drawing;","$f=New-Object System.Windows.Forms.Form;$f.Text='Set secret value';$f.Width=440;$f.Height=180;$f.StartPosition='CenterScreen';$f.TopMost=$true;",`$l=New-Object System.Windows.Forms.Label;$l.Text='${t(r)}';$l.AutoSize=$true;$l.Top=15;$l.Left=15;$f.Controls.Add($l);`,"$t=New-Object System.Windows.Forms.TextBox;$t.UseSystemPasswordChar=$true;$t.Width=400;$t.Top=45;$t.Left=15;$f.Controls.Add($t);","$ok=New-Object System.Windows.Forms.Button;$ok.Text='Save';$ok.Top=90;$ok.Left=235;$ok.DialogResult=[System.Windows.Forms.DialogResult]::OK;$f.Controls.Add($ok);$f.AcceptButton=$ok;","$cn=New-Object System.Windows.Forms.Button;$cn.Text='Cancel';$cn.Top=90;$cn.Left=325;$cn.DialogResult=[System.Windows.Forms.DialogResult]::Cancel;$f.Controls.Add($cn);$f.CancelButton=$cn;",'$r=$f.ShowDialog();if($r -eq [System.Windows.Forms.DialogResult]::OK){Write-Output $t.Text}else{Write-Output "__CANCELLED__"}'].join(""),i=await vn("powershell",["-NoProfile","-NonInteractive","-STA","-Command",n]);if(i.spawnError||i.code!==0)return{ok:!1,reason:"unavailable"};if(i.timedOut)return{ok:!1,reason:"cancelled"};let o=Cl(i.stdout);return o==="__CANCELLED__"?{ok:!1,reason:"cancelled"}:{ok:!0,value:o}}async function sN(e){if(oN())throw new Error("Setting a secret value needs a native GUI dialog so the value stays off the tool call, but MCP_HITL=off. Run without MCP_HITL=off on a machine with a desktop session.");let t;switch(process.platform){case"darwin":t=await S3(e);break;case"linux":t=await T3(e);break;case"win32":t=await I3(e);break;default:t={ok:!1,reason:"unavailable"}}if(t.ok){if(!t.value)throw new Error("No secret value was entered.");return np("notice",`Human entered a value for secret "${e}"`),t.value}throw t.reason==="unavailable"?new Error("Setting a secret value requires a native GUI dialog, but none could be shown on this host (headless/SSH/CI)."):new Error("Setting the secret value was cancelled.")}var aN=async(e,t)=>{let n=(await t.client.request(qc,{projectName:K(e.projectName)??"",paginator:{after:pe(e.cursor),first:Ue(e.limit,20)}})).fuzzySearchProjectName,i=(n?.edges??[]).map(a=>a?.node).filter(a=>a!=null).map(a=>({exId:a.exId,projectName:a.projectName,updatedAt:a.updatedAt,hasPublished:a.hasPublished,webProdDomain:a.webProdDomain})),o=n?.pageInfo,s=o?.hasNextPage?o.endCursor?.value??null:null;return t.ok({projects:i,nextCursor:s})},uN=()=>Tn==="ZION",w3=["WEB","WECHAT_MINI_PROGRAM","MOBILE","BACKEND_ONLY"],O3={WEB:"Web",WECHAT_MINI_PROGRAM:"WeChat mini program",MOBILE:"App"},A3="WEB, WECHAT_MINI_PROGRAM and MOBILE each create a client this project hosts \u2014 build its pages as component trees with these tools, or deploy your own build to a WEB client; BACKEND_ONLY creates no client, for a front end hosted elsewhere that calls the project's auto-generated GraphQL API",x3=e=>{let t=K(e.appType);if(t==="WECHAT_MINI_PROGRAM"&&!uN())throw new Error("appType WECHAT_MINI_PROGRAM is a Zion-only client type and cannot be created here");let r=w3.filter(n=>n!=="WECHAT_MINI_PROGRAM"||uN());if(!t||!r.some(n=>n===t))throw new Error(`appType is required and must be one of ${r.join(", ")} \u2014 ${A3}.`);return t},C3=(e,t)=>({appName:K(e.appName)??O3[t],appType:t,source:{type:"BLANK"}}),R3=async(e,t)=>{let r=K(e.projectName)??K(e.name);if(!r)throw new Error("projectName is required");let n=x3(e),i=await HR(t.client,e),s=(await t.client.request(JA,{createProjectDetail:{explicitBuiltInClientApp:!0,projectName:r,organizationExId:i.organizationExId,projectSpaceType:i.projectSpaceType,category:pe(e.category),source:{type:"BLANK"},...n!=="BACKEND_ONLY"&&{builtInClientApp:C3(e,n)}}})).createMultiClientProjectAsync;if(!s)throw new Error("Project creation failed: taskId is missing");let u=$e(e.wait,!0)?await QR(t.client,r,Ue(e.timeoutMs,12e4)):null,c=null;if(u?.exId){let l=String(u.exId);n!=="BACKEND_ONLY"&&(c=(await ni(t.client,l))[0]??null),await t.credentialStore.saveProjectContext(l,c?.appExId??null),await Cy(t.client,l,t.codingAgent,t.hostSessionId)}return t.ok({taskId:s,project:u,builtInApp:c,projectSpace:i})},N3=async(e,t)=>{let r=K(e.projectExId);if(!r)throw new Error("projectExId is required");let n=K(e.appExId),i=e.appExId===null,o=n||i?[]:await ni(t.client,r);if(o.length>1)throw new Error(`Project ${r} has ${o.length} client apps, so the current client cannot be resolved: ${o.map(a=>`${a.appExId} (${a.appType})`).join(", ")}. Pages and components belong to one client, so call this again with appExId set to the one to work on, or with appExId: null to address the project's backend document alone. The current project is left as it was.`);let s=n??yo(o);return await t.credentialStore.saveProjectContext(r,s),await Cy(t.client,r,t.codingAgent,t.hostSessionId),t.ok({projectExId:r,appExId:s},s?`Current project set to ${r}, current client ${s}`:`Current project set to ${r} (no client; calls address its backend document)`)},P3=async(e,t)=>t.ok(await t.credentialStore.loadProjectContext()),D3=async(e,t)=>{let r=await t.getProjectLevelArgs(e),n=await t.client.request(await Eo(t.client,Gs),r);return t.ok(Gy(xl(n,XR),e))},L3=async(e,t)=>{let r=await t.getProjectLevelArgs(e),n=await t.client.request(Vc,r);return $e(e.raw,!1)?t.ok(Gy(n,e)):t.ok(ZR(n))},k3=async(e,t)=>{let r=await t.getProjectArgs(e),n=K(e.projectName)??K(e.name);if(!n)throw new Error("projectName is required");return t.ok(await t.client.request(ZA,{projectExId:r.projectExId,projectName:n}))},j3=async(e,t)=>{let r=await t.getProjectArgs(e),n=K(e.appExId),i=K(e.appName)??K(e.name);if(!n)throw new Error("appExId is required");if(!i)throw new Error("appName is required");return t.ok(await t.client.request(e0,{projectExId:r.projectExId,appExId:n,appName:i}))},M3=async(e,t)=>{let r=await t.getProjectArgs(e);await ma(r.projectExId,e,"delete");let n=await t.client.request(t0,{projectExId:r.projectExId});return(await t.credentialStore.loadProjectContext())?.projectExId===r.projectExId&&await t.credentialStore.deleteProjectContext(),t.schemaManager.clear(),t.ok(n)},F3=async(e,t)=>{let r=await t.getProjectArgs(e);await ma(r.projectExId,e,"reset");let n=K(e.languageType)??"EN";return t.ok(await t.client.request(r0,{projectExId:r.projectExId,languageType:n}))},q3=async(e,t)=>{let r=await t.getProjectArgs(e);$e(e.refresh,!1)&&await t.client.request(f0,{projectExId:r.projectExId});let n=K(e.resourceType),[i,o,s,a]=await Promise.all([t.client.request(d0,{projectExId:r.projectExId,nonRealTimeDisplayedResourceTypes:ii(e.nonRealTimeDisplayedResourceTypes)}),t.client.request(g0,{projectExId:r.projectExId}).catch(l=>({error:l instanceof Error?l.message:String(l)})),n?t.client.request(h0,{projectExId:r.projectExId,resourceType:n}):Promise.resolve(null),n?t.client.request(m0,{projectExId:r.projectExId,resourceType:n}):Promise.resolve(null)]),u=o&&"findActiveSingleTenantResourceInfoAndThrowOnExpireTimeMismatch"in o?o.findActiveSingleTenantResourceInfoAndThrowOnExpireTimeMismatch:null,c={usage:eN(i.resourceUsageAndBurstInfo)};return u&&u.length>0&&(c.singleTenant=u),s?.monthlyResourceUsageHistory!=null&&(c.monthly=s.monthlyResourceUsageHistory),a?.dailyResourceUsageHistory!=null&&(c.daily=a.dailyResourceUsageHistory),t.ok(c)},cN={"projects.search":aN,"projects.list":aN,"project.create":R3,"project.set_current":N3,"project.get_current":P3,"project.detail":D3,"project.metadata":L3,"project.rename":k3,"project.rename_app":j3,"project.delete":M3,"project.reset":F3,"project.resources":q3};p();async function Nl(e,t){let r=await t.checkSchema(e),n=await t.getProjectArgs(e);return{warning:r,projectArgs:n,sArgs:nr(n.projectExId,n)}}var bo=e=>async(t,r)=>{let{warning:n,sArgs:i}=await Nl(t,r);return r.ok(Rt(await e(r.schemaManager,i),n))},U3=bo((e,t)=>e.load(t)),V3=bo((e,t)=>e.load(t,!0)),G3=async(e,t)=>{let r=K(e.projectExId)?await t.checkSchema(e):null;return t.ok(Rt(t.schemaManager.status(),r))},$3=async(e,t)=>t.ok(t.schemaManager.schemaState(K(e.projectExId))),B3=async(e,t)=>t.ok(t.schemaManager.schemaEvents(K(e.projectExId),pe(e.afterEventId),Ue(e.limit,100))),K3=bo((e,t)=>e.sync(t)),H3=async(e,t)=>{let{warning:r,sArgs:n}=await Nl(e,t),i=await t.schemaManager.snapshot(n,$e(e.full,!1));return t.ok(Rt(i,r))},Q3=bo((e,t)=>e.validate(t)),W3=bo((e,t)=>e.undo(t)),z3=bo((e,t)=>e.redo(t)),Ky=async(e,t)=>{let{warning:r,projectArgs:n,sArgs:i}=await Nl(e,t),o=await t.schemaManager.load(i),s=ky(o,n.appExId??null);if(!s.ok)return{ok:!1,error:s.error,data:Rt({status:o},r)};let a=await t.schemaManager.validate(i),u=yl(a);if(u.length>0&&!$e(e.allowValidationErrors,!1))return{ok:!1,error:"ztype backend validation errors block backend sync",data:Rt({ztypeDiagnostics:a,backendErrors:u},r)};let c=await t.schemaManager.save(i),l=ky(c,n.appExId??null);if(!l.ok)throw new Error(`schema.save: ${l.error}`);let d=c.serverDoc??null,f=l.schemaExId,h=l.appExId,g=$e(e.validateMultiClient,!1)&&!!d,v=$e(e.validateMultiClient,!1)&&!d?await t.client.request(p0,{projectExId:n.projectExId,appExId:h,schemaExId:f}):await t.client.request(l0,{projectExId:n.projectExId,appExId:h,schemaExId:f,buildTarget:K(e.buildTarget)??"SUPPORT_SERVICE"});return t.ok(Rt({saved:c,deploy:v,ztypeDiagnostics:a,...g?{multiClientValidationSkipped:!0}:{}},r))},Y3=async(e,t)=>{let{warning:r,sArgs:n}=await Nl(e,t),i=Array.isArray(e.toolCalls)?e.toolCalls:[];if(i.length===0)throw new Error("toolCalls must be a non-empty array");let o=$e(e.verbose,!1),s=await t.schemaManager.ztypeToolCalls(n,i,o,e.readState??null,$e(e.force,!1),e.projectCapabilities??null);return t.ok(Rt(s,r))},lN={"schema.load":U3,"schema.reload":V3,"schema.status":G3,"schema.state":$3,"schema.events":B3,"schema.sync":K3,"schema.snapshot":H3,"schema.validate":Q3,"project.sync_backend":Ky,"schema.ztype_tool_calls":Y3,"schema.undo":W3,"schema.redo":z3};p();p();var _t=e=>Array.isArray(e)?e:[],Pl=e=>oe(oe(e).server),J3=e=>{for(let t of e){let r=oe(t);if(r.type==="FLOW_END"&&r.removable!==!0)return pe(r.uniqueId)}return null},pN=(e,t)=>{let n=_t(Pl(e).actionFlows).find(s=>oe(s).uniqueId===t);if(!n)throw new Error(`No action flow with id ${t}`);let i=oe(n),o=J3(_t(i.allNodes));if(!o)throw new Error(`Action flow ${t} has no terminal end node, so it cannot be debugged.`);return{definition:i,endNodeId:o,displayName:pe(i.displayName),isAsync:i.isAsync===!0}},X3=(e,t)=>{let r=oe(e),n=oe(t);return r.id===n.id&&r.namespace===n.namespace},dN=(e,t)=>{let r=Pl(e),n=_t(r.zAiConfigs).find(a=>oe(a).id===t);if(!n)throw new Error(`No AI agent with id ${t}`);let i=oe(n),o=i.customModelIdentifier,s=o?_t(r.customAiModelConfigs).map(oe).find(a=>X3(a.id,o)):void 0;return{definition:i,...s?{customLLMConfig:s}:{},typeDefinitions:oe(oe(r.types).definitionById)}},Qy=50,Z3=e=>{for(let t=0;t<e.length-1;t++)if(e[t].key==="componentById")return pe(e[t+1].key);return null},fN=(e,t=Qy)=>{let r=oe(e);if(r.available===!1)return{count:0,errors:[],unavailable:!0};let n=[..._t(r.stableErrors),..._t(r.betaErrors)].map(oe),i=n.slice(0,t).map(s=>{let a=_t(s.fullPath).map(oe),u={message:pe(s.message)??"",path:a},c=pe(s.platform);c&&(u.platform=c);let l=Z3(a)??pe(s.componentId);return l&&(u.componentId=l),u}),o={count:n.length,errors:i};return n.length>i.length&&(o.truncated=!0),o},e8=e=>{let t=oe(e);if(!(e===void 0||t.available===!1))return _t(t.stableErrors).length+_t(t.betaErrors).length},hN=(e,t,r,n)=>{let i=e8(oe(t).ztypeDiagnostics),o=e?n===null?{status:"IN_PROGRESS",message:"The backend sync has not finished yet. Call sync_backend again to keep waiting for it."}:n==="FINISHED"?{status:"SYNCED",message:"The backend is synced: the saved schema is live on the project runtime."}:{status:"FAILED",message:"The backend sync failed. Inspect the project errors and the DEPLOYMENT logs for the cause, fix it, and sync again."}:{status:"FAILED",message:r??"The backend sync was refused and reported no reason."};return i!==void 0&&(o.projectErrorCount=i),o},t8=e=>{let t=new Map;for(let r of _t(e.actionFlows)){let n=oe(r),i=pe(n.uniqueId),o=pe(n.displayName);i&&o&&t.set(i,o)}return t},r8=e=>{let t=new Map;for(let r of _t(oe(e.dataModel).tables)){let n=oe(r),i=pe(n.uniqueId)??pe(n.id),o=pe(n.name);i&&o&&t.set(i,o)}return t},mN=e=>{let t=Pl(e),r=t8(t),n=r8(t),i=_t(t.triggerConfigurations).map(s=>{let a=oe(s),u=pe(a.tableId);return{triggerId:pe(a.uniqueId),displayName:pe(a.displayName),enabled:a.enabled===!0,tableName:u?n.get(u)??null:null,operation:pe(oe(a.trigger).dbOperationType),flowNames:_t(a.actions).map(c=>pe(oe(c).actionFlowUniqueId)).filter(c=>!!c).map(c=>r.get(c)).filter(c=>!!c)}}),o=_t(t.scheduledJobConfigurations).map(s=>{let a=oe(s),u=pe(oe(a.action).actionFlowUniqueId);return{triggerId:pe(a.uniqueId),name:pe(a.name),enabled:a.enabled!==!1,cron:pe(a.cron),flowName:u?r.get(u)??null:null}});return{dbTriggers:i,scheduledTriggers:o}},n8=["dataModel","actionFlows","callbackConfigurations","scheduledJobConfigurations","triggerConfigurations","apiWorkSpaces","zAiConfigs","roleConfigs","authenticationConfig","secretConfigs"],Hy=(e,t)=>{if(e===t)return!0;if(e==null)return t==null;if(t==null)return!1;if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((r,n)=>Hy(r,t[n]));if(typeof e=="object"&&typeof t=="object"){let r=e,n=t,i=new Set([...Object.keys(r),...Object.keys(n)]);for(let o of i)if(!Hy(r[o],n[o]))return!1;return!0}return!1},gN=(e,t)=>{if(t==null)return{hasPendingChanges:!1,changedAreas:[],known:!1};let r=Pl(e),n=oe(t),i=n8.filter(o=>!Hy(r[o],n[o]));return{hasPendingChanges:i.length>0,changedAreas:[...i],known:!0}};p();import{randomUUID as i8}from"crypto";var yN=je(Jg(),1);var o8=e=>!!e.errorMessage||!e.nextNodeId,s8=(e,t)=>new Promise((r,n)=>{let i=[],o=!1,s={},a=c=>{o||(o=!0,clearTimeout(u),s.subscription?.unsubscribe(),c())},u=setTimeout(()=>a(()=>r({nodes:i,timedOut:!0})),t);try{s.subscription=e.subscribe({next:c=>{o||(i.push(c),o8(c)&&a(()=>r({nodes:i,timedOut:!1})))},error:c=>a(()=>n(c)),complete:()=>a(()=>r({nodes:i,timedOut:!1}))})}catch(c){a(()=>n(c));return}o&&s.subscription.unsubscribe()}),a8=`mutation AgentSaveDebugActionFlowContext($request: DebugActionFlowRequestInput!) {
|
|
1426
|
+
Type the project id to confirm:`,i=`Add-Type -AssemblyName Microsoft.VisualBasic;$r=[Microsoft.VisualBasic.Interaction]::InputBox('${(s=>s.replace(/'/g,"''"))(r)}','Human approval required','');Write-Output $r`,o=await vn("powershell",["-NoProfile","-NonInteractive","-Command",i]);return o.spawnError?"unavailable":o.timedOut?"denied":o.code!==0?"unavailable":o.stdout.trim()===e?"approved":"denied"}async function w3(e,t){switch(process.platform){case"darwin":return b3(e,t);case"linux":return T3(e,t);case"win32":return I3(e,t);default:return"unavailable"}}async function ma(e,t,r,n={}){if(cN()){XR(e,t,r,n.allowForce??!0);return}let i=await w3(e,r);if(i==="approved"){np("notice",`Human approved ${r} of project ${e}`);return}throw i==="unavailable"?new Error(`${r} requires human approval via a GUI dialog, but no dialog could be shown on this host (headless/SSH/CI). Set MCP_HITL=off to bypass with the confirmProjectExId/force text gate.`):new Error(`${r} was not approved: the confirmation dialog was cancelled or the project id was not entered correctly.`)}var Cl=e=>e.replace(/\r?\n$/,"");async function O3(e){let r=["on run argv","set lbl to item 1 of argv",'set msg to "Enter the value for secret " & quote & lbl & quote & ":"',"try",`set dlg to display dialog msg with title "Set secret value" default answer "" with hidden answer buttons {"Cancel", "Save"} default button "Save" cancel button "Cancel" with icon note giving up after ${Rl}`,"on error number -128",'return "__CANCELLED__"',"end try",'if (gave up of dlg) then return "__CANCELLED__"',"return text returned of dlg","end run"].flatMap(o=>["-e",o]);r.push(e);let n=await vn("osascript",r);if(n.spawnError||n.code!==0)return{ok:!1,reason:"unavailable"};if(n.timedOut)return{ok:!1,reason:"cancelled"};let i=Cl(n.stdout);return i==="__CANCELLED__"?{ok:!1,reason:"cancelled"}:{ok:!0,value:i}}async function A3(e){if(!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY)return{ok:!1,reason:"unavailable"};let t=`Enter the value for secret "${e}":`,r=await vn("zenity",["--entry","--hide-text","--title=Set secret value",`--text=${t}`,`--timeout=${Rl}`]);if(!r.spawnError)return r.timedOut?{ok:!1,reason:"cancelled"}:r.code===0?{ok:!0,value:Cl(r.stdout)}:{ok:!1,reason:"cancelled"};let n=await vn("kdialog",["--title","Set secret value","--password",t]);return n.spawnError?{ok:!1,reason:"unavailable"}:n.timedOut?{ok:!1,reason:"cancelled"}:n.code===0?{ok:!0,value:Cl(n.stdout)}:{ok:!1,reason:"cancelled"}}async function x3(e){let t=s=>s.replace(/'/g,"''"),r=`Enter the value for secret "${e}":`,n=["Add-Type -AssemblyName System.Windows.Forms;","Add-Type -AssemblyName System.Drawing;","$f=New-Object System.Windows.Forms.Form;$f.Text='Set secret value';$f.Width=440;$f.Height=180;$f.StartPosition='CenterScreen';$f.TopMost=$true;",`$l=New-Object System.Windows.Forms.Label;$l.Text='${t(r)}';$l.AutoSize=$true;$l.Top=15;$l.Left=15;$f.Controls.Add($l);`,"$t=New-Object System.Windows.Forms.TextBox;$t.UseSystemPasswordChar=$true;$t.Width=400;$t.Top=45;$t.Left=15;$f.Controls.Add($t);","$ok=New-Object System.Windows.Forms.Button;$ok.Text='Save';$ok.Top=90;$ok.Left=235;$ok.DialogResult=[System.Windows.Forms.DialogResult]::OK;$f.Controls.Add($ok);$f.AcceptButton=$ok;","$cn=New-Object System.Windows.Forms.Button;$cn.Text='Cancel';$cn.Top=90;$cn.Left=325;$cn.DialogResult=[System.Windows.Forms.DialogResult]::Cancel;$f.Controls.Add($cn);$f.CancelButton=$cn;",'$r=$f.ShowDialog();if($r -eq [System.Windows.Forms.DialogResult]::OK){Write-Output $t.Text}else{Write-Output "__CANCELLED__"}'].join(""),i=await vn("powershell",["-NoProfile","-NonInteractive","-STA","-Command",n]);if(i.spawnError||i.code!==0)return{ok:!1,reason:"unavailable"};if(i.timedOut)return{ok:!1,reason:"cancelled"};let o=Cl(i.stdout);return o==="__CANCELLED__"?{ok:!1,reason:"cancelled"}:{ok:!0,value:o}}async function lN(e){if(cN())throw new Error("Setting a secret value needs a native GUI dialog so the value stays off the tool call, but MCP_HITL=off. Run without MCP_HITL=off on a machine with a desktop session.");let t;switch(process.platform){case"darwin":t=await O3(e);break;case"linux":t=await A3(e);break;case"win32":t=await x3(e);break;default:t={ok:!1,reason:"unavailable"}}if(t.ok){if(!t.value)throw new Error("No secret value was entered.");return np("notice",`Human entered a value for secret "${e}"`),t.value}throw t.reason==="unavailable"?new Error("Setting a secret value requires a native GUI dialog, but none could be shown on this host (headless/SSH/CI)."):new Error("Setting the secret value was cancelled.")}var pN=async(e,t)=>{let n=(await t.client.request(qc,{projectName:K(e.projectName)??"",paginator:{after:pe(e.cursor),first:Ue(e.limit,20)}})).fuzzySearchProjectName,i=(n?.edges??[]).map(a=>a?.node).filter(a=>a!=null).map(a=>({exId:a.exId,projectName:a.projectName,updatedAt:a.updatedAt,hasPublished:a.hasPublished,webProdDomain:a.webProdDomain})),o=n?.pageInfo,s=o?.hasNextPage?o.endCursor?.value??null:null;return t.ok({projects:i,nextCursor:s})},dN=()=>Tn==="ZION",C3=["WEB","WECHAT_MINI_PROGRAM","MOBILE","BACKEND_ONLY"],R3={WEB:"Web",WECHAT_MINI_PROGRAM:"WeChat mini program",MOBILE:"App"},N3="WEB, WECHAT_MINI_PROGRAM and MOBILE each create a client this project hosts \u2014 build its pages as component trees with these tools, or deploy your own build to a WEB client; BACKEND_ONLY creates no client, for a front end hosted elsewhere that calls the project's auto-generated GraphQL API",P3=e=>{let t=K(e.appType);if(t==="WECHAT_MINI_PROGRAM"&&!dN())throw new Error("appType WECHAT_MINI_PROGRAM is a Zion-only client type and cannot be created here");let r=C3.filter(n=>n!=="WECHAT_MINI_PROGRAM"||dN());if(!t||!r.some(n=>n===t))throw new Error(`appType is required and must be one of ${r.join(", ")} \u2014 ${N3}.`);return t},D3=(e,t)=>({appName:K(e.appName)??R3[t],appType:t,source:{type:"BLANK"}}),L3=async(e,t)=>{let r=K(e.projectName)??K(e.name);if(!r)throw new Error("projectName is required");let n=P3(e),i=await YR(t.client,e),s=(await t.client.request(XA,{createProjectDetail:{explicitBuiltInClientApp:!0,projectName:r,organizationExId:i.organizationExId,projectSpaceType:i.projectSpaceType,category:pe(e.category),source:{type:"BLANK"},...n!=="BACKEND_ONLY"&&{builtInClientApp:D3(e,n)}}})).createMultiClientProjectAsync;if(!s)throw new Error("Project creation failed: taskId is missing");let u=$e(e.wait,!0)?await JR(t.client,r,Ue(e.timeoutMs,12e4)):null,c=null;if(u?.exId){let l=String(u.exId);n!=="BACKEND_ONLY"&&(c=(await ni(t.client,l))[0]??null),await t.credentialStore.saveProjectContext(l,c?.appExId??null),await Cy(t.client,l,t.codingAgent,t.hostSessionId)}return t.ok({taskId:s,project:u,builtInApp:c,projectSpace:i})},k3=async(e,t)=>{let r=K(e.projectExId);if(!r)throw new Error("projectExId is required");let n=K(e.appExId),i=e.appExId===null,o=n||i?[]:await ni(t.client,r);if(o.length>1)throw new Error(`Project ${r} has ${o.length} client apps, so the current client cannot be resolved: ${o.map(a=>`${a.appExId} (${a.appType})`).join(", ")}. Pages and components belong to one client, so call this again with appExId set to the one to work on, or with appExId: null to address the project's backend document alone. The current project is left as it was.`);let s=n??yo(o);return await t.credentialStore.saveProjectContext(r,s),await Cy(t.client,r,t.codingAgent,t.hostSessionId),t.ok({projectExId:r,appExId:s},s?`Current project set to ${r}, current client ${s}`:`Current project set to ${r} (no client; calls address its backend document)`)},j3=async(e,t)=>t.ok(await t.credentialStore.loadProjectContext()),M3=async(e,t)=>{let r=await t.getProjectLevelArgs(e),n=await t.client.request(await Eo(t.client,$s),r);return t.ok($y(xl(n,rN),e))},F3=async(e,t)=>{let r=await t.getProjectLevelArgs(e),n=await t.client.request(Vc,r);return $e(e.raw,!1)?t.ok($y(n,e)):t.ok(nN(n))},q3=async(e,t)=>{let r=await t.getProjectArgs(e),n=K(e.projectName)??K(e.name);if(!n)throw new Error("projectName is required");return t.ok(await t.client.request(e0,{projectExId:r.projectExId,projectName:n}))},U3=async(e,t)=>{let r=await t.getProjectArgs(e),n=K(e.appExId),i=K(e.appName)??K(e.name);if(!n)throw new Error("appExId is required");if(!i)throw new Error("appName is required");return t.ok(await t.client.request(t0,{projectExId:r.projectExId,appExId:n,appName:i}))},V3=async(e,t)=>{let r=await t.getProjectArgs(e);await ma(r.projectExId,e,"delete");let n=await t.client.request(r0,{projectExId:r.projectExId});return(await t.credentialStore.loadProjectContext())?.projectExId===r.projectExId&&await t.credentialStore.deleteProjectContext(),t.schemaManager.clear(),t.ok(n)},G3=async(e,t)=>{let r=await t.getProjectArgs(e);await ma(r.projectExId,e,"reset");let n=K(e.languageType)??"EN";return t.ok(await t.client.request(n0,{projectExId:r.projectExId,languageType:n}))},$3=async(e,t)=>{let r=await t.getProjectArgs(e);$e(e.refresh,!1)&&await t.client.request(y0,{projectExId:r.projectExId});let n=K(e.resourceType),[i,o,s,a]=await Promise.all([t.client.request(g0,{projectExId:r.projectExId,nonRealTimeDisplayedResourceTypes:ii(e.nonRealTimeDisplayedResourceTypes)}),t.client.request(_0,{projectExId:r.projectExId}).catch(l=>({error:l instanceof Error?l.message:String(l)})),n?t.client.request(v0,{projectExId:r.projectExId,resourceType:n}):Promise.resolve(null),n?t.client.request(E0,{projectExId:r.projectExId,resourceType:n}):Promise.resolve(null)]),u=o&&"findActiveSingleTenantResourceInfoAndThrowOnExpireTimeMismatch"in o?o.findActiveSingleTenantResourceInfoAndThrowOnExpireTimeMismatch:null,c={usage:iN(i.resourceUsageAndBurstInfo)};return u&&u.length>0&&(c.singleTenant=u),s?.monthlyResourceUsageHistory!=null&&(c.monthly=s.monthlyResourceUsageHistory),a?.dailyResourceUsageHistory!=null&&(c.daily=a.dailyResourceUsageHistory),t.ok(c)},fN={"projects.search":pN,"projects.list":pN,"project.create":L3,"project.set_current":k3,"project.get_current":j3,"project.detail":M3,"project.metadata":F3,"project.rename":q3,"project.rename_app":U3,"project.delete":V3,"project.reset":G3,"project.resources":$3};p();async function Nl(e,t){let r=await t.checkSchema(e),n=await t.getProjectArgs(e);return{warning:r,projectArgs:n,sArgs:nr(n.projectExId,n)}}var bo=e=>async(t,r)=>{let{warning:n,sArgs:i}=await Nl(t,r);return r.ok(Rt(await e(r.schemaManager,i),n))},B3=bo((e,t)=>e.load(t)),K3=bo((e,t)=>e.load(t,!0)),H3=async(e,t)=>{let r=K(e.projectExId)?await t.checkSchema(e):null;return t.ok(Rt(t.schemaManager.status(),r))},Q3=async(e,t)=>t.ok(t.schemaManager.schemaState(K(e.projectExId))),W3=async(e,t)=>t.ok(t.schemaManager.schemaEvents(K(e.projectExId),pe(e.afterEventId),Ue(e.limit,100))),z3=bo((e,t)=>e.sync(t)),Y3=async(e,t)=>{let{warning:r,sArgs:n}=await Nl(e,t),i=await t.schemaManager.snapshot(n,$e(e.full,!1));return t.ok(Rt(i,r))},J3=bo((e,t)=>e.validate(t)),X3=bo((e,t)=>e.undo(t)),Z3=bo((e,t)=>e.redo(t)),Hy=async(e,t)=>{let{warning:r,projectArgs:n,sArgs:i}=await Nl(e,t),o=await t.schemaManager.load(i),s=jy(o,n.appExId??null);if(!s.ok)return{ok:!1,error:s.error,data:Rt({status:o},r)};let a=await t.schemaManager.validate(i),u=yl(a);if(u.length>0&&!$e(e.allowValidationErrors,!1))return{ok:!1,error:"ztype backend validation errors block backend sync",data:Rt({ztypeDiagnostics:a,backendErrors:u},r)};let c=await t.schemaManager.saveForDeploy(i),l=jy(c,n.appExId??null);if(!l.ok)throw new Error(`schema.save: ${l.error}`);let d=c.serverDoc??null,f=l.schemaExId,h=l.appExId,g=$e(e.validateMultiClient,!1)&&!!d,v=$e(e.validateMultiClient,!1)&&!d,_=K(e.buildTarget)??"SUPPORT_SERVICE",b={projectExId:n.projectExId,appExId:h,schemaExId:f},S=c.commitExIds?.[f],I;return S&&v?I=await t.client.request(h0,{...b,commitExId:S}):S?I=await t.client.request(f0,{...b,commitExId:S,buildTarget:_}):v?I=await t.client.request(d0,b):I=await t.client.request(p0,{...b,buildTarget:_}),t.ok(Rt({saved:c,deploy:I,ztypeDiagnostics:a,...g?{multiClientValidationSkipped:!0}:{}},r))},e8=async(e,t)=>{let{warning:r,sArgs:n}=await Nl(e,t),i=Array.isArray(e.toolCalls)?e.toolCalls:[];if(i.length===0)throw new Error("toolCalls must be a non-empty array");let o=$e(e.verbose,!1),s=await t.schemaManager.ztypeToolCalls(n,i,o,e.readState??null,$e(e.force,!1),e.projectCapabilities??null);return t.ok(Rt(s,r))},hN={"schema.load":B3,"schema.reload":K3,"schema.status":H3,"schema.state":Q3,"schema.events":W3,"schema.sync":z3,"schema.snapshot":Y3,"schema.validate":J3,"project.sync_backend":Hy,"schema.ztype_tool_calls":e8,"schema.undo":X3,"schema.redo":Z3};p();p();var St=e=>Array.isArray(e)?e:[],Pl=e=>oe(oe(e).server),t8=e=>{for(let t of e){let r=oe(t);if(r.type==="FLOW_END"&&r.removable!==!0)return pe(r.uniqueId)}return null},mN=(e,t)=>{let n=St(Pl(e).actionFlows).find(s=>oe(s).uniqueId===t);if(!n)throw new Error(`No action flow with id ${t}`);let i=oe(n),o=t8(St(i.allNodes));if(!o)throw new Error(`Action flow ${t} has no terminal end node, so it cannot be debugged.`);return{definition:i,endNodeId:o,displayName:pe(i.displayName),isAsync:i.isAsync===!0}},r8=(e,t)=>{let r=oe(e),n=oe(t);return r.id===n.id&&r.namespace===n.namespace},gN=(e,t)=>{let r=Pl(e),n=St(r.zAiConfigs).find(a=>oe(a).id===t);if(!n)throw new Error(`No AI agent with id ${t}`);let i=oe(n),o=i.customModelIdentifier,s=o?St(r.customAiModelConfigs).map(oe).find(a=>r8(a.id,o)):void 0;return{definition:i,...s?{customLLMConfig:s}:{},typeDefinitions:oe(oe(r.types).definitionById)}},Wy=50,n8=e=>{for(let t=0;t<e.length-1;t++)if(e[t].key==="componentById")return pe(e[t+1].key);return null},yN=(e,t=Wy)=>{let r=oe(e);if(r.available===!1)return{count:0,errors:[],unavailable:!0};let n=[...St(r.stableErrors),...St(r.betaErrors)].map(oe),i=n.slice(0,t).map(s=>{let a=St(s.fullPath).map(oe),u={message:pe(s.message)??"",path:a},c=pe(s.platform);c&&(u.platform=c);let l=n8(a)??pe(s.componentId);return l&&(u.componentId=l),u}),o={count:n.length,errors:i};return n.length>i.length&&(o.truncated=!0),o},i8=e=>{let t=oe(e);if(!(e===void 0||t.available===!1))return St(t.stableErrors).length+St(t.betaErrors).length},vN=(e,t,r,n)=>{let i=i8(oe(t).ztypeDiagnostics),o=e?n===null?{status:"IN_PROGRESS",message:"The backend sync has not finished yet. Call sync_backend again to keep waiting for it."}:n==="FINISHED"?{status:"SYNCED",message:"The backend is synced: the saved schema is live on the project runtime."}:{status:"FAILED",message:"The backend sync failed. Inspect the project errors and the DEPLOYMENT logs for the cause, fix it, and sync again."}:{status:"FAILED",message:r??"The backend sync was refused and reported no reason."};return i!==void 0&&(o.projectErrorCount=i),o},o8=e=>{let t=new Map;for(let r of St(e.actionFlows)){let n=oe(r),i=pe(n.uniqueId),o=pe(n.displayName);i&&o&&t.set(i,o)}return t},s8=e=>{let t=new Map;for(let r of St(oe(e.dataModel).tables)){let n=oe(r),i=pe(n.uniqueId)??pe(n.id),o=pe(n.name);i&&o&&t.set(i,o)}return t},EN=e=>{let t=Pl(e),r=o8(t),n=s8(t),i=St(t.triggerConfigurations).map(s=>{let a=oe(s),u=pe(a.tableId);return{triggerId:pe(a.uniqueId),displayName:pe(a.displayName),enabled:a.enabled===!0,tableName:u?n.get(u)??null:null,operation:pe(oe(a.trigger).dbOperationType),flowNames:St(a.actions).map(c=>pe(oe(c).actionFlowUniqueId)).filter(c=>!!c).map(c=>r.get(c)).filter(c=>!!c)}}),o=St(t.scheduledJobConfigurations).map(s=>{let a=oe(s),u=pe(oe(a.action).actionFlowUniqueId);return{triggerId:pe(a.uniqueId),name:pe(a.name),enabled:a.enabled!==!1,cron:pe(a.cron),flowName:u?r.get(u)??null:null}});return{dbTriggers:i,scheduledTriggers:o}},a8=["dataModel","actionFlows","callbackConfigurations","scheduledJobConfigurations","triggerConfigurations","apiWorkSpaces","zAiConfigs","roleConfigs","authenticationConfig","secretConfigs"],Qy=(e,t)=>{if(e===t)return!0;if(e==null)return t==null;if(t==null)return!1;if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((r,n)=>Qy(r,t[n]));if(typeof e=="object"&&typeof t=="object"){let r=e,n=t,i=new Set([...Object.keys(r),...Object.keys(n)]);for(let o of i)if(!Qy(r[o],n[o]))return!1;return!0}return!1},_N=(e,t)=>{if(t==null)return{hasPendingChanges:!1,changedAreas:[],known:!1};let r=Pl(e),n=oe(t),i=a8.filter(o=>!Qy(r[o],n[o]));return{hasPendingChanges:i.length>0,changedAreas:[...i],known:!0}};p();import{randomUUID as u8}from"crypto";var SN=je(Jg(),1);var c8=e=>!!e.errorMessage||!e.nextNodeId,l8=(e,t)=>new Promise((r,n)=>{let i=[],o=!1,s={},a=c=>{o||(o=!0,clearTimeout(u),s.subscription?.unsubscribe(),c())},u=setTimeout(()=>a(()=>r({nodes:i,timedOut:!0})),t);try{s.subscription=e.subscribe({next:c=>{o||(i.push(c),c8(c)&&a(()=>r({nodes:i,timedOut:!1})))},error:c=>a(()=>n(c)),complete:()=>a(()=>r({nodes:i,timedOut:!1}))})}catch(c){a(()=>n(c));return}o&&s.subscription.unsubscribe()}),p8=`mutation AgentSaveDebugActionFlowContext($request: DebugActionFlowRequestInput!) {
|
|
1381
1427
|
fz_save_debug_action_flow_context(request: $request)
|
|
1382
|
-
}`,
|
|
1428
|
+
}`,d8=`subscription AgentDebugActionFlow($contextId: String!) {
|
|
1383
1429
|
fz_debug_action_flow(contextId: $contextId)
|
|
1384
|
-
}`,
|
|
1385
|
-
${i}`):e},
|
|
1386
|
-
`)},
|
|
1430
|
+
}`,f8=1100,h8=2,m8=5e3,g8=60,y8=e=>e instanceof br&&e.response.status===429,v8=async e=>{for(let t=0;;t++){try{return await e()}catch(r){if(t===h8||!y8(r))throw r}await new Promise(r=>setTimeout(r,f8))}},zy=e=>{let t=Array.isArray(e)?e[0]:e;return t instanceof Error?t.message:oe(t).message??JSON.stringify(t)},E8=e=>oe(typeof e=="string"?JSON.parse(e):e),_8=(e,t,r)=>({subscribe:n=>{let i=new SN.SubscriptionClient(e,{lazy:!0,reconnect:!1,minTimeout:1e4,connectionParams:t,connectionCallback:s=>{s&&n.error(new Error(`The runtime refused the debug connection: ${zy(s)}`))}},la);i.onDisconnected(()=>n.error(new Error("The runtime closed the debug connection before the run finished")));let o=i.request({query:d8,variables:{contextId:r}}).subscribe({next:({data:s,errors:a})=>{if(a?.length){n.error(new Error(a.map(zy).join("; ")));return}let u=oe(s).fz_debug_action_flow;if(u==null)return;let c;try{c=E8(u)}catch{n.error(new Error("Could not parse a debug node output from the runtime"));return}n.next(c)},error:s=>n.error(new Error(zy(s))),complete:n.complete});return{unsubscribe:()=>{o.unsubscribe(),i.close(!0,!0)}}}}),bN=async(e,t,r,n)=>{if(!e.adminSubscriptionUrl)throw new Error("The project has no admin runtime endpoint; deploy it before debugging a flow");let o=(await v8(()=>e.adminClient.request(p8,{request:t})))?.fz_save_debug_action_flow_context;if(!o)throw new Error("The runtime did not return a debug context for this run");let s={authToken:e.adminToken,"X-SESSION-ID":u8()};r&&(s["X-MOCK-ACCOUNT-ID"]=String(r));let a=Ue(t.timeoutSeconds,g8)*1e3+m8;return l8(_8(e.adminSubscriptionUrl,s,o),Math.max(0,Math.min(a,n-Date.now())))};var ga=async(e,t)=>{let r=await t.getProjectArgs(e),n=nr(r.projectExId,r);return await t.schemaManager.load(n),{projectArgs:r,sArgs:n,snapshot:await t.schemaManager.snapshot(n,!0)}},S8=async(e,t)=>{let r=K(e.flowId);if(!r)return t.fail(new Error("Provide a 'flowId'."));let{snapshot:n}=await ga(e,t);return t.ok(mN(n,r))},b8=async(e,t)=>{let r=K(e.configId);if(!r)return t.fail(new Error("Provide a 'configId'."));let{snapshot:n}=await ga(e,t);return t.ok(gN(n,r))},T8=1e5,I8=async(e,t)=>{let r=Date.now()+T8,n=oe(e.request);if(!n.actionFlowDefinition||!K(n.endNodeId))return t.fail(new Error("Provide a 'request' holding the flow's 'actionFlowDefinition' and 'endNodeId'."));let i=await t.getProjectArgs(e),o=await yn(t.client,i),s=Ue(e.mockAccountId,0);return t.ok(await bN(o,n,s||null,r))},w8=async(e,t)=>{let{snapshot:r}=await ga(e,t);return t.ok(EN(r))},O8=async(e,t)=>{let{projectArgs:r,snapshot:n}=await ga(e,t),i=await t.client.request(q0,{projectExId:r.projectExId});return t.ok(_N(n,i?.project?.lastDeployedServerSchema??null))},A8=async(e,t)=>{let{sArgs:r}=await ga(e,t);return t.ok(yN(await t.schemaManager.validate(r),Ue(e.limit,Wy)))},x8=9e4,C8=2e3,TN=async(e,t)=>(await e.client.request(F0,{projectExId:t})).project?.lastAllPipelinePlatformStatus.find(n=>n.buildTarget==="SUPPORT_SERVICE")??null,R8=async(e,t,r,n)=>{for(;;){let i=await TN(e,t);if(i&&i.status!=="DEPLOYING"&&n(i))return i.status;if(Date.now()>=r)return null;await new Promise(o=>setTimeout(o,C8))}},N8=async(e,t)=>{let r=Date.now()+x8,{projectExId:n}=await t.getProjectArgs(e),i=await TN(t,n),o=i?.status==="DEPLOYING",s=o?t.ok():await Hy(e,t),a=s.ok?await R8(t,n,r,u=>o||u.startedAt!==i?.startedAt):null;return t.ok(vN(s.ok,s.data,s.error??null,a))},P8=async(e,t)=>{if(e.appExId)return e.appExId;let r=await ni(t.client,e.projectExId);if(r.length===0)throw new Error("The project has no client app, so there is no canvas to render.");let n=yo(r);if(!n)throw new Error(`Pass appExId: the project has ${r.length} client apps (${r.map(i=>i.appExId).join(", ")}), so the canvas to render is ambiguous.`);return n},Dl=async(e,t,r,n)=>{let i=Date.now()+Vy,o=await n.getProjectArgs(r),s=nr(o.projectExId,o),a=await P8(o,n),u=await n.client.request(Uc);if(!u?.user?.exId)throw new Error("Could not resolve the signed-in account to render the canvas as.");return Ol.run({projectExId:o.projectExId,appExId:a,token:await n.tokenManager.getValidToken(),user:{exId:u.user.exId,username:u.user.username??null}},{rpc:e,args:t,sessionExId:K(r.sessionExId)??"",pageId:K(r.pageId)??null,breakpoint:K(r.breakpoint)??null,lastPatchExIds:await n.schemaManager.lastPatchExIds(s),deadline:i})},D8=["pageId","componentId","mode","breakpoint","maxWidth","limit"],Ll=e=>Object.fromEntries(D8.filter(t=>e[t]!==void 0).map(t=>[t,e[t]])),L8=async(e,t)=>t.ok(await Dl("editor.getClippedComponents",Ll(e),e,t)),k8=async(e,t)=>K(e.sessionExId)?t.ok(await Dl("editor.captureCanvas",Ll(e),e,t)):t.fail(new Error("Provide 'sessionExId': the capture is stored as that agent session's media.")),IN={"bridge.flow_definition":S8,"bridge.agent_definition":b8,"bridge.debug_flow":I8,"bridge.trigger_bindings":w8,"bridge.deploy_status":O8,"bridge.project_errors":A8,"bridge.sync_backend":N8,"bridge.clipped_components":L8,"bridge.capture_canvas":k8};p();p();var j8=/Subselection required for type '(FZ_\w+)' of field '([^'/]+\/)?([^']+)'/,M8=/Unknown field argument '(where|limit|offset|order_by)'/,F8=/Field '([^']+)' in type '([^']+)' is undefined/,q8=/field name '([^']+)' that is not defined for input object type '(\w+)'/,U8=(e,t)=>{let r=Array.from({length:t.length+1},(n,i)=>i);for(let n=1;n<=e.length;n+=1){let i=[n];for(let o=1;o<=t.length;o+=1)i[o]=Math.min(r[o]+1,i[o-1]+1,r[o-1]+(e[n-1]===t[o-1]?0:1));r=i}return r[t.length]},ON=(e,t)=>{let r=Math.max(2,Math.ceil(t.length/2));return e.map(n=>({name:n,score:U8(n.toLowerCase(),t.toLowerCase())})).filter(n=>n.score<=r).sort((n,i)=>n.score-i.score).slice(0,3).map(n=>n.name)},V8=e=>(e?.tableMetadata??[]).flatMap(t=>[t?.name,t?.displayName].filter(r=>typeof r=="string"&&r.length>0)),kl=(e,t)=>(e?.tableMetadata??[]).find(r=>r?.name===t),wN=(e,t)=>{let r=t?.columnMetadata??[],n=r.find(o=>o?.displayName===e&&o?.name);if(n){let o=Al(n)??n.name;return`'${e}' is a column DISPLAY name, which the runtime never accepts \u2014 pass '${o}'.`}if(r.some(o=>o?.name===e))return`'${e}' is in the project schema but not in the deployed backend. Run 'project sync-backend', then retry.`;let i=ON(r.flatMap(o=>[o?.name,o?.displayName]).filter(o=>typeof o=="string"&&o.length>0),e);return i.length>0?`No column '${e}'. Closest: ${i.join(", ")}.`:`No column '${e}' on this table.`},G8=(e,t,r)=>{let n=j8.exec(e);if(n){let c=n[3];return`'${c}' is a media column \u2014 the runtime takes the asset id as '${c}_id', the only form it filters, sorts or writes. Read the asset's url or metadata with runtime graphql instead: ${c} { id url }.`}if(M8.test(e))return`'${t}' exists in the runtime but is not a table collection \u2014 it takes no where/limit/order_by. Query it with runtime graphql instead.`;let i=q8.exec(e);if(i)return wN(i[1],kl(r,t));let o=F8.exec(e);if(!o)return null;let[,s,a]=o;if(a!=="Query"&&a!=="Mutation")return wN(s,kl(r,t));if(kl(r,t))return`'${t}' is in the project schema but not in the deployed backend. Run 'project sync-backend', then retry \u2014 every runtime call hits the deployed app, never the draft.`;let u=ON(V8(r),t);return u.length>0?`No table '${t}' in the project schema. Closest: ${u.join(", ")}.`:`No table '${t}' in the project schema \u2014 'schema snapshot' lists the ones there are.`},AN=(e,t,r)=>{let n=e instanceof Error?e.message:String(e),i=G8(n,t,r);return i?e instanceof Error?(e.runtimeDiagnosis=i,e):new Error(`${n}
|
|
1431
|
+
${i}`):e},xN=(e,t,r)=>{let n=e?.tableMetadata??[];if(!n.some(o=>o?.name===t)){let o=n.find(s=>s?.displayName===t&&s?.name);if(o?.name)throw new Error(`'${t}' is a table DISPLAY name, which the runtime never accepts \u2014 pass '${o.name}'.`)}let i=kl(e,t)?.columnMetadata??[];for(let o of r??[]){let s=i.find(u=>u?.name===o)??i.find(u=>u?.displayName===o),a=s?Al(s):null;if(!(!s||!a||a===o))throw new Error(s.name===o?`'${o}' is a media column \u2014 pass '${a}', the asset id, which is the only form the runtime filters, sorts or writes. For the asset's url or metadata, select subfields with runtime graphql: ${o} { id url }.`:`'${o}' is a column DISPLAY name, which the runtime never accepts \u2014 pass '${a}'.`)}};p();p();var $8=/^[A-Za-z_][A-Za-z0-9_]*$/,En=(e,t)=>{if(!$8.test(e))throw new Error(`${t} must be a GraphQL identifier`)},Yy=(e,t)=>{for(let r of e)En(r,t)},jl=(e,t)=>{if(e.length===0)throw new Error("at least one field must be selected");return Yy(e,"fields"),e.map(r=>`${t}${r}`).join(`
|
|
1432
|
+
`)},CN=(e,t)=>(En(e,"table"),`query AgentQuery($where: ${e}_bool_exp, $limit: Int, $offset: Int, $order_by: [${e}_order_by!]) {
|
|
1387
1433
|
${e}(where: $where, limit: $limit, offset: $offset, order_by: $order_by) {
|
|
1388
1434
|
${jl(t," ")}
|
|
1389
1435
|
}
|
|
1390
|
-
}`),
|
|
1436
|
+
}`),RN=e=>(En(e,"table"),`query AgentAggregate($where: ${e}_bool_exp) {
|
|
1391
1437
|
${e}_aggregate(where: $where) {
|
|
1392
1438
|
aggregate {
|
|
1393
1439
|
count
|
|
1394
1440
|
}
|
|
1395
1441
|
}
|
|
1396
|
-
}`),
|
|
1442
|
+
}`),NN=(e,t)=>(En(e,"table"),`mutation AgentInsert($objects: [${e}_insert_input!]!) {
|
|
1397
1443
|
insert_${e}(objects: $objects) {
|
|
1398
1444
|
affected_rows
|
|
1399
1445
|
returning {
|
|
1400
1446
|
${jl(t," ")}
|
|
1401
1447
|
}
|
|
1402
1448
|
}
|
|
1403
|
-
}`),
|
|
1449
|
+
}`),PN=(e,t)=>(En(e,"table"),`mutation AgentUpdate($where: ${e}_bool_exp!, $set: ${e}_set_input!) {
|
|
1404
1450
|
update_${e}(where: $where, _set: $set) {
|
|
1405
1451
|
affected_rows
|
|
1406
1452
|
returning {
|
|
1407
1453
|
${jl(t," ")}
|
|
1408
1454
|
}
|
|
1409
1455
|
}
|
|
1410
|
-
}`),
|
|
1456
|
+
}`),DN=(e,t)=>(En(e,"table"),`mutation AgentDelete($where: ${e}_bool_exp!) {
|
|
1411
1457
|
delete_${e}(where: $where) {
|
|
1412
1458
|
affected_rows
|
|
1413
1459
|
returning {
|
|
1414
1460
|
${jl(t," ")}
|
|
1415
1461
|
}
|
|
1416
1462
|
}
|
|
1417
|
-
}`),
|
|
1463
|
+
}`),LN=()=>`mutation AgentRunCode($jsCode: String!, $args: JsonObject, $updateDb: Boolean!) {
|
|
1418
1464
|
fz_debug_action_code(jsCode: $jsCode, args: $args, updateDb: $updateDb)
|
|
1419
|
-
}`;var U8=20,V8=200,G8=20,Yy="id",Jy=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},kN=e=>Array.isArray(e)?e:[],$8=(e,t)=>typeof e=="boolean"?e:e==null?t:String(e).toLowerCase()==="true",NN=(e,t)=>typeof e=="number"&&Number.isFinite(e)?Math.trunc(e):t,PN=(e,t)=>{let r=e[t];if(typeof r!="string"||r.trim()==="")throw new Error(`'${t}' is required.`);return r},DN=(e,t,r)=>{let n=Jy(e.where);if(Object.keys(n).length>0)return n;if(e[r]===!0)return{};throw new Error(`'where' is required and must not be empty \u2014 this ${t} runs against the live app and there is no change-everything option.`)},Ml=(e,t)=>{let r=kN(e.fields).filter(n=>typeof n=="string"&&n.trim()!=="");return r.length>0?(zy(r,"fields"),r):t.length>0?t.slice(0,G8):[Yy]},LN=e=>e.includes(Yy)?e:[Yy,...e],Xy=(e,t,r=[])=>{if(e==="runtime.run_code")return{document:RN(),variables:{jsCode:PN(t,"jsCode"),args:Jy(t.args),updateDb:$8(t.updateDb,!1)},rootField:"fz_debug_action_code"};let n=PN(t,"tableName");switch(En(n,"tableName"),e){case"runtime.query":return{document:wN(n,Ml(t,r)),variables:{where:t.where??{},limit:Math.min(NN(t.limit,U8),V8),offset:NN(t.offset,0),order_by:t.orderBy??null},rootField:n};case"runtime.aggregate":return{document:ON(n),variables:{where:t.where??{}},rootField:`${n}_aggregate`};case"runtime.insert":{let i=kN(t.objects);if(i.length===0)throw new Error("'objects' must contain at least one row to insert.");if(i.some(o=>!o||typeof o!="object"||Array.isArray(o)))throw new Error("every entry in 'objects' must be an object of column values.");return{document:AN(n,LN(Ml(t,r))),variables:{objects:i},rootField:`insert_${n}`}}case"runtime.update":{let i=DN(t,"update","allowUpdateAll"),o=Jy(t.set);if(Object.keys(o).length===0)throw new Error("'set' must contain at least one column to change.");return{document:xN(n,Ml(t,r)),variables:{where:i,set:o},rootField:`update_${n}`}}case"runtime.delete":return{document:CN(n,LN(Ml(t,r))),variables:{where:DN(t,"delete","allowDeleteAll")},rootField:`delete_${n}`};default:throw new Error(`'${e}' is not a planned runtime operation.`)}},jN=e=>{if(!e||typeof e!="object"||Array.isArray(e))return e;let t=Object.keys(e);return t.length===1?e[t[0]]:e};async function ya(e,t,r,n){let i=await r.checkSchema(t),o=await r.getProjectArgs(t),s=oi(t.tableName,"tableName"),[a,u]=await Promise.all([r.schemaManager.dataModel(nr(o.projectExId,o)),yn(r.client,o)]);IN(a,s,ii(t.fields));let c=Xy(e,{...t,tableName:s},KR(a,s)),l;try{l=await u.dataClient.request(c.document,c.variables)}catch(d){throw TN(d,s,a)}return r.ok(Rt(n?jN(l):l,i))}var B8=async(e,t)=>{let r=await t.checkSchema(e),n=await t.getProjectArgs(e),i=oi(e.query,"query"),s=await(await yn(t.client,n)).dataClient.request(i,e.variables??{});return t.ok(Rt(s,r))},K8=async(e,t)=>ya("runtime.query",e,t,!1),H8=async(e,t)=>ya("runtime.aggregate",e,t,!1),Q8=async(e,t)=>ya("runtime.insert",e,t,!0),W8=async(e,t)=>ya("runtime.update",e,t,!0),z8=async(e,t)=>ya("runtime.delete",e,t,!0),Y8=async(e,t)=>{let r=await t.getProjectArgs(e),n=Xy("runtime.run_code",e),o=await(await yn(t.client,r)).adminClient.request(n.document,n.variables);return t.ok({keptWrites:n.variables.updateDb===!0,result:o?.fz_debug_action_code})},MN={"runtime.graphql":B8,"runtime.run_code":Y8,"runtime.query":K8,"runtime.aggregate":H8,"runtime.insert":Q8,"runtime.update":W8,"runtime.delete":z8};p();var J8=["GATEWAY","ACTION_FLOW","ACTION_FLOW_NODE","ACTION_FLOW_CONTEXT_LOG","DEPLOYMENT","TPA","TRIGGER","SQL_GENERATION","GQL","ZAI"],X8=["INFO","WARNING","ERROR"],Z8=50,e6=100,FN=5,qN=e=>`${e.toISOString().slice(0,19)}Z`,t6=e=>{if(!e)return new Date;let t=new Date(e);return Number.isNaN(t.getTime())?new Date:t},UN=(e,t)=>{if(!e)return;let r=e.map(n=>n.toUpperCase()).filter(n=>t.includes(n));return r.length>0?r:void 0},r6=async(e,t)=>{let r=await t.getProjectArgs(e),{adminToken:n}=await yn(t.client,r),i=t6(K(e.requestCreatedAt)),o={start:qN(new Date(i.getTime()-FN*6e4)),end:qN(new Date(i.getTime()+FN*6e4)),desc:!0},s=UN(ii(e.types),J8);s&&(o.type=s);let a=UN(ii(e.levels),X8);a&&(o.level=a);let u=K(e.customQueryCondition);u&&(o.customQueryCondition=u);let c=Math.min(e6,Ue(e.limit,Z8)),l=Nt().logApiUrlTemplate.replace("{projectExId}",r.projectExId),h=((await new Ze(l,{headers:{authorization:`Bearer ${n}`},fetch:vo}).request(j0,{queryCreation:o,paginator:{first:c}}))?.fetchLogsByPaginator?.edges??[]).map(g=>g?.node).filter(g=>!!g);return t.ok({entries:h})},VN={"logs.search":r6};p();p();var n6=async()=>(await import("./corpus-DCO5BVFL.js")).DOCS_CORPUS,i6=3,GN=null,o6=e=>{let t=new Map;for(let r of e)t.set(r.path,r);for(let r of e)for(let n of r.aliases??[])t.has(n)||t.set(n,r);return t},s6=e=>{let t=e.map(r=>{let n=ip(r.content),i=ip(r.title);for(let o=0;o<i6;o+=1)n.push(...i);return{ref:r,tokens:n}});return{index:Rv(t),byPath:o6(e)}},$N=async()=>(GN??=s6(await n6()),GN),BN=async(e,t=10)=>{let{index:r}=await $N();return Nv(r,e).filter(n=>n.score>0).sort((n,i)=>i.score-n.score).slice(0,Math.max(1,t)).map(n=>({path:n.ref.path,title:n.ref.title,url:n.ref.url}))},a6=e=>{let t=e.trim().replace(/\.mdx$/,"").replace(/^\/+/,"/").replace(/\/+$/,"");return t===""||t==="/"?"/":t.startsWith("/")?t:`/${t}`},KN=async e=>(await $N()).byPath.get(a6(e))??null;var u6=async(e,t)=>{let r=K(e.query);if(!r)throw new Error("query is required");let n=Ue(e.limit,10);return t.ok({results:await BN(r,n)})},c6=async(e,t)=>{let r=K(e.path);if(!r)throw new Error("path is required");let n=await KN(r);if(!n)throw new Error(`No doc page found for path: ${r}`);return t.ok(n)},HN={"docs.search":u6,"docs.get_page":c6};p();var si=je(ln(),1);var QN=["saveSchema","deployV2","validateSchemaIdIsLatest","addCodeComponentToProject","changeProjectCodeComponentVersion"],WN=(e,t)=>e.selections.flatMap(r=>{if(r.kind===si.Kind.FIELD)return[r.name.value];let n=r.kind===si.Kind.INLINE_FRAGMENT?r.selectionSet:t.get(r.name.value)?.selectionSet;return n?WN(n,t):[]}),l6=e=>{let t=(0,si.parse)(e),r=new Map;for(let i of t.definitions)i.kind===si.Kind.FRAGMENT_DEFINITION&&r.set(i.name.value,i);let n=new Set;for(let i of t.definitions)if(i.kind===si.Kind.OPERATION_DEFINITION&&i.operation!=="query")for(let o of WN(i.selectionSet,r))QN.includes(o)||n.add(o);return[...n]},p6=async(e,t)=>{let r=K(e.query);if(!r)throw new Error("query is required");let n=l6(r);if(n.length>0)throw new Error(`platform_graphql refused ${n.join(", ")}: queries pass through unchanged, but mutations are refused except the allow list for client builds and code component versions (${QN.join(", ")}). Make schema changes through ztype_tool_calls (CLI: schema tool-call), which validates each change before it is written.`);let i=e.variables&&typeof e.variables=="object"?e.variables:{};return t.ok(await t.client.request(r,i))},zN={"platform.graphql":p6};p();var d6=async(e,t)=>{let r=await Ct(),n=r?.api?.ZTypePredefinedApi;if(!n)return t.fail(new Error("ztype predefined template API is unavailable"));let o=n.getActionFlowTemplates(mo(r)).map(s=>({templateCodeId:s.preDefinedCodeId,displayName:s.displayName,group:s.directory,async:s.async,inputs:s.input,outputs:s.output}));return t.ok({templates:o})},YN={"actionflow.list_node_templates":d6};p();import{promises as JN}from"node:fs";import Zy from"node:path";var f6=e=>{if(!e)return null;let t=e.split("?")[0]?.split("/").pop();if(!t)return null;let r=t.replace(/\.[a-z0-9]+$/i,"");return r.length>0?r:null},h6=async(e,t)=>{let n=(await t.client.request(WA)).getTabBarIcons.flatMap(i=>i?[{name:f6(i.url),exId:i.exId}]:[]);return t.ok({icons:n,note:n.length===0?"This deployment ships no preset tab-bar icons; upload one in the editor and use its exId.":"A name ending in _selected is the pressed-state partner of the icon with the same prefix; for the plain icons use the same exId for both states."})},m6=async(e,t)=>{let{base64:r,...n}=await Dl("CAPTURE",Ll(e),e,t);if(!r)return t.ok(n);let i=Zy.resolve(K(e.out)??Zy.join(t.credentialStore.getMcpConfigDir(),"canvas",`canvas-${Date.now()}.png`));return await JN.mkdir(Zy.dirname(i),{recursive:!0}),await JN.writeFile(i,Buffer.from(r,"base64")),t.ok({path:i,...n})},XN={"component.tab_bar_icons":h6,"component.capture_canvas":m6};p();p();function g6(e){let t;try{t=new URL(e)}catch{throw new Error(`Unsupported or malformed URL: ${e}`)}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Error(`Only http/https URLs are allowed: ${e}`);return t}async function y6(e,t){let r=e.body?.getReader();if(!r)throw new Error(`Empty response body from ${t}`);let n=[],i=0;for(;;){let{done:o,value:s}=await r.read();if(o)break;if(i+=s.byteLength,i>10485760)throw await r.cancel(),new Error("Response exceeds size limit of 10485760 bytes");n.push(s)}return Buffer.concat(n).toString("utf8")}async function ZN(e){let t=e;for(let r=0;r<=5;r++){let n=g6(t),i=await fetch(n,{redirect:"manual",signal:AbortSignal.timeout(2e4),headers:{Accept:"application/json, application/yaml, text/yaml, text/html, */*","User-Agent":"Momen-Agent-TpaImport"}});if(i.status>=300&&i.status<400){let o=i.headers.get("location");if(await i.body?.cancel(),!o)throw new Error(`Redirect without Location from ${t}`);t=new URL(o,n).toString();continue}if(!i.ok)throw await i.body?.cancel(),new Error(`HTTP ${i.status} fetching ${t}`);return{finalUrl:n.toString(),contentType:i.headers.get("content-type"),body:await y6(i,t)}}throw new Error(`Too many redirects fetching ${e}`)}p();var v6=/(?:href|src|url)\s*[=:]\s*["']?([^"'\s>)]+)/gi,E6=/<(script|style|noscript|svg|iframe|canvas|template|nav|footer|aside)\b[\s\S]*?<\/\1\s*>/gi,_6=new Set(["css","js","png","jpg","jpeg","gif","svg","ico","woff","woff2","ttf","webp","mp4","zip","pdf"]);function eP(e,t){if(e&&e.toLowerCase().includes("html"))return!0;let r=t.trimStart();return r.startsWith("<")&&!r.startsWith("<?xml")}function tP(e){let t=e.length>4e3?e.slice(0,4e3):e;return t.includes('"openapi"')||t.includes('"swagger"')||/(^|\n)\s*openapi\s*:/.test(t)||/(^|\n)\s*swagger\s*:/.test(t)}function rP(e,t){try{return new URL(t,e).toString()}catch{return t.startsWith("http")?t:null}}var b6=/^https?:\/\/app\.swaggerhub\.com\/apis(?:-docs)?\/([^/?#]+)\/([^/?#]+)\/([^/?#]+)/i;function S6(e){let t=e.match(b6);return t?`https://api.swaggerhub.com/apis/${t[1]}/${t[2]}/${t[3]}`:null}function nP(e,t){let r=[],n=i=>{i&&r.length<20&&!r.includes(i)&&r.push(i)};for(let i of e.matchAll(v6)){if(r.length>=20)break;let o=i[1],s=o.toLowerCase();if(!(s.includes("openapi")||s.includes("swagger")||(s.endsWith(".json")||s.endsWith(".yaml")||s.endsWith(".yml"))&&s.includes("api")))continue;let u=rP(t,o);n(u&&S6(u)),n(u)}return r}function iP(e,t){let r=[],n;try{n=new URL(t).host}catch{return r}for(let i of e.matchAll(/<a\b[^>]*href\s*=\s*["']([^"'#]+)[^"']*["']/gi)){if(r.length>=40)break;let o;try{o=new URL(i[1],t)}catch{continue}if(o.host!==n)continue;o.hash="";let s=o.toString(),a=o.pathname.toLowerCase(),u=a.slice(a.lastIndexOf(".")+1);_6.has(u)||s===t||r.includes(s)||r.push(s)}return r}var T6={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",copy:"\xA9"};function ev(e){return e.replace(/&#x([0-9a-f]+);/gi,(t,r)=>String.fromCodePoint(parseInt(r,16))).replace(/&#(\d+);/g,(t,r)=>String.fromCodePoint(parseInt(r,10))).replace(/&([a-z]+);/gi,(t,r)=>T6[r.toLowerCase()]??t)}var va=e=>e.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim();function oP(e,t){let r=e.replace(/<!--[\s\S]*?-->/g,"").replace(E6,"");return r=r.replace(/<pre\b[^>]*>([\s\S]*?)<\/pre\s*>/gi,(n,i)=>`
|
|
1465
|
+
}`;var B8=20,K8=200,H8=20,Jy="id",Xy=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},qN=e=>Array.isArray(e)?e:[],Q8=(e,t)=>typeof e=="boolean"?e:e==null?t:String(e).toLowerCase()==="true",kN=(e,t)=>typeof e=="number"&&Number.isFinite(e)?Math.trunc(e):t,jN=(e,t)=>{let r=e[t];if(typeof r!="string"||r.trim()==="")throw new Error(`'${t}' is required.`);return r},MN=(e,t,r)=>{let n=Xy(e.where);if(Object.keys(n).length>0)return n;if(e[r]===!0)return{};throw new Error(`'where' is required and must not be empty \u2014 this ${t} runs against the live app and there is no change-everything option.`)},Ml=(e,t)=>{let r=qN(e.fields).filter(n=>typeof n=="string"&&n.trim()!=="");return r.length>0?(Yy(r,"fields"),r):t.length>0?t.slice(0,H8):[Jy]},FN=e=>e.includes(Jy)?e:[Jy,...e],Zy=(e,t,r=[])=>{if(e==="runtime.run_code")return{document:LN(),variables:{jsCode:jN(t,"jsCode"),args:Xy(t.args),updateDb:Q8(t.updateDb,!1)},rootField:"fz_debug_action_code"};let n=jN(t,"tableName");switch(En(n,"tableName"),e){case"runtime.query":return{document:CN(n,Ml(t,r)),variables:{where:t.where??{},limit:Math.min(kN(t.limit,B8),K8),offset:kN(t.offset,0),order_by:t.orderBy??null},rootField:n};case"runtime.aggregate":return{document:RN(n),variables:{where:t.where??{}},rootField:`${n}_aggregate`};case"runtime.insert":{let i=qN(t.objects);if(i.length===0)throw new Error("'objects' must contain at least one row to insert.");if(i.some(o=>!o||typeof o!="object"||Array.isArray(o)))throw new Error("every entry in 'objects' must be an object of column values.");return{document:NN(n,FN(Ml(t,r))),variables:{objects:i},rootField:`insert_${n}`}}case"runtime.update":{let i=MN(t,"update","allowUpdateAll"),o=Xy(t.set);if(Object.keys(o).length===0)throw new Error("'set' must contain at least one column to change.");return{document:PN(n,Ml(t,r)),variables:{where:i,set:o},rootField:`update_${n}`}}case"runtime.delete":return{document:DN(n,FN(Ml(t,r))),variables:{where:MN(t,"delete","allowDeleteAll")},rootField:`delete_${n}`};default:throw new Error(`'${e}' is not a planned runtime operation.`)}},UN=e=>{if(!e||typeof e!="object"||Array.isArray(e))return e;let t=Object.keys(e);return t.length===1?e[t[0]]:e};async function ya(e,t,r,n){let i=await r.checkSchema(t),o=await r.getProjectArgs(t),s=oi(t.tableName,"tableName"),[a,u]=await Promise.all([r.schemaManager.dataModel(nr(o.projectExId,o)),yn(r.client,o)]);xN(a,s,ii(t.fields));let c=Zy(e,{...t,tableName:s},zR(a,s)),l;try{l=await u.dataClient.request(c.document,c.variables)}catch(d){throw AN(d,s,a)}return r.ok(Rt(n?UN(l):l,i))}var W8=async(e,t)=>{let r=await t.checkSchema(e),n=await t.getProjectArgs(e),i=oi(e.query,"query"),s=await(await yn(t.client,n)).dataClient.request(i,e.variables??{});return t.ok(Rt(s,r))},z8=async(e,t)=>ya("runtime.query",e,t,!1),Y8=async(e,t)=>ya("runtime.aggregate",e,t,!1),J8=async(e,t)=>ya("runtime.insert",e,t,!0),X8=async(e,t)=>ya("runtime.update",e,t,!0),Z8=async(e,t)=>ya("runtime.delete",e,t,!0),e6=async(e,t)=>{let r=await t.getProjectArgs(e),n=Zy("runtime.run_code",e),o=await(await yn(t.client,r)).adminClient.request(n.document,n.variables);return t.ok({keptWrites:n.variables.updateDb===!0,result:o?.fz_debug_action_code})},VN={"runtime.graphql":W8,"runtime.run_code":e6,"runtime.query":z8,"runtime.aggregate":Y8,"runtime.insert":J8,"runtime.update":X8,"runtime.delete":Z8};p();var t6=["GATEWAY","ACTION_FLOW","ACTION_FLOW_NODE","ACTION_FLOW_CONTEXT_LOG","DEPLOYMENT","TPA","TRIGGER","SQL_GENERATION","GQL","ZAI"],r6=["INFO","WARNING","ERROR"],n6=50,i6=100,GN=5,$N=e=>`${e.toISOString().slice(0,19)}Z`,o6=e=>{if(!e)return new Date;let t=new Date(e);return Number.isNaN(t.getTime())?new Date:t},BN=(e,t)=>{if(!e)return;let r=e.map(n=>n.toUpperCase()).filter(n=>t.includes(n));return r.length>0?r:void 0},s6=async(e,t)=>{let r=await t.getProjectArgs(e),{adminToken:n}=await yn(t.client,r),i=o6(K(e.requestCreatedAt)),o={start:$N(new Date(i.getTime()-GN*6e4)),end:$N(new Date(i.getTime()+GN*6e4)),desc:!0},s=BN(ii(e.types),t6);s&&(o.type=s);let a=BN(ii(e.levels),r6);a&&(o.level=a);let u=K(e.customQueryCondition);u&&(o.customQueryCondition=u);let c=Math.min(i6,Ue(e.limit,n6)),l=Nt().logApiUrlTemplate.replace("{projectExId}",r.projectExId),h=((await new Ze(l,{headers:{authorization:`Bearer ${n}`},fetch:vo}).request(U0,{queryCreation:o,paginator:{first:c}}))?.fetchLogsByPaginator?.edges??[]).map(g=>g?.node).filter(g=>!!g);return t.ok({entries:h})},KN={"logs.search":s6};p();p();var a6=async()=>(await import("./corpus-WPOJHLAU.js")).DOCS_CORPUS,u6=3,HN=null,c6=e=>{let t=new Map;for(let r of e)t.set(r.path,r);for(let r of e)for(let n of r.aliases??[])t.has(n)||t.set(n,r);return t},l6=e=>{let t=e.map(r=>{let n=ip(r.content),i=ip(r.title);for(let o=0;o<u6;o+=1)n.push(...i);return{ref:r,tokens:n}});return{index:Nv(t),byPath:c6(e)}},QN=async()=>(HN??=l6(await a6()),HN),WN=async(e,t=10)=>{let{index:r}=await QN();return Pv(r,e).filter(n=>n.score>0).sort((n,i)=>i.score-n.score).slice(0,Math.max(1,t)).map(n=>({path:n.ref.path,title:n.ref.title,url:n.ref.url}))},p6=e=>{let t=e.trim().replace(/\.mdx$/,"").replace(/^\/+/,"/").replace(/\/+$/,"");return t===""||t==="/"?"/":t.startsWith("/")?t:`/${t}`},zN=async e=>(await QN()).byPath.get(p6(e))??null;var d6=async(e,t)=>{let r=K(e.query);if(!r)throw new Error("query is required");let n=Ue(e.limit,10);return t.ok({results:await WN(r,n)})},f6=async(e,t)=>{let r=K(e.path);if(!r)throw new Error("path is required");let n=await zN(r);if(!n)throw new Error(`No doc page found for path: ${r}`);return t.ok(n)},YN={"docs.search":d6,"docs.get_page":f6};p();var si=je(ln(),1);var JN=["saveSchema","deployV2","validateSchemaIdIsLatest","addCodeComponentToProject","changeProjectCodeComponentVersion"],XN=(e,t)=>e.selections.flatMap(r=>{if(r.kind===si.Kind.FIELD)return[r.name.value];let n=r.kind===si.Kind.INLINE_FRAGMENT?r.selectionSet:t.get(r.name.value)?.selectionSet;return n?XN(n,t):[]}),h6=e=>{let t=(0,si.parse)(e),r=new Map;for(let i of t.definitions)i.kind===si.Kind.FRAGMENT_DEFINITION&&r.set(i.name.value,i);let n=new Set;for(let i of t.definitions)if(i.kind===si.Kind.OPERATION_DEFINITION&&i.operation!=="query")for(let o of XN(i.selectionSet,r))JN.includes(o)||n.add(o);return[...n]},m6=async(e,t)=>{let r=K(e.query);if(!r)throw new Error("query is required");let n=h6(r);if(n.length>0)throw new Error(`platform_graphql refused ${n.join(", ")}: queries pass through unchanged, but mutations are refused except the allow list for client builds and code component versions (${JN.join(", ")}). Make schema changes through ztype_tool_calls (CLI: schema tool-call), which validates each change before it is written.`);let i=e.variables&&typeof e.variables=="object"?e.variables:{};return t.ok(await t.client.request(r,i))},ZN={"platform.graphql":m6};p();var g6=async(e,t)=>{let r=await _t(),n=r?.api?.ZTypePredefinedApi;if(!n)return t.fail(new Error("ztype predefined template API is unavailable"));let o=n.getActionFlowTemplates(mo(r)).map(s=>({templateCodeId:s.preDefinedCodeId,displayName:s.displayName,group:s.directory,async:s.async,inputs:s.input,outputs:s.output}));return t.ok({templates:o})},eP={"actionflow.list_node_templates":g6};p();import{promises as tP}from"node:fs";import ev from"node:path";var y6=e=>{if(!e)return null;let t=e.split("?")[0]?.split("/").pop();if(!t)return null;let r=t.replace(/\.[a-z0-9]+$/i,"");return r.length>0?r:null},v6=async(e,t)=>{let n=(await t.client.request(zA)).getTabBarIcons.flatMap(i=>i?[{name:y6(i.url),exId:i.exId}]:[]);return t.ok({icons:n,note:n.length===0?"This deployment ships no preset tab-bar icons; upload one in the editor and use its exId.":"A name ending in _selected is the pressed-state partner of the icon with the same prefix; for the plain icons use the same exId for both states."})},E6=async(e,t)=>{let{base64:r,...n}=await Dl("CAPTURE",Ll(e),e,t);if(!r)return t.ok(n);let i=ev.resolve(K(e.out)??ev.join(t.credentialStore.getMcpConfigDir(),"canvas",`canvas-${Date.now()}.png`));return await tP.mkdir(ev.dirname(i),{recursive:!0}),await tP.writeFile(i,Buffer.from(r,"base64")),t.ok({path:i,...n})},rP={"component.tab_bar_icons":v6,"component.capture_canvas":E6};p();p();function _6(e){let t;try{t=new URL(e)}catch{throw new Error(`Unsupported or malformed URL: ${e}`)}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Error(`Only http/https URLs are allowed: ${e}`);return t}async function S6(e,t){let r=e.body?.getReader();if(!r)throw new Error(`Empty response body from ${t}`);let n=[],i=0;for(;;){let{done:o,value:s}=await r.read();if(o)break;if(i+=s.byteLength,i>10485760)throw await r.cancel(),new Error("Response exceeds size limit of 10485760 bytes");n.push(s)}return Buffer.concat(n).toString("utf8")}async function nP(e){let t=e;for(let r=0;r<=5;r++){let n=_6(t),i=await fetch(n,{redirect:"manual",signal:AbortSignal.timeout(2e4),headers:{Accept:"application/json, application/yaml, text/yaml, text/html, */*","User-Agent":"Momen-Agent-TpaImport"}});if(i.status>=300&&i.status<400){let o=i.headers.get("location");if(await i.body?.cancel(),!o)throw new Error(`Redirect without Location from ${t}`);t=new URL(o,n).toString();continue}if(!i.ok)throw await i.body?.cancel(),new Error(`HTTP ${i.status} fetching ${t}`);return{finalUrl:n.toString(),contentType:i.headers.get("content-type"),body:await S6(i,t)}}throw new Error(`Too many redirects fetching ${e}`)}p();var b6=/(?:href|src|url)\s*[=:]\s*["']?([^"'\s>)]+)/gi,T6=/<(script|style|noscript|svg|iframe|canvas|template|nav|footer|aside)\b[\s\S]*?<\/\1\s*>/gi,I6=new Set(["css","js","png","jpg","jpeg","gif","svg","ico","woff","woff2","ttf","webp","mp4","zip","pdf"]);function iP(e,t){if(e&&e.toLowerCase().includes("html"))return!0;let r=t.trimStart();return r.startsWith("<")&&!r.startsWith("<?xml")}function oP(e){let t=e.length>4e3?e.slice(0,4e3):e;return t.includes('"openapi"')||t.includes('"swagger"')||/(^|\n)\s*openapi\s*:/.test(t)||/(^|\n)\s*swagger\s*:/.test(t)}function sP(e,t){try{return new URL(t,e).toString()}catch{return t.startsWith("http")?t:null}}var w6=/^https?:\/\/app\.swaggerhub\.com\/apis(?:-docs)?\/([^/?#]+)\/([^/?#]+)\/([^/?#]+)/i;function O6(e){let t=e.match(w6);return t?`https://api.swaggerhub.com/apis/${t[1]}/${t[2]}/${t[3]}`:null}function aP(e,t){let r=[],n=i=>{i&&r.length<20&&!r.includes(i)&&r.push(i)};for(let i of e.matchAll(b6)){if(r.length>=20)break;let o=i[1],s=o.toLowerCase();if(!(s.includes("openapi")||s.includes("swagger")||(s.endsWith(".json")||s.endsWith(".yaml")||s.endsWith(".yml"))&&s.includes("api")))continue;let u=sP(t,o);n(u&&O6(u)),n(u)}return r}function uP(e,t){let r=[],n;try{n=new URL(t).host}catch{return r}for(let i of e.matchAll(/<a\b[^>]*href\s*=\s*["']([^"'#]+)[^"']*["']/gi)){if(r.length>=40)break;let o;try{o=new URL(i[1],t)}catch{continue}if(o.host!==n)continue;o.hash="";let s=o.toString(),a=o.pathname.toLowerCase(),u=a.slice(a.lastIndexOf(".")+1);I6.has(u)||s===t||r.includes(s)||r.push(s)}return r}var A6={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",copy:"\xA9"};function tv(e){return e.replace(/&#x([0-9a-f]+);/gi,(t,r)=>String.fromCodePoint(parseInt(r,16))).replace(/&#(\d+);/g,(t,r)=>String.fromCodePoint(parseInt(r,10))).replace(/&([a-z]+);/gi,(t,r)=>A6[r.toLowerCase()]??t)}var va=e=>e.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim();function cP(e,t){let r=e.replace(/<!--[\s\S]*?-->/g,"").replace(T6,"");return r=r.replace(/<pre\b[^>]*>([\s\S]*?)<\/pre\s*>/gi,(n,i)=>`
|
|
1420
1466
|
\`\`\`
|
|
1421
|
-
${
|
|
1467
|
+
${tv(x6(i))}
|
|
1422
1468
|
\`\`\`
|
|
1423
|
-
`),r=r.replace(/<code\b[^>]*>([\s\S]*?)<\/code\s*>/gi,(n,i)=>`\`${
|
|
1469
|
+
`),r=r.replace(/<code\b[^>]*>([\s\S]*?)<\/code\s*>/gi,(n,i)=>`\`${tv(va(i))}\``),r=r.replace(/<a\b[^>]*href\s*=\s*["']([^"']+)["'][^>]*>([\s\S]*?)<\/a\s*>/gi,(n,i,o)=>{let s=va(o);if(!s)return"";let a=sP(t,i);return a?`[${s}](${a})`:s}),r=r.replace(/<h([1-6])\b[^>]*>([\s\S]*?)<\/h\1\s*>/gi,(n,i,o)=>`
|
|
1424
1470
|
|
|
1425
1471
|
${"#".repeat(Number(i))} ${va(o)}
|
|
1426
1472
|
|
|
@@ -1429,25 +1475,25 @@ ${"#".repeat(Number(i))} ${va(o)}
|
|
|
1429
1475
|
- `).replace(/<br\s*\/?>/gi,`
|
|
1430
1476
|
`).replace(/<\/(p|div|section|article|ul|ol|table|thead|tbody|dl|blockquote)\s*>/gi,`
|
|
1431
1477
|
|
|
1432
|
-
`).replace(/<(strong|b)\b[^>]*>([\s\S]*?)<\/\1\s*>/gi,(n,i,o)=>`**${va(o)}**`),r=
|
|
1478
|
+
`).replace(/<(strong|b)\b[^>]*>([\s\S]*?)<\/\1\s*>/gi,(n,i,o)=>`**${va(o)}**`),r=tv(r.replace(/<[^>]+>/g," ")),r.replace(/[^\S\n]+\n/g,`
|
|
1433
1479
|
`).replace(/[ \t]{3,}/g," ").replace(/\n{3,}/g,`
|
|
1434
1480
|
|
|
1435
|
-
`).trim()}var I6=e=>e.replace(/<[^>]+>/g,"");var aP=15,O6=3600*1e3,sP=new Map;function A6(e){let t=Date.now(),r=sP.get(e),n=r&&t-r.startedAt<O6?r:{used:0,startedAt:t};return n.used+=1,sP.set(e,n),aP-n.used}var x6=async(e,t)=>{let r=K(e.url);if(!r||r.trim()==="")throw new Error("Provide a 'url' to fetch.");let n=A6(t.credentialStore.getWorkspaceRoot());if(n<0)throw new Error(`fetch budget exhausted (${aP} per session) \u2014 build the endpoints from what you have already read.`);let i=await ZN(r),o=eP(i.contentType,i.body),s=o?nP(i.body,i.finalUrl):[],a=o?iP(i.body,i.finalUrl):[],u=o?oP(i.body,i.finalUrl):i.body,c=Math.max(0,Math.min(Ue(e.offset,0),u.length)),l=u.slice(c,c+2e4);return t.ok({finalUrl:i.finalUrl,contentType:i.contentType,looksLikeSpec:tP(i.body),specLinks:s,pageLinks:a,truncated:c+l.length<u.length,totalLength:u.length,fetchesRemaining:n,content:l})},uP={"web.fetch_doc":x6};p();var C6=async(e,t)=>{let r=pe(e.secretId),n=pe(e.displayName),i=pe(e.description);if(!!r==!!n)return t.fail("Provide exactly one of secretId (set an existing secret) or displayName (create a new one).");let o=await t.checkSchema(e),s=await t.getProjectArgs(e),a=nr(s.projectExId,s),u=await t.schemaManager.serverSchemaExId(a);if(!u)throw new Error("A secret value is stored under the project's backend document, which this session could not load \u2014 `schema status` reports why in staleReason.");let c=await sN(n??r),d=(await t.client.request(w0,{projectExId:s.projectExId,schemaExId:u,secretValue:c})).saveSecret?.secretKey;if(!d)throw new Error("saveSecret did not return a secretKey.");let f=r?{name:"UPDATE_SECRET_CONFIG",args:{secretId:r,secretKey:d}}:{name:"ADD_SECRET_CONFIGS",args:{items:[{displayName:n,secretKey:d,...i?{description:i}:{}}]}},h=await t.schemaManager.ztypeToolCalls(a,[f],!1);return t.ok(Rt({status:"SAVED",applied:h},o))},cP={"secret.save_value":C6};p();p();p();import{createHash as R6}from"node:crypto";import Fl from"node:fs/promises";import ql from"node:path";var ir=class extends Error{},N6=1024,P6=255,D6=e=>{let t=e.slice(e.lastIndexOf("/")+1),r=t.lastIndexOf(".");return r<=0||r===t.length-1?null:t.slice(r+1).toLowerCase()},lP=(e,t)=>ql.relative(e,t).split(ql.sep).join("/").normalize("NFC"),L6=e=>{if(e.length>N6||e.startsWith("/")||e.endsWith("/")||e.includes("\\")||e.includes("//")||e.includes(":"))throw new ir(`Invalid asset path: ${e}`);for(let t of e.split("/"))if(t===""||t==="."||t===".."||t.length>P6)throw new ir(`Invalid asset path: ${e}`);for(let t of e){let r=t.charCodeAt(0);if(r<32||r===127)throw new ir(`Invalid asset path: ${e}`)}},k6=async e=>{let t=R6("md5"),r=await Fl.open(e,"r");try{let n=r.createReadStream();for await(let i of n)t.update(i)}finally{await r.close()}return t.digest("base64")},pP=async(e,t,r,n)=>{let i=await Fl.readdir(t,{withFileTypes:!0}),o=[],s=[];for(let a of i){let u=ql.join(t,a.name),c=n&&a.name.startsWith(".");if(a.isDirectory()){if(c||r.has(a.name)){s.push(`${lP(e,u)}/`);continue}let l=await pP(e,u,r,n);o.push(...l.files),s.push(...l.prunedDirectories)}else a.isFile()&&!c&&o.push(u)}return{files:o,prunedDirectories:s}};async function Ul(e,t,r={}){let n=ql.resolve(e);if(!(await Fl.stat(n).catch(()=>null))?.isDirectory())throw new ir(`Not a directory: ${n}`);let o=r.maxFileSizeBytes??t.maxFileSizeBytes,s=t.reservedFiles??new Set,a=await pP(n,n,t.ignoredDirectories??new Set,t.ignoreHidden??!1),u=a.files.sort(),c=[],l=[...a.prunedDirectories.sort()],d=[],f=0;for(let h of u){let g=lP(n,h);if(s.has(g)){d.push(g);continue}let v=D6(g);if(v===null||!t.allowedExtensions.has(v)){l.push(g);continue}L6(g);let{size:_}=await Fl.stat(h);if(_>o)throw new ir(`${g} is ${_} bytes, over the ${o}-byte per-file limit`);c.push({path:g,absolutePath:h,md5Base64:await k6(h),sizeBytes:_}),f+=_}if(c.length===0)throw new ir(`No uploadable files found under ${n}`);if(!c.some(h=>h.path===t.entryFile))throw new ir(`${n} has no ${t.entryFile} at its root \u2014 a ${t.label} deployment must have one. ${t.entryHint}`);if(t.maxFileCount!==void 0&&c.length>t.maxFileCount)throw new ir(`${n} holds ${c.length} uploadable files, over the ${t.maxFileCount}-file limit`);if(t.maxTotalBytes!==void 0&&f>t.maxTotalBytes)throw new ir(`${n} totals ${f} bytes, over the ${t.maxTotalBytes}-byte package limit`);return{files:c,totalBytes:f,skipped:l,reserved:d}}var j6=new Set(["html","htm","js","mjs","cjs","css","map","json","webmanifest","txt","xml","csv","wasm","pdf","svg","png","jpg","jpeg","gif","webp","avif","ico","bmp","woff","woff2","ttf","otf","eot","mp4","webm","mp3","wav","ogg"]),M6="index.html",F6=2*1024*1024*1024,q6={label:"static site",entryFile:M6,entryHint:"Point --dir at the build output directory (e.g. ./dist), not the project root.",allowedExtensions:j6,maxFileSizeBytes:F6};function dP(e,t={}){return Ul(e,q6,t)}p();import U6 from"node:fs/promises";var V6=12e4,G6=1e3/(1024*1024),fP=3,$6=500,B6=256*1024*1024,K6=e=>new Promise(t=>setTimeout(t,e)),H6=e=>e>=500||e===429,Q6=async(e,t,r)=>{let n=AbortSignal.timeout(Math.ceil(V6+t.byteLength*G6)),i=await fetch(e.uploadUrl,{method:"PUT",headers:e.headers,body:t,signal:r?AbortSignal.any([r,n]):n});if(!i.ok){let o=await i.text().catch(()=>""),s=new Error(`PUT ${e.path} failed with ${i.status}${o?`: ${o.slice(0,300)}`:""}`);throw H6(i.status)||Object.assign(s,{fatal:!0}),s}await i.body?.cancel()},W6=async(e,t,r)=>{let n=await U6.readFile(t),i;for(let o=1;o<=fP;o+=1)try{await Q6(e,n,r);return}catch(s){if(i=s,r?.aborted||s.fatal||o===fP)break;await K6($6*2**(o-1))}throw i},tv=class{constructor(t){this.limit=t}inFlight=0;waiters=[];async acquire(t){for(;this.inFlight>0&&this.inFlight+t>this.limit;)await new Promise(r=>this.waiters.push(r));this.inFlight+=t}release(t){this.inFlight-=t;let r=this.waiters;this.waiters=[];for(let n of r)n()}};async function Vl(e,t,r,n){let i=[],o=[],s=new tv(B6),a=0,u=async()=>{for(;;){if(n?.aborted)return;let l=a;if(a+=1,l>=e.length)return;let d=e[l],f=t(d.path);if(!f){o.push({path:d.path,error:"no local file matches this manifest path"});continue}await s.acquire(f.sizeBytes);try{await W6(d,f.absolutePath,n),i.push(d.path)}catch(h){o.push({path:d.path,error:h instanceof Error?h.message:String(h)})}finally{s.release(f.sizeBytes)}}},c=Math.max(1,Math.min(r,e.length));return await Promise.all(Array.from({length:c},()=>u())),{uploaded:i,failures:o}}var z6=8,Y6=32,hP=200,J6=6,X6=6e4,Z6=3,mP=e=>{let t=(K(e.target)??"BETA").toUpperCase();if(t!=="BETA"&&t!=="PROD")throw new Error(`target must be BETA or PROD, got ${t}`);return t},rv=async(e,t)=>{let r=await t.getProjectArgs(e),n=r.appExId??null;if(!n)throw new Error("site commands act on a client app, and this call resolved to the project itself. Pin one with set_current_project (appExId), or pass appExId here; take it from `project metadata` -> apps[], the entry whose appType is WEB. A project with no client app has no site domain and cannot host a static site.");return{projectExId:r.projectExId,appExId:n,target:mP(e)}},nv=(e,t)=>t.client.request(T0,e),gP=(e,t,r)=>r.client.request(S0,{projectExId:e.projectExId,appExId:e.appExId,staticSiteDeploymentExId:t}),yP=async(e,t,r,n)=>(await n.client.request(b0,{projectExId:e.projectExId,appExId:e.appExId,staticSiteDeploymentExId:t,dryRun:r})).completeStaticSiteDeployment,vP=async(e,t,r,n,i)=>{let o=await i.client.request(_0,{projectExId:e.projectExId,appExId:e.appExId,staticSiteDeploymentExId:t,offset:n?null:r,limit:n?null:hP,paths:n}),s=(o.staticSiteUploadUrls.items??[]).filter(u=>u!==null),a=s.map(u=>Date.parse(String(u.expiresAt??""))).filter(u=>Number.isFinite(u));return{targets:s.map(u=>({path:u.path??"",uploadUrl:u.uploadUrl??"",headers:u.headers??{}})),nextOffset:o.staticSiteUploadUrls.nextOffset??null,expiresAt:a.length?Math.min(...a):null}},eX=e=>e!==null&&e-X6<=Date.now(),tX=async(e,t,r,n,i,o)=>{let s=[],a=[],u=r;for(let c=1;;c+=1){let l=await Vl(u.targets,h=>n.get(h),i,o.signal);s.push(...l.uploaded);let f=eX(u.expiresAt)&&c<Z6&&!o.signal?.aborted?l.failures.filter(h=>n.has(h.path)):[];if(a.push(...l.failures.filter(h=>!f.includes(h))),f.length===0)return{uploaded:s,failures:a};u=await vP(e,t,null,f.map(h=>h.path),o)}},rX=async(e,t,r,n,i,o)=>{let s=[],a=[],u=i?null:0,c=i?[...i]:null;for(;;){o.signal?.throwIfAborted();let l=c?.splice(0,hP)??null;if(l&&l.length===0)break;let d=await vP(e,t,l?null:u,l,o),f=await tX(e,t,d,r,n,o);if(s.push(...f.uploaded),a.push(...f.failures),l)continue;let h=d.nextOffset;if(h!==null&&u!==null&&h<=u)throw new Error(`upload url pagination stalled at offset ${u} (server returned ${h})`);if(u=h,u===null)break}return{uploaded:s,failures:a}},nX=(e,t)=>{if(e.length!==t.length)return!1;let r=new Map(t.map(n=>[n.path??"",n.md5Base64??""]));return e.every(n=>r.get(n.path)===n.md5Base64)},iX=async(e,t,r,n)=>{let o=(await nv(e,n)).inProgressStaticSiteDeployment;if(o){if(!r&&nX(t,o.manifest))return{deploymentExId:o.exId,resumed:!0,resumedStatus:o.status};await gP(e,o.exId,n)}return{deploymentExId:(await n.client.request(E0,{projectExId:e.projectExId,appExId:e.appExId,target:e.target,files:t.map(a=>({path:a.path,md5Base64:a.md5Base64,sizeBytes:a.sizeBytes}))})).createStaticSiteDeployment.exId,resumed:!1,resumedStatus:null}},EP=e=>{let t=(e.missingPaths??[]).filter(r=>typeof r=="string");return e.missingCount>t.length?null:t},oX=async(e,t,r,n)=>r!=="UPLOADING"?null:EP(await yP(e,t,!0,n)),sX=async(e,t)=>{let r=oi(e.dir,"dir"),n=$e(e.dryRun,!1),i=$e(e.force,!1),o=mP(e),s=Math.max(1,Math.min(Ue(e.concurrency,z6),Y6)),a=await dP(r);if(n)return t.ok({dryRun:!0,target:o,fileCount:a.files.length,totalBytes:a.totalBytes,skipped:a.skipped,files:a.files.map(A=>({path:A.path,sizeBytes:A.sizeBytes}))});let u=await rv(e,t);u.target==="PROD"&&await ma(u.projectExId,e,"deploy to production",{allowForce:!1});let c=new Map(a.files.map(A=>[A.path,A])),{deploymentExId:l,resumed:d,resumedStatus:f}=await iX(u,a.files,i,t),h=d?await oX(u,l,f,t):null,g=new Set,v=[],_=null,S=Number.POSITIVE_INFINITY,b=0;for(let A=1;A<=J6;A+=1){b=A;let O=await rX(u,l,c,s,h,t);for(let T of O.uploaded)g.add(T);if(v=O.failures,_=await yP(u,l,!1,t),!_.incomplete||_.missingCount>=S||(S=_.missingCount,h=EP(_),h?.length===0))break}return!_||_.incomplete?t.fail(new Error(`deployment ${l} is still missing ${_?.missingCount??"?"} file(s) after ${b} upload pass(es): ${(_?.missingPaths??[]).slice(0,10).join(", ")}${v.length?`; upload errors: ${v[0].error}`:""}. Re-run to resume, or pass force=true to start over.`)):t.ok({deploymentExId:l,target:u.target,resumed:d,fileCount:a.files.length,totalBytes:a.totalBytes,uploaded:g.size,skipped:a.skipped,siteUrl:_.siteUrl,previousDeploymentExId:_.previousDeploymentExId,...v.length?{uploadRetries:v}:{}})},aX=async(e,t)=>{let r=await rv(e,t),n=await nv(r,t);return t.ok({target:r.target,inProgress:n.inProgressStaticSiteDeployment?{deploymentExId:n.inProgressStaticSiteDeployment.exId,status:n.inProgressStaticSiteDeployment.status,fileCount:n.inProgressStaticSiteDeployment.fileCount,totalBytes:n.inProgressStaticSiteDeployment.totalBytes,createdAt:n.inProgressStaticSiteDeployment.createdAt}:null,active:n.activeStaticSiteDeployment?{deploymentExId:n.activeStaticSiteDeployment.exId,siteUrl:n.activeStaticSiteDeployment.siteUrl,fileCount:n.activeStaticSiteDeployment.fileCount,totalBytes:n.activeStaticSiteDeployment.totalBytes,activatedAt:n.activeStaticSiteDeployment.activatedAt}:null})},uX=async(e,t)=>{let r=await rv(e,t),i=K(e.deploymentExId)??(await nv(r,t)).inProgressStaticSiteDeployment?.exId;if(!i)return t.ok({target:r.target,aborted:null},"no in-progress deployment to abort");let o=await gP(r,i,t);return t.ok({deploymentExId:i,target:r.target,status:o.abortStaticSiteDeployment.status})},_P={"site.deploy":sX,"site.status":aX,"site.abort":uX};p();import TP from"node:fs/promises";import IP from"node:path";p();var cX=new Set(["js","ts","json","wxml","wxss","wxs","png","jpg","jpeg","gif","svg","webp","ico","ttf","otf","woff","woff2","mp3","mp4","wasm","cer","txt"]),lX=new Set(["project.config.json","project.private.config.json"]),pX=new Set(["node_modules"]),dX="app.json",fX=5e3,bP=20*1024*1024,hX={label:"WeChat mini program source",entryFile:dX,entryHint:"Point --dir at the mini program root (the directory holding app.js / app.json / app.wxss).",allowedExtensions:cX,ignoredDirectories:pX,ignoreHidden:!0,reservedFiles:lX,maxFileSizeBytes:bP,maxFileCount:fX,maxTotalBytes:bP};function SP(e,t={}){return Ul(e,hX,t)}var mX=8,gX=32,wP=200,yX=6,vX=6e4,EX=3,_X=900,bX=5e3,OP="wechat-trial-qrcode.jpg",Gl=async(e,t)=>{let r=await t.getProjectArgs(e),n=r.appExId??null;if(!n)throw new Error("wechat commands act on a mini program app, and this call resolved to the project itself. Pin one with set_current_project (appExId), or pass appExId here; take it from `project metadata` -> apps[], the entry whose appType is WECHAT_MINI_PROGRAM. A project without that client app has no mini program to upload.");return{projectExId:r.projectExId,appExId:n}},iv=(e,t)=>t.client.request(R0,e),AP=(e,t,r)=>r.client.request(C0,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t}),xP=async(e,t,r,n)=>(await n.client.request(x0,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t,dryRun:r})).completeWechatSourceCodeUpload,CP=async(e,t,r,n,i)=>{let o=await i.client.request(A0,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t,offset:n?null:r,limit:n?null:wP,paths:n}),s=(o.wechatSourceCodeUploadUrls.items??[]).filter(u=>u!==null),a=s.map(u=>Date.parse(String(u.expiresAt??""))).filter(u=>Number.isFinite(u));return{targets:s.map(u=>({path:u.path??"",uploadUrl:u.uploadUrl??"",headers:u.headers??{}})),nextOffset:o.wechatSourceCodeUploadUrls.nextOffset??null,expiresAt:a.length?Math.min(...a):null}},SX=e=>e!==null&&e-vX<=Date.now(),TX=async(e,t,r,n,i,o)=>{let s=[],a=[],u=r;for(let c=1;;c+=1){let l=await Vl(u.targets,h=>n.get(h),i,o.signal);s.push(...l.uploaded);let f=SX(u.expiresAt)&&c<EX&&!o.signal?.aborted?l.failures.filter(h=>n.has(h.path)):[];if(a.push(...l.failures.filter(h=>!f.includes(h))),f.length===0)return{uploaded:s,failures:a};u=await CP(e,t,null,f.map(h=>h.path),o)}},IX=async(e,t,r,n,i,o)=>{let s=[],a=[],u=i?null:0,c=i?[...i]:null;for(;;){o.signal?.throwIfAborted();let l=c?.splice(0,wP)??null;if(l&&l.length===0)break;let d=await CP(e,t,l?null:u,l,o),f=await TX(e,t,d,r,n,o);if(s.push(...f.uploaded),a.push(...f.failures),l)continue;let h=d.nextOffset;if(h!==null&&u!==null&&h<=u)throw new Error(`upload url pagination stalled at offset ${u} (server returned ${h})`);if(u=h,u===null)break}return{uploaded:s,failures:a}},wX=(e,t)=>{if(e.length!==t.length)return!1;let r=new Map(t.map(n=>[n.path??"",n.md5Base64??""]));return e.every(n=>r.get(n.path)===n.md5Base64)},OX=async(e,t,r,n)=>{let i=await iv(e,n),o=i.buildingWechatSourceCodeDeployment;if(o)throw new Error(`deployment ${o.exId} is already BUILDING (started ${o.buildStartedAt}) \u2014 a build cannot be aborted and blocks the next upload. Wait for it to finish, then re-run.`);let s=i.inProgressWechatSourceCodeDeployment;if(s){if(!r&&wX(t,s.manifest))return{deploymentExId:s.exId,resumed:!0,resumedStatus:s.status};await AP(e,s.exId,n)}return{deploymentExId:(await n.client.request(O0,{projectExId:e.projectExId,appExId:e.appExId,files:t.map(u=>({path:u.path,md5Base64:u.md5Base64,sizeBytes:u.sizeBytes}))})).createWechatSourceCodeDeployment.exId,resumed:!1,resumedStatus:null}},RP=e=>{let t=(e.missingPaths??[]).filter(r=>typeof r=="string");return e.missingCount>t.length?null:t},AX=async(e,t,r,n)=>r!=="UPLOADING"?null:RP(await xP(e,t,!0,n)),xX=async(e,t,r)=>(await r.client.request(N0,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t})).wechatSourceCodeDeployment,NP=async(e,t)=>(await t.client.request(P0,{projectExId:e.projectExId})).project,CX=async(e,t)=>(await t.client.request(D0,{projectExId:e.projectExId})).project,RX=(e,t)=>new Promise((r,n)=>{let i=setTimeout(()=>{t?.removeEventListener("abort",o),r()},e),o=()=>{clearTimeout(i),n(t?.reason??new Error("aborted"))};if(t?.aborted){o();return}t?.addEventListener("abort",o,{once:!0})}),PP=async(e,t)=>{let r=IP.resolve(t),n=Buffer.from(e,"base64");return await TP.mkdir(IP.dirname(r),{recursive:!0}),await TP.writeFile(r,n),{qrCodePath:r,qrCodeBytes:n.length}},NX=async(e,t,r,n)=>{let i=Date.now(),o=i+r*1e3;for(;;){n.signal?.throwIfAborted();let a=(await xX(e,t,n))?.status??null,u=Math.round((Date.now()-i)/1e3);if(a!=="BUILDING"&&a!=="UPLOADING")return{status:a,timedOut:!1,waitedSeconds:u};if(Date.now()>=o)return{status:a,timedOut:!0,waitedSeconds:u};await RX(Math.min(bX,Math.max(0,o-Date.now())),n.signal)}},PX=async(e,t)=>{let r=oi(e.dir,"dir"),n=$e(e.dryRun,!1),i=$e(e.force,!1),o=$e(e.wait,!0),s=Math.max(0,Ue(e.timeoutSeconds,_X)),a=K(e.qrOut)??OP,u=Math.max(1,Math.min(Ue(e.concurrency,mX),gX)),c=await SP(r);if(n)return t.ok({dryRun:!0,fileCount:c.files.length,totalBytes:c.totalBytes,skipped:c.skipped,serverManaged:c.reserved,files:c.files.map(de=>({path:de.path,sizeBytes:de.sizeBytes}))});let l=await Gl(e,t),d=new Map(c.files.map(de=>[de.path,de])),{deploymentExId:f,resumed:h,resumedStatus:g}=await OX(l,c.files,i,t),v=h?await AX(l,f,g,t):null,_=new Set,S=[],b=null,A=Number.POSITIVE_INFINITY,O=0;for(let de=1;de<=yX;de+=1){O=de;let ye=await IX(l,f,d,u,v,t);for(let I of ye.uploaded)_.add(I);if(S=ye.failures,b=await xP(l,f,!1,t),!b.incomplete||b.missingCount>=A||(A=b.missingCount,v=RP(b),v?.length===0))break}if(!b||b.incomplete)return t.fail(new Error(`deployment ${f} is still missing ${b?.missingCount??"?"} file(s) after ${O} upload pass(es): ${(b?.missingPaths??[]).slice(0,10).join(", ")}${S.length?`; upload errors: ${S[0].error}`:""}. Re-run to resume, or pass force=true to start over.`));let T={deploymentExId:f,resumed:h,fileCount:c.files.length,totalBytes:c.totalBytes,uploaded:_.size,skipped:c.skipped,serverManaged:c.reserved,deploymentRecordExId:b.deploymentRecordExId,...S.length?{uploadRetries:S}:{}};if(!o)return t.ok({...T,status:b.status,waited:!1});let x=await NX(l,f,s,t);if(x.timedOut)return t.ok({...T,status:x.status,waited:!0,timedOut:!0,waitedSeconds:x.waitedSeconds},`build is still running after ${x.waitedSeconds}s \u2014 poll \`wechat status\` for the trial version`);if(x.status!=="SUCCEEDED")return t.fail(new Error(`deployment ${f} ended in ${x.status} after ${x.waitedSeconds}s. The upload landed but the WeChat build did not succeed; check the deployment record ${b.deploymentRecordExId??"(none)"} for the failure.`));let U=await NP(l,t),C=U?.wechatMiniAppQRCodeBase64??null,te=C?await PP(C,a):null;return t.ok({...T,status:x.status,waited:!0,waitedSeconds:x.waitedSeconds,trialVersion:U?.wechatMiniAppPreviewVersion??null,trialVersionCommittedAt:U?.wechatMiniAppPreviewTime??null,...te??{qrCodePath:null}})},DX=async(e,t)=>{let r=await Gl(e,t),n=await iv(r,t),i=await CX(r,t);return t.ok({trial:{version:i?.wechatMiniAppPreviewVersion??null,committedAt:i?.wechatMiniAppPreviewTime??null},inProgress:n.inProgressWechatSourceCodeDeployment?{deploymentExId:n.inProgressWechatSourceCodeDeployment.exId,status:n.inProgressWechatSourceCodeDeployment.status,fileCount:n.inProgressWechatSourceCodeDeployment.fileCount,totalBytes:n.inProgressWechatSourceCodeDeployment.totalBytes,createdAt:n.inProgressWechatSourceCodeDeployment.createdAt,lastUploadUrlIssuedAt:n.inProgressWechatSourceCodeDeployment.lastUploadUrlIssuedAt}:null,building:n.buildingWechatSourceCodeDeployment?{deploymentExId:n.buildingWechatSourceCodeDeployment.exId,status:n.buildingWechatSourceCodeDeployment.status,fileCount:n.buildingWechatSourceCodeDeployment.fileCount,totalBytes:n.buildingWechatSourceCodeDeployment.totalBytes,buildStartedAt:n.buildingWechatSourceCodeDeployment.buildStartedAt,deploymentRecordExId:n.buildingWechatSourceCodeDeployment.deploymentRecordExId}:null})},LX=async(e,t)=>{let r=await Gl(e,t),i=K(e.deploymentExId)??(await iv(r,t)).inProgressWechatSourceCodeDeployment?.exId;if(!i)return t.ok({aborted:null},"no in-progress upload to abort");let o=await AP(r,i,t);return t.ok({deploymentExId:i,status:o.abortWechatSourceCodeDeployment.status})},kX=async(e,t)=>{let r=await Gl(e,t),n=K(e.out)??OP,i=await NP(r,t),o=i?.wechatMiniAppQRCodeBase64??null;if(!o)return t.fail(new Error("no trial version QR code is available for this project yet \u2014 run `wechat deploy` and let the build finish first."));let s=await PP(o,n);return t.ok({...s,trialVersion:i?.wechatMiniAppPreviewVersion??null,trialVersionCommittedAt:i?.wechatMiniAppPreviewTime??null})},DP={"wechat.deploy":PX,"wechat.status":DX,"wechat.abort":LX,"wechat.qrcode":kX};p();var LP={...zR,...nN,...cN,...lN,..._N,...MN,...VN,...HN,...zN,...YN,...XN,...uP,...cP,..._P,...DP};p();p();var jX=new Map([["claude-code","Claude Code"],["codex-mcp-client","Codex"]]);function kP(e){let t=typeof e?.name=="string"?e.name:"",r=typeof e?.title=="string"?e.title:"";return jX.get(t)??(r||t||"the coding agent")}function $l(e="the coding agent"){return`quit ${e} completely and open it again (starting a new chat in the same window may keep the old tools)`}function ai(e,t,r){let n=`${Y} ${e.current} is older than the minimum supported version ${e.minSupported} (latest ${e.latest})`,i=t?`, and upgrading it automatically failed: ${t}`:"";return`${n}${i}. Calls to the backend keep failing until it is upgraded, so stop retrying and tell the user, in their language: update the ${Sv} plugin from the plugin marketplace (or run \`npm i -g ${Y}@latest\` if ${Y} was installed with npm), then ${$l(r)} so it starts the new version.`}function jP(e){return`This project's schema was saved by a newer editor than ${Y} ${e} can read, and no ${Y} release that can read it has been published yet, so updating or restarting will not help for now, and neither will retrying. Stop and tell the user, in their language, that this project cannot be edited through ${Y} until a newer release comes out; they can keep working on it in the editor meanwhile.`}function MP(e,t){return`${Y} is upgrading itself from ${e} to ${t} in the background because the backend no longer supports ${e}. Nothing is broken and the user does not need to do anything: retry this call in about a minute.`}function FP(e,t,r){return`Note: ${Y} upgraded itself from ${e} to ${t} during this session and ran this call on ${t}, but ${r} did not reload its tool list, so tools added in ${t} are not visible to you. Tell the user once, in their language, that ${Y} was upgraded and that to use the new version's tools they should ${$l(r)}. Then carry on with their request; everything that worked before still works.`}function qP(e,t,r,n){let i=$l(r);return n.upgradedFrom&&n.toolListReloaded?`${Y} has no tool ${e}. ${Y} upgraded itself from ${n.upgradedFrom} to ${t} during this session and ${r} has already reloaded its tool list, so ${e} was from the old list: use the tools you have now instead. The user does not need to restart anything.`:n.upgradedFrom?`${Y} has no tool ${e}. ${Y} upgraded itself from ${n.upgradedFrom} to ${t} during this session, so your tool list is still the ${n.upgradedFrom} one. Tell the user, in their language, to ${i} so you get the current tools, then try again.`:`${Y} ${t} has no tool ${e}. Use only the tools in your current tool list; if that list was loaded from another ${Y} version, tell the user, in their language, to ${i}, then try again.`}function UP(e,t,r,n){return n?`${Y} upgraded itself from ${e} to ${t} during this session and ${r} has already reloaded its tool list, so check this tool's current arguments and try again.`:`${Y} upgraded itself from ${e} to ${t} during this session, so this tool's arguments may have changed since your tool list was loaded. If the error does not make sense against your tool list, tell the user, in their language, to ${$l(r)}.`}var MX=$`
|
|
1481
|
+
`).trim()}var x6=e=>e.replace(/<[^>]+>/g,"");var pP=15,R6=3600*1e3,lP=new Map;function N6(e){let t=Date.now(),r=lP.get(e),n=r&&t-r.startedAt<R6?r:{used:0,startedAt:t};return n.used+=1,lP.set(e,n),pP-n.used}var P6=async(e,t)=>{let r=K(e.url);if(!r||r.trim()==="")throw new Error("Provide a 'url' to fetch.");let n=N6(t.credentialStore.getWorkspaceRoot());if(n<0)throw new Error(`fetch budget exhausted (${pP} per session) \u2014 build the endpoints from what you have already read.`);let i=await nP(r),o=iP(i.contentType,i.body),s=o?aP(i.body,i.finalUrl):[],a=o?uP(i.body,i.finalUrl):[],u=o?cP(i.body,i.finalUrl):i.body,c=Math.max(0,Math.min(Ue(e.offset,0),u.length)),l=u.slice(c,c+2e4);return t.ok({finalUrl:i.finalUrl,contentType:i.contentType,looksLikeSpec:oP(i.body),specLinks:s,pageLinks:a,truncated:c+l.length<u.length,totalLength:u.length,fetchesRemaining:n,content:l})},dP={"web.fetch_doc":P6};p();var D6=async(e,t)=>{let r=pe(e.secretId),n=pe(e.displayName),i=pe(e.description);if(!!r==!!n)return t.fail("Provide exactly one of secretId (set an existing secret) or displayName (create a new one).");let o=await t.checkSchema(e),s=await t.getProjectArgs(e),a=nr(s.projectExId,s),u=await t.schemaManager.serverSchemaExId(a);if(!u)throw new Error("A secret value is stored under the project's backend document, which this session could not load \u2014 `schema status` reports why in staleReason.");let c=await lN(n??r),d=(await t.client.request(C0,{projectExId:s.projectExId,schemaExId:u,secretValue:c})).saveSecret?.secretKey;if(!d)throw new Error("saveSecret did not return a secretKey.");let f=r?{name:"UPDATE_SECRET_CONFIG",args:{secretId:r,secretKey:d}}:{name:"ADD_SECRET_CONFIGS",args:{items:[{displayName:n,secretKey:d,...i?{description:i}:{}}]}},h=await t.schemaManager.ztypeToolCalls(a,[f],!1);return t.ok(Rt({status:"SAVED",applied:h},o))},fP={"secret.save_value":D6};p();p();p();import{createHash as L6}from"node:crypto";import Fl from"node:fs/promises";import ql from"node:path";var ir=class extends Error{},k6=1024,j6=255,M6=e=>{let t=e.slice(e.lastIndexOf("/")+1),r=t.lastIndexOf(".");return r<=0||r===t.length-1?null:t.slice(r+1).toLowerCase()},hP=(e,t)=>ql.relative(e,t).split(ql.sep).join("/").normalize("NFC"),F6=e=>{if(e.length>k6||e.startsWith("/")||e.endsWith("/")||e.includes("\\")||e.includes("//")||e.includes(":"))throw new ir(`Invalid asset path: ${e}`);for(let t of e.split("/"))if(t===""||t==="."||t===".."||t.length>j6)throw new ir(`Invalid asset path: ${e}`);for(let t of e){let r=t.charCodeAt(0);if(r<32||r===127)throw new ir(`Invalid asset path: ${e}`)}},q6=async e=>{let t=L6("md5"),r=await Fl.open(e,"r");try{let n=r.createReadStream();for await(let i of n)t.update(i)}finally{await r.close()}return t.digest("base64")},mP=async(e,t,r,n)=>{let i=await Fl.readdir(t,{withFileTypes:!0}),o=[],s=[];for(let a of i){let u=ql.join(t,a.name),c=n&&a.name.startsWith(".");if(a.isDirectory()){if(c||r.has(a.name)){s.push(`${hP(e,u)}/`);continue}let l=await mP(e,u,r,n);o.push(...l.files),s.push(...l.prunedDirectories)}else a.isFile()&&!c&&o.push(u)}return{files:o,prunedDirectories:s}};async function Ul(e,t,r={}){let n=ql.resolve(e);if(!(await Fl.stat(n).catch(()=>null))?.isDirectory())throw new ir(`Not a directory: ${n}`);let o=r.maxFileSizeBytes??t.maxFileSizeBytes,s=t.reservedFiles??new Set,a=await mP(n,n,t.ignoredDirectories??new Set,t.ignoreHidden??!1),u=a.files.sort(),c=[],l=[...a.prunedDirectories.sort()],d=[],f=0;for(let h of u){let g=hP(n,h);if(s.has(g)){d.push(g);continue}let v=M6(g);if(v===null||!t.allowedExtensions.has(v)){l.push(g);continue}F6(g);let{size:_}=await Fl.stat(h);if(_>o)throw new ir(`${g} is ${_} bytes, over the ${o}-byte per-file limit`);c.push({path:g,absolutePath:h,md5Base64:await q6(h),sizeBytes:_}),f+=_}if(c.length===0)throw new ir(`No uploadable files found under ${n}`);if(!c.some(h=>h.path===t.entryFile))throw new ir(`${n} has no ${t.entryFile} at its root \u2014 a ${t.label} deployment must have one. ${t.entryHint}`);if(t.maxFileCount!==void 0&&c.length>t.maxFileCount)throw new ir(`${n} holds ${c.length} uploadable files, over the ${t.maxFileCount}-file limit`);if(t.maxTotalBytes!==void 0&&f>t.maxTotalBytes)throw new ir(`${n} totals ${f} bytes, over the ${t.maxTotalBytes}-byte package limit`);return{files:c,totalBytes:f,skipped:l,reserved:d}}var U6=new Set(["html","htm","js","mjs","cjs","css","map","json","webmanifest","txt","xml","csv","wasm","pdf","svg","png","jpg","jpeg","gif","webp","avif","ico","bmp","woff","woff2","ttf","otf","eot","mp4","webm","mp3","wav","ogg"]),V6="index.html",G6=2*1024*1024*1024,$6={label:"static site",entryFile:V6,entryHint:"Point --dir at the build output directory (e.g. ./dist), not the project root.",allowedExtensions:U6,maxFileSizeBytes:G6};function gP(e,t={}){return Ul(e,$6,t)}p();import B6 from"node:fs/promises";var K6=12e4,H6=1e3/(1024*1024),yP=3,Q6=500,W6=256*1024*1024,z6=e=>new Promise(t=>setTimeout(t,e)),Y6=e=>e>=500||e===429,J6=async(e,t,r)=>{let n=AbortSignal.timeout(Math.ceil(K6+t.byteLength*H6)),i=await fetch(e.uploadUrl,{method:"PUT",headers:e.headers,body:t,signal:r?AbortSignal.any([r,n]):n});if(!i.ok){let o=await i.text().catch(()=>""),s=new Error(`PUT ${e.path} failed with ${i.status}${o?`: ${o.slice(0,300)}`:""}`);throw Y6(i.status)||Object.assign(s,{fatal:!0}),s}await i.body?.cancel()},X6=async(e,t,r)=>{let n=await B6.readFile(t),i;for(let o=1;o<=yP;o+=1)try{await J6(e,n,r);return}catch(s){if(i=s,r?.aborted||s.fatal||o===yP)break;await z6(Q6*2**(o-1))}throw i},rv=class{constructor(t){this.limit=t}inFlight=0;waiters=[];async acquire(t){for(;this.inFlight>0&&this.inFlight+t>this.limit;)await new Promise(r=>this.waiters.push(r));this.inFlight+=t}release(t){this.inFlight-=t;let r=this.waiters;this.waiters=[];for(let n of r)n()}};async function Vl(e,t,r,n){let i=[],o=[],s=new rv(W6),a=0,u=async()=>{for(;;){if(n?.aborted)return;let l=a;if(a+=1,l>=e.length)return;let d=e[l],f=t(d.path);if(!f){o.push({path:d.path,error:"no local file matches this manifest path"});continue}await s.acquire(f.sizeBytes);try{await X6(d,f.absolutePath,n),i.push(d.path)}catch(h){o.push({path:d.path,error:h instanceof Error?h.message:String(h)})}finally{s.release(f.sizeBytes)}}},c=Math.max(1,Math.min(r,e.length));return await Promise.all(Array.from({length:c},()=>u())),{uploaded:i,failures:o}}var Z6=8,eX=32,vP=200,tX=6,rX=6e4,nX=3,EP=e=>{let t=(K(e.target)??"BETA").toUpperCase();if(t!=="BETA"&&t!=="PROD")throw new Error(`target must be BETA or PROD, got ${t}`);return t},nv=async(e,t)=>{let r=await t.getProjectArgs(e),n=r.appExId??null;if(!n)throw new Error("site commands act on a client app, and this call resolved to the project itself. Pin one with set_current_project (appExId), or pass appExId here; take it from `project metadata` -> apps[], the entry whose appType is WEB. A project with no client app has no site domain and cannot host a static site.");return{projectExId:r.projectExId,appExId:n,target:EP(e)}},iv=(e,t)=>t.client.request(A0,e),_P=(e,t,r)=>r.client.request(O0,{projectExId:e.projectExId,appExId:e.appExId,staticSiteDeploymentExId:t}),SP=async(e,t,r,n)=>(await n.client.request(w0,{projectExId:e.projectExId,appExId:e.appExId,staticSiteDeploymentExId:t,dryRun:r})).completeStaticSiteDeployment,bP=async(e,t,r,n,i)=>{let o=await i.client.request(I0,{projectExId:e.projectExId,appExId:e.appExId,staticSiteDeploymentExId:t,offset:n?null:r,limit:n?null:vP,paths:n}),s=(o.staticSiteUploadUrls.items??[]).filter(u=>u!==null),a=s.map(u=>Date.parse(String(u.expiresAt??""))).filter(u=>Number.isFinite(u));return{targets:s.map(u=>({path:u.path??"",uploadUrl:u.uploadUrl??"",headers:u.headers??{}})),nextOffset:o.staticSiteUploadUrls.nextOffset??null,expiresAt:a.length?Math.min(...a):null}},iX=e=>e!==null&&e-rX<=Date.now(),oX=async(e,t,r,n,i,o)=>{let s=[],a=[],u=r;for(let c=1;;c+=1){let l=await Vl(u.targets,h=>n.get(h),i,o.signal);s.push(...l.uploaded);let f=iX(u.expiresAt)&&c<nX&&!o.signal?.aborted?l.failures.filter(h=>n.has(h.path)):[];if(a.push(...l.failures.filter(h=>!f.includes(h))),f.length===0)return{uploaded:s,failures:a};u=await bP(e,t,null,f.map(h=>h.path),o)}},sX=async(e,t,r,n,i,o)=>{let s=[],a=[],u=i?null:0,c=i?[...i]:null;for(;;){o.signal?.throwIfAborted();let l=c?.splice(0,vP)??null;if(l&&l.length===0)break;let d=await bP(e,t,l?null:u,l,o),f=await oX(e,t,d,r,n,o);if(s.push(...f.uploaded),a.push(...f.failures),l)continue;let h=d.nextOffset;if(h!==null&&u!==null&&h<=u)throw new Error(`upload url pagination stalled at offset ${u} (server returned ${h})`);if(u=h,u===null)break}return{uploaded:s,failures:a}},aX=(e,t)=>{if(e.length!==t.length)return!1;let r=new Map(t.map(n=>[n.path??"",n.md5Base64??""]));return e.every(n=>r.get(n.path)===n.md5Base64)},uX=async(e,t,r,n)=>{let o=(await iv(e,n)).inProgressStaticSiteDeployment;if(o){if(!r&&aX(t,o.manifest))return{deploymentExId:o.exId,resumed:!0,resumedStatus:o.status};await _P(e,o.exId,n)}return{deploymentExId:(await n.client.request(T0,{projectExId:e.projectExId,appExId:e.appExId,target:e.target,files:t.map(a=>({path:a.path,md5Base64:a.md5Base64,sizeBytes:a.sizeBytes}))})).createStaticSiteDeployment.exId,resumed:!1,resumedStatus:null}},TP=e=>{let t=(e.missingPaths??[]).filter(r=>typeof r=="string");return e.missingCount>t.length?null:t},cX=async(e,t,r,n)=>r!=="UPLOADING"?null:TP(await SP(e,t,!0,n)),lX=async(e,t)=>{let r=oi(e.dir,"dir"),n=$e(e.dryRun,!1),i=$e(e.force,!1),o=EP(e),s=Math.max(1,Math.min(Ue(e.concurrency,Z6),eX)),a=await gP(r);if(n)return t.ok({dryRun:!0,target:o,fileCount:a.files.length,totalBytes:a.totalBytes,skipped:a.skipped,files:a.files.map(I=>({path:I.path,sizeBytes:I.sizeBytes}))});let u=await nv(e,t);u.target==="PROD"&&await ma(u.projectExId,e,"deploy to production",{allowForce:!1});let c=new Map(a.files.map(I=>[I.path,I])),{deploymentExId:l,resumed:d,resumedStatus:f}=await uX(u,a.files,i,t),h=d?await cX(u,l,f,t):null,g=new Set,v=[],_=null,b=Number.POSITIVE_INFINITY,S=0;for(let I=1;I<=tX;I+=1){S=I;let A=await sX(u,l,c,s,h,t);for(let T of A.uploaded)g.add(T);if(v=A.failures,_=await SP(u,l,!1,t),!_.incomplete||_.missingCount>=b||(b=_.missingCount,h=TP(_),h?.length===0))break}return!_||_.incomplete?t.fail(new Error(`deployment ${l} is still missing ${_?.missingCount??"?"} file(s) after ${S} upload pass(es): ${(_?.missingPaths??[]).slice(0,10).join(", ")}${v.length?`; upload errors: ${v[0].error}`:""}. Re-run to resume, or pass force=true to start over.`)):t.ok({deploymentExId:l,target:u.target,resumed:d,fileCount:a.files.length,totalBytes:a.totalBytes,uploaded:g.size,skipped:a.skipped,siteUrl:_.siteUrl,previousDeploymentExId:_.previousDeploymentExId,...v.length?{uploadRetries:v}:{}})},pX=async(e,t)=>{let r=await nv(e,t),n=await iv(r,t);return t.ok({target:r.target,inProgress:n.inProgressStaticSiteDeployment?{deploymentExId:n.inProgressStaticSiteDeployment.exId,status:n.inProgressStaticSiteDeployment.status,fileCount:n.inProgressStaticSiteDeployment.fileCount,totalBytes:n.inProgressStaticSiteDeployment.totalBytes,createdAt:n.inProgressStaticSiteDeployment.createdAt}:null,active:n.activeStaticSiteDeployment?{deploymentExId:n.activeStaticSiteDeployment.exId,siteUrl:n.activeStaticSiteDeployment.siteUrl,fileCount:n.activeStaticSiteDeployment.fileCount,totalBytes:n.activeStaticSiteDeployment.totalBytes,activatedAt:n.activeStaticSiteDeployment.activatedAt}:null})},dX=async(e,t)=>{let r=await nv(e,t),i=K(e.deploymentExId)??(await iv(r,t)).inProgressStaticSiteDeployment?.exId;if(!i)return t.ok({target:r.target,aborted:null},"no in-progress deployment to abort");let o=await _P(r,i,t);return t.ok({deploymentExId:i,target:r.target,status:o.abortStaticSiteDeployment.status})},IP={"site.deploy":lX,"site.status":pX,"site.abort":dX};p();import AP from"node:fs/promises";import xP from"node:path";p();var fX=new Set(["js","ts","json","wxml","wxss","wxs","png","jpg","jpeg","gif","svg","webp","ico","ttf","otf","woff","woff2","mp3","mp4","wasm","cer","txt"]),hX=new Set(["project.config.json","project.private.config.json"]),mX=new Set(["node_modules"]),gX="app.json",yX=5e3,wP=20*1024*1024,vX={label:"WeChat mini program source",entryFile:gX,entryHint:"Point --dir at the mini program root (the directory holding app.js / app.json / app.wxss).",allowedExtensions:fX,ignoredDirectories:mX,ignoreHidden:!0,reservedFiles:hX,maxFileSizeBytes:wP,maxFileCount:yX,maxTotalBytes:wP};function OP(e,t={}){return Ul(e,vX,t)}var EX=8,_X=32,CP=200,SX=6,bX=6e4,TX=3,IX=900,wX=5e3,RP="wechat-trial-qrcode.jpg",Gl=async(e,t)=>{let r=await t.getProjectArgs(e),n=r.appExId??null;if(!n)throw new Error("wechat commands act on a mini program app, and this call resolved to the project itself. Pin one with set_current_project (appExId), or pass appExId here; take it from `project metadata` -> apps[], the entry whose appType is WECHAT_MINI_PROGRAM. A project without that client app has no mini program to upload.");return{projectExId:r.projectExId,appExId:n}},ov=(e,t)=>t.client.request(L0,e),NP=(e,t,r)=>r.client.request(D0,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t}),PP=async(e,t,r,n)=>(await n.client.request(P0,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t,dryRun:r})).completeWechatSourceCodeUpload,DP=async(e,t,r,n,i)=>{let o=await i.client.request(N0,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t,offset:n?null:r,limit:n?null:CP,paths:n}),s=(o.wechatSourceCodeUploadUrls.items??[]).filter(u=>u!==null),a=s.map(u=>Date.parse(String(u.expiresAt??""))).filter(u=>Number.isFinite(u));return{targets:s.map(u=>({path:u.path??"",uploadUrl:u.uploadUrl??"",headers:u.headers??{}})),nextOffset:o.wechatSourceCodeUploadUrls.nextOffset??null,expiresAt:a.length?Math.min(...a):null}},OX=e=>e!==null&&e-bX<=Date.now(),AX=async(e,t,r,n,i,o)=>{let s=[],a=[],u=r;for(let c=1;;c+=1){let l=await Vl(u.targets,h=>n.get(h),i,o.signal);s.push(...l.uploaded);let f=OX(u.expiresAt)&&c<TX&&!o.signal?.aborted?l.failures.filter(h=>n.has(h.path)):[];if(a.push(...l.failures.filter(h=>!f.includes(h))),f.length===0)return{uploaded:s,failures:a};u=await DP(e,t,null,f.map(h=>h.path),o)}},xX=async(e,t,r,n,i,o)=>{let s=[],a=[],u=i?null:0,c=i?[...i]:null;for(;;){o.signal?.throwIfAborted();let l=c?.splice(0,CP)??null;if(l&&l.length===0)break;let d=await DP(e,t,l?null:u,l,o),f=await AX(e,t,d,r,n,o);if(s.push(...f.uploaded),a.push(...f.failures),l)continue;let h=d.nextOffset;if(h!==null&&u!==null&&h<=u)throw new Error(`upload url pagination stalled at offset ${u} (server returned ${h})`);if(u=h,u===null)break}return{uploaded:s,failures:a}},CX=(e,t)=>{if(e.length!==t.length)return!1;let r=new Map(t.map(n=>[n.path??"",n.md5Base64??""]));return e.every(n=>r.get(n.path)===n.md5Base64)},RX=async(e,t,r,n)=>{let i=await ov(e,n),o=i.buildingWechatSourceCodeDeployment;if(o)throw new Error(`deployment ${o.exId} is already BUILDING (started ${o.buildStartedAt}) \u2014 a build cannot be aborted and blocks the next upload. Wait for it to finish, then re-run.`);let s=i.inProgressWechatSourceCodeDeployment;if(s){if(!r&&CX(t,s.manifest))return{deploymentExId:s.exId,resumed:!0,resumedStatus:s.status};await NP(e,s.exId,n)}return{deploymentExId:(await n.client.request(R0,{projectExId:e.projectExId,appExId:e.appExId,files:t.map(u=>({path:u.path,md5Base64:u.md5Base64,sizeBytes:u.sizeBytes}))})).createWechatSourceCodeDeployment.exId,resumed:!1,resumedStatus:null}},LP=e=>{let t=(e.missingPaths??[]).filter(r=>typeof r=="string");return e.missingCount>t.length?null:t},NX=async(e,t,r,n)=>r!=="UPLOADING"?null:LP(await PP(e,t,!0,n)),PX=async(e,t,r)=>(await r.client.request(k0,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t})).wechatSourceCodeDeployment,kP=async(e,t)=>(await t.client.request(j0,{projectExId:e.projectExId})).project,DX=async(e,t)=>(await t.client.request(M0,{projectExId:e.projectExId})).project,LX=(e,t)=>new Promise((r,n)=>{let i=setTimeout(()=>{t?.removeEventListener("abort",o),r()},e),o=()=>{clearTimeout(i),n(t?.reason??new Error("aborted"))};if(t?.aborted){o();return}t?.addEventListener("abort",o,{once:!0})}),jP=async(e,t)=>{let r=xP.resolve(t),n=Buffer.from(e,"base64");return await AP.mkdir(xP.dirname(r),{recursive:!0}),await AP.writeFile(r,n),{qrCodePath:r,qrCodeBytes:n.length}},kX=async(e,t,r,n)=>{let i=Date.now(),o=i+r*1e3;for(;;){n.signal?.throwIfAborted();let a=(await PX(e,t,n))?.status??null,u=Math.round((Date.now()-i)/1e3);if(a!=="BUILDING"&&a!=="UPLOADING")return{status:a,timedOut:!1,waitedSeconds:u};if(Date.now()>=o)return{status:a,timedOut:!0,waitedSeconds:u};await LX(Math.min(wX,Math.max(0,o-Date.now())),n.signal)}},jX=async(e,t)=>{let r=oi(e.dir,"dir"),n=$e(e.dryRun,!1),i=$e(e.force,!1),o=$e(e.wait,!0),s=Math.max(0,Ue(e.timeoutSeconds,IX)),a=K(e.qrOut)??RP,u=Math.max(1,Math.min(Ue(e.concurrency,EX),_X)),c=await OP(r);if(n)return t.ok({dryRun:!0,fileCount:c.files.length,totalBytes:c.totalBytes,skipped:c.skipped,serverManaged:c.reserved,files:c.files.map(de=>({path:de.path,sizeBytes:de.sizeBytes}))});let l=await Gl(e,t),d=new Map(c.files.map(de=>[de.path,de])),{deploymentExId:f,resumed:h,resumedStatus:g}=await RX(l,c.files,i,t),v=h?await NX(l,f,g,t):null,_=new Set,b=[],S=null,I=Number.POSITIVE_INFINITY,A=0;for(let de=1;de<=SX;de+=1){A=de;let ye=await xX(l,f,d,u,v,t);for(let w of ye.uploaded)_.add(w);if(b=ye.failures,S=await PP(l,f,!1,t),!S.incomplete||S.missingCount>=I||(I=S.missingCount,v=LP(S),v?.length===0))break}if(!S||S.incomplete)return t.fail(new Error(`deployment ${f} is still missing ${S?.missingCount??"?"} file(s) after ${A} upload pass(es): ${(S?.missingPaths??[]).slice(0,10).join(", ")}${b.length?`; upload errors: ${b[0].error}`:""}. Re-run to resume, or pass force=true to start over.`));let T={deploymentExId:f,resumed:h,fileCount:c.files.length,totalBytes:c.totalBytes,uploaded:_.size,skipped:c.skipped,serverManaged:c.reserved,deploymentRecordExId:S.deploymentRecordExId,...b.length?{uploadRetries:b}:{}};if(!o)return t.ok({...T,status:S.status,waited:!1});let x=await kX(l,f,s,t);if(x.timedOut)return t.ok({...T,status:x.status,waited:!0,timedOut:!0,waitedSeconds:x.waitedSeconds},`build is still running after ${x.waitedSeconds}s \u2014 poll \`wechat status\` for the trial version`);if(x.status!=="SUCCEEDED")return t.fail(new Error(`deployment ${f} ended in ${x.status} after ${x.waitedSeconds}s. The upload landed but the WeChat build did not succeed; check the deployment record ${S.deploymentRecordExId??"(none)"} for the failure.`));let U=await kP(l,t),C=U?.wechatMiniAppQRCodeBase64??null,te=C?await jP(C,a):null;return t.ok({...T,status:x.status,waited:!0,waitedSeconds:x.waitedSeconds,trialVersion:U?.wechatMiniAppPreviewVersion??null,trialVersionCommittedAt:U?.wechatMiniAppPreviewTime??null,...te??{qrCodePath:null}})},MX=async(e,t)=>{let r=await Gl(e,t),n=await ov(r,t),i=await DX(r,t);return t.ok({trial:{version:i?.wechatMiniAppPreviewVersion??null,committedAt:i?.wechatMiniAppPreviewTime??null},inProgress:n.inProgressWechatSourceCodeDeployment?{deploymentExId:n.inProgressWechatSourceCodeDeployment.exId,status:n.inProgressWechatSourceCodeDeployment.status,fileCount:n.inProgressWechatSourceCodeDeployment.fileCount,totalBytes:n.inProgressWechatSourceCodeDeployment.totalBytes,createdAt:n.inProgressWechatSourceCodeDeployment.createdAt,lastUploadUrlIssuedAt:n.inProgressWechatSourceCodeDeployment.lastUploadUrlIssuedAt}:null,building:n.buildingWechatSourceCodeDeployment?{deploymentExId:n.buildingWechatSourceCodeDeployment.exId,status:n.buildingWechatSourceCodeDeployment.status,fileCount:n.buildingWechatSourceCodeDeployment.fileCount,totalBytes:n.buildingWechatSourceCodeDeployment.totalBytes,buildStartedAt:n.buildingWechatSourceCodeDeployment.buildStartedAt,deploymentRecordExId:n.buildingWechatSourceCodeDeployment.deploymentRecordExId}:null})},FX=async(e,t)=>{let r=await Gl(e,t),i=K(e.deploymentExId)??(await ov(r,t)).inProgressWechatSourceCodeDeployment?.exId;if(!i)return t.ok({aborted:null},"no in-progress upload to abort");let o=await NP(r,i,t);return t.ok({deploymentExId:i,status:o.abortWechatSourceCodeDeployment.status})},qX=async(e,t)=>{let r=await Gl(e,t),n=K(e.out)??RP,i=await kP(r,t),o=i?.wechatMiniAppQRCodeBase64??null;if(!o)return t.fail(new Error("no trial version QR code is available for this project yet \u2014 run `wechat deploy` and let the build finish first."));let s=await jP(o,n);return t.ok({...s,trialVersion:i?.wechatMiniAppPreviewVersion??null,trialVersionCommittedAt:i?.wechatMiniAppPreviewTime??null})},MP={"wechat.deploy":jX,"wechat.status":MX,"wechat.abort":FX,"wechat.qrcode":qX};p();var FP={...ZR,...aN,...fN,...hN,...IN,...VN,...KN,...YN,...ZN,...eP,...rP,...dP,...fP,...IP,...MP};p();p();var UX=new Map([["claude-code","Claude Code"],["codex-mcp-client","Codex"]]);function qP(e){let t=typeof e?.name=="string"?e.name:"",r=typeof e?.title=="string"?e.title:"";return UX.get(t)??(r||t||"the coding agent")}function $l(e="the coding agent"){return`quit ${e} completely and open it again (starting a new chat in the same window may keep the old tools)`}function ai(e,t,r){let n=`${Y} ${e.current} is older than the minimum supported version ${e.minSupported} (latest ${e.latest})`,i=t?`, and upgrading it automatically failed: ${t}`:"";return`${n}${i}. Calls to the backend keep failing until it is upgraded, so stop retrying and tell the user, in their language: update the ${Tv} plugin from the plugin marketplace (or run \`npm i -g ${Y}@latest\` if ${Y} was installed with npm), then ${$l(r)} so it starts the new version.`}function UP(e){return`This project's schema was saved by a newer editor than ${Y} ${e} can read, and no ${Y} release that can read it has been published yet, so updating or restarting will not help for now, and neither will retrying. Stop and tell the user, in their language, that this project cannot be edited through ${Y} until a newer release comes out; they can keep working on it in the editor meanwhile.`}function VP(e,t){return`${Y} is upgrading itself from ${e} to ${t} in the background because the backend no longer supports ${e}. Nothing is broken and the user does not need to do anything: retry this call in about a minute.`}function GP(e,t,r){return`Note: ${Y} upgraded itself from ${e} to ${t} during this session and ran this call on ${t}, but ${r} did not reload its tool list, so tools added in ${t} are not visible to you. Tell the user once, in their language, that ${Y} was upgraded and that to use the new version's tools they should ${$l(r)}. Then carry on with their request; everything that worked before still works.`}function $P(e,t,r,n){let i=$l(r);return n.upgradedFrom&&n.toolListReloaded?`${Y} has no tool ${e}. ${Y} upgraded itself from ${n.upgradedFrom} to ${t} during this session and ${r} has already reloaded its tool list, so ${e} was from the old list: use the tools you have now instead. The user does not need to restart anything.`:n.upgradedFrom?`${Y} has no tool ${e}. ${Y} upgraded itself from ${n.upgradedFrom} to ${t} during this session, so your tool list is still the ${n.upgradedFrom} one. Tell the user, in their language, to ${i} so you get the current tools, then try again.`:`${Y} ${t} has no tool ${e}. Use only the tools in your current tool list; if that list was loaded from another ${Y} version, tell the user, in their language, to ${i}, then try again.`}function BP(e,t,r,n){return n?`${Y} upgraded itself from ${e} to ${t} during this session and ${r} has already reloaded its tool list, so check this tool's current arguments and try again.`:`${Y} upgraded itself from ${e} to ${t} during this session, so this tool's arguments may have changed since your tool list was loaded. If the error does not make sense against your tool list, tell the user, in their language, to ${$l(r)}.`}var VX=G`
|
|
1436
1482
|
query SupportedMcpVersion {
|
|
1437
1483
|
supportedMcpVersion {
|
|
1438
1484
|
latest
|
|
1439
1485
|
minSupported
|
|
1440
1486
|
}
|
|
1441
1487
|
}
|
|
1442
|
-
`,
|
|
1443
|
-
${o}`:i}function Kl(e,t={}){let r=new
|
|
1444
|
-
`);if(i<0)return;let o=r.slice(0,i);r=r.slice(i+1),o.trim()!==""&&e(o)}}};var
|
|
1445
|
-
`)}),c.on("data",_a(h=>{clearTimeout(l),d(),c.end();try{let g=JSON.parse(h);if(g.id!==o){u(new Error("Daemon response id mismatch"));return}a(g.result)}catch(g){u(g)}})),c.on("error",h=>{clearTimeout(l),d(),u(h)})})}function
|
|
1446
|
-
`)}),d.on("data",_a(f=>{if(!d.destroyed)try{let h=JSON.parse(f);if(h.id===c)return;h.event==="schemaChanged"&&t(h.data)}catch(h){N.warn(`Failed to parse daemon event, destroying socket to force reconnect. Line: ${f}`,h),d.destroy()}})),o.on("error",f=>{s||r(f)}),o.on("close",()=>{o=null,s||(a=setTimeout(u,2e3))})};return u(),{unsubscribe(){s=!0,a&&clearTimeout(a),o&&o.end()}}}function
|
|
1488
|
+
`,GX=3600*1e3,$X=3600*1e3;function KP(e={}){let t=e.check??Ea,r=e.now??Date.now,n=e.ttlMs??GX,i=e.unknownTtlMs??$X,o=null,s=null;return{async check(){return o&&r()<o.expiresAt?o.result:s||(s=t().then(a=>(o={result:a,expiresAt:r()+(a.status==="unknown"?i:n)},a)).finally(()=>{s=null}),s)},invalidate(){o=null}}}function BX(e){let t=e instanceof Error?e.message:String(e);return/supportedMcpVersion|Cannot query field|Validation error|undefined/i.test(t)?"backend does not advertise a supported version":"backend version check unavailable"}async function Ea(){let{agentVersion:e}=await wy();try{let t=Nt(),r=new Ze(`${t.apiBaseUrl}/api/graphql`,{headers:{"User-Locale":"en_US"}}),{supportedMcpVersion:n}=await r.request(VX),{latest:i,minSupported:o}=n;return{status:ci(e,o)<0?"outdated":"ok",current:e,latest:i,minSupported:o}}catch(t){return N.debug(`[version-check] skipped: ${String(t)}`),{status:"unknown",current:e,reason:BX(t)}}}function Bl(e){return e.status==="outdated"?ai(e):e.status==="ok"?`${Y} ${e.current} meets the backend minimum ${e.minSupported} (latest ${e.latest}).`:`${Y} ${e.current}: ${e.reason}; skipping compatibility check.`}var KX=new Set(["docs.search","docs.get_page","auth.login","auth.reauth","auth.logout","auth.whoami","workspace.set"]),HX=e=>new Proxy({},{get(){throw new Error(`${e} is a local-only command and has no authenticated client`)}}),HP=e=>({ok:!1,error:Bl(e),data:{upgrade:e}});function QX(e){let t=e.cause,r=t?.code;if(typeof r!="string")return null;let n=typeof t?.message=="string"?t.message:"";return n?n.includes(r)?n:`${r}: ${n}`:r}function WX(e){if(!(e instanceof Error))return String(e);let t=Ay(e.response?.errors),r=e.message||String(e),n=QX(e),i=t||(n?`${r} (${n})`:r),o=e.runtimeDiagnosis;return typeof o=="string"?`${i}
|
|
1489
|
+
${o}`:i}function Kl(e,t={}){let r=new Sr(e),n=new Xi(r),i=new wl(()=>xy(n,r),t.watchSchemaChanges?async(...c)=>(await OR(n,r))(...c):void 0),o=KP({check:t.checkMcpVersion}),s=(c,l)=>({ok:!0,data:c,message:l}),a=c=>(c instanceof Error&&c.stack&&N.debug(`[AgentApp] command failed: ${c.stack}`),{ok:!1,error:WX(c),data:c instanceof mn?{ztypeDiagnostics:c.diagnostics}:void 0});return{execute:async(c,l)=>{let d=WR(c.args),f=KX.has(c.name);try{if(!f){let T=await o.check();if(T.status==="outdated")return HP(T)}let h=FP[c.name];if(!h)throw new Error(`Unknown command: ${c.name}`);let g=f?HX(c.name):await xy(n,r),v=null,_=f?void 0:g,b=async T=>(v??=await By(r,T,_),v),S=async T=>By(r,{appExId:null,...T},_),I=async T=>{let x=await b(T);return i.checkRemoteAndSync(nr(x.projectExId,x))},A={credentialStore:r,tokenManager:n,schemaManager:i,client:g,signal:l,codingAgent:c.agent,hostSessionId:c.sessionId,getProjectArgs:b,getProjectLevelArgs:S,checkSchema:I,ok:s,fail:a};return await h(d,A)}catch(h){if(!_l(h,"CLIENT_VERSION_TOO_OLD"))return a(h);o.invalidate();let g=await o.check();return g.status==="outdated"?HP(g):a(new Error(UP(g.current)))}},schemaManager:i,setWorkspaceRoot(c){r.setWorkspaceRoot(c),i.clear()},stop(){i.clear(),Ol.close()}}}p();import Hl from"net";p();import{StringDecoder as zX}from"string_decoder";var _a=e=>{let t=new zX("utf8"),r="";return n=>{for(r+=t.write(n);;){let i=r.indexOf(`
|
|
1490
|
+
`);if(i<0)return;let o=r.slice(0,i);r=r.slice(i+1),o.trim()!==""&&e(o)}}};var YX=600*1e3;async function bt(e,t,r){let{socketPath:n,token:i}=e,o=`${Date.now()}-${Math.random().toString(16).slice(2)}`,s={id:o,token:i,command:t};return new Promise((a,u)=>{let c=n.startsWith("tcp://")?Hl.createConnection(WP(n)):Hl.createConnection(n),l=setTimeout(()=>{c.destroy(),u(new Error(`Timed out waiting for daemon response to ${t.name}`))},YX),d=()=>{r&&r.removeEventListener("abort",f)},f=()=>{clearTimeout(l),c.destroy(),u(new Error(`Request aborted: ${t.name}`))};if(r){if(r.aborted){f();return}r.addEventListener("abort",f)}c.on("connect",()=>{c.write(`${JSON.stringify(s)}
|
|
1491
|
+
`)}),c.on("data",_a(h=>{clearTimeout(l),d(),c.end();try{let g=JSON.parse(h);if(g.id!==o){u(new Error("Daemon response id mismatch"));return}a(g.result)}catch(g){u(g)}})),c.on("error",h=>{clearTimeout(l),d(),u(h)})})}function QP(e,t,r){let{socketPath:n,token:i}=e,o=null,s=!1,a=null,u=()=>{if(s)return;o=n.startsWith("tcp://")?Hl.createConnection(WP(n)):Hl.createConnection(n);let c=`sub-${Date.now()}-${Math.random().toString(16).slice(2)}`,l={id:c,token:i,command:{name:"schema.subscribe"}},d=o;d.on("connect",()=>{d.write(`${JSON.stringify(l)}
|
|
1492
|
+
`)}),d.on("data",_a(f=>{if(!d.destroyed)try{let h=JSON.parse(f);if(h.id===c)return;h.event==="schemaChanged"&&t(h.data)}catch(h){N.warn(`Failed to parse daemon event, destroying socket to force reconnect. Line: ${f}`,h),d.destroy()}})),o.on("error",f=>{s||r(f)}),o.on("close",()=>{o=null,s||(a=setTimeout(u,2e3))})};return u(),{unsubscribe(){s=!0,a&&clearTimeout(a),o&&o.end()}}}function WP(e){let t=new URL(e),r=Number.parseInt(t.port,10);if(!t.hostname||!Number.isInteger(r))throw new Error(`Invalid daemon TCP endpoint: ${e}`);return{host:t.hostname,port:r}}p();import{createHash as JX,randomUUID as zP}from"crypto";import{promises as To,rmSync as XX}from"fs";import Io from"path";var ZX="registry.json",_n=class{constructor(t){this.workspaceRoot=t;this.root=Io.join(t,`.${Y}`,"daemon"),this.logRoot=Io.join(this.root,"logs"),this.socketRoot=Io.join(this.root,"sockets"),this.registryPath=Io.join(this.root,ZX)}root;logRoot;socketRoot;registryPath;async ensure(){await To.mkdir(this.root,{recursive:!0,mode:448}),await To.mkdir(this.logRoot,{recursive:!0,mode:448}),await To.mkdir(this.socketRoot,{recursive:!0,mode:448})}async list(){await this.ensure();try{let t=await To.readFile(this.registryPath,"utf8"),r=JSON.parse(t),n=r.filter(i=>this.isProcessAlive(i.pid));if(n.length!==r.length){for(let i of r)this.isProcessAlive(i.pid)||this.unlinkSocket(i.socketPath);await this.write(n)}return n}catch(t){if(t.code==="ENOENT")return[];throw t}}async findCompatible(t){return(await this.list()).find(n=>TR(t,n.compatibility)&&this.isProcessAlive(n.pid))??null}async upsert(t){let r=(await this.list()).filter(n=>n.uid!==t.uid);r.push(t),await this.write(r)}async remove(t){let r=await this.list();for(let n of r)n.pid===t&&this.unlinkSocket(n.socketPath);await this.write(r.filter(n=>n.pid!==t))}createRecord(t){let r=zP(),n=JX("sha256").update(`${this.workspaceRoot}:${r}`).digest("hex").slice(0,16),i=new Date().toISOString();return{uid:r,pid:process.pid,socketPath:this.chooseSocketPath(n),token:zP(),logPath:Io.join(this.logRoot,`${n}.log`),status:"idle",startedAt:i,lastBusyAt:i,compatibility:t}}chooseSocketPath(t){if(process.platform==="win32")return"tcp://127.0.0.1:0";let r=Io.join(this.socketRoot,`${t}.sock`);return r.length<=100?r:"tcp://127.0.0.1:0"}unlinkSocket(t){if(!t.startsWith("tcp://"))try{XX(t,{force:!0})}catch{}}async write(t){await this.ensure();let r=`${this.registryPath}.tmp`;await To.writeFile(r,JSON.stringify(t,null,2),{mode:384}),await To.rename(r,this.registryPath)}isProcessAlive(t){try{return process.kill(t,0),!0}catch{return!1}}};p();import{chmodSync as eZ}from"fs";import tZ from"net";var Ql=10800*1e3;async function YP(e){let t=e.idleTimeoutMs??Ql,r=new _n(e.workspaceRoot),n=new Sr(e.workspaceRoot),i=new Xi(n),o=await go(n,e.startupFlags??[]),s=r.createRecord(o),a=Kl(e.workspaceRoot,{watchSchemaChanges:!0}),u=new Set;a.schemaManager.emitter.on("schemaChanged",T=>{let x=JSON.stringify({event:"schemaChanged",data:T})+`
|
|
1447
1493
|
`;for(let U of u)try{U.write(x)}catch{u.delete(U)}});let c=new Map,l=0,d=!1,f=Date.now(),h=null,g=()=>{f=Date.now()},v=(T,x)=>`${JSON.stringify({id:T,result:x})}
|
|
1448
|
-
`,_=async()=>{s.compatibility=await go(n,e.startupFlags??[]),await r.upsert(s)},
|
|
1449
|
-
`);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),
|
|
1450
|
-
`}var zl=class{constructor(t=
|
|
1494
|
+
`,_=async()=>{s.compatibility=await go(n,e.startupFlags??[]),await r.upsert(s)},b=async T=>{switch(T.command.name){case"daemon.ping":return{ok:!0,data:{pid:process.pid,record:s,pins:c.size}};case"daemon.pin":{let x=typeof T.command.args?.token=="string"?T.command.args.token:`${Date.now()}-${Math.random()}`;return c.set(x,{token:x,lastSeenAt:Date.now()}),{ok:!0,data:{token:x}}}case"daemon.heartbeat":{let x=T.command.args?.token;return typeof x=="string"&&c.has(x)&&c.set(x,{token:x,lastSeenAt:Date.now()}),{ok:!0}}case"daemon.unpin":{let x=T.command.args?.token;return typeof x=="string"&&c.delete(x),{ok:!0}}case"daemon.stop":return d=!0,setTimeout(()=>I(0),25),{ok:!0,message:"Stopping daemon"};default:return null}},S=()=>{let T=Date.now();for(let[x,U]of c.entries())T-U.lastSeenAt>t&&c.delete(x)},I=async T=>{h&&h.close(),a.stop(),await r.remove(process.pid).catch(()=>{}),process.exit(T)};setInterval(()=>{S(),a.schemaManager.sweep(),d||i.refreshIfNeeded(),!(d||l>0||c.size>0)&&Date.now()-f>t&&(N.info("Daemon idle timeout reached; shutting down"),I(0))},3e4).unref(),h=tZ.createServer(T=>{let x=!1,U=new Map;T.on("close",()=>{u.delete(T);for(let te of U.values())te.abort();U.clear()}),T.on("error",()=>{u.delete(T);for(let te of U.values())te.abort();U.clear()});let C=te=>{(async()=>{l+=1,g();let de="unknown";try{let ye=JSON.parse(te);if(de=ye.id,ye.token!==s.token){T.write(v(ye.id,{ok:!1,error:"Unauthorized: invalid or missing daemon token"}));return}if(ye.command.name==="schema.subscribe"){x=!0,u.add(T),T.write(v(ye.id,{ok:!0,message:"Subscribed to schema events"}));return}let w=new AbortController;U.set(ye.id,w);let Ne=await b(ye)??await a.execute(ye.command,w.signal);Ne.ok&&(ye.command.name==="auth.login"||ye.command.name==="auth.reauth"||ye.command.name==="auth.logout")&&await _(),T.write(v(ye.id,Ne))}catch(ye){let w=de!=="unknown"?de:rZ(te);T.write(v(w,{ok:!1,error:ye instanceof Error?ye.message:String(ye)}))}finally{l-=1,g(),de!=="unknown"&&U.delete(de),x||T.end()}})()};T.on("data",_a(C))}),await r.ensure(),await new Promise((T,x)=>{if(h?.once("error",x),s.socketPath.startsWith("tcp://")){h?.listen(0,"127.0.0.1",()=>{let C=h?.address();if(!C||typeof C=="string"){x(new Error("Daemon TCP listener did not expose a port"));return}s.socketPath=`tcp://127.0.0.1:${C.port}`,T()});return}let U=s.socketPath;h?.listen(U,()=>{try{eZ(U,384)}catch{}T()})}),await r.upsert(s),N.info(`Daemon listening on ${s.socketPath}`),Cv(),process.on("SIGINT",()=>void I(0)),process.on("SIGTERM",()=>void I(0))}function rZ(e){try{return JSON.parse(e).id??"unknown"}catch{return"unknown"}}p();p();import JP from"node:process";p();var wo=class{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
|
|
1495
|
+
`);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),nZ(r)}clear(){this._buffer=void 0}};function nZ(e){return Dv.parse(JSON.parse(e))}function Wl(e){return JSON.stringify(e)+`
|
|
1496
|
+
`}var zl=class{constructor(t=JP.stdin,r=JP.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new wo,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{this.onerror?.(n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let t=this._readBuffer.readMessage();if(t===null)break;this.onmessage?.(t)}catch(t){this.onerror?.(t)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(t){return new Promise(r=>{let n=Wl(t);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};import{spawn as yZ}from"child_process";import oD from"path";import{randomUUID as vZ}from"crypto";p();function XP(){let{productName:e}=qv();return`# ${e} MCP \u2014 no-code platform (visual UI + PostgreSQL + actionflows)
|
|
1451
1497
|
Two modes. **Builder**: edit the data model, bindings, action flows, request filters, UI, third-party APIs, project lifecycle, deploys, and data with tools. **Consultant**: for what tools can't change (permission config, payment setup, formula columns), diagnose and guide the user through the editor.
|
|
1452
1498
|
|
|
1453
1499
|
## Session
|
|
@@ -1462,13 +1508,13 @@ Schema editing: one tool per capability, each {op, args} where op is a schema To
|
|
|
1462
1508
|
Permission config, payment module/credentials, and formula COLUMNS are editor-only. (Formula data BINDINGS via schema_create_binding op=FORMULA are fine \u2014 different thing.)
|
|
1463
1509
|
|
|
1464
1510
|
## Always
|
|
1465
|
-
Ask when ambiguous. Ground every call in what you retrieved \u2014 never fabricate table/column/enum/component names; verify names before any query/mutation. Before deleting tables/columns/relations/enums, list what's removed and warn of data loss. Data-model/permission/actionflow changes take effect only after sync_backend. Done = VALIDATE clean, synced, each changed actionflow without external calls debug-run once, and what the user asked for actually exercised. Reply in the user's language.`}p();import{randomUUID as
|
|
1466
|
-
`);let o;try{o=await r.installFirst(
|
|
1467
|
-
${t}`}};let r=e.result;return r?.content?{jsonrpc:"2.0",id:e.id,result:{...r,content:[...r.content,{type:"text",text:t}]}}:e}function ov(e,t){return e.method==="tools/call"?{jsonrpc:"2.0",id:e.id,result:{content:[{type:"text",text:t}],isError:!0}}:{jsonrpc:"2.0",id:e.id,error:{code:-32603,message:t}}}var sv=class{seen=!1;waiters=new Set;reset(){this.seen=!1}mark(){this.seen=!0;for(let t of this.waiters)t();this.waiters.clear()}waitFor(t){return this.seen||t<=0?Promise.resolve(this.seen):new Promise(r=>{let n=()=>{clearTimeout(i),r(!0)},i=setTimeout(()=>{this.waiters.delete(n),r(!1)},t);this.waiters.add(n)})}};function dZ(e,t){return new Promise(r=>{let n=setTimeout(()=>r({kind:"TIMEOUT"}),t);e.then(i=>{clearTimeout(n),r({kind:"DONE",value:i})},i=>{clearTimeout(n),r({kind:"FAILED",reason:i instanceof Error?i.message:String(i)})})})}var av=class{constructor(t,r,n,i){this.version=t;this.child=r;this.toHost=n;r.stdout.on("data",a=>{for(this.buffer.append(a);;){let u;try{u=this.buffer.readMessage()}catch(c){N.warn(`[upgrade] unreadable message from new version: ${String(c)}`);continue}if(!u)break;this.route(u)}}),r.stdin.on("error",()=>{});let o=!1,s=(a,u)=>{if(!o){o=!0;for(let c of this.waiters.values())c({jsonrpc:"2.0",id:"",error:{code:-32603,message:u}});this.waiters.clear(),this.closed||Promise.allSettled([...this.inflight]).then(()=>i(a))}};r.on("error",a=>s(1,`it could not start: ${a.message}`)),r.on("exit",a=>s(a??1,`it exited with ${a}`))}buffer=new Io;intercepts=new Map;inflight=new Set;waiters=new Map;sequence=0;closed=!1;send(t,r){r&&"id"in t&&t.id!==void 0&&this.intercepts.set(t.id,r),this.closed||this.child.stdin.write(Wl(t))}async initialize(t,r,n){let i=await this.request(t.method,{...t.params,...r?{protocolVersion:r}:{}});if(i.error)throw new Error(`the new version did not initialize: ${i.error.message}`);let o=i.result?.protocolVersion;if(r&&o!==r)throw new Error(`the new version speaks MCP ${String(o)}, but this session uses ${r}`);this.send({jsonrpc:"2.0",method:"notifications/initialized"});for(let s of n)await this.request(s.method,s.params).catch(()=>{})}close(){this.closed||(this.closed=!0,this.child.stdin.end())}request(t,r){this.sequence+=1;let n=`handover-${this.sequence}`;return new Promise((i,o)=>{let s=setTimeout(()=>{this.waiters.delete(n),o(new Error(`the new version did not answer ${t}`))},rZ);this.waiters.set(n,a=>{clearTimeout(s),i(a)}),this.send({jsonrpc:"2.0",id:n,method:t,params:r})})}route(t){if(eD(t)){let r=typeof t.id=="string"?this.waiters.get(t.id):void 0;if(r){this.waiters.delete(t.id),r(t);return}let n=this.intercepts.get(t.id);if(n){this.intercepts.delete(t.id);let i=n(t).then(o=>this.toHost(o));this.inflight.add(i),i.finally(()=>this.inflight.delete(i));return}}this.toHost(t)}};var Xl=Tn.toLowerCase(),rD=e=>`${Xl}://project/${encodeURIComponent(e)}/schema-state`,nD=e=>`${Xl}://project/${encodeURIComponent(e)}/schema-events`,iD=e=>Array.isArray(e)?String(e[0]??""):String(e??"");async function uv(e){let t=tD.resolve(e),r=await Sa(t),n=oD(),i=async()=>{await bt(r,{name:"daemon.pin",args:{token:n}})},o=async()=>{await bt(r,{name:"daemon.unpin",args:{token:n}}).catch(()=>{})};await i();let s=setInterval(()=>{bt(r,{name:"daemon.heartbeat",args:{token:n}}).catch(()=>{})},6e4);s.unref();let a=new kv({name:Y,version:"1.0.0"},{instructions:WP(),capabilities:{tools:{},prompts:{},resources:{subscribe:!0}}});Ov(a);let u=new Set;a.server.setRequestHandler(Dv,b=>(u.add(b.params.uri),{})),a.server.setRequestHandler(Lv,b=>(u.delete(b.params.uri),{}));let c=process.env.MCP_HOST_SESSION_ID||hZ(),l=async(b,A)=>{if(b.agent??=a.server.getClientVersion()?.name,b.sessionId??=c,b.name==="workspace.set"&&typeof b.args?.cwd=="string"){let O=tD.resolve(b.args.cwd);if(b.args.cwd=O,O!==t){let T=r;r=await Sa(O),t=O,await bt(T,{name:"daemon.unpin",args:{token:n}},A).catch(()=>{}),await i()}}return bt(r,b,A)},d=new Co,f=new Jl({inner:new zl,currentVersion:Sn(),upgradedFrom:process.env.MCP_UPGRADED_FROM||void 0,canUpgrade:b=>Ro()&&wo(b)!==null,prepare:b=>d.installFirst(ba(b)),launch:b=>fZ(process.execPath,[d.binPath(b),"mcp","--cwd",t],{stdio:["pipe","pipe","inherit"],env:{...process.env,MCP_HOST_SESSION_ID:c,MCP_UPGRADED_FROM:Sn()}}),onRelayActive:()=>{clearInterval(s),v.unsubscribe(),o()},onRelayExit:b=>process.exit(b)});Mv(a,f.wrapSender(l)),qv(a,f.wrapSender(l));let h=async()=>{let b=await bt(r,{name:"schema.status"});if(!b.ok)return[];let O=b.data?.sessions;return Array.isArray(O)?[...new Set(O.map(T=>T?.projectExId).filter(T=>typeof T=="string"))]:[]};a.registerResource("project-schema-state",new op(`${Xl}://project/{projectExId}/schema-state`,{list:async()=>({resources:(await h()).map(b=>({uri:rD(b),name:`schema-state-${b}`,title:`Schema state ${b}`,description:"Current in-memory schema revision and stale/change notification state.",mimeType:"application/json"}))})}),{title:"Project Schema State",description:"Current in-memory schema revision and stale/change notification state.",mimeType:"application/json"},async(b,A)=>{let O=iD(A.projectExId),T=await bt(r,{name:"schema.state",args:{projectExId:O}});return{contents:[{uri:b.href,mimeType:"application/json",text:JSON.stringify(T.ok?T.data:T,null,2)}]}}),a.registerResource("project-schema-events",new op(`${Xl}://project/{projectExId}/schema-events`,{list:async()=>({resources:(await h()).map(b=>({uri:nD(b),name:`schema-events-${b}`,title:`Schema events ${b}`,description:"Recent semantic schema-change events observed by the daemon.",mimeType:"application/json"}))})}),{title:"Project Schema Events",description:"Recent semantic schema-change events observed by the daemon.",mimeType:"application/json"},async(b,A)=>{let O=iD(A.projectExId),T=await bt(r,{name:"schema.events",args:{projectExId:O}});return{contents:[{uri:b.href,mimeType:"application/json",text:JSON.stringify(T.ok?T.data:T,null,2)}]}}),await a.connect(f),process.env.MCP_UPGRADED_FROM||YP(Ea,d).catch(b=>{N.warn(`[upgrade] prefetch failed: ${String(b)}`)});let g=new Set,v=$P(r,async b=>{if(!b?.id||g.has(b.id))return;g.add(b.id);let A=String(b.projectExId??"");if(!A)return;let O=rD(A),T=nD(A),x=[u.has(O)?a.server.sendResourceUpdated({uri:O}):Promise.resolve(),u.has(T)?a.server.sendResourceUpdated({uri:T}):Promise.resolve()];await Promise.all([...x,a.sendLoggingMessage({level:"notice",logger:Y,data:{message:"Project schema changed",projectExId:A,event:b}})])},b=>{N.warn("Daemon subscription error",b.message)}),_=!1,S=async()=>{_||(_=!0,clearInterval(s),v.unsubscribe(),await o(),await a.close())};process.on("SIGINT",()=>{S().finally(()=>process.exit(0))}),process.on("SIGTERM",()=>{S().finally(()=>process.exit(0))}),process.stdin.on("end",()=>{S().finally(()=>process.exit(0))}),process.stdin.on("close",()=>{S().finally(()=>process.exit(0))}),process.on("exit",()=>{clearInterval(s),v.unsubscribe()})}p();var mZ=/^-?\d+(\.\d+)?$/;function gZ(e){return e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")}function yZ(e){if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;if(mZ.test(e))return Number(e);if(gZ(e))try{return JSON.parse(e)}catch{return e}return e}function sD(e){let t=Number(e);if(Number.isNaN(t))throw new Tp("expected a number");return t}function cv(e){try{return JSON.parse(e)}catch{throw new Tp("expected valid JSON")}}function aD(e){if(typeof e!="string")return{};try{let t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function vZ(e){let t={};for(let r=0;r<e.length;r++){let n=e[r];if(!n.startsWith("--"))continue;let i=n.slice(2),o,s=i.indexOf("=");if(s!==-1)o=i.slice(s+1),i=i.slice(0,s);else{let a=e[r+1];a!==void 0&&!a.startsWith("--")&&(o=a,r+=1)}o===void 0?i.startsWith("no-")?t[i.slice(3)]=!1:t[i]=!0:t[i]=yZ(o)}return t}function uD(e,t,r){let n=aD(e.args);return Object.assign(n,vZ(t)),r&&(n.subcommand=r),n}function cD(e,t){let r=aD(t.args),n=e.opts();for(let i of e.options){let o=i.attributeName();e.getOptionValueSource(o)==="cli"&&(r[o]=n[o])}return r}p();function EZ(e){let t=e,r=!1;for(;;)if(t instanceof Pt.ZodOptional)r=!0,t=t.unwrap();else if(t instanceof Pt.ZodNullable)t=t.unwrap();else if(t instanceof Pt.ZodDefault)t=t.removeDefault();else break;return{base:t,optional:r}}function lD(e,t){for(let[r,n]of Object.entries(t)){let{base:i,optional:o}=EZ(n),s=o?"":"required",a=`${s} JSON`.trim();i instanceof Pt.ZodBoolean?(e.option(`--${r}`,s),e.option(`--no-${r}`)):i instanceof Pt.ZodNumber?e.option(`--${r} <value>`,s,sD):i instanceof Pt.ZodArray?i.element instanceof Pt.ZodString?e.option(`--${r} <values...>`,s):e.option(`--${r} <json>`,a,cv):i instanceof Pt.ZodRecord||i instanceof Pt.ZodObject||i instanceof Pt.ZodAny||i instanceof Pt.ZodUnknown?e.option(`--${r} <json>`,a,cv):e.option(`--${r} <value>`,s)}}var lv=["default"],hD=[];function ui(e){return typeof e.cwd=="string"?fD.resolve(e.cwd):process.env.WORKSPACE_ROOT||process.cwd()}function Zl(e){return e.pretty===void 0?!0:!e.pretty}async function mD(e,t,r){let n={name:e,args:t},i=ui(r),o=r.daemon===!1?await DZ(n,i):await PZ(n,i),s=Yl(o);if(s){let a=await zP(s,hD);if(a.kind==="RERAN"){wv(a.status);return}a.kind==="FAILED"&&(o={...o,error:ai(s,a.reason)})}ep(o,Zl(r)),o.ok||(process.exitCode=1)}async function wZ(e){let t=await Sa(ui(e));ep({ok:!0,data:gD(t),message:"Daemon started"},Zl(e))}async function OZ(e){await HP({workspaceRoot:ui(e),idleTimeoutMs:LZ(process.env.ZED_AGENT_DAEMON_IDLE_TTL)??Ql,startupFlags:lv})}async function AZ(e){let r=await new _n(ui(e)).list();ep({ok:!0,data:r.map(gD)},Zl(e))}async function xZ(e){let t=ui(e),r=new _n(t),n=new br(t),i=await go(n,lv),o=await r.list(),s=[];for(let a of o)if(JSON.stringify(a.compatibility)===JSON.stringify(i))try{await bt(a,{name:"daemon.stop"}),s.push(a.pid)}catch{await r.remove(a.pid)}ep({ok:!0,data:{stopped:s}},Zl(e))}function pD(e,t){return e.commands.find(r=>r.name()===t)}function dD(e,t,r,n,i){let o=e;for(let u=0;u<t.length-1;u+=1)o=pD(o,t[u])??o.command(t[u]);let s=t[t.length-1];if(pD(o,s))return;let a=o.command(s).description(r);i&&lD(a,i),a.action(async(u,c)=>{let l=c.optsWithGlobals();await mD(n,cD(c,l),l)})}function CZ(e,t,r,n){dD(e,r.path.split(" "),t.description,t.command,n),r.alias&&dD(e,r.alias.split(" "),t.description,t.command,n)}function RZ(){let e=Nt(),t=Object.keys(Tv).join(", ");return["","Backend environment:",` Active: ${e.name} (select with ZION_ENV / MCP_ENV; known: ${t})`,` API: ${e.apiBaseUrl}`,` Auth: ${e.authEndpoint}`," Override any endpoint individually with BACKEND_API_BASE,"," BACKEND_AUTH_ENDPOINT, ZERO_API_URL_TEMPLATE, LOG_API_URL_TEMPLATE.","","Upgrades:"," When the backend stops supporting this version, the newer release is installed",` into ~/.${Y}/versions and the call continues on it; later starts run it directly.`," MCP_AUTO_UPGRADE=0 turns this off and only reports the required upgrade.","","Logs:",` File: ${Av()}`,` Level: ${process.env.MCP_LOG_LEVEL??"info"} (set MCP_LOG_LEVEL; debug, or verbose)`," Verbose: MCP_LOG_LEVEL=verbose (or MCP_LOG_GQL=1) logs full GraphQL bodies + subscription events"," Rotation: 50 MB x 5 files; data older than 1 day is truncated"," Override: MCP_LOG_DIR, MCP_LOG_MAX_BYTES, MCP_LOG_MAX_FILES,"," MCP_LOG_MAX_AGE_DAYS (0 disables), MCP_LOG_FILE=off"].join(`
|
|
1468
|
-
`)}function
|
|
1469
|
-
`),i.status==="outdated"&&(process.exitCode=1)}),t.command("tool-surface",{hidden:!0}).description("Print the MCP tools, prompts and CLI verbs this version exposes, as JSON").action(async()=>{let{collectToolSurface:i}=await import("./surface-
|
|
1470
|
-
`)});let r=t.command("daemon").description("Daemon control"),n=[["start","Start daemon",
|
|
1511
|
+
Ask when ambiguous. Ground every call in what you retrieved \u2014 never fabricate table/column/enum/component names; verify names before any query/mutation. Before deleting tables/columns/relations/enums, list what's removed and warn of data loss. Data-model/permission/actionflow changes take effect only after sync_backend. Done = VALIDATE clean, synced, each changed actionflow without external calls debug-run once, and what the user asked for actually exercised. Reply in the user's language.`}p();import{randomUUID as iZ}from"crypto";p();function Yl(e){if(e.ok||typeof e.data!="object"||e.data===null)return null;let t=e.data.upgrade;return t?.status!=="outdated"||typeof t.current!="string"||typeof t.latest!="string"||typeof t.minSupported!="string"?null:t}function Sa(e){let t=tp(e.minSupported)?e.minSupported:e.current;return[...new Set([e.latest,e.minSupported])].filter(tp).filter(r=>ci(r,e.current)>0&&ci(r,t)>=0).sort((r,n)=>ci(n,r))}function Oo(e){return Sa(e)[0]??null}async function ZP(e,t,r=new Ro,n){let i=Oo(e);if(!i||!No(n))return{kind:"UNAVAILABLE"};process.stderr.write(`[${Y}] ${e.current} is no longer supported by the backend; upgrading to ${i}...
|
|
1512
|
+
`);let o;try{o=await r.installFirst(Sa(e))}catch(s){return{kind:"FAILED",reason:s instanceof Error?s.message:String(s)}}return{kind:"RERAN",status:await wv(r,o,t)}}async function eD(e,t=new Ro,r){if(!No(r))return;let n=await e();n.status==="outdated"&&Oo(n)&&await t.installFirst(Sa(n))}var tD=`__MCP_UPGRADE_HANDOVER_${iZ()}__`,oZ=4e4,sZ=3e4,aZ=600*1e3,uZ=2e3,cZ=`${Y} upgraded itself from`,lZ=/^(MCP error -?\d+: )?Tool \S+ not found/,pZ=/^(MCP error -?\d+: )?Input validation error/,dZ=new Set(["logging/setLevel","resources/subscribe","resources/unsubscribe"]),fZ=["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed"],rD=e=>"method"in e&&"id"in e,iD=e=>"id"in e&&!("method"in e),Jl=class{constructor(t){this.options=t}onmessage;onclose;onerror;pending=new Map;initializeRequest=null;negotiatedProtocol=null;logLevelRequest=null;subscriptions=new Map;upgrade=null;relay=null;toolsRelisted=new av;startedAt=Date.now();upgradeNoted=!1;async start(){let{inner:t}=this.options;t.onmessage=(r,n)=>this.fromHost(r,n),t.onclose=()=>this.onclose?.(),t.onerror=r=>this.onerror?.(r),await t.start()}async close(){this.relay?.close(),await this.options.inner.close()}setProtocolVersion(t){this.options.inner.setProtocolVersion?.(t)}async send(t,r){if(iD(t)){let n=this.pending.get(t.id);if(this.pending.delete(t.id),n&&this.upgrade&&JSON.stringify(t).includes(tD)){this.handOver(n);return}if(n?.method==="initialize"){let i=t.result?.protocolVersion;this.negotiatedProtocol=typeof i=="string"?i:null}n&&(t=await this.withToolHint(n,t))}await this.options.inner.send(t,r)}wrapSender(t){return async(r,n)=>{let i=await t(r,n),o=Yl(i);return!o||!this.options.canUpgrade(o)?i:(this.requestUpgrade(o),{ok:!1,error:tD})}}fromHost(t,r){if(rD(t)&&t.method==="tools/list"&&this.toolsRelisted.mark(),this.relay){this.relay.send(t);return}rD(t)&&(this.remember(t),this.pending.set(t.id,t)),this.onmessage?.(t,r)}remember(t){if(t.method==="initialize")this.initializeRequest=t;else if(t.method==="logging/setLevel")this.logLevelRequest=t;else if(dZ.has(t.method)){let r=String(t.params?.uri??"");t.method==="resources/subscribe"?this.subscriptions.set(r,t):this.subscriptions.delete(r)}}requestUpgrade(t){let r=this.upgrade;if(r?.kind==="RUNNING"||r?.kind==="FAILED"&&Date.now()-r.at<aZ)return;let n=this.performUpgrade(t);this.upgrade={kind:"RUNNING",version:t,target:n},n.catch(i=>{let o=i instanceof Error?i.message:String(i);N.warn(`[upgrade] handover failed: ${o}`),this.upgrade={kind:"FAILED",version:t,reason:o,at:Date.now()}})}async performUpgrade(t){let r=this.initializeRequest;if(!r)throw new Error("the MCP client never initialized this server");let n=await this.options.prepare(t),i=new uv(n,this.options.launch(n),o=>this.options.inner.send(o),o=>{this.relay===i&&this.options.onRelayExit?.(o)});try{await i.initialize(r,this.negotiatedProtocol,[...this.logLevelRequest?[this.logLevelRequest]:[],...this.subscriptions.values()])}catch(o){throw i.close(),o}this.relay=i,this.toolsRelisted.reset();for(let o of fZ)await this.options.inner.send({jsonrpc:"2.0",method:o});return N.info(`[upgrade] handed this session over to ${n} (was ${this.options.currentVersion})`),this.options.onRelayActive?.(),i}async handOver(t){let r=this.upgrade;if(!r){await this.options.inner.send(sv(t,"internal error: upgrade was not requested"));return}if(r.kind==="FAILED"){await this.options.inner.send(sv(t,ai(r.version,r.reason,this.host())));return}let n=await gZ(r.target,this.options.waitMs??oZ);if(n.kind==="DONE"){let o=this.options.currentVersion,s=n.value.version;n.value.send(t,async a=>{let u=await this.toolsRelisted.waitFor(this.reloadGraceMs()),c=this.upgradeNoted;return this.upgradeNoted=!0,u||c||JSON.stringify(a).includes(cZ)?a:nD(a,GP(o,s,this.host()))});return}let i=n.kind==="TIMEOUT"?VP(r.version.current,Oo(r.version)??r.version.latest):ai(r.version,n.reason,this.host());await this.options.inner.send(sv(t,i))}reloadGraceMs(){return this.options.toolReloadGraceMs??uZ}async hostRelistedTools(){let t=this.startedAt+2*this.reloadGraceMs()-Date.now();return this.toolsRelisted.waitFor(Math.max(0,t))}host(){let t=this.initializeRequest?.params?.clientInfo;return qP(t)}async withToolHint(t,r){if(t.method!=="tools/call")return r;let n=hZ(r);if(n===null)return r;let{upgradedFrom:i,currentVersion:o}=this.options;return lZ.test(n)?mZ(r,$P(String(t.params?.name??""),o,this.host(),{upgradedFrom:i,toolListReloaded:i?await this.hostRelistedTools():!1})):i&&pZ.test(n)?nD(r,BP(i,o,this.host(),await this.hostRelistedTools())):r}};function hZ(e){let t=e.result,r=t?.content?.[0];return t?.isError&&r?.type==="text"&&typeof r.text=="string"?r.text:null}function mZ(e,t){return{jsonrpc:"2.0",id:e.id,result:{content:[{type:"text",text:t}],isError:!0}}}function nD(e,t){if(e.error)return{jsonrpc:"2.0",id:e.id,error:{...e.error,message:`${e.error.message}
|
|
1513
|
+
${t}`}};let r=e.result;return r?.content?{jsonrpc:"2.0",id:e.id,result:{...r,content:[...r.content,{type:"text",text:t}]}}:e}function sv(e,t){return e.method==="tools/call"?{jsonrpc:"2.0",id:e.id,result:{content:[{type:"text",text:t}],isError:!0}}:{jsonrpc:"2.0",id:e.id,error:{code:-32603,message:t}}}var av=class{seen=!1;waiters=new Set;reset(){this.seen=!1}mark(){this.seen=!0;for(let t of this.waiters)t();this.waiters.clear()}waitFor(t){return this.seen||t<=0?Promise.resolve(this.seen):new Promise(r=>{let n=()=>{clearTimeout(i),r(!0)},i=setTimeout(()=>{this.waiters.delete(n),r(!1)},t);this.waiters.add(n)})}};function gZ(e,t){return new Promise(r=>{let n=setTimeout(()=>r({kind:"TIMEOUT"}),t);e.then(i=>{clearTimeout(n),r({kind:"DONE",value:i})},i=>{clearTimeout(n),r({kind:"FAILED",reason:i instanceof Error?i.message:String(i)})})})}var uv=class{constructor(t,r,n,i){this.version=t;this.child=r;this.toHost=n;r.stdout.on("data",a=>{for(this.buffer.append(a);;){let u;try{u=this.buffer.readMessage()}catch(c){N.warn(`[upgrade] unreadable message from new version: ${String(c)}`);continue}if(!u)break;this.route(u)}}),r.stdin.on("error",()=>{});let o=!1,s=(a,u)=>{if(!o){o=!0;for(let c of this.waiters.values())c({jsonrpc:"2.0",id:"",error:{code:-32603,message:u}});this.waiters.clear(),this.closed||Promise.allSettled([...this.inflight]).then(()=>i(a))}};r.on("error",a=>s(1,`it could not start: ${a.message}`)),r.on("exit",a=>s(a??1,`it exited with ${a}`))}buffer=new wo;intercepts=new Map;inflight=new Set;waiters=new Map;sequence=0;closed=!1;send(t,r){r&&"id"in t&&t.id!==void 0&&this.intercepts.set(t.id,r),this.closed||this.child.stdin.write(Wl(t))}async initialize(t,r,n){let i=await this.request(t.method,{...t.params,...r?{protocolVersion:r}:{}});if(i.error)throw new Error(`the new version did not initialize: ${i.error.message}`);let o=i.result?.protocolVersion;if(r&&o!==r)throw new Error(`the new version speaks MCP ${String(o)}, but this session uses ${r}`);this.send({jsonrpc:"2.0",method:"notifications/initialized"});for(let s of n)await this.request(s.method,s.params).catch(()=>{})}close(){this.closed||(this.closed=!0,this.child.stdin.end())}request(t,r){this.sequence+=1;let n=`handover-${this.sequence}`;return new Promise((i,o)=>{let s=setTimeout(()=>{this.waiters.delete(n),o(new Error(`the new version did not answer ${t}`))},sZ);this.waiters.set(n,a=>{clearTimeout(s),i(a)}),this.send({jsonrpc:"2.0",id:n,method:t,params:r})})}route(t){if(iD(t)){let r=typeof t.id=="string"?this.waiters.get(t.id):void 0;if(r){this.waiters.delete(t.id),r(t);return}let n=this.intercepts.get(t.id);if(n){this.intercepts.delete(t.id);let i=n(t).then(o=>this.toHost(o));this.inflight.add(i),i.finally(()=>this.inflight.delete(i));return}}this.toHost(t)}};var Xl=Tn.toLowerCase(),sD=e=>`${Xl}://project/${encodeURIComponent(e)}/schema-state`,aD=e=>`${Xl}://project/${encodeURIComponent(e)}/schema-events`,uD=e=>Array.isArray(e)?String(e[0]??""):String(e??"");async function cv(e){let t=oD.resolve(e),r=await ba(t),n=cD(),i=async()=>{await bt(r,{name:"daemon.pin",args:{token:n}})},o=async()=>{await bt(r,{name:"daemon.unpin",args:{token:n}}).catch(()=>{})};await i();let s=setInterval(()=>{bt(r,{name:"daemon.heartbeat",args:{token:n}}).catch(()=>{})},6e4);s.unref();let a=new jv({name:Y,version:"1.0.0"},{instructions:XP(),capabilities:{tools:{},prompts:{},resources:{subscribe:!0}}});Av(a);let u=new Set;a.server.setRequestHandler(Lv,S=>(u.add(S.params.uri),{})),a.server.setRequestHandler(kv,S=>(u.delete(S.params.uri),{}));let c=process.env.MCP_HOST_SESSION_ID||vZ(),l=async(S,I)=>{if(S.agent??=a.server.getClientVersion()?.name,S.sessionId??=c,S.name==="workspace.set"&&typeof S.args?.cwd=="string"){let A=oD.resolve(S.args.cwd);if(S.args.cwd=A,A!==t){let T=r;r=await ba(A),t=A,await bt(T,{name:"daemon.unpin",args:{token:n}},I).catch(()=>{}),await i()}}return bt(r,S,I)},d=new Ro,f=new Jl({inner:new zl,currentVersion:bn(),upgradedFrom:process.env.MCP_UPGRADED_FROM||void 0,canUpgrade:S=>No()&&Oo(S)!==null,prepare:S=>d.installFirst(Sa(S)),launch:S=>yZ(process.execPath,[d.binPath(S),"mcp","--cwd",t],{stdio:["pipe","pipe","inherit"],env:{...process.env,MCP_HOST_SESSION_ID:c,MCP_UPGRADED_FROM:bn()}}),onRelayActive:()=>{clearInterval(s),v.unsubscribe(),o()},onRelayExit:S=>process.exit(S)});Fv(a,f.wrapSender(l)),Uv(a,f.wrapSender(l));let h=async()=>{let S=await bt(r,{name:"schema.status"});if(!S.ok)return[];let A=S.data?.sessions;return Array.isArray(A)?[...new Set(A.map(T=>T?.projectExId).filter(T=>typeof T=="string"))]:[]};a.registerResource("project-schema-state",new op(`${Xl}://project/{projectExId}/schema-state`,{list:async()=>({resources:(await h()).map(S=>({uri:sD(S),name:`schema-state-${S}`,title:`Schema state ${S}`,description:"Current in-memory schema revision and stale/change notification state.",mimeType:"application/json"}))})}),{title:"Project Schema State",description:"Current in-memory schema revision and stale/change notification state.",mimeType:"application/json"},async(S,I)=>{let A=uD(I.projectExId),T=await bt(r,{name:"schema.state",args:{projectExId:A}});return{contents:[{uri:S.href,mimeType:"application/json",text:JSON.stringify(T.ok?T.data:T,null,2)}]}}),a.registerResource("project-schema-events",new op(`${Xl}://project/{projectExId}/schema-events`,{list:async()=>({resources:(await h()).map(S=>({uri:aD(S),name:`schema-events-${S}`,title:`Schema events ${S}`,description:"Recent semantic schema-change events observed by the daemon.",mimeType:"application/json"}))})}),{title:"Project Schema Events",description:"Recent semantic schema-change events observed by the daemon.",mimeType:"application/json"},async(S,I)=>{let A=uD(I.projectExId),T=await bt(r,{name:"schema.events",args:{projectExId:A}});return{contents:[{uri:S.href,mimeType:"application/json",text:JSON.stringify(T.ok?T.data:T,null,2)}]}}),await a.connect(f),process.env.MCP_UPGRADED_FROM||eD(Ea,d).catch(S=>{N.warn(`[upgrade] prefetch failed: ${String(S)}`)});let g=new Set,v=QP(r,async S=>{if(!S?.id||g.has(S.id))return;g.add(S.id);let I=String(S.projectExId??"");if(!I)return;let A=sD(I),T=aD(I),x=[u.has(A)?a.server.sendResourceUpdated({uri:A}):Promise.resolve(),u.has(T)?a.server.sendResourceUpdated({uri:T}):Promise.resolve()];await Promise.all([...x,a.sendLoggingMessage({level:"notice",logger:Y,data:{message:"Project schema changed",projectExId:I,event:S}})])},S=>{N.warn("Daemon subscription error",S.message)}),_=!1,b=async()=>{_||(_=!0,clearInterval(s),v.unsubscribe(),await o(),await a.close())};process.on("SIGINT",()=>{b().finally(()=>process.exit(0))}),process.on("SIGTERM",()=>{b().finally(()=>process.exit(0))}),process.stdin.on("end",()=>{b().finally(()=>process.exit(0))}),process.stdin.on("close",()=>{b().finally(()=>process.exit(0))}),process.on("exit",()=>{clearInterval(s),v.unsubscribe()})}p();var EZ=/^-?\d+(\.\d+)?$/;function _Z(e){return e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")}function SZ(e){if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;if(EZ.test(e))return Number(e);if(_Z(e))try{return JSON.parse(e)}catch{return e}return e}function lD(e){let t=Number(e);if(Number.isNaN(t))throw new Tp("expected a number");return t}function lv(e){try{return JSON.parse(e)}catch{throw new Tp("expected valid JSON")}}function pD(e){if(typeof e!="string")return{};try{let t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function bZ(e){let t={};for(let r=0;r<e.length;r++){let n=e[r];if(!n.startsWith("--"))continue;let i=n.slice(2),o,s=i.indexOf("=");if(s!==-1)o=i.slice(s+1),i=i.slice(0,s);else{let a=e[r+1];a!==void 0&&!a.startsWith("--")&&(o=a,r+=1)}o===void 0?i.startsWith("no-")?t[i.slice(3)]=!1:t[i]=!0:t[i]=SZ(o)}return t}function dD(e,t,r){let n=pD(e.args);return Object.assign(n,bZ(t)),r&&(n.subcommand=r),n}function fD(e,t){let r=pD(t.args),n=e.opts();for(let i of e.options){let o=i.attributeName();e.getOptionValueSource(o)==="cli"&&(r[o]=n[o])}return r}p();function TZ(e){let t=e,r=!1;for(;;)if(t instanceof Pt.ZodOptional)r=!0,t=t.unwrap();else if(t instanceof Pt.ZodNullable)t=t.unwrap();else if(t instanceof Pt.ZodDefault)t=t.removeDefault();else break;return{base:t,optional:r}}function hD(e,t){for(let[r,n]of Object.entries(t)){let{base:i,optional:o}=TZ(n),s=o?"":"required",a=`${s} JSON`.trim();i instanceof Pt.ZodBoolean?(e.option(`--${r}`,s),e.option(`--no-${r}`)):i instanceof Pt.ZodNumber?e.option(`--${r} <value>`,s,lD):i instanceof Pt.ZodArray?i.element instanceof Pt.ZodString?e.option(`--${r} <values...>`,s):e.option(`--${r} <json>`,a,lv):i instanceof Pt.ZodRecord||i instanceof Pt.ZodObject||i instanceof Pt.ZodAny||i instanceof Pt.ZodUnknown?e.option(`--${r} <json>`,a,lv):e.option(`--${r} <value>`,s)}}var pv=["default"],vD=[];function ui(e){return typeof e.cwd=="string"?yD.resolve(e.cwd):process.env.WORKSPACE_ROOT||process.cwd()}function Zl(e){return e.pretty===void 0?!0:!e.pretty}async function ED(e,t,r){let n={name:e,args:t},i=ui(r),o=r.daemon===!1?await MZ(n,i):await jZ(n,i),s=Yl(o);if(s){let a=await ZP(s,vD);if(a.kind==="RERAN"){Ov(a.status);return}a.kind==="FAILED"&&(o={...o,error:ai(s,a.reason)})}ep(o,Zl(r)),o.ok||(process.exitCode=1)}async function CZ(e){let t=await ba(ui(e));ep({ok:!0,data:_D(t),message:"Daemon started"},Zl(e))}async function RZ(e){await YP({workspaceRoot:ui(e),idleTimeoutMs:FZ(process.env.ZED_AGENT_DAEMON_IDLE_TTL)??Ql,startupFlags:pv})}async function NZ(e){let r=await new _n(ui(e)).list();ep({ok:!0,data:r.map(_D)},Zl(e))}async function PZ(e){let t=ui(e),r=new _n(t),n=new Sr(t),i=await go(n,pv),o=await r.list(),s=[];for(let a of o)if(JSON.stringify(a.compatibility)===JSON.stringify(i))try{await bt(a,{name:"daemon.stop"}),s.push(a.pid)}catch{await r.remove(a.pid)}ep({ok:!0,data:{stopped:s}},Zl(e))}function mD(e,t){return e.commands.find(r=>r.name()===t)}function gD(e,t,r,n,i){let o=e;for(let u=0;u<t.length-1;u+=1)o=mD(o,t[u])??o.command(t[u]);let s=t[t.length-1];if(mD(o,s))return;let a=o.command(s).description(r);i&&hD(a,i),a.action(async(u,c)=>{let l=c.optsWithGlobals();await ED(n,fD(c,l),l)})}function DZ(e,t,r,n){gD(e,r.path.split(" "),t.description,t.command,n),r.alias&&gD(e,r.alias.split(" "),t.description,t.command,n)}function LZ(){let e=Nt(),t=Object.keys(Iv).join(", ");return["","Backend environment:",` Active: ${e.name} (select with ZION_ENV / MCP_ENV; known: ${t})`,` API: ${e.apiBaseUrl}`,` Auth: ${e.authEndpoint}`," Override any endpoint individually with BACKEND_API_BASE,"," BACKEND_AUTH_ENDPOINT, ZERO_API_URL_TEMPLATE, LOG_API_URL_TEMPLATE.","","Upgrades:"," When the backend stops supporting this version, the newer release is installed",` into ~/.${Y}/versions and the call continues on it; later starts run it directly.`," MCP_AUTO_UPGRADE=0 turns this off and only reports the required upgrade.","","Logs:",` File: ${xv()}`,` Level: ${process.env.MCP_LOG_LEVEL??"info"} (set MCP_LOG_LEVEL; debug, or verbose)`," Verbose: MCP_LOG_LEVEL=verbose (or MCP_LOG_GQL=1) logs full GraphQL bodies + subscription events"," Rotation: 50 MB x 5 files; data older than 1 day is truncated"," Override: MCP_LOG_DIR, MCP_LOG_MAX_BYTES, MCP_LOG_MAX_FILES,"," MCP_LOG_MAX_AGE_DAYS (0 disables), MCP_LOG_FILE=off"].join(`
|
|
1514
|
+
`)}function kZ(e){return e instanceof Error&&"code"in e&&typeof e.code=="string"&&e.code.startsWith("commander.")}async function bge(e=process.argv.slice(2)){vD=e;let t=new eE;t.name(Y).allowUnknownOption(!0).allowExcessArguments(!0).exitOverride(),t.option("--no-daemon","Run command one-shot without starting or using daemon"),t.option("--cwd <dir>","Workspace root for product config and daemon registry"),t.option("--pretty","Human-oriented output"),t.option("--args <json>","Pass arguments as JSON string"),t.command("mcp").description("Run MCP Bridge").allowUnknownOption(!0).action(async(i,o)=>{await cv(ui(o.optsWithGlobals()))}),t.command("version-check").description("Compare this CLI against the backend-advertised minimum supported version").action(async()=>{let i=await Ea();process.stdout.write(`${Bl(i)}
|
|
1515
|
+
`),i.status==="outdated"&&(process.exitCode=1)}),t.command("tool-surface",{hidden:!0}).description("Print the MCP tools, prompts and CLI verbs this version exposes, as JSON").action(async()=>{let{collectToolSurface:i}=await import("./surface-TGGCJZR5.js");process.stdout.write(`${JSON.stringify(await i(),null,2)}
|
|
1516
|
+
`)});let r=t.command("daemon").description("Daemon control"),n=[["start","Start daemon",CZ],["foreground","Run daemon in foreground",RZ],["status","Get daemon status",NZ],["stop","Stop daemon",PZ]];for(let[i,o,s]of n)r.command(i).description(o).action(async(a,u)=>{await s(u.optsWithGlobals())});for(let i of Mv){if(!i.cli)continue;let o=i.cli,s=i.tool?.inputSchema;DZ(t,i,o,s)}t.argument("[parts...]","Custom agent command or MCP Bridge").action(async(i,o,s)=>{let a=s.optsWithGlobals();if(!i||i.length===0){await cv(ui(a));return}let u=[],c=[],l=!1;for(let d of i)!l&&d.startsWith("--")&&(l=!0),(l?c:u).push(d);await ED(u[0],dD(a,c,u[1]),a)}),t.addHelpText("afterAll",LZ);try{await t.parseAsync(["node",Y,...e])}catch(i){if(kZ(i)){i.code==="commander.help"||i.code==="commander.helpDisplayed"||i.code==="commander.version"||(process.exitCode=1);return}throw i}}async function jZ(e,t){let r=await ba(t);return bt(r,e)}async function MZ(e,t){let r=Kl(t);try{return await r.execute(e)}finally{r.stop()}}async function ba(e){let t=new _n(e),r=new Sr(e),n=await go(r,pv),i=await t.findCompatible(n);if(i)try{if((await bt(i,{name:"daemon.ping"})).ok)return i}catch{await t.remove(i.pid)}let o=t.createRecord(n);await t.ensure(),await xZ.mkdir(yD.dirname(o.logPath),{recursive:!0});let s=AZ(o.logPath,"a"),a=IZ(process.execPath,[process.argv[1],"daemon","foreground"],{cwd:e,detached:!0,env:{...process.env,WORKSPACE_ROOT:e,ZED_AGENT_DAEMON_IDLE_TTL:process.env.ZED_AGENT_DAEMON_IDLE_TTL??String(Ql)},stdio:["ignore",s,s]});OZ(s),a.unref();let u=Date.now()+1e4,c=null;for(;Date.now()<u;){await qZ(200);let l=await t.findCompatible(n);if(l)try{if((await bt(l,{name:"daemon.ping"})).ok)return l}catch(d){c=d}}throw new Error(`Failed to start daemon${c?`: ${c.message}`:""}`)}function _D(e){let{token:t,...r}=e;return r}function ep(e,t){if(t){let r=e.ok?e.data??(e.message!==void 0?{message:e.message}:{}):{error:e.error,...e.data!==void 0?{data:e.data}:{}};process.stdout.write(`${JSON.stringify(r,null,2)}
|
|
1471
1517
|
`);return}e.message&&process.stdout.write(`${e.message}
|
|
1472
1518
|
`),e.data!==void 0&&process.stdout.write(`${JSON.stringify(e.data,null,2)}
|
|
1473
1519
|
`),e.error&&process.stderr.write(`${e.error}
|
|
1474
|
-
`)}function
|
|
1520
|
+
`)}function FZ(e){if(!e)return null;if(/^\d+$/.test(e))return Number(e);let t=e.match(/^(\d+)(ms|s|m|h)$/);if(!t)return null;let r=Number(t[1]),n=t[2];return n==="ms"?r:n==="s"?r*1e3:n==="m"?r*6e4:r*60*6e4}function cD(){return wZ()}var qZ=e=>new Promise(t=>{setTimeout(t,e)});export{cD as createMcpPinToken,ba as ensureDaemon,bge as runCli};
|