diff --git a/Cargo.lock b/Cargo.lock index a516dcdb7eb60..f124606f31038 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -697,7 +697,7 @@ dependencies = [ [[package]] name = "arrow-udf-js-deno" version = "0.0.1" -source = "git+https://github.com/risingwavelabs/arrow-udf.git?rev=1381842#13818424f07d4494509ae82dfb4fab9ef105b90e" +source = "git+https://github.com/bakjos/arrow-udf.git?rev=a810d2c#a810d2cc247e7bdd0ffdc6cecfe98c0192211e19" dependencies = [ "anyhow", "arrow-array 50.0.0", @@ -719,7 +719,7 @@ dependencies = [ [[package]] name = "arrow-udf-js-deno-runtime" version = "0.0.1" -source = "git+https://github.com/risingwavelabs/arrow-udf.git?rev=1381842#13818424f07d4494509ae82dfb4fab9ef105b90e" +source = "git+https://github.com/bakjos/arrow-udf.git?rev=a810d2c#a810d2cc247e7bdd0ffdc6cecfe98c0192211e19" dependencies = [ "anyhow", "deno_ast", diff --git a/Cargo.toml b/Cargo.toml index 7a1aef81fb011..8164048e1f753 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -66,7 +66,7 @@ members = [ "src/utils/workspace-config", "src/workspace-hack", ] -exclude = ["e2e_test/udf/wasm", "lints"] +exclude = ["e2e_test/udf/sse/server", "e2e_test/udf/wasm", "lints"] resolver = "2" [workspace.package] @@ -138,7 +138,8 @@ arrow-select = "50" arrow-ord = "50" arrow-row = "50" arrow-udf-js = "0.1" -arrow-udf-js-deno = { git = "https://github.com/risingwavelabs/arrow-udf.git", rev = "1381842" } +# FIXME: Use the latest version of arrow-udf-js-deno when it is released. +arrow-udf-js-deno = { git = "https://github.com/bakjos/arrow-udf.git", rev = "a810d2c" } arrow-udf-wasm = { version = "0.2", features = ["build"] } arrow-udf-python = { git = "https://github.com/risingwavelabs/arrow-udf.git", rev = "6c32f71" } arrow-array-deltalake = { package = "arrow-array", version = "48.0.1" } diff --git a/ci/scripts/build-other.sh b/ci/scripts/build-other.sh index 2311e5164fe74..5284b3cc92801 100755 --- a/ci/scripts/build-other.sh +++ b/ci/scripts/build-other.sh @@ -11,6 +11,11 @@ cd e2e_test/udf/wasm cargo build --release cd ../../.. +echo "--- Build sse-server" +cd e2e_test/udf/sse/server +cargo build --release +cd ../../../.. + echo "--- Build Java packages" cd java mvn -B package -Dmaven.test.skip=true diff --git a/ci/scripts/run-e2e-test.sh b/ci/scripts/run-e2e-test.sh index d1c13a02f1ec5..00b821cc39f94 100755 --- a/ci/scripts/run-e2e-test.sh +++ b/ci/scripts/run-e2e-test.sh @@ -122,6 +122,7 @@ sqllogictest -p 4566 -d dev './e2e_test/udf/wasm_udf.slt' sqllogictest -p 4566 -d dev './e2e_test/udf/rust_udf.slt' sqllogictest -p 4566 -d dev './e2e_test/udf/js_udf.slt' sqllogictest -p 4566 -d dev './e2e_test/udf/python_udf.slt' +sqllogictest -p 4566 -d dev './e2e_test/udf/deno_udf.slt' echo "--- Kill cluster" cluster_stop diff --git a/e2e_test/udf/deno_udf.slt b/e2e_test/udf/deno_udf.slt new file mode 100644 index 0000000000000..d9b4be2470f3b --- /dev/null +++ b/e2e_test/udf/deno_udf.slt @@ -0,0 +1,240 @@ +statement ok +CREATE FUNCTION gcd(a int, b int) RETURNS int LANGUAGE javascript RUNTIME deno AS $$ + if(a == null || b == null) { + return null; + } + while (b != 0) { + let t = b; + b = a % b; + a = t; + } + return a; +$$; + +query I +select gcd(25, 15); +---- +5 + +statement ok +drop function gcd; + +statement ok +create function decimal_add(a decimal, b decimal) returns decimal language javascript RUNTIME deno as $$ + return a.add(b); +$$; + +query R +select decimal_add(1.11, 2.22); +---- +3.33 + +statement ok +drop function decimal_add; + + +statement ok +create function to_string(a boolean, b smallint, c int, d bigint, e real, f float, g decimal, h varchar, i bytea, j jsonb) returns varchar language javascript RUNTIME deno as $$ + return a.toString() + b.toString() + c.toString() + d.toString() + e.toString() + f.toString() + g.toString() + h.toString() + i.toString() + JSON.stringify(j); +$$; + +query T +select to_string(false, 1::smallint, 2, 3, 4.5, 6.7, 8.9, 'abc', '\x010203', '{"key": 1}'); +---- +false1234.56.78.9abc1,2,3{"key":1} + +statement ok +drop function to_string; + +# show data types in javascript +statement ok +create function js_typeof(a boolean, b smallint, c int, d bigint, e real, f float, g decimal, h varchar, i bytea, j jsonb) returns jsonb language javascript RUNTIME deno as $$ + return { + boolean: typeof a, + smallint: typeof b, + int: typeof c, + bigint: typeof d, + real: typeof e, + float: typeof f, + decimal: typeof g, + varchar: typeof h, + bytea: typeof i, + jsonb: typeof j, + }; +$$; + +query T +select js_typeof(false, 1::smallint, 2, 3, 4.5, 6.7, 8.9, 'abc', '\x010203', '{"key": 1}'); +---- +{"bigint": "bigint", "boolean": "boolean", "bytea": "object", "decimal": "object", "float": "number", "int": "number", "jsonb": "object", "real": "number", "smallint": "number", "varchar": "string"} + +statement ok +drop function js_typeof; + +statement ok +create function return_all(a boolean, b smallint, c int, d bigint, e real, f float, g decimal, h varchar, i bytea, j jsonb, s struct) +returns struct> +language javascript runtime deno as $$ + return {a,b,c,d,e,f,g,h,i,j,s}; +$$; + +query T +select (return_all( + true, + 1 ::smallint, + 1, + 1, + 1, + 1, + 12345678901234567890.12345678, + 'string', + 'bytes', + '{"key":1}', + row(1, 2)::struct +)).*; +---- +t 1 1 1 1 1 12345678901234567890.12345678 string \x6279746573 {"key": 1} (1,2) + +statement ok +drop function return_all; + + +statement ok +create function series(n int) returns table (x int) language javascript RUNTIME deno as $$ + for(let i = 0; i < n; i++) { + yield i; + } +$$; + +query I +select series(5); +---- +0 +1 +2 +3 +4 + +statement ok +drop function series; + + +statement ok +create function split(s varchar) returns table (word varchar, length int) language javascript RUNTIME deno as $$ + for(let word of s.split(' ')) { + yield { word: word, length: word.length }; + } +$$; + +query IT +select * from split('rising wave'); +---- +rising 6 +wave 4 + +statement ok +drop function split; + + +statement ok +CREATE FUNCTION digest( t string ) RETURNS bytea LANGUAGE javascript RUNTIME deno AS $$ + const subtle = crypto.subtle; + const key = await subtle.generateKey({ + name: 'HMAC', + hash: 'SHA-256', + length: 256, + }, true, ['sign', 'verify']); + + const enc = new TextEncoder(); + const message = enc.encode(t); + + const result = await subtle.sign({ + name: 'HMAC', + }, key, message); + console.log('result', result); + return result; +$$ ASYNC; + +query I +select bit_length(digest('Hello')); +---- +256 + +statement ok +drop function digest; + +statement ok +CREATE FUNCTION delay_response() + RETURNS TABLE (x int) LANGUAGE javascript RUNTIME deno AS $$ + const delayedResponses = { + delays: [50, 10, 15], + wait(delay) { + return new Promise((resolve) => { + setTimeout(resolve, delay); + }); + }, + + async *[Symbol.asyncIterator]() { + for (const delay of this.delays) { + await this.wait(delay); + yield delay; + } + }, + }; + return delayedResponses; +$$ SYNC; + +query I +select * FROM delay_response(); +---- +50 +10 +15 + +statement ok +drop function delay_response; + +system ok +python3 e2e_test/udf/mock_server.py & + +# wait for server to start +sleep 1s + +statement ok +CREATE FUNCTION fetch_api() RETURNS TABLE ( data struct< idx int>) LANGUAGE javascript RUNTIME deno AS $$ + const response = await fetch('http://127.0.0.1:4101'); + const resp = await response.json(); + for (const r of resp.results) { + yield r; + } +$$ ASYNC GENERATOR; + +query I +select * FROM fetch_api(); +---- +1 +2 + +statement ok +drop function fetch_api; + +system ok +pkill -9 python3 + +system ok +e2e_test/udf/sse/server/target/release/sse-server & + +statement ok +CREATE FUNCTION call_sse() RETURNS TABLE ( data struct>) LANGUAGE javascript RUNTIME deno USING LINK 'fs://e2e_test/udf/sse/bundled.table.js' SYNC; + +query I +select * FROM call_sse(); +---- +(Hi) +(Bonjour) +(Hola) +(Ciao) +(Zdravo) + +system ok +pkill -9 sse-server \ No newline at end of file diff --git a/e2e_test/udf/mock_server.py b/e2e_test/udf/mock_server.py new file mode 100644 index 0000000000000..2008d1ac71b3c --- /dev/null +++ b/e2e_test/udf/mock_server.py @@ -0,0 +1,24 @@ +import http.server +import sys + +class MockHTTPRequestHandler(http.server.BaseHTTPRequestHandler): + """HTTPServer mock request handler""" + + def do_GET(self): # pylint: disable=invalid-name + """Handle GET requests""" + self.send_response(200) + self.send_header("Content-Type", "application/json") + self.end_headers() + self.wfile.write(b'{"results": [{"idx": 1}, {"idx": 2}]}') + + def log_request(self, code=None, size=None): + """Don't log anything""" + +def main() -> int: + """Echo the input arguments to standard output""" + + httpd = http.server.HTTPServer( ("127.0.0.1", 4101), MockHTTPRequestHandler) + httpd.serve_forever() + +if __name__ == '__main__': + sys.exit(main()) \ No newline at end of file diff --git a/e2e_test/udf/sse/bundled.table.js b/e2e_test/udf/sse/bundled.table.js new file mode 100644 index 0000000000000..91c7b3dd2af87 --- /dev/null +++ b/e2e_test/udf/sse/bundled.table.js @@ -0,0 +1,186 @@ +//This code was generated using esbuild +var z=(()=>{var h=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Pn=h(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.isObject=void 0;function Zd(e){return typeof e=="object"&&e!==null}jn.isObject=Zd});var dr=h(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.isAsyncGenerator=Re.isAsyncIterable=Re.parseStreamData=Re.print=Re.validateStreamEvent=Re.TOKEN_QUERY_KEY=Re.TOKEN_HEADER_KEY=void 0;var ef=Pn();Re.TOKEN_HEADER_KEY="x-graphql-event-stream-token";Re.TOKEN_QUERY_KEY="token";function tf(e){if(e=e,e!=="next"&&e!=="complete")throw new Error(`Invalid stream event "${e}"`);return e}Re.validateStreamEvent=tf;function rf(e){let t=`event: ${e.event} +data:`;return e.data&&(t+=" ",t+=JSON.stringify(e.data)),t+=` + +`,t}Re.print=rf;function nf(e,t){if(t)try{t=JSON.parse(t)}catch{throw new Error("Invalid stream data")}if(e==="next"&&!t)throw new Error('Stream data must be an object for "next" events');return t||null}Re.parseStreamData=nf;function sf(e){return typeof Object(e)[Symbol.asyncIterator]=="function"}Re.isAsyncIterable=sf;function af(e){return(0,ef.isObject)(e)&&typeof Object(e)[Symbol.asyncIterator]=="function"&&typeof e.return=="function"&&typeof e.throw=="function"&&typeof e.next=="function"}Re.isAsyncGenerator=af});var Gu=h(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.versionInfo=fr.version=void 0;var of="16.8.1";fr.version=of;var uf=Object.freeze({major:16,minor:8,patch:1,preReleaseTag:null});fr.versionInfo=uf});var Fe=h(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.devAssert=cf;function cf(e,t){if(!!!e)throw new Error(t)}});var wn=h(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.isPromise=lf;function lf(e){return typeof e?.then=="function"}});var pt=h(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.isObjectLike=pf;function pf(e){return typeof e=="object"&&e!==null}});var je=h(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.invariant=df;function df(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}});var Fn=h(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.getLocation=yf;var ff=je(),mf=/\r\n|[\n\r]/g;function yf(e,t){let r=0,n=1;for(let i of e.body.matchAll(mf)){if(typeof i.index=="number"||(0,ff.invariant)(!1),i.index>=t)break;r=i.index+i[0].length,n+=1}return{line:n,column:t+1-r}}});var os=h(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.printLocation=vf;kn.printSourceLocation=Qu;var hf=Fn();function vf(e){return Qu(e.source,(0,hf.getLocation)(e.source,e.start))}function Qu(e,t){let r=e.locationOffset.column-1,n="".padStart(r)+e.body,i=t.line-1,s=e.locationOffset.line-1,a=t.line+s,o=t.line===1?r:0,u=t.column+o,c=`${e.name}:${a}:${u} +`,l=n.split(/\r\n|[\n\r]/g),f=l[i];if(f.length>120){let d=Math.floor(u/80),y=u%80,T=[];for(let I=0;I["|",I]),["|","^".padStart(y)],["|",T[d+1]]])}return c+Cu([[`${a-1} |`,l[i-1]],[`${a} |`,f],["|","^".padStart(u)],[`${a+1} |`,l[i+1]]])}function Cu(e){let t=e.filter(([n,i])=>i!==void 0),r=Math.max(...t.map(([n])=>n.length));return t.map(([n,i])=>n.padStart(r)+(i?" "+i:"")).join(` +`)}});var q=h(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.GraphQLError=void 0;mr.formatError=Ef;mr.printError=gf;var Tf=pt(),Uu=Fn(),Ku=os();function bf(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}var us=class e extends Error{constructor(t,...r){var n,i,s;let{nodes:a,source:o,positions:u,path:c,originalError:l,extensions:f}=bf(r);super(t),this.name="GraphQLError",this.path=c??void 0,this.originalError=l??void 0,this.nodes=$u(Array.isArray(a)?a:a?[a]:void 0);let d=$u((n=this.nodes)===null||n===void 0?void 0:n.map(T=>T.loc).filter(T=>T!=null));this.source=o??(d==null||(i=d[0])===null||i===void 0?void 0:i.source),this.positions=u??d?.map(T=>T.start),this.locations=u&&o?u.map(T=>(0,Uu.getLocation)(o,T)):d?.map(T=>(0,Uu.getLocation)(T.source,T.start));let y=(0,Tf.isObjectLike)(l?.extensions)?l?.extensions:void 0;this.extensions=(s=f??y)!==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}}),l!=null&&l.stack?Object.defineProperty(this,"stack",{value:l.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let r of this.nodes)r.loc&&(t+=` + +`+(0,Ku.printLocation)(r.loc));else if(this.source&&this.locations)for(let r of this.locations)t+=` + +`+(0,Ku.printSourceLocation)(this.source,r);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};mr.GraphQLError=us;function $u(e){return e===void 0||e.length===0?void 0:e}function gf(e){return e.toString()}function Ef(e){return e.toJSON()}});var qn=h(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.syntaxError=Nf;var _f=q();function Nf(e,t,r){return new _f.GraphQLError(`Syntax Error: ${r}`,{source:e,positions:[t]})}});var dt=h(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.Token=Ke.QueryDocumentKeys=Ke.OperationTypeNode=Ke.Location=void 0;Ke.isNode=If;var ls=class{constructor(t,r,n){this.start=t.start,this.end=r.end,this.startToken=t,this.endToken=r,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}};Ke.Location=ls;var ps=class{constructor(t,r,n,i,s,a){this.kind=t,this.start=r,this.end=n,this.line=i,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}}};Ke.Token=ps;var Bu={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"]};Ke.QueryDocumentKeys=Bu;var Of=new Set(Object.keys(Bu));function If(e){let t=e?.kind;return typeof t=="string"&&Of.has(t)}var ds;Ke.OperationTypeNode=ds;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(ds||(Ke.OperationTypeNode=ds={}))});var yr=h(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.DirectiveLocation=void 0;var fs;wr.DirectiveLocation=fs;(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"})(fs||(wr.DirectiveLocation=fs={}))});var H=h(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.Kind=void 0;var ms;Fr.Kind=ms;(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"})(ms||(Fr.Kind=ms={}))});var xn=h(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.isDigit=Yu;Qt.isLetter=ys;Qt.isNameContinue=Df;Qt.isNameStart=Sf;Qt.isWhiteSpace=Lf;function Lf(e){return e===9||e===32}function Yu(e){return e>=48&&e<=57}function ys(e){return e>=97&&e<=122||e>=65&&e<=90}function Sf(e){return ys(e)||e===95}function Df(e){return ys(e)||Yu(e)||e===95}});var qr=h(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.dedentBlockStringLines=Af;kr.isPrintableAsBlockString=jf;kr.printBlockString=Pf;var hs=xn();function Af(e){var t;let r=Number.MAX_SAFE_INTEGER,n=null,i=-1;for(let a=0;ao===0?a:a.slice(r)).slice((t=n)!==null&&t!==void 0?t:0,i+1)}function Rf(e){let t=0;for(;t1&&n.slice(1).every(y=>y.length===0||(0,hs.isWhiteSpace)(y.charCodeAt(0))),a=r.endsWith('\\"""'),o=e.endsWith('"')&&!a,u=e.endsWith("\\"),c=o||u,l=!(t!=null&&t.minimize)&&(!i||e.length>70||c||s||a),f="",d=i&&(0,hs.isWhiteSpace)(e.charCodeAt(0));return(l&&!d||s)&&(f+=` +`),f+=r,(l||c)&&(f+=` +`),'"""'+f+'"""'}});var Vr=h(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.TokenKind=void 0;var vs;xr.TokenKind=vs;(function(e){e.SOF="",e.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"})(vs||(xr.TokenKind=vs={}))});var Mn=h(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.Lexer=void 0;Gr.isPunctuatorTokenKind=Ff;var rt=qn(),Xu=dt(),wf=qr(),Ut=xn(),U=Vr(),bs=class{constructor(t){let r=new Xu.Token(U.TokenKind.SOF,0,0,0,0);this.source=t,this.lastToken=r,this.token=r,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==U.TokenKind.EOF)do if(t.next)t=t.next;else{let r=kf(this,t.end);t.next=r,r.prev=t,t=r}while(t.kind===U.TokenKind.COMMENT);return t}};Gr.Lexer=bs;function Ff(e){return e===U.TokenKind.BANG||e===U.TokenKind.DOLLAR||e===U.TokenKind.AMP||e===U.TokenKind.PAREN_L||e===U.TokenKind.PAREN_R||e===U.TokenKind.SPREAD||e===U.TokenKind.COLON||e===U.TokenKind.EQUALS||e===U.TokenKind.AT||e===U.TokenKind.BRACKET_L||e===U.TokenKind.BRACKET_R||e===U.TokenKind.BRACE_L||e===U.TokenKind.PIPE||e===U.TokenKind.BRACE_R}function hr(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Vn(e,t){return Hu(e.charCodeAt(t))&&zu(e.charCodeAt(t+1))}function Hu(e){return e>=55296&&e<=56319}function zu(e){return e>=56320&&e<=57343}function Kt(e,t){let r=e.source.body.codePointAt(t);if(r===void 0)return U.TokenKind.EOF;if(r>=32&&r<=126){let n=String.fromCodePoint(r);return n==='"'?`'"'`:`"${n}"`}return"U+"+r.toString(16).toUpperCase().padStart(4,"0")}function ve(e,t,r,n,i){let s=e.line,a=1+r-e.lineStart;return new Xu.Token(t,r,n,s,a,i)}function kf(e,t){let r=e.source.body,n=r.length,i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Cf(e,t){let r=e.source.body;switch(r.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:` +`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw(0,rt.syntaxError)(e.source,t,`Invalid character escape sequence: "${r.slice(t,t+2)}".`)}function Qf(e,t){let r=e.source.body,n=r.length,i=e.lineStart,s=t+3,a=s,o="",u=[];for(;s{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.inspect=$f;var Kf=10,Wu=2;function $f(e){return Gn(e,[])}function Gn(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return Bf(e,t);default:return String(e)}}function Bf(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let r=[...t,e];if(Yf(e)){let n=e.toJSON();if(n!==e)return typeof n=="string"?n:Gn(n,r)}else if(Array.isArray(e))return Xf(e,r);return Jf(e,r)}function Yf(e){return typeof e.toJSON=="function"}function Jf(e,t){let r=Object.entries(e);return r.length===0?"{}":t.length>Wu?"["+Hf(e)+"]":"{ "+r.map(([i,s])=>i+": "+Gn(s,t)).join(", ")+" }"}function Xf(e,t){if(e.length===0)return"[]";if(t.length>Wu)return"[Array]";let r=Math.min(Kf,e.length),n=e.length-r,i=[];for(let s=0;s1&&i.push(`... ${n} more items`),"["+i.join(", ")+"]"}function Hf(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let r=e.constructor.name;if(typeof r=="string"&&r!=="")return r}return t}});var Cr=h(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.instanceOf=void 0;var zf=re(),Wf=globalThis.process&&globalThis.process.env.NODE_ENV==="production"?function(t,r){return t instanceof r}:function(t,r){if(t instanceof r)return!0;if(typeof t=="object"&&t!==null){var n;let i=r.prototype[Symbol.toStringTag],s=Symbol.toStringTag in t?t[Symbol.toStringTag]:(n=t.constructor)===null||n===void 0?void 0:n.name;if(i===s){let a=(0,zf.inspect)(t);throw new Error(`Cannot use ${i} "${a}" from another module or realm. + +Ensure that there is only one instance of "graphql" in the node_modules +directory. If different versions of "graphql" are the dependencies of other +relied on modules, use "resolutions" to ensure only one version is installed. + +https://yarnpkg.com/en/docs/selective-version-resolutions + +Duplicate "graphql" modules cannot be used at the same time since different +versions may have different capabilities and behavior. The data from one +version used in the function from another could produce confusing and +spurious results.`)}}return!1};Cn.instanceOf=Wf});var Un=h(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.Source=void 0;Qr.isSource=tm;var Es=Fe(),Zf=re(),em=Cr(),Qn=class{constructor(t,r="GraphQL request",n={line:1,column:1}){typeof t=="string"||(0,Es.devAssert)(!1,`Body must be a string. Received: ${(0,Zf.inspect)(t)}.`),this.body=t,this.name=r,this.locationOffset=n,this.locationOffset.line>0||(0,Es.devAssert)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,Es.devAssert)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};Qr.Source=Qn;function tm(e){return(0,em.instanceOf)(e,Qn)}});var vr=h(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.Parser=void 0;Pt.parse=nm;Pt.parseConstValue=sm;Pt.parseType=am;Pt.parseValue=im;var $t=qn(),Ur=dt(),rm=yr(),M=H(),ec=Mn(),Zu=Un(),O=Vr();function nm(e,t){return new Bt(e,t).parseDocument()}function im(e,t){let r=new Bt(e,t);r.expectToken(O.TokenKind.SOF);let n=r.parseValueLiteral(!1);return r.expectToken(O.TokenKind.EOF),n}function sm(e,t){let r=new Bt(e,t);r.expectToken(O.TokenKind.SOF);let n=r.parseConstValueLiteral();return r.expectToken(O.TokenKind.EOF),n}function am(e,t){let r=new Bt(e,t);r.expectToken(O.TokenKind.SOF);let n=r.parseTypeReference();return r.expectToken(O.TokenKind.EOF),n}var Bt=class{constructor(t,r={}){let n=(0,Zu.isSource)(t)?t:new Zu.Source(t);this._lexer=new ec.Lexer(n),this._options=r,this._tokenCounter=0}parseName(){let t=this.expectToken(O.TokenKind.NAME);return this.node(t,{kind:M.Kind.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:M.Kind.DOCUMENT,definitions:this.many(O.TokenKind.SOF,this.parseDefinition,O.TokenKind.EOF)})}parseDefinition(){if(this.peek(O.TokenKind.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),r=t?this._lexer.lookahead():this._lexer.token;if(r.kind===O.TokenKind.NAME){switch(r.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw(0,$t.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(r.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(r)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(O.TokenKind.BRACE_L))return this.node(t,{kind:M.Kind.OPERATION_DEFINITION,operation:Ur.OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let r=this.parseOperationType(),n;return this.peek(O.TokenKind.NAME)&&(n=this.parseName()),this.node(t,{kind:M.Kind.OPERATION_DEFINITION,operation:r,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(O.TokenKind.NAME);switch(t.value){case"query":return Ur.OperationTypeNode.QUERY;case"mutation":return Ur.OperationTypeNode.MUTATION;case"subscription":return Ur.OperationTypeNode.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(O.TokenKind.PAREN_L,this.parseVariableDefinition,O.TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:M.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(O.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(O.TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(O.TokenKind.DOLLAR),this.node(t,{kind:M.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:M.Kind.SELECTION_SET,selections:this.many(O.TokenKind.BRACE_L,this.parseSelection,O.TokenKind.BRACE_R)})}parseSelection(){return this.peek(O.TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,r=this.parseName(),n,i;return this.expectOptionalToken(O.TokenKind.COLON)?(n=r,i=this.parseName()):i=r,this.node(t,{kind:M.Kind.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(O.TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let r=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(O.TokenKind.PAREN_L,r,O.TokenKind.PAREN_R)}parseArgument(t=!1){let r=this._lexer.token,n=this.parseName();return this.expectToken(O.TokenKind.COLON),this.node(r,{kind:M.Kind.ARGUMENT,name:n,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(O.TokenKind.SPREAD);let r=this.expectOptionalKeyword("on");return!r&&this.peek(O.TokenKind.NAME)?this.node(t,{kind:M.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:M.Kind.INLINE_FRAGMENT,typeCondition:r?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:M.Kind.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:M.Kind.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 r=this._lexer.token;switch(r.kind){case O.TokenKind.BRACKET_L:return this.parseList(t);case O.TokenKind.BRACE_L:return this.parseObject(t);case O.TokenKind.INT:return this.advanceLexer(),this.node(r,{kind:M.Kind.INT,value:r.value});case O.TokenKind.FLOAT:return this.advanceLexer(),this.node(r,{kind:M.Kind.FLOAT,value:r.value});case O.TokenKind.STRING:case O.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case O.TokenKind.NAME:switch(this.advanceLexer(),r.value){case"true":return this.node(r,{kind:M.Kind.BOOLEAN,value:!0});case"false":return this.node(r,{kind:M.Kind.BOOLEAN,value:!1});case"null":return this.node(r,{kind:M.Kind.NULL});default:return this.node(r,{kind:M.Kind.ENUM,value:r.value})}case O.TokenKind.DOLLAR:if(t)if(this.expectToken(O.TokenKind.DOLLAR),this._lexer.token.kind===O.TokenKind.NAME){let n=this._lexer.token.value;throw(0,$t.syntaxError)(this._lexer.source,r.start,`Unexpected variable "$${n}" in constant value.`)}else throw this.unexpected(r);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:M.Kind.STRING,value:t.value,block:t.kind===O.TokenKind.BLOCK_STRING})}parseList(t){let r=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:M.Kind.LIST,values:this.any(O.TokenKind.BRACKET_L,r,O.TokenKind.BRACKET_R)})}parseObject(t){let r=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:M.Kind.OBJECT,fields:this.any(O.TokenKind.BRACE_L,r,O.TokenKind.BRACE_R)})}parseObjectField(t){let r=this._lexer.token,n=this.parseName();return this.expectToken(O.TokenKind.COLON),this.node(r,{kind:M.Kind.OBJECT_FIELD,name:n,value:this.parseValueLiteral(t)})}parseDirectives(t){let r=[];for(;this.peek(O.TokenKind.AT);)r.push(this.parseDirective(t));return r}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let r=this._lexer.token;return this.expectToken(O.TokenKind.AT),this.node(r,{kind:M.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,r;if(this.expectOptionalToken(O.TokenKind.BRACKET_L)){let n=this.parseTypeReference();this.expectToken(O.TokenKind.BRACKET_R),r=this.node(t,{kind:M.Kind.LIST_TYPE,type:n})}else r=this.parseNamedType();return this.expectOptionalToken(O.TokenKind.BANG)?this.node(t,{kind:M.Kind.NON_NULL_TYPE,type:r}):r}parseNamedType(){return this.node(this._lexer.token,{kind:M.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(O.TokenKind.STRING)||this.peek(O.TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.many(O.TokenKind.BRACE_L,this.parseOperationTypeDefinition,O.TokenKind.BRACE_R);return this.node(t,{kind:M.Kind.SCHEMA_DEFINITION,description:r,directives:n,operationTypes:i})}parseOperationTypeDefinition(){let t=this._lexer.token,r=this.parseOperationType();this.expectToken(O.TokenKind.COLON);let n=this.parseNamedType();return this.node(t,{kind:M.Kind.OPERATION_TYPE_DEFINITION,operation:r,type:n})}parseScalarTypeDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("scalar");let n=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:M.Kind.SCALAR_TYPE_DEFINITION,description:r,name:n,directives:i})}parseObjectTypeDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:M.Kind.OBJECT_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:s,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(O.TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(O.TokenKind.BRACE_L,this.parseFieldDefinition,O.TokenKind.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,r=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(O.TokenKind.COLON);let s=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(t,{kind:M.Kind.FIELD_DEFINITION,description:r,name:n,arguments:i,type:s,directives:a})}parseArgumentDefs(){return this.optionalMany(O.TokenKind.PAREN_L,this.parseInputValueDef,O.TokenKind.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,r=this.parseDescription(),n=this.parseName();this.expectToken(O.TokenKind.COLON);let i=this.parseTypeReference(),s;this.expectOptionalToken(O.TokenKind.EQUALS)&&(s=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(t,{kind:M.Kind.INPUT_VALUE_DEFINITION,description:r,name:n,type:i,defaultValue:s,directives:a})}parseInterfaceTypeDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:M.Kind.INTERFACE_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:s,fields:a})}parseUnionTypeDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:M.Kind.UNION_TYPE_DEFINITION,description:r,name:n,directives:i,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(O.TokenKind.EQUALS)?this.delimitedMany(O.TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:M.Kind.ENUM_TYPE_DEFINITION,description:r,name:n,directives:i,values:s})}parseEnumValuesDefinition(){return this.optionalMany(O.TokenKind.BRACE_L,this.parseEnumValueDefinition,O.TokenKind.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,r=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:M.Kind.ENUM_VALUE_DEFINITION,description:r,name:n,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw(0,$t.syntaxError)(this._lexer.source,this._lexer.token.start,`${Kn(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:M.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:r,name:n,directives:i,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(O.TokenKind.BRACE_L,this.parseInputValueDef,O.TokenKind.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===O.TokenKind.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let r=this.parseConstDirectives(),n=this.optionalMany(O.TokenKind.BRACE_L,this.parseOperationTypeDefinition,O.TokenKind.BRACE_R);if(r.length===0&&n.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.SCHEMA_EXTENSION,directives:r,operationTypes:n})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let r=this.parseName(),n=this.parseConstDirectives();if(n.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.SCALAR_TYPE_EXTENSION,name:r,directives:n})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.OBJECT_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:s})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.INTERFACE_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:s})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let r=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.UNION_TYPE_EXTENSION,name:r,directives:n,types:i})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let r=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.ENUM_TYPE_EXTENSION,name:r,directives:n,values:i})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let r=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:r,directives:n,fields:i})}parseDirectiveDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("directive"),this.expectToken(O.TokenKind.AT);let n=this.parseName(),i=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:M.Kind.DIRECTIVE_DEFINITION,description:r,name:n,arguments:i,repeatable:s,locations:a})}parseDirectiveLocations(){return this.delimitedMany(O.TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,r=this.parseName();if(Object.prototype.hasOwnProperty.call(rm.DirectiveLocation,r.value))return r;throw this.unexpected(t)}node(t,r){return this._options.noLocation!==!0&&(r.loc=new Ur.Location(t,this._lexer.lastToken,this._lexer.source)),r}peek(t){return this._lexer.token.kind===t}expectToken(t){let r=this._lexer.token;if(r.kind===t)return this.advanceLexer(),r;throw(0,$t.syntaxError)(this._lexer.source,r.start,`Expected ${tc(t)}, found ${Kn(r)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let r=this._lexer.token;if(r.kind===O.TokenKind.NAME&&r.value===t)this.advanceLexer();else throw(0,$t.syntaxError)(this._lexer.source,r.start,`Expected "${t}", found ${Kn(r)}.`)}expectOptionalKeyword(t){let r=this._lexer.token;return r.kind===O.TokenKind.NAME&&r.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let r=t??this._lexer.token;return(0,$t.syntaxError)(this._lexer.source,r.start,`Unexpected ${Kn(r)}.`)}any(t,r,n){this.expectToken(t);let i=[];for(;!this.expectOptionalToken(n);)i.push(r.call(this));return i}optionalMany(t,r,n){if(this.expectOptionalToken(t)){let i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}return[]}many(t,r,n){this.expectToken(t);let i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}delimitedMany(t,r){this.expectOptionalToken(t);let n=[];do n.push(r.call(this));while(this.expectOptionalToken(t));return n}advanceLexer(){let{maxTokens:t}=this._options,r=this._lexer.advance();if(t!==void 0&&r.kind!==O.TokenKind.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw(0,$t.syntaxError)(this._lexer.source,r.start,`Document contains more that ${t} tokens. Parsing aborted.`)}};Pt.Parser=Bt;function Kn(e){let t=e.value;return tc(e.kind)+(t!=null?` "${t}"`:"")}function tc(e){return(0,ec.isPunctuatorTokenKind)(e)?`"${e}"`:e}});var wt=h(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.didYouMean=um;var om=5;function um(e,t){let[r,n]=t?[e,t]:[void 0,e],i=" Did you mean ";r&&(i+=r+" ");let s=n.map(u=>`"${u}"`);switch(s.length){case 0:return"";case 1:return i+s[0]+"?";case 2:return i+s[0]+" or "+s[1]+"?"}let a=s.slice(0,om),o=a.pop();return i+a.join(", ")+", or "+o+"?"}});var rc=h(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.identityFunc=cm;function cm(e){return e}});var Ft=h(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.keyMap=lm;function lm(e,t){let r=Object.create(null);for(let n of e)r[t(n)]=n;return r}});var Kr=h(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.keyValMap=pm;function pm(e,t,r){let n=Object.create(null);for(let i of e)n[t(i)]=r(i);return n}});var Ss=h(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.mapValue=dm;function dm(e,t){let r=Object.create(null);for(let n of Object.keys(e))r[n]=t(e[n],n);return r}});var $r=h(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.naturalCompare=fm;function fm(e,t){let r=0,n=0;for(;r0);let o=0;do++n,o=o*10+s-Ds,s=t.charCodeAt(n);while($n(s)&&o>0);if(ao)return 1}else{if(is)return 1;++r,++n}}return e.length-t.length}var Ds=48,mm=57;function $n(e){return!isNaN(e)&&Ds<=e&&e<=mm}});var kt=h(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.suggestionList=hm;var ym=$r();function hm(e,t){let r=Object.create(null),n=new Rs(e),i=Math.floor(e.length*.4)+1;for(let s of t){let a=n.measure(s,i);a!==void 0&&(r[s]=a)}return Object.keys(r).sort((s,a)=>{let o=r[s]-r[a];return o!==0?o:(0,ym.naturalCompare)(s,a)})}var Rs=class{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=nc(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,r){if(this._input===t)return 0;let n=t.toLowerCase();if(this._inputLowerCase===n)return 1;let i=nc(n),s=this._inputArray;if(i.lengthr)return;let u=this._rows;for(let l=0;l<=o;l++)u[0][l]=l;for(let l=1;l<=a;l++){let f=u[(l-1)%3],d=u[l%3],y=d[0]=l;for(let T=1;T<=o;T++){let I=i[l-1]===s[T-1]?0:1,E=Math.min(f[T]+1,d[T-1]+1,f[T-1]+I);if(l>1&&T>1&&i[l-1]===s[T-2]&&i[l-2]===s[T-1]){let L=u[(l-2)%3][T-2];E=Math.min(E,L+1)}Er)return}let c=u[a%3][o];return c<=r?c:void 0}};function nc(e){let t=e.length,r=new Array(t);for(let n=0;n{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.toObjMap=vm;function vm(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[r,n]of Object.entries(e))t[r]=n;return t}});var ic=h(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.printString=Tm;function Tm(e){return`"${e.replace(bm,gm)}"`}var bm=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function gm(e){return Em[e.charCodeAt(0)]}var Em=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"]});var Yt=h(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.BREAK=void 0;qt.getEnterLeaveForKind=Yn;qt.getVisitFn=Lm;qt.visit=Om;qt.visitInParallel=Im;var _m=Fe(),Nm=re(),Fs=dt(),sc=H(),Tr=Object.freeze({});qt.BREAK=Tr;function Om(e,t,r=Fs.QueryDocumentKeys){let n=new Map;for(let L of Object.values(sc.Kind))n.set(L,Yn(t,L));let i,s=Array.isArray(e),a=[e],o=-1,u=[],c=e,l,f,d=[],y=[];do{o++;let L=o===a.length,F=L&&u.length!==0;if(L){if(l=y.length===0?void 0:d[d.length-1],c=f,f=y.pop(),F)if(s){c=c.slice();let P=0;for(let[G,C]of u){let w=G-P;C===null?(c.splice(w,1),P++):c[w]=C}}else{c=Object.defineProperties({},Object.getOwnPropertyDescriptors(c));for(let[P,G]of u)c[P]=G}o=i.index,a=i.keys,u=i.edits,s=i.inArray,i=i.prev}else if(f){if(l=s?o:a[o],c=f[l],c==null)continue;d.push(l)}let k;if(!Array.isArray(c)){var T,I;(0,Fs.isNode)(c)||(0,_m.devAssert)(!1,`Invalid AST Node: ${(0,Nm.inspect)(c)}.`);let P=L?(T=n.get(c.kind))===null||T===void 0?void 0:T.leave:(I=n.get(c.kind))===null||I===void 0?void 0:I.enter;if(k=P?.call(t,c,l,f,d,y),k===Tr)break;if(k===!1){if(!L){d.pop();continue}}else if(k!==void 0&&(u.push([l,k]),!L))if((0,Fs.isNode)(k))c=k;else{d.pop();continue}}if(k===void 0&&F&&u.push([l,c]),L)d.pop();else{var E;i={inArray:s,index:o,keys:a,edits:u,prev:i},s=Array.isArray(c),a=s?c:(E=r[c.kind])!==null&&E!==void 0?E:[],o=-1,u=[],f&&y.push(f),f=c}}while(i!==void 0);return u.length!==0?u[u.length-1][1]:e}function Im(e){let t=new Array(e.length).fill(null),r=Object.create(null);for(let n of Object.values(sc.Kind)){let i=!1,s=new Array(e.length).fill(void 0),a=new Array(e.length).fill(void 0);for(let u=0;u{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.print=Rm;var Sm=qr(),Dm=ic(),Am=Yt();function Rm(e){return(0,Am.visit)(e,Pm)}var jm=80,Pm={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>A(e.definitions,` + +`)},OperationDefinition:{leave(e){let t=B("(",A(e.variableDefinitions,", "),")"),r=A([e.operation,A([e.name,t]),A(e.directives," ")]," ");return(r==="query"?"":r+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:r,directives:n})=>e+": "+t+B(" = ",r)+B(" ",A(n," "))},SelectionSet:{leave:({selections:e})=>nt(e)},Field:{leave({alias:e,name:t,arguments:r,directives:n,selectionSet:i}){let s=B("",e,": ")+t,a=s+B("(",A(r,", "),")");return a.length>jm&&(a=s+B(`( +`,Jn(A(r,` +`)),` +)`)),A([a,A(n," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+B(" ",A(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:r})=>A(["...",B("on ",e),A(t," "),r]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:r,directives:n,selectionSet:i})=>`fragment ${e}${B("(",A(r,", "),")")} on ${t} ${B("",A(n," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?(0,Sm.printBlockString)(e):(0,Dm.printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+A(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+A(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+B("(",A(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:r})=>B("",e,` +`)+A(["schema",A(t," "),nt(r)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:r})=>B("",e,` +`)+A(["scalar",t,A(r," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>B("",e,` +`)+A(["type",t,B("implements ",A(r," & ")),A(n," "),nt(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:r,type:n,directives:i})=>B("",e,` +`)+t+(ac(r)?B(`( +`,Jn(A(r,` +`)),` +)`):B("(",A(r,", "),")"))+": "+n+B(" ",A(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:r,defaultValue:n,directives:i})=>B("",e,` +`)+A([t+": "+r,B("= ",n),A(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>B("",e,` +`)+A(["interface",t,B("implements ",A(r," & ")),A(n," "),nt(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:r,types:n})=>B("",e,` +`)+A(["union",t,A(r," "),B("= ",A(n," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:r,values:n})=>B("",e,` +`)+A(["enum",t,A(r," "),nt(n)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:r})=>B("",e,` +`)+A([t,A(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:r,fields:n})=>B("",e,` +`)+A(["input",t,A(r," "),nt(n)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:r,repeatable:n,locations:i})=>B("",e,` +`)+"directive @"+t+(ac(r)?B(`( +`,Jn(A(r,` +`)),` +)`):B("(",A(r,", "),")"))+(n?" repeatable":"")+" on "+A(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>A(["extend schema",A(e," "),nt(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>A(["extend scalar",e,A(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>A(["extend type",e,B("implements ",A(t," & ")),A(r," "),nt(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>A(["extend interface",e,B("implements ",A(t," & ")),A(r," "),nt(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:r})=>A(["extend union",e,A(t," "),B("= ",A(r," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:r})=>A(["extend enum",e,A(t," "),nt(r)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:r})=>A(["extend input",e,A(t," "),nt(r)]," ")}};function A(e,t=""){var r;return(r=e?.filter(n=>n).join(t))!==null&&r!==void 0?r:""}function nt(e){return B(`{ +`,Jn(A(e,` +`)),` +}`)}function B(e,t,r=""){return t!=null&&t!==""?e+t+r:""}function Jn(e){return B(" ",e.replace(/\n/g,` + `))}function ac(e){var t;return(t=e?.some(r=>r.includes(` +`)))!==null&&t!==void 0?t:!1}});var Vs=h(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.valueFromASTUntyped=qs;var wm=Kr(),Ot=H();function qs(e,t){switch(e.kind){case Ot.Kind.NULL:return null;case Ot.Kind.INT:return parseInt(e.value,10);case Ot.Kind.FLOAT:return parseFloat(e.value);case Ot.Kind.STRING:case Ot.Kind.ENUM:case Ot.Kind.BOOLEAN:return e.value;case Ot.Kind.LIST:return e.values.map(r=>qs(r,t));case Ot.Kind.OBJECT:return(0,wm.keyValMap)(e.fields,r=>r.name.value,r=>qs(r.value,t));case Ot.Kind.VARIABLE:return t?.[e.name.value]}}});var Br=h(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.assertEnumValueName=Fm;Hn.assertName=cc;var oc=Fe(),Xn=q(),uc=xn();function cc(e){if(e!=null||(0,oc.devAssert)(!1,"Must provide name."),typeof e=="string"||(0,oc.devAssert)(!1,"Expected name to be a string."),e.length===0)throw new Xn.GraphQLError("Expected name to be a non-empty string.");for(let t=1;t{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.GraphQLUnionType=j.GraphQLScalarType=j.GraphQLObjectType=j.GraphQLNonNull=j.GraphQLList=j.GraphQLInterfaceType=j.GraphQLInputObjectType=j.GraphQLEnumType=void 0;j.argsToArgsConfig=Ec;j.assertAbstractType=ey;j.assertCompositeType=Zm;j.assertEnumType=Bm;j.assertInputObjectType=Ym;j.assertInputType=Hm;j.assertInterfaceType=Km;j.assertLeafType=Wm;j.assertListType=Jm;j.assertNamedType=iy;j.assertNonNullType=Xm;j.assertNullableType=ry;j.assertObjectType=Um;j.assertOutputType=zm;j.assertScalarType=Qm;j.assertType=Cm;j.assertUnionType=$m;j.assertWrappingType=ty;j.defineArguments=bc;j.getNamedType=sy;j.getNullableType=ny;j.isAbstractType=yc;j.isCompositeType=mc;j.isEnumType=zt;j.isInputObjectType=Jr;j.isInputType=Ms;j.isInterfaceType=Xt;j.isLeafType=fc;j.isListType=ui;j.isNamedType=hc;j.isNonNullType=Vt;j.isNullableType=Cs;j.isObjectType=gr;j.isOutputType=Gs;j.isRequiredArgument=ay;j.isRequiredInputField=ly;j.isScalarType=Jt;j.isType=oi;j.isUnionType=Ht;j.isWrappingType=Xr;j.resolveObjMapThunk=Us;j.resolveReadonlyArrayThunk=Qs;var Se=Fe(),km=wt(),lc=rc(),se=re(),xt=Cr(),qm=pt(),xm=Ft(),dc=Kr(),ai=Ss(),Vm=kt(),ft=Bn(),Yr=q(),Mm=H(),pc=Ce(),Gm=Vs(),mt=Br();function oi(e){return Jt(e)||gr(e)||Xt(e)||Ht(e)||zt(e)||Jr(e)||ui(e)||Vt(e)}function Cm(e){if(!oi(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL type.`);return e}function Jt(e){return(0,xt.instanceOf)(e,ei)}function Qm(e){if(!Jt(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL Scalar type.`);return e}function gr(e){return(0,xt.instanceOf)(e,ti)}function Um(e){if(!gr(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL Object type.`);return e}function Xt(e){return(0,xt.instanceOf)(e,ri)}function Km(e){if(!Xt(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL Interface type.`);return e}function Ht(e){return(0,xt.instanceOf)(e,ni)}function $m(e){if(!Ht(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL Union type.`);return e}function zt(e){return(0,xt.instanceOf)(e,ii)}function Bm(e){if(!zt(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL Enum type.`);return e}function Jr(e){return(0,xt.instanceOf)(e,si)}function Ym(e){if(!Jr(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL Input Object type.`);return e}function ui(e){return(0,xt.instanceOf)(e,Wn)}function Jm(e){if(!ui(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL List type.`);return e}function Vt(e){return(0,xt.instanceOf)(e,Zn)}function Xm(e){if(!Vt(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL Non-Null type.`);return e}function Ms(e){return Jt(e)||zt(e)||Jr(e)||Xr(e)&&Ms(e.ofType)}function Hm(e){if(!Ms(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL input type.`);return e}function Gs(e){return Jt(e)||gr(e)||Xt(e)||Ht(e)||zt(e)||Xr(e)&&Gs(e.ofType)}function zm(e){if(!Gs(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL output type.`);return e}function fc(e){return Jt(e)||zt(e)}function Wm(e){if(!fc(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL leaf type.`);return e}function mc(e){return gr(e)||Xt(e)||Ht(e)}function Zm(e){if(!mc(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL composite type.`);return e}function yc(e){return Xt(e)||Ht(e)}function ey(e){if(!yc(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL abstract type.`);return e}var Wn=class{constructor(t){oi(t)||(0,Se.devAssert)(!1,`Expected ${(0,se.inspect)(t)} to be a GraphQL type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}};j.GraphQLList=Wn;var Zn=class{constructor(t){Cs(t)||(0,Se.devAssert)(!1,`Expected ${(0,se.inspect)(t)} to be a GraphQL nullable type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}};j.GraphQLNonNull=Zn;function Xr(e){return ui(e)||Vt(e)}function ty(e){if(!Xr(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL wrapping type.`);return e}function Cs(e){return oi(e)&&!Vt(e)}function ry(e){if(!Cs(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL nullable type.`);return e}function ny(e){if(e)return Vt(e)?e.ofType:e}function hc(e){return Jt(e)||gr(e)||Xt(e)||Ht(e)||zt(e)||Jr(e)}function iy(e){if(!hc(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL named type.`);return e}function sy(e){if(e){let t=e;for(;Xr(t);)t=t.ofType;return t}}function Qs(e){return typeof e=="function"?e():e}function Us(e){return typeof e=="function"?e():e}var ei=class{constructor(t){var r,n,i,s;let a=(r=t.parseValue)!==null&&r!==void 0?r:lc.identityFunc;this.name=(0,mt.assertName)(t.name),this.description=t.description,this.specifiedByURL=t.specifiedByURL,this.serialize=(n=t.serialize)!==null&&n!==void 0?n:lc.identityFunc,this.parseValue=a,this.parseLiteral=(i=t.parseLiteral)!==null&&i!==void 0?i:(o,u)=>a((0,Gm.valueFromASTUntyped)(o,u)),this.extensions=(0,ft.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(s=t.extensionASTNodes)!==null&&s!==void 0?s:[],t.specifiedByURL==null||typeof t.specifiedByURL=="string"||(0,Se.devAssert)(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${(0,se.inspect)(t.specifiedByURL)}.`),t.serialize==null||typeof t.serialize=="function"||(0,Se.devAssert)(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||(0,Se.devAssert)(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};j.GraphQLScalarType=ei;var ti=class{constructor(t){var r;this.name=(0,mt.assertName)(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=(0,ft.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],this._fields=()=>Tc(t),this._interfaces=()=>vc(t),t.isTypeOf==null||typeof t.isTypeOf=="function"||(0,Se.devAssert)(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${(0,se.inspect)(t.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:gc(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};j.GraphQLObjectType=ti;function vc(e){var t;let r=Qs((t=e.interfaces)!==null&&t!==void 0?t:[]);return Array.isArray(r)||(0,Se.devAssert)(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),r}function Tc(e){let t=Us(e.fields);return br(t)||(0,Se.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,ai.mapValue)(t,(r,n)=>{var i;br(r)||(0,Se.devAssert)(!1,`${e.name}.${n} field config must be an object.`),r.resolve==null||typeof r.resolve=="function"||(0,Se.devAssert)(!1,`${e.name}.${n} field resolver must be a function if provided, but got: ${(0,se.inspect)(r.resolve)}.`);let s=(i=r.args)!==null&&i!==void 0?i:{};return br(s)||(0,Se.devAssert)(!1,`${e.name}.${n} args must be an object with argument names as keys.`),{name:(0,mt.assertName)(n),description:r.description,type:r.type,args:bc(s),resolve:r.resolve,subscribe:r.subscribe,deprecationReason:r.deprecationReason,extensions:(0,ft.toObjMap)(r.extensions),astNode:r.astNode}})}function bc(e){return Object.entries(e).map(([t,r])=>({name:(0,mt.assertName)(t),description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:(0,ft.toObjMap)(r.extensions),astNode:r.astNode}))}function br(e){return(0,qm.isObjectLike)(e)&&!Array.isArray(e)}function gc(e){return(0,ai.mapValue)(e,t=>({description:t.description,type:t.type,args:Ec(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function Ec(e){return(0,dc.keyValMap)(e,t=>t.name,t=>({description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function ay(e){return Vt(e.type)&&e.defaultValue===void 0}var ri=class{constructor(t){var r;this.name=(0,mt.assertName)(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=(0,ft.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],this._fields=Tc.bind(void 0,t),this._interfaces=vc.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||(0,Se.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,se.inspect)(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:gc(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};j.GraphQLInterfaceType=ri;var ni=class{constructor(t){var r;this.name=(0,mt.assertName)(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=(0,ft.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],this._types=oy.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||(0,Se.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,se.inspect)(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};j.GraphQLUnionType=ni;function oy(e){let t=Qs(e.types);return Array.isArray(t)||(0,Se.devAssert)(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}var ii=class{constructor(t){var r;this.name=(0,mt.assertName)(t.name),this.description=t.description,this.extensions=(0,ft.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],this._values=uy(this.name,t.values),this._valueLookup=new Map(this._values.map(n=>[n.value,n])),this._nameLookup=(0,xm.keyMap)(this._values,n=>n.name)}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(t){return this._nameLookup[t]}serialize(t){let r=this._valueLookup.get(t);if(r===void 0)throw new Yr.GraphQLError(`Enum "${this.name}" cannot represent value: ${(0,se.inspect)(t)}`);return r.name}parseValue(t){if(typeof t!="string"){let n=(0,se.inspect)(t);throw new Yr.GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${n}.`+zn(this,n))}let r=this.getValue(t);if(r==null)throw new Yr.GraphQLError(`Value "${t}" does not exist in "${this.name}" enum.`+zn(this,t));return r.value}parseLiteral(t,r){if(t.kind!==Mm.Kind.ENUM){let i=(0,pc.print)(t);throw new Yr.GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+zn(this,i),{nodes:t})}let n=this.getValue(t.value);if(n==null){let i=(0,pc.print)(t);throw new Yr.GraphQLError(`Value "${i}" does not exist in "${this.name}" enum.`+zn(this,i),{nodes:t})}return n.value}toConfig(){let t=(0,dc.keyValMap)(this.getValues(),r=>r.name,r=>({description:r.description,value:r.value,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}));return{name:this.name,description:this.description,values:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};j.GraphQLEnumType=ii;function zn(e,t){let r=e.getValues().map(i=>i.name),n=(0,Vm.suggestionList)(t,r);return(0,km.didYouMean)("the enum value",n)}function uy(e,t){return br(t)||(0,Se.devAssert)(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([r,n])=>(br(n)||(0,Se.devAssert)(!1,`${e}.${r} must refer to an object with a "value" key representing an internal value but got: ${(0,se.inspect)(n)}.`),{name:(0,mt.assertEnumValueName)(r),description:n.description,value:n.value!==void 0?n.value:r,deprecationReason:n.deprecationReason,extensions:(0,ft.toObjMap)(n.extensions),astNode:n.astNode}))}var si=class{constructor(t){var r;this.name=(0,mt.assertName)(t.name),this.description=t.description,this.extensions=(0,ft.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],this._fields=cy.bind(void 0,t)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){let t=(0,ai.mapValue)(this.getFields(),r=>({description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}));return{name:this.name,description:this.description,fields:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};j.GraphQLInputObjectType=si;function cy(e){let t=Us(e.fields);return br(t)||(0,Se.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,ai.mapValue)(t,(r,n)=>(!("resolve"in r)||(0,Se.devAssert)(!1,`${e.name}.${n} field has a resolve property, but Input Types cannot define resolvers.`),{name:(0,mt.assertName)(n),description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:(0,ft.toObjMap)(r.extensions),astNode:r.astNode}))}function ly(e){return Vt(e.type)&&e.defaultValue===void 0}});var zr=h(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.doTypesOverlap=py;Hr.isEqualType=Ks;Hr.isTypeSubTypeOf=ci;var Pe=Y();function Ks(e,t){return e===t?!0:(0,Pe.isNonNullType)(e)&&(0,Pe.isNonNullType)(t)||(0,Pe.isListType)(e)&&(0,Pe.isListType)(t)?Ks(e.ofType,t.ofType):!1}function ci(e,t,r){return t===r?!0:(0,Pe.isNonNullType)(r)?(0,Pe.isNonNullType)(t)?ci(e,t.ofType,r.ofType):!1:(0,Pe.isNonNullType)(t)?ci(e,t.ofType,r):(0,Pe.isListType)(r)?(0,Pe.isListType)(t)?ci(e,t.ofType,r.ofType):!1:(0,Pe.isListType)(t)?!1:(0,Pe.isAbstractType)(r)&&((0,Pe.isInterfaceType)(t)||(0,Pe.isObjectType)(t))&&e.isSubType(r,t)}function py(e,t,r){return t===r?!0:(0,Pe.isAbstractType)(t)?(0,Pe.isAbstractType)(r)?e.getPossibleTypes(t).some(n=>e.isSubType(r,n)):e.isSubType(t,r):(0,Pe.isAbstractType)(r)?e.isSubType(r,t):!1}});var yt=h(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.GraphQLString=ge.GraphQLInt=ge.GraphQLID=ge.GraphQLFloat=ge.GraphQLBoolean=ge.GRAPHQL_MIN_INT=ge.GRAPHQL_MAX_INT=void 0;ge.isSpecifiedScalarType=dy;ge.specifiedScalarTypes=void 0;var it=re(),_c=pt(),De=q(),Wt=H(),Wr=Ce(),Zr=Y(),li=2147483647;ge.GRAPHQL_MAX_INT=li;var pi=-2147483648;ge.GRAPHQL_MIN_INT=pi;var Nc=new Zr.GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){let t=en(e);if(typeof t=="boolean")return t?1:0;let r=t;if(typeof t=="string"&&t!==""&&(r=Number(t)),typeof r!="number"||!Number.isInteger(r))throw new De.GraphQLError(`Int cannot represent non-integer value: ${(0,it.inspect)(t)}`);if(r>li||rli||eli||te.name===t)}function en(e){if((0,_c.isObjectLike)(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!(0,_c.isObjectLike)(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}});var Ve=h(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.GraphQLSpecifiedByDirective=Ee.GraphQLSkipDirective=Ee.GraphQLIncludeDirective=Ee.GraphQLDirective=Ee.GraphQLDeprecatedDirective=Ee.DEFAULT_DEPRECATION_REASON=void 0;Ee.assertDirective=Ty;Ee.isDirective=Rc;Ee.isSpecifiedDirective=by;Ee.specifiedDirectives=void 0;var Ac=Fe(),fy=re(),my=Cr(),yy=pt(),hy=Bn(),st=yr(),vy=Br(),tn=Y(),di=yt();function Rc(e){return(0,my.instanceOf)(e,Mt)}function Ty(e){if(!Rc(e))throw new Error(`Expected ${(0,fy.inspect)(e)} to be a GraphQL directive.`);return e}var Mt=class{constructor(t){var r,n;this.name=(0,vy.assertName)(t.name),this.description=t.description,this.locations=t.locations,this.isRepeatable=(r=t.isRepeatable)!==null&&r!==void 0?r:!1,this.extensions=(0,hy.toObjMap)(t.extensions),this.astNode=t.astNode,Array.isArray(t.locations)||(0,Ac.devAssert)(!1,`@${t.name} locations must be an Array.`);let i=(n=t.args)!==null&&n!==void 0?n:{};(0,yy.isObjectLike)(i)&&!Array.isArray(i)||(0,Ac.devAssert)(!1,`@${t.name} args must be an object with argument names as keys.`),this.args=(0,tn.defineArguments)(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:(0,tn.argsToArgsConfig)(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}};Ee.GraphQLDirective=Mt;var jc=new Mt({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[st.DirectiveLocation.FIELD,st.DirectiveLocation.FRAGMENT_SPREAD,st.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new tn.GraphQLNonNull(di.GraphQLBoolean),description:"Included when true."}}});Ee.GraphQLIncludeDirective=jc;var Pc=new Mt({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[st.DirectiveLocation.FIELD,st.DirectiveLocation.FRAGMENT_SPREAD,st.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new tn.GraphQLNonNull(di.GraphQLBoolean),description:"Skipped when true."}}});Ee.GraphQLSkipDirective=Pc;var wc="No longer supported";Ee.DEFAULT_DEPRECATION_REASON=wc;var Fc=new Mt({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[st.DirectiveLocation.FIELD_DEFINITION,st.DirectiveLocation.ARGUMENT_DEFINITION,st.DirectiveLocation.INPUT_FIELD_DEFINITION,st.DirectiveLocation.ENUM_VALUE],args:{reason:{type:di.GraphQLString,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:wc}}});Ee.GraphQLDeprecatedDirective=Fc;var kc=new Mt({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[st.DirectiveLocation.SCALAR],args:{url:{type:new tn.GraphQLNonNull(di.GraphQLString),description:"The URL that specifies the behavior of this scalar."}}});Ee.GraphQLSpecifiedByDirective=kc;var qc=Object.freeze([jc,Pc,Fc,kc]);Ee.specifiedDirectives=qc;function by(e){return qc.some(({name:t})=>t===e.name)}});var fi=h($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.isIterableObject=gy;function gy(e){return typeof e=="object"&&typeof e?.[Symbol.iterator]=="function"}});var sn=h(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.astFromValue=nn;var xc=re(),Ey=je(),_y=fi(),Ny=pt(),$e=H(),rn=Y(),Oy=yt();function nn(e,t){if((0,rn.isNonNullType)(t)){let r=nn(e,t.ofType);return r?.kind===$e.Kind.NULL?null:r}if(e===null)return{kind:$e.Kind.NULL};if(e===void 0)return null;if((0,rn.isListType)(t)){let r=t.ofType;if((0,_y.isIterableObject)(e)){let n=[];for(let i of e){let s=nn(i,r);s!=null&&n.push(s)}return{kind:$e.Kind.LIST,values:n}}return nn(e,r)}if((0,rn.isInputObjectType)(t)){if(!(0,Ny.isObjectLike)(e))return null;let r=[];for(let n of Object.values(t.getFields())){let i=nn(e[n.name],n.type);i&&r.push({kind:$e.Kind.OBJECT_FIELD,name:{kind:$e.Kind.NAME,value:n.name},value:i})}return{kind:$e.Kind.OBJECT,fields:r}}if((0,rn.isLeafType)(t)){let r=t.serialize(e);if(r==null)return null;if(typeof r=="boolean")return{kind:$e.Kind.BOOLEAN,value:r};if(typeof r=="number"&&Number.isFinite(r)){let n=String(r);return Vc.test(n)?{kind:$e.Kind.INT,value:n}:{kind:$e.Kind.FLOAT,value:n}}if(typeof r=="string")return(0,rn.isEnumType)(t)?{kind:$e.Kind.ENUM,value:r}:t===Oy.GraphQLID&&Vc.test(r)?{kind:$e.Kind.INT,value:r}:{kind:$e.Kind.STRING,value:r};throw new TypeError(`Cannot convert value to AST: ${(0,xc.inspect)(r)}.`)}(0,Ey.invariant)(!1,"Unexpected input type: "+(0,xc.inspect)(t))}var Vc=/^-?(?:0|[1-9][0-9]*)$/});var Ye=h(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.introspectionTypes=ne.__TypeKind=ne.__Type=ne.__Schema=ne.__InputValue=ne.__Field=ne.__EnumValue=ne.__DirectiveLocation=ne.__Directive=ne.TypeNameMetaFieldDef=ne.TypeMetaFieldDef=ne.TypeKind=ne.SchemaMetaFieldDef=void 0;ne.isIntrospectionType=Py;var Iy=re(),Ly=je(),_e=yr(),Sy=Ce(),Dy=sn(),R=Y(),ae=yt(),Ys=new R.GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:ae.GraphQLString,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new R.GraphQLNonNull(new R.GraphQLList(new R.GraphQLNonNull(Be))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new R.GraphQLNonNull(Be),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Be,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Be,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new R.GraphQLNonNull(new R.GraphQLList(new R.GraphQLNonNull(Js))),resolve:e=>e.getDirectives()}})});ne.__Schema=Ys;var Js=new R.GraphQLObjectType({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document. + +In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new R.GraphQLNonNull(ae.GraphQLString),resolve:e=>e.name},description:{type:ae.GraphQLString,resolve:e=>e.description},isRepeatable:{type:new R.GraphQLNonNull(ae.GraphQLBoolean),resolve:e=>e.isRepeatable},locations:{type:new R.GraphQLNonNull(new R.GraphQLList(new R.GraphQLNonNull(Xs))),resolve:e=>e.locations},args:{type:new R.GraphQLNonNull(new R.GraphQLList(new R.GraphQLNonNull(an))),args:{includeDeprecated:{type:ae.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(r=>r.deprecationReason==null)}}})});ne.__Directive=Js;var Xs=new R.GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:_e.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:_e.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:_e.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:_e.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:_e.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:_e.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:_e.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:_e.DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:_e.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:_e.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:_e.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:_e.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:_e.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:_e.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:_e.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:_e.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:_e.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:_e.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:_e.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}});ne.__DirectiveLocation=Xs;var Be=new R.GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new R.GraphQLNonNull(Ws),resolve(e){if((0,R.isScalarType)(e))return Ne.SCALAR;if((0,R.isObjectType)(e))return Ne.OBJECT;if((0,R.isInterfaceType)(e))return Ne.INTERFACE;if((0,R.isUnionType)(e))return Ne.UNION;if((0,R.isEnumType)(e))return Ne.ENUM;if((0,R.isInputObjectType)(e))return Ne.INPUT_OBJECT;if((0,R.isListType)(e))return Ne.LIST;if((0,R.isNonNullType)(e))return Ne.NON_NULL;(0,Ly.invariant)(!1,`Unexpected type: "${(0,Iy.inspect)(e)}".`)}},name:{type:ae.GraphQLString,resolve:e=>"name"in e?e.name:void 0},description:{type:ae.GraphQLString,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:ae.GraphQLString,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new R.GraphQLList(new R.GraphQLNonNull(Hs)),args:{includeDeprecated:{type:ae.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,R.isObjectType)(e)||(0,R.isInterfaceType)(e)){let r=Object.values(e.getFields());return t?r:r.filter(n=>n.deprecationReason==null)}}},interfaces:{type:new R.GraphQLList(new R.GraphQLNonNull(Be)),resolve(e){if((0,R.isObjectType)(e)||(0,R.isInterfaceType)(e))return e.getInterfaces()}},possibleTypes:{type:new R.GraphQLList(new R.GraphQLNonNull(Be)),resolve(e,t,r,{schema:n}){if((0,R.isAbstractType)(e))return n.getPossibleTypes(e)}},enumValues:{type:new R.GraphQLList(new R.GraphQLNonNull(zs)),args:{includeDeprecated:{type:ae.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,R.isEnumType)(e)){let r=e.getValues();return t?r:r.filter(n=>n.deprecationReason==null)}}},inputFields:{type:new R.GraphQLList(new R.GraphQLNonNull(an)),args:{includeDeprecated:{type:ae.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,R.isInputObjectType)(e)){let r=Object.values(e.getFields());return t?r:r.filter(n=>n.deprecationReason==null)}}},ofType:{type:Be,resolve:e=>"ofType"in e?e.ofType:void 0}})});ne.__Type=Be;var Hs=new R.GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new R.GraphQLNonNull(ae.GraphQLString),resolve:e=>e.name},description:{type:ae.GraphQLString,resolve:e=>e.description},args:{type:new R.GraphQLNonNull(new R.GraphQLList(new R.GraphQLNonNull(an))),args:{includeDeprecated:{type:ae.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(r=>r.deprecationReason==null)}},type:{type:new R.GraphQLNonNull(Be),resolve:e=>e.type},isDeprecated:{type:new R.GraphQLNonNull(ae.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:ae.GraphQLString,resolve:e=>e.deprecationReason}})});ne.__Field=Hs;var an=new R.GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new R.GraphQLNonNull(ae.GraphQLString),resolve:e=>e.name},description:{type:ae.GraphQLString,resolve:e=>e.description},type:{type:new R.GraphQLNonNull(Be),resolve:e=>e.type},defaultValue:{type:ae.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:r}=e,n=(0,Dy.astFromValue)(r,t);return n?(0,Sy.print)(n):null}},isDeprecated:{type:new R.GraphQLNonNull(ae.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:ae.GraphQLString,resolve:e=>e.deprecationReason}})});ne.__InputValue=an;var zs=new R.GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new R.GraphQLNonNull(ae.GraphQLString),resolve:e=>e.name},description:{type:ae.GraphQLString,resolve:e=>e.description},isDeprecated:{type:new R.GraphQLNonNull(ae.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:ae.GraphQLString,resolve:e=>e.deprecationReason}})});ne.__EnumValue=zs;var Ne;ne.TypeKind=Ne;(function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"})(Ne||(ne.TypeKind=Ne={}));var Ws=new R.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Ne.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Ne.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Ne.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Ne.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Ne.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Ne.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Ne.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Ne.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});ne.__TypeKind=Ws;var Ay={name:"__schema",type:new R.GraphQLNonNull(Ys),description:"Access the current type schema of this server.",args:[],resolve:(e,t,r,{schema:n})=>n,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};ne.SchemaMetaFieldDef=Ay;var Ry={name:"__type",type:Be,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new R.GraphQLNonNull(ae.GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},r,{schema:n})=>n.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};ne.TypeMetaFieldDef=Ry;var jy={name:"__typename",type:new R.GraphQLNonNull(ae.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,r,{parentType:n})=>n.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};ne.TypeNameMetaFieldDef=jy;var Mc=Object.freeze([Ys,Js,Xs,Be,Hs,an,zs,Ws]);ne.introspectionTypes=Mc;function Py(e){return Mc.some(({name:t})=>e.name===t)}});var Zt=h(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.GraphQLSchema=void 0;Er.assertSchema=xy;Er.isSchema=Cc;var mi=Fe(),ea=re(),wy=Cr(),Fy=pt(),ky=Bn(),Zs=dt(),at=Y(),Gc=Ve(),qy=Ye();function Cc(e){return(0,wy.instanceOf)(e,yi)}function xy(e){if(!Cc(e))throw new Error(`Expected ${(0,ea.inspect)(e)} to be a GraphQL schema.`);return e}var yi=class{constructor(t){var r,n;this.__validationErrors=t.assumeValid===!0?[]:void 0,(0,Fy.isObjectLike)(t)||(0,mi.devAssert)(!1,"Must provide configuration object."),!t.types||Array.isArray(t.types)||(0,mi.devAssert)(!1,`"types" must be Array if provided but got: ${(0,ea.inspect)(t.types)}.`),!t.directives||Array.isArray(t.directives)||(0,mi.devAssert)(!1,`"directives" must be Array if provided but got: ${(0,ea.inspect)(t.directives)}.`),this.description=t.description,this.extensions=(0,ky.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(n=t.directives)!==null&&n!==void 0?n:Gc.specifiedDirectives;let i=new Set(t.types);if(t.types!=null)for(let s of t.types)i.delete(s),ot(s,i);this._queryType!=null&&ot(this._queryType,i),this._mutationType!=null&&ot(this._mutationType,i),this._subscriptionType!=null&&ot(this._subscriptionType,i);for(let s of this._directives)if((0,Gc.isDirective)(s))for(let a of s.args)ot(a.type,i);ot(qy.__Schema,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let s of i){if(s==null)continue;let a=s.name;if(a||(0,mi.devAssert)(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[a]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${a}".`);if(this._typeMap[a]=s,(0,at.isInterfaceType)(s)){for(let o of s.getInterfaces())if((0,at.isInterfaceType)(o)){let u=this._implementationsMap[o.name];u===void 0&&(u=this._implementationsMap[o.name]={objects:[],interfaces:[]}),u.interfaces.push(s)}}else if((0,at.isObjectType)(s)){for(let o of s.getInterfaces())if((0,at.isInterfaceType)(o)){let u=this._implementationsMap[o.name];u===void 0&&(u=this._implementationsMap[o.name]={objects:[],interfaces:[]}),u.objects.push(s)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case Zs.OperationTypeNode.QUERY:return this.getQueryType();case Zs.OperationTypeNode.MUTATION:return this.getMutationType();case Zs.OperationTypeNode.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return(0,at.isUnionType)(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){let r=this._implementationsMap[t.name];return r??{objects:[],interfaces:[]}}isSubType(t,r){let n=this._subTypeMap[t.name];if(n===void 0){if(n=Object.create(null),(0,at.isUnionType)(t))for(let i of t.getTypes())n[i.name]=!0;else{let i=this.getImplementations(t);for(let s of i.objects)n[s.name]=!0;for(let s of i.interfaces)n[s.name]=!0}this._subTypeMap[t.name]=n}return n[r.name]!==void 0}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(r=>r.name===t)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}};Er.GraphQLSchema=yi;function ot(e,t){let r=(0,at.getNamedType)(e);if(!t.has(r)){if(t.add(r),(0,at.isUnionType)(r))for(let n of r.getTypes())ot(n,t);else if((0,at.isObjectType)(r)||(0,at.isInterfaceType)(r)){for(let n of r.getInterfaces())ot(n,t);for(let n of Object.values(r.getFields())){ot(n.type,t);for(let i of n.args)ot(i.type,t)}}else if((0,at.isInputObjectType)(r))for(let n of Object.values(r.getFields()))ot(n.type,t)}return t}});var un=h(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.assertValidSchema=Cy;hi.validateSchema=Yc;var we=re(),Vy=q(),ta=dt(),Qc=zr(),he=Y(),Bc=Ve(),My=Ye(),Gy=Zt();function Yc(e){if((0,Gy.assertSchema)(e),e.__validationErrors)return e.__validationErrors;let t=new na(e);Qy(t),Uy(t),Ky(t);let r=t.getErrors();return e.__validationErrors=r,r}function Cy(e){let t=Yc(e);if(t.length!==0)throw new Error(t.map(r=>r.message).join(` + +`))}var na=class{constructor(t){this._errors=[],this.schema=t}reportError(t,r){let n=Array.isArray(r)?r.filter(Boolean):r;this._errors.push(new Vy.GraphQLError(t,{nodes:n}))}getErrors(){return this._errors}};function Qy(e){let t=e.schema,r=t.getQueryType();if(!r)e.reportError("Query root type must be provided.",t.astNode);else if(!(0,he.isObjectType)(r)){var n;e.reportError(`Query root type must be Object type, it cannot be ${(0,we.inspect)(r)}.`,(n=ra(t,ta.OperationTypeNode.QUERY))!==null&&n!==void 0?n:r.astNode)}let i=t.getMutationType();if(i&&!(0,he.isObjectType)(i)){var s;e.reportError(`Mutation root type must be Object type if provided, it cannot be ${(0,we.inspect)(i)}.`,(s=ra(t,ta.OperationTypeNode.MUTATION))!==null&&s!==void 0?s:i.astNode)}let a=t.getSubscriptionType();if(a&&!(0,he.isObjectType)(a)){var o;e.reportError(`Subscription root type must be Object type if provided, it cannot be ${(0,we.inspect)(a)}.`,(o=ra(t,ta.OperationTypeNode.SUBSCRIPTION))!==null&&o!==void 0?o:a.astNode)}}function ra(e,t){var r;return(r=[e.astNode,...e.extensionASTNodes].flatMap(n=>{var i;return(i=n?.operationTypes)!==null&&i!==void 0?i:[]}).find(n=>n.operation===t))===null||r===void 0?void 0:r.type}function Uy(e){for(let r of e.schema.getDirectives()){if(!(0,Bc.isDirective)(r)){e.reportError(`Expected directive but got: ${(0,we.inspect)(r)}.`,r?.astNode);continue}er(e,r);for(let n of r.args)if(er(e,n),(0,he.isInputType)(n.type)||e.reportError(`The type of @${r.name}(${n.name}:) must be Input Type but got: ${(0,we.inspect)(n.type)}.`,n.astNode),(0,he.isRequiredArgument)(n)&&n.deprecationReason!=null){var t;e.reportError(`Required argument @${r.name}(${n.name}:) cannot be deprecated.`,[ia(n.astNode),(t=n.astNode)===null||t===void 0?void 0:t.type])}}}function er(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function Ky(e){let t=Hy(e),r=e.schema.getTypeMap();for(let n of Object.values(r)){if(!(0,he.isNamedType)(n)){e.reportError(`Expected GraphQL named type but got: ${(0,we.inspect)(n)}.`,n.astNode);continue}(0,My.isIntrospectionType)(n)||er(e,n),(0,he.isObjectType)(n)||(0,he.isInterfaceType)(n)?(Uc(e,n),Kc(e,n)):(0,he.isUnionType)(n)?Yy(e,n):(0,he.isEnumType)(n)?Jy(e,n):(0,he.isInputObjectType)(n)&&(Xy(e,n),t(n))}}function Uc(e,t){let r=Object.values(t.getFields());r.length===0&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let a of r){if(er(e,a),!(0,he.isOutputType)(a.type)){var n;e.reportError(`The type of ${t.name}.${a.name} must be Output Type but got: ${(0,we.inspect)(a.type)}.`,(n=a.astNode)===null||n===void 0?void 0:n.type)}for(let o of a.args){let u=o.name;if(er(e,o),!(0,he.isInputType)(o.type)){var i;e.reportError(`The type of ${t.name}.${a.name}(${u}:) must be Input Type but got: ${(0,we.inspect)(o.type)}.`,(i=o.astNode)===null||i===void 0?void 0:i.type)}if((0,he.isRequiredArgument)(o)&&o.deprecationReason!=null){var s;e.reportError(`Required argument ${t.name}.${a.name}(${u}:) cannot be deprecated.`,[ia(o.astNode),(s=o.astNode)===null||s===void 0?void 0:s.type])}}}}function Kc(e,t){let r=Object.create(null);for(let n of t.getInterfaces()){if(!(0,he.isInterfaceType)(n)){e.reportError(`Type ${(0,we.inspect)(t)} must only implement Interface types, it cannot implement ${(0,we.inspect)(n)}.`,on(t,n));continue}if(t===n){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,on(t,n));continue}if(r[n.name]){e.reportError(`Type ${t.name} can only implement ${n.name} once.`,on(t,n));continue}r[n.name]=!0,By(e,t,n),$y(e,t,n)}}function $y(e,t,r){let n=t.getFields();for(let u of Object.values(r.getFields())){let c=u.name,l=n[c];if(!l){e.reportError(`Interface field ${r.name}.${c} expected but ${t.name} does not provide it.`,[u.astNode,t.astNode,...t.extensionASTNodes]);continue}if(!(0,Qc.isTypeSubTypeOf)(e.schema,l.type,u.type)){var i,s;e.reportError(`Interface field ${r.name}.${c} expects type ${(0,we.inspect)(u.type)} but ${t.name}.${c} is type ${(0,we.inspect)(l.type)}.`,[(i=u.astNode)===null||i===void 0?void 0:i.type,(s=l.astNode)===null||s===void 0?void 0:s.type])}for(let f of u.args){let d=f.name,y=l.args.find(T=>T.name===d);if(!y){e.reportError(`Interface field argument ${r.name}.${c}(${d}:) expected but ${t.name}.${c} does not provide it.`,[f.astNode,l.astNode]);continue}if(!(0,Qc.isEqualType)(f.type,y.type)){var a,o;e.reportError(`Interface field argument ${r.name}.${c}(${d}:) expects type ${(0,we.inspect)(f.type)} but ${t.name}.${c}(${d}:) is type ${(0,we.inspect)(y.type)}.`,[(a=f.astNode)===null||a===void 0?void 0:a.type,(o=y.astNode)===null||o===void 0?void 0:o.type])}}for(let f of l.args){let d=f.name;!u.args.find(T=>T.name===d)&&(0,he.isRequiredArgument)(f)&&e.reportError(`Object field ${t.name}.${c} includes required argument ${d} that is missing from the Interface field ${r.name}.${c}.`,[f.astNode,u.astNode])}}}function By(e,t,r){let n=t.getInterfaces();for(let i of r.getInterfaces())n.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${r.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${r.name}.`,[...on(r,i),...on(t,r)])}function Yy(e,t){let r=t.getTypes();r.length===0&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let n=Object.create(null);for(let i of r){if(n[i.name]){e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,$c(t,i.name));continue}n[i.name]=!0,(0,he.isObjectType)(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${(0,we.inspect)(i)}.`,$c(t,String(i)))}}function Jy(e,t){let r=t.getValues();r.length===0&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(let n of r)er(e,n)}function Xy(e,t){let r=Object.values(t.getFields());r.length===0&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let s of r){if(er(e,s),!(0,he.isInputType)(s.type)){var n;e.reportError(`The type of ${t.name}.${s.name} must be Input Type but got: ${(0,we.inspect)(s.type)}.`,(n=s.astNode)===null||n===void 0?void 0:n.type)}if((0,he.isRequiredInputField)(s)&&s.deprecationReason!=null){var i;e.reportError(`Required input field ${t.name}.${s.name} cannot be deprecated.`,[ia(s.astNode),(i=s.astNode)===null||i===void 0?void 0:i.type])}}}function Hy(e){let t=Object.create(null),r=[],n=Object.create(null);return i;function i(s){if(t[s.name])return;t[s.name]=!0,n[s.name]=r.length;let a=Object.values(s.getFields());for(let o of a)if((0,he.isNonNullType)(o.type)&&(0,he.isInputObjectType)(o.type.ofType)){let u=o.type.ofType,c=n[u.name];if(r.push(o),c===void 0)i(u);else{let l=r.slice(c),f=l.map(d=>d.name).join(".");e.reportError(`Cannot reference Input Object "${u.name}" within itself through a series of non-null fields: "${f}".`,l.map(d=>d.astNode))}r.pop()}n[s.name]=void 0}}function on(e,t){let{astNode:r,extensionASTNodes:n}=e;return(r!=null?[r,...n]:n).flatMap(s=>{var a;return(a=s.interfaces)!==null&&a!==void 0?a:[]}).filter(s=>s.name.value===t.name)}function $c(e,t){let{astNode:r,extensionASTNodes:n}=e;return(r!=null?[r,...n]:n).flatMap(s=>{var a;return(a=s.types)!==null&&a!==void 0?a:[]}).filter(s=>s.name.value===t)}function ia(e){var t;return e==null||(t=e.directives)===null||t===void 0?void 0:t.find(r=>r.name.value===Bc.GraphQLDeprecatedDirective.name)}});var ht=h(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.typeFromAST=aa;var sa=H(),Jc=Y();function aa(e,t){switch(t.kind){case sa.Kind.LIST_TYPE:{let r=aa(e,t.type);return r&&new Jc.GraphQLList(r)}case sa.Kind.NON_NULL_TYPE:{let r=aa(e,t.type);return r&&new Jc.GraphQLNonNull(r)}case sa.Kind.NAMED_TYPE:return e.getType(t.name.value)}}});var vi=h(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.TypeInfo=void 0;cn.visitWithTypeInfo=Zy;var zy=dt(),de=H(),Xc=Yt(),fe=Y(),_r=Ye(),Hc=ht(),ua=class{constructor(t,r,n){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=n??Wy,r&&((0,fe.isInputType)(r)&&this._inputTypeStack.push(r),(0,fe.isCompositeType)(r)&&this._parentTypeStack.push(r),(0,fe.isOutputType)(r)&&this._typeStack.push(r))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(t){let r=this._schema;switch(t.kind){case de.Kind.SELECTION_SET:{let i=(0,fe.getNamedType)(this.getType());this._parentTypeStack.push((0,fe.isCompositeType)(i)?i:void 0);break}case de.Kind.FIELD:{let i=this.getParentType(),s,a;i&&(s=this._getFieldDef(r,i,t),s&&(a=s.type)),this._fieldDefStack.push(s),this._typeStack.push((0,fe.isOutputType)(a)?a:void 0);break}case de.Kind.DIRECTIVE:this._directive=r.getDirective(t.name.value);break;case de.Kind.OPERATION_DEFINITION:{let i=r.getRootType(t.operation);this._typeStack.push((0,fe.isObjectType)(i)?i:void 0);break}case de.Kind.INLINE_FRAGMENT:case de.Kind.FRAGMENT_DEFINITION:{let i=t.typeCondition,s=i?(0,Hc.typeFromAST)(r,i):(0,fe.getNamedType)(this.getType());this._typeStack.push((0,fe.isOutputType)(s)?s:void 0);break}case de.Kind.VARIABLE_DEFINITION:{let i=(0,Hc.typeFromAST)(r,t.type);this._inputTypeStack.push((0,fe.isInputType)(i)?i:void 0);break}case de.Kind.ARGUMENT:{var n;let i,s,a=(n=this.getDirective())!==null&&n!==void 0?n:this.getFieldDef();a&&(i=a.args.find(o=>o.name===t.name.value),i&&(s=i.type)),this._argument=i,this._defaultValueStack.push(i?i.defaultValue:void 0),this._inputTypeStack.push((0,fe.isInputType)(s)?s:void 0);break}case de.Kind.LIST:{let i=(0,fe.getNullableType)(this.getInputType()),s=(0,fe.isListType)(i)?i.ofType:i;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,fe.isInputType)(s)?s:void 0);break}case de.Kind.OBJECT_FIELD:{let i=(0,fe.getNamedType)(this.getInputType()),s,a;(0,fe.isInputObjectType)(i)&&(a=i.getFields()[t.name.value],a&&(s=a.type)),this._defaultValueStack.push(a?a.defaultValue:void 0),this._inputTypeStack.push((0,fe.isInputType)(s)?s:void 0);break}case de.Kind.ENUM:{let i=(0,fe.getNamedType)(this.getInputType()),s;(0,fe.isEnumType)(i)&&(s=i.getValue(t.value)),this._enumValue=s;break}default:}}leave(t){switch(t.kind){case de.Kind.SELECTION_SET:this._parentTypeStack.pop();break;case de.Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case de.Kind.DIRECTIVE:this._directive=null;break;case de.Kind.OPERATION_DEFINITION:case de.Kind.INLINE_FRAGMENT:case de.Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case de.Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case de.Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case de.Kind.LIST:case de.Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case de.Kind.ENUM:this._enumValue=null;break;default:}}};cn.TypeInfo=ua;function Wy(e,t,r){let n=r.name.value;if(n===_r.SchemaMetaFieldDef.name&&e.getQueryType()===t)return _r.SchemaMetaFieldDef;if(n===_r.TypeMetaFieldDef.name&&e.getQueryType()===t)return _r.TypeMetaFieldDef;if(n===_r.TypeNameMetaFieldDef.name&&(0,fe.isCompositeType)(t))return _r.TypeNameMetaFieldDef;if((0,fe.isObjectType)(t)||(0,fe.isInterfaceType)(t))return t.getFields()[n]}function Zy(e,t){return{enter(...r){let n=r[0];e.enter(n);let i=(0,Xc.getEnterLeaveForKind)(t,n.kind).enter;if(i){let s=i.apply(t,r);return s!==void 0&&(e.leave(n),(0,zy.isNode)(s)&&e.enter(s)),s}},leave(...r){let n=r[0],i=(0,Xc.getEnterLeaveForKind)(t,n.kind).leave,s;return i&&(s=i.apply(t,r)),e.leave(n),s}}}});var tr=h(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.isConstValueNode=ca;Je.isDefinitionNode=eh;Je.isExecutableDefinitionNode=zc;Je.isSelectionNode=th;Je.isTypeDefinitionNode=el;Je.isTypeExtensionNode=rl;Je.isTypeNode=rh;Je.isTypeSystemDefinitionNode=Zc;Je.isTypeSystemExtensionNode=tl;Je.isValueNode=Wc;var J=H();function eh(e){return zc(e)||Zc(e)||tl(e)}function zc(e){return e.kind===J.Kind.OPERATION_DEFINITION||e.kind===J.Kind.FRAGMENT_DEFINITION}function th(e){return e.kind===J.Kind.FIELD||e.kind===J.Kind.FRAGMENT_SPREAD||e.kind===J.Kind.INLINE_FRAGMENT}function Wc(e){return e.kind===J.Kind.VARIABLE||e.kind===J.Kind.INT||e.kind===J.Kind.FLOAT||e.kind===J.Kind.STRING||e.kind===J.Kind.BOOLEAN||e.kind===J.Kind.NULL||e.kind===J.Kind.ENUM||e.kind===J.Kind.LIST||e.kind===J.Kind.OBJECT}function ca(e){return Wc(e)&&(e.kind===J.Kind.LIST?e.values.some(ca):e.kind===J.Kind.OBJECT?e.fields.some(t=>ca(t.value)):e.kind!==J.Kind.VARIABLE)}function rh(e){return e.kind===J.Kind.NAMED_TYPE||e.kind===J.Kind.LIST_TYPE||e.kind===J.Kind.NON_NULL_TYPE}function Zc(e){return e.kind===J.Kind.SCHEMA_DEFINITION||el(e)||e.kind===J.Kind.DIRECTIVE_DEFINITION}function el(e){return e.kind===J.Kind.SCALAR_TYPE_DEFINITION||e.kind===J.Kind.OBJECT_TYPE_DEFINITION||e.kind===J.Kind.INTERFACE_TYPE_DEFINITION||e.kind===J.Kind.UNION_TYPE_DEFINITION||e.kind===J.Kind.ENUM_TYPE_DEFINITION||e.kind===J.Kind.INPUT_OBJECT_TYPE_DEFINITION}function tl(e){return e.kind===J.Kind.SCHEMA_EXTENSION||rl(e)}function rl(e){return e.kind===J.Kind.SCALAR_TYPE_EXTENSION||e.kind===J.Kind.OBJECT_TYPE_EXTENSION||e.kind===J.Kind.INTERFACE_TYPE_EXTENSION||e.kind===J.Kind.UNION_TYPE_EXTENSION||e.kind===J.Kind.ENUM_TYPE_EXTENSION||e.kind===J.Kind.INPUT_OBJECT_TYPE_EXTENSION}});var pa=h(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.ExecutableDefinitionsRule=sh;var nh=q(),nl=H(),ih=tr();function sh(e){return{Document(t){for(let r of t.definitions)if(!(0,ih.isExecutableDefinitionNode)(r)){let n=r.kind===nl.Kind.SCHEMA_DEFINITION||r.kind===nl.Kind.SCHEMA_EXTENSION?"schema":'"'+r.name.value+'"';e.reportError(new nh.GraphQLError(`The ${n} definition is not executable.`,{nodes:r}))}return!1}}}});var fa=h(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.FieldsOnCorrectTypeRule=ch;var il=wt(),ah=$r(),oh=kt(),uh=q(),ln=Y();function ch(e){return{Field(t){let r=e.getParentType();if(r&&!e.getFieldDef()){let i=e.getSchema(),s=t.name.value,a=(0,il.didYouMean)("to use an inline fragment on",lh(i,r,s));a===""&&(a=(0,il.didYouMean)(ph(r,s))),e.reportError(new uh.GraphQLError(`Cannot query field "${s}" on type "${r.name}".`+a,{nodes:t}))}}}}function lh(e,t,r){if(!(0,ln.isAbstractType)(t))return[];let n=new Set,i=Object.create(null);for(let a of e.getPossibleTypes(t))if(a.getFields()[r]){n.add(a),i[a.name]=1;for(let o of a.getInterfaces()){var s;o.getFields()[r]&&(n.add(o),i[o.name]=((s=i[o.name])!==null&&s!==void 0?s:0)+1)}}return[...n].sort((a,o)=>{let u=i[o.name]-i[a.name];return u!==0?u:(0,ln.isInterfaceType)(a)&&e.isSubType(a,o)?-1:(0,ln.isInterfaceType)(o)&&e.isSubType(o,a)?1:(0,ah.naturalCompare)(a.name,o.name)}).map(a=>a.name)}function ph(e,t){if((0,ln.isObjectType)(e)||(0,ln.isInterfaceType)(e)){let r=Object.keys(e.getFields());return(0,oh.suggestionList)(t,r)}return[]}});var ya=h(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.FragmentsOnCompositeTypesRule=dh;var sl=q(),al=Ce(),ol=Y(),ul=ht();function dh(e){return{InlineFragment(t){let r=t.typeCondition;if(r){let n=(0,ul.typeFromAST)(e.getSchema(),r);if(n&&!(0,ol.isCompositeType)(n)){let i=(0,al.print)(r);e.reportError(new sl.GraphQLError(`Fragment cannot condition on non composite type "${i}".`,{nodes:r}))}}},FragmentDefinition(t){let r=(0,ul.typeFromAST)(e.getSchema(),t.typeCondition);if(r&&!(0,ol.isCompositeType)(r)){let n=(0,al.print)(t.typeCondition);e.reportError(new sl.GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}}});var ha=h(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.KnownArgumentNamesOnDirectivesRule=dl;Ti.KnownArgumentNamesRule=yh;var cl=wt(),ll=kt(),pl=q(),fh=H(),mh=Ve();function yh(e){return{...dl(e),Argument(t){let r=e.getArgument(),n=e.getFieldDef(),i=e.getParentType();if(!r&&n&&i){let s=t.name.value,a=n.args.map(u=>u.name),o=(0,ll.suggestionList)(s,a);e.reportError(new pl.GraphQLError(`Unknown argument "${s}" on field "${i.name}.${n.name}".`+(0,cl.didYouMean)(o),{nodes:t}))}}}}function dl(e){let t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():mh.specifiedDirectives;for(let a of n)t[a.name]=a.args.map(o=>o.name);let i=e.getDocument().definitions;for(let a of i)if(a.kind===fh.Kind.DIRECTIVE_DEFINITION){var s;let o=(s=a.arguments)!==null&&s!==void 0?s:[];t[a.name.value]=o.map(u=>u.name.value)}return{Directive(a){let o=a.name.value,u=t[o];if(a.arguments&&u)for(let c of a.arguments){let l=c.name.value;if(!u.includes(l)){let f=(0,ll.suggestionList)(l,u);e.reportError(new pl.GraphQLError(`Unknown argument "${l}" on directive "@${o}".`+(0,cl.didYouMean)(f),{nodes:c}))}}return!1}}}});var ga=h(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.KnownDirectivesRule=Th;var hh=re(),va=je(),fl=q(),Ta=dt(),Oe=yr(),ue=H(),vh=Ve();function Th(e){let t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():vh.specifiedDirectives;for(let s of n)t[s.name]=s.locations;let i=e.getDocument().definitions;for(let s of i)s.kind===ue.Kind.DIRECTIVE_DEFINITION&&(t[s.name.value]=s.locations.map(a=>a.value));return{Directive(s,a,o,u,c){let l=s.name.value,f=t[l];if(!f){e.reportError(new fl.GraphQLError(`Unknown directive "@${l}".`,{nodes:s}));return}let d=bh(c);d&&!f.includes(d)&&e.reportError(new fl.GraphQLError(`Directive "@${l}" may not be used on ${d}.`,{nodes:s}))}}}function bh(e){let t=e[e.length-1];switch("kind"in t||(0,va.invariant)(!1),t.kind){case ue.Kind.OPERATION_DEFINITION:return gh(t.operation);case ue.Kind.FIELD:return Oe.DirectiveLocation.FIELD;case ue.Kind.FRAGMENT_SPREAD:return Oe.DirectiveLocation.FRAGMENT_SPREAD;case ue.Kind.INLINE_FRAGMENT:return Oe.DirectiveLocation.INLINE_FRAGMENT;case ue.Kind.FRAGMENT_DEFINITION:return Oe.DirectiveLocation.FRAGMENT_DEFINITION;case ue.Kind.VARIABLE_DEFINITION:return Oe.DirectiveLocation.VARIABLE_DEFINITION;case ue.Kind.SCHEMA_DEFINITION:case ue.Kind.SCHEMA_EXTENSION:return Oe.DirectiveLocation.SCHEMA;case ue.Kind.SCALAR_TYPE_DEFINITION:case ue.Kind.SCALAR_TYPE_EXTENSION:return Oe.DirectiveLocation.SCALAR;case ue.Kind.OBJECT_TYPE_DEFINITION:case ue.Kind.OBJECT_TYPE_EXTENSION:return Oe.DirectiveLocation.OBJECT;case ue.Kind.FIELD_DEFINITION:return Oe.DirectiveLocation.FIELD_DEFINITION;case ue.Kind.INTERFACE_TYPE_DEFINITION:case ue.Kind.INTERFACE_TYPE_EXTENSION:return Oe.DirectiveLocation.INTERFACE;case ue.Kind.UNION_TYPE_DEFINITION:case ue.Kind.UNION_TYPE_EXTENSION:return Oe.DirectiveLocation.UNION;case ue.Kind.ENUM_TYPE_DEFINITION:case ue.Kind.ENUM_TYPE_EXTENSION:return Oe.DirectiveLocation.ENUM;case ue.Kind.ENUM_VALUE_DEFINITION:return Oe.DirectiveLocation.ENUM_VALUE;case ue.Kind.INPUT_OBJECT_TYPE_DEFINITION:case ue.Kind.INPUT_OBJECT_TYPE_EXTENSION:return Oe.DirectiveLocation.INPUT_OBJECT;case ue.Kind.INPUT_VALUE_DEFINITION:{let r=e[e.length-3];return"kind"in r||(0,va.invariant)(!1),r.kind===ue.Kind.INPUT_OBJECT_TYPE_DEFINITION?Oe.DirectiveLocation.INPUT_FIELD_DEFINITION:Oe.DirectiveLocation.ARGUMENT_DEFINITION}default:(0,va.invariant)(!1,"Unexpected kind: "+(0,hh.inspect)(t.kind))}}function gh(e){switch(e){case Ta.OperationTypeNode.QUERY:return Oe.DirectiveLocation.QUERY;case Ta.OperationTypeNode.MUTATION:return Oe.DirectiveLocation.MUTATION;case Ta.OperationTypeNode.SUBSCRIPTION:return Oe.DirectiveLocation.SUBSCRIPTION}}});var _a=h(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});Ea.KnownFragmentNamesRule=_h;var Eh=q();function _h(e){return{FragmentSpread(t){let r=t.name.value;e.getFragment(r)||e.reportError(new Eh.GraphQLError(`Unknown fragment "${r}".`,{nodes:t.name}))}}}});var Ia=h(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.KnownTypeNamesRule=Dh;var Nh=wt(),Oh=kt(),Ih=q(),Na=tr(),Lh=Ye(),Sh=yt();function Dh(e){let t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null);for(let s of e.getDocument().definitions)(0,Na.isTypeDefinitionNode)(s)&&(n[s.name.value]=!0);let i=[...Object.keys(r),...Object.keys(n)];return{NamedType(s,a,o,u,c){let l=s.name.value;if(!r[l]&&!n[l]){var f;let d=(f=c[2])!==null&&f!==void 0?f:o,y=d!=null&&Ah(d);if(y&&ml.includes(l))return;let T=(0,Oh.suggestionList)(l,y?ml.concat(i):i);e.reportError(new Ih.GraphQLError(`Unknown type "${l}".`+(0,Nh.didYouMean)(T),{nodes:s}))}}}}var ml=[...Sh.specifiedScalarTypes,...Lh.introspectionTypes].map(e=>e.name);function Ah(e){return"kind"in e&&((0,Na.isTypeSystemDefinitionNode)(e)||(0,Na.isTypeSystemExtensionNode)(e))}});var Sa=h(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.LoneAnonymousOperationRule=Ph;var Rh=q(),jh=H();function Ph(e){let t=0;return{Document(r){t=r.definitions.filter(n=>n.kind===jh.Kind.OPERATION_DEFINITION).length},OperationDefinition(r){!r.name&&t>1&&e.reportError(new Rh.GraphQLError("This anonymous operation must be the only defined operation.",{nodes:r}))}}}});var Aa=h(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.LoneSchemaDefinitionRule=wh;var yl=q();function wh(e){var t,r,n;let i=e.getSchema(),s=(t=(r=(n=i?.astNode)!==null&&n!==void 0?n:i?.getQueryType())!==null&&r!==void 0?r:i?.getMutationType())!==null&&t!==void 0?t:i?.getSubscriptionType(),a=0;return{SchemaDefinition(o){if(s){e.reportError(new yl.GraphQLError("Cannot define a new schema within a schema extension.",{nodes:o}));return}a>0&&e.reportError(new yl.GraphQLError("Must provide only one schema definition.",{nodes:o})),++a}}}});var ja=h(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.NoFragmentCyclesRule=kh;var Fh=q();function kh(e){let t=Object.create(null),r=[],n=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(s){return i(s),!1}};function i(s){if(t[s.name.value])return;let a=s.name.value;t[a]=!0;let o=e.getFragmentSpreads(s.selectionSet);if(o.length!==0){n[a]=r.length;for(let u of o){let c=u.name.value,l=n[c];if(r.push(u),l===void 0){let f=e.getFragment(c);f&&i(f)}else{let f=r.slice(l),d=f.slice(0,-1).map(y=>'"'+y.name.value+'"').join(", ");e.reportError(new Fh.GraphQLError(`Cannot spread fragment "${c}" within itself`+(d!==""?` via ${d}.`:"."),{nodes:f}))}r.pop()}n[a]=void 0}}}});var wa=h(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.NoUndefinedVariablesRule=xh;var qh=q();function xh(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(r){let n=e.getRecursiveVariableUsages(r);for(let{node:i}of n){let s=i.name.value;t[s]!==!0&&e.reportError(new qh.GraphQLError(r.name?`Variable "$${s}" is not defined by operation "${r.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[i,r]}))}}},VariableDefinition(r){t[r.variable.name.value]=!0}}}});var ka=h(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.NoUnusedFragmentsRule=Mh;var Vh=q();function Mh(e){let t=[],r=[];return{OperationDefinition(n){return t.push(n),!1},FragmentDefinition(n){return r.push(n),!1},Document:{leave(){let n=Object.create(null);for(let i of t)for(let s of e.getRecursivelyReferencedFragments(i))n[s.name.value]=!0;for(let i of r){let s=i.name.value;n[s]!==!0&&e.reportError(new Vh.GraphQLError(`Fragment "${s}" is never used.`,{nodes:i}))}}}}}});var xa=h(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.NoUnusedVariablesRule=Ch;var Gh=q();function Ch(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(r){let n=Object.create(null),i=e.getRecursiveVariableUsages(r);for(let{node:s}of i)n[s.name.value]=!0;for(let s of t){let a=s.variable.name.value;n[a]!==!0&&e.reportError(new Gh.GraphQLError(r.name?`Variable "$${a}" is never used in operation "${r.name.value}".`:`Variable "$${a}" is never used.`,{nodes:s}))}}},VariableDefinition(r){t.push(r)}}}});var Ga=h(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});Ma.sortValueNode=Va;var Qh=$r(),It=H();function Va(e){switch(e.kind){case It.Kind.OBJECT:return{...e,fields:Uh(e.fields)};case It.Kind.LIST:return{...e,values:e.values.map(Va)};case It.Kind.INT:case It.Kind.FLOAT:case It.Kind.STRING:case It.Kind.BOOLEAN:case It.Kind.NULL:case It.Kind.ENUM:case It.Kind.VARIABLE:return e}}function Uh(e){return e.map(t=>({...t,value:Va(t.value)})).sort((t,r)=>(0,Qh.naturalCompare)(t.name.value,r.name.value))}});var Ya=h(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.OverlappingFieldsCanBeMergedRule=Yh;var hl=re(),Kh=q(),Ca=H(),$h=Ce(),Me=Y(),Bh=Ga(),Tl=ht();function bl(e){return Array.isArray(e)?e.map(([t,r])=>`subfields "${t}" conflict because `+bl(r)).join(" and "):e}function Yh(e){let t=new Ka,r=new Map;return{SelectionSet(n){let i=Jh(e,r,t,e.getParentType(),n);for(let[[s,a],o,u]of i){let c=bl(a);e.reportError(new Kh.GraphQLError(`Fields "${s}" conflict because ${c}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:o.concat(u)}))}}}}function Jh(e,t,r,n,i){let s=[],[a,o]=Ei(e,t,n,i);if(Hh(e,s,t,r,a),o.length!==0)for(let u=0;u1)for(let o=0;o[s.value,a]));return r.every(s=>{let a=s.value,o=i.get(s.name.value);return o===void 0?!1:vl(a)===vl(o)})}function vl(e){return(0,$h.print)((0,Bh.sortValueNode)(e))}function Qa(e,t){return(0,Me.isListType)(e)?(0,Me.isListType)(t)?Qa(e.ofType,t.ofType):!0:(0,Me.isListType)(t)?!0:(0,Me.isNonNullType)(e)?(0,Me.isNonNullType)(t)?Qa(e.ofType,t.ofType):!0:(0,Me.isNonNullType)(t)?!0:(0,Me.isLeafType)(e)||(0,Me.isLeafType)(t)?e!==t:!1}function Ei(e,t,r,n){let i=t.get(n);if(i)return i;let s=Object.create(null),a=Object.create(null);El(e,r,n,s,a);let o=[s,Object.keys(a)];return t.set(n,o),o}function Ua(e,t,r){let n=t.get(r.selectionSet);if(n)return n;let i=(0,Tl.typeFromAST)(e.getSchema(),r.typeCondition);return Ei(e,t,i,r.selectionSet)}function El(e,t,r,n,i){for(let s of r.selections)switch(s.kind){case Ca.Kind.FIELD:{let a=s.name.value,o;((0,Me.isObjectType)(t)||(0,Me.isInterfaceType)(t))&&(o=t.getFields()[a]);let u=s.alias?s.alias.value:a;n[u]||(n[u]=[]),n[u].push([t,s,o]);break}case Ca.Kind.FRAGMENT_SPREAD:i[s.name.value]=!0;break;case Ca.Kind.INLINE_FRAGMENT:{let a=s.typeCondition,o=a?(0,Tl.typeFromAST)(e.getSchema(),a):t;El(e,o,s.selectionSet,n,i);break}}}function Wh(e,t,r,n){if(e.length>0)return[[t,e.map(([i])=>i)],[r,...e.map(([,i])=>i).flat()],[n,...e.map(([,,i])=>i).flat()]]}var Ka=class{constructor(){this._data=new Map}has(t,r,n){var i;let[s,a]=t{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.PossibleFragmentSpreadsRule=ev;var _i=re(),_l=q(),Ja=Y(),Nl=zr(),Zh=ht();function ev(e){return{InlineFragment(t){let r=e.getType(),n=e.getParentType();if((0,Ja.isCompositeType)(r)&&(0,Ja.isCompositeType)(n)&&!(0,Nl.doTypesOverlap)(e.getSchema(),r,n)){let i=(0,_i.inspect)(n),s=(0,_i.inspect)(r);e.reportError(new _l.GraphQLError(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${s}".`,{nodes:t}))}},FragmentSpread(t){let r=t.name.value,n=tv(e,r),i=e.getParentType();if(n&&i&&!(0,Nl.doTypesOverlap)(e.getSchema(),n,i)){let s=(0,_i.inspect)(i),a=(0,_i.inspect)(n);e.reportError(new _l.GraphQLError(`Fragment "${r}" cannot be spread here as objects of type "${s}" can never be of type "${a}".`,{nodes:t}))}}}}function tv(e,t){let r=e.getFragment(t);if(r){let n=(0,Zh.typeFromAST)(e.getSchema(),r.typeCondition);if((0,Ja.isCompositeType)(n))return n}}});var Wa=h(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.PossibleTypeExtensionsRule=sv;var rv=wt(),Il=re(),Ll=je(),nv=kt(),Ol=q(),le=H(),iv=tr(),Nr=Y();function sv(e){let t=e.getSchema(),r=Object.create(null);for(let i of e.getDocument().definitions)(0,iv.isTypeDefinitionNode)(i)&&(r[i.name.value]=i);return{ScalarTypeExtension:n,ObjectTypeExtension:n,InterfaceTypeExtension:n,UnionTypeExtension:n,EnumTypeExtension:n,InputObjectTypeExtension:n};function n(i){let s=i.name.value,a=r[s],o=t?.getType(s),u;if(a?u=av[a.kind]:o&&(u=ov(o)),u){if(u!==i.kind){let c=uv(i.kind);e.reportError(new Ol.GraphQLError(`Cannot extend non-${c} type "${s}".`,{nodes:a?[a,i]:i}))}}else{let c=Object.keys({...r,...t?.getTypeMap()}),l=(0,nv.suggestionList)(s,c);e.reportError(new Ol.GraphQLError(`Cannot extend type "${s}" because it is not defined.`+(0,rv.didYouMean)(l),{nodes:i.name}))}}}var av={[le.Kind.SCALAR_TYPE_DEFINITION]:le.Kind.SCALAR_TYPE_EXTENSION,[le.Kind.OBJECT_TYPE_DEFINITION]:le.Kind.OBJECT_TYPE_EXTENSION,[le.Kind.INTERFACE_TYPE_DEFINITION]:le.Kind.INTERFACE_TYPE_EXTENSION,[le.Kind.UNION_TYPE_DEFINITION]:le.Kind.UNION_TYPE_EXTENSION,[le.Kind.ENUM_TYPE_DEFINITION]:le.Kind.ENUM_TYPE_EXTENSION,[le.Kind.INPUT_OBJECT_TYPE_DEFINITION]:le.Kind.INPUT_OBJECT_TYPE_EXTENSION};function ov(e){if((0,Nr.isScalarType)(e))return le.Kind.SCALAR_TYPE_EXTENSION;if((0,Nr.isObjectType)(e))return le.Kind.OBJECT_TYPE_EXTENSION;if((0,Nr.isInterfaceType)(e))return le.Kind.INTERFACE_TYPE_EXTENSION;if((0,Nr.isUnionType)(e))return le.Kind.UNION_TYPE_EXTENSION;if((0,Nr.isEnumType)(e))return le.Kind.ENUM_TYPE_EXTENSION;if((0,Nr.isInputObjectType)(e))return le.Kind.INPUT_OBJECT_TYPE_EXTENSION;(0,Ll.invariant)(!1,"Unexpected type: "+(0,Il.inspect)(e))}function uv(e){switch(e){case le.Kind.SCALAR_TYPE_EXTENSION:return"scalar";case le.Kind.OBJECT_TYPE_EXTENSION:return"object";case le.Kind.INTERFACE_TYPE_EXTENSION:return"interface";case le.Kind.UNION_TYPE_EXTENSION:return"union";case le.Kind.ENUM_TYPE_EXTENSION:return"enum";case le.Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:(0,Ll.invariant)(!1,"Unexpected kind: "+(0,Il.inspect)(e))}}});var eo=h(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.ProvidedRequiredArgumentsOnDirectivesRule=jl;Ni.ProvidedRequiredArgumentsRule=pv;var Dl=re(),Sl=Ft(),Al=q(),Rl=H(),cv=Ce(),Za=Y(),lv=Ve();function pv(e){return{...jl(e),Field:{leave(t){var r;let n=e.getFieldDef();if(!n)return!1;let i=new Set((r=t.arguments)===null||r===void 0?void 0:r.map(s=>s.name.value));for(let s of n.args)if(!i.has(s.name)&&(0,Za.isRequiredArgument)(s)){let a=(0,Dl.inspect)(s.type);e.reportError(new Al.GraphQLError(`Field "${n.name}" argument "${s.name}" of type "${a}" is required, but it was not provided.`,{nodes:t}))}}}}}function jl(e){var t;let r=Object.create(null),n=e.getSchema(),i=(t=n?.getDirectives())!==null&&t!==void 0?t:lv.specifiedDirectives;for(let o of i)r[o.name]=(0,Sl.keyMap)(o.args.filter(Za.isRequiredArgument),u=>u.name);let s=e.getDocument().definitions;for(let o of s)if(o.kind===Rl.Kind.DIRECTIVE_DEFINITION){var a;let u=(a=o.arguments)!==null&&a!==void 0?a:[];r[o.name.value]=(0,Sl.keyMap)(u.filter(dv),c=>c.name.value)}return{Directive:{leave(o){let u=o.name.value,c=r[u];if(c){var l;let f=(l=o.arguments)!==null&&l!==void 0?l:[],d=new Set(f.map(y=>y.name.value));for(let[y,T]of Object.entries(c))if(!d.has(y)){let I=(0,Za.isType)(T.type)?(0,Dl.inspect)(T.type):(0,cv.print)(T.type);e.reportError(new Al.GraphQLError(`Directive "@${u}" argument "${y}" of type "${I}" is required, but it was not provided.`,{nodes:o}))}}}}}}function dv(e){return e.type.kind===Rl.Kind.NON_NULL_TYPE&&e.defaultValue==null}});var ro=h(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.ScalarLeafsRule=fv;var Pl=re(),wl=q(),Fl=Y();function fv(e){return{Field(t){let r=e.getType(),n=t.selectionSet;if(r){if((0,Fl.isLeafType)((0,Fl.getNamedType)(r))){if(n){let i=t.name.value,s=(0,Pl.inspect)(r);e.reportError(new wl.GraphQLError(`Field "${i}" must not have a selection since type "${s}" has no subfields.`,{nodes:n}))}}else if(!n){let i=t.name.value,s=(0,Pl.inspect)(r);e.reportError(new wl.GraphQLError(`Field "${i}" of type "${s}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:t}))}}}}}});var io=h(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.printPathArray=mv;function mv(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}});var pn=h(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.addPath=yv;Oi.pathToArray=hv;function yv(e,t,r){return{prev:e,key:t,typename:r}}function hv(e){let t=[],r=e;for(;r;)t.push(r.key),r=r.prev;return t.reverse()}});var ao=h(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.coerceInputValue=Nv;var vv=wt(),Ii=re(),Tv=je(),bv=fi(),gv=pt(),Lt=pn(),Ev=io(),_v=kt(),rr=q(),dn=Y();function Nv(e,t,r=Ov){return fn(e,t,r,void 0)}function Ov(e,t,r){let n="Invalid value "+(0,Ii.inspect)(t);throw e.length>0&&(n+=` at "value${(0,Ev.printPathArray)(e)}"`),r.message=n+": "+r.message,r}function fn(e,t,r,n){if((0,dn.isNonNullType)(t)){if(e!=null)return fn(e,t.ofType,r,n);r((0,Lt.pathToArray)(n),e,new rr.GraphQLError(`Expected non-nullable type "${(0,Ii.inspect)(t)}" not to be null.`));return}if(e==null)return null;if((0,dn.isListType)(t)){let i=t.ofType;return(0,bv.isIterableObject)(e)?Array.from(e,(s,a)=>{let o=(0,Lt.addPath)(n,a,void 0);return fn(s,i,r,o)}):[fn(e,i,r,n)]}if((0,dn.isInputObjectType)(t)){if(!(0,gv.isObjectLike)(e)){r((0,Lt.pathToArray)(n),e,new rr.GraphQLError(`Expected type "${t.name}" to be an object.`));return}let i={},s=t.getFields();for(let a of Object.values(s)){let o=e[a.name];if(o===void 0){if(a.defaultValue!==void 0)i[a.name]=a.defaultValue;else if((0,dn.isNonNullType)(a.type)){let u=(0,Ii.inspect)(a.type);r((0,Lt.pathToArray)(n),e,new rr.GraphQLError(`Field "${a.name}" of required type "${u}" was not provided.`))}continue}i[a.name]=fn(o,a.type,r,(0,Lt.addPath)(n,a.name,t.name))}for(let a of Object.keys(e))if(!s[a]){let o=(0,_v.suggestionList)(a,Object.keys(t.getFields()));r((0,Lt.pathToArray)(n),e,new rr.GraphQLError(`Field "${a}" is not defined by type "${t.name}".`+(0,vv.didYouMean)(o)))}return i}if((0,dn.isLeafType)(t)){let i;try{i=t.parseValue(e)}catch(s){s instanceof rr.GraphQLError?r((0,Lt.pathToArray)(n),e,s):r((0,Lt.pathToArray)(n),e,new rr.GraphQLError(`Expected type "${t.name}". `+s.message,{originalError:s}));return}return i===void 0&&r((0,Lt.pathToArray)(n),e,new rr.GraphQLError(`Expected type "${t.name}".`)),i}(0,Tv.invariant)(!1,"Unexpected input type: "+(0,Ii.inspect)(t))}});var yn=h(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.valueFromAST=mn;var Iv=re(),Lv=je(),Sv=Ft(),Or=H(),nr=Y();function mn(e,t,r){if(e){if(e.kind===Or.Kind.VARIABLE){let n=e.name.value;if(r==null||r[n]===void 0)return;let i=r[n];return i===null&&(0,nr.isNonNullType)(t)?void 0:i}if((0,nr.isNonNullType)(t))return e.kind===Or.Kind.NULL?void 0:mn(e,t.ofType,r);if(e.kind===Or.Kind.NULL)return null;if((0,nr.isListType)(t)){let n=t.ofType;if(e.kind===Or.Kind.LIST){let s=[];for(let a of e.values)if(kl(a,r)){if((0,nr.isNonNullType)(n))return;s.push(null)}else{let o=mn(a,n,r);if(o===void 0)return;s.push(o)}return s}let i=mn(e,n,r);return i===void 0?void 0:[i]}if((0,nr.isInputObjectType)(t)){if(e.kind!==Or.Kind.OBJECT)return;let n=Object.create(null),i=(0,Sv.keyMap)(e.fields,s=>s.name.value);for(let s of Object.values(t.getFields())){let a=i[s.name];if(!a||kl(a.value,r)){if(s.defaultValue!==void 0)n[s.name]=s.defaultValue;else if((0,nr.isNonNullType)(s.type))return;continue}let o=mn(a.value,s.type,r);if(o===void 0)return;n[s.name]=o}return n}if((0,nr.isLeafType)(t)){let n;try{n=t.parseLiteral(e,r)}catch{return}return n===void 0?void 0:n}(0,Lv.invariant)(!1,"Unexpected input type: "+(0,Iv.inspect)(t))}}function kl(e,t){return e.kind===Or.Kind.VARIABLE&&(t==null||t[e.name.value]===void 0)}});var Sr=h(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.getArgumentValues=Ml;hn.getDirectiveValues=Fv;hn.getVariableValues=Pv;var Ir=re(),Dv=Ft(),Av=io(),St=q(),ql=H(),xl=Ce(),Lr=Y(),Rv=ao(),jv=ht(),Vl=yn();function Pv(e,t,r,n){let i=[],s=n?.maxErrors;try{let a=wv(e,t,r,o=>{if(s!=null&&i.length>=s)throw new St.GraphQLError("Too many errors processing variables, error limit reached. Execution aborted.");i.push(o)});if(i.length===0)return{coerced:a}}catch(a){i.push(a)}return{errors:i}}function wv(e,t,r,n){let i={};for(let s of t){let a=s.variable.name.value,o=(0,jv.typeFromAST)(e,s.type);if(!(0,Lr.isInputType)(o)){let c=(0,xl.print)(s.type);n(new St.GraphQLError(`Variable "$${a}" expected value of type "${c}" which cannot be used as an input type.`,{nodes:s.type}));continue}if(!Gl(r,a)){if(s.defaultValue)i[a]=(0,Vl.valueFromAST)(s.defaultValue,o);else if((0,Lr.isNonNullType)(o)){let c=(0,Ir.inspect)(o);n(new St.GraphQLError(`Variable "$${a}" of required type "${c}" was not provided.`,{nodes:s}))}continue}let u=r[a];if(u===null&&(0,Lr.isNonNullType)(o)){let c=(0,Ir.inspect)(o);n(new St.GraphQLError(`Variable "$${a}" of non-null type "${c}" must not be null.`,{nodes:s}));continue}i[a]=(0,Rv.coerceInputValue)(u,o,(c,l,f)=>{let d=`Variable "$${a}" got invalid value `+(0,Ir.inspect)(l);c.length>0&&(d+=` at "${a}${(0,Av.printPathArray)(c)}"`),n(new St.GraphQLError(d+"; "+f.message,{nodes:s,originalError:f}))})}return i}function Ml(e,t,r){var n;let i={},s=(n=t.arguments)!==null&&n!==void 0?n:[],a=(0,Dv.keyMap)(s,o=>o.name.value);for(let o of e.args){let u=o.name,c=o.type,l=a[u];if(!l){if(o.defaultValue!==void 0)i[u]=o.defaultValue;else if((0,Lr.isNonNullType)(c))throw new St.GraphQLError(`Argument "${u}" of required type "${(0,Ir.inspect)(c)}" was not provided.`,{nodes:t});continue}let f=l.value,d=f.kind===ql.Kind.NULL;if(f.kind===ql.Kind.VARIABLE){let T=f.name.value;if(r==null||!Gl(r,T)){if(o.defaultValue!==void 0)i[u]=o.defaultValue;else if((0,Lr.isNonNullType)(c))throw new St.GraphQLError(`Argument "${u}" of required type "${(0,Ir.inspect)(c)}" was provided the variable "$${T}" which was not provided a runtime value.`,{nodes:f});continue}d=r[T]==null}if(d&&(0,Lr.isNonNullType)(c))throw new St.GraphQLError(`Argument "${u}" of non-null type "${(0,Ir.inspect)(c)}" must not be null.`,{nodes:f});let y=(0,Vl.valueFromAST)(f,c,r);if(y===void 0)throw new St.GraphQLError(`Argument "${u}" has invalid value ${(0,xl.print)(f)}.`,{nodes:f});i[u]=y}return i}function Fv(e,t,r){var n;let i=(n=t.directives)===null||n===void 0?void 0:n.find(s=>s.name.value===e.name);if(i)return Ml(e,i,r)}function Gl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var Di=h(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.collectFields=xv;Si.collectSubfields=Vv;var uo=H(),kv=Y(),Cl=Ve(),qv=ht(),Ql=Sr();function xv(e,t,r,n,i){let s=new Map;return Li(e,t,r,n,i,s,new Set),s}function Vv(e,t,r,n,i){let s=new Map,a=new Set;for(let o of i)o.selectionSet&&Li(e,t,r,n,o.selectionSet,s,a);return s}function Li(e,t,r,n,i,s,a){for(let o of i.selections)switch(o.kind){case uo.Kind.FIELD:{if(!co(r,o))continue;let u=Mv(o),c=s.get(u);c!==void 0?c.push(o):s.set(u,[o]);break}case uo.Kind.INLINE_FRAGMENT:{if(!co(r,o)||!Ul(e,o,n))continue;Li(e,t,r,n,o.selectionSet,s,a);break}case uo.Kind.FRAGMENT_SPREAD:{let u=o.name.value;if(a.has(u)||!co(r,o))continue;a.add(u);let c=t[u];if(!c||!Ul(e,c,n))continue;Li(e,t,r,n,c.selectionSet,s,a);break}}}function co(e,t){let r=(0,Ql.getDirectiveValues)(Cl.GraphQLSkipDirective,t,e);if(r?.if===!0)return!1;let n=(0,Ql.getDirectiveValues)(Cl.GraphQLIncludeDirective,t,e);return n?.if!==!1}function Ul(e,t,r){let n=t.typeCondition;if(!n)return!0;let i=(0,qv.typeFromAST)(e,n);return i===r?!0:(0,kv.isAbstractType)(i)?e.isSubType(i,r):!1}function Mv(e){return e.alias?e.alias.value:e.name.value}});var po=h(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.SingleFieldSubscriptionsRule=Qv;var Kl=q(),Gv=H(),Cv=Di();function Qv(e){return{OperationDefinition(t){if(t.operation==="subscription"){let r=e.getSchema(),n=r.getSubscriptionType();if(n){let i=t.name?t.name.value:null,s=Object.create(null),a=e.getDocument(),o=Object.create(null);for(let c of a.definitions)c.kind===Gv.Kind.FRAGMENT_DEFINITION&&(o[c.name.value]=c);let u=(0,Cv.collectFields)(r,o,s,n,t.selectionSet);if(u.size>1){let f=[...u.values()].slice(1).flat();e.reportError(new Kl.GraphQLError(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:f}))}for(let c of u.values())c[0].name.value.startsWith("__")&&e.reportError(new Kl.GraphQLError(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:c}))}}}}}});var Ai=h(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.groupBy=Uv;function Uv(e,t){let r=new Map;for(let n of e){let i=t(n),s=r.get(i);s===void 0?r.set(i,[n]):s.push(n)}return r}});var yo=h(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.UniqueArgumentDefinitionNamesRule=Bv;var Kv=Ai(),$v=q();function Bv(e){return{DirectiveDefinition(n){var i;let s=(i=n.arguments)!==null&&i!==void 0?i:[];return r(`@${n.name.value}`,s)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(n){var i;let s=n.name.value,a=(i=n.fields)!==null&&i!==void 0?i:[];for(let u of a){var o;let c=u.name.value,l=(o=u.arguments)!==null&&o!==void 0?o:[];r(`${s}.${c}`,l)}return!1}function r(n,i){let s=(0,Kv.groupBy)(i,a=>a.name.value);for(let[a,o]of s)o.length>1&&e.reportError(new $v.GraphQLError(`Argument "${n}(${a}:)" can only be defined once.`,{nodes:o.map(u=>u.name)}));return!1}}});var vo=h(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.UniqueArgumentNamesRule=Xv;var Yv=Ai(),Jv=q();function Xv(e){return{Field:t,Directive:t};function t(r){var n;let i=(n=r.arguments)!==null&&n!==void 0?n:[],s=(0,Yv.groupBy)(i,a=>a.name.value);for(let[a,o]of s)o.length>1&&e.reportError(new Jv.GraphQLError(`There can be only one argument named "${a}".`,{nodes:o.map(u=>u.name)}))}}});var bo=h(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.UniqueDirectiveNamesRule=Hv;var $l=q();function Hv(e){let t=Object.create(null),r=e.getSchema();return{DirectiveDefinition(n){let i=n.name.value;if(r!=null&&r.getDirective(i)){e.reportError(new $l.GraphQLError(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:n.name}));return}return t[i]?e.reportError(new $l.GraphQLError(`There can be only one directive named "@${i}".`,{nodes:[t[i],n.name]})):t[i]=n.name,!1}}}});var _o=h(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.UniqueDirectivesPerLocationRule=Zv;var zv=q(),go=H(),Bl=tr(),Wv=Ve();function Zv(e){let t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():Wv.specifiedDirectives;for(let o of n)t[o.name]=!o.isRepeatable;let i=e.getDocument().definitions;for(let o of i)o.kind===go.Kind.DIRECTIVE_DEFINITION&&(t[o.name.value]=!o.repeatable);let s=Object.create(null),a=Object.create(null);return{enter(o){if(!("directives"in o)||!o.directives)return;let u;if(o.kind===go.Kind.SCHEMA_DEFINITION||o.kind===go.Kind.SCHEMA_EXTENSION)u=s;else if((0,Bl.isTypeDefinitionNode)(o)||(0,Bl.isTypeExtensionNode)(o)){let c=o.name.value;u=a[c],u===void 0&&(a[c]=u=Object.create(null))}else u=Object.create(null);for(let c of o.directives){let l=c.name.value;t[l]&&(u[l]?e.reportError(new zv.GraphQLError(`The directive "@${l}" can only be used once at this location.`,{nodes:[u[l],c]})):u[l]=c)}}}}});var Oo=h(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.UniqueEnumValueNamesRule=tT;var Yl=q(),eT=Y();function tT(e){let t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(s){var a;let o=s.name.value;n[o]||(n[o]=Object.create(null));let u=(a=s.values)!==null&&a!==void 0?a:[],c=n[o];for(let l of u){let f=l.name.value,d=r[o];(0,eT.isEnumType)(d)&&d.getValue(f)?e.reportError(new Yl.GraphQLError(`Enum value "${o}.${f}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name})):c[f]?e.reportError(new Yl.GraphQLError(`Enum value "${o}.${f}" can only be defined once.`,{nodes:[c[f],l.name]})):c[f]=l.name}return!1}}});var So=h(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.UniqueFieldDefinitionNamesRule=rT;var Jl=q(),Io=Y();function rT(e){let t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(s){var a;let o=s.name.value;n[o]||(n[o]=Object.create(null));let u=(a=s.fields)!==null&&a!==void 0?a:[],c=n[o];for(let l of u){let f=l.name.value;nT(r[o],f)?e.reportError(new Jl.GraphQLError(`Field "${o}.${f}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name})):c[f]?e.reportError(new Jl.GraphQLError(`Field "${o}.${f}" can only be defined once.`,{nodes:[c[f],l.name]})):c[f]=l.name}return!1}}function nT(e,t){return(0,Io.isObjectType)(e)||(0,Io.isInterfaceType)(e)||(0,Io.isInputObjectType)(e)?e.getFields()[t]!=null:!1}});var Ao=h(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.UniqueFragmentNamesRule=sT;var iT=q();function sT(e){let t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(r){let n=r.name.value;return t[n]?e.reportError(new iT.GraphQLError(`There can be only one fragment named "${n}".`,{nodes:[t[n],r.name]})):t[n]=r.name,!1}}}});var jo=h(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.UniqueInputFieldNamesRule=uT;var aT=je(),oT=q();function uT(e){let t=[],r=Object.create(null);return{ObjectValue:{enter(){t.push(r),r=Object.create(null)},leave(){let n=t.pop();n||(0,aT.invariant)(!1),r=n}},ObjectField(n){let i=n.name.value;r[i]?e.reportError(new oT.GraphQLError(`There can be only one input field named "${i}".`,{nodes:[r[i],n.name]})):r[i]=n.name}}}});var wo=h(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.UniqueOperationNamesRule=lT;var cT=q();function lT(e){let t=Object.create(null);return{OperationDefinition(r){let n=r.name;return n&&(t[n.value]?e.reportError(new cT.GraphQLError(`There can be only one operation named "${n.value}".`,{nodes:[t[n.value],n]})):t[n.value]=n),!1},FragmentDefinition:()=>!1}}});var ko=h(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.UniqueOperationTypesRule=pT;var Xl=q();function pT(e){let t=e.getSchema(),r=Object.create(null),n=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(s){var a;let o=(a=s.operationTypes)!==null&&a!==void 0?a:[];for(let u of o){let c=u.operation,l=r[c];n[c]?e.reportError(new Xl.GraphQLError(`Type for ${c} already defined in the schema. It cannot be redefined.`,{nodes:u})):l?e.reportError(new Xl.GraphQLError(`There can be only one ${c} type in schema.`,{nodes:[l,u]})):r[c]=u}return!1}}});var xo=h(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.UniqueTypeNamesRule=dT;var Hl=q();function dT(e){let t=Object.create(null),r=e.getSchema();return{ScalarTypeDefinition:n,ObjectTypeDefinition:n,InterfaceTypeDefinition:n,UnionTypeDefinition:n,EnumTypeDefinition:n,InputObjectTypeDefinition:n};function n(i){let s=i.name.value;if(r!=null&&r.getType(s)){e.reportError(new Hl.GraphQLError(`Type "${s}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}));return}return t[s]?e.reportError(new Hl.GraphQLError(`There can be only one type named "${s}".`,{nodes:[t[s],i.name]})):t[s]=i.name,!1}}});var Mo=h(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.UniqueVariableNamesRule=yT;var fT=Ai(),mT=q();function yT(e){return{OperationDefinition(t){var r;let n=(r=t.variableDefinitions)!==null&&r!==void 0?r:[],i=(0,fT.groupBy)(n,s=>s.variable.name.value);for(let[s,a]of i)a.length>1&&e.reportError(new mT.GraphQLError(`There can be only one variable named "$${s}".`,{nodes:a.map(o=>o.variable.name)}))}}}});var Co=h(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.ValuesOfCorrectTypeRule=bT;var hT=wt(),vn=re(),vT=Ft(),TT=kt(),sr=q(),Ri=Ce(),vt=Y();function bT(e){return{ListValue(t){let r=(0,vt.getNullableType)(e.getParentInputType());if(!(0,vt.isListType)(r))return ir(e,t),!1},ObjectValue(t){let r=(0,vt.getNamedType)(e.getInputType());if(!(0,vt.isInputObjectType)(r))return ir(e,t),!1;let n=(0,vT.keyMap)(t.fields,i=>i.name.value);for(let i of Object.values(r.getFields()))if(!n[i.name]&&(0,vt.isRequiredInputField)(i)){let a=(0,vn.inspect)(i.type);e.reportError(new sr.GraphQLError(`Field "${r.name}.${i.name}" of required type "${a}" was not provided.`,{nodes:t}))}},ObjectField(t){let r=(0,vt.getNamedType)(e.getParentInputType());if(!e.getInputType()&&(0,vt.isInputObjectType)(r)){let i=(0,TT.suggestionList)(t.name.value,Object.keys(r.getFields()));e.reportError(new sr.GraphQLError(`Field "${t.name.value}" is not defined by type "${r.name}".`+(0,hT.didYouMean)(i),{nodes:t}))}},NullValue(t){let r=e.getInputType();(0,vt.isNonNullType)(r)&&e.reportError(new sr.GraphQLError(`Expected value of type "${(0,vn.inspect)(r)}", found ${(0,Ri.print)(t)}.`,{nodes:t}))},EnumValue:t=>ir(e,t),IntValue:t=>ir(e,t),FloatValue:t=>ir(e,t),StringValue:t=>ir(e,t),BooleanValue:t=>ir(e,t)}}function ir(e,t){let r=e.getInputType();if(!r)return;let n=(0,vt.getNamedType)(r);if(!(0,vt.isLeafType)(n)){let i=(0,vn.inspect)(r);e.reportError(new sr.GraphQLError(`Expected value of type "${i}", found ${(0,Ri.print)(t)}.`,{nodes:t}));return}try{if(n.parseLiteral(t,void 0)===void 0){let s=(0,vn.inspect)(r);e.reportError(new sr.GraphQLError(`Expected value of type "${s}", found ${(0,Ri.print)(t)}.`,{nodes:t}))}}catch(i){let s=(0,vn.inspect)(r);i instanceof sr.GraphQLError?e.reportError(i):e.reportError(new sr.GraphQLError(`Expected value of type "${s}", found ${(0,Ri.print)(t)}; `+i.message,{nodes:t,originalError:i}))}}});var Uo=h(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.VariablesAreInputTypesRule=OT;var gT=q(),ET=Ce(),_T=Y(),NT=ht();function OT(e){return{VariableDefinition(t){let r=(0,NT.typeFromAST)(e.getSchema(),t.type);if(r!==void 0&&!(0,_T.isInputType)(r)){let n=t.variable.name.value,i=(0,ET.print)(t.type);e.reportError(new gT.GraphQLError(`Variable "$${n}" cannot be non-input type "${i}".`,{nodes:t.type}))}}}}});var $o=h(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.VariablesInAllowedPositionRule=DT;var zl=re(),IT=q(),LT=H(),Wl=Y(),Zl=zr(),ST=ht();function DT(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(r){let n=e.getRecursiveVariableUsages(r);for(let{node:i,type:s,defaultValue:a}of n){let o=i.name.value,u=t[o];if(u&&s){let c=e.getSchema(),l=(0,ST.typeFromAST)(c,u.type);if(l&&!AT(c,l,u.defaultValue,s,a)){let f=(0,zl.inspect)(l),d=(0,zl.inspect)(s);e.reportError(new IT.GraphQLError(`Variable "$${o}" of type "${f}" used in position expecting type "${d}".`,{nodes:[u,i]}))}}}}},VariableDefinition(r){t[r.variable.name.value]=r}}}function AT(e,t,r,n,i){if((0,Wl.isNonNullType)(n)&&!(0,Wl.isNonNullType)(t)){if(!(r!=null&&r.kind!==LT.Kind.NULL)&&!(i!==void 0))return!1;let o=n.ofType;return(0,Zl.isTypeSubTypeOf)(e,t,o)}return(0,Zl.isTypeSubTypeOf)(e,t,n)}});var Bo=h(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.specifiedSDLRules=Dr.specifiedRules=void 0;var RT=pa(),jT=fa(),PT=ya(),ep=ha(),tp=ga(),wT=_a(),rp=Ia(),FT=Sa(),kT=Aa(),qT=ja(),xT=wa(),VT=ka(),MT=xa(),GT=Ya(),CT=Ha(),QT=Wa(),np=eo(),UT=ro(),KT=po(),$T=yo(),ip=vo(),BT=bo(),sp=_o(),YT=Oo(),JT=So(),XT=Ao(),ap=jo(),HT=wo(),zT=ko(),WT=xo(),ZT=Mo(),eb=Co(),tb=Uo(),rb=$o(),nb=Object.freeze([RT.ExecutableDefinitionsRule,HT.UniqueOperationNamesRule,FT.LoneAnonymousOperationRule,KT.SingleFieldSubscriptionsRule,rp.KnownTypeNamesRule,PT.FragmentsOnCompositeTypesRule,tb.VariablesAreInputTypesRule,UT.ScalarLeafsRule,jT.FieldsOnCorrectTypeRule,XT.UniqueFragmentNamesRule,wT.KnownFragmentNamesRule,VT.NoUnusedFragmentsRule,CT.PossibleFragmentSpreadsRule,qT.NoFragmentCyclesRule,ZT.UniqueVariableNamesRule,xT.NoUndefinedVariablesRule,MT.NoUnusedVariablesRule,tp.KnownDirectivesRule,sp.UniqueDirectivesPerLocationRule,ep.KnownArgumentNamesRule,ip.UniqueArgumentNamesRule,eb.ValuesOfCorrectTypeRule,np.ProvidedRequiredArgumentsRule,rb.VariablesInAllowedPositionRule,GT.OverlappingFieldsCanBeMergedRule,ap.UniqueInputFieldNamesRule]);Dr.specifiedRules=nb;var ib=Object.freeze([kT.LoneSchemaDefinitionRule,zT.UniqueOperationTypesRule,WT.UniqueTypeNamesRule,YT.UniqueEnumValueNamesRule,JT.UniqueFieldDefinitionNamesRule,$T.UniqueArgumentDefinitionNamesRule,BT.UniqueDirectiveNamesRule,rp.KnownTypeNamesRule,tp.KnownDirectivesRule,sp.UniqueDirectivesPerLocationRule,QT.PossibleTypeExtensionsRule,ep.KnownArgumentNamesOnDirectivesRule,ip.UniqueArgumentNamesRule,ap.UniqueInputFieldNamesRule,np.ProvidedRequiredArgumentsOnDirectivesRule]);Dr.specifiedSDLRules=ib});var Xo=h(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.ValidationContext=Gt.SDLValidationContext=Gt.ASTValidationContext=void 0;var op=H(),sb=Yt(),up=vi(),Tn=class{constructor(t,r){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=r}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let r;if(this._fragments)r=this._fragments;else{r=Object.create(null);for(let n of this.getDocument().definitions)n.kind===op.Kind.FRAGMENT_DEFINITION&&(r[n.name.value]=n);this._fragments=r}return r[t]}getFragmentSpreads(t){let r=this._fragmentSpreads.get(t);if(!r){r=[];let n=[t],i;for(;i=n.pop();)for(let s of i.selections)s.kind===op.Kind.FRAGMENT_SPREAD?r.push(s):s.selectionSet&&n.push(s.selectionSet);this._fragmentSpreads.set(t,r)}return r}getRecursivelyReferencedFragments(t){let r=this._recursivelyReferencedFragments.get(t);if(!r){r=[];let n=Object.create(null),i=[t.selectionSet],s;for(;s=i.pop();)for(let a of this.getFragmentSpreads(s)){let o=a.name.value;if(n[o]!==!0){n[o]=!0;let u=this.getFragment(o);u&&(r.push(u),i.push(u.selectionSet))}}this._recursivelyReferencedFragments.set(t,r)}return r}};Gt.ASTValidationContext=Tn;var Yo=class extends Tn{constructor(t,r,n){super(t,n),this._schema=r}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}};Gt.SDLValidationContext=Yo;var Jo=class extends Tn{constructor(t,r,n,i){super(r,i),this._schema=t,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(t){let r=this._variableUsages.get(t);if(!r){let n=[],i=new up.TypeInfo(this._schema);(0,sb.visit)(t,(0,up.visitWithTypeInfo)(i,{VariableDefinition:()=>!1,Variable(s){n.push({node:s,type:i.getInputType(),defaultValue:i.getDefaultValue()})}})),r=n,this._variableUsages.set(t,r)}return r}getRecursiveVariableUsages(t){let r=this._recursiveVariableUsages.get(t);if(!r){r=this.getVariableUsages(t);for(let n of this.getRecursivelyReferencedFragments(t))r=r.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(t,r)}return r}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}};Gt.ValidationContext=Jo});var bn=h(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.assertValidSDL=lb;Ar.assertValidSDLExtension=pb;Ar.validate=cb;Ar.validateSDL=Ho;var ab=Fe(),ob=q(),ji=Yt(),ub=un(),cp=vi(),lp=Bo(),pp=Xo();function cb(e,t,r=lp.specifiedRules,n,i=new cp.TypeInfo(e)){var s;let a=(s=n?.maxErrors)!==null&&s!==void 0?s:100;t||(0,ab.devAssert)(!1,"Must provide document."),(0,ub.assertValidSchema)(e);let o=Object.freeze({}),u=[],c=new pp.ValidationContext(e,t,i,f=>{if(u.length>=a)throw u.push(new ob.GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),o;u.push(f)}),l=(0,ji.visitInParallel)(r.map(f=>f(c)));try{(0,ji.visit)(t,(0,cp.visitWithTypeInfo)(i,l))}catch(f){if(f!==o)throw f}return u}function Ho(e,t,r=lp.specifiedSDLRules){let n=[],i=new pp.SDLValidationContext(e,t,a=>{n.push(a)}),s=r.map(a=>a(i));return(0,ji.visit)(e,(0,ji.visitInParallel)(s)),n}function lb(e){let t=Ho(e);if(t.length!==0)throw new Error(t.map(r=>r.message).join(` + +`))}function pb(e,t){let r=Ho(e,t);if(r.length!==0)throw new Error(r.map(n=>n.message).join(` + +`))}});var dp=h(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.memoize3=db;function db(e){let t;return function(n,i,s){t===void 0&&(t=new WeakMap);let a=t.get(n);a===void 0&&(a=new WeakMap,t.set(n,a));let o=a.get(i);o===void 0&&(o=new WeakMap,a.set(i,o));let u=o.get(s);return u===void 0&&(u=e(n,i,s),o.set(s,u)),u}}});var fp=h(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.promiseForObject=fb;function fb(e){return Promise.all(Object.values(e)).then(t=>{let r=Object.create(null);for(let[n,i]of Object.keys(e).entries())r[i]=t[n];return r})}});var mp=h(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.promiseReduce=yb;var mb=wn();function yb(e,t,r){let n=r;for(let i of e)n=(0,mb.isPromise)(n)?n.then(s=>t(s,i)):t(n,i);return n}});var yp=h(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.toError=vb;var hb=re();function vb(e){return e instanceof Error?e:new eu(e)}var eu=class extends Error{constructor(t){super("Unexpected error value: "+(0,hb.inspect)(t)),this.name="NonErrorThrown",this.thrownValue=t}}});var Pi=h(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.locatedError=gb;var Tb=yp(),bb=q();function gb(e,t,r){var n;let i=(0,Tb.toError)(e);return Eb(i)?i:new bb.GraphQLError(i.message,{nodes:(n=i.nodes)!==null&&n!==void 0?n:t,source:i.source,positions:i.positions,path:r,originalError:i})}function Eb(e){return Array.isArray(e.path)}});var En=h(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.assertValidExecutionArguments=Np;He.buildExecutionContext=Op;He.buildResolveInfo=Lp;He.defaultTypeResolver=He.defaultFieldResolver=void 0;He.execute=_p;He.executeSync=Db;He.getFieldDef=Dp;var iu=Fe(),ar=re(),_b=je(),Nb=fi(),ou=pt(),ut=wn(),Ob=dp(),or=pn(),hp=fp(),Ib=mp(),Xe=q(),Fi=Pi(),nu=dt(),vp=H(),Ct=Y(),Rr=Ye(),Lb=un(),gp=Di(),Ep=Sr(),Sb=(0,Ob.memoize3)((e,t,r)=>(0,gp.collectSubfields)(e.schema,e.fragments,e.variableValues,t,r));function _p(e){arguments.length<2||(0,iu.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:t,document:r,variableValues:n,rootValue:i}=e;Np(t,r,n);let s=Op(e);if(!("schema"in s))return{errors:s};try{let{operation:a}=s,o=Ab(s,a,i);return(0,ut.isPromise)(o)?o.then(u=>wi(u,s.errors),u=>(s.errors.push(u),wi(null,s.errors))):wi(o,s.errors)}catch(a){return s.errors.push(a),wi(null,s.errors)}}function Db(e){let t=_p(e);if((0,ut.isPromise)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function wi(e,t){return t.length===0?{data:e}:{errors:t,data:e}}function Np(e,t,r){t||(0,iu.devAssert)(!1,"Must provide document."),(0,Lb.assertValidSchema)(e),r==null||(0,ou.isObjectLike)(r)||(0,iu.devAssert)(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function Op(e){var t,r;let{schema:n,document:i,rootValue:s,contextValue:a,variableValues:o,operationName:u,fieldResolver:c,typeResolver:l,subscribeFieldResolver:f}=e,d,y=Object.create(null);for(let E of i.definitions)switch(E.kind){case vp.Kind.OPERATION_DEFINITION:if(u==null){if(d!==void 0)return[new Xe.GraphQLError("Must provide operation name if query contains multiple operations.")];d=E}else((t=E.name)===null||t===void 0?void 0:t.value)===u&&(d=E);break;case vp.Kind.FRAGMENT_DEFINITION:y[E.name.value]=E;break;default:}if(!d)return u!=null?[new Xe.GraphQLError(`Unknown operation named "${u}".`)]:[new Xe.GraphQLError("Must provide an operation.")];let T=(r=d.variableDefinitions)!==null&&r!==void 0?r:[],I=(0,Ep.getVariableValues)(n,T,o??{},{maxErrors:50});return I.errors?I.errors:{schema:n,fragments:y,rootValue:s,contextValue:a,operation:d,variableValues:I.coerced,fieldResolver:c??au,typeResolver:l??Sp,subscribeFieldResolver:f??au,errors:[]}}function Ab(e,t,r){let n=e.schema.getRootType(t.operation);if(n==null)throw new Xe.GraphQLError(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});let i=(0,gp.collectFields)(e.schema,e.fragments,e.variableValues,n,t.selectionSet),s=void 0;switch(t.operation){case nu.OperationTypeNode.QUERY:return ki(e,n,r,s,i);case nu.OperationTypeNode.MUTATION:return Rb(e,n,r,s,i);case nu.OperationTypeNode.SUBSCRIPTION:return ki(e,n,r,s,i)}}function Rb(e,t,r,n,i){return(0,Ib.promiseReduce)(i.entries(),(s,[a,o])=>{let u=(0,or.addPath)(n,a,t.name),c=Ip(e,t,r,o,u);return c===void 0?s:(0,ut.isPromise)(c)?c.then(l=>(s[a]=l,s)):(s[a]=c,s)},Object.create(null))}function ki(e,t,r,n,i){let s=Object.create(null),a=!1;try{for(let[o,u]of i.entries()){let c=(0,or.addPath)(n,o,t.name),l=Ip(e,t,r,u,c);l!==void 0&&(s[o]=l,(0,ut.isPromise)(l)&&(a=!0))}}catch(o){if(a)return(0,hp.promiseForObject)(s).finally(()=>{throw o});throw o}return a?(0,hp.promiseForObject)(s):s}function Ip(e,t,r,n,i){var s;let a=Dp(e.schema,t,n[0]);if(!a)return;let o=a.type,u=(s=a.resolve)!==null&&s!==void 0?s:e.fieldResolver,c=Lp(e,a,n,t,i);try{let l=(0,Ep.getArgumentValues)(a,n[0],e.variableValues),f=e.contextValue,d=u(r,l,f,c),y;return(0,ut.isPromise)(d)?y=d.then(T=>gn(e,o,n,c,i,T)):y=gn(e,o,n,c,i,d),(0,ut.isPromise)(y)?y.then(void 0,T=>{let I=(0,Fi.locatedError)(T,n,(0,or.pathToArray)(i));return qi(I,o,e)}):y}catch(l){let f=(0,Fi.locatedError)(l,n,(0,or.pathToArray)(i));return qi(f,o,e)}}function Lp(e,t,r,n,i){return{fieldName:t.name,fieldNodes:r,returnType:t.type,parentType:n,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function qi(e,t,r){if((0,Ct.isNonNullType)(t))throw e;return r.errors.push(e),null}function gn(e,t,r,n,i,s){if(s instanceof Error)throw s;if((0,Ct.isNonNullType)(t)){let a=gn(e,t.ofType,r,n,i,s);if(a===null)throw new Error(`Cannot return null for non-nullable field ${n.parentType.name}.${n.fieldName}.`);return a}if(s==null)return null;if((0,Ct.isListType)(t))return jb(e,t,r,n,i,s);if((0,Ct.isLeafType)(t))return Pb(t,s);if((0,Ct.isAbstractType)(t))return wb(e,t,r,n,i,s);if((0,Ct.isObjectType)(t))return su(e,t,r,n,i,s);(0,_b.invariant)(!1,"Cannot complete value of unexpected output type: "+(0,ar.inspect)(t))}function jb(e,t,r,n,i,s){if(!(0,Nb.isIterableObject)(s))throw new Xe.GraphQLError(`Expected Iterable, but did not find one for field "${n.parentType.name}.${n.fieldName}".`);let a=t.ofType,o=!1,u=Array.from(s,(c,l)=>{let f=(0,or.addPath)(i,l,void 0);try{let d;return(0,ut.isPromise)(c)?d=c.then(y=>gn(e,a,r,n,f,y)):d=gn(e,a,r,n,f,c),(0,ut.isPromise)(d)?(o=!0,d.then(void 0,y=>{let T=(0,Fi.locatedError)(y,r,(0,or.pathToArray)(f));return qi(T,a,e)})):d}catch(d){let y=(0,Fi.locatedError)(d,r,(0,or.pathToArray)(f));return qi(y,a,e)}});return o?Promise.all(u):u}function Pb(e,t){let r=e.serialize(t);if(r==null)throw new Error(`Expected \`${(0,ar.inspect)(e)}.serialize(${(0,ar.inspect)(t)})\` to return non-nullable value, returned: ${(0,ar.inspect)(r)}`);return r}function wb(e,t,r,n,i,s){var a;let o=(a=t.resolveType)!==null&&a!==void 0?a:e.typeResolver,u=e.contextValue,c=o(s,u,n,t);return(0,ut.isPromise)(c)?c.then(l=>su(e,Tp(l,e,t,r,n,s),r,n,i,s)):su(e,Tp(c,e,t,r,n,s),r,n,i,s)}function Tp(e,t,r,n,i,s){if(e==null)throw new Xe.GraphQLError(`Abstract type "${r.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${r.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,n);if((0,Ct.isObjectType)(e))throw new Xe.GraphQLError("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if(typeof e!="string")throw new Xe.GraphQLError(`Abstract type "${r.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${(0,ar.inspect)(s)}, received "${(0,ar.inspect)(e)}".`);let a=t.schema.getType(e);if(a==null)throw new Xe.GraphQLError(`Abstract type "${r.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:n});if(!(0,Ct.isObjectType)(a))throw new Xe.GraphQLError(`Abstract type "${r.name}" was resolved to a non-object type "${e}".`,{nodes:n});if(!t.schema.isSubType(r,a))throw new Xe.GraphQLError(`Runtime Object type "${a.name}" is not a possible type for "${r.name}".`,{nodes:n});return a}function su(e,t,r,n,i,s){let a=Sb(e,t,r);if(t.isTypeOf){let o=t.isTypeOf(s,e.contextValue,n);if((0,ut.isPromise)(o))return o.then(u=>{if(!u)throw bp(t,s,r);return ki(e,t,s,i,a)});if(!o)throw bp(t,s,r)}return ki(e,t,s,i,a)}function bp(e,t,r){return new Xe.GraphQLError(`Expected value of type "${e.name}" but got: ${(0,ar.inspect)(t)}.`,{nodes:r})}var Sp=function(e,t,r,n){if((0,ou.isObjectLike)(e)&&typeof e.__typename=="string")return e.__typename;let i=r.schema.getPossibleTypes(n),s=[];for(let a=0;a{for(let o=0;o{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.graphql=Gb;xi.graphqlSync=Cb;var Fb=Fe(),kb=wn(),qb=vr(),xb=un(),Vb=bn(),Mb=En();function Gb(e){return new Promise(t=>t(Ap(e)))}function Cb(e){let t=Ap(e);if((0,kb.isPromise)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function Ap(e){arguments.length<2||(0,Fb.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:t,source:r,rootValue:n,contextValue:i,variableValues:s,operationName:a,fieldResolver:o,typeResolver:u}=e,c=(0,xb.validateSchema)(t);if(c.length>0)return{errors:c};let l;try{l=(0,qb.parse)(r)}catch(d){return{errors:[d]}}let f=(0,Vb.validate)(t,l);return f.length>0?{errors:f}:(0,Mb.execute)({schema:t,document:l,rootValue:n,contextValue:i,variableValues:s,operationName:a,fieldResolver:o,typeResolver:u})}});var wp=h(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});Object.defineProperty(b,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return Tt.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(b,"GRAPHQL_MAX_INT",{enumerable:!0,get:function(){return Dt.GRAPHQL_MAX_INT}});Object.defineProperty(b,"GRAPHQL_MIN_INT",{enumerable:!0,get:function(){return Dt.GRAPHQL_MIN_INT}});Object.defineProperty(b,"GraphQLBoolean",{enumerable:!0,get:function(){return Dt.GraphQLBoolean}});Object.defineProperty(b,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return Tt.GraphQLDeprecatedDirective}});Object.defineProperty(b,"GraphQLDirective",{enumerable:!0,get:function(){return Tt.GraphQLDirective}});Object.defineProperty(b,"GraphQLEnumType",{enumerable:!0,get:function(){return x.GraphQLEnumType}});Object.defineProperty(b,"GraphQLFloat",{enumerable:!0,get:function(){return Dt.GraphQLFloat}});Object.defineProperty(b,"GraphQLID",{enumerable:!0,get:function(){return Dt.GraphQLID}});Object.defineProperty(b,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return Tt.GraphQLIncludeDirective}});Object.defineProperty(b,"GraphQLInputObjectType",{enumerable:!0,get:function(){return x.GraphQLInputObjectType}});Object.defineProperty(b,"GraphQLInt",{enumerable:!0,get:function(){return Dt.GraphQLInt}});Object.defineProperty(b,"GraphQLInterfaceType",{enumerable:!0,get:function(){return x.GraphQLInterfaceType}});Object.defineProperty(b,"GraphQLList",{enumerable:!0,get:function(){return x.GraphQLList}});Object.defineProperty(b,"GraphQLNonNull",{enumerable:!0,get:function(){return x.GraphQLNonNull}});Object.defineProperty(b,"GraphQLObjectType",{enumerable:!0,get:function(){return x.GraphQLObjectType}});Object.defineProperty(b,"GraphQLScalarType",{enumerable:!0,get:function(){return x.GraphQLScalarType}});Object.defineProperty(b,"GraphQLSchema",{enumerable:!0,get:function(){return uu.GraphQLSchema}});Object.defineProperty(b,"GraphQLSkipDirective",{enumerable:!0,get:function(){return Tt.GraphQLSkipDirective}});Object.defineProperty(b,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return Tt.GraphQLSpecifiedByDirective}});Object.defineProperty(b,"GraphQLString",{enumerable:!0,get:function(){return Dt.GraphQLString}});Object.defineProperty(b,"GraphQLUnionType",{enumerable:!0,get:function(){return x.GraphQLUnionType}});Object.defineProperty(b,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return Ge.SchemaMetaFieldDef}});Object.defineProperty(b,"TypeKind",{enumerable:!0,get:function(){return Ge.TypeKind}});Object.defineProperty(b,"TypeMetaFieldDef",{enumerable:!0,get:function(){return Ge.TypeMetaFieldDef}});Object.defineProperty(b,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return Ge.TypeNameMetaFieldDef}});Object.defineProperty(b,"__Directive",{enumerable:!0,get:function(){return Ge.__Directive}});Object.defineProperty(b,"__DirectiveLocation",{enumerable:!0,get:function(){return Ge.__DirectiveLocation}});Object.defineProperty(b,"__EnumValue",{enumerable:!0,get:function(){return Ge.__EnumValue}});Object.defineProperty(b,"__Field",{enumerable:!0,get:function(){return Ge.__Field}});Object.defineProperty(b,"__InputValue",{enumerable:!0,get:function(){return Ge.__InputValue}});Object.defineProperty(b,"__Schema",{enumerable:!0,get:function(){return Ge.__Schema}});Object.defineProperty(b,"__Type",{enumerable:!0,get:function(){return Ge.__Type}});Object.defineProperty(b,"__TypeKind",{enumerable:!0,get:function(){return Ge.__TypeKind}});Object.defineProperty(b,"assertAbstractType",{enumerable:!0,get:function(){return x.assertAbstractType}});Object.defineProperty(b,"assertCompositeType",{enumerable:!0,get:function(){return x.assertCompositeType}});Object.defineProperty(b,"assertDirective",{enumerable:!0,get:function(){return Tt.assertDirective}});Object.defineProperty(b,"assertEnumType",{enumerable:!0,get:function(){return x.assertEnumType}});Object.defineProperty(b,"assertEnumValueName",{enumerable:!0,get:function(){return Pp.assertEnumValueName}});Object.defineProperty(b,"assertInputObjectType",{enumerable:!0,get:function(){return x.assertInputObjectType}});Object.defineProperty(b,"assertInputType",{enumerable:!0,get:function(){return x.assertInputType}});Object.defineProperty(b,"assertInterfaceType",{enumerable:!0,get:function(){return x.assertInterfaceType}});Object.defineProperty(b,"assertLeafType",{enumerable:!0,get:function(){return x.assertLeafType}});Object.defineProperty(b,"assertListType",{enumerable:!0,get:function(){return x.assertListType}});Object.defineProperty(b,"assertName",{enumerable:!0,get:function(){return Pp.assertName}});Object.defineProperty(b,"assertNamedType",{enumerable:!0,get:function(){return x.assertNamedType}});Object.defineProperty(b,"assertNonNullType",{enumerable:!0,get:function(){return x.assertNonNullType}});Object.defineProperty(b,"assertNullableType",{enumerable:!0,get:function(){return x.assertNullableType}});Object.defineProperty(b,"assertObjectType",{enumerable:!0,get:function(){return x.assertObjectType}});Object.defineProperty(b,"assertOutputType",{enumerable:!0,get:function(){return x.assertOutputType}});Object.defineProperty(b,"assertScalarType",{enumerable:!0,get:function(){return x.assertScalarType}});Object.defineProperty(b,"assertSchema",{enumerable:!0,get:function(){return uu.assertSchema}});Object.defineProperty(b,"assertType",{enumerable:!0,get:function(){return x.assertType}});Object.defineProperty(b,"assertUnionType",{enumerable:!0,get:function(){return x.assertUnionType}});Object.defineProperty(b,"assertValidSchema",{enumerable:!0,get:function(){return jp.assertValidSchema}});Object.defineProperty(b,"assertWrappingType",{enumerable:!0,get:function(){return x.assertWrappingType}});Object.defineProperty(b,"getNamedType",{enumerable:!0,get:function(){return x.getNamedType}});Object.defineProperty(b,"getNullableType",{enumerable:!0,get:function(){return x.getNullableType}});Object.defineProperty(b,"introspectionTypes",{enumerable:!0,get:function(){return Ge.introspectionTypes}});Object.defineProperty(b,"isAbstractType",{enumerable:!0,get:function(){return x.isAbstractType}});Object.defineProperty(b,"isCompositeType",{enumerable:!0,get:function(){return x.isCompositeType}});Object.defineProperty(b,"isDirective",{enumerable:!0,get:function(){return Tt.isDirective}});Object.defineProperty(b,"isEnumType",{enumerable:!0,get:function(){return x.isEnumType}});Object.defineProperty(b,"isInputObjectType",{enumerable:!0,get:function(){return x.isInputObjectType}});Object.defineProperty(b,"isInputType",{enumerable:!0,get:function(){return x.isInputType}});Object.defineProperty(b,"isInterfaceType",{enumerable:!0,get:function(){return x.isInterfaceType}});Object.defineProperty(b,"isIntrospectionType",{enumerable:!0,get:function(){return Ge.isIntrospectionType}});Object.defineProperty(b,"isLeafType",{enumerable:!0,get:function(){return x.isLeafType}});Object.defineProperty(b,"isListType",{enumerable:!0,get:function(){return x.isListType}});Object.defineProperty(b,"isNamedType",{enumerable:!0,get:function(){return x.isNamedType}});Object.defineProperty(b,"isNonNullType",{enumerable:!0,get:function(){return x.isNonNullType}});Object.defineProperty(b,"isNullableType",{enumerable:!0,get:function(){return x.isNullableType}});Object.defineProperty(b,"isObjectType",{enumerable:!0,get:function(){return x.isObjectType}});Object.defineProperty(b,"isOutputType",{enumerable:!0,get:function(){return x.isOutputType}});Object.defineProperty(b,"isRequiredArgument",{enumerable:!0,get:function(){return x.isRequiredArgument}});Object.defineProperty(b,"isRequiredInputField",{enumerable:!0,get:function(){return x.isRequiredInputField}});Object.defineProperty(b,"isScalarType",{enumerable:!0,get:function(){return x.isScalarType}});Object.defineProperty(b,"isSchema",{enumerable:!0,get:function(){return uu.isSchema}});Object.defineProperty(b,"isSpecifiedDirective",{enumerable:!0,get:function(){return Tt.isSpecifiedDirective}});Object.defineProperty(b,"isSpecifiedScalarType",{enumerable:!0,get:function(){return Dt.isSpecifiedScalarType}});Object.defineProperty(b,"isType",{enumerable:!0,get:function(){return x.isType}});Object.defineProperty(b,"isUnionType",{enumerable:!0,get:function(){return x.isUnionType}});Object.defineProperty(b,"isWrappingType",{enumerable:!0,get:function(){return x.isWrappingType}});Object.defineProperty(b,"resolveObjMapThunk",{enumerable:!0,get:function(){return x.resolveObjMapThunk}});Object.defineProperty(b,"resolveReadonlyArrayThunk",{enumerable:!0,get:function(){return x.resolveReadonlyArrayThunk}});Object.defineProperty(b,"specifiedDirectives",{enumerable:!0,get:function(){return Tt.specifiedDirectives}});Object.defineProperty(b,"specifiedScalarTypes",{enumerable:!0,get:function(){return Dt.specifiedScalarTypes}});Object.defineProperty(b,"validateSchema",{enumerable:!0,get:function(){return jp.validateSchema}});var uu=Zt(),x=Y(),Tt=Ve(),Dt=yt(),Ge=Ye(),jp=un(),Pp=Br()});var kp=h(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});Object.defineProperty(z,"BREAK",{enumerable:!0,get:function(){return _n.BREAK}});Object.defineProperty(z,"DirectiveLocation",{enumerable:!0,get:function(){return Jb.DirectiveLocation}});Object.defineProperty(z,"Kind",{enumerable:!0,get:function(){return Kb.Kind}});Object.defineProperty(z,"Lexer",{enumerable:!0,get:function(){return Bb.Lexer}});Object.defineProperty(z,"Location",{enumerable:!0,get:function(){return cu.Location}});Object.defineProperty(z,"OperationTypeNode",{enumerable:!0,get:function(){return cu.OperationTypeNode}});Object.defineProperty(z,"Source",{enumerable:!0,get:function(){return Qb.Source}});Object.defineProperty(z,"Token",{enumerable:!0,get:function(){return cu.Token}});Object.defineProperty(z,"TokenKind",{enumerable:!0,get:function(){return $b.TokenKind}});Object.defineProperty(z,"getEnterLeaveForKind",{enumerable:!0,get:function(){return _n.getEnterLeaveForKind}});Object.defineProperty(z,"getLocation",{enumerable:!0,get:function(){return Ub.getLocation}});Object.defineProperty(z,"getVisitFn",{enumerable:!0,get:function(){return _n.getVisitFn}});Object.defineProperty(z,"isConstValueNode",{enumerable:!0,get:function(){return bt.isConstValueNode}});Object.defineProperty(z,"isDefinitionNode",{enumerable:!0,get:function(){return bt.isDefinitionNode}});Object.defineProperty(z,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return bt.isExecutableDefinitionNode}});Object.defineProperty(z,"isSelectionNode",{enumerable:!0,get:function(){return bt.isSelectionNode}});Object.defineProperty(z,"isTypeDefinitionNode",{enumerable:!0,get:function(){return bt.isTypeDefinitionNode}});Object.defineProperty(z,"isTypeExtensionNode",{enumerable:!0,get:function(){return bt.isTypeExtensionNode}});Object.defineProperty(z,"isTypeNode",{enumerable:!0,get:function(){return bt.isTypeNode}});Object.defineProperty(z,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return bt.isTypeSystemDefinitionNode}});Object.defineProperty(z,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return bt.isTypeSystemExtensionNode}});Object.defineProperty(z,"isValueNode",{enumerable:!0,get:function(){return bt.isValueNode}});Object.defineProperty(z,"parse",{enumerable:!0,get:function(){return Vi.parse}});Object.defineProperty(z,"parseConstValue",{enumerable:!0,get:function(){return Vi.parseConstValue}});Object.defineProperty(z,"parseType",{enumerable:!0,get:function(){return Vi.parseType}});Object.defineProperty(z,"parseValue",{enumerable:!0,get:function(){return Vi.parseValue}});Object.defineProperty(z,"print",{enumerable:!0,get:function(){return Yb.print}});Object.defineProperty(z,"printLocation",{enumerable:!0,get:function(){return Fp.printLocation}});Object.defineProperty(z,"printSourceLocation",{enumerable:!0,get:function(){return Fp.printSourceLocation}});Object.defineProperty(z,"visit",{enumerable:!0,get:function(){return _n.visit}});Object.defineProperty(z,"visitInParallel",{enumerable:!0,get:function(){return _n.visitInParallel}});var Qb=Un(),Ub=Fn(),Fp=os(),Kb=H(),$b=Vr(),Bb=Mn(),Vi=vr(),Yb=Ce(),_n=Yt(),cu=dt(),bt=tr(),Jb=yr()});var qp=h(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.isAsyncIterable=Xb;function Xb(e){return typeof e?.[Symbol.asyncIterator]=="function"}});var xp=h(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.mapAsyncIterator=Hb;function Hb(e,t){let r=e[Symbol.asyncIterator]();async function n(i){if(i.done)return i;try{return{value:await t(i.value),done:!1}}catch(s){if(typeof r.return=="function")try{await r.return()}catch{}throw s}}return{async next(){return n(await r.next())},async return(){return typeof r.return=="function"?n(await r.return()):{value:void 0,done:!0}},async throw(i){if(typeof r.throw=="function")return n(await r.throw(i));throw i},[Symbol.asyncIterator](){return this}}}});var Cp=h(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.createSourceEventStream=Gp;Mi.subscribe=ng;var zb=Fe(),Wb=re(),Mp=qp(),Vp=pn(),du=q(),Zb=Pi(),eg=Di(),Nn=En(),tg=xp(),rg=Sr();async function ng(e){arguments.length<2||(0,zb.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let t=await Gp(e);if(!(0,Mp.isAsyncIterable)(t))return t;let r=n=>(0,Nn.execute)({...e,rootValue:n});return(0,tg.mapAsyncIterator)(t,r)}function ig(e){let t=e[0];return t&&"document"in t?t:{schema:t,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]}}async function Gp(...e){let t=ig(e),{schema:r,document:n,variableValues:i}=t;(0,Nn.assertValidExecutionArguments)(r,n,i);let s=(0,Nn.buildExecutionContext)(t);if(!("schema"in s))return{errors:s};try{let a=await sg(s);if(!(0,Mp.isAsyncIterable)(a))throw new Error(`Subscription field must return Async Iterable. Received: ${(0,Wb.inspect)(a)}.`);return a}catch(a){if(a instanceof du.GraphQLError)return{errors:[a]};throw a}}async function sg(e){let{schema:t,fragments:r,operation:n,variableValues:i,rootValue:s}=e,a=t.getSubscriptionType();if(a==null)throw new du.GraphQLError("Schema is not configured to execute subscription operation.",{nodes:n});let o=(0,eg.collectFields)(t,r,i,a,n.selectionSet),[u,c]=[...o.entries()][0],l=(0,Nn.getFieldDef)(t,a,c[0]);if(!l){let T=c[0].name.value;throw new du.GraphQLError(`The subscription field "${T}" is not defined.`,{nodes:c})}let f=(0,Vp.addPath)(void 0,u,a.name),d=(0,Nn.buildResolveInfo)(e,l,c,a,f);try{var y;let T=(0,rg.getArgumentValues)(l,c[0],i),I=e.contextValue,L=await((y=l.subscribe)!==null&&y!==void 0?y:e.subscribeFieldResolver)(s,T,I,d);if(L instanceof Error)throw L;return L}catch(T){throw(0,Zb.locatedError)(T,c,(0,Vp.pathToArray)(f))}}});var Up=h(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});Object.defineProperty(ze,"createSourceEventStream",{enumerable:!0,get:function(){return Qp.createSourceEventStream}});Object.defineProperty(ze,"defaultFieldResolver",{enumerable:!0,get:function(){return Gi.defaultFieldResolver}});Object.defineProperty(ze,"defaultTypeResolver",{enumerable:!0,get:function(){return Gi.defaultTypeResolver}});Object.defineProperty(ze,"execute",{enumerable:!0,get:function(){return Gi.execute}});Object.defineProperty(ze,"executeSync",{enumerable:!0,get:function(){return Gi.executeSync}});Object.defineProperty(ze,"getArgumentValues",{enumerable:!0,get:function(){return fu.getArgumentValues}});Object.defineProperty(ze,"getDirectiveValues",{enumerable:!0,get:function(){return fu.getDirectiveValues}});Object.defineProperty(ze,"getVariableValues",{enumerable:!0,get:function(){return fu.getVariableValues}});Object.defineProperty(ze,"responsePathAsArray",{enumerable:!0,get:function(){return ag.pathToArray}});Object.defineProperty(ze,"subscribe",{enumerable:!0,get:function(){return Qp.subscribe}});var ag=pn(),Gi=En(),Qp=Cp(),fu=Sr()});var Kp=h(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.NoDeprecatedCustomRule=og;var mu=je(),On=q(),yu=Y();function og(e){return{Field(t){let r=e.getFieldDef(),n=r?.deprecationReason;if(r&&n!=null){let i=e.getParentType();i!=null||(0,mu.invariant)(!1),e.reportError(new On.GraphQLError(`The field ${i.name}.${r.name} is deprecated. ${n}`,{nodes:t}))}},Argument(t){let r=e.getArgument(),n=r?.deprecationReason;if(r&&n!=null){let i=e.getDirective();if(i!=null)e.reportError(new On.GraphQLError(`Directive "@${i.name}" argument "${r.name}" is deprecated. ${n}`,{nodes:t}));else{let s=e.getParentType(),a=e.getFieldDef();s!=null&&a!=null||(0,mu.invariant)(!1),e.reportError(new On.GraphQLError(`Field "${s.name}.${a.name}" argument "${r.name}" is deprecated. ${n}`,{nodes:t}))}}},ObjectField(t){let r=(0,yu.getNamedType)(e.getParentInputType());if((0,yu.isInputObjectType)(r)){let n=r.getFields()[t.name.value],i=n?.deprecationReason;i!=null&&e.reportError(new On.GraphQLError(`The input field ${r.name}.${n.name} is deprecated. ${i}`,{nodes:t}))}},EnumValue(t){let r=e.getEnumValue(),n=r?.deprecationReason;if(r&&n!=null){let i=(0,yu.getNamedType)(e.getInputType());i!=null||(0,mu.invariant)(!1),e.reportError(new On.GraphQLError(`The enum value "${i.name}.${r.name}" is deprecated. ${n}`,{nodes:t}))}}}}});var $p=h(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.NoSchemaIntrospectionCustomRule=pg;var ug=q(),cg=Y(),lg=Ye();function pg(e){return{Field(t){let r=(0,cg.getNamedType)(e.getType());r&&(0,lg.isIntrospectionType)(r)&&e.reportError(new ug.GraphQLError(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}}});var Bp=h(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Object.defineProperty(Q,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return yg.ExecutableDefinitionsRule}});Object.defineProperty(Q,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return hg.FieldsOnCorrectTypeRule}});Object.defineProperty(Q,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return vg.FragmentsOnCompositeTypesRule}});Object.defineProperty(Q,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return Tg.KnownArgumentNamesRule}});Object.defineProperty(Q,"KnownDirectivesRule",{enumerable:!0,get:function(){return bg.KnownDirectivesRule}});Object.defineProperty(Q,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return gg.KnownFragmentNamesRule}});Object.defineProperty(Q,"KnownTypeNamesRule",{enumerable:!0,get:function(){return Eg.KnownTypeNamesRule}});Object.defineProperty(Q,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return _g.LoneAnonymousOperationRule}});Object.defineProperty(Q,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return Cg.LoneSchemaDefinitionRule}});Object.defineProperty(Q,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return Xg.NoDeprecatedCustomRule}});Object.defineProperty(Q,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return Ng.NoFragmentCyclesRule}});Object.defineProperty(Q,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return Hg.NoSchemaIntrospectionCustomRule}});Object.defineProperty(Q,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return Og.NoUndefinedVariablesRule}});Object.defineProperty(Q,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return Ig.NoUnusedFragmentsRule}});Object.defineProperty(Q,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return Lg.NoUnusedVariablesRule}});Object.defineProperty(Q,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return Sg.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(Q,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return Dg.PossibleFragmentSpreadsRule}});Object.defineProperty(Q,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return Jg.PossibleTypeExtensionsRule}});Object.defineProperty(Q,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return Ag.ProvidedRequiredArgumentsRule}});Object.defineProperty(Q,"ScalarLeafsRule",{enumerable:!0,get:function(){return Rg.ScalarLeafsRule}});Object.defineProperty(Q,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return jg.SingleFieldSubscriptionsRule}});Object.defineProperty(Q,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return Bg.UniqueArgumentDefinitionNamesRule}});Object.defineProperty(Q,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return Pg.UniqueArgumentNamesRule}});Object.defineProperty(Q,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return Yg.UniqueDirectiveNamesRule}});Object.defineProperty(Q,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return wg.UniqueDirectivesPerLocationRule}});Object.defineProperty(Q,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return Kg.UniqueEnumValueNamesRule}});Object.defineProperty(Q,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return $g.UniqueFieldDefinitionNamesRule}});Object.defineProperty(Q,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return Fg.UniqueFragmentNamesRule}});Object.defineProperty(Q,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return kg.UniqueInputFieldNamesRule}});Object.defineProperty(Q,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return qg.UniqueOperationNamesRule}});Object.defineProperty(Q,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return Qg.UniqueOperationTypesRule}});Object.defineProperty(Q,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return Ug.UniqueTypeNamesRule}});Object.defineProperty(Q,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return xg.UniqueVariableNamesRule}});Object.defineProperty(Q,"ValidationContext",{enumerable:!0,get:function(){return fg.ValidationContext}});Object.defineProperty(Q,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return Vg.ValuesOfCorrectTypeRule}});Object.defineProperty(Q,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return Mg.VariablesAreInputTypesRule}});Object.defineProperty(Q,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return Gg.VariablesInAllowedPositionRule}});Object.defineProperty(Q,"specifiedRules",{enumerable:!0,get:function(){return mg.specifiedRules}});Object.defineProperty(Q,"validate",{enumerable:!0,get:function(){return dg.validate}});var dg=bn(),fg=Xo(),mg=Bo(),yg=pa(),hg=fa(),vg=ya(),Tg=ha(),bg=ga(),gg=_a(),Eg=Ia(),_g=Sa(),Ng=ja(),Og=wa(),Ig=ka(),Lg=xa(),Sg=Ya(),Dg=Ha(),Ag=eo(),Rg=ro(),jg=po(),Pg=vo(),wg=_o(),Fg=Ao(),kg=jo(),qg=wo(),xg=Mo(),Vg=Co(),Mg=Uo(),Gg=$o(),Cg=Aa(),Qg=ko(),Ug=xo(),Kg=Oo(),$g=So(),Bg=yo(),Yg=bo(),Jg=Wa(),Xg=Kp(),Hg=$p()});var Yp=h(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});Object.defineProperty(ur,"GraphQLError",{enumerable:!0,get:function(){return Tu.GraphQLError}});Object.defineProperty(ur,"formatError",{enumerable:!0,get:function(){return Tu.formatError}});Object.defineProperty(ur,"locatedError",{enumerable:!0,get:function(){return Wg.locatedError}});Object.defineProperty(ur,"printError",{enumerable:!0,get:function(){return Tu.printError}});Object.defineProperty(ur,"syntaxError",{enumerable:!0,get:function(){return zg.syntaxError}});var Tu=q(),zg=qn(),Wg=Pi()});var gu=h(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.getIntrospectionQuery=Zg;function Zg(e){let t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,...e},r=t.descriptions?"description":"",n=t.specifiedByUrl?"specifiedByURL":"",i=t.directiveIsRepeatable?"isRepeatable":"",s=t.schemaDescription?r:"";function a(o){return t.inputValueDeprecation?o:""}return` + query IntrospectionQuery { + __schema { + ${s} + queryType { name } + mutationType { name } + subscriptionType { name } + types { + ...FullType + } + directives { + name + ${r} + ${i} + locations + args${a("(includeDeprecated: true)")} { + ...InputValue + } + } + } + } + + fragment FullType on __Type { + kind + name + ${r} + ${n} + fields(includeDeprecated: true) { + name + ${r} + args${a("(includeDeprecated: true)")} { + ...InputValue + } + type { + ...TypeRef + } + isDeprecated + deprecationReason + } + inputFields${a("(includeDeprecated: true)")} { + ...InputValue + } + interfaces { + ...TypeRef + } + enumValues(includeDeprecated: true) { + name + ${r} + isDeprecated + deprecationReason + } + possibleTypes { + ...TypeRef + } + } + + fragment InputValue on __InputValue { + name + ${r} + type { ...TypeRef } + defaultValue + ${a("isDeprecated")} + ${a("deprecationReason")} + } + + fragment TypeRef on __Type { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + } + } + } + } + } + } + } + } + } + } + `}});var Jp=h(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.getOperationAST=tE;var eE=H();function tE(e,t){let r=null;for(let i of e.definitions)if(i.kind===eE.Kind.OPERATION_DEFINITION){var n;if(t==null){if(r)return null;r=i}else if(((n=i.name)===null||n===void 0?void 0:n.value)===t)return i}return r}});var Xp=h(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});_u.getOperationRootType=rE;var Ci=q();function rE(e,t){if(t.operation==="query"){let r=e.getQueryType();if(!r)throw new Ci.GraphQLError("Schema does not define the required query root type.",{nodes:t});return r}if(t.operation==="mutation"){let r=e.getMutationType();if(!r)throw new Ci.GraphQLError("Schema is not configured for mutations.",{nodes:t});return r}if(t.operation==="subscription"){let r=e.getSubscriptionType();if(!r)throw new Ci.GraphQLError("Schema is not configured for subscriptions.",{nodes:t});return r}throw new Ci.GraphQLError("Can only have query, mutation and subscription operations.",{nodes:t})}});var Hp=h(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.introspectionFromSchema=oE;var nE=je(),iE=vr(),sE=En(),aE=gu();function oE(e,t){let r={specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,...t},n=(0,iE.parse)((0,aE.getIntrospectionQuery)(r)),i=(0,sE.executeSync)({schema:e,document:n});return!i.errors&&i.data||(0,nE.invariant)(!1),i.data}});var Wp=h(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.buildClientSchema=mE;var uE=Fe(),Qe=re(),zp=pt(),Qi=Kr(),cE=vr(),Ue=Y(),lE=Ve(),gt=Ye(),pE=yt(),dE=Zt(),fE=yn();function mE(e,t){(0,zp.isObjectLike)(e)&&(0,zp.isObjectLike)(e.__schema)||(0,uE.devAssert)(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${(0,Qe.inspect)(e)}.`);let r=e.__schema,n=(0,Qi.keyValMap)(r.types,m=>m.name,m=>d(m));for(let m of[...pE.specifiedScalarTypes,...gt.introspectionTypes])n[m.name]&&(n[m.name]=m);let i=r.queryType?l(r.queryType):null,s=r.mutationType?l(r.mutationType):null,a=r.subscriptionType?l(r.subscriptionType):null,o=r.directives?r.directives.map(V):[];return new dE.GraphQLSchema({description:r.description,query:i,mutation:s,subscription:a,types:Object.values(n),directives:o,assumeValid:t?.assumeValid});function u(m){if(m.kind===gt.TypeKind.LIST){let _=m.ofType;if(!_)throw new Error("Decorated type deeper than introspection query.");return new Ue.GraphQLList(u(_))}if(m.kind===gt.TypeKind.NON_NULL){let _=m.ofType;if(!_)throw new Error("Decorated type deeper than introspection query.");let oe=u(_);return new Ue.GraphQLNonNull((0,Ue.assertNullableType)(oe))}return c(m)}function c(m){let _=m.name;if(!_)throw new Error(`Unknown type reference: ${(0,Qe.inspect)(m)}.`);let oe=n[_];if(!oe)throw new Error(`Invalid or incomplete schema, unknown type: ${_}. Ensure that a full introspection query is used in order to build a client schema.`);return oe}function l(m){return(0,Ue.assertObjectType)(c(m))}function f(m){return(0,Ue.assertInterfaceType)(c(m))}function d(m){if(m!=null&&m.name!=null&&m.kind!=null)switch(m.kind){case gt.TypeKind.SCALAR:return y(m);case gt.TypeKind.OBJECT:return I(m);case gt.TypeKind.INTERFACE:return E(m);case gt.TypeKind.UNION:return L(m);case gt.TypeKind.ENUM:return F(m);case gt.TypeKind.INPUT_OBJECT:return k(m)}let _=(0,Qe.inspect)(m);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${_}.`)}function y(m){return new Ue.GraphQLScalarType({name:m.name,description:m.description,specifiedByURL:m.specifiedByURL})}function T(m){if(m.interfaces===null&&m.kind===gt.TypeKind.INTERFACE)return[];if(!m.interfaces){let _=(0,Qe.inspect)(m);throw new Error(`Introspection result missing interfaces: ${_}.`)}return m.interfaces.map(f)}function I(m){return new Ue.GraphQLObjectType({name:m.name,description:m.description,interfaces:()=>T(m),fields:()=>P(m)})}function E(m){return new Ue.GraphQLInterfaceType({name:m.name,description:m.description,interfaces:()=>T(m),fields:()=>P(m)})}function L(m){if(!m.possibleTypes){let _=(0,Qe.inspect)(m);throw new Error(`Introspection result missing possibleTypes: ${_}.`)}return new Ue.GraphQLUnionType({name:m.name,description:m.description,types:()=>m.possibleTypes.map(l)})}function F(m){if(!m.enumValues){let _=(0,Qe.inspect)(m);throw new Error(`Introspection result missing enumValues: ${_}.`)}return new Ue.GraphQLEnumType({name:m.name,description:m.description,values:(0,Qi.keyValMap)(m.enumValues,_=>_.name,_=>({description:_.description,deprecationReason:_.deprecationReason}))})}function k(m){if(!m.inputFields){let _=(0,Qe.inspect)(m);throw new Error(`Introspection result missing inputFields: ${_}.`)}return new Ue.GraphQLInputObjectType({name:m.name,description:m.description,fields:()=>C(m.inputFields)})}function P(m){if(!m.fields)throw new Error(`Introspection result missing fields: ${(0,Qe.inspect)(m)}.`);return(0,Qi.keyValMap)(m.fields,_=>_.name,G)}function G(m){let _=u(m.type);if(!(0,Ue.isOutputType)(_)){let oe=(0,Qe.inspect)(_);throw new Error(`Introspection must provide output type for fields, but received: ${oe}.`)}if(!m.args){let oe=(0,Qe.inspect)(m);throw new Error(`Introspection result missing field args: ${oe}.`)}return{description:m.description,deprecationReason:m.deprecationReason,type:_,args:C(m.args)}}function C(m){return(0,Qi.keyValMap)(m,_=>_.name,w)}function w(m){let _=u(m.type);if(!(0,Ue.isInputType)(_)){let $=(0,Qe.inspect)(_);throw new Error(`Introspection must provide input type for arguments, but received: ${$}.`)}let oe=m.defaultValue!=null?(0,fE.valueFromAST)((0,cE.parseValue)(m.defaultValue),_):void 0;return{description:m.description,type:_,defaultValue:oe,deprecationReason:m.deprecationReason}}function V(m){if(!m.args){let _=(0,Qe.inspect)(m);throw new Error(`Introspection result missing directive args: ${_}.`)}if(!m.locations){let _=(0,Qe.inspect)(m);throw new Error(`Introspection result missing directive locations: ${_}.`)}return new lE.GraphQLDirective({name:m.name,description:m.description,isRepeatable:m.isRepeatable,locations:m.locations.slice(),args:C(m.args)})}}});var Iu=h($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.extendSchema=gE;$i.extendSchemaImpl=od;var yE=Fe(),hE=re(),vE=je(),TE=Ft(),In=Ss(),We=H(),Zp=tr(),pe=Y(),Ki=Ve(),id=Ye(),sd=yt(),ed=Zt(),bE=bn(),ad=Sr(),td=yn();function gE(e,t,r){(0,ed.assertSchema)(e),t!=null&&t.kind===We.Kind.DOCUMENT||(0,yE.devAssert)(!1,"Must provide valid Document AST."),r?.assumeValid!==!0&&r?.assumeValidSDL!==!0&&(0,bE.assertValidSDLExtension)(t,e);let n=e.toConfig(),i=od(n,t,r);return n===i?e:new ed.GraphQLSchema(i)}function od(e,t,r){var n,i,s,a;let o=[],u=Object.create(null),c=[],l,f=[];for(let v of t.definitions)if(v.kind===We.Kind.SCHEMA_DEFINITION)l=v;else if(v.kind===We.Kind.SCHEMA_EXTENSION)f.push(v);else if((0,Zp.isTypeDefinitionNode)(v))o.push(v);else if((0,Zp.isTypeExtensionNode)(v)){let S=v.name.value,N=u[S];u[S]=N?N.concat([v]):[v]}else v.kind===We.Kind.DIRECTIVE_DEFINITION&&c.push(v);if(Object.keys(u).length===0&&o.length===0&&c.length===0&&f.length===0&&l==null)return e;let d=Object.create(null);for(let v of e.types)d[v.name]=F(v);for(let v of o){var y;let S=v.name.value;d[S]=(y=rd[S])!==null&&y!==void 0?y:jt(v)}let T={query:e.query&&E(e.query),mutation:e.mutation&&E(e.mutation),subscription:e.subscription&&E(e.subscription),...l&&oe([l]),...oe(f)};return{description:(n=l)===null||n===void 0||(i=n.description)===null||i===void 0?void 0:i.value,...T,types:Object.values(d),directives:[...e.directives.map(L),...c.map(ye)],extensions:Object.create(null),astNode:(s=l)!==null&&s!==void 0?s:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(f),assumeValid:(a=r?.assumeValid)!==null&&a!==void 0?a:!1};function I(v){return(0,pe.isListType)(v)?new pe.GraphQLList(I(v.ofType)):(0,pe.isNonNullType)(v)?new pe.GraphQLNonNull(I(v.ofType)):E(v)}function E(v){return d[v.name]}function L(v){let S=v.toConfig();return new Ki.GraphQLDirective({...S,args:(0,In.mapValue)(S.args,_)})}function F(v){if((0,id.isIntrospectionType)(v)||(0,sd.isSpecifiedScalarType)(v))return v;if((0,pe.isScalarType)(v))return G(v);if((0,pe.isObjectType)(v))return C(v);if((0,pe.isInterfaceType)(v))return w(v);if((0,pe.isUnionType)(v))return V(v);if((0,pe.isEnumType)(v))return P(v);if((0,pe.isInputObjectType)(v))return k(v);(0,vE.invariant)(!1,"Unexpected type: "+(0,hE.inspect)(v))}function k(v){var S;let N=v.toConfig(),D=(S=u[N.name])!==null&&S!==void 0?S:[];return new pe.GraphQLInputObjectType({...N,fields:()=>({...(0,In.mapValue)(N.fields,ie=>({...ie,type:I(ie.type)})),...Le(D)}),extensionASTNodes:N.extensionASTNodes.concat(D)})}function P(v){var S;let N=v.toConfig(),D=(S=u[v.name])!==null&&S!==void 0?S:[];return new pe.GraphQLEnumType({...N,values:{...N.values,...xe(D)},extensionASTNodes:N.extensionASTNodes.concat(D)})}function G(v){var S;let N=v.toConfig(),D=(S=u[N.name])!==null&&S!==void 0?S:[],ie=N.specifiedByURL;for(let ce of D){var be;ie=(be=nd(ce))!==null&&be!==void 0?be:ie}return new pe.GraphQLScalarType({...N,specifiedByURL:ie,extensionASTNodes:N.extensionASTNodes.concat(D)})}function C(v){var S;let N=v.toConfig(),D=(S=u[N.name])!==null&&S!==void 0?S:[];return new pe.GraphQLObjectType({...N,interfaces:()=>[...v.getInterfaces().map(E),...Ae(D)],fields:()=>({...(0,In.mapValue)(N.fields,m),...Te(D)}),extensionASTNodes:N.extensionASTNodes.concat(D)})}function w(v){var S;let N=v.toConfig(),D=(S=u[N.name])!==null&&S!==void 0?S:[];return new pe.GraphQLInterfaceType({...N,interfaces:()=>[...v.getInterfaces().map(E),...Ae(D)],fields:()=>({...(0,In.mapValue)(N.fields,m),...Te(D)}),extensionASTNodes:N.extensionASTNodes.concat(D)})}function V(v){var S;let N=v.toConfig(),D=(S=u[N.name])!==null&&S!==void 0?S:[];return new pe.GraphQLUnionType({...N,types:()=>[...v.getTypes().map(E),...Nt(D)],extensionASTNodes:N.extensionASTNodes.concat(D)})}function m(v){return{...v,type:I(v.type),args:v.args&&(0,In.mapValue)(v.args,_)}}function _(v){return{...v,type:I(v.type)}}function oe(v){let S={};for(let D of v){var N;let ie=(N=D.operationTypes)!==null&&N!==void 0?N:[];for(let be of ie)S[be.operation]=$(be.type)}return S}function $(v){var S;let N=v.name.value,D=(S=rd[N])!==null&&S!==void 0?S:d[N];if(D===void 0)throw new Error(`Unknown type: "${N}".`);return D}function X(v){return v.kind===We.Kind.LIST_TYPE?new pe.GraphQLList(X(v.type)):v.kind===We.Kind.NON_NULL_TYPE?new pe.GraphQLNonNull(X(v.type)):$(v)}function ye(v){var S;return new Ki.GraphQLDirective({name:v.name.value,description:(S=v.description)===null||S===void 0?void 0:S.value,locations:v.locations.map(({value:N})=>N),isRepeatable:v.repeatable,args:Ie(v.arguments),astNode:v})}function Te(v){let S=Object.create(null);for(let ie of v){var N;let be=(N=ie.fields)!==null&&N!==void 0?N:[];for(let ce of be){var D;S[ce.name.value]={type:X(ce.type),description:(D=ce.description)===null||D===void 0?void 0:D.value,args:Ie(ce.arguments),deprecationReason:Ui(ce),astNode:ce}}}return S}function Ie(v){let S=v??[],N=Object.create(null);for(let ie of S){var D;let be=X(ie.type);N[ie.name.value]={type:be,description:(D=ie.description)===null||D===void 0?void 0:D.value,defaultValue:(0,td.valueFromAST)(ie.defaultValue,be),deprecationReason:Ui(ie),astNode:ie}}return N}function Le(v){let S=Object.create(null);for(let ie of v){var N;let be=(N=ie.fields)!==null&&N!==void 0?N:[];for(let ce of be){var D;let pr=X(ce.type);S[ce.name.value]={type:pr,description:(D=ce.description)===null||D===void 0?void 0:D.value,defaultValue:(0,td.valueFromAST)(ce.defaultValue,pr),deprecationReason:Ui(ce),astNode:ce}}}return S}function xe(v){let S=Object.create(null);for(let ie of v){var N;let be=(N=ie.values)!==null&&N!==void 0?N:[];for(let ce of be){var D;S[ce.name.value]={description:(D=ce.description)===null||D===void 0?void 0:D.value,deprecationReason:Ui(ce),astNode:ce}}}return S}function Ae(v){return v.flatMap(S=>{var N,D;return(N=(D=S.interfaces)===null||D===void 0?void 0:D.map($))!==null&&N!==void 0?N:[]})}function Nt(v){return v.flatMap(S=>{var N,D;return(N=(D=S.types)===null||D===void 0?void 0:D.map($))!==null&&N!==void 0?N:[]})}function jt(v){var S;let N=v.name.value,D=(S=u[N])!==null&&S!==void 0?S:[];switch(v.kind){case We.Kind.OBJECT_TYPE_DEFINITION:{var ie;let tt=[v,...D];return new pe.GraphQLObjectType({name:N,description:(ie=v.description)===null||ie===void 0?void 0:ie.value,interfaces:()=>Ae(tt),fields:()=>Te(tt),astNode:v,extensionASTNodes:D})}case We.Kind.INTERFACE_TYPE_DEFINITION:{var be;let tt=[v,...D];return new pe.GraphQLInterfaceType({name:N,description:(be=v.description)===null||be===void 0?void 0:be.value,interfaces:()=>Ae(tt),fields:()=>Te(tt),astNode:v,extensionASTNodes:D})}case We.Kind.ENUM_TYPE_DEFINITION:{var ce;let tt=[v,...D];return new pe.GraphQLEnumType({name:N,description:(ce=v.description)===null||ce===void 0?void 0:ce.value,values:xe(tt),astNode:v,extensionASTNodes:D})}case We.Kind.UNION_TYPE_DEFINITION:{var pr;let tt=[v,...D];return new pe.GraphQLUnionType({name:N,description:(pr=v.description)===null||pr===void 0?void 0:pr.value,types:()=>Nt(tt),astNode:v,extensionASTNodes:D})}case We.Kind.SCALAR_TYPE_DEFINITION:{var es;return new pe.GraphQLScalarType({name:N,description:(es=v.description)===null||es===void 0?void 0:es.value,specifiedByURL:nd(v),astNode:v,extensionASTNodes:D})}case We.Kind.INPUT_OBJECT_TYPE_DEFINITION:{var ts;let tt=[v,...D];return new pe.GraphQLInputObjectType({name:N,description:(ts=v.description)===null||ts===void 0?void 0:ts.value,fields:()=>Le(tt),astNode:v,extensionASTNodes:D})}}}}var rd=(0,TE.keyMap)([...sd.specifiedScalarTypes,...id.introspectionTypes],e=>e.name);function Ui(e){let t=(0,ad.getDirectiveValues)(Ki.GraphQLDeprecatedDirective,e);return t?.reason}function nd(e){let t=(0,ad.getDirectiveValues)(Ki.GraphQLSpecifiedByDirective,e);return t?.url}});var cd=h(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.buildASTSchema=ud;Bi.buildSchema=DE;var EE=Fe(),_E=H(),NE=vr(),OE=Ve(),IE=Zt(),LE=bn(),SE=Iu();function ud(e,t){e!=null&&e.kind===_E.Kind.DOCUMENT||(0,EE.devAssert)(!1,"Must provide valid Document AST."),t?.assumeValid!==!0&&t?.assumeValidSDL!==!0&&(0,LE.assertValidSDL)(e);let r={description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},n=(0,SE.extendSchemaImpl)(r,e,t);if(n.astNode==null)for(let s of n.types)switch(s.name){case"Query":n.query=s;break;case"Mutation":n.mutation=s;break;case"Subscription":n.subscription=s;break}let i=[...n.directives,...OE.specifiedDirectives.filter(s=>n.directives.every(a=>a.name!==s.name))];return new IE.GraphQLSchema({...n,directives:i})}function DE(e,t){let r=(0,NE.parse)(e,{noLocation:t?.noLocation,allowLegacyFragmentVariables:t?.allowLegacyFragmentVariables});return ud(r,{assumeValidSDL:t?.assumeValidSDL,assumeValid:t?.assumeValid})}});var dd=h(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.lexicographicSortSchema=kE;var AE=re(),RE=je(),jE=Kr(),ld=$r(),ke=Y(),PE=Ve(),wE=Ye(),FE=Zt();function kE(e){let t=e.toConfig(),r=(0,jE.keyValMap)(Lu(t.types),d=>d.name,f);return new FE.GraphQLSchema({...t,types:Object.values(r),directives:Lu(t.directives).map(a),query:s(t.query),mutation:s(t.mutation),subscription:s(t.subscription)});function n(d){return(0,ke.isListType)(d)?new ke.GraphQLList(n(d.ofType)):(0,ke.isNonNullType)(d)?new ke.GraphQLNonNull(n(d.ofType)):i(d)}function i(d){return r[d.name]}function s(d){return d&&i(d)}function a(d){let y=d.toConfig();return new PE.GraphQLDirective({...y,locations:pd(y.locations,T=>T),args:o(y.args)})}function o(d){return Yi(d,y=>({...y,type:n(y.type)}))}function u(d){return Yi(d,y=>({...y,type:n(y.type),args:y.args&&o(y.args)}))}function c(d){return Yi(d,y=>({...y,type:n(y.type)}))}function l(d){return Lu(d).map(i)}function f(d){if((0,ke.isScalarType)(d)||(0,wE.isIntrospectionType)(d))return d;if((0,ke.isObjectType)(d)){let y=d.toConfig();return new ke.GraphQLObjectType({...y,interfaces:()=>l(y.interfaces),fields:()=>u(y.fields)})}if((0,ke.isInterfaceType)(d)){let y=d.toConfig();return new ke.GraphQLInterfaceType({...y,interfaces:()=>l(y.interfaces),fields:()=>u(y.fields)})}if((0,ke.isUnionType)(d)){let y=d.toConfig();return new ke.GraphQLUnionType({...y,types:()=>l(y.types)})}if((0,ke.isEnumType)(d)){let y=d.toConfig();return new ke.GraphQLEnumType({...y,values:Yi(y.values,T=>T)})}if((0,ke.isInputObjectType)(d)){let y=d.toConfig();return new ke.GraphQLInputObjectType({...y,fields:()=>c(y.fields)})}(0,RE.invariant)(!1,"Unexpected type: "+(0,AE.inspect)(d))}}function Yi(e,t){let r=Object.create(null);for(let n of Object.keys(e).sort(ld.naturalCompare))r[n]=t(e[n]);return r}function Lu(e){return pd(e,t=>t.name)}function pd(e,t){return e.slice().sort((r,n)=>{let i=t(r),s=t(n);return(0,ld.naturalCompare)(i,s)})}});var bd=h(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.printIntrospectionSchema=QE;Ln.printSchema=CE;Ln.printType=yd;var qE=re(),xE=je(),VE=qr(),Au=H(),Ji=Ce(),jr=Y(),Ru=Ve(),fd=Ye(),ME=yt(),GE=sn();function CE(e){return md(e,t=>!(0,Ru.isSpecifiedDirective)(t),UE)}function QE(e){return md(e,Ru.isSpecifiedDirective,fd.isIntrospectionType)}function UE(e){return!(0,ME.isSpecifiedScalarType)(e)&&!(0,fd.isIntrospectionType)(e)}function md(e,t,r){let n=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(r);return[KE(e),...n.map(s=>WE(s)),...i.map(s=>yd(s))].filter(Boolean).join(` + +`)}function KE(e){if(e.description==null&&$E(e))return;let t=[],r=e.getQueryType();r&&t.push(` query: ${r.name}`);let n=e.getMutationType();n&&t.push(` mutation: ${n.name}`);let i=e.getSubscriptionType();return i&&t.push(` subscription: ${i.name}`),Ze(e)+`schema { +${t.join(` +`)} +}`}function $E(e){let t=e.getQueryType();if(t&&t.name!=="Query")return!1;let r=e.getMutationType();if(r&&r.name!=="Mutation")return!1;let n=e.getSubscriptionType();return!(n&&n.name!=="Subscription")}function yd(e){if((0,jr.isScalarType)(e))return BE(e);if((0,jr.isObjectType)(e))return YE(e);if((0,jr.isInterfaceType)(e))return JE(e);if((0,jr.isUnionType)(e))return XE(e);if((0,jr.isEnumType)(e))return HE(e);if((0,jr.isInputObjectType)(e))return zE(e);(0,xE.invariant)(!1,"Unexpected type: "+(0,qE.inspect)(e))}function BE(e){return Ze(e)+`scalar ${e.name}`+ZE(e)}function hd(e){let t=e.getInterfaces();return t.length?" implements "+t.map(r=>r.name).join(" & "):""}function YE(e){return Ze(e)+`type ${e.name}`+hd(e)+vd(e)}function JE(e){return Ze(e)+`interface ${e.name}`+hd(e)+vd(e)}function XE(e){let t=e.getTypes(),r=t.length?" = "+t.join(" | "):"";return Ze(e)+"union "+e.name+r}function HE(e){let t=e.getValues().map((r,n)=>Ze(r," ",!n)+" "+r.name+Pu(r.deprecationReason));return Ze(e)+`enum ${e.name}`+ju(t)}function zE(e){let t=Object.values(e.getFields()).map((r,n)=>Ze(r," ",!n)+" "+Du(r));return Ze(e)+`input ${e.name}`+ju(t)}function vd(e){let t=Object.values(e.getFields()).map((r,n)=>Ze(r," ",!n)+" "+r.name+Td(r.args," ")+": "+String(r.type)+Pu(r.deprecationReason));return ju(t)}function ju(e){return e.length!==0?` { +`+e.join(` +`)+` +}`:""}function Td(e,t=""){return e.length===0?"":e.every(r=>!r.description)?"("+e.map(Du).join(", ")+")":`( +`+e.map((r,n)=>Ze(r," "+t,!n)+" "+t+Du(r)).join(` +`)+` +`+t+")"}function Du(e){let t=(0,GE.astFromValue)(e.defaultValue,e.type),r=e.name+": "+String(e.type);return t&&(r+=` = ${(0,Ji.print)(t)}`),r+Pu(e.deprecationReason)}function WE(e){return Ze(e)+"directive @"+e.name+Td(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}function Pu(e){return e==null?"":e!==Ru.DEFAULT_DEPRECATION_REASON?` @deprecated(reason: ${(0,Ji.print)({kind:Au.Kind.STRING,value:e})})`:" @deprecated"}function ZE(e){return e.specifiedByURL==null?"":` @specifiedBy(url: ${(0,Ji.print)({kind:Au.Kind.STRING,value:e.specifiedByURL})})`}function Ze(e,t="",r=!0){let{description:n}=e;if(n==null)return"";let i=(0,Ji.print)({kind:Au.Kind.STRING,value:n,block:(0,VE.isPrintableAsBlockString)(n)});return(t&&!r?` +`+t:t)+i.replace(/\n/g,` +`+t)+` +`}});var gd=h(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.concatAST=t_;var e_=H();function t_(e){let t=[];for(let r of e)t.push(...r.definitions);return{kind:e_.Kind.DOCUMENT,definitions:t}}});var Nd=h(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.separateOperations=n_;var Xi=H(),r_=Yt();function n_(e){let t=[],r=Object.create(null);for(let i of e.definitions)switch(i.kind){case Xi.Kind.OPERATION_DEFINITION:t.push(i);break;case Xi.Kind.FRAGMENT_DEFINITION:r[i.name.value]=Ed(i.selectionSet);break;default:}let n=Object.create(null);for(let i of t){let s=new Set;for(let o of Ed(i.selectionSet))_d(s,r,o);let a=i.name?i.name.value:"";n[a]={kind:Xi.Kind.DOCUMENT,definitions:e.definitions.filter(o=>o===i||o.kind===Xi.Kind.FRAGMENT_DEFINITION&&s.has(o.name.value))}}return n}function _d(e,t,r){if(!e.has(r)){e.add(r);let n=t[r];if(n!==void 0)for(let i of n)_d(e,t,i)}}function Ed(e){let t=[];return(0,r_.visit)(e,{FragmentSpread(r){t.push(r.name.value)}}),t}});var Ld=h(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.stripIgnoredCharacters=s_;var i_=qr(),Od=Mn(),Id=Un(),ku=Vr();function s_(e){let t=(0,Id.isSource)(e)?e:new Id.Source(e),r=t.body,n=new Od.Lexer(t),i="",s=!1;for(;n.advance().kind!==ku.TokenKind.EOF;){let a=n.token,o=a.kind,u=!(0,Od.isPunctuatorTokenKind)(a.kind);s&&(u||a.kind===ku.TokenKind.SPREAD)&&(i+=" ");let c=r.slice(a.start,a.end);o===ku.TokenKind.BLOCK_STRING?i+=(0,i_.printBlockString)(a.value,{minimize:!0}):i+=c,s=u}return i}});var Dd=h(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.assertValidName=c_;Hi.isValidNameError=Sd;var a_=Fe(),o_=q(),u_=Br();function c_(e){let t=Sd(e);if(t)throw t;return e}function Sd(e){if(typeof e=="string"||(0,a_.devAssert)(!1,"Expected name to be a string."),e.startsWith("__"))return new o_.GraphQLError(`Name "${e}" must not begin with "__", which is reserved by GraphQL introspection.`);try{(0,u_.assertName)(e)}catch(t){return t}}});var qd=h(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.DangerousChangeType=Et.BreakingChangeType=void 0;Et.findBreakingChanges=y_;Et.findDangerousChanges=h_;var l_=re(),Fd=je(),Ad=Ft(),p_=Ce(),Z=Y(),d_=yt(),f_=sn(),m_=Ga(),me;Et.BreakingChangeType=me;(function(e){e.TYPE_REMOVED="TYPE_REMOVED",e.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",e.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",e.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",e.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",e.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",e.FIELD_REMOVED="FIELD_REMOVED",e.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",e.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",e.ARG_REMOVED="ARG_REMOVED",e.ARG_CHANGED_KIND="ARG_CHANGED_KIND",e.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",e.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",e.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",e.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",e.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"})(me||(Et.BreakingChangeType=me={}));var ct;Et.DangerousChangeType=ct;(function(e){e.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",e.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",e.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",e.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",e.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",e.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"})(ct||(Et.DangerousChangeType=ct={}));function y_(e,t){return kd(e,t).filter(r=>r.type in me)}function h_(e,t){return kd(e,t).filter(r=>r.type in ct)}function kd(e,t){return[...T_(e,t),...v_(e,t)]}function v_(e,t){let r=[],n=At(e.getDirectives(),t.getDirectives());for(let i of n.removed)r.push({type:me.DIRECTIVE_REMOVED,description:`${i.name} was removed.`});for(let[i,s]of n.persisted){let a=At(i.args,s.args);for(let o of a.added)(0,Z.isRequiredArgument)(o)&&r.push({type:me.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${o.name} on directive ${i.name} was added.`});for(let o of a.removed)r.push({type:me.DIRECTIVE_ARG_REMOVED,description:`${o.name} was removed from ${i.name}.`});i.isRepeatable&&!s.isRepeatable&&r.push({type:me.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${i.name}.`});for(let o of i.locations)s.locations.includes(o)||r.push({type:me.DIRECTIVE_LOCATION_REMOVED,description:`${o} was removed from ${i.name}.`})}return r}function T_(e,t){let r=[],n=At(Object.values(e.getTypeMap()),Object.values(t.getTypeMap()));for(let i of n.removed)r.push({type:me.TYPE_REMOVED,description:(0,d_.isSpecifiedScalarType)(i)?`Standard scalar ${i.name} was removed because it is not referenced anymore.`:`${i.name} was removed.`});for(let[i,s]of n.persisted)(0,Z.isEnumType)(i)&&(0,Z.isEnumType)(s)?r.push(...E_(i,s)):(0,Z.isUnionType)(i)&&(0,Z.isUnionType)(s)?r.push(...g_(i,s)):(0,Z.isInputObjectType)(i)&&(0,Z.isInputObjectType)(s)?r.push(...b_(i,s)):(0,Z.isObjectType)(i)&&(0,Z.isObjectType)(s)?r.push(...jd(i,s),...Rd(i,s)):(0,Z.isInterfaceType)(i)&&(0,Z.isInterfaceType)(s)?r.push(...jd(i,s),...Rd(i,s)):i.constructor!==s.constructor&&r.push({type:me.TYPE_CHANGED_KIND,description:`${i.name} changed from ${Pd(i)} to ${Pd(s)}.`});return r}function b_(e,t){let r=[],n=At(Object.values(e.getFields()),Object.values(t.getFields()));for(let i of n.added)(0,Z.isRequiredInputField)(i)?r.push({type:me.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${i.name} on input type ${e.name} was added.`}):r.push({type:ct.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${i.name} on input type ${e.name} was added.`});for(let i of n.removed)r.push({type:me.FIELD_REMOVED,description:`${e.name}.${i.name} was removed.`});for(let[i,s]of n.persisted)Dn(i.type,s.type)||r.push({type:me.FIELD_CHANGED_KIND,description:`${e.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return r}function g_(e,t){let r=[],n=At(e.getTypes(),t.getTypes());for(let i of n.added)r.push({type:ct.TYPE_ADDED_TO_UNION,description:`${i.name} was added to union type ${e.name}.`});for(let i of n.removed)r.push({type:me.TYPE_REMOVED_FROM_UNION,description:`${i.name} was removed from union type ${e.name}.`});return r}function E_(e,t){let r=[],n=At(e.getValues(),t.getValues());for(let i of n.added)r.push({type:ct.VALUE_ADDED_TO_ENUM,description:`${i.name} was added to enum type ${e.name}.`});for(let i of n.removed)r.push({type:me.VALUE_REMOVED_FROM_ENUM,description:`${i.name} was removed from enum type ${e.name}.`});return r}function Rd(e,t){let r=[],n=At(e.getInterfaces(),t.getInterfaces());for(let i of n.added)r.push({type:ct.IMPLEMENTED_INTERFACE_ADDED,description:`${i.name} added to interfaces implemented by ${e.name}.`});for(let i of n.removed)r.push({type:me.IMPLEMENTED_INTERFACE_REMOVED,description:`${e.name} no longer implements interface ${i.name}.`});return r}function jd(e,t){let r=[],n=At(Object.values(e.getFields()),Object.values(t.getFields()));for(let i of n.removed)r.push({type:me.FIELD_REMOVED,description:`${e.name}.${i.name} was removed.`});for(let[i,s]of n.persisted)r.push(...__(e,i,s)),Sn(i.type,s.type)||r.push({type:me.FIELD_CHANGED_KIND,description:`${e.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return r}function __(e,t,r){let n=[],i=At(t.args,r.args);for(let s of i.removed)n.push({type:me.ARG_REMOVED,description:`${e.name}.${t.name} arg ${s.name} was removed.`});for(let[s,a]of i.persisted)if(!Dn(s.type,a.type))n.push({type:me.ARG_CHANGED_KIND,description:`${e.name}.${t.name} arg ${s.name} has changed type from ${String(s.type)} to ${String(a.type)}.`});else if(s.defaultValue!==void 0)if(a.defaultValue===void 0)n.push({type:ct.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${s.name} defaultValue was removed.`});else{let u=wd(s.defaultValue,s.type),c=wd(a.defaultValue,a.type);u!==c&&n.push({type:ct.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${s.name} has changed defaultValue from ${u} to ${c}.`})}for(let s of i.added)(0,Z.isRequiredArgument)(s)?n.push({type:me.REQUIRED_ARG_ADDED,description:`A required arg ${s.name} on ${e.name}.${t.name} was added.`}):n.push({type:ct.OPTIONAL_ARG_ADDED,description:`An optional arg ${s.name} on ${e.name}.${t.name} was added.`});return n}function Sn(e,t){return(0,Z.isListType)(e)?(0,Z.isListType)(t)&&Sn(e.ofType,t.ofType)||(0,Z.isNonNullType)(t)&&Sn(e,t.ofType):(0,Z.isNonNullType)(e)?(0,Z.isNonNullType)(t)&&Sn(e.ofType,t.ofType):(0,Z.isNamedType)(t)&&e.name===t.name||(0,Z.isNonNullType)(t)&&Sn(e,t.ofType)}function Dn(e,t){return(0,Z.isListType)(e)?(0,Z.isListType)(t)&&Dn(e.ofType,t.ofType):(0,Z.isNonNullType)(e)?(0,Z.isNonNullType)(t)&&Dn(e.ofType,t.ofType)||!(0,Z.isNonNullType)(t)&&Dn(e.ofType,t):(0,Z.isNamedType)(t)&&e.name===t.name}function Pd(e){if((0,Z.isScalarType)(e))return"a Scalar type";if((0,Z.isObjectType)(e))return"an Object type";if((0,Z.isInterfaceType)(e))return"an Interface type";if((0,Z.isUnionType)(e))return"a Union type";if((0,Z.isEnumType)(e))return"an Enum type";if((0,Z.isInputObjectType)(e))return"an Input type";(0,Fd.invariant)(!1,"Unexpected type: "+(0,l_.inspect)(e))}function wd(e,t){let r=(0,f_.astFromValue)(e,t);return r!=null||(0,Fd.invariant)(!1),(0,p_.print)((0,m_.sortValueNode)(r))}function At(e,t){let r=[],n=[],i=[],s=(0,Ad.keyMap)(e,({name:o})=>o),a=(0,Ad.keyMap)(t,({name:o})=>o);for(let o of e){let u=a[o.name];u===void 0?n.push(o):i.push([o,u])}for(let o of t)s[o.name]===void 0&&r.push(o);return{added:r,persisted:i,removed:n}}});var Gd=h(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});Object.defineProperty(W,"BreakingChangeType",{enumerable:!0,get:function(){return zi.BreakingChangeType}});Object.defineProperty(W,"DangerousChangeType",{enumerable:!0,get:function(){return zi.DangerousChangeType}});Object.defineProperty(W,"TypeInfo",{enumerable:!0,get:function(){return Vd.TypeInfo}});Object.defineProperty(W,"assertValidName",{enumerable:!0,get:function(){return Md.assertValidName}});Object.defineProperty(W,"astFromValue",{enumerable:!0,get:function(){return w_.astFromValue}});Object.defineProperty(W,"buildASTSchema",{enumerable:!0,get:function(){return xd.buildASTSchema}});Object.defineProperty(W,"buildClientSchema",{enumerable:!0,get:function(){return S_.buildClientSchema}});Object.defineProperty(W,"buildSchema",{enumerable:!0,get:function(){return xd.buildSchema}});Object.defineProperty(W,"coerceInputValue",{enumerable:!0,get:function(){return F_.coerceInputValue}});Object.defineProperty(W,"concatAST",{enumerable:!0,get:function(){return k_.concatAST}});Object.defineProperty(W,"doTypesOverlap",{enumerable:!0,get:function(){return Vu.doTypesOverlap}});Object.defineProperty(W,"extendSchema",{enumerable:!0,get:function(){return D_.extendSchema}});Object.defineProperty(W,"findBreakingChanges",{enumerable:!0,get:function(){return zi.findBreakingChanges}});Object.defineProperty(W,"findDangerousChanges",{enumerable:!0,get:function(){return zi.findDangerousChanges}});Object.defineProperty(W,"getIntrospectionQuery",{enumerable:!0,get:function(){return N_.getIntrospectionQuery}});Object.defineProperty(W,"getOperationAST",{enumerable:!0,get:function(){return O_.getOperationAST}});Object.defineProperty(W,"getOperationRootType",{enumerable:!0,get:function(){return I_.getOperationRootType}});Object.defineProperty(W,"introspectionFromSchema",{enumerable:!0,get:function(){return L_.introspectionFromSchema}});Object.defineProperty(W,"isEqualType",{enumerable:!0,get:function(){return Vu.isEqualType}});Object.defineProperty(W,"isTypeSubTypeOf",{enumerable:!0,get:function(){return Vu.isTypeSubTypeOf}});Object.defineProperty(W,"isValidNameError",{enumerable:!0,get:function(){return Md.isValidNameError}});Object.defineProperty(W,"lexicographicSortSchema",{enumerable:!0,get:function(){return A_.lexicographicSortSchema}});Object.defineProperty(W,"printIntrospectionSchema",{enumerable:!0,get:function(){return xu.printIntrospectionSchema}});Object.defineProperty(W,"printSchema",{enumerable:!0,get:function(){return xu.printSchema}});Object.defineProperty(W,"printType",{enumerable:!0,get:function(){return xu.printType}});Object.defineProperty(W,"separateOperations",{enumerable:!0,get:function(){return q_.separateOperations}});Object.defineProperty(W,"stripIgnoredCharacters",{enumerable:!0,get:function(){return x_.stripIgnoredCharacters}});Object.defineProperty(W,"typeFromAST",{enumerable:!0,get:function(){return R_.typeFromAST}});Object.defineProperty(W,"valueFromAST",{enumerable:!0,get:function(){return j_.valueFromAST}});Object.defineProperty(W,"valueFromASTUntyped",{enumerable:!0,get:function(){return P_.valueFromASTUntyped}});Object.defineProperty(W,"visitWithTypeInfo",{enumerable:!0,get:function(){return Vd.visitWithTypeInfo}});var N_=gu(),O_=Jp(),I_=Xp(),L_=Hp(),S_=Wp(),xd=cd(),D_=Iu(),A_=dd(),xu=bd(),R_=ht(),j_=yn(),P_=Vs(),w_=sn(),Vd=vi(),F_=ao(),k_=gd(),q_=Nd(),x_=Ld(),Vu=zr(),Md=Dd(),zi=qd()});var Ud=h(p=>{"use strict";Object.defineProperty(p,"__esModule",{value:!0});Object.defineProperty(p,"BREAK",{enumerable:!0,get:function(){return ee.BREAK}});Object.defineProperty(p,"BreakingChangeType",{enumerable:!0,get:function(){return te.BreakingChangeType}});Object.defineProperty(p,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return g.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(p,"DangerousChangeType",{enumerable:!0,get:function(){return te.DangerousChangeType}});Object.defineProperty(p,"DirectiveLocation",{enumerable:!0,get:function(){return ee.DirectiveLocation}});Object.defineProperty(p,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return K.ExecutableDefinitionsRule}});Object.defineProperty(p,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return K.FieldsOnCorrectTypeRule}});Object.defineProperty(p,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return K.FragmentsOnCompositeTypesRule}});Object.defineProperty(p,"GRAPHQL_MAX_INT",{enumerable:!0,get:function(){return g.GRAPHQL_MAX_INT}});Object.defineProperty(p,"GRAPHQL_MIN_INT",{enumerable:!0,get:function(){return g.GRAPHQL_MIN_INT}});Object.defineProperty(p,"GraphQLBoolean",{enumerable:!0,get:function(){return g.GraphQLBoolean}});Object.defineProperty(p,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return g.GraphQLDeprecatedDirective}});Object.defineProperty(p,"GraphQLDirective",{enumerable:!0,get:function(){return g.GraphQLDirective}});Object.defineProperty(p,"GraphQLEnumType",{enumerable:!0,get:function(){return g.GraphQLEnumType}});Object.defineProperty(p,"GraphQLError",{enumerable:!0,get:function(){return An.GraphQLError}});Object.defineProperty(p,"GraphQLFloat",{enumerable:!0,get:function(){return g.GraphQLFloat}});Object.defineProperty(p,"GraphQLID",{enumerable:!0,get:function(){return g.GraphQLID}});Object.defineProperty(p,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return g.GraphQLIncludeDirective}});Object.defineProperty(p,"GraphQLInputObjectType",{enumerable:!0,get:function(){return g.GraphQLInputObjectType}});Object.defineProperty(p,"GraphQLInt",{enumerable:!0,get:function(){return g.GraphQLInt}});Object.defineProperty(p,"GraphQLInterfaceType",{enumerable:!0,get:function(){return g.GraphQLInterfaceType}});Object.defineProperty(p,"GraphQLList",{enumerable:!0,get:function(){return g.GraphQLList}});Object.defineProperty(p,"GraphQLNonNull",{enumerable:!0,get:function(){return g.GraphQLNonNull}});Object.defineProperty(p,"GraphQLObjectType",{enumerable:!0,get:function(){return g.GraphQLObjectType}});Object.defineProperty(p,"GraphQLScalarType",{enumerable:!0,get:function(){return g.GraphQLScalarType}});Object.defineProperty(p,"GraphQLSchema",{enumerable:!0,get:function(){return g.GraphQLSchema}});Object.defineProperty(p,"GraphQLSkipDirective",{enumerable:!0,get:function(){return g.GraphQLSkipDirective}});Object.defineProperty(p,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return g.GraphQLSpecifiedByDirective}});Object.defineProperty(p,"GraphQLString",{enumerable:!0,get:function(){return g.GraphQLString}});Object.defineProperty(p,"GraphQLUnionType",{enumerable:!0,get:function(){return g.GraphQLUnionType}});Object.defineProperty(p,"Kind",{enumerable:!0,get:function(){return ee.Kind}});Object.defineProperty(p,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return K.KnownArgumentNamesRule}});Object.defineProperty(p,"KnownDirectivesRule",{enumerable:!0,get:function(){return K.KnownDirectivesRule}});Object.defineProperty(p,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return K.KnownFragmentNamesRule}});Object.defineProperty(p,"KnownTypeNamesRule",{enumerable:!0,get:function(){return K.KnownTypeNamesRule}});Object.defineProperty(p,"Lexer",{enumerable:!0,get:function(){return ee.Lexer}});Object.defineProperty(p,"Location",{enumerable:!0,get:function(){return ee.Location}});Object.defineProperty(p,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return K.LoneAnonymousOperationRule}});Object.defineProperty(p,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return K.LoneSchemaDefinitionRule}});Object.defineProperty(p,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return K.NoDeprecatedCustomRule}});Object.defineProperty(p,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return K.NoFragmentCyclesRule}});Object.defineProperty(p,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return K.NoSchemaIntrospectionCustomRule}});Object.defineProperty(p,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return K.NoUndefinedVariablesRule}});Object.defineProperty(p,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return K.NoUnusedFragmentsRule}});Object.defineProperty(p,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return K.NoUnusedVariablesRule}});Object.defineProperty(p,"OperationTypeNode",{enumerable:!0,get:function(){return ee.OperationTypeNode}});Object.defineProperty(p,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return K.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(p,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return K.PossibleFragmentSpreadsRule}});Object.defineProperty(p,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return K.PossibleTypeExtensionsRule}});Object.defineProperty(p,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return K.ProvidedRequiredArgumentsRule}});Object.defineProperty(p,"ScalarLeafsRule",{enumerable:!0,get:function(){return K.ScalarLeafsRule}});Object.defineProperty(p,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return g.SchemaMetaFieldDef}});Object.defineProperty(p,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return K.SingleFieldSubscriptionsRule}});Object.defineProperty(p,"Source",{enumerable:!0,get:function(){return ee.Source}});Object.defineProperty(p,"Token",{enumerable:!0,get:function(){return ee.Token}});Object.defineProperty(p,"TokenKind",{enumerable:!0,get:function(){return ee.TokenKind}});Object.defineProperty(p,"TypeInfo",{enumerable:!0,get:function(){return te.TypeInfo}});Object.defineProperty(p,"TypeKind",{enumerable:!0,get:function(){return g.TypeKind}});Object.defineProperty(p,"TypeMetaFieldDef",{enumerable:!0,get:function(){return g.TypeMetaFieldDef}});Object.defineProperty(p,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return g.TypeNameMetaFieldDef}});Object.defineProperty(p,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return K.UniqueArgumentDefinitionNamesRule}});Object.defineProperty(p,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return K.UniqueArgumentNamesRule}});Object.defineProperty(p,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return K.UniqueDirectiveNamesRule}});Object.defineProperty(p,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return K.UniqueDirectivesPerLocationRule}});Object.defineProperty(p,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return K.UniqueEnumValueNamesRule}});Object.defineProperty(p,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return K.UniqueFieldDefinitionNamesRule}});Object.defineProperty(p,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return K.UniqueFragmentNamesRule}});Object.defineProperty(p,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return K.UniqueInputFieldNamesRule}});Object.defineProperty(p,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return K.UniqueOperationNamesRule}});Object.defineProperty(p,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return K.UniqueOperationTypesRule}});Object.defineProperty(p,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return K.UniqueTypeNamesRule}});Object.defineProperty(p,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return K.UniqueVariableNamesRule}});Object.defineProperty(p,"ValidationContext",{enumerable:!0,get:function(){return K.ValidationContext}});Object.defineProperty(p,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return K.ValuesOfCorrectTypeRule}});Object.defineProperty(p,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return K.VariablesAreInputTypesRule}});Object.defineProperty(p,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return K.VariablesInAllowedPositionRule}});Object.defineProperty(p,"__Directive",{enumerable:!0,get:function(){return g.__Directive}});Object.defineProperty(p,"__DirectiveLocation",{enumerable:!0,get:function(){return g.__DirectiveLocation}});Object.defineProperty(p,"__EnumValue",{enumerable:!0,get:function(){return g.__EnumValue}});Object.defineProperty(p,"__Field",{enumerable:!0,get:function(){return g.__Field}});Object.defineProperty(p,"__InputValue",{enumerable:!0,get:function(){return g.__InputValue}});Object.defineProperty(p,"__Schema",{enumerable:!0,get:function(){return g.__Schema}});Object.defineProperty(p,"__Type",{enumerable:!0,get:function(){return g.__Type}});Object.defineProperty(p,"__TypeKind",{enumerable:!0,get:function(){return g.__TypeKind}});Object.defineProperty(p,"assertAbstractType",{enumerable:!0,get:function(){return g.assertAbstractType}});Object.defineProperty(p,"assertCompositeType",{enumerable:!0,get:function(){return g.assertCompositeType}});Object.defineProperty(p,"assertDirective",{enumerable:!0,get:function(){return g.assertDirective}});Object.defineProperty(p,"assertEnumType",{enumerable:!0,get:function(){return g.assertEnumType}});Object.defineProperty(p,"assertEnumValueName",{enumerable:!0,get:function(){return g.assertEnumValueName}});Object.defineProperty(p,"assertInputObjectType",{enumerable:!0,get:function(){return g.assertInputObjectType}});Object.defineProperty(p,"assertInputType",{enumerable:!0,get:function(){return g.assertInputType}});Object.defineProperty(p,"assertInterfaceType",{enumerable:!0,get:function(){return g.assertInterfaceType}});Object.defineProperty(p,"assertLeafType",{enumerable:!0,get:function(){return g.assertLeafType}});Object.defineProperty(p,"assertListType",{enumerable:!0,get:function(){return g.assertListType}});Object.defineProperty(p,"assertName",{enumerable:!0,get:function(){return g.assertName}});Object.defineProperty(p,"assertNamedType",{enumerable:!0,get:function(){return g.assertNamedType}});Object.defineProperty(p,"assertNonNullType",{enumerable:!0,get:function(){return g.assertNonNullType}});Object.defineProperty(p,"assertNullableType",{enumerable:!0,get:function(){return g.assertNullableType}});Object.defineProperty(p,"assertObjectType",{enumerable:!0,get:function(){return g.assertObjectType}});Object.defineProperty(p,"assertOutputType",{enumerable:!0,get:function(){return g.assertOutputType}});Object.defineProperty(p,"assertScalarType",{enumerable:!0,get:function(){return g.assertScalarType}});Object.defineProperty(p,"assertSchema",{enumerable:!0,get:function(){return g.assertSchema}});Object.defineProperty(p,"assertType",{enumerable:!0,get:function(){return g.assertType}});Object.defineProperty(p,"assertUnionType",{enumerable:!0,get:function(){return g.assertUnionType}});Object.defineProperty(p,"assertValidName",{enumerable:!0,get:function(){return te.assertValidName}});Object.defineProperty(p,"assertValidSchema",{enumerable:!0,get:function(){return g.assertValidSchema}});Object.defineProperty(p,"assertWrappingType",{enumerable:!0,get:function(){return g.assertWrappingType}});Object.defineProperty(p,"astFromValue",{enumerable:!0,get:function(){return te.astFromValue}});Object.defineProperty(p,"buildASTSchema",{enumerable:!0,get:function(){return te.buildASTSchema}});Object.defineProperty(p,"buildClientSchema",{enumerable:!0,get:function(){return te.buildClientSchema}});Object.defineProperty(p,"buildSchema",{enumerable:!0,get:function(){return te.buildSchema}});Object.defineProperty(p,"coerceInputValue",{enumerable:!0,get:function(){return te.coerceInputValue}});Object.defineProperty(p,"concatAST",{enumerable:!0,get:function(){return te.concatAST}});Object.defineProperty(p,"createSourceEventStream",{enumerable:!0,get:function(){return _t.createSourceEventStream}});Object.defineProperty(p,"defaultFieldResolver",{enumerable:!0,get:function(){return _t.defaultFieldResolver}});Object.defineProperty(p,"defaultTypeResolver",{enumerable:!0,get:function(){return _t.defaultTypeResolver}});Object.defineProperty(p,"doTypesOverlap",{enumerable:!0,get:function(){return te.doTypesOverlap}});Object.defineProperty(p,"execute",{enumerable:!0,get:function(){return _t.execute}});Object.defineProperty(p,"executeSync",{enumerable:!0,get:function(){return _t.executeSync}});Object.defineProperty(p,"extendSchema",{enumerable:!0,get:function(){return te.extendSchema}});Object.defineProperty(p,"findBreakingChanges",{enumerable:!0,get:function(){return te.findBreakingChanges}});Object.defineProperty(p,"findDangerousChanges",{enumerable:!0,get:function(){return te.findDangerousChanges}});Object.defineProperty(p,"formatError",{enumerable:!0,get:function(){return An.formatError}});Object.defineProperty(p,"getArgumentValues",{enumerable:!0,get:function(){return _t.getArgumentValues}});Object.defineProperty(p,"getDirectiveValues",{enumerable:!0,get:function(){return _t.getDirectiveValues}});Object.defineProperty(p,"getEnterLeaveForKind",{enumerable:!0,get:function(){return ee.getEnterLeaveForKind}});Object.defineProperty(p,"getIntrospectionQuery",{enumerable:!0,get:function(){return te.getIntrospectionQuery}});Object.defineProperty(p,"getLocation",{enumerable:!0,get:function(){return ee.getLocation}});Object.defineProperty(p,"getNamedType",{enumerable:!0,get:function(){return g.getNamedType}});Object.defineProperty(p,"getNullableType",{enumerable:!0,get:function(){return g.getNullableType}});Object.defineProperty(p,"getOperationAST",{enumerable:!0,get:function(){return te.getOperationAST}});Object.defineProperty(p,"getOperationRootType",{enumerable:!0,get:function(){return te.getOperationRootType}});Object.defineProperty(p,"getVariableValues",{enumerable:!0,get:function(){return _t.getVariableValues}});Object.defineProperty(p,"getVisitFn",{enumerable:!0,get:function(){return ee.getVisitFn}});Object.defineProperty(p,"graphql",{enumerable:!0,get:function(){return Qd.graphql}});Object.defineProperty(p,"graphqlSync",{enumerable:!0,get:function(){return Qd.graphqlSync}});Object.defineProperty(p,"introspectionFromSchema",{enumerable:!0,get:function(){return te.introspectionFromSchema}});Object.defineProperty(p,"introspectionTypes",{enumerable:!0,get:function(){return g.introspectionTypes}});Object.defineProperty(p,"isAbstractType",{enumerable:!0,get:function(){return g.isAbstractType}});Object.defineProperty(p,"isCompositeType",{enumerable:!0,get:function(){return g.isCompositeType}});Object.defineProperty(p,"isConstValueNode",{enumerable:!0,get:function(){return ee.isConstValueNode}});Object.defineProperty(p,"isDefinitionNode",{enumerable:!0,get:function(){return ee.isDefinitionNode}});Object.defineProperty(p,"isDirective",{enumerable:!0,get:function(){return g.isDirective}});Object.defineProperty(p,"isEnumType",{enumerable:!0,get:function(){return g.isEnumType}});Object.defineProperty(p,"isEqualType",{enumerable:!0,get:function(){return te.isEqualType}});Object.defineProperty(p,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return ee.isExecutableDefinitionNode}});Object.defineProperty(p,"isInputObjectType",{enumerable:!0,get:function(){return g.isInputObjectType}});Object.defineProperty(p,"isInputType",{enumerable:!0,get:function(){return g.isInputType}});Object.defineProperty(p,"isInterfaceType",{enumerable:!0,get:function(){return g.isInterfaceType}});Object.defineProperty(p,"isIntrospectionType",{enumerable:!0,get:function(){return g.isIntrospectionType}});Object.defineProperty(p,"isLeafType",{enumerable:!0,get:function(){return g.isLeafType}});Object.defineProperty(p,"isListType",{enumerable:!0,get:function(){return g.isListType}});Object.defineProperty(p,"isNamedType",{enumerable:!0,get:function(){return g.isNamedType}});Object.defineProperty(p,"isNonNullType",{enumerable:!0,get:function(){return g.isNonNullType}});Object.defineProperty(p,"isNullableType",{enumerable:!0,get:function(){return g.isNullableType}});Object.defineProperty(p,"isObjectType",{enumerable:!0,get:function(){return g.isObjectType}});Object.defineProperty(p,"isOutputType",{enumerable:!0,get:function(){return g.isOutputType}});Object.defineProperty(p,"isRequiredArgument",{enumerable:!0,get:function(){return g.isRequiredArgument}});Object.defineProperty(p,"isRequiredInputField",{enumerable:!0,get:function(){return g.isRequiredInputField}});Object.defineProperty(p,"isScalarType",{enumerable:!0,get:function(){return g.isScalarType}});Object.defineProperty(p,"isSchema",{enumerable:!0,get:function(){return g.isSchema}});Object.defineProperty(p,"isSelectionNode",{enumerable:!0,get:function(){return ee.isSelectionNode}});Object.defineProperty(p,"isSpecifiedDirective",{enumerable:!0,get:function(){return g.isSpecifiedDirective}});Object.defineProperty(p,"isSpecifiedScalarType",{enumerable:!0,get:function(){return g.isSpecifiedScalarType}});Object.defineProperty(p,"isType",{enumerable:!0,get:function(){return g.isType}});Object.defineProperty(p,"isTypeDefinitionNode",{enumerable:!0,get:function(){return ee.isTypeDefinitionNode}});Object.defineProperty(p,"isTypeExtensionNode",{enumerable:!0,get:function(){return ee.isTypeExtensionNode}});Object.defineProperty(p,"isTypeNode",{enumerable:!0,get:function(){return ee.isTypeNode}});Object.defineProperty(p,"isTypeSubTypeOf",{enumerable:!0,get:function(){return te.isTypeSubTypeOf}});Object.defineProperty(p,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return ee.isTypeSystemDefinitionNode}});Object.defineProperty(p,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return ee.isTypeSystemExtensionNode}});Object.defineProperty(p,"isUnionType",{enumerable:!0,get:function(){return g.isUnionType}});Object.defineProperty(p,"isValidNameError",{enumerable:!0,get:function(){return te.isValidNameError}});Object.defineProperty(p,"isValueNode",{enumerable:!0,get:function(){return ee.isValueNode}});Object.defineProperty(p,"isWrappingType",{enumerable:!0,get:function(){return g.isWrappingType}});Object.defineProperty(p,"lexicographicSortSchema",{enumerable:!0,get:function(){return te.lexicographicSortSchema}});Object.defineProperty(p,"locatedError",{enumerable:!0,get:function(){return An.locatedError}});Object.defineProperty(p,"parse",{enumerable:!0,get:function(){return ee.parse}});Object.defineProperty(p,"parseConstValue",{enumerable:!0,get:function(){return ee.parseConstValue}});Object.defineProperty(p,"parseType",{enumerable:!0,get:function(){return ee.parseType}});Object.defineProperty(p,"parseValue",{enumerable:!0,get:function(){return ee.parseValue}});Object.defineProperty(p,"print",{enumerable:!0,get:function(){return ee.print}});Object.defineProperty(p,"printError",{enumerable:!0,get:function(){return An.printError}});Object.defineProperty(p,"printIntrospectionSchema",{enumerable:!0,get:function(){return te.printIntrospectionSchema}});Object.defineProperty(p,"printLocation",{enumerable:!0,get:function(){return ee.printLocation}});Object.defineProperty(p,"printSchema",{enumerable:!0,get:function(){return te.printSchema}});Object.defineProperty(p,"printSourceLocation",{enumerable:!0,get:function(){return ee.printSourceLocation}});Object.defineProperty(p,"printType",{enumerable:!0,get:function(){return te.printType}});Object.defineProperty(p,"resolveObjMapThunk",{enumerable:!0,get:function(){return g.resolveObjMapThunk}});Object.defineProperty(p,"resolveReadonlyArrayThunk",{enumerable:!0,get:function(){return g.resolveReadonlyArrayThunk}});Object.defineProperty(p,"responsePathAsArray",{enumerable:!0,get:function(){return _t.responsePathAsArray}});Object.defineProperty(p,"separateOperations",{enumerable:!0,get:function(){return te.separateOperations}});Object.defineProperty(p,"specifiedDirectives",{enumerable:!0,get:function(){return g.specifiedDirectives}});Object.defineProperty(p,"specifiedRules",{enumerable:!0,get:function(){return K.specifiedRules}});Object.defineProperty(p,"specifiedScalarTypes",{enumerable:!0,get:function(){return g.specifiedScalarTypes}});Object.defineProperty(p,"stripIgnoredCharacters",{enumerable:!0,get:function(){return te.stripIgnoredCharacters}});Object.defineProperty(p,"subscribe",{enumerable:!0,get:function(){return _t.subscribe}});Object.defineProperty(p,"syntaxError",{enumerable:!0,get:function(){return An.syntaxError}});Object.defineProperty(p,"typeFromAST",{enumerable:!0,get:function(){return te.typeFromAST}});Object.defineProperty(p,"validate",{enumerable:!0,get:function(){return K.validate}});Object.defineProperty(p,"validateSchema",{enumerable:!0,get:function(){return g.validateSchema}});Object.defineProperty(p,"valueFromAST",{enumerable:!0,get:function(){return te.valueFromAST}});Object.defineProperty(p,"valueFromASTUntyped",{enumerable:!0,get:function(){return te.valueFromASTUntyped}});Object.defineProperty(p,"version",{enumerable:!0,get:function(){return Cd.version}});Object.defineProperty(p,"versionInfo",{enumerable:!0,get:function(){return Cd.versionInfo}});Object.defineProperty(p,"visit",{enumerable:!0,get:function(){return ee.visit}});Object.defineProperty(p,"visitInParallel",{enumerable:!0,get:function(){return ee.visitInParallel}});Object.defineProperty(p,"visitWithTypeInfo",{enumerable:!0,get:function(){return te.visitWithTypeInfo}});var Cd=Gu(),Qd=Rp(),g=wp(),ee=kp(),_t=Up(),K=Bp(),An=Yp(),te=Gd()});var Yd=h(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.isExecutionResult=Pr.createHandler=void 0;var Rn=Ud(),$d=Pn(),et=dr();function V_(e){let{validate:t=Rn.validate,execute:r=Rn.execute,subscribe:n=Rn.subscribe,schema:i,authenticate:s=function(E){var L;let F=E.headers.get(et.TOKEN_HEADER_KEY);if(F)return Array.isArray(F)?F.join(""):F;let k=new URL((L=E.url)!==null&&L!==void 0?L:"","http://localhost/").searchParams.get(et.TOKEN_QUERY_KEY);return k||"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,P=>{let G=Math.random()*16|0;return(P=="x"?G:G&3|8).toString(16)})},onConnect:a,context:o,onSubscribe:u,onOperation:c,onNext:l,onComplete:f}=e,d={};function y(I){let E={},L,F=(()=>{let P=[],G={done:!1,error:null,resolve:()=>{}};async function C(){clearInterval(L),typeof I=="string"&&delete d[I];for(let V of Object.values(E))(0,et.isAsyncGenerator)(V)&&await V.return(void 0)}let w=async function*(){for(;;){for(P.length||await new Promise(m=>G.resolve=m);P.length;)yield P.shift();if(G.error)throw G.error;if(G.done)return}}();return w.throw=async V=>(G.done||(G.done=!0,G.error=V,G.resolve(),await C()),{done:!0,value:void 0}),w.return=async()=>(G.done||(G.done=!0,G.resolve(),await C()),{done:!0,value:void 0}),{next(V){P.push(V),G.resolve()},iterator:w}})(),k=!1;return{get open(){return k},ops:E,subscribe(){return k=!0,F.next(`: + +`),L=setInterval(()=>F.next(`: + +`),12e3),F.iterator},from(P,G,C,w){(async()=>{if((0,et.isAsyncIterable)(C))for await(let V of C){let m=await l?.(P,G,V);m&&(V=m),F.next((0,et.print)({event:"next",data:w?{id:w,payload:V}:V}))}else{let V=await l?.(P,G,C);V&&(C=V),F.next((0,et.print)({event:"next",data:w?{id:w,payload:C}:C}))}F.next((0,et.print)({event:"complete",data:w?{id:w}:null})),await f?.(P,G),w?delete E[w]:await F.iterator.return()})().catch(F.iterator.throw)}}}async function T(I,E){let L,F=await u?.(I,E);if(cr(F))return F;if(Bd(F)||(0,et.isAsyncIterable)(F))return{ctx:typeof o=="function"?await o(I,E):o,perform(){return F}};if(F)L=F;else{if(!i)throw new Error("The GraphQL schema is not provided");let{operationName:G,variables:C}=E,w;try{w=(0,Rn.parse)(E.query)}catch(m){return[JSON.stringify({errors:[m instanceof Error?{message:m.message}:m]}),{status:400,statusText:"Bad Request",headers:{"content-type":"application/json; charset=utf-8"}}]}let V={operationName:G,document:w,variableValues:C,contextValue:typeof o=="function"?await o(I,E):o};L={...V,schema:typeof i=="function"?await i(I,V):i}}let k;try{let G=(0,Rn.getOperationAST)(L.document,L.operationName);if(!G)throw null;k=G.operation}catch{return[JSON.stringify({errors:[{message:"Unable to detect operation AST"}]}),{status:400,statusText:"Bad Request",headers:{"content-type":"application/json; charset=utf-8"}}]}if(k==="mutation"&&I.method==="GET")return[JSON.stringify({errors:[{message:"Cannot perform mutations over GET"}]}),{status:405,statusText:"Method Not Allowed",headers:{allow:"POST","content-type":"application/json; charset=utf-8"}}];let P=t(L.schema,L.document);return P.length?I.headers.get("accept")==="text/event-stream"?{ctx:L.contextValue,perform(){return{errors:P}}}:[JSON.stringify({errors:P}),{status:400,statusText:"Bad Request",headers:{"content-type":"application/json; charset=utf-8"}}]:{ctx:L.contextValue,async perform(){let G=await(k==="subscription"?n(L):r(L)),C=await c?.(L.contextValue,I,L,G);return C||G}}}return async function(E){var L,F,k;let P=await s(E);if(cr(P))return P;let G=E.headers.get("accept")||"*/*",C=typeof P=="string"?d[P]:null;if(G==="text/event-stream"){let $=await a?.(E);if(cr($))return $;if(!C){let X=await Kd(E);if(cr(X))return X;let ye=X,Te=y(null);Te.ops[""]=null;let Ie=await T(E,ye);if(cr(Ie))return Ie;let Le=await Ie.perform();return(0,et.isAsyncIterable)(Le)&&(Te.ops[""]=Le),Te.from(Ie.ctx,E,Le,null),[Te.subscribe(),{status:200,statusText:"OK",headers:{connection:"keep-alive","cache-control":"no-cache","content-encoding":"none","content-type":"text/event-stream; charset=utf-8"}}]}return C.open?[JSON.stringify({errors:[{message:"Stream already open"}]}),{status:409,statusText:"Conflict",headers:{"content-type":"application/json; charset=utf-8"}}]:[C.subscribe(),{status:200,statusText:"OK",headers:{connection:"keep-alive","cache-control":"no-cache","content-encoding":"none","content-type":"text/event-stream; charset=utf-8"}}]}if(typeof P!="string")return[null,{status:404,statusText:"Not Found"}];if(E.method==="PUT")return["*/*","text/plain"].includes(G)?C?[JSON.stringify({errors:[{message:"Stream already registered"}]}),{status:409,statusText:"Conflict",headers:{"content-type":"application/json; charset=utf-8"}}]:(d[P]=y(P),[P,{status:201,statusText:"Created",headers:{"content-type":"text/plain; charset=utf-8"}}]):[null,{status:406,statusText:"Not Acceptable"}];if(E.method==="DELETE"){if(!C)return[JSON.stringify({errors:[{message:"Stream not found"}]}),{status:404,statusText:"Not Found",headers:{"content-type":"application/json; charset=utf-8"}}];let $=new URL((L=E.url)!==null&&L!==void 0?L:"","http://localhost/").searchParams.get("operationId");if(!$)return[JSON.stringify({errors:[{message:"Operation ID is missing"}]}),{status:400,statusText:"Bad Request",headers:{"content-type":"application/json; charset=utf-8"}}];let X=C.ops[$];return(0,et.isAsyncGenerator)(X)&&X.return(void 0),delete C.ops[$],[null,{status:200,statusText:"OK"}]}else{if(E.method!=="GET"&&E.method!=="POST")return[null,{status:405,statusText:"Method Not Allowed",headers:{allow:"GET, POST, PUT, DELETE"}}];if(!C)return[JSON.stringify({errors:[{message:"Stream not found"}]}),{status:404,statusText:"Not Found",headers:{"content-type":"application/json; charset=utf-8"}}]}if(!["*/*","application/*","application/json"].includes(G))return[null,{status:406,statusText:"Not Acceptable"}];let w=await Kd(E);if(cr(w))return w;let V=w,m=String((k=(F=V.extensions)===null||F===void 0?void 0:F.operationId)!==null&&k!==void 0?k:"");if(!m)return[JSON.stringify({errors:[{message:"Operation ID is missing"}]}),{status:400,statusText:"Bad Request",headers:{"content-type":"application/json; charset=utf-8"}}];if(m in C.ops)return[JSON.stringify({errors:[{message:"Operation with ID already exists"}]}),{status:409,statusText:"Conflict",headers:{"content-type":"application/json; charset=utf-8"}}];C.ops[m]=null;let _=await T(E,V);if(cr(_))return _;if(!(m in C.ops))return[null,{status:204,statusText:"No Content"}];let oe=await _.perform();return!(m in C.ops)&&((0,et.isAsyncGenerator)(oe)&&oe.return(void 0),!(m in C.ops))?[null,{status:204,statusText:"No Content"}]:((0,et.isAsyncIterable)(oe)&&(C.ops[m]=oe),C.from(_.ctx,E,oe,m),[null,{status:202,statusText:"Accepted"}])}}Pr.createHandler=V_;async function Kd(e){var t,r,n;let i={};try{switch(!0){case e.method==="GET":{try{let[,s]=e.url.split("?"),a=new URLSearchParams(s);i.operationName=(t=a.get("operationName"))!==null&&t!==void 0?t:void 0,i.query=(r=a.get("query"))!==null&&r!==void 0?r:void 0;let o=a.get("variables");o&&(i.variables=JSON.parse(o));let u=a.get("extensions");u&&(i.extensions=JSON.parse(u))}catch{throw new Error("Unparsable URL")}break}case(e.method==="POST"&&((n=e.headers.get("content-type"))===null||n===void 0?void 0:n.includes("application/json"))):{if(!e.body)throw new Error("Missing body");let s=typeof e.body=="function"?await e.body():e.body,a=typeof s=="string"?JSON.parse(s):s;if(!(0,$d.isObject)(a))throw new Error("JSON body must be an object");i.operationName=a.operationName,i.query=a.query,i.variables=a.variables,i.extensions=a.extensions;break}default:return[null,{status:415,statusText:"Unsupported Media Type"}]}if(i.query==null)throw new Error("Missing query");if(typeof i.query!="string")throw new Error("Invalid query");if(i.variables!=null&&(typeof i.variables!="object"||Array.isArray(i.variables)))throw new Error("Invalid variables");if(i.extensions!=null&&(typeof i.extensions!="object"||Array.isArray(i.extensions)))throw new Error("Invalid extensions");return i}catch(s){return[JSON.stringify({errors:[s instanceof Error?{message:s.message}:s]}),{status:400,statusText:"Bad Request",headers:{"content-type":"application/json; charset=utf-8"}}]}}function cr(e){return Array.isArray(e)}function Bd(e){return(0,$d.isObject)(e)&&("data"in e||"data"in e&&e.data==null&&"errors"in e)}Pr.isExecutionResult=Bd});var Xd=h(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.createParser=void 0;var Jd=dr(),lr;(function(e){e[e.NewLine=10]="NewLine",e[e.CchunkiageReturn=13]="CchunkiageReturn",e[e.Space=32]="Space",e[e.Colon=58]="Colon"})(lr||(lr={}));function M_(){let e,t,r,n=!1,i={event:"",data:""},s=[],a=new TextDecoder;return function(u){if(e===void 0)e=u,t=0,r=-1;else{let f=new Uint8Array(e.length+u.length);f.set(e),f.set(u,e.length),e=f}let c=e.length,l=0;for(;t0){let d=e.subarray(l,f),y=a.decode(d.subarray(0,r)),T=r+(d[r+1]===lr.Space?2:1),I=a.decode(d.subarray(T));switch(y){case"event":i.event=I;break;case"data":i.data=i.data?i.data+` +`+I:I;break}}l=t,r=-1}if(l===c){e=void 0;let f=[...s];return s=[],f}else l!==0&&(e=e.subarray(l),t-=l)}}Wi.createParser=M_});var zd=h(lt=>{"use strict";var G_=lt&<.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),C_=lt&<.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&G_(t,e,r)};Object.defineProperty(lt,"__esModule",{value:!0});lt.NetworkError=lt.createClient=void 0;var Q_=Xd(),U_=Pn(),K_=dr();C_(dr(),lt);function $_(e){let{singleConnection:t=!1,lazy:r=!0,lazyCloseTimeout:n=0,onNonLazyError:i=console.error,generateID:s=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,V=>{let m=Math.random()*16|0;return(V=="x"?m:m&3|8).toString(16)})},retryAttempts:a=5,retry:o=async function(V){let m=1e3;for(let _=0;_setTimeout(_,m+Math.floor(Math.random()*2700+300)))},credentials:u="same-origin",referrer:c,referrerPolicy:l,onMessage:f,on:d}=e,y=e.fetchFn||fetch,T=e.abortControllerImpl||AbortController,I=(()=>{let w=!1,V=[];return{get disposed(){return w},onDispose(m){return w?(setTimeout(()=>m(),0),()=>{}):(V.push(m),()=>{V.splice(V.indexOf(m),1)})},dispose(){if(!w){w=!0;for(let m of[...V])m()}}}})(),E,L,F=0,k=null,P=0;async function G(){try{if(I.disposed)throw new Error("Client has been disposed");return await(L??(L=(async()=>{var w,V,m;if(k){if(await o(P),E.signal.aborted)throw new Error("Connection aborted by the client");P++}(w=d?.connecting)===null||w===void 0||w.call(d,!!k),E=new T;let _=I.onDispose(()=>E.abort());E.signal.addEventListener("abort",()=>{_(),L=void 0});let oe=typeof e.url=="function"?await e.url():e.url;if(E.signal.aborted)throw new Error("Connection aborted by the client");let $=typeof e.headers=="function"?await e.headers():(V=e.headers)!==null&&V!==void 0?V:{};if(E.signal.aborted)throw new Error("Connection aborted by the client");let X;try{X=await y(oe,{signal:E.signal,method:"PUT",credentials:u,referrer:c,referrerPolicy:l,headers:$})}catch(Ie){throw new qe(Ie)}if(X.status!==201)throw new qe(X);let ye=await X.text();$[K_.TOKEN_HEADER_KEY]=ye;let Te=await Hd({signal:E.signal,headers:$,credentials:u,referrer:c,referrerPolicy:l,url:oe,fetchFn:y,onMessage:Ie=>{var Le;(Le=d?.message)===null||Le===void 0||Le.call(d,Ie),f?.(Ie)}});return(m=d?.connected)===null||m===void 0||m.call(d,!!k),Te.waitForThrow().catch(()=>L=void 0),Te})()))}catch(w){throw L=void 0,w}}t&&!r&&(async()=>{for(F++;;)try{let{waitForThrow:w}=await G();await w()}catch(w){if(I.disposed)return;if(!(w instanceof qe)||(L=void 0,!a||P>=a))return i?.(w);k=w}})();function C(w,V,m){if(!t){let $=new T,X=I.onDispose(()=>{X(),$.abort()});return(async()=>{var ye,Te,Ie,Le,xe;let Ae=null,Nt=0;for(;;)try{if(Ae){if(await o(Nt),$.signal.aborted)throw new Error("Connection aborted by the client");Nt++}(ye=d?.connecting)===null||ye===void 0||ye.call(d,!!Ae),(Te=m?.connecting)===null||Te===void 0||Te.call(m,!!Ae);let jt=typeof e.url=="function"?await e.url():e.url;if($.signal.aborted)throw new Error("Connection aborted by the client");let v=typeof e.headers=="function"?await e.headers():(Ie=e.headers)!==null&&Ie!==void 0?Ie:{};if($.signal.aborted)throw new Error("Connection aborted by the client");let{getResults:S}=await Hd({signal:$.signal,headers:{...v,"content-type":"application/json; charset=utf-8"},credentials:u,referrer:c,referrerPolicy:l,url:jt,body:JSON.stringify(w),fetchFn:y,onMessage:N=>{var D,ie;(D=d?.message)===null||D===void 0||D.call(d,N),(ie=m?.message)===null||ie===void 0||ie.call(m,N),f?.(N)}});(Le=d?.connected)===null||Le===void 0||Le.call(d,!!Ae),(xe=m?.connected)===null||xe===void 0||xe.call(m,!!Ae);for await(let N of S())Ae=null,Nt=0,V.next(N);return $.abort()}catch(jt){if($.signal.aborted)return;if(!(jt instanceof qe)||!a||Nt>=a)throw jt;Ae=jt}})().then(()=>V.complete()).catch(ye=>V.error(ye)),()=>$.abort()}F++;let _=new T,oe=I.onDispose(()=>{oe(),_.abort()});return(async()=>{let $=s();w={...w,extensions:{...w.extensions,operationId:$}};let X=null;for(;;){X=null;try{let{url:ye,headers:Te,getResults:Ie}=await G(),Le;try{Le=await y(ye,{signal:_.signal,method:"POST",credentials:u,referrer:c,referrerPolicy:l,headers:{...Te,"content-type":"application/json; charset=utf-8"},body:JSON.stringify(w)})}catch(xe){throw new qe(xe)}if(Le.status!==202)throw new qe(Le);X=async()=>{let xe;try{let Ae=new T,Nt=I.onDispose(()=>{Nt(),Ae.abort()});xe=await y(ye+"?operationId="+$,{signal:Ae.signal,method:"DELETE",credentials:u,referrer:c,referrerPolicy:l,headers:Te})}catch(Ae){throw new qe(Ae)}if(xe.status!==200)throw new qe(xe)};for await(let xe of Ie({signal:_.signal,operationId:$}))k=null,P=0,V.next(xe);return X=null,_.abort()}catch(ye){if(_.signal.aborted)return await X?.();if(!(ye instanceof qe)||(r&&(L=void 0),!a||P>=a))throw _.abort(),ye;k=ye}finally{_.signal.aborted&&--F===0&&(isFinite(n)&&n>0?setTimeout(()=>{F||E.abort()},n):E.abort())}}})().then(()=>V.complete()).catch($=>V.error($)),()=>_.abort()}return{subscribe:C,iterate(w,V){let m=[],_={done:!1,error:null,resolve:()=>{}},oe=C(w,{next(X){m.push(X),_.resolve()},error(X){_.done=!0,_.error=X,_.resolve()},complete(){_.done=!0,_.resolve()}},V),$=async function*(){for(;;){for(m.length||await new Promise(ye=>_.resolve=ye);m.length;)yield m.shift();if(_.error)throw _.error;if(_.done)return}}();return $.throw=async X=>(_.done||(_.done=!0,_.error=X,_.resolve()),{done:!0,value:void 0}),$.return=async()=>(oe(),{done:!0,value:void 0}),$},dispose(){I.dispose()}}}lt.createClient=$_;var qe=class extends Error{constructor(t){let r,n;B_(t)?(n=t,r="Server responded with "+t.status+": "+t.statusText):t instanceof Error?r=t.message:r=String(t),super(r),this.name=this.constructor.name,this.response=n}};lt.NetworkError=qe;function B_(e){return(0,U_.isObject)(e)&&typeof e.ok=="boolean"&&typeof e.status=="number"&&typeof e.statusText=="string"}async function Hd(e){let{signal:t,url:r,credentials:n,headers:i,body:s,referrer:a,referrerPolicy:o,fetchFn:u,onMessage:c}=e,l={},f={},d;try{d=await u(r,{signal:t,method:s?"POST":"GET",credentials:n,referrer:a,referrerPolicy:o,headers:{...i,accept:"text/event-stream"},body:s})}catch(I){throw new qe(I)}if(!d.ok)throw new qe(d);if(!d.body)throw new Error("Missing response body");let y=null,T;return(async()=>{var I;try{let E=(0,Q_.createParser)();for await(let L of Y_(d.body)){if(typeof L=="string")throw y=new Error(`Unexpected string chunk "${L}"`);let F;try{F=E(L)}catch(k){throw y=k}if(F)for(let k of F){try{c?.(k)}catch(G){throw y=G}let P=k.data&&"id"in k.data?k.data.id:"";switch(P in f||(f[P]=[]),k.event){case"next":P?f[P].push(k.data.payload):f[P].push(k.data);break;case"complete":f[P].push("complete");break;default:throw y=new Error(`Unexpected message event "${k.event}"`)}(I=l[P])===null||I===void 0||I.proceed()}}if(Object.keys(l).length)throw new Error("Connection closed while having active streams")}catch(E){!y&&Object.keys(l).length?y=new qe(E):y=E,T?.(y)}finally{Object.values(l).forEach(({proceed:E})=>E())}})(),{url:r,headers:i,waitForThrow:()=>new Promise((I,E)=>{if(y)return E(y);T=E}),async*getResults(I){var E;let{signal:L,operationId:F=""}=I??{};try{for(;;){for(;!((E=f[F])===null||E===void 0)&&E.length;){let k=f[F].shift();if(k==="complete")return;yield k}if(y)throw y;if(L?.aborted)throw new Error("Getting results aborted by the client");await new Promise(k=>{let P=()=>{L?.removeEventListener("abort",P),delete l[F],k()};L?.addEventListener("abort",P),l[F]={proceed:P}})}}finally{delete f[F]}}}}function Y_(e){return typeof Object(e)[Symbol.asyncIterator]=="function"?(e=e,e[Symbol.asyncIterator]()):async function*(){let t=e.getReader(),r;do r=await t.read(),r.value!==void 0&&(yield r.value);while(!r.done)}()}});var Wd=h(Rt=>{"use strict";var J_=Rt&&Rt.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Mu=Rt&&Rt.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&J_(t,e,r)};Object.defineProperty(Rt,"__esModule",{value:!0});Mu(dr(),Rt);Mu(Yd(),Rt);Mu(zd(),Rt)});var z_=h(Zi=>{Object.defineProperty(Zi,"__esModule",{value:!0});Zi.createAsyncIterable=void 0;var X_=Wd();async function H_(){let e="http://127.0.0.1:4200/graphql/stream";return console.log("using url",e),(0,X_.createClient)({url:e}).iterate({query:"subscription { greetings }"})}Zi.createAsyncIterable=H_});return z_();})(); +return z.createAsyncIterable(); diff --git a/e2e_test/udf/sse/server/Cargo.lock b/e2e_test/udf/sse/server/Cargo.lock new file mode 100644 index 0000000000000..4e2b4ea74d1fa --- /dev/null +++ b/e2e_test/udf/sse/server/Cargo.lock @@ -0,0 +1,953 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "async-trait" +version = "0.1.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "461abc97219de0eaaf81fe3ef974a540158f3d079c2ab200f891f1a2ef201e85" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "axum" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +dependencies = [ + "async-trait", + "axum-core", + "bitflags", + "bytes", + "futures-util", + "headers", + "http", + "http-body", + "hyper", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "mime", + "rustversion", + "tower-layer", + "tower-service", +] + +[[package]] +name = "backtrace" +version = "0.3.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bytes" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" + +[[package]] +name = "cc" +version = "1.0.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "headers" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" +dependencies = [ + "base64", + "bytes", + "headers-core", + "http", + "httpdate", + "mime", + "sha1", +] + +[[package]] +name = "headers-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" +dependencies = [ + "http", +] + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.48.5", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "proc-macro2" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "ryu" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "serde" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +dependencies = [ + "itoa", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "socket2" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "sse-server" +version = "0.1.0" +dependencies = [ + "axum", + "futures", + "hyper", + "serde_json", + "tokio", +] + +[[package]] +name = "syn" +version = "2.0.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "tokio" +version = "1.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.4", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +dependencies = [ + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" diff --git a/e2e_test/udf/sse/server/Cargo.toml b/e2e_test/udf/sse/server/Cargo.toml new file mode 100644 index 0000000000000..a91cc5e11e19c --- /dev/null +++ b/e2e_test/udf/sse/server/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "sse-server" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +axum = { version = "0.6.2", features = ["headers", "json", "original-uri"] } +futures = "0.3.24" +hyper = { version = "0.14", features = ["client"] } +serde_json = "1" +tokio = { version = "1", features = ["full"] } diff --git a/e2e_test/udf/sse/server/src/main.rs b/e2e_test/udf/sse/server/src/main.rs new file mode 100644 index 0000000000000..605b91f8d185e --- /dev/null +++ b/e2e_test/udf/sse/server/src/main.rs @@ -0,0 +1,60 @@ +use std::convert::Infallible; + +use axum::{http, response::sse::Event}; +use futures::StreamExt; + +async fn sse_handle( + request: http::Request, +) -> axum::response::Sse>> { + let (parts, body) = request.into_parts(); + let body_bytes = hyper::body::to_bytes(body).await.unwrap(); + + let accept = parts + .headers + .get(http::header::ACCEPT) + .unwrap() + .to_str() + .unwrap(); + + assert_eq!(accept, "text/event-stream"); + + let payload: serde_json::Value = serde_json::from_slice(&body_bytes).unwrap(); + + assert!(serde_json::to_string(&payload) + .expect("should be a valid json") + .contains("subscription"),); + + let stream = futures::stream::iter(vec!["Hi", "Bonjour", "Hola", "Ciao", "Zdravo"]) + .map(|name| { + let response = serde_json::json!({ + "data": { + "greetings": name + } + }); + + Event::default() + .event("next") + .data(serde_json::to_string(&response).unwrap()) + }) + .chain(futures::stream::once(futures::future::ready( + Event::default().event("complete"), + ))) + .map(Ok); + + axum::response::Sse::new(stream) +} + +#[tokio::main] +async fn main() { + let router = axum::Router::new().route("/graphql/stream", axum::routing::post(sse_handle)); + + let listener = std::net::TcpListener::bind("127.0.0.1:4200").unwrap(); + + let socket_addr = listener.local_addr().unwrap(); + + + let server = hyper::Server::from_tcp(listener) + .unwrap() + .serve(router.into_make_service()); + server.await.unwrap(); +} diff --git a/proto/catalog.proto b/proto/catalog.proto index 9d342e033f7e3..0188023a0d057 100644 --- a/proto/catalog.proto +++ b/proto/catalog.proto @@ -246,8 +246,8 @@ message Function { // The zstd-compressed binary of the function. optional bytes compressed_binary = 17; bool always_retry_on_network_error = 16; - optional string param_name = 18; - optional string param_value = 19; + optional string runtime = 18; + optional string function_type = 19; oneof kind { ScalarFunction scalar = 11; diff --git a/proto/expr.proto b/proto/expr.proto index 009ac3adc0933..519d1d895b48e 100644 --- a/proto/expr.proto +++ b/proto/expr.proto @@ -538,8 +538,8 @@ message UserDefinedFunction { optional bytes compressed_binary = 10; bool always_retry_on_network_error = 9; - optional string param_name = 11; - optional string param_value = 12; + optional string runtime = 11; + optional string function_type = 12; } // Additional information for user defined table functions. @@ -551,6 +551,6 @@ message UserDefinedTableFunction { optional string identifier = 6; optional string body = 7; optional bytes compressed_binary = 10; - optional string param_name = 11; - optional string param_value = 12; + optional string runtime = 11; + optional string function_type = 12; } diff --git a/src/cmd_all/Cargo.toml b/src/cmd_all/Cargo.toml index f12f98d2492b2..5e41f643069bb 100644 --- a/src/cmd_all/Cargo.toml +++ b/src/cmd_all/Cargo.toml @@ -12,6 +12,7 @@ rw-static-link = ["workspace-config/rw-static-link"] rw-dynamic-link = ["workspace-config/rw-dynamic-link"] embedded-deno-udf = ["risingwave_expr/embedded-deno-udf"] embedded-python-udf = ["risingwave_expr/embedded-python-udf"] +# FIXME: Remove the deno udf feature before merging the PR default = ["embedded-deno-udf", "rw-static-link"] [package.metadata.cargo-machete] diff --git a/src/expr/core/src/expr/expr_udf.rs b/src/expr/core/src/expr/expr_udf.rs index a65b7162ceb66..65509b2f95894 100644 --- a/src/expr/core/src/expr/expr_udf.rs +++ b/src/expr/core/src/expr/expr_udf.rs @@ -131,11 +131,11 @@ impl UserDefinedFunction { }; let language = match &self.imp { UdfImpl::Wasm(_) => "wasm", - UdfImpl::JavaScript(_) => "javascript", + UdfImpl::JavaScript(_) => "javascript(quickjs)", #[cfg(feature = "embedded-python-udf")] UdfImpl::Python(_) => "python", #[cfg(feature = "embedded-deno-udf")] - UdfImpl::Deno(_) => "deno", + UdfImpl::Deno(_) => "javascript(deno)", UdfImpl::External(_) => "external", }; let labels: &[&str; 4] = &[addr, language, &self.identifier, fragment_id.as_str()]; @@ -250,6 +250,15 @@ impl Build for UserDefinedFunction { let return_type = DataType::from(prost.get_return_type().unwrap()); let udf = prost.get_rex_node().unwrap().as_udf().unwrap(); + #[cfg(not(feature = "embedded-deno-udf"))] + let runtime = "quickjs"; + + #[cfg(feature = "embedded-deno-udf")] + let runtime = match udf.runtime.as_deref() { + Some("deno") => "deno", + _ => "quickjs", + }; + let identifier = udf.get_identifier()?; let imp = match udf.language.as_str() { #[cfg(not(madsim))] @@ -260,7 +269,7 @@ impl Build for UserDefinedFunction { let runtime = get_or_create_wasm_runtime(&wasm_binary)?; UdfImpl::Wasm(runtime) } - "javascript" => { + "javascript" if runtime != "deno" => { let mut rt = JsRuntime::new()?; let body = format!( "export function {}({}) {{ {} }}", @@ -276,20 +285,8 @@ impl Build for UserDefinedFunction { )?; UdfImpl::JavaScript(rt) } - #[cfg(feature = "embedded-python-udf")] - "python" if udf.body.is_some() => { - let mut rt = PythonRuntime::builder().sandboxed(true).build()?; - let body = udf.get_body()?; - rt.add_function( - identifier, - arrow_schema::DataType::try_from(&return_type)?, - PythonCallMode::CalledOnNullInput, - body, - )?; - UdfImpl::Python(rt) - } #[cfg(feature = "embedded-deno-udf")] - "deno" if udf.body.is_some() => { + "javascript" if runtime == "deno" => { let rt = DenoRuntime::new(); let body = match udf.get_body() { Ok(body) => body.clone(), @@ -305,16 +302,7 @@ impl Build for UserDefinedFunction { }, }; - let is_async = if let (Ok(name), Ok(ty)) = ( - udf.get_param_name().map(|s| s.as_str()), - udf.get_param_value().map(|s| s.as_str()), - ) { - "function_type" == name && "async" == ty - } else { - false - }; - - let body = if is_async { + let body = if matches!(udf.function_type.as_deref(), Some("async")) { format!( "export async function {}({}) {{ {} }}", identifier, @@ -339,6 +327,18 @@ impl Build for UserDefinedFunction { UdfImpl::Deno(rt) } + #[cfg(feature = "embedded-python-udf")] + "python" if udf.body.is_some() => { + let mut rt = PythonRuntime::builder().sandboxed(true).build()?; + let body = udf.get_body()?; + rt.add_function( + identifier, + arrow_schema::DataType::try_from(&return_type)?, + PythonCallMode::CalledOnNullInput, + body, + )?; + UdfImpl::Python(rt) + } #[cfg(not(madsim))] _ => { let link = udf.get_link()?; diff --git a/src/expr/core/src/table_function/user_defined.rs b/src/expr/core/src/table_function/user_defined.rs index eb86255ebebe4..13d3dc5bedc65 100644 --- a/src/expr/core/src/table_function/user_defined.rs +++ b/src/expr/core/src/table_function/user_defined.rs @@ -197,6 +197,15 @@ pub fn new_user_defined(prost: &PbTableFunction, chunk_size: usize) -> Result "deno", + _ => "quickjs", + }; + let client = match udtf.language.as_str() { "wasm" | "rust" => { let compressed_wasm_binary = udtf.get_compressed_binary()?; @@ -205,7 +214,7 @@ pub fn new_user_defined(prost: &PbTableFunction, chunk_size: usize) -> Result { + "javascript" if runtime != "deno" => { let mut rt = JsRuntime::new()?; let body = format!( "export function* {}({}) {{ {} }}", @@ -221,20 +230,8 @@ pub fn new_user_defined(prost: &PbTableFunction, chunk_size: usize) -> Result { - let mut rt = PythonRuntime::builder().sandboxed(true).build()?; - let body = udtf.get_body()?; - rt.add_function( - identifier, - arrow_schema::DataType::try_from(&return_type)?, - PythonCallMode::CalledOnNullInput, - body, - )?; - UdfImpl::Python(rt) - } #[cfg(feature = "embedded-deno-udf")] - "deno" => { + "javascript" if runtime == "deno" => { let rt = DenoRuntime::new(); let body = match udtf.get_body() { Ok(body) => body.clone(), @@ -250,21 +247,8 @@ pub fn new_user_defined(prost: &PbTableFunction, chunk_size: usize) -> Result { + let body = match udtf.function_type.as_deref() { + Some("async") => { format!( "export async function {}({}) {{ {} }}", identifier, @@ -272,7 +256,7 @@ pub fn new_user_defined(prost: &PbTableFunction, chunk_size: usize) -> Result { + Some("async_generator") => { format!( "export async function* {}({}) {{ {} }}", identifier, @@ -280,9 +264,9 @@ pub fn new_user_defined(prost: &PbTableFunction, chunk_size: usize) -> Result { + Some("sync") => { format!( - "export function* {}({}) {{ {} }}", + "export function {}({}) {{ {} }}", identifier, udtf.arg_names.join(","), body @@ -290,7 +274,7 @@ pub fn new_user_defined(prost: &PbTableFunction, chunk_size: usize) -> Result { format!( - "export function {}({}) {{ {} }}", + "export function* {}({}) {{ {} }}", identifier, udtf.arg_names.join(","), body @@ -306,6 +290,18 @@ pub fn new_user_defined(prost: &PbTableFunction, chunk_size: usize) -> Result { + let mut rt = PythonRuntime::builder().sandboxed(true).build()?; + let body = udtf.get_body()?; + rt.add_function( + identifier, + arrow_schema::DataType::try_from(&return_type)?, + PythonCallMode::CalledOnNullInput, + body, + )?; + UdfImpl::Python(rt) + } // connect to UDF service _ => { let link = udtf.get_link()?; diff --git a/src/frontend/src/catalog/function_catalog.rs b/src/frontend/src/catalog/function_catalog.rs index 873bb744079bb..1a0e01db1b92a 100644 --- a/src/frontend/src/catalog/function_catalog.rs +++ b/src/frontend/src/catalog/function_catalog.rs @@ -35,8 +35,8 @@ pub struct FunctionCatalog { pub link: Option, pub compressed_binary: Option>, pub always_retry_on_network_error: bool, - pub param_name: Option, - pub param_value: Option, + pub function_type: Option, + pub runtime: Option, } #[derive(Clone, Display, PartialEq, Eq, Hash, Debug)] @@ -74,8 +74,8 @@ impl From<&PbFunction> for FunctionCatalog { link: prost.link.clone(), compressed_binary: prost.compressed_binary.clone(), always_retry_on_network_error: prost.always_retry_on_network_error, - param_name: prost.param_name.clone(), - param_value: prost.param_value.clone(), + function_type: prost.function_type.clone(), + runtime: prost.runtime.clone(), } } } diff --git a/src/frontend/src/expr/table_function.rs b/src/frontend/src/expr/table_function.rs index 332be13ce4875..4703112bc16d3 100644 --- a/src/frontend/src/expr/table_function.rs +++ b/src/frontend/src/expr/table_function.rs @@ -80,8 +80,8 @@ impl TableFunction { identifier: c.identifier.clone(), body: c.body.clone(), compressed_binary: c.compressed_binary.clone(), - param_name: c.param_name.clone(), - param_value: c.param_value.clone(), + function_type: c.function_type.clone(), + runtime: c.runtime.clone(), }), } } diff --git a/src/frontend/src/expr/user_defined_function.rs b/src/frontend/src/expr/user_defined_function.rs index 1ed1e847832d2..44abfa1859c42 100644 --- a/src/frontend/src/expr/user_defined_function.rs +++ b/src/frontend/src/expr/user_defined_function.rs @@ -60,8 +60,8 @@ impl UserDefinedFunction { link: udf.link.clone(), compressed_binary: udf.compressed_binary.clone(), always_retry_on_network_error: udf.always_retry_on_network_error, - param_name: udf.param_name.clone(), - param_value: udf.param_value.clone(), + function_type: udf.function_type.clone(), + runtime: udf.runtime.clone(), }; Ok(Self { @@ -98,8 +98,8 @@ impl Expr for UserDefinedFunction { body: self.catalog.body.clone(), compressed_binary: self.catalog.compressed_binary.clone(), always_retry_on_network_error: self.catalog.always_retry_on_network_error, - param_name: self.catalog.param_name.clone(), - param_value: self.catalog.param_value.clone(), + function_type: self.catalog.function_type.clone(), + runtime: self.catalog.runtime.clone(), })), } } diff --git a/src/frontend/src/handler/create_function.rs b/src/frontend/src/handler/create_function.rs index 7ab25ba579b68..410ed50d34251 100644 --- a/src/frontend/src/handler/create_function.rs +++ b/src/frontend/src/handler/create_function.rs @@ -50,7 +50,7 @@ pub async fn handle_create_function( Some(lang) => { let lang = lang.real_value().to_lowercase(); match &*lang { - "python" | "java" | "wasm" | "rust" | "javascript" | "deno" => lang, + "python" | "java" | "wasm" | "rust" | "javascript" => lang, _ => { return Err(ErrorCode::InvalidParameterValue(format!( "language {} is not supported", @@ -64,6 +64,21 @@ pub async fn handle_create_function( // correct protocol. None => "".to_string(), }; + + let rt = match params.runtime { + Some(runtime) => { + if language.as_str() == "javascript" { + runtime.to_string() + } else { + return Err(ErrorCode::InvalidParameterValue( + "runtime is only supported for javascript".to_string(), + ) + .into()); + } + } + None => "".to_string(), + }; + let return_type; let kind = match returns { Some(CreateFunctionReturns::Value(data_type)) => { @@ -122,8 +137,8 @@ pub async fn handle_create_function( let mut link = None; let mut body = None; let mut compressed_binary = None; - let mut param_name = None; - let mut param_value = None; + let mut function_type = None; + let mut runtime = None; match language.as_str() { "python" if params.using.is_none() => { @@ -179,7 +194,7 @@ pub async fn handle_create_function( } link = Some(l); } - "javascript" => { + "javascript" if rt.as_str() != "deno" => { identifier = function_name.to_string(); body = Some( params @@ -187,8 +202,9 @@ pub async fn handle_create_function( .ok_or_else(|| ErrorCode::InvalidParameterValue("AS must be specified".into()))? .into_string(), ); + runtime = Some("quickjs".to_string()); } - "deno" => { + "javascript" if rt.as_str() == "deno" => { identifier = function_name.to_string(); match (params.using, params.as_) { (None, None) => { @@ -217,11 +233,15 @@ pub async fn handle_create_function( } }; - param_name = params.param.as_ref().map(|_| "function_type".to_string()); - param_value = params.param.map(|p| { - let CreateFunctionParamType::FunctionType(f) = p; - f.to_string() - }); + function_type = match params.function_type { + Some(CreateFunctionType::Sync) => Some("sync".to_string()), + Some(CreateFunctionType::Async) => Some("async".to_string()), + Some(CreateFunctionType::Generator) => Some("generator".to_string()), + Some(CreateFunctionType::AsyncGenerator) => Some("async_generator".to_string()), + None => None, + }; + + runtime = Some("deno".to_string()); } "rust" => { if params.using.is_some() { @@ -319,8 +339,8 @@ pub async fn handle_create_function( always_retry_on_network_error: with_options .always_retry_on_network_error .unwrap_or_default(), - param_name, - param_value, + runtime, + function_type, }; let catalog_writer = session.catalog_writer()?; diff --git a/src/frontend/src/handler/create_sql_function.rs b/src/frontend/src/handler/create_sql_function.rs index 068c0afd9c3c8..ae7b2730e25d5 100644 --- a/src/frontend/src/handler/create_sql_function.rs +++ b/src/frontend/src/handler/create_sql_function.rs @@ -344,8 +344,8 @@ pub async fn handle_create_sql_function( link: None, owner: session.user_id(), always_retry_on_network_error: false, - param_name: None, - param_value: None, + runtime: None, + function_type: None, }; let catalog_writer = session.catalog_writer()?; diff --git a/src/meta/model_v2/migration/src/m20230908_072257_init.rs b/src/meta/model_v2/migration/src/m20230908_072257_init.rs index c1f9ed46bf1e2..ecdd8ccb75931 100644 --- a/src/meta/model_v2/migration/src/m20230908_072257_init.rs +++ b/src/meta/model_v2/migration/src/m20230908_072257_init.rs @@ -780,8 +780,8 @@ impl MigrationTrait for Migration { .boolean() .not_null(), ) - .col(ColumnDef::new(Function::ParamName).string()) - .col(ColumnDef::new(Function::ParamValue).string()) + .col(ColumnDef::new(Function::Runtime).string()) + .col(ColumnDef::new(Function::FunctionType).string()) .foreign_key( &mut ForeignKey::create() .name("FK_function_object_id") @@ -1184,8 +1184,8 @@ enum Function { CompressedBinary, Kind, AlwaysRetryOnNetworkError, - ParamName, - ParamValue, + Runtime, + FunctionType, } #[derive(DeriveIden)] diff --git a/src/meta/model_v2/src/function.rs b/src/meta/model_v2/src/function.rs index 2f101e627cc93..b6a675c32f804 100644 --- a/src/meta/model_v2/src/function.rs +++ b/src/meta/model_v2/src/function.rs @@ -47,8 +47,8 @@ pub struct Model { pub compressed_binary: Option>, pub kind: FunctionKind, pub always_retry_on_network_error: bool, - pub param_name: Option, - pub param_value: Option, + pub runtime: Option, + pub function_type: Option, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] @@ -106,8 +106,8 @@ impl From for ActiveModel { compressed_binary: Set(function.compressed_binary), kind: Set(function.kind.unwrap().into()), always_retry_on_network_error: Set(function.always_retry_on_network_error), - param_name: Set(function.param_name), - param_value: Set(function.param_value), + runtime: Set(function.runtime), + function_type: Set(function.function_type), } } } diff --git a/src/meta/src/controller/mod.rs b/src/meta/src/controller/mod.rs index e1b64dd91613f..f0043bf2eff5e 100644 --- a/src/meta/src/controller/mod.rs +++ b/src/meta/src/controller/mod.rs @@ -315,8 +315,8 @@ impl From> for PbFunction { compressed_binary: value.0.compressed_binary, kind: Some(value.0.kind.into()), always_retry_on_network_error: value.0.always_retry_on_network_error, - param_name: value.0.param_name, - param_value: value.0.param_value, + runtime: value.0.runtime, + function_type: value.0.function_type, } } } diff --git a/src/sqlparser/src/ast/mod.rs b/src/sqlparser/src/ast/mod.rs index 12691dce7f3b7..ac55dcd15e77a 100644 --- a/src/sqlparser/src/ast/mod.rs +++ b/src/sqlparser/src/ast/mod.rs @@ -2737,6 +2737,9 @@ impl fmt::Display for TableColumnDef { pub struct CreateFunctionBody { /// LANGUAGE lang_name pub language: Option, + + pub runtime: Option, + /// IMMUTABLE | STABLE | VOLATILE pub behavior: Option, /// AS 'definition' @@ -2748,7 +2751,7 @@ pub struct CreateFunctionBody { /// USING ... pub using: Option, - pub param: Option, + pub function_type: Option, } impl fmt::Display for CreateFunctionBody { @@ -2756,6 +2759,11 @@ impl fmt::Display for CreateFunctionBody { if let Some(language) = &self.language { write!(f, " LANGUAGE {language}")?; } + + if let Some(runtime) = &self.runtime { + write!(f, " RUNTIME {runtime}")?; + } + if let Some(behavior) = &self.behavior { write!(f, " {behavior}")?; } @@ -2768,8 +2776,8 @@ impl fmt::Display for CreateFunctionBody { if let Some(using) = &self.using { write!(f, " {using}")?; } - if let Some(param) = &self.param { - write!(f, " {param}")?; + if let Some(function_type) = &self.function_type { + write!(f, " {function_type}")?; } Ok(()) } @@ -2845,6 +2853,22 @@ impl fmt::Display for CreateFunctionUsing { } } +#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +pub enum FunctionRuntime { + QuickJs, + Deno, +} + +impl fmt::Display for FunctionRuntime { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + FunctionRuntime::QuickJs => write!(f, "quickjs"), + FunctionRuntime::Deno => write!(f, "deno"), + } + } +} + #[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub enum CreateFunctionParamFunctionType { @@ -2867,17 +2891,20 @@ impl fmt::Display for CreateFunctionParamFunctionType { #[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] -pub enum CreateFunctionParamType { - FunctionType(CreateFunctionParamFunctionType), +pub enum CreateFunctionType { + Sync, + Async, + Generator, + AsyncGenerator, } -impl fmt::Display for CreateFunctionParamType { +impl fmt::Display for CreateFunctionType { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "SET ")?; match self { - CreateFunctionParamType::FunctionType(function_type) => { - write!(f, "function_type = '{function_type}'") - } + CreateFunctionType::Sync => write!(f, "SYNC"), + CreateFunctionType::Async => write!(f, "ASYNC"), + CreateFunctionType::Generator => write!(f, "SYNC GENERATOR"), + CreateFunctionType::AsyncGenerator => write!(f, "ASYNC GENERATOR"), } } } @@ -3101,7 +3128,8 @@ mod tests { as_: Some(FunctionDefinition::SingleQuotedDef("SELECT 1".to_string())), return_: None, using: None, - param: None, + runtime: None, + function_type: None, }, with_options: CreateFunctionWithOptions { always_retry_on_network_error: None, @@ -3123,7 +3151,8 @@ mod tests { as_: Some(FunctionDefinition::SingleQuotedDef("SELECT 1".to_string())), return_: None, using: None, - param: None, + runtime: None, + function_type: None, }, with_options: CreateFunctionWithOptions { always_retry_on_network_error: Some(true), @@ -3133,5 +3162,29 @@ mod tests { "CREATE FUNCTION foo(INT) RETURNS INT LANGUAGE python IMMUTABLE AS 'SELECT 1' WITH ( ALWAYS_RETRY_NETWORK_ERRORS = true )", format!("{}", create_function) ); + + let create_function = Statement::CreateFunction { + temporary: false, + or_replace: false, + name: ObjectName(vec![Ident::new_unchecked("foo")]), + args: Some(vec![OperateFunctionArg::unnamed(DataType::Int)]), + returns: Some(CreateFunctionReturns::Value(DataType::Int)), + params: CreateFunctionBody { + language: Some(Ident::new_unchecked("javascript")), + behavior: None, + as_: Some(FunctionDefinition::SingleQuotedDef("SELECT 1".to_string())), + return_: None, + using: None, + runtime: Some(FunctionRuntime::Deno), + function_type: Some(CreateFunctionType::AsyncGenerator), + }, + with_options: CreateFunctionWithOptions { + always_retry_on_network_error: None, + }, + }; + assert_eq!( + "CREATE FUNCTION foo(INT) RETURNS INT LANGUAGE javascript RUNTIME deno AS 'SELECT 1' ASYNC GENERATOR", + format!("{}", create_function) + ); } } diff --git a/src/sqlparser/src/keywords.rs b/src/sqlparser/src/keywords.rs index 4d99482558bcd..f9efe5230048e 100644 --- a/src/sqlparser/src/keywords.rs +++ b/src/sqlparser/src/keywords.rs @@ -89,6 +89,7 @@ define_keywords!( ASC, ASENSITIVE, ASYMMETRIC, + ASYNC, AT, ATOMIC, AUTHORIZATION, @@ -246,6 +247,7 @@ define_keywords!( FUNCTIONS, FUSION, GET, + GENERATOR, GLOBAL, GRANT, GRANTED, @@ -435,6 +437,7 @@ define_keywords!( ROWID, ROWS, ROW_NUMBER, + RUNTIME, SAVEPOINT, SCALAR, SCHEMA, diff --git a/src/sqlparser/src/parser.rs b/src/sqlparser/src/parser.rs index 2e36118aa9012..6f22070d1330a 100644 --- a/src/sqlparser/src/parser.rs +++ b/src/sqlparser/src/parser.rs @@ -2356,6 +2356,9 @@ impl Parser { } else if self.parse_keyword(Keyword::LANGUAGE) { ensure_not_set(&body.language, "LANGUAGE")?; body.language = Some(self.parse_identifier()?); + } else if self.parse_keyword(Keyword::RUNTIME) { + ensure_not_set(&body.runtime, "RUNTIME")?; + body.runtime = Some(self.parse_function_runtime()?); } else if self.parse_keyword(Keyword::IMMUTABLE) { ensure_not_set(&body.behavior, "IMMUTABLE | STABLE | VOLATILE")?; body.behavior = Some(FunctionBehavior::Immutable); @@ -2371,9 +2374,15 @@ impl Parser { } else if self.parse_keyword(Keyword::USING) { ensure_not_set(&body.using, "USING")?; body.using = Some(self.parse_create_function_using()?); - } else if self.parse_keyword(Keyword::SET) { - ensure_not_set(&body.param, "SET")?; - body.param = Some(self.parse_create_function_param()?); + } else if self.parse_keyword(Keyword::SYNC) { + ensure_not_set(&body.function_type, "SYNC | ASYNC")?; + body.function_type = Some(self.parse_function_type(false, false)?); + } else if self.parse_keyword(Keyword::ASYNC) { + ensure_not_set(&body.function_type, "SYNC | ASYNC")?; + body.function_type = Some(self.parse_function_type(true, false)?); + } else if self.parse_keyword(Keyword::GENERATOR) { + ensure_not_set(&body.function_type, "SYNC | ASYNC")?; + body.function_type = Some(self.parse_function_type(false, true)?); } else { return Ok(body); } @@ -2396,45 +2405,33 @@ impl Parser { } } - fn parse_create_function_param(&mut self) -> Result { - let variable = self.parse_identifier()?; - if variable.value.to_lowercase() != "function_type" { - return Err(ParserError::ParserError(format!( - "SET {} is not supported", - variable.value - ))); + fn parse_function_runtime(&mut self) -> Result { + let ident = self.parse_identifier()?; + match ident.value.to_lowercase().as_str() { + "deno" => Ok(FunctionRuntime::Deno), + "quickjs" => Ok(FunctionRuntime::QuickJs), + r => Err(ParserError::ParserError(format!( + "Unsupported runtime: {r}" + ))), } + } - if self.consume_token(&Token::Eq) || self.parse_keyword(Keyword::TO) { - let value = self.parse_set_variable()?; - match value { - SetVariableValue::Single(s) => { - match s.to_string_unquoted().to_lowercase().as_str() { - "normal" => Ok(CreateFunctionParamType::FunctionType( - CreateFunctionParamFunctionType::Normal, - )), - "async" => Ok(CreateFunctionParamType::FunctionType( - CreateFunctionParamFunctionType::Async, - )), - "generator" => Ok(CreateFunctionParamType::FunctionType( - CreateFunctionParamFunctionType::Generator, - )), - "async_generator" => Ok(CreateFunctionParamType::FunctionType( - CreateFunctionParamFunctionType::AsyncGenerator, - )), - v => Err(ParserError::ParserError(format!( - "SET FUNCTION_TYPE to {} is not supported", - v - ))), - } - } - SetVariableValue::List(_) => self.expected("only one value set", self.peek_token()), - SetVariableValue::Default => Ok(CreateFunctionParamType::FunctionType( - CreateFunctionParamFunctionType::Normal, - )), - } + fn parse_function_type( + &mut self, + is_async: bool, + is_generator: bool, + ) -> Result { + let is_generator = if is_generator { + true } else { - self.expected("equals sign or TO", self.peek_token()) + self.parse_keyword(Keyword::GENERATOR) + }; + + match (is_async, is_generator) { + (false, false) => Ok(CreateFunctionType::Sync), + (true, false) => Ok(CreateFunctionType::Async), + (false, true) => Ok(CreateFunctionType::Generator), + (true, true) => Ok(CreateFunctionType::AsyncGenerator), } } diff --git a/src/sqlparser/tests/sqlparser_postgres.rs b/src/sqlparser/tests/sqlparser_postgres.rs index bcc77a56d6c65..444b4368cf767 100644 --- a/src/sqlparser/tests/sqlparser_postgres.rs +++ b/src/sqlparser/tests/sqlparser_postgres.rs @@ -873,7 +873,7 @@ fn parse_create_function() { } ); - let sql = "CREATE FUNCTION add(INT, INT) RETURNS INT LANGUAGE SQL IMMUTABLE AS 'select $1 + $2;' SET function_type = 'async'"; + let sql = "CREATE FUNCTION add(INT, INT) RETURNS INT LANGUAGE SQL IMMUTABLE AS 'select $1 + $2;' ASYNC"; assert_eq!( verified_stmt(sql), Statement::CreateFunction { @@ -891,9 +891,7 @@ fn parse_create_function() { as_: Some(FunctionDefinition::SingleQuotedDef( "select $1 + $2;".into() )), - param: Some(CreateFunctionParamType::FunctionType( - CreateFunctionParamFunctionType::Async - )), + function_type: CreateFunctionType::Async, ..Default::default() }, with_options: Default::default(),