prettier 3.0.0-alpha.1 → 3.0.0-alpha.10
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/LICENSE +910 -759
- package/README.md +3 -3
- package/bin/prettier.cjs +0 -0
- package/doc.d.ts +240 -0
- package/doc.js +351 -479
- package/doc.mjs +342 -474
- package/index.cjs +400 -230
- package/index.d.ts +921 -0
- package/index.mjs +17218 -32209
- package/internal/cli.mjs +4374 -10823
- package/internal/internal.mjs +6437 -0
- package/package.json +55 -13
- package/plugins/acorn.d.ts +6 -0
- package/plugins/acorn.js +13 -0
- package/plugins/acorn.mjs +13 -0
- package/plugins/angular.d.ts +8 -0
- package/plugins/angular.js +2 -2
- package/plugins/angular.mjs +2 -2
- package/plugins/babel.d.ts +17 -0
- package/plugins/babel.js +12 -12
- package/plugins/babel.mjs +12 -12
- package/plugins/estree.d.ts +0 -0
- package/plugins/estree.js +35 -0
- package/plugins/estree.mjs +35 -0
- package/plugins/flow.d.ts +5 -0
- package/plugins/flow.js +20 -20
- package/plugins/flow.mjs +20 -20
- package/plugins/glimmer.d.ts +5 -0
- package/plugins/glimmer.js +22 -17
- package/plugins/glimmer.mjs +22 -17
- package/plugins/graphql.d.ts +5 -0
- package/plugins/graphql.js +16 -7
- package/plugins/graphql.mjs +16 -7
- package/plugins/html.d.ts +8 -0
- package/plugins/html.js +19 -29
- package/plugins/html.mjs +19 -29
- package/plugins/markdown.d.ts +7 -0
- package/plugins/markdown.js +54 -34
- package/plugins/markdown.mjs +54 -34
- package/plugins/meriyah.d.ts +5 -0
- package/plugins/meriyah.js +5 -6
- package/plugins/meriyah.mjs +5 -6
- package/plugins/postcss.d.ts +7 -0
- package/plugins/postcss.js +45 -43
- package/plugins/postcss.mjs +45 -43
- package/plugins/typescript.d.ts +5 -0
- package/plugins/typescript.js +24 -239
- package/plugins/typescript.mjs +24 -239
- package/plugins/yaml.d.ts +5 -0
- package/plugins/yaml.js +148 -135
- package/plugins/yaml.mjs +148 -135
- package/standalone.d.ts +33 -0
- package/standalone.js +35 -105
- package/standalone.mjs +35 -105
- package/internal/third-party.mjs +0 -9071
- package/plugins/acorn-and-espree.js +0 -13
- package/plugins/acorn-and-espree.mjs +0 -13
package/plugins/graphql.js
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
`,E=s.split(/\r\n|[\n\r]/g),I=E[i];if(I.length>120){let x=Math.floor(l/80),V=l%80,N=[];for(let y=0;y<I.length;y+=80)N.push(I.slice(y,y+80));return T+se([[`${a} |`,N[0]],...N.slice(1,x+1).map(y=>["|",y]),["|","^".padStart(V)],["|",N[x+1]]])}return T+se([[`${a-1} |`,E[i-1]],[`${a} |`,I],["|","^".padStart(l)],[`${a+1} |`,E[i+1]]])}function se(e){let t=e.filter(([s,i])=>i!==void 0),n=Math.max(...t.map(([s])=>s.length));return t.map(([s,i])=>s.padStart(n)+(i?" "+i:"")).join(`
|
|
3
|
-
`)}var oe=m(()=>{u();j()});function Ue(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}function ae(e){return e===void 0||e.length===0?void 0:e}var D,ce=m(()=>{u();te();j();oe();D=class extends Error{constructor(t,...n){var s,i,o;let{nodes:a,source:p,positions:l,path:T,originalError:E,extensions:I}=Ue(n);super(t),this.name="GraphQLError",this.path=T!=null?T:void 0,this.originalError=E!=null?E:void 0,this.nodes=ae(Array.isArray(a)?a:a?[a]:void 0);let x=ae((s=this.nodes)===null||s===void 0?void 0:s.map(N=>N.loc).filter(N=>N!=null));this.source=p!=null?p:x==null||(i=x[0])===null||i===void 0?void 0:i.source,this.positions=l!=null?l:x==null?void 0:x.map(N=>N.start),this.locations=l&&p?l.map(N=>k(p,N)):x==null?void 0:x.map(N=>k(N.source,N.start));let V=ee(E==null?void 0:E.extensions)?E==null?void 0:E.extensions:void 0;this.extensions=(o=I!=null?I:V)!==null&&o!==void 0?o: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}}),E!=null&&E.stack?Object.defineProperty(this,"stack",{value:E.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,D):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=`
|
|
1
|
+
(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.graphql=e()}})(function(){"use strict";var oe=Object.defineProperty;var Ct=Object.getOwnPropertyDescriptor;var St=Object.getOwnPropertyNames;var vt=Object.prototype.hasOwnProperty;var f=(e,t)=>()=>(e&&(t=e(e=0)),t);var ae=(e,t)=>{for(var n in t)oe(e,n,{get:t[n],enumerable:!0})},bt=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of St(t))!vt.call(e,r)&&r!==n&&oe(e,r,{get:()=>t[r],enumerable:!(i=Ct(t,r))||i.enumerable});return e};var Lt=e=>bt(oe({},"__esModule",{value:!0}),e);function Ve(e){return/^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/.test(e)}function Be(e){return`# @format
|
|
4
2
|
|
|
5
|
-
`+
|
|
3
|
+
`+e}var me=f(()=>{});function q(e){return e.kind==="Comment"?e.start:e.loc.start}function Q(e){return e.kind==="Comment"?e.end:e.loc.end}var Ee=f(()=>{});var W,U,H,gr,S,z=f(()=>{W=class{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}}},U=class{constructor(t,n,i,r,s,a){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=s,this.value=a,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}}},H={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},gr=new Set(Object.keys(H));(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(S||(S={}))});function Je(e){return typeof e=="object"&&e!==null}var Xe=f(()=>{});function qe(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}var Qe=f(()=>{});function M(e,t){let n=0,i=1;for(let r of e.body.matchAll(hn)){if(typeof r.index=="number"||qe(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}var hn,_e=f(()=>{Qe();hn=/\r\n|[\n\r]/g});function He(e){return ye(e.source,M(e.source,e.start))}function ye(e,t){let n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,s=e.locationOffset.line-1,a=t.line+s,u=t.line===1?n:0,l=t.column+u,N=`${e.name}:${a}:${l}
|
|
4
|
+
`,d=i.split(/\r\n|[\n\r]/g),g=d[r];if(g.length>120){let O=Math.floor(l/80),se=l%80,x=[];for(let b=0;b<g.length;b+=80)x.push(g.slice(b,b+80));return N+We([[`${a} |`,x[0]],...x.slice(1,O+1).map(b=>["|",b]),["|","^".padStart(se)],["|",x[O+1]]])}return N+We([[`${a-1} |`,d[r-1]],[`${a} |`,g],["|","^".padStart(l)],[`${a+1} |`,d[r+1]]])}function We(e){let t=e.filter(([i,r])=>r!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(`
|
|
5
|
+
`)}var ze=f(()=>{_e()});function dn(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}function Ke(e){return e===void 0||e.length===0?void 0:e}var R,Ze=f(()=>{Xe();_e();ze();R=class extends Error{constructor(t,...n){var i,r,s;let{nodes:a,source:u,positions:l,path:N,originalError:d,extensions:g}=dn(n);super(t),this.name="GraphQLError",this.path=N??void 0,this.originalError=d??void 0,this.nodes=Ke(Array.isArray(a)?a:a?[a]:void 0);let O=Ke((i=this.nodes)===null||i===void 0?void 0:i.map(x=>x.loc).filter(x=>x!=null));this.source=u??(O==null||(r=O[0])===null||r===void 0?void 0:r.source),this.positions=l??(O==null?void 0:O.map(x=>x.start)),this.locations=l&&u?l.map(x=>M(u,x)):O==null?void 0:O.map(x=>M(x.source,x.start));let se=Je(d==null?void 0:d.extensions)?d==null?void 0:d.extensions:void 0;this.extensions=(s=g??se)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),d!=null&&d.stack?Object.defineProperty(this,"stack",{value:d.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,R):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=`
|
|
6
6
|
|
|
7
|
-
`+$(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}});function d(e,t,n){return new D(`Syntax Error: ${n}`,{source:e,positions:[t]})}var Y=m(()=>{u();ce()});var R,g,Ve,Vt,_,G=m(()=>{u();R=class{constructor(t,n,s){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=s}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},g=class{constructor(t,n,s,i,o,a){this.kind=t,this.start=n,this.end=s,this.line=i,this.column=o,this.value=a,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}}},Ve={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Vt=new Set(Object.keys(Ve));(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(_||(_={}))});var b,ue=m(()=>{u();(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"})(b||(b={}))});var c,pe=m(()=>{u();(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"})(c||(c={}))});function le(e){return e===9||e===32}function S(e){return e>=48&&e<=57}function he(e){return e>=97&&e<=122||e>=65&&e<=90}function J(e){return he(e)||e===95}function de(e){return he(e)||S(e)||e===95}var X=m(()=>{u()});function fe(e){var t;let n=Number.MAX_SAFE_INTEGER,s=null,i=-1;for(let a=0;a<e.length;++a){var o;let p=e[a],l=Be(p);l!==p.length&&(s=(o=s)!==null&&o!==void 0?o:a,i=a,a!==0&&l<n&&(n=l))}return e.map((a,p)=>p===0?a:a.slice(n)).slice((t=s)!==null&&t!==void 0?t:0,i+1)}function Be(e){let t=0;for(;t<e.length&&le(e.charCodeAt(t));)++t;return t}var Ee=m(()=>{u();X()});var r,Q=m(()=>{u();(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",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"})(r||(r={}))});function Ne(e){return e===r.BANG||e===r.DOLLAR||e===r.AMP||e===r.PAREN_L||e===r.PAREN_R||e===r.SPREAD||e===r.COLON||e===r.EQUALS||e===r.AT||e===r.BRACKET_L||e===r.BRACKET_R||e===r.BRACE_L||e===r.PIPE||e===r.BRACE_R}function v(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function w(e,t){return Te(e.charCodeAt(t))&&xe(e.charCodeAt(t+1))}function Te(e){return e>=55296&&e<=56319}function xe(e){return e>=56320&&e<=57343}function O(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return r.EOF;if(n>=32&&n<=126){let s=String.fromCodePoint(n);return s==='"'?`'"'`:`"${s}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function f(e,t,n,s,i){let o=e.line,a=1+n-e.lineStart;return new g(t,n,s,o,a,i)}function je(e,t){let n=e.source.body,s=n.length,i=t;for(;i<s;){let o=n.charCodeAt(i);switch(o){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:n.charCodeAt(i+1)===10?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return $e(e,i);case 33:return f(e,r.BANG,i,i+1);case 36:return f(e,r.DOLLAR,i,i+1);case 38:return f(e,r.AMP,i,i+1);case 40:return f(e,r.PAREN_L,i,i+1);case 41:return f(e,r.PAREN_R,i,i+1);case 46:if(n.charCodeAt(i+1)===46&&n.charCodeAt(i+2)===46)return f(e,r.SPREAD,i,i+3);break;case 58:return f(e,r.COLON,i,i+1);case 61:return f(e,r.EQUALS,i,i+1);case 64:return f(e,r.AT,i,i+1);case 91:return f(e,r.BRACKET_L,i,i+1);case 93:return f(e,r.BRACKET_R,i,i+1);case 123:return f(e,r.BRACE_L,i,i+1);case 124:return f(e,r.PIPE,i,i+1);case 125:return f(e,r.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?qe(e,i):Ge(e,i)}if(S(o)||o===45)return Ye(e,i,o);if(J(o))return ze(e,i);throw d(e.source,i,o===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:v(o)||w(n,i)?`Unexpected character: ${O(e,i)}.`:`Invalid character: ${O(e,i)}.`)}return f(e,r.EOF,s,s)}function $e(e,t){let n=e.source.body,s=n.length,i=t+1;for(;i<s;){let o=n.charCodeAt(i);if(o===10||o===13)break;if(v(o))++i;else if(w(n,i))i+=2;else break}return f(e,r.COMMENT,t,i,n.slice(t+1,i))}function Ye(e,t,n){let s=e.source.body,i=t,o=n,a=!1;if(o===45&&(o=s.charCodeAt(++i)),o===48){if(o=s.charCodeAt(++i),S(o))throw d(e.source,i,`Invalid number, unexpected digit after 0: ${O(e,i)}.`)}else i=q(e,i,o),o=s.charCodeAt(i);if(o===46&&(a=!0,o=s.charCodeAt(++i),i=q(e,i,o),o=s.charCodeAt(i)),(o===69||o===101)&&(a=!0,o=s.charCodeAt(++i),(o===43||o===45)&&(o=s.charCodeAt(++i)),i=q(e,i,o),o=s.charCodeAt(i)),o===46||J(o))throw d(e.source,i,`Invalid number, expected digit but got: ${O(e,i)}.`);return f(e,a?r.FLOAT:r.INT,t,i,s.slice(t,i))}function q(e,t,n){if(!S(n))throw d(e.source,t,`Invalid number, expected digit but got: ${O(e,t)}.`);let s=e.source.body,i=t+1;for(;S(s.charCodeAt(i));)++i;return i}function Ge(e,t){let n=e.source.body,s=n.length,i=t+1,o=i,a="";for(;i<s;){let p=n.charCodeAt(i);if(p===34)return a+=n.slice(o,i),f(e,r.STRING,t,i+1,a);if(p===92){a+=n.slice(o,i);let l=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?Je(e,i):Xe(e,i):Qe(e,i);a+=l.value,i+=l.size,o=i;continue}if(p===10||p===13)break;if(v(p))++i;else if(w(n,i))i+=2;else throw d(e.source,i,`Invalid character within String: ${O(e,i)}.`)}throw d(e.source,i,"Unterminated string.")}function Je(e,t){let n=e.source.body,s=0,i=3;for(;i<12;){let o=n.charCodeAt(t+i++);if(o===125){if(i<5||!v(s))break;return{value:String.fromCodePoint(s),size:i}}if(s=s<<4|C(o),s<0)break}throw d(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function Xe(e,t){let n=e.source.body,s=me(n,t+2);if(v(s))return{value:String.fromCodePoint(s),size:6};if(Te(s)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let i=me(n,t+8);if(xe(i))return{value:String.fromCodePoint(s,i),size:12}}throw d(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function me(e,t){return C(e.charCodeAt(t))<<12|C(e.charCodeAt(t+1))<<8|C(e.charCodeAt(t+2))<<4|C(e.charCodeAt(t+3))}function C(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Qe(e,t){let 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:`
|
|
8
|
-
|
|
9
|
-
`));return e.line+=l.length-1,e.lineStart=i,E}if(T===92&&n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34&&n.charCodeAt(o+3)===34){p+=n.slice(a,o),a=o+1,o+=4;continue}if(T===10||T===13){p+=n.slice(a,o),l.push(p),T===13&&n.charCodeAt(o+1)===10?o+=2:++o,p="",a=o,i=o;continue}if(v(T))++o;else if(w(n,o))o+=2;else throw d(e.source,o,`Invalid character within String: ${O(e,o)}.`)}throw d(e.source,o,"Unterminated string.")}function ze(e,t){let n=e.source.body,s=n.length,i=t+1;for(;i<s;){let o=n.charCodeAt(i);if(de(o))++i;else break}return f(e,r.NAME,t,i,n.slice(t,i))}var F,Ie=m(()=>{u();Y();G();Ee();X();Q();F=class{constructor(t){let n=new g(r.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!==r.EOF)do if(t.next)t=t.next;else{let n=je(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===r.COMMENT);return t}}});function P(e,t){if(!Boolean(e))throw new Error(t)}var _e=m(()=>{u()});function Oe(e){return M(e,[])}function M(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return He(e,t);default:return String(e)}}function He(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(We(e)){let s=e.toJSON();if(s!==e)return typeof s=="string"?s:M(s,n)}else if(Array.isArray(e))return Ke(e,n);return Ze(e,n)}function We(e){return typeof e.toJSON=="function"}function Ze(e,t){let n=Object.entries(e);if(n.length===0)return"{}";if(t.length>2)return"["+et(e)+"]";let s=n.map(([i,o])=>i+": "+M(o,t));return"{ "+s.join(", ")+" }"}function Ke(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),s=e.length-n,i=[];for(let o=0;o<n;++o)i.push(M(e[o],t));return s===1?i.push("... 1 more item"):s>1&&i.push(`... ${s} more items`),"["+i.join(", ")+"]"}function et(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}var Ae=m(()=>{u()});var ye,De=m(()=>{u();ye=function(t,n){return t instanceof n}});function Se(e){return ye(e,L)}var L,ve=m(()=>{u();_e();Ae();De();L=class{constructor(t,n="GraphQL request",s={line:1,column:1}){typeof t=="string"||P(!1,`Body must be a string. Received: ${Oe(t)}.`),this.body=t,this.name=n,this.locationOffset=s,this.locationOffset.line>0||P(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||P(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}});var ge={};z(ge,{Parser:()=>A,parse:()=>tt,parseConstValue:()=>it,parseType:()=>st,parseValue:()=>nt});function tt(e,t){return new A(e,t).parseDocument()}function nt(e,t){let n=new A(e,t);n.expectToken(r.SOF);let s=n.parseValueLiteral(!1);return n.expectToken(r.EOF),s}function it(e,t){let n=new A(e,t);n.expectToken(r.SOF);let s=n.parseConstValueLiteral();return n.expectToken(r.EOF),s}function st(e,t){let n=new A(e,t);n.expectToken(r.SOF);let s=n.parseTypeReference();return n.expectToken(r.EOF),s}function U(e){let t=e.value;return ke(e.kind)+(t!=null?` "${t}"`:"")}function ke(e){return Ne(e)?`"${e}"`:e}var A,Ce=m(()=>{u();Y();G();ue();pe();Ie();ve();Q();A=class{constructor(t,n={}){let s=Se(t)?t:new L(t);this._lexer=new F(s),this._options=n,this._tokenCounter=0}parseName(){let t=this.expectToken(r.NAME);return this.node(t,{kind:c.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:c.DOCUMENT,definitions:this.many(r.SOF,this.parseDefinition,r.EOF)})}parseDefinition(){if(this.peek(r.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===r.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()}if(t)throw d(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(r.BRACE_L))return this.node(t,{kind:c.OPERATION_DEFINITION,operation:_.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let n=this.parseOperationType(),s;return this.peek(r.NAME)&&(s=this.parseName()),this.node(t,{kind:c.OPERATION_DEFINITION,operation:n,name:s,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(r.NAME);switch(t.value){case"query":return _.QUERY;case"mutation":return _.MUTATION;case"subscription":return _.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(r.PAREN_L,this.parseVariableDefinition,r.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:c.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(r.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(r.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(r.DOLLAR),this.node(t,{kind:c.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:c.SELECTION_SET,selections:this.many(r.BRACE_L,this.parseSelection,r.BRACE_R)})}parseSelection(){return this.peek(r.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),s,i;return this.expectOptionalToken(r.COLON)?(s=n,i=this.parseName()):i=n,this.node(t,{kind:c.FIELD,alias:s,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(r.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(r.PAREN_L,n,r.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,s=this.parseName();return this.expectToken(r.COLON),this.node(n,{kind:c.ARGUMENT,name:s,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(r.SPREAD);let n=this.expectOptionalKeyword("on");return!n&&this.peek(r.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(){let t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:c.FRAGMENT_DEFINITION,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,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case r.BRACKET_L:return this.parseList(t);case r.BRACE_L:return this.parseObject(t);case r.INT:return this.advanceLexer(),this.node(n,{kind:c.INT,value:n.value});case r.FLOAT:return this.advanceLexer(),this.node(n,{kind:c.FLOAT,value:n.value});case r.STRING:case r.BLOCK_STRING:return this.parseStringLiteral();case r.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 r.DOLLAR:if(t)if(this.expectToken(r.DOLLAR),this._lexer.token.kind===r.NAME){let s=this._lexer.token.value;throw d(this._lexer.source,n.start,`Unexpected variable "$${s}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:c.STRING,value:t.value,block:t.kind===r.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:c.LIST,values:this.any(r.BRACKET_L,n,r.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:c.OBJECT,fields:this.any(r.BRACE_L,n,r.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,s=this.parseName();return this.expectToken(r.COLON),this.node(n,{kind:c.OBJECT_FIELD,name:s,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(r.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(r.AT),this.node(n,{kind:c.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(r.BRACKET_L)){let s=this.parseTypeReference();this.expectToken(r.BRACKET_R),n=this.node(t,{kind:c.LIST_TYPE,type:s})}else n=this.parseNamedType();return this.expectOptionalToken(r.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(r.STRING)||this.peek(r.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let s=this.parseConstDirectives(),i=this.many(r.BRACE_L,this.parseOperationTypeDefinition,r.BRACE_R);return this.node(t,{kind:c.SCHEMA_DEFINITION,description:n,directives:s,operationTypes:i})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(r.COLON);let s=this.parseNamedType();return this.node(t,{kind:c.OPERATION_TYPE_DEFINITION,operation:n,type:s})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let s=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:c.SCALAR_TYPE_DEFINITION,description:n,name:s,directives:i})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let s=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:c.OBJECT_TYPE_DEFINITION,description:n,name:s,interfaces:i,directives:o,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(r.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(r.BRACE_L,this.parseFieldDefinition,r.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),s=this.parseName(),i=this.parseArgumentDefs();this.expectToken(r.COLON);let o=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(t,{kind:c.FIELD_DEFINITION,description:n,name:s,arguments:i,type:o,directives:a})}parseArgumentDefs(){return this.optionalMany(r.PAREN_L,this.parseInputValueDef,r.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),s=this.parseName();this.expectToken(r.COLON);let i=this.parseTypeReference(),o;this.expectOptionalToken(r.EQUALS)&&(o=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(t,{kind:c.INPUT_VALUE_DEFINITION,description:n,name:s,type:i,defaultValue:o,directives:a})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let s=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:c.INTERFACE_TYPE_DEFINITION,description:n,name:s,interfaces:i,directives:o,fields:a})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let s=this.parseName(),i=this.parseConstDirectives(),o=this.parseUnionMemberTypes();return this.node(t,{kind:c.UNION_TYPE_DEFINITION,description:n,name:s,directives:i,types:o})}parseUnionMemberTypes(){return this.expectOptionalToken(r.EQUALS)?this.delimitedMany(r.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let s=this.parseName(),i=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();return this.node(t,{kind:c.ENUM_TYPE_DEFINITION,description:n,name:s,directives:i,values:o})}parseEnumValuesDefinition(){return this.optionalMany(r.BRACE_L,this.parseEnumValueDefinition,r.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),s=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:c.ENUM_VALUE_DEFINITION,description:n,name:s,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw d(this._lexer.source,this._lexer.token.start,`${U(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let s=this.parseName(),i=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:s,directives:i,fields:o})}parseInputFieldsDefinition(){return this.optionalMany(r.BRACE_L,this.parseInputValueDef,r.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===r.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),s=this.optionalMany(r.BRACE_L,this.parseOperationTypeDefinition,r.BRACE_R);if(n.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:c.SCHEMA_EXTENSION,directives:n,operationTypes:s})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),s=this.parseConstDirectives();if(s.length===0)throw this.unexpected();return this.node(t,{kind:c.SCALAR_TYPE_EXTENSION,name:n,directives:s})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),s=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(s.length===0&&i.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:c.OBJECT_TYPE_EXTENSION,name:n,interfaces:s,directives:i,fields:o})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),s=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(s.length===0&&i.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:c.INTERFACE_TYPE_EXTENSION,name:n,interfaces:s,directives:i,fields:o})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),s=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(s.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:c.UNION_TYPE_EXTENSION,name:n,directives:s,types:i})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),s=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(s.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:c.ENUM_TYPE_EXTENSION,name:n,directives:s,values:i})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),s=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(s.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:s,fields:i})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(r.AT);let s=this.parseName(),i=this.parseArgumentDefs(),o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:c.DIRECTIVE_DEFINITION,description:n,name:s,arguments:i,repeatable:o,locations:a})}parseDirectiveLocations(){return this.delimitedMany(r.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(b,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new R(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw d(this._lexer.source,n.start,`Expected ${ke(t)}, found ${U(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===r.NAME&&n.value===t)this.advanceLexer();else throw d(this._lexer.source,n.start,`Expected "${t}", found ${U(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===r.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t!=null?t:this._lexer.token;return d(this._lexer.source,n.start,`Unexpected ${U(n)}.`)}any(t,n,s){this.expectToken(t);let i=[];for(;!this.expectOptionalToken(s);)i.push(n.call(this));return i}optionalMany(t,n,s){if(this.expectOptionalToken(t)){let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(s));return i}return[]}many(t,n,s){this.expectToken(t);let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(s));return i}delimitedMany(t,n){this.expectOptionalToken(t);let s=[];do s.push(n.call(this));while(this.expectOptionalToken(t));return s}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(t!==void 0&&n.kind!==r.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw d(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}});var lt={};z(lt,{default:()=>pt});u();u();function Pe(e,t){let n=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(n,t)}var H=Pe;u();function W(e){return/^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/.test(e)}u();function Z(e){return e.kind==="Comment"?e.start:e.loc.start}function K(e){return e.kind==="Comment"?e.end:e.loc.end}function rt(e){let t=[],{startToken:n,endToken:s}=e.loc;for(let i=n;i!==s;i=i.next)i.kind==="Comment"&&t.push(i);return t}var ot={allowLegacyFragmentVariables:!0};function at(e){if((e==null?void 0:e.name)==="GraphQLError"){let{message:t,locations:[n]}=e;return H(t,{loc:{start:n},cause:e})}return e}async function ct(e){let{parse:t}=await Promise.resolve().then(()=>(Ce(),ge)),n;try{n=t(e,ot)}catch(s){throw at(s)}return n.comments=rt(n),n}var ut={parsers:{graphql:{parse:ct,astFormat:"graphql",hasPragma:W,locStart:Z,locEnd:K}}},pt=ut;return we(lt);});
|
|
7
|
+
`+He(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=`
|
|
8
|
+
|
|
9
|
+
`+ye(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}});function m(e,t,n){return new R(`Syntax Error: ${n}`,{source:e,positions:[t]})}var Ie=f(()=>{Ze()});var K,et=f(()=>{(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"})(K||(K={}))});var c,tt=f(()=>{(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"})(c||(c={}))});function nt(e){return e===9||e===32}function P(e){return e>=48&&e<=57}function rt(e){return e>=97&&e<=122||e>=65&&e<=90}function Oe(e){return rt(e)||e===95}function it(e){return rt(e)||P(e)||e===95}var De=f(()=>{});function st(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let a=0;a<e.length;++a){var s;let u=e[a],l=mn(u);l!==u.length&&(i=(s=i)!==null&&s!==void 0?s:a,r=a,a!==0&&l<n&&(n=l))}return e.map((a,u)=>u===0?a:a.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,r+1)}function mn(e){let t=0;for(;t<e.length&&nt(e.charCodeAt(t));)++t;return t}var ot=f(()=>{De()});var o,ge=f(()=>{(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",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"})(o||(o={}))});function ct(e){return e===o.BANG||e===o.DOLLAR||e===o.AMP||e===o.PAREN_L||e===o.PAREN_R||e===o.SPREAD||e===o.COLON||e===o.EQUALS||e===o.AT||e===o.BRACKET_L||e===o.BRACKET_R||e===o.BRACE_L||e===o.PIPE||e===o.BRACE_R}function F(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function ee(e,t){return ut(e.charCodeAt(t))&<(e.charCodeAt(t+1))}function ut(e){return e>=55296&&e<=56319}function lt(e){return e>=56320&&e<=57343}function v(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return o.EOF;if(n>=32&&n<=126){let i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function E(e,t,n,i,r){let s=e.line,a=1+n-e.lineStart;return new U(t,n,i,s,a,r)}function En(e,t){let n=e.source.body,i=n.length,r=t;for(;r<i;){let s=n.charCodeAt(r);switch(s){case 65279:case 9:case 32:case 44:++r;continue;case 10:++r,++e.line,e.lineStart=r;continue;case 13:n.charCodeAt(r+1)===10?r+=2:++r,++e.line,e.lineStart=r;continue;case 35:return Tn(e,r);case 33:return E(e,o.BANG,r,r+1);case 36:return E(e,o.DOLLAR,r,r+1);case 38:return E(e,o.AMP,r,r+1);case 40:return E(e,o.PAREN_L,r,r+1);case 41:return E(e,o.PAREN_R,r,r+1);case 46:if(n.charCodeAt(r+1)===46&&n.charCodeAt(r+2)===46)return E(e,o.SPREAD,r,r+3);break;case 58:return E(e,o.COLON,r,r+1);case 61:return E(e,o.EQUALS,r,r+1);case 64:return E(e,o.AT,r,r+1);case 91:return E(e,o.BRACKET_L,r,r+1);case 93:return E(e,o.BRACKET_R,r,r+1);case 123:return E(e,o.BRACE_L,r,r+1);case 124:return E(e,o.PIPE,r,r+1);case 125:return E(e,o.BRACE_R,r,r+1);case 34:return n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34?On(e,r):xn(e,r)}if(P(s)||s===45)return Nn(e,r,s);if(Oe(s))return Dn(e,r);throw m(e.source,r,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:F(s)||ee(n,r)?`Unexpected character: ${v(e,r)}.`:`Invalid character: ${v(e,r)}.`)}return E(e,o.EOF,i,i)}function Tn(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let s=n.charCodeAt(r);if(s===10||s===13)break;if(F(s))++r;else if(ee(n,r))r+=2;else break}return E(e,o.COMMENT,t,r,n.slice(t+1,r))}function Nn(e,t,n){let i=e.source.body,r=t,s=n,a=!1;if(s===45&&(s=i.charCodeAt(++r)),s===48){if(s=i.charCodeAt(++r),P(s))throw m(e.source,r,`Invalid number, unexpected digit after 0: ${v(e,r)}.`)}else r=Ae(e,r,s),s=i.charCodeAt(r);if(s===46&&(a=!0,s=i.charCodeAt(++r),r=Ae(e,r,s),s=i.charCodeAt(r)),(s===69||s===101)&&(a=!0,s=i.charCodeAt(++r),(s===43||s===45)&&(s=i.charCodeAt(++r)),r=Ae(e,r,s),s=i.charCodeAt(r)),s===46||Oe(s))throw m(e.source,r,`Invalid number, expected digit but got: ${v(e,r)}.`);return E(e,a?o.FLOAT:o.INT,t,r,i.slice(t,r))}function Ae(e,t,n){if(!P(n))throw m(e.source,t,`Invalid number, expected digit but got: ${v(e,t)}.`);let i=e.source.body,r=t+1;for(;P(i.charCodeAt(r));)++r;return r}function xn(e,t){let n=e.source.body,i=n.length,r=t+1,s=r,a="";for(;r<i;){let u=n.charCodeAt(r);if(u===34)return a+=n.slice(s,r),E(e,o.STRING,t,r+1,a);if(u===92){a+=n.slice(s,r);let l=n.charCodeAt(r+1)===117?n.charCodeAt(r+2)===123?_n(e,r):yn(e,r):In(e,r);a+=l.value,r+=l.size,s=r;continue}if(u===10||u===13)break;if(F(u))++r;else if(ee(n,r))r+=2;else throw m(e.source,r,`Invalid character within String: ${v(e,r)}.`)}throw m(e.source,r,"Unterminated string.")}function _n(e,t){let n=e.source.body,i=0,r=3;for(;r<12;){let s=n.charCodeAt(t+r++);if(s===125){if(r<5||!F(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|Y(s),i<0)break}throw m(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}function yn(e,t){let n=e.source.body,i=at(n,t+2);if(F(i))return{value:String.fromCodePoint(i),size:6};if(ut(i)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let r=at(n,t+8);if(lt(r))return{value:String.fromCodePoint(i,r),size:12}}throw m(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function at(e,t){return Y(e.charCodeAt(t))<<12|Y(e.charCodeAt(t+1))<<8|Y(e.charCodeAt(t+2))<<4|Y(e.charCodeAt(t+3))}function Y(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function In(e,t){let 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 m(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function On(e,t){let n=e.source.body,i=n.length,r=e.lineStart,s=t+3,a=s,u="",l=[];for(;s<i;){let N=n.charCodeAt(s);if(N===34&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34){u+=n.slice(a,s),l.push(u);let d=E(e,o.BLOCK_STRING,t,s+3,st(l).join(`
|
|
11
|
+
`));return e.line+=l.length-1,e.lineStart=r,d}if(N===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){u+=n.slice(a,s),a=s+1,s+=4;continue}if(N===10||N===13){u+=n.slice(a,s),l.push(u),N===13&&n.charCodeAt(s+1)===10?s+=2:++s,u="",a=s,r=s;continue}if(F(N))++s;else if(ee(n,s))s+=2;else throw m(e.source,s,`Invalid character within String: ${v(e,s)}.`)}throw m(e.source,s,"Unterminated string.")}function Dn(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let s=n.charCodeAt(r);if(it(s))++r;else break}return E(e,o.NAME,t,r,n.slice(t,r))}var Z,pt=f(()=>{Ie();z();ot();De();ge();Z=class{constructor(t){let n=new U(o.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!==o.EOF)do if(t.next)t=t.next;else{let n=En(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===o.COMMENT);return t}}});function te(e,t){if(!!!e)throw new Error(t)}var ft=f(()=>{});function ht(e){return ne(e,[])}function ne(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return gn(e,t);default:return String(e)}}function gn(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(An(e)){let i=e.toJSON();if(i!==e)return typeof i=="string"?i:ne(i,n)}else if(Array.isArray(e))return Cn(e,n);return kn(e,n)}function An(e){return typeof e.toJSON=="function"}function kn(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>2?"["+Sn(e)+"]":"{ "+n.map(([r,s])=>r+": "+ne(s,t)).join(", ")+" }"}function Cn(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),i=e.length-n,r=[];for(let s=0;s<n;++s)r.push(ne(e[s],t));return i===1?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function Sn(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}var dt=f(()=>{});var mt,Et=f(()=>{mt=function(t,n){return t instanceof n}});function Tt(e){return mt(e,j)}var j,Nt=f(()=>{ft();dt();Et();j=class{constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||te(!1,`Body must be a string. Received: ${ht(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||te(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||te(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}});function xt(e,t){return new ke(e,t).parseDocument()}function re(e){let t=e.value;return _t(e.kind)+(t!=null?` "${t}"`:"")}function _t(e){return ct(e)?`"${e}"`:e}var ke,yt=f(()=>{Ie();z();et();tt();pt();Nt();ge();ke=class{constructor(t,n={}){let i=Tt(t)?t:new j(t);this._lexer=new Z(i),this._options=n,this._tokenCounter=0}parseName(){let t=this.expectToken(o.NAME);return this.node(t,{kind:c.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:c.DOCUMENT,definitions:this.many(o.SOF,this.parseDefinition,o.EOF)})}parseDefinition(){if(this.peek(o.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===o.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()}if(t)throw m(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(o.BRACE_L))return this.node(t,{kind:c.OPERATION_DEFINITION,operation:S.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let n=this.parseOperationType(),i;return this.peek(o.NAME)&&(i=this.parseName()),this.node(t,{kind:c.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(o.NAME);switch(t.value){case"query":return S.QUERY;case"mutation":return S.MUTATION;case"subscription":return S.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(o.PAREN_L,this.parseVariableDefinition,o.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:c.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(o.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(o.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(o.DOLLAR),this.node(t,{kind:c.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:c.SELECTION_SET,selections:this.many(o.BRACE_L,this.parseSelection,o.BRACE_R)})}parseSelection(){return this.peek(o.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),i,r;return this.expectOptionalToken(o.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:c.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(o.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(o.PAREN_L,n,o.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,i=this.parseName();return this.expectToken(o.COLON),this.node(n,{kind:c.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(o.SPREAD);let n=this.expectOptionalKeyword("on");return!n&&this.peek(o.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(){let t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:c.FRAGMENT_DEFINITION,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,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case o.BRACKET_L:return this.parseList(t);case o.BRACE_L:return this.parseObject(t);case o.INT:return this.advanceLexer(),this.node(n,{kind:c.INT,value:n.value});case o.FLOAT:return this.advanceLexer(),this.node(n,{kind:c.FLOAT,value:n.value});case o.STRING:case o.BLOCK_STRING:return this.parseStringLiteral();case o.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 o.DOLLAR:if(t)if(this.expectToken(o.DOLLAR),this._lexer.token.kind===o.NAME){let i=this._lexer.token.value;throw m(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(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:c.STRING,value:t.value,block:t.kind===o.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:c.LIST,values:this.any(o.BRACKET_L,n,o.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:c.OBJECT,fields:this.any(o.BRACE_L,n,o.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,i=this.parseName();return this.expectToken(o.COLON),this.node(n,{kind:c.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(o.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(o.AT),this.node(n,{kind:c.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(o.BRACKET_L)){let i=this.parseTypeReference();this.expectToken(o.BRACKET_R),n=this.node(t,{kind:c.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(o.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(o.STRING)||this.peek(o.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let i=this.parseConstDirectives(),r=this.many(o.BRACE_L,this.parseOperationTypeDefinition,o.BRACE_R);return this.node(t,{kind:c.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(o.COLON);let i=this.parseNamedType();return this.node(t,{kind:c.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:c.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:c.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(o.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(o.BRACE_L,this.parseFieldDefinition,o.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(o.COLON);let s=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(t,{kind:c.FIELD_DEFINITION,description:n,name:i,arguments:r,type:s,directives:a})}parseArgumentDefs(){return this.optionalMany(o.PAREN_L,this.parseInputValueDef,o.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(o.COLON);let r=this.parseTypeReference(),s;this.expectOptionalToken(o.EQUALS)&&(s=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(t,{kind:c.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:s,directives:a})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:c.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:a})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let i=this.parseName(),r=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:c.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(o.EQUALS)?this.delimitedMany(o.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let i=this.parseName(),r=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:c.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:s})}parseEnumValuesDefinition(){return this.optionalMany(o.BRACE_L,this.parseEnumValueDefinition,o.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:c.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw m(this._lexer.source,this._lexer.token.start,`${re(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let i=this.parseName(),r=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(o.BRACE_L,this.parseInputValueDef,o.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===o.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.optionalMany(o.BRACE_L,this.parseOperationTypeDefinition,o.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(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let 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(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:c.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:c.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(o.AT);let i=this.parseName(),r=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:c.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:s,locations:a})}parseDirectiveLocations(){return this.delimitedMany(o.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(K,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new W(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw m(this._lexer.source,n.start,`Expected ${_t(t)}, found ${re(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===o.NAME&&n.value===t)this.advanceLexer();else throw m(this._lexer.source,n.start,`Expected "${t}", found ${re(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===o.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t??this._lexer.token;return m(this._lexer.source,n.start,`Unexpected ${re(n)}.`)}any(t,n,i){this.expectToken(t);let r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(t,n,i){this.expectToken(t);let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);let i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(t!==void 0&&n.kind!==o.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw m(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}});function vn(e,t){let n=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(n,t)}var It,Ot=f(()=>{It=vn});var Dt={};ae(Dt,{graphql:()=>Fn});function bn(e){let t=[],{startToken:n,endToken:i}=e.loc;for(let r=n;r!==i;r=r.next)r.kind==="Comment"&&t.push(r);return t}function Rn(e){if((e==null?void 0:e.name)==="GraphQLError"){let{message:t,locations:[n]}=e;return It(t,{loc:{start:n},cause:e})}return e}function Pn(e){let t;try{t=xt(e,Ln)}catch(n){throw Rn(n)}return t.comments=bn(t),t}var Ln,Fn,gt=f(()=>{yt();Ot();me();Ee();Ln={allowLegacyFragmentVariables:!0};Fn={parse:Pn,astFormat:"graphql",hasPragma:Ve,locStart:q,locEnd:Q}});var wn={};ae(wn,{default:()=>ie,languages:()=>Ne,options:()=>xe,parsers:()=>kt,printers:()=>At});var ie={};ae(ie,{languages:()=>Ne,options:()=>xe,parsers:()=>kt,printers:()=>At});function Rt(e){let t=Object.create(null);for(let{importParsers:n,parserNames:i}of e)for(let r of i)t[r]=async()=>Object.assign(t,await n())[r];return t}var Ce=Rt;var Pt=(e,t,n,i)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(n,i):n.global?t.replace(n,i):t.split(n).join(i)},$=Pt;var ce="indent";var ue="group";var le="if-break";var w="line";var pe="break-parent";var Se=()=>{},L=Se,fe=Se;function _(e){return L(e),{type:ce,contents:e}}function I(e,t={}){return L(e),fe(t.expandedStates,!0),{type:ue,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function D(e,t="",n={}){return L(e),t!==""&&L(t),{type:le,breakContents:e,flatContents:t,groupId:n.groupId}}var qt={type:pe};var Qt={type:w,hard:!0};var C={type:w},p={type:w,soft:!0},h=[Qt,qt];function T(e,t){L(e),fe(t);let n=[];for(let i=0;i<t.length;i++)i!==0&&n.push(e),n.push(t[i]);return n}function Wt(e,t,n){let i=!!(n!=null&&n.backwards);if(t===!1)return!1;let r=e.charAt(t);if(i){if(e.charAt(t-1)==="\r"&&r===`
|
|
12
|
+
`)return t-2;if(r===`
|
|
13
|
+
`||r==="\r"||r==="\u2028"||r==="\u2029")return t-1}else{if(r==="\r"&&e.charAt(t+1)===`
|
|
14
|
+
`)return t+2;if(r===`
|
|
15
|
+
`||r==="\r"||r==="\u2028"||r==="\u2029")return t+1}return t}var G=Wt;function J(e){return(t,n,i)=>{let r=!!(i!=null&&i.backwards);if(n===!1)return!1;let{length:s}=t,a=n;for(;a>=0&&a<s;){let u=t.charAt(a);if(e instanceof RegExp){if(!e.test(u))return a}else if(!e.includes(u))return a;r?a--:a++}return a===-1||a===s?a:!1}}var ir=J(/\s/),X=J(" "),ve=J(",; "),be=J(/[^\n\r]/);function Ht(e,t){if(t===!1)return!1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let n=t+2;n<e.length;++n)if(e.charAt(n)==="*"&&e.charAt(n+1)==="/")return n+2}return t}var Le=Ht;function zt(e,t){return t===!1?!1:e.charAt(t)==="/"&&e.charAt(t+1)==="/"?be(e,t):t}var Re=zt;function Kt(e,t,n={}){let i=X(e,n.backwards?t-1:t,n),r=G(e,i,n);return i!==r}var Pe=Kt;function Zt(e,t){let n=null,i=t;for(;i!==n;)n=i,i=ve(e,i),i=Le(e,i),i=X(e,i);return i=Re(e,i),i=G(e,i),i!==!1&&Pe(e,i)}var Fe=Zt;function en(e){return Array.isArray(e)&&e.length>0}var he=en;var de=class extends Error{name="UnexpectedNodeError";constructor(t,n,i="type"){super(`Unexpected ${n} node ${i}: ${JSON.stringify(t[i])}.`),this.node=t}},we=de;me();Ee();var V=null;function B(e){if(V!==null&&typeof V.property){let t=V;return V=B.prototype=null,t}return V=B.prototype=e??Object.create(null),new B}var tn=10;for(let e=0;e<=tn;e++)B();function Te(e){return B(e)}function nn(e,t="type"){Te(e);function n(i){let r=i[t],s=e[r];if(!Array.isArray(s))throw Object.assign(new Error(`Missing visitor keys for '${r}'.`),{node:i});return s}return n}var Ue=nn;z();var rn=Ue(H,"kind"),Me=rn;function sn(e,t,n){let{node:i}=e;if(!i.description)return"";let r=[n("description")];return i.kind==="InputValueDefinition"&&!i.description.block?r.push(C):r.push(h),r}var A=sn;function on(e,t,n){let{node:i}=e;switch(i.kind){case"Document":return[...T(h,k(e,t,n,"definitions")),h];case"OperationDefinition":{let r=t.originalText[q(i)]!=="{",s=!!i.name;return[r?i.operation:"",r&&s?[" ",n("name")]:"",r&&!s&&he(i.variableDefinitions)?" ":"",Ye(e,n),y(e,n,i),!r&&!s?"":" ",n("selectionSet")]}case"FragmentDefinition":return["fragment ",n("name"),Ye(e,n)," on ",n("typeCondition"),y(e,n,i)," ",n("selectionSet")];case"SelectionSet":return["{",_([h,T(h,k(e,t,n,"selections"))]),h,"}"];case"Field":return I([i.alias?[n("alias"),": "]:"",n("name"),i.arguments.length>0?I(["(",_([p,T([D("",", "),p],k(e,t,n,"arguments"))]),p,")"]):"",y(e,n,i),i.selectionSet?" ":"",n("selectionSet")]);case"Name":return i.value;case"StringValue":if(i.block){let r=$(!1,i.value,'"""','\\"""').split(`
|
|
16
|
+
`);return r.length===1&&(r[0]=r[0].trim()),r.every(s=>s==="")&&(r.length=0),T(h,['"""',...r,'"""'])}return['"',$(!1,$(!1,i.value,/["\\]/g,"\\$&"),`
|
|
17
|
+
`,"\\n"),'"'];case"IntValue":case"FloatValue":case"EnumValue":return i.value;case"BooleanValue":return i.value?"true":"false";case"NullValue":return"null";case"Variable":return["$",n("name")];case"ListValue":return I(["[",_([p,T([D("",", "),p],e.map(n,"values"))]),p,"]"]);case"ObjectValue":{let r=t.bracketSpacing&&i.fields.length>0?" ":"";return I(["{",r,_([p,T([D("",", "),p],e.map(n,"fields"))]),p,D("",r),"}"])}case"ObjectField":case"Argument":return[n("name"),": ",n("value")];case"Directive":return["@",n("name"),i.arguments.length>0?I(["(",_([p,T([D("",", "),p],k(e,t,n,"arguments"))]),p,")"]):""];case"NamedType":return n("name");case"VariableDefinition":return[n("variable"),": ",n("type"),i.defaultValue?[" = ",n("defaultValue")]:"",y(e,n,i)];case"ObjectTypeExtension":case"ObjectTypeDefinition":case"InputObjectTypeExtension":case"InputObjectTypeDefinition":case"InterfaceTypeExtension":case"InterfaceTypeDefinition":{let{kind:r}=i,s=[];return r.endsWith("TypeDefinition")?s.push(A(e,t,n)):s.push("extend "),r.startsWith("ObjectType")?s.push("type"):r.startsWith("InputObjectType")?s.push("input"):s.push("interface"),s.push(" ",n("name")),!r.startsWith("InputObjectType")&&i.interfaces.length>0&&s.push(" implements ",...un(e,t,n)),s.push(y(e,n,i)),i.fields.length>0&&s.push([" {",_([h,T(h,k(e,t,n,"fields"))]),h,"}"]),s}case"FieldDefinition":return[A(e,t,n),n("name"),i.arguments.length>0?I(["(",_([p,T([D("",", "),p],k(e,t,n,"arguments"))]),p,")"]):"",": ",n("type"),y(e,n,i)];case"DirectiveDefinition":return[A(e,t,n),"directive ","@",n("name"),i.arguments.length>0?I(["(",_([p,T([D("",", "),p],k(e,t,n,"arguments"))]),p,")"]):"",i.repeatable?" repeatable":""," on ",...T(" | ",e.map(n,"locations"))];case"EnumTypeExtension":case"EnumTypeDefinition":return[A(e,t,n),i.kind==="EnumTypeExtension"?"extend ":"","enum ",n("name"),y(e,n,i),i.values.length>0?[" {",_([h,T(h,k(e,t,n,"values"))]),h,"}"]:""];case"EnumValueDefinition":return[A(e,t,n),n("name"),y(e,n,i)];case"InputValueDefinition":return[A(e,t,n),n("name"),": ",n("type"),i.defaultValue?[" = ",n("defaultValue")]:"",y(e,n,i)];case"SchemaExtension":return["extend schema",y(e,n,i),...i.operationTypes.length>0?[" {",_([h,T(h,k(e,t,n,"operationTypes"))]),h,"}"]:[]];case"SchemaDefinition":return[A(e,t,n),"schema",y(e,n,i)," {",i.operationTypes.length>0?_([h,T(h,k(e,t,n,"operationTypes"))]):"",h,"}"];case"OperationTypeDefinition":return[i.operation,": ",n("type")];case"FragmentSpread":return["...",n("name"),y(e,n,i)];case"InlineFragment":return["...",i.typeCondition?[" on ",n("typeCondition")]:"",y(e,n,i)," ",n("selectionSet")];case"UnionTypeExtension":case"UnionTypeDefinition":return I([A(e,t,n),I([i.kind==="UnionTypeExtension"?"extend ":"","union ",n("name"),y(e,n,i),i.types.length>0?[" =",D(""," "),_([D([C," "]),T([C,"| "],e.map(n,"types"))])]:""])]);case"ScalarTypeExtension":case"ScalarTypeDefinition":return[A(e,t,n),i.kind==="ScalarTypeExtension"?"extend ":"","scalar ",n("name"),y(e,n,i)];case"NonNullType":return[n("type"),"!"];case"ListType":return["[",n("type"),"]"];default:throw new we(i,"Graphql","kind")}}function y(e,t,n){if(n.directives.length===0)return"";let i=T(C,e.map(t,"directives"));return n.kind==="FragmentDefinition"||n.kind==="OperationDefinition"?I([C,i]):[" ",I(_([p,i]))]}function k(e,t,n,i){return e.map(({isLast:r,node:s})=>{let a=n();return!r&&Fe(t.originalText,Q(s))?[a,h]:a},i)}function an(e){return e.kind!=="Comment"}function cn(e){let t=e.node;if(t.kind==="Comment")return"#"+t.value.trimEnd();throw new Error("Not a comment: "+JSON.stringify(t))}function un(e,t,n){let{node:i}=e,r=[],{interfaces:s}=i,a=e.map(n,"interfaces");for(let u=0;u<s.length;u++){let l=s[u];r.push(a[u]);let N=s[u+1];if(N){let g=t.originalText.slice(l.loc.end,N.loc.start).includes("#");r.push(" &",g?C:" ")}}return r}function Ye(e,t){let{node:n}=e;return he(n.variableDefinitions)?I(["(",_([p,T([D("",", "),p],e.map(t,"variableDefinitions"))]),p,")"]):""}function je(e,t){e.kind==="StringValue"&&e.block&&!e.value.includes(`
|
|
18
|
+
`)&&(t.value=t.value.trim())}je.ignoredProperties=new Set(["loc","comments"]);function ln(e){var n;let{node:t}=e;return(n=t==null?void 0:t.comments)==null?void 0:n.some(i=>i.value.trim()==="prettier-ignore")}var pn={print:on,massageAstNode:je,hasPrettierIgnore:ln,insertPragma:Be,printComment:cn,canAttachComment:an,getVisitorKeys:Me},$e=pn;var Ne=[{linguistLanguageId:139,name:"GraphQL",type:"data",color:"#e10098",extensions:[".graphql",".gql",".graphqls"],tmScope:"source.graphql",aceMode:"text",parsers:["graphql"],vscodeLanguageIds:["graphql"]}];var Ge={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var fn={bracketSpacing:Ge.bracketSpacing},xe=fn;var At={graphql:$e},kt=Ce([{importParsers:()=>Promise.resolve().then(()=>(gt(),Dt)),parserNames:["graphql"]}]);return Lt(wn);});
|
package/plugins/graphql.mjs
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
var
|
|
2
|
-
`,E=s.split(/\r\n|[\n\r]/g),I=E[i];if(I.length>120){let x=Math.floor(l/80),V=l%80,N=[];for(let y=0;y<I.length;y+=80)N.push(I.slice(y,y+80));return T+ne([[`${a} |`,N[0]],...N.slice(1,x+1).map(y=>["|",y]),["|","^".padStart(V)],["|",N[x+1]]])}return T+ne([[`${a-1} |`,E[i-1]],[`${a} |`,I],["|","^".padStart(l)],[`${a+1} |`,E[i+1]]])}function ne(e){let t=e.filter(([s,i])=>i!==void 0),n=Math.max(...t.map(([s])=>s.length));return t.map(([s,i])=>s.padStart(n)+(i?" "+i:"")).join(`
|
|
3
|
-
`)}var se=m(()=>{u();B()});function be(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}function re(e){return e===void 0||e.length===0?void 0:e}var D,oe=m(()=>{u();K();B();se();D=class extends Error{constructor(t,...n){var s,i,o;let{nodes:a,source:p,positions:l,path:T,originalError:E,extensions:I}=be(n);super(t),this.name="GraphQLError",this.path=T!=null?T:void 0,this.originalError=E!=null?E:void 0,this.nodes=re(Array.isArray(a)?a:a?[a]:void 0);let x=re((s=this.nodes)===null||s===void 0?void 0:s.map(N=>N.loc).filter(N=>N!=null));this.source=p!=null?p:x==null||(i=x[0])===null||i===void 0?void 0:i.source,this.positions=l!=null?l:x==null?void 0:x.map(N=>N.start),this.locations=l&&p?l.map(N=>k(p,N)):x==null?void 0:x.map(N=>k(N.source,N.start));let V=Z(E==null?void 0:E.extensions)?E==null?void 0:E.extensions:void 0;this.extensions=(o=I!=null?I:V)!==null&&o!==void 0?o: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}}),E!=null&&E.stack?Object.defineProperty(this,"stack",{value:E.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,D):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=`
|
|
1
|
+
var gt=Object.defineProperty;var f=(e,t)=>()=>(e&&(t=e(e=0)),t);var De=(e,t)=>{for(var n in t)gt(e,n,{get:t[n],enumerable:!0})};function Pe(e){return/^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/.test(e)}function Fe(e){return`# @format
|
|
4
2
|
|
|
5
|
-
`+
|
|
3
|
+
`+e}var fe=f(()=>{});function q(e){return e.kind==="Comment"?e.start:e.loc.start}function Q(e){return e.kind==="Comment"?e.end:e.loc.end}var he=f(()=>{});var W,U,H,xr,S,z=f(()=>{W=class{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}}},U=class{constructor(t,n,i,r,s,a){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=s,this.value=a,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}}},H={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},xr=new Set(Object.keys(H));(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(S||(S={}))});function Ge(e){return typeof e=="object"&&e!==null}var Je=f(()=>{});function Xe(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}var qe=f(()=>{});function M(e,t){let n=0,i=1;for(let r of e.body.matchAll(on)){if(typeof r.index=="number"||Xe(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}var on,me=f(()=>{qe();on=/\r\n|[\n\r]/g});function We(e){return Ee(e.source,M(e.source,e.start))}function Ee(e,t){let n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,s=e.locationOffset.line-1,a=t.line+s,u=t.line===1?n:0,l=t.column+u,N=`${e.name}:${a}:${l}
|
|
4
|
+
`,d=i.split(/\r\n|[\n\r]/g),g=d[r];if(g.length>120){let O=Math.floor(l/80),ie=l%80,x=[];for(let b=0;b<g.length;b+=80)x.push(g.slice(b,b+80));return N+Qe([[`${a} |`,x[0]],...x.slice(1,O+1).map(b=>["|",b]),["|","^".padStart(ie)],["|",x[O+1]]])}return N+Qe([[`${a-1} |`,d[r-1]],[`${a} |`,g],["|","^".padStart(l)],[`${a+1} |`,d[r+1]]])}function Qe(e){let t=e.filter(([i,r])=>r!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(`
|
|
5
|
+
`)}var He=f(()=>{me()});function an(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}function ze(e){return e===void 0||e.length===0?void 0:e}var R,Ke=f(()=>{Je();me();He();R=class extends Error{constructor(t,...n){var i,r,s;let{nodes:a,source:u,positions:l,path:N,originalError:d,extensions:g}=an(n);super(t),this.name="GraphQLError",this.path=N??void 0,this.originalError=d??void 0,this.nodes=ze(Array.isArray(a)?a:a?[a]:void 0);let O=ze((i=this.nodes)===null||i===void 0?void 0:i.map(x=>x.loc).filter(x=>x!=null));this.source=u??(O==null||(r=O[0])===null||r===void 0?void 0:r.source),this.positions=l??(O==null?void 0:O.map(x=>x.start)),this.locations=l&&u?l.map(x=>M(u,x)):O==null?void 0:O.map(x=>M(x.source,x.start));let ie=Ge(d==null?void 0:d.extensions)?d==null?void 0:d.extensions:void 0;this.extensions=(s=g??ie)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),d!=null&&d.stack?Object.defineProperty(this,"stack",{value:d.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,R):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=`
|
|
6
6
|
|
|
7
|
-
`+j(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}});function d(e,t,n){return new D(`Syntax Error: ${n}`,{source:e,positions:[t]})}var $=m(()=>{u();oe()});var R,g,Fe,Rt,_,Y=m(()=>{u();R=class{constructor(t,n,s){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=s}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},g=class{constructor(t,n,s,i,o,a){this.kind=t,this.start=n,this.end=s,this.line=i,this.column=o,this.value=a,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}}},Fe={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Rt=new Set(Object.keys(Fe));(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(_||(_={}))});var b,ae=m(()=>{u();(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"})(b||(b={}))});var c,ce=m(()=>{u();(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"})(c||(c={}))});function ue(e){return e===9||e===32}function S(e){return e>=48&&e<=57}function pe(e){return e>=97&&e<=122||e>=65&&e<=90}function G(e){return pe(e)||e===95}function le(e){return pe(e)||S(e)||e===95}var J=m(()=>{u()});function he(e){var t;let n=Number.MAX_SAFE_INTEGER,s=null,i=-1;for(let a=0;a<e.length;++a){var o;let p=e[a],l=we(p);l!==p.length&&(s=(o=s)!==null&&o!==void 0?o:a,i=a,a!==0&&l<n&&(n=l))}return e.map((a,p)=>p===0?a:a.slice(n)).slice((t=s)!==null&&t!==void 0?t:0,i+1)}function we(e){let t=0;for(;t<e.length&&ue(e.charCodeAt(t));)++t;return t}var de=m(()=>{u();J()});var r,X=m(()=>{u();(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",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"})(r||(r={}))});function Ee(e){return e===r.BANG||e===r.DOLLAR||e===r.AMP||e===r.PAREN_L||e===r.PAREN_R||e===r.SPREAD||e===r.COLON||e===r.EQUALS||e===r.AT||e===r.BRACKET_L||e===r.BRACKET_R||e===r.BRACE_L||e===r.PIPE||e===r.BRACE_R}function v(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function w(e,t){return me(e.charCodeAt(t))&&Ne(e.charCodeAt(t+1))}function me(e){return e>=55296&&e<=56319}function Ne(e){return e>=56320&&e<=57343}function O(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return r.EOF;if(n>=32&&n<=126){let s=String.fromCodePoint(n);return s==='"'?`'"'`:`"${s}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function f(e,t,n,s,i){let o=e.line,a=1+n-e.lineStart;return new g(t,n,s,o,a,i)}function Pe(e,t){let n=e.source.body,s=n.length,i=t;for(;i<s;){let o=n.charCodeAt(i);switch(o){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:n.charCodeAt(i+1)===10?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return Me(e,i);case 33:return f(e,r.BANG,i,i+1);case 36:return f(e,r.DOLLAR,i,i+1);case 38:return f(e,r.AMP,i,i+1);case 40:return f(e,r.PAREN_L,i,i+1);case 41:return f(e,r.PAREN_R,i,i+1);case 46:if(n.charCodeAt(i+1)===46&&n.charCodeAt(i+2)===46)return f(e,r.SPREAD,i,i+3);break;case 58:return f(e,r.COLON,i,i+1);case 61:return f(e,r.EQUALS,i,i+1);case 64:return f(e,r.AT,i,i+1);case 91:return f(e,r.BRACKET_L,i,i+1);case 93:return f(e,r.BRACKET_R,i,i+1);case 123:return f(e,r.BRACE_L,i,i+1);case 124:return f(e,r.PIPE,i,i+1);case 125:return f(e,r.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?Ye(e,i):Ve(e,i)}if(S(o)||o===45)return Ue(e,i,o);if(G(o))return Ge(e,i);throw d(e.source,i,o===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:v(o)||w(n,i)?`Unexpected character: ${O(e,i)}.`:`Invalid character: ${O(e,i)}.`)}return f(e,r.EOF,s,s)}function Me(e,t){let n=e.source.body,s=n.length,i=t+1;for(;i<s;){let o=n.charCodeAt(i);if(o===10||o===13)break;if(v(o))++i;else if(w(n,i))i+=2;else break}return f(e,r.COMMENT,t,i,n.slice(t+1,i))}function Ue(e,t,n){let s=e.source.body,i=t,o=n,a=!1;if(o===45&&(o=s.charCodeAt(++i)),o===48){if(o=s.charCodeAt(++i),S(o))throw d(e.source,i,`Invalid number, unexpected digit after 0: ${O(e,i)}.`)}else i=Q(e,i,o),o=s.charCodeAt(i);if(o===46&&(a=!0,o=s.charCodeAt(++i),i=Q(e,i,o),o=s.charCodeAt(i)),(o===69||o===101)&&(a=!0,o=s.charCodeAt(++i),(o===43||o===45)&&(o=s.charCodeAt(++i)),i=Q(e,i,o),o=s.charCodeAt(i)),o===46||G(o))throw d(e.source,i,`Invalid number, expected digit but got: ${O(e,i)}.`);return f(e,a?r.FLOAT:r.INT,t,i,s.slice(t,i))}function Q(e,t,n){if(!S(n))throw d(e.source,t,`Invalid number, expected digit but got: ${O(e,t)}.`);let s=e.source.body,i=t+1;for(;S(s.charCodeAt(i));)++i;return i}function Ve(e,t){let n=e.source.body,s=n.length,i=t+1,o=i,a="";for(;i<s;){let p=n.charCodeAt(i);if(p===34)return a+=n.slice(o,i),f(e,r.STRING,t,i+1,a);if(p===92){a+=n.slice(o,i);let l=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?Be(e,i):je(e,i):$e(e,i);a+=l.value,i+=l.size,o=i;continue}if(p===10||p===13)break;if(v(p))++i;else if(w(n,i))i+=2;else throw d(e.source,i,`Invalid character within String: ${O(e,i)}.`)}throw d(e.source,i,"Unterminated string.")}function Be(e,t){let n=e.source.body,s=0,i=3;for(;i<12;){let o=n.charCodeAt(t+i++);if(o===125){if(i<5||!v(s))break;return{value:String.fromCodePoint(s),size:i}}if(s=s<<4|C(o),s<0)break}throw d(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function je(e,t){let n=e.source.body,s=fe(n,t+2);if(v(s))return{value:String.fromCodePoint(s),size:6};if(me(s)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let i=fe(n,t+8);if(Ne(i))return{value:String.fromCodePoint(s,i),size:12}}throw d(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function fe(e,t){return C(e.charCodeAt(t))<<12|C(e.charCodeAt(t+1))<<8|C(e.charCodeAt(t+2))<<4|C(e.charCodeAt(t+3))}function C(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function $e(e,t){let 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:`
|
|
8
|
-
|
|
9
|
-
`));return e.line+=l.length-1,e.lineStart=i,E}if(T===92&&n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34&&n.charCodeAt(o+3)===34){p+=n.slice(a,o),a=o+1,o+=4;continue}if(T===10||T===13){p+=n.slice(a,o),l.push(p),T===13&&n.charCodeAt(o+1)===10?o+=2:++o,p="",a=o,i=o;continue}if(v(T))++o;else if(w(n,o))o+=2;else throw d(e.source,o,`Invalid character within String: ${O(e,o)}.`)}throw d(e.source,o,"Unterminated string.")}function Ge(e,t){let n=e.source.body,s=n.length,i=t+1;for(;i<s;){let o=n.charCodeAt(i);if(le(o))++i;else break}return f(e,r.NAME,t,i,n.slice(t,i))}var F,Te=m(()=>{u();$();Y();de();J();X();F=class{constructor(t){let n=new g(r.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!==r.EOF)do if(t.next)t=t.next;else{let n=Pe(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===r.COMMENT);return t}}});function P(e,t){if(!Boolean(e))throw new Error(t)}var xe=m(()=>{u()});function Ie(e){return M(e,[])}function M(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return Je(e,t);default:return String(e)}}function Je(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(Xe(e)){let s=e.toJSON();if(s!==e)return typeof s=="string"?s:M(s,n)}else if(Array.isArray(e))return qe(e,n);return Qe(e,n)}function Xe(e){return typeof e.toJSON=="function"}function Qe(e,t){let n=Object.entries(e);if(n.length===0)return"{}";if(t.length>2)return"["+ze(e)+"]";let s=n.map(([i,o])=>i+": "+M(o,t));return"{ "+s.join(", ")+" }"}function qe(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),s=e.length-n,i=[];for(let o=0;o<n;++o)i.push(M(e[o],t));return s===1?i.push("... 1 more item"):s>1&&i.push(`... ${s} more items`),"["+i.join(", ")+"]"}function ze(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}var _e=m(()=>{u()});var Oe,Ae=m(()=>{u();Oe=function(t,n){return t instanceof n}});function ye(e){return Oe(e,L)}var L,De=m(()=>{u();xe();_e();Ae();L=class{constructor(t,n="GraphQL request",s={line:1,column:1}){typeof t=="string"||P(!1,`Body must be a string. Received: ${Ie(t)}.`),this.body=t,this.name=n,this.locationOffset=s,this.locationOffset.line>0||P(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||P(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}});var ve={};Ce(ve,{Parser:()=>A,parse:()=>He,parseConstValue:()=>Ze,parseType:()=>Ke,parseValue:()=>We});function He(e,t){return new A(e,t).parseDocument()}function We(e,t){let n=new A(e,t);n.expectToken(r.SOF);let s=n.parseValueLiteral(!1);return n.expectToken(r.EOF),s}function Ze(e,t){let n=new A(e,t);n.expectToken(r.SOF);let s=n.parseConstValueLiteral();return n.expectToken(r.EOF),s}function Ke(e,t){let n=new A(e,t);n.expectToken(r.SOF);let s=n.parseTypeReference();return n.expectToken(r.EOF),s}function U(e){let t=e.value;return Se(e.kind)+(t!=null?` "${t}"`:"")}function Se(e){return Ee(e)?`"${e}"`:e}var A,ke=m(()=>{u();$();Y();ae();ce();Te();De();X();A=class{constructor(t,n={}){let s=ye(t)?t:new L(t);this._lexer=new F(s),this._options=n,this._tokenCounter=0}parseName(){let t=this.expectToken(r.NAME);return this.node(t,{kind:c.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:c.DOCUMENT,definitions:this.many(r.SOF,this.parseDefinition,r.EOF)})}parseDefinition(){if(this.peek(r.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===r.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()}if(t)throw d(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(r.BRACE_L))return this.node(t,{kind:c.OPERATION_DEFINITION,operation:_.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let n=this.parseOperationType(),s;return this.peek(r.NAME)&&(s=this.parseName()),this.node(t,{kind:c.OPERATION_DEFINITION,operation:n,name:s,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(r.NAME);switch(t.value){case"query":return _.QUERY;case"mutation":return _.MUTATION;case"subscription":return _.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(r.PAREN_L,this.parseVariableDefinition,r.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:c.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(r.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(r.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(r.DOLLAR),this.node(t,{kind:c.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:c.SELECTION_SET,selections:this.many(r.BRACE_L,this.parseSelection,r.BRACE_R)})}parseSelection(){return this.peek(r.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),s,i;return this.expectOptionalToken(r.COLON)?(s=n,i=this.parseName()):i=n,this.node(t,{kind:c.FIELD,alias:s,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(r.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(r.PAREN_L,n,r.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,s=this.parseName();return this.expectToken(r.COLON),this.node(n,{kind:c.ARGUMENT,name:s,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(r.SPREAD);let n=this.expectOptionalKeyword("on");return!n&&this.peek(r.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(){let t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:c.FRAGMENT_DEFINITION,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,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case r.BRACKET_L:return this.parseList(t);case r.BRACE_L:return this.parseObject(t);case r.INT:return this.advanceLexer(),this.node(n,{kind:c.INT,value:n.value});case r.FLOAT:return this.advanceLexer(),this.node(n,{kind:c.FLOAT,value:n.value});case r.STRING:case r.BLOCK_STRING:return this.parseStringLiteral();case r.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 r.DOLLAR:if(t)if(this.expectToken(r.DOLLAR),this._lexer.token.kind===r.NAME){let s=this._lexer.token.value;throw d(this._lexer.source,n.start,`Unexpected variable "$${s}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:c.STRING,value:t.value,block:t.kind===r.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:c.LIST,values:this.any(r.BRACKET_L,n,r.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:c.OBJECT,fields:this.any(r.BRACE_L,n,r.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,s=this.parseName();return this.expectToken(r.COLON),this.node(n,{kind:c.OBJECT_FIELD,name:s,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(r.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(r.AT),this.node(n,{kind:c.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(r.BRACKET_L)){let s=this.parseTypeReference();this.expectToken(r.BRACKET_R),n=this.node(t,{kind:c.LIST_TYPE,type:s})}else n=this.parseNamedType();return this.expectOptionalToken(r.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(r.STRING)||this.peek(r.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let s=this.parseConstDirectives(),i=this.many(r.BRACE_L,this.parseOperationTypeDefinition,r.BRACE_R);return this.node(t,{kind:c.SCHEMA_DEFINITION,description:n,directives:s,operationTypes:i})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(r.COLON);let s=this.parseNamedType();return this.node(t,{kind:c.OPERATION_TYPE_DEFINITION,operation:n,type:s})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let s=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:c.SCALAR_TYPE_DEFINITION,description:n,name:s,directives:i})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let s=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:c.OBJECT_TYPE_DEFINITION,description:n,name:s,interfaces:i,directives:o,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(r.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(r.BRACE_L,this.parseFieldDefinition,r.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),s=this.parseName(),i=this.parseArgumentDefs();this.expectToken(r.COLON);let o=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(t,{kind:c.FIELD_DEFINITION,description:n,name:s,arguments:i,type:o,directives:a})}parseArgumentDefs(){return this.optionalMany(r.PAREN_L,this.parseInputValueDef,r.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),s=this.parseName();this.expectToken(r.COLON);let i=this.parseTypeReference(),o;this.expectOptionalToken(r.EQUALS)&&(o=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(t,{kind:c.INPUT_VALUE_DEFINITION,description:n,name:s,type:i,defaultValue:o,directives:a})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let s=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:c.INTERFACE_TYPE_DEFINITION,description:n,name:s,interfaces:i,directives:o,fields:a})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let s=this.parseName(),i=this.parseConstDirectives(),o=this.parseUnionMemberTypes();return this.node(t,{kind:c.UNION_TYPE_DEFINITION,description:n,name:s,directives:i,types:o})}parseUnionMemberTypes(){return this.expectOptionalToken(r.EQUALS)?this.delimitedMany(r.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let s=this.parseName(),i=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();return this.node(t,{kind:c.ENUM_TYPE_DEFINITION,description:n,name:s,directives:i,values:o})}parseEnumValuesDefinition(){return this.optionalMany(r.BRACE_L,this.parseEnumValueDefinition,r.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),s=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:c.ENUM_VALUE_DEFINITION,description:n,name:s,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw d(this._lexer.source,this._lexer.token.start,`${U(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let s=this.parseName(),i=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:s,directives:i,fields:o})}parseInputFieldsDefinition(){return this.optionalMany(r.BRACE_L,this.parseInputValueDef,r.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===r.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),s=this.optionalMany(r.BRACE_L,this.parseOperationTypeDefinition,r.BRACE_R);if(n.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:c.SCHEMA_EXTENSION,directives:n,operationTypes:s})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),s=this.parseConstDirectives();if(s.length===0)throw this.unexpected();return this.node(t,{kind:c.SCALAR_TYPE_EXTENSION,name:n,directives:s})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),s=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(s.length===0&&i.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:c.OBJECT_TYPE_EXTENSION,name:n,interfaces:s,directives:i,fields:o})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),s=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(s.length===0&&i.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:c.INTERFACE_TYPE_EXTENSION,name:n,interfaces:s,directives:i,fields:o})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),s=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(s.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:c.UNION_TYPE_EXTENSION,name:n,directives:s,types:i})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),s=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(s.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:c.ENUM_TYPE_EXTENSION,name:n,directives:s,values:i})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),s=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(s.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:s,fields:i})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(r.AT);let s=this.parseName(),i=this.parseArgumentDefs(),o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:c.DIRECTIVE_DEFINITION,description:n,name:s,arguments:i,repeatable:o,locations:a})}parseDirectiveLocations(){return this.delimitedMany(r.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(b,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new R(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw d(this._lexer.source,n.start,`Expected ${Se(t)}, found ${U(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===r.NAME&&n.value===t)this.advanceLexer();else throw d(this._lexer.source,n.start,`Expected "${t}", found ${U(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===r.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t!=null?t:this._lexer.token;return d(this._lexer.source,n.start,`Unexpected ${U(n)}.`)}any(t,n,s){this.expectToken(t);let i=[];for(;!this.expectOptionalToken(s);)i.push(n.call(this));return i}optionalMany(t,n,s){if(this.expectOptionalToken(t)){let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(s));return i}return[]}many(t,n,s){this.expectToken(t);let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(s));return i}delimitedMany(t,n){this.expectOptionalToken(t);let s=[];do s.push(n.call(this));while(this.expectOptionalToken(t));return s}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(t!==void 0&&n.kind!==r.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw d(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}});u();u();function Le(e,t){let n=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(n,t)}var q=Le;u();function z(e){return/^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/.test(e)}u();function H(e){return e.kind==="Comment"?e.start:e.loc.start}function W(e){return e.kind==="Comment"?e.end:e.loc.end}function et(e){let t=[],{startToken:n,endToken:s}=e.loc;for(let i=n;i!==s;i=i.next)i.kind==="Comment"&&t.push(i);return t}var tt={allowLegacyFragmentVariables:!0};function nt(e){if((e==null?void 0:e.name)==="GraphQLError"){let{message:t,locations:[n]}=e;return q(t,{loc:{start:n},cause:e})}return e}async function it(e){let{parse:t}=await Promise.resolve().then(()=>(ke(),ve)),n;try{n=t(e,tt)}catch(s){throw nt(s)}return n.comments=et(n),n}var st={parsers:{graphql:{parse:it,astFormat:"graphql",hasPragma:z,locStart:H,locEnd:W}}},On=st;export{On as default};
|
|
7
|
+
`+We(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=`
|
|
8
|
+
|
|
9
|
+
`+Ee(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}});function m(e,t,n){return new R(`Syntax Error: ${n}`,{source:e,positions:[t]})}var Te=f(()=>{Ke()});var K,Ze=f(()=>{(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"})(K||(K={}))});var c,et=f(()=>{(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"})(c||(c={}))});function tt(e){return e===9||e===32}function P(e){return e>=48&&e<=57}function nt(e){return e>=97&&e<=122||e>=65&&e<=90}function Ne(e){return nt(e)||e===95}function rt(e){return nt(e)||P(e)||e===95}var xe=f(()=>{});function it(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let a=0;a<e.length;++a){var s;let u=e[a],l=cn(u);l!==u.length&&(i=(s=i)!==null&&s!==void 0?s:a,r=a,a!==0&&l<n&&(n=l))}return e.map((a,u)=>u===0?a:a.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,r+1)}function cn(e){let t=0;for(;t<e.length&&tt(e.charCodeAt(t));)++t;return t}var st=f(()=>{xe()});var o,_e=f(()=>{(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",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"})(o||(o={}))});function at(e){return e===o.BANG||e===o.DOLLAR||e===o.AMP||e===o.PAREN_L||e===o.PAREN_R||e===o.SPREAD||e===o.COLON||e===o.EQUALS||e===o.AT||e===o.BRACKET_L||e===o.BRACKET_R||e===o.BRACE_L||e===o.PIPE||e===o.BRACE_R}function F(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function ee(e,t){return ct(e.charCodeAt(t))&&ut(e.charCodeAt(t+1))}function ct(e){return e>=55296&&e<=56319}function ut(e){return e>=56320&&e<=57343}function v(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return o.EOF;if(n>=32&&n<=126){let i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function E(e,t,n,i,r){let s=e.line,a=1+n-e.lineStart;return new U(t,n,i,s,a,r)}function un(e,t){let n=e.source.body,i=n.length,r=t;for(;r<i;){let s=n.charCodeAt(r);switch(s){case 65279:case 9:case 32:case 44:++r;continue;case 10:++r,++e.line,e.lineStart=r;continue;case 13:n.charCodeAt(r+1)===10?r+=2:++r,++e.line,e.lineStart=r;continue;case 35:return ln(e,r);case 33:return E(e,o.BANG,r,r+1);case 36:return E(e,o.DOLLAR,r,r+1);case 38:return E(e,o.AMP,r,r+1);case 40:return E(e,o.PAREN_L,r,r+1);case 41:return E(e,o.PAREN_R,r,r+1);case 46:if(n.charCodeAt(r+1)===46&&n.charCodeAt(r+2)===46)return E(e,o.SPREAD,r,r+3);break;case 58:return E(e,o.COLON,r,r+1);case 61:return E(e,o.EQUALS,r,r+1);case 64:return E(e,o.AT,r,r+1);case 91:return E(e,o.BRACKET_L,r,r+1);case 93:return E(e,o.BRACKET_R,r,r+1);case 123:return E(e,o.BRACE_L,r,r+1);case 124:return E(e,o.PIPE,r,r+1);case 125:return E(e,o.BRACE_R,r,r+1);case 34:return n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34?En(e,r):fn(e,r)}if(P(s)||s===45)return pn(e,r,s);if(Ne(s))return Tn(e,r);throw m(e.source,r,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:F(s)||ee(n,r)?`Unexpected character: ${v(e,r)}.`:`Invalid character: ${v(e,r)}.`)}return E(e,o.EOF,i,i)}function ln(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let s=n.charCodeAt(r);if(s===10||s===13)break;if(F(s))++r;else if(ee(n,r))r+=2;else break}return E(e,o.COMMENT,t,r,n.slice(t+1,r))}function pn(e,t,n){let i=e.source.body,r=t,s=n,a=!1;if(s===45&&(s=i.charCodeAt(++r)),s===48){if(s=i.charCodeAt(++r),P(s))throw m(e.source,r,`Invalid number, unexpected digit after 0: ${v(e,r)}.`)}else r=ye(e,r,s),s=i.charCodeAt(r);if(s===46&&(a=!0,s=i.charCodeAt(++r),r=ye(e,r,s),s=i.charCodeAt(r)),(s===69||s===101)&&(a=!0,s=i.charCodeAt(++r),(s===43||s===45)&&(s=i.charCodeAt(++r)),r=ye(e,r,s),s=i.charCodeAt(r)),s===46||Ne(s))throw m(e.source,r,`Invalid number, expected digit but got: ${v(e,r)}.`);return E(e,a?o.FLOAT:o.INT,t,r,i.slice(t,r))}function ye(e,t,n){if(!P(n))throw m(e.source,t,`Invalid number, expected digit but got: ${v(e,t)}.`);let i=e.source.body,r=t+1;for(;P(i.charCodeAt(r));)++r;return r}function fn(e,t){let n=e.source.body,i=n.length,r=t+1,s=r,a="";for(;r<i;){let u=n.charCodeAt(r);if(u===34)return a+=n.slice(s,r),E(e,o.STRING,t,r+1,a);if(u===92){a+=n.slice(s,r);let l=n.charCodeAt(r+1)===117?n.charCodeAt(r+2)===123?hn(e,r):dn(e,r):mn(e,r);a+=l.value,r+=l.size,s=r;continue}if(u===10||u===13)break;if(F(u))++r;else if(ee(n,r))r+=2;else throw m(e.source,r,`Invalid character within String: ${v(e,r)}.`)}throw m(e.source,r,"Unterminated string.")}function hn(e,t){let n=e.source.body,i=0,r=3;for(;r<12;){let s=n.charCodeAt(t+r++);if(s===125){if(r<5||!F(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|Y(s),i<0)break}throw m(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}function dn(e,t){let n=e.source.body,i=ot(n,t+2);if(F(i))return{value:String.fromCodePoint(i),size:6};if(ct(i)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let r=ot(n,t+8);if(ut(r))return{value:String.fromCodePoint(i,r),size:12}}throw m(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function ot(e,t){return Y(e.charCodeAt(t))<<12|Y(e.charCodeAt(t+1))<<8|Y(e.charCodeAt(t+2))<<4|Y(e.charCodeAt(t+3))}function Y(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function mn(e,t){let 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 m(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function En(e,t){let n=e.source.body,i=n.length,r=e.lineStart,s=t+3,a=s,u="",l=[];for(;s<i;){let N=n.charCodeAt(s);if(N===34&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34){u+=n.slice(a,s),l.push(u);let d=E(e,o.BLOCK_STRING,t,s+3,it(l).join(`
|
|
11
|
+
`));return e.line+=l.length-1,e.lineStart=r,d}if(N===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){u+=n.slice(a,s),a=s+1,s+=4;continue}if(N===10||N===13){u+=n.slice(a,s),l.push(u),N===13&&n.charCodeAt(s+1)===10?s+=2:++s,u="",a=s,r=s;continue}if(F(N))++s;else if(ee(n,s))s+=2;else throw m(e.source,s,`Invalid character within String: ${v(e,s)}.`)}throw m(e.source,s,"Unterminated string.")}function Tn(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let s=n.charCodeAt(r);if(rt(s))++r;else break}return E(e,o.NAME,t,r,n.slice(t,r))}var Z,lt=f(()=>{Te();z();st();xe();_e();Z=class{constructor(t){let n=new U(o.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!==o.EOF)do if(t.next)t=t.next;else{let n=un(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===o.COMMENT);return t}}});function te(e,t){if(!!!e)throw new Error(t)}var pt=f(()=>{});function ft(e){return ne(e,[])}function ne(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return Nn(e,t);default:return String(e)}}function Nn(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(xn(e)){let i=e.toJSON();if(i!==e)return typeof i=="string"?i:ne(i,n)}else if(Array.isArray(e))return yn(e,n);return _n(e,n)}function xn(e){return typeof e.toJSON=="function"}function _n(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>2?"["+In(e)+"]":"{ "+n.map(([r,s])=>r+": "+ne(s,t)).join(", ")+" }"}function yn(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),i=e.length-n,r=[];for(let s=0;s<n;++s)r.push(ne(e[s],t));return i===1?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function In(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}var ht=f(()=>{});var dt,mt=f(()=>{dt=function(t,n){return t instanceof n}});function Et(e){return dt(e,j)}var j,Tt=f(()=>{pt();ht();mt();j=class{constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||te(!1,`Body must be a string. Received: ${ft(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||te(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||te(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}});function Nt(e,t){return new Ie(e,t).parseDocument()}function re(e){let t=e.value;return xt(e.kind)+(t!=null?` "${t}"`:"")}function xt(e){return at(e)?`"${e}"`:e}var Ie,_t=f(()=>{Te();z();Ze();et();lt();Tt();_e();Ie=class{constructor(t,n={}){let i=Et(t)?t:new j(t);this._lexer=new Z(i),this._options=n,this._tokenCounter=0}parseName(){let t=this.expectToken(o.NAME);return this.node(t,{kind:c.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:c.DOCUMENT,definitions:this.many(o.SOF,this.parseDefinition,o.EOF)})}parseDefinition(){if(this.peek(o.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===o.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()}if(t)throw m(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(o.BRACE_L))return this.node(t,{kind:c.OPERATION_DEFINITION,operation:S.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let n=this.parseOperationType(),i;return this.peek(o.NAME)&&(i=this.parseName()),this.node(t,{kind:c.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(o.NAME);switch(t.value){case"query":return S.QUERY;case"mutation":return S.MUTATION;case"subscription":return S.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(o.PAREN_L,this.parseVariableDefinition,o.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:c.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(o.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(o.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(o.DOLLAR),this.node(t,{kind:c.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:c.SELECTION_SET,selections:this.many(o.BRACE_L,this.parseSelection,o.BRACE_R)})}parseSelection(){return this.peek(o.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),i,r;return this.expectOptionalToken(o.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:c.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(o.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(o.PAREN_L,n,o.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,i=this.parseName();return this.expectToken(o.COLON),this.node(n,{kind:c.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(o.SPREAD);let n=this.expectOptionalKeyword("on");return!n&&this.peek(o.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(){let t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:c.FRAGMENT_DEFINITION,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,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case o.BRACKET_L:return this.parseList(t);case o.BRACE_L:return this.parseObject(t);case o.INT:return this.advanceLexer(),this.node(n,{kind:c.INT,value:n.value});case o.FLOAT:return this.advanceLexer(),this.node(n,{kind:c.FLOAT,value:n.value});case o.STRING:case o.BLOCK_STRING:return this.parseStringLiteral();case o.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 o.DOLLAR:if(t)if(this.expectToken(o.DOLLAR),this._lexer.token.kind===o.NAME){let i=this._lexer.token.value;throw m(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(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:c.STRING,value:t.value,block:t.kind===o.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:c.LIST,values:this.any(o.BRACKET_L,n,o.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:c.OBJECT,fields:this.any(o.BRACE_L,n,o.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,i=this.parseName();return this.expectToken(o.COLON),this.node(n,{kind:c.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(o.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(o.AT),this.node(n,{kind:c.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(o.BRACKET_L)){let i=this.parseTypeReference();this.expectToken(o.BRACKET_R),n=this.node(t,{kind:c.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(o.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(o.STRING)||this.peek(o.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let i=this.parseConstDirectives(),r=this.many(o.BRACE_L,this.parseOperationTypeDefinition,o.BRACE_R);return this.node(t,{kind:c.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(o.COLON);let i=this.parseNamedType();return this.node(t,{kind:c.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:c.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:c.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(o.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(o.BRACE_L,this.parseFieldDefinition,o.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(o.COLON);let s=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(t,{kind:c.FIELD_DEFINITION,description:n,name:i,arguments:r,type:s,directives:a})}parseArgumentDefs(){return this.optionalMany(o.PAREN_L,this.parseInputValueDef,o.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(o.COLON);let r=this.parseTypeReference(),s;this.expectOptionalToken(o.EQUALS)&&(s=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(t,{kind:c.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:s,directives:a})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:c.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:a})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let i=this.parseName(),r=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:c.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(o.EQUALS)?this.delimitedMany(o.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let i=this.parseName(),r=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:c.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:s})}parseEnumValuesDefinition(){return this.optionalMany(o.BRACE_L,this.parseEnumValueDefinition,o.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:c.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw m(this._lexer.source,this._lexer.token.start,`${re(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let i=this.parseName(),r=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(o.BRACE_L,this.parseInputValueDef,o.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===o.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.optionalMany(o.BRACE_L,this.parseOperationTypeDefinition,o.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(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let 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(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:c.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:c.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(o.AT);let i=this.parseName(),r=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:c.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:s,locations:a})}parseDirectiveLocations(){return this.delimitedMany(o.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(K,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new W(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw m(this._lexer.source,n.start,`Expected ${xt(t)}, found ${re(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===o.NAME&&n.value===t)this.advanceLexer();else throw m(this._lexer.source,n.start,`Expected "${t}", found ${re(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===o.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t??this._lexer.token;return m(this._lexer.source,n.start,`Unexpected ${re(n)}.`)}any(t,n,i){this.expectToken(t);let r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(t,n,i){this.expectToken(t);let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);let i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(t!==void 0&&n.kind!==o.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw m(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}});function On(e,t){let n=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(n,t)}var yt,It=f(()=>{yt=On});var Ot={};De(Ot,{graphql:()=>Cn});function Dn(e){let t=[],{startToken:n,endToken:i}=e.loc;for(let r=n;r!==i;r=r.next)r.kind==="Comment"&&t.push(r);return t}function An(e){if((e==null?void 0:e.name)==="GraphQLError"){let{message:t,locations:[n]}=e;return yt(t,{loc:{start:n},cause:e})}return e}function kn(e){let t;try{t=Nt(e,gn)}catch(n){throw An(n)}return t.comments=Dn(t),t}var gn,Cn,Dt=f(()=>{_t();It();fe();he();gn={allowLegacyFragmentVariables:!0};Cn={parse:kn,astFormat:"graphql",hasPragma:Pe,locStart:q,locEnd:Q}});var Oe={};De(Oe,{languages:()=>Ye,options:()=>$e,parsers:()=>vn,printers:()=>Sn});function At(e){let t=Object.create(null);for(let{importParsers:n,parserNames:i}of e)for(let r of i)t[r]=async()=>Object.assign(t,await n())[r];return t}var ge=At;var kt=(e,t,n,i)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(n,i):n.global?t.replace(n,i):t.split(n).join(i)},$=kt;var se="indent";var oe="group";var ae="if-break";var w="line";var ce="break-parent";var Ae=()=>{},L=Ae,ue=Ae;function _(e){return L(e),{type:se,contents:e}}function I(e,t={}){return L(e),ue(t.expandedStates,!0),{type:oe,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function D(e,t="",n={}){return L(e),t!==""&&L(t),{type:ae,breakContents:e,flatContents:t,groupId:n.groupId}}var Mt={type:ce};var Yt={type:w,hard:!0};var C={type:w},p={type:w,soft:!0},h=[Yt,Mt];function T(e,t){L(e),ue(t);let n=[];for(let i=0;i<t.length;i++)i!==0&&n.push(e),n.push(t[i]);return n}function jt(e,t,n){let i=!!(n!=null&&n.backwards);if(t===!1)return!1;let r=e.charAt(t);if(i){if(e.charAt(t-1)==="\r"&&r===`
|
|
12
|
+
`)return t-2;if(r===`
|
|
13
|
+
`||r==="\r"||r==="\u2028"||r==="\u2029")return t-1}else{if(r==="\r"&&e.charAt(t+1)===`
|
|
14
|
+
`)return t+2;if(r===`
|
|
15
|
+
`||r==="\r"||r==="\u2028"||r==="\u2029")return t+1}return t}var G=jt;function J(e){return(t,n,i)=>{let r=!!(i!=null&&i.backwards);if(n===!1)return!1;let{length:s}=t,a=n;for(;a>=0&&a<s;){let u=t.charAt(a);if(e instanceof RegExp){if(!e.test(u))return a}else if(!e.includes(u))return a;r?a--:a++}return a===-1||a===s?a:!1}}var Kn=J(/\s/),X=J(" "),ke=J(",; "),Ce=J(/[^\n\r]/);function $t(e,t){if(t===!1)return!1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let n=t+2;n<e.length;++n)if(e.charAt(n)==="*"&&e.charAt(n+1)==="/")return n+2}return t}var Se=$t;function Gt(e,t){return t===!1?!1:e.charAt(t)==="/"&&e.charAt(t+1)==="/"?Ce(e,t):t}var ve=Gt;function Jt(e,t,n={}){let i=X(e,n.backwards?t-1:t,n),r=G(e,i,n);return i!==r}var be=Jt;function Xt(e,t){let n=null,i=t;for(;i!==n;)n=i,i=ke(e,i),i=Se(e,i),i=X(e,i);return i=ve(e,i),i=G(e,i),i!==!1&&be(e,i)}var Le=Xt;function qt(e){return Array.isArray(e)&&e.length>0}var le=qt;var pe=class extends Error{name="UnexpectedNodeError";constructor(t,n,i="type"){super(`Unexpected ${n} node ${i}: ${JSON.stringify(t[i])}.`),this.node=t}},Re=pe;fe();he();var V=null;function B(e){if(V!==null&&typeof V.property){let t=V;return V=B.prototype=null,t}return V=B.prototype=e??Object.create(null),new B}var Qt=10;for(let e=0;e<=Qt;e++)B();function de(e){return B(e)}function Wt(e,t="type"){de(e);function n(i){let r=i[t],s=e[r];if(!Array.isArray(s))throw Object.assign(new Error(`Missing visitor keys for '${r}'.`),{node:i});return s}return n}var we=Wt;z();var Ht=we(H,"kind"),Ve=Ht;function zt(e,t,n){let{node:i}=e;if(!i.description)return"";let r=[n("description")];return i.kind==="InputValueDefinition"&&!i.description.block?r.push(C):r.push(h),r}var A=zt;function Kt(e,t,n){let{node:i}=e;switch(i.kind){case"Document":return[...T(h,k(e,t,n,"definitions")),h];case"OperationDefinition":{let r=t.originalText[q(i)]!=="{",s=!!i.name;return[r?i.operation:"",r&&s?[" ",n("name")]:"",r&&!s&&le(i.variableDefinitions)?" ":"",Be(e,n),y(e,n,i),!r&&!s?"":" ",n("selectionSet")]}case"FragmentDefinition":return["fragment ",n("name"),Be(e,n)," on ",n("typeCondition"),y(e,n,i)," ",n("selectionSet")];case"SelectionSet":return["{",_([h,T(h,k(e,t,n,"selections"))]),h,"}"];case"Field":return I([i.alias?[n("alias"),": "]:"",n("name"),i.arguments.length>0?I(["(",_([p,T([D("",", "),p],k(e,t,n,"arguments"))]),p,")"]):"",y(e,n,i),i.selectionSet?" ":"",n("selectionSet")]);case"Name":return i.value;case"StringValue":if(i.block){let r=$(!1,i.value,'"""','\\"""').split(`
|
|
16
|
+
`);return r.length===1&&(r[0]=r[0].trim()),r.every(s=>s==="")&&(r.length=0),T(h,['"""',...r,'"""'])}return['"',$(!1,$(!1,i.value,/["\\]/g,"\\$&"),`
|
|
17
|
+
`,"\\n"),'"'];case"IntValue":case"FloatValue":case"EnumValue":return i.value;case"BooleanValue":return i.value?"true":"false";case"NullValue":return"null";case"Variable":return["$",n("name")];case"ListValue":return I(["[",_([p,T([D("",", "),p],e.map(n,"values"))]),p,"]"]);case"ObjectValue":{let r=t.bracketSpacing&&i.fields.length>0?" ":"";return I(["{",r,_([p,T([D("",", "),p],e.map(n,"fields"))]),p,D("",r),"}"])}case"ObjectField":case"Argument":return[n("name"),": ",n("value")];case"Directive":return["@",n("name"),i.arguments.length>0?I(["(",_([p,T([D("",", "),p],k(e,t,n,"arguments"))]),p,")"]):""];case"NamedType":return n("name");case"VariableDefinition":return[n("variable"),": ",n("type"),i.defaultValue?[" = ",n("defaultValue")]:"",y(e,n,i)];case"ObjectTypeExtension":case"ObjectTypeDefinition":case"InputObjectTypeExtension":case"InputObjectTypeDefinition":case"InterfaceTypeExtension":case"InterfaceTypeDefinition":{let{kind:r}=i,s=[];return r.endsWith("TypeDefinition")?s.push(A(e,t,n)):s.push("extend "),r.startsWith("ObjectType")?s.push("type"):r.startsWith("InputObjectType")?s.push("input"):s.push("interface"),s.push(" ",n("name")),!r.startsWith("InputObjectType")&&i.interfaces.length>0&&s.push(" implements ",...tn(e,t,n)),s.push(y(e,n,i)),i.fields.length>0&&s.push([" {",_([h,T(h,k(e,t,n,"fields"))]),h,"}"]),s}case"FieldDefinition":return[A(e,t,n),n("name"),i.arguments.length>0?I(["(",_([p,T([D("",", "),p],k(e,t,n,"arguments"))]),p,")"]):"",": ",n("type"),y(e,n,i)];case"DirectiveDefinition":return[A(e,t,n),"directive ","@",n("name"),i.arguments.length>0?I(["(",_([p,T([D("",", "),p],k(e,t,n,"arguments"))]),p,")"]):"",i.repeatable?" repeatable":""," on ",...T(" | ",e.map(n,"locations"))];case"EnumTypeExtension":case"EnumTypeDefinition":return[A(e,t,n),i.kind==="EnumTypeExtension"?"extend ":"","enum ",n("name"),y(e,n,i),i.values.length>0?[" {",_([h,T(h,k(e,t,n,"values"))]),h,"}"]:""];case"EnumValueDefinition":return[A(e,t,n),n("name"),y(e,n,i)];case"InputValueDefinition":return[A(e,t,n),n("name"),": ",n("type"),i.defaultValue?[" = ",n("defaultValue")]:"",y(e,n,i)];case"SchemaExtension":return["extend schema",y(e,n,i),...i.operationTypes.length>0?[" {",_([h,T(h,k(e,t,n,"operationTypes"))]),h,"}"]:[]];case"SchemaDefinition":return[A(e,t,n),"schema",y(e,n,i)," {",i.operationTypes.length>0?_([h,T(h,k(e,t,n,"operationTypes"))]):"",h,"}"];case"OperationTypeDefinition":return[i.operation,": ",n("type")];case"FragmentSpread":return["...",n("name"),y(e,n,i)];case"InlineFragment":return["...",i.typeCondition?[" on ",n("typeCondition")]:"",y(e,n,i)," ",n("selectionSet")];case"UnionTypeExtension":case"UnionTypeDefinition":return I([A(e,t,n),I([i.kind==="UnionTypeExtension"?"extend ":"","union ",n("name"),y(e,n,i),i.types.length>0?[" =",D(""," "),_([D([C," "]),T([C,"| "],e.map(n,"types"))])]:""])]);case"ScalarTypeExtension":case"ScalarTypeDefinition":return[A(e,t,n),i.kind==="ScalarTypeExtension"?"extend ":"","scalar ",n("name"),y(e,n,i)];case"NonNullType":return[n("type"),"!"];case"ListType":return["[",n("type"),"]"];default:throw new Re(i,"Graphql","kind")}}function y(e,t,n){if(n.directives.length===0)return"";let i=T(C,e.map(t,"directives"));return n.kind==="FragmentDefinition"||n.kind==="OperationDefinition"?I([C,i]):[" ",I(_([p,i]))]}function k(e,t,n,i){return e.map(({isLast:r,node:s})=>{let a=n();return!r&&Le(t.originalText,Q(s))?[a,h]:a},i)}function Zt(e){return e.kind!=="Comment"}function en(e){let t=e.node;if(t.kind==="Comment")return"#"+t.value.trimEnd();throw new Error("Not a comment: "+JSON.stringify(t))}function tn(e,t,n){let{node:i}=e,r=[],{interfaces:s}=i,a=e.map(n,"interfaces");for(let u=0;u<s.length;u++){let l=s[u];r.push(a[u]);let N=s[u+1];if(N){let g=t.originalText.slice(l.loc.end,N.loc.start).includes("#");r.push(" &",g?C:" ")}}return r}function Be(e,t){let{node:n}=e;return le(n.variableDefinitions)?I(["(",_([p,T([D("",", "),p],e.map(t,"variableDefinitions"))]),p,")"]):""}function Ue(e,t){e.kind==="StringValue"&&e.block&&!e.value.includes(`
|
|
18
|
+
`)&&(t.value=t.value.trim())}Ue.ignoredProperties=new Set(["loc","comments"]);function nn(e){var n;let{node:t}=e;return(n=t==null?void 0:t.comments)==null?void 0:n.some(i=>i.value.trim()==="prettier-ignore")}var rn={print:Kt,massageAstNode:Ue,hasPrettierIgnore:nn,insertPragma:Fe,printComment:en,canAttachComment:Zt,getVisitorKeys:Ve},Me=rn;var Ye=[{linguistLanguageId:139,name:"GraphQL",type:"data",color:"#e10098",extensions:[".graphql",".gql",".graphqls"],tmScope:"source.graphql",aceMode:"text",parsers:["graphql"],vscodeLanguageIds:["graphql"]}];var je={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var sn={bracketSpacing:je.bracketSpacing},$e=sn;var Sn={graphql:Me},vn=ge([{importParsers:()=>Promise.resolve().then(()=>(Dt(),Ot)),parserNames:["graphql"]}]);export{Oe as default,Ye as languages,$e as options,vn as parsers,Sn as printers};
|