zion-mcp 2.8.2 → 2.8.3
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-V7YNFSBA.js → chunk-75A6HWF6.js} +1 -1
- package/dist/{chunk-LQXIJ6IC.js → chunk-7VVKHGGT.js} +1 -1
- package/dist/{chunk-4QGP6SS6.js → chunk-ATGTMFY5.js} +1 -1
- package/dist/{chunk-2HB5XNRD.js → chunk-EP2OX7PH.js} +11 -17
- package/dist/{chunk-PCRBAYPI.js → chunk-QTOGKZCE.js} +1 -1
- package/dist/{chunk-L3ZOUP3F.js → chunk-YUFE5SO6.js} +1 -1
- package/dist/cli-XXSHELNV.js +1433 -0
- package/dist/{corpus-UM23FYNV.js → corpus-73N3F2LB.js} +1 -1
- package/dist/{index.cjs-3U67BJYG.js → index.cjs-ERRJ7ONN.js} +1 -1
- package/dist/{json-crdt-BC5BIGDJ.js → json-crdt-DOM7HQ5E.js} +1 -1
- package/dist/{json-crdt-patch-JAVNDWYK.js → json-crdt-patch-3KSX2FWP.js} +1 -1
- package/dist/server.js +1 -1
- package/dist/{surface-JDDFP4JL.js → surface-JK45KCNT.js} +1 -1
- package/dist/{ztype-VF25BWB2.js → ztype-G7EMRCO5.js} +115 -107
- package/package.json +1 -1
- package/dist/cli-OEODBI6G.js +0 -1465
package/dist/cli-OEODBI6G.js
DELETED
|
@@ -1,1465 +0,0 @@
|
|
|
1
|
-
import { createRequire as __nodeCreateRequire } from 'node:module';
|
|
2
|
-
const require = __nodeCreateRequire(import.meta.url);
|
|
3
|
-
import{a as Kl,b as oi,c as Oo,d as wo,f as uv,g as cv}from"./chunk-V7YNFSBA.js";import{A as yv,B as vv,V as Ev,W as zl,X as _v,Y as Sv,Z as bv,_ as Tv,a as lv,b as Hl,c as dv,d as Ql,e as C,f as Nt,g as pv,h as Ct,i as fv,j as Wl,k as hv,l as mv,s as gv}from"./chunk-2HB5XNRD.js";import{a as qr,b as ov,c as En,d as X,e as Io,f as sv,g as _a,i as av}from"./chunk-L3ZOUP3F.js";import{a as M,c as y,e as Qe,g as d}from"./chunk-4QGP6SS6.js";var Ao=y(Jl=>{d();var Sa=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}},Yl=class extends Sa{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Jl.CommanderError=Sa;Jl.InvalidArgumentError=Yl});var ba=y(Zl=>{d();var{InvalidArgumentError:JP}=Ao(),Xl=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 JP(`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 XP(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}Zl.Argument=Xl;Zl.humanReadableArgName=XP});var rd=y(td=>{d();var{humanReadableArgName:ZP}=ba(),ed=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=>ZP(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(p,f){return r.formatItem(p,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(p=>o(r.styleArgumentTerm(r.argumentTerm(p)),r.styleArgumentDescription(r.argumentDescription(p))));if(s=s.concat(this.formatItemList("Arguments:",u,r)),this.groupItems(t.options,r.visibleOptions(t),p=>p.helpGroupHeading??"Options:").forEach((p,f)=>{let h=p.map(g=>o(r.styleOptionTerm(r.optionTerm(g)),r.styleOptionDescription(r.optionDescription(g))));s=s.concat(this.formatItemList(f,h,r))}),r.showGlobalOptions){let p=r.visibleGlobalOptions(t).map(f=>o(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));s=s.concat(this.formatItemList("Global Options:",p,r))}return this.groupItems(t.commands,r.visibleCommands(t),p=>p.helpGroup()||"Commands:").forEach((p,f)=>{let h=p.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 Iv(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,p;return l<this.minWidthToWrap||i.preformatted(n)?p=n:p=i.boxWrap(n,l).replace(/\n/g,`
|
|
5
|
-
`+" ".repeat(r+u)),s+a+" ".repeat(u)+p.replace(/\n/g,`
|
|
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 p=this.displayWidth(l);if(c+p<=r){u.push(l),c+=p;return}o.push(u.join(""));let f=l.trimStart();u=[f],c=this.displayWidth(f)}),o.push(u.join(""))}),o.join(`
|
|
7
|
-
`)}};function Iv(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}td.Help=ed;td.stripColor=Iv});var sd=y(od=>{d();var{InvalidArgumentError:eD}=Ao(),nd=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=tD(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 eD(`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?Ov(this.name().replace(/^no-/,"")):Ov(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}},id=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 Ov(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function tD(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
|
-
- a short flag is a single dash and a single character
|
|
9
|
-
- either use a single dash and a single character (for a short flag)
|
|
10
|
-
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(s)?new Error(`${a}
|
|
11
|
-
- too many short flags`):i.test(s)?new Error(`${a}
|
|
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}}od.Option=nd;od.DualOptions=id});var Av=y(wv=>{d();function rD(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 nD(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=rD(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
|
-
(Did you mean one of ${n.join(", ")}?)`:n.length===1?`
|
|
15
|
-
(Did you mean ${n[0]}?)`:""}wv.suggestSimilar=nD});var Cv=y(dd=>{d();var iD=M("node:events").EventEmitter,ad=M("node:child_process"),_r=M("node:path"),Ta=M("node:fs"),pe=M("node:process"),{Argument:oD,humanReadableArgName:sD}=ba(),{CommanderError:ud}=Ao(),{Help:aD,stripColor:uD}=rd(),{Option:xv,DualOptions:cD}=sd(),{suggestSimilar:Rv}=Av(),cd=class e extends iD{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=>pe.stdout.write(r),writeErr:r=>pe.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>pe.stdout.isTTY?pe.stdout.columns:void 0,getErrHelpWidth:()=>pe.stderr.isTTY?pe.stderr.columns:void 0,getOutHasColors:()=>ld()??(pe.stdout.isTTY&&pe.stdout.hasColors?.()),getErrHasColors:()=>ld()??(pe.stderr.isTTY&&pe.stderr.hasColors?.()),stripColor:r=>uD(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 aD,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 oD(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 ud(t,r,n)),pe.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 xv(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 xv)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){pe.versions?.electron&&(r.from="electron");let i=pe.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}t===void 0&&(t=pe.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":pe.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
|
-
- 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(Ta.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
|
-
- if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
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,p){let f=_r.resolve(l,p);if(Ta.existsSync(f))return f;if(i.includes(_r.extname(p)))return;let h=i.find(g=>Ta.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=Ta.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 p=_r.basename(this._scriptPath,_r.extname(this._scriptPath));p!==this._name&&(l=o(a,`${p}-${t._name}`))}s=l||s}n=i.includes(_r.extname(s));let u;pe.platform!=="win32"?n?(r.unshift(s),r=Nv(pe.execArgv).concat(r),u=ad.spawn(pe.argv[0],r,{stdio:"inherit"})):u=ad.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,t._name),r.unshift(s),r=Nv(pe.execArgv).concat(r),u=ad.spawn(pe.execPath,r,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(p=>{pe.on(p,()=>{u.killed===!1&&u.exitCode===null&&u.kill(p)})});let c=this._exitCallback;u.on("close",l=>{l=l??1,c?c(new ud(l,"commander.executeSubCommandAsync","(close)")):pe.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)pe.exit(1);else{let p=new ud(1,"commander.executeSubCommandAsync","(error)");p.nestedError=l,c(p)}}),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(p=>p.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 p=this._findOption(l);if(p){if(p.required){let f=t[c++];f===void 0&&this.optionMissingArgument(p),this.emit(`option:${p.name()}`,f)}else if(p.optional){let f=null;c<t.length&&(!o(t[c])||s(t[c]))&&(f=t[c++]),this.emit(`option:${p.name()}`,f)}else this.emit(`option:${p.name()}`);a=p.variadic?p:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let p=this._findOption(`-${l[1]}`);if(p){p.required||p.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${p.name()}`,l.slice(2)):(this.emit(`option:${p.name()}`),u=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let p=l.indexOf("="),f=this._findOption(l.slice(0,p));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,l.slice(p+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
|
-
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
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 pe.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()}`,pe.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new cD(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(p=>p.negate&&a===p.attributeName()),l=this.options.find(p=>!p.negate&&a===p.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=Rv(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=Rv(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=>sD(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(pe.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
|
-
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 Nv(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 ld(){if(pe.env.NO_COLOR||pe.env.FORCE_COLOR==="0"||pe.env.FORCE_COLOR==="false")return!1;if(pe.env.FORCE_COLOR||pe.env.CLICOLOR_FORCE!==void 0)return!0}dd.Command=cd;dd.useColor=ld});var kv=y(Pt=>{d();var{Argument:Pv}=ba(),{Command:pd}=Cv(),{CommanderError:lD,InvalidArgumentError:Dv}=Ao(),{Help:dD}=rd(),{Option:Lv}=sd();Pt.program=new pd;Pt.createCommand=e=>new pd(e);Pt.createOption=(e,t)=>new Lv(e,t);Pt.createArgument=(e,t)=>new Pv(e,t);Pt.Command=pd;Pt.Option=Lv;Pt.Argument=Pv;Pt.Help=dD;Pt.CommanderError=lD;Pt.InvalidArgumentError=Dv;Pt.InvalidOptionArgumentError=Dv});var si=y((hd,qv)=>{d();var Ia=M("buffer"),or=Ia.Buffer;function Fv(e,t){for(var r in e)t[r]=e[r]}or.from&&or.alloc&&or.allocUnsafe&&or.allocUnsafeSlow?qv.exports=Ia:(Fv(Ia,hd),hd.Buffer=_n);function _n(e,t,r){return or(e,t,r)}_n.prototype=Object.create(or.prototype);Fv(or,_n);_n.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return or(e,t,r)};_n.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};_n.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return or(e)};_n.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Ia.SlowBuffer(e)}});var md=y((ZX,Uv)=>{d();var Oa=si().Buffer,pD=M("stream"),fD=M("util");function wa(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=Oa.alloc(0),this;if(typeof e.pipe=="function")return this.buffer=Oa.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+")")}fD.inherits(wa,pD);wa.prototype.write=function(t){this.buffer=Oa.concat([this.buffer,Oa.from(t)]),this.emit("data",t)};wa.prototype.end=function(t){t&&this.write(t),this.emit("end",t),this.emit("close"),this.writable=!1,this.readable=!1};Uv.exports=wa});var Gv=y((tZ,Vv)=>{"use strict";d();function gd(e){var t=(e/8|0)+(e%8===0?0:1);return t}var hD={ES256:gd(256),ES384:gd(384),ES512:gd(521)};function mD(e){var t=hD[e];if(t)return t;throw new Error('Unknown algorithm "'+e+'"')}Vv.exports=mD});var zv=y((nZ,Wv)=>{"use strict";d();var Aa=si().Buffer,Bv=Gv(),xa=128,Kv=0,gD=32,yD=16,vD=2,Hv=yD|gD|Kv<<6,Ra=vD|Kv<<6;function ED(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Qv(e){if(Aa.isBuffer(e))return e;if(typeof e=="string")return Aa.from(e,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function _D(e,t){e=Qv(e);var r=Bv(t),n=r+1,i=e.length,o=0;if(e[o++]!==Hv)throw new Error('Could not find expected "seq"');var s=e[o++];if(s===(xa|1)&&(s=e[o++]),i-o<s)throw new Error('"seq" specified length of "'+s+'", only "'+(i-o)+'" remaining');if(e[o++]!==Ra)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++]!==Ra)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 p=r-a,f=r-c,h=Aa.allocUnsafe(p+a+f+c);for(o=0;o<p;++o)h[o]=0;e.copy(h,o,u+Math.max(-p,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=ED(h),h}function $v(e,t,r){for(var n=0;t+n<r&&e[t+n]===0;)++n;var i=e[t+n]>=xa;return i&&--n,n}function SD(e,t){e=Qv(e);var r=Bv(t),n=e.length;if(n!==r*2)throw new TypeError('"'+t+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=$v(e,0,r),o=$v(e,r,e.length),s=r-i,a=r-o,u=2+s+1+1+a,c=u<xa,l=Aa.allocUnsafe((c?2:3)+u),p=0;return l[p++]=Hv,c?l[p++]=u:(l[p++]=xa|1,l[p++]=u&255),l[p++]=Ra,l[p++]=s,i<0?(l[p++]=0,p+=e.copy(l,p,0,r)):p+=e.copy(l,p,i,r),l[p++]=Ra,l[p++]=a,o<0?(l[p++]=0,e.copy(l,p,r)):e.copy(l,p,r+o),l}Wv.exports={derToJose:_D,joseToDer:SD}});var Jv=y((oZ,Yv)=>{"use strict";d();var xo=M("buffer").Buffer,yd=M("buffer").SlowBuffer;Yv.exports=Na;function Na(e,t){if(!xo.isBuffer(e)||!xo.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}Na.install=function(){xo.prototype.equal=yd.prototype.equal=function(t){return Na(this,t)}};var bD=xo.prototype.equal,TD=yd.prototype.equal;Na.restore=function(){xo.prototype.equal=bD,yd.prototype.equal=TD}});var Sd=y((aZ,sE)=>{d();var ui=si().Buffer,Dt=M("crypto"),Zv=zv(),Xv=M("util"),ID=`"%s" is not a valid algorithm.
|
|
29
|
-
Supported algorithms are:
|
|
30
|
-
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Ro="secret must be a string or buffer",ai="key must be a string or a buffer",OD="key must be a string, a buffer or an object",Ed=typeof Dt.createPublicKey=="function";Ed&&(ai+=" or a KeyObject",Ro+="or a KeyObject");function eE(e){if(!ui.isBuffer(e)&&typeof e!="string"&&(!Ed||typeof e!="object"||typeof e.type!="string"||typeof e.asymmetricKeyType!="string"||typeof e.export!="function"))throw Qt(ai)}function tE(e){if(!ui.isBuffer(e)&&typeof e!="string"&&typeof e!="object")throw Qt(OD)}function wD(e){if(!ui.isBuffer(e)){if(typeof e=="string")return e;if(!Ed||typeof e!="object"||e.type!=="secret"||typeof e.export!="function")throw Qt(Ro)}}function _d(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function rE(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=Xv.format.bind(Xv,e).apply(null,t);return new TypeError(r)}function AD(e){return ui.isBuffer(e)||typeof e=="string"}function No(e){return AD(e)||(e=JSON.stringify(e)),e}function nE(e){return function(r,n){wD(n),r=No(r);var i=Dt.createHmac("sha"+e,n),o=(i.update(r),i.digest("base64"));return _d(o)}}var vd,xD="timingSafeEqual"in Dt?function(t,r){return t.byteLength!==r.byteLength?!1:Dt.timingSafeEqual(t,r)}:function(t,r){return vd||(vd=Jv()),vd(t,r)};function RD(e){return function(r,n,i){var o=nE(e)(r,i);return xD(ui.from(n),ui.from(o))}}function iE(e){return function(r,n){tE(n),r=No(r);var i=Dt.createSign("RSA-SHA"+e),o=(i.update(r),i.sign(n,"base64"));return _d(o)}}function oE(e){return function(r,n,i){eE(i),r=No(r),n=rE(n);var o=Dt.createVerify("RSA-SHA"+e);return o.update(r),o.verify(i,n,"base64")}}function ND(e){return function(r,n){tE(n),r=No(r);var i=Dt.createSign("RSA-SHA"+e),o=(i.update(r),i.sign({key:n,padding:Dt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Dt.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return _d(o)}}function CD(e){return function(r,n,i){eE(i),r=No(r),n=rE(n);var o=Dt.createVerify("RSA-SHA"+e);return o.update(r),o.verify({key:i,padding:Dt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Dt.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function PD(e){var t=iE(e);return function(){var n=t.apply(null,arguments);return n=Zv.derToJose(n,"ES"+e),n}}function DD(e){var t=oE(e);return function(n,i,o){i=Zv.joseToDer(i,"ES"+e).toString("base64");var s=t(n,i,o);return s}}function LD(){return function(){return""}}function kD(){return function(t,r){return r===""}}sE.exports=function(t){var r={hs:nE,rs:iE,ps:ND,es:PD,none:LD},n={hs:RD,rs:oE,ps:CD,es:DD,none:kD},i=t.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Qt(ID,t);var o=(i[1]||i[3]).toLowerCase(),s=i[2];return{sign:r[o](s),verify:n[o](s)}}});var bd=y((cZ,aE)=>{d();var jD=M("buffer").Buffer;aE.exports=function(t){return typeof t=="string"?t:typeof t=="number"||jD.isBuffer(t)?t.toString():JSON.stringify(t)}});var fE=y((dZ,pE)=>{d();var MD=si().Buffer,uE=md(),FD=Sd(),qD=M("stream"),cE=bd(),Td=M("util");function lE(e,t){return MD.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function UD(e,t,r){r=r||"utf8";var n=lE(cE(e),"binary"),i=lE(cE(t),r);return Td.format("%s.%s",n,i)}function dE(e){var t=e.header,r=e.payload,n=e.secret||e.privateKey,i=e.encoding,o=FD(t.alg),s=UD(t,r,i),a=o.sign(s,n);return Td.format("%s.%s",s,a)}function Ca(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 uE(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new uE(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))}Td.inherits(Ca,qD);Ca.prototype.sign=function(){try{var t=dE({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")}};Ca.sign=dE;pE.exports=Ca});var TE=y((fZ,bE)=>{d();var mE=si().Buffer,hE=md(),VD=Sd(),GD=M("stream"),gE=bd(),$D=M("util"),BD=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function KD(e){return Object.prototype.toString.call(e)==="[object Object]"}function HD(e){if(KD(e))return e;try{return JSON.parse(e)}catch{return}}function yE(e){var t=e.split(".",1)[0];return HD(mE.from(t,"base64").toString("binary"))}function QD(e){return e.split(".",2).join(".")}function vE(e){return e.split(".")[2]}function WD(e,t){t=t||"utf8";var r=e.split(".")[1];return mE.from(r,"base64").toString(t)}function EE(e){return BD.test(e)&&!!yE(e)}function _E(e,t,r){if(!t){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}e=gE(e);var i=vE(e),o=QD(e),s=VD(t);return s.verify(o,i,r)}function SE(e,t){if(t=t||{},e=gE(e),!EE(e))return null;var r=yE(e);if(!r)return null;var n=WD(e);return(r.typ==="JWT"||t.json)&&(n=JSON.parse(n,t.encoding)),{header:r,payload:n,signature:vE(e)}}function ci(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 hE(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new hE(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))}$D.inherits(ci,GD);ci.prototype.verify=function(){try{var t=_E(this.signature.buffer,this.algorithm,this.key.buffer),r=SE(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")}};ci.decode=SE;ci.isValid=EE;ci.verify=_E;bE.exports=ci});var Da=y(Ur=>{d();var IE=fE(),Pa=TE(),zD=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Ur.ALGORITHMS=zD;Ur.sign=IE.sign;Ur.verify=Pa.verify;Ur.decode=Pa.decode;Ur.isValid=Pa.isValid;Ur.createSign=function(t){return new IE(t)};Ur.createVerify=function(t){return new Pa(t)}});var Id=y((yZ,OE)=>{d();var YD=Da();OE.exports=function(e,t){t=t||{};var r=YD.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 Co=y((EZ,wE)=>{d();var La=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};La.prototype=Object.create(Error.prototype);La.prototype.constructor=La;wE.exports=La});var Od=y((SZ,xE)=>{d();var AE=Co(),ka=function(e,t){AE.call(this,e),this.name="NotBeforeError",this.date=t};ka.prototype=Object.create(AE.prototype);ka.prototype.constructor=ka;xE.exports=ka});var wd=y((TZ,NE)=>{d();var RE=Co(),ja=function(e,t){RE.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};ja.prototype=Object.create(RE.prototype);ja.prototype.constructor=ja;NE.exports=ja});var PE=y((OZ,CE)=>{d();var li=1e3,di=li*60,pi=di*60,Sn=pi*24,JD=Sn*7,XD=Sn*365.25;CE.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return ZD(e);if(r==="number"&&isFinite(e))return t.long?tL(e):eL(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function ZD(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*XD;case"weeks":case"week":case"w":return r*JD;case"days":case"day":case"d":return r*Sn;case"hours":case"hour":case"hrs":case"hr":case"h":return r*pi;case"minutes":case"minute":case"mins":case"min":case"m":return r*di;case"seconds":case"second":case"secs":case"sec":case"s":return r*li;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function eL(e){var t=Math.abs(e);return t>=Sn?Math.round(e/Sn)+"d":t>=pi?Math.round(e/pi)+"h":t>=di?Math.round(e/di)+"m":t>=li?Math.round(e/li)+"s":e+"ms"}function tL(e){var t=Math.abs(e);return t>=Sn?Ma(e,t,Sn,"day"):t>=pi?Ma(e,t,pi,"hour"):t>=di?Ma(e,t,di,"minute"):t>=li?Ma(e,t,li,"second"):e+" ms"}function Ma(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var Ad=y((AZ,DE)=>{d();var rL=PE();DE.exports=function(e,t){var r=t||Math.floor(Date.now()/1e3);if(typeof e=="string"){var n=rL(e);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof e=="number"?r+e:void 0}});var fi=y((RZ,LE)=>{"use strict";d();var nL="2.0.0",iL=Number.MAX_SAFE_INTEGER||9007199254740991,oL=16,sL=250,aL=["major","premajor","minor","preminor","patch","prepatch","prerelease"];LE.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:oL,MAX_SAFE_BUILD_LENGTH:sL,MAX_SAFE_INTEGER:iL,RELEASE_TYPES:aL,SEMVER_SPEC_VERSION:nL,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Po=y((CZ,kE)=>{"use strict";d();var uL=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};kE.exports=uL});var hi=y((sr,jE)=>{"use strict";d();var{MAX_SAFE_COMPONENT_LENGTH:xd,MAX_SAFE_BUILD_LENGTH:cL,MAX_LENGTH:lL}=fi(),dL=Po();sr=jE.exports={};var pL=sr.re=[],fL=sr.safeRe=[],k=sr.src=[],hL=sr.safeSrc=[],j=sr.t={},mL=0,Rd="[a-zA-Z0-9-]",gL=[["\\s",1],["\\d",lL],[Rd,cL]],yL=e=>{for(let[t,r]of gL)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},z=(e,t,r)=>{let n=yL(t),i=mL++;dL(e,i,t),j[e]=i,k[i]=t,hL[i]=n,pL[i]=new RegExp(t,r?"g":void 0),fL[i]=new RegExp(n,r?"g":void 0)};z("NUMERICIDENTIFIER","0|[1-9]\\d*");z("NUMERICIDENTIFIERLOOSE","\\d+");z("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Rd}*`);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",`${Rd}+`);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,${xd}})(?:\\.(\\d{1,${xd}}))?(?:\\.(\\d{1,${xd}}))?`);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 Fa=y((LZ,ME)=>{"use strict";d();var vL=Object.freeze({loose:!0}),EL=Object.freeze({}),_L=e=>e?typeof e!="object"?vL:e:EL;ME.exports=_L});var Nd=y((jZ,UE)=>{"use strict";d();var FE=/^[0-9]+$/,qE=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;let r=FE.test(e),n=FE.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},SL=(e,t)=>qE(t,e);UE.exports={compareIdentifiers:qE,rcompareIdentifiers:SL}});var Je=y((FZ,GE)=>{"use strict";d();var qa=Po(),{MAX_LENGTH:VE,MAX_SAFE_INTEGER:Ua}=fi(),{safeRe:Va,t:Ga}=hi(),bL=Fa(),{compareIdentifiers:Cd}=Nd(),Pd=class e{constructor(t,r){if(r=bL(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>VE)throw new TypeError(`version is longer than ${VE} characters`);qa("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?Va[Ga.LOOSE]:Va[Ga.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>Ua||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ua||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ua||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<Ua)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(qa("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(qa("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 Cd(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(qa("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 Cd(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?Va[Ga.PRERELEASELOOSE]:Va[Ga.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]),Cd(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}};GE.exports=Pd});var Vr=y((UZ,BE)=>{"use strict";d();var $E=Je(),TL=(e,t,r=!1)=>{if(e instanceof $E)return e;try{return new $E(e,t)}catch(n){if(!r)return null;throw n}};BE.exports=TL});var HE=y((GZ,KE)=>{"use strict";d();var IL=Vr(),OL=(e,t)=>{let r=IL(e,t);return r?r.version:null};KE.exports=OL});var WE=y((BZ,QE)=>{"use strict";d();var wL=Vr(),AL=(e,t)=>{let r=wL(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};QE.exports=AL});var JE=y((HZ,YE)=>{"use strict";d();var zE=Je(),xL=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new zE(e instanceof zE?e.version:e,r).inc(t,n,i).version}catch{return null}};YE.exports=xL});var e_=y((WZ,ZE)=>{"use strict";d();var XE=Vr(),RL=(e,t)=>{let r=XE(e,null,!0),n=XE(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"};ZE.exports=RL});var r_=y((YZ,t_)=>{"use strict";d();var NL=Je(),CL=(e,t)=>new NL(e,t).major;t_.exports=CL});var i_=y((XZ,n_)=>{"use strict";d();var PL=Je(),DL=(e,t)=>new PL(e,t).minor;n_.exports=DL});var s_=y((e9,o_)=>{"use strict";d();var LL=Je(),kL=(e,t)=>new LL(e,t).patch;o_.exports=kL});var u_=y((r9,a_)=>{"use strict";d();var jL=Vr(),ML=(e,t)=>{let r=jL(e,t);return r&&r.prerelease.length?r.prerelease:null};a_.exports=ML});var Lt=y((i9,l_)=>{"use strict";d();var c_=Je(),FL=(e,t,r)=>new c_(e,r).compare(new c_(t,r));l_.exports=FL});var p_=y((s9,d_)=>{"use strict";d();var qL=Lt(),UL=(e,t,r)=>qL(t,e,r);d_.exports=UL});var h_=y((u9,f_)=>{"use strict";d();var VL=Lt(),GL=(e,t)=>VL(e,t,!0);f_.exports=GL});var $a=y((l9,g_)=>{"use strict";d();var m_=Je(),$L=(e,t,r)=>{let n=new m_(e,r),i=new m_(t,r);return n.compare(i)||n.compareBuild(i)};g_.exports=$L});var v_=y((p9,y_)=>{"use strict";d();var BL=$a(),KL=(e,t)=>e.sort((r,n)=>BL(r,n,t));y_.exports=KL});var __=y((h9,E_)=>{"use strict";d();var HL=$a(),QL=(e,t)=>e.sort((r,n)=>HL(n,r,t));E_.exports=QL});var Do=y((g9,S_)=>{"use strict";d();var WL=Lt(),zL=(e,t,r)=>WL(e,t,r)>0;S_.exports=zL});var Ba=y((v9,b_)=>{"use strict";d();var YL=Lt(),JL=(e,t,r)=>YL(e,t,r)<0;b_.exports=JL});var Dd=y((_9,T_)=>{"use strict";d();var XL=Lt(),ZL=(e,t,r)=>XL(e,t,r)===0;T_.exports=ZL});var Ld=y((b9,I_)=>{"use strict";d();var ek=Lt(),tk=(e,t,r)=>ek(e,t,r)!==0;I_.exports=tk});var Ka=y((I9,O_)=>{"use strict";d();var rk=Lt(),nk=(e,t,r)=>rk(e,t,r)>=0;O_.exports=nk});var Ha=y((w9,w_)=>{"use strict";d();var ik=Lt(),ok=(e,t,r)=>ik(e,t,r)<=0;w_.exports=ok});var kd=y((x9,A_)=>{"use strict";d();var sk=Dd(),ak=Ld(),uk=Do(),ck=Ka(),lk=Ba(),dk=Ha(),pk=(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 sk(e,r,n);case"!=":return ak(e,r,n);case">":return uk(e,r,n);case">=":return ck(e,r,n);case"<":return lk(e,r,n);case"<=":return dk(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};A_.exports=pk});var R_=y((N9,x_)=>{"use strict";d();var fk=Je(),hk=Vr(),{safeRe:Qa,t:Wa}=hi(),mk=(e,t)=>{if(e instanceof fk)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?Qa[Wa.COERCEFULL]:Qa[Wa.COERCE]);else{let u=t.includePrerelease?Qa[Wa.COERCERTLFULL]:Qa[Wa.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 hk(`${n}.${i}.${o}${s}${a}`,t)};x_.exports=mk});var C_=y((P9,N_)=>{"use strict";d();var gk=Vr(),yk=fi(),vk=Je(),Ek=(e,t,r)=>{if(!yk.RELEASE_TYPES.includes(t))return null;let n=_k(e,r);return n&&Sk(n,t)},_k=(e,t)=>{let r=e instanceof vk?e.version:e;return gk(r,t)},Sk=(e,t)=>{if(bk(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()},bk=e=>e.startsWith("pre");N_.exports=Ek});var D_=y((L9,P_)=>{"use strict";d();var jd=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}};P_.exports=jd});var kt=y((j9,M_)=>{"use strict";d();var Tk=/\s+/g,Md=class e{constructor(t,r){if(r=Ok(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof Fd)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(Tk," "),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=>!k_(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&&Lk(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(Dk,"");let n=((this.options.includePrerelease&&Ck)|(this.options.loose&&Pk))+":"+t,i=L_.get(n);if(i)return i;let o=this.options.loose,s=o?ut[Xe.HYPHENRANGELOOSE]:ut[Xe.HYPHENRANGE];t=t.replace(s,Bk(this.options.includePrerelease)),Te("hyphen replace",t),t=t.replace(ut[Xe.COMPARATORTRIM],xk),Te("comparator trim",t),t=t.replace(ut[Xe.TILDETRIM],Rk),Te("tilde trim",t),t=t.replace(ut[Xe.CARETTRIM],Nk),Te("caret trim",t);let a=t.split(" ").map(p=>kk(p,this.options)).join(" ").split(/\s+/).map(p=>$k(p,this.options));o&&(a=a.filter(p=>(Te("loose invalid filter",p,this.options),!!p.match(ut[Xe.COMPARATORLOOSE])))),Te("range list",a);let u=new Map,c=a.map(p=>new Fd(p,this.options));for(let p of c){if(k_(p))return[p];u.set(p.value,p)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return L_.set(n,l),l}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(n=>j_(n,r)&&t.set.some(i=>j_(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 wk(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Kk(this.set[r],t,this.options))return!0;return!1}};M_.exports=Md;var Ik=D_(),L_=new Ik,Ok=Fa(),Fd=Lo(),Te=Po(),wk=Je(),{safeRe:ut,src:Ak,t:Xe,comparatorTrimReplace:xk,tildeTrimReplace:Rk,caretTrimReplace:Nk}=hi(),{FLAG_INCLUDE_PRERELEASE:Ck,FLAG_LOOSE:Pk}=fi(),Dk=new RegExp(Ak[Xe.BUILD],"g"),k_=e=>e.value==="<0.0.0-0",Lk=e=>e.value==="",j_=(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},kk=(e,t)=>(e=e.replace(ut[Xe.BUILD],""),Te("comp",e,t),e=Fk(e,t),Te("caret",e),e=jk(e,t),Te("tildes",e),e=Uk(e,t),Te("xrange",e),e=Gk(e,t),Te("stars",e),e),ct=e=>!e||e.toLowerCase()==="x"||e==="*",jk=(e,t)=>e.trim().split(/\s+/).map(r=>Mk(r,t)).join(" "),Mk=(e,t)=>{let r=t.loose?ut[Xe.TILDELOOSE]:ut[Xe.TILDE];return e.replace(r,(n,i,o,s,a)=>{Te("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?(Te("replaceTilde pr",a),u=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):u=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,Te("tilde return",u),u})},Fk=(e,t)=>e.trim().split(/\s+/).map(r=>qk(r,t)).join(" "),qk=(e,t)=>{Te("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)=>{Te("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?(Te("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`):(Te("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`),Te("caret return",c),c})},Uk=(e,t)=>(Te("replaceXRanges",e,t),e.split(/\s+/).map(r=>Vk(r,t)).join(" ")),Vk=(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)=>{Te("xRange",e,n,i,o,s,a,u);let c=ct(o),l=c||ct(s),p=l||ct(a),f=p;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`:p&&(n=`>=${o}.${s}.0${u} <${o}.${+s+1}.0-0`),Te("xRange return",n),n})},Gk=(e,t)=>(Te("replaceStars",e,t),e.trim().replace(ut[Xe.STAR],"")),$k=(e,t)=>(Te("replaceGTE0",e,t),e.trim().replace(ut[t.includePrerelease?Xe.GTE0PRE:Xe.GTE0],"")),Bk=e=>(t,r,n,i,o,s,a,u,c,l,p,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(p)?u=`<${c}.${+l+1}.0-0`:f?u=`<=${c}.${l}.${p}-${f}`:e?u=`<${c}.${l}.${+p+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),Kk=(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(Te(e[n].semver),e[n].semver!==Fd.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 Lo=y((F9,$_)=>{"use strict";d();var ko=Symbol("SemVer ANY"),Vd=class e{static get ANY(){return ko}constructor(t,r){if(r=F_(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),Ud("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===ko?this.value="":this.value=this.operator+this.semver.version,Ud("comp",this)}parse(t){let r=this.options.loose?q_[U_.COMPARATORLOOSE]:q_[U_.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 V_(n[2],this.options.loose):this.semver=ko}toString(){return this.value}test(t){if(Ud("Comparator.test",t,this.options.loose),this.semver===ko||t===ko)return!0;if(typeof t=="string")try{t=new V_(t,this.options)}catch{return!1}return qd(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 G_(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new G_(this.value,r).test(t.semver):(r=F_(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("=")||qd(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||qd(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};$_.exports=Vd;var F_=Fa(),{safeRe:q_,t:U_}=hi(),qd=kd(),Ud=Po(),V_=Je(),G_=kt()});var jo=y((U9,B_)=>{"use strict";d();var Hk=kt(),Qk=(e,t,r)=>{try{t=new Hk(t,r)}catch{return!1}return t.test(e)};B_.exports=Qk});var H_=y((G9,K_)=>{"use strict";d();var Wk=kt(),zk=(e,t)=>new Wk(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));K_.exports=zk});var W_=y((B9,Q_)=>{"use strict";d();var Yk=Je(),Jk=kt(),Xk=(e,t,r)=>{let n=null,i=null,o=null;try{o=new Jk(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new Yk(n,r))}),n};Q_.exports=Xk});var Y_=y((H9,z_)=>{"use strict";d();var Zk=Je(),ej=kt(),tj=(e,t,r)=>{let n=null,i=null,o=null;try{o=new ej(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new Zk(n,r))}),n};z_.exports=tj});var Z_=y((W9,X_)=>{"use strict";d();var Gd=Je(),rj=kt(),J_=Do(),nj=(e,t)=>{e=new rj(e,t);let r=new Gd("0.0.0");if(e.test(r)||(r=new Gd("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 Gd(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||J_(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||J_(r,o))&&(r=o)}return r&&e.test(r)?r:null};X_.exports=nj});var tS=y((Y9,eS)=>{"use strict";d();var ij=kt(),oj=(e,t)=>{try{return new ij(e,t).range||"*"}catch{return null}};eS.exports=oj});var za=y((X9,oS)=>{"use strict";d();var sj=Je(),iS=Lo(),{ANY:aj}=iS,uj=kt(),cj=jo(),rS=Do(),nS=Ba(),lj=Ha(),dj=Ka(),pj=(e,t,r,n)=>{e=new sj(e,n),t=new uj(t,n);let i,o,s,a,u;switch(r){case">":i=rS,o=lj,s=nS,a=">",u=">=";break;case"<":i=nS,o=dj,s=rS,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(cj(e,t,n))return!1;for(let c=0;c<t.set.length;++c){let l=t.set[c],p=null,f=null;if(l.forEach(h=>{h.semver===aj&&(h=new iS(">=0.0.0")),p=p||h,f=f||h,i(h.semver,p.semver,n)?p=h:s(h.semver,f.semver,n)&&(f=h)}),p.operator===a||p.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};oS.exports=pj});var aS=y((e7,sS)=>{"use strict";d();var fj=za(),hj=(e,t,r)=>fj(e,t,">",r);sS.exports=hj});var cS=y((r7,uS)=>{"use strict";d();var mj=za(),gj=(e,t,r)=>mj(e,t,"<",r);uS.exports=gj});var pS=y((i7,dS)=>{"use strict";d();var lS=kt(),yj=(e,t,r)=>(e=new lS(e,r),t=new lS(t,r),e.intersects(t,r));dS.exports=yj});var hS=y((s7,fS)=>{"use strict";d();var vj=jo(),Ej=Lt();fS.exports=(e,t,r)=>{let n=[],i=null,o=null,s=e.sort((l,p)=>Ej(l,p,r));for(let l of s)vj(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,p]of n)l===p?a.push(l):!p&&l===s[0]?a.push("*"):p?l===s[0]?a.push(`<=${p}`):a.push(`${l} - ${p}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof t.raw=="string"?t.raw:String(t);return u.length<c.length?u:t}});var _S=y((u7,ES)=>{"use strict";d();var mS=kt(),Kd=Lo(),{ANY:$d}=Kd,Bd=jo(),Hd=Lt(),_j=(e,t,r={})=>{if(e===t)return!0;e=new mS(e,r),t=new mS(t,r);let n=!1;e:for(let i of e.set){for(let o of t.set){let s=bj(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},Sj=[new Kd(">=0.0.0-0")],gS=[new Kd(">=0.0.0")],bj=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===$d){if(t.length===1&&t[0].semver===$d)return!0;r.includePrerelease?e=Sj:e=gS}if(t.length===1&&t[0].semver===$d){if(r.includePrerelease)return!0;t=gS}let n=new Set,i,o;for(let h of e)h.operator===">"||h.operator===">="?i=yS(i,h,r):h.operator==="<"||h.operator==="<="?o=vS(o,h,r):n.add(h.semver);if(n.size>1)return null;let s;if(i&&o){if(s=Hd(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&&!Bd(h,String(i),r)||o&&!Bd(h,String(o),r))return null;for(let g of t)if(!Bd(h,String(g),r))return!1;return!0}let a,u,c,l,p=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,f=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;p&&p.prerelease.length===1&&o.operator==="<"&&p.prerelease[0]===0&&(p=!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=yS(i,h,r),a===h&&a!==i)return!1}else if(i.operator===">="&&!h.test(i.semver))return!1}if(o){if(p&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===p.major&&h.semver.minor===p.minor&&h.semver.patch===p.patch&&(p=!1),h.operator==="<"||h.operator==="<="){if(u=vS(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||p)},yS=(e,t,r)=>{if(!e)return t;let n=Hd(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},vS=(e,t,r)=>{if(!e)return t;let n=Hd(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};ES.exports=_j});var Ya=y((l7,TS)=>{"use strict";d();var Qd=hi(),SS=fi(),Tj=Je(),bS=Nd(),Ij=Vr(),Oj=HE(),wj=WE(),Aj=JE(),xj=e_(),Rj=r_(),Nj=i_(),Cj=s_(),Pj=u_(),Dj=Lt(),Lj=p_(),kj=h_(),jj=$a(),Mj=v_(),Fj=__(),qj=Do(),Uj=Ba(),Vj=Dd(),Gj=Ld(),$j=Ka(),Bj=Ha(),Kj=kd(),Hj=R_(),Qj=C_(),Wj=Lo(),zj=kt(),Yj=jo(),Jj=H_(),Xj=W_(),Zj=Y_(),eM=Z_(),tM=tS(),rM=za(),nM=aS(),iM=cS(),oM=pS(),sM=hS(),aM=_S();TS.exports={parse:Ij,valid:Oj,clean:wj,inc:Aj,diff:xj,major:Rj,minor:Nj,patch:Cj,prerelease:Pj,compare:Dj,rcompare:Lj,compareLoose:kj,compareBuild:jj,sort:Mj,rsort:Fj,gt:qj,lt:Uj,eq:Vj,neq:Gj,gte:$j,lte:Bj,cmp:Kj,coerce:Hj,truncate:Qj,Comparator:Wj,Range:zj,satisfies:Yj,toComparators:Jj,maxSatisfying:Xj,minSatisfying:Zj,minVersion:eM,validRange:tM,outside:rM,gtr:nM,ltr:iM,intersects:oM,simplifyRange:sM,subset:aM,SemVer:Tj,re:Qd.re,src:Qd.src,tokens:Qd.t,SEMVER_SPEC_VERSION:SS.SEMVER_SPEC_VERSION,RELEASE_TYPES:SS.RELEASE_TYPES,compareIdentifiers:bS.compareIdentifiers,rcompareIdentifiers:bS.rcompareIdentifiers}});var OS=y((p7,IS)=>{d();var uM=Ya();IS.exports=uM.satisfies(process.version,">=15.7.0")});var AS=y((h7,wS)=>{d();var cM=Ya();wS.exports=cM.satisfies(process.version,">=16.9.0")});var Wd=y((g7,xS)=>{d();var lM=OS(),dM=AS(),pM={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},fM={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};xS.exports=function(e,t){if(!e||!t)return;let r=t.asymmetricKeyType;if(!r)return;let n=pM[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(lM)switch(r){case"ec":let i=t.asymmetricKeyDetails.namedCurve,o=fM[e];if(i!==o)throw new Error(`"alg" parameter "${e}" requires curve "${o}".`);break;case"rsa-pss":if(dM){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 zd=y((v7,RS)=>{d();var hM=Ya();RS.exports=hM.satisfies(process.version,"^6.12.0 || >=8.0.0")});var PS=y((_7,CS)=>{d();var be=Co(),mM=Od(),NS=wd(),gM=Id(),yM=Ad(),vM=Wd(),EM=zd(),_M=Da(),{KeyObject:SM,createSecretKey:bM,createPublicKey:TM}=M("crypto"),Yd=["RS256","RS384","RS512"],IM=["ES256","ES384","ES512"],Jd=["RS256","RS384","RS512"],OM=["HS256","HS384","HS512"];EM&&(Yd.splice(Yd.length,0,"PS256","PS384","PS512"),Jd.splice(Jd.length,0,"PS256","PS384","PS512"));CS.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,p){if(l)throw l;return p},r.clockTimestamp&&typeof r.clockTimestamp!="number")return i(new be("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return i(new be("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return i(new be("allowInvalidAsymmetricKeyTypes must be a boolean"));let o=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return i(new be("jwt must be provided"));if(typeof e!="string")return i(new be("jwt must be a string"));let s=e.split(".");if(s.length!==3)return i(new be("jwt malformed"));let a;try{a=gM(e,{complete:!0})}catch(l){return i(l)}if(!a)return i(new be("invalid token"));let u=a.header,c;if(typeof t=="function"){if(!n)return i(new be("verify must be called asynchronous if secret or public key is provided as a callback"));c=t}else c=function(l,p){return p(null,t)};return c(u,function(l,p){if(l)return i(new be("error in secret or public key callback: "+l.message));let f=s[2].trim()!=="";if(!f&&p)return i(new be("jwt signature is required"));if(f&&!p)return i(new be("secret or public key must be provided"));if(!f&&!r.algorithms)return i(new be('please specify "none" in "algorithms" to verify unsigned tokens'));if(p!=null&&!(p instanceof SM))try{p=TM(p)}catch{try{p=bM(typeof p=="string"?Buffer.from(p):p)}catch{return i(new be("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(p.type==="secret"?r.algorithms=OM:["rsa","rsa-pss"].includes(p.asymmetricKeyType)?r.algorithms=Jd:p.asymmetricKeyType==="ec"?r.algorithms=IM:r.algorithms=Yd),r.algorithms.indexOf(a.header.alg)===-1)return i(new be("invalid algorithm"));if(u.alg.startsWith("HS")&&p.type!=="secret")return i(new be(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)&&p.type!=="public")return i(new be(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{vM(u.alg,p)}catch(v){return i(v)}let h;try{h=_M.verify(e,a.header.alg,p)}catch(v){return i(v)}if(!h)return i(new be("invalid signature"));let g=a.payload;if(typeof g.nbf<"u"&&!r.ignoreNotBefore){if(typeof g.nbf!="number")return i(new be("invalid nbf value"));if(g.nbf>o+(r.clockTolerance||0))return i(new mM("jwt not active",new Date(g.nbf*1e3)))}if(typeof g.exp<"u"&&!r.ignoreExpiration){if(typeof g.exp!="number")return i(new be("invalid exp value"));if(o>=g.exp+(r.clockTolerance||0))return i(new NS("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 be("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 be("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&g.sub!==r.subject)return i(new be("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&g.jti!==r.jwtid)return i(new be("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&g.nonce!==r.nonce)return i(new be("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof g.iat!="number")return i(new be("iat required when maxAge is specified"));let v=yM(r.maxAge,g.iat);if(typeof v>"u")return i(new be('"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 NS("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 FS=y((b7,MS)=>{d();var DS=1/0,kS=9007199254740991,wM=17976931348623157e292,LS=NaN,AM="[object Arguments]",xM="[object Function]",RM="[object GeneratorFunction]",NM="[object String]",CM="[object Symbol]",PM=/^\s+|\s+$/g,DM=/^[-+]0x[0-9a-f]+$/i,LM=/^0b[01]+$/i,kM=/^0o[0-7]+$/i,jM=/^(?:0|[1-9]\d*)$/,MM=parseInt;function FM(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 qM(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 UM(e,t,r){if(t!==t)return qM(e,VM,r);for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}function VM(e){return e!==e}function GM(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function $M(e,t){return FM(t,function(r){return e[r]})}function BM(e,t){return function(r){return e(t(r))}}var Ja=Object.prototype,Zd=Ja.hasOwnProperty,Xa=Ja.toString,KM=Ja.propertyIsEnumerable,HM=BM(Object.keys,Object),QM=Math.max;function WM(e,t){var r=jS(e)||ZM(e)?GM(e.length,String):[],n=r.length,i=!!n;for(var o in e)(t||Zd.call(e,o))&&!(i&&(o=="length"||YM(o,n)))&&r.push(o);return r}function zM(e){if(!JM(e))return HM(e);var t=[];for(var r in Object(e))Zd.call(e,r)&&r!="constructor"&&t.push(r);return t}function YM(e,t){return t=t??kS,!!t&&(typeof e=="number"||jM.test(e))&&e>-1&&e%1==0&&e<t}function JM(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Ja;return e===r}function XM(e,t,r,n){e=ep(e)?e:cF(e),r=r&&!n?sF(r):0;var i=e.length;return r<0&&(r=QM(i+r,0)),nF(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&UM(e,t,r)>-1}function ZM(e){return eF(e)&&Zd.call(e,"callee")&&(!KM.call(e,"callee")||Xa.call(e)==AM)}var jS=Array.isArray;function ep(e){return e!=null&&rF(e.length)&&!tF(e)}function eF(e){return tp(e)&&ep(e)}function tF(e){var t=Xd(e)?Xa.call(e):"";return t==xM||t==RM}function rF(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=kS}function Xd(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function tp(e){return!!e&&typeof e=="object"}function nF(e){return typeof e=="string"||!jS(e)&&tp(e)&&Xa.call(e)==NM}function iF(e){return typeof e=="symbol"||tp(e)&&Xa.call(e)==CM}function oF(e){if(!e)return e===0?e:0;if(e=aF(e),e===DS||e===-DS){var t=e<0?-1:1;return t*wM}return e===e?e:0}function sF(e){var t=oF(e),r=t%1;return t===t?r?t-r:t:0}function aF(e){if(typeof e=="number")return e;if(iF(e))return LS;if(Xd(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Xd(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(PM,"");var r=LM.test(e);return r||kM.test(e)?MM(e.slice(2),r?2:8):DM.test(e)?LS:+e}function uF(e){return ep(e)?WM(e):zM(e)}function cF(e){return e?$M(e,uF(e)):[]}MS.exports=XM});var US=y((I7,qS)=>{d();var lF="[object Boolean]",dF=Object.prototype,pF=dF.toString;function fF(e){return e===!0||e===!1||hF(e)&&pF.call(e)==lF}function hF(e){return!!e&&typeof e=="object"}qS.exports=fF});var KS=y((w7,BS)=>{d();var VS=1/0,mF=17976931348623157e292,GS=NaN,gF="[object Symbol]",yF=/^\s+|\s+$/g,vF=/^[-+]0x[0-9a-f]+$/i,EF=/^0b[01]+$/i,_F=/^0o[0-7]+$/i,SF=parseInt,bF=Object.prototype,TF=bF.toString;function IF(e){return typeof e=="number"&&e==xF(e)}function $S(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function OF(e){return!!e&&typeof e=="object"}function wF(e){return typeof e=="symbol"||OF(e)&&TF.call(e)==gF}function AF(e){if(!e)return e===0?e:0;if(e=RF(e),e===VS||e===-VS){var t=e<0?-1:1;return t*mF}return e===e?e:0}function xF(e){var t=AF(e),r=t%1;return t===t?r?t-r:t:0}function RF(e){if(typeof e=="number")return e;if(wF(e))return GS;if($S(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=$S(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(yF,"");var r=EF.test(e);return r||_F.test(e)?SF(e.slice(2),r?2:8):vF.test(e)?GS:+e}BS.exports=IF});var QS=y((x7,HS)=>{d();var NF="[object Number]",CF=Object.prototype,PF=CF.toString;function DF(e){return!!e&&typeof e=="object"}function LF(e){return typeof e=="number"||DF(e)&&PF.call(e)==NF}HS.exports=LF});var JS=y((N7,YS)=>{d();var kF="[object Object]";function jF(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}function MF(e,t){return function(r){return e(t(r))}}var FF=Function.prototype,WS=Object.prototype,zS=FF.toString,qF=WS.hasOwnProperty,UF=zS.call(Object),VF=WS.toString,GF=MF(Object.getPrototypeOf,Object);function $F(e){return!!e&&typeof e=="object"}function BF(e){if(!$F(e)||VF.call(e)!=kF||jF(e))return!1;var t=GF(e);if(t===null)return!0;var r=qF.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&zS.call(r)==UF}YS.exports=BF});var ZS=y((P7,XS)=>{d();var KF="[object String]",HF=Object.prototype,QF=HF.toString,WF=Array.isArray;function zF(e){return!!e&&typeof e=="object"}function YF(e){return typeof e=="string"||!WF(e)&&zF(e)&&QF.call(e)==KF}XS.exports=YF});var ib=y((L7,nb)=>{d();var JF="Expected a function",eb=1/0,XF=17976931348623157e292,tb=NaN,ZF="[object Symbol]",eq=/^\s+|\s+$/g,tq=/^[-+]0x[0-9a-f]+$/i,rq=/^0b[01]+$/i,nq=/^0o[0-7]+$/i,iq=parseInt,oq=Object.prototype,sq=oq.toString;function aq(e,t){var r;if(typeof t!="function")throw new TypeError(JF);return e=pq(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}function uq(e){return aq(2,e)}function rb(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function cq(e){return!!e&&typeof e=="object"}function lq(e){return typeof e=="symbol"||cq(e)&&sq.call(e)==ZF}function dq(e){if(!e)return e===0?e:0;if(e=fq(e),e===eb||e===-eb){var t=e<0?-1:1;return t*XF}return e===e?e:0}function pq(e){var t=dq(e),r=t%1;return t===t?r?t-r:t:0}function fq(e){if(typeof e=="number")return e;if(lq(e))return tb;if(rb(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=rb(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(eq,"");var r=rq.test(e);return r||nq.test(e)?iq(e.slice(2),r?2:8):tq.test(e)?tb:+e}nb.exports=uq});var fb=y((j7,pb)=>{d();var ob=Ad(),hq=zd(),mq=Wd(),sb=Da(),gq=FS(),Za=US(),ab=KS(),rp=QS(),cb=JS(),Gr=ZS(),yq=ib(),{KeyObject:vq,createSecretKey:Eq,createPrivateKey:_q}=M("crypto"),lb=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];hq&&lb.splice(3,0,"PS256","PS384","PS512");var Sq={expiresIn:{isValid:function(e){return ab(e)||Gr(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return ab(e)||Gr(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return Gr(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:gq.bind(null,lb),message:'"algorithm" must be a valid string enum value'},header:{isValid:cb,message:'"header" must be an object'},encoding:{isValid:Gr,message:'"encoding" must be a string'},issuer:{isValid:Gr,message:'"issuer" must be a string'},subject:{isValid:Gr,message:'"subject" must be a string'},jwtid:{isValid:Gr,message:'"jwtid" must be a string'},noTimestamp:{isValid:Za,message:'"noTimestamp" must be a boolean'},keyid:{isValid:Gr,message:'"keyid" must be a string'},mutatePayload:{isValid:Za,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:Za,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:Za,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},bq={iat:{isValid:rp,message:'"iat" should be a number of seconds'},exp:{isValid:rp,message:'"exp" should be a number of seconds'},nbf:{isValid:rp,message:'"nbf" should be a number of seconds'}};function db(e,t,r,n){if(!cb(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 Tq(e){return db(Sq,!1,e,"options")}function Iq(e){return db(bq,!0,e,"payload")}var ub={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},Oq=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];pb.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 vq))try{t=_q(t)}catch{try{t=Eq(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{Iq(e)}catch(c){return s(c)}r.mutatePayload||(e=Object.assign({},e))}else{let c=Oq.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{Tq(r)}catch(c){return s(c)}if(!r.allowInvalidAsymmetricKeyTypes)try{mq(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=ob(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=ob(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(ub).forEach(function(c){let l=ub[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&&yq(n),sb.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=sb.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 Mo=y((F7,hb)=>{d();hb.exports={decode:Id(),verify:PS(),sign:fb(),JsonWebTokenError:Co(),NotBeforeError:Od(),TokenExpiredError:wd()}});var _b=y(mi=>{"use strict";d();Object.defineProperty(mi,"__esModule",{value:!0});mi.versionInfo=mi.version=void 0;var Nq="15.10.2";mi.version=Nq;var Cq=Object.freeze({major:15,minor:10,patch:2,preReleaseTag:null});mi.versionInfo=Cq});var ru=y(op=>{"use strict";d();Object.defineProperty(op,"__esModule",{value:!0});op.default=Pq;function Pq(e){return typeof e?.then=="function"}});var jt=y(sp=>{"use strict";d();Object.defineProperty(sp,"__esModule",{value:!0});sp.default=Dq;function Dq(e,t){var r=!!e;if(!r)throw new Error(t)}});var ar=y(ap=>{"use strict";d();Object.defineProperty(ap,"__esModule",{value:!0});ap.default=Lq;function nu(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?nu=function(r){return typeof r}:nu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},nu(e)}function Lq(e){return nu(e)=="object"&&e!==null}});var ur=y(Br=>{"use strict";d();Object.defineProperty(Br,"__esModule",{value:!0});Br.SYMBOL_TO_STRING_TAG=Br.SYMBOL_ASYNC_ITERATOR=Br.SYMBOL_ITERATOR=void 0;var kq=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator";Br.SYMBOL_ITERATOR=kq;var jq=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator";Br.SYMBOL_ASYNC_ITERATOR=jq;var Mq=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";Br.SYMBOL_TO_STRING_TAG=Mq});var iu=y(up=>{"use strict";d();Object.defineProperty(up,"__esModule",{value:!0});up.getLocation=Fq;function Fq(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 cp=y(su=>{"use strict";d();Object.defineProperty(su,"__esModule",{value:!0});su.printLocation=Uq;su.printSourceLocation=bb;var qq=iu();function Uq(e){return bb(e.source,(0,qq.getLocation)(e.source,e.start))}function bb(e,t){var r=e.locationOffset.column-1,n=ou(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),p=l[i];if(p.length>120){for(var f=Math.floor(u/80),h=u%80,g=[],v=0;v<p.length;v+=80)g.push(p.slice(v,v+80));return c+Sb([["".concat(s),g[0]]].concat(g.slice(1,f+1).map(function(_){return["",_]}),[[" ",ou(h-1)+"^"],["",g[f+1]]]))}return c+Sb([["".concat(s-1),l[i-1]],["".concat(s),p],["",ou(u-1)+"^"],["".concat(s+1),l[i+1]]])}function Sb(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 Vq(r,i)+(o?" | "+o:" |")}).join(`
|
|
32
|
-
`)}function ou(e){return Array(e+1).join(" ")}function Vq(e,t){return ou(e-t.length)+t}});var K=y(gi=>{"use strict";d();function au(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?au=function(r){return typeof r}:au=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},au(e)}Object.defineProperty(gi,"__esModule",{value:!0});gi.printError=Cb;gi.formatError=Pb;gi.GraphQLError=void 0;var Gq=xb(jt()),$q=xb(ar()),Bq=ur(),Tb=iu(),Ib=cp();function xb(e){return e&&e.__esModule?e:{default:e}}function Ob(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 Kq(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ob(Object(r),!0).forEach(function(n){Hq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ob(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Hq(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wb(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 Wq(e,t,r){return t&&wb(e.prototype,t),r&&wb(e,r),e}function zq(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&&Uo(e,t)}function Yq(e){var t=Nb();return function(){var n=Vo(e),i;if(t){var o=Vo(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Rb(this,i)}}function Rb(e,t){return t&&(au(t)==="object"||typeof t=="function")?t:qo(e)}function qo(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lp(e){var t=typeof Map=="function"?new Map:void 0;return lp=function(n){if(n===null||!Jq(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 uu(n,arguments,Vo(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Uo(i,n)},lp(e)}function uu(e,t,r){return Nb()?uu=Reflect.construct:uu=function(i,o,s){var a=[null];a.push.apply(a,o);var u=Function.bind.apply(i,a),c=new u;return s&&Uo(c,s.prototype),c},uu.apply(null,arguments)}function Nb(){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 Jq(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Uo(e,t){return Uo=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Uo(e,t)}function Vo(e){return Vo=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Vo(e)}var Xq=(function(e){zq(r,e);var t=Yq(r);function r(n,i,o,s,a,u,c){var l,p,f,h;Qq(this,r),h=t.call(this,n),h.name="GraphQLError",h.originalError=u??void 0,h.nodes=Ab(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=Ab(g),h.source=o??((l=g)===null||l===void 0?void 0:l[0].source),h.positions=s??((p=g)===null||p===void 0?void 0:p.map(function(T){return T.start})),h.locations=s&&o?s.map(function(T){return(0,Tb.getLocation)(o,T)}):(f=g)===null||f===void 0?void 0:f.map(function(T){return(0,Tb.getLocation)(T.source,T.start)}),h.path=a??void 0;var A=u?.extensions;return c==null&&(0,$q.default)(A)?h.extensions=Kq({},A):h.extensions=c??{},Object.defineProperties(qo(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(qo(h),"stack",{value:u.stack,writable:!0,configurable:!0}),Rb(h)):(Error.captureStackTrace?Error.captureStackTrace(qo(h),r):Object.defineProperty(qo(h),"stack",{value:Error().stack,writable:!0,configurable:!0}),h)}return Wq(r,[{key:"toString",value:function(){return Cb(this)}},{key:"toJSON",value:function(){return Pb(this)}},{key:Bq.SYMBOL_TO_STRING_TAG,get:function(){return"Object"}}]),r})(lp(Error));gi.GraphQLError=Xq;function Ab(e){return e===void 0||e.length===0?void 0:e}function Cb(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
|
-
|
|
34
|
-
`+(0,Ib.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
|
-
|
|
36
|
-
`+(0,Ib.printSourceLocation)(e.source,a)}return t}function Pb(e){var t;e||(0,Gq.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 cu=y(dp=>{"use strict";d();Object.defineProperty(dp,"__esModule",{value:!0});dp.syntaxError=eU;var Zq=K();function eU(e,t,r){return new Zq.GraphQLError("Syntax Error: ".concat(r),void 0,e,[t])}});var Ee=y(lu=>{"use strict";d();Object.defineProperty(lu,"__esModule",{value:!0});lu.Kind=void 0;var tU=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"});lu.Kind=tU});var et=y(pp=>{"use strict";d();Object.defineProperty(pp,"__esModule",{value:!0});pp.default=rU;function rU(e,t){var r=!!e;if(!r)throw new Error(t??"Unexpected invariant triggered.")}});var fp=y(du=>{"use strict";d();Object.defineProperty(du,"__esModule",{value:!0});du.default=void 0;var nU=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,iU=nU;du.default=iU});var pu=y(hp=>{"use strict";d();Object.defineProperty(hp,"__esModule",{value:!0});hp.default=sU;var oU=Lb(et()),Db=Lb(fp());function Lb(e){return e&&e.__esModule?e:{default:e}}function sU(e){var t=e.prototype.toJSON;typeof t=="function"||(0,oU.default)(0),e.prototype.inspect=t,Db.default&&(e.prototype[Db.default]=t)}});var yi=y(On=>{"use strict";d();Object.defineProperty(On,"__esModule",{value:!0});On.isNode=uU;On.Token=On.Location=void 0;var kb=aU(pu());function aU(e){return e&&e.__esModule?e:{default:e}}var jb=(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})();On.Location=jb;(0,kb.default)(jb);var Mb=(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})();On.Token=Mb;(0,kb.default)(Mb);function uU(e){return e!=null&&typeof e.kind=="string"}});var vi=y(fu=>{"use strict";d();Object.defineProperty(fu,"__esModule",{value:!0});fu.TokenKind=void 0;var cU=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"});fu.TokenKind=cU});var ae=y(mp=>{"use strict";d();Object.defineProperty(mp,"__esModule",{value:!0});mp.default=fU;var lU=dU(fp());function dU(e){return e&&e.__esModule?e:{default:e}}function hu(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?hu=function(r){return typeof r}:hu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},hu(e)}var pU=10,Fb=2;function fU(e){return mu(e,[])}function mu(e,t){switch(hu(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return e===null?"null":hU(e,t);default:return String(e)}}function hU(e,t){if(t.indexOf(e)!==-1)return"[Circular]";var r=[].concat(t,[e]),n=yU(e);if(n!==void 0){var i=n.call(e);if(i!==e)return typeof i=="string"?i:mu(i,r)}else if(Array.isArray(e))return gU(e,r);return mU(e,r)}function mU(e,t){var r=Object.keys(e);if(r.length===0)return"{}";if(t.length>Fb)return"["+vU(e)+"]";var n=r.map(function(i){var o=mu(e[i],t);return i+": "+o});return"{ "+n.join(", ")+" }"}function gU(e,t){if(e.length===0)return"[]";if(t.length>Fb)return"[Array]";for(var r=Math.min(pU,e.length),n=e.length-r,i=[],o=0;o<r;++o)i.push(mu(e[o],t));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function yU(e){var t=e[String(lU.default)];if(typeof t=="function")return t;if(typeof e.inspect=="function")return e.inspect}function vU(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 Go=y(yu=>{"use strict";d();Object.defineProperty(yu,"__esModule",{value:!0});yu.default=void 0;var EU=_U(ae());function _U(e){return e&&e.__esModule?e:{default:e}}function gu(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?gu=function(r){return typeof r}:gu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},gu(e)}var SU=process.env.NODE_ENV==="production"?function(t,r){return t instanceof r}:function(t,r){if(t instanceof r)return!0;if(gu(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,EU.default)(t);throw new Error("Cannot use ".concat(i,' "').concat(s,`" from another module or realm.
|
|
37
|
-
|
|
38
|
-
Ensure that there is only one instance of "graphql" in the node_modules
|
|
39
|
-
directory. If different versions of "graphql" are the dependencies of other
|
|
40
|
-
relied on modules, use "resolutions" to ensure only one version is installed.
|
|
41
|
-
|
|
42
|
-
https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
43
|
-
|
|
44
|
-
Duplicate "graphql" modules cannot be used at the same time since different
|
|
45
|
-
versions may have different capabilities and behavior. The data from one
|
|
46
|
-
version used in the function from another could produce confusing and
|
|
47
|
-
spurious results.`))}}return!1};yu.default=SU});var vu=y($o=>{"use strict";d();Object.defineProperty($o,"__esModule",{value:!0});$o.isSource=wU;$o.Source=void 0;var bU=ur(),TU=yp(ae()),gp=yp(jt()),IU=yp(Go());function yp(e){return e&&e.__esModule?e:{default:e}}function qb(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 OU(e,t,r){return t&&qb(e.prototype,t),r&&qb(e,r),e}var Ub=(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,gp.default)(0,"Body must be a string. Received: ".concat((0,TU.default)(t),".")),this.body=t,this.name=r,this.locationOffset=n,this.locationOffset.line>0||(0,gp.default)(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,gp.default)(0,"column in locationOffset is 1-indexed and must be positive.")}return OU(e,[{key:bU.SYMBOL_TO_STRING_TAG,get:function(){return"Source"}}]),e})();$o.Source=Ub;function wU(e){return(0,IU.default)(e,Ub)}});var Ei=y(Eu=>{"use strict";d();Object.defineProperty(Eu,"__esModule",{value:!0});Eu.DirectiveLocation=void 0;var AU=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"});Eu.DirectiveLocation=AU});var _i=y(Bo=>{"use strict";d();Object.defineProperty(Bo,"__esModule",{value:!0});Bo.dedentBlockStringValue=xU;Bo.getBlockStringIndentation=Gb;Bo.printBlockString=RU;function xU(e){var t=e.split(/\r\n|[\n\r]/g),r=Gb(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&&Vb(t[i]);)++i;for(var o=t.length;o>i&&Vb(t[o-1]);)--o;return t.slice(i,o).join(`
|
|
48
|
-
`)}function Vb(e){for(var t=0;t<e.length;++t)if(e[t]!==" "&&e[t]!==" ")return!1;return!0}function Gb(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 RU(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
|
-
`)===-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
|
-
`+t),u+=t?e.replace(/\n/g,`
|
|
51
|
-
`+t):e,a&&(u+=`
|
|
52
|
-
`),'"""'+u.replace(/"""/g,'\\"""')+'"""'}});var Su=y(Ko=>{"use strict";d();Object.defineProperty(Ko,"__esModule",{value:!0});Ko.isPunctuatorTokenKind=PU;Ko.Lexer=void 0;var cr=cu(),je=yi(),Z=vi(),NU=_i(),CU=(function(){function e(r){var n=new je.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=DU(this,n)}while(n.kind===Z.TokenKind.COMMENT);return n},e})();Ko.Lexer=CU;function PU(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 wn(e){return isNaN(e)?Z.TokenKind.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function DU(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 je.Token(Z.TokenKind.BANG,o,o+1,a,u,t);case 35:return kU(r,o,a,u,t);case 36:return new je.Token(Z.TokenKind.DOLLAR,o,o+1,a,u,t);case 38:return new je.Token(Z.TokenKind.AMP,o,o+1,a,u,t);case 40:return new je.Token(Z.TokenKind.PAREN_L,o,o+1,a,u,t);case 41:return new je.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 je.Token(Z.TokenKind.SPREAD,o,o+3,a,u,t);break;case 58:return new je.Token(Z.TokenKind.COLON,o,o+1,a,u,t);case 61:return new je.Token(Z.TokenKind.EQUALS,o,o+1,a,u,t);case 64:return new je.Token(Z.TokenKind.AT,o,o+1,a,u,t);case 91:return new je.Token(Z.TokenKind.BRACKET_L,o,o+1,a,u,t);case 93:return new je.Token(Z.TokenKind.BRACKET_R,o,o+1,a,u,t);case 123:return new je.Token(Z.TokenKind.BRACE_L,o,o+1,a,u,t);case 124:return new je.Token(Z.TokenKind.PIPE,o,o+1,a,u,t);case 125:return new je.Token(Z.TokenKind.BRACE_R,o,o+1,a,u,t);case 34:return n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34?FU(r,o,a,u,t,e):MU(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 jU(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 UU(r,o,a,u,t)}throw(0,cr.syntaxError)(r,o,LU(s))}var c=e.line,l=1+o-e.lineStart;return new je.Token(Z.TokenKind.EOF,i,i,c,l,t)}function LU(e){return e<32&&e!==9&&e!==10&&e!==13?"Cannot contain the invalid character ".concat(wn(e),"."):e===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(wn(e),".")}function kU(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 je.Token(Z.TokenKind.COMMENT,t,a,r,n,i,o.slice(t+1,a))}function jU(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(wn(a),"."))}else u=vp(e,u,a),a=s.charCodeAt(u);if(a===46&&(c=!0,a=s.charCodeAt(++u),u=vp(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=vp(e,u,a),a=s.charCodeAt(u)),a===46||VU(a))throw(0,cr.syntaxError)(e,u,"Invalid number, expected digit but got: ".concat(wn(a),"."));return new je.Token(c?Z.TokenKind.FLOAT:Z.TokenKind.INT,t,u,n,i,o,s.slice(t,u))}function vp(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(wn(o),"."))}function MU(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 je.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(wn(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=qU(o.charCodeAt(s+1),o.charCodeAt(s+2),o.charCodeAt(s+3),o.charCodeAt(s+4));if(l<0){var p=o.slice(s+1,s+5);throw(0,cr.syntaxError)(e,s,"Invalid character escape sequence: \\u".concat(p,"."))}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 FU(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 je.Token(Z.TokenKind.BLOCK_STRING,t,a+3,r,n,i,(0,NU.dedentBlockStringValue)(l));if(c<32&&c!==9&&c!==10&&c!==13)throw(0,cr.syntaxError)(e,a,"Invalid character within String: ".concat(wn(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 qU(e,t,r,n){return _u(e)<<12|_u(t)<<8|_u(r)<<4|_u(n)}function _u(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function UU(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 je.Token(Z.TokenKind.NAME,t,a,r,n,i,o.slice(t,a))}function VU(e){return e===95||e>=65&&e<=90||e>=97&&e<=122}});var Si=y(An=>{"use strict";d();Object.defineProperty(An,"__esModule",{value:!0});An.parse=BU;An.parseValue=KU;An.parseType=HU;An.Parser=void 0;var Ep=cu(),H=Ee(),GU=yi(),P=vi(),$b=vu(),$U=Ei(),Bb=Su();function BU(e,t){var r=new bu(e,t);return r.parseDocument()}function KU(e,t){var r=new bu(e,t);r.expectToken(P.TokenKind.SOF);var n=r.parseValueLiteral(!1);return r.expectToken(P.TokenKind.EOF),n}function HU(e,t){var r=new bu(e,t);r.expectToken(P.TokenKind.SOF);var n=r.parseTypeReference();return r.expectToken(P.TokenKind.EOF),n}var bu=(function(){function e(r,n){var i=(0,$b.isSource)(r)?r:new $b.Source(r);this._lexer=new Bb.Lexer(i),this._options=n}var t=e.prototype;return t.parseName=function(){var n=this.expectToken(P.TokenKind.NAME);return{kind:H.Kind.NAME,value:n.value,loc:this.loc(n)}},t.parseDocument=function(){var n=this._lexer.token;return{kind:H.Kind.DOCUMENT,definitions:this.many(P.TokenKind.SOF,this.parseDefinition,P.TokenKind.EOF),loc:this.loc(n)}},t.parseDefinition=function(){if(this.peek(P.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(P.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(P.TokenKind.BRACE_L))return{kind:H.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(P.TokenKind.NAME)&&(o=this.parseName()),{kind:H.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(P.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(P.TokenKind.PAREN_L,this.parseVariableDefinition,P.TokenKind.PAREN_R)},t.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:H.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(P.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(P.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(P.TokenKind.DOLLAR),{kind:H.Kind.VARIABLE,name:this.parseName(),loc:this.loc(n)}},t.parseSelectionSet=function(){var n=this._lexer.token;return{kind:H.Kind.SELECTION_SET,selections:this.many(P.TokenKind.BRACE_L,this.parseSelection,P.TokenKind.BRACE_R),loc:this.loc(n)}},t.parseSelection=function(){return this.peek(P.TokenKind.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var n=this._lexer.token,i=this.parseName(),o,s;return this.expectOptionalToken(P.TokenKind.COLON)?(o=i,s=this.parseName()):s=i,{kind:H.Kind.FIELD,alias:o,name:s,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(P.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(P.TokenKind.PAREN_L,i,P.TokenKind.PAREN_R)},t.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(P.TokenKind.COLON),{kind:H.Kind.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},t.parseConstArgument=function(){var n=this._lexer.token;return{kind:H.Kind.ARGUMENT,name:this.parseName(),value:(this.expectToken(P.TokenKind.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},t.parseFragment=function(){var n=this._lexer.token;this.expectToken(P.TokenKind.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(P.TokenKind.NAME)?{kind:H.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:H.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:H.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:H.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 P.TokenKind.BRACKET_L:return this.parseList(n);case P.TokenKind.BRACE_L:return this.parseObject(n);case P.TokenKind.INT:return this._lexer.advance(),{kind:H.Kind.INT,value:i.value,loc:this.loc(i)};case P.TokenKind.FLOAT:return this._lexer.advance(),{kind:H.Kind.FLOAT,value:i.value,loc:this.loc(i)};case P.TokenKind.STRING:case P.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case P.TokenKind.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:H.Kind.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:H.Kind.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:H.Kind.NULL,loc:this.loc(i)};default:return{kind:H.Kind.ENUM,value:i.value,loc:this.loc(i)}}case P.TokenKind.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},t.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:H.Kind.STRING,value:n.value,block:n.kind===P.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:H.Kind.LIST,values:this.any(P.TokenKind.BRACKET_L,s,P.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:H.Kind.OBJECT,fields:this.any(P.TokenKind.BRACE_L,s,P.TokenKind.BRACE_R),loc:this.loc(o)}},t.parseObjectField=function(n){var i=this._lexer.token,o=this.parseName();return this.expectToken(P.TokenKind.COLON),{kind:H.Kind.OBJECT_FIELD,name:o,value:this.parseValueLiteral(n),loc:this.loc(i)}},t.parseDirectives=function(n){for(var i=[];this.peek(P.TokenKind.AT);)i.push(this.parseDirective(n));return i},t.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(P.TokenKind.AT),{kind:H.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(P.TokenKind.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(P.TokenKind.BRACKET_R),i={kind:H.Kind.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(P.TokenKind.BANG)?{kind:H.Kind.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},t.parseNamedType=function(){var n=this._lexer.token;return{kind:H.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===P.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(P.TokenKind.STRING)||this.peek(P.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(P.TokenKind.BRACE_L,this.parseOperationTypeDefinition,P.TokenKind.BRACE_R);return{kind:H.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(P.TokenKind.COLON);var o=this.parseNamedType();return{kind:H.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:H.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:H.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(P.TokenKind.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(P.TokenKind.AMP)||this.peek(P.TokenKind.NAME));return i}return this.delimitedMany(P.TokenKind.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(P.TokenKind.BRACE_L)&&this._lexer.lookahead().kind===P.TokenKind.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(P.TokenKind.BRACE_L,this.parseFieldDefinition,P.TokenKind.BRACE_R)},t.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),o=this.parseName(),s=this.parseArgumentDefs();this.expectToken(P.TokenKind.COLON);var a=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:H.Kind.FIELD_DEFINITION,description:i,name:o,arguments:s,type:a,directives:u,loc:this.loc(n)}},t.parseArgumentDefs=function(){return this.optionalMany(P.TokenKind.PAREN_L,this.parseInputValueDef,P.TokenKind.PAREN_R)},t.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),o=this.parseName();this.expectToken(P.TokenKind.COLON);var s=this.parseTypeReference(),a;this.expectOptionalToken(P.TokenKind.EQUALS)&&(a=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:H.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:H.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:H.Kind.UNION_TYPE_DEFINITION,description:i,name:o,directives:s,types:a,loc:this.loc(n)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(P.TokenKind.EQUALS)?this.delimitedMany(P.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:H.Kind.ENUM_TYPE_DEFINITION,description:i,name:o,directives:s,values:a,loc:this.loc(n)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(P.TokenKind.BRACE_L,this.parseEnumValueDefinition,P.TokenKind.BRACE_R)},t.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),o=this.parseName(),s=this.parseDirectives(!0);return{kind:H.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:H.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:o,directives:s,fields:a,loc:this.loc(n)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(P.TokenKind.BRACE_L,this.parseInputValueDef,P.TokenKind.BRACE_R)},t.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===P.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(P.TokenKind.BRACE_L,this.parseOperationTypeDefinition,P.TokenKind.BRACE_R);if(i.length===0&&o.length===0)throw this.unexpected();return{kind:H.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:H.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:H.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:H.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:H.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:H.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:H.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(P.TokenKind.AT);var o=this.parseName(),s=this.parseArgumentDefs(),a=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:H.Kind.DIRECTIVE_DEFINITION,description:i,name:o,arguments:s,repeatable:a,locations:u,loc:this.loc(n)}},t.parseDirectiveLocations=function(){return this.delimitedMany(P.TokenKind.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if($U.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 GU.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,Ep.syntaxError)(this._lexer.source,i.start,"Expected ".concat(Kb(n),", found ").concat(_p(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===P.TokenKind.NAME&&i.value===n)this._lexer.advance();else throw(0,Ep.syntaxError)(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(_p(i),"."))},t.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===P.TokenKind.NAME&&i.value===n?(this._lexer.advance(),!0):!1},t.unexpected=function(n){var i=n??this._lexer.token;return(0,Ep.syntaxError)(this._lexer.source,i.start,"Unexpected ".concat(_p(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})();An.Parser=bu;function _p(e){var t=e.value;return Kb(e.kind)+(t!=null?' "'.concat(t,'"'):"")}function Kb(e){return(0,Bb.isPunctuatorTokenKind)(e)?'"'.concat(e,'"'):e}});var Kr=y(br=>{"use strict";d();Object.defineProperty(br,"__esModule",{value:!0});br.visit=zU;br.visitInParallel=YU;br.getVisitFn=Tu;br.BREAK=br.QueryDocumentKeys=void 0;var QU=WU(ae()),Hb=yi();function WU(e){return e&&e.__esModule?e:{default:e}}var Qb={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"]};br.QueryDocumentKeys=Qb;var bi=Object.freeze({});br.BREAK=bi;function zU(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Qb,n=void 0,i=Array.isArray(e),o=[e],s=-1,a=[],u=void 0,c=void 0,l=void 0,p=[],f=[],h=e;do{s++;var g=s===o.length,v=g&&a.length!==0;if(g){if(c=f.length===0?void 0:p[p.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 D=a[T][0],V=a[T][1];i&&(D-=A),i&&V===null?(u.splice(D,1),A++):u[D]=V}}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&&p.push(c)}var x=void 0;if(!Array.isArray(u)){if(!(0,Hb.isNode)(u))throw new Error("Invalid AST Node: ".concat((0,QU.default)(u),"."));var te=Tu(t,u.kind,g);if(te){if(x=te.call(t,u,c,l,p,f),x===bi)break;if(x===!1){if(!g){p.pop();continue}}else if(x!==void 0&&(a.push([c,x]),!g))if((0,Hb.isNode)(x))u=x;else{p.pop();continue}}}if(x===void 0&&v&&a.push([c,u]),g)p.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 YU(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=Tu(e[i],n.kind,!1);if(o){var s=o.apply(e[i],arguments);if(s===!1)t[i]=n;else if(s===bi)t[i]=bi;else if(s!==void 0)return s}}},leave:function(n){for(var i=0;i<e.length;i++)if(t[i]==null){var o=Tu(e[i],n.kind,!0);if(o){var s=o.apply(e[i],arguments);if(s===bi)t[i]=bi;else if(s!==void 0&&s!==!1)return s}}else t[i]===n&&(t[i]=null)}}}function Tu(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 Ti=y(Iu=>{"use strict";d();Object.defineProperty(Iu,"__esModule",{value:!0});Iu.default=void 0;var JU=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}},XU=JU;Iu.default=XU});var St=y(Ou=>{"use strict";d();Object.defineProperty(Ou,"__esModule",{value:!0});Ou.default=void 0;var ZU=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},eV=ZU;Ou.default=eV});var Ho=y(Sp=>{"use strict";d();Object.defineProperty(Sp,"__esModule",{value:!0});Sp.locatedError=iV;var tV=nV(ae()),rV=K();function nV(e){return e&&e.__esModule?e:{default:e}}function iV(e,t,r){var n,i=e instanceof Error?e:new Error("Unexpected error value: "+(0,tV.default)(e));return Array.isArray(i.path)?i:new rV.GraphQLError(i.message,(n=i.nodes)!==null&&n!==void 0?n:t,i.source,i.positions,r,i)}});var bp=y(wu=>{"use strict";d();Object.defineProperty(wu,"__esModule",{value:!0});wu.assertValidName=uV;wu.isValidNameError=zb;var oV=sV(jt()),Wb=K();function sV(e){return e&&e.__esModule?e:{default:e}}var aV=/^[_a-zA-Z][_a-zA-Z0-9]*$/;function uV(e){var t=zb(e);if(t)throw t;return e}function zb(e){if(typeof e=="string"||(0,oV.default)(0,"Expected name to be a string."),e.length>1&&e[0]==="_"&&e[1]==="_")return new Wb.GraphQLError('Name "'.concat(e,'" must not begin with "__", which is reserved by GraphQL introspection.'));if(!aV.test(e))return new Wb.GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'.concat(e,'" does not.'))}});var Ii=y(Au=>{"use strict";d();Object.defineProperty(Au,"__esModule",{value:!0});Au.default=void 0;var cV=Object.entries||function(e){return Object.keys(e).map(function(t){return[t,e[t]]})},lV=cV;Au.default=lV});var Hr=y(Tp=>{"use strict";d();Object.defineProperty(Tp,"__esModule",{value:!0});Tp.default=dV;function dV(e,t){return e.reduce(function(r,n){return r[t(n)]=n,r},Object.create(null))}});var Op=y(Ip=>{"use strict";d();Object.defineProperty(Ip,"__esModule",{value:!0});Ip.default=hV;var pV=fV(Ii());function fV(e){return e&&e.__esModule?e:{default:e}}function hV(e,t){for(var r=Object.create(null),n=0,i=(0,pV.default)(e);n<i.length;n++){var o=i[n],s=o[0],a=o[1];r[s]=t(a,s)}return r}});var xu=y(wp=>{"use strict";d();Object.defineProperty(wp,"__esModule",{value:!0});wp.default=yV;var mV=gV(Ii());function gV(e){return e&&e.__esModule?e:{default:e}}function yV(e){if(Object.getPrototypeOf(e)===null)return e;for(var t=Object.create(null),r=0,n=(0,mV.default)(e);r<n.length;r++){var i=n[r],o=i[0],s=i[1];t[o]=s}return t}});var Qo=y(Ap=>{"use strict";d();Object.defineProperty(Ap,"__esModule",{value:!0});Ap.default=vV;function vV(e,t,r){return e.reduce(function(n,i){return n[t(i)]=r(i),n},Object.create(null))}});var Qr=y(xp=>{"use strict";d();Object.defineProperty(xp,"__esModule",{value:!0});xp.default=_V;var EV=5;function _V(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,EV),u=a.pop();return o+a.join(", ")+", or "+u+"?"}});var Yb=y(Rp=>{"use strict";d();Object.defineProperty(Rp,"__esModule",{value:!0});Rp.default=SV;function SV(e){return e}});var Wo=y(Cp=>{"use strict";d();Object.defineProperty(Cp,"__esModule",{value:!0});Cp.default=bV;function bV(e,t){for(var r=0,n=0;r<e.length&&n<t.length;){var i=e.charCodeAt(r),o=t.charCodeAt(n);if(Ru(i)&&Ru(o)){var s=0;do++r,s=s*10+i-Np,i=e.charCodeAt(r);while(Ru(i)&&s>0);var a=0;do++n,a=a*10+o-Np,o=t.charCodeAt(n);while(Ru(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 Np=48,TV=57;function Ru(e){return!isNaN(e)&&Np<=e&&e<=TV}});var Wr=y(Pp=>{"use strict";d();Object.defineProperty(Pp,"__esModule",{value:!0});Pp.default=wV;var IV=OV(Wo());function OV(e){return e&&e.__esModule?e:{default:e}}function wV(e,t){for(var r=Object.create(null),n=new AV(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,IV.default)(u,c)})}var AV=(function(){function e(r){this._input=r,this._inputLowerCase=r.toLowerCase(),this._inputArray=Jb(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=Jb(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 p=this._rows,f=0;f<=l;f++)p[0][f]=f;for(var h=1;h<=c;h++){for(var g=p[(h-1)%3],v=p[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=p[(h-2)%3][b-2];I=Math.min(I,A+1)}I<_&&(_=I),v[b]=I}if(_>i)return}var T=p[c%3][l];return T<=i?T:void 0}},e})();function Jb(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(Dp=>{"use strict";d();Object.defineProperty(Dp,"__esModule",{value:!0});Dp.print=NV;var xV=Kr(),RV=_i();function NV(e){return(0,xV.visit)(e,{leave:PV})}var CV=80,PV={Name:function(t){return t.value},Variable:function(t){return"$"+t.name},Document:function(t){return F(t.definitions,`
|
|
54
|
-
|
|
55
|
-
`)+`
|
|
56
|
-
`},OperationDefinition:function(t){var r=t.operation,n=t.name,i=Ce("(",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+Ce(" = ",i)+Ce(" ",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=Ce("",r,": ")+n,u=a+Ce("(",F(i,", "),")");return u.length>CV&&(u=a+Ce(`(
|
|
57
|
-
`,Nu(F(i,`
|
|
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+Ce(" ",F(n," "))},InlineFragment:function(t){var r=t.typeCondition,n=t.directives,i=t.selectionSet;return F(["...",Ce("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(Ce("(",F(i,", "),")")," ")+"on ".concat(n," ").concat(Ce("",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,RV.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+Ce("(",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,Ce("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+(Xb(r)?Ce(`(
|
|
60
|
-
`,Nu(F(r,`
|
|
61
|
-
`)),`
|
|
62
|
-
)`):Ce("(",F(r,", "),")"))+": "+n+Ce(" ",F(i," "))}),InputValueDefinition:Wt(function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return F([t+": "+r,Ce("= ",n),F(i," ")]," ")}),InterfaceTypeDefinition:Wt(function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return F(["interface",t,Ce("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+(Xb(r)?Ce(`(
|
|
63
|
-
`,Nu(F(r,`
|
|
64
|
-
`)),`
|
|
65
|
-
)`):Ce("(",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,Ce("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,Ce("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)],`
|
|
66
|
-
`)}}function F(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(t=e?.filter(function(n){return n}).join(r))!==null&&t!==void 0?t:""}function zt(e){return Ce(`{
|
|
67
|
-
`,Nu(F(e,`
|
|
68
|
-
`)),`
|
|
69
|
-
}`)}function Ce(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return t!=null&&t!==""?e+t+r:""}function Nu(e){return Ce(" ",e.replace(/\n/g,`
|
|
70
|
-
`))}function DV(e){return e.indexOf(`
|
|
71
|
-
`)!==-1}function Xb(e){return e!=null&&e.some(DV)}});var Mp=y(jp=>{"use strict";d();Object.defineProperty(jp,"__esModule",{value:!0});jp.valueFromASTUntyped=Lp;var LV=kp(ae()),kV=kp(et()),jV=kp(Qo()),Tr=Ee();function kp(e){return e&&e.__esModule?e:{default:e}}function Lp(e,t){switch(e.kind){case Tr.Kind.NULL:return null;case Tr.Kind.INT:return parseInt(e.value,10);case Tr.Kind.FLOAT:return parseFloat(e.value);case Tr.Kind.STRING:case Tr.Kind.ENUM:case Tr.Kind.BOOLEAN:return e.value;case Tr.Kind.LIST:return e.values.map(function(r){return Lp(r,t)});case Tr.Kind.OBJECT:return(0,jV.default)(e.fields,function(r){return r.name.value},function(r){return Lp(r.value,t)});case Tr.Kind.VARIABLE:return t?.[e.name.value]}(0,kV.default)(0,"Unexpected value node: "+(0,LV.default)(e))}});var ie=y($=>{"use strict";d();Object.defineProperty($,"__esModule",{value:!0});$.isType=Fp;$.assertType=iT;$.isScalarType=xn;$.assertScalarType=$V;$.isObjectType=Ai;$.assertObjectType=BV;$.isInterfaceType=Rn;$.assertInterfaceType=KV;$.isUnionType=Nn;$.assertUnionType=HV;$.isEnumType=Cn;$.assertEnumType=QV;$.isInputObjectType=Yo;$.assertInputObjectType=WV;$.isListType=Du;$.assertListType=zV;$.isNonNullType=en;$.assertNonNullType=YV;$.isInputType=qp;$.assertInputType=JV;$.isOutputType=Up;$.assertOutputType=XV;$.isLeafType=oT;$.assertLeafType=ZV;$.isCompositeType=sT;$.assertCompositeType=eG;$.isAbstractType=aT;$.assertAbstractType=tG;$.GraphQLList=zr;$.GraphQLNonNull=Yr;$.isWrappingType=Jo;$.assertWrappingType=rG;$.isNullableType=uT;$.assertNullableType=cT;$.getNullableType=nG;$.isNamedType=lT;$.assertNamedType=iG;$.getNamedType=oG;$.argsToArgsConfig=hT;$.isRequiredArgument=sG;$.isRequiredInputField=lG;$.GraphQLInputObjectType=$.GraphQLEnumType=$.GraphQLUnionType=$.GraphQLInterfaceType=$.GraphQLObjectType=$.GraphQLScalarType=void 0;var rT=bt(Ii()),Jr=ur(),Ie=bt(ae()),MV=bt(Hr()),Pu=bt(Op()),lr=bt(xu()),we=bt(jt()),nT=bt(Qo()),Xr=bt(Go()),FV=bt(Qr()),qV=bt(ar()),Zb=bt(Yb()),Zr=bt(pu()),UV=bt(Wr()),zo=K(),VV=Ee(),eT=mt(),GV=Mp();function bt(e){return e&&e.__esModule?e:{default:e}}function tT(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 wi(e,t,r){return t&&tT(e.prototype,t),r&&tT(e,r),e}function Fp(e){return xn(e)||Ai(e)||Rn(e)||Nn(e)||Cn(e)||Yo(e)||Du(e)||en(e)}function iT(e){if(!Fp(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL type."));return e}function xn(e){return(0,Xr.default)(e,Vp)}function $V(e){if(!xn(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Scalar type."));return e}function Ai(e){return(0,Xr.default)(e,Gp)}function BV(e){if(!Ai(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Object type."));return e}function Rn(e){return(0,Xr.default)(e,$p)}function KV(e){if(!Rn(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Interface type."));return e}function Nn(e){return(0,Xr.default)(e,Bp)}function HV(e){if(!Nn(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Union type."));return e}function Cn(e){return(0,Xr.default)(e,Kp)}function QV(e){if(!Cn(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Enum type."));return e}function Yo(e){return(0,Xr.default)(e,Hp)}function WV(e){if(!Yo(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Input Object type."));return e}function Du(e){return(0,Xr.default)(e,zr)}function zV(e){if(!Du(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL List type."));return e}function en(e){return(0,Xr.default)(e,Yr)}function YV(e){if(!en(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Non-Null type."));return e}function qp(e){return xn(e)||Cn(e)||Yo(e)||Jo(e)&&qp(e.ofType)}function JV(e){if(!qp(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL input type."));return e}function Up(e){return xn(e)||Ai(e)||Rn(e)||Nn(e)||Cn(e)||Jo(e)&&Up(e.ofType)}function XV(e){if(!Up(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL output type."));return e}function oT(e){return xn(e)||Cn(e)}function ZV(e){if(!oT(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL leaf type."));return e}function sT(e){return Ai(e)||Rn(e)||Nn(e)}function eG(e){if(!sT(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL composite type."));return e}function aT(e){return Rn(e)||Nn(e)}function tG(e){if(!aT(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL abstract type."));return e}function zr(e){if(this instanceof zr)this.ofType=iT(e);else return new zr(e)}zr.prototype.toString=function(){return"["+String(this.ofType)+"]"};zr.prototype.toJSON=function(){return this.toString()};Object.defineProperty(zr.prototype,Jr.SYMBOL_TO_STRING_TAG,{get:function(){return"GraphQLList"}});(0,Zr.default)(zr);function Yr(e){if(this instanceof Yr)this.ofType=cT(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,Jr.SYMBOL_TO_STRING_TAG,{get:function(){return"GraphQLNonNull"}});(0,Zr.default)(Yr);function Jo(e){return Du(e)||en(e)}function rG(e){if(!Jo(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL wrapping type."));return e}function uT(e){return Fp(e)&&!en(e)}function cT(e){if(!uT(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL nullable type."));return e}function nG(e){if(e)return en(e)?e.ofType:e}function lT(e){return xn(e)||Ai(e)||Rn(e)||Nn(e)||Cn(e)||Yo(e)}function iG(e){if(!lT(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL named type."));return e}function oG(e){if(e){for(var t=e;Jo(t);)t=t.ofType;return t}}function Lu(e){return typeof e=="function"?e():e}function xi(e){return e&&e.length>0?e:void 0}var Vp=(function(){function e(r){var n,i,o,s=(n=r.parseValue)!==null&&n!==void 0?n:Zb.default;this.name=r.name,this.description=r.description,this.specifiedByUrl=r.specifiedByUrl,this.serialize=(i=r.serialize)!==null&&i!==void 0?i:Zb.default,this.parseValue=s,this.parseLiteral=(o=r.parseLiteral)!==null&&o!==void 0?o:function(a,u){return s((0,GV.valueFromASTUntyped)(a,u))},this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=xi(r.extensionASTNodes),typeof r.name=="string"||(0,we.default)(0,"Must provide name."),r.specifiedByUrl==null||typeof r.specifiedByUrl=="string"||(0,we.default)(0,"".concat(this.name,' must provide "specifiedByUrl" as a string, ')+"but got: ".concat((0,Ie.default)(r.specifiedByUrl),".")),r.serialize==null||typeof r.serialize=="function"||(0,we.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,we.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()},wi(e,[{key:Jr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLScalarType"}}]),e})();$.GraphQLScalarType=Vp;(0,Zr.default)(Vp);var Gp=(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=xi(r.extensionASTNodes),this._fields=pT.bind(void 0,r),this._interfaces=dT.bind(void 0,r),typeof r.name=="string"||(0,we.default)(0,"Must provide name."),r.isTypeOf==null||typeof r.isTypeOf=="function"||(0,we.default)(0,"".concat(this.name,' must provide "isTypeOf" as a function, ')+"but got: ".concat((0,Ie.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:fT(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()},wi(e,[{key:Jr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLObjectType"}}]),e})();$.GraphQLObjectType=Gp;(0,Zr.default)(Gp);function dT(e){var t,r=(t=Lu(e.interfaces))!==null&&t!==void 0?t:[];return Array.isArray(r)||(0,we.default)(0,"".concat(e.name," interfaces must be an Array or a function which returns an Array.")),r}function pT(e){var t=Lu(e.fields);return Oi(t)||(0,we.default)(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),(0,Pu.default)(t,function(r,n){var i;Oi(r)||(0,we.default)(0,"".concat(e.name,".").concat(n," field config must be an object.")),!("isDeprecated"in r)||(0,we.default)(0,"".concat(e.name,".").concat(n,' should provide "deprecationReason" instead of "isDeprecated".')),r.resolve==null||typeof r.resolve=="function"||(0,we.default)(0,"".concat(e.name,".").concat(n," field resolver must be a function if ")+"provided, but got: ".concat((0,Ie.default)(r.resolve),"."));var o=(i=r.args)!==null&&i!==void 0?i:{};Oi(o)||(0,we.default)(0,"".concat(e.name,".").concat(n," args must be an object with argument names as keys."));var s=(0,rT.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 Oi(e){return(0,qV.default)(e)&&!Array.isArray(e)}function fT(e){return(0,Pu.default)(e,function(t){return{description:t.description,type:t.type,args:hT(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}})}function hT(e){return(0,nT.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 sG(e){return en(e.type)&&e.defaultValue===void 0}var $p=(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=xi(r.extensionASTNodes),this._fields=pT.bind(void 0,r),this._interfaces=dT.bind(void 0,r),typeof r.name=="string"||(0,we.default)(0,"Must provide name."),r.resolveType==null||typeof r.resolveType=="function"||(0,we.default)(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat((0,Ie.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:fT(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()},wi(e,[{key:Jr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLInterfaceType"}}]),e})();$.GraphQLInterfaceType=$p;(0,Zr.default)($p);var Bp=(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=xi(r.extensionASTNodes),this._types=aG.bind(void 0,r),typeof r.name=="string"||(0,we.default)(0,"Must provide name."),r.resolveType==null||typeof r.resolveType=="function"||(0,we.default)(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat((0,Ie.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()},wi(e,[{key:Jr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLUnionType"}}]),e})();$.GraphQLUnionType=Bp;(0,Zr.default)(Bp);function aG(e){var t=Lu(e.types);return Array.isArray(t)||(0,we.default)(0,"Must provide Array of types or a function which returns such an array for Union ".concat(e.name,".")),t}var Kp=(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=xi(r.extensionASTNodes),this._values=uG(this.name,r.values),this._valueLookup=new Map(this._values.map(function(n){return[n.value,n]})),this._nameLookup=(0,MV.default)(this._values,function(n){return n.name}),typeof r.name=="string"||(0,we.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,Ie.default)(n)));return i.name},t.parseValue=function(n){if(typeof n!="string"){var i=(0,Ie.default)(n);throw new zo.GraphQLError('Enum "'.concat(this.name,'" cannot represent non-string value: ').concat(i,".")+Cu(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.')+Cu(this,n));return o.value},t.parseLiteral=function(n,i){if(n.kind!==VV.Kind.ENUM){var o=(0,eT.print)(n);throw new zo.GraphQLError('Enum "'.concat(this.name,'" cannot represent non-enum value: ').concat(o,".")+Cu(this,o),n)}var s=this.getValue(n.value);if(s==null){var a=(0,eT.print)(n);throw new zo.GraphQLError('Value "'.concat(a,'" does not exist in "').concat(this.name,'" enum.')+Cu(this,a),n)}return s.value},t.toConfig=function(){var n,i=(0,nT.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()},wi(e,[{key:Jr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLEnumType"}}]),e})();$.GraphQLEnumType=Kp;(0,Zr.default)(Kp);function Cu(e,t){var r=e.getValues().map(function(i){return i.name}),n=(0,UV.default)(t,r);return(0,FV.default)("the enum value",n)}function uG(e,t){return Oi(t)||(0,we.default)(0,"".concat(e," values must be an object with value names as keys.")),(0,rT.default)(t).map(function(r){var n=r[0],i=r[1];return Oi(i)||(0,we.default)(0,"".concat(e,".").concat(n,' must refer to an object with a "value" key ')+"representing an internal value but got: ".concat((0,Ie.default)(i),".")),!("isDeprecated"in i)||(0,we.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 Hp=(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=xi(r.extensionASTNodes),this._fields=cG.bind(void 0,r),typeof r.name=="string"||(0,we.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,Pu.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()},wi(e,[{key:Jr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLInputObjectType"}}]),e})();$.GraphQLInputObjectType=Hp;(0,Zr.default)(Hp);function cG(e){var t=Lu(e.fields);return Oi(t)||(0,we.default)(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),(0,Pu.default)(t,function(r,n){return!("resolve"in r)||(0,we.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 lG(e){return en(e.type)&&e.defaultValue===void 0}});var Zo=y(Xo=>{"use strict";d();Object.defineProperty(Xo,"__esModule",{value:!0});Xo.isEqualType=Qp;Xo.isTypeSubTypeOf=ku;Xo.doTypesOverlap=dG;var nt=ie();function Qp(e,t){return e===t?!0:(0,nt.isNonNullType)(e)&&(0,nt.isNonNullType)(t)||(0,nt.isListType)(e)&&(0,nt.isListType)(t)?Qp(e.ofType,t.ofType):!1}function ku(e,t,r){return t===r?!0:(0,nt.isNonNullType)(r)?(0,nt.isNonNullType)(t)?ku(e,t.ofType,r.ofType):!1:(0,nt.isNonNullType)(t)?ku(e,t.ofType,r):(0,nt.isListType)(r)?(0,nt.isListType)(t)?ku(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 dG(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 Wp=y(ju=>{"use strict";d();Object.defineProperty(ju,"__esModule",{value:!0});ju.default=void 0;var pG=ur(),fG=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[pG.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[]},hG=fG;ju.default=hG});var zp=y(Mu=>{"use strict";d();Object.defineProperty(Mu,"__esModule",{value:!0});Mu.default=void 0;var mG=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},gG=mG;Mu.default=gG});var qu=y(Yp=>{"use strict";d();Object.defineProperty(Yp,"__esModule",{value:!0});Yp.default=vG;var yG=ur();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)}function vG(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(l){return l};if(e==null||Fu(e)!=="object")return null;if(Array.isArray(e))return e.map(t);var r=e[yG.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 mT=y(Uu=>{"use strict";d();Object.defineProperty(Uu,"__esModule",{value:!0});Uu.default=void 0;var EG=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},_G=EG;Uu.default=_G});var dr=y(lt=>{"use strict";d();Object.defineProperty(lt,"__esModule",{value:!0});lt.isSpecifiedScalarType=CG;lt.specifiedScalarTypes=lt.GraphQLID=lt.GraphQLBoolean=lt.GraphQLString=lt.GraphQLFloat=lt.GraphQLInt=void 0;var Vu=$u(zp()),Gu=$u(mT()),Yt=$u(ae()),gT=$u(ar()),Pn=Ee(),es=mt(),We=K(),ts=ie();function $u(e){return e&&e.__esModule?e:{default:e}}var Jp=2147483647,Xp=-2147483648;function SG(e){var t=rs(e);if(typeof t=="boolean")return t?1:0;var r=t;if(typeof t=="string"&&t!==""&&(r=Number(t)),!(0,Gu.default)(r))throw new We.GraphQLError("Int cannot represent non-integer value: ".concat((0,Yt.default)(t)));if(r>Jp||r<Xp)throw new We.GraphQLError("Int cannot represent non 32-bit signed integer value: "+(0,Yt.default)(t));return r}function bG(e){if(!(0,Gu.default)(e))throw new We.GraphQLError("Int cannot represent non-integer value: ".concat((0,Yt.default)(e)));if(e>Jp||e<Xp)throw new We.GraphQLError("Int cannot represent non 32-bit signed integer value: ".concat(e));return e}var yT=new ts.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:SG,parseValue:bG,parseLiteral:function(t){if(t.kind!==Pn.Kind.INT)throw new We.GraphQLError("Int cannot represent non-integer value: ".concat((0,es.print)(t)),t);var r=parseInt(t.value,10);if(r>Jp||r<Xp)throw new We.GraphQLError("Int cannot represent non 32-bit signed integer value: ".concat(t.value),t);return r}});lt.GraphQLInt=yT;function TG(e){var t=rs(e);if(typeof t=="boolean")return t?1:0;var r=t;if(typeof t=="string"&&t!==""&&(r=Number(t)),!(0,Vu.default)(r))throw new We.GraphQLError("Float cannot represent non numeric value: ".concat((0,Yt.default)(t)));return r}function IG(e){if(!(0,Vu.default)(e))throw new We.GraphQLError("Float cannot represent non numeric value: ".concat((0,Yt.default)(e)));return e}var vT=new ts.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:TG,parseValue:IG,parseLiteral:function(t){if(t.kind!==Pn.Kind.FLOAT&&t.kind!==Pn.Kind.INT)throw new We.GraphQLError("Float cannot represent non numeric value: ".concat((0,es.print)(t)),t);return parseFloat(t.value)}});lt.GraphQLFloat=vT;function rs(e){if((0,gT.default)(e)){if(typeof e.valueOf=="function"){var t=e.valueOf();if(!(0,gT.default)(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}function OG(e){var t=rs(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if((0,Vu.default)(t))return t.toString();throw new We.GraphQLError("String cannot represent value: ".concat((0,Yt.default)(e)))}function wG(e){if(typeof e!="string")throw new We.GraphQLError("String cannot represent a non string value: ".concat((0,Yt.default)(e)));return e}var ET=new ts.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:OG,parseValue:wG,parseLiteral:function(t){if(t.kind!==Pn.Kind.STRING)throw new We.GraphQLError("String cannot represent a non string value: ".concat((0,es.print)(t)),t);return t.value}});lt.GraphQLString=ET;function AG(e){var t=rs(e);if(typeof t=="boolean")return t;if((0,Vu.default)(t))return t!==0;throw new We.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0,Yt.default)(t)))}function xG(e){if(typeof e!="boolean")throw new We.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0,Yt.default)(e)));return e}var _T=new ts.GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:AG,parseValue:xG,parseLiteral:function(t){if(t.kind!==Pn.Kind.BOOLEAN)throw new We.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0,es.print)(t)),t);return t.value}});lt.GraphQLBoolean=_T;function RG(e){var t=rs(e);if(typeof t=="string")return t;if((0,Gu.default)(t))return String(t);throw new We.GraphQLError("ID cannot represent value: ".concat((0,Yt.default)(e)))}function NG(e){if(typeof e=="string")return e;if((0,Gu.default)(e))return e.toString();throw new We.GraphQLError("ID cannot represent value: ".concat((0,Yt.default)(e)))}var ST=new ts.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:RG,parseValue:NG,parseLiteral:function(t){if(t.kind!==Pn.Kind.STRING&&t.kind!==Pn.Kind.INT)throw new We.GraphQLError("ID cannot represent a non-string and non-integer value: "+(0,es.print)(t),t);return t.value}});lt.GraphQLID=ST;var bT=Object.freeze([ET,yT,vT,_T,ST]);lt.specifiedScalarTypes=bT;function CG(e){return bT.some(function(t){var r=t.name;return e.name===r})}});var os=y(Zp=>{"use strict";d();Object.defineProperty(Zp,"__esModule",{value:!0});Zp.astFromValue=is;var PG=Ri(zp()),DG=Ri(St()),TT=Ri(ae()),LG=Ri(et()),kG=Ri(ar()),jG=Ri(qu()),Mt=Ee(),MG=dr(),ns=ie();function Ri(e){return e&&e.__esModule?e:{default:e}}function is(e,t){if((0,ns.isNonNullType)(t)){var r=is(e,t.ofType);return r?.kind===Mt.Kind.NULL?null:r}if(e===null)return{kind:Mt.Kind.NULL};if(e===void 0)return null;if((0,ns.isListType)(t)){var n=t.ofType,i=(0,jG.default)(e);if(i!=null){for(var o=[],s=0;s<i.length;s++){var a=i[s],u=is(a,n);u!=null&&o.push(u)}return{kind:Mt.Kind.LIST,values:o}}return is(e,n)}if((0,ns.isInputObjectType)(t)){if(!(0,kG.default)(e))return null;for(var c=[],l=0,p=(0,DG.default)(t.getFields());l<p.length;l++){var f=p[l],h=is(e[f.name],f.type);h&&c.push({kind:Mt.Kind.OBJECT_FIELD,name:{kind:Mt.Kind.NAME,value:f.name},value:h})}return{kind:Mt.Kind.OBJECT,fields:c}}if((0,ns.isLeafType)(t)){var g=t.serialize(e);if(g==null)return null;if(typeof g=="boolean")return{kind:Mt.Kind.BOOLEAN,value:g};if(typeof g=="number"&&(0,PG.default)(g)){var v=String(g);return IT.test(v)?{kind:Mt.Kind.INT,value:v}:{kind:Mt.Kind.FLOAT,value:v}}if(typeof g=="string")return(0,ns.isEnumType)(t)?{kind:Mt.Kind.ENUM,value:g}:t===MG.GraphQLID&&IT.test(g)?{kind:Mt.Kind.INT,value:g}:{kind:Mt.Kind.STRING,value:g};throw new TypeError("Cannot convert value to AST: ".concat((0,TT.default)(g),"."))}(0,LG.default)(0,"Unexpected input type: "+(0,TT.default)(t))}var IT=/^-?(?:0|[1-9][0-9]*)$/});var qt=y(ye=>{"use strict";d();Object.defineProperty(ye,"__esModule",{value:!0});ye.isIntrospectionType=KG;ye.introspectionTypes=ye.TypeNameMetaFieldDef=ye.TypeMetaFieldDef=ye.SchemaMetaFieldDef=ye.__TypeKind=ye.TypeKind=ye.__EnumValue=ye.__InputValue=ye.__Field=ye.__Type=ye.__DirectiveLocation=ye.__Directive=ye.__Schema=void 0;var ef=tf(St()),FG=tf(ae()),qG=tf(et()),UG=mt(),Ge=Ei(),VG=os(),_e=dr(),q=ie();function tf(e){return e&&e.__esModule?e:{default:e}}var rf=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:_e.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(Ft))),resolve:function(r){return(0,ef.default)(r.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new q.GraphQLNonNull(Ft),resolve:function(r){return r.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Ft,resolve:function(r){return r.getMutationType()}},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Ft,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(nf))),resolve:function(r){return r.getDirectives()}}}}});ye.__Schema=rf;var nf=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
|
-
|
|
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(_e.GraphQLString),resolve:function(r){return r.name}},description:{type:_e.GraphQLString,resolve:function(r){return r.description}},isRepeatable:{type:new q.GraphQLNonNull(_e.GraphQLBoolean),resolve:function(r){return r.isRepeatable}},locations:{type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(of))),resolve:function(r){return r.locations}},args:{type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(ss))),args:{includeDeprecated:{type:_e.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;return i?r.args:r.args.filter(function(o){return o.deprecationReason==null})}}}}});ye.__Directive=nf;var of=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:Ge.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:Ge.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:Ge.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:Ge.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:Ge.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:Ge.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:Ge.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:Ge.DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:Ge.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:Ge.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:Ge.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:Ge.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:Ge.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:Ge.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:Ge.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:Ge.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:Ge.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:Ge.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:Ge.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}});ye.__DirectiveLocation=of;var Ft=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(uf),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,qG.default)(0,'Unexpected type: "'.concat((0,FG.default)(r),'".'))}},name:{type:_e.GraphQLString,resolve:function(r){return r.name!==void 0?r.name:void 0}},description:{type:_e.GraphQLString,resolve:function(r){return r.description!==void 0?r.description:void 0}},specifiedByUrl:{type:_e.GraphQLString,resolve:function(r){return r.specifiedByUrl!==void 0?r.specifiedByUrl:void 0}},fields:{type:new q.GraphQLList(new q.GraphQLNonNull(sf)),args:{includeDeprecated:{type:_e.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;if((0,q.isObjectType)(r)||(0,q.isInterfaceType)(r)){var o=(0,ef.default)(r.getFields());return i?o:o.filter(function(s){return s.deprecationReason==null})}}},interfaces:{type:new q.GraphQLList(new q.GraphQLNonNull(Ft)),resolve:function(r){if((0,q.isObjectType)(r)||(0,q.isInterfaceType)(r))return r.getInterfaces()}},possibleTypes:{type:new q.GraphQLList(new q.GraphQLNonNull(Ft)),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(af)),args:{includeDeprecated:{type:_e.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(ss)),args:{includeDeprecated:{type:_e.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;if((0,q.isInputObjectType)(r)){var o=(0,ef.default)(r.getFields());return i?o:o.filter(function(s){return s.deprecationReason==null})}}},ofType:{type:Ft,resolve:function(r){return r.ofType!==void 0?r.ofType:void 0}}}}});ye.__Type=Ft;var sf=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(_e.GraphQLString),resolve:function(r){return r.name}},description:{type:_e.GraphQLString,resolve:function(r){return r.description}},args:{type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(ss))),args:{includeDeprecated:{type:_e.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(Ft),resolve:function(r){return r.type}},isDeprecated:{type:new q.GraphQLNonNull(_e.GraphQLBoolean),resolve:function(r){return r.deprecationReason!=null}},deprecationReason:{type:_e.GraphQLString,resolve:function(r){return r.deprecationReason}}}}});ye.__Field=sf;var ss=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(_e.GraphQLString),resolve:function(r){return r.name}},description:{type:_e.GraphQLString,resolve:function(r){return r.description}},type:{type:new q.GraphQLNonNull(Ft),resolve:function(r){return r.type}},defaultValue:{type:_e.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,VG.astFromValue)(i,n);return o?(0,UG.print)(o):null}},isDeprecated:{type:new q.GraphQLNonNull(_e.GraphQLBoolean),resolve:function(r){return r.deprecationReason!=null}},deprecationReason:{type:_e.GraphQLString,resolve:function(r){return r.deprecationReason}}}}});ye.__InputValue=ss;var af=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(_e.GraphQLString),resolve:function(r){return r.name}},description:{type:_e.GraphQLString,resolve:function(r){return r.description}},isDeprecated:{type:new q.GraphQLNonNull(_e.GraphQLBoolean),resolve:function(r){return r.deprecationReason!=null}},deprecationReason:{type:_e.GraphQLString,resolve:function(r){return r.deprecationReason}}}}});ye.__EnumValue=af;var tt=Object.freeze({SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"});ye.TypeKind=tt;var uf=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."}}});ye.__TypeKind=uf;var GG={name:"__schema",type:new q.GraphQLNonNull(rf),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};ye.SchemaMetaFieldDef=GG;var $G={name:"__type",type:Ft,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new q.GraphQLNonNull(_e.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};ye.TypeMetaFieldDef=$G;var BG={name:"__typename",type:new q.GraphQLNonNull(_e.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};ye.TypeNameMetaFieldDef=BG;var OT=Object.freeze([rf,nf,of,Ft,sf,ss,af,uf]);ye.introspectionTypes=OT;function KG(e){return OT.some(function(t){var r=t.name;return e.name===r})}});var gt=y($e=>{"use strict";d();Object.defineProperty($e,"__esModule",{value:!0});$e.isDirective=xT;$e.assertDirective=ZG;$e.isSpecifiedDirective=e1;$e.specifiedDirectives=$e.GraphQLSpecifiedByDirective=$e.GraphQLDeprecatedDirective=$e.DEFAULT_DEPRECATION_REASON=$e.GraphQLSkipDirective=$e.GraphQLIncludeDirective=$e.GraphQLDirective=void 0;var HG=Dn(Ii()),QG=ur(),WG=Dn(ae()),wT=Dn(xu()),cf=Dn(jt()),zG=Dn(Go()),YG=Dn(ar()),JG=Dn(pu()),Jt=Ei(),Bu=dr(),Ku=ie();function Dn(e){return e&&e.__esModule?e:{default:e}}function AT(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 XG(e,t,r){return t&&AT(e.prototype,t),r&&AT(e,r),e}function xT(e){return(0,zG.default)(e,Ln)}function ZG(e){if(!xT(e))throw new Error("Expected ".concat((0,WG.default)(e)," to be a GraphQL directive."));return e}var Ln=(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,wT.default)(r.extensions),this.astNode=r.astNode,r.name||(0,cf.default)(0,"Directive must be named."),Array.isArray(r.locations)||(0,cf.default)(0,"@".concat(r.name," locations must be an Array."));var o=(i=r.args)!==null&&i!==void 0?i:{};(0,YG.default)(o)&&!Array.isArray(o)||(0,cf.default)(0,"@".concat(r.name," args must be an object with argument names as keys.")),this.args=(0,HG.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,wT.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,Ku.argsToArgsConfig)(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},t.toString=function(){return"@"+this.name},t.toJSON=function(){return this.toString()},XG(e,[{key:QG.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLDirective"}}]),e})();$e.GraphQLDirective=Ln;(0,JG.default)(Ln);var RT=new Ln({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 Ku.GraphQLNonNull(Bu.GraphQLBoolean),description:"Included when true."}}});$e.GraphQLIncludeDirective=RT;var NT=new Ln({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 Ku.GraphQLNonNull(Bu.GraphQLBoolean),description:"Skipped when true."}}});$e.GraphQLSkipDirective=NT;var CT="No longer supported";$e.DEFAULT_DEPRECATION_REASON=CT;var PT=new Ln({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:Bu.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:CT}}});$e.GraphQLDeprecatedDirective=PT;var DT=new Ln({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[Jt.DirectiveLocation.SCALAR],args:{url:{type:new Ku.GraphQLNonNull(Bu.GraphQLString),description:"The URL that specifies the behaviour of this scalar."}}});$e.GraphQLSpecifiedByDirective=DT;var LT=Object.freeze([RT,NT,PT,DT]);$e.specifiedDirectives=LT;function e1(e){return LT.some(function(t){var r=t.name;return r===e.name})}});var kn=y(Ni=>{"use strict";d();Object.defineProperty(Ni,"__esModule",{value:!0});Ni.isSchema=MT;Ni.assertSchema=c1;Ni.GraphQLSchema=void 0;var t1=tn(Ti()),r1=tn(Wp()),lf=tn(St()),n1=ur(),df=tn(ae()),i1=tn(xu()),Hu=tn(jt()),o1=tn(Go()),s1=tn(ar()),a1=qt(),kT=gt(),Xt=ie();function tn(e){return e&&e.__esModule?e:{default:e}}function jT(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 u1(e,t,r){return t&&jT(e.prototype,t),r&&jT(e,r),e}function MT(e){return(0,o1.default)(e,FT)}function c1(e){if(!MT(e))throw new Error("Expected ".concat((0,df.default)(e)," to be a GraphQL schema."));return e}var FT=(function(){function e(r){var n;this.__validationErrors=r.assumeValid===!0?[]:void 0,(0,s1.default)(r)||(0,Hu.default)(0,"Must provide configuration object."),!r.types||Array.isArray(r.types)||(0,Hu.default)(0,'"types" must be Array if provided but got: '.concat((0,df.default)(r.types),".")),!r.directives||Array.isArray(r.directives)||(0,Hu.default)(0,'"directives" must be Array if provided but got: '+"".concat((0,df.default)(r.directives),".")),this.description=r.description,this.extensions=r.extensions&&(0,i1.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:kT.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,kT.isDirective)(l))for(var p=0,f=l.args;p<f.length;p++){var h=f[p];Zt(h.type,i)}}Zt(a1.__Schema,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var g=0,v=(0,r1.default)(i);g<v.length;g++){var _=v[g];if(_!=null){var b=_.name;if(b||(0,Hu.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 D=0,V=_.getInterfaces();D<V.length;D++){var x=V[D];if((0,Xt.isInterfaceType)(x)){var te=this._implementationsMap[x.name];te===void 0&&(te=this._implementationsMap[x.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,p=c.objects;l<p.length;l++){var f=p[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,t1.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,lf.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}},u1(e,[{key:n1.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLSchema"}}]),e})();Ni.GraphQLSchema=FT;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,lf.default)(r.getFields());c<l.length;c++){var p=l[c];Zt(p.type,t);for(var f=0,h=p.args;f<h.length;f++){var g=h[f];Zt(g.type,t)}}}else if((0,Xt.isInputObjectType)(r))for(var v=0,_=(0,lf.default)(r.getFields());v<_.length;v++){var b=_[v];Zt(b.type,t)}}return t}});var cs=y(Qu=>{"use strict";d();Object.defineProperty(Qu,"__esModule",{value:!0});Qu.validateSchema=KT;Qu.assertValidSchema=m1;var qT=ff(Ti()),us=ff(St()),it=ff(ae()),l1=K(),d1=Ho(),p1=bp(),UT=Zo(),f1=kn(),h1=qt(),BT=gt(),Me=ie();function ff(e){return e&&e.__esModule?e:{default:e}}function KT(e){if((0,f1.assertSchema)(e),e.__validationErrors)return e.__validationErrors;var t=new g1(e);y1(t),v1(t),E1(t);var r=t.getErrors();return e.__validationErrors=r,r}function m1(e){var t=KT(e);if(t.length!==0)throw new Error(t.map(function(r){return r.message}).join(`
|
|
74
|
-
|
|
75
|
-
`))}var g1=(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 l1.GraphQLError(n,o))},t.addError=function(n){this._errors.push(n)},t.getErrors=function(){return this._errors},e})();function y1(e){var t=e.schema,r=t.getQueryType();if(!r)e.reportError("Query root type must be provided.",t.astNode);else if(!(0,Me.isObjectType)(r)){var n;e.reportError("Query root type must be Object type, it cannot be ".concat((0,it.default)(r),"."),(n=pf(t,"query"))!==null&&n!==void 0?n:r.astNode)}var i=t.getMutationType();if(i&&!(0,Me.isObjectType)(i)){var o;e.reportError("Mutation root type must be Object type if provided, it cannot be "+"".concat((0,it.default)(i),"."),(o=pf(t,"mutation"))!==null&&o!==void 0?o:i.astNode)}var s=t.getSubscriptionType();if(s&&!(0,Me.isObjectType)(s)){var a;e.reportError("Subscription root type must be Object type if provided, it cannot be "+"".concat((0,it.default)(s),"."),(a=pf(t,"subscription"))!==null&&a!==void 0?a:s.astNode)}}function pf(e,t){for(var r=hf(e,function(o){return o.operationTypes}),n=0;n<r.length;n++){var i=r[n];if(i.operation===t)return i.type}}function v1(e){for(var t=0,r=e.schema.getDirectives();t<r.length;t++){var n=r[t];if(!(0,BT.isDirective)(n)){e.reportError("Expected directive but got: ".concat((0,it.default)(n),"."),n?.astNode);continue}jn(e,n);for(var i=0,o=n.args;i<o.length;i++){var s=o[i];if(jn(e,s),(0,Me.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,Me.isRequiredArgument)(s)&&s.deprecationReason!=null){var a;e.reportError("Required argument @".concat(n.name,"(").concat(s.name,":) cannot be deprecated."),[mf(s.astNode),(a=s.astNode)===null||a===void 0?void 0:a.type])}}}}function jn(e,t){var r=(0,p1.isValidNameError)(t.name);r&&e.addError((0,d1.locatedError)(r,t.astNode))}function E1(e){for(var t=O1(e),r=e.schema.getTypeMap(),n=0,i=(0,us.default)(r);n<i.length;n++){var o=i[n];if(!(0,Me.isNamedType)(o)){e.reportError("Expected GraphQL named type but got: ".concat((0,it.default)(o),"."),o.astNode);continue}(0,h1.isIntrospectionType)(o)||jn(e,o),(0,Me.isObjectType)(o)||(0,Me.isInterfaceType)(o)?(VT(e,o),GT(e,o)):(0,Me.isUnionType)(o)?b1(e,o):(0,Me.isEnumType)(o)?T1(e,o):(0,Me.isInputObjectType)(o)&&(I1(e,o),t(o))}}function VT(e,t){var r=(0,us.default)(t.getFields());r.length===0&&e.reportError("Type ".concat(t.name," must define one or more fields."),Ci(t));for(var n=0;n<r.length;n++){var i=r[n];if(jn(e,i),!(0,Me.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(jn(e,u),!(0,Me.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,Me.isRequiredArgument)(u)&&u.deprecationReason!=null){var p;e.reportError("Required argument ".concat(t.name,".").concat(i.name,"(").concat(c,":) cannot be deprecated."),[mf(u.astNode),(p=u.astNode)===null||p===void 0?void 0:p.type])}}}}function GT(e,t){for(var r=Object.create(null),n=0,i=t.getInterfaces();n<i.length;n++){var o=i[n];if(!(0,Me.isInterfaceType)(o)){e.reportError("Type ".concat((0,it.default)(t)," must only implement Interface types, ")+"it cannot implement ".concat((0,it.default)(o),"."),as(t,o));continue}if(t===o){e.reportError("Type ".concat(t.name," cannot implement itself because it would create a circular reference."),as(t,o));continue}if(r[o.name]){e.reportError("Type ".concat(t.name," can only implement ").concat(o.name," once."),as(t,o));continue}r[o.name]=!0,S1(e,t,o),_1(e,t,o)}}function _1(e,t,r){for(var n=t.getFields(),i=0,o=(0,us.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(Ci(t)));continue}if(!(0,UT.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 p=function(I,A){var T=A[I],D=T.name,V=(0,qT.default)(u.args,function(de){return de.name===D});if(!V)return e.reportError("Interface field argument ".concat(r.name,".").concat(a,"(").concat(D,":) expected but ").concat(t.name,".").concat(a," does not provide it."),[T.astNode,u.astNode]),"continue";if(!(0,UT.isEqualType)(T.type,V.type)){var x,te;e.reportError("Interface field argument ".concat(r.name,".").concat(a,"(").concat(D,":) ")+"expects type ".concat((0,it.default)(T.type)," but ")+"".concat(t.name,".").concat(a,"(").concat(D,":) is type ")+"".concat((0,it.default)(V.type),"."),[(x=T.astNode)===null||x===void 0?void 0:x.type,(te=V.astNode)===null||te===void 0?void 0:te.type])}},f=0,h=s.args;f<h.length;f++)var g=p(f,h);for(var v=function(I,A){var T=A[I],D=T.name,V=(0,qT.default)(s.args,function(x){return x.name===D});!V&&(0,Me.isRequiredArgument)(T)&&e.reportError("Object field ".concat(t.name,".").concat(a," includes required argument ").concat(D," 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 S1(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(as(r,s),as(t,r)))}}function b1(e,t){var r=t.getTypes();r.length===0&&e.reportError("Union type ".concat(t.name," must define one or more member types."),Ci(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."),$T(t,o.name));continue}n[o.name]=!0,(0,Me.isObjectType)(o)||e.reportError("Union type ".concat(t.name," can only include Object types, ")+"it cannot include ".concat((0,it.default)(o),"."),$T(t,String(o)))}}function T1(e,t){var r=t.getValues();r.length===0&&e.reportError("Enum type ".concat(t.name," must define one or more values."),Ci(t));for(var n=0;n<r.length;n++){var i=r[n],o=i.name;jn(e,i),(o==="true"||o==="false"||o==="null")&&e.reportError("Enum type ".concat(t.name," cannot include value: ").concat(o,"."),i.astNode)}}function I1(e,t){var r=(0,us.default)(t.getFields());r.length===0&&e.reportError("Input Object type ".concat(t.name," must define one or more fields."),Ci(t));for(var n=0;n<r.length;n++){var i=r[n];if(jn(e,i),!(0,Me.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,Me.isRequiredInputField)(i)&&i.deprecationReason!=null){var s;e.reportError("Required input field ".concat(t.name,".").concat(i.name," cannot be deprecated."),[mf(i.astNode),(s=i.astNode)===null||s===void 0?void 0:s.type])}}}function O1(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,us.default)(o.getFields()),a=0;a<s.length;a++){var u=s[a];if((0,Me.isNonNullType)(u.type)&&(0,Me.isInputObjectType)(u.type.ofType)){var c=u.type.ofType,l=n[c.name];if(r.push(u),l===void 0)i(c);else{var p=r.slice(l),f=p.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,'".'),p.map(function(h){return h.astNode}))}r.pop()}}n[o.name]=void 0}}}function Ci(e){var t=e.astNode,r=e.extensionASTNodes;return t?r?[t].concat(r):[t]:r??[]}function hf(e,t){for(var r=[],n=0,i=Ci(e);n<i.length;n++){var o,s=i[n];r=r.concat((o=t(s))!==null&&o!==void 0?o:[])}return r}function as(e,t){return hf(e,function(r){return r.interfaces}).filter(function(r){return r.name.value===t.name})}function $T(e,t){return hf(e,function(r){return r.types}).filter(function(r){return r.name.value===t})}function mf(e){var t;return e==null||(t=e.directives)===null||t===void 0?void 0:t.find(function(r){return r.name.value===BT.GraphQLDeprecatedDirective.name})}});var pr=y(vf=>{"use strict";d();Object.defineProperty(vf,"__esModule",{value:!0});vf.typeFromAST=yf;var w1=QT(ae()),A1=QT(et()),gf=Ee(),HT=ie();function QT(e){return e&&e.__esModule?e:{default:e}}function yf(e,t){var r;if(t.kind===gf.Kind.LIST_TYPE)return r=yf(e,t.type),r&&new HT.GraphQLList(r);if(t.kind===gf.Kind.NON_NULL_TYPE)return r=yf(e,t.type),r&&new HT.GraphQLNonNull(r);if(t.kind===gf.Kind.NAMED_TYPE)return e.getType(t.name.value);(0,A1.default)(0,"Unexpected type node: "+(0,w1.default)(t))}});var Wu=y(ls=>{"use strict";d();Object.defineProperty(ls,"__esModule",{value:!0});ls.visitWithTypeInfo=D1;ls.TypeInfo=void 0;var x1=N1(Ti()),Pe=Ee(),R1=yi(),WT=Kr(),De=ie(),Pi=qt(),zT=pr();function N1(e){return e&&e.__esModule?e:{default:e}}var C1=(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??P1,i&&((0,De.isInputType)(i)&&this._inputTypeStack.push(i),(0,De.isCompositeType)(i)&&this._parentTypeStack.push(i),(0,De.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 Pe.Kind.SELECTION_SET:{var o=(0,De.getNamedType)(this.getType());this._parentTypeStack.push((0,De.isCompositeType)(o)?o:void 0);break}case Pe.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,De.isOutputType)(u)?u:void 0);break}case Pe.Kind.DIRECTIVE:this._directive=i.getDirective(n.name.value);break;case Pe.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,De.isObjectType)(c)?c:void 0);break}case Pe.Kind.INLINE_FRAGMENT:case Pe.Kind.FRAGMENT_DEFINITION:{var l=n.typeCondition,p=l?(0,zT.typeFromAST)(i,l):(0,De.getNamedType)(this.getType());this._typeStack.push((0,De.isOutputType)(p)?p:void 0);break}case Pe.Kind.VARIABLE_DEFINITION:{var f=(0,zT.typeFromAST)(i,n.type);this._inputTypeStack.push((0,De.isInputType)(f)?f:void 0);break}case Pe.Kind.ARGUMENT:{var h,g,v,_=(h=this.getDirective())!==null&&h!==void 0?h:this.getFieldDef();_&&(g=(0,x1.default)(_.args,function(x){return x.name===n.name.value}),g&&(v=g.type)),this._argument=g,this._defaultValueStack.push(g?g.defaultValue:void 0),this._inputTypeStack.push((0,De.isInputType)(v)?v:void 0);break}case Pe.Kind.LIST:{var b=(0,De.getNullableType)(this.getInputType()),S=(0,De.isListType)(b)?b.ofType:b;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,De.isInputType)(S)?S:void 0);break}case Pe.Kind.OBJECT_FIELD:{var I=(0,De.getNamedType)(this.getInputType()),A,T;(0,De.isInputObjectType)(I)&&(T=I.getFields()[n.name.value],T&&(A=T.type)),this._defaultValueStack.push(T?T.defaultValue:void 0),this._inputTypeStack.push((0,De.isInputType)(A)?A:void 0);break}case Pe.Kind.ENUM:{var D=(0,De.getNamedType)(this.getInputType()),V;(0,De.isEnumType)(D)&&(V=D.getValue(n.value)),this._enumValue=V;break}}},t.leave=function(n){switch(n.kind){case Pe.Kind.SELECTION_SET:this._parentTypeStack.pop();break;case Pe.Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case Pe.Kind.DIRECTIVE:this._directive=null;break;case Pe.Kind.OPERATION_DEFINITION:case Pe.Kind.INLINE_FRAGMENT:case Pe.Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case Pe.Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case Pe.Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case Pe.Kind.LIST:case Pe.Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case Pe.Kind.ENUM:this._enumValue=null;break}},e})();ls.TypeInfo=C1;function P1(e,t,r){var n=r.name.value;if(n===Pi.SchemaMetaFieldDef.name&&e.getQueryType()===t)return Pi.SchemaMetaFieldDef;if(n===Pi.TypeMetaFieldDef.name&&e.getQueryType()===t)return Pi.TypeMetaFieldDef;if(n===Pi.TypeNameMetaFieldDef.name&&(0,De.isCompositeType)(t))return Pi.TypeNameMetaFieldDef;if((0,De.isObjectType)(t)||(0,De.isInterfaceType)(t))return t.getFields()[n]}function D1(e,t){return{enter:function(n){e.enter(n);var i=(0,WT.getVisitFn)(t,n.kind,!1);if(i){var o=i.apply(t,arguments);return o!==void 0&&(e.leave(n),(0,R1.isNode)(o)&&e.enter(o)),o}},leave:function(n){var i=(0,WT.getVisitFn)(t,n.kind,!0),o;return i&&(o=i.apply(t,arguments)),e.leave(n),o}}}});var Mn=y(er=>{"use strict";d();Object.defineProperty(er,"__esModule",{value:!0});er.isDefinitionNode=L1;er.isExecutableDefinitionNode=YT;er.isSelectionNode=k1;er.isValueNode=j1;er.isTypeNode=M1;er.isTypeSystemDefinitionNode=JT;er.isTypeDefinitionNode=XT;er.isTypeSystemExtensionNode=ZT;er.isTypeExtensionNode=eI;var ue=Ee();function L1(e){return YT(e)||JT(e)||ZT(e)}function YT(e){return e.kind===ue.Kind.OPERATION_DEFINITION||e.kind===ue.Kind.FRAGMENT_DEFINITION}function k1(e){return e.kind===ue.Kind.FIELD||e.kind===ue.Kind.FRAGMENT_SPREAD||e.kind===ue.Kind.INLINE_FRAGMENT}function j1(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 M1(e){return e.kind===ue.Kind.NAMED_TYPE||e.kind===ue.Kind.LIST_TYPE||e.kind===ue.Kind.NON_NULL_TYPE}function JT(e){return e.kind===ue.Kind.SCHEMA_DEFINITION||XT(e)||e.kind===ue.Kind.DIRECTIVE_DEFINITION}function XT(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 ZT(e){return e.kind===ue.Kind.SCHEMA_EXTENSION||eI(e)}function eI(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 _f=y(Ef=>{"use strict";d();Object.defineProperty(Ef,"__esModule",{value:!0});Ef.ExecutableDefinitionsRule=U1;var F1=K(),tI=Ee(),q1=Mn();function U1(e){return{Document:function(r){for(var n=0,i=r.definitions;n<i.length;n++){var o=i[n];if(!(0,q1.isExecutableDefinitionNode)(o)){var s=o.kind===tI.Kind.SCHEMA_DEFINITION||o.kind===tI.Kind.SCHEMA_EXTENSION?"schema":'"'+o.name.value+'"';e.reportError(new F1.GraphQLError("The ".concat(s," definition is not executable."),o))}}return!1}}}});var bf=y(Sf=>{"use strict";d();Object.defineProperty(Sf,"__esModule",{value:!0});Sf.UniqueOperationNamesRule=G1;var V1=K();function G1(e){var t=Object.create(null);return{OperationDefinition:function(n){var i=n.name;return i&&(t[i.value]?e.reportError(new V1.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 If=y(Tf=>{"use strict";d();Object.defineProperty(Tf,"__esModule",{value:!0});Tf.LoneAnonymousOperationRule=K1;var $1=K(),B1=Ee();function K1(e){var t=0;return{Document:function(n){t=n.definitions.filter(function(i){return i.kind===B1.Kind.OPERATION_DEFINITION}).length},OperationDefinition:function(n){!n.name&&t>1&&e.reportError(new $1.GraphQLError("This anonymous operation must be the only defined operation.",n))}}}});var wf=y(Of=>{"use strict";d();Object.defineProperty(Of,"__esModule",{value:!0});Of.SingleFieldSubscriptionsRule=Q1;var H1=K();function Q1(e){return{OperationDefinition:function(r){r.operation==="subscription"&&r.selectionSet.selections.length!==1&&e.reportError(new H1.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 Rf=y(xf=>{"use strict";d();Object.defineProperty(xf,"__esModule",{value:!0});xf.KnownTypeNamesRule=Z1;var W1=rI(Qr()),z1=rI(Wr()),Y1=K(),Af=Mn(),J1=dr(),X1=qt();function rI(e){return e&&e.__esModule?e:{default:e}}function Z1(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,Af.isTypeDefinitionNode)(s)&&(n[s.name.value]=!0)}var a=Object.keys(r).concat(Object.keys(n));return{NamedType:function(c,l,p,f,h){var g=c.name.value;if(!r[g]&&!n[g]){var v,_=(v=h[2])!==null&&v!==void 0?v:p,b=_!=null&&t$(_);if(b&&e$(g))return;var S=(0,z1.default)(g,b?nI.concat(a):a);e.reportError(new Y1.GraphQLError('Unknown type "'.concat(g,'".')+(0,W1.default)(S),c))}}}}var nI=[].concat(J1.specifiedScalarTypes,X1.introspectionTypes).map(function(e){return e.name});function e$(e){return nI.indexOf(e)!==-1}function t$(e){return!Array.isArray(e)&&((0,Af.isTypeSystemDefinitionNode)(e)||(0,Af.isTypeSystemExtensionNode)(e))}});var Cf=y(Nf=>{"use strict";d();Object.defineProperty(Nf,"__esModule",{value:!0});Nf.FragmentsOnCompositeTypesRule=r$;var iI=K(),oI=mt(),sI=ie(),aI=pr();function r$(e){return{InlineFragment:function(r){var n=r.typeCondition;if(n){var i=(0,aI.typeFromAST)(e.getSchema(),n);if(i&&!(0,sI.isCompositeType)(i)){var o=(0,oI.print)(n);e.reportError(new iI.GraphQLError('Fragment cannot condition on non composite type "'.concat(o,'".'),n))}}},FragmentDefinition:function(r){var n=(0,aI.typeFromAST)(e.getSchema(),r.typeCondition);if(n&&!(0,sI.isCompositeType)(n)){var i=(0,oI.print)(r.typeCondition);e.reportError(new iI.GraphQLError('Fragment "'.concat(r.name.value,'" cannot condition on non composite type "').concat(i,'".'),r.typeCondition))}}}}});var Df=y(Pf=>{"use strict";d();Object.defineProperty(Pf,"__esModule",{value:!0});Pf.VariablesAreInputTypesRule=a$;var n$=K(),i$=mt(),o$=ie(),s$=pr();function a$(e){return{VariableDefinition:function(r){var n=(0,s$.typeFromAST)(e.getSchema(),r.type);if(n&&!(0,o$.isInputType)(n)){var i=r.variable.name.value,o=(0,i$.print)(r.type);e.reportError(new n$.GraphQLError('Variable "$'.concat(i,'" cannot be non-input type "').concat(o,'".'),r.type))}}}}});var kf=y(Lf=>{"use strict";d();Object.defineProperty(Lf,"__esModule",{value:!0});Lf.ScalarLeafsRule=c$;var uI=u$(ae()),cI=K(),lI=ie();function u$(e){return e&&e.__esModule?e:{default:e}}function c$(e){return{Field:function(r){var n=e.getType(),i=r.selectionSet;if(n){if((0,lI.isLeafType)((0,lI.getNamedType)(n))){if(i){var o=r.name.value,s=(0,uI.default)(n);e.reportError(new cI.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,uI.default)(n);e.reportError(new cI.GraphQLError('Field "'.concat(a,'" of type "').concat(u,'" must have a selection of subfields. Did you mean "').concat(a,' { ... }"?'),r))}}}}}});var Mf=y(jf=>{"use strict";d();Object.defineProperty(jf,"__esModule",{value:!0});jf.FieldsOnCorrectTypeRule=h$;var l$=zu(Wp()),dI=zu(Qr()),d$=zu(Wr()),p$=zu(Wo()),f$=K(),ds=ie();function zu(e){return e&&e.__esModule?e:{default:e}}function h$(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,dI.default)("to use an inline fragment on",m$(o,n,s));a===""&&(a=(0,dI.default)(g$(n,s))),e.reportError(new f$.GraphQLError('Cannot query field "'.concat(s,'" on type "').concat(n.name,'".')+a,r))}}}}}function m$(e,t,r){if(!(0,ds.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,p=c[u];p.getFields()[r]&&(n.add(p),i[p.name]=((l=i[p.name])!==null&&l!==void 0?l:0)+1)}}}return(0,l$.default)(n).sort(function(f,h){var g=i[h.name]-i[f.name];return g!==0?g:(0,ds.isInterfaceType)(f)&&e.isSubType(f,h)?-1:(0,ds.isInterfaceType)(h)&&e.isSubType(h,f)?1:(0,p$.default)(f.name,h.name)}).map(function(f){return f.name})}function g$(e,t){if((0,ds.isObjectType)(e)||(0,ds.isInterfaceType)(e)){var r=Object.keys(e.getFields());return(0,d$.default)(t,r)}return[]}});var qf=y(Ff=>{"use strict";d();Object.defineProperty(Ff,"__esModule",{value:!0});Ff.UniqueFragmentNamesRule=v$;var y$=K();function v$(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 y$.GraphQLError('There can be only one fragment named "'.concat(i,'".'),[t[i],n.name])):t[i]=n.name,!1}}}});var Vf=y(Uf=>{"use strict";d();Object.defineProperty(Uf,"__esModule",{value:!0});Uf.KnownFragmentNamesRule=_$;var E$=K();function _$(e){return{FragmentSpread:function(r){var n=r.name.value,i=e.getFragment(n);i||e.reportError(new E$.GraphQLError('Unknown fragment "'.concat(n,'".'),r.name))}}}});var $f=y(Gf=>{"use strict";d();Object.defineProperty(Gf,"__esModule",{value:!0});Gf.NoUnusedFragmentsRule=b$;var S$=K();function b$(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 p=r[l],f=p.name.value;i[f]!==!0&&e.reportError(new S$.GraphQLError('Fragment "'.concat(f,'" is never used.'),p))}}}}}});var Hf=y(Kf=>{"use strict";d();Object.defineProperty(Kf,"__esModule",{value:!0});Kf.PossibleFragmentSpreadsRule=O$;var Yu=I$(ae()),pI=K(),Bf=ie(),T$=pr(),fI=Zo();function I$(e){return e&&e.__esModule?e:{default:e}}function O$(e){return{InlineFragment:function(r){var n=e.getType(),i=e.getParentType();if((0,Bf.isCompositeType)(n)&&(0,Bf.isCompositeType)(i)&&!(0,fI.doTypesOverlap)(e.getSchema(),n,i)){var o=(0,Yu.default)(i),s=(0,Yu.default)(n);e.reportError(new pI.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=w$(e,n),o=e.getParentType();if(i&&o&&!(0,fI.doTypesOverlap)(e.getSchema(),i,o)){var s=(0,Yu.default)(o),a=(0,Yu.default)(i);e.reportError(new pI.GraphQLError('Fragment "'.concat(n,'" cannot be spread here as objects of type "').concat(s,'" can never be of type "').concat(a,'".'),r))}}}}function w$(e,t){var r=e.getFragment(t);if(r){var n=(0,T$.typeFromAST)(e.getSchema(),r.typeCondition);if((0,Bf.isCompositeType)(n))return n}}});var Wf=y(Qf=>{"use strict";d();Object.defineProperty(Qf,"__esModule",{value:!0});Qf.NoFragmentCyclesRule=x$;var A$=K();function x$(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,p=n[l];if(r.push(c),p===void 0){var f=e.getFragment(l);f&&i(f)}else{var h=r.slice(p),g=h.slice(0,-1).map(function(v){return'"'+v.name.value+'"'}).join(", ");e.reportError(new A$.GraphQLError('Cannot spread fragment "'.concat(l,'" within itself')+(g!==""?" via ".concat(g,"."):"."),h))}r.pop()}n[s]=void 0}}}}});var Yf=y(zf=>{"use strict";d();Object.defineProperty(zf,"__esModule",{value:!0});zf.UniqueVariableNamesRule=N$;var R$=K();function N$(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 R$.GraphQLError('There can be only one variable named "$'.concat(i,'".'),[t[i],n.variable.name])):t[i]=n.variable.name}}}});var Xf=y(Jf=>{"use strict";d();Object.defineProperty(Jf,"__esModule",{value:!0});Jf.NoUndefinedVariablesRule=P$;var C$=K();function P$(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 C$.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 eh=y(Zf=>{"use strict";d();Object.defineProperty(Zf,"__esModule",{value:!0});Zf.NoUnusedVariablesRule=L$;var D$=K();function L$(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 p=l[c],f=p.variable.name.value;i[f]!==!0&&e.reportError(new D$.GraphQLError(n.name?'Variable "$'.concat(f,'" is never used in operation "').concat(n.name.value,'".'):'Variable "$'.concat(f,'" is never used.'),p))}}},VariableDefinition:function(n){t.push(n)}}}});var rh=y(th=>{"use strict";d();Object.defineProperty(th,"__esModule",{value:!0});th.KnownDirectivesRule=M$;var k$=gI(ae()),mI=gI(et()),hI=K(),Oe=Ee(),Be=Ei(),j$=gt();function gI(e){return e&&e.__esModule?e:{default:e}}function M$(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():j$.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,p,f,h,g){var v=l.name.value,_=t[v];if(!_){e.reportError(new hI.GraphQLError('Unknown directive "@'.concat(v,'".'),l));return}var b=F$(g);b&&_.indexOf(b)===-1&&e.reportError(new hI.GraphQLError('Directive "@'.concat(v,'" may not be used on ').concat(b,"."),l))}}}function F$(e){var t=e[e.length-1];switch(!Array.isArray(t)||(0,mI.default)(0),t.kind){case Oe.Kind.OPERATION_DEFINITION:return q$(t.operation);case Oe.Kind.FIELD:return Be.DirectiveLocation.FIELD;case Oe.Kind.FRAGMENT_SPREAD:return Be.DirectiveLocation.FRAGMENT_SPREAD;case Oe.Kind.INLINE_FRAGMENT:return Be.DirectiveLocation.INLINE_FRAGMENT;case Oe.Kind.FRAGMENT_DEFINITION:return Be.DirectiveLocation.FRAGMENT_DEFINITION;case Oe.Kind.VARIABLE_DEFINITION:return Be.DirectiveLocation.VARIABLE_DEFINITION;case Oe.Kind.SCHEMA_DEFINITION:case Oe.Kind.SCHEMA_EXTENSION:return Be.DirectiveLocation.SCHEMA;case Oe.Kind.SCALAR_TYPE_DEFINITION:case Oe.Kind.SCALAR_TYPE_EXTENSION:return Be.DirectiveLocation.SCALAR;case Oe.Kind.OBJECT_TYPE_DEFINITION:case Oe.Kind.OBJECT_TYPE_EXTENSION:return Be.DirectiveLocation.OBJECT;case Oe.Kind.FIELD_DEFINITION:return Be.DirectiveLocation.FIELD_DEFINITION;case Oe.Kind.INTERFACE_TYPE_DEFINITION:case Oe.Kind.INTERFACE_TYPE_EXTENSION:return Be.DirectiveLocation.INTERFACE;case Oe.Kind.UNION_TYPE_DEFINITION:case Oe.Kind.UNION_TYPE_EXTENSION:return Be.DirectiveLocation.UNION;case Oe.Kind.ENUM_TYPE_DEFINITION:case Oe.Kind.ENUM_TYPE_EXTENSION:return Be.DirectiveLocation.ENUM;case Oe.Kind.ENUM_VALUE_DEFINITION:return Be.DirectiveLocation.ENUM_VALUE;case Oe.Kind.INPUT_OBJECT_TYPE_DEFINITION:case Oe.Kind.INPUT_OBJECT_TYPE_EXTENSION:return Be.DirectiveLocation.INPUT_OBJECT;case Oe.Kind.INPUT_VALUE_DEFINITION:{var r=e[e.length-3];return r.kind===Oe.Kind.INPUT_OBJECT_TYPE_DEFINITION?Be.DirectiveLocation.INPUT_FIELD_DEFINITION:Be.DirectiveLocation.ARGUMENT_DEFINITION}}}function q$(e){switch(e){case"query":return Be.DirectiveLocation.QUERY;case"mutation":return Be.DirectiveLocation.MUTATION;case"subscription":return Be.DirectiveLocation.SUBSCRIPTION}(0,mI.default)(0,"Unexpected operation: "+(0,k$.default)(e))}});var oh=y(ih=>{"use strict";d();Object.defineProperty(ih,"__esModule",{value:!0});ih.UniqueDirectivesPerLocationRule=G$;var U$=K(),nh=Ee(),yI=Mn(),V$=gt();function G$(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():V$.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===nh.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===nh.Kind.SCHEMA_DEFINITION||f.kind===nh.Kind.SCHEMA_EXTENSION)h=c;else if((0,yI.isTypeDefinitionNode)(f)||(0,yI.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 U$.GraphQLError('The directive "@'.concat(S,'" can only be used once at this location.'),[h[S],b])):h[S]=b)}}}}}});var sh=y(Ju=>{"use strict";d();Object.defineProperty(Ju,"__esModule",{value:!0});Ju.KnownArgumentNamesRule=H$;Ju.KnownArgumentNamesOnDirectivesRule=II;var _I=TI(Qr()),SI=TI(Wr()),bI=K(),$$=Ee(),B$=gt();function TI(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 EI(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){K$(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 K$(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function H$(e){return EI(EI({},II(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,SI.default)(s,a);e.reportError(new bI.GraphQLError('Unknown argument "'.concat(s,'" on field "').concat(o.name,".").concat(i.name,'".')+(0,_I.default)(u),r))}}})}function II(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(p){return p.name})}for(var s=e.getDocument().definitions,a=0;a<s.length;a++){var u=s[a];if(u.kind===$$.Kind.DIRECTIVE_DEFINITION){var c,l=(c=u.arguments)!==null&&c!==void 0?c:[];t[u.name.value]=l.map(function(p){return p.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,SI.default)(S,g);e.reportError(new bI.GraphQLError('Unknown argument "'.concat(S,'" on directive "@').concat(h,'".')+(0,_I.default)(I),b))}}return!1}}}});var uh=y(ah=>{"use strict";d();Object.defineProperty(ah,"__esModule",{value:!0});ah.UniqueArgumentNamesRule=W$;var Q$=K();function W$(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 Q$.GraphQLError('There can be only one argument named "'.concat(i,'".'),[t[i],n.name])):t[i]=n.name,!1}}}});var lh=y(ch=>{"use strict";d();Object.defineProperty(ch,"__esModule",{value:!0});ch.ValuesOfCorrectTypeRule=Z$;var z$=fs(St()),Y$=fs(Hr()),ps=fs(ae()),J$=fs(Qr()),X$=fs(Wr()),qn=K(),Xu=mt(),fr=ie();function fs(e){return e&&e.__esModule?e:{default:e}}function Z$(e){return{ListValue:function(r){var n=(0,fr.getNullableType)(e.getParentInputType());if(!(0,fr.isListType)(n))return Fn(e,r),!1},ObjectValue:function(r){var n=(0,fr.getNamedType)(e.getInputType());if(!(0,fr.isInputObjectType)(n))return Fn(e,r),!1;for(var i=(0,Y$.default)(r.fields,function(l){return l.name.value}),o=0,s=(0,z$.default)(n.getFields());o<s.length;o++){var a=s[o],u=i[a.name];if(!u&&(0,fr.isRequiredInputField)(a)){var c=(0,ps.default)(a.type);e.reportError(new qn.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,X$.default)(r.name.value,Object.keys(n.getFields()));e.reportError(new qn.GraphQLError('Field "'.concat(r.name.value,'" is not defined by type "').concat(n.name,'".')+(0,J$.default)(o),r))}},NullValue:function(r){var n=e.getInputType();(0,fr.isNonNullType)(n)&&e.reportError(new qn.GraphQLError('Expected value of type "'.concat((0,ps.default)(n),'", found ').concat((0,Xu.print)(r),"."),r))},EnumValue:function(r){return Fn(e,r)},IntValue:function(r){return Fn(e,r)},FloatValue:function(r){return Fn(e,r)},StringValue:function(r){return Fn(e,r)},BooleanValue:function(r){return Fn(e,r)}}}function Fn(e,t){var r=e.getInputType();if(r){var n=(0,fr.getNamedType)(r);if(!(0,fr.isLeafType)(n)){var i=(0,ps.default)(r);e.reportError(new qn.GraphQLError('Expected value of type "'.concat(i,'", found ').concat((0,Xu.print)(t),"."),t));return}try{var o=n.parseLiteral(t,void 0);if(o===void 0){var s=(0,ps.default)(r);e.reportError(new qn.GraphQLError('Expected value of type "'.concat(s,'", found ').concat((0,Xu.print)(t),"."),t))}}catch(u){var a=(0,ps.default)(r);u instanceof qn.GraphQLError?e.reportError(u):e.reportError(new qn.GraphQLError('Expected value of type "'.concat(a,'", found ').concat((0,Xu.print)(t),"; ")+u.message,t,void 0,void 0,void 0,u))}}}});var ph=y(ec=>{"use strict";d();Object.defineProperty(ec,"__esModule",{value:!0});ec.ProvidedRequiredArgumentsRule=nB;ec.ProvidedRequiredArgumentsOnDirectivesRule=CI;var AI=NI(ae()),Zu=NI(Hr()),xI=K(),RI=Ee(),eB=mt(),tB=gt(),dh=ie();function NI(e){return e&&e.__esModule?e:{default:e}}function OI(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 wI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?OI(Object(r),!0).forEach(function(n){rB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nB(e){return wI(wI({},CI(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,Zu.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,dh.isRequiredArgument)(c)){var p=(0,AI.default)(c.type);e.reportError(new xI.GraphQLError('Field "'.concat(i.name,'" argument "').concat(c.name,'" of type "').concat(p,'" is required, but it was not provided.'),r))}}}}})}function CI(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():tB.specifiedDirectives,i=0;i<n.length;i++){var o=n[i];t[o.name]=(0,Zu.default)(o.args.filter(dh.isRequiredArgument),function(p){return p.name})}for(var s=e.getDocument().definitions,a=0;a<s.length;a++){var u=s[a];if(u.kind===RI.Kind.DIRECTIVE_DEFINITION){var c,l=(c=u.arguments)!==null&&c!==void 0?c:[];t[u.name.value]=(0,Zu.default)(l.filter(iB),function(p){return p.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,Zu.default)(_,function(V){return V.name.value}),S=0,I=Object.keys(g);S<I.length;S++){var A=I[S];if(!b[A]){var T=g[A].type,D=(0,dh.isType)(T)?(0,AI.default)(T):(0,eB.print)(T);e.reportError(new xI.GraphQLError('Directive "@'.concat(h,'" argument "').concat(A,'" of type "').concat(D,'" is required, but it was not provided.'),f))}}}}}}function iB(e){return e.type.kind===RI.Kind.NON_NULL_TYPE&&e.defaultValue==null}});var hh=y(fh=>{"use strict";d();Object.defineProperty(fh,"__esModule",{value:!0});fh.VariablesInAllowedPositionRule=cB;var PI=uB(ae()),oB=K(),sB=Ee(),DI=ie(),aB=pr(),LI=Zo();function uB(e){return e&&e.__esModule?e:{default:e}}function cB(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,p=t[l];if(p&&u){var f=e.getSchema(),h=(0,aB.typeFromAST)(f,p.type);if(h&&!lB(f,h,p.defaultValue,u,c)){var g=(0,PI.default)(h),v=(0,PI.default)(u);e.reportError(new oB.GraphQLError('Variable "$'.concat(l,'" of type "').concat(g,'" used in position expecting type "').concat(v,'".'),[p,a]))}}}}},VariableDefinition:function(n){t[n.variable.name.value]=n}}}function lB(e,t,r,n,i){if((0,DI.isNonNullType)(n)&&!(0,DI.isNonNullType)(t)){var o=r!=null&&r.kind!==sB.Kind.NULL,s=i!==void 0;if(!o&&!s)return!1;var a=n.ofType;return(0,LI.isTypeSubTypeOf)(e,t,a)}return(0,LI.isTypeSubTypeOf)(e,t,n)}});var Sh=y(_h=>{"use strict";d();Object.defineProperty(_h,"__esModule",{value:!0});_h.OverlappingFieldsCanBeMergedRule=hB;var dB=vh(Ti()),pB=vh(Ii()),kI=vh(ae()),fB=K(),mh=Ee(),jI=mt(),yt=ie(),MI=pr();function vh(e){return e&&e.__esModule?e:{default:e}}function FI(e){return Array.isArray(e)?e.map(function(t){var r=t[0],n=t[1];return'subfields "'.concat(r,'" conflict because ')+FI(n)}).join(" and "):e}function hB(e){var t=new SB,r=new Map;return{SelectionSet:function(i){for(var o=mB(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],p=a[1],f=a[2],h=FI(l);e.reportError(new fB.GraphQLError('Fields "'.concat(c,'" conflict because ').concat(h,". Use different aliases on the fields to fetch both if this was intentional."),p.concat(f)))}}}}function mB(e,t,r,n,i){var o=[],s=nc(e,t,n,i),a=s[0],u=s[1];if(yB(e,o,t,r,a),u.length!==0)for(var c=0;c<u.length;c++){tc(e,o,t,r,!1,a,u[c]);for(var l=c+1;l<u.length;l++)rc(e,o,t,r,!1,u[c],u[l])}return o}function tc(e,t,r,n,i,o,s){var a=e.getFragment(s);if(a){var u=yh(e,r,a),c=u[0],l=u[1];if(o!==c){Eh(e,t,r,n,i,o,c);for(var p=0;p<l.length;p++){var f=l[p];n.has(f,s,i)||(n.add(f,s,i),tc(e,t,r,n,i,o,l[p]))}}}}function rc(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=yh(e,r,a),l=c[0],p=c[1],f=yh(e,r,u),h=f[0],g=f[1];Eh(e,t,r,n,i,l,h);for(var v=0;v<g.length;v++)rc(e,t,r,n,i,o,g[v]);for(var _=0;_<p.length;_++)rc(e,t,r,n,i,p[_],s)}}}function gB(e,t,r,n,i,o,s,a){var u=[],c=nc(e,t,i,o),l=c[0],p=c[1],f=nc(e,t,s,a),h=f[0],g=f[1];if(Eh(e,u,t,r,n,l,h),g.length!==0)for(var v=0;v<g.length;v++)tc(e,u,t,r,n,l,g[v]);if(p.length!==0)for(var _=0;_<p.length;_++)tc(e,u,t,r,n,h,p[_]);for(var b=0;b<p.length;b++)for(var S=0;S<g.length;S++)rc(e,u,t,r,n,p[b],g[S]);return u}function yB(e,t,r,n,i){for(var o=0,s=(0,pB.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 p=l+1;p<c.length;p++){var f=qI(e,r,n,!1,u,c[l],c[p]);f&&t.push(f)}}}function Eh(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 p=o[c],f=0;f<p.length;f++)for(var h=0;h<l.length;h++){var g=qI(e,r,n,i,c,p[f],l[h]);g&&t.push(g)}}}function qI(e,t,r,n,i,o,s){var a=o[0],u=o[1],c=o[2],l=s[0],p=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=p.name.value;if(_!==b)return[[i,'"'.concat(_,'" and "').concat(b,'" are different fields')],[u],[p]];var S=(g=u.arguments)!==null&&g!==void 0?g:[],I=(v=p.arguments)!==null&&v!==void 0?v:[];if(!vB(S,I))return[[i,"they have differing arguments"],[u],[p]]}var A=c?.type,T=f?.type;if(A&&T&&gh(A,T))return[[i,'they return conflicting types "'.concat((0,kI.default)(A),'" and "').concat((0,kI.default)(T),'"')],[u],[p]];var D=u.selectionSet,V=p.selectionSet;if(D&&V){var x=gB(e,t,r,h,(0,yt.getNamedType)(A),D,(0,yt.getNamedType)(T),V);return _B(x,i,u,p)}}function vB(e,t){return e.length!==t.length?!1:e.every(function(r){var n=(0,dB.default)(t,function(i){return i.name.value===r.name.value});return n?EB(r.value,n.value):!1})}function EB(e,t){return(0,jI.print)(e)===(0,jI.print)(t)}function gh(e,t){return(0,yt.isListType)(e)?(0,yt.isListType)(t)?gh(e.ofType,t.ofType):!0:(0,yt.isListType)(t)?!0:(0,yt.isNonNullType)(e)?(0,yt.isNonNullType)(t)?gh(e.ofType,t.ofType):!0:(0,yt.isNonNullType)(t)?!0:(0,yt.isLeafType)(e)||(0,yt.isLeafType)(t)?e!==t:!1}function nc(e,t,r,n){var i=t.get(n);if(!i){var o=Object.create(null),s=Object.create(null);UI(e,r,n,o,s),i=[o,Object.keys(s)],t.set(n,i)}return i}function yh(e,t,r){var n=t.get(r.selectionSet);if(n)return n;var i=(0,MI.typeFromAST)(e.getSchema(),r.typeCondition);return nc(e,t,i,r.selectionSet)}function UI(e,t,r,n,i){for(var o=0,s=r.selections;o<s.length;o++){var a=s[o];switch(a.kind){case mh.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 mh.Kind.FRAGMENT_SPREAD:i[a.name.value]=!0;break;case mh.Kind.INLINE_FRAGMENT:{var p=a.typeCondition,f=p?(0,MI.typeFromAST)(e.getSchema(),p):t;UI(e,f,a.selectionSet,n,i);break}}}}function _B(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 SB=(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 Th=y(bh=>{"use strict";d();Object.defineProperty(bh,"__esModule",{value:!0});bh.UniqueInputFieldNamesRule=TB;var bB=K();function TB(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 bB.GraphQLError('There can be only one input field named "'.concat(o,'".'),[r[o],i.name])):r[o]=i.name}}}});var Oh=y(Ih=>{"use strict";d();Object.defineProperty(Ih,"__esModule",{value:!0});Ih.MaxIntrospectionDepthRule=wB;var IB=K(),VI=Ee(),OB=3;function wB(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===VI.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===VI.Kind.FIELD&&(r.name.value==="fields"||r.name.value==="interfaces"||r.name.value==="possibleTypes"||r.name.value==="inputFields")&&(i++,i>=OB))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 IB.GraphQLError("Maximum introspection depth exceeded",[n])),!1}}}});var Ah=y(wh=>{"use strict";d();Object.defineProperty(wh,"__esModule",{value:!0});wh.LoneSchemaDefinitionRule=AB;var GI=K();function AB(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 GI.GraphQLError("Cannot define a new schema within a schema extension.",u));return}s>0&&e.reportError(new GI.GraphQLError("Must provide only one schema definition.",u)),++s}}}});var Rh=y(xh=>{"use strict";d();Object.defineProperty(xh,"__esModule",{value:!0});xh.UniqueOperationTypesRule=xB;var $I=K();function xB(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,p=r[l];n[l]?e.reportError(new $I.GraphQLError("Type for ".concat(l," already defined in the schema. It cannot be redefined."),c)):p?e.reportError(new $I.GraphQLError("There can be only one ".concat(l," type in schema."),[p,c])):r[l]=c}return!1}}});var Ch=y(Nh=>{"use strict";d();Object.defineProperty(Nh,"__esModule",{value:!0});Nh.UniqueTypeNamesRule=RB;var BI=K();function RB(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 BI.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 BI.GraphQLError('There can be only one type named "'.concat(o,'".'),[t[o],i.name])):t[o]=i.name,!1}}});var Dh=y(Ph=>{"use strict";d();Object.defineProperty(Ph,"__esModule",{value:!0});Ph.UniqueEnumValueNamesRule=CB;var KI=K(),NB=ie();function CB(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 p=u[l],f=p.name.value,h=r[a];(0,NB.isEnumType)(h)&&h.getValue(f)?e.reportError(new KI.GraphQLError('Enum value "'.concat(a,".").concat(f,'" already exists in the schema. It cannot also be defined in this type extension.'),p.name)):c[f]?e.reportError(new KI.GraphQLError('Enum value "'.concat(a,".").concat(f,'" can only be defined once.'),[c[f],p.name])):c[f]=p.name}return!1}}});var jh=y(kh=>{"use strict";d();Object.defineProperty(kh,"__esModule",{value:!0});kh.UniqueFieldDefinitionNamesRule=PB;var HI=K(),Lh=ie();function PB(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 p=u[l],f=p.name.value;DB(r[a],f)?e.reportError(new HI.GraphQLError('Field "'.concat(a,".").concat(f,'" already exists in the schema. It cannot also be defined in this type extension.'),p.name)):c[f]?e.reportError(new HI.GraphQLError('Field "'.concat(a,".").concat(f,'" can only be defined once.'),[c[f],p.name])):c[f]=p.name}return!1}}function DB(e,t){return(0,Lh.isObjectType)(e)||(0,Lh.isInterfaceType)(e)||(0,Lh.isInputObjectType)(e)?e.getFields()[t]!=null:!1}});var Fh=y(Mh=>{"use strict";d();Object.defineProperty(Mh,"__esModule",{value:!0});Mh.UniqueDirectiveNamesRule=LB;var QI=K();function LB(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 QI.GraphQLError('Directive "@'.concat(o,'" already exists in the schema. It cannot be redefined.'),i.name));return}return t[o]?e.reportError(new QI.GraphQLError('There can be only one directive named "@'.concat(o,'".'),[t[o],i.name])):t[o]=i.name,!1}}}});var Uh=y(qh=>{"use strict";d();Object.defineProperty(qh,"__esModule",{value:!0});qh.PossibleTypeExtensionsRule=FB;var zI=ic(ae()),YI=ic(et()),kB=ic(Qr()),jB=ic(Wr()),WI=K(),Ae=Ee(),MB=Mn(),Di=ie(),rn;function ic(e){return e&&e.__esModule?e:{default:e}}function Li(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function FB(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,MB.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),p;if(c?p=qB[c.kind]:l&&(p=UB(l)),p){if(p!==a.kind){var f=VB(a.kind);e.reportError(new WI.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,jB.default)(u,h);e.reportError(new WI.GraphQLError('Cannot extend type "'.concat(u,'" because it is not defined.')+(0,kB.default)(g),a.name))}}}var qB=(rn={},Li(rn,Ae.Kind.SCALAR_TYPE_DEFINITION,Ae.Kind.SCALAR_TYPE_EXTENSION),Li(rn,Ae.Kind.OBJECT_TYPE_DEFINITION,Ae.Kind.OBJECT_TYPE_EXTENSION),Li(rn,Ae.Kind.INTERFACE_TYPE_DEFINITION,Ae.Kind.INTERFACE_TYPE_EXTENSION),Li(rn,Ae.Kind.UNION_TYPE_DEFINITION,Ae.Kind.UNION_TYPE_EXTENSION),Li(rn,Ae.Kind.ENUM_TYPE_DEFINITION,Ae.Kind.ENUM_TYPE_EXTENSION),Li(rn,Ae.Kind.INPUT_OBJECT_TYPE_DEFINITION,Ae.Kind.INPUT_OBJECT_TYPE_EXTENSION),rn);function UB(e){if((0,Di.isScalarType)(e))return Ae.Kind.SCALAR_TYPE_EXTENSION;if((0,Di.isObjectType)(e))return Ae.Kind.OBJECT_TYPE_EXTENSION;if((0,Di.isInterfaceType)(e))return Ae.Kind.INTERFACE_TYPE_EXTENSION;if((0,Di.isUnionType)(e))return Ae.Kind.UNION_TYPE_EXTENSION;if((0,Di.isEnumType)(e))return Ae.Kind.ENUM_TYPE_EXTENSION;if((0,Di.isInputObjectType)(e))return Ae.Kind.INPUT_OBJECT_TYPE_EXTENSION;(0,YI.default)(0,"Unexpected type: "+(0,zI.default)(e))}function VB(e){switch(e){case Ae.Kind.SCALAR_TYPE_EXTENSION:return"scalar";case Ae.Kind.OBJECT_TYPE_EXTENSION:return"object";case Ae.Kind.INTERFACE_TYPE_EXTENSION:return"interface";case Ae.Kind.UNION_TYPE_EXTENSION:return"union";case Ae.Kind.ENUM_TYPE_EXTENSION:return"enum";case Ae.Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object"}(0,YI.default)(0,"Unexpected kind: "+(0,zI.default)(e))}});var Vh=y(nn=>{"use strict";d();Object.defineProperty(nn,"__esModule",{value:!0});nn.specifiedSDLRules=nn.specifiedRules=nn.recommendedRules=void 0;var GB=_f(),$B=bf(),BB=If(),KB=wf(),JI=Rf(),HB=Cf(),QB=Df(),WB=kf(),zB=Mf(),YB=qf(),JB=Vf(),XB=$f(),ZB=Hf(),eK=Wf(),tK=Yf(),rK=Xf(),nK=eh(),XI=rh(),ZI=oh(),eO=sh(),tO=uh(),iK=lh(),rO=ph(),oK=hh(),sK=Sh(),nO=Th(),aK=Oh(),uK=Ah(),cK=Rh(),lK=Ch(),dK=Dh(),pK=jh(),fK=Fh(),hK=Uh(),iO=Object.freeze([aK.MaxIntrospectionDepthRule]);nn.recommendedRules=iO;var mK=Object.freeze([GB.ExecutableDefinitionsRule,$B.UniqueOperationNamesRule,BB.LoneAnonymousOperationRule,KB.SingleFieldSubscriptionsRule,JI.KnownTypeNamesRule,HB.FragmentsOnCompositeTypesRule,QB.VariablesAreInputTypesRule,WB.ScalarLeafsRule,zB.FieldsOnCorrectTypeRule,YB.UniqueFragmentNamesRule,JB.KnownFragmentNamesRule,XB.NoUnusedFragmentsRule,ZB.PossibleFragmentSpreadsRule,eK.NoFragmentCyclesRule,tK.UniqueVariableNamesRule,rK.NoUndefinedVariablesRule,nK.NoUnusedVariablesRule,XI.KnownDirectivesRule,ZI.UniqueDirectivesPerLocationRule,eO.KnownArgumentNamesRule,tO.UniqueArgumentNamesRule,iK.ValuesOfCorrectTypeRule,rO.ProvidedRequiredArgumentsRule,oK.VariablesInAllowedPositionRule,sK.OverlappingFieldsCanBeMergedRule,nO.UniqueInputFieldNamesRule].concat(iO));nn.specifiedRules=mK;var gK=Object.freeze([uK.LoneSchemaDefinitionRule,cK.UniqueOperationTypesRule,lK.UniqueTypeNamesRule,dK.UniqueEnumValueNamesRule,pK.UniqueFieldDefinitionNamesRule,fK.UniqueDirectiveNamesRule,JI.KnownTypeNamesRule,XI.KnownDirectivesRule,ZI.UniqueDirectivesPerLocationRule,hK.PossibleTypeExtensionsRule,eO.KnownArgumentNamesOnDirectivesRule,tO.UniqueArgumentNamesRule,nO.UniqueInputFieldNamesRule,rO.ProvidedRequiredArgumentsOnDirectivesRule]);nn.specifiedSDLRules=gK});var $h=y(on=>{"use strict";d();Object.defineProperty(on,"__esModule",{value:!0});on.ValidationContext=on.SDLValidationContext=on.ASTValidationContext=void 0;var oO=Ee(),yK=Kr(),sO=Wu();function aO(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Gh=(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===oO.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===oO.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],p=l.name.value;if(o[p]!==!0){o[p]=!0;var f=this.getFragment(p);f&&(i.push(f),s.push(f.selectionSet))}}this._recursivelyReferencedFragments.set(n,i)}return i},e})();on.ASTValidationContext=Gh;var vK=(function(e){aO(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})(Gh);on.SDLValidationContext=vK;var EK=(function(e){aO(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 sO.TypeInfo(this._schema);(0,yK.visit)(i,(0,sO.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})(Gh);on.ValidationContext=EK});var ji=y(ki=>{"use strict";d();Object.defineProperty(ki,"__esModule",{value:!0});ki.validate=IK;ki.validateSDL=Bh;ki.assertValidSDL=OK;ki.assertValidSDLExtension=wK;var _K=TK(jt()),SK=K(),oc=Kr(),bK=cs(),uO=Wu(),cO=Vh(),lO=$h();function TK(e){return e&&e.__esModule?e:{default:e}}function IK(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:cO.specifiedRules,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new uO.TypeInfo(e),i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{maxErrors:void 0};t||(0,_K.default)(0,"Must provide document."),(0,bK.assertValidSchema)(e);var o=Object.freeze({}),s=[],a=new lO.ValidationContext(e,t,n,function(c){if(i.maxErrors!=null&&s.length>=i.maxErrors)throw s.push(new SK.GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),o;s.push(c)}),u=(0,oc.visitInParallel)(r.map(function(c){return c(a)}));try{(0,oc.visit)(t,(0,uO.visitWithTypeInfo)(n,u))}catch(c){if(c!==o)throw c}return s}function Bh(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:cO.specifiedSDLRules,n=[],i=new lO.SDLValidationContext(e,t,function(s){n.push(s)}),o=r.map(function(s){return s(i)});return(0,oc.visit)(e,(0,oc.visitInParallel)(o)),n}function OK(e){var t=Bh(e);if(t.length!==0)throw new Error(t.map(function(r){return r.message}).join(`
|
|
76
|
-
|
|
77
|
-
`))}function wK(e,t){var r=Bh(e,t);if(r.length!==0)throw new Error(r.map(function(n){return n.message}).join(`
|
|
78
|
-
|
|
79
|
-
`))}});var dO=y(Kh=>{"use strict";d();Object.defineProperty(Kh,"__esModule",{value:!0});Kh.default=AK;function AK(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 pO=y(Hh=>{"use strict";d();Object.defineProperty(Hh,"__esModule",{value:!0});Hh.default=NK;var xK=RK(ru());function RK(e){return e&&e.__esModule?e:{default:e}}function NK(e,t,r){return e.reduce(function(n,i){return(0,xK.default)(n)?n.then(function(o){return t(o,i)}):t(n,i)},r)}});var fO=y(Qh=>{"use strict";d();Object.defineProperty(Qh,"__esModule",{value:!0});Qh.default=CK;function CK(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 hs=y(sc=>{"use strict";d();Object.defineProperty(sc,"__esModule",{value:!0});sc.addPath=PK;sc.pathToArray=DK;function PK(e,t,r){return{prev:e,key:t,typename:r}}function DK(e){for(var t=[],r=e;r;)t.push(r.key),r=r.prev;return t.reverse()}});var uc=y(Wh=>{"use strict";d();Object.defineProperty(Wh,"__esModule",{value:!0});Wh.getOperationRootType=LK;var ac=K();function LK(e,t){if(t.operation==="query"){var r=e.getQueryType();if(!r)throw new ac.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 ac.GraphQLError("Schema is not configured for mutations.",t);return n}if(t.operation==="subscription"){var i=e.getSubscriptionType();if(!i)throw new ac.GraphQLError("Schema is not configured for subscriptions.",t);return i}throw new ac.GraphQLError("Can only have query, mutation and subscription operations.",t)}});var Yh=y(zh=>{"use strict";d();Object.defineProperty(zh,"__esModule",{value:!0});zh.default=kK;function kK(e){return e.map(function(t){return typeof t=="number"?"["+t.toString()+"]":"."+t}).join("")}});var gs=y(Jh=>{"use strict";d();Object.defineProperty(Jh,"__esModule",{value:!0});Jh.valueFromAST=ms;var jK=cc(St()),MK=cc(Hr()),FK=cc(ae()),qK=cc(et()),Mi=Ee(),Un=ie();function cc(e){return e&&e.__esModule?e:{default:e}}function ms(e,t,r){if(e){if(e.kind===Mi.Kind.VARIABLE){var n=e.name.value;if(r==null||r[n]===void 0)return;var i=r[n];return i===null&&(0,Un.isNonNullType)(t)?void 0:i}if((0,Un.isNonNullType)(t))return e.kind===Mi.Kind.NULL?void 0:ms(e,t.ofType,r);if(e.kind===Mi.Kind.NULL)return null;if((0,Un.isListType)(t)){var o=t.ofType;if(e.kind===Mi.Kind.LIST){for(var s=[],a=0,u=e.values;a<u.length;a++){var c=u[a];if(hO(c,r)){if((0,Un.isNonNullType)(o))return;s.push(null)}else{var l=ms(c,o,r);if(l===void 0)return;s.push(l)}}return s}var p=ms(e,o,r);return p===void 0?void 0:[p]}if((0,Un.isInputObjectType)(t)){if(e.kind!==Mi.Kind.OBJECT)return;for(var f=Object.create(null),h=(0,MK.default)(e.fields,function(A){return A.name.value}),g=0,v=(0,jK.default)(t.getFields());g<v.length;g++){var _=v[g],b=h[_.name];if(!b||hO(b.value,r)){if(_.defaultValue!==void 0)f[_.name]=_.defaultValue;else if((0,Un.isNonNullType)(_.type))return;continue}var S=ms(b.value,_.type,r);if(S===void 0)return;f[_.name]=S}return f}if((0,Un.isLeafType)(t)){var I;try{I=t.parseLiteral(e,r)}catch{return}return I===void 0?void 0:I}(0,qK.default)(0,"Unexpected input type: "+(0,FK.default)(t))}}function hO(e,t){return e.kind===Mi.Kind.VARIABLE&&(t==null||t[e.name.value]===void 0)}});var Zh=y(Xh=>{"use strict";d();Object.defineProperty(Xh,"__esModule",{value:!0});Xh.coerceInputValue=zK;var UK=sn(St()),lc=sn(ae()),VK=sn(et()),GK=sn(Qr()),$K=sn(ar()),BK=sn(qu()),KK=sn(Wr()),HK=sn(Yh()),Ir=hs(),Vn=K(),ys=ie();function sn(e){return e&&e.__esModule?e:{default:e}}function mO(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 QK(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mO(Object(r),!0).forEach(function(n){WK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function WK(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zK(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:YK;return vs(e,t,r)}function YK(e,t,r){var n="Invalid value "+(0,lc.default)(t);throw e.length>0&&(n+=' at "value'.concat((0,HK.default)(e),'"')),r.message=n+": "+r.message,r}function vs(e,t,r,n){if((0,ys.isNonNullType)(t)){if(e!=null)return vs(e,t.ofType,r,n);r((0,Ir.pathToArray)(n),e,new Vn.GraphQLError('Expected non-nullable type "'.concat((0,lc.default)(t),'" not to be null.')));return}if(e==null)return null;if((0,ys.isListType)(t)){var i=t.ofType,o=(0,BK.default)(e,function(S,I){var A=(0,Ir.addPath)(n,I,void 0);return vs(S,i,r,A)});return o??[vs(e,i,r,n)]}if((0,ys.isInputObjectType)(t)){if(!(0,$K.default)(e)){r((0,Ir.pathToArray)(n),e,new Vn.GraphQLError('Expected type "'.concat(t.name,'" to be an object.')));return}for(var s=Object.create(null),a=t.getFields(),u=0,c=(0,UK.default)(a);u<c.length;u++){var l=c[u],p=e[l.name];if(p===void 0){if(l.defaultValue!==void 0)s[l.name]=l.defaultValue;else if((0,ys.isNonNullType)(l.type)){var f=(0,lc.default)(l.type);r((0,Ir.pathToArray)(n),e,new Vn.GraphQLError('Field "'.concat(l.name,'" of required type "').concat(f,'" was not provided.')))}continue}s[l.name]=vs(p,l.type,r,(0,Ir.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,KK.default)(v,Object.keys(t.getFields()));r((0,Ir.pathToArray)(n),e,new Vn.GraphQLError('Field "'.concat(v,'" is not defined by type "').concat(t.name,'".')+(0,GK.default)(_)))}}return QK({},s)}if((0,ys.isLeafType)(t)){var b;try{b=t.parseValue(e)}catch(S){S instanceof Vn.GraphQLError?r((0,Ir.pathToArray)(n),e,S):r((0,Ir.pathToArray)(n),e,new Vn.GraphQLError('Expected type "'.concat(t.name,'". ')+S.message,void 0,void 0,void 0,void 0,S));return}return b===void 0&&r((0,Ir.pathToArray)(n),e,new Vn.GraphQLError('Expected type "'.concat(t.name,'".'))),b}(0,VK.default)(0,"Unexpected input type: "+(0,lc.default)(t))}});var _s=y(Es=>{"use strict";d();Object.defineProperty(Es,"__esModule",{value:!0});Es.getVariableValues=nH;Es.getArgumentValues=SO;Es.getDirectiveValues=oH;var JK=dc(Ti()),XK=dc(Hr()),Fi=dc(ae()),ZK=dc(Yh()),Or=K(),gO=Ee(),vO=mt(),qi=ie(),eH=pr(),EO=gs(),tH=Zh();function dc(e){return e&&e.__esModule?e:{default:e}}function yO(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 _O(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yO(Object(r),!0).forEach(function(n){rH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nH(e,t,r,n){var i=[],o=n?.maxErrors;try{var s=iH(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 iH(e,t,r,n){for(var i=Object.create(null),o=function(c){var l=t[c],p=l.variable.name.value,f=(0,eH.typeFromAST)(e,l.type);if(!(0,qi.isInputType)(f)){var h=(0,vO.print)(l.type);return n(new Or.GraphQLError('Variable "$'.concat(p,'" expected value of type "').concat(h,'" which cannot be used as an input type.'),l.type)),"continue"}if(!bO(r,p)){if(l.defaultValue)i[p]=(0,EO.valueFromAST)(l.defaultValue,f);else if((0,qi.isNonNullType)(f)){var g=(0,Fi.default)(f);n(new Or.GraphQLError('Variable "$'.concat(p,'" of required type "').concat(g,'" was not provided.'),l))}return"continue"}var v=r[p];if(v===null&&(0,qi.isNonNullType)(f)){var _=(0,Fi.default)(f);return n(new Or.GraphQLError('Variable "$'.concat(p,'" of non-null type "').concat(_,'" must not be null.'),l)),"continue"}i[p]=(0,tH.coerceInputValue)(v,f,function(b,S,I){var A='Variable "$'.concat(p,'" got invalid value ')+(0,Fi.default)(S);b.length>0&&(A+=' at "'.concat(p).concat((0,ZK.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 _O({},i)}function SO(e,t,r){for(var n,i=Object.create(null),o=(n=t.arguments)!==null&&n!==void 0?n:[],s=(0,XK.default)(o,function(b){return b.name.value}),a=0,u=e.args;a<u.length;a++){var c=u[a],l=c.name,p=c.type,f=s[l];if(!f){if(c.defaultValue!==void 0)i[l]=c.defaultValue;else if((0,qi.isNonNullType)(p))throw new Or.GraphQLError('Argument "'.concat(l,'" of required type "').concat((0,Fi.default)(p),'" ')+"was not provided.",t);continue}var h=f.value,g=h.kind===gO.Kind.NULL;if(h.kind===gO.Kind.VARIABLE){var v=h.name.value;if(r==null||!bO(r,v)){if(c.defaultValue!==void 0)i[l]=c.defaultValue;else if((0,qi.isNonNullType)(p))throw new Or.GraphQLError('Argument "'.concat(l,'" of required type "').concat((0,Fi.default)(p),'" ')+'was provided the variable "$'.concat(v,'" which was not provided a runtime value.'),h);continue}g=r[v]==null}if(g&&(0,qi.isNonNullType)(p))throw new Or.GraphQLError('Argument "'.concat(l,'" of non-null type "').concat((0,Fi.default)(p),'" ')+"must not be null.",h);var _=(0,EO.valueFromAST)(h,p,r);if(_===void 0)throw new Or.GraphQLError('Argument "'.concat(l,'" has invalid value ').concat((0,vO.print)(h),"."),h);i[l]=_}return _O({},i)}function oH(e,t,r){var n=t.directives&&(0,JK.default)(t.directives,function(i){return i.name.value===e.name});if(n)return SO(e,n,r)}function bO(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var Is=y(Tt=>{"use strict";d();Object.defineProperty(Tt,"__esModule",{value:!0});Tt.execute=fH;Tt.executeSync=hH;Tt.assertValidExecutionArguments=CO;Tt.buildExecutionContext=PO;Tt.collectFields=bs;Tt.buildResolveInfo=kO;Tt.getFieldDef=FO;Tt.defaultFieldResolver=Tt.defaultTypeResolver=void 0;var Vi=Ar(ae()),sH=Ar(dO()),aH=Ar(et()),TO=Ar(jt()),Ut=Ar(ru()),nm=Ar(ar()),uH=Ar(qu()),cH=Ar(pO()),IO=Ar(fO()),Gn=hs(),hr=K(),pc=Ho(),Ss=Ee(),lH=cs(),Ui=qt(),OO=gt(),wr=ie(),dH=pr(),pH=uc(),fc=_s();function Ar(e){return e&&e.__esModule?e:{default:e}}function fH(e,t,r,n,i,o,s,a){return arguments.length===1?tm(e):tm({schema:e,document:t,rootValue:r,contextValue:n,variableValues:i,operationName:o,fieldResolver:s,typeResolver:a})}function hH(e){var t=tm(e);if((0,Ut.default)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function tm(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;CO(t,r,o);var c=PO(t,r,n,i,o,s,a,u);if(Array.isArray(c))return{errors:c};var l=mH(c,c.operation,n);return NO(c,l)}function NO(e,t){return(0,Ut.default)(t)?t.then(function(r){return NO(e,r)}):e.errors.length===0?{data:t}:{errors:e.errors,data:t}}function CO(e,t,r){t||(0,TO.default)(0,"Must provide document."),(0,lH.assertValidSchema)(e),r==null||(0,nm.default)(r)||(0,TO.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 PO(e,t,r,n,i,o,s,a){for(var u,c,l,p=Object.create(null),f=0,h=t.definitions;f<h.length;f++){var g=h[f];switch(g.kind){case Ss.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 Ss.Kind.FRAGMENT_DEFINITION:p[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,fc.getVariableValues)(e,v,i??{},{maxErrors:50});return _.errors?_.errors:{schema:e,fragments:p,rootValue:r,contextValue:n,operation:l,variableValues:_.coerced,fieldResolver:s??MO,typeResolver:a??jO,errors:[]}}function mH(e,t,r){var n=(0,pH.getOperationRootType)(e.schema,t),i=bs(e,n,t.selectionSet,Object.create(null),Object.create(null)),o=void 0;try{var s=t.operation==="mutation"?gH(e,n,r,o,i):DO(e,n,r,o,i);return(0,Ut.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 gH(e,t,r,n,i){return(0,cH.default)(Object.keys(i),function(o,s){var a=i[s],u=(0,Gn.addPath)(n,s,t.name),c=LO(e,t,r,a,u);return c===void 0?o:(0,Ut.default)(c)?c.then(function(l){return o[s]=l,o}):(o[s]=c,o)},Object.create(null))}function DO(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],p=(0,Gn.addPath)(n,c,t.name),f=LO(e,t,r,l,p);f!==void 0&&(o[c]=f,(0,Ut.default)(f)&&(s=!0))}}catch(h){if(s)return(0,IO.default)(o).finally(function(){throw h});throw h}return s?(0,IO.default)(o):o}function bs(e,t,r,n,i){for(var o=0,s=r.selections;o<s.length;o++){var a=s[o];switch(a.kind){case Ss.Kind.FIELD:{if(!em(e,a))continue;var u=yH(a);n[u]||(n[u]=[]),n[u].push(a);break}case Ss.Kind.INLINE_FRAGMENT:{if(!em(e,a)||!wO(e,a,t))continue;bs(e,t,a.selectionSet,n,i);break}case Ss.Kind.FRAGMENT_SPREAD:{var c=a.name.value;if(i[c]||!em(e,a))continue;i[c]=!0;var l=e.fragments[c];if(!l||!wO(e,l,t))continue;bs(e,t,l.selectionSet,n,i);break}}}return n}function em(e,t){var r=(0,fc.getDirectiveValues)(OO.GraphQLSkipDirective,t,e.variableValues);if(r?.if===!0)return!1;var n=(0,fc.getDirectiveValues)(OO.GraphQLIncludeDirective,t,e.variableValues);return n?.if!==!1}function wO(e,t,r){var n=t.typeCondition;if(!n)return!0;var i=(0,dH.typeFromAST)(e.schema,n);return i===r?!0:(0,wr.isAbstractType)(i)?e.schema.isSubType(i,r):!1}function yH(e){return e.alias?e.alias.value:e.name.value}function LO(e,t,r,n,i){var o,s=n[0],a=s.name.value,u=FO(e.schema,t,a);if(u){var c=u.type,l=(o=u.resolve)!==null&&o!==void 0?o:e.fieldResolver,p=kO(e,u,n,t,i);try{var f=(0,fc.getArgumentValues)(u,n[0],e.variableValues),h=e.contextValue,g=l(r,f,h,p),v;return(0,Ut.default)(g)?v=g.then(function(b){return Ts(e,c,n,p,i,b)}):v=Ts(e,c,n,p,i,g),(0,Ut.default)(v)?v.then(void 0,function(b){var S=(0,pc.locatedError)(b,n,(0,Gn.pathToArray)(i));return hc(S,c,e)}):v}catch(b){var _=(0,pc.locatedError)(b,n,(0,Gn.pathToArray)(i));return hc(_,c,e)}}}function kO(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 hc(e,t,r){if((0,wr.isNonNullType)(t))throw e;return r.errors.push(e),null}function Ts(e,t,r,n,i,o){if(o instanceof Error)throw o;if((0,wr.isNonNullType)(t)){var s=Ts(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,wr.isListType)(t))return vH(e,t,r,n,i,o);if((0,wr.isLeafType)(t))return EH(t,o);if((0,wr.isAbstractType)(t))return _H(e,t,r,n,i,o);if((0,wr.isObjectType)(t))return rm(e,t,r,n,i,o);(0,aH.default)(0,"Cannot complete value of unexpected output type: "+(0,Vi.default)(t))}function vH(e,t,r,n,i,o){var s=t.ofType,a=!1,u=(0,uH.default)(o,function(c,l){var p=(0,Gn.addPath)(i,l,void 0);try{var f;return(0,Ut.default)(c)?f=c.then(function(g){return Ts(e,s,r,n,p,g)}):f=Ts(e,s,r,n,p,c),(0,Ut.default)(f)?(a=!0,f.then(void 0,function(g){var v=(0,pc.locatedError)(g,r,(0,Gn.pathToArray)(p));return hc(v,s,e)})):f}catch(g){var h=(0,pc.locatedError)(g,r,(0,Gn.pathToArray)(p));return hc(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 EH(e,t){var r=e.serialize(t);if(r===void 0)throw new Error('Expected a value of type "'.concat((0,Vi.default)(e),'" but ')+"received: ".concat((0,Vi.default)(t)));return r}function _H(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,Ut.default)(c)?c.then(function(l){return rm(e,AO(l,e,t,r,n,o),r,n,i,o)}):rm(e,AO(c,e,t,r,n,o),r,n,i,o)}function AO(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,wr.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,Vi.default)(o),', received "').concat((0,Vi.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,wr.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 rm(e,t,r,n,i,o){if(t.isTypeOf){var s=t.isTypeOf(o,e.contextValue,n);if((0,Ut.default)(s))return s.then(function(a){if(!a)throw xO(t,o,r);return RO(e,t,r,i,o)});if(!s)throw xO(t,o,r)}return RO(e,t,r,i,o)}function xO(e,t,r){return new hr.GraphQLError('Expected value of type "'.concat(e.name,'" but got: ').concat((0,Vi.default)(t),"."),r)}function RO(e,t,r,n,i){var o=SH(e,t,r);return DO(e,t,i,n,o)}var SH=(0,sH.default)(bH);function bH(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=bs(e,t,s.selectionSet,n,i))}return n}var jO=function(t,r,n,i){if((0,nm.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,Ut.default)(c))s[a]=c;else if(c)return u.name}}if(s.length)return Promise.all(s).then(function(l){for(var p=0;p<l.length;p++)if(l[p])return o[p].name})};Tt.defaultTypeResolver=jO;var MO=function(t,r,n,i){if((0,nm.default)(t)||typeof t=="function"){var o=t[i.fieldName];return typeof o=="function"?t[i.fieldName](r,n,i):o}};Tt.defaultFieldResolver=MO;function FO(e,t,r){return r===Ui.SchemaMetaFieldDef.name&&e.getQueryType()===t?Ui.SchemaMetaFieldDef:r===Ui.TypeMetaFieldDef.name&&e.getQueryType()===t?Ui.TypeMetaFieldDef:r===Ui.TypeNameMetaFieldDef.name?Ui.TypeNameMetaFieldDef:t.getFields()[r]}});var qO=y(gc=>{"use strict";d();Object.defineProperty(gc,"__esModule",{value:!0});gc.graphql=RH;gc.graphqlSync=NH;var TH=xH(ru()),IH=Si(),OH=ji(),wH=cs(),AH=Is();function xH(e){return e&&e.__esModule?e:{default:e}}function RH(e,t,r,n,i,o,s,a){var u=arguments;return new Promise(function(c){return c(u.length===1?mc(e):mc({schema:e,source:t,rootValue:r,contextValue:n,variableValues:i,operationName:o,fieldResolver:s,typeResolver:a}))})}function NH(e,t,r,n,i,o,s,a){var u=arguments.length===1?mc(e):mc({schema:e,source:t,rootValue:r,contextValue:n,variableValues:i,operationName:o,fieldResolver:s,typeResolver:a});if((0,TH.default)(u))throw new Error("GraphQL execution failed to complete synchronously.");return u}function mc(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,wH.validateSchema)(t);if(c.length>0)return{errors:c};var l;try{l=(0,IH.parse)(r)}catch(f){return{errors:[f]}}var p=(0,OH.validate)(t,l);return p.length>0?{errors:p}:(0,AH.execute)({schema:t,document:l,rootValue:n,contextValue:i,variableValues:o,operationName:s,fieldResolver:a,typeResolver:u})}});var VO=y(R=>{"use strict";d();Object.defineProperty(R,"__esModule",{value:!0});Object.defineProperty(R,"isSchema",{enumerable:!0,get:function(){return im.isSchema}});Object.defineProperty(R,"assertSchema",{enumerable:!0,get:function(){return im.assertSchema}});Object.defineProperty(R,"GraphQLSchema",{enumerable:!0,get:function(){return im.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 $n.isSpecifiedScalarType}});Object.defineProperty(R,"specifiedScalarTypes",{enumerable:!0,get:function(){return $n.specifiedScalarTypes}});Object.defineProperty(R,"GraphQLInt",{enumerable:!0,get:function(){return $n.GraphQLInt}});Object.defineProperty(R,"GraphQLFloat",{enumerable:!0,get:function(){return $n.GraphQLFloat}});Object.defineProperty(R,"GraphQLString",{enumerable:!0,get:function(){return $n.GraphQLString}});Object.defineProperty(R,"GraphQLBoolean",{enumerable:!0,get:function(){return $n.GraphQLBoolean}});Object.defineProperty(R,"GraphQLID",{enumerable:!0,get:function(){return $n.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 UO.validateSchema}});Object.defineProperty(R,"assertValidSchema",{enumerable:!0,get:function(){return UO.assertValidSchema}});var im=kn(),W=ie(),mr=gt(),$n=dr(),vt=qt(),UO=cs()});var BO=y(ve=>{"use strict";d();Object.defineProperty(ve,"__esModule",{value:!0});Object.defineProperty(ve,"Source",{enumerable:!0,get:function(){return CH.Source}});Object.defineProperty(ve,"getLocation",{enumerable:!0,get:function(){return PH.getLocation}});Object.defineProperty(ve,"printLocation",{enumerable:!0,get:function(){return GO.printLocation}});Object.defineProperty(ve,"printSourceLocation",{enumerable:!0,get:function(){return GO.printSourceLocation}});Object.defineProperty(ve,"Kind",{enumerable:!0,get:function(){return DH.Kind}});Object.defineProperty(ve,"TokenKind",{enumerable:!0,get:function(){return LH.TokenKind}});Object.defineProperty(ve,"Lexer",{enumerable:!0,get:function(){return kH.Lexer}});Object.defineProperty(ve,"parse",{enumerable:!0,get:function(){return om.parse}});Object.defineProperty(ve,"parseValue",{enumerable:!0,get:function(){return om.parseValue}});Object.defineProperty(ve,"parseType",{enumerable:!0,get:function(){return om.parseType}});Object.defineProperty(ve,"print",{enumerable:!0,get:function(){return jH.print}});Object.defineProperty(ve,"visit",{enumerable:!0,get:function(){return yc.visit}});Object.defineProperty(ve,"visitInParallel",{enumerable:!0,get:function(){return yc.visitInParallel}});Object.defineProperty(ve,"getVisitFn",{enumerable:!0,get:function(){return yc.getVisitFn}});Object.defineProperty(ve,"BREAK",{enumerable:!0,get:function(){return yc.BREAK}});Object.defineProperty(ve,"Location",{enumerable:!0,get:function(){return $O.Location}});Object.defineProperty(ve,"Token",{enumerable:!0,get:function(){return $O.Token}});Object.defineProperty(ve,"isDefinitionNode",{enumerable:!0,get:function(){return xr.isDefinitionNode}});Object.defineProperty(ve,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return xr.isExecutableDefinitionNode}});Object.defineProperty(ve,"isSelectionNode",{enumerable:!0,get:function(){return xr.isSelectionNode}});Object.defineProperty(ve,"isValueNode",{enumerable:!0,get:function(){return xr.isValueNode}});Object.defineProperty(ve,"isTypeNode",{enumerable:!0,get:function(){return xr.isTypeNode}});Object.defineProperty(ve,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return xr.isTypeSystemDefinitionNode}});Object.defineProperty(ve,"isTypeDefinitionNode",{enumerable:!0,get:function(){return xr.isTypeDefinitionNode}});Object.defineProperty(ve,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return xr.isTypeSystemExtensionNode}});Object.defineProperty(ve,"isTypeExtensionNode",{enumerable:!0,get:function(){return xr.isTypeExtensionNode}});Object.defineProperty(ve,"DirectiveLocation",{enumerable:!0,get:function(){return MH.DirectiveLocation}});var CH=vu(),PH=iu(),GO=cp(),DH=Ee(),LH=vi(),kH=Su(),om=Si(),jH=mt(),yc=Kr(),$O=yi(),xr=Mn(),MH=Ei()});var KO=y(an=>{"use strict";d();Object.defineProperty(an,"__esModule",{value:!0});Object.defineProperty(an,"responsePathAsArray",{enumerable:!0,get:function(){return FH.pathToArray}});Object.defineProperty(an,"execute",{enumerable:!0,get:function(){return vc.execute}});Object.defineProperty(an,"executeSync",{enumerable:!0,get:function(){return vc.executeSync}});Object.defineProperty(an,"defaultFieldResolver",{enumerable:!0,get:function(){return vc.defaultFieldResolver}});Object.defineProperty(an,"defaultTypeResolver",{enumerable:!0,get:function(){return vc.defaultTypeResolver}});Object.defineProperty(an,"getDirectiveValues",{enumerable:!0,get:function(){return qH.getDirectiveValues}});var FH=hs(),vc=Is(),qH=_s()});var HO=y(sm=>{"use strict";d();Object.defineProperty(sm,"__esModule",{value:!0});sm.default=VH;var UH=ur();function VH(e){return typeof e?.[UH.SYMBOL_ASYNC_ITERATOR]=="function"}});var YO=y(am=>{"use strict";d();Object.defineProperty(am,"__esModule",{value:!0});am.default=$H;var QO=ur();function GH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $H(e,t,r){var n=e[QO.SYMBOL_ASYNC_ITERATOR],i=n.call(e),o,s;typeof i.return=="function"&&(o=i.return,s=function(p){var f=function(){return Promise.reject(p)};return o.call(i).then(f,f)});function a(l){return l.done?l:WO(l.value,t).then(zO,s)}var u;if(r){var c=r;u=function(p){return WO(p,c).then(zO,s)}}return GH({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(p){return typeof i.throw=="function"?i.throw(p).then(a,u):Promise.reject(p).catch(s)}},QO.SYMBOL_ASYNC_ITERATOR,function(){return this})}function WO(e,t){return new Promise(function(r){return r(t(e))})}function zO(e){return{value:e,done:!1}}});var nw=y(Ec=>{"use strict";d();Object.defineProperty(Ec,"__esModule",{value:!0});Ec.subscribe=WH;Ec.createSourceEventStream=rw;var BH=cm(ae()),ZO=cm(HO()),um=hs(),ew=K(),JO=Ho(),KH=_s(),Gi=Is(),HH=uc(),QH=cm(YO());function cm(e){return e&&e.__esModule?e:{default:e}}function WH(e,t,r,n,i,o,s,a){return arguments.length===1?XO(e):XO({schema:e,document:t,rootValue:r,contextValue:n,variableValues:i,operationName:o,fieldResolver:s,subscribeFieldResolver:a})}function tw(e){if(e instanceof ew.GraphQLError)return{errors:[e]};throw e}function XO(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=rw(t,r,n,i,o,s,u),l=function(f){return(0,Gi.execute)({schema:t,document:r,rootValue:f,contextValue:i,variableValues:o,operationName:s,fieldResolver:a})};return c.then(function(p){return(0,ZO.default)(p)?(0,QH.default)(p,l,tw):p})}function rw(e,t,r,n,i,o,s){return(0,Gi.assertValidExecutionArguments)(e,t,i),new Promise(function(a){var u=(0,Gi.buildExecutionContext)(e,t,r,n,i,o,s);a(Array.isArray(u)?{errors:u}:zH(u))}).catch(tw)}function zH(e){var t=e.schema,r=e.operation,n=e.variableValues,i=e.rootValue,o=(0,HH.getOperationRootType)(t,r),s=(0,Gi.collectFields)(e,o,r.selectionSet,Object.create(null),Object.create(null)),a=Object.keys(s),u=a[0],c=s[u],l=c[0],p=l.name.value,f=(0,Gi.getFieldDef)(t,o,p);if(!f)throw new ew.GraphQLError('The subscription field "'.concat(p,'" is not defined.'),c);var h=(0,um.addPath)(void 0,u,o.name),g=(0,Gi.buildResolveInfo)(e,f,c,o,h);return new Promise(function(v){var _,b=(0,KH.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,JO.locatedError)(v,c,(0,um.pathToArray)(h));if(!(0,ZO.default)(v))throw new Error("Subscription field must return Async Iterable. "+"Received: ".concat((0,BH.default)(v),"."));return v},function(v){throw(0,JO.locatedError)(v,c,(0,um.pathToArray)(h))})}});var ow=y(_c=>{"use strict";d();Object.defineProperty(_c,"__esModule",{value:!0});Object.defineProperty(_c,"subscribe",{enumerable:!0,get:function(){return iw.subscribe}});Object.defineProperty(_c,"createSourceEventStream",{enumerable:!0,get:function(){return iw.createSourceEventStream}});var iw=nw()});var fm=y(pm=>{"use strict";d();Object.defineProperty(pm,"__esModule",{value:!0});pm.NoDeprecatedCustomRule=JH;var lm=YH(et()),Os=K(),dm=ie();function YH(e){return e&&e.__esModule?e:{default:e}}function JH(e){return{Field:function(r){var n=e.getFieldDef(),i=n?.deprecationReason;if(n&&i!=null){var o=e.getParentType();o!=null||(0,lm.default)(0),e.reportError(new Os.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 Os.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,lm.default)(0),e.reportError(new Os.GraphQLError('Field "'.concat(s.name,".").concat(a.name,'" argument "').concat(n.name,'" is deprecated. ').concat(i),r))}}},ObjectField:function(r){var n=(0,dm.getNamedType)(e.getParentInputType());if((0,dm.isInputObjectType)(n)){var i=n.getFields()[r.name.value],o=i?.deprecationReason;o!=null&&e.reportError(new Os.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,dm.getNamedType)(e.getInputType());o!=null||(0,lm.default)(0),e.reportError(new Os.GraphQLError('The enum value "'.concat(o.name,".").concat(n.name,'" is deprecated. ').concat(i),r))}}}}});var sw=y(hm=>{"use strict";d();Object.defineProperty(hm,"__esModule",{value:!0});hm.NoSchemaIntrospectionCustomRule=tQ;var XH=K(),ZH=ie(),eQ=qt();function tQ(e){return{Field:function(r){var n=(0,ZH.getNamedType)(e.getType());n&&(0,eQ.isIntrospectionType)(n)&&e.reportError(new XH.GraphQLError('GraphQL introspection has been disabled, but the requested query contained the field "'.concat(r.name.value,'".'),r))}}}});var uw=y(Y=>{"use strict";d();Object.defineProperty(Y,"__esModule",{value:!0});Object.defineProperty(Y,"validate",{enumerable:!0,get:function(){return rQ.validate}});Object.defineProperty(Y,"ValidationContext",{enumerable:!0,get:function(){return nQ.ValidationContext}});Object.defineProperty(Y,"specifiedRules",{enumerable:!0,get:function(){return aw.specifiedRules}});Object.defineProperty(Y,"recommendedRules",{enumerable:!0,get:function(){return aw.recommendedRules}});Object.defineProperty(Y,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return iQ.ExecutableDefinitionsRule}});Object.defineProperty(Y,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return oQ.FieldsOnCorrectTypeRule}});Object.defineProperty(Y,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return sQ.FragmentsOnCompositeTypesRule}});Object.defineProperty(Y,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return aQ.KnownArgumentNamesRule}});Object.defineProperty(Y,"KnownDirectivesRule",{enumerable:!0,get:function(){return uQ.KnownDirectivesRule}});Object.defineProperty(Y,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return cQ.KnownFragmentNamesRule}});Object.defineProperty(Y,"KnownTypeNamesRule",{enumerable:!0,get:function(){return lQ.KnownTypeNamesRule}});Object.defineProperty(Y,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return dQ.LoneAnonymousOperationRule}});Object.defineProperty(Y,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return pQ.NoFragmentCyclesRule}});Object.defineProperty(Y,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return fQ.NoUndefinedVariablesRule}});Object.defineProperty(Y,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return hQ.NoUnusedFragmentsRule}});Object.defineProperty(Y,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return mQ.NoUnusedVariablesRule}});Object.defineProperty(Y,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return gQ.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(Y,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return yQ.PossibleFragmentSpreadsRule}});Object.defineProperty(Y,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return vQ.ProvidedRequiredArgumentsRule}});Object.defineProperty(Y,"ScalarLeafsRule",{enumerable:!0,get:function(){return EQ.ScalarLeafsRule}});Object.defineProperty(Y,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return _Q.SingleFieldSubscriptionsRule}});Object.defineProperty(Y,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return SQ.UniqueArgumentNamesRule}});Object.defineProperty(Y,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return bQ.UniqueDirectivesPerLocationRule}});Object.defineProperty(Y,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return TQ.UniqueFragmentNamesRule}});Object.defineProperty(Y,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return IQ.UniqueInputFieldNamesRule}});Object.defineProperty(Y,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return OQ.UniqueOperationNamesRule}});Object.defineProperty(Y,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return wQ.UniqueVariableNamesRule}});Object.defineProperty(Y,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return AQ.ValuesOfCorrectTypeRule}});Object.defineProperty(Y,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return xQ.VariablesAreInputTypesRule}});Object.defineProperty(Y,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return RQ.VariablesInAllowedPositionRule}});Object.defineProperty(Y,"MaxIntrospectionDepthRule",{enumerable:!0,get:function(){return NQ.MaxIntrospectionDepthRule}});Object.defineProperty(Y,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return CQ.LoneSchemaDefinitionRule}});Object.defineProperty(Y,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return PQ.UniqueOperationTypesRule}});Object.defineProperty(Y,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return DQ.UniqueTypeNamesRule}});Object.defineProperty(Y,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return LQ.UniqueEnumValueNamesRule}});Object.defineProperty(Y,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return kQ.UniqueFieldDefinitionNamesRule}});Object.defineProperty(Y,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return jQ.UniqueDirectiveNamesRule}});Object.defineProperty(Y,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return MQ.PossibleTypeExtensionsRule}});Object.defineProperty(Y,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return FQ.NoDeprecatedCustomRule}});Object.defineProperty(Y,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return qQ.NoSchemaIntrospectionCustomRule}});var rQ=ji(),nQ=$h(),aw=Vh(),iQ=_f(),oQ=Mf(),sQ=Cf(),aQ=sh(),uQ=rh(),cQ=Vf(),lQ=Rf(),dQ=If(),pQ=Wf(),fQ=Xf(),hQ=$f(),mQ=eh(),gQ=Sh(),yQ=Hf(),vQ=ph(),EQ=kf(),_Q=wf(),SQ=uh(),bQ=oh(),TQ=qf(),IQ=Th(),OQ=bf(),wQ=Yf(),AQ=lh(),xQ=Df(),RQ=hh(),NQ=Oh(),CQ=Ah(),PQ=Rh(),DQ=Ch(),LQ=Dh(),kQ=jh(),jQ=Fh(),MQ=Uh(),FQ=fm(),qQ=sw()});var cw=y(mm=>{"use strict";d();Object.defineProperty(mm,"__esModule",{value:!0});Object.defineProperty(mm,"formatError",{enumerable:!0,get:function(){return UQ.formatError}});var UQ=K()});var dw=y(Bn=>{"use strict";d();Object.defineProperty(Bn,"__esModule",{value:!0});Object.defineProperty(Bn,"GraphQLError",{enumerable:!0,get:function(){return lw.GraphQLError}});Object.defineProperty(Bn,"printError",{enumerable:!0,get:function(){return lw.printError}});Object.defineProperty(Bn,"syntaxError",{enumerable:!0,get:function(){return VQ.syntaxError}});Object.defineProperty(Bn,"locatedError",{enumerable:!0,get:function(){return GQ.locatedError}});Object.defineProperty(Bn,"formatError",{enumerable:!0,get:function(){return $Q.formatError}});var lw=K(),VQ=cu(),GQ=Ho(),$Q=cw()});var ym=y(gm=>{"use strict";d();Object.defineProperty(gm,"__esModule",{value:!0});gm.getIntrospectionQuery=HQ;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 BQ(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){KQ(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 KQ(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HQ(e){var t=BQ({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
|
-
query IntrospectionQuery {
|
|
81
|
-
__schema {
|
|
82
|
-
`.concat(o,`
|
|
83
|
-
queryType { name }
|
|
84
|
-
mutationType { name }
|
|
85
|
-
subscriptionType { name }
|
|
86
|
-
types {
|
|
87
|
-
...FullType
|
|
88
|
-
}
|
|
89
|
-
directives {
|
|
90
|
-
name
|
|
91
|
-
`).concat(r,`
|
|
92
|
-
`).concat(i,`
|
|
93
|
-
locations
|
|
94
|
-
args`).concat(s("(includeDeprecated: true)"),` {
|
|
95
|
-
...InputValue
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
fragment FullType on __Type {
|
|
102
|
-
kind
|
|
103
|
-
name
|
|
104
|
-
`).concat(r,`
|
|
105
|
-
`).concat(n,`
|
|
106
|
-
fields(includeDeprecated: true) {
|
|
107
|
-
name
|
|
108
|
-
`).concat(r,`
|
|
109
|
-
args`).concat(s("(includeDeprecated: true)"),` {
|
|
110
|
-
...InputValue
|
|
111
|
-
}
|
|
112
|
-
type {
|
|
113
|
-
...TypeRef
|
|
114
|
-
}
|
|
115
|
-
isDeprecated
|
|
116
|
-
deprecationReason
|
|
117
|
-
}
|
|
118
|
-
inputFields`).concat(s("(includeDeprecated: true)"),` {
|
|
119
|
-
...InputValue
|
|
120
|
-
}
|
|
121
|
-
interfaces {
|
|
122
|
-
...TypeRef
|
|
123
|
-
}
|
|
124
|
-
enumValues(includeDeprecated: true) {
|
|
125
|
-
name
|
|
126
|
-
`).concat(r,`
|
|
127
|
-
isDeprecated
|
|
128
|
-
deprecationReason
|
|
129
|
-
}
|
|
130
|
-
possibleTypes {
|
|
131
|
-
...TypeRef
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
fragment InputValue on __InputValue {
|
|
136
|
-
name
|
|
137
|
-
`).concat(r,`
|
|
138
|
-
type { ...TypeRef }
|
|
139
|
-
defaultValue
|
|
140
|
-
`).concat(s("isDeprecated"),`
|
|
141
|
-
`).concat(s("deprecationReason"),`
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
fragment TypeRef on __Type {
|
|
145
|
-
kind
|
|
146
|
-
name
|
|
147
|
-
ofType {
|
|
148
|
-
kind
|
|
149
|
-
name
|
|
150
|
-
ofType {
|
|
151
|
-
kind
|
|
152
|
-
name
|
|
153
|
-
ofType {
|
|
154
|
-
kind
|
|
155
|
-
name
|
|
156
|
-
ofType {
|
|
157
|
-
kind
|
|
158
|
-
name
|
|
159
|
-
ofType {
|
|
160
|
-
kind
|
|
161
|
-
name
|
|
162
|
-
ofType {
|
|
163
|
-
kind
|
|
164
|
-
name
|
|
165
|
-
ofType {
|
|
166
|
-
kind
|
|
167
|
-
name
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
`)}});var Em=y(vm=>{"use strict";d();Object.defineProperty(vm,"__esModule",{value:!0});vm.getOperationAST=WQ;var QQ=Ee();function WQ(e,t){for(var r=null,n=0,i=e.definitions;n<i.length;n++){var o=i[n];if(o.kind===QQ.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 hw=y(_m=>{"use strict";d();Object.defineProperty(_m,"__esModule",{value:!0});_m.introspectionFromSchema=rW;var zQ=ZQ(et()),YQ=Si(),JQ=Is(),XQ=ym();function ZQ(e){return e&&e.__esModule?e:{default:e}}function fw(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 eW(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fw(Object(r),!0).forEach(function(n){tW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rW(e,t){var r=eW({specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0},t),n=(0,YQ.parse)((0,XQ.getIntrospectionQuery)(r)),i=(0,JQ.executeSync)({schema:e,document:n});return!i.errors&&i.data||(0,zQ.default)(0),i.data}});var gw=y(Sm=>{"use strict";d();Object.defineProperty(Sm,"__esModule",{value:!0});Sm.buildClientSchema=lW;var nW=ws(St()),It=ws(ae()),iW=ws(jt()),Sc=ws(Qo()),mw=ws(ar()),oW=Si(),sW=kn(),aW=gt(),uW=dr(),gr=qt(),Ot=ie(),cW=gs();function ws(e){return e&&e.__esModule?e:{default:e}}function lW(e,t){(0,mw.default)(e)&&(0,mw.default)(e.__schema)||(0,iW.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,It.default)(e),"."));for(var r=e.__schema,n=(0,Sc.default)(r.types,function(O){return O.name},function(O){return v(O)}),i=0,o=[].concat(uW.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(ge):[];return new sW.GraphQLSchema({description:r.description,query:a,mutation:u,subscription:c,types:(0,nW.default)(n),directives:l,assumeValid:t?.assumeValid});function p(O){if(O.kind===gr.TypeKind.LIST){var ee=O.ofType;if(!ee)throw new Error("Decorated type deeper than introspection query.");return new Ot.GraphQLList(p(ee))}if(O.kind===gr.TypeKind.NON_NULL){var Ne=O.ofType;if(!Ne)throw new Error("Decorated type deeper than introspection query.");var vn=p(Ne);return new Ot.GraphQLNonNull((0,Ot.assertNullableType)(vn))}return f(O)}function f(O){var ee=O.name;if(!ee)throw new Error("Unknown type reference: ".concat((0,It.default)(O),"."));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(O){return(0,Ot.assertObjectType)(f(O))}function g(O){return(0,Ot.assertInterfaceType)(f(O))}function v(O){if(O!=null&&O.name!=null&&O.kind!=null)switch(O.kind){case gr.TypeKind.SCALAR:return _(O);case gr.TypeKind.OBJECT:return S(O);case gr.TypeKind.INTERFACE:return I(O);case gr.TypeKind.UNION:return A(O);case gr.TypeKind.ENUM:return T(O);case gr.TypeKind.INPUT_OBJECT:return D(O)}var ee=(0,It.default)(O);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 _(O){return new Ot.GraphQLScalarType({name:O.name,description:O.description,specifiedByUrl:O.specifiedByUrl})}function b(O){if(O.interfaces===null&&O.kind===gr.TypeKind.INTERFACE)return[];if(!O.interfaces){var ee=(0,It.default)(O);throw new Error("Introspection result missing interfaces: ".concat(ee,"."))}return O.interfaces.map(g)}function S(O){return new Ot.GraphQLObjectType({name:O.name,description:O.description,interfaces:function(){return b(O)},fields:function(){return V(O)}})}function I(O){return new Ot.GraphQLInterfaceType({name:O.name,description:O.description,interfaces:function(){return b(O)},fields:function(){return V(O)}})}function A(O){if(!O.possibleTypes){var ee=(0,It.default)(O);throw new Error("Introspection result missing possibleTypes: ".concat(ee,"."))}return new Ot.GraphQLUnionType({name:O.name,description:O.description,types:function(){return O.possibleTypes.map(h)}})}function T(O){if(!O.enumValues){var ee=(0,It.default)(O);throw new Error("Introspection result missing enumValues: ".concat(ee,"."))}return new Ot.GraphQLEnumType({name:O.name,description:O.description,values:(0,Sc.default)(O.enumValues,function(Ne){return Ne.name},function(Ne){return{description:Ne.description,deprecationReason:Ne.deprecationReason}})})}function D(O){if(!O.inputFields){var ee=(0,It.default)(O);throw new Error("Introspection result missing inputFields: ".concat(ee,"."))}return new Ot.GraphQLInputObjectType({name:O.name,description:O.description,fields:function(){return te(O.inputFields)}})}function V(O){if(!O.fields)throw new Error("Introspection result missing fields: ".concat((0,It.default)(O),"."));return(0,Sc.default)(O.fields,function(ee){return ee.name},x)}function x(O){var ee=p(O.type);if(!(0,Ot.isOutputType)(ee)){var Ne=(0,It.default)(ee);throw new Error("Introspection must provide output type for fields, but received: ".concat(Ne,"."))}if(!O.args){var vn=(0,It.default)(O);throw new Error("Introspection result missing field args: ".concat(vn,"."))}return{description:O.description,deprecationReason:O.deprecationReason,type:ee,args:te(O.args)}}function te(O){return(0,Sc.default)(O,function(ee){return ee.name},de)}function de(O){var ee=p(O.type);if(!(0,Ot.isInputType)(ee)){var Ne=(0,It.default)(ee);throw new Error("Introspection must provide input type for arguments, but received: ".concat(Ne,"."))}var vn=O.defaultValue!=null?(0,cW.valueFromAST)((0,oW.parseValue)(O.defaultValue),ee):void 0;return{description:O.description,type:ee,defaultValue:vn,deprecationReason:O.deprecationReason}}function ge(O){if(!O.args){var ee=(0,It.default)(O);throw new Error("Introspection result missing directive args: ".concat(ee,"."))}if(!O.locations){var Ne=(0,It.default)(O);throw new Error("Introspection result missing directive locations: ".concat(Ne,"."))}return new aW.GraphQLDirective({name:O.name,description:O.description,isRepeatable:O.isRepeatable,locations:O.locations.slice(),args:te(O.args)})}}});var bm=y(xs=>{"use strict";d();Object.defineProperty(xs,"__esModule",{value:!0});xs.extendSchema=vW;xs.extendSchemaImpl=xw;xs.getDescription=Kn;var dW=$i(St()),pW=$i(Hr()),yw=$i(ae()),As=$i(Op()),vw=$i(et()),fW=$i(jt()),Vt=Ee(),hW=vi(),mW=_i(),Ew=Mn(),gW=ji(),Ow=_s(),_w=kn(),ww=dr(),Aw=qt(),Tc=gt(),xe=ie(),Sw=gs();function $i(e){return e&&e.__esModule?e:{default:e}}function bw(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?bw(Object(r),!0).forEach(function(n){yW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function yW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vW(e,t,r){(0,_w.assertSchema)(e),t!=null&&t.kind===Vt.Kind.DOCUMENT||(0,fW.default)(0,"Must provide valid Document AST."),r?.assumeValid!==!0&&r?.assumeValidSDL!==!0&&(0,gW.assertValidSDLExtension)(t,e);var n=e.toConfig(),i=xw(n,t,r);return n===i?e:new _w.GraphQLSchema(i)}function xw(e,t,r){for(var n,i,o,s,a=[],u=Object.create(null),c=[],l,p=[],f=0,h=t.definitions;f<h.length;f++){var g=h[f];if(g.kind===Vt.Kind.SCHEMA_DEFINITION)l=g;else if(g.kind===Vt.Kind.SCHEMA_EXTENSION)p.push(g);else if((0,Ew.isTypeDefinitionNode)(g))a.push(g);else if((0,Ew.isTypeExtensionNode)(g)){var v=g.name.value,_=u[v];u[v]=_?_.concat([g]):[g]}else g.kind===Vt.Kind.DIRECTIVE_DEFINITION&&c.push(g)}if(Object.keys(u).length===0&&a.length===0&&c.length===0&&p.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 D,V=a[T],x=V.name.value;b[x]=(D=Tw[x])!==null&&D!==void 0?D:HP(V)}var te=ce(ce({query:e.query&&ge(e.query),mutation:e.mutation&&ge(e.mutation),subscription:e.subscription&&ge(e.subscription)},l&&Jy([l])),Jy(p));return ce(ce({description:(n=l)===null||n===void 0||(i=n.description)===null||i===void 0?void 0:i.value},te),{},{types:(0,dW.default)(b),directives:[].concat(e.directives.map(O),c.map(KP)),extensions:void 0,astNode:(o=l)!==null&&o!==void 0?o:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(p),assumeValid:(s=r?.assumeValid)!==null&&s!==void 0?s:!1});function de(w){return(0,xe.isListType)(w)?new xe.GraphQLList(de(w.ofType)):(0,xe.isNonNullType)(w)?new xe.GraphQLNonNull(de(w.ofType)):ge(w)}function ge(w){return b[w.name]}function O(w){var G=w.toConfig();return new Tc.GraphQLDirective(ce(ce({},G),{},{args:(0,As.default)(G.args,Yy)}))}function ee(w){if((0,Aw.isIntrospectionType)(w)||(0,ww.isSpecifiedScalarType)(w))return w;if((0,xe.isScalarType)(w))return VP(w);if((0,xe.isObjectType)(w))return GP(w);if((0,xe.isInterfaceType)(w))return $P(w);if((0,xe.isUnionType)(w))return BP(w);if((0,xe.isEnumType)(w))return vn(w);if((0,xe.isInputObjectType)(w))return Ne(w);(0,vw.default)(0,"Unexpected type: "+(0,yw.default)(w))}function Ne(w){var G,L=w.toConfig(),U=(G=u[L.name])!==null&&G!==void 0?G:[];return new xe.GraphQLInputObjectType(ce(ce({},L),{},{fields:function(){return ce(ce({},(0,As.default)(L.fields,function(fe){return ce(ce({},fe),{},{type:de(fe.type)})})),Zy(U))},extensionASTNodes:L.extensionASTNodes.concat(U)}))}function vn(w){var G,L=w.toConfig(),U=(G=u[w.name])!==null&&G!==void 0?G:[];return new xe.GraphQLEnumType(ce(ce({},L),{},{values:ce(ce({},L.values),ev(U)),extensionASTNodes:L.extensionASTNodes.concat(U)}))}function VP(w){for(var G,L=w.toConfig(),U=(G=u[L.name])!==null&&G!==void 0?G:[],re=L.specifiedByUrl,fe=0;fe<U.length;fe++){var he,me=U[fe];re=(he=Iw(me))!==null&&he!==void 0?he:re}return new xe.GraphQLScalarType(ce(ce({},L),{},{specifiedByUrl:re,extensionASTNodes:L.extensionASTNodes.concat(U)}))}function GP(w){var G,L=w.toConfig(),U=(G=u[L.name])!==null&&G!==void 0?G:[];return new xe.GraphQLObjectType(ce(ce({},L),{},{interfaces:function(){return[].concat(w.getInterfaces().map(ge),Ea(U))},fields:function(){return ce(ce({},(0,As.default)(L.fields,zy)),va(U))},extensionASTNodes:L.extensionASTNodes.concat(U)}))}function $P(w){var G,L=w.toConfig(),U=(G=u[L.name])!==null&&G!==void 0?G:[];return new xe.GraphQLInterfaceType(ce(ce({},L),{},{interfaces:function(){return[].concat(w.getInterfaces().map(ge),Ea(U))},fields:function(){return ce(ce({},(0,As.default)(L.fields,zy)),va(U))},extensionASTNodes:L.extensionASTNodes.concat(U)}))}function BP(w){var G,L=w.toConfig(),U=(G=u[L.name])!==null&&G!==void 0?G:[];return new xe.GraphQLUnionType(ce(ce({},L),{},{types:function(){return[].concat(w.getTypes().map(ge),tv(U))},extensionASTNodes:L.extensionASTNodes.concat(U)}))}function zy(w){return ce(ce({},w),{},{type:de(w.type),args:(0,As.default)(w.args,Yy)})}function Yy(w){return ce(ce({},w),{},{type:de(w.type)})}function Jy(w){for(var G={},L=0;L<w.length;L++)for(var U,re=w[L],fe=(U=re.operationTypes)!==null&&U!==void 0?U:[],he=0;he<fe.length;he++){var me=fe[he];G[me.operation]=ya(me.type)}return G}function ya(w){var G,L=w.name.value,U=(G=Tw[L])!==null&&G!==void 0?G:b[L];if(U===void 0)throw new Error('Unknown type: "'.concat(L,'".'));return U}function So(w){return w.kind===Vt.Kind.LIST_TYPE?new xe.GraphQLList(So(w.type)):w.kind===Vt.Kind.NON_NULL_TYPE?new xe.GraphQLNonNull(So(w.type)):ya(w)}function KP(w){var G=w.locations.map(function(L){var U=L.value;return U});return new Tc.GraphQLDirective({name:w.name.value,description:Kn(w,r),locations:G,isRepeatable:w.repeatable,args:Xy(w.arguments),astNode:w})}function va(w){for(var G=Object.create(null),L=0;L<w.length;L++)for(var U,re=w[L],fe=(U=re.fields)!==null&&U!==void 0?U:[],he=0;he<fe.length;he++){var me=fe[he];G[me.name.value]={type:So(me.type),description:Kn(me,r),args:Xy(me.arguments),deprecationReason:bc(me),astNode:me}}return G}function Xy(w){for(var G=w??[],L=Object.create(null),U=0;U<G.length;U++){var re=G[U],fe=So(re.type);L[re.name.value]={type:fe,description:Kn(re,r),defaultValue:(0,Sw.valueFromAST)(re.defaultValue,fe),deprecationReason:bc(re),astNode:re}}return L}function Zy(w){for(var G=Object.create(null),L=0;L<w.length;L++)for(var U,re=w[L],fe=(U=re.fields)!==null&&U!==void 0?U:[],he=0;he<fe.length;he++){var me=fe[he],bo=So(me.type);G[me.name.value]={type:bo,description:Kn(me,r),defaultValue:(0,Sw.valueFromAST)(me.defaultValue,bo),deprecationReason:bc(me),astNode:me}}return G}function ev(w){for(var G=Object.create(null),L=0;L<w.length;L++)for(var U,re=w[L],fe=(U=re.values)!==null&&U!==void 0?U:[],he=0;he<fe.length;he++){var me=fe[he];G[me.name.value]={description:Kn(me,r),deprecationReason:bc(me),astNode:me}}return G}function Ea(w){for(var G=[],L=0;L<w.length;L++)for(var U,re=w[L],fe=(U=re.interfaces)!==null&&U!==void 0?U:[],he=0;he<fe.length;he++){var me=fe[he];G.push(ya(me))}return G}function tv(w){for(var G=[],L=0;L<w.length;L++)for(var U,re=w[L],fe=(U=re.types)!==null&&U!==void 0?U:[],he=0;he<fe.length;he++){var me=fe[he];G.push(ya(me))}return G}function HP(w){var G,L=w.name.value,U=Kn(w,r),re=(G=u[L])!==null&&G!==void 0?G:[];switch(w.kind){case Vt.Kind.OBJECT_TYPE_DEFINITION:{var fe=re,he=[w].concat(fe);return new xe.GraphQLObjectType({name:L,description:U,interfaces:function(){return Ea(he)},fields:function(){return va(he)},astNode:w,extensionASTNodes:fe})}case Vt.Kind.INTERFACE_TYPE_DEFINITION:{var me=re,bo=[w].concat(me);return new xe.GraphQLInterfaceType({name:L,description:U,interfaces:function(){return Ea(bo)},fields:function(){return va(bo)},astNode:w,extensionASTNodes:me})}case Vt.Kind.ENUM_TYPE_DEFINITION:{var rv=re,QP=[w].concat(rv);return new xe.GraphQLEnumType({name:L,description:U,values:ev(QP),astNode:w,extensionASTNodes:rv})}case Vt.Kind.UNION_TYPE_DEFINITION:{var nv=re,WP=[w].concat(nv);return new xe.GraphQLUnionType({name:L,description:U,types:function(){return tv(WP)},astNode:w,extensionASTNodes:nv})}case Vt.Kind.SCALAR_TYPE_DEFINITION:{var zP=re;return new xe.GraphQLScalarType({name:L,description:U,specifiedByUrl:Iw(w),astNode:w,extensionASTNodes:zP})}case Vt.Kind.INPUT_OBJECT_TYPE_DEFINITION:{var iv=re,YP=[w].concat(iv);return new xe.GraphQLInputObjectType({name:L,description:U,fields:function(){return Zy(YP)},astNode:w,extensionASTNodes:iv})}}(0,vw.default)(0,"Unexpected type definition node: "+(0,yw.default)(w))}}var Tw=(0,pW.default)(ww.specifiedScalarTypes.concat(Aw.introspectionTypes),function(e){return e.name});function bc(e){var t=(0,Ow.getDirectiveValues)(Tc.GraphQLDeprecatedDirective,e);return t?.reason}function Iw(e){var t=(0,Ow.getDirectiveValues)(Tc.GraphQLSpecifiedByDirective,e);return t?.url}function Kn(e,t){if(e.description)return e.description.value;if(t?.commentDescriptions===!0){var r=EW(e);if(r!==void 0)return(0,mW.dedentBlockStringValue)(`
|
|
177
|
-
`+r)}}function EW(e){var t=e.loc;if(t){for(var r=[],n=t.startToken.prev;n!=null&&n.kind===hW.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 Cw=y(Ic=>{"use strict";d();Object.defineProperty(Ic,"__esModule",{value:!0});Ic.buildASTSchema=Nw;Ic.buildSchema=AW;var _W=wW(jt()),SW=Ee(),bW=Si(),TW=ji(),IW=kn(),Rw=gt(),OW=bm();function wW(e){return e&&e.__esModule?e:{default:e}}function Nw(e,t){e!=null&&e.kind===SW.Kind.DOCUMENT||(0,_W.default)(0,"Must provide valid Document AST."),t?.assumeValid!==!0&&t?.assumeValidSDL!==!0&&(0,TW.assertValidSDL)(e);var r={description:void 0,types:[],directives:[],extensions:void 0,extensionASTNodes:[],assumeValid:!1},n=(0,OW.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(p){var f=Rw.specifiedDirectives[p];a.every(function(h){return h.name!==f.name})&&a.push(f)},c=0;c<Rw.specifiedDirectives.length;c++)u(c);return new IW.GraphQLSchema(n)}function AW(e,t){var r=(0,bW.parse)(e,{noLocation:t?.noLocation,allowLegacySDLEmptyFields:t?.allowLegacySDLEmptyFields,allowLegacySDLImplementsInterfaces:t?.allowLegacySDLImplementsInterfaces,experimentalFragmentVariables:t?.experimentalFragmentVariables});return Nw(r,{commentDescriptions:t?.commentDescriptions,assumeValidSDL:t?.assumeValidSDL,assumeValid:t?.assumeValid})}});var Dw=y(Om=>{"use strict";d();Object.defineProperty(Om,"__esModule",{value:!0});Om.lexicographicSortSchema=MW;var xW=Rs(St()),RW=Rs(ae()),NW=Rs(et()),CW=Rs(Qo()),PW=Rs(Wo()),DW=kn(),LW=gt(),kW=qt(),dt=ie();function Rs(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 Ue(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){jW(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 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 MW(e){var t=e.toConfig(),r=(0,CW.default)(Tm(t.types),function(f){return f.name},p);return new DW.GraphQLSchema(Ue(Ue({},t),{},{types:(0,xW.default)(r),directives:Tm(t.directives).map(s),query:o(t.query),mutation:o(t.mutation),subscription:o(t.subscription)}));function n(f){return(0,dt.isListType)(f)?new dt.GraphQLList(n(f.ofType)):(0,dt.isNonNullType)(f)?new dt.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 LW.GraphQLDirective(Ue(Ue({},h),{},{locations:Im(h.locations,function(g){return g}),args:a(h.args)}))}function a(f){return Oc(f,function(h){return Ue(Ue({},h),{},{type:n(h.type)})})}function u(f){return Oc(f,function(h){return Ue(Ue({},h),{},{type:n(h.type),args:a(h.args)})})}function c(f){return Oc(f,function(h){return Ue(Ue({},h),{},{type:n(h.type)})})}function l(f){return Tm(f).map(i)}function p(f){if((0,dt.isScalarType)(f)||(0,kW.isIntrospectionType)(f))return f;if((0,dt.isObjectType)(f)){var h=f.toConfig();return new dt.GraphQLObjectType(Ue(Ue({},h),{},{interfaces:function(){return l(h.interfaces)},fields:function(){return u(h.fields)}}))}if((0,dt.isInterfaceType)(f)){var g=f.toConfig();return new dt.GraphQLInterfaceType(Ue(Ue({},g),{},{interfaces:function(){return l(g.interfaces)},fields:function(){return u(g.fields)}}))}if((0,dt.isUnionType)(f)){var v=f.toConfig();return new dt.GraphQLUnionType(Ue(Ue({},v),{},{types:function(){return l(v.types)}}))}if((0,dt.isEnumType)(f)){var _=f.toConfig();return new dt.GraphQLEnumType(Ue(Ue({},_),{},{values:Oc(_.values)}))}if((0,dt.isInputObjectType)(f)){var b=f.toConfig();return new dt.GraphQLInputObjectType(Ue(Ue({},b),{},{fields:function(){return c(b.fields)}}))}(0,NW.default)(0,"Unexpected type: "+(0,RW.default)(f))}}function Oc(e,t){for(var r=Object.create(null),n=Im(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 Tm(e){return Im(e,function(t){return t.name})}function Im(e,t){return e.slice().sort(function(r,n){var i=t(r),o=t(n);return(0,PW.default)(i,o)})}});var Vw=y(Ns=>{"use strict";d();Object.defineProperty(Ns,"__esModule",{value:!0});Ns.printSchema=UW;Ns.printIntrospectionSchema=VW;Ns.printType=Mw;var Am=Pm(St()),FW=Pm(ae()),Lw=Pm(et()),xm=mt(),qW=_i(),kw=qt(),Rm=dr(),Nm=gt(),Bi=ie(),Cm=os();function Pm(e){return e&&e.__esModule?e:{default:e}}function UW(e,t){return jw(e,function(r){return!(0,Nm.isSpecifiedDirective)(r)},GW,t)}function VW(e,t){return jw(e,Nm.isSpecifiedDirective,kw.isIntrospectionType,t)}function GW(e){return!(0,Rm.isSpecifiedScalarType)(e)&&!(0,kw.isIntrospectionType)(e)}function jw(e,t,r,n){var i=e.getDirectives().filter(t),o=(0,Am.default)(e.getTypeMap()).filter(r);return[$W(e)].concat(i.map(function(s){return JW(s,n)}),o.map(function(s){return Mw(s,n)})).filter(Boolean).join(`
|
|
179
|
-
|
|
180
|
-
`)+`
|
|
181
|
-
`}function $W(e){if(!(e.description==null&&BW(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)),Gt({},e)+`schema {
|
|
182
|
-
`.concat(t.join(`
|
|
183
|
-
`),`
|
|
184
|
-
}`)}}function BW(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 Mw(e,t){if((0,Bi.isScalarType)(e))return KW(e,t);if((0,Bi.isObjectType)(e))return HW(e,t);if((0,Bi.isInterfaceType)(e))return QW(e,t);if((0,Bi.isUnionType)(e))return WW(e,t);if((0,Bi.isEnumType)(e))return zW(e,t);if((0,Bi.isInputObjectType)(e))return YW(e,t);(0,Lw.default)(0,"Unexpected type: "+(0,FW.default)(e))}function KW(e,t){return Gt(t,e)+"scalar ".concat(e.name)+XW(e)}function Fw(e){var t=e.getInterfaces();return t.length?" implements "+t.map(function(r){return r.name}).join(" & "):""}function HW(e,t){return Gt(t,e)+"type ".concat(e.name)+Fw(e)+qw(t,e)}function QW(e,t){return Gt(t,e)+"interface ".concat(e.name)+Fw(e)+qw(t,e)}function WW(e,t){var r=e.getTypes(),n=r.length?" = "+r.join(" | "):"";return Gt(t,e)+"union "+e.name+n}function zW(e,t){var r=e.getValues().map(function(n,i){return Gt(t,n," ",!i)+" "+n.name+Lm(n.deprecationReason)});return Gt(t,e)+"enum ".concat(e.name)+Dm(r)}function YW(e,t){var r=(0,Am.default)(e.getFields()).map(function(n,i){return Gt(t,n," ",!i)+" "+wm(n)});return Gt(t,e)+"input ".concat(e.name)+Dm(r)}function qw(e,t){var r=(0,Am.default)(t.getFields()).map(function(n,i){return Gt(e,n," ",!i)+" "+n.name+Uw(e,n.args," ")+": "+String(n.type)+Lm(n.deprecationReason)});return Dm(r)}function Dm(e){return e.length!==0?` {
|
|
185
|
-
`+e.join(`
|
|
186
|
-
`)+`
|
|
187
|
-
}`:""}function Uw(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(wm).join(", ")+")":`(
|
|
188
|
-
`+t.map(function(n,i){return Gt(e,n," "+r,!i)+" "+r+wm(n)}).join(`
|
|
189
|
-
`)+`
|
|
190
|
-
`+r+")"}function wm(e){var t=(0,Cm.astFromValue)(e.defaultValue,e.type),r=e.name+": "+String(e.type);return t&&(r+=" = ".concat((0,xm.print)(t))),r+Lm(e.deprecationReason)}function JW(e,t){return Gt(t,e)+"directive @"+e.name+Uw(t,e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}function Lm(e){if(e==null)return"";var t=(0,Cm.astFromValue)(e,Rm.GraphQLString);return t&&e!==Nm.DEFAULT_DEPRECATION_REASON?" @deprecated(reason: "+(0,xm.print)(t)+")":" @deprecated"}function XW(e){if(e.specifiedByUrl==null)return"";var t=e.specifiedByUrl,r=(0,Cm.astFromValue)(t,Rm.GraphQLString);return r||(0,Lw.default)(0,"Unexpected null value returned from `astFromValue` for specifiedByUrl")," @specifiedBy(url: "+(0,xm.print)(r)+")"}function Gt(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 ZW(i,r,n);var o=i.length>70,s=(0,qW.printBlockString)(i,"",o),a=r&&!n?`
|
|
191
|
-
`+r:r;return a+s.replace(/\n/g,`
|
|
192
|
-
`+r)+`
|
|
193
|
-
`}function ZW(e,t,r){var n=t&&!r?`
|
|
194
|
-
`:"",i=e.split(`
|
|
195
|
-
`).map(function(o){return t+(o!==""?"# "+o:"#")}).join(`
|
|
196
|
-
`);return n+i+`
|
|
197
|
-
`}});var Gw=y(km=>{"use strict";d();Object.defineProperty(km,"__esModule",{value:!0});km.concatAST=ez;function ez(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 Kw=y(jm=>{"use strict";d();Object.defineProperty(jm,"__esModule",{value:!0});jm.separateOperations=rz;var wc=Ee(),tz=Kr();function rz(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 wc.Kind.OPERATION_DEFINITION:t.push(o);break;case wc.Kind.FRAGMENT_DEFINITION:r[o.name.value]=$w(o.selectionSet);break}}for(var s=Object.create(null),a=function(l){for(var p=t[l],f=new Set,h=0,g=$w(p.selectionSet);h<g.length;h++){var v=g[h];Bw(f,r,v)}var _=p.name?p.name.value:"";s[_]={kind:wc.Kind.DOCUMENT,definitions:e.definitions.filter(function(b){return b===p||b.kind===wc.Kind.FRAGMENT_DEFINITION&&f.has(b.name.value)})}},u=0;u<t.length;u++)a(u);return s}function Bw(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];Bw(e,t,o)}}}function $w(e){var t=[];return(0,tz.visit)(e,{FragmentSpread:function(n){t.push(n.name.value)}}),t}});var zw=y(Fm=>{"use strict";d();Object.defineProperty(Fm,"__esModule",{value:!0});Fm.stripIgnoredCharacters=nz;var Hw=vu(),Mm=vi(),Qw=Su(),Ww=_i();function nz(e){for(var t=(0,Hw.isSource)(e)?e:new Hw.Source(e),r=t.body,n=new Qw.Lexer(t),i="",o=!1;n.advance().kind!==Mm.TokenKind.EOF;){var s=n.token,a=s.kind,u=!(0,Qw.isPunctuatorTokenKind)(s.kind);o&&(u||s.kind===Mm.TokenKind.SPREAD)&&(i+=" ");var c=r.slice(s.start,s.end);a===Mm.TokenKind.BLOCK_STRING?i+=iz(c):i+=c,o=u}return i}function iz(e){var t=e.slice(3,-3),r=(0,Ww.dedentBlockStringValue)(t);(0,Ww.getBlockStringIndentation)(r)>0&&(r=`
|
|
198
|
-
`+r);var n=r[r.length-1],i=n==='"'&&r.slice(-4)!=='\\"""';return(i||n==="\\")&&(r+=`
|
|
199
|
-
`),'"""'+r+'"""'}});var o0=y(un=>{"use strict";d();Object.defineProperty(un,"__esModule",{value:!0});un.findBreakingChanges=pz;un.findDangerousChanges=fz;un.DangerousChangeType=un.BreakingChangeType=void 0;var Ki=Ds(St()),Yw=Ds(Hr()),oz=Ds(ae()),n0=Ds(et()),sz=Ds(Wo()),az=mt(),uz=Kr(),cz=dr(),le=ie(),lz=os();function Ds(e){return e&&e.__esModule?e:{default:e}}function Jw(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 Xw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Jw(Object(r),!0).forEach(function(n){dz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function dz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ve=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"});un.BreakingChangeType=Ve;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"});un.DangerousChangeType=Rr;function pz(e,t){var r=i0(e,t).filter(function(n){return n.type in Ve});return r}function fz(e,t){var r=i0(e,t).filter(function(n){return n.type in Rr});return r}function i0(e,t){return[].concat(mz(e,t),hz(e,t))}function hz(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:Ve.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],p=c[1],f=Nr(l.args,p.args),h=0,g=f.added;h<g.length;h++){var v=g[h];(0,le.isRequiredArgument)(v)&&r.push({type:Ve.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:Ve.DIRECTIVE_ARG_REMOVED,description:"".concat(S.name," was removed from ").concat(l.name,".")})}l.isRepeatable&&!p.isRepeatable&&r.push({type:Ve.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];p.locations.indexOf(T)===-1&&r.push({type:Ve.DIRECTIVE_LOCATION_REMOVED,description:"".concat(T," was removed from ").concat(l.name,".")})}}return r}function mz(e,t){for(var r=[],n=Nr((0,Ki.default)(e.getTypeMap()),(0,Ki.default)(t.getTypeMap())),i=0,o=n.removed;i<o.length;i++){var s=o[i];r.push({type:Ve.TYPE_REMOVED,description:(0,cz.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],p=c[1];(0,le.isEnumType)(l)&&(0,le.isEnumType)(p)?r.push.apply(r,vz(l,p)):(0,le.isUnionType)(l)&&(0,le.isUnionType)(p)?r.push.apply(r,yz(l,p)):(0,le.isInputObjectType)(l)&&(0,le.isInputObjectType)(p)?r.push.apply(r,gz(l,p)):(0,le.isObjectType)(l)&&(0,le.isObjectType)(p)||(0,le.isInterfaceType)(l)&&(0,le.isInterfaceType)(p)?r.push.apply(r,e0(l,p).concat(Zw(l,p))):l.constructor!==p.constructor&&r.push({type:Ve.TYPE_CHANGED_KIND,description:"".concat(l.name," changed from ")+"".concat(t0(l)," to ").concat(t0(p),".")})}return r}function gz(e,t){for(var r=[],n=Nr((0,Ki.default)(e.getFields()),(0,Ki.default)(t.getFields())),i=0,o=n.added;i<o.length;i++){var s=o[i];(0,le.isRequiredInputField)(s)?r.push({type:Ve.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:Ve.FIELD_REMOVED,description:"".concat(e.name,".").concat(c.name," was removed.")})}for(var l=0,p=n.persisted;l<p.length;l++){var f=p[l],h=f[0],g=f[1],v=Ps(h.type,g.type);v||r.push({type:Ve.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 yz(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:Ve.TYPE_REMOVED_FROM_UNION,description:"".concat(c.name," was removed from union type ").concat(e.name,".")})}return r}function vz(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:Ve.VALUE_REMOVED_FROM_ENUM,description:"".concat(c.name," was removed from enum type ").concat(e.name,".")})}return r}function Zw(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:Ve.IMPLEMENTED_INTERFACE_REMOVED,description:"".concat(e.name," no longer implements interface ").concat(c.name,".")})}return r}function e0(e,t){for(var r=[],n=Nr((0,Ki.default)(e.getFields()),(0,Ki.default)(t.getFields())),i=0,o=n.removed;i<o.length;i++){var s=o[i];r.push({type:Ve.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],p=c[1];r.push.apply(r,Ez(e,l,p));var f=Cs(l.type,p.type);f||r.push({type:Ve.FIELD_CHANGED_KIND,description:"".concat(e.name,".").concat(l.name," changed type from ")+"".concat(String(l.type)," to ").concat(String(p.type),".")})}return r}function Ez(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:Ve.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],p=l[0],f=l[1],h=Ps(p.type,f.type);if(!h)n.push({type:Ve.ARG_CHANGED_KIND,description:"".concat(e.name,".").concat(t.name," arg ").concat(p.name," has changed type from ")+"".concat(String(p.type)," to ").concat(String(f.type),".")});else if(p.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(p.name," defaultValue was removed.")});else{var g=r0(p.defaultValue,p.type),v=r0(f.defaultValue,f.type);g!==v&&n.push({type:Rr.ARG_DEFAULT_VALUE_CHANGE,description:"".concat(e.name,".").concat(t.name," arg ").concat(p.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:Ve.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 Cs(e,t){return(0,le.isListType)(e)?(0,le.isListType)(t)&&Cs(e.ofType,t.ofType)||(0,le.isNonNullType)(t)&&Cs(e,t.ofType):(0,le.isNonNullType)(e)?(0,le.isNonNullType)(t)&&Cs(e.ofType,t.ofType):(0,le.isNamedType)(t)&&e.name===t.name||(0,le.isNonNullType)(t)&&Cs(e,t.ofType)}function Ps(e,t){return(0,le.isListType)(e)?(0,le.isListType)(t)&&Ps(e.ofType,t.ofType):(0,le.isNonNullType)(e)?(0,le.isNonNullType)(t)&&Ps(e.ofType,t.ofType)||!(0,le.isNonNullType)(t)&&Ps(e.ofType,t):(0,le.isNamedType)(t)&&e.name===t.name}function t0(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,n0.default)(0,"Unexpected type: "+(0,oz.default)(e))}function r0(e,t){var r=(0,lz.astFromValue)(e,t);r!=null||(0,n0.default)(0);var n=(0,uz.visit)(r,{ObjectValue:function(o){var s=[].concat(o.fields);return s.sort(function(a,u){return(0,sz.default)(a.name.value,u.name.value)}),Xw(Xw({},o),{},{fields:s})}});return(0,az.print)(n)}function Nr(e,t){for(var r=[],n=[],i=[],o=(0,Yw.default)(e,function(f){var h=f.name;return h}),s=(0,Yw.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 p=t[l];o[p.name]===void 0&&r.push(p)}return{added:r,persisted:i,removed:n}}});var s0=y(qm=>{"use strict";d();Object.defineProperty(qm,"__esModule",{value:!0});qm.findDeprecatedUsages=bz;var _z=ji(),Sz=fm();function bz(e,t){return(0,_z.validate)(e,t,[Sz.NoDeprecatedCustomRule])}});var d0=y(ne=>{"use strict";d();Object.defineProperty(ne,"__esModule",{value:!0});Object.defineProperty(ne,"getIntrospectionQuery",{enumerable:!0,get:function(){return Tz.getIntrospectionQuery}});Object.defineProperty(ne,"getOperationAST",{enumerable:!0,get:function(){return Iz.getOperationAST}});Object.defineProperty(ne,"getOperationRootType",{enumerable:!0,get:function(){return Oz.getOperationRootType}});Object.defineProperty(ne,"introspectionFromSchema",{enumerable:!0,get:function(){return wz.introspectionFromSchema}});Object.defineProperty(ne,"buildClientSchema",{enumerable:!0,get:function(){return Az.buildClientSchema}});Object.defineProperty(ne,"buildASTSchema",{enumerable:!0,get:function(){return a0.buildASTSchema}});Object.defineProperty(ne,"buildSchema",{enumerable:!0,get:function(){return a0.buildSchema}});Object.defineProperty(ne,"extendSchema",{enumerable:!0,get:function(){return u0.extendSchema}});Object.defineProperty(ne,"getDescription",{enumerable:!0,get:function(){return u0.getDescription}});Object.defineProperty(ne,"lexicographicSortSchema",{enumerable:!0,get:function(){return xz.lexicographicSortSchema}});Object.defineProperty(ne,"printSchema",{enumerable:!0,get:function(){return Um.printSchema}});Object.defineProperty(ne,"printType",{enumerable:!0,get:function(){return Um.printType}});Object.defineProperty(ne,"printIntrospectionSchema",{enumerable:!0,get:function(){return Um.printIntrospectionSchema}});Object.defineProperty(ne,"typeFromAST",{enumerable:!0,get:function(){return Rz.typeFromAST}});Object.defineProperty(ne,"valueFromAST",{enumerable:!0,get:function(){return Nz.valueFromAST}});Object.defineProperty(ne,"valueFromASTUntyped",{enumerable:!0,get:function(){return Cz.valueFromASTUntyped}});Object.defineProperty(ne,"astFromValue",{enumerable:!0,get:function(){return Pz.astFromValue}});Object.defineProperty(ne,"TypeInfo",{enumerable:!0,get:function(){return c0.TypeInfo}});Object.defineProperty(ne,"visitWithTypeInfo",{enumerable:!0,get:function(){return c0.visitWithTypeInfo}});Object.defineProperty(ne,"coerceInputValue",{enumerable:!0,get:function(){return Dz.coerceInputValue}});Object.defineProperty(ne,"concatAST",{enumerable:!0,get:function(){return Lz.concatAST}});Object.defineProperty(ne,"separateOperations",{enumerable:!0,get:function(){return kz.separateOperations}});Object.defineProperty(ne,"stripIgnoredCharacters",{enumerable:!0,get:function(){return jz.stripIgnoredCharacters}});Object.defineProperty(ne,"isEqualType",{enumerable:!0,get:function(){return Vm.isEqualType}});Object.defineProperty(ne,"isTypeSubTypeOf",{enumerable:!0,get:function(){return Vm.isTypeSubTypeOf}});Object.defineProperty(ne,"doTypesOverlap",{enumerable:!0,get:function(){return Vm.doTypesOverlap}});Object.defineProperty(ne,"assertValidName",{enumerable:!0,get:function(){return l0.assertValidName}});Object.defineProperty(ne,"isValidNameError",{enumerable:!0,get:function(){return l0.isValidNameError}});Object.defineProperty(ne,"BreakingChangeType",{enumerable:!0,get:function(){return Ac.BreakingChangeType}});Object.defineProperty(ne,"DangerousChangeType",{enumerable:!0,get:function(){return Ac.DangerousChangeType}});Object.defineProperty(ne,"findBreakingChanges",{enumerable:!0,get:function(){return Ac.findBreakingChanges}});Object.defineProperty(ne,"findDangerousChanges",{enumerable:!0,get:function(){return Ac.findDangerousChanges}});Object.defineProperty(ne,"findDeprecatedUsages",{enumerable:!0,get:function(){return Mz.findDeprecatedUsages}});var Tz=ym(),Iz=Em(),Oz=uc(),wz=hw(),Az=gw(),a0=Cw(),u0=bm(),xz=Dw(),Um=Vw(),Rz=pr(),Nz=gs(),Cz=Mp(),Pz=os(),c0=Wu(),Dz=Zh(),Lz=Gw(),kz=Kw(),jz=zw(),Vm=Zo(),l0=bp(),Ac=o0(),Mz=s0()});var Qi=y(E=>{"use strict";d();Object.defineProperty(E,"__esModule",{value:!0});Object.defineProperty(E,"version",{enumerable:!0,get:function(){return p0.version}});Object.defineProperty(E,"versionInfo",{enumerable:!0,get:function(){return p0.versionInfo}});Object.defineProperty(E,"graphql",{enumerable:!0,get:function(){return f0.graphql}});Object.defineProperty(E,"graphqlSync",{enumerable:!0,get:function(){return f0.graphqlSync}});Object.defineProperty(E,"GraphQLSchema",{enumerable:!0,get:function(){return N.GraphQLSchema}});Object.defineProperty(E,"GraphQLDirective",{enumerable:!0,get:function(){return N.GraphQLDirective}});Object.defineProperty(E,"GraphQLScalarType",{enumerable:!0,get:function(){return N.GraphQLScalarType}});Object.defineProperty(E,"GraphQLObjectType",{enumerable:!0,get:function(){return N.GraphQLObjectType}});Object.defineProperty(E,"GraphQLInterfaceType",{enumerable:!0,get:function(){return N.GraphQLInterfaceType}});Object.defineProperty(E,"GraphQLUnionType",{enumerable:!0,get:function(){return N.GraphQLUnionType}});Object.defineProperty(E,"GraphQLEnumType",{enumerable:!0,get:function(){return N.GraphQLEnumType}});Object.defineProperty(E,"GraphQLInputObjectType",{enumerable:!0,get:function(){return N.GraphQLInputObjectType}});Object.defineProperty(E,"GraphQLList",{enumerable:!0,get:function(){return N.GraphQLList}});Object.defineProperty(E,"GraphQLNonNull",{enumerable:!0,get:function(){return N.GraphQLNonNull}});Object.defineProperty(E,"specifiedScalarTypes",{enumerable:!0,get:function(){return N.specifiedScalarTypes}});Object.defineProperty(E,"GraphQLInt",{enumerable:!0,get:function(){return N.GraphQLInt}});Object.defineProperty(E,"GraphQLFloat",{enumerable:!0,get:function(){return N.GraphQLFloat}});Object.defineProperty(E,"GraphQLString",{enumerable:!0,get:function(){return N.GraphQLString}});Object.defineProperty(E,"GraphQLBoolean",{enumerable:!0,get:function(){return N.GraphQLBoolean}});Object.defineProperty(E,"GraphQLID",{enumerable:!0,get:function(){return N.GraphQLID}});Object.defineProperty(E,"specifiedDirectives",{enumerable:!0,get:function(){return N.specifiedDirectives}});Object.defineProperty(E,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return N.GraphQLIncludeDirective}});Object.defineProperty(E,"GraphQLSkipDirective",{enumerable:!0,get:function(){return N.GraphQLSkipDirective}});Object.defineProperty(E,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return N.GraphQLDeprecatedDirective}});Object.defineProperty(E,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return N.GraphQLSpecifiedByDirective}});Object.defineProperty(E,"TypeKind",{enumerable:!0,get:function(){return N.TypeKind}});Object.defineProperty(E,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return N.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(E,"introspectionTypes",{enumerable:!0,get:function(){return N.introspectionTypes}});Object.defineProperty(E,"__Schema",{enumerable:!0,get:function(){return N.__Schema}});Object.defineProperty(E,"__Directive",{enumerable:!0,get:function(){return N.__Directive}});Object.defineProperty(E,"__DirectiveLocation",{enumerable:!0,get:function(){return N.__DirectiveLocation}});Object.defineProperty(E,"__Type",{enumerable:!0,get:function(){return N.__Type}});Object.defineProperty(E,"__Field",{enumerable:!0,get:function(){return N.__Field}});Object.defineProperty(E,"__InputValue",{enumerable:!0,get:function(){return N.__InputValue}});Object.defineProperty(E,"__EnumValue",{enumerable:!0,get:function(){return N.__EnumValue}});Object.defineProperty(E,"__TypeKind",{enumerable:!0,get:function(){return N.__TypeKind}});Object.defineProperty(E,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return N.SchemaMetaFieldDef}});Object.defineProperty(E,"TypeMetaFieldDef",{enumerable:!0,get:function(){return N.TypeMetaFieldDef}});Object.defineProperty(E,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return N.TypeNameMetaFieldDef}});Object.defineProperty(E,"isSchema",{enumerable:!0,get:function(){return N.isSchema}});Object.defineProperty(E,"isDirective",{enumerable:!0,get:function(){return N.isDirective}});Object.defineProperty(E,"isType",{enumerable:!0,get:function(){return N.isType}});Object.defineProperty(E,"isScalarType",{enumerable:!0,get:function(){return N.isScalarType}});Object.defineProperty(E,"isObjectType",{enumerable:!0,get:function(){return N.isObjectType}});Object.defineProperty(E,"isInterfaceType",{enumerable:!0,get:function(){return N.isInterfaceType}});Object.defineProperty(E,"isUnionType",{enumerable:!0,get:function(){return N.isUnionType}});Object.defineProperty(E,"isEnumType",{enumerable:!0,get:function(){return N.isEnumType}});Object.defineProperty(E,"isInputObjectType",{enumerable:!0,get:function(){return N.isInputObjectType}});Object.defineProperty(E,"isListType",{enumerable:!0,get:function(){return N.isListType}});Object.defineProperty(E,"isNonNullType",{enumerable:!0,get:function(){return N.isNonNullType}});Object.defineProperty(E,"isInputType",{enumerable:!0,get:function(){return N.isInputType}});Object.defineProperty(E,"isOutputType",{enumerable:!0,get:function(){return N.isOutputType}});Object.defineProperty(E,"isLeafType",{enumerable:!0,get:function(){return N.isLeafType}});Object.defineProperty(E,"isCompositeType",{enumerable:!0,get:function(){return N.isCompositeType}});Object.defineProperty(E,"isAbstractType",{enumerable:!0,get:function(){return N.isAbstractType}});Object.defineProperty(E,"isWrappingType",{enumerable:!0,get:function(){return N.isWrappingType}});Object.defineProperty(E,"isNullableType",{enumerable:!0,get:function(){return N.isNullableType}});Object.defineProperty(E,"isNamedType",{enumerable:!0,get:function(){return N.isNamedType}});Object.defineProperty(E,"isRequiredArgument",{enumerable:!0,get:function(){return N.isRequiredArgument}});Object.defineProperty(E,"isRequiredInputField",{enumerable:!0,get:function(){return N.isRequiredInputField}});Object.defineProperty(E,"isSpecifiedScalarType",{enumerable:!0,get:function(){return N.isSpecifiedScalarType}});Object.defineProperty(E,"isIntrospectionType",{enumerable:!0,get:function(){return N.isIntrospectionType}});Object.defineProperty(E,"isSpecifiedDirective",{enumerable:!0,get:function(){return N.isSpecifiedDirective}});Object.defineProperty(E,"assertSchema",{enumerable:!0,get:function(){return N.assertSchema}});Object.defineProperty(E,"assertDirective",{enumerable:!0,get:function(){return N.assertDirective}});Object.defineProperty(E,"assertType",{enumerable:!0,get:function(){return N.assertType}});Object.defineProperty(E,"assertScalarType",{enumerable:!0,get:function(){return N.assertScalarType}});Object.defineProperty(E,"assertObjectType",{enumerable:!0,get:function(){return N.assertObjectType}});Object.defineProperty(E,"assertInterfaceType",{enumerable:!0,get:function(){return N.assertInterfaceType}});Object.defineProperty(E,"assertUnionType",{enumerable:!0,get:function(){return N.assertUnionType}});Object.defineProperty(E,"assertEnumType",{enumerable:!0,get:function(){return N.assertEnumType}});Object.defineProperty(E,"assertInputObjectType",{enumerable:!0,get:function(){return N.assertInputObjectType}});Object.defineProperty(E,"assertListType",{enumerable:!0,get:function(){return N.assertListType}});Object.defineProperty(E,"assertNonNullType",{enumerable:!0,get:function(){return N.assertNonNullType}});Object.defineProperty(E,"assertInputType",{enumerable:!0,get:function(){return N.assertInputType}});Object.defineProperty(E,"assertOutputType",{enumerable:!0,get:function(){return N.assertOutputType}});Object.defineProperty(E,"assertLeafType",{enumerable:!0,get:function(){return N.assertLeafType}});Object.defineProperty(E,"assertCompositeType",{enumerable:!0,get:function(){return N.assertCompositeType}});Object.defineProperty(E,"assertAbstractType",{enumerable:!0,get:function(){return N.assertAbstractType}});Object.defineProperty(E,"assertWrappingType",{enumerable:!0,get:function(){return N.assertWrappingType}});Object.defineProperty(E,"assertNullableType",{enumerable:!0,get:function(){return N.assertNullableType}});Object.defineProperty(E,"assertNamedType",{enumerable:!0,get:function(){return N.assertNamedType}});Object.defineProperty(E,"getNullableType",{enumerable:!0,get:function(){return N.getNullableType}});Object.defineProperty(E,"getNamedType",{enumerable:!0,get:function(){return N.getNamedType}});Object.defineProperty(E,"validateSchema",{enumerable:!0,get:function(){return N.validateSchema}});Object.defineProperty(E,"assertValidSchema",{enumerable:!0,get:function(){return N.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 Hi.execute}});Object.defineProperty(E,"executeSync",{enumerable:!0,get:function(){return Hi.executeSync}});Object.defineProperty(E,"defaultFieldResolver",{enumerable:!0,get:function(){return Hi.defaultFieldResolver}});Object.defineProperty(E,"defaultTypeResolver",{enumerable:!0,get:function(){return Hi.defaultTypeResolver}});Object.defineProperty(E,"responsePathAsArray",{enumerable:!0,get:function(){return Hi.responsePathAsArray}});Object.defineProperty(E,"getDirectiveValues",{enumerable:!0,get:function(){return Hi.getDirectiveValues}});Object.defineProperty(E,"subscribe",{enumerable:!0,get:function(){return h0.subscribe}});Object.defineProperty(E,"createSourceEventStream",{enumerable:!0,get:function(){return h0.createSourceEventStream}});Object.defineProperty(E,"validate",{enumerable:!0,get:function(){return J.validate}});Object.defineProperty(E,"ValidationContext",{enumerable:!0,get:function(){return J.ValidationContext}});Object.defineProperty(E,"specifiedRules",{enumerable:!0,get:function(){return J.specifiedRules}});Object.defineProperty(E,"recommendedRules",{enumerable:!0,get:function(){return J.recommendedRules}});Object.defineProperty(E,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return J.ExecutableDefinitionsRule}});Object.defineProperty(E,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return J.FieldsOnCorrectTypeRule}});Object.defineProperty(E,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return J.FragmentsOnCompositeTypesRule}});Object.defineProperty(E,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return J.KnownArgumentNamesRule}});Object.defineProperty(E,"KnownDirectivesRule",{enumerable:!0,get:function(){return J.KnownDirectivesRule}});Object.defineProperty(E,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return J.KnownFragmentNamesRule}});Object.defineProperty(E,"KnownTypeNamesRule",{enumerable:!0,get:function(){return J.KnownTypeNamesRule}});Object.defineProperty(E,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return J.LoneAnonymousOperationRule}});Object.defineProperty(E,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return J.NoFragmentCyclesRule}});Object.defineProperty(E,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return J.NoUndefinedVariablesRule}});Object.defineProperty(E,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return J.NoUnusedFragmentsRule}});Object.defineProperty(E,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return J.NoUnusedVariablesRule}});Object.defineProperty(E,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return J.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(E,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return J.PossibleFragmentSpreadsRule}});Object.defineProperty(E,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return J.ProvidedRequiredArgumentsRule}});Object.defineProperty(E,"ScalarLeafsRule",{enumerable:!0,get:function(){return J.ScalarLeafsRule}});Object.defineProperty(E,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return J.SingleFieldSubscriptionsRule}});Object.defineProperty(E,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return J.UniqueArgumentNamesRule}});Object.defineProperty(E,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return J.UniqueDirectivesPerLocationRule}});Object.defineProperty(E,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return J.UniqueFragmentNamesRule}});Object.defineProperty(E,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return J.UniqueInputFieldNamesRule}});Object.defineProperty(E,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return J.UniqueOperationNamesRule}});Object.defineProperty(E,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return J.UniqueVariableNamesRule}});Object.defineProperty(E,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return J.ValuesOfCorrectTypeRule}});Object.defineProperty(E,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return J.VariablesAreInputTypesRule}});Object.defineProperty(E,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return J.VariablesInAllowedPositionRule}});Object.defineProperty(E,"MaxIntrospectionDepthRule",{enumerable:!0,get:function(){return J.MaxIntrospectionDepthRule}});Object.defineProperty(E,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return J.LoneSchemaDefinitionRule}});Object.defineProperty(E,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return J.UniqueOperationTypesRule}});Object.defineProperty(E,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return J.UniqueTypeNamesRule}});Object.defineProperty(E,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return J.UniqueEnumValueNamesRule}});Object.defineProperty(E,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return J.UniqueFieldDefinitionNamesRule}});Object.defineProperty(E,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return J.UniqueDirectiveNamesRule}});Object.defineProperty(E,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return J.PossibleTypeExtensionsRule}});Object.defineProperty(E,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return J.NoDeprecatedCustomRule}});Object.defineProperty(E,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return J.NoSchemaIntrospectionCustomRule}});Object.defineProperty(E,"GraphQLError",{enumerable:!0,get:function(){return Ls.GraphQLError}});Object.defineProperty(E,"syntaxError",{enumerable:!0,get:function(){return Ls.syntaxError}});Object.defineProperty(E,"locatedError",{enumerable:!0,get:function(){return Ls.locatedError}});Object.defineProperty(E,"printError",{enumerable:!0,get:function(){return Ls.printError}});Object.defineProperty(E,"formatError",{enumerable:!0,get:function(){return Ls.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 p0=_b(),f0=qO(),N=VO(),Se=BO(),Hi=KO(),h0=ow(),J=uw(),Ls=dw(),se=d0()});var R0=y((Loe,Cr)=>{d();var Hm=M("fs"),Pc=M("path"),Bz=M("os"),Kz=M("crypto"),I0=["\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 Hz(){return I0[Math.floor(Math.random()*I0.length)]}function Wi(e){return typeof e=="string"?!["false","0","no","off",""].includes(e.toLowerCase()):!!e}function Qz(){return process.stdout.isTTY}function Wz(e){return Qz()?`\x1B[2m${e}\x1B[0m`:e}var zz=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Yz(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
|
|
200
|
-
`);let n;for(;(n=zz.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 Jz(e){e=e||{};let t=x0(e);e.path=t;let r=Ke.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=A0(e).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),u=Zz(r,a);o=Ke.decrypt(u.ciphertext,u.key);break}catch(a){if(s+1>=i)throw a}return Ke.parse(o)}function Xz(e){console.error(`\u26A0 ${e}`)}function Ms(e){console.log(`\u2506 ${e}`)}function w0(e){console.log(`\u25C7 ${e}`)}function A0(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 Zz(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 x0(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)Hm.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=Pc.resolve(process.cwd(),".env.vault");return Hm.existsSync(t)?t:null}function O0(e){return e[0]==="~"?Pc.join(Bz.homedir(),e.slice(1)):e}function eY(e){let t=Wi(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),r=Wi(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);(t||!r)&&w0("loading env from encrypted .env.vault");let n=Ke._parseVault(e),i=process.env;return e&&e.processEnv!=null&&(i=e.processEnv),Ke.populate(i,n,e),{parsed:n}}function tY(e){let t=Pc.resolve(process.cwd(),".env"),r="utf8",n=process.env;e&&e.processEnv!=null&&(n=e.processEnv);let i=Wi(n.DOTENV_CONFIG_DEBUG||e&&e.debug),o=Wi(n.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?r=e.encoding:i&&Ms("no encoding is specified (UTF-8 is used by default)");let s=[t];if(e&&e.path)if(!Array.isArray(e.path))s=[O0(e.path)];else{s=[];for(let l of e.path)s.push(O0(l))}let a,u={};for(let l of s)try{let p=Ke.parse(Hm.readFileSync(l,{encoding:r}));Ke.populate(u,p,e)}catch(p){i&&Ms(`failed to load ${l} ${p.message}`),a=p}let c=Ke.populate(n,u,e);if(i=Wi(n.DOTENV_CONFIG_DEBUG||i),o=Wi(n.DOTENV_CONFIG_QUIET||o),i||!o){let l=Object.keys(c).length,p=[];for(let f of s)try{let h=Pc.relative(process.cwd(),f);p.push(h)}catch(h){i&&Ms(`failed to load ${f} ${h.message}`),a=h}w0(`injected env (${l}) from ${p.join(",")} ${Wz(`// tip: ${Hz()}`)}`)}return a?{parsed:u,error:a}:{parsed:u}}function rY(e){if(A0(e).length===0)return Ke.configDotenv(e);let t=x0(e);return t?Ke._configVault(e):(Xz(`you set DOTENV_KEY but you are missing a .env.vault file at ${t}`),Ke.configDotenv(e))}function nY(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=Kz.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 iY(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&&Ms(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 Ke={configDotenv:tY,_configVault:eY,_parseVault:Jz,config:rY,decrypt:nY,parse:Yz,populate:iY};Cr.exports.configDotenv=Ke.configDotenv;Cr.exports._configVault=Ke._configVault;Cr.exports._parseVault=Ke._parseVault;Cr.exports.config=Ke.config;Cr.exports.decrypt=Ke.decrypt;Cr.exports.parse=Ke.parse;Cr.exports.populate=Ke.populate;Cr.exports=Ke});var _A=y((Zoe,EA)=>{d();EA.exports=Yi;function Yi(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}Yi.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};Yi.prototype.reset=function(){this.attempts=0};Yi.prototype.setMin=function(e){this.ms=e};Yi.prototype.setMax=function(e){this.max=e};Yi.prototype.setJitter=function(e){this.jitter=e}});var bA=y((tse,zm)=>{"use strict";d();var lY=Object.prototype.hasOwnProperty,pt="~";function Fs(){}Object.create&&(Fs.prototype=Object.create(null),new Fs().__proto__||(pt=!1));function dY(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function SA(e,t,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var o=new dY(r,n||e,i),s=pt?pt+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 jc(e,t){--e._eventsCount===0?e._events=new Fs:delete e._events[t]}function ot(){this._events=new Fs,this._eventsCount=0}ot.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)lY.call(r,n)&&t.push(pt?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};ot.prototype.listeners=function(t){var r=pt?pt+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=pt?pt+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=pt?pt+t:t;if(!this._events[a])return!1;var u=this._events[a],c=arguments.length,l,p;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(p=1,l=new Array(c-1);p<c;p++)l[p-1]=arguments[p];u.fn.apply(u.context,l)}else{var f=u.length,h;for(p=0;p<f;p++)switch(u[p].once&&this.removeListener(t,u[p].fn,void 0,!0),c){case 1:u[p].fn.call(u[p].context);break;case 2:u[p].fn.call(u[p].context,r);break;case 3:u[p].fn.call(u[p].context,r,n);break;case 4:u[p].fn.call(u[p].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[p].fn.apply(u[p].context,l)}}return!0};ot.prototype.on=function(t,r,n){return SA(this,t,r,n,!1)};ot.prototype.once=function(t,r,n){return SA(this,t,r,n,!0)};ot.prototype.removeListener=function(t,r,n,i){var o=pt?pt+t:t;if(!this._events[o])return this;if(!r)return jc(this,o),this;var s=this._events[o];if(s.fn)s.fn===r&&(!i||s.once)&&(!n||s.context===n)&&jc(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:jc(this,o)}return this};ot.prototype.removeAllListeners=function(t){var r;return t?(r=pt?pt+t:t,this._events[r]&&jc(this,r)):(this._events=new Fs,this._eventsCount=0),this};ot.prototype.off=ot.prototype.removeListener;ot.prototype.addListener=ot.prototype.on;ot.prefixed=pt;ot.EventEmitter=ot;typeof zm<"u"&&(zm.exports=ot)});var TA=y(Ym=>{"use strict";d();Object.defineProperty(Ym,"__esModule",{value:!0});function pY(e){return typeof e=="string"}Ym.default=pY});var Xm=y(Jm=>{"use strict";d();Object.defineProperty(Jm,"__esModule",{value:!0});function fY(e){return e!==null&&typeof e=="object"}Jm.default=fY});var IA=y(Zm=>{"use strict";d();Object.defineProperty(Zm,"__esModule",{value:!0});Zm.default=hY;function hY(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 OA=y((tg,eg)=>{"use strict";d();Object.defineProperty(tg,"__esModule",{value:!0});var mY=IA(),gY=yY(mY);function yY(e){return e&&e.__esModule?e:{default:e}}var Ji;typeof self<"u"?Ji=self:typeof window<"u"?Ji=window:typeof global<"u"?Ji=global:typeof eg<"u"?Ji=eg:Ji=Function("return this")();var vY=(0,gY.default)(Ji);tg.default=vY});var Mc=y(Xi=>{"use strict";d();Object.defineProperty(Xi,"__esModule",{value:!0});Xi.GRAPHQL_SUBSCRIPTIONS=Xi.GRAPHQL_WS=void 0;var EY="graphql-ws";Xi.GRAPHQL_WS=EY;var _Y="graphql-subscriptions";Xi.GRAPHQL_SUBSCRIPTIONS=_Y});var wA=y(Zi=>{"use strict";d();Object.defineProperty(Zi,"__esModule",{value:!0});Zi.WS_TIMEOUT=Zi.MIN_WS_TIMEOUT=void 0;var SY=1e3;Zi.MIN_WS_TIMEOUT=SY;var bY=3e4;Zi.WS_TIMEOUT=bY});var qs=y(rg=>{"use strict";d();Object.defineProperty(rg,"__esModule",{value:!0});var TY=(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})();rg.default=TY});var PA=y($t=>{"use strict";d();var eo=$t&&$t.__assign||function(){return eo=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},eo.apply(this,arguments)},IY=$t&&$t.__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(p){s(p)}}function u(l){try{c(n.throw(l))}catch(p){s(p)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(e,t||[])).next())})},OY=$t&&$t.__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}}},AA=$t&&$t.__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($t,"__esModule",{value:!0});$t.SubscriptionClient=void 0;var xA=typeof global<"u"?global:typeof window<"u"?window:{},wY=xA.WebSocket||xA.MozWebSocket,RA=_A(),AY=bA(),NA=TA(),xY=Xm(),RY=mt(),NY=Em(),CY=OA(),PY=Mc(),CA=wA(),ft=qs(),DY=(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,p=l===void 0?CA.MIN_WS_TIMEOUT:l,f=o.timeout,h=f===void 0?CA.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,D=o.wsOptionArguments,V=D===void 0?[]:D;if(this.wsImpl=n||wY,!this.wsImpl)throw new Error("Unable to find native implementation, or alternative implementation for WebSocket!");this.wsProtocols=i||PY.GRAPHQL_WS,this.connectionCallback=a,this.url=t,this.operations={},this.nextOperationId=0,this.minWsTimeout=p,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 RA({jitter:.5}),this.eventEmitter=new AY.EventEmitter,this.middlewares=[],this.client=null,this.maxConnectTimeGenerator=this.createMaxConnectTimeGenerator(),this.connectionParams=this.getConnectionParams(c),this.wsOptionArguments=V,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[CY.default]=function(){return this},r.subscribe=function(a,u,c){var l=n(a,u,c);return s=i(t,function(p,f){p===null&&f===null?l.complete&&l.complete():p?l.error&&l.error(p[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(AA([],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 RA({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,NA.default)(n)&&!(0,NY.getOperationAST)(n,o)||o&&!(0,NA.default)(o)||i&&!(0,xY.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?eo(eo({},n),{query:typeof n.query=="string"?n.query:(0,RY.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,AA([void 0,this.url,this.wsProtocols],this.wsOptionArguments,!1))),this.checkMaxConnectTimeout(),this.client.onopen=function(){return IY(r,void 0,void 0,function(){var n,i;return OY(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?eo(eo({},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})();$t.SubscriptionClient=DY});var Qn=y((vse,DA)=>{"use strict";d();DA.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 Us=y((_se,ng)=>{"use strict";d();var{EMPTY_BUFFER:LY}=Qn();function LA(e,t){if(e.length===0)return LY;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 kA(e,t,r,n,i){for(let o=0;o<i;o++)r[n+o]=e[o]^t[o&3]}function jA(e,t){let r=e.length;for(let n=0;n<r;n++)e[n]^=t[n&3]}function MA(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function Fc(e){if(Fc.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),Fc.readOnly=!1),t}try{let e=M("bufferutil"),t=e.BufferUtil||e;ng.exports={concat:LA,mask(r,n,i,o,s){s<48?kA(r,n,i,o,s):t.mask(r,n,i,o,s)},toArrayBuffer:MA,toBuffer:Fc,unmask(r,n){r.length<32?jA(r,n):t.unmask(r,n)}}}catch{ng.exports={concat:LA,mask:kA,toArrayBuffer:MA,toBuffer:Fc,unmask:jA}}});var UA=y((bse,qA)=>{"use strict";d();var FA=Symbol("kDone"),ig=Symbol("kRun"),og=class{constructor(t){this[FA]=()=>{this.pending--,this[ig]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[ig]()}[ig](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[FA])}}};qA.exports=og});var $s=y((Ise,BA)=>{"use strict";d();var Vs=M("zlib"),VA=Us(),kY=UA(),{kStatusCode:GA,NOOP:jY}=Qn(),MY=Buffer.from([0,0,255,255]),Vc=Symbol("permessage-deflate"),Pr=Symbol("total-length"),Gs=Symbol("callback"),cn=Symbol("buffers"),Uc=Symbol("error"),qc,sg=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,!qc){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;qc=new kY(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[Gs];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){qc.add(i=>{this._decompress(t,r,(o,s)=>{i(),n(o,s)})})}compress(t,r,n){qc.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"?Vs.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=Vs.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[Vc]=this,this._inflate[Pr]=0,this._inflate[cn]=[],this._inflate.on("error",qY),this._inflate.on("data",$A)}this._inflate[Gs]=n,this._inflate.write(t),r&&this._inflate.write(MY),this._inflate.flush(()=>{let o=this._inflate[Uc];if(o){this._inflate.close(),this._inflate=null,n(o);return}let s=VA.concat(this._inflate[cn],this._inflate[Pr]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Pr]=0,this._inflate[cn]=[],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"?Vs.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=Vs.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[Pr]=0,this._deflate[cn]=[],this._deflate.on("error",jY),this._deflate.on("data",FY)}this._deflate[Gs]=n,this._deflate.write(t),this._deflate.flush(Vs.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=VA.concat(this._deflate[cn],this._deflate[Pr]);r&&(o=o.slice(0,o.length-4)),this._deflate[Gs]=null,this._deflate[Pr]=0,this._deflate[cn]=[],r&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,o)})}};BA.exports=sg;function FY(e){this[cn].push(e),this[Pr]+=e.length}function $A(e){if(this[Pr]+=e.length,this[Vc]._maxPayload<1||this[Pr]<=this[Vc]._maxPayload){this[cn].push(e);return}this[Uc]=new RangeError("Max payload size exceeded"),this[Uc].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Uc][GA]=1009,this.removeListener("data",$A),this.reset()}function qY(e){this[Vc]._inflate=null,e[GA]=1007,this[Gs](e)}});var ug=y((wse,ag)=>{"use strict";d();function KA(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function HA(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),ag.exports={isValidStatusCode:KA,isValidUTF8(t){return t.length<150?HA(t):e(t)}}}catch{ag.exports={isValidStatusCode:KA,isValidUTF8:HA}}});var pg=y((xse,XA)=>{"use strict";d();var{Writable:UY}=M("stream"),QA=$s(),{BINARY_TYPES:VY,EMPTY_BUFFER:GY,kStatusCode:$Y,kWebSocket:BY}=Qn(),{concat:cg,toArrayBuffer:KY,unmask:HY}=Us(),{isValidStatusCode:QY,isValidUTF8:WA}=ug(),Bs=0,zA=1,YA=2,JA=3,lg=4,WY=5,dg=class extends UY{constructor(t,r,n,i,o,s){super(),this._binaryType=t||VY[0],this[BY]=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=Bs,this._loop=!1}_write(t,r,n){if(this._opcode===8&&this._state==Bs)return n();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks)return n(Le(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 Bs:r=this.getInfo();break;case zA:r=this.getPayloadLength16();break;case YA:r=this.getPayloadLength64();break;case JA:this.getMask();break;case lg: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,Le(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[QA.extensionName])return this._loop=!1,Le(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,Le(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,Le(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,Le(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,Le(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(r)return this._loop=!1,Le(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125)return this._loop=!1,Le(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}else return this._loop=!1,Le(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,Le(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,Le(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(this._payloadLength===126)this._state=zA;else if(this._payloadLength===127)this._state=YA;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,Le(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,Le(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=JA:this._state=lg}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=lg}getData(t){let r=GY;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&HY(r,this._mask)}if(this._opcode>7)return this.controlMessage(r);if(this._compressed){this._state=WY,this.decompress(r,t);return}if(r.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments)return this._loop=!1,Le(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[QA.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(Le(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));if(this._maxFragments>0&&this._fragments.length>=this._maxFragments)return r(Le(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=cg(r,t):this._binaryType==="arraybuffer"?n=KY(cg(r,t)):n=r,this.emit("message",n)}else{let n=cg(r,t);if(!WA(n))return this._loop=!1,Le(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",n.toString())}}this._state=Bs}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 Le(RangeError,"invalid payload length 1",!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");{let r=t.readUInt16BE(0);if(!QY(r))return Le(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");let n=t.slice(2);if(!WA(n))return Le(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=Bs}};XA.exports=dg;function Le(e,t,r,n,i){let o=new e(r?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,Le),o.code=i,o[$Y]=n,o}});var hg=y((Pse,tx)=>{"use strict";d();var Nse=M("net"),Cse=M("tls"),{randomFillSync:zY}=M("crypto"),ZA=$s(),{EMPTY_BUFFER:YY}=Qn(),{isValidStatusCode:JY}=ug(),{mask:ex,toBuffer:Dr}=Us(),Wn=Buffer.alloc(4),fg=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?(zY(Wn,0,4),s[1]|=128,s[i-4]=Wn[0],s[i-3]=Wn[1],s[i-2]=Wn[2],s[i-1]=Wn[3],n?(ex(t,Wn,s,i,t.length),[s]):(ex(t,Wn,t,0,t.length),[s,t])):[s,t]}close(t,r,n,i){let o;if(t===void 0)o=YY;else{if(typeof t!="number"||!JY(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=Dr(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,Dr.readOnly,n]):this.doPing(i,r,Dr.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=Dr(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,Dr.readOnly,n]):this.doPong(i,r,Dr.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=Dr(t),o=this._extensions[ZA.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:Dr.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:Dr.readOnly}),n)}dispatch(t,r,n,i){if(!r){this.sendFrame(e.frame(t,n),i);return}let o=this._extensions[ZA.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=fg});var nx=y((Lse,rx)=>{"use strict";d();var to=class{constructor(t,r){this.target=r,this.type=t}},mg=class extends to{constructor(t,r){super("message",r),this.data=t}},gg=class extends to{constructor(t,r,n){super("close",n),this.wasClean=n._closeFrameReceived&&n._closeFrameSent,this.reason=r,this.code=t}},yg=class extends to{constructor(t){super("open",t)}},vg=class extends to{constructor(t,r){super("error",r),this.message=t.message,this.error=t}},XY={addEventListener(e,t,r){if(typeof t!="function")return;function n(u){t.call(this,new mg(u,this))}function i(u,c){t.call(this,new gg(u,c,this))}function o(u){t.call(this,new vg(u,this))}function s(){t.call(this,new yg(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])}};rx.exports=XY});var Eg=y((jse,ix)=>{"use strict";d();var Ks=[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 ZY(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&&Ks[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&&Ks[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(Ks[f]!==1)throw new SyntaxError(`Unexpected character at index ${l}`);u===-1?u=l:n||(n=!0),i=!1}else if(o)if(Ks[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&&Ks[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 p=e.slice(u,c);return s===void 0?vr(t,p,r):(a===void 0?vr(r,p,!0):n?vr(r,a,p.replace(/\\/g,"")):vr(r,a,p),vr(t,s,r)),t}function eJ(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(", ")}ix.exports={format:eJ,parse:ZY}});var Og=y((qse,hx)=>{"use strict";d();var tJ=M("events"),rJ=M("https"),nJ=M("http"),ax=M("net"),iJ=M("tls"),{randomBytes:oJ,createHash:sJ}=M("crypto"),{Readable:Fse}=M("stream"),{URL:_g}=M("url"),ln=$s(),aJ=pg(),uJ=hg(),{BINARY_TYPES:ox,EMPTY_BUFFER:Sg,GUID:cJ,kStatusCode:lJ,kWebSocket:st,NOOP:ux}=Qn(),{addEventListener:dJ,removeEventListener:pJ}=nx(),{format:fJ,parse:hJ}=Eg(),{toBuffer:mJ}=Us(),Lr=["CONNECTING","OPEN","CLOSING","CLOSED"],bg=[8,13],gJ=30*1e3,Fe=class e extends tJ{constructor(t,r,n){super(),this._binaryType=ox[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),cx(this,t,r,n)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(t){ox.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 aJ(this.binaryType,this._extensions,this._isServer,n,i,o);this._sender=new uJ(t,this._extensions),this._receiver=s,this._socket=t,s[st]=this,t[st]=this,s.on("conclude",EJ),s.on("drain",_J),s.on("error",SJ),s.on("message",bJ),s.on("ping",TJ),s.on("pong",IJ),t.setTimeout(0),t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",dx),t.on("data",Gc),t.on("end",px),t.on("error",fx),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[ln.extensionName]&&this._extensions[ln.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 wt(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),gJ)}}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){Ig(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||Sg,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){Ig(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||Sg,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){Ig(this,t,n);return}let i={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[ln.extensionName]||(i.compress=!1),this._sender.send(t||Sg,i,n)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING)return wt(this,this._req,"WebSocket was closed before the connection was established");this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(Fe,"CONNECTING",{enumerable:!0,value:Lr.indexOf("CONNECTING")});Object.defineProperty(Fe.prototype,"CONNECTING",{enumerable:!0,value:Lr.indexOf("CONNECTING")});Object.defineProperty(Fe,"OPEN",{enumerable:!0,value:Lr.indexOf("OPEN")});Object.defineProperty(Fe.prototype,"OPEN",{enumerable:!0,value:Lr.indexOf("OPEN")});Object.defineProperty(Fe,"CLOSING",{enumerable:!0,value:Lr.indexOf("CLOSING")});Object.defineProperty(Fe.prototype,"CLOSING",{enumerable:!0,value:Lr.indexOf("CLOSING")});Object.defineProperty(Fe,"CLOSED",{enumerable:!0,value:Lr.indexOf("CLOSED")});Object.defineProperty(Fe.prototype,"CLOSED",{enumerable:!0,value:Lr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","protocol","readyState","url"].forEach(e=>{Object.defineProperty(Fe.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(Fe.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)}})});Fe.prototype.addEventListener=dJ;Fe.prototype.removeEventListener=pJ;hx.exports=Fe;function cx(e,t,r,n){let i={protocolVersion:bg[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(!bg.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${bg.join(", ")})`);let o;t instanceof _g?(o=t,e._url=t.href):(o=new _g(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;Tg(e,h);return}let a=o.protocol==="wss:"||o.protocol==="https:",u=a?443:80,c=oJ(16).toString("base64"),l=a?rJ.get:nJ.get,p;if(i.createConnection=a?vJ:yJ,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&&(p=new ln(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=fJ({[ln.extensionName]:p.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",()=>{wt(e,f,"Opening handshake has timed out")}),f.on("error",h=>{f===null||f.aborted||(f=e._req=null,Tg(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){wt(e,f,"Maximum redirects exceeded");return}f.abort();let _;try{_=new _g(g,t)}catch(b){Tg(e,b);return}cx(e,_,r,n)}else e.emit("unexpected-response",f,h)||wt(e,f,`Unexpected server response: ${h.statusCode}`)}),f.on("upgrade",(h,g,v)=>{if(e.emit("upgrade",h),e.readyState!==Fe.CONNECTING)return;f=e._req=null;let _=h.headers.upgrade;if(_===void 0||_.toLowerCase()!=="websocket"){wt(e,g,"Invalid Upgrade header");return}let b=sJ("sha1").update(c+cJ).digest("base64");if(h.headers["sec-websocket-accept"]!==b){wt(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){wt(e,g,A);return}S&&(e._protocol=S);let T=h.headers["sec-websocket-extensions"];if(T!==void 0){if(!p){wt(e,g,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let D;try{D=hJ(T)}catch{wt(e,g,"Invalid Sec-WebSocket-Extensions header");return}let V=Object.keys(D);if(V.length){if(V.length!==1||V[0]!==ln.extensionName){wt(e,g,"Server indicated an extension that was not requested");return}try{p.accept(D[ln.extensionName])}catch{wt(e,g,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[ln.extensionName]=p}}e.setSocket(g,v,i.maxPayload,i.maxBufferedChunks,i.maxFragments)})}function Tg(e,t){e._readyState=Fe.CLOSING,e.emit("error",t),e.emitClose()}function yJ(e){return e.path=e.socketPath,ax.connect(e)}function vJ(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=ax.isIP(e.host)?"":e.host),iJ.connect(e)}function wt(e,t,r){e._readyState=Fe.CLOSING;let n=new Error(r);Error.captureStackTrace(n,wt),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 Ig(e,t,r){if(t){let n=mJ(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${e.readyState} (${Lr[e.readyState]})`);r(n)}}function EJ(e,t){let r=this[st];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[st]!==void 0&&(r._socket.removeListener("data",Gc),process.nextTick(lx,r._socket),e===1005?r.close():r.close(e,t))}function _J(){this[st]._socket.resume()}function SJ(e){let t=this[st];t._socket[st]!==void 0&&(t._socket.removeListener("data",Gc),process.nextTick(lx,t._socket),t.close(e[lJ])),t.emit("error",e)}function sx(){this[st].emitClose()}function bJ(e){this[st].emit("message",e)}function TJ(e){let t=this[st];t.pong(e,!t._isServer,ux),t.emit("ping",e)}function IJ(e){this[st].emit("pong",e)}function lx(e){e.resume()}function dx(){let e=this[st];this.removeListener("close",dx),this.removeListener("data",Gc),this.removeListener("end",px),e._readyState=Fe.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",sx),e._receiver.on("finish",sx))}function Gc(e){this[st]._receiver.write(e)||this.pause()}function px(){let e=this[st];e._readyState=Fe.CLOSING,e._receiver.end(),this.end()}function fx(){let e=this[st];this.removeListener("error",fx),this.on("error",ux),e&&(e._readyState=Fe.CLOSING,this.destroy())}});var vx=y((Vse,yx)=>{"use strict";d();var{Duplex:OJ}=M("stream");function mx(e){e.emit("close")}function wJ(){!this.destroyed&&this._writableState.finished&&this.destroy()}function gx(e){this.removeListener("error",gx),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function AJ(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 OJ({...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",wJ),o.on("error",gx),o}yx.exports=AJ});var Tx=y((Hse,bx)=>{"use strict";d();var xJ=M("events"),$c=M("http"),$se=M("https"),Bse=M("net"),Kse=M("tls"),{createHash:RJ}=M("crypto"),zn=$s(),NJ=Og(),{format:CJ,parse:PJ}=Eg(),{GUID:DJ,kWebSocket:LJ}=Qn(),kJ=/^[+/0-9A-Za-z]{22}==$/,Ex=0,_x=1,Sx=2,Ag=class extends xJ{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=$c.createServer((n,i)=>{let o=$c.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=jJ(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=Ex}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===Sx){process.nextTick(wg,this);return}if(this._state===_x)return;if(this._state=_x,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(wg.bind(void 0,this));return}process.nextTick(wg,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",xg);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||!kJ.test(o)||a!==8&&a!==13||!this.shouldHandle(t))return Hs(r,400);if(this.options.perMessageDeflate){let c=new zn(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let l=PJ(t.headers["sec-websocket-extensions"]);l[zn.extensionName]&&(c.accept(l[zn.extensionName]),u[zn.extensionName]=c)}catch{return Hs(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,p,f,h)=>{if(!l)return Hs(r,p||401,f,h);this.completeUpgrade(o,u,t,r,n,i)});return}if(!this.options.verifyClient(c))return Hs(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[LJ])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Ex)return Hs(i,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${RJ("sha1").update(t+DJ).digest("base64")}`],c=new NJ(null),l=n.headers["sec-websocket-protocol"];if(l&&(l=l.split(",").map(MJ),this.options.handleProtocols?l=this.options.handleProtocols(l,n):l=l[0],l&&(u.push(`Sec-WebSocket-Protocol: ${l}`),c._protocol=l)),r[zn.extensionName]){let p=r[zn.extensionName].params,f=CJ({[zn.extensionName]:[p]});u.push(`Sec-WebSocket-Extensions: ${f}`),c._extensions=r}this.emit("headers",u,n),i.write(u.concat(`\r
|
|
202
|
-
`).join(`\r
|
|
203
|
-
`)),i.removeListener("error",xg),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=Ag;function jJ(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 wg(e){e._state=Sx,e.emit("close")}function xg(){this.destroy()}function Hs(e,t,r,n){e.writable&&(r=r||$c.STATUS_CODES[t],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...n},e.write(`HTTP/1.1 ${t} ${$c.STATUS_CODES[t]}\r
|
|
204
|
-
`+Object.keys(n).map(i=>`${i}: ${n[i]}`).join(`\r
|
|
205
|
-
`)+`\r
|
|
206
|
-
\r
|
|
207
|
-
`+r)),e.removeListener("error",xg),e.destroy()}function MJ(e){return e.trim()}});var Ox=y((Wse,Ix)=>{"use strict";d();var Qs=Og();Qs.createWebSocketStream=vx();Qs.Server=Tx();Qs.Receiver=pg();Qs.Sender=hg();Ix.exports=Qs});var jg=y(ht=>{"use strict";d();ht.isIterable=wx;ht.isArrayLike=Kc;ht.isCollection=qJ;ht.getIterator=Cg;ht.getIteratorMethod=Pg;ht.createIterator=Ax;ht.forEach=UJ;ht.isAsyncIterable=GJ;ht.getAsyncIterator=xx;ht.getAsyncIteratorMethod=Lg;ht.createAsyncIterator=Rx;ht.forAwaitEach=$J;var Bc=typeof Symbol=="function"?Symbol:void 0,Rg=Bc&&Bc.iterator,FJ=ht.$$iterator=Rg||"@@iterator";function wx(e){return!!Pg(e)}function Kc(e){var t=e!=null&&e.length;return typeof t=="number"&&t>=0&&t%1===0}function qJ(e){return Object(e)===e&&(Kc(e)||wx(e))}function Cg(e){var t=Pg(e);if(t)return t.call(e)}function Pg(e){if(e!=null){var t=Rg&&e[Rg]||e["@@iterator"];if(typeof t=="function")return t}}function Ax(e){if(e!=null){var t=Cg(e);if(t)return t;if(Kc(e))return new Dg(e)}}function Dg(e){this._o=e,this._i=0}Dg.prototype[FJ]=function(){return this};Dg.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 UJ(e,t,r){if(e!=null){if(typeof e.forEach=="function")return e.forEach(t,r);var n=0,i=Cg(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(Kc(e))for(;n<e.length;n++)e.hasOwnProperty(n)&&t.call(r,e[n],n,e)}}var Ng=Bc&&Bc.asyncIterator,VJ=ht.$$asyncIterator=Ng||"@@asyncIterator";function GJ(e){return!!Lg(e)}function xx(e){var t=Lg(e);if(t)return t.call(e)}function Lg(e){if(e!=null){var t=Ng&&e[Ng]||e["@@asyncIterator"];if(typeof t=="function")return t}}function Rx(e){if(e!=null){var t=xx(e);if(t)return t;var r=Ax(e);if(r)return new Ws(r)}}function Ws(e){this._i=e}Ws.prototype[VJ]=function(){return this};Ws.prototype.next=function(e){return kg(this._i,"next",e)};Ws.prototype.return=function(e){return this._i.return?kg(this._i,"return",e):Promise.resolve({value:e,done:!0})};Ws.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 $J(e,t,r){var n=Rx(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 Nx=y(Hc=>{"use strict";d();Object.defineProperty(Hc,"__esModule",{value:!0});Hc.createEmptyIterable=void 0;var BJ=jg(),KJ=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[BJ.$$asyncIterator]=function(){return this},e};Hc.createEmptyIterable=KJ});var Cx=y(Qc=>{"use strict";d();Object.defineProperty(Qc,"__esModule",{value:!0});Qc.isASubscriptionOperation=void 0;var HJ=Qi(),QJ=function(e,t){var r=(0,HJ.getOperationAST)(e,t);return!!r&&r.operation==="subscription"};Qc.isASubscriptionOperation=QJ});var Px=y(ro=>{"use strict";d();var Et=ro&&ro.__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(ro,"__esModule",{value:!0});ro.parseLegacyProtocolMessage=void 0;var at=qs(),WJ=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};ro.parseLegacyProtocolMessage=WJ});var kx=y(Wc=>{"use strict";d();Object.defineProperty(Wc,"__esModule",{value:!0});Wc.SubscriptionServer=void 0;var Mg=Ox(),rt=qs(),Dx=Mc(),zJ=Xm(),Fg=Qi(),YJ=Nx(),qg=jg(),JJ=Cx(),Lx=Px(),XJ=function(e){return e.on},ZJ=(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||Fg.specifiedRules,this.loadExecutor(t),this.onOperation=i,this.onOperationComplete=o,this.onConnect=s,this.onDisconnect=a,this.keepAlive=u,XJ(r)?this.wsServer=r:this.wsServer=new Mg.Server(r||{});var c=(function(l,p){if(l.upgradeReq=p,l.protocol===void 0||l.protocol.indexOf(Dx.GRAPHQL_WS)===-1&&l.protocol.indexOf(Dx.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=p,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,Lx.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===Mg.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,zJ.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,YJ.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 p="Invalid params returned from onOperation! return values must be an object!";throw r.sendError(t,o,{message:p}),new Error(p)}if(!l.schema){var p="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:p}),new Error(p)}var f=typeof a.query!="string"?a.query:(0,Fg.parse)(a.query),h,g=(0,Fg.validate)(l.schema,f,r.specifiedRules);if(g.length>0)h=Promise.resolve({errors:g});else{var v=r.execute;r.subscribe&&(0,JJ.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,qg.isAsyncIterable)(_)?_:(0,qg.createAsyncIterator)([_]),params:l}})}).then(function(l){var p=l.executionIterable,f=l.params;return(0,qg.forAwaitEach)(p,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)}),p}).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,Lx.parseLegacyProtocolMessage)(t,{type:n,id:r,payload:i});o&&t.socket.readyState===Mg.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})();Wc.SubscriptionServer=ZJ});var jx=y(tr=>{"use strict";d();var e2=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]})),Ug=tr&&tr.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&e2(t,e,r)};Object.defineProperty(tr,"__esModule",{value:!0});tr.MessageTypes=void 0;Ug(PA(),tr);Ug(kx(),tr);var t2=qs();Object.defineProperty(tr,"MessageTypes",{enumerable:!0,get:function(){return t2.default}});Ug(Mc(),tr)});var kr=y((uae,qx)=>{"use strict";d();var Mx=["nodebuffer","arraybuffer","fragments"],Fx=typeof Blob<"u";Fx&&Mx.push("blob");qx.exports={BINARY_TYPES:Mx,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Fx,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var zs=y((lae,zc)=>{"use strict";d();var{EMPTY_BUFFER:r2}=kr(),Vg=Buffer[Symbol.species];function n2(e,t){if(e.length===0)return r2;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 Vg(r.buffer,r.byteOffset,n):r}function Ux(e,t,r,n,i){for(let o=0;o<i;o++)r[n+o]=e[o]^t[o&3]}function Vx(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function i2(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function Gg(e){if(Gg.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new Vg(e):ArrayBuffer.isView(e)?t=new Vg(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Gg.readOnly=!1),t}zc.exports={concat:n2,mask:Ux,toArrayBuffer:i2,toBuffer:Gg,unmask:Vx};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=M("bufferutil");zc.exports.mask=function(t,r,n,i,o){o<48?Ux(t,r,n,i,o):e.mask(t,r,n,i,o)},zc.exports.unmask=function(t,r){t.length<32?Vx(t,r):e.unmask(t,r)}}catch{}});var Bx=y((pae,$x)=>{"use strict";d();var Gx=Symbol("kDone"),$g=Symbol("kRun"),Bg=class{constructor(t){this[Gx]=()=>{this.pending--,this[$g]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[$g]()}[$g](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[Gx])}}};$x.exports=Bg});var oo=y((hae,Wx)=>{"use strict";d();var Ys=M("zlib"),Kx=zs(),o2=Bx(),{kStatusCode:Hx}=kr(),s2=Buffer[Symbol.species],a2=Buffer.from([0,0,255,255]),Jc=Symbol("permessage-deflate"),jr=Symbol("total-length"),no=Symbol("callback"),dn=Symbol("buffers"),io=Symbol("error"),Yc,Kg=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,!Yc){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Yc=new o2(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[no];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){Yc.add(i=>{this._decompress(t,r,(o,s)=>{i(),n(o,s)})})}compress(t,r,n){Yc.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"?Ys.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=Ys.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[Jc]=this,this._inflate[jr]=0,this._inflate[dn]=[],this._inflate.on("error",c2),this._inflate.on("data",Qx)}this._inflate[no]=n,this._inflate.write(t),r&&this._inflate.write(a2),this._inflate.flush(()=>{let o=this._inflate[io];if(o){this._inflate.close(),this._inflate=null,n(o);return}let s=Kx.concat(this._inflate[dn],this._inflate[jr]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[jr]=0,this._inflate[dn]=[],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"?Ys.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=Ys.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[jr]=0,this._deflate[dn]=[],this._deflate.on("data",u2)}this._deflate[no]=n,this._deflate.write(t),this._deflate.flush(Ys.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=Kx.concat(this._deflate[dn],this._deflate[jr]);r&&(o=new s2(o.buffer,o.byteOffset,o.length-4)),this._deflate[no]=null,this._deflate[jr]=0,this._deflate[dn]=[],r&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,o)})}};Wx.exports=Kg;function u2(e){this[dn].push(e),this[jr]+=e.length}function Qx(e){if(this[jr]+=e.length,this[Jc]._maxPayload<1||this[jr]<=this[Jc]._maxPayload){this[dn].push(e);return}this[io]=new RangeError("Max payload size exceeded"),this[io].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[io][Hx]=1009,this.removeListener("data",Qx),this.reset()}function c2(e){if(this[Jc]._inflate=null,this[io]){this[no](this[io]);return}e[Hx]=1007,this[no](e)}});var so=y((gae,Xc)=>{"use strict";d();var{isUtf8:zx}=M("buffer"),{hasBlob:l2}=kr(),d2=[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 p2(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function Hg(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 f2(e){return l2&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}Xc.exports={isBlob:f2,isValidStatusCode:p2,isValidUTF8:Hg,tokenChars:d2};if(zx)Xc.exports.isValidUTF8=function(e){return e.length<24?Hg(e):zx(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=M("utf-8-validate");Xc.exports.isValidUTF8=function(t){return t.length<32?Hg(t):e(t)}}catch{}});var Jg=y((vae,rR)=>{"use strict";d();var{Writable:h2}=M("stream"),Yx=oo(),{BINARY_TYPES:m2,EMPTY_BUFFER:Jx,kStatusCode:g2,kWebSocket:y2}=kr(),{concat:Qg,toArrayBuffer:v2,unmask:E2}=zs(),{isValidStatusCode:_2,isValidUTF8:Xx}=so(),Zc=Buffer[Symbol.species],Bt=0,Zx=1,eR=2,tR=3,Wg=4,zg=5,el=6,Yg=class extends h2{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||m2[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[y2]=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=Bt}_write(t,r,n){if(this._opcode===8&&this._state==Bt)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 Zc(n.buffer,n.byteOffset+t,n.length-t),new Zc(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 Zc(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 Bt:this.getInfo(t);break;case Zx:this.getPayloadLength16(t);break;case eR:this.getPayloadLength64(t);break;case tR:this.getMask();break;case Wg:this.getData(t);break;case zg:case el: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[Yx.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=Zx:this._payloadLength===127?this._state=eR: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=tR:this._state=Wg}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Wg}getData(t){let r=Jx;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&&E2(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=zg,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[Yx.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===Bt&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=Bt;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=Qg(n,r):this._binaryType==="arraybuffer"?i=v2(Qg(n,r)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=Bt):(this._state=el,setImmediate(()=>{this.emit("message",i,!0),this._state=Bt,this.startLoop(t)}))}else{let i=Qg(n,r);if(!this._skipUTF8Validation&&!Xx(i)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(o);return}this._state===zg||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=Bt):(this._state=el,setImmediate(()=>{this.emit("message",i,!1),this._state=Bt,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,Jx),this.end();else{let n=t.readUInt16BE(0);if(!_2(n)){let o=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(o);return}let i=new Zc(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!Xx(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=Bt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=Bt):(this._state=el,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=Bt,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[g2]=i,s}};rR.exports=Yg});var ey=y((Sae,oR)=>{"use strict";d();var{Duplex:_ae}=M("stream"),{randomFillSync:S2}=M("crypto"),{types:{isUint8Array:b2}}=M("util"),nR=oo(),{EMPTY_BUFFER:T2,kWebSocket:I2,NOOP:O2}=kr(),{isBlob:ao,isValidStatusCode:w2}=so(),{mask:iR,toBuffer:Yn}=zs(),Kt=Symbol("kByteLength"),A2=Buffer.alloc(4),tl=8*1024,Jn,uo=tl,rr=0,x2=1,R2=2,Xg=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=O2,this[I2]=void 0}static frame(t,r){let n,i=!1,o=2,s=!1;r.mask&&(n=r.maskBuffer||A2,r.generateMask?r.generateMask(n):(uo===tl&&(Jn===void 0&&(Jn=Buffer.alloc(tl)),S2(Jn,0,tl),uo=0),n[0]=Jn[uo++],n[1]=Jn[uo++],n[2]=Jn[uo++],n[3]=Jn[uo++]),s=(n[0]|n[1]|n[2]|n[3])===0,o=6);let a;typeof t=="string"?(!r.mask||s)&&r[Kt]!==void 0?a=r[Kt]:(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?(iR(t,n,c,o,a),[c]):(iR(t,n,t,0,a),[c,t])):[c,t]}close(t,r,n,i){let o;if(t===void 0)o=T2;else{if(typeof t!="number"||!w2(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(b2(r))o.set(r,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let s={[Kt]: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):ao(t)?(i=t.size,o=!1):(t=Yn(t),i=t.length,o=Yn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Kt]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};ao(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):ao(t)?(i=t.size,o=!1):(t=Yn(t),i=t.length,o=Yn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Kt]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};ao(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[nR.extensionName],o=r.binary?2:1,s=r.compress,a,u;typeof t=="string"?(a=Buffer.byteLength(t),u=!1):ao(t)?(a=t.size,u=!1):(t=Yn(t),a=t.length,u=Yn.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={[Kt]:a,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:u,rsv1:s};ao(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[Kt],this._state=R2,t.arrayBuffer().then(o=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Zg,this,a,i);return}this._bufferedBytes-=n[Kt];let s=Yn(o);r?this.dispatch(s,r,n,i):(this._state=rr,this.sendFrame(e.frame(s,n),i),this.dequeue())}).catch(o=>{process.nextTick(N2,this,o,i)})}dispatch(t,r,n,i){if(!r){this.sendFrame(e.frame(t,n),i);return}let o=this._extensions[nR.extensionName];this._bufferedBytes+=n[Kt],this._state=x2,o.compress(t,n.fin,(s,a)=>{if(this._socket.destroyed){let u=new Error("The socket was closed while data was being compressed");Zg(this,u,i);return}this._bufferedBytes-=n[Kt],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][Kt],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Kt],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)}};oR.exports=Xg;function Zg(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 N2(e,t,r){Zg(e,t,r),e.onerror(t)}});var hR=y((Tae,fR)=>{"use strict";d();var{kForOnEventAttribute:Js,kListener:ty}=kr(),sR=Symbol("kCode"),aR=Symbol("kData"),uR=Symbol("kError"),cR=Symbol("kMessage"),lR=Symbol("kReason"),co=Symbol("kTarget"),dR=Symbol("kType"),pR=Symbol("kWasClean"),Mr=class{constructor(t){this[co]=null,this[dR]=t}get target(){return this[co]}get type(){return this[dR]}};Object.defineProperty(Mr.prototype,"target",{enumerable:!0});Object.defineProperty(Mr.prototype,"type",{enumerable:!0});var Xn=class extends Mr{constructor(t,r={}){super(t),this[sR]=r.code===void 0?0:r.code,this[lR]=r.reason===void 0?"":r.reason,this[pR]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[sR]}get reason(){return this[lR]}get wasClean(){return this[pR]}};Object.defineProperty(Xn.prototype,"code",{enumerable:!0});Object.defineProperty(Xn.prototype,"reason",{enumerable:!0});Object.defineProperty(Xn.prototype,"wasClean",{enumerable:!0});var lo=class extends Mr{constructor(t,r={}){super(t),this[uR]=r.error===void 0?null:r.error,this[cR]=r.message===void 0?"":r.message}get error(){return this[uR]}get message(){return this[cR]}};Object.defineProperty(lo.prototype,"error",{enumerable:!0});Object.defineProperty(lo.prototype,"message",{enumerable:!0});var Xs=class extends Mr{constructor(t,r={}){super(t),this[aR]=r.data===void 0?null:r.data}get data(){return this[aR]}};Object.defineProperty(Xs.prototype,"data",{enumerable:!0});var C2={addEventListener(e,t,r={}){for(let i of this.listeners(e))if(!r[Js]&&i[ty]===t&&!i[Js])return;let n;if(e==="message")n=function(o,s){let a=new Xs("message",{data:s?o:o.toString()});a[co]=this,rl(t,this,a)};else if(e==="close")n=function(o,s){let a=new Xn("close",{code:o,reason:s.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[co]=this,rl(t,this,a)};else if(e==="error")n=function(o){let s=new lo("error",{error:o,message:o.message});s[co]=this,rl(t,this,s)};else if(e==="open")n=function(){let o=new Mr("open");o[co]=this,rl(t,this,o)};else return;n[Js]=!!r[Js],n[ty]=t,r.once?this.once(e,n):this.on(e,n)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[ty]===t&&!r[Js]){this.removeListener(e,r);break}}};fR.exports={CloseEvent:Xn,ErrorEvent:lo,Event:Mr,EventTarget:C2,MessageEvent:Xs};function rl(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var nl=y((Oae,mR)=>{"use strict";d();var{tokenChars:Zs}=so();function Er(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function P2(e){let t=Object.create(null),r=Object.create(null),n=!1,i=!1,o=!1,s,a,u=-1,c=-1,l=-1,p=0;for(;p<e.length;p++)if(c=e.charCodeAt(p),s===void 0)if(l===-1&&Zs[c]===1)u===-1&&(u=p);else if(p!==0&&(c===32||c===9))l===-1&&u!==-1&&(l=p);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${p}`);l===-1&&(l=p);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 ${p}`);else if(a===void 0)if(l===-1&&Zs[c]===1)u===-1&&(u=p);else if(c===32||c===9)l===-1&&u!==-1&&(l=p);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${p}`);l===-1&&(l=p),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,p),u=l=-1;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(i){if(Zs[c]!==1)throw new SyntaxError(`Unexpected character at index ${p}`);u===-1?u=p:n||(n=!0),i=!1}else if(o)if(Zs[c]===1)u===-1&&(u=p);else if(c===34&&u!==-1)o=!1,l=p;else if(c===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(c===34&&e.charCodeAt(p-1)===61)o=!0;else if(l===-1&&Zs[c]===1)u===-1&&(u=p);else if(u!==-1&&(c===32||c===9))l===-1&&(l=p);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${p}`);l===-1&&(l=p);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 ${p}`);if(u===-1||o||c===32||c===9)throw new SyntaxError("Unexpected end of input");l===-1&&(l=p);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 D2(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(", ")}mR.exports={format:D2,parse:P2}});var al=y((Rae,AR)=>{"use strict";d();var L2=M("events"),k2=M("https"),j2=M("http"),vR=M("net"),M2=M("tls"),{randomBytes:F2,createHash:q2}=M("crypto"),{Duplex:Aae,Readable:xae}=M("stream"),{URL:ry}=M("url"),pn=oo(),U2=Jg(),V2=ey(),{isBlob:G2}=so(),{BINARY_TYPES:gR,CLOSE_TIMEOUT:$2,EMPTY_BUFFER:il,GUID:B2,kForOnEventAttribute:ny,kListener:K2,kStatusCode:H2,kWebSocket:ze,NOOP:ER}=kr(),{EventTarget:{addEventListener:Q2,removeEventListener:W2}}=hR(),{format:z2,parse:Y2}=nl(),{toBuffer:J2}=zs(),_R=Symbol("kAborted"),iy=[8,13],Fr=["CONNECTING","OPEN","CLOSING","CLOSED"],X2=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Re=class e extends L2{constructor(t,r,n){super(),this._binaryType=gR[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=il,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]),SR(this,t,r,n)):(this._autoPong=n.autoPong,this._closeTimeout=n.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){gR.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 U2({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 V2(t,this._extensions,n.generateMask);this._receiver=i,this._sender=o,this._socket=t,i[ze]=this,o[ze]=this,t[ze]=this,i.on("conclude",t4),i.on("drain",r4),i.on("error",n4),i.on("message",i4),i.on("ping",o4),i.on("pong",s4),o.onerror=a4,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",IR),t.on("data",sl),t.on("end",OR),t.on("error",wR),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[pn.extensionName]&&this._extensions[pn.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){At(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())}),TR(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){oy(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||il,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){oy(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||il,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){oy(this,t,n);return}let i={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[pn.extensionName]||(i.compress=!1),this._sender.send(t||il,i,n)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){At(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:Fr.indexOf("CONNECTING")});Object.defineProperty(Re.prototype,"CONNECTING",{enumerable:!0,value:Fr.indexOf("CONNECTING")});Object.defineProperty(Re,"OPEN",{enumerable:!0,value:Fr.indexOf("OPEN")});Object.defineProperty(Re.prototype,"OPEN",{enumerable:!0,value:Fr.indexOf("OPEN")});Object.defineProperty(Re,"CLOSING",{enumerable:!0,value:Fr.indexOf("CLOSING")});Object.defineProperty(Re.prototype,"CLOSING",{enumerable:!0,value:Fr.indexOf("CLOSING")});Object.defineProperty(Re,"CLOSED",{enumerable:!0,value:Fr.indexOf("CLOSED")});Object.defineProperty(Re.prototype,"CLOSED",{enumerable:!0,value:Fr.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[ny])return t[K2];return null},set(t){for(let r of this.listeners(e))if(r[ny]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[ny]:!0})}})});Re.prototype.addEventListener=Q2;Re.prototype.removeEventListener=W2;AR.exports=Re;function SR(e,t,r,n){let i={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:$2,protocolVersion:iy[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,!iy.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${iy.join(", ")})`);let o;if(t instanceof ry)o=t;else try{o=new ry(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;ol(e,v);return}let c=s?443:80,l=F2(16).toString("base64"),p=s?k2.request:j2.request,f=new Set,h;if(i.createConnection=i.createConnection||(s?e4:Z2),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 pn({...i.perMessageDeflate,isServer:!1,maxPayload:i.maxPayload}),i.headers["Sec-WebSocket-Extensions"]=z2({[pn.extensionName]:h.offer()})),r.length){for(let v of r){if(typeof v!="string"||!X2.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=p(i),e._redirects&&e.emit("redirect",e.url,g)}else g=e._req=p(i);i.timeout&&g.on("timeout",()=>{At(e,g,"Opening handshake has timed out")}),g.on("error",v=>{g===null||g[_R]||(g=e._req=null,ol(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){At(e,g,"Maximum redirects exceeded");return}g.abort();let S;try{S=new ry(_,t)}catch{let A=new SyntaxError(`Invalid URL: ${_}`);ol(e,A);return}SR(e,S,r,n)}else e.emit("unexpected-response",g,v)||At(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"){At(e,_,"Invalid Upgrade header");return}let I=q2("sha1").update(l+B2).digest("base64");if(v.headers["sec-websocket-accept"]!==I){At(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){At(e,_,T);return}A&&(e._protocol=A);let D=v.headers["sec-websocket-extensions"];if(D!==void 0){if(!h){At(e,_,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let V;try{V=Y2(D)}catch{At(e,_,"Invalid Sec-WebSocket-Extensions header");return}let x=Object.keys(V);if(x.length!==1||x[0]!==pn.extensionName){At(e,_,"Server indicated an extension that was not requested");return}try{h.accept(V[pn.extensionName])}catch{At(e,_,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[pn.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 ol(e,t){e._readyState=Re.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function Z2(e){return e.path=e.socketPath,vR.connect(e)}function e4(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=vR.isIP(e.host)?"":e.host),M2.connect(e)}function At(e,t,r){e._readyState=Re.CLOSING;let n=new Error(r);Error.captureStackTrace(n,At),t.setHeader?(t[_R]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(ol,e,n)):(t.destroy(n),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function oy(e,t,r){if(t){let n=G2(t)?t.size:J2(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${e.readyState} (${Fr[e.readyState]})`);process.nextTick(r,n)}}function t4(e,t){let r=this[ze];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[ze]!==void 0&&(r._socket.removeListener("data",sl),process.nextTick(bR,r._socket),e===1005?r.close():r.close(e,t))}function r4(){let e=this[ze];e.isPaused||e._socket.resume()}function n4(e){let t=this[ze];t._socket[ze]!==void 0&&(t._socket.removeListener("data",sl),process.nextTick(bR,t._socket),t.close(e[H2])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function yR(){this[ze].emitClose()}function i4(e,t){this[ze].emit("message",e,t)}function o4(e){let t=this[ze];t._autoPong&&t.pong(e,!this._isServer,ER),t.emit("ping",e)}function s4(e){this[ze].emit("pong",e)}function bR(e){e.resume()}function a4(e){let t=this[ze];t.readyState!==Re.CLOSED&&(t.readyState===Re.OPEN&&(t._readyState=Re.CLOSING,TR(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function TR(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function IR(){let e=this[ze];if(this.removeListener("close",IR),this.removeListener("data",sl),this.removeListener("end",OR),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[ze]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",yR),e._receiver.on("finish",yR))}function sl(e){this[ze]._receiver.write(e)||this.pause()}function OR(){let e=this[ze];e._readyState=Re.CLOSING,e._receiver.end(),this.end()}function wR(){let e=this[ze];this.removeListener("error",wR),this.on("error",ER),e&&(e._readyState=Re.CLOSING,this.destroy())}});var CR=y((Pae,NR)=>{"use strict";d();var Cae=al(),{Duplex:u4}=M("stream");function xR(e){e.emit("close")}function c4(){!this.destroyed&&this._writableState.finished&&this.destroy()}function RR(e){this.removeListener("error",RR),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function l4(e,t){let r=!0,n=new u4({...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(xR,n);return}let s=!1;e.once("error",function(u){s=!0,o(u)}),e.once("close",function(){s||o(i),process.nextTick(xR,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",c4),n.on("error",RR),n}NR.exports=l4});var sy=y((Lae,PR)=>{"use strict";d();var{tokenChars:d4}=so();function p4(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&&d4[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}PR.exports={parse:p4}});var qR=y((Mae,FR)=>{"use strict";d();var f4=M("events"),ul=M("http"),{Duplex:jae}=M("stream"),{createHash:h4}=M("crypto"),DR=nl(),Zn=oo(),m4=sy(),g4=al(),{CLOSE_TIMEOUT:y4,GUID:v4,kWebSocket:E4}=kr(),_4=/^[+/0-9A-Za-z]{22}==$/,LR=0,kR=1,MR=2,ay=class extends f4{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:y4,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:g4,...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=ul.createServer((n,i)=>{let o=ul.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=S4(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=LR}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===MR){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(ea,this);return}if(t&&this.once("close",t),this._state!==kR)if(this._state=kR,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(ea,this):process.nextTick(ea,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{ea(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",jR);let o=t.headers["sec-websocket-key"],s=t.headers.upgrade,a=+t.headers["sec-websocket-version"];if(t.method!=="GET"){ei(this,t,r,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){ei(this,t,r,400,"Invalid Upgrade header");return}if(o===void 0||!_4.test(o)){ei(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){ei(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){ta(r,400);return}let u=t.headers["sec-websocket-protocol"],c=new Set;if(u!==void 0)try{c=m4.parse(u)}catch{ei(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let l=t.headers["sec-websocket-extensions"],p={};if(this.options.perMessageDeflate&&l!==void 0){let f=new Zn({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let h=DR.parse(l);h[Zn.extensionName]&&(f.accept(h[Zn.extensionName]),p[Zn.extensionName]=f)}catch{ei(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 ta(r,g||401,v,_);this.completeUpgrade(p,o,c,t,r,n,i)});return}if(!this.options.verifyClient(f))return ta(r,401)}this.completeUpgrade(p,o,c,t,r,n,i)}completeUpgrade(t,r,n,i,o,s,a){if(!o.readable||!o.writable)return o.destroy();if(o[E4])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>LR)return ta(o,503);let c=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${h4("sha1").update(r+v4).digest("base64")}`],l=new this.options.WebSocket(null,void 0,this.options);if(n.size){let p=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;p&&(c.push(`Sec-WebSocket-Protocol: ${p}`),l._protocol=p)}if(t[Zn.extensionName]){let p=t[Zn.extensionName].params,f=DR.format({[Zn.extensionName]:[p]});c.push(`Sec-WebSocket-Extensions: ${f}`),l._extensions=t}this.emit("headers",c,i),o.write(c.concat(`\r
|
|
208
|
-
`).join(`\r
|
|
209
|
-
`)),o.removeListener("error",jR),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(ea,this)})),a(l,i)}};FR.exports=ay;function S4(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 ea(e){e._state=MR,e.emit("close")}function jR(){this.destroy()}function ta(e,t,r,n){r=r||ul.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} ${ul.STATUS_CODES[t]}\r
|
|
210
|
-
`+Object.keys(n).map(i=>`${i}: ${n[i]}`).join(`\r
|
|
211
|
-
`)+`\r
|
|
212
|
-
\r
|
|
213
|
-
`+r)}function ei(e,t,r,n,i,o){if(e.listenerCount("wsClientError")){let s=new Error(i);Error.captureStackTrace(s,ei),e.emit("wsClientError",s,r,t)}else ta(r,n,i,o)}});d();import{spawn as dX}from"child_process";import{randomUUID as pX}from"crypto";import{closeSync as fX,openSync as hX}from"fs";import{promises as mX}from"fs";import MP from"path";d();var jv=Qe(kv(),1),{program:VX,createCommand:GX,createArgument:$X,createOption:BX,CommanderError:KX,InvalidArgumentError:fd,InvalidOptionArgumentError:HX,Command:Mv,Argument:QX,Option:WX,Help:zX}=jv.default;d();d();var mb=Qe(Mo(),1);import{promises as $r}from"fs";import wq from"os";import bn from"path";import{randomUUID as Aq}from"crypto";var Sr=class{workspaceRoot;mcpConfigDir;credentialsPath;configPath;projectContextPath;globalConfigDir=bn.join(wq.homedir(),`.${X}`);globalCredentialsPath=bn.join(this.globalConfigDir,"credentials.json");constructor(t){this.setWorkspaceRoot(t)}setWorkspaceRoot(t){this.workspaceRoot=t,this.mcpConfigDir=bn.join(t,`.${X}`),this.credentialsPath=bn.join(this.mcpConfigDir,"credentials.json"),this.configPath=bn.join(this.mcpConfigDir,"config.json"),this.projectContextPath=bn.join(this.mcpConfigDir,"project-context.json")}async ensureInitialized(){await $r.mkdir(this.mcpConfigDir,{recursive:!0});let t=bn.join(this.mcpConfigDir,".gitignore"),r="*";try{await $r.writeFile(t,r,{flag:"wx"})}catch(n){if(n.code!=="EEXIST")throw n}}tempPathFor(t){return`${t}.${process.pid}.${Aq()}.tmp`}async atomicWrite(t,r,n){let i=this.tempPathFor(t);await $r.writeFile(i,JSON.stringify(r,null,2),n!==void 0?{mode:n}:void 0),await $r.rename(i,t)}async readJsonFile(t){try{let r=await $r.readFile(t,"utf8");return JSON.parse(r)}catch(r){if(r.code==="ENOENT")return null;throw r}}async unlinkIfExists(t){try{await $r.unlink(t)}catch(r){if(r.code!=="ENOENT")throw r}}async fileExists(t){try{return await $r.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 $r.mkdir(this.globalConfigDir,{recursive:!0}),await this.atomicWrite(this.globalCredentialsPath,r,384)),C.info("[CredentialStore] Credentials saved successfully")}async loadCredentials(){let t=await this.readJsonFile(this.credentialsPath);if(t){if(this.validateCredentials(t))return t;C.error("[CredentialStore] Workspace credentials are invalid or expired")}let r=await this.readJsonFile(this.globalCredentialsPath);if(r){if(this.validateCredentials(r))return r;C.error("[CredentialStore] Global credentials are invalid or expired")}return null}validateCredentials(t){if(!t||!t.access_token)return C.error("[CredentialStore] Missing access token"),!1;if(t.token_type!=="Bearer")return C.error("[CredentialStore] Invalid token type:",t.token_type),!1;try{let r=mb.default.decode(t.access_token,{complete:!0});if(!r||typeof r=="string")return C.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 C.error("[CredentialStore] JWT token has expired"),!1;let s=Math.floor((i-o)/1e3/60);C.debug(`[CredentialStore] Token valid for ${s} more minutes`)}else console.warn("[CredentialStore] JWT token does not have expiration field");return n.iss&&C.debug(`[CredentialStore] Token issued by: ${n.iss}`),n.sub&&C.debug(`[CredentialStore] Token subject: ${n.sub}`),!0}catch(r){return C.error("[CredentialStore] Error validating JWT token:",r.message),!1}}async deleteCredentials(){await this.unlinkIfExists(this.credentialsPath),await this.unlinkIfExists(this.globalCredentialsPath),C.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){await this.ensureInitialized();let r={projectExId:t,lastUsed:new Date().toISOString()};await this.atomicWrite(this.projectContextPath,r)}async loadProjectContext(){return this.readJsonFile(this.projectContextPath)}async deleteProjectContext(){await this.unlinkIfExists(this.projectContextPath)}getWorkspaceRoot(){return this.workspaceRoot}getMcpConfigDir(){return this.mcpConfigDir}};d();var C0=Qe(Mo(),1);d();d();var Tn=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)})`}};d();d();d();var np=e=>e.toUpperCase(),eu=e=>typeof e=="function"?e():e,ip=(e,t)=>e.map((r,n)=>[r,t[n]]),In=e=>{let t={};return e instanceof Headers?t=xq(e):Array.isArray(e)?e.forEach(([r,n])=>{r&&n!==void 0&&(t[r]=n)}):e&&(t=e),t},xq=e=>{let t={};return e.forEach((r,n)=>{t[n]=r}),t},yb=e=>{try{let t=e();return Rq(t)?t.catch(r=>gb(r)):t}catch(t){return gb(t)}},gb=e=>e instanceof Error?e:new Error(String(e)),Rq=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",tu=e=>{throw new Error(`Unhandled case: ${String(e)}`)},Fo=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);d();var vb=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0};d();var Eb=(e,t,r)=>e.query?e:{query:e,variables:t,requestHeaders:r,signal:void 0};d();d();var y0=Qe(Qi(),1);d();var Gm="Accept",xc="Content-Type",ks="application/json",Rc="application/graphql-response+json";var $m=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),v0=e=>{let t=e.toLowerCase();return t.includes(Rc)||t.includes(ks)},Bm=e=>{try{if(Array.isArray(e))return{_tag:"Batch",executionResults:e.map(m0)};if(Fo(e))return{_tag:"Single",executionResult:m0(e)};throw new Error(`Invalid execution result: result is not object or array.
|
|
214
|
-
Got:
|
|
215
|
-
${String(e)}`)}catch(t){return t}},m0=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(!Fo(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(!Fo(e.data)&&e.data!==null)throw new Error("Invalid execution result: data is not plain object");r=e.data}if("extensions"in e){if(!Fo(e.extensions))throw new Error("Invalid execution result: extensions is not plain object");n=e.extensions}return{data:r,errors:t,extensions:n}},E0=e=>e._tag==="Batch"?e.executionResults.some(g0):g0(e.executionResult),g0=e=>Array.isArray(e.errors)?e.errors.length>0:!!e.errors,Km=e=>typeof e=="object"&&e!==null&&"kind"in e&&e.kind===y0.Kind.OPERATION_DEFINITION;var _0=Qe(Qi(),1),S0=Qe(Qi(),1),Fz=e=>{let t,r=e.definitions.filter(Km);return r.length===1&&(t=r[0].name?.value),t},qz=e=>{let t=!1,r=e.definitions.filter(Km);return r.length===1&&(t=r[0].operation==="mutation"),t},js=(e,t)=>{let r=typeof e=="string"||"kind"in e?e:String(e),n=typeof r=="string"?r:(0,S0.print)(r),i=!1,o;if(t)return{expression:n,isMutation:i,operationName:o};let s=yb(()=>typeof r=="string"?(0,_0.parse)(r):r);return s instanceof Error?{expression:n,isMutation:i,operationName:o}:(o=Fz(s),i=qz(s),{expression:n,operationName:o,isMutation:i})};d();d();var Nc=JSON;var Cc=async e=>{let t={...e,method:e.request._tag==="Single"?e.request.document.isMutation?"POST":np(e.method??"post"):e.request.hasMutations?"POST":np(e.method??"post"),fetchOptions:{...e.fetchOptions,errorPolicy:e.fetchOptions.errorPolicy??"none"}},n=await Vz(t.method)(t),i=await n.text(),o;try{o=Uz(i,n.headers.get(xc),e.fetchOptions.jsonSerializer??Nc)}catch(a){o=a}let s={status:n.status,headers:n.headers,body:i};if(!n.ok){if(o instanceof Error)return new Tn({...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 Tn(a,{query:e.request._tag==="Single"?e.request.document.expression:e.request.query,variables:e.request.variables})}if(o instanceof Error)throw o;if(E0(o)&&t.fetchOptions.errorPolicy==="none"){let a=o._tag==="Batch"?{...o.executionResults,...s}:{...o.executionResult,...s};return new Tn(a,{query:e.request._tag==="Single"?e.request.document.expression:e.request.query,variables:e.request.variables})}switch(o._tag){case"Single":return{...s,...b0(t)(o.executionResult)};case"Batch":return{...s,data:o.executionResults.map(b0(t))};default:tu(o)}},b0=e=>t=>({extensions:t.extensions,data:t.data,errors:e.fetchOptions.errorPolicy==="all"?t.errors:void 0}),Uz=(e,t,r)=>t&&v0(t)?Bm(r.parse(e)):Bm(e),Vz=e=>async t=>{let r=new Headers(t.headers),n=null,i;r.has(Gm)||r.set(Gm,[Rc,ks].join(", ")),e==="POST"?(i=(t.fetchOptions.jsonSerializer??Nc).stringify(Gz(t)),typeof i=="string"&&!r.has(xc)&&r.set(xc,ks)):n=$z(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,...p}=c;s=new URL(l),a=p}return n&&n.forEach((c,l)=>{s.searchParams.append(l,c)}),await(t.fetch??fetch)(s,a)},Gz=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 ip(e.request.query,e.request.variables??[]).map(([t,r])=>({query:t,variables:r}));default:throw tu(e.request)}},$z=e=>{let t=e.fetchOptions.jsonSerializer??Nc,r=new URLSearchParams;switch(e.request._tag){case"Single":return r.append("query",$m(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($m),o=ip(i,n).map(([s,a])=>({query:s,variables:a}));return r.append("query",t.stringify(o)),r}default:throw tu(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=Eb(r,n,i),{headers:s,fetch:a=globalThis.fetch,method:u="POST",requestMiddleware:c,responseMiddleware:l,excludeOperationName:p,...f}=this.requestConfig,{url:h}=this;o.signal!==void 0&&(f.signal=o.signal);let g=js(o.query,p),v=await Cc({url:h,request:{_tag:"Single",document:g,variables:o.variables},headers:{...In(eu(s)),...In(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=T0(t,n,i),{headers:s,fetch:a=globalThis.fetch,method:u="POST",requestMiddleware:c,responseMiddleware:l,excludeOperationName:p,...f}=this.requestConfig,{url:h}=this;o.signal!==void 0&&(f.signal=o.signal);let g=js(o.document,p),v=await Cc({url:h,request:{_tag:"Single",document:g,variables:o.variables},headers:{...In(eu(s)),...In(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=vb(t,r),{headers:i,excludeOperationName:o,...s}=this.requestConfig;n.signal!==void 0&&(s.signal=n.signal);let a=n.documents.map(({document:f})=>js(f,o)),u=a.map(({expression:f})=>f),c=a.some(({isMutation:f})=>f),l=n.documents.map(({variables:f})=>f),p=await Cc({url:this.url,request:{_tag:"Batch",operationName:void 0,query:u,hasMutations:c,variables:l},headers:{...In(eu(i)),...In(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(p,{operationName:void 0,variables:l,url:this.url}),p instanceof Error)throw p;return p.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 T0=(e,t,r)=>e.document?e:{document:e,variables:t,requestHeaders:r,signal:void 0};d();var B=(e,...t)=>e.reduce((r,n,i)=>`${r}${n}${i in t?String(t[i]):""}`,"");d();var N0=Qe(R0(),1);(0,N0.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 oY=.25,sY=300*1e3,aY=3600*1e3,uY="query { refreshToken { accessToken } }",zi=class{store;lastRefreshAt=Date.now();constructor(t){this.store=t}async getValidToken(){let t=await this.store.loadCredentials();if(!t)throw new Error(_a);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){C.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(uY)).refreshToken?.accessToken;return o?(await this.store.saveCredentials({access_token:o,token_type:"Bearer"}),this.lastRefreshAt=Date.now(),C.info("[TokenManager] Access token refreshed"),o):(C.debug("[TokenManager] refreshToken returned no accessToken - keeping current token"),null)}catch(r){return C.debug(`[TokenManager] Token refresh failed - keeping current token: ${r.message}`),null}}isDue(t){try{let r=C0.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*oY:sY;if(o<s)return!0;let a=n.iat!=null?n.iat*1e3:this.lastRefreshAt;return i-a>=aY}catch{return!1}}};d();import{EventEmitter as l5}from"events";d();import{randomUUID as sa}from"crypto";d();d();var P0=B`
|
|
216
|
-
query TabBarIcons {
|
|
217
|
-
getTabBarIcons {
|
|
218
|
-
exId
|
|
219
|
-
url
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
`,D0=B`
|
|
223
|
-
fragment SchemaCrdtPatch on SchemaCrdtPatch {
|
|
224
|
-
exId
|
|
225
|
-
createdAt
|
|
226
|
-
content
|
|
227
|
-
patchBase64
|
|
228
|
-
}
|
|
229
|
-
`,Qm=B`
|
|
230
|
-
fragment SchemaCrdtPatches on SchemaCrdtPatches {
|
|
231
|
-
lastPatchExId
|
|
232
|
-
patches {
|
|
233
|
-
...SchemaCrdtPatch
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
${D0}
|
|
237
|
-
`,Dc=B`
|
|
238
|
-
query FuzzySearchProjectName(
|
|
239
|
-
$projectName: String!
|
|
240
|
-
$paginator: ConnectionPaginatorInput
|
|
241
|
-
) {
|
|
242
|
-
fuzzySearchProjectName(projectName: $projectName, paginator: $paginator) {
|
|
243
|
-
pageInfo {
|
|
244
|
-
hasNextPage
|
|
245
|
-
endCursor {
|
|
246
|
-
value
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
edges {
|
|
250
|
-
node {
|
|
251
|
-
exId
|
|
252
|
-
type
|
|
253
|
-
name
|
|
254
|
-
updatedAt
|
|
255
|
-
hasPublished
|
|
256
|
-
webProdDomain
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
`,Hn=B`
|
|
262
|
-
query FetchAppDetailByExId(
|
|
263
|
-
$projectExId: String!
|
|
264
|
-
$appExId: String
|
|
265
|
-
$appVersionExId: String
|
|
266
|
-
) {
|
|
267
|
-
# Non-reconciling resolver: the plain fetchAppDetailByExId is gated by the
|
|
268
|
-
# backend @ReconciledSchema aspect, which demands an X-ZED-VERSION header and
|
|
269
|
-
# migrates the project schema on read (ZED_VERSION_MISSING otherwise). The
|
|
270
|
-
# alias keeps the response key stable so generated types stay valid.
|
|
271
|
-
fetchAppDetailByExId: fetchAppDetailByExIdWithoutReconcile(
|
|
272
|
-
projectExId: $projectExId
|
|
273
|
-
appExId: $appExId
|
|
274
|
-
appVersionExId: $appVersionExId
|
|
275
|
-
) {
|
|
276
|
-
projectExId
|
|
277
|
-
appExId
|
|
278
|
-
appType
|
|
279
|
-
... on WebApp {
|
|
280
|
-
name
|
|
281
|
-
createdAt
|
|
282
|
-
lastOpenedAt
|
|
283
|
-
collaboratorTypeByLevel
|
|
284
|
-
hasPublished
|
|
285
|
-
config {
|
|
286
|
-
favicon
|
|
287
|
-
customDomain
|
|
288
|
-
}
|
|
289
|
-
isExpired
|
|
290
|
-
additional
|
|
291
|
-
project {
|
|
292
|
-
...ProjectDetails
|
|
293
|
-
lastDeployedServerSchemaExId
|
|
294
|
-
}
|
|
295
|
-
latestDeployedServerSchema
|
|
296
|
-
lastUploadedSchema: latestSchema {
|
|
297
|
-
exId
|
|
298
|
-
crdtModelUrl
|
|
299
|
-
crdtPatches {
|
|
300
|
-
...SchemaCrdtPatches
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
... on WechatMiniProgramApp {
|
|
305
|
-
name
|
|
306
|
-
createdAt
|
|
307
|
-
lastOpenedAt
|
|
308
|
-
collaboratorTypeByLevel
|
|
309
|
-
hasPublished
|
|
310
|
-
config {
|
|
311
|
-
...WechatConfigFragment
|
|
312
|
-
}
|
|
313
|
-
debugScriptUrl
|
|
314
|
-
wechatMiniAppPreviewTime
|
|
315
|
-
wechatMiniAppPreviewVersion
|
|
316
|
-
isExpired
|
|
317
|
-
additional
|
|
318
|
-
project {
|
|
319
|
-
...ProjectDetails
|
|
320
|
-
lastDeployedServerSchemaExId
|
|
321
|
-
}
|
|
322
|
-
latestDeployedServerSchema
|
|
323
|
-
lastUploadedSchema: latestSchema {
|
|
324
|
-
exId
|
|
325
|
-
crdtModelUrl
|
|
326
|
-
crdtPatches {
|
|
327
|
-
...SchemaCrdtPatches
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
... on MobileApp {
|
|
332
|
-
name
|
|
333
|
-
createdAt
|
|
334
|
-
lastOpenedAt
|
|
335
|
-
collaboratorTypeByLevel
|
|
336
|
-
hasPublished
|
|
337
|
-
isExpired
|
|
338
|
-
additional
|
|
339
|
-
project {
|
|
340
|
-
...ProjectDetails
|
|
341
|
-
lastDeployedServerSchemaExId
|
|
342
|
-
}
|
|
343
|
-
latestDeployedServerSchema
|
|
344
|
-
lastUploadedSchema: latestSchema {
|
|
345
|
-
exId
|
|
346
|
-
crdtModelUrl
|
|
347
|
-
crdtPatches {
|
|
348
|
-
...SchemaCrdtPatches
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
... on Project {
|
|
353
|
-
...ProjectDetails
|
|
354
|
-
lastUploadedSchema: latestSchema {
|
|
355
|
-
exId
|
|
356
|
-
crdtModelUrl
|
|
357
|
-
crdtPatches {
|
|
358
|
-
...SchemaCrdtPatches
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
deploymentEnvConfigs {
|
|
362
|
-
exId
|
|
363
|
-
userDeploymentEnvironment
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
fragment ProjectDetails on Project {
|
|
370
|
-
exId
|
|
371
|
-
createdAt
|
|
372
|
-
updatedAt
|
|
373
|
-
name
|
|
374
|
-
projectName
|
|
375
|
-
collaboratorType
|
|
376
|
-
collaboratorTypeByLevel
|
|
377
|
-
schemaExId
|
|
378
|
-
debugScriptUrl
|
|
379
|
-
callbackConfigUrlPrefix
|
|
380
|
-
wechatMiniAppPreviewVersion
|
|
381
|
-
wechatMiniAppPreviewTime
|
|
382
|
-
adminToken
|
|
383
|
-
forBeginnerGuide
|
|
384
|
-
hasPublished
|
|
385
|
-
zeroUrl
|
|
386
|
-
zeroSubscriptionUrl
|
|
387
|
-
lastDeployedServerSchemaExId
|
|
388
|
-
relatedTemplate {
|
|
389
|
-
exId
|
|
390
|
-
}
|
|
391
|
-
projectConfig {
|
|
392
|
-
...ProjectConfigFragment
|
|
393
|
-
}
|
|
394
|
-
appList {
|
|
395
|
-
projectExId
|
|
396
|
-
appExId
|
|
397
|
-
appType
|
|
398
|
-
name
|
|
399
|
-
lastOpenedAt
|
|
400
|
-
collaboratorType
|
|
401
|
-
collaboratorTypeByLevel
|
|
402
|
-
hasPublished
|
|
403
|
-
expireAt
|
|
404
|
-
isExpired
|
|
405
|
-
isRenewable
|
|
406
|
-
additional
|
|
407
|
-
}
|
|
408
|
-
vectorStorageSupported
|
|
409
|
-
isExpired
|
|
410
|
-
webFreeProdDomain
|
|
411
|
-
allowCopyToOtherProjects
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
fragment ProjectConfigFragment on ProjectConfig {
|
|
415
|
-
wechatAppConfig {
|
|
416
|
-
...WechatConfigFragment
|
|
417
|
-
}
|
|
418
|
-
webConfig {
|
|
419
|
-
favicon
|
|
420
|
-
customDomain
|
|
421
|
-
}
|
|
422
|
-
aliyunSmsConfig {
|
|
423
|
-
powerOfAttorneyImageExId
|
|
424
|
-
signature {
|
|
425
|
-
description
|
|
426
|
-
signSource
|
|
427
|
-
signature
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
emailConfig {
|
|
431
|
-
emailPassword
|
|
432
|
-
emailProvider
|
|
433
|
-
emailSender
|
|
434
|
-
}
|
|
435
|
-
aliPayConfig {
|
|
436
|
-
appId
|
|
437
|
-
merchantPrivateKey
|
|
438
|
-
alipayPublicKey
|
|
439
|
-
notifyUrl
|
|
440
|
-
paymentConfigVersion
|
|
441
|
-
}
|
|
442
|
-
stripePayConfig {
|
|
443
|
-
stripePrivateKey
|
|
444
|
-
stripePublicKey
|
|
445
|
-
callbackUrl
|
|
446
|
-
endpointSecret
|
|
447
|
-
paymentConfigVersion
|
|
448
|
-
}
|
|
449
|
-
wechatPayConfig {
|
|
450
|
-
appId
|
|
451
|
-
mchId
|
|
452
|
-
mchKey
|
|
453
|
-
notifyUrl
|
|
454
|
-
paymentConfigVersion
|
|
455
|
-
wechatPaymentBase64CertFileExId
|
|
456
|
-
}
|
|
457
|
-
supportedPlatforms
|
|
458
|
-
registerToken
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
fragment WechatConfigFragment on WechatAppConfig {
|
|
462
|
-
appId
|
|
463
|
-
wechatAppId
|
|
464
|
-
wechatAppSecret
|
|
465
|
-
hasGrantedThirdPartyAuthorization
|
|
466
|
-
wechatPaymentMerchantId
|
|
467
|
-
wechatPaymentMerchantKey
|
|
468
|
-
wechatPaymentNotifyUrl
|
|
469
|
-
paymentConfigVersion
|
|
470
|
-
wechatPaymentBase64CertFileExId
|
|
471
|
-
wechatPrivateKeyFileExId
|
|
472
|
-
wechatBetaAppExpireAt
|
|
473
|
-
wechatBetaAppId
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
${Qm}
|
|
477
|
-
`,cY=B`
|
|
478
|
-
fragment OrganizationForAgent on Organization {
|
|
479
|
-
exId
|
|
480
|
-
displayName
|
|
481
|
-
ownerName
|
|
482
|
-
planType
|
|
483
|
-
planExpireAt
|
|
484
|
-
permissionEnabled
|
|
485
|
-
permissionRoleLimit
|
|
486
|
-
capabilities {
|
|
487
|
-
capability
|
|
488
|
-
limit {
|
|
489
|
-
amount
|
|
490
|
-
unlimited
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
`,Lc=B`
|
|
495
|
-
query FetchCurrentUserInfoForAgent {
|
|
496
|
-
user {
|
|
497
|
-
exId
|
|
498
|
-
email
|
|
499
|
-
phoneNumber
|
|
500
|
-
username
|
|
501
|
-
displayName
|
|
502
|
-
availableTechnicalSupportHours
|
|
503
|
-
daysSinceRegistration
|
|
504
|
-
involvedProjectCount
|
|
505
|
-
currentOrganization {
|
|
506
|
-
exId
|
|
507
|
-
}
|
|
508
|
-
organization {
|
|
509
|
-
exId
|
|
510
|
-
}
|
|
511
|
-
organizations {
|
|
512
|
-
exId
|
|
513
|
-
}
|
|
514
|
-
joinedOrganizations {
|
|
515
|
-
exId
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
`,L0=B`
|
|
520
|
-
query FetchAccountProfileForAgent {
|
|
521
|
-
user {
|
|
522
|
-
exId
|
|
523
|
-
email
|
|
524
|
-
phoneNumber
|
|
525
|
-
username
|
|
526
|
-
displayName
|
|
527
|
-
availableTechnicalSupportHours
|
|
528
|
-
daysSinceRegistration
|
|
529
|
-
involvedProjectCount
|
|
530
|
-
joinedOrganizations {
|
|
531
|
-
...OrganizationForAgent
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
${cY}
|
|
537
|
-
`,k0=B`
|
|
538
|
-
mutation CreateProjectInOrganizationForAgent(
|
|
539
|
-
$projectName: String!
|
|
540
|
-
$templateExId: String
|
|
541
|
-
$platform: Platform
|
|
542
|
-
$projectSpaceType: ProjectSpaceType!
|
|
543
|
-
$organizationExId: String!
|
|
544
|
-
$forBeginnerGuide: Boolean
|
|
545
|
-
$category: ProjectContentCategory
|
|
546
|
-
$useRefactoredComponent: Boolean
|
|
547
|
-
$useNewType: Boolean
|
|
548
|
-
) {
|
|
549
|
-
createProjectInOrganizationAsync(
|
|
550
|
-
projectName: $projectName
|
|
551
|
-
templateExId: $templateExId
|
|
552
|
-
platform: $platform
|
|
553
|
-
projectSpaceType: $projectSpaceType
|
|
554
|
-
organizationExId: $organizationExId
|
|
555
|
-
forBeginnerGuide: $forBeginnerGuide
|
|
556
|
-
category: $category
|
|
557
|
-
useRefactoredComponent: $useRefactoredComponent
|
|
558
|
-
useNewType: $useNewType
|
|
559
|
-
)
|
|
560
|
-
}
|
|
561
|
-
`,j0=B`
|
|
562
|
-
query GetFeaturesForAgent($projectExId: String) {
|
|
563
|
-
features(projectExId: $projectExId) {
|
|
564
|
-
featureName
|
|
565
|
-
enabled
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
`,M0=B`
|
|
569
|
-
mutation RenameProjectForAgent($projectExId: String!, $projectName: String!) {
|
|
570
|
-
renameProject(projectExId: $projectExId, projectName: $projectName) {
|
|
571
|
-
projectName
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
`,F0=B`
|
|
575
|
-
mutation RenameAppForAgent(
|
|
576
|
-
$projectExId: String!
|
|
577
|
-
$appExId: String!
|
|
578
|
-
$appName: String!
|
|
579
|
-
) {
|
|
580
|
-
renameApp(projectExId: $projectExId, appName: $appName, appExId: $appExId) {
|
|
581
|
-
name
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
`,q0=B`
|
|
585
|
-
mutation DeleteProjectForAgent($projectExId: String!) {
|
|
586
|
-
deleteProject(projectExId: $projectExId)
|
|
587
|
-
}
|
|
588
|
-
`,U0=B`
|
|
589
|
-
mutation ResetProjectForAgent(
|
|
590
|
-
$projectExId: String!
|
|
591
|
-
$languageType: LanguageType!
|
|
592
|
-
) {
|
|
593
|
-
resetProject(projectExId: $projectExId, languageType: $languageType)
|
|
594
|
-
}
|
|
595
|
-
`,V0=B`
|
|
596
|
-
query FetchProjectRuntimeAdminAccess(
|
|
597
|
-
$projectExId: String!
|
|
598
|
-
$appExId: String
|
|
599
|
-
$appVersionExId: String
|
|
600
|
-
) {
|
|
601
|
-
fetchAppDetailByExIdWithoutReconcile(
|
|
602
|
-
projectExId: $projectExId
|
|
603
|
-
appExId: $appExId
|
|
604
|
-
appVersionExId: $appVersionExId
|
|
605
|
-
) {
|
|
606
|
-
appType
|
|
607
|
-
... on WebApp {
|
|
608
|
-
project {
|
|
609
|
-
adminToken
|
|
610
|
-
zeroUrl
|
|
611
|
-
adminZeroUrl
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
... on WechatMiniProgramApp {
|
|
615
|
-
project {
|
|
616
|
-
adminToken
|
|
617
|
-
zeroUrl
|
|
618
|
-
adminZeroUrl
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
... on Project {
|
|
622
|
-
adminToken
|
|
623
|
-
zeroUrl
|
|
624
|
-
adminZeroUrl
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
`,G0=B`
|
|
629
|
-
query FetchCrdtSchemaBySchemaExId($schemaExId: String!) {
|
|
630
|
-
crdtSchemaBySchemaExId(schemaExId: $schemaExId) {
|
|
631
|
-
crdtModelUrl
|
|
632
|
-
crdtPatches {
|
|
633
|
-
...SchemaCrdtPatches
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
${Qm}
|
|
638
|
-
`,$0=B`
|
|
639
|
-
query SchemaCrdtPatchInputFields {
|
|
640
|
-
__type(name: "SchemaCrdtPatchCreationDtoInput") {
|
|
641
|
-
inputFields {
|
|
642
|
-
name
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
`,B0=B`
|
|
647
|
-
mutation BatchCreateSchemaCrdtPatch(
|
|
648
|
-
$projectExId: String!
|
|
649
|
-
$appExId: String
|
|
650
|
-
$schemaExId: String!
|
|
651
|
-
$patches: [SchemaCrdtPatchCreationDtoInput!]!
|
|
652
|
-
) {
|
|
653
|
-
batchCreateSchemaCrdtPatch(
|
|
654
|
-
projectExId: $projectExId
|
|
655
|
-
appExId: $appExId
|
|
656
|
-
schemaExId: $schemaExId
|
|
657
|
-
patches: $patches
|
|
658
|
-
) {
|
|
659
|
-
...SchemaCrdtPatch
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
${D0}
|
|
663
|
-
`,Wm=B`
|
|
664
|
-
mutation SaveSchema(
|
|
665
|
-
$projectExId: String!
|
|
666
|
-
$appExId: String
|
|
667
|
-
$versionExId: String
|
|
668
|
-
) {
|
|
669
|
-
saveSchema(
|
|
670
|
-
projectExId: $projectExId
|
|
671
|
-
appExId: $appExId
|
|
672
|
-
versionExId: $versionExId
|
|
673
|
-
)
|
|
674
|
-
}
|
|
675
|
-
`,K0=B`
|
|
676
|
-
subscription OnNewCrdtPatchV2(
|
|
677
|
-
$projectExId: String!
|
|
678
|
-
$appExId: String
|
|
679
|
-
$versionExId: String
|
|
680
|
-
$latestPatchExIdInClient: String
|
|
681
|
-
) {
|
|
682
|
-
onNewCrdtPatchV2(
|
|
683
|
-
projectExId: $projectExId
|
|
684
|
-
appExId: $appExId
|
|
685
|
-
versionExId: $versionExId
|
|
686
|
-
shouldExcludeSameSessionDiffs: true
|
|
687
|
-
latestPatchExIdInClient: $latestPatchExIdInClient
|
|
688
|
-
) {
|
|
689
|
-
...SchemaCrdtPatches
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
${Qm}
|
|
693
|
-
`,H0=B`
|
|
694
|
-
subscription OnSchemaUploadV3(
|
|
695
|
-
$projectExId: String!
|
|
696
|
-
$appExId: String
|
|
697
|
-
$appVersionExId: String
|
|
698
|
-
) {
|
|
699
|
-
onSchemaUploadV3(
|
|
700
|
-
projectExId: $projectExId
|
|
701
|
-
appExId: $appExId
|
|
702
|
-
shouldExcludeSameSessionEvent: true
|
|
703
|
-
appVersionExId: $appVersionExId
|
|
704
|
-
) {
|
|
705
|
-
... on SchemaUploadEndV3 {
|
|
706
|
-
__typename
|
|
707
|
-
schemaExId
|
|
708
|
-
continuous
|
|
709
|
-
}
|
|
710
|
-
... on SchemaUploadStartV3 {
|
|
711
|
-
__typename
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
`,Q0=B`
|
|
716
|
-
mutation DeployV2ForAgent(
|
|
717
|
-
$schemaExId: String!
|
|
718
|
-
$projectExId: String!
|
|
719
|
-
$appExId: String
|
|
720
|
-
$buildTarget: BuildTarget!
|
|
721
|
-
) {
|
|
722
|
-
deployV2(
|
|
723
|
-
schemaExId: $schemaExId
|
|
724
|
-
projectExId: $projectExId
|
|
725
|
-
appExId: $appExId
|
|
726
|
-
buildTarget: $buildTarget
|
|
727
|
-
)
|
|
728
|
-
}
|
|
729
|
-
`,W0=B`
|
|
730
|
-
mutation ValidateAndDeploySupportServiceForAgent(
|
|
731
|
-
$schemaExId: String!
|
|
732
|
-
$projectExId: String!
|
|
733
|
-
$appExId: String
|
|
734
|
-
) {
|
|
735
|
-
validateAndDeploy(
|
|
736
|
-
schemaExId: $schemaExId
|
|
737
|
-
projectExId: $projectExId
|
|
738
|
-
appExId: $appExId
|
|
739
|
-
) {
|
|
740
|
-
appExId
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
`,z0=B`
|
|
744
|
-
query ResourceUsageAndBurstInfoForAgent(
|
|
745
|
-
$projectExId: String!
|
|
746
|
-
$nonRealTimeDisplayedResourceTypes: [ResourceType]
|
|
747
|
-
) {
|
|
748
|
-
resourceUsageAndBurstInfo(
|
|
749
|
-
projectExId: $projectExId
|
|
750
|
-
nonRealTimeDisplayedResourceTypes: $nonRealTimeDisplayedResourceTypes
|
|
751
|
-
) {
|
|
752
|
-
projectResourceUsageInfo {
|
|
753
|
-
availableAmountWithNoExhaustionBurst
|
|
754
|
-
resourceType
|
|
755
|
-
resourceUsageStatus
|
|
756
|
-
usedAmount
|
|
757
|
-
unlimited
|
|
758
|
-
}
|
|
759
|
-
unitComputingPower
|
|
760
|
-
visitTimesSupportedByComputingPower
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
`,Y0=B`
|
|
764
|
-
mutation RefreshAllProjectResourcesForAgent($projectExId: String!) {
|
|
765
|
-
refreshAllProjectResources(projectExId: $projectExId)
|
|
766
|
-
}
|
|
767
|
-
`,J0=B`
|
|
768
|
-
query MonthlyResourceUsageHistoryForAgent(
|
|
769
|
-
$projectExId: String!
|
|
770
|
-
$resourceType: ResourceType!
|
|
771
|
-
) {
|
|
772
|
-
monthlyResourceUsageHistory(
|
|
773
|
-
projectExId: $projectExId
|
|
774
|
-
resourceType: $resourceType
|
|
775
|
-
)
|
|
776
|
-
}
|
|
777
|
-
`,X0=B`
|
|
778
|
-
query DailyResourceUsageHistoryForAgent(
|
|
779
|
-
$projectExId: String!
|
|
780
|
-
$resourceType: ResourceType!
|
|
781
|
-
) {
|
|
782
|
-
dailyResourceUsageHistory(
|
|
783
|
-
projectExId: $projectExId
|
|
784
|
-
resourceType: $resourceType
|
|
785
|
-
)
|
|
786
|
-
}
|
|
787
|
-
`,Z0=B`
|
|
788
|
-
query ActiveSingleTenantResourceInfoForAgent($projectExId: String!) {
|
|
789
|
-
findActiveSingleTenantResourceInfoAndThrowOnExpireTimeMismatch(
|
|
790
|
-
projectExId: $projectExId
|
|
791
|
-
) {
|
|
792
|
-
amount
|
|
793
|
-
expireAt
|
|
794
|
-
resourceType
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
`,Hoe=B`
|
|
798
|
-
query ProjectPlanAndCapabilityForAgentQuery(
|
|
799
|
-
$projectExId: String!
|
|
800
|
-
$appExId: String
|
|
801
|
-
) {
|
|
802
|
-
fetchAppDetailByExId: fetchAppDetailByExIdWithoutReconcile(
|
|
803
|
-
projectExId: $projectExId
|
|
804
|
-
appExId: $appExId
|
|
805
|
-
) {
|
|
806
|
-
projectExId
|
|
807
|
-
appExId
|
|
808
|
-
appType
|
|
809
|
-
... on WebApp {
|
|
810
|
-
project {
|
|
811
|
-
...ProjectPlanAndCapabilityForAgent
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
... on WechatMiniProgramApp {
|
|
815
|
-
project {
|
|
816
|
-
...ProjectPlanAndCapabilityForAgent
|
|
817
|
-
}
|
|
818
|
-
}
|
|
819
|
-
... on MobileApp {
|
|
820
|
-
project {
|
|
821
|
-
...ProjectPlanAndCapabilityForAgent
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
... on Project {
|
|
825
|
-
...ProjectPlanAndCapabilityForAgent
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
fragment ProjectPlanAndCapabilityForAgent on Project {
|
|
831
|
-
capabilities {
|
|
832
|
-
capability
|
|
833
|
-
limit {
|
|
834
|
-
amount
|
|
835
|
-
unlimited
|
|
836
|
-
}
|
|
837
|
-
}
|
|
838
|
-
highestPurchasedProjectPlanType
|
|
839
|
-
projectPlan {
|
|
840
|
-
expireAt
|
|
841
|
-
projectPlanType
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
`,Qoe=B`
|
|
845
|
-
query ProjectRpsStatsForAgent($projectExId: String!) {
|
|
846
|
-
project(projectExId: $projectExId) {
|
|
847
|
-
rpsStatsInLast30Days {
|
|
848
|
-
exceededNumOfDays
|
|
849
|
-
exceededTotal
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
`,eA=B`
|
|
854
|
-
query SupportedCustomModelDescriptor {
|
|
855
|
-
supportedCustomModelDescriptor {
|
|
856
|
-
chatModelDescriptors
|
|
857
|
-
embeddingModelDescriptors
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
`,kc=B`
|
|
861
|
-
query ProjectMetadataForAgent($projectExId: String!, $appExId: String) {
|
|
862
|
-
fetchAppDetailByExId: fetchAppDetailByExIdWithoutReconcile(
|
|
863
|
-
projectExId: $projectExId
|
|
864
|
-
appExId: $appExId
|
|
865
|
-
) {
|
|
866
|
-
projectExId
|
|
867
|
-
appExId
|
|
868
|
-
appType
|
|
869
|
-
... on WebApp {
|
|
870
|
-
name
|
|
871
|
-
createdAt
|
|
872
|
-
hasPublished
|
|
873
|
-
isExpired
|
|
874
|
-
config {
|
|
875
|
-
customDomain
|
|
876
|
-
}
|
|
877
|
-
lastUploadedSchema: latestSchema {
|
|
878
|
-
exId
|
|
879
|
-
}
|
|
880
|
-
project {
|
|
881
|
-
...ProjectMetaSummary
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
... on WechatMiniProgramApp {
|
|
885
|
-
name
|
|
886
|
-
createdAt
|
|
887
|
-
hasPublished
|
|
888
|
-
isExpired
|
|
889
|
-
lastUploadedSchema: latestSchema {
|
|
890
|
-
exId
|
|
891
|
-
}
|
|
892
|
-
project {
|
|
893
|
-
...ProjectMetaSummary
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
... on MobileApp {
|
|
897
|
-
name
|
|
898
|
-
createdAt
|
|
899
|
-
hasPublished
|
|
900
|
-
isExpired
|
|
901
|
-
lastUploadedSchema: latestSchema {
|
|
902
|
-
exId
|
|
903
|
-
}
|
|
904
|
-
project {
|
|
905
|
-
...ProjectMetaSummary
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
... on Project {
|
|
909
|
-
...ProjectMetaSummary
|
|
910
|
-
lastUploadedSchema: latestSchema {
|
|
911
|
-
exId
|
|
912
|
-
}
|
|
913
|
-
deploymentEnvConfigs {
|
|
914
|
-
userDeploymentEnvironment
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
project(projectExId: $projectExId) {
|
|
919
|
-
rpsStatsInLast30Days {
|
|
920
|
-
exceededNumOfDays
|
|
921
|
-
exceededTotal
|
|
922
|
-
}
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
fragment ProjectMetaSummary on Project {
|
|
927
|
-
exId
|
|
928
|
-
projectName
|
|
929
|
-
createdAt
|
|
930
|
-
updatedAt
|
|
931
|
-
hasPublished
|
|
932
|
-
isExpired
|
|
933
|
-
lastDeployedServerSchemaExId
|
|
934
|
-
webFreeProdDomain
|
|
935
|
-
projectConfig {
|
|
936
|
-
supportedPlatforms
|
|
937
|
-
webConfig {
|
|
938
|
-
customDomain
|
|
939
|
-
}
|
|
940
|
-
stripePayConfig {
|
|
941
|
-
paymentConfigVersion
|
|
942
|
-
}
|
|
943
|
-
aliPayConfig {
|
|
944
|
-
paymentConfigVersion
|
|
945
|
-
}
|
|
946
|
-
wechatPayConfig {
|
|
947
|
-
paymentConfigVersion
|
|
948
|
-
}
|
|
949
|
-
wechatAppConfig {
|
|
950
|
-
paymentConfigVersion
|
|
951
|
-
}
|
|
952
|
-
aliyunSmsConfig {
|
|
953
|
-
powerOfAttorneyImageExId
|
|
954
|
-
}
|
|
955
|
-
emailConfig {
|
|
956
|
-
emailProvider
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
appList {
|
|
960
|
-
appExId
|
|
961
|
-
appType
|
|
962
|
-
name
|
|
963
|
-
hasPublished
|
|
964
|
-
isExpired
|
|
965
|
-
}
|
|
966
|
-
capabilities {
|
|
967
|
-
capability
|
|
968
|
-
limit {
|
|
969
|
-
amount
|
|
970
|
-
unlimited
|
|
971
|
-
}
|
|
972
|
-
}
|
|
973
|
-
highestPurchasedProjectPlanType
|
|
974
|
-
projectPlan {
|
|
975
|
-
expireAt
|
|
976
|
-
projectPlanType
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
`,tA=B`
|
|
980
|
-
mutation CreateStaticSiteDeploymentForAgent(
|
|
981
|
-
$projectExId: String!
|
|
982
|
-
$appExId: String
|
|
983
|
-
$target: StaticSiteTarget!
|
|
984
|
-
$files: [StaticFileInputInput]!
|
|
985
|
-
) {
|
|
986
|
-
createStaticSiteDeployment(
|
|
987
|
-
projectExId: $projectExId
|
|
988
|
-
appExId: $appExId
|
|
989
|
-
target: $target
|
|
990
|
-
files: $files
|
|
991
|
-
) {
|
|
992
|
-
exId
|
|
993
|
-
status
|
|
994
|
-
target
|
|
995
|
-
siteUrl
|
|
996
|
-
fileCount
|
|
997
|
-
totalBytes
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
`,rA=B`
|
|
1001
|
-
mutation GetStaticSiteUploadUrlsForAgent(
|
|
1002
|
-
$projectExId: String!
|
|
1003
|
-
$appExId: String
|
|
1004
|
-
$staticSiteDeploymentExId: String!
|
|
1005
|
-
$offset: Int
|
|
1006
|
-
$limit: Int
|
|
1007
|
-
$paths: [String]
|
|
1008
|
-
) {
|
|
1009
|
-
staticSiteUploadUrls(
|
|
1010
|
-
projectExId: $projectExId
|
|
1011
|
-
appExId: $appExId
|
|
1012
|
-
staticSiteDeploymentExId: $staticSiteDeploymentExId
|
|
1013
|
-
offset: $offset
|
|
1014
|
-
limit: $limit
|
|
1015
|
-
paths: $paths
|
|
1016
|
-
) {
|
|
1017
|
-
items {
|
|
1018
|
-
path
|
|
1019
|
-
objectKey
|
|
1020
|
-
uploadUrl
|
|
1021
|
-
headers
|
|
1022
|
-
expiresAt
|
|
1023
|
-
}
|
|
1024
|
-
nextOffset
|
|
1025
|
-
totalCount
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
`,nA=B`
|
|
1029
|
-
mutation CompleteStaticSiteDeploymentForAgent(
|
|
1030
|
-
$projectExId: String!
|
|
1031
|
-
$appExId: String
|
|
1032
|
-
$staticSiteDeploymentExId: String!
|
|
1033
|
-
$dryRun: Boolean
|
|
1034
|
-
) {
|
|
1035
|
-
completeStaticSiteDeployment(
|
|
1036
|
-
projectExId: $projectExId
|
|
1037
|
-
appExId: $appExId
|
|
1038
|
-
staticSiteDeploymentExId: $staticSiteDeploymentExId
|
|
1039
|
-
dryRun: $dryRun
|
|
1040
|
-
) {
|
|
1041
|
-
status
|
|
1042
|
-
incomplete
|
|
1043
|
-
missingPaths
|
|
1044
|
-
missingCount
|
|
1045
|
-
siteUrl
|
|
1046
|
-
previousDeploymentExId
|
|
1047
|
-
}
|
|
1048
|
-
}
|
|
1049
|
-
`,iA=B`
|
|
1050
|
-
mutation AbortStaticSiteDeploymentForAgent(
|
|
1051
|
-
$projectExId: String!
|
|
1052
|
-
$appExId: String
|
|
1053
|
-
$staticSiteDeploymentExId: String!
|
|
1054
|
-
) {
|
|
1055
|
-
abortStaticSiteDeployment(
|
|
1056
|
-
projectExId: $projectExId
|
|
1057
|
-
appExId: $appExId
|
|
1058
|
-
staticSiteDeploymentExId: $staticSiteDeploymentExId
|
|
1059
|
-
) {
|
|
1060
|
-
exId
|
|
1061
|
-
status
|
|
1062
|
-
target
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
1065
|
-
`,oA=B`
|
|
1066
|
-
query GetStaticSiteStatusForAgent(
|
|
1067
|
-
$projectExId: String!
|
|
1068
|
-
$appExId: String
|
|
1069
|
-
$target: StaticSiteTarget!
|
|
1070
|
-
) {
|
|
1071
|
-
inProgressStaticSiteDeployment(
|
|
1072
|
-
projectExId: $projectExId
|
|
1073
|
-
appExId: $appExId
|
|
1074
|
-
target: $target
|
|
1075
|
-
) {
|
|
1076
|
-
exId
|
|
1077
|
-
status
|
|
1078
|
-
target
|
|
1079
|
-
fileCount
|
|
1080
|
-
totalBytes
|
|
1081
|
-
createdAt
|
|
1082
|
-
manifest {
|
|
1083
|
-
path
|
|
1084
|
-
md5Base64
|
|
1085
|
-
sizeBytes
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1088
|
-
activeStaticSiteDeployment(
|
|
1089
|
-
projectExId: $projectExId
|
|
1090
|
-
appExId: $appExId
|
|
1091
|
-
target: $target
|
|
1092
|
-
) {
|
|
1093
|
-
exId
|
|
1094
|
-
status
|
|
1095
|
-
target
|
|
1096
|
-
siteUrl
|
|
1097
|
-
fileCount
|
|
1098
|
-
totalBytes
|
|
1099
|
-
activatedAt
|
|
1100
|
-
}
|
|
1101
|
-
}
|
|
1102
|
-
`,sA=B`
|
|
1103
|
-
mutation StartAgentSession(
|
|
1104
|
-
$projectExId: String!
|
|
1105
|
-
$client: String!
|
|
1106
|
-
$clientVersion: String!
|
|
1107
|
-
$sessionId: String!
|
|
1108
|
-
$agent: String
|
|
1109
|
-
) {
|
|
1110
|
-
startAgentSession(
|
|
1111
|
-
projectExId: $projectExId
|
|
1112
|
-
client: $client
|
|
1113
|
-
clientVersion: $clientVersion
|
|
1114
|
-
sessionId: $sessionId
|
|
1115
|
-
agent: $agent
|
|
1116
|
-
)
|
|
1117
|
-
}
|
|
1118
|
-
`,aA=B`
|
|
1119
|
-
mutation SaveSecretForAgent(
|
|
1120
|
-
$projectExId: String!
|
|
1121
|
-
$schemaExId: String!
|
|
1122
|
-
$secretValue: String!
|
|
1123
|
-
) {
|
|
1124
|
-
saveSecret(
|
|
1125
|
-
projectExId: $projectExId
|
|
1126
|
-
schemaExId: $schemaExId
|
|
1127
|
-
secretValue: $secretValue
|
|
1128
|
-
) {
|
|
1129
|
-
secretKey
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
`,uA=B`
|
|
1133
|
-
mutation CreateWechatSourceCodeDeploymentForAgent(
|
|
1134
|
-
$projectExId: String!
|
|
1135
|
-
$appExId: String
|
|
1136
|
-
$files: [WechatSourceCodeFileInputInput]!
|
|
1137
|
-
) {
|
|
1138
|
-
createWechatSourceCodeDeployment(
|
|
1139
|
-
projectExId: $projectExId
|
|
1140
|
-
appExId: $appExId
|
|
1141
|
-
files: $files
|
|
1142
|
-
) {
|
|
1143
|
-
exId
|
|
1144
|
-
status
|
|
1145
|
-
fileCount
|
|
1146
|
-
totalBytes
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
|
-
`,cA=B`
|
|
1150
|
-
mutation GetWechatSourceCodeUploadUrlsForAgent(
|
|
1151
|
-
$projectExId: String!
|
|
1152
|
-
$appExId: String
|
|
1153
|
-
$wechatSourceCodeDeploymentExId: String!
|
|
1154
|
-
$offset: Int
|
|
1155
|
-
$limit: Int
|
|
1156
|
-
$paths: [String]
|
|
1157
|
-
) {
|
|
1158
|
-
wechatSourceCodeUploadUrls(
|
|
1159
|
-
projectExId: $projectExId
|
|
1160
|
-
appExId: $appExId
|
|
1161
|
-
wechatSourceCodeDeploymentExId: $wechatSourceCodeDeploymentExId
|
|
1162
|
-
offset: $offset
|
|
1163
|
-
limit: $limit
|
|
1164
|
-
paths: $paths
|
|
1165
|
-
) {
|
|
1166
|
-
items {
|
|
1167
|
-
path
|
|
1168
|
-
objectKey
|
|
1169
|
-
uploadUrl
|
|
1170
|
-
headers
|
|
1171
|
-
expiresAt
|
|
1172
|
-
}
|
|
1173
|
-
nextOffset
|
|
1174
|
-
totalCount
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1177
|
-
`,lA=B`
|
|
1178
|
-
mutation CompleteWechatSourceCodeUploadForAgent(
|
|
1179
|
-
$projectExId: String!
|
|
1180
|
-
$appExId: String
|
|
1181
|
-
$wechatSourceCodeDeploymentExId: String!
|
|
1182
|
-
$dryRun: Boolean
|
|
1183
|
-
) {
|
|
1184
|
-
completeWechatSourceCodeUpload(
|
|
1185
|
-
projectExId: $projectExId
|
|
1186
|
-
appExId: $appExId
|
|
1187
|
-
wechatSourceCodeDeploymentExId: $wechatSourceCodeDeploymentExId
|
|
1188
|
-
dryRun: $dryRun
|
|
1189
|
-
) {
|
|
1190
|
-
status
|
|
1191
|
-
incomplete
|
|
1192
|
-
missingPaths
|
|
1193
|
-
missingCount
|
|
1194
|
-
deploymentRecordExId
|
|
1195
|
-
}
|
|
1196
|
-
}
|
|
1197
|
-
`,dA=B`
|
|
1198
|
-
mutation AbortWechatSourceCodeDeploymentForAgent(
|
|
1199
|
-
$projectExId: String!
|
|
1200
|
-
$appExId: String
|
|
1201
|
-
$wechatSourceCodeDeploymentExId: String!
|
|
1202
|
-
) {
|
|
1203
|
-
abortWechatSourceCodeDeployment(
|
|
1204
|
-
projectExId: $projectExId
|
|
1205
|
-
appExId: $appExId
|
|
1206
|
-
wechatSourceCodeDeploymentExId: $wechatSourceCodeDeploymentExId
|
|
1207
|
-
) {
|
|
1208
|
-
exId
|
|
1209
|
-
status
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
`,pA=B`
|
|
1213
|
-
query GetWechatSourceCodeStatusForAgent(
|
|
1214
|
-
$projectExId: String!
|
|
1215
|
-
$appExId: String
|
|
1216
|
-
) {
|
|
1217
|
-
inProgressWechatSourceCodeDeployment(
|
|
1218
|
-
projectExId: $projectExId
|
|
1219
|
-
appExId: $appExId
|
|
1220
|
-
) {
|
|
1221
|
-
exId
|
|
1222
|
-
status
|
|
1223
|
-
fileCount
|
|
1224
|
-
totalBytes
|
|
1225
|
-
createdAt
|
|
1226
|
-
lastUploadUrlIssuedAt
|
|
1227
|
-
manifest {
|
|
1228
|
-
path
|
|
1229
|
-
md5Base64
|
|
1230
|
-
sizeBytes
|
|
1231
|
-
}
|
|
1232
|
-
}
|
|
1233
|
-
buildingWechatSourceCodeDeployment(
|
|
1234
|
-
projectExId: $projectExId
|
|
1235
|
-
appExId: $appExId
|
|
1236
|
-
) {
|
|
1237
|
-
exId
|
|
1238
|
-
status
|
|
1239
|
-
fileCount
|
|
1240
|
-
totalBytes
|
|
1241
|
-
createdAt
|
|
1242
|
-
buildStartedAt
|
|
1243
|
-
deploymentRecordExId
|
|
1244
|
-
}
|
|
1245
|
-
}
|
|
1246
|
-
`,fA=B`
|
|
1247
|
-
query GetWechatSourceCodeDeploymentForAgent(
|
|
1248
|
-
$projectExId: String!
|
|
1249
|
-
$appExId: String
|
|
1250
|
-
$wechatSourceCodeDeploymentExId: String!
|
|
1251
|
-
) {
|
|
1252
|
-
wechatSourceCodeDeployment(
|
|
1253
|
-
projectExId: $projectExId
|
|
1254
|
-
appExId: $appExId
|
|
1255
|
-
wechatSourceCodeDeploymentExId: $wechatSourceCodeDeploymentExId
|
|
1256
|
-
) {
|
|
1257
|
-
exId
|
|
1258
|
-
status
|
|
1259
|
-
fileCount
|
|
1260
|
-
totalBytes
|
|
1261
|
-
createdAt
|
|
1262
|
-
buildStartedAt
|
|
1263
|
-
deploymentRecordExId
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
|
-
`,hA=B`
|
|
1267
|
-
query GetWechatTrialVersionForAgent($projectExId: String!) {
|
|
1268
|
-
project(projectExId: $projectExId) {
|
|
1269
|
-
exId
|
|
1270
|
-
wechatMiniAppPreviewVersion
|
|
1271
|
-
wechatMiniAppPreviewTime
|
|
1272
|
-
wechatMiniAppQRCodeBase64
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
`,mA=B`
|
|
1276
|
-
query GetWechatTrialVersionMetaForAgent($projectExId: String!) {
|
|
1277
|
-
project(projectExId: $projectExId) {
|
|
1278
|
-
exId
|
|
1279
|
-
wechatMiniAppPreviewVersion
|
|
1280
|
-
wechatMiniAppPreviewTime
|
|
1281
|
-
}
|
|
1282
|
-
}
|
|
1283
|
-
`,gA=B`
|
|
1284
|
-
query SupportServicePipelineStatusForAgent($projectExId: String!) {
|
|
1285
|
-
project(projectExId: $projectExId) {
|
|
1286
|
-
lastAllPipelinePlatformStatus {
|
|
1287
|
-
buildTarget
|
|
1288
|
-
status
|
|
1289
|
-
startedAt
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
}
|
|
1293
|
-
`,yA=B`
|
|
1294
|
-
query DeployedServerSchemaForAgent($projectExId: String!) {
|
|
1295
|
-
project(projectExId: $projectExId) {
|
|
1296
|
-
exId
|
|
1297
|
-
lastDeployedServerSchema
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
`;d();var vA=B`
|
|
1301
|
-
query FetchLogsByPaginator(
|
|
1302
|
-
$queryCreation: QueryCreationInputType
|
|
1303
|
-
$paginator: PaginatorType
|
|
1304
|
-
) {
|
|
1305
|
-
fetchLogsByPaginator(queryCreation: $queryCreation, paginator: $paginator) {
|
|
1306
|
-
edges {
|
|
1307
|
-
node {
|
|
1308
|
-
content
|
|
1309
|
-
createdAt
|
|
1310
|
-
eventId
|
|
1311
|
-
level
|
|
1312
|
-
type
|
|
1313
|
-
}
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
}
|
|
1317
|
-
`;d();import{randomUUID as D4}from"crypto";var rN=Qe(jx(),1);d();var b4=Qe(CR(),1),T4=Qe(nl(),1),I4=Qe(oo(),1),O4=Qe(Jg(),1),w4=Qe(ey(),1),A4=Qe(sy(),1),UR=Qe(al(),1),x4=Qe(qR(),1);var VR=UR.default;d();var GR=100*1024*1024,cl=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()}}},uy=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>GR)throw new Error(`CRDT model is larger than ${GR} 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},ra=async(e,t)=>{try{return await t()}catch(r){return C.warn(`Optional runtime package unavailable: ${e}`,r.message),null}},$R=null,xt=async()=>($R??=ra("@functorz/ztype",()=>import("./ztype-VF25BWB2.js")).then(e=>(e?.default??e)?.com?.functorz?.ztype??null),$R),BR=null,WR=async()=>(BR??=ra("@functorz/ztype",()=>import("./ztype-VF25BWB2.js")).then(e=>(e?.default??e)?.kotlin?.collections??null),BR),KR=null,zR=async()=>(KR??=xt().then(e=>e?.typesystem?.schema?.SCHEMA_VERSION??null),KR),HR=null,na=async()=>(HR??=ra("@functorz/crdt-helper",()=>import("./index.cjs-3U67BJYG.js")).then(e=>e?.Crdt??e?.default?.Crdt??null),HR),QR=null,cy=async()=>(QR??=ra("json-joy/lib/json-crdt-patch/index.js",()=>import("./json-crdt-patch-JAVNDWYK.js")).then(e=>e??ra("json-joy/lib/json-crdt/index.js",()=>import("./json-crdt-BC5BIGDJ.js"))).then(e=>e?.Patch??e?.default?.Patch??null),QR),ia=e=>e?.lastUploadedSchema??null,ly=e=>[e?.project?.lastDeployedServerSchemaExId,e?.lastDeployedServerSchemaExId,e?.project?.latestDeployedServerSchema?.exId,e?.latestDeployedServerSchema?.exId].find(r=>typeof r=="string"&&r.length>0)??null,YR=e=>e==null?e:structuredClone(e),dy=(e,t)=>e?.appExId?e.appExId:t?.name??"",py=(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},po=e=>{let t=e?.typesystem?.schema?.Product?.[Io];if(!t)throw new Error(`ztype runtime has no Product enum member for ${Io}`);return t},JR=e=>{let t=e?.typesystem?.schema?.Locale?.EN;if(!t)throw new Error("ztype runtime has no Locale enum member for EN");return t},R4=e=>{try{return JSON.parse(JSON.stringify(e))}catch{return String(e)}},ll=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:R4(e?.fullPath??[])}),dl=e=>e.stableErrors.concat(e.betaErrors).filter(t=>!!t.isBackendError),XR=e=>dl(e).length,ZR=(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)}};d();var eN=Qe(Mo(),1);import{createRequire as N4}from"module";var C4=N4(import.meta.url);var pl=e=>{if(qr){if(e==="@functorz/ztype")return qr.ztype;if(e==="@functorz/crdt-helper")return qr.crdtHelper;if(e==="json-joy")return qr.jsonJoy}try{let t=C4(`${e}/package.json`);return t.ztypeBuild??t.version??"unknown"}catch{return"unavailable"}},P4=async()=>{if(qr)return{ztypeVersion:qr.ztype,ztypeSchemaVersion:qr.ztypeSchemaVersion};try{let e=await xt();return{ztypeVersion:pl("@functorz/ztype"),ztypeSchemaVersion:e?.ZTypeSystem?.getSchemaVersion?.()??"unknown"}}catch{return{ztypeVersion:pl("@functorz/ztype"),ztypeSchemaVersion:"unavailable"}}};async function fy(){let e=ov(),t=await P4();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:pl("@functorz/crdt-helper"),jsonJoyVersion:pl("json-joy")}}async function fo(e,t){let[r,n,i]=await Promise.all([fy(),yr(e),e.loadCredentials()]),o=i?eN.default.decode(i.access_token):null,s=typeof o=="object"&&o!==null?String(o.sub??o.exId??o.id??"authenticated"):"anonymous";return{...r,product:X,apiBaseUrl:n.apiBaseUrl,authUserId:s,workspaceRoot:e.getWorkspaceRoot(),startupFlags:[...t].sort()}}function tN(e,t){return JSON.stringify(e)===JSON.stringify(t)}var my=D4(),nN=`${X}/${En()}`,L4=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};function gy(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 k4=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>"}},ho=async(e,t)=>{let r=Hl();C.debug(`[HTTP] Request URL: ${e.toString()}`),t?.headers&&C.debug(`[HTTP] Request Headers: ${JSON.stringify(L4(t.headers))}`),r&&t?.body!=null&&C.debug(`[GQL] Request Body: ${k4(t.body)}`);let n=await fetch(e,t),i=null;try{i=await n.clone().text()}catch(o){C.debug(`[GQL] Response read failed: ${String(o)}`)}if(r&&C.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=gy(o);s&&C.warn(`[GQL] ${n.status} errors: ${s}`)}return n};async function yy(e,t){let r=await e.getValidToken(),n=await yr(t),i={Authorization:`Bearer ${r}`,"User-Locale":"en_US","X-SESSION-ID":my,"X-Client":nN},o=await zR();return o&&(i["X-ZED-VERSION"]=o),process.env.REACT_APP_VERSION&&(i["X-REACT-APP-VERSION"]=process.env.REACT_APP_VERSION),new Ze(`${n.apiBaseUrl}/api/graphql`,{headers:i,fetch:ho})}var hy=class extends VR{constructor(...t){super(...t),this.on("error",r=>C.debug(`[SUB] socket error: ${r.message}`))}};async function iN(e,t){let r=await e.getValidToken(),i=`${(await yr(t)).apiBaseUrl.replace(/^http:/,"ws:").replace(/^https:/,"wss:")}/api/graphql-subscription`;return async(o,s,a)=>{let u=Hl(),c={authToken:r,"X-SESSION-ID":my,"X-Client":nN};C.debug(`[SUB] connecting ${i} params=${JSON.stringify({...c,authToken:"Bearer <redacted>"})}`);let l=new rN.SubscriptionClient(i,{lazy:!0,reconnect:!0,minTimeout:3e3,connectionParams:c},hy);l.onConnected(()=>C.debug("[SUB] connected")),l.onReconnected(()=>C.debug("[SUB] reconnected")),l.onDisconnected(()=>C.debug("[SUB] disconnected")),l.onError(h=>C.debug(`[SUB] error ${h?.message??String(h)}`));let f=[{name:"onNewCrdtPatchV2",query:K0,variables:{projectExId:o.projectExId,appExId:o.appExId??null,versionExId:o.appVersionExId??null,latestPatchExIdInClient:s}},{name:"onSchemaUploadV3",query:H0,variables:{projectExId:o.projectExId,appExId:o.appExId??null,appVersionExId:o.appVersionExId??null}}].map(h=>(C.debug(`[SUB] subscribe ${h.name} vars=${JSON.stringify(h.variables)}`),l.request({query:h.query,variables:h.variables}).subscribe({next:g=>{u&&C.debug(`[SUB] ${h.name} event: ${JSON.stringify(g)}`),a()},error:g=>{C.warn("Schema subscription event failed",String(g)),a()}})));return{unsubscribe(){for(let h of f)h.unsubscribe();l.close(!1,!1)}}}}async function oN(e,t){if(t.projectExId)return await e.saveProjectContext(t.projectExId),t.projectExId;let r=await e.loadProjectContext();if(!r?.projectExId)throw new Error("No projectExId provided and no current project is set");return r.projectExId}async function vy(e,t,r,n){try{await e.request(sA,{projectExId:t,client:X,clientVersion:En(),sessionId:n??my,agent:r??null}),C.debug(`[agent-session] started for project ${t}`)}catch(i){C.debug(`[agent-session] skipped: ${String(i)}`)}}d();d();d();import{createHash as j4}from"crypto";var M4=e=>!!(e&&typeof e=="object"&&!Array.isArray(e)),Ey=e=>{if(Array.isArray(e))return e.map(r=>r===void 0?null:Ey(r));if(!M4(e))return e;let t={};for(let r of Object.keys(e).sort()){let n=e[r];n!==void 0&&(t[r]=Ey(n))}return t},F4=e=>JSON.stringify(Ey(e)),q4=e=>j4("sha256").update(F4(e)).digest("hex"),sN=e=>({projectExId:e.projectExId,appExId:e.appExId??null,appVersionExId:e.appVersionExId??null,schemaExId:e.schemaExId??null,lastPatchExId:e.lastPatchExId??null,snapshotHash:q4(e.snapshot),deployedSchemaExId:e.deployedSchemaExId??null,checkedAt:e.checkedAt??new Date().toISOString()}),aN=(e,t)=>!e||!t?e!==t:e.schemaExId!==t.schemaExId||e.lastPatchExId!==t.lastPatchExId||e.snapshotHash!==t.snapshotHash||e.deployedSchemaExId!==t.deployedSchemaExId,fl=e=>e.changes.length>0;var uN=null,U4=()=>(uN??=xt().then(e=>{let t=e?.typesystem?.schema?.diff?.computeSemanticSchemaChanges;return typeof t=="function"?t:null}),uN),V4=async(e,t)=>{let r=await U4();return r?r(e,t):{changes:[]}},_y=(e,t)=>V4(JSON.stringify(e),JSON.stringify(t));d();var G4="Functorz";function cN(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 C.warn("ztype ExtraContext symbols missing; schema graph will be built without custom models"),null;try{let{ExtraContext:u}=i,{AIModelDescriptors:c,CustomChatModelDescriptor:l,CustomEmbeddingModelDescriptor:p,ModelCustomParamDescriptor:f,CustomModelParam:h,CustomChatCompletionFeatures:g,Identifier:v,MediaOutputCardinality:_}=o,b=x=>a.fromJsMap(new Map(Object.entries(x??{}))),S=x=>typeof x=="string"?x==="single"?_.SINGLE:x==="multiple"?_.MULTIPLE:_.NONE:typeof x=="boolean"&&x?_.MULTIPLE:_.NONE,I=x=>new f(x.name,b(x.displayName),x.type,b(x.description)),A=x=>new h(I(x.serverUrl),I(x.apiToken),s.fromJsArray((x.extensionParams??[]).map(te=>new f(te.name,b(te.displayName),te.type,b(te.displayName))))),T=x=>x.provider===G4&&x.customModelIdentifier?new v(x.customModelIdentifier.id,x.customModelIdentifier.namespace):null,D=(r?.chatModelDescriptors??[]).map(x=>new l(x.provider,x.name,A(x.paramToConfigure),x.delisted,new g(x.features.streamResponse,x.features.multiModal,x.features.imageInput??!1,!1,x.features.videoInput??!1,x.features.imageMessageInput??!1,!1,x.features.videoMessageInput??!1,x.features.tools,x.features.reasoningContent,x.features.imageOutput,x.features.videoOutput,S(x.features.imageOutput),S(x.features.videoOutput),null,x.features.structuredOutput),T(x))),V=(r?.embeddingModelDescriptors??[]).map(x=>new p(x.provider,x.name,A(x.paramToConfigure),T(x),x.delisted));return new u(new c(s.fromJsArray(D),s.fromJsArray(V)),a.fromJsMap(new Map),n)}catch(u){return C.warn("ztype ExtraContext construction failed; schema graph will be built without custom models",u.message),null}}d();var fn=class extends Error{constructor(r,n){super(r);this.diagnostics=n;this.name="ZtypeValidationError"}};d();function hl(e,t,r,n=null){let i=py(e,r?.appType);return e.api.ZTypeCoreApi.genZTypeApiContext(t,po(e),i,dy(r,i),JR(e),n)}function lN(e,t){return dy(t,py(e,t?.appType))}d();var hn=e=>e==null,Sy=(e,t)=>{if(hn(e)&&hn(t)||e===t)return!0;if(hn(e)||hn(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(!Sy(r[o],n[o]))return!1;return!0};var by=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]},dN=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)}`)},$4=e=>e.key??e.index??"",B4=(e,t)=>{let r=e;for(let n of t){if(r===null||typeof r!="object")return;r=r[n]}return r},K4=(e,t)=>{if(t.__typename!=="DiffItem")return null;let r=t.pathComponents.at(-1)?.key;if(r===void 0)return null;let n=Sy(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},H4=(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=()=>Sy(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},pN=(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($4).slice(0,-1);if(hn(B4(r,u)))continue;let c=i(u);if(Array.isArray(c)){let l=H4(c,s);l&&o.push(l)}else if(c!==null&&typeof c=="object"){let l=K4(c,s);l&&o.push(l)}}catch{continue}return o};d();var Q4=3e4,ml=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=>{C.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())},Q4),this.timer.unref())}async run(){if(!this.running){this.running=!0;try{await this.options.refresh()}finally{this.running=!1}}}};d();var fN=(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 p=l.key??l.index??"",f=u[p];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[p]=h;break}c[p]=n(f),u=f,c=c[p]}}return o};d();d();var W4=new Set(["BACKEND_ONLY","COMBINED"]),oa=e=>!e?.appType||W4.has(e.appType)?!1:(e.project?.appList??[]).some(t=>t.appType==="BACKEND_ONLY"),mN=(e,t)=>{if(!t)return e;let r=t.model.view();return{...e,server:r?.server??null}},gl=e=>e?.pathComponents?.[0]?.key==="server",hN=e=>typeof e=="string"&&e.length>0?e:null,Ty=(e,t)=>{let r=e.serverDoc;if(r){let i=hN(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=hN(e.schemaExId);return n?{ok:!0,appExId:t,schemaExId:n}:{ok:!1,error:"the session has no schemaExId"}};d();var Iy=null,gN=async e=>(Iy??=e.request($0).then(t=>(t.__type?.inputFields??[]).some(r=>r.name==="origin")).catch(()=>(Iy=null,!1)),await Iy?{origin:"MCP"}:{});d();function yN(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=fv[i];o!==void 0&&!t.includes(o)&&r.add(i)}return[...r]}function vN(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 Oy=300*1e3,z4=100,Y4=50,J4=["dataModel","types"];function X4(e){let t=e.server;if(!t||typeof t!="object"||Array.isArray(t))return e;let r={};for(let i of J4){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 Z4(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 e5(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]=Z4(i);return r}function t5(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??sa();return t.add(o),i===o?n:{...n,toolCallId:o}})}function r5(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 n5(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?Object.values(t).find(n=>typeof n=="string")??t:t):[]}function i5(e){let t=e??{},r=t.data??{},n={},i=e5(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=n5(t.errors??r.errors);return s.length>0&&(n.errors=s),n}function o5(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 s5(e){return(e??{}).data?.touchesComponents===!0}function a5(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 u5(e){let r=(await xt())?.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 c5(e){return e?e.available===!1||(e.stableErrors?.length??0)>0||(e.betaErrors?.length??0)>0:!1}var aa=class e{constructor(t,r,n,i){this.client=t;this.sessionKey=r;this.onSchemaEvent=i;this.key=e.stringifyKey(r),this.watcher=new ml({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;lastPatchExId=null;appliedPatchExIds=new Set;staleReason="not loaded";lastError=null;lastZtypeDiagnostics=null;diagnosedFor=null;lastRevision=null;events=[];undoStack=[];redoStack=[];watcher;loadedAt=0;lastUsedAt=Date.now();mutex=new cl;key;static stringifyKey(t){return[t.projectExId,t.appExId??"",t.appVersionExId??""].join(":")}isExpired(t=Date.now()){return t-this.lastUsedAt>Oy}currentView(){if(!this.model)throw new Error("CRDT model not loaded");return mN(this.model.view(),this.serverDoc)}lastPatchExIds(){return[this.lastPatchExId,this.serverDoc?.lastPatchExId??null].filter(t=>typeof t=="string")}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:oa(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.client.request(G0,{schemaExId:this.schemaExId}),r=t.crdtSchemaBySchemaExId?.crdtPatches?.patches??[];return await this.applyNetworkPatches(r),await this.syncServerDocLocked(),this.model&&(this.snapshot=this.currentView(),await this.resolveZtypeGraph(),await this.refreshZtypeDiagnostics()),this.lastPatchExId=t.crdtSchemaBySchemaExId?.crdtPatches?.lastPatchExId??this.lastPatchExId,this.updateRevision(),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:X4(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(Wm,{projectExId:this.sessionKey.projectExId,appExId:this.sessionKey.appExId??null,versionExId:this.sessionKey.appVersionExId??null});if(this.schemaExId=r.saveSchema,this.serverDoc){let n=await this.client.request(Wm,{projectExId:this.sessionKey.projectExId,appExId:null,versionExId:null});this.serverDoc.schemaExId=n.saveSchema}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 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 xt(),a=s?.api;if(!a?.ZTypeCoreApi||!a?.ZTypeSchemaOpsApi)throw new Error("ztype SchemaOps API is unavailable");let u=o===null?this.schemaGraph:a.ZTypeCoreApi.withProjectLimits(this.schemaGraph,o),c=hl(s,u,this.appDetail,await this.getExtraContext(s)),l=yN(t,this.enabledProjectFeatureNames);if(l.length)throw new Error(vN(l));let p=t5(t),f=p.map(I=>I&&typeof I=="object"?I.toolCallId:void 0).filter(I=>typeof I=="string"),h=this.withProjectFeatures(a.ZTypeCoreApi,()=>a.ZTypeSchemaOpsApi.toolCalls(c,p,n??null)),g=i5(h),v=g.schemaDiff,_=r5(g.responses,f),b={},S=o5(h);if(S!=null&&(b.updatedReadState=S),_&&(b.responses=_),g.errors&&(b.errors=g.errors,Object.assign(b,a5(h,f)),b.applied={applied:!1,reason:"batch rejected by ztype"}),v&&r&&(b.schemaDiff=v),v)try{b.applied=await this.applySchemaDiffLocked(v,{skipValidation:i}),s5(h)&&(b.touchesComponents=!0)}catch(I){if(!(I instanceof fn))throw I;let A=await u5(I);return Object.assign(b,A,{errors:[...Array.isArray(b.errors)?b.errors:[],...A.errors]}),b}return await this.attachValidationErrorIfAny(b),b}))}async attachValidationErrorIfAny(t){let r=await this.currentZtypeDiagnostics();c5(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(dN).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:by(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:by(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=pN(r,t);if(n.length!==t.length)return null;let i=n.filter(o=>!(o.__typename==="DiffItem"&&hn(o.oldValue)&&hn(o.newValue)));return i.length===0?null:this.applySchemaDiffLocked({id:sa(),dataSource:i},{recordUndo:!1})}async recordUndoEntry(t,r,n){let i=await na();if(!i?.generateDiff)return;let o=[];i.generateDiff({before:t,after:r,prefix:[],result:o}),o.length!==0&&(this.undoStack.push({id:sa(),dataSource:o,semanticChanges:n}),this.undoStack.length>Y4&&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(Hn,this.sessionKey)).fetchAppDetailByExId;if(!n)throw new Error(`Project not found: ${this.sessionKey.projectExId}`);let i=ia(n);if(!i?.crdtModelUrl||!i.exId)throw new Error("Project has no uploaded CRDT schema");let o=await uy(i.crdtModelUrl);return this.crdtBinary=o,this.appliedPatchExIds.clear(),this.lastPatchExId=null,this.serverDoc=null,this.undoStack=[],this.redoStack=[],this.appDetail=n,await this.initializeRuntime(o,i.crdtPatches?.patches??[],n),this.schemaExId=i.exId,this.lastPatchExId=i.crdtPatches?.lastPatchExId??null,this.loadedAt=Date.now(),this.model&&this.schemaGraph?this.staleReason=!this.serverDoc&&oa(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&&oa(this.appDetail)&&(t.dataSource??[]).some(gl))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.");let i=(r.recordUndo??process.env.MOMEN_MCP_UNDO!=="0")&&this.snapshot?fN(this.snapshot,t.dataSource??[]):null,o=this.currentRevision(),s=await xt(),a=s?.api?.ZTypeCoreApi,u=await na();if(!a||!u?.executeCrdtNodeUpdateAndTransformDiff||!u.generateDiff)throw new Error("CRDT/ztype write runtime is unavailable");let c=hl(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(ll),betaErrors:[]};if(r.skipValidation!==!0)throw new fn("ztype validation interrupted schema update",g)}if(!this.model)throw new Error("CRDT model not loaded");C.debug(`[Session] applying schemaDiff dataSource: ${JSON.stringify(t.dataSource).slice(0,4e3)}`);try{await this.uploadByDoc(u,t.dataSource??[],this.model)}catch(g){C.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){C.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 p=await this.refreshZtypeDiagnostics(),f=this.updateRevision(),h=i&&o&&i.server!==this.snapshot.server?await _y({version:i.version,server:i.server},{version:this.snapshot.version,server:this.snapshot.server}):null;return h&&fl(h)&&o&&f&&this.appendSchemaEvent("local",o,f,h),i&&await this.recordUndoEntry(i,this.snapshot,h&&fl(h)?h:null).catch(g=>C.warn(`[Session] the write landed but its undo entry could not be recorded: ${g.message}`)),{...this.status(),ztypeDiagnostics:p,backendErrorCount:XR(p),_schema:h&&fl(h)?{change:h}:void 0}}async uploadByDoc(t,r,n){let i=this.serverDoc,o=i?r.filter(gl):[],s=i?r.filter(u=>!gl(u)):r,a=i&&o.length>0&&s.length>0?YR(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,ZR),a=sa(),u=await gN(this.client);return(await this.client.request(B0,{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(Hn,this.sessionKey)).fetchAppDetailByExId,s=ia(o);if(!s?.exId)return null;let a=s.crdtPatches?.lastPatchExId??null,u=s.exId,c=ly(o);if(!await this.syncServerDocLocked()&&u===this.schemaExId&&a===this.lastPatchExId&&c===this.lastRevision?.deployedSchemaExId)return this.appDetail=o??this.appDetail,this.updateRevision(),null;u!==this.schemaExId||!s.crdtModelUrl?await this.loadLocked(!0):(this.appDetail=o??this.appDetail,await this.applyNetworkPatches(s.crdtPatches?.patches??[]),this.model&&(this.snapshot=this.currentView(),await this.resolveZtypeGraph(),await this.refreshZtypeDiagnostics()),this.lastPatchExId=a,this.updateRevision());let p=this.currentRevision();if(!p||!aN(r,p))return null;let f=await _y(n,{version:this.snapshot?.version,server:this.snapshot?.server});return this.appendSchemaEvent(t==="watch"?"remote":t,r,p,f),{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:p,semanticChanges:f,detectedAt:new Date().toISOString()}}currentRevision(){return this.lastRevision??this.updateRevision()}updateRevision(){return!this.snapshot&&!this.crdtBinary?(this.lastRevision=null,null):(this.lastRevision=sN({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:ly(this.appDetail)}),this.lastRevision)}appendSchemaEvent(t,r,n,i){let o={id:sa(),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(-z4),this.onSchemaEvent?.(o)}async runWatchRefresh(){let t=this.lastUsedAt;try{await this.mutex.run(async()=>{await this.withErrorState(async()=>this.checkRemoteAndSyncLocked("watch"))})}catch(r){C.warn("Schema watch refresh failed",r.message)}finally{this.lastUsedAt=t}}dispose(){this.watcher.dispose()}async initializeRuntime(t,r,n){let i=await na();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&&(oa(n)&&(this.serverDoc=await this.loadServerDoc(i).catch(o=>(C.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 cy();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.client.request(Hn,{projectExId:this.sessionKey.projectExId}),n=ia(r.fetchAppDetailByExId);if(!n?.crdtModelUrl||!n.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 uy(n.crdtModelUrl)),schemaExId:n.exId,lastPatchExId:null,appliedPatchExIds:new Set};return await this.applyServerPatches(i,n.crdtPatches?.patches??[]),i.lastPatchExId=n.crdtPatches?.lastPatchExId??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 cy();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.client.request(Hn,{projectExId:this.sessionKey.projectExId}),n=ia(r.fetchAppDetailByExId);if(!n?.exId)return!1;let i=n.crdtPatches?.lastPatchExId??null;return n.exId===t.schemaExId&&i===t.lastPatchExId?!1:n.exId!==t.schemaExId?(this.serverDoc=await this.loadServerDoc(await na()),!0):(await this.applyServerPatches(t,n.crdtPatches?.patches??[]),t.lastPatchExId=i,!0)}async resolveZtypeGraph(){let t=await xt(),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([WR(),this.client.request(eA).then(o=>o.supportedCustomModelDescriptor??null).catch(o=>(C.warn("extraContext: model descriptors unavailable",o.message),null)),this.client.request(j0,{projectExId:this.sessionKey.projectExId}).then(o=>(o.features??[]).filter(s=>s.enabled).map(s=>s.featureName)).catch(o=>(C.warn("extraContext: project features unavailable; ztype runs with every feature off",o.message),[]))]);this.enabledProjectFeatureNames=i,this.extraContext=cN(t,r,n,po(t))}catch(r){C.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 xt(),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=hl(t,this.schemaGraph,this.appDetail,await this.getExtraContext(t)),i=this.withProjectFeatures(r.ZTypeCoreApi,()=>r.ZTypeValidationApi.validateSchemaGraph(n,lN(t,this.appDetail)));return this.lastZtypeDiagnostics={available:!0,stableErrors:[...i?.errors??i?.stableErrors??[]].map(ll),betaErrors:[...i?.warnings??i?.betaErrors??[]].map(ll)},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 yl=class{constructor(t,r){this.clientFactory=t;this.subscriptionFactory=r}sessions=new Map;emitter=new l5;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:Oy,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 currentSchemaExId(t){let r=await this.getSession(t);await r.load(!1);let n=r.status().schemaExId;return typeof n=="string"?n:null}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=aa.stringifyKey(t),n=this.sessions.get(r);if(n)return n;let i=new aa(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}}d();var EN=e=>e??{},Q=e=>typeof e=="string"&&e.length>0?e:void 0,oe=e=>typeof e=="string"&&e.length>0?e:null,ke=(e,t=!1)=>typeof e=="boolean"?e:t,Ye=(e,t)=>typeof e=="number"&&Number.isFinite(e)?e:t,ti=e=>Array.isArray(e)&&e.every(t=>typeof t=="string")?e:void 0,qe=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},ri=(e,t)=>{let r=Q(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=qe(r._schema);return{...r,_schema:{...n,warning:t}}}return{result:e,_schema:{warning:t}}},d5=e=>new Promise(t=>{setTimeout(t,e)}),vl=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},_N=(e,t)=>{let n=e?.tableMetadata?.find(i=>i?.name===t)?.columnMetadata?.map(i=>vl(i))?.filter(i=>i!==null);return n?.length?n.slice(0,20):["id"]},p5=/token|secret|password|privatekey|merchantkey|mchkey|apikey/i,wy=e=>{if(Array.isArray(e))return e.map(wy);if(!e||typeof e!="object")return e;let t={};for(let[r,n]of Object.entries(e))t[r]=p5.test(r)?"<redacted>":wy(n);return t},Ay=(e,t)=>ke(t.includeSecrets,!1)?e:wy(e),SN=async(e,t)=>{let r={projectExId:Q(t.projectExId),appExId:oe(t.appExId),appVersionExId:oe(t.appVersionExId)},n=await oN(e,r);if(r.appExId!==null&&r.appExId===n)throw new Error(`appExId was given the project exId (${n}). appExId names an app inside the project, never the project itself: leave it unset to address the project (its backend, and the whole schema of a single-client project), or take an app exId from \`project metadata\` -> apps[] whose appExId is non-null.`);return{...r,projectExId:n}},bN=async(e,t)=>{let r=Q(t.organizationExId),n=Q(t.projectSpaceType);if(r&&n)return{organizationExId:r,projectSpaceType:n};let o=(await e.request(Lc))?.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"}},f5=async(e,t)=>((await e.request(Dc,{projectName:t,paginator:{first:20}}))?.fuzzySearchProjectName?.edges??[]).find(o=>o?.node?.name===t)?.node??null,TN=async(e,t,r)=>{let n=Date.now()+r;for(;Date.now()<n;){let i=await f5(e,t);if(i)return i;await d5(2e3)}return null},IN=(e,t,r,n=!0)=>{if(Q(t.confirmProjectExId)!==e&&!(n&&ke(t.force,!1)))throw new Error(`${r} is destructive; pass confirmProjectExId=${e}`+(n?" or force=true":""))},h5=e=>e?"project"in e?e.project:"adminToken"in e?e:null:null,m5=e=>e.replace(/\/api\/graphql-v2(\/?)$/,"/api/graphql-admin$1"),mo=async(e,t)=>{let r=await e.request(V0,t),n=h5(r?.fetchAppDetailByExIdWithoutReconcile);if(!n?.adminToken)throw new Error(`Runtime commands need the project admin token, which only project editors get; none was returned for project ${t.projectExId}`);let i=n.zeroUrl??Nt().zeroApiUrlTemplate.replace("{projectExId}",t.projectExId),o={authorization:`Bearer ${n.adminToken}`};return{adminToken:n.adminToken,zeroUrl:i,dataClient:new Ze(i,{headers:o,fetch:ho}),adminClient:new Ze(n.adminZeroUrl??m5(i),{headers:o,fetch:ho})}};d();d();import{promises as g5}from"fs";import y5 from"path";var v5=async(e,t)=>{let r=Q(e.cwd);if(!r)throw new Error("cwd is required");let n=y5.resolve(r);if(!(await g5.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}`)},ON={"workspace.set":v5};d();var CN=Qe(Mo(),1);d();import{createServer as wN}from"http";import E5 from"open";var ua=class{config;constructor(t){this.config=t}async findAvailablePort(t){let r=t||this.config.callbackPort||8088;return new Promise((n,i)=>{let o=wN();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`;C.info(`[JwtAuth] Using callback URL: ${r}`),C.info("[JwtAuth] Opening browser for authentication...");let n=await new Promise((i,o)=>{let s=null,a=!1,u=wN(async(c,l)=>{if(!c.url)return;let p=new URL(c.url,`http://localhost:${t}`);if(p.pathname==="/callback"){C.info(`[JwtAuth] Callback received: ${c.url}`);let f=p.searchParams.get("token");if(!f||f.trim()===""){C.info("[JwtAuth] No token parameter found in callback URL"),C.info("[JwtAuth] Available parameters:",Array.from(p.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}C.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),C.info(`[JwtAuth] Opening: ${c.toString()}`);try{await E5(c.toString())}catch{C.info("[JwtAuth] Could not open browser automatically"),C.info("[JwtAuth] Please open this URL manually:"),C.info(c.toString())}}),s=setTimeout(()=>{a||(a=!0,u.close(),o(new Error("Authentication timeout - no response after 5 minutes")))},3e5)});return C.info("[JwtAuth] JWT token received successfully"),{access_token:n,token_type:"Bearer"}}renderPage(t){let r=t.autoClose?`
|
|
1318
|
-
<script>
|
|
1319
|
-
setTimeout(() => {
|
|
1320
|
-
window.close();
|
|
1321
|
-
}, 2000);
|
|
1322
|
-
</script>`:"";return`
|
|
1323
|
-
<!DOCTYPE html>
|
|
1324
|
-
<html>
|
|
1325
|
-
<head>
|
|
1326
|
-
<meta charset="utf-8">
|
|
1327
|
-
<title>${t.title}</title>
|
|
1328
|
-
<style>
|
|
1329
|
-
body {
|
|
1330
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
1331
|
-
display: flex;
|
|
1332
|
-
justify-content: center;
|
|
1333
|
-
align-items: center;
|
|
1334
|
-
height: 100vh;
|
|
1335
|
-
margin: 0;
|
|
1336
|
-
background: linear-gradient(135deg, ${t.gradient});
|
|
1337
|
-
}
|
|
1338
|
-
.container {
|
|
1339
|
-
background: white;
|
|
1340
|
-
padding: 2.5rem;
|
|
1341
|
-
border-radius: 1rem;
|
|
1342
|
-
box-shadow: 0 20px 60px rgba(0,0,0,0.3);
|
|
1343
|
-
text-align: center;
|
|
1344
|
-
max-width: 400px;
|
|
1345
|
-
}
|
|
1346
|
-
h1 {
|
|
1347
|
-
margin: 0 0 1rem;
|
|
1348
|
-
color: ${t.headingColor};
|
|
1349
|
-
font-size: 1.5rem;
|
|
1350
|
-
}
|
|
1351
|
-
p {
|
|
1352
|
-
color: #666;
|
|
1353
|
-
margin: 0;
|
|
1354
|
-
line-height: 1.6;
|
|
1355
|
-
}
|
|
1356
|
-
.icon {
|
|
1357
|
-
font-size: 3rem;
|
|
1358
|
-
margin-bottom: 1rem;
|
|
1359
|
-
}
|
|
1360
|
-
</style>
|
|
1361
|
-
</head>
|
|
1362
|
-
<body>
|
|
1363
|
-
<div class="container">
|
|
1364
|
-
<div class="icon">${t.icon}</div>
|
|
1365
|
-
<h1>${t.heading}</h1>
|
|
1366
|
-
<p>${t.body}</p>
|
|
1367
|
-
<p style="margin-top: 1rem; font-size: 0.9em; opacity: 0.8;">${t.footer}</p>
|
|
1368
|
-
</div>${r}
|
|
1369
|
-
</body>
|
|
1370
|
-
</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."})}};d();var He=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},ca=e=>Array.isArray(e)?e:[];function AN(e){let t={};for(let r of ca(e)){let n=He(r),i=n.capability;if(typeof i!="string")continue;let o=He(n.limit);t[i]=o.unlimited?"unlimited":o.amount??0}return t}function El(e,t){if(Array.isArray(e))return e.map(r=>El(r,t));if(e&&typeof e=="object"){let r={};for(let[n,i]of Object.entries(e))t.has(n)||(r[n]=El(i,t));return r}return e}var xN=new Set(["crdtPatches","crdtModelUrl","latestDeployedServerSchema","additional"]);function _l(e){let t=He(e),r=He(t.fetchAppDetailByExId),n=He(r.project),i=h=>r[h]??n[h],o=He(i("projectConfig")),s=He(r.config).customDomain??He(o.webConfig).customDomain??i("webFreeProdDomain")??null,a=i("lastDeployedServerSchemaExId")??null,u=He(r.lastUploadedSchema).exId??null,c=ca(i("appList")).map(h=>{let g=He(h);return{appExId:g.appExId,appType:g.appType,name:g.name,published:g.hasPublished??!1,expired:g.isExpired??!1}}),l=He(i("projectPlan")),p=He(He(t.project).rpsStatsInLast30Days),f={projectExId:r.projectExId??n.exId??null,projectName:i("projectName")??r.name??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,deployedSchemaExId:a,uploadedSchemaExId:u,hasUndeployedChanges:u!=null&&u!==a,deploymentEnvs:ca(i("deploymentEnvConfigs")).map(h=>He(h).userDeploymentEnvironment).filter(h=>h!=null),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:l.projectPlanType??null,expireAt:l.expireAt??null,highestPurchased:i("highestPurchasedProjectPlanType")??null},capabilities:AN(i("capabilities")),rpsLast30Days:{exceededDays:p.exceededNumOfDays??0,exceededTotal:p.exceededTotal??0}};return c.length>0&&(f.apps=c),f}function RN(e){let t=He(e),r={};for(let n of ca(t.projectResourceUsageInfo)){let i=He(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 NN(e){let t=He(He(e).user),r=ca(t.joinedOrganizations).map(n=>{let i=He(n);return{exId:i.exId,displayName:i.displayName,ownerName:i.ownerName,planType:i.planType,planExpireAt:i.planExpireAt,permissionEnabled:i.permissionEnabled,permissionRoleLimit:i.permissionRoleLimit,capabilities:AN(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 xy(e){let t=await e.loadCredentials();if(!t)return null;let r=CN.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 _5=async(e,t)=>{let r=await yr(t.credentialStore),n=await new ua(r).authenticate();return await t.credentialStore.saveCredentials(n),t.ok(await xy(t.credentialStore),"Authenticated")},S5=async(e,t)=>{await t.credentialStore.deleteCredentials();let r=await yr(t.credentialStore),n=await new ua(r).authenticate();return await t.credentialStore.saveCredentials(n),t.ok(await xy(t.credentialStore),"Authenticated")},b5=async(e,t)=>(await t.credentialStore.deleteCredentials(),await t.credentialStore.deleteProjectContext(),t.schemaManager.clear(),t.ok(void 0,"Logged out")),T5=async(e,t)=>{let r=await xy(t.credentialStore);return r?t.ok(r):t.fail(new Error(_a))},I5=async(e,t)=>t.ok(NN(await t.client.request(L0))),PN={"auth.login":_5,"auth.reauth":S5,"auth.logout":b5,"auth.whoami":T5,"account.profile":I5};d();d();import{spawn as O5}from"child_process";var DN=18e4,bl=Math.floor(DN/1e3),w5=DN+5e3,LN=()=>(process.env.MCP_HITL??"").trim().toLowerCase()==="off";function mn(e,t){return new Promise(r=>{let n="",i="",o=!1,s=O5(e,t,{stdio:["ignore","pipe","pipe"]}),a=setTimeout(()=>{o||(s.kill("SIGKILL"),o=!0,r({code:null,stdout:n,stderr:i,timedOut:!0}))},w5);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 A5(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 ${bl}`,"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 mn("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 x5(e,t){if(!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY)return"unavailable";let r=`This will ${t} project ${e}.
|
|
1371
|
-
This action is IRREVERSIBLE.
|
|
1372
|
-
|
|
1373
|
-
Type the project id to confirm:`,n=await mn("zenity",["--entry","--title=Human approval required",`--text=${r}`,`--timeout=${bl}`]);if(!n.spawnError)return n.timedOut?"denied":n.code===0&&n.stdout.trim()===e?"approved":"denied";let i=await mn("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 R5(e,t){let r=`This will ${t} project ${e}. This action is IRREVERSIBLE.
|
|
1374
|
-
|
|
1375
|
-
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 mn("powershell",["-NoProfile","-NonInteractive","-Command",i]);return o.spawnError?"unavailable":o.timedOut?"denied":o.code!==0?"unavailable":o.stdout.trim()===e?"approved":"denied"}async function N5(e,t){switch(process.platform){case"darwin":return A5(e,t);case"linux":return x5(e,t);case"win32":return R5(e,t);default:return"unavailable"}}async function la(e,t,r,n={}){if(LN()){IN(e,t,r,n.allowForce??!0);return}let i=await N5(e,r);if(i==="approved"){Ql("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 Sl=e=>e.replace(/\r?\n$/,"");async function C5(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 ${bl}`,"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 mn("osascript",r);if(n.spawnError||n.code!==0)return{ok:!1,reason:"unavailable"};if(n.timedOut)return{ok:!1,reason:"cancelled"};let i=Sl(n.stdout);return i==="__CANCELLED__"?{ok:!1,reason:"cancelled"}:{ok:!0,value:i}}async function P5(e){if(!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY)return{ok:!1,reason:"unavailable"};let t=`Enter the value for secret "${e}":`,r=await mn("zenity",["--entry","--hide-text","--title=Set secret value",`--text=${t}`,`--timeout=${bl}`]);if(!r.spawnError)return r.timedOut?{ok:!1,reason:"cancelled"}:r.code===0?{ok:!0,value:Sl(r.stdout)}:{ok:!1,reason:"cancelled"};let n=await mn("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:Sl(n.stdout)}:{ok:!1,reason:"cancelled"}}async function D5(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 mn("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=Sl(i.stdout);return o==="__CANCELLED__"?{ok:!1,reason:"cancelled"}:{ok:!0,value:o}}async function kN(e){if(LN())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 C5(e);break;case"linux":t=await P5(e);break;case"win32":t=await D5(e);break;default:t={ok:!1,reason:"unavailable"}}if(t.ok){if(!t.value)throw new Error("No secret value was entered.");return Ql("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 jN=async(e,t)=>{let n=(await t.client.request(Dc,{projectName:Q(e.projectName)??"",paginator:{after:oe(e.cursor),first:Ye(e.limit,20)}})).fuzzySearchProjectName,i=(n?.edges??[]).map(a=>a?.node).filter(a=>a!=null),o=n?.pageInfo,s=o?.hasNextPage?o.endCursor?.value??null:null;return t.ok({projects:i,nextCursor:s})},L5=async(e,t)=>{let r=Q(e.projectName)??Q(e.name);if(!r)throw new Error("projectName is required");let n=await bN(t.client,e),o=(await t.client.request(k0,{projectName:r,templateExId:oe(e.templateExId),platform:oe(e.platform),projectSpaceType:n.projectSpaceType,organizationExId:n.organizationExId,forBeginnerGuide:ke(e.forBeginnerGuide,!1),category:oe(e.category),useRefactoredComponent:ke(e.useRefactoredComponent,!0),useNewType:!0})).createProjectInOrganizationAsync;if(!o)throw new Error("Project creation failed: taskId is missing");let a=ke(e.wait,!0)?await TN(t.client,r,Ye(e.timeoutMs,12e4)):null;return a?.exId&&(await t.credentialStore.saveProjectContext(String(a.exId)),await vy(t.client,String(a.exId),t.codingAgent,t.hostSessionId)),t.ok({taskId:o,project:a,projectSpace:n})},k5=async(e,t)=>{let r=Q(e.projectExId);if(!r)throw new Error("projectExId is required");return await t.credentialStore.saveProjectContext(r),await vy(t.client,r,t.codingAgent,t.hostSessionId),t.ok({projectExId:r},`Current project set to ${r}`)},j5=async(e,t)=>t.ok(await t.credentialStore.loadProjectContext()),M5=async(e,t)=>{let r=await t.getProjectArgs(e),n=await t.client.request(Hn,r);return t.ok(Ay(El(n,xN),e))},F5=async(e,t)=>{let r=await t.getProjectArgs(e),n=await t.client.request(kc,r);return ke(e.raw,!1)?t.ok(Ay(n,e)):t.ok(_l(n))},q5=async(e,t)=>{let r=await t.getProjectArgs(e),n=Q(e.projectName)??Q(e.name);if(!n)throw new Error("projectName is required");return t.ok(await t.client.request(M0,{projectExId:r.projectExId,projectName:n}))},U5=async(e,t)=>{let r=await t.getProjectArgs(e),n=Q(e.appExId),i=Q(e.appName)??Q(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(F0,{projectExId:r.projectExId,appExId:n,appName:i}))},V5=async(e,t)=>{let r=await t.getProjectArgs(e);await la(r.projectExId,e,"delete");let n=await t.client.request(q0,{projectExId:r.projectExId});return(await t.credentialStore.loadProjectContext())?.projectExId===r.projectExId&&await t.credentialStore.deleteProjectContext(),t.schemaManager.clear(),t.ok(n)},G5=async(e,t)=>{let r=await t.getProjectArgs(e);await la(r.projectExId,e,"reset");let n=Q(e.languageType)??"EN";return t.ok(await t.client.request(U0,{projectExId:r.projectExId,languageType:n}))},$5=async(e,t)=>{let r=await t.getProjectArgs(e);ke(e.refresh,!1)&&await t.client.request(Y0,{projectExId:r.projectExId});let n=Q(e.resourceType),[i,o,s,a]=await Promise.all([t.client.request(z0,{projectExId:r.projectExId,nonRealTimeDisplayedResourceTypes:ti(e.nonRealTimeDisplayedResourceTypes)}),t.client.request(Z0,{projectExId:r.projectExId}).catch(l=>({error:l instanceof Error?l.message:String(l)})),n?t.client.request(J0,{projectExId:r.projectExId,resourceType:n}):Promise.resolve(null),n?t.client.request(X0,{projectExId:r.projectExId,resourceType:n}):Promise.resolve(null)]),u=o&&"findActiveSingleTenantResourceInfoAndThrowOnExpireTimeMismatch"in o?o.findActiveSingleTenantResourceInfoAndThrowOnExpireTimeMismatch:null,c={usage:RN(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)},MN={"projects.search":jN,"projects.list":jN,"project.create":L5,"project.set_current":k5,"project.get_current":j5,"project.detail":M5,"project.metadata":F5,"project.rename":q5,"project.rename_app":U5,"project.delete":V5,"project.reset":G5,"project.resources":$5};d();async function Tl(e,t){let r=await t.checkSchema(e),n=await t.getProjectArgs(e);return{warning:r,projectArgs:n,sArgs:nr(n.projectExId,n)}}var go=e=>async(t,r)=>{let{warning:n,sArgs:i}=await Tl(t,r);return r.ok(Rt(await e(r.schemaManager,i),n))},B5=go((e,t)=>e.load(t)),K5=go((e,t)=>e.load(t,!0)),H5=async(e,t)=>{let r=Q(e.projectExId)?await t.checkSchema(e):null;return t.ok(Rt(t.schemaManager.status(),r))},Q5=async(e,t)=>t.ok(t.schemaManager.schemaState(Q(e.projectExId))),W5=async(e,t)=>t.ok(t.schemaManager.schemaEvents(Q(e.projectExId),oe(e.afterEventId),Ye(e.limit,100))),z5=go((e,t)=>e.sync(t)),Y5=async(e,t)=>{let{warning:r,sArgs:n}=await Tl(e,t),i=await t.schemaManager.snapshot(n,ke(e.full,!1));return t.ok(Rt(i,r))},J5=go((e,t)=>e.validate(t)),X5=go((e,t)=>e.undo(t)),Z5=go((e,t)=>e.redo(t)),Ry=async(e,t)=>{let{warning:r,projectArgs:n,sArgs:i}=await Tl(e,t),o=await t.schemaManager.load(i),s=Ty(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=dl(a);if(u.length>0&&!ke(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=Ty(c,n.appExId??null);if(!l.ok)throw new Error(`schema.save: ${l.error}`);let p=c.serverDoc??null,f=l.schemaExId,h=l.appExId,g=ke(e.validateMultiClient,!1)&&!!p,v=ke(e.validateMultiClient,!1)&&!p?await t.client.request(W0,{projectExId:n.projectExId,appExId:h,schemaExId:f}):await t.client.request(Q0,{projectExId:n.projectExId,appExId:h,schemaExId:f,buildTarget:Q(e.buildTarget)??"SUPPORT_SERVICE"});return t.ok(Rt({saved:c,deploy:v,ztypeDiagnostics:a,...g?{multiClientValidationSkipped:!0}:{}},r))},e3=async(e,t)=>{let{warning:r,sArgs:n}=await Tl(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=ke(e.verbose,!1),s=await t.schemaManager.ztypeToolCalls(n,i,o,e.readState??null,ke(e.force,!1),e.projectLimits??null);return t.ok(Rt(s,r))},FN={"schema.load":B5,"schema.reload":K5,"schema.status":H5,"schema.state":Q5,"schema.events":W5,"schema.sync":z5,"schema.snapshot":Y5,"schema.validate":J5,"project.sync_backend":Ry,"schema.ztype_tool_calls":e3,"schema.undo":X5,"schema.redo":Z5};d();d();var Ht=e=>Array.isArray(e)?e:[],Cy=e=>qe(qe(e).server),t3=e=>{for(let t of e){let r=qe(t);if(r.type==="FLOW_END"&&r.removable!==!0)return oe(r.uniqueId)}return null},qN=(e,t)=>{let n=Ht(Cy(e).actionFlows).find(s=>qe(s).uniqueId===t);if(!n)throw new Error(`No action flow with id ${t}. Check the id with project.inspect.`);let i=qe(n),o=t3(Ht(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:oe(i.displayName),isAsync:i.isAsync===!0}},Py=50,r3=e=>{for(let t=0;t<e.length-1;t++)if(e[t].key==="componentById")return oe(e[t+1].key);return null},UN=(e,t=Py)=>{let r=qe(e);if(r.available===!1)return{count:0,errors:[],unavailable:!0};let n=[...Ht(r.stableErrors),...Ht(r.betaErrors)].map(qe),i=n.slice(0,t).map(s=>{let a=Ht(s.fullPath).map(qe),u={message:oe(s.message)??"",path:a},c=oe(s.platform);c&&(u.platform=c);let l=r3(a)??oe(s.componentId);return l&&(u.componentId=l),u}),o={count:n.length,errors:i};return n.length>i.length&&(o.truncated=!0),o},n3=e=>{let t=qe(e);if(!(e===void 0||t.available===!1))return Ht(t.stableErrors).length+Ht(t.betaErrors).length},VN=(e,t,r,n)=>{let i=n3(qe(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},i3=e=>{let t=new Map;for(let r of Ht(e.actionFlows)){let n=qe(r),i=oe(n.uniqueId),o=oe(n.displayName);i&&o&&t.set(i,o)}return t},o3=e=>{let t=new Map;for(let r of Ht(qe(e.dataModel).tables)){let n=qe(r),i=oe(n.uniqueId)??oe(n.id),o=oe(n.name);i&&o&&t.set(i,o)}return t},GN=e=>{let t=Cy(e),r=i3(t),n=o3(t),i=Ht(t.triggerConfigurations).map(s=>{let a=qe(s),u=oe(a.tableId);return{triggerId:oe(a.uniqueId),displayName:oe(a.displayName),enabled:a.enabled===!0,tableName:u?n.get(u)??null:null,operation:oe(qe(a.trigger).dbOperationType),flowNames:Ht(a.actions).map(c=>oe(qe(c).actionFlowUniqueId)).filter(c=>!!c).map(c=>r.get(c)).filter(c=>!!c)}}),o=Ht(t.scheduledJobConfigurations).map(s=>{let a=qe(s),u=oe(qe(a.action).actionFlowUniqueId);return{triggerId:oe(a.uniqueId),name:oe(a.name),enabled:a.enabled!==!1,cron:oe(a.cron),flowName:u?r.get(u)??null:null}});return{dbTriggers:i,scheduledTriggers:o}},s3=["dataModel","actionFlows","callbackConfigurations","scheduledJobConfigurations","triggerConfigurations","apiWorkSpaces","zAiConfigs","roleConfigs","authenticationConfig","secretConfigs"],Ny=(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)=>Ny(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(!Ny(r[o],n[o]))return!1;return!0}return!1},$N=(e,t)=>{if(t==null)return{hasPendingChanges:!1,changedAreas:[],known:!1};let r=Cy(e),n=qe(t),i=s3.filter(o=>!Ny(r[o],n[o]));return{hasPendingChanges:i.length>0,changedAreas:[...i],known:!0}};d();import{execSync as a3}from"node:child_process";import{createRequire as u3}from"node:module";import c3 from"node:path";var BN=18e4,l3=15e3,d3=3e4,KN=["--js-flags=--max-old-space-size=1024","--renderer-process-limit=1"],p3=async()=>{try{return await import("playwright")}catch{let e=a3("npm root -g").toString().trim();return u3(c3.join(e,"noop.js"))("playwright")}},Dy=class{browser=null;context=null;page=null;loadedFor=null;loadedWithPatches=new Set;queue=Promise.resolve();run(t,r){let n=this.queue.then(()=>this.runNow(t,r));return this.queue=n.catch(()=>{}),n}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 n.evaluate(()=>globalThis.__ZION_AGENT_CANVAS__.isInSync()).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)){n=await this.load(t,r);break}return r.pageId&&(await n.evaluate(({pageId:o,breakpoint:s})=>globalThis.__ZION_AGENT_CANVAS__.focus(o,s),{pageId:r.pageId,breakpoint:r.breakpoint}),await n.waitForFunction(({pageId:o,breakpoint:s})=>globalThis.__ZION_AGENT_CANVAS__.isFocused(o,s),{pageId:r.pageId,breakpoint:r.breakpoint},{timeout:d3})),n.evaluate(({rpc:o,args:s,sessionExId:a})=>globalThis.__ZION_AGENT_CANVAS__.dispatch(o,s,a),{rpc:r.rpc,args:r.args,sessionExId:r.sessionExId})}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){try{return await t.waitForFunction(n=>globalThis.__ZION_AGENT_CANVAS__.hasAppliedPatch(n),r,{timeout:l3}),!0}catch{return!1}}async load(t,r){let n=Nt().editorBaseUrl;if(!this.browser?.isConnected()||!this.context){await this.close();let{chromium:o}=await p3(),s=process.env.EDITOR_HOST_RESOLVER_RULES;this.browser=await o.launch({headless:!0,args:s?[...KN,`--host-resolver-rules=${s}`]:KN}),this.context=await this.browser.newContext({viewport:{width:1280,height:800}})}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())&&(this.page=await this.context.newPage());let i=new URLSearchParams({mode:"AGENT_CANVAS",leftSideTab:"page"});return r.pageId&&i.set("componentId",r.pageId),r.breakpoint&&i.set("breakpoint",r.breakpoint),this.loadedWithPatches=new Set(r.lastPatchExIds),this.loadedFor=null,await this.page.goto(`${n}/multi-client/tool/${t.projectExId}/${t.appExId}/design?${i}`,{waitUntil:"domcontentloaded",timeout:BN}),await this.page.waitForFunction(()=>!!globalThis.__ZION_AGENT_CANVAS__&&!!globalThis.document.querySelector("#canvas-viewport [data-meta-id]"),void 0,{timeout:BN}),this.loadedFor=`${t.projectExId}/${t.appExId}`,this.page}},HN=new Dy;var Il=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)}},f3=async(e,t)=>{let r=Q(e.flowId);if(!r)return t.fail(new Error("Provide a 'flowId'."));let{snapshot:n}=await Il(e,t);return t.ok(qN(n,r))},h3=async(e,t)=>{let{snapshot:r}=await Il(e,t);return t.ok(GN(r))},m3=async(e,t)=>{let{projectArgs:r,snapshot:n}=await Il(e,t),i=await t.client.request(yA,{projectExId:r.projectExId});return t.ok($N(n,i?.project?.lastDeployedServerSchema??null))},g3=async(e,t)=>{let{sArgs:r}=await Il(e,t);return t.ok(UN(await t.schemaManager.validate(r),Ye(e.limit,Py)))},y3=9e4,v3=2e3,QN=async(e,t)=>(await e.client.request(gA,{projectExId:t})).project?.lastAllPipelinePlatformStatus.find(n=>n.buildTarget==="SUPPORT_SERVICE")??null,E3=async(e,t,r,n)=>{for(;;){let i=await QN(e,t);if(i&&i.status!=="DEPLOYING"&&n(i))return i.status;if(Date.now()>=r)return null;await new Promise(o=>setTimeout(o,v3))}},_3=async(e,t)=>{let r=Date.now()+y3,{projectExId:n}=await t.getProjectArgs(e),i=await QN(t,n),o=i?.status==="DEPLOYING",s=o?t.ok():await Ry(e,t),a=s.ok?await E3(t,n,r,u=>o||u.startedAt!==i?.startedAt):null;return t.ok(VN(s.ok,s.data,s.error??null,a))},S3=async(e,t)=>{if(e.appExId)return e.appExId;let n=(_l(await t.client.request(kc,e)).apps??[]).filter(i=>i.appExId&&i.appType!=="BACKEND_ONLY");if(n.length===0)throw new Error("The project has no client app, so there is no canvas to render.");if(n.length>1)throw new Error(`Pass appExId: the project has ${n.length} client apps (${n.map(i=>i.appExId).join(", ")}), so the canvas to render is ambiguous.`);return n[0].appExId},WN=async(e,t,r,n)=>{let i=await n.getProjectArgs(r),o=nr(i.projectExId,i),s=await S3(i,n),a=await n.client.request(Lc);if(!a?.user?.exId)throw new Error("Could not resolve the signed-in account to render the canvas as.");return HN.run({projectExId:i.projectExId,appExId:s,token:await n.tokenManager.getValidToken(),user:{exId:a.user.exId,username:a.user.username??null}},{rpc:e,args:t,sessionExId:Q(r.sessionExId)??"",pageId:Q(r.pageId)??null,breakpoint:Q(r.breakpoint)??null,lastPatchExIds:await n.schemaManager.lastPatchExIds(o)})},b3=["pageId","componentId","mode","breakpoint","maxWidth","limit"],zN=e=>Object.fromEntries(b3.filter(t=>e[t]!==void 0).map(t=>[t,e[t]])),T3=async(e,t)=>t.ok(await WN("editor.getClippedComponents",zN(e),e,t)),I3=async(e,t)=>Q(e.sessionExId)?t.ok(await WN("editor.captureCanvas",zN(e),e,t)):t.fail(new Error("Provide 'sessionExId': the capture is stored as that agent session's media.")),YN={"bridge.flow_definition":f3,"bridge.trigger_bindings":h3,"bridge.deploy_status":m3,"bridge.project_errors":g3,"bridge.sync_backend":_3,"bridge.clipped_components":T3,"bridge.capture_canvas":I3};d();d();var O3=/Subselection required for type '(FZ_\w+)' of field '([^'/]+\/)?([^']+)'/,w3=/Unknown field argument '(where|limit|offset|order_by)'/,A3=/Field '([^']+)' in type '([^']+)' is undefined/,x3=/field name '([^']+)' that is not defined for input object type '(\w+)'/,R3=(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]},XN=(e,t)=>{let r=Math.max(2,Math.ceil(t.length/2));return e.map(n=>({name:n,score:R3(n.toLowerCase(),t.toLowerCase())})).filter(n=>n.score<=r).sort((n,i)=>n.score-i.score).slice(0,3).map(n=>n.name)},N3=e=>(e?.tableMetadata??[]).flatMap(t=>[t?.name,t?.displayName].filter(r=>typeof r=="string"&&r.length>0)),Ol=(e,t)=>(e?.tableMetadata??[]).find(r=>r?.name===t),JN=(e,t)=>{let r=t?.columnMetadata??[],n=r.find(o=>o?.displayName===e&&o?.name);if(n){let o=vl(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=XN(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.`},C3=(e,t,r)=>{let n=O3.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(w3.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=x3.exec(e);if(i)return JN(i[1],Ol(r,t));let o=A3.exec(e);if(!o)return null;let[,s,a]=o;if(a!=="Query"&&a!=="Mutation")return JN(s,Ol(r,t));if(Ol(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=XN(N3(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.`},ZN=(e,t,r)=>{let n=e instanceof Error?e.message:String(e),i=C3(n,t,r);return i?e instanceof Error?(e.runtimeDiagnosis=i,e):new Error(`${n}
|
|
1376
|
-
${i}`):e},eC=(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=Ol(e,t)?.columnMetadata??[];for(let o of r??[]){let s=i.find(u=>u?.name===o)??i.find(u=>u?.displayName===o),a=s?vl(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}'.`)}};d();d();var P3=/^[A-Za-z_][A-Za-z0-9_]*$/,gn=(e,t)=>{if(!P3.test(e))throw new Error(`${t} must be a GraphQL identifier`)},Ly=(e,t)=>{for(let r of e)gn(r,t)},wl=(e,t)=>{if(e.length===0)throw new Error("at least one field must be selected");return Ly(e,"fields"),e.map(r=>`${t}${r}`).join(`
|
|
1377
|
-
`)},tC=(e,t)=>(gn(e,"table"),`query AgentQuery($where: ${e}_bool_exp, $limit: Int, $offset: Int, $order_by: [${e}_order_by!]) {
|
|
1378
|
-
${e}(where: $where, limit: $limit, offset: $offset, order_by: $order_by) {
|
|
1379
|
-
${wl(t," ")}
|
|
1380
|
-
}
|
|
1381
|
-
}`),rC=e=>(gn(e,"table"),`query AgentAggregate($where: ${e}_bool_exp) {
|
|
1382
|
-
${e}_aggregate(where: $where) {
|
|
1383
|
-
aggregate {
|
|
1384
|
-
count
|
|
1385
|
-
}
|
|
1386
|
-
}
|
|
1387
|
-
}`),nC=(e,t)=>(gn(e,"table"),`mutation AgentInsert($objects: [${e}_insert_input!]!) {
|
|
1388
|
-
insert_${e}(objects: $objects) {
|
|
1389
|
-
affected_rows
|
|
1390
|
-
returning {
|
|
1391
|
-
${wl(t," ")}
|
|
1392
|
-
}
|
|
1393
|
-
}
|
|
1394
|
-
}`),iC=(e,t)=>(gn(e,"table"),`mutation AgentUpdate($where: ${e}_bool_exp!, $set: ${e}_set_input!) {
|
|
1395
|
-
update_${e}(where: $where, _set: $set) {
|
|
1396
|
-
affected_rows
|
|
1397
|
-
returning {
|
|
1398
|
-
${wl(t," ")}
|
|
1399
|
-
}
|
|
1400
|
-
}
|
|
1401
|
-
}`),oC=(e,t)=>(gn(e,"table"),`mutation AgentDelete($where: ${e}_bool_exp!) {
|
|
1402
|
-
delete_${e}(where: $where) {
|
|
1403
|
-
affected_rows
|
|
1404
|
-
returning {
|
|
1405
|
-
${wl(t," ")}
|
|
1406
|
-
}
|
|
1407
|
-
}
|
|
1408
|
-
}`),sC=()=>`mutation AgentRunCode($jsCode: String!, $args: JsonObject, $updateDb: Boolean!) {
|
|
1409
|
-
fz_debug_action_code(jsCode: $jsCode, args: $args, updateDb: $updateDb)
|
|
1410
|
-
}`;var D3=20,L3=200,k3=20,ky="id",jy=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},lC=e=>Array.isArray(e)?e:[],j3=(e,t)=>typeof e=="boolean"?e:e==null?t:String(e).toLowerCase()==="true",aC=(e,t)=>typeof e=="number"&&Number.isFinite(e)?Math.trunc(e):t,uC=(e,t)=>{let r=e[t];if(typeof r!="string"||r.trim()==="")throw new Error(`'${t}' is required.`);return r},cC=(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.`)},Al=(e,t)=>{let r=lC(e.fields).filter(n=>typeof n=="string"&&n.trim()!=="");return r.length>0?(Ly(r,"fields"),r):t.length>0?t.slice(0,k3):[ky]},M3=e=>e.includes(ky)?e:[ky,...e],My=(e,t,r=[])=>{if(e==="runtime.run_code")return{document:sC(),variables:{jsCode:uC(t,"jsCode"),args:jy(t.args),updateDb:j3(t.updateDb,!1)},rootField:"fz_debug_action_code"};let n=uC(t,"tableName");switch(gn(n,"tableName"),e){case"runtime.query":return{document:tC(n,Al(t,r)),variables:{where:t.where??{},limit:Math.min(aC(t.limit,D3),L3),offset:aC(t.offset,0),order_by:t.orderBy??null},rootField:n};case"runtime.aggregate":return{document:rC(n),variables:{where:t.where??{}},rootField:`${n}_aggregate`};case"runtime.insert":{let i=lC(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:nC(n,M3(Al(t,r))),variables:{objects:i},rootField:`insert_${n}`}}case"runtime.update":{let i=cC(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:iC(n,Al(t,r)),variables:{where:i,set:o},rootField:`update_${n}`}}case"runtime.delete":return{document:oC(n,Al(t,r)),variables:{where:cC(t,"delete","allowDeleteAll")},rootField:`delete_${n}`};default:throw new Error(`'${e}' is not a planned runtime operation.`)}},dC=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 da(e,t,r,n){let i=await r.checkSchema(t),o=await r.getProjectArgs(t),s=ri(t.tableName,"tableName"),[a,u]=await Promise.all([r.schemaManager.dataModel(nr(o.projectExId,o)),mo(r.client,o)]);eC(a,s,ti(t.fields));let c=My(e,{...t,tableName:s},_N(a,s)),l;try{l=await u.dataClient.request(c.document,c.variables)}catch(p){throw ZN(p,s,a)}return r.ok(Rt(n?dC(l):l,i))}var F3=async(e,t)=>{let r=await t.checkSchema(e),n=await t.getProjectArgs(e),i=ri(e.query,"query"),s=await(await mo(t.client,n)).dataClient.request(i,e.variables??{});return t.ok(Rt(s,r))},q3=async(e,t)=>da("runtime.query",e,t,!1),U3=async(e,t)=>da("runtime.aggregate",e,t,!1),V3=async(e,t)=>da("runtime.insert",e,t,!0),G3=async(e,t)=>da("runtime.update",e,t,!0),$3=async(e,t)=>da("runtime.delete",e,t,!0),B3=async(e,t)=>{let r=await t.getProjectArgs(e),n=My("runtime.run_code",e),o=await(await mo(t.client,r)).adminClient.request(n.document,n.variables);return t.ok({keptWrites:n.variables.updateDb===!0,result:o?.fz_debug_action_code})},pC={"runtime.graphql":F3,"runtime.run_code":B3,"runtime.query":q3,"runtime.aggregate":U3,"runtime.insert":V3,"runtime.update":G3,"runtime.delete":$3};d();var K3=["GATEWAY","ACTION_FLOW","ACTION_FLOW_NODE","ACTION_FLOW_CONTEXT_LOG","DEPLOYMENT","TPA","TRIGGER","SQL_GENERATION","GQL","ZAI"],H3=["INFO","WARNING","ERROR"],Q3=50,W3=100,fC=5,hC=e=>`${e.toISOString().slice(0,19)}Z`,z3=e=>{if(!e)return new Date;let t=new Date(e);return Number.isNaN(t.getTime())?new Date:t},mC=(e,t)=>{if(!e)return;let r=e.map(n=>n.toUpperCase()).filter(n=>t.includes(n));return r.length>0?r:void 0},Y3=async(e,t)=>{let r=await t.getProjectArgs(e),{adminToken:n}=await mo(t.client,r),i=z3(Q(e.requestCreatedAt)),o={start:hC(new Date(i.getTime()-fC*6e4)),end:hC(new Date(i.getTime()+fC*6e4)),desc:!0},s=mC(ti(e.types),K3);s&&(o.type=s);let a=mC(ti(e.levels),H3);a&&(o.level=a);let u=Q(e.customQueryCondition);u&&(o.customQueryCondition=u);let c=Math.min(W3,Ye(e.limit,Q3)),l=Nt().logApiUrlTemplate.replace("{projectExId}",r.projectExId),h=((await new Ze(l,{headers:{authorization:`Bearer ${n}`},fetch:ho}).request(vA,{queryCreation:o,paginator:{first:c}}))?.fetchLogsByPaginator?.edges??[]).map(g=>g?.node).filter(g=>!!g);return t.ok({entries:h})},gC={"logs.search":Y3};d();d();var J3=async()=>(await import("./corpus-UM23FYNV.js")).DOCS_CORPUS,X3=3,yC=null,Z3=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},e8=e=>{let t=e.map(r=>{let n=Wl(r.content),i=Wl(r.title);for(let o=0;o<X3;o+=1)n.push(...i);return{ref:r,tokens:n}});return{index:hv(t),byPath:Z3(e)}},vC=async()=>(yC??=e8(await J3()),yC),EC=async(e,t=10)=>{let{index:r}=await vC();return mv(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}))},t8=e=>{let t=e.trim().replace(/\.mdx$/,"").replace(/^\/+/,"/").replace(/\/+$/,"");return t===""||t==="/"?"/":t.startsWith("/")?t:`/${t}`},_C=async e=>(await vC()).byPath.get(t8(e))??null;var r8=async(e,t)=>{let r=Q(e.query);if(!r)throw new Error("query is required");let n=Ye(e.limit,10);return t.ok({results:await EC(r,n)})},n8=async(e,t)=>{let r=Q(e.path);if(!r)throw new Error("path is required");let n=await _C(r);if(!n)throw new Error(`No doc page found for path: ${r}`);return t.ok(n)},SC={"docs.search":r8,"docs.get_page":n8};d();var i8=async(e,t)=>{let r=Q(e.query);if(!r)throw new Error("query is required");let n=e.variables&&typeof e.variables=="object"?e.variables:{};return t.ok(await t.client.request(r,n))},bC={"platform.graphql":i8};d();var o8=async(e,t)=>{let r=await xt(),n=r?.api?.ZTypePredefinedApi;if(!n)return t.fail(new Error("ztype predefined template API is unavailable"));let o=n.getActionFlowTemplates(po(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})},TC={"actionflow.list_node_templates":o8};d();var s8=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},a8=async(e,t)=>{let n=(await t.client.request(P0)).getTabBarIcons.flatMap(i=>i?[{name:s8(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."})},IC={"component.tab_bar_icons":a8};d();d();function u8(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 c8(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 OC(e){let t=e;for(let r=0;r<=5;r++){let n=u8(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 c8(i,t)}}throw new Error(`Too many redirects fetching ${e}`)}d();var l8=/(?:href|src|url)\s*[=:]\s*["']?([^"'\s>)]+)/gi,d8=/<(script|style|noscript|svg|iframe|canvas|template|nav|footer|aside)\b[\s\S]*?<\/\1\s*>/gi,p8=new Set(["css","js","png","jpg","jpeg","gif","svg","ico","woff","woff2","ttf","webp","mp4","zip","pdf"]);function wC(e,t){if(e&&e.toLowerCase().includes("html"))return!0;let r=t.trimStart();return r.startsWith("<")&&!r.startsWith("<?xml")}function AC(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 xC(e,t){try{return new URL(t,e).toString()}catch{return t.startsWith("http")?t:null}}var f8=/^https?:\/\/app\.swaggerhub\.com\/apis(?:-docs)?\/([^/?#]+)\/([^/?#]+)\/([^/?#]+)/i;function h8(e){let t=e.match(f8);return t?`https://api.swaggerhub.com/apis/${t[1]}/${t[2]}/${t[3]}`:null}function RC(e,t){let r=[],n=i=>{i&&r.length<20&&!r.includes(i)&&r.push(i)};for(let i of e.matchAll(l8)){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=xC(t,o);n(u&&h8(u)),n(u)}return r}function NC(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);p8.has(u)||s===t||r.includes(s)||r.push(s)}return r}var m8={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",copy:"\xA9"};function Fy(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)=>m8[r.toLowerCase()]??t)}var pa=e=>e.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim();function CC(e,t){let r=e.replace(/<!--[\s\S]*?-->/g,"").replace(d8,"");return r=r.replace(/<pre\b[^>]*>([\s\S]*?)<\/pre\s*>/gi,(n,i)=>`
|
|
1411
|
-
\`\`\`
|
|
1412
|
-
${Fy(g8(i))}
|
|
1413
|
-
\`\`\`
|
|
1414
|
-
`),r=r.replace(/<code\b[^>]*>([\s\S]*?)<\/code\s*>/gi,(n,i)=>`\`${Fy(pa(i))}\``),r=r.replace(/<a\b[^>]*href\s*=\s*["']([^"']+)["'][^>]*>([\s\S]*?)<\/a\s*>/gi,(n,i,o)=>{let s=pa(o);if(!s)return"";let a=xC(t,i);return a?`[${s}](${a})`:s}),r=r.replace(/<h([1-6])\b[^>]*>([\s\S]*?)<\/h\1\s*>/gi,(n,i,o)=>`
|
|
1415
|
-
|
|
1416
|
-
${"#".repeat(Number(i))} ${pa(o)}
|
|
1417
|
-
|
|
1418
|
-
`),r=r.replace(/<t[hd]\b[^>]*>([\s\S]*?)<\/t[hd]\s*>/gi,(n,i)=>` ${pa(i)} |`).replace(/<tr\b[^>]*>/gi,`
|
|
1419
|
-
|`).replace(/<\/tr\s*>/gi,""),r=r.replace(/<li\b[^>]*>/gi,`
|
|
1420
|
-
- `).replace(/<br\s*\/?>/gi,`
|
|
1421
|
-
`).replace(/<\/(p|div|section|article|ul|ol|table|thead|tbody|dl|blockquote)\s*>/gi,`
|
|
1422
|
-
|
|
1423
|
-
`).replace(/<(strong|b)\b[^>]*>([\s\S]*?)<\/\1\s*>/gi,(n,i,o)=>`**${pa(o)}**`),r=Fy(r.replace(/<[^>]+>/g," ")),r.replace(/[^\S\n]+\n/g,`
|
|
1424
|
-
`).replace(/[ \t]{3,}/g," ").replace(/\n{3,}/g,`
|
|
1425
|
-
|
|
1426
|
-
`).trim()}var g8=e=>e.replace(/<[^>]+>/g,"");var DC=15,v8=3600*1e3,PC=new Map;function E8(e){let t=Date.now(),r=PC.get(e),n=r&&t-r.startedAt<v8?r:{used:0,startedAt:t};return n.used+=1,PC.set(e,n),DC-n.used}var _8=async(e,t)=>{let r=Q(e.url);if(!r||r.trim()==="")throw new Error("Provide a 'url' to fetch.");let n=E8(t.credentialStore.getWorkspaceRoot());if(n<0)throw new Error(`fetch budget exhausted (${DC} per session) \u2014 build the endpoints from what you have already read.`);let i=await OC(r),o=wC(i.contentType,i.body),s=o?RC(i.body,i.finalUrl):[],a=o?NC(i.body,i.finalUrl):[],u=o?CC(i.body,i.finalUrl):i.body,c=Math.max(0,Math.min(Ye(e.offset,0),u.length)),l=u.slice(c,c+2e4);return t.ok({finalUrl:i.finalUrl,contentType:i.contentType,looksLikeSpec:AC(i.body),specLinks:s,pageLinks:a,truncated:c+l.length<u.length,totalLength:u.length,fetchesRemaining:n,content:l})},LC={"web.fetch_doc":_8};d();var S8=async(e,t)=>{let r=oe(e.secretId),n=oe(e.displayName),i=oe(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.currentSchemaExId(a);if(!u)throw new Error("No loaded schema for the project; load the project schema before setting a secret value.");let c=await kN(n??r),p=(await t.client.request(aA,{projectExId:s.projectExId,schemaExId:u,secretValue:c})).saveSecret?.secretKey;if(!p)throw new Error("saveSecret did not return a secretKey.");let f=r?{name:"UPDATE_SECRET_CONFIG",args:{secretId:r,secretKey:p}}:{name:"ADD_SECRET_CONFIGS",args:{items:[{displayName:n,secretKey:p,...i?{description:i}:{}}]}},h=await t.schemaManager.ztypeToolCalls(a,[f],!1);return t.ok(Rt({status:"SAVED",applied:h},o))},kC={"secret.save_value":S8};d();d();d();import{createHash as b8}from"node:crypto";import xl from"node:fs/promises";import Rl from"node:path";var ir=class extends Error{},T8=1024,I8=255,O8=e=>{let t=e.slice(e.lastIndexOf("/")+1),r=t.lastIndexOf(".");return r<=0||r===t.length-1?null:t.slice(r+1).toLowerCase()},jC=(e,t)=>Rl.relative(e,t).split(Rl.sep).join("/").normalize("NFC"),w8=e=>{if(e.length>T8||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>I8)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}`)}},A8=async e=>{let t=b8("md5"),r=await xl.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")},MC=async(e,t,r,n)=>{let i=await xl.readdir(t,{withFileTypes:!0}),o=[],s=[];for(let a of i){let u=Rl.join(t,a.name),c=n&&a.name.startsWith(".");if(a.isDirectory()){if(c||r.has(a.name)){s.push(`${jC(e,u)}/`);continue}let l=await MC(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 Nl(e,t,r={}){let n=Rl.resolve(e);if(!(await xl.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 MC(n,n,t.ignoredDirectories??new Set,t.ignoreHidden??!1),u=a.files.sort(),c=[],l=[...a.prunedDirectories.sort()],p=[],f=0;for(let h of u){let g=jC(n,h);if(s.has(g)){p.push(g);continue}let v=O8(g);if(v===null||!t.allowedExtensions.has(v)){l.push(g);continue}w8(g);let{size:_}=await xl.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 A8(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:p}}var x8=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"]),R8="index.html",N8=2*1024*1024*1024,C8={label:"static site",entryFile:R8,entryHint:"Point --dir at the build output directory (e.g. ./dist), not the project root.",allowedExtensions:x8,maxFileSizeBytes:N8};function FC(e,t={}){return Nl(e,C8,t)}d();import P8 from"node:fs/promises";var D8=12e4,L8=1e3/(1024*1024),qC=3,k8=500,j8=256*1024*1024,M8=e=>new Promise(t=>setTimeout(t,e)),F8=e=>e>=500||e===429,q8=async(e,t,r)=>{let n=AbortSignal.timeout(Math.ceil(D8+t.byteLength*L8)),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 F8(i.status)||Object.assign(s,{fatal:!0}),s}await i.body?.cancel()},U8=async(e,t,r)=>{let n=await P8.readFile(t),i;for(let o=1;o<=qC;o+=1)try{await q8(e,n,r);return}catch(s){if(i=s,r?.aborted||s.fatal||o===qC)break;await M8(k8*2**(o-1))}throw i},qy=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 Cl(e,t,r,n){let i=[],o=[],s=new qy(j8),a=0,u=async()=>{for(;;){if(n?.aborted)return;let l=a;if(a+=1,l>=e.length)return;let p=e[l],f=t(p.path);if(!f){o.push({path:p.path,error:"no local file matches this manifest path"});continue}await s.acquire(f.sizeBytes);try{await U8(p,f.absolutePath,n),i.push(p.path)}catch(h){o.push({path:p.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 V8=8,G8=32,UC=200,$8=6,B8=6e4,K8=3,VC=e=>{let t=(Q(e.target)??"BETA").toUpperCase();if(t!=="BETA"&&t!=="PROD")throw new Error(`target must be BETA or PROD, got ${t}`);return t},Uy=async(e,t)=>{let r=await t.getProjectArgs(e);return{projectExId:r.projectExId,appExId:r.appExId??null,target:VC(e)}},Vy=(e,t)=>t.client.request(oA,e),GC=(e,t,r)=>r.client.request(iA,{projectExId:e.projectExId,appExId:e.appExId,staticSiteDeploymentExId:t}),$C=async(e,t,r,n)=>(await n.client.request(nA,{projectExId:e.projectExId,appExId:e.appExId,staticSiteDeploymentExId:t,dryRun:r})).completeStaticSiteDeployment,BC=async(e,t,r,n,i)=>{let o=await i.client.request(rA,{projectExId:e.projectExId,appExId:e.appExId,staticSiteDeploymentExId:t,offset:n?null:r,limit:n?null:UC,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}},H8=e=>e!==null&&e-B8<=Date.now(),Q8=async(e,t,r,n,i,o)=>{let s=[],a=[],u=r;for(let c=1;;c+=1){let l=await Cl(u.targets,h=>n.get(h),i,o.signal);s.push(...l.uploaded);let f=H8(u.expiresAt)&&c<K8&&!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 BC(e,t,null,f.map(h=>h.path),o)}},W8=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,UC)??null;if(l&&l.length===0)break;let p=await BC(e,t,l?null:u,l,o),f=await Q8(e,t,p,r,n,o);if(s.push(...f.uploaded),a.push(...f.failures),l)continue;let h=p.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}},z8=(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)},Y8=async(e,t,r,n)=>{let o=(await Vy(e,n)).inProgressStaticSiteDeployment;if(o){if(!r&&z8(t,o.manifest))return{deploymentExId:o.exId,resumed:!0,resumedStatus:o.status};await GC(e,o.exId,n)}return{deploymentExId:(await n.client.request(tA,{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}},KC=e=>{let t=(e.missingPaths??[]).filter(r=>typeof r=="string");return e.missingCount>t.length?null:t},J8=async(e,t,r,n)=>r!=="UPLOADING"?null:KC(await $C(e,t,!0,n)),X8=async(e,t)=>{let r=ri(e.dir,"dir"),n=ke(e.dryRun,!1),i=ke(e.force,!1),o=VC(e),s=Math.max(1,Math.min(Ye(e.concurrency,V8),G8)),a=await FC(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 Uy(e,t);u.target==="PROD"&&await la(u.projectExId,e,"deploy to production",{allowForce:!1});let c=new Map(a.files.map(I=>[I.path,I])),{deploymentExId:l,resumed:p,resumedStatus:f}=await Y8(u,a.files,i,t),h=p?await J8(u,l,f,t):null,g=new Set,v=[],_=null,b=Number.POSITIVE_INFINITY,S=0;for(let I=1;I<=$8;I+=1){S=I;let A=await W8(u,l,c,s,h,t);for(let T of A.uploaded)g.add(T);if(v=A.failures,_=await $C(u,l,!1,t),!_.incomplete||_.missingCount>=b||(b=_.missingCount,h=KC(_),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:p,fileCount:a.files.length,totalBytes:a.totalBytes,uploaded:g.size,skipped:a.skipped,siteUrl:_.siteUrl,previousDeploymentExId:_.previousDeploymentExId,...v.length?{uploadRetries:v}:{}})},Z8=async(e,t)=>{let r=await Uy(e,t),n=await Vy(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})},e6=async(e,t)=>{let r=await Uy(e,t),i=Q(e.deploymentExId)??(await Vy(r,t)).inProgressStaticSiteDeployment?.exId;if(!i)return t.ok({target:r.target,aborted:null},"no in-progress deployment to abort");let o=await GC(r,i,t);return t.ok({deploymentExId:i,target:r.target,status:o.abortStaticSiteDeployment.status})},HC={"site.deploy":X8,"site.status":Z8,"site.abort":e6};d();import zC from"node:fs/promises";import YC from"node:path";d();var t6=new Set(["js","ts","json","wxml","wxss","wxs","png","jpg","jpeg","gif","svg","webp","ico","ttf","otf","woff","woff2","mp3","mp4","wasm","cer","txt"]),r6=new Set(["project.config.json","project.private.config.json"]),n6=new Set(["node_modules"]),i6="app.json",o6=5e3,QC=20*1024*1024,s6={label:"WeChat mini program source",entryFile:i6,entryHint:"Point --dir at the mini program root (the directory holding app.js / app.json / app.wxss).",allowedExtensions:t6,ignoredDirectories:n6,ignoreHidden:!0,reservedFiles:r6,maxFileSizeBytes:QC,maxFileCount:o6,maxTotalBytes:QC};function WC(e,t={}){return Nl(e,s6,t)}var a6=8,u6=32,JC=200,c6=6,l6=6e4,d6=3,p6=900,f6=5e3,XC="wechat-trial-qrcode.jpg",Pl=async(e,t)=>{let r=await t.getProjectArgs(e);return{projectExId:r.projectExId,appExId:r.appExId??null}},Gy=(e,t)=>t.client.request(pA,e),ZC=(e,t,r)=>r.client.request(dA,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t}),eP=async(e,t,r,n)=>(await n.client.request(lA,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t,dryRun:r})).completeWechatSourceCodeUpload,tP=async(e,t,r,n,i)=>{let o=await i.client.request(cA,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t,offset:n?null:r,limit:n?null:JC,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}},h6=e=>e!==null&&e-l6<=Date.now(),m6=async(e,t,r,n,i,o)=>{let s=[],a=[],u=r;for(let c=1;;c+=1){let l=await Cl(u.targets,h=>n.get(h),i,o.signal);s.push(...l.uploaded);let f=h6(u.expiresAt)&&c<d6&&!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 tP(e,t,null,f.map(h=>h.path),o)}},g6=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,JC)??null;if(l&&l.length===0)break;let p=await tP(e,t,l?null:u,l,o),f=await m6(e,t,p,r,n,o);if(s.push(...f.uploaded),a.push(...f.failures),l)continue;let h=p.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}},y6=(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)},v6=async(e,t,r,n)=>{let i=await Gy(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&&y6(t,s.manifest))return{deploymentExId:s.exId,resumed:!0,resumedStatus:s.status};await ZC(e,s.exId,n)}return{deploymentExId:(await n.client.request(uA,{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},E6=async(e,t,r,n)=>r!=="UPLOADING"?null:rP(await eP(e,t,!0,n)),_6=async(e,t,r)=>(await r.client.request(fA,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t})).wechatSourceCodeDeployment,nP=async(e,t)=>(await t.client.request(hA,{projectExId:e.projectExId})).project,S6=async(e,t)=>(await t.client.request(mA,{projectExId:e.projectExId})).project,b6=(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})}),iP=async(e,t)=>{let r=YC.resolve(t),n=Buffer.from(e,"base64");return await zC.mkdir(YC.dirname(r),{recursive:!0}),await zC.writeFile(r,n),{qrCodePath:r,qrCodeBytes:n.length}},T6=async(e,t,r,n)=>{let i=Date.now(),o=i+r*1e3;for(;;){n.signal?.throwIfAborted();let a=(await _6(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 b6(Math.min(f6,Math.max(0,o-Date.now())),n.signal)}},I6=async(e,t)=>{let r=ri(e.dir,"dir"),n=ke(e.dryRun,!1),i=ke(e.force,!1),o=ke(e.wait,!0),s=Math.max(0,Ye(e.timeoutSeconds,p6)),a=Q(e.qrOut)??XC,u=Math.max(1,Math.min(Ye(e.concurrency,a6),u6)),c=await WC(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 Pl(e,t),p=new Map(c.files.map(de=>[de.path,de])),{deploymentExId:f,resumed:h,resumedStatus:g}=await v6(l,c.files,i,t),v=h?await E6(l,f,g,t):null,_=new Set,b=[],S=null,I=Number.POSITIVE_INFINITY,A=0;for(let de=1;de<=c6;de+=1){A=de;let ge=await g6(l,f,p,u,v,t);for(let O of ge.uploaded)_.add(O);if(b=ge.failures,S=await eP(l,f,!1,t),!S.incomplete||S.missingCount>=I||(I=S.missingCount,v=rP(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 D=await T6(l,f,s,t);if(D.timedOut)return t.ok({...T,status:D.status,waited:!0,timedOut:!0,waitedSeconds:D.waitedSeconds},`build is still running after ${D.waitedSeconds}s \u2014 poll \`wechat status\` for the trial version`);if(D.status!=="SUCCEEDED")return t.fail(new Error(`deployment ${f} ended in ${D.status} after ${D.waitedSeconds}s. The upload landed but the WeChat build did not succeed; check the deployment record ${S.deploymentRecordExId??"(none)"} for the failure.`));let V=await nP(l,t),x=V?.wechatMiniAppQRCodeBase64??null,te=x?await iP(x,a):null;return t.ok({...T,status:D.status,waited:!0,waitedSeconds:D.waitedSeconds,trialVersion:V?.wechatMiniAppPreviewVersion??null,trialVersionCommittedAt:V?.wechatMiniAppPreviewTime??null,...te??{qrCodePath:null}})},O6=async(e,t)=>{let r=await Pl(e,t),n=await Gy(r,t),i=await S6(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})},w6=async(e,t)=>{let r=await Pl(e,t),i=Q(e.deploymentExId)??(await Gy(r,t)).inProgressWechatSourceCodeDeployment?.exId;if(!i)return t.ok({aborted:null},"no in-progress upload to abort");let o=await ZC(r,i,t);return t.ok({deploymentExId:i,status:o.abortWechatSourceCodeDeployment.status})},A6=async(e,t)=>{let r=await Pl(e,t),n=Q(e.out)??XC,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 iP(o,n);return t.ok({...s,trialVersion:i?.wechatMiniAppPreviewVersion??null,trialVersionCommittedAt:i?.wechatMiniAppPreviewTime??null})},oP={"wechat.deploy":I6,"wechat.status":O6,"wechat.abort":w6,"wechat.qrcode":A6};d();var sP={...ON,...PN,...MN,...FN,...YN,...pC,...gC,...SC,...bC,...TC,...IC,...LC,...kC,...HC,...oP};d();d();var x6=new Map([["claude-code","Claude Code"],["codex-mcp-client","Codex"]]);function aP(e){let t=typeof e?.name=="string"?e.name:"",r=typeof e?.title=="string"?e.title:"";return x6.get(t)??(r||t||"the coding agent")}function Dl(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 ni(e,t,r){let n=`${X} ${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 ${X}@latest\` if ${X} was installed with npm), then ${Dl(r)} so it starts the new version.`}function uP(e,t){return`${X} 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 cP(e,t,r){return`Note: ${X} 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 ${X} was upgraded and that to use the new version's tools they should ${Dl(r)}. Then carry on with their request; everything that worked before still works.`}function lP(e,t,r,n){let i=Dl(r);return n.upgradedFrom&&n.toolListReloaded?`${X} has no tool ${e}. ${X} 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?`${X} has no tool ${e}. ${X} 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.`:`${X} ${t} has no tool ${e}. Use only the tools in your current tool list; if that list was loaded from another ${X} version, tell the user, in their language, to ${i}, then try again.`}function dP(e,t,r,n){return n?`${X} 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.`:`${X} 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 ${Dl(r)}.`}var R6=B`
|
|
1427
|
-
query SupportedMcpVersion {
|
|
1428
|
-
supportedMcpVersion {
|
|
1429
|
-
latest
|
|
1430
|
-
minSupported
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
`,N6=3600*1e3,C6=3600*1e3;function pP(e={}){let t=e.check??fa,r=e.now??Date.now,n=e.ttlMs??N6,i=e.unknownTtlMs??C6,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)}}}function P6(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 fa(){let{agentVersion:e}=await fy();try{let t=Nt(),r=new Ze(`${t.apiBaseUrl}/api/graphql`,{headers:{"User-Locale":"en_US"}}),{supportedMcpVersion:n}=await r.request(R6),{latest:i,minSupported:o}=n;return{status:oi(e,o)<0?"outdated":"ok",current:e,latest:i,minSupported:o}}catch(t){return C.debug(`[version-check] skipped: ${String(t)}`),{status:"unknown",current:e,reason:P6(t)}}}function Ll(e){return e.status==="outdated"?ni(e):e.status==="ok"?`${X} ${e.current} meets the backend minimum ${e.minSupported} (latest ${e.latest}).`:`${X} ${e.current}: ${e.reason}; skipping compatibility check.`}var D6=new Set(["docs.search","docs.get_page","auth.login","auth.reauth","auth.logout","auth.whoami","workspace.set"]),L6=e=>new Proxy({},{get(){throw new Error(`${e} is a local-only command and has no authenticated client`)}});function k6(e){if(!(e instanceof Error))return String(e);let r=gy(e.response?.errors)||e.message||String(e),n=e.runtimeDiagnosis;return typeof n=="string"?`${r}
|
|
1434
|
-
${n}`:r}function kl(e,t={}){let r=new Sr(e),n=new zi(r),i=new yl(()=>yy(n,r),t.watchSchemaChanges?async(...c)=>(await iN(n,r))(...c):void 0),o=pP({check:t.checkMcpVersion}),s=(c,l)=>({ok:!0,data:c,message:l}),a=c=>(c instanceof Error&&c.stack&&C.debug(`[AgentApp] command failed: ${c.stack}`),{ok:!1,error:k6(c),data:c instanceof fn?{ztypeDiagnostics:c.diagnostics}:void 0});return{execute:async(c,l)=>{let p=EN(c.args),f=D6.has(c.name);try{if(!f){let I=await o.check();if(I.status==="outdated")return{ok:!1,error:Ll(I),data:{upgrade:I}}}let h=sP[c.name];if(!h)throw new Error(`Unknown command: ${c.name}`);let g=f?L6(c.name):await yy(n,r),v=null,_=async I=>(v??=await SN(r,I),v),b=async I=>{let A=await _(I);return i.checkRemoteAndSync(nr(A.projectExId,A))},S={credentialStore:r,tokenManager:n,schemaManager:i,client:g,signal:l,codingAgent:c.agent,hostSessionId:c.sessionId,getProjectArgs:_,checkSchema:b,ok:s,fail:a};return await h(p,S)}catch(h){return a(h)}},schemaManager:i,setWorkspaceRoot(c){r.setWorkspaceRoot(c),i.clear()},stop(){i.clear()}}}d();import jl from"net";d();import{StringDecoder as j6}from"string_decoder";var ha=e=>{let t=new j6("utf8"),r="";return n=>{for(r+=t.write(n);;){let i=r.indexOf(`
|
|
1435
|
-
`);if(i<0)return;let o=r.slice(0,i);r=r.slice(i+1),o.trim()!==""&&e(o)}}};var M6=600*1e3;async function _t(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://")?jl.createConnection(hP(n)):jl.createConnection(n),l=setTimeout(()=>{c.destroy(),u(new Error(`Timed out waiting for daemon response to ${t.name}`))},M6),p=()=>{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)}
|
|
1436
|
-
`)}),c.on("data",ha(h=>{clearTimeout(l),p(),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),p(),u(h)})})}function fP(e,t,r){let{socketPath:n,token:i}=e,o=null,s=!1,a=null,u=()=>{if(s)return;o=n.startsWith("tcp://")?jl.createConnection(hP(n)):jl.createConnection(n);let c=`sub-${Date.now()}-${Math.random().toString(16).slice(2)}`,l={id:c,token:i,command:{name:"schema.subscribe"}},p=o;p.on("connect",()=>{p.write(`${JSON.stringify(l)}
|
|
1437
|
-
`)}),p.on("data",ha(f=>{if(!p.destroyed)try{let h=JSON.parse(f);if(h.id===c)return;h.event==="schemaChanged"&&t(h.data)}catch(h){C.warn(`Failed to parse daemon event, destroying socket to force reconnect. Line: ${f}`,h),p.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 hP(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}}d();import{createHash as F6,randomUUID as mP}from"crypto";import{promises as yo,rmSync as q6}from"fs";import vo from"path";var U6="registry.json",yn=class{constructor(t){this.workspaceRoot=t;this.root=vo.join(t,`.${X}`,"daemon"),this.logRoot=vo.join(this.root,"logs"),this.socketRoot=vo.join(this.root,"sockets"),this.registryPath=vo.join(this.root,U6)}root;logRoot;socketRoot;registryPath;async ensure(){await yo.mkdir(this.root,{recursive:!0,mode:448}),await yo.mkdir(this.logRoot,{recursive:!0,mode:448}),await yo.mkdir(this.socketRoot,{recursive:!0,mode:448})}async list(){await this.ensure();try{let t=await yo.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=>tN(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=mP(),n=F6("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:mP(),logPath:vo.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=vo.join(this.socketRoot,`${t}.sock`);return r.length<=100?r:"tcp://127.0.0.1:0"}unlinkSocket(t){if(!t.startsWith("tcp://"))try{q6(t,{force:!0})}catch{}}async write(t){await this.ensure();let r=`${this.registryPath}.tmp`;await yo.writeFile(r,JSON.stringify(t,null,2),{mode:384}),await yo.rename(r,this.registryPath)}isProcessAlive(t){try{return process.kill(t,0),!0}catch{return!1}}};d();import{chmodSync as V6}from"fs";import G6 from"net";var Ml=10800*1e3;async function gP(e){let t=e.idleTimeoutMs??Ml,r=new yn(e.workspaceRoot),n=new Sr(e.workspaceRoot),i=new zi(n),o=await fo(n,e.startupFlags??[]),s=r.createRecord(o),a=kl(e.workspaceRoot,{watchSchemaChanges:!0}),u=new Set;a.schemaManager.emitter.on("schemaChanged",T=>{let D=JSON.stringify({event:"schemaChanged",data:T})+`
|
|
1438
|
-
`;for(let V of u)try{V.write(D)}catch{u.delete(V)}});let c=new Map,l=0,p=!1,f=Date.now(),h=null,g=()=>{f=Date.now()},v=(T,D)=>`${JSON.stringify({id:T,result:D})}
|
|
1439
|
-
`,_=async()=>{s.compatibility=await fo(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 D=typeof T.command.args?.token=="string"?T.command.args.token:`${Date.now()}-${Math.random()}`;return c.set(D,{token:D,lastSeenAt:Date.now()}),{ok:!0,data:{token:D}}}case"daemon.heartbeat":{let D=T.command.args?.token;return typeof D=="string"&&c.has(D)&&c.set(D,{token:D,lastSeenAt:Date.now()}),{ok:!0}}case"daemon.unpin":{let D=T.command.args?.token;return typeof D=="string"&&c.delete(D),{ok:!0}}case"daemon.stop":return p=!0,setTimeout(()=>I(0),25),{ok:!0,message:"Stopping daemon"};default:return null}},S=()=>{let T=Date.now();for(let[D,V]of c.entries())T-V.lastSeenAt>t&&c.delete(D)},I=async T=>{h&&h.close(),a.stop(),await r.remove(process.pid).catch(()=>{}),process.exit(T)};setInterval(()=>{S(),a.schemaManager.sweep(),p||i.refreshIfNeeded(),!(p||l>0||c.size>0)&&Date.now()-f>t&&(C.info("Daemon idle timeout reached; shutting down"),I(0))},3e4).unref(),h=G6.createServer(T=>{let D=!1,V=new Map;T.on("close",()=>{u.delete(T);for(let te of V.values())te.abort();V.clear()}),T.on("error",()=>{u.delete(T);for(let te of V.values())te.abort();V.clear()});let x=te=>{(async()=>{l+=1,g();let de="unknown";try{let ge=JSON.parse(te);if(de=ge.id,ge.token!==s.token){T.write(v(ge.id,{ok:!1,error:"Unauthorized: invalid or missing daemon token"}));return}if(ge.command.name==="schema.subscribe"){D=!0,u.add(T),T.write(v(ge.id,{ok:!0,message:"Subscribed to schema events"}));return}let O=new AbortController;V.set(ge.id,O);let Ne=await b(ge)??await a.execute(ge.command,O.signal);Ne.ok&&(ge.command.name==="auth.login"||ge.command.name==="auth.reauth"||ge.command.name==="auth.logout")&&await _(),T.write(v(ge.id,Ne))}catch(ge){let O=de!=="unknown"?de:$6(te);T.write(v(O,{ok:!1,error:ge instanceof Error?ge.message:String(ge)}))}finally{l-=1,g(),de!=="unknown"&&V.delete(de),D||T.end()}})()};T.on("data",ha(x))}),await r.ensure(),await new Promise((T,D)=>{if(h?.once("error",D),s.socketPath.startsWith("tcp://")){h?.listen(0,"127.0.0.1",()=>{let x=h?.address();if(!x||typeof x=="string"){D(new Error("Daemon TCP listener did not expose a port"));return}s.socketPath=`tcp://127.0.0.1:${x.port}`,T()});return}let V=s.socketPath;h?.listen(V,()=>{try{V6(V,384)}catch{}T()})}),await r.upsert(s),C.info(`Daemon listening on ${s.socketPath}`),pv(),process.on("SIGINT",()=>void I(0)),process.on("SIGTERM",()=>void I(0))}function $6(e){try{return JSON.parse(e).id??"unknown"}catch{return"unknown"}}d();d();import yP from"node:process";d();var Eo=class{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
|
|
1440
|
-
`);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),B6(r)}clear(){this._buffer=void 0}};function B6(e){return gv.parse(JSON.parse(e))}function Fl(e){return JSON.stringify(e)+`
|
|
1441
|
-
`}var ql=class{constructor(t=yP.stdin,r=yP.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new Eo,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=Fl(t);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};import{spawn as iX}from"child_process";import OP from"path";import{randomUUID as oX}from"crypto";d();function vP(){let{productName:e}=bv();return`# ${e} MCP \u2014 no-code platform (visual UI + PostgreSQL + actionflows)
|
|
1442
|
-
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.
|
|
1443
|
-
|
|
1444
|
-
## Session
|
|
1445
|
-
- Pin a project with set_current_project (or pass projectExId); resolve a name via get_projects.
|
|
1446
|
-
- Warm it with schema_session op=LOAD before reading/editing. Edits apply immediately (CRDT patch) but are NOT live until sync_backend; schema_undo reverts the last; re-read before the next.
|
|
1447
|
-
- Deploy with schema_session op=VALIDATE \u2192 sync_backend; never sync an unvalidated session.
|
|
1448
|
-
|
|
1449
|
-
## Tools \u2014 call guide {plugin} for an area's rules before editing it
|
|
1450
|
-
Schema editing: one tool per capability, each {op, args} where op is a schema ToolName \u2014 database, type, bindings, actionflow, api, secret, zai, component. Read/write ALL runtime data (queries, mutations, aggregates, invoking actionflows/AI, uploads) via runtime_graphql. Diagnose: search_logs. Docs: search_docs \u2192 get_doc_page.
|
|
1451
|
-
|
|
1452
|
-
## Cannot do (consultant only)
|
|
1453
|
-
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.)
|
|
1454
|
-
|
|
1455
|
-
## Always
|
|
1456
|
-
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.`}d();import{randomUUID as K6}from"crypto";d();function Ul(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 ma(e){let t=Kl(e.minSupported)?e.minSupported:e.current;return[...new Set([e.latest,e.minSupported])].filter(Kl).filter(r=>oi(r,e.current)>0&&oi(r,t)>=0).sort((r,n)=>oi(n,r))}function _o(e){return ma(e)[0]??null}async function EP(e,t,r=new Oo,n){let i=_o(e);if(!i||!wo(n))return{kind:"UNAVAILABLE"};process.stderr.write(`[${X}] ${e.current} is no longer supported by the backend; upgrading to ${i}...
|
|
1457
|
-
`);let o;try{o=await r.installFirst(ma(e))}catch(s){return{kind:"FAILED",reason:s instanceof Error?s.message:String(s)}}return{kind:"RERAN",status:await uv(r,o,t)}}async function _P(e,t=new Oo,r){if(!wo(r))return;let n=await e();n.status==="outdated"&&_o(n)&&await t.installFirst(ma(n))}var SP=`__MCP_UPGRADE_HANDOVER_${K6()}__`,H6=4e4,Q6=3e4,W6=600*1e3,z6=2e3,Y6=`${X} upgraded itself from`,J6=/^(MCP error -?\d+: )?Tool \S+ not found/,X6=/^(MCP error -?\d+: )?Input validation error/,Z6=new Set(["logging/setLevel","resources/subscribe","resources/unsubscribe"]),eX=["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed"],bP=e=>"method"in e&&"id"in e,IP=e=>"id"in e&&!("method"in e),Vl=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 By;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(IP(t)){let n=this.pending.get(t.id);if(this.pending.delete(t.id),n&&this.upgrade&&JSON.stringify(t).includes(SP)){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=Ul(i);return!o||!this.options.canUpgrade(o)?i:(this.requestUpgrade(o),{ok:!1,error:SP})}}fromHost(t,r){if(bP(t)&&t.method==="tools/list"&&this.toolsRelisted.mark(),this.relay){this.relay.send(t);return}bP(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(Z6.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<W6)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);C.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 Ky(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 eX)await this.options.inner.send({jsonrpc:"2.0",method:o});return C.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($y(t,"internal error: upgrade was not requested"));return}if(r.kind==="FAILED"){await this.options.inner.send($y(t,ni(r.version,r.reason,this.host())));return}let n=await nX(r.target,this.options.waitMs??H6);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(Y6)?a:TP(a,cP(o,s,this.host()))});return}let i=n.kind==="TIMEOUT"?uP(r.version.current,_o(r.version)??r.version.latest):ni(r.version,n.reason,this.host());await this.options.inner.send($y(t,i))}reloadGraceMs(){return this.options.toolReloadGraceMs??z6}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 aP(t)}async withToolHint(t,r){if(t.method!=="tools/call")return r;let n=tX(r);if(n===null)return r;let{upgradedFrom:i,currentVersion:o}=this.options;return J6.test(n)?rX(r,lP(String(t.params?.name??""),o,this.host(),{upgradedFrom:i,toolListReloaded:i?await this.hostRelistedTools():!1})):i&&X6.test(n)?TP(r,dP(i,o,this.host(),await this.hostRelistedTools())):r}};function tX(e){let t=e.result,r=t?.content?.[0];return t?.isError&&r?.type==="text"&&typeof r.text=="string"?r.text:null}function rX(e,t){return{jsonrpc:"2.0",id:e.id,result:{content:[{type:"text",text:t}],isError:!0}}}function TP(e,t){if(e.error)return{jsonrpc:"2.0",id:e.id,error:{...e.error,message:`${e.error.message}
|
|
1458
|
-
${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 $y(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 By=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 nX(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 Ky=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){C.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 Eo;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(Fl(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}`))},Q6);this.waiters.set(n,a=>{clearTimeout(s),i(a)}),this.send({jsonrpc:"2.0",id:n,method:t,params:r})})}route(t){if(IP(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 Gl=Io.toLowerCase(),wP=e=>`${Gl}://project/${encodeURIComponent(e)}/schema-state`,AP=e=>`${Gl}://project/${encodeURIComponent(e)}/schema-events`,xP=e=>Array.isArray(e)?String(e[0]??""):String(e??"");async function Hy(e){let t=OP.resolve(e),r=await ga(t),n=RP(),i=async()=>{await _t(r,{name:"daemon.pin",args:{token:n}})},o=async()=>{await _t(r,{name:"daemon.unpin",args:{token:n}}).catch(()=>{})};await i();let s=setInterval(()=>{_t(r,{name:"daemon.heartbeat",args:{token:n}}).catch(()=>{})},6e4);s.unref();let a=new Ev({name:X,version:"1.0.0"},{instructions:vP(),capabilities:{tools:{},prompts:{},resources:{subscribe:!0}}});lv(a);let u=new Set;a.server.setRequestHandler(yv,S=>(u.add(S.params.uri),{})),a.server.setRequestHandler(vv,S=>(u.delete(S.params.uri),{}));let c=process.env.MCP_HOST_SESSION_ID||oX(),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=OP.resolve(S.args.cwd);if(S.args.cwd=A,A!==t){let T=r;r=await ga(A),t=A,await _t(T,{name:"daemon.unpin",args:{token:n}},I).catch(()=>{}),await i()}}return _t(r,S,I)},p=new Oo,f=new Vl({inner:new ql,currentVersion:En(),upgradedFrom:process.env.MCP_UPGRADED_FROM||void 0,canUpgrade:S=>wo()&&_o(S)!==null,prepare:S=>p.installFirst(ma(S)),launch:S=>iX(process.execPath,[p.binPath(S),"mcp","--cwd",t],{stdio:["pipe","pipe","inherit"],env:{...process.env,MCP_HOST_SESSION_ID:c,MCP_UPGRADED_FROM:En()}}),onRelayActive:()=>{clearInterval(s),v.unsubscribe(),o()},onRelayExit:S=>process.exit(S)});Sv(a,f.wrapSender(l)),Tv(a,f.wrapSender(l));let h=async()=>{let S=await _t(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 zl(`${Gl}://project/{projectExId}/schema-state`,{list:async()=>({resources:(await h()).map(S=>({uri:wP(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=xP(I.projectExId),T=await _t(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 zl(`${Gl}://project/{projectExId}/schema-events`,{list:async()=>({resources:(await h()).map(S=>({uri:AP(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=xP(I.projectExId),T=await _t(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||_P(fa,p).catch(S=>{C.warn(`[upgrade] prefetch failed: ${String(S)}`)});let g=new Set,v=fP(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=wP(I),T=AP(I),D=[u.has(A)?a.server.sendResourceUpdated({uri:A}):Promise.resolve(),u.has(T)?a.server.sendResourceUpdated({uri:T}):Promise.resolve()];await Promise.all([...D,a.sendLoggingMessage({level:"notice",logger:X,data:{message:"Project schema changed",projectExId:I,event:S}})])},S=>{C.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()})}d();var sX=/^-?\d+(\.\d+)?$/;function aX(e){return e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")}function uX(e){if(e==="true")return!0;if(e==="false")return!1;if(sX.test(e))return Number(e);if(aX(e))try{return JSON.parse(e)}catch{return e}return e}function NP(e){let t=Number(e);if(Number.isNaN(t))throw new fd("expected a number");return t}function Qy(e){try{return JSON.parse(e)}catch{throw new fd("expected valid JSON")}}function CP(e){if(typeof e!="string")return{};try{let t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function cX(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]=uX(o)}return t}function PP(e,t,r){let n=CP(e.args);return Object.assign(n,cX(t)),r&&(n.subcommand=r),n}function DP(e,t){let r=CP(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}d();function lX(e){let t=e,r=!1;for(;;)if(t instanceof Ct.ZodOptional)r=!0,t=t.unwrap();else if(t instanceof Ct.ZodNullable)t=t.unwrap();else if(t instanceof Ct.ZodDefault)t=t.removeDefault();else break;return{base:t,optional:r}}function LP(e,t){for(let[r,n]of Object.entries(t)){let{base:i,optional:o}=lX(n),s=o?"":"required",a=`${s} JSON`.trim();i instanceof Ct.ZodBoolean?(e.option(`--${r}`,s),e.option(`--no-${r}`)):i instanceof Ct.ZodNumber?e.option(`--${r} <value>`,s,NP):i instanceof Ct.ZodArray?i.element instanceof Ct.ZodString?e.option(`--${r} <values...>`,s):e.option(`--${r} <json>`,a,Qy):i instanceof Ct.ZodRecord||i instanceof Ct.ZodObject||i instanceof Ct.ZodAny||i instanceof Ct.ZodUnknown?e.option(`--${r} <json>`,a,Qy):e.option(`--${r} <value>`,s)}}var Wy=["default"],FP=[];function ii(e){return typeof e.cwd=="string"?MP.resolve(e.cwd):process.env.WORKSPACE_ROOT||process.cwd()}function $l(e){return e.pretty===void 0?!0:!e.pretty}async function qP(e,t,r){let n={name:e,args:t},i=ii(r),o=r.daemon===!1?await IX(n,i):await TX(n,i),s=Ul(o);if(s){let a=await EP(s,FP);if(a.kind==="RERAN"){cv(a.status);return}a.kind==="FAILED"&&(o={...o,error:ni(s,a.reason)})}Bl(o,$l(r)),o.ok||(process.exitCode=1)}async function gX(e){let t=await ga(ii(e));Bl({ok:!0,data:UP(t),message:"Daemon started"},$l(e))}async function yX(e){await gP({workspaceRoot:ii(e),idleTimeoutMs:OX(process.env.ZED_AGENT_DAEMON_IDLE_TTL)??Ml,startupFlags:Wy})}async function vX(e){let r=await new yn(ii(e)).list();Bl({ok:!0,data:r.map(UP)},$l(e))}async function EX(e){let t=ii(e),r=new yn(t),n=new Sr(t),i=await fo(n,Wy),o=await r.list(),s=[];for(let a of o)if(JSON.stringify(a.compatibility)===JSON.stringify(i))try{await _t(a,{name:"daemon.stop"}),s.push(a.pid)}catch{await r.remove(a.pid)}Bl({ok:!0,data:{stopped:s}},$l(e))}function kP(e,t){return e.commands.find(r=>r.name()===t)}function jP(e,t,r,n,i){let o=e;for(let u=0;u<t.length-1;u+=1)o=kP(o,t[u])??o.command(t[u]);let s=t[t.length-1];if(kP(o,s))return;let a=o.command(s).description(r);i&&LP(a,i),a.action(async(u,c)=>{let l=c.optsWithGlobals();await qP(n,DP(c,l),l)})}function _X(e,t,r,n){jP(e,r.path.split(" "),t.description,t.command,n),r.alias&&jP(e,r.alias.split(" "),t.description,t.command,n)}function SX(){let e=Nt(),t=Object.keys(av).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 ~/.${X}/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: ${dv()}`,` 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(`
|
|
1459
|
-
`)}function bX(e){return e instanceof Error&&"code"in e&&typeof e.code=="string"&&e.code.startsWith("commander.")}async function jhe(e=process.argv.slice(2)){FP=e;let t=new Mv;t.name(X).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 Hy(ii(o.optsWithGlobals()))}),t.command("version-check").description("Compare this CLI against the backend-advertised minimum supported version").action(async()=>{let i=await fa();process.stdout.write(`${Ll(i)}
|
|
1460
|
-
`),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-JDDFP4JL.js");process.stdout.write(`${JSON.stringify(await i(),null,2)}
|
|
1461
|
-
`)});let r=t.command("daemon").description("Daemon control"),n=[["start","Start daemon",gX],["foreground","Run daemon in foreground",yX],["status","Get daemon status",vX],["stop","Stop daemon",EX]];for(let[i,o,s]of n)r.command(i).description(o).action(async(a,u)=>{await s(u.optsWithGlobals())});for(let i of _v){if(!i.cli)continue;let o=i.cli,s=i.tool?.inputSchema;_X(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 Hy(ii(a));return}let u=[],c=[],l=!1;for(let p of i)!l&&p.startsWith("--")&&(l=!0),(l?c:u).push(p);await qP(u[0],PP(a,c,u[1]),a)}),t.addHelpText("afterAll",SX);try{await t.parseAsync(["node",X,...e])}catch(i){if(bX(i)){i.code==="commander.help"||i.code==="commander.helpDisplayed"||i.code==="commander.version"||(process.exitCode=1);return}throw i}}async function TX(e,t){let r=await ga(t);return _t(r,e)}async function IX(e,t){let r=kl(t);try{return await r.execute(e)}finally{r.stop()}}async function ga(e){let t=new yn(e),r=new Sr(e),n=await fo(r,Wy),i=await t.findCompatible(n);if(i)try{if((await _t(i,{name:"daemon.ping"})).ok)return i}catch{await t.remove(i.pid)}let o=t.createRecord(n);await t.ensure(),await mX.mkdir(MP.dirname(o.logPath),{recursive:!0});let s=hX(o.logPath,"a"),a=dX(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(Ml)},stdio:["ignore",s,s]});fX(s),a.unref();let u=Date.now()+1e4,c=null;for(;Date.now()<u;){await wX(200);let l=await t.findCompatible(n);if(l)try{if((await _t(l,{name:"daemon.ping"})).ok)return l}catch(p){c=p}}throw new Error(`Failed to start daemon${c?`: ${c.message}`:""}`)}function UP(e){let{token:t,...r}=e;return r}function Bl(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)}
|
|
1462
|
-
`);return}e.message&&process.stdout.write(`${e.message}
|
|
1463
|
-
`),e.data!==void 0&&process.stdout.write(`${JSON.stringify(e.data,null,2)}
|
|
1464
|
-
`),e.error&&process.stderr.write(`${e.error}
|
|
1465
|
-
`)}function OX(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 RP(){return pX()}var wX=e=>new Promise(t=>{setTimeout(t,e)});export{RP as createMcpPinToken,ga as ensureDaemon,jhe as runCli};
|