@powerhousedao/connect 5.2.0-staging.9 → 6.0.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddDriveModal-DPAIVc5B.js +1 -0
- package/dist/assets/ClearStorageModal-DDCSnHBa.js +1 -0
- package/dist/assets/CookiesPolicyModal-D5koyP0a.js +1 -0
- package/dist/assets/CreateDocumentModal-WDQNTedg.js +1 -0
- package/dist/assets/DebugSettingsModal-DWoSRmAX.js +1 -0
- package/dist/assets/DeleteDriveModal-BeubmwBZ.js +1 -0
- package/dist/assets/DeleteItemModal-DNjWQGhA.js +1 -0
- package/dist/assets/DisclaimerModal-Bl0JZtHi.js +1 -0
- package/dist/assets/DriveSettingsModal-CXQCQZHm.js +1 -0
- package/dist/assets/ExportDocumentWithErrorsModal-CqOhmcTh.js +1 -0
- package/dist/assets/SettingsModal-B-Ext2a5.js +1 -0
- package/dist/assets/UpgradeDriveModal-BTM20583.js +1 -0
- package/dist/assets/{design_system-A06C6Yf1.js → design_system-B-LWHRUh.js} +2 -2
- package/dist/assets/design_system_connect-cVSO9Msn.js +47 -0
- package/dist/assets/design_system_ui-CcOSmEq3.js +1 -0
- package/dist/assets/document_drive-Cn6j768A.js +316 -0
- package/dist/assets/{document_engineering-DyUJTCDd.js → document_engineering-D0rEhMoj.js} +1 -1
- package/dist/assets/document_model-BZM9Doht.js +230 -0
- package/dist/assets/document_model_editor-B6UOlNyW.js +25 -0
- package/dist/assets/{drive_explorer-CmtyoZn3.js → drive_explorer-CqMBWXV9.js} +2 -2
- package/dist/assets/{graphql-BS4Brs_E.js → graphql-AKTCpY7l.js} +45 -45
- package/dist/assets/{graphql-editor-XmXHvN5a.js → graphql-editor-Bz53xwVM.js} +2 -2
- package/dist/assets/{graphql_request-9RNJ00DB.js → graphql_request-BJtmW2JS.js} +1 -1
- package/dist/assets/{hooks-BErIZKfJ.js → hooks-B7GA7zmd.js} +1 -1
- package/dist/assets/index-BGt-bCk0.js +18 -0
- package/dist/assets/index-DNce0SAe.css +1 -0
- package/dist/assets/index-cGjbPuoF.js +28 -0
- package/dist/assets/{json-editor-DlieF2PT.js → json-editor-CKRAKV7M.js} +1 -1
- package/dist/assets/nodefs-Dmk3giym.js +1 -0
- package/dist/assets/{opfs-ahp-DL7h9dwT.js → opfs-ahp-DQdCBulO.js} +1 -1
- package/dist/assets/{reactor_browser-C9bmc1dB.js → reactor_browser-w_W9gLF7.js} +31 -29
- package/dist/assets/state-schemas-ChDaA9MW.js +2 -0
- package/dist/assets/zod-9j67vCAu.js +39 -0
- package/dist/index.html +14 -14
- package/lib/package.copy.json +8 -4
- package/lib/src/components/app-loader.d.ts +0 -4
- package/lib/src/components/app-loader.d.ts.map +1 -1
- package/lib/src/components/app-loader.js +2 -2
- package/lib/src/components/app-loader.js.map +1 -1
- package/lib/src/components/app.d.ts.map +1 -1
- package/lib/src/components/app.js +11 -0
- package/lib/src/components/app.js.map +1 -1
- package/lib/src/components/document-editor-container.d.ts +1 -1
- package/lib/src/components/document-editor-container.d.ts.map +1 -1
- package/lib/src/components/document-editor-container.js +19 -16
- package/lib/src/components/document-editor-container.js.map +1 -1
- package/lib/src/components/drive-editor-container.d.ts.map +1 -1
- package/lib/src/components/drive-editor-container.js +6 -9
- package/lib/src/components/drive-editor-container.js.map +1 -1
- package/lib/src/components/editors.d.ts.map +1 -1
- package/lib/src/components/editors.js +3 -9
- package/lib/src/components/editors.js.map +1 -1
- package/lib/src/components/error-boundary.d.ts +103 -0
- package/lib/src/components/error-boundary.d.ts.map +1 -0
- package/lib/src/components/error-boundary.js +104 -0
- package/lib/src/components/error-boundary.js.map +1 -0
- package/lib/src/components/modal/index.d.ts +0 -1
- package/lib/src/components/modal/index.d.ts.map +1 -1
- package/lib/src/components/modal/index.js +0 -1
- package/lib/src/components/modal/index.js.map +1 -1
- package/lib/src/components/modal/modals/InspectorModal/InspectorModal.d.ts.map +1 -1
- package/lib/src/components/modal/modals/InspectorModal/InspectorModal.js +5 -2
- package/lib/src/components/modal/modals/InspectorModal/InspectorModal.js.map +1 -1
- package/lib/src/components/modal/modals/InspectorModal/useDbExplorer.d.ts +3 -4
- package/lib/src/components/modal/modals/InspectorModal/useDbExplorer.d.ts.map +1 -1
- package/lib/src/components/modal/modals/InspectorModal/useDbExplorer.js +116 -13
- package/lib/src/components/modal/modals/InspectorModal/useDbExplorer.js.map +1 -1
- package/lib/src/components/modal/modals-container.js +2 -2
- package/lib/src/components/modal/modals-container.js.map +1 -1
- package/lib/src/components/sidebar.d.ts.map +1 -1
- package/lib/src/components/sidebar.js +2 -5
- package/lib/src/components/sidebar.js.map +1 -1
- package/lib/src/feature-flags.d.ts.map +1 -1
- package/lib/src/feature-flags.js +12 -8
- package/lib/src/feature-flags.js.map +1 -1
- package/lib/src/pages/content.d.ts.map +1 -1
- package/lib/src/pages/content.js +5 -5
- package/lib/src/pages/content.js.map +1 -1
- package/lib/src/store/reactor.d.ts.map +1 -1
- package/lib/src/store/reactor.js +9 -4
- package/lib/src/store/reactor.js.map +1 -1
- package/lib/src/utils/reactor.d.ts +2 -2
- package/lib/src/utils/reactor.d.ts.map +1 -1
- package/lib/src/utils/reactor.js +5 -3
- package/lib/src/utils/reactor.js.map +1 -1
- package/lib/style.css +12453 -0
- package/lib/test/utils/signer.test.js +22 -11
- package/lib/test/utils/signer.test.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.copy.json +8 -4
- package/package.json +17 -13
- package/src/index.css +1 -0
- package/dist/assets/AddDriveModal-NSVF-Mdc.js +0 -1
- package/dist/assets/ClearStorageModal-DD_JYsOg.js +0 -1
- package/dist/assets/CookiesPolicyModal--DN3PA4H.js +0 -1
- package/dist/assets/CreateDocumentModal-DvZ8e-Lk.js +0 -1
- package/dist/assets/DebugSettingsModal-CZWJH2s9.js +0 -1
- package/dist/assets/DeleteDriveModal-C0WqLyV9.js +0 -1
- package/dist/assets/DeleteItemModal-xzaro45o.js +0 -1
- package/dist/assets/DisclaimerModal-BBwmK3NU.js +0 -1
- package/dist/assets/DriveSettingsModal-IncRChmg.js +0 -1
- package/dist/assets/ExportDocumentWithErrorsModal-Co3Mgkql.js +0 -1
- package/dist/assets/SettingsModal-DG-7Po7Z.js +0 -1
- package/dist/assets/UpgradeDriveModal-C7ZsOHp2.js +0 -1
- package/dist/assets/design_system_connect-BWyThEO1.js +0 -45
- package/dist/assets/design_system_ui-lw84_Ll6.js +0 -1
- package/dist/assets/document_drive-BuVpBb4l.js +0 -316
- package/dist/assets/document_model-DB4SzBSe.js +0 -230
- package/dist/assets/document_model_editor-Bvy5ZEHe.js +0 -23
- package/dist/assets/index-BilHslhO.css +0 -1
- package/dist/assets/index-CzN3WTTB.js +0 -20
- package/dist/assets/index-DhjId3Dc.js +0 -25
- package/dist/assets/nodefs-DuVlDR-q.js +0 -1
- package/dist/assets/state-schemas-D3n-7j6n.js +0 -2
- package/dist/assets/zod-BpTyxkjy.js +0 -20
- package/lib/src/components/modal/modals-error-boundary.d.ts +0 -18
- package/lib/src/components/modal/modals-error-boundary.d.ts.map +0 -1
- package/lib/src/components/modal/modals-error-boundary.js +0 -22
- package/lib/src/components/modal/modals-error-boundary.js.map +0 -1
- package/lib/src/utils/signer.d.ts +0 -18
- package/lib/src/utils/signer.d.ts.map +0 -1
- package/lib/src/utils/signer.js +0 -215
- package/lib/src/utils/signer.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
`,f=i.split(/\r\n|[\n\r]/g),p=f[s];if(p.length>120){const T=Math.floor(u/80),_=u%80,I=[];for(let w=0;w<p.length;w+=80)I.push(p.slice(w,w+80));return l+
|
|
3
|
-
`)}function
|
|
1
|
+
const ho=Object.freeze({major:16,minor:12,patch:0,preReleaseTag:null});function A(e,t){if(!!!e)throw new Error(t)}function Te(e){return typeof e=="object"&&e!==null}function Y(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}const Di=/\r\n|[\n\r]/g;function yt(e,t){let n=0,i=1;for(const s of e.body.matchAll(Di)){if(typeof s.index=="number"||Y(!1),s.index>=t)break;n=s.index+s[0].length,i+=1}return{line:i,column:t+1-n}}function Ai(e){return On(e.source,yt(e.source,e.start))}function On(e,t){const n=e.locationOffset.column-1,i="".padStart(n)+e.body,s=t.line-1,r=e.locationOffset.line-1,o=t.line+r,a=t.line===1?n:0,u=t.column+a,l=`${e.name}:${o}:${u}
|
|
2
|
+
`,f=i.split(/\r\n|[\n\r]/g),p=f[s];if(p.length>120){const T=Math.floor(u/80),_=u%80,I=[];for(let w=0;w<p.length;w+=80)I.push(p.slice(w,w+80));return l+tn([[`${o} |`,I[0]],...I.slice(1,T+1).map(w=>["|",w]),["|","^".padStart(_)],["|",I[T+1]]])}return l+tn([[`${o-1} |`,f[s-1]],[`${o} |`,p],["|","^".padStart(u)],[`${o+1} |`,f[s+1]]])}function tn(e){const t=e.filter(([i,s])=>s!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,s])=>i.padStart(n)+(s?" "+s:"")).join(`
|
|
3
|
+
`)}function wi(e){const t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}class m extends Error{constructor(t,...n){var i,s,r;const{nodes:o,source:a,positions:u,path:l,originalError:f,extensions:p}=wi(n);super(t),this.name="GraphQLError",this.path=l??void 0,this.originalError=f??void 0,this.nodes=nn(Array.isArray(o)?o:o?[o]:void 0);const T=nn((i=this.nodes)===null||i===void 0?void 0:i.map(I=>I.loc).filter(I=>I!=null));this.source=a??(T==null||(s=T[0])===null||s===void 0?void 0:s.source),this.positions=u??T?.map(I=>I.start),this.locations=u&&a?u.map(I=>yt(a,I)):T?.map(I=>yt(I.source,I.start));const _=Te(f?.extensions)?f?.extensions:void 0;this.extensions=(r=p??_)!==null&&r!==void 0?r:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),f!=null&&f.stack?Object.defineProperty(this,"stack",{value:f.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,m):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(t+=`
|
|
4
4
|
|
|
5
|
-
`+
|
|
5
|
+
`+Ai(n.loc));else if(this.source&&this.locations)for(const n of this.locations)t+=`
|
|
6
6
|
|
|
7
|
-
`+
|
|
7
|
+
`+On(this.source,n);return t}toJSON(){const t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}function nn(e){return e===void 0||e.length===0?void 0:e}function j(e,t,n){return new m(`Syntax Error: ${n}`,{source:e,positions:[t]})}class Ri{constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class _n{constructor(t,n,i,s,r,o){this.kind=t,this.start=n,this.end=i,this.line=s,this.column=r,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const bn={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},ki=new Set(Object.keys(bn));function Et(e){const t=e?.kind;return typeof t=="string"&&ki.has(t)}var J;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(J||(J={}));var O;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(O||(O={}));var c;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",e.TYPE_COORDINATE="TypeCoordinate",e.MEMBER_COORDINATE="MemberCoordinate",e.ARGUMENT_COORDINATE="ArgumentCoordinate",e.DIRECTIVE_COORDINATE="DirectiveCoordinate",e.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate"})(c||(c={}));function Nt(e){return e===9||e===32}function je(e){return e>=48&&e<=57}function Sn(e){return e>=97&&e<=122||e>=65&&e<=90}function kt(e){return Sn(e)||e===95}function Dn(e){return Sn(e)||je(e)||e===95}function Li(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,s=-1;for(let o=0;o<e.length;++o){var r;const a=e[o],u=xi(a);u!==a.length&&(i=(r=i)!==null&&r!==void 0?r:o,s=o,o!==0&&u<n&&(n=u))}return e.map((o,a)=>a===0?o:o.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,s+1)}function xi(e){let t=0;for(;t<e.length&&Nt(e.charCodeAt(t));)++t;return t}function Fi(e){if(e==="")return!0;let t=!0,n=!1,i=!0,s=!1;for(let r=0;r<e.length;++r)switch(e.codePointAt(r)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(t&&!s)return!1;s=!0,t=!0,n=!1;break;case 9:case 32:n||(n=t);break;default:i&&(i=n),t=!1}return!(t||i&&s)}function Ci(e,t){const n=e.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),s=i.length===1,r=i.length>1&&i.slice(1).every(_=>_.length===0||Nt(_.charCodeAt(0))),o=n.endsWith('\\"""'),a=e.endsWith('"')&&!o,u=e.endsWith("\\"),l=a||u,f=!s||e.length>70||l||r||o;let p="";const T=s&&Nt(e.charCodeAt(0));return(f&&!T||r)&&(p+=`
|
|
8
8
|
`),p+=n,(f||l)&&(p+=`
|
|
9
|
-
`),'"""'+p+'"""'}var h;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.DOT=".",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(h||(h={}));class
|
|
10
|
-
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw j(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function
|
|
11
|
-
`));return e.line+=u.length-1,e.lineStart=s,f}if(l===92&&n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34&&n.charCodeAt(r+3)===34){a+=n.slice(o,r),o=r+1,r+=4;continue}if(l===10||l===13){a+=n.slice(o,r),u.push(a),l===13&&n.charCodeAt(r+1)===10?r+=2:++r,a="",o=r,s=r;continue}if(
|
|
9
|
+
`),'"""'+p+'"""'}var h;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.DOT=".",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(h||(h={}));class $i{constructor(t){const n=new _n(h.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==h.EOF)do if(t.next)t=t.next;else{const n=Mi(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===h.COMMENT);return t}}function Ui(e){return e===h.BANG||e===h.DOLLAR||e===h.AMP||e===h.PAREN_L||e===h.PAREN_R||e===h.DOT||e===h.SPREAD||e===h.COLON||e===h.EQUALS||e===h.AT||e===h.BRACKET_L||e===h.BRACKET_R||e===h.BRACE_L||e===h.PIPE||e===h.BRACE_R}function Le(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function ot(e,t){return An(e.charCodeAt(t))&&wn(e.charCodeAt(t+1))}function An(e){return e>=55296&&e<=56319}function wn(e){return e>=56320&&e<=57343}function Oe(e,t){const n=e.source.body.codePointAt(t);if(n===void 0)return h.EOF;if(n>=32&&n<=126){const i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function M(e,t,n,i,s){const r=e.line,o=1+n-e.lineStart;return new _n(t,n,i,r,o,s)}function Mi(e,t){const n=e.source.body,i=n.length;let s=t;for(;s<i;){const r=n.charCodeAt(s);switch(r){case 65279:case 9:case 32:case 44:++s;continue;case 10:++s,++e.line,e.lineStart=s;continue;case 13:n.charCodeAt(s+1)===10?s+=2:++s,++e.line,e.lineStart=s;continue;case 35:return Vi(e,s);case 33:return M(e,h.BANG,s,s+1);case 36:return M(e,h.DOLLAR,s,s+1);case 38:return M(e,h.AMP,s,s+1);case 40:return M(e,h.PAREN_L,s,s+1);case 41:return M(e,h.PAREN_R,s,s+1);case 46:if(n.charCodeAt(s+1)===46&&n.charCodeAt(s+2)===46)return M(e,h.SPREAD,s,s+3);break;case 58:return M(e,h.COLON,s,s+1);case 61:return M(e,h.EQUALS,s,s+1);case 64:return M(e,h.AT,s,s+1);case 91:return M(e,h.BRACKET_L,s,s+1);case 93:return M(e,h.BRACKET_R,s,s+1);case 123:return M(e,h.BRACE_L,s,s+1);case 124:return M(e,h.PIPE,s,s+1);case 125:return M(e,h.BRACE_R,s,s+1);case 34:return n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34?Qi(e,s):Pi(e,s)}if(je(r)||r===45)return ji(e,s,r);if(kt(r))return Ji(e,s);throw j(e.source,s,r===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Le(r)||ot(n,s)?`Unexpected character: ${Oe(e,s)}.`:`Invalid character: ${Oe(e,s)}.`)}return M(e,h.EOF,i,i)}function Vi(e,t){const n=e.source.body,i=n.length;let s=t+1;for(;s<i;){const r=n.charCodeAt(s);if(r===10||r===13)break;if(Le(r))++s;else if(ot(n,s))s+=2;else break}return M(e,h.COMMENT,t,s,n.slice(t+1,s))}function ji(e,t,n){const i=e.source.body;let s=t,r=n,o=!1;if(r===45&&(r=i.charCodeAt(++s)),r===48){if(r=i.charCodeAt(++s),je(r))throw j(e.source,s,`Invalid number, unexpected digit after 0: ${Oe(e,s)}.`)}else s=pt(e,s,r),r=i.charCodeAt(s);if(r===46&&(o=!0,r=i.charCodeAt(++s),s=pt(e,s,r),r=i.charCodeAt(s)),(r===69||r===101)&&(o=!0,r=i.charCodeAt(++s),(r===43||r===45)&&(r=i.charCodeAt(++s)),s=pt(e,s,r),r=i.charCodeAt(s)),r===46||kt(r))throw j(e.source,s,`Invalid number, expected digit but got: ${Oe(e,s)}.`);return M(e,o?h.FLOAT:h.INT,t,s,i.slice(t,s))}function pt(e,t,n){if(!je(n))throw j(e.source,t,`Invalid number, expected digit but got: ${Oe(e,t)}.`);const i=e.source.body;let s=t+1;for(;je(i.charCodeAt(s));)++s;return s}function Pi(e,t){const n=e.source.body,i=n.length;let s=t+1,r=s,o="";for(;s<i;){const a=n.charCodeAt(s);if(a===34)return o+=n.slice(r,s),M(e,h.STRING,t,s+1,o);if(a===92){o+=n.slice(r,s);const u=n.charCodeAt(s+1)===117?n.charCodeAt(s+2)===123?Bi(e,s):Gi(e,s):Yi(e,s);o+=u.value,s+=u.size,r=s;continue}if(a===10||a===13)break;if(Le(a))++s;else if(ot(n,s))s+=2;else throw j(e.source,s,`Invalid character within String: ${Oe(e,s)}.`)}throw j(e.source,s,"Unterminated string.")}function Bi(e,t){const n=e.source.body;let i=0,s=3;for(;s<12;){const r=n.charCodeAt(t+s++);if(r===125){if(s<5||!Le(i))break;return{value:String.fromCodePoint(i),size:s}}if(i=i<<4|Ce(r),i<0)break}throw j(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+s)}".`)}function Gi(e,t){const n=e.source.body,i=sn(n,t+2);if(Le(i))return{value:String.fromCodePoint(i),size:6};if(An(i)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){const s=sn(n,t+8);if(wn(s))return{value:String.fromCodePoint(i,s),size:12}}throw j(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function sn(e,t){return Ce(e.charCodeAt(t))<<12|Ce(e.charCodeAt(t+1))<<8|Ce(e.charCodeAt(t+2))<<4|Ce(e.charCodeAt(t+3))}function Ce(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Yi(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
|
|
10
|
+
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw j(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Qi(e,t){const n=e.source.body,i=n.length;let s=e.lineStart,r=t+3,o=r,a="";const u=[];for(;r<i;){const l=n.charCodeAt(r);if(l===34&&n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34){a+=n.slice(o,r),u.push(a);const f=M(e,h.BLOCK_STRING,t,r+3,Li(u).join(`
|
|
11
|
+
`));return e.line+=u.length-1,e.lineStart=s,f}if(l===92&&n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34&&n.charCodeAt(r+3)===34){a+=n.slice(o,r),o=r+1,r+=4;continue}if(l===10||l===13){a+=n.slice(o,r),u.push(a),l===13&&n.charCodeAt(r+1)===10?r+=2:++r,a="",o=r,s=r;continue}if(Le(l))++r;else if(ot(n,r))r+=2;else throw j(e.source,r,`Invalid character within String: ${Oe(e,r)}.`)}throw j(e.source,r,"Unterminated string.")}function Ji(e,t){const n=e.source.body,i=n.length;let s=t+1;for(;s<i;){const r=n.charCodeAt(s);if(Dn(r))++s;else break}return M(e,h.NAME,t,s,n.slice(t,s))}const qi=10,Rn=2;function v(e){return at(e,[])}function at(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return Xi(e,t);default:return String(e)}}function Xi(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(zi(e)){const i=e.toJSON();if(i!==e)return typeof i=="string"?i:at(i,n)}else if(Array.isArray(e))return Wi(e,n);return Hi(e,n)}function zi(e){return typeof e.toJSON=="function"}function Hi(e,t){const n=Object.entries(e);return n.length===0?"{}":t.length>Rn?"["+Zi(e)+"]":"{ "+n.map(([s,r])=>s+": "+at(r,t)).join(", ")+" }"}function Wi(e,t){if(e.length===0)return"[]";if(t.length>Rn)return"[Array]";const n=Math.min(qi,e.length),i=e.length-n,s=[];for(let r=0;r<n;++r)s.push(at(e[r],t));return i===1?s.push("... 1 more item"):i>1&&s.push(`... ${i} more items`),"["+s.join(", ")+"]"}function Zi(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){const n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}const Ki=globalThis.process&&!0,ae=Ki?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var i;const s=n.prototype[Symbol.toStringTag],r=Symbol.toStringTag in t?t[Symbol.toStringTag]:(i=t.constructor)===null||i===void 0?void 0:i.name;if(s===r){const o=v(t);throw new Error(`Cannot use ${s} "${o}" from another module or realm.
|
|
12
12
|
|
|
13
13
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
14
14
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -19,57 +19,57 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
|
19
19
|
Duplicate "graphql" modules cannot be used at the same time since different
|
|
20
20
|
versions may have different capabilities and behavior. The data from one
|
|
21
21
|
version used in the function from another could produce confusing and
|
|
22
|
-
spurious results.`)}}return!1};class An{constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||D(!1,`Body must be a string. Received: ${E(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||D(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||D(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function Xi(e){return oe(e,An)}function zi(e,t){const n=new Hi(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}class Hi{constructor(t,n={}){const{lexer:i,...s}=n;if(i)this._lexer=i;else{const r=Xi(t)?t:new An(t);this._lexer=new Ri(r)}this._options=s,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const t=this.expectToken(h.NAME);return this.node(t,{kind:c.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:c.DOCUMENT,definitions:this.many(h.SOF,this.parseDefinition,h.EOF)})}parseDefinition(){if(this.peek(h.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(t&&n.kind===h.BRACE_L)throw j(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(n.kind===h.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()}switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(t)throw j(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");switch(n.value){case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(h.BRACE_L))return this.node(t,{kind:c.OPERATION_DEFINITION,operation:Q.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseDescription(),i=this.parseOperationType();let s;return this.peek(h.NAME)&&(s=this.parseName()),this.node(t,{kind:c.OPERATION_DEFINITION,operation:i,description:n,name:s,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(h.NAME);switch(t.value){case"query":return Q.QUERY;case"mutation":return Q.MUTATION;case"subscription":return Q.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(h.PAREN_L,this.parseVariableDefinition,h.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:c.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(h.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(h.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(h.DOLLAR),this.node(t,{kind:c.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:c.SELECTION_SET,selections:this.many(h.BRACE_L,this.parseSelection,h.BRACE_R)})}parseSelection(){return this.peek(h.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,n=this.parseName();let i,s;return this.expectOptionalToken(h.COLON)?(i=n,s=this.parseName()):s=n,this.node(t,{kind:c.FIELD,alias:i,name:s,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(h.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){const n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(h.PAREN_L,n,h.PAREN_R)}parseArgument(t=!1){const n=this._lexer.token,i=this.parseName();return this.expectToken(h.COLON),this.node(n,{kind:c.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(h.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(h.NAME)?this.node(t,{kind:c.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:c.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token,n=this.parseDescription();return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:c.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:c.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){const n=this._lexer.token;switch(n.kind){case h.BRACKET_L:return this.parseList(t);case h.BRACE_L:return this.parseObject(t);case h.INT:return this.advanceLexer(),this.node(n,{kind:c.INT,value:n.value});case h.FLOAT:return this.advanceLexer(),this.node(n,{kind:c.FLOAT,value:n.value});case h.STRING:case h.BLOCK_STRING:return this.parseStringLiteral();case h.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:c.BOOLEAN,value:!0});case"false":return this.node(n,{kind:c.BOOLEAN,value:!1});case"null":return this.node(n,{kind:c.NULL});default:return this.node(n,{kind:c.ENUM,value:n.value})}case h.DOLLAR:if(t)if(this.expectToken(h.DOLLAR),this._lexer.token.kind===h.NAME){const i=this._lexer.token.value;throw j(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:c.STRING,value:t.value,block:t.kind===h.BLOCK_STRING})}parseList(t){const n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:c.LIST,values:this.any(h.BRACKET_L,n,h.BRACKET_R)})}parseObject(t){const n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:c.OBJECT,fields:this.any(h.BRACE_L,n,h.BRACE_R)})}parseObjectField(t){const n=this._lexer.token,i=this.parseName();return this.expectToken(h.COLON),this.node(n,{kind:c.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){const n=[];for(;this.peek(h.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const n=this._lexer.token;return this.expectToken(h.AT),this.node(n,{kind:c.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let n;if(this.expectOptionalToken(h.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(h.BRACKET_R),n=this.node(t,{kind:c.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(h.BANG)?this.node(t,{kind:c.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:c.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(h.STRING)||this.peek(h.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),s=this.many(h.BRACE_L,this.parseOperationTypeDefinition,h.BRACE_R);return this.node(t,{kind:c.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:s})}parseOperationTypeDefinition(){const t=this._lexer.token,n=this.parseOperationType();this.expectToken(h.COLON);const i=this.parseNamedType();return this.node(t,{kind:c.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),s=this.parseConstDirectives();return this.node(t,{kind:c.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:s})}parseObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),s=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:c.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:s,directives:r,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(h.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(h.BRACE_L,this.parseFieldDefinition,h.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),s=this.parseArgumentDefs();this.expectToken(h.COLON);const r=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:c.FIELD_DEFINITION,description:n,name:i,arguments:s,type:r,directives:o})}parseArgumentDefs(){return this.optionalMany(h.PAREN_L,this.parseInputValueDef,h.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(h.COLON);const s=this.parseTypeReference();let r;this.expectOptionalToken(h.EQUALS)&&(r=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(t,{kind:c.INPUT_VALUE_DEFINITION,description:n,name:i,type:s,defaultValue:r,directives:o})}parseInterfaceTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),s=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:c.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:s,directives:r,fields:o})}parseUnionTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),s=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(t,{kind:c.UNION_TYPE_DEFINITION,description:n,name:i,directives:s,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(h.EQUALS)?this.delimitedMany(h.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),s=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(t,{kind:c.ENUM_TYPE_DEFINITION,description:n,name:i,directives:s,values:r})}parseEnumValuesDefinition(){return this.optionalMany(h.BRACE_L,this.parseEnumValueDefinition,h.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),s=this.parseConstDirectives();return this.node(t,{kind:c.ENUM_VALUE_DEFINITION,description:n,name:i,directives:s})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw j(this._lexer.source,this._lexer.token.start,`${ze(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const i=this.parseName(),s=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:s,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(h.BRACE_L,this.parseInputValueDef,h.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===h.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.optionalMany(h.BRACE_L,this.parseOperationTypeDefinition,h.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:c.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(t,{kind:c.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(i.length===0&&s.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:s,fields:r})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(i.length===0&&s.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:s,fields:r})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();if(i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:c.UNION_TYPE_EXTENSION,name:n,directives:i,types:s})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();if(i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:c.ENUM_TYPE_EXTENSION,name:n,directives:i,values:s})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();if(i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:s})}parseDirectiveDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(h.AT);const i=this.parseName(),s=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(t,{kind:c.DIRECTIVE_DEFINITION,description:n,name:i,arguments:s,repeatable:r,locations:o})}parseDirectiveLocations(){return this.delimitedMany(h.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(O,n.value))return n;throw this.unexpected(t)}parseSchemaCoordinate(){const t=this._lexer.token,n=this.expectOptionalToken(h.AT),i=this.parseName();let s;!n&&this.expectOptionalToken(h.DOT)&&(s=this.parseName());let r;return(n||s)&&this.expectOptionalToken(h.PAREN_L)&&(r=this.parseName(),this.expectToken(h.COLON),this.expectToken(h.PAREN_R)),n?r?this.node(t,{kind:c.DIRECTIVE_ARGUMENT_COORDINATE,name:i,argumentName:r}):this.node(t,{kind:c.DIRECTIVE_COORDINATE,name:i}):s?r?this.node(t,{kind:c.ARGUMENT_COORDINATE,name:i,fieldName:s,argumentName:r}):this.node(t,{kind:c.MEMBER_COORDINATE,name:i,memberName:s}):this.node(t,{kind:c.TYPE_COORDINATE,name:i})}node(t,n){return this._options.noLocation!==!0&&(n.loc=new _i(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){const n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw j(this._lexer.source,n.start,`Expected ${wn(t)}, found ${ze(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){const n=this._lexer.token;if(n.kind===h.NAME&&n.value===t)this.advanceLexer();else throw j(this._lexer.source,n.start,`Expected "${t}", found ${ze(n)}.`)}expectOptionalKeyword(t){const n=this._lexer.token;return n.kind===h.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){const n=t??this._lexer.token;return j(this._lexer.source,n.start,`Unexpected ${ze(n)}.`)}any(t,n,i){this.expectToken(t);const s=[];for(;!this.expectOptionalToken(i);)s.push(n.call(this));return s}optionalMany(t,n,i){if(this.expectOptionalToken(t)){const s=[];do s.push(n.call(this));while(!this.expectOptionalToken(i));return s}return[]}many(t,n,i){this.expectToken(t);const s=[];do s.push(n.call(this));while(!this.expectOptionalToken(i));return s}delimitedMany(t,n){this.expectOptionalToken(t);const i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){const{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==h.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw j(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function ze(e){const t=e.value;return wn(e.kind)+(t!=null?` "${t}"`:"")}function wn(e){return ki(e)?`"${e}"`:e}const Wi=5;function de(e,t){const[n,i]=t?[e,t]:[void 0,e];let s=" Did you mean ";n&&(s+=n+" ");const r=i.map(u=>`"${u}"`);switch(r.length){case 0:return"";case 1:return s+r[0]+"?";case 2:return s+r[0]+" or "+r[1]+"?"}const o=r.slice(0,Wi),a=o.pop();return s+o.join(", ")+", or "+a+"?"}function nn(e){return e}function ge(e,t){const n=Object.create(null);for(const i of e)n[t(i)]=i;return n}function Rt(e,t,n){const i=Object.create(null);for(const s of e)i[t(s)]=n(s);return i}function ue(e,t){const n=Object.create(null);for(const i of Object.keys(e))n[i]=t(e[i],i);return n}function kt(e,t){let n=0,i=0;for(;n<e.length&&i<t.length;){let s=e.charCodeAt(n),r=t.charCodeAt(i);if(He(s)&&He(r)){let o=0;do++n,o=o*10+s-yt,s=e.charCodeAt(n);while(He(s)&&o>0);let a=0;do++i,a=a*10+r-yt,r=t.charCodeAt(i);while(He(r)&&a>0);if(o<a)return-1;if(o>a)return 1}else{if(s<r)return-1;if(s>r)return 1;++n,++i}}return e.length-t.length}const yt=48,Zi=57;function He(e){return!isNaN(e)&&yt<=e&&e<=Zi}function _e(e,t){const n=Object.create(null),i=new Ki(e),s=Math.floor(e.length*.4)+1;for(const r of t){const o=i.measure(r,s);o!==void 0&&(n[r]=o)}return Object.keys(n).sort((r,o)=>{const a=n[r]-n[o];return a!==0?a:kt(r,o)})}class Ki{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=sn(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,n){if(this._input===t)return 0;const i=t.toLowerCase();if(this._inputLowerCase===i)return 1;let s=sn(i),r=this._inputArray;if(s.length<r.length){const f=s;s=r,r=f}const o=s.length,a=r.length;if(o-a>n)return;const u=this._rows;for(let f=0;f<=a;f++)u[0][f]=f;for(let f=1;f<=o;f++){const p=u[(f-1)%3],T=u[f%3];let _=T[0]=f;for(let I=1;I<=a;I++){const w=s[f-1]===r[I-1]?0:1;let F=Math.min(p[I]+1,T[I-1]+1,p[I-1]+w);if(f>1&&I>1&&s[f-1]===r[I-2]&&s[f-2]===r[I-1]){const B=u[(f-2)%3][I-2];F=Math.min(F,B+1)}F<_&&(_=F),T[I]=F}if(_>n)return}const l=u[o%3][a];return l<=n?l:void 0}}function sn(e){const t=e.length,n=new Array(t);for(let i=0;i<t;++i)n[i]=e.charCodeAt(i);return n}function te(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;const t=Object.create(null);for(const[n,i]of Object.entries(e))t[n]=i;return t}function es(e){return`"${e.replace(ts,ns)}"`}const ts=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function ns(e){return is[e.charCodeAt(0)]}const is=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],Ce=Object.freeze({});function ot(e,t,n=gn){const i=new Map;for(const B of Object.values(c))i.set(B,et(t,B));let s,r=Array.isArray(e),o=[e],a=-1,u=[],l=e,f,p;const T=[],_=[];do{a++;const B=a===o.length,Ee=B&&u.length!==0;if(B){if(f=_.length===0?void 0:T[T.length-1],l=p,p=_.pop(),Ee)if(r){l=l.slice();let z=0;for(const[Le,Ye]of u){const Qe=Le-z;Ye===null?(l.splice(Qe,1),z++):l[Qe]=Ye}}else{l={...l};for(const[z,Le]of u)l[z]=Le}a=s.index,o=s.keys,u=s.edits,r=s.inArray,s=s.prev}else if(p){if(f=r?a:o[a],l=p[f],l==null)continue;T.push(f)}let Y;if(!Array.isArray(l)){var I,w;Et(l)||D(!1,`Invalid AST Node: ${E(l)}.`);const z=B?(I=i.get(l.kind))===null||I===void 0?void 0:I.leave:(w=i.get(l.kind))===null||w===void 0?void 0:w.enter;if(Y=z?.call(t,l,f,p,T,_),Y===Ce)break;if(Y===!1){if(!B){T.pop();continue}}else if(Y!==void 0&&(u.push([f,Y]),!B))if(Et(Y))l=Y;else{T.pop();continue}}if(Y===void 0&&Ee&&u.push([f,l]),B)T.pop();else{var F;s={inArray:r,index:a,keys:o,edits:u,prev:s},r=Array.isArray(l),o=r?l:(F=n[l.kind])!==null&&F!==void 0?F:[],a=-1,u=[],p&&_.push(p),p=l}}while(s!==void 0);return u.length!==0?u[u.length-1][1]:e}function Rn(e){const t=new Array(e.length).fill(null),n=Object.create(null);for(const i of Object.values(c)){let s=!1;const r=new Array(e.length).fill(void 0),o=new Array(e.length).fill(void 0);for(let u=0;u<e.length;++u){const{enter:l,leave:f}=et(e[u],i);s||(s=l!=null||f!=null),r[u]=l,o[u]=f}if(!s)continue;const a={enter(...u){const l=u[0];for(let p=0;p<e.length;p++)if(t[p]===null){var f;const T=(f=r[p])===null||f===void 0?void 0:f.apply(e[p],u);if(T===!1)t[p]=l;else if(T===Ce)t[p]=Ce;else if(T!==void 0)return T}},leave(...u){const l=u[0];for(let p=0;p<e.length;p++)if(t[p]===null){var f;const T=(f=o[p])===null||f===void 0?void 0:f.apply(e[p],u);if(T===Ce)t[p]=Ce;else if(T!==void 0&&T!==!1)return T}else t[p]===l&&(t[p]=null)}};n[i]=a}return n}function et(e,t){const n=e[t];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function C(e){return ot(e,rs)}const ss=80,rs={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>y(e.definitions,`
|
|
22
|
+
spurious results.`)}}return!1};class kn{constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||A(!1,`Body must be a string. Received: ${v(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||A(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||A(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function es(e){return ae(e,kn)}function ts(e,t){const n=new ns(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}class ns{constructor(t,n={}){const{lexer:i,...s}=n;if(i)this._lexer=i;else{const r=es(t)?t:new kn(t);this._lexer=new $i(r)}this._options=s,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const t=this.expectToken(h.NAME);return this.node(t,{kind:c.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:c.DOCUMENT,definitions:this.many(h.SOF,this.parseDefinition,h.EOF)})}parseDefinition(){if(this.peek(h.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(t&&n.kind===h.BRACE_L)throw j(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(n.kind===h.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()}switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(t)throw j(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");switch(n.value){case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(h.BRACE_L))return this.node(t,{kind:c.OPERATION_DEFINITION,operation:J.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseDescription(),i=this.parseOperationType();let s;return this.peek(h.NAME)&&(s=this.parseName()),this.node(t,{kind:c.OPERATION_DEFINITION,operation:i,description:n,name:s,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(h.NAME);switch(t.value){case"query":return J.QUERY;case"mutation":return J.MUTATION;case"subscription":return J.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(h.PAREN_L,this.parseVariableDefinition,h.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:c.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(h.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(h.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(h.DOLLAR),this.node(t,{kind:c.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:c.SELECTION_SET,selections:this.many(h.BRACE_L,this.parseSelection,h.BRACE_R)})}parseSelection(){return this.peek(h.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,n=this.parseName();let i,s;return this.expectOptionalToken(h.COLON)?(i=n,s=this.parseName()):s=n,this.node(t,{kind:c.FIELD,alias:i,name:s,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(h.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){const n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(h.PAREN_L,n,h.PAREN_R)}parseArgument(t=!1){const n=this._lexer.token,i=this.parseName();return this.expectToken(h.COLON),this.node(n,{kind:c.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(h.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(h.NAME)?this.node(t,{kind:c.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:c.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token,n=this.parseDescription();return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:c.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:c.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){const n=this._lexer.token;switch(n.kind){case h.BRACKET_L:return this.parseList(t);case h.BRACE_L:return this.parseObject(t);case h.INT:return this.advanceLexer(),this.node(n,{kind:c.INT,value:n.value});case h.FLOAT:return this.advanceLexer(),this.node(n,{kind:c.FLOAT,value:n.value});case h.STRING:case h.BLOCK_STRING:return this.parseStringLiteral();case h.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:c.BOOLEAN,value:!0});case"false":return this.node(n,{kind:c.BOOLEAN,value:!1});case"null":return this.node(n,{kind:c.NULL});default:return this.node(n,{kind:c.ENUM,value:n.value})}case h.DOLLAR:if(t)if(this.expectToken(h.DOLLAR),this._lexer.token.kind===h.NAME){const i=this._lexer.token.value;throw j(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:c.STRING,value:t.value,block:t.kind===h.BLOCK_STRING})}parseList(t){const n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:c.LIST,values:this.any(h.BRACKET_L,n,h.BRACKET_R)})}parseObject(t){const n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:c.OBJECT,fields:this.any(h.BRACE_L,n,h.BRACE_R)})}parseObjectField(t){const n=this._lexer.token,i=this.parseName();return this.expectToken(h.COLON),this.node(n,{kind:c.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){const n=[];for(;this.peek(h.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const n=this._lexer.token;return this.expectToken(h.AT),this.node(n,{kind:c.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let n;if(this.expectOptionalToken(h.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(h.BRACKET_R),n=this.node(t,{kind:c.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(h.BANG)?this.node(t,{kind:c.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:c.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(h.STRING)||this.peek(h.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),s=this.many(h.BRACE_L,this.parseOperationTypeDefinition,h.BRACE_R);return this.node(t,{kind:c.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:s})}parseOperationTypeDefinition(){const t=this._lexer.token,n=this.parseOperationType();this.expectToken(h.COLON);const i=this.parseNamedType();return this.node(t,{kind:c.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),s=this.parseConstDirectives();return this.node(t,{kind:c.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:s})}parseObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),s=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:c.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:s,directives:r,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(h.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(h.BRACE_L,this.parseFieldDefinition,h.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),s=this.parseArgumentDefs();this.expectToken(h.COLON);const r=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:c.FIELD_DEFINITION,description:n,name:i,arguments:s,type:r,directives:o})}parseArgumentDefs(){return this.optionalMany(h.PAREN_L,this.parseInputValueDef,h.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(h.COLON);const s=this.parseTypeReference();let r;this.expectOptionalToken(h.EQUALS)&&(r=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(t,{kind:c.INPUT_VALUE_DEFINITION,description:n,name:i,type:s,defaultValue:r,directives:o})}parseInterfaceTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),s=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:c.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:s,directives:r,fields:o})}parseUnionTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),s=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(t,{kind:c.UNION_TYPE_DEFINITION,description:n,name:i,directives:s,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(h.EQUALS)?this.delimitedMany(h.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),s=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(t,{kind:c.ENUM_TYPE_DEFINITION,description:n,name:i,directives:s,values:r})}parseEnumValuesDefinition(){return this.optionalMany(h.BRACE_L,this.parseEnumValueDefinition,h.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),s=this.parseConstDirectives();return this.node(t,{kind:c.ENUM_VALUE_DEFINITION,description:n,name:i,directives:s})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw j(this._lexer.source,this._lexer.token.start,`${We(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const i=this.parseName(),s=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:s,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(h.BRACE_L,this.parseInputValueDef,h.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===h.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.optionalMany(h.BRACE_L,this.parseOperationTypeDefinition,h.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:c.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(t,{kind:c.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(i.length===0&&s.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:s,fields:r})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(i.length===0&&s.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:s,fields:r})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();if(i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:c.UNION_TYPE_EXTENSION,name:n,directives:i,types:s})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();if(i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:c.ENUM_TYPE_EXTENSION,name:n,directives:i,values:s})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();if(i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:s})}parseDirectiveDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(h.AT);const i=this.parseName(),s=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(t,{kind:c.DIRECTIVE_DEFINITION,description:n,name:i,arguments:s,repeatable:r,locations:o})}parseDirectiveLocations(){return this.delimitedMany(h.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(O,n.value))return n;throw this.unexpected(t)}parseSchemaCoordinate(){const t=this._lexer.token,n=this.expectOptionalToken(h.AT),i=this.parseName();let s;!n&&this.expectOptionalToken(h.DOT)&&(s=this.parseName());let r;return(n||s)&&this.expectOptionalToken(h.PAREN_L)&&(r=this.parseName(),this.expectToken(h.COLON),this.expectToken(h.PAREN_R)),n?r?this.node(t,{kind:c.DIRECTIVE_ARGUMENT_COORDINATE,name:i,argumentName:r}):this.node(t,{kind:c.DIRECTIVE_COORDINATE,name:i}):s?r?this.node(t,{kind:c.ARGUMENT_COORDINATE,name:i,fieldName:s,argumentName:r}):this.node(t,{kind:c.MEMBER_COORDINATE,name:i,memberName:s}):this.node(t,{kind:c.TYPE_COORDINATE,name:i})}node(t,n){return this._options.noLocation!==!0&&(n.loc=new Ri(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){const n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw j(this._lexer.source,n.start,`Expected ${Ln(t)}, found ${We(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){const n=this._lexer.token;if(n.kind===h.NAME&&n.value===t)this.advanceLexer();else throw j(this._lexer.source,n.start,`Expected "${t}", found ${We(n)}.`)}expectOptionalKeyword(t){const n=this._lexer.token;return n.kind===h.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){const n=t??this._lexer.token;return j(this._lexer.source,n.start,`Unexpected ${We(n)}.`)}any(t,n,i){this.expectToken(t);const s=[];for(;!this.expectOptionalToken(i);)s.push(n.call(this));return s}optionalMany(t,n,i){if(this.expectOptionalToken(t)){const s=[];do s.push(n.call(this));while(!this.expectOptionalToken(i));return s}return[]}many(t,n,i){this.expectToken(t);const s=[];do s.push(n.call(this));while(!this.expectOptionalToken(i));return s}delimitedMany(t,n){this.expectOptionalToken(t);const i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){const{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==h.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw j(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function We(e){const t=e.value;return Ln(e.kind)+(t!=null?` "${t}"`:"")}function Ln(e){return Ui(e)?`"${e}"`:e}const is=5;function fe(e,t){const[n,i]=t?[e,t]:[void 0,e];let s=" Did you mean ";n&&(s+=n+" ");const r=i.map(u=>`"${u}"`);switch(r.length){case 0:return"";case 1:return s+r[0]+"?";case 2:return s+r[0]+" or "+r[1]+"?"}const o=r.slice(0,is),a=o.pop();return s+o.join(", ")+", or "+a+"?"}function rn(e){return e}function _e(e,t){const n=Object.create(null);for(const i of e)n[t(i)]=i;return n}function Lt(e,t,n){const i=Object.create(null);for(const s of e)i[t(s)]=n(s);return i}function le(e,t){const n=Object.create(null);for(const i of Object.keys(e))n[i]=t(e[i],i);return n}function xt(e,t){let n=0,i=0;for(;n<e.length&&i<t.length;){let s=e.charCodeAt(n),r=t.charCodeAt(i);if(Ze(s)&&Ze(r)){let o=0;do++n,o=o*10+s-It,s=e.charCodeAt(n);while(Ze(s)&&o>0);let a=0;do++i,a=a*10+r-It,r=t.charCodeAt(i);while(Ze(r)&&a>0);if(o<a)return-1;if(o>a)return 1}else{if(s<r)return-1;if(s>r)return 1;++n,++i}}return e.length-t.length}const It=48,ss=57;function Ze(e){return!isNaN(e)&&It<=e&&e<=ss}function Ne(e,t){const n=Object.create(null),i=new rs(e),s=Math.floor(e.length*.4)+1;for(const r of t){const o=i.measure(r,s);o!==void 0&&(n[r]=o)}return Object.keys(n).sort((r,o)=>{const a=n[r]-n[o];return a!==0?a:xt(r,o)})}class rs{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=on(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,n){if(this._input===t)return 0;const i=t.toLowerCase();if(this._inputLowerCase===i)return 1;let s=on(i),r=this._inputArray;if(s.length<r.length){const f=s;s=r,r=f}const o=s.length,a=r.length;if(o-a>n)return;const u=this._rows;for(let f=0;f<=a;f++)u[0][f]=f;for(let f=1;f<=o;f++){const p=u[(f-1)%3],T=u[f%3];let _=T[0]=f;for(let I=1;I<=a;I++){const w=s[f-1]===r[I-1]?0:1;let C=Math.min(p[I]+1,T[I-1]+1,p[I-1]+w);if(f>1&&I>1&&s[f-1]===r[I-2]&&s[f-2]===r[I-1]){const G=u[(f-2)%3][I-2];C=Math.min(C,G+1)}C<_&&(_=C),T[I]=C}if(_>n)return}const l=u[o%3][a];return l<=n?l:void 0}}function on(e){const t=e.length,n=new Array(t);for(let i=0;i<t;++i)n[i]=e.charCodeAt(i);return n}function te(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;const t=Object.create(null);for(const[n,i]of Object.entries(e))t[n]=i;return t}function os(e){return`"${e.replace(as,cs)}"`}const as=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function cs(e){return us[e.charCodeAt(0)]}const us=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],$e=Object.freeze({});function ct(e,t,n=bn){const i=new Map;for(const G of Object.values(c))i.set(G,nt(t,G));let s,r=Array.isArray(e),o=[e],a=-1,u=[],l=e,f,p;const T=[],_=[];do{a++;const G=a===o.length,Ie=G&&u.length!==0;if(G){if(f=_.length===0?void 0:T[T.length-1],l=p,p=_.pop(),Ie)if(r){l=l.slice();let z=0;for(const[xe,Je]of u){const qe=xe-z;Je===null?(l.splice(qe,1),z++):l[qe]=Je}}else{l={...l};for(const[z,xe]of u)l[z]=xe}a=s.index,o=s.keys,u=s.edits,r=s.inArray,s=s.prev}else if(p){if(f=r?a:o[a],l=p[f],l==null)continue;T.push(f)}let Q;if(!Array.isArray(l)){var I,w;Et(l)||A(!1,`Invalid AST Node: ${v(l)}.`);const z=G?(I=i.get(l.kind))===null||I===void 0?void 0:I.leave:(w=i.get(l.kind))===null||w===void 0?void 0:w.enter;if(Q=z?.call(t,l,f,p,T,_),Q===$e)break;if(Q===!1){if(!G){T.pop();continue}}else if(Q!==void 0&&(u.push([f,Q]),!G))if(Et(Q))l=Q;else{T.pop();continue}}if(Q===void 0&&Ie&&u.push([f,l]),G)T.pop();else{var C;s={inArray:r,index:a,keys:o,edits:u,prev:s},r=Array.isArray(l),o=r?l:(C=n[l.kind])!==null&&C!==void 0?C:[],a=-1,u=[],p&&_.push(p),p=l}}while(s!==void 0);return u.length!==0?u[u.length-1][1]:e}function xn(e){const t=new Array(e.length).fill(null),n=Object.create(null);for(const i of Object.values(c)){let s=!1;const r=new Array(e.length).fill(void 0),o=new Array(e.length).fill(void 0);for(let u=0;u<e.length;++u){const{enter:l,leave:f}=nt(e[u],i);s||(s=l!=null||f!=null),r[u]=l,o[u]=f}if(!s)continue;const a={enter(...u){const l=u[0];for(let p=0;p<e.length;p++)if(t[p]===null){var f;const T=(f=r[p])===null||f===void 0?void 0:f.apply(e[p],u);if(T===!1)t[p]=l;else if(T===$e)t[p]=$e;else if(T!==void 0)return T}},leave(...u){const l=u[0];for(let p=0;p<e.length;p++)if(t[p]===null){var f;const T=(f=o[p])===null||f===void 0?void 0:f.apply(e[p],u);if(T===$e)t[p]=$e;else if(T!==void 0&&T!==!1)return T}else t[p]===l&&(t[p]=null)}};n[i]=a}return n}function nt(e,t){const n=e[t];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function F(e){return ct(e,fs)}const ls=80,fs={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>E(e.definitions,`
|
|
23
23
|
|
|
24
|
-
`)},OperationDefinition:{leave(e){const t=
|
|
25
|
-
`,
|
|
24
|
+
`)},OperationDefinition:{leave(e){const t=dt(e.variableDefinitions)?b(`(
|
|
25
|
+
`,E(e.variableDefinitions,`
|
|
26
26
|
`),`
|
|
27
|
-
)`):b("(",
|
|
28
|
-
`)+
|
|
29
|
-
`)+e+": "+t+b(" = ",n)+b(" ",
|
|
30
|
-
`,
|
|
27
|
+
)`):b("(",E(e.variableDefinitions,", "),")"),n=b("",e.description,`
|
|
28
|
+
`)+E([e.operation,E([e.name,t]),E(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:i,description:s})=>b("",s,`
|
|
29
|
+
`)+e+": "+t+b(" = ",n)+b(" ",E(i," "))},SelectionSet:{leave:({selections:e})=>ie(e)},Field:{leave({alias:e,name:t,arguments:n,directives:i,selectionSet:s}){const r=b("",e,": ")+t;let o=r+b("(",E(n,", "),")");return o.length>ls&&(o=r+b(`(
|
|
30
|
+
`,tt(E(n,`
|
|
31
31
|
`)),`
|
|
32
|
-
)`)),
|
|
33
|
-
`)+`fragment ${e}${b("(",
|
|
34
|
-
`)+
|
|
35
|
-
`)+
|
|
36
|
-
`)+
|
|
37
|
-
`)+t+(
|
|
38
|
-
`,
|
|
32
|
+
)`)),E([o,E(i," "),s]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+b(" ",E(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>E(["...",b("on ",e),E(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:i,selectionSet:s,description:r})=>b("",r,`
|
|
33
|
+
`)+`fragment ${e}${b("(",E(n,", "),")")} on ${t} ${b("",E(i," ")," ")}`+s},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?Ci(e):os(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+E(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+E(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+b("(",E(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>b("",e,`
|
|
34
|
+
`)+E(["schema",E(t," "),ie(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>b("",e,`
|
|
35
|
+
`)+E(["scalar",t,E(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:s})=>b("",e,`
|
|
36
|
+
`)+E(["type",t,b("implements ",E(n," & ")),E(i," "),ie(s)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:i,directives:s})=>b("",e,`
|
|
37
|
+
`)+t+(dt(n)?b(`(
|
|
38
|
+
`,tt(E(n,`
|
|
39
39
|
`)),`
|
|
40
|
-
)`):b("(",
|
|
41
|
-
`)+
|
|
42
|
-
`)+
|
|
43
|
-
`)+
|
|
44
|
-
`)+
|
|
45
|
-
`)+
|
|
46
|
-
`)+
|
|
47
|
-
`)+"directive @"+t+(
|
|
48
|
-
`,
|
|
40
|
+
)`):b("(",E(n,", "),")"))+": "+i+b(" ",E(s," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:i,directives:s})=>b("",e,`
|
|
41
|
+
`)+E([t+": "+n,b("= ",i),E(s," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:s})=>b("",e,`
|
|
42
|
+
`)+E(["interface",t,b("implements ",E(n," & ")),E(i," "),ie(s)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:i})=>b("",e,`
|
|
43
|
+
`)+E(["union",t,E(n," "),b("= ",E(i," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:i})=>b("",e,`
|
|
44
|
+
`)+E(["enum",t,E(n," "),ie(i)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>b("",e,`
|
|
45
|
+
`)+E([t,E(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:i})=>b("",e,`
|
|
46
|
+
`)+E(["input",t,E(n," "),ie(i)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:i,locations:s})=>b("",e,`
|
|
47
|
+
`)+"directive @"+t+(dt(n)?b(`(
|
|
48
|
+
`,tt(E(n,`
|
|
49
49
|
`)),`
|
|
50
|
-
)`):b("(",
|
|
51
|
-
`,
|
|
50
|
+
)`):b("(",E(n,", "),")"))+(i?" repeatable":"")+" on "+E(s," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>E(["extend schema",E(e," "),ie(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>E(["extend scalar",e,E(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>E(["extend type",e,b("implements ",E(t," & ")),E(n," "),ie(i)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>E(["extend interface",e,b("implements ",E(t," & ")),E(n," "),ie(i)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>E(["extend union",e,E(t," "),b("= ",E(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>E(["extend enum",e,E(t," "),ie(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>E(["extend input",e,E(t," "),ie(n)]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>E([e,b(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>E([e,b(".",t),b("(",n,":)")])},DirectiveCoordinate:{leave:({name:e})=>E(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>E(["@",e,b("(",t,":)")])}};function E(e,t=""){var n;return(n=e?.filter(i=>i).join(t))!==null&&n!==void 0?n:""}function ie(e){return b(`{
|
|
51
|
+
`,tt(E(e,`
|
|
52
52
|
`)),`
|
|
53
|
-
}`)}function b(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function
|
|
54
|
-
`))}function
|
|
55
|
-
`)))!==null&&t!==void 0?t:!1}function Nt(e,t){switch(e.kind){case c.NULL:return null;case c.INT:return parseInt(e.value,10);case c.FLOAT:return parseFloat(e.value);case c.STRING:case c.ENUM:case c.BOOLEAN:return e.value;case c.LIST:return e.values.map(n=>Nt(n,t));case c.OBJECT:return Rt(e.fields,n=>n.name.value,n=>Nt(n.value,t));case c.VARIABLE:return t?.[e.name.value]}}function ae(e){if(e!=null||D(!1,"Must provide name."),typeof e=="string"||D(!1,"Expected name to be a string."),e.length===0)throw new m("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!_n(e.charCodeAt(t)))throw new m(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!wt(e.charCodeAt(0)))throw new m(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}function os(e){if(e==="true"||e==="false"||e==="null")throw new m(`Enum values cannot be named: ${e}`);return ae(e)}function Lt(e){return fe(e)||k(e)||x(e)||Z(e)||X(e)||M(e)||G(e)||A(e)}function fe(e){return oe(e,me)}function k(e){return oe(e,le)}function x(e){return oe(e,It)}function Z(e){return oe(e,gt)}function X(e){return oe(e,Ve)}function M(e){return oe(e,Ot)}function G(e){return oe(e,q)}function A(e){return oe(e,S)}function ce(e){return fe(e)||X(e)||M(e)||xt(e)&&ce(e.ofType)}function $e(e){return fe(e)||k(e)||x(e)||Z(e)||X(e)||xt(e)&&$e(e.ofType)}function Re(e){return fe(e)||X(e)}function he(e){return k(e)||x(e)||Z(e)}function pe(e){return x(e)||Z(e)}function ao(e){if(!pe(e))throw new Error(`Expected ${E(e)} to be a GraphQL abstract type.`);return e}class q{constructor(t){Lt(t)||D(!1,`Expected ${E(t)} to be a GraphQL type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class S{constructor(t){kn(t)||D(!1,`Expected ${E(t)} to be a GraphQL nullable type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function xt(e){return G(e)||A(e)}function kn(e){return Lt(e)&&!A(e)}function Ln(e){if(e)return A(e)?e.ofType:e}function as(e){return fe(e)||k(e)||x(e)||Z(e)||X(e)||M(e)}function H(e){if(e){let t=e;for(;xt(t);)t=t.ofType;return t}}function xn(e){return typeof e=="function"?e():e}function Fn(e){return typeof e=="function"?e():e}class me{constructor(t){var n,i,s,r;const o=(n=t.parseValue)!==null&&n!==void 0?n:nn;this.name=ae(t.name),this.description=t.description,this.specifiedByURL=t.specifiedByURL,this.serialize=(i=t.serialize)!==null&&i!==void 0?i:nn,this.parseValue=o,this.parseLiteral=(s=t.parseLiteral)!==null&&s!==void 0?s:(a,u)=>o(Nt(a,u)),this.extensions=te(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],t.specifiedByURL==null||typeof t.specifiedByURL=="string"||D(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${E(t.specifiedByURL)}.`),t.serialize==null||typeof t.serialize=="function"||D(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||D(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class le{constructor(t){var n;this.name=ae(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=te(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>$n(t),this._interfaces=()=>Cn(t),t.isTypeOf==null||typeof t.isTypeOf=="function"||D(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${E(t.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Mn(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Cn(e){var t;const n=xn((t=e.interfaces)!==null&&t!==void 0?t:[]);return Array.isArray(n)||D(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}function $n(e){const t=Fn(e.fields);return Ae(t)||D(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),ue(t,(n,i)=>{var s;Ae(n)||D(!1,`${e.name}.${i} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||D(!1,`${e.name}.${i} field resolver must be a function if provided, but got: ${E(n.resolve)}.`);const r=(s=n.args)!==null&&s!==void 0?s:{};return Ae(r)||D(!1,`${e.name}.${i} args must be an object with argument names as keys.`),{name:ae(i),description:n.description,type:n.type,args:Un(r),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:te(n.extensions),astNode:n.astNode}})}function Un(e){return Object.entries(e).map(([t,n])=>({name:ae(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:te(n.extensions),astNode:n.astNode}))}function Ae(e){return Ne(e)&&!Array.isArray(e)}function Mn(e){return ue(e,t=>({description:t.description,type:t.type,args:Vn(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function Vn(e){return Rt(e,t=>t.name,t=>({description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function Pe(e){return A(e.type)&&e.defaultValue===void 0}class It{constructor(t){var n;this.name=ae(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=te(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=$n.bind(void 0,t),this._interfaces=Cn.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||D(!1,`${this.name} must provide "resolveType" as a function, but got: ${E(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Mn(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class gt{constructor(t){var n;this.name=ae(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=te(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=cs.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||D(!1,`${this.name} must provide "resolveType" as a function, but got: ${E(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function cs(e){const t=xn(e.types);return Array.isArray(t)||D(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}class Ve{constructor(t){var n;this.name=ae(t.name),this.description=t.description,this.extensions=te(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=typeof t.values=="function"?t.values:rn(this.name,t.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=rn(this.name,this._values())),this._values}getValue(t){return this._nameLookup===null&&(this._nameLookup=ge(this.getValues(),n=>n.name)),this._nameLookup[t]}serialize(t){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(i=>[i.value,i])));const n=this._valueLookup.get(t);if(n===void 0)throw new m(`Enum "${this.name}" cannot represent value: ${E(t)}`);return n.name}parseValue(t){if(typeof t!="string"){const i=E(t);throw new m(`Enum "${this.name}" cannot represent non-string value: ${i}.`+We(this,i))}const n=this.getValue(t);if(n==null)throw new m(`Value "${t}" does not exist in "${this.name}" enum.`+We(this,t));return n.value}parseLiteral(t,n){if(t.kind!==c.ENUM){const s=C(t);throw new m(`Enum "${this.name}" cannot represent non-enum value: ${s}.`+We(this,s),{nodes:t})}const i=this.getValue(t.value);if(i==null){const s=C(t);throw new m(`Value "${s}" does not exist in "${this.name}" enum.`+We(this,s),{nodes:t})}return i.value}toConfig(){const t=Rt(this.getValues(),n=>n.name,n=>({description:n.description,value:n.value,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,values:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function We(e,t){const n=e.getValues().map(s=>s.name),i=_e(t,n);return de("the enum value",i)}function rn(e,t){return Ae(t)||D(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([n,i])=>(Ae(i)||D(!1,`${e}.${n} must refer to an object with a "value" key representing an internal value but got: ${E(i)}.`),{name:os(n),description:i.description,value:i.value!==void 0?i.value:n,deprecationReason:i.deprecationReason,extensions:te(i.extensions),astNode:i.astNode}))}class Ot{constructor(t){var n,i;this.name=ae(t.name),this.description=t.description,this.extensions=te(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this.isOneOf=(i=t.isOneOf)!==null&&i!==void 0?i:!1,this._fields=us.bind(void 0,t)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const t=ue(this.getFields(),n=>({description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,fields:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function us(e){const t=Fn(e.fields);return Ae(t)||D(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),ue(t,(n,i)=>(!("resolve"in n)||D(!1,`${e.name}.${i} field has a resolve property, but Input Types cannot define resolvers.`),{name:ae(i),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:te(n.extensions),astNode:n.astNode}))}function jn(e){return A(e.type)&&e.defaultValue===void 0}function _t(e,t){return e===t?!0:A(e)&&A(t)||G(e)&&G(t)?_t(e.ofType,t.ofType):!1}function we(e,t,n){return t===n?!0:A(n)?A(t)?we(e,t.ofType,n.ofType):!1:A(t)?we(e,t.ofType,n):G(n)?G(t)?we(e,t.ofType,n.ofType):!1:G(t)?!1:pe(n)&&(x(t)||k(t))&&e.isSubType(n,t)}function on(e,t,n){return t===n?!0:pe(t)?pe(n)?e.getPossibleTypes(t).some(i=>e.isSubType(n,i)):e.isSubType(t,n):pe(n)?e.isSubType(n,t):!1}const pt=2147483647,dt=-2147483648,ls=new me({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){const t=Be(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isInteger(n))throw new m(`Int cannot represent non-integer value: ${E(t)}`);if(n>pt||n<dt)throw new m("Int cannot represent non 32-bit signed integer value: "+E(t));return n},parseValue(e){if(typeof e!="number"||!Number.isInteger(e))throw new m(`Int cannot represent non-integer value: ${E(e)}`);if(e>pt||e<dt)throw new m(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==c.INT)throw new m(`Int cannot represent non-integer value: ${C(e)}`,{nodes:e});const t=parseInt(e.value,10);if(t>pt||t<dt)throw new m(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),fs=new me({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(e){const t=Be(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isFinite(n))throw new m(`Float cannot represent non numeric value: ${E(t)}`);return n},parseValue(e){if(typeof e!="number"||!Number.isFinite(e))throw new m(`Float cannot represent non numeric value: ${E(e)}`);return e},parseLiteral(e){if(e.kind!==c.FLOAT&&e.kind!==c.INT)throw new m(`Float cannot represent non numeric value: ${C(e)}`,e);return parseFloat(e.value)}}),$=new me({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(e){const t=Be(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number"&&Number.isFinite(t))return t.toString();throw new m(`String cannot represent value: ${E(e)}`)},parseValue(e){if(typeof e!="string")throw new m(`String cannot represent a non string value: ${E(e)}`);return e},parseLiteral(e){if(e.kind!==c.STRING)throw new m(`String cannot represent a non string value: ${C(e)}`,{nodes:e});return e.value}}),W=new me({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){const t=Be(e);if(typeof t=="boolean")return t;if(Number.isFinite(t))return t!==0;throw new m(`Boolean cannot represent a non boolean value: ${E(t)}`)},parseValue(e){if(typeof e!="boolean")throw new m(`Boolean cannot represent a non boolean value: ${E(e)}`);return e},parseLiteral(e){if(e.kind!==c.BOOLEAN)throw new m(`Boolean cannot represent a non boolean value: ${C(e)}`,{nodes:e});return e.value}}),Pn=new me({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(e){const t=Be(e);if(typeof t=="string")return t;if(Number.isInteger(t))return String(t);throw new m(`ID cannot represent value: ${E(e)}`)},parseValue(e){if(typeof e=="string")return e;if(typeof e=="number"&&Number.isInteger(e))return e.toString();throw new m(`ID cannot represent value: ${E(e)}`)},parseLiteral(e){if(e.kind!==c.STRING&&e.kind!==c.INT)throw new m("ID cannot represent a non-string and non-integer value: "+C(e),{nodes:e});return e.value}}),Ft=Object.freeze([$,ls,fs,W,Pn]);function Bn(e){return Ft.some(({name:t})=>e.name===t)}function Be(e){if(Ne(e)){if(typeof e.valueOf=="function"){const t=e.valueOf();if(!Ne(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}function Gn(e){return oe(e,Te)}class Te{constructor(t){var n,i;this.name=ae(t.name),this.description=t.description,this.locations=t.locations,this.isRepeatable=(n=t.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=te(t.extensions),this.astNode=t.astNode,Array.isArray(t.locations)||D(!1,`@${t.name} locations must be an Array.`);const s=(i=t.args)!==null&&i!==void 0?i:{};Ne(s)&&!Array.isArray(s)||D(!1,`@${t.name} args must be an object with argument names as keys.`),this.args=Un(s)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Vn(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const Yn=new Te({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[O.FIELD,O.FRAGMENT_SPREAD,O.INLINE_FRAGMENT],args:{if:{type:new S(W),description:"Included when true."}}}),Qn=new Te({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[O.FIELD,O.FRAGMENT_SPREAD,O.INLINE_FRAGMENT],args:{if:{type:new S(W),description:"Skipped when true."}}}),Jn="No longer supported",Ct=new Te({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[O.FIELD_DEFINITION,O.ARGUMENT_DEFINITION,O.INPUT_FIELD_DEFINITION,O.ENUM_VALUE],args:{reason:{type:$,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:Jn}}}),qn=new Te({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[O.SCALAR],args:{url:{type:new S($),description:"The URL that specifies the behavior of this scalar."}}}),Xn=new Te({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[O.INPUT_OBJECT],args:{}}),be=Object.freeze([Yn,Qn,Ct,qn,Xn]);function ps(e){return be.some(({name:t})=>t===e.name)}function ds(e){return typeof e=="object"&&typeof e?.[Symbol.iterator]=="function"}function De(e,t){if(A(t)){const n=De(e,t.ofType);return n?.kind===c.NULL?null:n}if(e===null)return{kind:c.NULL};if(e===void 0)return null;if(G(t)){const n=t.ofType;if(ds(e)){const i=[];for(const s of e){const r=De(s,n);r!=null&&i.push(r)}return{kind:c.LIST,values:i}}return De(e,n)}if(M(t)){if(!Ne(e))return null;const n=[];for(const i of Object.values(t.getFields())){const s=De(e[i.name],i.type);s&&n.push({kind:c.OBJECT_FIELD,name:{kind:c.NAME,value:i.name},value:s})}return{kind:c.OBJECT,fields:n}}if(Re(t)){const n=t.serialize(e);if(n==null)return null;if(typeof n=="boolean")return{kind:c.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){const i=String(n);return an.test(i)?{kind:c.INT,value:i}:{kind:c.FLOAT,value:i}}if(typeof n=="string")return X(t)?{kind:c.ENUM,value:n}:t===Pn&&an.test(n)?{kind:c.INT,value:n}:{kind:c.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${E(n)}.`)}J(!1,"Unexpected input type: "+E(t))}const an=/^-?(?:0|[1-9][0-9]*)$/,$t=new le({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:$,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new S(new q(new S(re))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new S(re),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:re,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:re,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new S(new q(new S(zn))),resolve:e=>e.getDirectives()}})}),zn=new le({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
53
|
+
}`)}function b(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function tt(e){return b(" ",e.replace(/\n/g,`
|
|
54
|
+
`))}function dt(e){var t;return(t=e?.some(n=>n.includes(`
|
|
55
|
+
`)))!==null&&t!==void 0?t:!1}function gt(e,t){switch(e.kind){case c.NULL:return null;case c.INT:return parseInt(e.value,10);case c.FLOAT:return parseFloat(e.value);case c.STRING:case c.ENUM:case c.BOOLEAN:return e.value;case c.LIST:return e.values.map(n=>gt(n,t));case c.OBJECT:return Lt(e.fields,n=>n.name.value,n=>gt(n.value,t));case c.VARIABLE:return t?.[e.name.value]}}function ce(e){if(e!=null||A(!1,"Must provide name."),typeof e=="string"||A(!1,"Expected name to be a string."),e.length===0)throw new m("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!Dn(e.charCodeAt(t)))throw new m(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!kt(e.charCodeAt(0)))throw new m(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}function ps(e){if(e==="true"||e==="false"||e==="null")throw new m(`Enum values cannot be named: ${e}`);return ce(e)}function Ft(e){return de(e)||k(e)||x(e)||Z(e)||X(e)||U(e)||B(e)||D(e)}function de(e){return ae(e,ye)}function k(e){return ae(e,pe)}function x(e){return ae(e,Ot)}function Z(e){return ae(e,_t)}function X(e){return ae(e,Pe)}function U(e){return ae(e,bt)}function B(e){return ae(e,q)}function D(e){return ae(e,S)}function re(e){return de(e)||X(e)||U(e)||Ct(e)&&re(e.ofType)}function Me(e){return de(e)||k(e)||x(e)||Z(e)||X(e)||Ct(e)&&Me(e.ofType)}function be(e){return de(e)||X(e)}function ve(e){return k(e)||x(e)||Z(e)}function me(e){return x(e)||Z(e)}function mo(e){if(!me(e))throw new Error(`Expected ${v(e)} to be a GraphQL abstract type.`);return e}class q{constructor(t){Ft(t)||A(!1,`Expected ${v(t)} to be a GraphQL type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class S{constructor(t){Fn(t)||A(!1,`Expected ${v(t)} to be a GraphQL nullable type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function Ct(e){return B(e)||D(e)}function Fn(e){return Ft(e)&&!D(e)}function Cn(e){if(e)return D(e)?e.ofType:e}function ds(e){return de(e)||k(e)||x(e)||Z(e)||X(e)||U(e)}function H(e){if(e){let t=e;for(;Ct(t);)t=t.ofType;return t}}function $n(e){return typeof e=="function"?e():e}function Un(e){return typeof e=="function"?e():e}class ye{constructor(t){var n,i,s,r;const o=(n=t.parseValue)!==null&&n!==void 0?n:rn;this.name=ce(t.name),this.description=t.description,this.specifiedByURL=t.specifiedByURL,this.serialize=(i=t.serialize)!==null&&i!==void 0?i:rn,this.parseValue=o,this.parseLiteral=(s=t.parseLiteral)!==null&&s!==void 0?s:(a,u)=>o(gt(a,u)),this.extensions=te(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],t.specifiedByURL==null||typeof t.specifiedByURL=="string"||A(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${v(t.specifiedByURL)}.`),t.serialize==null||typeof t.serialize=="function"||A(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||A(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class pe{constructor(t){var n;this.name=ce(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=te(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>Vn(t),this._interfaces=()=>Mn(t),t.isTypeOf==null||typeof t.isTypeOf=="function"||A(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${v(t.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Pn(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Mn(e){var t;const n=$n((t=e.interfaces)!==null&&t!==void 0?t:[]);return Array.isArray(n)||A(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}function Vn(e){const t=Un(e.fields);return Re(t)||A(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),le(t,(n,i)=>{var s;Re(n)||A(!1,`${e.name}.${i} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||A(!1,`${e.name}.${i} field resolver must be a function if provided, but got: ${v(n.resolve)}.`);const r=(s=n.args)!==null&&s!==void 0?s:{};return Re(r)||A(!1,`${e.name}.${i} args must be an object with argument names as keys.`),{name:ce(i),description:n.description,type:n.type,args:jn(r),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:te(n.extensions),astNode:n.astNode}})}function jn(e){return Object.entries(e).map(([t,n])=>({name:ce(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:te(n.extensions),astNode:n.astNode}))}function Re(e){return Te(e)&&!Array.isArray(e)}function Pn(e){return le(e,t=>({description:t.description,type:t.type,args:Bn(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function Bn(e){return Lt(e,t=>t.name,t=>({description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function Ge(e){return D(e.type)&&e.defaultValue===void 0}class Ot{constructor(t){var n;this.name=ce(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=te(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=Vn.bind(void 0,t),this._interfaces=Mn.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||A(!1,`${this.name} must provide "resolveType" as a function, but got: ${v(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Pn(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class _t{constructor(t){var n;this.name=ce(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=te(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=hs.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||A(!1,`${this.name} must provide "resolveType" as a function, but got: ${v(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function hs(e){const t=$n(e.types);return Array.isArray(t)||A(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}class Pe{constructor(t){var n;this.name=ce(t.name),this.description=t.description,this.extensions=te(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=typeof t.values=="function"?t.values:an(this.name,t.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=an(this.name,this._values())),this._values}getValue(t){return this._nameLookup===null&&(this._nameLookup=_e(this.getValues(),n=>n.name)),this._nameLookup[t]}serialize(t){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(i=>[i.value,i])));const n=this._valueLookup.get(t);if(n===void 0)throw new m(`Enum "${this.name}" cannot represent value: ${v(t)}`);return n.name}parseValue(t){if(typeof t!="string"){const i=v(t);throw new m(`Enum "${this.name}" cannot represent non-string value: ${i}.`+Ke(this,i))}const n=this.getValue(t);if(n==null)throw new m(`Value "${t}" does not exist in "${this.name}" enum.`+Ke(this,t));return n.value}parseLiteral(t,n){if(t.kind!==c.ENUM){const s=F(t);throw new m(`Enum "${this.name}" cannot represent non-enum value: ${s}.`+Ke(this,s),{nodes:t})}const i=this.getValue(t.value);if(i==null){const s=F(t);throw new m(`Value "${s}" does not exist in "${this.name}" enum.`+Ke(this,s),{nodes:t})}return i.value}toConfig(){const t=Lt(this.getValues(),n=>n.name,n=>({description:n.description,value:n.value,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,values:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Ke(e,t){const n=e.getValues().map(s=>s.name),i=Ne(t,n);return fe("the enum value",i)}function an(e,t){return Re(t)||A(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([n,i])=>(Re(i)||A(!1,`${e}.${n} must refer to an object with a "value" key representing an internal value but got: ${v(i)}.`),{name:ps(n),description:i.description,value:i.value!==void 0?i.value:n,deprecationReason:i.deprecationReason,extensions:te(i.extensions),astNode:i.astNode}))}class bt{constructor(t){var n,i;this.name=ce(t.name),this.description=t.description,this.extensions=te(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this.isOneOf=(i=t.isOneOf)!==null&&i!==void 0?i:!1,this._fields=ms.bind(void 0,t)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const t=le(this.getFields(),n=>({description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,fields:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function ms(e){const t=Un(e.fields);return Re(t)||A(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),le(t,(n,i)=>(!("resolve"in n)||A(!1,`${e.name}.${i} field has a resolve property, but Input Types cannot define resolvers.`),{name:ce(i),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:te(n.extensions),astNode:n.astNode}))}function Gn(e){return D(e.type)&&e.defaultValue===void 0}function St(e,t){return e===t?!0:D(e)&&D(t)||B(e)&&B(t)?St(e.ofType,t.ofType):!1}function ke(e,t,n){return t===n?!0:D(n)?D(t)?ke(e,t.ofType,n.ofType):!1:D(t)?ke(e,t.ofType,n):B(n)?B(t)?ke(e,t.ofType,n.ofType):!1:B(t)?!1:me(n)&&(x(t)||k(t))&&e.isSubType(n,t)}function cn(e,t,n){return t===n?!0:me(t)?me(n)?e.getPossibleTypes(t).some(i=>e.isSubType(n,i)):e.isSubType(t,n):me(n)?e.isSubType(n,t):!1}const ht=2147483647,mt=-2147483648,Ts=new ye({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){const t=Ye(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isInteger(n))throw new m(`Int cannot represent non-integer value: ${v(t)}`);if(n>ht||n<mt)throw new m("Int cannot represent non 32-bit signed integer value: "+v(t));return n},parseValue(e){if(typeof e!="number"||!Number.isInteger(e))throw new m(`Int cannot represent non-integer value: ${v(e)}`);if(e>ht||e<mt)throw new m(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==c.INT)throw new m(`Int cannot represent non-integer value: ${F(e)}`,{nodes:e});const t=parseInt(e.value,10);if(t>ht||t<mt)throw new m(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),vs=new ye({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(e){const t=Ye(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isFinite(n))throw new m(`Float cannot represent non numeric value: ${v(t)}`);return n},parseValue(e){if(typeof e!="number"||!Number.isFinite(e))throw new m(`Float cannot represent non numeric value: ${v(e)}`);return e},parseLiteral(e){if(e.kind!==c.FLOAT&&e.kind!==c.INT)throw new m(`Float cannot represent non numeric value: ${F(e)}`,e);return parseFloat(e.value)}}),$=new ye({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(e){const t=Ye(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number"&&Number.isFinite(t))return t.toString();throw new m(`String cannot represent value: ${v(e)}`)},parseValue(e){if(typeof e!="string")throw new m(`String cannot represent a non string value: ${v(e)}`);return e},parseLiteral(e){if(e.kind!==c.STRING)throw new m(`String cannot represent a non string value: ${F(e)}`,{nodes:e});return e.value}}),W=new ye({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){const t=Ye(e);if(typeof t=="boolean")return t;if(Number.isFinite(t))return t!==0;throw new m(`Boolean cannot represent a non boolean value: ${v(t)}`)},parseValue(e){if(typeof e!="boolean")throw new m(`Boolean cannot represent a non boolean value: ${v(e)}`);return e},parseLiteral(e){if(e.kind!==c.BOOLEAN)throw new m(`Boolean cannot represent a non boolean value: ${F(e)}`,{nodes:e});return e.value}}),Yn=new ye({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(e){const t=Ye(e);if(typeof t=="string")return t;if(Number.isInteger(t))return String(t);throw new m(`ID cannot represent value: ${v(e)}`)},parseValue(e){if(typeof e=="string")return e;if(typeof e=="number"&&Number.isInteger(e))return e.toString();throw new m(`ID cannot represent value: ${v(e)}`)},parseLiteral(e){if(e.kind!==c.STRING&&e.kind!==c.INT)throw new m("ID cannot represent a non-string and non-integer value: "+F(e),{nodes:e});return e.value}}),$t=Object.freeze([$,Ts,vs,W,Yn]);function Qn(e){return $t.some(({name:t})=>e.name===t)}function Ye(e){if(Te(e)){if(typeof e.valueOf=="function"){const t=e.valueOf();if(!Te(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}function Jn(e){return ae(e,Ee)}class Ee{constructor(t){var n,i;this.name=ce(t.name),this.description=t.description,this.locations=t.locations,this.isRepeatable=(n=t.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=te(t.extensions),this.astNode=t.astNode,Array.isArray(t.locations)||A(!1,`@${t.name} locations must be an Array.`);const s=(i=t.args)!==null&&i!==void 0?i:{};Te(s)&&!Array.isArray(s)||A(!1,`@${t.name} args must be an object with argument names as keys.`),this.args=jn(s)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Bn(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const qn=new Ee({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[O.FIELD,O.FRAGMENT_SPREAD,O.INLINE_FRAGMENT],args:{if:{type:new S(W),description:"Included when true."}}}),Xn=new Ee({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[O.FIELD,O.FRAGMENT_SPREAD,O.INLINE_FRAGMENT],args:{if:{type:new S(W),description:"Skipped when true."}}}),zn="No longer supported",Ut=new Ee({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[O.FIELD_DEFINITION,O.ARGUMENT_DEFINITION,O.INPUT_FIELD_DEFINITION,O.ENUM_VALUE],args:{reason:{type:$,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:zn}}}),Hn=new Ee({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[O.SCALAR],args:{url:{type:new S($),description:"The URL that specifies the behavior of this scalar."}}}),Wn=new Ee({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[O.INPUT_OBJECT],args:{}}),De=Object.freeze([qn,Xn,Ut,Hn,Wn]);function ys(e){return De.some(({name:t})=>t===e.name)}function Zn(e){return typeof e=="object"&&typeof e?.[Symbol.iterator]=="function"}function we(e,t){if(D(t)){const n=we(e,t.ofType);return n?.kind===c.NULL?null:n}if(e===null)return{kind:c.NULL};if(e===void 0)return null;if(B(t)){const n=t.ofType;if(Zn(e)){const i=[];for(const s of e){const r=we(s,n);r!=null&&i.push(r)}return{kind:c.LIST,values:i}}return we(e,n)}if(U(t)){if(!Te(e))return null;const n=[];for(const i of Object.values(t.getFields())){const s=we(e[i.name],i.type);s&&n.push({kind:c.OBJECT_FIELD,name:{kind:c.NAME,value:i.name},value:s})}return{kind:c.OBJECT,fields:n}}if(be(t)){const n=t.serialize(e);if(n==null)return null;if(typeof n=="boolean")return{kind:c.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){const i=String(n);return un.test(i)?{kind:c.INT,value:i}:{kind:c.FLOAT,value:i}}if(typeof n=="string")return X(t)?{kind:c.ENUM,value:n}:t===Yn&&un.test(n)?{kind:c.INT,value:n}:{kind:c.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${v(n)}.`)}Y(!1,"Unexpected input type: "+v(t))}const un=/^-?(?:0|[1-9][0-9]*)$/,Mt=new pe({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:$,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new S(new q(new S(oe))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new S(oe),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:oe,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:oe,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new S(new q(new S(Kn))),resolve:e=>e.getDirectives()}})}),Kn=new pe({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
56
56
|
|
|
57
|
-
In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new S($),resolve:e=>e.name},description:{type:$,resolve:e=>e.description},isRepeatable:{type:new S(W),resolve:e=>e.isRepeatable},locations:{type:new S(new q(new S(Hn))),resolve:e=>e.locations},args:{type:new S(new q(new S(at))),args:{includeDeprecated:{type:W,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}}})}),Hn=new Ve({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:O.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:O.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:O.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:O.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:O.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:O.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:O.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:O.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:O.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:O.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:O.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:O.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:O.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:O.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:O.UNION,description:"Location adjacent to a union definition."},ENUM:{value:O.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:O.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:O.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:O.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),re=new le({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new S(Kn),resolve(e){if(fe(e))return P.SCALAR;if(k(e))return P.OBJECT;if(x(e))return P.INTERFACE;if(Z(e))return P.UNION;if(X(e))return P.ENUM;if(M(e))return P.INPUT_OBJECT;if(G(e))return P.LIST;if(A(e))return P.NON_NULL;J(!1,`Unexpected type: "${E(e)}".`)}},name:{type:$,resolve:e=>"name"in e?e.name:void 0},description:{type:$,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:$,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new q(new S(Wn)),args:{includeDeprecated:{type:W,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(k(e)||x(e)){const n=Object.values(e.getFields());return t?n:n.filter(i=>i.deprecationReason==null)}}},interfaces:{type:new q(new S(re)),resolve(e){if(k(e)||x(e))return e.getInterfaces()}},possibleTypes:{type:new q(new S(re)),resolve(e,t,n,{schema:i}){if(pe(e))return i.getPossibleTypes(e)}},enumValues:{type:new q(new S(Zn)),args:{includeDeprecated:{type:W,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(X(e)){const n=e.getValues();return t?n:n.filter(i=>i.deprecationReason==null)}}},inputFields:{type:new q(new S(at)),args:{includeDeprecated:{type:W,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(M(e)){const n=Object.values(e.getFields());return t?n:n.filter(i=>i.deprecationReason==null)}}},ofType:{type:re,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:W,resolve:e=>{if(M(e))return e.isOneOf}}})}),Wn=new le({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new S($),resolve:e=>e.name},description:{type:$,resolve:e=>e.description},args:{type:new S(new q(new S(at))),args:{includeDeprecated:{type:W,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new S(re),resolve:e=>e.type},isDeprecated:{type:new S(W),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:$,resolve:e=>e.deprecationReason}})}),at=new le({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new S($),resolve:e=>e.name},description:{type:$,resolve:e=>e.description},type:{type:new S(re),resolve:e=>e.type},defaultValue:{type:$,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const{type:t,defaultValue:n}=e,i=De(n,t);return i?C(i):null}},isDeprecated:{type:new S(W),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:$,resolve:e=>e.deprecationReason}})}),Zn=new le({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new S($),resolve:e=>e.name},description:{type:$,resolve:e=>e.description},isDeprecated:{type:new S(W),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:$,resolve:e=>e.deprecationReason}})});var P;(function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"})(P||(P={}));const Kn=new Ve({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:P.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:P.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:P.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:P.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:P.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:P.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:P.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:P.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),cn={name:"__schema",type:new S($t),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,{schema:i})=>i,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},un={name:"__type",type:re,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new S($),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:i})=>i.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},ln={name:"__typename",type:new S($),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,{parentType:i})=>i.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Ut=Object.freeze([$t,zn,Hn,re,Wn,at,Zn,Kn]);function Mt(e){return Ut.some(({name:t})=>e.name===t)}function hs(e){return oe(e,ei)}function ms(e){if(!hs(e))throw new Error(`Expected ${E(e)} to be a GraphQL schema.`);return e}class ei{constructor(t){var n,i;this.__validationErrors=t.assumeValid===!0?[]:void 0,Ne(t)||D(!1,"Must provide configuration object."),!t.types||Array.isArray(t.types)||D(!1,`"types" must be Array if provided but got: ${E(t.types)}.`),!t.directives||Array.isArray(t.directives)||D(!1,`"directives" must be Array if provided but got: ${E(t.directives)}.`),this.description=t.description,this.extensions=te(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(i=t.directives)!==null&&i!==void 0?i:be;const s=new Set(t.types);if(t.types!=null)for(const r of t.types)s.delete(r),se(r,s);this._queryType!=null&&se(this._queryType,s),this._mutationType!=null&&se(this._mutationType,s),this._subscriptionType!=null&&se(this._subscriptionType,s);for(const r of this._directives)if(Gn(r))for(const o of r.args)se(o.type,s);se($t,s),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const r of s){if(r==null)continue;const o=r.name;if(o||D(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[o]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${o}".`);if(this._typeMap[o]=r,x(r)){for(const a of r.getInterfaces())if(x(a)){let u=this._implementationsMap[a.name];u===void 0&&(u=this._implementationsMap[a.name]={objects:[],interfaces:[]}),u.interfaces.push(r)}}else if(k(r)){for(const a of r.getInterfaces())if(x(a)){let u=this._implementationsMap[a.name];u===void 0&&(u=this._implementationsMap[a.name]={objects:[],interfaces:[]}),u.objects.push(r)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case Q.QUERY:return this.getQueryType();case Q.MUTATION:return this.getMutationType();case Q.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return Z(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){const n=this._implementationsMap[t.name];return n??{objects:[],interfaces:[]}}isSubType(t,n){let i=this._subTypeMap[t.name];if(i===void 0){if(i=Object.create(null),Z(t))for(const s of t.getTypes())i[s.name]=!0;else{const s=this.getImplementations(t);for(const r of s.objects)i[r.name]=!0;for(const r of s.interfaces)i[r.name]=!0}this._subTypeMap[t.name]=i}return i[n.name]!==void 0}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(n=>n.name===t)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}function se(e,t){const n=H(e);if(!t.has(n)){if(t.add(n),Z(n))for(const i of n.getTypes())se(i,t);else if(k(n)||x(n)){for(const i of n.getInterfaces())se(i,t);for(const i of Object.values(n.getFields())){se(i.type,t);for(const s of i.args)se(s.type,t)}}else if(M(n))for(const i of Object.values(n.getFields()))se(i.type,t)}return t}function Ts(e){if(ms(e),e.__validationErrors)return e.__validationErrors;const t=new vs(e);ys(t),Ns(t),Is(t);const n=t.getErrors();return e.__validationErrors=n,n}function Es(e){const t=Ts(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(`
|
|
57
|
+
In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new S($),resolve:e=>e.name},description:{type:$,resolve:e=>e.description},isRepeatable:{type:new S(W),resolve:e=>e.isRepeatable},locations:{type:new S(new q(new S(ei))),resolve:e=>e.locations},args:{type:new S(new q(new S(ut))),args:{includeDeprecated:{type:W,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}}})}),ei=new Pe({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:O.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:O.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:O.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:O.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:O.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:O.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:O.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:O.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:O.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:O.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:O.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:O.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:O.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:O.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:O.UNION,description:"Location adjacent to a union definition."},ENUM:{value:O.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:O.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:O.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:O.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),oe=new pe({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new S(ii),resolve(e){if(de(e))return P.SCALAR;if(k(e))return P.OBJECT;if(x(e))return P.INTERFACE;if(Z(e))return P.UNION;if(X(e))return P.ENUM;if(U(e))return P.INPUT_OBJECT;if(B(e))return P.LIST;if(D(e))return P.NON_NULL;Y(!1,`Unexpected type: "${v(e)}".`)}},name:{type:$,resolve:e=>"name"in e?e.name:void 0},description:{type:$,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:$,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new q(new S(ti)),args:{includeDeprecated:{type:W,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(k(e)||x(e)){const n=Object.values(e.getFields());return t?n:n.filter(i=>i.deprecationReason==null)}}},interfaces:{type:new q(new S(oe)),resolve(e){if(k(e)||x(e))return e.getInterfaces()}},possibleTypes:{type:new q(new S(oe)),resolve(e,t,n,{schema:i}){if(me(e))return i.getPossibleTypes(e)}},enumValues:{type:new q(new S(ni)),args:{includeDeprecated:{type:W,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(X(e)){const n=e.getValues();return t?n:n.filter(i=>i.deprecationReason==null)}}},inputFields:{type:new q(new S(ut)),args:{includeDeprecated:{type:W,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(U(e)){const n=Object.values(e.getFields());return t?n:n.filter(i=>i.deprecationReason==null)}}},ofType:{type:oe,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:W,resolve:e=>{if(U(e))return e.isOneOf}}})}),ti=new pe({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new S($),resolve:e=>e.name},description:{type:$,resolve:e=>e.description},args:{type:new S(new q(new S(ut))),args:{includeDeprecated:{type:W,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new S(oe),resolve:e=>e.type},isDeprecated:{type:new S(W),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:$,resolve:e=>e.deprecationReason}})}),ut=new pe({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new S($),resolve:e=>e.name},description:{type:$,resolve:e=>e.description},type:{type:new S(oe),resolve:e=>e.type},defaultValue:{type:$,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const{type:t,defaultValue:n}=e,i=we(n,t);return i?F(i):null}},isDeprecated:{type:new S(W),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:$,resolve:e=>e.deprecationReason}})}),ni=new pe({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new S($),resolve:e=>e.name},description:{type:$,resolve:e=>e.description},isDeprecated:{type:new S(W),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:$,resolve:e=>e.deprecationReason}})});var P;(function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"})(P||(P={}));const ii=new Pe({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:P.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:P.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:P.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:P.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:P.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:P.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:P.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:P.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),ln={name:"__schema",type:new S(Mt),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,{schema:i})=>i,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},fn={name:"__type",type:oe,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new S($),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:i})=>i.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},pn={name:"__typename",type:new S($),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,{parentType:i})=>i.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Vt=Object.freeze([Mt,Kn,ei,oe,ti,ut,ni,ii]);function jt(e){return Vt.some(({name:t})=>e.name===t)}function Es(e){return ae(e,si)}function Ns(e){if(!Es(e))throw new Error(`Expected ${v(e)} to be a GraphQL schema.`);return e}class si{constructor(t){var n,i;this.__validationErrors=t.assumeValid===!0?[]:void 0,Te(t)||A(!1,"Must provide configuration object."),!t.types||Array.isArray(t.types)||A(!1,`"types" must be Array if provided but got: ${v(t.types)}.`),!t.directives||Array.isArray(t.directives)||A(!1,`"directives" must be Array if provided but got: ${v(t.directives)}.`),this.description=t.description,this.extensions=te(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(i=t.directives)!==null&&i!==void 0?i:De;const s=new Set(t.types);if(t.types!=null)for(const r of t.types)s.delete(r),se(r,s);this._queryType!=null&&se(this._queryType,s),this._mutationType!=null&&se(this._mutationType,s),this._subscriptionType!=null&&se(this._subscriptionType,s);for(const r of this._directives)if(Jn(r))for(const o of r.args)se(o.type,s);se(Mt,s),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const r of s){if(r==null)continue;const o=r.name;if(o||A(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[o]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${o}".`);if(this._typeMap[o]=r,x(r)){for(const a of r.getInterfaces())if(x(a)){let u=this._implementationsMap[a.name];u===void 0&&(u=this._implementationsMap[a.name]={objects:[],interfaces:[]}),u.interfaces.push(r)}}else if(k(r)){for(const a of r.getInterfaces())if(x(a)){let u=this._implementationsMap[a.name];u===void 0&&(u=this._implementationsMap[a.name]={objects:[],interfaces:[]}),u.objects.push(r)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case J.QUERY:return this.getQueryType();case J.MUTATION:return this.getMutationType();case J.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return Z(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){const n=this._implementationsMap[t.name];return n??{objects:[],interfaces:[]}}isSubType(t,n){let i=this._subTypeMap[t.name];if(i===void 0){if(i=Object.create(null),Z(t))for(const s of t.getTypes())i[s.name]=!0;else{const s=this.getImplementations(t);for(const r of s.objects)i[r.name]=!0;for(const r of s.interfaces)i[r.name]=!0}this._subTypeMap[t.name]=i}return i[n.name]!==void 0}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(n=>n.name===t)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}function se(e,t){const n=H(e);if(!t.has(n)){if(t.add(n),Z(n))for(const i of n.getTypes())se(i,t);else if(k(n)||x(n)){for(const i of n.getInterfaces())se(i,t);for(const i of Object.values(n.getFields())){se(i.type,t);for(const s of i.args)se(s.type,t)}}else if(U(n))for(const i of Object.values(n.getFields()))se(i.type,t)}return t}function Is(e){if(Ns(e),e.__validationErrors)return e.__validationErrors;const t=new Os(e);_s(t),bs(t),Ss(t);const n=t.getErrors();return e.__validationErrors=n,n}function gs(e){const t=Is(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(`
|
|
58
58
|
|
|
59
|
-
`))}class vs{constructor(t){this._errors=[],this.schema=t}reportError(t,n){const i=Array.isArray(n)?n.filter(Boolean):n;this._errors.push(new m(t,{nodes:i}))}getErrors(){return this._errors}}function ys(e){const t=e.schema,n=t.getQueryType();if(!n)e.reportError("Query root type must be provided.",t.astNode);else if(!k(n)){var i;e.reportError(`Query root type must be Object type, it cannot be ${E(n)}.`,(i=ht(t,Q.QUERY))!==null&&i!==void 0?i:n.astNode)}const s=t.getMutationType();if(s&&!k(s)){var r;e.reportError(`Mutation root type must be Object type if provided, it cannot be ${E(s)}.`,(r=ht(t,Q.MUTATION))!==null&&r!==void 0?r:s.astNode)}const o=t.getSubscriptionType();if(o&&!k(o)){var a;e.reportError(`Subscription root type must be Object type if provided, it cannot be ${E(o)}.`,(a=ht(t,Q.SUBSCRIPTION))!==null&&a!==void 0?a:o.astNode)}}function ht(e,t){var n;return(n=[e.astNode,...e.extensionASTNodes].flatMap(i=>{var s;return(s=i?.operationTypes)!==null&&s!==void 0?s:[]}).find(i=>i.operation===t))===null||n===void 0?void 0:n.type}function Ns(e){for(const n of e.schema.getDirectives()){if(!Gn(n)){e.reportError(`Expected directive but got: ${E(n)}.`,n?.astNode);continue}Oe(e,n),n.locations.length===0&&e.reportError(`Directive @${n.name} must include 1 or more locations.`,n.astNode);for(const i of n.args)if(Oe(e,i),ce(i.type)||e.reportError(`The type of @${n.name}(${i.name}:) must be Input Type but got: ${E(i.type)}.`,i.astNode),Pe(i)&&i.deprecationReason!=null){var t;e.reportError(`Required argument @${n.name}(${i.name}:) cannot be deprecated.`,[Vt(i.astNode),(t=i.astNode)===null||t===void 0?void 0:t.type])}}}function Oe(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function Is(e){const t=As(e),n=e.schema.getTypeMap();for(const i of Object.values(n)){if(!as(i)){e.reportError(`Expected GraphQL named type but got: ${E(i)}.`,i.astNode);continue}Mt(i)||Oe(e,i),k(i)||x(i)?(fn(e,i),pn(e,i)):Z(i)?_s(e,i):X(i)?bs(e,i):M(i)&&(Ss(e,i),t(i))}}function fn(e,t){const n=Object.values(t.getFields());n.length===0&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const o of n){if(Oe(e,o),!$e(o.type)){var i;e.reportError(`The type of ${t.name}.${o.name} must be Output Type but got: ${E(o.type)}.`,(i=o.astNode)===null||i===void 0?void 0:i.type)}for(const a of o.args){const u=a.name;if(Oe(e,a),!ce(a.type)){var s;e.reportError(`The type of ${t.name}.${o.name}(${u}:) must be Input Type but got: ${E(a.type)}.`,(s=a.astNode)===null||s===void 0?void 0:s.type)}if(Pe(a)&&a.deprecationReason!=null){var r;e.reportError(`Required argument ${t.name}.${o.name}(${u}:) cannot be deprecated.`,[Vt(a.astNode),(r=a.astNode)===null||r===void 0?void 0:r.type])}}}}function pn(e,t){const n=Object.create(null);for(const i of t.getInterfaces()){if(!x(i)){e.reportError(`Type ${E(t)} must only implement Interface types, it cannot implement ${E(i)}.`,Ue(t,i));continue}if(t===i){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,Ue(t,i));continue}if(n[i.name]){e.reportError(`Type ${t.name} can only implement ${i.name} once.`,Ue(t,i));continue}n[i.name]=!0,Os(e,t,i),gs(e,t,i)}}function gs(e,t,n){const i=t.getFields();for(const u of Object.values(n.getFields())){const l=u.name,f=i[l];if(!f){e.reportError(`Interface field ${n.name}.${l} expected but ${t.name} does not provide it.`,[u.astNode,t.astNode,...t.extensionASTNodes]);continue}if(!we(e.schema,f.type,u.type)){var s,r;e.reportError(`Interface field ${n.name}.${l} expects type ${E(u.type)} but ${t.name}.${l} is type ${E(f.type)}.`,[(s=u.astNode)===null||s===void 0?void 0:s.type,(r=f.astNode)===null||r===void 0?void 0:r.type])}for(const p of u.args){const T=p.name,_=f.args.find(I=>I.name===T);if(!_){e.reportError(`Interface field argument ${n.name}.${l}(${T}:) expected but ${t.name}.${l} does not provide it.`,[p.astNode,f.astNode]);continue}if(!_t(p.type,_.type)){var o,a;e.reportError(`Interface field argument ${n.name}.${l}(${T}:) expects type ${E(p.type)} but ${t.name}.${l}(${T}:) is type ${E(_.type)}.`,[(o=p.astNode)===null||o===void 0?void 0:o.type,(a=_.astNode)===null||a===void 0?void 0:a.type])}}for(const p of f.args){const T=p.name;!u.args.find(I=>I.name===T)&&Pe(p)&&e.reportError(`Object field ${t.name}.${l} includes required argument ${T} that is missing from the Interface field ${n.name}.${l}.`,[p.astNode,u.astNode])}}}function Os(e,t,n){const i=t.getInterfaces();for(const s of n.getInterfaces())i.includes(s)||e.reportError(s===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${s.name} because it is implemented by ${n.name}.`,[...Ue(n,s),...Ue(t,n)])}function _s(e,t){const n=t.getTypes();n.length===0&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const i=Object.create(null);for(const s of n){if(i[s.name]){e.reportError(`Union type ${t.name} can only include type ${s.name} once.`,dn(t,s.name));continue}i[s.name]=!0,k(s)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${E(s)}.`,dn(t,String(s)))}}function bs(e,t){const n=t.getValues();n.length===0&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const i of n)Oe(e,i)}function Ss(e,t){const n=Object.values(t.getFields());n.length===0&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const r of n){if(Oe(e,r),!ce(r.type)){var i;e.reportError(`The type of ${t.name}.${r.name} must be Input Type but got: ${E(r.type)}.`,(i=r.astNode)===null||i===void 0?void 0:i.type)}if(jn(r)&&r.deprecationReason!=null){var s;e.reportError(`Required input field ${t.name}.${r.name} cannot be deprecated.`,[Vt(r.astNode),(s=r.astNode)===null||s===void 0?void 0:s.type])}t.isOneOf&&Ds(t,r,e)}}function Ds(e,t,n){if(A(t.type)){var i;n.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,(i=t.astNode)===null||i===void 0?void 0:i.type)}t.defaultValue!==void 0&&n.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode)}function As(e){const t=Object.create(null),n=[],i=Object.create(null);return s;function s(r){if(t[r.name])return;t[r.name]=!0,i[r.name]=n.length;const o=Object.values(r.getFields());for(const a of o)if(A(a.type)&&M(a.type.ofType)){const u=a.type.ofType,l=i[u.name];if(n.push(a),l===void 0)s(u);else{const f=n.slice(l),p=f.map(T=>T.name).join(".");e.reportError(`Cannot reference Input Object "${u.name}" within itself through a series of non-null fields: "${p}".`,f.map(T=>T.astNode))}n.pop()}i[r.name]=void 0}}function Ue(e,t){const{astNode:n,extensionASTNodes:i}=e;return(n!=null?[n,...i]:i).flatMap(r=>{var o;return(o=r.interfaces)!==null&&o!==void 0?o:[]}).filter(r=>r.name.value===t.name)}function dn(e,t){const{astNode:n,extensionASTNodes:i}=e;return(n!=null?[n,...i]:i).flatMap(r=>{var o;return(o=r.types)!==null&&o!==void 0?o:[]}).filter(r=>r.name.value===t)}function Vt(e){var t;return e==null||(t=e.directives)===null||t===void 0?void 0:t.find(n=>n.name.value===Ct.name)}function K(e,t){switch(t.kind){case c.LIST_TYPE:{const n=K(e,t.type);return n&&new q(n)}case c.NON_NULL_TYPE:{const n=K(e,t.type);return n&&new S(n)}case c.NAMED_TYPE:return e.getType(t.name.value)}}class ti{constructor(t,n,i){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=i??ws,n&&(ce(n)&&this._inputTypeStack.push(n),he(n)&&this._parentTypeStack.push(n),$e(n)&&this._typeStack.push(n))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(t){const n=this._schema;switch(t.kind){case c.SELECTION_SET:{const s=H(this.getType());this._parentTypeStack.push(he(s)?s:void 0);break}case c.FIELD:{const s=this.getParentType();let r,o;s&&(r=this._getFieldDef(n,s,t),r&&(o=r.type)),this._fieldDefStack.push(r),this._typeStack.push($e(o)?o:void 0);break}case c.DIRECTIVE:this._directive=n.getDirective(t.name.value);break;case c.OPERATION_DEFINITION:{const s=n.getRootType(t.operation);this._typeStack.push(k(s)?s:void 0);break}case c.INLINE_FRAGMENT:case c.FRAGMENT_DEFINITION:{const s=t.typeCondition,r=s?K(n,s):H(this.getType());this._typeStack.push($e(r)?r:void 0);break}case c.VARIABLE_DEFINITION:{const s=K(n,t.type);this._inputTypeStack.push(ce(s)?s:void 0);break}case c.ARGUMENT:{var i;let s,r;const o=(i=this.getDirective())!==null&&i!==void 0?i:this.getFieldDef();o&&(s=o.args.find(a=>a.name===t.name.value),s&&(r=s.type)),this._argument=s,this._defaultValueStack.push(s?s.defaultValue:void 0),this._inputTypeStack.push(ce(r)?r:void 0);break}case c.LIST:{const s=Ln(this.getInputType()),r=G(s)?s.ofType:s;this._defaultValueStack.push(void 0),this._inputTypeStack.push(ce(r)?r:void 0);break}case c.OBJECT_FIELD:{const s=H(this.getInputType());let r,o;M(s)&&(o=s.getFields()[t.name.value],o&&(r=o.type)),this._defaultValueStack.push(o?o.defaultValue:void 0),this._inputTypeStack.push(ce(r)?r:void 0);break}case c.ENUM:{const s=H(this.getInputType());let r;X(s)&&(r=s.getValue(t.value)),this._enumValue=r;break}}}leave(t){switch(t.kind){case c.SELECTION_SET:this._parentTypeStack.pop();break;case c.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case c.DIRECTIVE:this._directive=null;break;case c.OPERATION_DEFINITION:case c.INLINE_FRAGMENT:case c.FRAGMENT_DEFINITION:this._typeStack.pop();break;case c.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case c.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case c.LIST:case c.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case c.ENUM:this._enumValue=null;break}}}function ws(e,t,n){const i=n.name.value;if(i===cn.name&&e.getQueryType()===t)return cn;if(i===un.name&&e.getQueryType()===t)return un;if(i===ln.name&&he(t))return ln;if(k(t)||x(t))return t.getFields()[i]}function ni(e,t){return{enter(...n){const i=n[0];e.enter(i);const s=et(t,i.kind).enter;if(s){const r=s.apply(t,n);return r!==void 0&&(e.leave(i),Et(r)&&e.enter(r)),r}},leave(...n){const i=n[0],s=et(t,i.kind).leave;let r;return s&&(r=s.apply(t,n)),e.leave(i),r}}}function Rs(e){return e.kind===c.OPERATION_DEFINITION||e.kind===c.FRAGMENT_DEFINITION}function ks(e){return e.kind===c.SCHEMA_DEFINITION||Ge(e)||e.kind===c.DIRECTIVE_DEFINITION}function Ge(e){return e.kind===c.SCALAR_TYPE_DEFINITION||e.kind===c.OBJECT_TYPE_DEFINITION||e.kind===c.INTERFACE_TYPE_DEFINITION||e.kind===c.UNION_TYPE_DEFINITION||e.kind===c.ENUM_TYPE_DEFINITION||e.kind===c.INPUT_OBJECT_TYPE_DEFINITION}function Ls(e){return e.kind===c.SCHEMA_EXTENSION||jt(e)}function jt(e){return e.kind===c.SCALAR_TYPE_EXTENSION||e.kind===c.OBJECT_TYPE_EXTENSION||e.kind===c.INTERFACE_TYPE_EXTENSION||e.kind===c.UNION_TYPE_EXTENSION||e.kind===c.ENUM_TYPE_EXTENSION||e.kind===c.INPUT_OBJECT_TYPE_EXTENSION}function xs(e){return{Document(t){for(const n of t.definitions)if(!Rs(n)){const i=n.kind===c.SCHEMA_DEFINITION||n.kind===c.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new m(`The ${i} definition is not executable.`,{nodes:n}))}return!1}}}function Fs(e){return{Field(t){const n=e.getParentType();if(n&&!e.getFieldDef()){const s=e.getSchema(),r=t.name.value;let o=de("to use an inline fragment on",Cs(s,n,r));o===""&&(o=de($s(n,r))),e.reportError(new m(`Cannot query field "${r}" on type "${n.name}".`+o,{nodes:t}))}}}}function Cs(e,t,n){if(!pe(t))return[];const i=new Set,s=Object.create(null);for(const o of e.getPossibleTypes(t))if(o.getFields()[n]){i.add(o),s[o.name]=1;for(const a of o.getInterfaces()){var r;a.getFields()[n]&&(i.add(a),s[a.name]=((r=s[a.name])!==null&&r!==void 0?r:0)+1)}}return[...i].sort((o,a)=>{const u=s[a.name]-s[o.name];return u!==0?u:x(o)&&e.isSubType(o,a)?-1:x(a)&&e.isSubType(a,o)?1:kt(o.name,a.name)}).map(o=>o.name)}function $s(e,t){if(k(e)||x(e)){const n=Object.keys(e.getFields());return _e(t,n)}return[]}function Us(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const i=K(e.getSchema(),n);if(i&&!he(i)){const s=C(n);e.reportError(new m(`Fragment cannot condition on non composite type "${s}".`,{nodes:n}))}}},FragmentDefinition(t){const n=K(e.getSchema(),t.typeCondition);if(n&&!he(n)){const i=C(t.typeCondition);e.reportError(new m(`Fragment "${t.name.value}" cannot condition on non composite type "${i}".`,{nodes:t.typeCondition}))}}}}function Ms(e){return{...ii(e),Argument(t){const n=e.getArgument(),i=e.getFieldDef(),s=e.getParentType();if(!n&&i&&s){const r=t.name.value,o=i.args.map(u=>u.name),a=_e(r,o);e.reportError(new m(`Unknown argument "${r}" on field "${s.name}.${i.name}".`+de(a),{nodes:t}))}}}}function ii(e){const t=Object.create(null),n=e.getSchema(),i=n?n.getDirectives():be;for(const o of i)t[o.name]=o.args.map(a=>a.name);const s=e.getDocument().definitions;for(const o of s)if(o.kind===c.DIRECTIVE_DEFINITION){var r;const a=(r=o.arguments)!==null&&r!==void 0?r:[];t[o.name.value]=a.map(u=>u.name.value)}return{Directive(o){const a=o.name.value,u=t[a];if(o.arguments&&u)for(const l of o.arguments){const f=l.name.value;if(!u.includes(f)){const p=_e(f,u);e.reportError(new m(`Unknown argument "${f}" on directive "@${a}".`+de(p),{nodes:l}))}}return!1}}}function si(e){const t=Object.create(null),n=e.getSchema(),i=n?n.getDirectives():be;for(const r of i)t[r.name]=r.locations;const s=e.getDocument().definitions;for(const r of s)r.kind===c.DIRECTIVE_DEFINITION&&(t[r.name.value]=r.locations.map(o=>o.value));return{Directive(r,o,a,u,l){const f=r.name.value,p=t[f];if(!p){e.reportError(new m(`Unknown directive "@${f}".`,{nodes:r}));return}const T=Vs(l);T&&!p.includes(T)&&e.reportError(new m(`Directive "@${f}" may not be used on ${T}.`,{nodes:r}))}}}function Vs(e){const t=e[e.length-1];switch("kind"in t||J(!1),t.kind){case c.OPERATION_DEFINITION:return js(t.operation);case c.FIELD:return O.FIELD;case c.FRAGMENT_SPREAD:return O.FRAGMENT_SPREAD;case c.INLINE_FRAGMENT:return O.INLINE_FRAGMENT;case c.FRAGMENT_DEFINITION:return O.FRAGMENT_DEFINITION;case c.VARIABLE_DEFINITION:return O.VARIABLE_DEFINITION;case c.SCHEMA_DEFINITION:case c.SCHEMA_EXTENSION:return O.SCHEMA;case c.SCALAR_TYPE_DEFINITION:case c.SCALAR_TYPE_EXTENSION:return O.SCALAR;case c.OBJECT_TYPE_DEFINITION:case c.OBJECT_TYPE_EXTENSION:return O.OBJECT;case c.FIELD_DEFINITION:return O.FIELD_DEFINITION;case c.INTERFACE_TYPE_DEFINITION:case c.INTERFACE_TYPE_EXTENSION:return O.INTERFACE;case c.UNION_TYPE_DEFINITION:case c.UNION_TYPE_EXTENSION:return O.UNION;case c.ENUM_TYPE_DEFINITION:case c.ENUM_TYPE_EXTENSION:return O.ENUM;case c.ENUM_VALUE_DEFINITION:return O.ENUM_VALUE;case c.INPUT_OBJECT_TYPE_DEFINITION:case c.INPUT_OBJECT_TYPE_EXTENSION:return O.INPUT_OBJECT;case c.INPUT_VALUE_DEFINITION:{const n=e[e.length-3];return"kind"in n||J(!1),n.kind===c.INPUT_OBJECT_TYPE_DEFINITION?O.INPUT_FIELD_DEFINITION:O.ARGUMENT_DEFINITION}default:J(!1,"Unexpected kind: "+E(t.kind))}}function js(e){switch(e){case Q.QUERY:return O.QUERY;case Q.MUTATION:return O.MUTATION;case Q.SUBSCRIPTION:return O.SUBSCRIPTION}}function Ps(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new m(`Unknown fragment "${n}".`,{nodes:t.name}))}}}function ri(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),i=Object.create(null);for(const r of e.getDocument().definitions)Ge(r)&&(i[r.name.value]=!0);const s=[...Object.keys(n),...Object.keys(i)];return{NamedType(r,o,a,u,l){const f=r.name.value;if(!n[f]&&!i[f]){var p;const T=(p=l[2])!==null&&p!==void 0?p:a,_=T!=null&&Bs(T);if(_&&hn.includes(f))return;const I=_e(f,_?hn.concat(s):s);e.reportError(new m(`Unknown type "${f}".`+de(I),{nodes:r}))}}}}const hn=[...Ft,...Ut].map(e=>e.name);function Bs(e){return"kind"in e&&(ks(e)||Ls(e))}function Gs(e){let t=0;return{Document(n){t=n.definitions.filter(i=>i.kind===c.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new m("This anonymous operation must be the only defined operation.",{nodes:n}))}}}function Ys(e){var t,n,i;const s=e.getSchema(),r=(t=(n=(i=s?.astNode)!==null&&i!==void 0?i:s?.getQueryType())!==null&&n!==void 0?n:s?.getMutationType())!==null&&t!==void 0?t:s?.getSubscriptionType();let o=0;return{SchemaDefinition(a){if(r){e.reportError(new m("Cannot define a new schema within a schema extension.",{nodes:a}));return}o>0&&e.reportError(new m("Must provide only one schema definition.",{nodes:a})),++o}}}const Qs=3;function Js(e){function t(n,i=Object.create(null),s=0){if(n.kind===c.FRAGMENT_SPREAD){const r=n.name.value;if(i[r]===!0)return!1;const o=e.getFragment(r);if(!o)return!1;try{return i[r]=!0,t(o,i,s)}finally{i[r]=void 0}}if(n.kind===c.FIELD&&(n.name.value==="fields"||n.name.value==="interfaces"||n.name.value==="possibleTypes"||n.name.value==="inputFields")&&(s++,s>=Qs))return!0;if("selectionSet"in n&&n.selectionSet){for(const r of n.selectionSet.selections)if(t(r,i,s))return!0}return!1}return{Field(n){if((n.name.value==="__schema"||n.name.value==="__type")&&t(n))return e.reportError(new m("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}function qs(e){const t=Object.create(null),n=[],i=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(r){return s(r),!1}};function s(r){if(t[r.name.value])return;const o=r.name.value;t[o]=!0;const a=e.getFragmentSpreads(r.selectionSet);if(a.length!==0){i[o]=n.length;for(const u of a){const l=u.name.value,f=i[l];if(n.push(u),f===void 0){const p=e.getFragment(l);p&&s(p)}else{const p=n.slice(f),T=p.slice(0,-1).map(_=>'"'+_.name.value+'"').join(", ");e.reportError(new m(`Cannot spread fragment "${l}" within itself`+(T!==""?` via ${T}.`:"."),{nodes:p}))}n.pop()}i[o]=void 0}}}function Xs(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){const i=e.getRecursiveVariableUsages(n);for(const{node:s}of i){const r=s.name.value;t[r]!==!0&&e.reportError(new m(n.name?`Variable "$${r}" is not defined by operation "${n.name.value}".`:`Variable "$${r}" is not defined.`,{nodes:[s,n]}))}}},VariableDefinition(n){t[n.variable.name.value]=!0}}}function zs(e){const t=[],n=[];return{OperationDefinition(i){return t.push(i),!1},FragmentDefinition(i){return n.push(i),!1},Document:{leave(){const i=Object.create(null);for(const s of t)for(const r of e.getRecursivelyReferencedFragments(s))i[r.name.value]=!0;for(const s of n){const r=s.name.value;i[r]!==!0&&e.reportError(new m(`Fragment "${r}" is never used.`,{nodes:s}))}}}}}function Hs(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(n){const i=Object.create(null),s=e.getRecursiveVariableUsages(n);for(const{node:r}of s)i[r.name.value]=!0;for(const r of t){const o=r.variable.name.value;i[o]!==!0&&e.reportError(new m(n.name?`Variable "$${o}" is never used in operation "${n.name.value}".`:`Variable "$${o}" is never used.`,{nodes:r}))}}},VariableDefinition(n){t.push(n)}}}function Pt(e){switch(e.kind){case c.OBJECT:return{...e,fields:Ws(e.fields)};case c.LIST:return{...e,values:e.values.map(Pt)};case c.INT:case c.FLOAT:case c.STRING:case c.BOOLEAN:case c.NULL:case c.ENUM:case c.VARIABLE:return e}}function Ws(e){return e.map(t=>({...t,value:Pt(t.value)})).sort((t,n)=>kt(t.name.value,n.name.value))}function oi(e){return Array.isArray(e)?e.map(([t,n])=>`subfields "${t}" conflict because `+oi(n)).join(" and "):e}function Zs(e){const t=new ui,n=new sr,i=new Map;return{SelectionSet(s){const r=Ks(e,i,t,n,e.getParentType(),s);for(const[[o,a],u,l]of r){const f=oi(a);e.reportError(new m(`Fields "${o}" conflict because ${f}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:u.concat(l)}))}}}}function Ks(e,t,n,i,s,r){const o=[],[a,u]=it(e,t,s,r);if(tr(e,o,t,n,i,a),u.length!==0)for(let l=0;l<u.length;l++){tt(e,o,t,n,i,!1,a,u[l]);for(let f=l+1;f<u.length;f++)nt(e,o,t,n,i,!1,u[l],u[f])}return o}function tt(e,t,n,i,s,r,o,a){if(i.has(o,a,r))return;i.add(o,a,r);const u=e.getFragment(a);if(!u)return;const[l,f]=St(e,n,u);if(o!==l){Bt(e,t,n,i,s,r,o,l);for(const p of f)tt(e,t,n,i,s,r,o,p)}}function nt(e,t,n,i,s,r,o,a){if(o===a||s.has(o,a,r))return;s.add(o,a,r);const u=e.getFragment(o),l=e.getFragment(a);if(!u||!l)return;const[f,p]=St(e,n,u),[T,_]=St(e,n,l);Bt(e,t,n,i,s,r,f,T);for(const I of _)nt(e,t,n,i,s,r,o,I);for(const I of p)nt(e,t,n,i,s,r,I,a)}function er(e,t,n,i,s,r,o,a,u){const l=[],[f,p]=it(e,t,r,o),[T,_]=it(e,t,a,u);Bt(e,l,t,n,i,s,f,T);for(const I of _)tt(e,l,t,n,i,s,f,I);for(const I of p)tt(e,l,t,n,i,s,T,I);for(const I of p)for(const w of _)nt(e,l,t,n,i,s,I,w);return l}function tr(e,t,n,i,s,r){for(const[o,a]of Object.entries(r))if(a.length>1)for(let u=0;u<a.length;u++)for(let l=u+1;l<a.length;l++){const f=ai(e,n,i,s,!1,o,a[u],a[l]);f&&t.push(f)}}function Bt(e,t,n,i,s,r,o,a){for(const[u,l]of Object.entries(o)){const f=a[u];if(f)for(const p of l)for(const T of f){const _=ai(e,n,i,s,r,u,p,T);_&&t.push(_)}}}function ai(e,t,n,i,s,r,o,a){const[u,l,f]=o,[p,T,_]=a,I=s||u!==p&&k(u)&&k(p);if(!I){const Y=l.name.value,z=T.name.value;if(Y!==z)return[[r,`"${Y}" and "${z}" are different fields`],[l],[T]];if(!nr(l,T))return[[r,"they have differing arguments"],[l],[T]]}const w=f?.type,F=_?.type;if(w&&F&&bt(w,F))return[[r,`they return conflicting types "${E(w)}" and "${E(F)}"`],[l],[T]];const B=l.selectionSet,Ee=T.selectionSet;if(B&&Ee){const Y=er(e,t,n,i,I,H(w),B,H(F),Ee);return ir(Y,r,l,T)}}function nr(e,t){const n=e.arguments,i=t.arguments;if(n===void 0||n.length===0)return i===void 0||i.length===0;if(i===void 0||i.length===0||n.length!==i.length)return!1;const s=new Map(i.map(({name:r,value:o})=>[r.value,o]));return n.every(r=>{const o=r.value,a=s.get(r.name.value);return a===void 0?!1:mn(o)===mn(a)})}function mn(e){return C(Pt(e))}function bt(e,t){return G(e)?G(t)?bt(e.ofType,t.ofType):!0:G(t)?!0:A(e)?A(t)?bt(e.ofType,t.ofType):!0:A(t)?!0:Re(e)||Re(t)?e!==t:!1}function it(e,t,n,i){const s=t.get(i);if(s)return s;const r=Object.create(null),o=Object.create(null);ci(e,n,i,r,o);const a=[r,Object.keys(o)];return t.set(i,a),a}function St(e,t,n){const i=t.get(n.selectionSet);if(i)return i;const s=K(e.getSchema(),n.typeCondition);return it(e,t,s,n.selectionSet)}function ci(e,t,n,i,s){for(const r of n.selections)switch(r.kind){case c.FIELD:{const o=r.name.value;let a;(k(t)||x(t))&&(a=t.getFields()[o]);const u=r.alias?r.alias.value:o;i[u]||(i[u]=[]),i[u].push([t,r,a]);break}case c.FRAGMENT_SPREAD:s[r.name.value]=!0;break;case c.INLINE_FRAGMENT:{const o=r.typeCondition,a=o?K(e.getSchema(),o):t;ci(e,a,r.selectionSet,i,s);break}}}function ir(e,t,n,i){if(e.length>0)return[[t,e.map(([s])=>s)],[n,...e.map(([,s])=>s).flat()],[i,...e.map(([,,s])=>s).flat()]]}class ui{constructor(){this._data=new Map}has(t,n,i){var s;const r=(s=this._data.get(t))===null||s===void 0?void 0:s.get(n);return r===void 0?!1:i?!0:i===r}add(t,n,i){const s=this._data.get(t);s===void 0?this._data.set(t,new Map([[n,i]])):s.set(n,i)}}class sr{constructor(){this._orderedPairSet=new ui}has(t,n,i){return t<n?this._orderedPairSet.has(t,n,i):this._orderedPairSet.has(n,t,i)}add(t,n,i){t<n?this._orderedPairSet.add(t,n,i):this._orderedPairSet.add(n,t,i)}}function rr(e){return{InlineFragment(t){const n=e.getType(),i=e.getParentType();if(he(n)&&he(i)&&!on(e.getSchema(),n,i)){const s=E(i),r=E(n);e.reportError(new m(`Fragment cannot be spread here as objects of type "${s}" can never be of type "${r}".`,{nodes:t}))}},FragmentSpread(t){const n=t.name.value,i=or(e,n),s=e.getParentType();if(i&&s&&!on(e.getSchema(),i,s)){const r=E(s),o=E(i);e.reportError(new m(`Fragment "${n}" cannot be spread here as objects of type "${r}" can never be of type "${o}".`,{nodes:t}))}}}}function or(e,t){const n=e.getFragment(t);if(n){const i=K(e.getSchema(),n.typeCondition);if(he(i))return i}}function ar(e){const t=e.getSchema(),n=Object.create(null);for(const s of e.getDocument().definitions)Ge(s)&&(n[s.name.value]=s);return{ScalarTypeExtension:i,ObjectTypeExtension:i,InterfaceTypeExtension:i,UnionTypeExtension:i,EnumTypeExtension:i,InputObjectTypeExtension:i};function i(s){const r=s.name.value,o=n[r],a=t?.getType(r);let u;if(o?u=cr[o.kind]:a&&(u=ur(a)),u){if(u!==s.kind){const l=lr(s.kind);e.reportError(new m(`Cannot extend non-${l} type "${r}".`,{nodes:o?[o,s]:s}))}}else{const l=Object.keys({...n,...t?.getTypeMap()}),f=_e(r,l);e.reportError(new m(`Cannot extend type "${r}" because it is not defined.`+de(f),{nodes:s.name}))}}}const cr={[c.SCALAR_TYPE_DEFINITION]:c.SCALAR_TYPE_EXTENSION,[c.OBJECT_TYPE_DEFINITION]:c.OBJECT_TYPE_EXTENSION,[c.INTERFACE_TYPE_DEFINITION]:c.INTERFACE_TYPE_EXTENSION,[c.UNION_TYPE_DEFINITION]:c.UNION_TYPE_EXTENSION,[c.ENUM_TYPE_DEFINITION]:c.ENUM_TYPE_EXTENSION,[c.INPUT_OBJECT_TYPE_DEFINITION]:c.INPUT_OBJECT_TYPE_EXTENSION};function ur(e){if(fe(e))return c.SCALAR_TYPE_EXTENSION;if(k(e))return c.OBJECT_TYPE_EXTENSION;if(x(e))return c.INTERFACE_TYPE_EXTENSION;if(Z(e))return c.UNION_TYPE_EXTENSION;if(X(e))return c.ENUM_TYPE_EXTENSION;if(M(e))return c.INPUT_OBJECT_TYPE_EXTENSION;J(!1,"Unexpected type: "+E(e))}function lr(e){switch(e){case c.SCALAR_TYPE_EXTENSION:return"scalar";case c.OBJECT_TYPE_EXTENSION:return"object";case c.INTERFACE_TYPE_EXTENSION:return"interface";case c.UNION_TYPE_EXTENSION:return"union";case c.ENUM_TYPE_EXTENSION:return"enum";case c.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:J(!1,"Unexpected kind: "+E(e))}}function fr(e){return{...li(e),Field:{leave(t){var n;const i=e.getFieldDef();if(!i)return!1;const s=new Set((n=t.arguments)===null||n===void 0?void 0:n.map(r=>r.name.value));for(const r of i.args)if(!s.has(r.name)&&Pe(r)){const o=E(r.type);e.reportError(new m(`Field "${i.name}" argument "${r.name}" of type "${o}" is required, but it was not provided.`,{nodes:t}))}}}}}function li(e){var t;const n=Object.create(null),i=e.getSchema(),s=(t=i?.getDirectives())!==null&&t!==void 0?t:be;for(const a of s)n[a.name]=ge(a.args.filter(Pe),u=>u.name);const r=e.getDocument().definitions;for(const a of r)if(a.kind===c.DIRECTIVE_DEFINITION){var o;const u=(o=a.arguments)!==null&&o!==void 0?o:[];n[a.name.value]=ge(u.filter(pr),l=>l.name.value)}return{Directive:{leave(a){const u=a.name.value,l=n[u];if(l){var f;const p=(f=a.arguments)!==null&&f!==void 0?f:[],T=new Set(p.map(_=>_.name.value));for(const[_,I]of Object.entries(l))if(!T.has(_)){const w=Lt(I.type)?E(I.type):C(I.type);e.reportError(new m(`Directive "@${u}" argument "${_}" of type "${w}" is required, but it was not provided.`,{nodes:a}))}}}}}}function pr(e){return e.type.kind===c.NON_NULL_TYPE&&e.defaultValue==null}function dr(e){return{Field(t){const n=e.getType(),i=t.selectionSet;if(n)if(Re(H(n))){if(i){const s=t.name.value,r=E(n);e.reportError(new m(`Field "${s}" must not have a selection since type "${r}" has no subfields.`,{nodes:i}))}}else if(i){if(i.selections.length===0){const s=t.name.value,r=E(n);e.reportError(new m(`Field "${s}" of type "${r}" must have at least one field selected.`,{nodes:t}))}}else{const s=t.name.value,r=E(n);e.reportError(new m(`Field "${s}" of type "${r}" must have a selection of subfields. Did you mean "${s} { ... }"?`,{nodes:t}))}}}}function ye(e,t,n){if(e){if(e.kind===c.VARIABLE){const i=e.name.value;if(n==null||n[i]===void 0)return;const s=n[i];return s===null&&A(t)?void 0:s}if(A(t))return e.kind===c.NULL?void 0:ye(e,t.ofType,n);if(e.kind===c.NULL)return null;if(G(t)){const i=t.ofType;if(e.kind===c.LIST){const r=[];for(const o of e.values)if(Tn(o,n)){if(A(i))return;r.push(null)}else{const a=ye(o,i,n);if(a===void 0)return;r.push(a)}return r}const s=ye(e,i,n);return s===void 0?void 0:[s]}if(M(t)){if(e.kind!==c.OBJECT)return;const i=Object.create(null),s=ge(e.fields,r=>r.name.value);for(const r of Object.values(t.getFields())){const o=s[r.name];if(!o||Tn(o.value,n)){if(r.defaultValue!==void 0)i[r.name]=r.defaultValue;else if(A(r.type))return;continue}const a=ye(o.value,r.type,n);if(a===void 0)return;i[r.name]=a}if(t.isOneOf){const r=Object.keys(i);if(r.length!==1||i[r[0]]===null)return}return i}if(Re(t)){let i;try{i=t.parseLiteral(e,n)}catch{return}return i===void 0?void 0:i}J(!1,"Unexpected input type: "+E(t))}}function Tn(e,t){return e.kind===c.VARIABLE&&(t==null||t[e.name.value]===void 0)}function hr(e,t,n){var i;const s={},r=(i=t.arguments)!==null&&i!==void 0?i:[],o=ge(r,a=>a.name.value);for(const a of e.args){const u=a.name,l=a.type,f=o[u];if(!f){if(a.defaultValue!==void 0)s[u]=a.defaultValue;else if(A(l))throw new m(`Argument "${u}" of required type "${E(l)}" was not provided.`,{nodes:t});continue}const p=f.value;let T=p.kind===c.NULL;if(p.kind===c.VARIABLE){const I=p.name.value;if(n==null||!mr(n,I)){if(a.defaultValue!==void 0)s[u]=a.defaultValue;else if(A(l))throw new m(`Argument "${u}" of required type "${E(l)}" was provided the variable "$${I}" which was not provided a runtime value.`,{nodes:p});continue}T=n[I]==null}if(T&&A(l))throw new m(`Argument "${u}" of non-null type "${E(l)}" must not be null.`,{nodes:p});const _=ye(p,l,n);if(_===void 0)throw new m(`Argument "${u}" has invalid value ${C(p)}.`,{nodes:p});s[u]=_}return s}function je(e,t,n){var i;const s=(i=t.directives)===null||i===void 0?void 0:i.find(r=>r.name.value===e.name);if(s)return hr(e,s,n)}function mr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Tr(e,t,n,i,s){const r=new Map;return Dt(e,t,n,i,s,r,new Set),r}function Dt(e,t,n,i,s,r,o){for(const a of s.selections)switch(a.kind){case c.FIELD:{if(!mt(n,a))continue;const u=Er(a),l=r.get(u);l!==void 0?l.push(a):r.set(u,[a]);break}case c.INLINE_FRAGMENT:{if(!mt(n,a)||!En(e,a,i))continue;Dt(e,t,n,i,a.selectionSet,r,o);break}case c.FRAGMENT_SPREAD:{const u=a.name.value;if(o.has(u)||!mt(n,a))continue;o.add(u);const l=t[u];if(!l||!En(e,l,i))continue;Dt(e,t,n,i,l.selectionSet,r,o);break}}}function mt(e,t){const n=je(Qn,t,e);if(n?.if===!0)return!1;const i=je(Yn,t,e);return i?.if!==!1}function En(e,t,n){const i=t.typeCondition;if(!i)return!0;const s=K(e,i);return s===n?!0:pe(s)?e.isSubType(s,n):!1}function Er(e){return e.alias?e.alias.value:e.name.value}function vr(e){return{OperationDefinition(t){if(t.operation==="subscription"){const n=e.getSchema(),i=n.getSubscriptionType();if(i){const s=t.name?t.name.value:null,r=Object.create(null),o=e.getDocument(),a=Object.create(null);for(const l of o.definitions)l.kind===c.FRAGMENT_DEFINITION&&(a[l.name.value]=l);const u=Tr(n,a,r,i,t.selectionSet);if(u.size>1){const p=[...u.values()].slice(1).flat();e.reportError(new m(s!=null?`Subscription "${s}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:p}))}for(const l of u.values())l[0].name.value.startsWith("__")&&e.reportError(new m(s!=null?`Subscription "${s}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:l}))}}}}}function Gt(e,t){const n=new Map;for(const i of e){const s=t(i),r=n.get(s);r===void 0?n.set(s,[i]):r.push(i)}return n}function yr(e){return{DirectiveDefinition(i){var s;const r=(s=i.arguments)!==null&&s!==void 0?s:[];return n(`@${i.name.value}`,r)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(i){var s;const r=i.name.value,o=(s=i.fields)!==null&&s!==void 0?s:[];for(const u of o){var a;const l=u.name.value,f=(a=u.arguments)!==null&&a!==void 0?a:[];n(`${r}.${l}`,f)}return!1}function n(i,s){const r=Gt(s,o=>o.name.value);for(const[o,a]of r)a.length>1&&e.reportError(new m(`Argument "${i}(${o}:)" can only be defined once.`,{nodes:a.map(u=>u.name)}));return!1}}function fi(e){return{Field:t,Directive:t};function t(n){var i;const s=(i=n.arguments)!==null&&i!==void 0?i:[],r=Gt(s,o=>o.name.value);for(const[o,a]of r)a.length>1&&e.reportError(new m(`There can be only one argument named "${o}".`,{nodes:a.map(u=>u.name)}))}}function Nr(e){const t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(i){const s=i.name.value;if(n!=null&&n.getDirective(s)){e.reportError(new m(`Directive "@${s}" already exists in the schema. It cannot be redefined.`,{nodes:i.name}));return}return t[s]?e.reportError(new m(`There can be only one directive named "@${s}".`,{nodes:[t[s],i.name]})):t[s]=i.name,!1}}}function pi(e){const t=Object.create(null),n=e.getSchema(),i=n?n.getDirectives():be;for(const a of i)t[a.name]=!a.isRepeatable;const s=e.getDocument().definitions;for(const a of s)a.kind===c.DIRECTIVE_DEFINITION&&(t[a.name.value]=!a.repeatable);const r=Object.create(null),o=Object.create(null);return{enter(a){if(!("directives"in a)||!a.directives)return;let u;if(a.kind===c.SCHEMA_DEFINITION||a.kind===c.SCHEMA_EXTENSION)u=r;else if(Ge(a)||jt(a)){const l=a.name.value;u=o[l],u===void 0&&(o[l]=u=Object.create(null))}else u=Object.create(null);for(const l of a.directives){const f=l.name.value;t[f]&&(u[f]?e.reportError(new m(`The directive "@${f}" can only be used once at this location.`,{nodes:[u[f],l]})):u[f]=l)}}}}function Ir(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),i=Object.create(null);return{EnumTypeDefinition:s,EnumTypeExtension:s};function s(r){var o;const a=r.name.value;i[a]||(i[a]=Object.create(null));const u=(o=r.values)!==null&&o!==void 0?o:[],l=i[a];for(const f of u){const p=f.name.value,T=n[a];X(T)&&T.getValue(p)?e.reportError(new m(`Enum value "${a}.${p}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:f.name})):l[p]?e.reportError(new m(`Enum value "${a}.${p}" can only be defined once.`,{nodes:[l[p],f.name]})):l[p]=f.name}return!1}}function gr(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),i=Object.create(null);return{InputObjectTypeDefinition:s,InputObjectTypeExtension:s,InterfaceTypeDefinition:s,InterfaceTypeExtension:s,ObjectTypeDefinition:s,ObjectTypeExtension:s};function s(r){var o;const a=r.name.value;i[a]||(i[a]=Object.create(null));const u=(o=r.fields)!==null&&o!==void 0?o:[],l=i[a];for(const f of u){const p=f.name.value;Or(n[a],p)?e.reportError(new m(`Field "${a}.${p}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:f.name})):l[p]?e.reportError(new m(`Field "${a}.${p}" can only be defined once.`,{nodes:[l[p],f.name]})):l[p]=f.name}return!1}}function Or(e,t){return k(e)||x(e)||M(e)?e.getFields()[t]!=null:!1}function _r(e){const t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){const i=n.name.value;return t[i]?e.reportError(new m(`There can be only one fragment named "${i}".`,{nodes:[t[i],n.name]})):t[i]=n.name,!1}}}function di(e){const t=[];let n=Object.create(null);return{ObjectValue:{enter(){t.push(n),n=Object.create(null)},leave(){const i=t.pop();i||J(!1),n=i}},ObjectField(i){const s=i.name.value;n[s]?e.reportError(new m(`There can be only one input field named "${s}".`,{nodes:[n[s],i.name]})):n[s]=i.name}}}function br(e){const t=Object.create(null);return{OperationDefinition(n){const i=n.name;return i&&(t[i.value]?e.reportError(new m(`There can be only one operation named "${i.value}".`,{nodes:[t[i.value],i]})):t[i.value]=i),!1},FragmentDefinition:()=>!1}}function Sr(e){const t=e.getSchema(),n=Object.create(null),i=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:s,SchemaExtension:s};function s(r){var o;const a=(o=r.operationTypes)!==null&&o!==void 0?o:[];for(const u of a){const l=u.operation,f=n[l];i[l]?e.reportError(new m(`Type for ${l} already defined in the schema. It cannot be redefined.`,{nodes:u})):f?e.reportError(new m(`There can be only one ${l} type in schema.`,{nodes:[f,u]})):n[l]=u}return!1}}function Dr(e){const t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:i,ObjectTypeDefinition:i,InterfaceTypeDefinition:i,UnionTypeDefinition:i,EnumTypeDefinition:i,InputObjectTypeDefinition:i};function i(s){const r=s.name.value;if(n!=null&&n.getType(r)){e.reportError(new m(`Type "${r}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:s.name}));return}return t[r]?e.reportError(new m(`There can be only one type named "${r}".`,{nodes:[t[r],s.name]})):t[r]=s.name,!1}}function Ar(e){return{OperationDefinition(t){var n;const i=(n=t.variableDefinitions)!==null&&n!==void 0?n:[],s=Gt(i,r=>r.variable.name.value);for(const[r,o]of s)o.length>1&&e.reportError(new m(`There can be only one variable named "$${r}".`,{nodes:o.map(a=>a.variable.name)}))}}}function wr(e){let t={};return{OperationDefinition:{enter(){t={}}},VariableDefinition(n){t[n.variable.name.value]=n},ListValue(n){const i=Ln(e.getParentInputType());if(!G(i))return ve(e,n),!1},ObjectValue(n){const i=H(e.getInputType());if(!M(i))return ve(e,n),!1;const s=ge(n.fields,r=>r.name.value);for(const r of Object.values(i.getFields()))if(!s[r.name]&&jn(r)){const a=E(r.type);e.reportError(new m(`Field "${i.name}.${r.name}" of required type "${a}" was not provided.`,{nodes:n}))}i.isOneOf&&Rr(e,n,i,s)},ObjectField(n){const i=H(e.getParentInputType());if(!e.getInputType()&&M(i)){const r=_e(n.name.value,Object.keys(i.getFields()));e.reportError(new m(`Field "${n.name.value}" is not defined by type "${i.name}".`+de(r),{nodes:n}))}},NullValue(n){const i=e.getInputType();A(i)&&e.reportError(new m(`Expected value of type "${E(i)}", found ${C(n)}.`,{nodes:n}))},EnumValue:n=>ve(e,n),IntValue:n=>ve(e,n),FloatValue:n=>ve(e,n),StringValue:n=>ve(e,n),BooleanValue:n=>ve(e,n)}}function ve(e,t){const n=e.getInputType();if(!n)return;const i=H(n);if(!Re(i)){const s=E(n);e.reportError(new m(`Expected value of type "${s}", found ${C(t)}.`,{nodes:t}));return}try{if(i.parseLiteral(t,void 0)===void 0){const r=E(n);e.reportError(new m(`Expected value of type "${r}", found ${C(t)}.`,{nodes:t}))}}catch(s){const r=E(n);s instanceof m?e.reportError(s):e.reportError(new m(`Expected value of type "${r}", found ${C(t)}; `+s.message,{nodes:t,originalError:s}))}}function Rr(e,t,n,i){var s;const r=Object.keys(i);if(r.length!==1){e.reportError(new m(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[t]}));return}const a=(s=i[r[0]])===null||s===void 0?void 0:s.value;(!a||a.kind===c.NULL)&&e.reportError(new m(`Field "${n.name}.${r[0]}" must be non-null.`,{nodes:[t]}))}function kr(e){return{VariableDefinition(t){const n=K(e.getSchema(),t.type);if(n!==void 0&&!ce(n)){const i=t.variable.name.value,s=C(t.type);e.reportError(new m(`Variable "$${i}" cannot be non-input type "${s}".`,{nodes:t.type}))}}}}function Lr(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){const i=e.getRecursiveVariableUsages(n);for(const{node:s,type:r,defaultValue:o,parentType:a}of i){const u=s.name.value,l=t[u];if(l&&r){const f=e.getSchema(),p=K(f,l.type);if(p&&!xr(f,p,l.defaultValue,r,o)){const T=E(p),_=E(r);e.reportError(new m(`Variable "$${u}" of type "${T}" used in position expecting type "${_}".`,{nodes:[l,s]}))}M(a)&&a.isOneOf&&kn(p)&&e.reportError(new m(`Variable "$${u}" is of type "${p}" but must be non-nullable to be used for OneOf Input Object "${a}".`,{nodes:[l,s]}))}}}},VariableDefinition(n){t[n.variable.name.value]=n}}}function xr(e,t,n,i,s){if(A(i)&&!A(t)){if(!(n!=null&&n.kind!==c.NULL)&&!(s!==void 0))return!1;const a=i.ofType;return we(e,t,a)}return we(e,t,i)}const Fr=Object.freeze([Js]),Cr=Object.freeze([xs,br,Gs,vr,ri,Us,kr,dr,Fs,_r,Ps,zs,rr,qs,Ar,Xs,Hs,si,pi,Ms,fi,wr,fr,Lr,Zs,di,...Fr]),$r=Object.freeze([Ys,Sr,Dr,Ir,gr,yr,Nr,ri,si,pi,ar,ii,fi,di,li]);class hi{constructor(t,n){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(const i of this.getDocument().definitions)i.kind===c.FRAGMENT_DEFINITION&&(n[i.name.value]=i);this._fragments=n}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];const i=[t];let s;for(;s=i.pop();)for(const r of s.selections)r.kind===c.FRAGMENT_SPREAD?n.push(r):r.selectionSet&&i.push(r.selectionSet);this._fragmentSpreads.set(t,n)}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];const i=Object.create(null),s=[t.selectionSet];let r;for(;r=s.pop();)for(const o of this.getFragmentSpreads(r)){const a=o.name.value;if(i[a]!==!0){i[a]=!0;const u=this.getFragment(a);u&&(n.push(u),s.push(u.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}}class Ur extends hi{constructor(t,n,i){super(t,i),this._schema=n}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class Mr extends hi{constructor(t,n,i,s){super(n,s),this._schema=t,this._typeInfo=i,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(t){let n=this._variableUsages.get(t);if(!n){const i=[],s=new ti(this._schema);ot(t,ni(s,{VariableDefinition:()=>!1,Variable(r){i.push({node:r,type:s.getInputType(),defaultValue:s.getDefaultValue(),parentType:s.getParentInputType()})}})),n=i,this._variableUsages.set(t,n)}return n}getRecursiveVariableUsages(t){let n=this._recursiveVariableUsages.get(t);if(!n){n=this.getVariableUsages(t);for(const i of this.getRecursivelyReferencedFragments(t))n=n.concat(this.getVariableUsages(i));this._recursiveVariableUsages.set(t,n)}return n}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}function co(e,t,n=Cr,i,s=new ti(e)){var r;const o=(r=void 0)!==null&&r!==void 0?r:100;t||D(!1,"Must provide document."),Es(e);const a=Object.freeze({}),u=[],l=new Mr(e,t,s,p=>{if(u.length>=o)throw u.push(new m("Too many validation errors, error limit reached. Validation aborted.")),a;u.push(p)}),f=Rn(n.map(p=>p(l)));try{ot(t,ni(s,f))}catch(p){if(p!==a)throw p}return u}function Vr(e,t,n=$r){const i=[],s=new Ur(e,t,o=>{i.push(o)}),r=n.map(o=>o(s));return ot(e,Rn(r)),i}function jr(e){const t=Vr(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(`
|
|
59
|
+
`))}class Os{constructor(t){this._errors=[],this.schema=t}reportError(t,n){const i=Array.isArray(n)?n.filter(Boolean):n;this._errors.push(new m(t,{nodes:i}))}getErrors(){return this._errors}}function _s(e){const t=e.schema,n=t.getQueryType();if(!n)e.reportError("Query root type must be provided.",t.astNode);else if(!k(n)){var i;e.reportError(`Query root type must be Object type, it cannot be ${v(n)}.`,(i=Tt(t,J.QUERY))!==null&&i!==void 0?i:n.astNode)}const s=t.getMutationType();if(s&&!k(s)){var r;e.reportError(`Mutation root type must be Object type if provided, it cannot be ${v(s)}.`,(r=Tt(t,J.MUTATION))!==null&&r!==void 0?r:s.astNode)}const o=t.getSubscriptionType();if(o&&!k(o)){var a;e.reportError(`Subscription root type must be Object type if provided, it cannot be ${v(o)}.`,(a=Tt(t,J.SUBSCRIPTION))!==null&&a!==void 0?a:o.astNode)}}function Tt(e,t){var n;return(n=[e.astNode,...e.extensionASTNodes].flatMap(i=>{var s;return(s=i?.operationTypes)!==null&&s!==void 0?s:[]}).find(i=>i.operation===t))===null||n===void 0?void 0:n.type}function bs(e){for(const n of e.schema.getDirectives()){if(!Jn(n)){e.reportError(`Expected directive but got: ${v(n)}.`,n?.astNode);continue}Se(e,n),n.locations.length===0&&e.reportError(`Directive @${n.name} must include 1 or more locations.`,n.astNode);for(const i of n.args)if(Se(e,i),re(i.type)||e.reportError(`The type of @${n.name}(${i.name}:) must be Input Type but got: ${v(i.type)}.`,i.astNode),Ge(i)&&i.deprecationReason!=null){var t;e.reportError(`Required argument @${n.name}(${i.name}:) cannot be deprecated.`,[Pt(i.astNode),(t=i.astNode)===null||t===void 0?void 0:t.type])}}}function Se(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function Ss(e){const t=xs(e),n=e.schema.getTypeMap();for(const i of Object.values(n)){if(!ds(i)){e.reportError(`Expected GraphQL named type but got: ${v(i)}.`,i.astNode);continue}jt(i)||Se(e,i),k(i)||x(i)?(dn(e,i),hn(e,i)):Z(i)?ws(e,i):X(i)?Rs(e,i):U(i)&&(ks(e,i),t(i))}}function dn(e,t){const n=Object.values(t.getFields());n.length===0&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const o of n){if(Se(e,o),!Me(o.type)){var i;e.reportError(`The type of ${t.name}.${o.name} must be Output Type but got: ${v(o.type)}.`,(i=o.astNode)===null||i===void 0?void 0:i.type)}for(const a of o.args){const u=a.name;if(Se(e,a),!re(a.type)){var s;e.reportError(`The type of ${t.name}.${o.name}(${u}:) must be Input Type but got: ${v(a.type)}.`,(s=a.astNode)===null||s===void 0?void 0:s.type)}if(Ge(a)&&a.deprecationReason!=null){var r;e.reportError(`Required argument ${t.name}.${o.name}(${u}:) cannot be deprecated.`,[Pt(a.astNode),(r=a.astNode)===null||r===void 0?void 0:r.type])}}}}function hn(e,t){const n=Object.create(null);for(const i of t.getInterfaces()){if(!x(i)){e.reportError(`Type ${v(t)} must only implement Interface types, it cannot implement ${v(i)}.`,Ve(t,i));continue}if(t===i){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,Ve(t,i));continue}if(n[i.name]){e.reportError(`Type ${t.name} can only implement ${i.name} once.`,Ve(t,i));continue}n[i.name]=!0,As(e,t,i),Ds(e,t,i)}}function Ds(e,t,n){const i=t.getFields();for(const u of Object.values(n.getFields())){const l=u.name,f=i[l];if(!f){e.reportError(`Interface field ${n.name}.${l} expected but ${t.name} does not provide it.`,[u.astNode,t.astNode,...t.extensionASTNodes]);continue}if(!ke(e.schema,f.type,u.type)){var s,r;e.reportError(`Interface field ${n.name}.${l} expects type ${v(u.type)} but ${t.name}.${l} is type ${v(f.type)}.`,[(s=u.astNode)===null||s===void 0?void 0:s.type,(r=f.astNode)===null||r===void 0?void 0:r.type])}for(const p of u.args){const T=p.name,_=f.args.find(I=>I.name===T);if(!_){e.reportError(`Interface field argument ${n.name}.${l}(${T}:) expected but ${t.name}.${l} does not provide it.`,[p.astNode,f.astNode]);continue}if(!St(p.type,_.type)){var o,a;e.reportError(`Interface field argument ${n.name}.${l}(${T}:) expects type ${v(p.type)} but ${t.name}.${l}(${T}:) is type ${v(_.type)}.`,[(o=p.astNode)===null||o===void 0?void 0:o.type,(a=_.astNode)===null||a===void 0?void 0:a.type])}}for(const p of f.args){const T=p.name;!u.args.find(I=>I.name===T)&&Ge(p)&&e.reportError(`Object field ${t.name}.${l} includes required argument ${T} that is missing from the Interface field ${n.name}.${l}.`,[p.astNode,u.astNode])}}}function As(e,t,n){const i=t.getInterfaces();for(const s of n.getInterfaces())i.includes(s)||e.reportError(s===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${s.name} because it is implemented by ${n.name}.`,[...Ve(n,s),...Ve(t,n)])}function ws(e,t){const n=t.getTypes();n.length===0&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const i=Object.create(null);for(const s of n){if(i[s.name]){e.reportError(`Union type ${t.name} can only include type ${s.name} once.`,mn(t,s.name));continue}i[s.name]=!0,k(s)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${v(s)}.`,mn(t,String(s)))}}function Rs(e,t){const n=t.getValues();n.length===0&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const i of n)Se(e,i)}function ks(e,t){const n=Object.values(t.getFields());n.length===0&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const r of n){if(Se(e,r),!re(r.type)){var i;e.reportError(`The type of ${t.name}.${r.name} must be Input Type but got: ${v(r.type)}.`,(i=r.astNode)===null||i===void 0?void 0:i.type)}if(Gn(r)&&r.deprecationReason!=null){var s;e.reportError(`Required input field ${t.name}.${r.name} cannot be deprecated.`,[Pt(r.astNode),(s=r.astNode)===null||s===void 0?void 0:s.type])}t.isOneOf&&Ls(t,r,e)}}function Ls(e,t,n){if(D(t.type)){var i;n.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,(i=t.astNode)===null||i===void 0?void 0:i.type)}t.defaultValue!==void 0&&n.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode)}function xs(e){const t=Object.create(null),n=[],i=Object.create(null);return s;function s(r){if(t[r.name])return;t[r.name]=!0,i[r.name]=n.length;const o=Object.values(r.getFields());for(const a of o)if(D(a.type)&&U(a.type.ofType)){const u=a.type.ofType,l=i[u.name];if(n.push(a),l===void 0)s(u);else{const f=n.slice(l),p=f.map(T=>T.name).join(".");e.reportError(`Cannot reference Input Object "${u.name}" within itself through a series of non-null fields: "${p}".`,f.map(T=>T.astNode))}n.pop()}i[r.name]=void 0}}function Ve(e,t){const{astNode:n,extensionASTNodes:i}=e;return(n!=null?[n,...i]:i).flatMap(r=>{var o;return(o=r.interfaces)!==null&&o!==void 0?o:[]}).filter(r=>r.name.value===t.name)}function mn(e,t){const{astNode:n,extensionASTNodes:i}=e;return(n!=null?[n,...i]:i).flatMap(r=>{var o;return(o=r.types)!==null&&o!==void 0?o:[]}).filter(r=>r.name.value===t)}function Pt(e){var t;return e==null||(t=e.directives)===null||t===void 0?void 0:t.find(n=>n.name.value===Ut.name)}function K(e,t){switch(t.kind){case c.LIST_TYPE:{const n=K(e,t.type);return n&&new q(n)}case c.NON_NULL_TYPE:{const n=K(e,t.type);return n&&new S(n)}case c.NAMED_TYPE:return e.getType(t.name.value)}}class ri{constructor(t,n,i){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=i??Fs,n&&(re(n)&&this._inputTypeStack.push(n),ve(n)&&this._parentTypeStack.push(n),Me(n)&&this._typeStack.push(n))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(t){const n=this._schema;switch(t.kind){case c.SELECTION_SET:{const s=H(this.getType());this._parentTypeStack.push(ve(s)?s:void 0);break}case c.FIELD:{const s=this.getParentType();let r,o;s&&(r=this._getFieldDef(n,s,t),r&&(o=r.type)),this._fieldDefStack.push(r),this._typeStack.push(Me(o)?o:void 0);break}case c.DIRECTIVE:this._directive=n.getDirective(t.name.value);break;case c.OPERATION_DEFINITION:{const s=n.getRootType(t.operation);this._typeStack.push(k(s)?s:void 0);break}case c.INLINE_FRAGMENT:case c.FRAGMENT_DEFINITION:{const s=t.typeCondition,r=s?K(n,s):H(this.getType());this._typeStack.push(Me(r)?r:void 0);break}case c.VARIABLE_DEFINITION:{const s=K(n,t.type);this._inputTypeStack.push(re(s)?s:void 0);break}case c.ARGUMENT:{var i;let s,r;const o=(i=this.getDirective())!==null&&i!==void 0?i:this.getFieldDef();o&&(s=o.args.find(a=>a.name===t.name.value),s&&(r=s.type)),this._argument=s,this._defaultValueStack.push(s?s.defaultValue:void 0),this._inputTypeStack.push(re(r)?r:void 0);break}case c.LIST:{const s=Cn(this.getInputType()),r=B(s)?s.ofType:s;this._defaultValueStack.push(void 0),this._inputTypeStack.push(re(r)?r:void 0);break}case c.OBJECT_FIELD:{const s=H(this.getInputType());let r,o;U(s)&&(o=s.getFields()[t.name.value],o&&(r=o.type)),this._defaultValueStack.push(o?o.defaultValue:void 0),this._inputTypeStack.push(re(r)?r:void 0);break}case c.ENUM:{const s=H(this.getInputType());let r;X(s)&&(r=s.getValue(t.value)),this._enumValue=r;break}}}leave(t){switch(t.kind){case c.SELECTION_SET:this._parentTypeStack.pop();break;case c.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case c.DIRECTIVE:this._directive=null;break;case c.OPERATION_DEFINITION:case c.INLINE_FRAGMENT:case c.FRAGMENT_DEFINITION:this._typeStack.pop();break;case c.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case c.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case c.LIST:case c.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case c.ENUM:this._enumValue=null;break}}}function Fs(e,t,n){const i=n.name.value;if(i===ln.name&&e.getQueryType()===t)return ln;if(i===fn.name&&e.getQueryType()===t)return fn;if(i===pn.name&&ve(t))return pn;if(k(t)||x(t))return t.getFields()[i]}function oi(e,t){return{enter(...n){const i=n[0];e.enter(i);const s=nt(t,i.kind).enter;if(s){const r=s.apply(t,n);return r!==void 0&&(e.leave(i),Et(r)&&e.enter(r)),r}},leave(...n){const i=n[0],s=nt(t,i.kind).leave;let r;return s&&(r=s.apply(t,n)),e.leave(i),r}}}function Cs(e){return e.kind===c.OPERATION_DEFINITION||e.kind===c.FRAGMENT_DEFINITION}function $s(e){return e.kind===c.SCHEMA_DEFINITION||Qe(e)||e.kind===c.DIRECTIVE_DEFINITION}function Qe(e){return e.kind===c.SCALAR_TYPE_DEFINITION||e.kind===c.OBJECT_TYPE_DEFINITION||e.kind===c.INTERFACE_TYPE_DEFINITION||e.kind===c.UNION_TYPE_DEFINITION||e.kind===c.ENUM_TYPE_DEFINITION||e.kind===c.INPUT_OBJECT_TYPE_DEFINITION}function Us(e){return e.kind===c.SCHEMA_EXTENSION||Bt(e)}function Bt(e){return e.kind===c.SCALAR_TYPE_EXTENSION||e.kind===c.OBJECT_TYPE_EXTENSION||e.kind===c.INTERFACE_TYPE_EXTENSION||e.kind===c.UNION_TYPE_EXTENSION||e.kind===c.ENUM_TYPE_EXTENSION||e.kind===c.INPUT_OBJECT_TYPE_EXTENSION}function Ms(e){return{Document(t){for(const n of t.definitions)if(!Cs(n)){const i=n.kind===c.SCHEMA_DEFINITION||n.kind===c.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new m(`The ${i} definition is not executable.`,{nodes:n}))}return!1}}}function Vs(e){return{Field(t){const n=e.getParentType();if(n&&!e.getFieldDef()){const s=e.getSchema(),r=t.name.value;let o=fe("to use an inline fragment on",js(s,n,r));o===""&&(o=fe(Ps(n,r))),e.reportError(new m(`Cannot query field "${r}" on type "${n.name}".`+o,{nodes:t}))}}}}function js(e,t,n){if(!me(t))return[];const i=new Set,s=Object.create(null);for(const o of e.getPossibleTypes(t))if(o.getFields()[n]){i.add(o),s[o.name]=1;for(const a of o.getInterfaces()){var r;a.getFields()[n]&&(i.add(a),s[a.name]=((r=s[a.name])!==null&&r!==void 0?r:0)+1)}}return[...i].sort((o,a)=>{const u=s[a.name]-s[o.name];return u!==0?u:x(o)&&e.isSubType(o,a)?-1:x(a)&&e.isSubType(a,o)?1:xt(o.name,a.name)}).map(o=>o.name)}function Ps(e,t){if(k(e)||x(e)){const n=Object.keys(e.getFields());return Ne(t,n)}return[]}function Bs(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const i=K(e.getSchema(),n);if(i&&!ve(i)){const s=F(n);e.reportError(new m(`Fragment cannot condition on non composite type "${s}".`,{nodes:n}))}}},FragmentDefinition(t){const n=K(e.getSchema(),t.typeCondition);if(n&&!ve(n)){const i=F(t.typeCondition);e.reportError(new m(`Fragment "${t.name.value}" cannot condition on non composite type "${i}".`,{nodes:t.typeCondition}))}}}}function Gs(e){return{...ai(e),Argument(t){const n=e.getArgument(),i=e.getFieldDef(),s=e.getParentType();if(!n&&i&&s){const r=t.name.value,o=i.args.map(u=>u.name),a=Ne(r,o);e.reportError(new m(`Unknown argument "${r}" on field "${s.name}.${i.name}".`+fe(a),{nodes:t}))}}}}function ai(e){const t=Object.create(null),n=e.getSchema(),i=n?n.getDirectives():De;for(const o of i)t[o.name]=o.args.map(a=>a.name);const s=e.getDocument().definitions;for(const o of s)if(o.kind===c.DIRECTIVE_DEFINITION){var r;const a=(r=o.arguments)!==null&&r!==void 0?r:[];t[o.name.value]=a.map(u=>u.name.value)}return{Directive(o){const a=o.name.value,u=t[a];if(o.arguments&&u)for(const l of o.arguments){const f=l.name.value;if(!u.includes(f)){const p=Ne(f,u);e.reportError(new m(`Unknown argument "${f}" on directive "@${a}".`+fe(p),{nodes:l}))}}return!1}}}function ci(e){const t=Object.create(null),n=e.getSchema(),i=n?n.getDirectives():De;for(const r of i)t[r.name]=r.locations;const s=e.getDocument().definitions;for(const r of s)r.kind===c.DIRECTIVE_DEFINITION&&(t[r.name.value]=r.locations.map(o=>o.value));return{Directive(r,o,a,u,l){const f=r.name.value,p=t[f];if(!p){e.reportError(new m(`Unknown directive "@${f}".`,{nodes:r}));return}const T=Ys(l);T&&!p.includes(T)&&e.reportError(new m(`Directive "@${f}" may not be used on ${T}.`,{nodes:r}))}}}function Ys(e){const t=e[e.length-1];switch("kind"in t||Y(!1),t.kind){case c.OPERATION_DEFINITION:return Qs(t.operation);case c.FIELD:return O.FIELD;case c.FRAGMENT_SPREAD:return O.FRAGMENT_SPREAD;case c.INLINE_FRAGMENT:return O.INLINE_FRAGMENT;case c.FRAGMENT_DEFINITION:return O.FRAGMENT_DEFINITION;case c.VARIABLE_DEFINITION:return O.VARIABLE_DEFINITION;case c.SCHEMA_DEFINITION:case c.SCHEMA_EXTENSION:return O.SCHEMA;case c.SCALAR_TYPE_DEFINITION:case c.SCALAR_TYPE_EXTENSION:return O.SCALAR;case c.OBJECT_TYPE_DEFINITION:case c.OBJECT_TYPE_EXTENSION:return O.OBJECT;case c.FIELD_DEFINITION:return O.FIELD_DEFINITION;case c.INTERFACE_TYPE_DEFINITION:case c.INTERFACE_TYPE_EXTENSION:return O.INTERFACE;case c.UNION_TYPE_DEFINITION:case c.UNION_TYPE_EXTENSION:return O.UNION;case c.ENUM_TYPE_DEFINITION:case c.ENUM_TYPE_EXTENSION:return O.ENUM;case c.ENUM_VALUE_DEFINITION:return O.ENUM_VALUE;case c.INPUT_OBJECT_TYPE_DEFINITION:case c.INPUT_OBJECT_TYPE_EXTENSION:return O.INPUT_OBJECT;case c.INPUT_VALUE_DEFINITION:{const n=e[e.length-3];return"kind"in n||Y(!1),n.kind===c.INPUT_OBJECT_TYPE_DEFINITION?O.INPUT_FIELD_DEFINITION:O.ARGUMENT_DEFINITION}default:Y(!1,"Unexpected kind: "+v(t.kind))}}function Qs(e){switch(e){case J.QUERY:return O.QUERY;case J.MUTATION:return O.MUTATION;case J.SUBSCRIPTION:return O.SUBSCRIPTION}}function Js(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new m(`Unknown fragment "${n}".`,{nodes:t.name}))}}}function ui(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),i=Object.create(null);for(const r of e.getDocument().definitions)Qe(r)&&(i[r.name.value]=!0);const s=[...Object.keys(n),...Object.keys(i)];return{NamedType(r,o,a,u,l){const f=r.name.value;if(!n[f]&&!i[f]){var p;const T=(p=l[2])!==null&&p!==void 0?p:a,_=T!=null&&qs(T);if(_&&Tn.includes(f))return;const I=Ne(f,_?Tn.concat(s):s);e.reportError(new m(`Unknown type "${f}".`+fe(I),{nodes:r}))}}}}const Tn=[...$t,...Vt].map(e=>e.name);function qs(e){return"kind"in e&&($s(e)||Us(e))}function Xs(e){let t=0;return{Document(n){t=n.definitions.filter(i=>i.kind===c.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new m("This anonymous operation must be the only defined operation.",{nodes:n}))}}}function zs(e){var t,n,i;const s=e.getSchema(),r=(t=(n=(i=s?.astNode)!==null&&i!==void 0?i:s?.getQueryType())!==null&&n!==void 0?n:s?.getMutationType())!==null&&t!==void 0?t:s?.getSubscriptionType();let o=0;return{SchemaDefinition(a){if(r){e.reportError(new m("Cannot define a new schema within a schema extension.",{nodes:a}));return}o>0&&e.reportError(new m("Must provide only one schema definition.",{nodes:a})),++o}}}const Hs=3;function Ws(e){function t(n,i=Object.create(null),s=0){if(n.kind===c.FRAGMENT_SPREAD){const r=n.name.value;if(i[r]===!0)return!1;const o=e.getFragment(r);if(!o)return!1;try{return i[r]=!0,t(o,i,s)}finally{i[r]=void 0}}if(n.kind===c.FIELD&&(n.name.value==="fields"||n.name.value==="interfaces"||n.name.value==="possibleTypes"||n.name.value==="inputFields")&&(s++,s>=Hs))return!0;if("selectionSet"in n&&n.selectionSet){for(const r of n.selectionSet.selections)if(t(r,i,s))return!0}return!1}return{Field(n){if((n.name.value==="__schema"||n.name.value==="__type")&&t(n))return e.reportError(new m("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}function Zs(e){const t=Object.create(null),n=[],i=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(r){return s(r),!1}};function s(r){if(t[r.name.value])return;const o=r.name.value;t[o]=!0;const a=e.getFragmentSpreads(r.selectionSet);if(a.length!==0){i[o]=n.length;for(const u of a){const l=u.name.value,f=i[l];if(n.push(u),f===void 0){const p=e.getFragment(l);p&&s(p)}else{const p=n.slice(f),T=p.slice(0,-1).map(_=>'"'+_.name.value+'"').join(", ");e.reportError(new m(`Cannot spread fragment "${l}" within itself`+(T!==""?` via ${T}.`:"."),{nodes:p}))}n.pop()}i[o]=void 0}}}function Ks(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){const i=e.getRecursiveVariableUsages(n);for(const{node:s}of i){const r=s.name.value;t[r]!==!0&&e.reportError(new m(n.name?`Variable "$${r}" is not defined by operation "${n.name.value}".`:`Variable "$${r}" is not defined.`,{nodes:[s,n]}))}}},VariableDefinition(n){t[n.variable.name.value]=!0}}}function er(e){const t=[],n=[];return{OperationDefinition(i){return t.push(i),!1},FragmentDefinition(i){return n.push(i),!1},Document:{leave(){const i=Object.create(null);for(const s of t)for(const r of e.getRecursivelyReferencedFragments(s))i[r.name.value]=!0;for(const s of n){const r=s.name.value;i[r]!==!0&&e.reportError(new m(`Fragment "${r}" is never used.`,{nodes:s}))}}}}}function tr(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(n){const i=Object.create(null),s=e.getRecursiveVariableUsages(n);for(const{node:r}of s)i[r.name.value]=!0;for(const r of t){const o=r.variable.name.value;i[o]!==!0&&e.reportError(new m(n.name?`Variable "$${o}" is never used in operation "${n.name.value}".`:`Variable "$${o}" is never used.`,{nodes:r}))}}},VariableDefinition(n){t.push(n)}}}function Gt(e){switch(e.kind){case c.OBJECT:return{...e,fields:nr(e.fields)};case c.LIST:return{...e,values:e.values.map(Gt)};case c.INT:case c.FLOAT:case c.STRING:case c.BOOLEAN:case c.NULL:case c.ENUM:case c.VARIABLE:return e}}function nr(e){return e.map(t=>({...t,value:Gt(t.value)})).sort((t,n)=>xt(t.name.value,n.name.value))}function li(e){return Array.isArray(e)?e.map(([t,n])=>`subfields "${t}" conflict because `+li(n)).join(" and "):e}function ir(e){const t=new di,n=new ur,i=new Map;return{SelectionSet(s){const r=sr(e,i,t,n,e.getParentType(),s);for(const[[o,a],u,l]of r){const f=li(a);e.reportError(new m(`Fields "${o}" conflict because ${f}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:u.concat(l)}))}}}}function sr(e,t,n,i,s,r){const o=[],[a,u]=rt(e,t,s,r);if(or(e,o,t,n,i,a),u.length!==0)for(let l=0;l<u.length;l++){it(e,o,t,n,i,!1,a,u[l]);for(let f=l+1;f<u.length;f++)st(e,o,t,n,i,!1,u[l],u[f])}return o}function it(e,t,n,i,s,r,o,a){if(i.has(o,a,r))return;i.add(o,a,r);const u=e.getFragment(a);if(!u)return;const[l,f]=At(e,n,u);if(o!==l){Yt(e,t,n,i,s,r,o,l);for(const p of f)it(e,t,n,i,s,r,o,p)}}function st(e,t,n,i,s,r,o,a){if(o===a||s.has(o,a,r))return;s.add(o,a,r);const u=e.getFragment(o),l=e.getFragment(a);if(!u||!l)return;const[f,p]=At(e,n,u),[T,_]=At(e,n,l);Yt(e,t,n,i,s,r,f,T);for(const I of _)st(e,t,n,i,s,r,o,I);for(const I of p)st(e,t,n,i,s,r,I,a)}function rr(e,t,n,i,s,r,o,a,u){const l=[],[f,p]=rt(e,t,r,o),[T,_]=rt(e,t,a,u);Yt(e,l,t,n,i,s,f,T);for(const I of _)it(e,l,t,n,i,s,f,I);for(const I of p)it(e,l,t,n,i,s,T,I);for(const I of p)for(const w of _)st(e,l,t,n,i,s,I,w);return l}function or(e,t,n,i,s,r){for(const[o,a]of Object.entries(r))if(a.length>1)for(let u=0;u<a.length;u++)for(let l=u+1;l<a.length;l++){const f=fi(e,n,i,s,!1,o,a[u],a[l]);f&&t.push(f)}}function Yt(e,t,n,i,s,r,o,a){for(const[u,l]of Object.entries(o)){const f=a[u];if(f)for(const p of l)for(const T of f){const _=fi(e,n,i,s,r,u,p,T);_&&t.push(_)}}}function fi(e,t,n,i,s,r,o,a){const[u,l,f]=o,[p,T,_]=a,I=s||u!==p&&k(u)&&k(p);if(!I){const Q=l.name.value,z=T.name.value;if(Q!==z)return[[r,`"${Q}" and "${z}" are different fields`],[l],[T]];if(!ar(l,T))return[[r,"they have differing arguments"],[l],[T]]}const w=f?.type,C=_?.type;if(w&&C&&Dt(w,C))return[[r,`they return conflicting types "${v(w)}" and "${v(C)}"`],[l],[T]];const G=l.selectionSet,Ie=T.selectionSet;if(G&&Ie){const Q=rr(e,t,n,i,I,H(w),G,H(C),Ie);return cr(Q,r,l,T)}}function ar(e,t){const n=e.arguments,i=t.arguments;if(n===void 0||n.length===0)return i===void 0||i.length===0;if(i===void 0||i.length===0||n.length!==i.length)return!1;const s=new Map(i.map(({name:r,value:o})=>[r.value,o]));return n.every(r=>{const o=r.value,a=s.get(r.name.value);return a===void 0?!1:vn(o)===vn(a)})}function vn(e){return F(Gt(e))}function Dt(e,t){return B(e)?B(t)?Dt(e.ofType,t.ofType):!0:B(t)?!0:D(e)?D(t)?Dt(e.ofType,t.ofType):!0:D(t)?!0:be(e)||be(t)?e!==t:!1}function rt(e,t,n,i){const s=t.get(i);if(s)return s;const r=Object.create(null),o=Object.create(null);pi(e,n,i,r,o);const a=[r,Object.keys(o)];return t.set(i,a),a}function At(e,t,n){const i=t.get(n.selectionSet);if(i)return i;const s=K(e.getSchema(),n.typeCondition);return rt(e,t,s,n.selectionSet)}function pi(e,t,n,i,s){for(const r of n.selections)switch(r.kind){case c.FIELD:{const o=r.name.value;let a;(k(t)||x(t))&&(a=t.getFields()[o]);const u=r.alias?r.alias.value:o;i[u]||(i[u]=[]),i[u].push([t,r,a]);break}case c.FRAGMENT_SPREAD:s[r.name.value]=!0;break;case c.INLINE_FRAGMENT:{const o=r.typeCondition,a=o?K(e.getSchema(),o):t;pi(e,a,r.selectionSet,i,s);break}}}function cr(e,t,n,i){if(e.length>0)return[[t,e.map(([s])=>s)],[n,...e.map(([,s])=>s).flat()],[i,...e.map(([,,s])=>s).flat()]]}class di{constructor(){this._data=new Map}has(t,n,i){var s;const r=(s=this._data.get(t))===null||s===void 0?void 0:s.get(n);return r===void 0?!1:i?!0:i===r}add(t,n,i){const s=this._data.get(t);s===void 0?this._data.set(t,new Map([[n,i]])):s.set(n,i)}}class ur{constructor(){this._orderedPairSet=new di}has(t,n,i){return t<n?this._orderedPairSet.has(t,n,i):this._orderedPairSet.has(n,t,i)}add(t,n,i){t<n?this._orderedPairSet.add(t,n,i):this._orderedPairSet.add(n,t,i)}}function lr(e){return{InlineFragment(t){const n=e.getType(),i=e.getParentType();if(ve(n)&&ve(i)&&!cn(e.getSchema(),n,i)){const s=v(i),r=v(n);e.reportError(new m(`Fragment cannot be spread here as objects of type "${s}" can never be of type "${r}".`,{nodes:t}))}},FragmentSpread(t){const n=t.name.value,i=fr(e,n),s=e.getParentType();if(i&&s&&!cn(e.getSchema(),i,s)){const r=v(s),o=v(i);e.reportError(new m(`Fragment "${n}" cannot be spread here as objects of type "${r}" can never be of type "${o}".`,{nodes:t}))}}}}function fr(e,t){const n=e.getFragment(t);if(n){const i=K(e.getSchema(),n.typeCondition);if(ve(i))return i}}function pr(e){const t=e.getSchema(),n=Object.create(null);for(const s of e.getDocument().definitions)Qe(s)&&(n[s.name.value]=s);return{ScalarTypeExtension:i,ObjectTypeExtension:i,InterfaceTypeExtension:i,UnionTypeExtension:i,EnumTypeExtension:i,InputObjectTypeExtension:i};function i(s){const r=s.name.value,o=n[r],a=t?.getType(r);let u;if(o?u=dr[o.kind]:a&&(u=hr(a)),u){if(u!==s.kind){const l=mr(s.kind);e.reportError(new m(`Cannot extend non-${l} type "${r}".`,{nodes:o?[o,s]:s}))}}else{const l=Object.keys({...n,...t?.getTypeMap()}),f=Ne(r,l);e.reportError(new m(`Cannot extend type "${r}" because it is not defined.`+fe(f),{nodes:s.name}))}}}const dr={[c.SCALAR_TYPE_DEFINITION]:c.SCALAR_TYPE_EXTENSION,[c.OBJECT_TYPE_DEFINITION]:c.OBJECT_TYPE_EXTENSION,[c.INTERFACE_TYPE_DEFINITION]:c.INTERFACE_TYPE_EXTENSION,[c.UNION_TYPE_DEFINITION]:c.UNION_TYPE_EXTENSION,[c.ENUM_TYPE_DEFINITION]:c.ENUM_TYPE_EXTENSION,[c.INPUT_OBJECT_TYPE_DEFINITION]:c.INPUT_OBJECT_TYPE_EXTENSION};function hr(e){if(de(e))return c.SCALAR_TYPE_EXTENSION;if(k(e))return c.OBJECT_TYPE_EXTENSION;if(x(e))return c.INTERFACE_TYPE_EXTENSION;if(Z(e))return c.UNION_TYPE_EXTENSION;if(X(e))return c.ENUM_TYPE_EXTENSION;if(U(e))return c.INPUT_OBJECT_TYPE_EXTENSION;Y(!1,"Unexpected type: "+v(e))}function mr(e){switch(e){case c.SCALAR_TYPE_EXTENSION:return"scalar";case c.OBJECT_TYPE_EXTENSION:return"object";case c.INTERFACE_TYPE_EXTENSION:return"interface";case c.UNION_TYPE_EXTENSION:return"union";case c.ENUM_TYPE_EXTENSION:return"enum";case c.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:Y(!1,"Unexpected kind: "+v(e))}}function Tr(e){return{...hi(e),Field:{leave(t){var n;const i=e.getFieldDef();if(!i)return!1;const s=new Set((n=t.arguments)===null||n===void 0?void 0:n.map(r=>r.name.value));for(const r of i.args)if(!s.has(r.name)&&Ge(r)){const o=v(r.type);e.reportError(new m(`Field "${i.name}" argument "${r.name}" of type "${o}" is required, but it was not provided.`,{nodes:t}))}}}}}function hi(e){var t;const n=Object.create(null),i=e.getSchema(),s=(t=i?.getDirectives())!==null&&t!==void 0?t:De;for(const a of s)n[a.name]=_e(a.args.filter(Ge),u=>u.name);const r=e.getDocument().definitions;for(const a of r)if(a.kind===c.DIRECTIVE_DEFINITION){var o;const u=(o=a.arguments)!==null&&o!==void 0?o:[];n[a.name.value]=_e(u.filter(vr),l=>l.name.value)}return{Directive:{leave(a){const u=a.name.value,l=n[u];if(l){var f;const p=(f=a.arguments)!==null&&f!==void 0?f:[],T=new Set(p.map(_=>_.name.value));for(const[_,I]of Object.entries(l))if(!T.has(_)){const w=Ft(I.type)?v(I.type):F(I.type);e.reportError(new m(`Directive "@${u}" argument "${_}" of type "${w}" is required, but it was not provided.`,{nodes:a}))}}}}}}function vr(e){return e.type.kind===c.NON_NULL_TYPE&&e.defaultValue==null}function yr(e){return{Field(t){const n=e.getType(),i=t.selectionSet;if(n)if(be(H(n))){if(i){const s=t.name.value,r=v(n);e.reportError(new m(`Field "${s}" must not have a selection since type "${r}" has no subfields.`,{nodes:i}))}}else if(i){if(i.selections.length===0){const s=t.name.value,r=v(n);e.reportError(new m(`Field "${s}" of type "${r}" must have at least one field selected.`,{nodes:t}))}}else{const s=t.name.value,r=v(n);e.reportError(new m(`Field "${s}" of type "${r}" must have a selection of subfields. Did you mean "${s} { ... }"?`,{nodes:t}))}}}}function mi(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}function yn(e,t,n){return{prev:e,key:t,typename:n}}function ue(e){const t=[];let n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function Er(e,t,n=Nr){return Ue(e,t,n,void 0)}function Nr(e,t,n){let i="Invalid value "+v(t);throw e.length>0&&(i+=` at "value${mi(e)}"`),n.message=i+": "+n.message,n}function Ue(e,t,n,i){if(D(t)){if(e!=null)return Ue(e,t.ofType,n,i);n(ue(i),e,new m(`Expected non-nullable type "${v(t)}" not to be null.`));return}if(e==null)return null;if(B(t)){const s=t.ofType;return Zn(e)?Array.from(e,(r,o)=>{const a=yn(i,o,void 0);return Ue(r,s,n,a)}):[Ue(e,s,n,i)]}if(U(t)){if(!Te(e)||Array.isArray(e)){n(ue(i),e,new m(`Expected type "${t.name}" to be an object.`));return}const s={},r=t.getFields();for(const o of Object.values(r)){const a=e[o.name];if(a===void 0){if(o.defaultValue!==void 0)s[o.name]=o.defaultValue;else if(D(o.type)){const u=v(o.type);n(ue(i),e,new m(`Field "${o.name}" of required type "${u}" was not provided.`))}continue}s[o.name]=Ue(a,o.type,n,yn(i,o.name,t.name))}for(const o of Object.keys(e))if(!r[o]){const a=Ne(o,Object.keys(t.getFields()));n(ue(i),e,new m(`Field "${o}" is not defined by type "${t.name}".`+fe(a)))}if(t.isOneOf){const o=Object.keys(s);o.length!==1&&n(ue(i),e,new m(`Exactly one key must be specified for OneOf type "${t.name}".`));const a=o[0],u=s[a];u===null&&n(ue(i).concat(a),u,new m(`Field "${a}" must be non-null.`))}return s}if(be(t)){let s;try{s=t.parseValue(e)}catch(r){r instanceof m?n(ue(i),e,r):n(ue(i),e,new m(`Expected type "${t.name}". `+r.message,{originalError:r}));return}return s===void 0&&n(ue(i),e,new m(`Expected type "${t.name}".`)),s}Y(!1,"Unexpected input type: "+v(t))}function he(e,t,n){if(e){if(e.kind===c.VARIABLE){const i=e.name.value;if(n==null||n[i]===void 0)return;const s=n[i];return s===null&&D(t)?void 0:s}if(D(t))return e.kind===c.NULL?void 0:he(e,t.ofType,n);if(e.kind===c.NULL)return null;if(B(t)){const i=t.ofType;if(e.kind===c.LIST){const r=[];for(const o of e.values)if(En(o,n)){if(D(i))return;r.push(null)}else{const a=he(o,i,n);if(a===void 0)return;r.push(a)}return r}const s=he(e,i,n);return s===void 0?void 0:[s]}if(U(t)){if(e.kind!==c.OBJECT)return;const i=Object.create(null),s=_e(e.fields,r=>r.name.value);for(const r of Object.values(t.getFields())){const o=s[r.name];if(!o||En(o.value,n)){if(r.defaultValue!==void 0)i[r.name]=r.defaultValue;else if(D(r.type))return;continue}const a=he(o.value,r.type,n);if(a===void 0)return;i[r.name]=a}if(t.isOneOf){const r=Object.keys(i);if(r.length!==1||i[r[0]]===null)return}return i}if(be(t)){let i;try{i=t.parseLiteral(e,n)}catch{return}return i===void 0?void 0:i}Y(!1,"Unexpected input type: "+v(t))}}function En(e,t){return e.kind===c.VARIABLE&&(t==null||t[e.name.value]===void 0)}function To(e,t,n,i){const s=[];try{const o=Ir(e,t,n,a=>{s.push(a)});if(s.length===0)return{coerced:o}}catch(o){s.push(o)}return{errors:s}}function Ir(e,t,n,i){const s={};for(const r of t){const o=r.variable.name.value,a=K(e,r.type);if(!re(a)){const l=F(r.type);i(new m(`Variable "$${o}" expected value of type "${l}" which cannot be used as an input type.`,{nodes:r.type}));continue}if(!Ti(n,o)){if(r.defaultValue)s[o]=he(r.defaultValue,a);else if(D(a)){const l=v(a);i(new m(`Variable "$${o}" of required type "${l}" was not provided.`,{nodes:r}))}continue}const u=n[o];if(u===null&&D(a)){const l=v(a);i(new m(`Variable "$${o}" of non-null type "${l}" must not be null.`,{nodes:r}));continue}s[o]=Er(u,a,(l,f,p)=>{let T=`Variable "$${o}" got invalid value `+v(f);l.length>0&&(T+=` at "${o}${mi(l)}"`),i(new m(T+"; "+p.message,{nodes:r,originalError:p}))})}return s}function gr(e,t,n){var i;const s={},r=(i=t.arguments)!==null&&i!==void 0?i:[],o=_e(r,a=>a.name.value);for(const a of e.args){const u=a.name,l=a.type,f=o[u];if(!f){if(a.defaultValue!==void 0)s[u]=a.defaultValue;else if(D(l))throw new m(`Argument "${u}" of required type "${v(l)}" was not provided.`,{nodes:t});continue}const p=f.value;let T=p.kind===c.NULL;if(p.kind===c.VARIABLE){const I=p.name.value;if(n==null||!Ti(n,I)){if(a.defaultValue!==void 0)s[u]=a.defaultValue;else if(D(l))throw new m(`Argument "${u}" of required type "${v(l)}" was provided the variable "$${I}" which was not provided a runtime value.`,{nodes:p});continue}T=n[I]==null}if(T&&D(l))throw new m(`Argument "${u}" of non-null type "${v(l)}" must not be null.`,{nodes:p});const _=he(p,l,n);if(_===void 0)throw new m(`Argument "${u}" has invalid value ${F(p)}.`,{nodes:p});s[u]=_}return s}function Be(e,t,n){var i;const s=(i=t.directives)===null||i===void 0?void 0:i.find(r=>r.name.value===e.name);if(s)return gr(e,s,n)}function Ti(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Or(e,t,n,i,s){const r=new Map;return wt(e,t,n,i,s,r,new Set),r}function wt(e,t,n,i,s,r,o){for(const a of s.selections)switch(a.kind){case c.FIELD:{if(!vt(n,a))continue;const u=_r(a),l=r.get(u);l!==void 0?l.push(a):r.set(u,[a]);break}case c.INLINE_FRAGMENT:{if(!vt(n,a)||!Nn(e,a,i))continue;wt(e,t,n,i,a.selectionSet,r,o);break}case c.FRAGMENT_SPREAD:{const u=a.name.value;if(o.has(u)||!vt(n,a))continue;o.add(u);const l=t[u];if(!l||!Nn(e,l,i))continue;wt(e,t,n,i,l.selectionSet,r,o);break}}}function vt(e,t){const n=Be(Xn,t,e);if(n?.if===!0)return!1;const i=Be(qn,t,e);return i?.if!==!1}function Nn(e,t,n){const i=t.typeCondition;if(!i)return!0;const s=K(e,i);return s===n?!0:me(s)?e.isSubType(s,n):!1}function _r(e){return e.alias?e.alias.value:e.name.value}function br(e){return{OperationDefinition(t){if(t.operation==="subscription"){const n=e.getSchema(),i=n.getSubscriptionType();if(i){const s=t.name?t.name.value:null,r=Object.create(null),o=e.getDocument(),a=Object.create(null);for(const l of o.definitions)l.kind===c.FRAGMENT_DEFINITION&&(a[l.name.value]=l);const u=Or(n,a,r,i,t.selectionSet);if(u.size>1){const p=[...u.values()].slice(1).flat();e.reportError(new m(s!=null?`Subscription "${s}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:p}))}for(const l of u.values())l[0].name.value.startsWith("__")&&e.reportError(new m(s!=null?`Subscription "${s}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:l}))}}}}}function Qt(e,t){const n=new Map;for(const i of e){const s=t(i),r=n.get(s);r===void 0?n.set(s,[i]):r.push(i)}return n}function Sr(e){return{DirectiveDefinition(i){var s;const r=(s=i.arguments)!==null&&s!==void 0?s:[];return n(`@${i.name.value}`,r)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(i){var s;const r=i.name.value,o=(s=i.fields)!==null&&s!==void 0?s:[];for(const u of o){var a;const l=u.name.value,f=(a=u.arguments)!==null&&a!==void 0?a:[];n(`${r}.${l}`,f)}return!1}function n(i,s){const r=Qt(s,o=>o.name.value);for(const[o,a]of r)a.length>1&&e.reportError(new m(`Argument "${i}(${o}:)" can only be defined once.`,{nodes:a.map(u=>u.name)}));return!1}}function vi(e){return{Field:t,Directive:t};function t(n){var i;const s=(i=n.arguments)!==null&&i!==void 0?i:[],r=Qt(s,o=>o.name.value);for(const[o,a]of r)a.length>1&&e.reportError(new m(`There can be only one argument named "${o}".`,{nodes:a.map(u=>u.name)}))}}function Dr(e){const t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(i){const s=i.name.value;if(n!=null&&n.getDirective(s)){e.reportError(new m(`Directive "@${s}" already exists in the schema. It cannot be redefined.`,{nodes:i.name}));return}return t[s]?e.reportError(new m(`There can be only one directive named "@${s}".`,{nodes:[t[s],i.name]})):t[s]=i.name,!1}}}function yi(e){const t=Object.create(null),n=e.getSchema(),i=n?n.getDirectives():De;for(const a of i)t[a.name]=!a.isRepeatable;const s=e.getDocument().definitions;for(const a of s)a.kind===c.DIRECTIVE_DEFINITION&&(t[a.name.value]=!a.repeatable);const r=Object.create(null),o=Object.create(null);return{enter(a){if(!("directives"in a)||!a.directives)return;let u;if(a.kind===c.SCHEMA_DEFINITION||a.kind===c.SCHEMA_EXTENSION)u=r;else if(Qe(a)||Bt(a)){const l=a.name.value;u=o[l],u===void 0&&(o[l]=u=Object.create(null))}else u=Object.create(null);for(const l of a.directives){const f=l.name.value;t[f]&&(u[f]?e.reportError(new m(`The directive "@${f}" can only be used once at this location.`,{nodes:[u[f],l]})):u[f]=l)}}}}function Ar(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),i=Object.create(null);return{EnumTypeDefinition:s,EnumTypeExtension:s};function s(r){var o;const a=r.name.value;i[a]||(i[a]=Object.create(null));const u=(o=r.values)!==null&&o!==void 0?o:[],l=i[a];for(const f of u){const p=f.name.value,T=n[a];X(T)&&T.getValue(p)?e.reportError(new m(`Enum value "${a}.${p}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:f.name})):l[p]?e.reportError(new m(`Enum value "${a}.${p}" can only be defined once.`,{nodes:[l[p],f.name]})):l[p]=f.name}return!1}}function wr(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),i=Object.create(null);return{InputObjectTypeDefinition:s,InputObjectTypeExtension:s,InterfaceTypeDefinition:s,InterfaceTypeExtension:s,ObjectTypeDefinition:s,ObjectTypeExtension:s};function s(r){var o;const a=r.name.value;i[a]||(i[a]=Object.create(null));const u=(o=r.fields)!==null&&o!==void 0?o:[],l=i[a];for(const f of u){const p=f.name.value;Rr(n[a],p)?e.reportError(new m(`Field "${a}.${p}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:f.name})):l[p]?e.reportError(new m(`Field "${a}.${p}" can only be defined once.`,{nodes:[l[p],f.name]})):l[p]=f.name}return!1}}function Rr(e,t){return k(e)||x(e)||U(e)?e.getFields()[t]!=null:!1}function kr(e){const t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){const i=n.name.value;return t[i]?e.reportError(new m(`There can be only one fragment named "${i}".`,{nodes:[t[i],n.name]})):t[i]=n.name,!1}}}function Ei(e){const t=[];let n=Object.create(null);return{ObjectValue:{enter(){t.push(n),n=Object.create(null)},leave(){const i=t.pop();i||Y(!1),n=i}},ObjectField(i){const s=i.name.value;n[s]?e.reportError(new m(`There can be only one input field named "${s}".`,{nodes:[n[s],i.name]})):n[s]=i.name}}}function Lr(e){const t=Object.create(null);return{OperationDefinition(n){const i=n.name;return i&&(t[i.value]?e.reportError(new m(`There can be only one operation named "${i.value}".`,{nodes:[t[i.value],i]})):t[i.value]=i),!1},FragmentDefinition:()=>!1}}function xr(e){const t=e.getSchema(),n=Object.create(null),i=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:s,SchemaExtension:s};function s(r){var o;const a=(o=r.operationTypes)!==null&&o!==void 0?o:[];for(const u of a){const l=u.operation,f=n[l];i[l]?e.reportError(new m(`Type for ${l} already defined in the schema. It cannot be redefined.`,{nodes:u})):f?e.reportError(new m(`There can be only one ${l} type in schema.`,{nodes:[f,u]})):n[l]=u}return!1}}function Fr(e){const t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:i,ObjectTypeDefinition:i,InterfaceTypeDefinition:i,UnionTypeDefinition:i,EnumTypeDefinition:i,InputObjectTypeDefinition:i};function i(s){const r=s.name.value;if(n!=null&&n.getType(r)){e.reportError(new m(`Type "${r}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:s.name}));return}return t[r]?e.reportError(new m(`There can be only one type named "${r}".`,{nodes:[t[r],s.name]})):t[r]=s.name,!1}}function Cr(e){return{OperationDefinition(t){var n;const i=(n=t.variableDefinitions)!==null&&n!==void 0?n:[],s=Qt(i,r=>r.variable.name.value);for(const[r,o]of s)o.length>1&&e.reportError(new m(`There can be only one variable named "$${r}".`,{nodes:o.map(a=>a.variable.name)}))}}}function $r(e){let t={};return{OperationDefinition:{enter(){t={}}},VariableDefinition(n){t[n.variable.name.value]=n},ListValue(n){const i=Cn(e.getParentInputType());if(!B(i))return ge(e,n),!1},ObjectValue(n){const i=H(e.getInputType());if(!U(i))return ge(e,n),!1;const s=_e(n.fields,r=>r.name.value);for(const r of Object.values(i.getFields()))if(!s[r.name]&&Gn(r)){const a=v(r.type);e.reportError(new m(`Field "${i.name}.${r.name}" of required type "${a}" was not provided.`,{nodes:n}))}i.isOneOf&&Ur(e,n,i,s)},ObjectField(n){const i=H(e.getParentInputType());if(!e.getInputType()&&U(i)){const r=Ne(n.name.value,Object.keys(i.getFields()));e.reportError(new m(`Field "${n.name.value}" is not defined by type "${i.name}".`+fe(r),{nodes:n}))}},NullValue(n){const i=e.getInputType();D(i)&&e.reportError(new m(`Expected value of type "${v(i)}", found ${F(n)}.`,{nodes:n}))},EnumValue:n=>ge(e,n),IntValue:n=>ge(e,n),FloatValue:n=>ge(e,n),StringValue:n=>ge(e,n),BooleanValue:n=>ge(e,n)}}function ge(e,t){const n=e.getInputType();if(!n)return;const i=H(n);if(!be(i)){const s=v(n);e.reportError(new m(`Expected value of type "${s}", found ${F(t)}.`,{nodes:t}));return}try{if(i.parseLiteral(t,void 0)===void 0){const r=v(n);e.reportError(new m(`Expected value of type "${r}", found ${F(t)}.`,{nodes:t}))}}catch(s){const r=v(n);s instanceof m?e.reportError(s):e.reportError(new m(`Expected value of type "${r}", found ${F(t)}; `+s.message,{nodes:t,originalError:s}))}}function Ur(e,t,n,i){var s;const r=Object.keys(i);if(r.length!==1){e.reportError(new m(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[t]}));return}const a=(s=i[r[0]])===null||s===void 0?void 0:s.value;(!a||a.kind===c.NULL)&&e.reportError(new m(`Field "${n.name}.${r[0]}" must be non-null.`,{nodes:[t]}))}function Mr(e){return{VariableDefinition(t){const n=K(e.getSchema(),t.type);if(n!==void 0&&!re(n)){const i=t.variable.name.value,s=F(t.type);e.reportError(new m(`Variable "$${i}" cannot be non-input type "${s}".`,{nodes:t.type}))}}}}function Vr(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){const i=e.getRecursiveVariableUsages(n);for(const{node:s,type:r,defaultValue:o,parentType:a}of i){const u=s.name.value,l=t[u];if(l&&r){const f=e.getSchema(),p=K(f,l.type);if(p&&!jr(f,p,l.defaultValue,r,o)){const T=v(p),_=v(r);e.reportError(new m(`Variable "$${u}" of type "${T}" used in position expecting type "${_}".`,{nodes:[l,s]}))}U(a)&&a.isOneOf&&Fn(p)&&e.reportError(new m(`Variable "$${u}" is of type "${p}" but must be non-nullable to be used for OneOf Input Object "${a}".`,{nodes:[l,s]}))}}}},VariableDefinition(n){t[n.variable.name.value]=n}}}function jr(e,t,n,i,s){if(D(i)&&!D(t)){if(!(n!=null&&n.kind!==c.NULL)&&!(s!==void 0))return!1;const a=i.ofType;return ke(e,t,a)}return ke(e,t,i)}const Pr=Object.freeze([Ws]),Br=Object.freeze([Ms,Lr,Xs,br,ui,Bs,Mr,yr,Vs,kr,Js,er,lr,Zs,Cr,Ks,tr,ci,yi,Gs,vi,$r,Tr,Vr,ir,Ei,...Pr]),Gr=Object.freeze([zs,xr,Fr,Ar,wr,Sr,Dr,ui,ci,yi,pr,ai,vi,Ei,hi]);class Ni{constructor(t,n){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(const i of this.getDocument().definitions)i.kind===c.FRAGMENT_DEFINITION&&(n[i.name.value]=i);this._fragments=n}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];const i=[t];let s;for(;s=i.pop();)for(const r of s.selections)r.kind===c.FRAGMENT_SPREAD?n.push(r):r.selectionSet&&i.push(r.selectionSet);this._fragmentSpreads.set(t,n)}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];const i=Object.create(null),s=[t.selectionSet];let r;for(;r=s.pop();)for(const o of this.getFragmentSpreads(r)){const a=o.name.value;if(i[a]!==!0){i[a]=!0;const u=this.getFragment(a);u&&(n.push(u),s.push(u.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}}class Yr extends Ni{constructor(t,n,i){super(t,i),this._schema=n}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class Qr extends Ni{constructor(t,n,i,s){super(n,s),this._schema=t,this._typeInfo=i,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(t){let n=this._variableUsages.get(t);if(!n){const i=[],s=new ri(this._schema);ct(t,oi(s,{VariableDefinition:()=>!1,Variable(r){i.push({node:r,type:s.getInputType(),defaultValue:s.getDefaultValue(),parentType:s.getParentInputType()})}})),n=i,this._variableUsages.set(t,n)}return n}getRecursiveVariableUsages(t){let n=this._recursiveVariableUsages.get(t);if(!n){n=this.getVariableUsages(t);for(const i of this.getRecursivelyReferencedFragments(t))n=n.concat(this.getVariableUsages(i));this._recursiveVariableUsages.set(t,n)}return n}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}function vo(e,t,n=Br,i,s=new ri(e)){var r;const o=(r=void 0)!==null&&r!==void 0?r:100;t||A(!1,"Must provide document."),gs(e);const a=Object.freeze({}),u=[],l=new Qr(e,t,s,p=>{if(u.length>=o)throw u.push(new m("Too many validation errors, error limit reached. Validation aborted.")),a;u.push(p)}),f=xn(n.map(p=>p(l)));try{ct(t,oi(s,f))}catch(p){if(p!==a)throw p}return u}function Jr(e,t,n=Gr){const i=[],s=new Yr(e,t,o=>{i.push(o)}),r=n.map(o=>o(s));return ct(e,xn(r)),i}function qr(e){const t=Jr(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(`
|
|
60
60
|
|
|
61
|
-
`))}function
|
|
61
|
+
`))}function Xr(e){return e instanceof Error?e:new zr(e)}class zr extends Error{constructor(t){super("Unexpected error value: "+v(t)),this.name="NonErrorThrown",this.thrownValue=t}}function yo(e,t,n){var i;const s=Xr(e);return Hr(s)?s:new m(s.message,{nodes:(i=s.nodes)!==null&&i!==void 0?i:t,source:s.source,positions:s.positions,path:n,originalError:s})}function Hr(e){return Array.isArray(e.path)}function Eo(e){return{Field(t){const n=e.getFieldDef(),i=n?.deprecationReason;if(n&&i!=null){const s=e.getParentType();s!=null||Y(!1),e.reportError(new m(`The field ${s.name}.${n.name} is deprecated. ${i}`,{nodes:t}))}},Argument(t){const n=e.getArgument(),i=n?.deprecationReason;if(n&&i!=null){const s=e.getDirective();if(s!=null)e.reportError(new m(`Directive "@${s.name}" argument "${n.name}" is deprecated. ${i}`,{nodes:t}));else{const r=e.getParentType(),o=e.getFieldDef();r!=null&&o!=null||Y(!1),e.reportError(new m(`Field "${r.name}.${o.name}" argument "${n.name}" is deprecated. ${i}`,{nodes:t}))}}},ObjectField(t){const n=H(e.getParentInputType());if(U(n)){const i=n.getFields()[t.name.value],s=i?.deprecationReason;s!=null&&e.reportError(new m(`The input field ${n.name}.${i.name} is deprecated. ${s}`,{nodes:t}))}},EnumValue(t){const n=e.getEnumValue(),i=n?.deprecationReason;if(n&&i!=null){const s=H(e.getInputType());s!=null||Y(!1),e.reportError(new m(`The enum value "${s.name}.${n.name}" is deprecated. ${i}`,{nodes:t}))}}}}function No(e,t){let n=null;for(const i of e.definitions)if(i.kind===c.OPERATION_DEFINITION){if(n)return null;n=i}return n}function Wr(e,t,n){var i,s,r,o;const a=[],u=Object.create(null),l=[];let f;const p=[];for(const d of t.definitions)if(d.kind===c.SCHEMA_DEFINITION)f=d;else if(d.kind===c.SCHEMA_EXTENSION)p.push(d);else if(Qe(d))a.push(d);else if(Bt(d)){const N=d.name.value,y=u[N];u[N]=y?y.concat([d]):[d]}else d.kind===c.DIRECTIVE_DEFINITION&&l.push(d);if(Object.keys(u).length===0&&a.length===0&&l.length===0&&p.length===0&&f==null)return e;const T=Object.create(null);for(const d of e.types)T[d.name]=Ie(d);for(const d of a){var _;const N=d.name.value;T[N]=(_=In[N])!==null&&_!==void 0?_:Si(d)}const I={query:e.query&&C(e.query),mutation:e.mutation&&C(e.mutation),subscription:e.subscription&&C(e.subscription),...f&&Ht([f]),...Ht(p)};return{description:(i=f)===null||i===void 0||(s=i.description)===null||s===void 0?void 0:s.value,...I,types:Object.values(T),directives:[...e.directives.map(G),...l.map(bi)],extensions:Object.create(null),astNode:(r=f)!==null&&r!==void 0?r:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(p),assumeValid:(o=n?.assumeValid)!==null&&o!==void 0?o:!1};function w(d){return B(d)?new q(w(d.ofType)):D(d)?new S(w(d.ofType)):C(d)}function C(d){return T[d.name]}function G(d){const N=d.toConfig();return new Ee({...N,args:le(N.args,zt)})}function Ie(d){if(jt(d)||Qn(d))return d;if(de(d))return xe(d);if(k(d))return Je(d);if(x(d))return qe(d);if(Z(d))return _i(d);if(X(d))return z(d);if(U(d))return Q(d);Y(!1,"Unexpected type: "+v(d))}function Q(d){var N;const y=d.toConfig(),g=(N=u[y.name])!==null&&N!==void 0?N:[];return new bt({...y,fields:()=>({...le(y.fields,R=>({...R,type:w(R.type)})),...Zt(g)}),extensionASTNodes:y.extensionASTNodes.concat(g)})}function z(d){var N;const y=d.toConfig(),g=(N=u[d.name])!==null&&N!==void 0?N:[];return new Pe({...y,values:{...y.values,...Kt(g)},extensionASTNodes:y.extensionASTNodes.concat(g)})}function xe(d){var N;const y=d.toConfig(),g=(N=u[y.name])!==null&&N!==void 0?N:[];let R=y.specifiedByURL;for(const L of g){var V;R=(V=gn(L))!==null&&V!==void 0?V:R}return new ye({...y,specifiedByURL:R,extensionASTNodes:y.extensionASTNodes.concat(g)})}function Je(d){var N;const y=d.toConfig(),g=(N=u[y.name])!==null&&N!==void 0?N:[];return new pe({...y,interfaces:()=>[...d.getInterfaces().map(C),...He(g)],fields:()=>({...le(y.fields,Xt),...ze(g)}),extensionASTNodes:y.extensionASTNodes.concat(g)})}function qe(d){var N;const y=d.toConfig(),g=(N=u[y.name])!==null&&N!==void 0?N:[];return new Ot({...y,interfaces:()=>[...d.getInterfaces().map(C),...He(g)],fields:()=>({...le(y.fields,Xt),...ze(g)}),extensionASTNodes:y.extensionASTNodes.concat(g)})}function _i(d){var N;const y=d.toConfig(),g=(N=u[y.name])!==null&&N!==void 0?N:[];return new _t({...y,types:()=>[...d.getTypes().map(C),...en(g)],extensionASTNodes:y.extensionASTNodes.concat(g)})}function Xt(d){return{...d,type:w(d.type),args:d.args&&le(d.args,zt)}}function zt(d){return{...d,type:w(d.type)}}function Ht(d){const N={};for(const g of d){var y;const R=(y=g.operationTypes)!==null&&y!==void 0?y:[];for(const V of R)N[V.operation]=Xe(V.type)}return N}function Xe(d){var N;const y=d.name.value,g=(N=In[y])!==null&&N!==void 0?N:T[y];if(g===void 0)throw new Error(`Unknown type: "${y}".`);return g}function Fe(d){return d.kind===c.LIST_TYPE?new q(Fe(d.type)):d.kind===c.NON_NULL_TYPE?new S(Fe(d.type)):Xe(d)}function bi(d){var N;return new Ee({name:d.name.value,description:(N=d.description)===null||N===void 0?void 0:N.value,locations:d.locations.map(({value:y})=>y),isRepeatable:d.repeatable,args:Wt(d.arguments),astNode:d})}function ze(d){const N=Object.create(null);for(const R of d){var y;const V=(y=R.fields)!==null&&y!==void 0?y:[];for(const L of V){var g;N[L.name.value]={type:Fe(L.type),description:(g=L.description)===null||g===void 0?void 0:g.value,args:Wt(L.arguments),deprecationReason:et(L),astNode:L}}}return N}function Wt(d){const N=d??[],y=Object.create(null);for(const R of N){var g;const V=Fe(R.type);y[R.name.value]={type:V,description:(g=R.description)===null||g===void 0?void 0:g.value,defaultValue:he(R.defaultValue,V),deprecationReason:et(R),astNode:R}}return y}function Zt(d){const N=Object.create(null);for(const R of d){var y;const V=(y=R.fields)!==null&&y!==void 0?y:[];for(const L of V){var g;const Ae=Fe(L.type);N[L.name.value]={type:Ae,description:(g=L.description)===null||g===void 0?void 0:g.value,defaultValue:he(L.defaultValue,Ae),deprecationReason:et(L),astNode:L}}}return N}function Kt(d){const N=Object.create(null);for(const R of d){var y;const V=(y=R.values)!==null&&y!==void 0?y:[];for(const L of V){var g;N[L.name.value]={description:(g=L.description)===null||g===void 0?void 0:g.value,deprecationReason:et(L),astNode:L}}}return N}function He(d){return d.flatMap(N=>{var y,g;return(y=(g=N.interfaces)===null||g===void 0?void 0:g.map(Xe))!==null&&y!==void 0?y:[]})}function en(d){return d.flatMap(N=>{var y,g;return(y=(g=N.types)===null||g===void 0?void 0:g.map(Xe))!==null&&y!==void 0?y:[]})}function Si(d){var N;const y=d.name.value,g=(N=u[y])!==null&&N!==void 0?N:[];switch(d.kind){case c.OBJECT_TYPE_DEFINITION:{var R;const ne=[d,...g];return new pe({name:y,description:(R=d.description)===null||R===void 0?void 0:R.value,interfaces:()=>He(ne),fields:()=>ze(ne),astNode:d,extensionASTNodes:g})}case c.INTERFACE_TYPE_DEFINITION:{var V;const ne=[d,...g];return new Ot({name:y,description:(V=d.description)===null||V===void 0?void 0:V.value,interfaces:()=>He(ne),fields:()=>ze(ne),astNode:d,extensionASTNodes:g})}case c.ENUM_TYPE_DEFINITION:{var L;const ne=[d,...g];return new Pe({name:y,description:(L=d.description)===null||L===void 0?void 0:L.value,values:Kt(ne),astNode:d,extensionASTNodes:g})}case c.UNION_TYPE_DEFINITION:{var Ae;const ne=[d,...g];return new _t({name:y,description:(Ae=d.description)===null||Ae===void 0?void 0:Ae.value,types:()=>en(ne),astNode:d,extensionASTNodes:g})}case c.SCALAR_TYPE_DEFINITION:{var lt;return new ye({name:y,description:(lt=d.description)===null||lt===void 0?void 0:lt.value,specifiedByURL:gn(d),astNode:d,extensionASTNodes:g})}case c.INPUT_OBJECT_TYPE_DEFINITION:{var ft;const ne=[d,...g];return new bt({name:y,description:(ft=d.description)===null||ft===void 0?void 0:ft.value,fields:()=>Zt(ne),astNode:d,extensionASTNodes:g,isOneOf:Zr(d)})}}}}const In=_e([...$t,...Vt],e=>e.name);function et(e){const t=Be(Ut,e);return t?.reason}function gn(e){const t=Be(Hn,e);return t?.url}function Zr(e){return!!Be(Wn,e)}function Kr(e,t){e!=null&&e.kind===c.DOCUMENT||A(!1,"Must provide valid Document AST."),t?.assumeValid!==!0&&t?.assumeValidSDL!==!0&&qr(e);const i=Wr({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(i.astNode==null)for(const r of i.types)switch(r.name){case"Query":i.query=r;break;case"Mutation":i.mutation=r;break;case"Subscription":i.subscription=r;break}const s=[...i.directives,...De.filter(r=>i.directives.every(o=>o.name!==r.name))];return new si({...i,directives:s})}function Io(e,t){const n=ts(e,{noLocation:void 0,allowLegacyFragmentVariables:void 0});return Kr(n,{assumeValidSDL:void 0,assumeValid:void 0})}function go(e){return to(e,t=>!ys(t),eo)}function eo(e){return!Qn(e)&&!jt(e)}function to(e,t,n){const i=e.getDirectives().filter(t),s=Object.values(e.getTypeMap()).filter(n);return[no(e),...i.map(r=>fo(r)),...s.map(r=>so(r))].filter(Boolean).join(`
|
|
62
62
|
|
|
63
|
-
`)}function
|
|
63
|
+
`)}function no(e){if(e.description==null&&io(e))return;const t=[],n=e.getQueryType();n&&t.push(` query: ${n.name}`);const i=e.getMutationType();i&&t.push(` mutation: ${i.name}`);const s=e.getSubscriptionType();return s&&t.push(` subscription: ${s.name}`),ee(e)+`schema {
|
|
64
64
|
${t.join(`
|
|
65
65
|
`)}
|
|
66
|
-
}`}function
|
|
66
|
+
}`}function io(e){const t=e.getQueryType();if(t&&t.name!=="Query")return!1;const n=e.getMutationType();if(n&&n.name!=="Mutation")return!1;const i=e.getSubscriptionType();return!(i&&i.name!=="Subscription")}function so(e){if(de(e))return ro(e);if(k(e))return oo(e);if(x(e))return ao(e);if(Z(e))return co(e);if(X(e))return uo(e);if(U(e))return lo(e);Y(!1,"Unexpected type: "+v(e))}function ro(e){return ee(e)+`scalar ${e.name}`+po(e)}function Ii(e){const t=e.getInterfaces();return t.length?" implements "+t.map(n=>n.name).join(" & "):""}function oo(e){return ee(e)+`type ${e.name}`+Ii(e)+gi(e)}function ao(e){return ee(e)+`interface ${e.name}`+Ii(e)+gi(e)}function co(e){const t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return ee(e)+"union "+e.name+n}function uo(e){const t=e.getValues().map((n,i)=>ee(n," ",!i)+" "+n.name+qt(n.deprecationReason));return ee(e)+`enum ${e.name}`+Jt(t)}function lo(e){const t=Object.values(e.getFields()).map((n,i)=>ee(n," ",!i)+" "+Rt(n));return ee(e)+`input ${e.name}`+(e.isOneOf?" @oneOf":"")+Jt(t)}function gi(e){const t=Object.values(e.getFields()).map((n,i)=>ee(n," ",!i)+" "+n.name+Oi(n.args," ")+": "+String(n.type)+qt(n.deprecationReason));return Jt(t)}function Jt(e){return e.length!==0?` {
|
|
67
67
|
`+e.join(`
|
|
68
68
|
`)+`
|
|
69
|
-
}`:""}function
|
|
70
|
-
`+e.map((n,i)=>ee(n," "+t,!i)+" "+t+
|
|
69
|
+
}`:""}function Oi(e,t=""){return e.length===0?"":e.every(n=>!n.description)?"("+e.map(Rt).join(", ")+")":`(
|
|
70
|
+
`+e.map((n,i)=>ee(n," "+t,!i)+" "+t+Rt(n)).join(`
|
|
71
71
|
`)+`
|
|
72
|
-
`+t+")"}function
|
|
72
|
+
`+t+")"}function Rt(e){const t=we(e.defaultValue,e.type);let n=e.name+": "+String(e.type);return t&&(n+=` = ${F(t)}`),n+qt(e.deprecationReason)}function fo(e){return ee(e)+"directive @"+e.name+Oi(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}function qt(e){return e==null?"":e!==zn?` @deprecated(reason: ${F({kind:c.STRING,value:e})})`:" @deprecated"}function po(e){return e.specifiedByURL==null?"":` @specifiedBy(url: ${F({kind:c.STRING,value:e.specifiedByURL})})`}function ee(e,t="",n=!0){const{description:i}=e;if(i==null)return"";const s=F({kind:c.STRING,value:i,block:Fi(i)});return(t&&!n?`
|
|
73
73
|
`+t:t)+s.replace(/\n/g,`
|
|
74
74
|
`+t)+`
|
|
75
|
-
`}export{
|
|
75
|
+
`}export{er as $,Qn as A,B,D as C,ds as D,Cn as E,be as F,m as G,si as H,go as I,Kr as J,c as K,vo as L,ct as M,No as N,To as O,H as P,me as Q,$e as R,ln as S,fn as T,pn as U,ve as V,Me as W,re as X,mo as Y,cn as Z,O as _,ts as a,Ms as a0,Eo as a1,Is as a2,yo as a3,Io as b,pe as c,S as d,_t as e,q as f,ye as g,Yn as h,k as i,W as j,$ as k,vs as l,Ts as m,ys as n,Ee as o,F as p,x as q,Ot as r,Br as s,Z as t,U as u,ho as v,bt as w,X as x,Pe as y,de as z};
|