diff options
Diffstat (limited to '')
| -rw-r--r-- | vendor/deps.js | 190 |
1 files changed, 190 insertions, 0 deletions
diff --git a/vendor/deps.js b/vendor/deps.js new file mode 100644 index 0000000..22d7525 --- /dev/null +++ b/vendor/deps.js @@ -0,0 +1,190 @@ +// @ts-self-types="./deps.d.ts" +var Ef=Object.defineProperty;var Tf=(e)=>e;function yf(e,t){this[e]=Tf.bind(null,t)}var gf=(e,t)=>{for(var n in t)Ef(e,n,{get:t[n],enumerable:!0,configurable:!0,set:yf.bind(t,n)})};var C={};gf(C,{ARGUMENT:()=>ii,ARGUMENT_COORDINATE:()=>mo,BOOLEAN:()=>tt,DIRECTIVE:()=>oi,DIRECTIVE_ARGUMENT_COORDINATE:()=>Eo,DIRECTIVE_COORDINATE:()=>ho,DIRECTIVE_DEFINITION:()=>pt,DIRECTIVE_EXTENSION:()=>Tr,DOCUMENT:()=>jt,ENUM:()=>Ot,ENUM_TYPE_DEFINITION:()=>Yt,ENUM_TYPE_EXTENSION:()=>pn,ENUM_VALUE_DEFINITION:()=>lo,FIELD:()=>an,FIELD_DEFINITION:()=>co,FLOAT:()=>Bt,FRAGMENT_ARGUMENT:()=>uo,FRAGMENT_DEFINITION:()=>Qe,FRAGMENT_SPREAD:()=>Dt,INLINE_FRAGMENT:()=>_n,INPUT_OBJECT_TYPE_DEFINITION:()=>yt,INPUT_OBJECT_TYPE_EXTENSION:()=>Lt,INPUT_VALUE_DEFINITION:()=>ai,INT:()=>Oe,INTERFACE_TYPE_DEFINITION:()=>xt,INTERFACE_TYPE_EXTENSION:()=>Kt,LIST:()=>Ae,LIST_TYPE:()=>Dn,MEMBER_COORDINATE:()=>fo,NAME:()=>Ne,NAMED_TYPE:()=>Sn,NON_NULL_TYPE:()=>cn,NULL:()=>le,OBJECT:()=>Ve,OBJECT_FIELD:()=>un,OBJECT_TYPE_DEFINITION:()=>At,OBJECT_TYPE_EXTENSION:()=>qt,OPERATION_DEFINITION:()=>Tt,OPERATION_TYPE_DEFINITION:()=>si,SCALAR_TYPE_DEFINITION:()=>Qt,SCALAR_TYPE_EXTENSION:()=>ln,SCHEMA_DEFINITION:()=>Ye,SCHEMA_EXTENSION:()=>Rt,SELECTION_SET:()=>ao,STRING:()=>Ie,TYPE_COORDINATE:()=>po,UNION_TYPE_DEFINITION:()=>wt,UNION_TYPE_EXTENSION:()=>Jt,VARIABLE:()=>Ce,VARIABLE_DEFINITION:()=>ri});var Nf="17.0.2",ro=Object.freeze({major:17,minor:0,patch:2,preReleaseTag:null});function y(e){return io(e,[])}function io(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return If(e,t);default:return String(e)}}function If(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(vf(e)){let r=e.toJSON();if(r!==e)return typeof r==="string"?r:io(r,n)}else if(Array.isArray(e))return _f(e,n);return bf(e,n)}function vf(e){return typeof e.toJSON==="function"}function bf(e,t){let n=Object.entries(e);if(n.length===0)return"{}";if(t.length>2)return"["+Sf(e)+"]";return"{ "+n.map(([i,o])=>i+": "+io(o,t)).join(", ")+" }"}function _f(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),r=e.length-n,i=[];for(let o=0;o<n;++o)i.push(io(e[o],t));if(r===1)i.push("... 1 more item");else if(r>1)i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}function Sf(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor==="function"){let n=e.constructor.name;if(typeof n==="string"&&n!=="")return n}return t}function Df(e,t,n){if(e?.__kind===t)return!0;if(typeof e==="object"&&e!==null){let r=n.prototype[Symbol.toStringTag],i=Symbol.toStringTag in e?e[Symbol.toStringTag]:e.constructor?.name;if(r===i){let o=y(e);throw Error(`Cannot use ${r} "${o}" 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}function Of(e,t){return e?.__kind===t}var Le=Of;function Ru(){Le=Df}var Lu=!1;function Af(){Lu=!0,Ru()}function xf(){return Lu}function K(e){return e instanceof Promise}function Be(e){return typeof e?.then==="function"}function oo(e){return e instanceof Error?e:new ku(e)}class ku extends Error{constructor(e){super("Unexpected error value: "+y(e));this.name="NonErrorThrown",this.thrownValue=e}}function ye(e){return typeof e=="object"&&e!==null}function U(e,t){if(!e)throw Error(t??"Unexpected invariant triggered.")}var wf=/\r\n|[\n\r]/g;function Yn(e,t){let n=0,r=1;for(let i of e.body.matchAll(wf)){if(typeof i.index!=="number")U(!1);if(i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function so(e){return Zr(e.source,Yn(e.source,e.start))}function Zr(e,t){let n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,s=t.line+o,a=t.line===1?n:0,u=t.column+a,c=`${e.name}:${s}:${u} +`,l=r.split(/\r\n|[\n\r]/g),p=l[i];if(p.length>120){let f=Math.floor(u/80),d=u%80,E=[];for(let I=0;I<p.length;I+=80)E.push(p.slice(I,I+80));return c+Fu([[`${s} |`,E[0]],...E.slice(1,f+1).map((I)=>["|",I]),["|","^".padStart(d)],["|",E[f+1]]])}return c+Fu([[`${s-1} |`,l[i-1]],[`${s} |`,p],["|","^".padStart(u)],[`${s+1} |`,l[i+1]]])}function Fu(e){let t=e.filter(([r,i])=>i!==void 0),n=Math.max(...t.map(([r])=>r.length));return t.map(([r,i])=>r.padStart(n)+(i?" "+i:"")).join(` +`)}class m extends Error{constructor(e,t={}){let{nodes:n,source:r,positions:i,path:o,originalError:s,cause:a,extensions:u}=t,c="cause"in t,l=c?a:s,p=c||s!=null?{cause:l}:void 0;super(e,p);this.name="GraphQLError",this.path=o??void 0;let f=s??(a instanceof Error?a:void 0);this.originalError=f,this.nodes=Cu(Array.isArray(n)?n:n?[n]:void 0);let d=Cu(this.nodes?.map((I)=>I.loc).filter((I)=>I!=null));this.source=r??d?.[0]?.source,this.positions=i??d?.map((I)=>I.start),this.locations=i&&r?i.map((I)=>Yn(r,I)):d?.map((I)=>Yn(I.source,I.start));let E=ye(f?.extensions)?f.extensions:void 0;if(this.extensions=u??E??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}}),s?.stack!=null)Object.defineProperty(this,"stack",{value:s.stack,writable:!0,configurable:!0});else if(Error.captureStackTrace!=null)Error.captureStackTrace(this,m);else Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes){for(let t of this.nodes)if(t.loc)e+=` + +`+so(t.loc)}else if(this.source&&this.locations)for(let t of this.locations)e+=` + +`+Zr(this.source,t);return e}toJSON(){let e={message:this.message};if(this.locations!=null)e.locations=this.locations;if(this.path!=null)e.path=this.path;if(this.extensions!=null&&Object.keys(this.extensions).length>0)e.extensions=this.extensions;return e}}function Cu(e){return e===void 0||e.length===0?void 0:e}function De(e){if(e instanceof m)return e;let t=oo(e);return new m(t.message,{originalError:t})}class Fe extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(e,t){let n=this.get(e);if(n===void 0)this.set(e,[t]);else n.push(t)}}function Vu(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function Mu(e){return Pu("or",e)}function Uu(e){return Pu("and",e)}function Pu(e,t){if(t.length===0)U(!1);switch(t.length){case 1:return t[0];case 2:return t[0]+" "+e+" "+t[1]}let n=t.slice(0,-1),r=t.at(-1);return n.join(", ")+", "+e+" "+r}function et(e){return typeof e==="object"&&typeof e?.[Symbol.iterator]==="function"}function sn(e,t){let n=Object.create(null);for(let r of e)n[t(r)]=r;return n}function Gt(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}function qn(e){if(e.length===0)return"";return` at ${e.map((t)=>typeof t==="number"?`[${t}]`:`.${t}`).join("")}`}class ei{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class bn{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}var ti={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentArgument:["name","value"],FragmentSpread:["name","arguments","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","directives","locations"],SchemaExtension:["directives","operationTypes"],DirectiveExtension:["name","directives"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},Rf=new Set(Object.keys(ti));function ni(e){let t=e?.kind;return typeof t==="string"&&Rf.has(t)}var re={QUERY:"query",MUTATION:"mutation",SUBSCRIPTION:"subscription"};var Ne="Name",jt="Document",Tt="OperationDefinition",ri="VariableDefinition",ao="SelectionSet",an="Field",ii="Argument",uo="FragmentArgument",Dt="FragmentSpread",_n="InlineFragment",Qe="FragmentDefinition",Ce="Variable",Oe="IntValue",Bt="FloatValue",Ie="StringValue",tt="BooleanValue",le="NullValue",Ot="EnumValue",Ae="ListValue",Ve="ObjectValue",un="ObjectField",oi="Directive",Sn="NamedType",Dn="ListType",cn="NonNullType",Ye="SchemaDefinition",si="OperationTypeDefinition",Qt="ScalarTypeDefinition",At="ObjectTypeDefinition",co="FieldDefinition",ai="InputValueDefinition",xt="InterfaceTypeDefinition",wt="UnionTypeDefinition",Yt="EnumTypeDefinition",lo="EnumValueDefinition",yt="InputObjectTypeDefinition",pt="DirectiveDefinition",Rt="SchemaExtension",Tr="DirectiveExtension",ln="ScalarTypeExtension",qt="ObjectTypeExtension",Kt="InterfaceTypeExtension",Jt="UnionTypeExtension",pn="EnumTypeExtension",Lt="InputObjectTypeExtension",po="TypeCoordinate",fo="MemberCoordinate",mo="ArgumentCoordinate",ho="DirectiveCoordinate",Eo="DirectiveArgumentCoordinate";function nt(e,t){if(!e)throw Error(t)}var Lf=5;function qe(e,t){let[n,r]=t?[e,t]:[void 0,e];if(r.length===0)return"";let i=" Did you mean ";if(n!=null)i+=n+" ";let o=Mu(r.slice(0,Lf).map((s)=>`"${s}"`));return i+o+"?"}function ua(e){return e}function kt(e,t,n){let r=Object.create(null);for(let i of e)r[t(i)]=n(i);return r}function fn(e,t){let n=0,r=0;while(n<e.length&&r<t.length){let i=e.charCodeAt(n),o=t.charCodeAt(r);if(To(i)&&To(o)){let s=0;do++n,s=s*10+i-ca,i=e.charCodeAt(n);while(To(i)&&s>0);let a=0;do++r,a=a*10+o-ca,o=t.charCodeAt(r);while(To(o)&&a>0);if(s<a)return-1;if(s>a)return 1}else{if(i<o)return-1;if(i>o)return 1;++n,++r}}return e.length-t.length}var ca=48,kf=57;function To(e){return!isNaN(e)&&ca<=e&&e<=kf}function Je(e,t){let n=Object.create(null),r=new Gu(e),i=Math.floor(e.length*0.4)+1;for(let o of t){let s=r.measure(o,i);if(s!==void 0)n[o]=s}return Object.keys(n).sort((o,s)=>{let a=n[o]-n[s];return a!==0?a:fn(o,s)})}class Gu{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=$u(this._inputLowerCase),this._rows=[Array(e.length+1).fill(0),Array(e.length+1).fill(0),Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;let n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=$u(n),i=this._inputArray;if(r.length<i.length){let c=r;r=i,i=c}let o=r.length,s=i.length;if(o-s>t)return;let a=this._rows;for(let c=0;c<=s;c++)a[0][c]=c;for(let c=1;c<=o;c++){let l=a[(c-1)%3],p=a[c%3],f=p[0]=c;for(let d=1;d<=s;d++){let E=r[c-1]===i[d-1]?0:1,I=Math.min(l[d]+1,p[d-1]+1,l[d-1]+E);if(c>1&&d>1&&r[c-1]===i[d-2]&&r[c-2]===i[d-1]){let S=a[(c-2)%3][d-2];I=Math.min(I,S+1)}if(I<f)f=I;p[d]=I}if(f>t)return}let u=a[o%3][s];return u<=t?u:void 0}}function $u(e){let t=e.length,n=Array(t);for(let r=0;r<t;++r)n[r]=e.charCodeAt(r);return n}function We(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[n,r]of Object.entries(e))t[n]=r;for(let n of Object.getOwnPropertySymbols(e))t[n]=e[n];return t}function yo(e){return e===9||e===32}function Kn(e){return e>=48&&e<=57}function ju(e){return e>=97&&e<=122||e>=65&&e<=90}function Jn(e){return ju(e)||e===95}function go(e){return ju(e)||Kn(e)||e===95}function Bu(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;i<e.length;++i){let o=e[i],s=Ff(o);if(s===o.length)continue;if(n??=i,r=i,i!==0&&s<t)t=s}return e.map((i,o)=>o===0?i:i.slice(t)).slice(n??0,r+1)}function Ff(e){let t=0;while(t<e.length&&yo(e.charCodeAt(t)))++t;return t}function Qu(e){if(e==="")return!0;let t=!0,n=!1,r=!0,i=!1;for(let o=0;o<e.length;++o)switch(e.codePointAt(o)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(t&&!i)return!1;i=!0,t=!0,n=!1;break;case 9:case 32:n||=t;break;default:r&&=n,t=!1}if(t)return!1;if(r&&i)return!1;return!0}function No(e,t){let n=e.replaceAll('"""','\\"""'),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,o=r.length>1&&r.slice(1).every((d)=>d.length===0||yo(d.charCodeAt(0))),s=n.endsWith('\\"""'),a=e.endsWith('"')&&!s,u=e.endsWith("\\"),c=a||u,l=!t?.minimize&&(!i||e.length>70||c||o||s),p="",f=i&&yo(e.charCodeAt(0));if(l&&!f||o)p+=` +`;if(p+=n,l||c)p+=` +`;return'"""'+p+'"""'}function Yu(e){return`"${e.replace(Cf,Vf)}"`}var Cf=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Vf(e){return Mf[e.charCodeAt(0)]}var Mf=["\\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 Wn=Object.freeze({});function ft(e,t,n=ti){let r=new Map;for(let E of Object.values(C))r.set(E,Hn(t,E));let i=void 0,o=Array.isArray(e),s=[e],a=-1,u=[],c=e,l=void 0,p=void 0,f=[],d=[];do{a++;let E=a===s.length,I=E&&u.length!==0;if(E){if(l=d.length===0?void 0:f[f.length-1],c=p,p=d.pop(),I)if(o){c=c.slice();let G=0;for(let[Z,W]of u){let H=Z-G;if(W===null)c.splice(H,1),G++;else c[H]=W}}else{c={...c};for(let[G,Z]of u)c[G]=Z}a=i.index,s=i.keys,u=i.edits,o=i.inArray,i=i.prev}else if(p!=null){if(l=o?a:s[a],c=p[l],c===null||c===void 0)continue;f.push(l)}let S;if(!Array.isArray(c)){if(!ni(c))nt(!1,`Invalid AST Node: ${y(c)}.`);if(S=(E?r.get(c.kind)?.leave:r.get(c.kind)?.enter)?.call(t,c,l,p,f,d),S===Wn)break;if(S===!1){if(!E){f.pop();continue}}else if(S!==void 0){if(u.push([l,S]),!E)if(ni(S))c=S;else{f.pop();continue}}}if(S===void 0&&I)u.push([l,c]);if(E)f.pop();else{if(i={inArray:o,index:a,keys:s,edits:u,prev:i},o=Array.isArray(c),s=o?c:n[c.kind]??[],a=-1,u=[],p!=null)d.push(p);p=c}}while(i!==void 0);if(u.length!==0)return u.at(-1)[1];return e}function ui(e){let t=Array(e.length).fill(null),n=Object.create(null);for(let r of Object.values(C)){let i=!1,o=Array(e.length).fill(void 0),s=Array(e.length).fill(void 0);for(let u=0;u<e.length;++u){let{enter:c,leave:l}=Hn(e[u],r);i||=c!=null||l!=null,o[u]=c,s[u]=l}if(!i)continue;let a={enter(...u){let c=u[0];for(let l=0;l<e.length;l++)if(t[l]===null){let p=o[l]?.apply(e[l],u);if(p===!1)t[l]=c;else if(p===Wn)t[l]=Wn;else if(p!==void 0)return p}},leave(...u){let c=u[0];for(let l=0;l<e.length;l++)if(t[l]===null){let p=s[l]?.apply(e[l],u);if(p===Wn)t[l]=Wn;else if(p!==void 0&&p!==!1)return p}else if(t[l]===c)t[l]=null}};n[r]=a}return n}function Hn(e,t){let n=e[t];if(typeof n==="object")return n;else if(typeof n==="function")return{enter:n,leave:void 0};return{enter:e.enter,leave:e.leave}}function ee(e){return ft(e,Uf)}var pa=80,Uf={Name:{leave:(e)=>e.value},Variable:{leave:(e)=>"$"+e.name},Document:{leave:(e)=>x(e.definitions,` + +`)},OperationDefinition:{leave(e){let t=la(e.variableDefinitions)?J(`( +`,x(e.variableDefinitions,` +`),` +)`):J("(",x(e.variableDefinitions,", "),")"),n=J("",e.description,` +`)+x([e.operation,x([e.name,t]),x(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r,description:i})=>J("",i,` +`)+e+": "+t+J(" = ",n)+J(" ",x(r," "))},SelectionSet:{leave:({selections:e})=>gt(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let o=x([J("",e,": "),t],"");return x([qu(o,n),J(" ",x(r," ")),J(" ",i)])}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentArgument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>{let r="..."+e;return qu(r,t)+J(" ",x(n," "))}},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>x(["...",J("on ",e),x(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i,description:o})=>J("",o,` +`)+`fragment ${e}${J("(",x(n,", "),")")} on ${t} ${J("",x(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t===!0?No(e):Yu(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{let t="["+x(e,", ")+"]";if(t.length>pa)return`[ +`+ci(x(e,` +`))+` +]`;return t}},ObjectValue:{leave:({fields:e})=>{let t="{ "+x(e,", ")+" }";return t.length>pa?gt(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+J("(",x(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>J("",e,` +`)+x(["schema",x(t," "),gt(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>J("",e,` +`)+x(["scalar",t,x(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>J("",e,` +`)+x(["type",t,J("implements ",x(n," & ")),x(r," "),gt(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>J("",e,` +`)+t+(la(n)?J(`( +`,ci(x(n,` +`)),` +)`):J("(",x(n,", "),")"))+": "+r+J(" ",x(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>J("",e,` +`)+x([t+": "+n,J("= ",r),x(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>J("",e,` +`)+x(["interface",t,J("implements ",x(n," & ")),x(r," "),gt(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>J("",e,` +`)+x(["union",t,x(n," "),J("= ",x(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>J("",e,` +`)+x(["enum",t,x(n," "),gt(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>J("",e,` +`)+x([t,x(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>J("",e,` +`)+x(["input",t,x(n," "),gt(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,directives:r,repeatable:i,locations:o})=>J("",e,` +`)+"directive @"+t+(la(n)?J(`( +`,ci(x(n,` +`)),` +)`):J("(",x(n,", "),")"))+J(" ",x(r," "))+(i?" repeatable":"")+" on "+x(o," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>x(["extend schema",x(e," "),gt(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>x(["extend scalar",e,x(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>x(["extend type",e,J("implements ",x(t," & ")),x(n," "),gt(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>x(["extend interface",e,J("implements ",x(t," & ")),x(n," "),gt(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>x(["extend union",e,x(t," "),J("= ",x(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>x(["extend enum",e,x(t," "),gt(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>x(["extend input",e,x(t," "),gt(n)]," ")},DirectiveExtension:{leave:({name:e,directives:t})=>x(["extend directive @"+e,x(t," ")]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>x([e,J(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>x([e,J(".",t),J("(",n,":)")])},DirectiveCoordinate:{leave:({name:e})=>x(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>x(["@",e,J("(",t,":)")])}};function x(e,t=""){return e?.filter((n)=>n!==void 0&&n!=="").join(t)??""}function gt(e){return J(`{ +`,ci(x(e,` +`)),` +}`)}function J(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function ci(e){return J(" ",e.replaceAll(` +`,` + `))}function la(e){return e?.some((t)=>t.includes(` +`))??!1}function qu(e,t){let n=e+J("(",x(t,", "),")");if(n.length>pa)n=e+J(`( +`,ci(x(t,` +`)),` +)`);return n}function Wt(e,t){switch(e.kind){case le:return null;case Oe:return parseInt(e.value,10);case Bt:return parseFloat(e.value);case Ie:case Ot:case tt:return e.value;case Ae:return e.values.map((n)=>Wt(n,t));case Ve:return kt(e.fields,(n)=>n.name.value,(n)=>Wt(n.value,t));case Ce:return t?.[e.name.value]}}function He(e){if(e.length===0)throw new m("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!go(e.charCodeAt(t)))throw new m(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!Jn(e.charCodeAt(0)))throw new m(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}function Io(e){if(e==="true"||e==="false"||e==="null")throw new m(`Enum values cannot be named: ${e}`);return He(e)}function yr(e){return ae(e)||L(e)||P(e)||te(e)||z(e)||k(e)||j(e)||w(e)}function Ku(e){if(!yr(e))throw Error(`Expected ${y(e)} to be a GraphQL type.`);return e}var Ju=Symbol("Scalar");function ae(e){return Le(e,Ju,ke)}function Wu(e){if(!ae(e))throw Error(`Expected ${y(e)} to be a GraphQL Scalar type.`);return e}var fa=Symbol("Object");function L(e){return Le(e,fa,Ee)}function bo(e){if(!L(e))throw Error(`Expected ${y(e)} to be a GraphQL Object type.`);return e}var Hu=Symbol("Field");function da(e){return Le(e,Hu,zn)}function zu(e){if(!da(e))throw Error(`Expected ${y(e)} to be a GraphQL field.`);return e}var Xu=Symbol("Argument");function li(e){return Le(e,Xu,di)}function Zu(e){if(!li(e))throw Error(`Expected ${y(e)} to be a GraphQL argument.`);return e}var ec=Symbol("Interface");function P(e){return Le(e,ec,Me)}function _o(e){if(!P(e))throw Error(`Expected ${y(e)} to be a GraphQL Interface type.`);return e}var tc=Symbol("Union");function te(e){return Le(e,tc,it)}function nc(e){if(!te(e))throw Error(`Expected ${y(e)} to be a GraphQL Union type.`);return e}var rc=Symbol("Enum");function z(e){return Le(e,rc,we)}function ic(e){if(!z(e))throw Error(`Expected ${y(e)} to be a GraphQL Enum type.`);return e}var oc=Symbol("EnumValue");function ma(e){return Le(e,oc,Ea)}function sc(e){if(!ma(e))throw Error(`Expected ${y(e)} to be a GraphQL Enum value.`);return e}var ac=Symbol("InputObject");function k(e){return Le(e,ac,Ge)}function uc(e){if(!k(e))throw Error(`Expected ${y(e)} to be a GraphQL Input Object type.`);return e}var cc=Symbol("InputField");function ha(e){return Le(e,cc,Ta)}function lc(e){if(!ha(e))throw Error(`Expected ${y(e)} to be a GraphQL input field.`);return e}var pc=Symbol("List");function j(e){return Le(e,pc,oe)}function fc(e){if(!j(e))throw Error(`Expected ${y(e)} to be a GraphQL List type.`);return e}var dc=Symbol("NonNull");function w(e){return Le(e,dc,V)}function mc(e){if(!w(e))throw Error(`Expected ${y(e)} to be a GraphQL Non-Null type.`);return e}function xe(e){return ae(e)||z(e)||k(e)||On(e)&&xe(e.ofType)}function hc(e){if(!xe(e))throw Error(`Expected ${y(e)} to be a GraphQL input type.`);return e}function Nt(e){return ae(e)||L(e)||P(e)||te(e)||z(e)||On(e)&&Nt(e.ofType)}function Ec(e){if(!Nt(e))throw Error(`Expected ${y(e)} to be a GraphQL output type.`);return e}function ve(e){return ae(e)||z(e)}function It(e){if(!ve(e))throw Error(`Expected ${y(e)} to be a GraphQL leaf type.`);return e}function dt(e){return L(e)||P(e)||te(e)}function Tc(e){if(!dt(e))throw Error(`Expected ${y(e)} to be a GraphQL composite type.`);return e}function Ke(e){return P(e)||te(e)}function yc(e){if(!Ke(e))throw Error(`Expected ${y(e)} to be a GraphQL abstract type.`);return e}class oe{constructor(e){this.__kind=pc,this.ofType=e}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class V{constructor(e){this.__kind=dc,this.ofType=e}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function On(e){return j(e)||w(e)}function gc(e){if(!On(e))throw Error(`Expected ${y(e)} to be a GraphQL wrapping type.`);return e}function pi(e){return yr(e)&&!w(e)}function So(e){if(!pi(e))throw Error(`Expected ${y(e)} to be a GraphQL nullable type.`);return e}function gr(e){if(e)return w(e)?e.ofType:e}function rt(e){return ae(e)||L(e)||P(e)||te(e)||z(e)||k(e)}function Nc(e){if(!rt(e))throw Error(`Expected ${y(e)} to be a GraphQL named type.`);return e}function pe(e){if(e){let t=e;while(On(t))t=t.ofType;return t}}function Do(e){return typeof e==="function"?e():e}function fi(e){return typeof e==="function"?e():e}class ke{constructor(e){if(this.__kind=Ju,this.name=He(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=e.serialize??e.coerceOutputValue??ua,this.parseValue=e.parseValue??e.coerceInputValue??ua,this.parseLiteral=e.parseLiteral??((t,n)=>this.coerceInputValue(Wt(t,n))),this.coerceOutputValue=e.coerceOutputValue??this.serialize,this.coerceInputValue=e.coerceInputValue??this.parseValue,this.coerceInputLiteral=e.coerceInputLiteral,this.valueToLiteral=e.valueToLiteral,this.extensions=We(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],e.parseLiteral){if(!(typeof e.parseValue==="function"&&typeof e.parseLiteral==="function"))nt(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`)}if(e.coerceInputLiteral){if(!(typeof e.coerceInputValue==="function"&&typeof e.coerceInputLiteral==="function"))nt(!1,`${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" 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,coerceOutputValue:this.coerceOutputValue,coerceInputValue:this.coerceInputValue,coerceInputLiteral:this.coerceInputLiteral,valueToLiteral:this.valueToLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class Ee{constructor(e){this.__kind=fa,this.__kind=fa,this.name=He(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=We(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=vc.bind(void 0,this,e.fields),this._interfaces=Ic.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){if(typeof this._fields==="function")this._fields=this._fields();return this._fields}getInterfaces(){if(typeof this._interfaces==="function")this._interfaces=this._interfaces();return this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Gt(this.getFields(),(e)=>e.toConfig()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Ic(e){return Do(e??[])}function vc(e,t){let n=fi(t);return Gt(n,(r,i)=>new zn(e,i,r))}class zn{constructor(e,t,n){this.__kind=Hu,this.parentType=e,this.name=He(t),this.description=n.description,this.type=n.type;let r=n.args;this.args=r?Object.entries(r).map(([i,o])=>new di(this,i,o)):[],this.resolve=n.resolve,this.subscribe=n.subscribe,this.deprecationReason=n.deprecationReason,this.extensions=We(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLField"}toConfig(){return{description:this.description,type:this.type,args:kt(this.args,(e)=>e.name,(e)=>e.toConfig()),resolve:this.resolve,subscribe:this.subscribe,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType??"<meta>"}.${this.name}`}toJSON(){return this.toString()}}class di{constructor(e,t,n){this.__kind=Xu,this.parent=e,this.name=He(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this._memoizedCoercedDefaultValue=void 0,this.deprecationReason=n.deprecationReason,this.extensions=We(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLArgument"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parent}(${this.name}:)`}toJSON(){return this.toString()}}function ze(e){return w(e.type)&&e.default===void 0&&e.defaultValue===void 0}class Me{constructor(e){this.__kind=ec,this.name=He(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=We(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=vc.bind(void 0,this,e.fields),this._interfaces=Ic.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){if(typeof this._fields==="function")this._fields=this._fields();return this._fields}getInterfaces(){if(typeof this._interfaces==="function")this._interfaces=this._interfaces();return this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Gt(this.getFields(),(e)=>e.toConfig()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class it{constructor(e){this.__kind=tc,this.name=He(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=We(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._types=Pf.bind(void 0,e.types)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){if(typeof this._types==="function")this._types=this._types();return this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Pf(e){return Do(e)}class we{constructor(e){this.__kind=rc,this.name=He(e.name),this.description=e.description,this.extensions=We(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._values=$f.bind(void 0,this,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){if(typeof this._values==="function")this._values=this._values();return this._values}getValue(e){return this._nameLookup??=sn(this.getValues(),(t)=>t.name),this._nameLookup[e]}serialize(e){return this.coerceOutputValue(e)}coerceOutputValue(e){this._valueLookup??=new Map(this.getValues().map((n)=>[n.value,n]));let t=this._valueLookup.get(e);if(t===void 0)throw new m(`Enum "${this.name}" cannot represent value: ${y(e)}`);return t.name}parseValue(e,t){return this.coerceInputValue(e,t)}coerceInputValue(e,t){if(typeof e!=="string"){let r=y(e);throw new m(`Enum "${this.name}" cannot represent non-string value: ${r}.`+(t?"":vo(this,r)))}let n=this.getValue(e);if(n==null)throw new m(`Value "${e}" does not exist in "${this.name}" enum.`+(t?"":vo(this,e)));return n.value}parseLiteral(e,t,n){return this.coerceInputLiteral(e,n)}coerceInputLiteral(e,t){if(e.kind!==Ot){let r=ee(e);throw new m(`Enum "${this.name}" cannot represent non-enum value: ${r}.`+(t?"":vo(this,r)),{nodes:e})}let n=this.getValue(e.value);if(n==null){let r=ee(e);throw new m(`Value "${r}" does not exist in "${this.name}" enum.`+(t?"":vo(this,r)),{nodes:e})}return n.value}valueToLiteral(e){if(typeof e==="string"&&this.getValue(e))return{kind:Ot,value:e}}toConfig(){return{name:this.name,description:this.description,values:kt(this.getValues(),(e)=>e.name,(e)=>e.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function $f(e,t){let n=fi(t);return Object.entries(n).map(([r,i])=>new Ea(e,r,i))}function vo(e,t){let n=e.getValues().map((i)=>i.name),r=Je(t,n);return qe("the enum value",r)}class Ea{constructor(e,t,n){this.__kind=oc,this.parentEnum=e,this.name=Io(t),this.description=n.description,this.value=n.value!==void 0?n.value:t,this.deprecationReason=n.deprecationReason,this.extensions=We(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLEnumValue"}toConfig(){return{description:this.description,value:this.value,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentEnum.name}.${this.name}`}toJSON(){return this.toString()}}class Ge{constructor(e){this.__kind=ac,this.name=He(e.name),this.description=e.description,this.extensions=We(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this.isOneOf=e.isOneOf??!1,this._fields=Gf.bind(void 0,this,e.fields)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){if(typeof this._fields==="function")this._fields=this._fields();return this._fields}toConfig(){return{name:this.name,description:this.description,fields:Gt(this.getFields(),(e)=>e.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function Gf(e,t){let n=fi(t);return Gt(n,(r,i)=>new Ta(e,i,r))}class Ta{constructor(e,t,n){if("resolve"in n)nt(!1,`${e}.${t} field has a resolve property, but Input Types cannot define resolvers.`);this.__kind=cc,this.parentType=e,this.name=He(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this._memoizedCoercedDefaultValue=void 0,this.deprecationReason=n.deprecationReason,this.extensions=We(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLInputField"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType}.${this.name}`}toJSON(){return this.toString()}}function Xe(e){return w(e.type)&&e.defaultValue===void 0&&e.default===void 0}function Nr(e,t){if(e===t)return!0;if(w(e)&&w(t))return Nr(e.ofType,t.ofType);if(j(e)&&j(t))return Nr(e.ofType,t.ofType);return!1}function Ht(e,t,n){if(t===n)return!0;if(w(n)){if(w(t))return Ht(e,t.ofType,n.ofType);return!1}if(w(t))return Ht(e,t.ofType,n);if(j(n)){if(j(t))return Ht(e,t.ofType,n.ofType);return!1}if(j(t))return!1;return Ke(n)&&(P(t)||L(t))&&e.isSubType(n,t)}function mi(e,t,n){if(t===n)return!0;if(Ke(t)){if(Ke(n))return e.getPossibleTypes(t).some((r)=>e.isSubType(n,r));return e.isSubType(t,n)}if(Ke(n))return e.isSubType(n,t);return!1}function Pe(e,t,n){return{prev:e,key:t,typename:n}}function fe(e){let t=[],n=e;while(n)t.push(n.key),n=n.prev;return t.reverse()}function zt(e,t){if(w(t)){if(e==null)return;return zt(e,t.ofType)}if(e==null)return{kind:le};if(j(t)){if(!et(e))return zt(e,t.ofType);let r=[];for(let i of e){let o=zt(i,t.ofType);if(!o)return;r.push(o)}return{kind:Ae,values:r}}if(k(t)){if(!ye(e))return;let r=[],i=t.getFields();if(Object.keys(e).some((s)=>e[s]!==void 0&&!Object.hasOwn(i,s)))return;for(let s of Object.values(t.getFields()))if(e[s.name]===void 0){if(Xe(s))return}else{let u=zt(e[s.name],s.type);if(!u)return;r.push({kind:un,name:{kind:Ne,value:s.name},value:u})}return{kind:Ve,fields:r}}let n=It(t);if(n.valueToLiteral)try{return n.valueToLiteral(e)}catch(r){return}return Xn(e)}function Xn(e){if(e==null)return{kind:le};switch(typeof e){case"boolean":return{kind:tt,value:e};case"string":return{kind:Ie,value:e,block:!1};case"bigint":return{kind:Oe,value:e.toString()};case"number":{if(!Number.isFinite(e))return{kind:le};let t=String(e);return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:Oe,value:t}:{kind:Bt,value:t}}case"object":{if(et(e))return{kind:Ae,values:Array.from(e,Xn)};let t=e,n=[];for(let r of Object.keys(t)){let i=t[r];if(i!==void 0)n.push({kind:un,name:{kind:Ne,value:r},value:Xn(i)})}return{kind:Ve,fields:n}}}throw TypeError(`Cannot convert value to AST: ${y(e)}.`)}function dn(e,t,n){switch(e.kind){case Ce:{let r=e.name.value,i=n?.sources[r];if(i){let s=i.value;if(s===void 0){let a=i.signature.default;if(a!==void 0)return a.literal;return{kind:le}}return dn(s,t,i.fragmentVariableValues)}let o=t?.sources[r];if(o==null)return{kind:le};if(o.value===void 0){let s=o.signature.default;if(s!==void 0)return s.literal}return zt(o.value,o.signature.type)}case Ve:{let r=[];for(let i of e.fields){if(i.value.kind===Ce){let s=n?.sources[i.value.name.value]??t?.sources[i.value.name.value];if(s?.value===void 0&&s?.signature.default===void 0)continue}let o=dn(i.value,t,n);r.push({...i,value:o})}return{...e,fields:r}}case Ae:{let r=[];for(let i of e.values){let o=dn(i,t,n);r.push(o)}return{...e,values:r}}default:return e}}function Zn(e,t,n,r){return hi(e,t,n,r,void 0)}function hi(e,t,n,r,i){if(w(t)){if(e===void 0){An(n,`Expected a value of non-null type "${t}" to be provided.`,i);return}if(e===null){An(n,`Expected value of non-null type "${t}" not to be null.`,i);return}return hi(e,t.ofType,n,r,i)}if(e==null)return;if(j(t))if(!et(e))hi(e,t.ofType,n,r,i);else{let o=0;for(let s of e)hi(s,t.ofType,n,r,Pe(i,o++,void 0))}else if(k(t)){if(!ye(e)||Array.isArray(e)){An(n,`Expected value of type "${t}" to be an object, found: ${y(e)}.`,i);return}let o=t.getFields();for(let a of Object.values(o)){let u=e[a.name];if(u===void 0){if(Xe(a))An(n,`Expected value of type "${t}" to include required field "${a.name}", found: ${y(e)}.`,i)}else hi(u,a.type,n,r,Pe(i,a.name,t.name))}let s=[];for(let a of Object.keys(e)){if(e[a]===void 0)continue;if(!Object.hasOwn(o,a)){let u=r?"":qe(Je(a,Object.keys(o)));An(n,`Expected value of type "${t}" not to include unknown field "${a}"${u?`.${u} Found`:", found"}: ${y(e)}.`,i);continue}s.push(a)}if(t.isOneOf){if(s.length!==1)An(n,Oo(t),i);let a=s[0];if(e[a]===null)An(n,Oo(t),Pe(i,a,t.name))}}else{It(t);let o,s;try{o=t.coerceInputValue(e,r)}catch(a){if(a instanceof m){n(a,fe(i));return}s=a}if(o===void 0)An(n,`Expected value of type "${t}"${s!=null?`, but encountered error "${_c(s)}"; found`:", found"}: ${y(e)}.`,i,De(s))}}function An(e,t,n,r){e(new m(t,{originalError:r}),fe(n))}function xn(e,t,n,r,i,o){return Ei({static:!r&&!i,onError:n,variables:r,fragmentVariableValues:i},e,t,o,void 0)}function Ei(e,t,n,r,i){if(t.kind===Ce){if(e.static)return;let s=bc(e,t)?.coerced[t.name.value];if(w(n)){if(s===void 0)Ft(e.onError,`Expected variable "$${t.name.value}" provided to type "${n}" to provide a runtime value.`,t,i);else if(s===null)Ft(e.onError,`Expected variable "$${t.name.value}" provided to non-null type "${n}" not to be null.`,t,i)}return}if(w(n)){if(t.kind===le){Ft(e.onError,`Expected value of non-null type "${n}" not to be null.`,t,i);return}return Ei(e,t,n.ofType,r,i)}if(t.kind===le)return;if(j(n))if(t.kind!==Ae)Ei(e,t,n.ofType,r,i);else{let o=0;for(let s of t.values)Ei(e,s,n.ofType,r,Pe(i,o++,void 0))}else if(k(n)){if(t.kind!==Ve){Ft(e.onError,`Expected value of type "${n}" to be an object, found: ${ee(t)}.`,t,i);return}let o=n.getFields(),s=sn(t.fields,(c)=>c.name.value);for(let c of Object.values(o)){let l=s[c.name];if(l===void 0){if(Xe(c))Ft(e.onError,`Expected value of type "${n}" to include required field "${c.name}", found: ${ee(t)}.`,t,i)}else{let p=l.value;if(p.kind===Ce&&!e.static){let f=bc(e,p),d=p.name.value,E=f?.coerced[d];if(n.isOneOf){if(E===void 0)Ft(e.onError,`Expected variable "$${d}" provided to field "${c.name}" for OneOf Input Object type "${n}" to provide a runtime value.`,t,i);else if(E===null)Ft(e.onError,`Expected variable "$${d}" provided to field "${c.name}" for OneOf Input Object type "${n}" not to be null.`,t,i)}else if(E===void 0&&!Xe(c))continue}Ei(e,p,c.type,r,Pe(i,c.name,n.name))}}let a=t.fields,u=[];for(let c of a){let l=c.name.value;if(!Object.hasOwn(o,l)){let p=r?"":qe(Je(l,Object.keys(o)));Ft(e.onError,`Expected value of type "${n}" not to include unknown field "${l}"${p?`.${p} Found`:", found"}: ${ee(t)}.`,c,i)}else u.push(c)}if(n.isOneOf){if(u.length!==1){Ft(e.onError,Oo(n),t,i);return}if(u[0].value.kind===le){let p=u[0].name.value;Ft(e.onError,Oo(n),t,Pe(i,p,void 0))}}}else{It(n);let o,s;try{o=n.coerceInputLiteral?n.coerceInputLiteral(dn(t,e.variables,e.fragmentVariableValues),r):n.parseLiteral(t,void 0,r)}catch(a){if(a instanceof m){e.onError(a,fe(i));return}s=a}if(o===void 0)Ft(e.onError,`Expected value of type "${n}"${s!=null?`, but encountered error "${_c(s)}"; found`:", found"}: ${ee(t)}.`,t,i,De(s))}}function bc(e,t){let n=t.name.value,{fragmentVariableValues:r,variables:i}=e;return r?.sources[n]?r:i}function Ft(e,t,n,r,i){e(new m(t,{nodes:n,originalError:i}),fe(r))}function _c(e){if(ye(e)){let t=e.message;if(typeof t==="string"&&t!=="")return t}return String(e)}function Oo(e){return`Within OneOf Input Object type "${e}", exactly one field must be specified, and the value for that field must be non-null.`}var F={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",FRAGMENT_VARIABLE_DEFINITION:"FRAGMENT_VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION",DIRECTIVE_DEFINITION:"DIRECTIVE_DEFINITION"};var er=2147483647,tr=-2147483648,wn=new ke({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.",coerceOutputValue(e){let t=Ti(e);if(typeof t==="number")return Sc(t);if(typeof t==="boolean")return t?1:0;if(typeof t==="string")return jf(t);if(typeof t==="bigint")return Dc(t);throw new m(`Int cannot represent non-integer value: ${y(t)}`)},coerceInputValue(e){if(typeof e==="number")return Sc(e);if(typeof e==="bigint")return Dc(e);throw new m(`Int cannot represent non-integer value: ${y(e)}`)},coerceInputLiteral(e){if(e.kind!==Oe)throw new m(`Int cannot represent non-integer value: ${ee(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>er||t<tr)throw new m(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t},valueToLiteral(e){if((typeof e==="number"&&Number.isInteger(e)||typeof e==="bigint")&&e<=er&&e>=tr)return{kind:Oe,value:String(e)}}}),Ir=new ke({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",coerceOutputValue(e){let t=Ti(e);if(typeof t==="number")return Oc(t);if(typeof t==="boolean")return t?1:0;if(typeof t==="string")return Bf(t);if(typeof t==="bigint")return Ac(t);throw new m(`Float cannot represent non numeric value: ${y(t)}`)},coerceInputValue(e){if(typeof e==="number")return Oc(e);if(typeof e==="bigint")return Ac(e);throw new m(`Float cannot represent non numeric value: ${y(e)}`)},coerceInputLiteral(e){if(e.kind!==Bt&&e.kind!==Oe)throw new m(`Float cannot represent non numeric value: ${ee(e)}`,{nodes:e});return parseFloat(e.value)},valueToLiteral(e){let t=Xn(e);if(t.kind===Bt||t.kind===Oe)return t}}),ie=new ke({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",coerceOutputValue(e){let t=Ti(e);if(typeof t==="string")return t;if(typeof t==="boolean")return t?"true":"false";if(typeof t==="number")return Qf(t);if(typeof t==="bigint")return String(t);throw new m(`String cannot represent value: ${y(e)}`)},coerceInputValue(e){if(typeof e!=="string")throw new m(`String cannot represent a non string value: ${y(e)}`);return e},coerceInputLiteral(e){if(e.kind!==Ie)throw new m(`String cannot represent a non string value: ${ee(e)}`,{nodes:e});return e.value},valueToLiteral(e){let t=Xn(e);if(t.kind===Ie)return t}}),ge=new ke({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",coerceOutputValue(e){let t=Ti(e);if(typeof t==="boolean")return t;if(typeof t==="number")return Yf(t);if(typeof t==="bigint")return t!==0n;throw new m(`Boolean cannot represent a non boolean value: ${y(t)}`)},coerceInputValue(e){if(typeof e!=="boolean")throw new m(`Boolean cannot represent a non boolean value: ${y(e)}`);return e},coerceInputLiteral(e){if(e.kind!==tt)throw new m(`Boolean cannot represent a non boolean value: ${ee(e)}`,{nodes:e});return e.value},valueToLiteral(e){let t=Xn(e);if(t.kind===tt)return t}}),Rn=new ke({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',coerceOutputValue(e){let t=Ti(e);if(typeof t==="string")return t;if(typeof t==="number")return ya(t);if(typeof t==="bigint")return String(t);throw new m(`ID cannot represent value: ${y(e)}`)},coerceInputValue(e){if(typeof e==="string")return e;if(typeof e==="number")return ya(e);if(typeof e==="bigint")return String(e);throw new m(`ID cannot represent value: ${y(e)}`)},coerceInputLiteral(e){if(e.kind!==Ie&&e.kind!==Oe)throw new m("ID cannot represent a non-string and non-integer value: "+ee(e),{nodes:e});return e.value},valueToLiteral(e){if(typeof e==="string")return/^-?(?:0|[1-9][0-9]*)$/.test(e)?{kind:Oe,value:e}:{kind:Ie,value:e,block:!1};if(typeof e==="number")return{kind:Oe,value:ya(e)};if(typeof e==="bigint")return{kind:Oe,value:String(e)}}}),Ct=Object.freeze([ie,wn,Ir,ge,Rn]);function Ze(e){return Ct.some(({name:t})=>e.name===t)}function Ti(e){if(ye(e)){if(typeof e.valueOf==="function"){let t=e.valueOf();if(!ye(t))return t}if(typeof e.toJSON==="function")return e.toJSON()}return e}function Sc(e){if(!Number.isInteger(e))throw new m(`Int cannot represent non-integer value: ${y(e)}`);if(e>er||e<tr)throw new m(`Int cannot represent non 32-bit signed integer value: ${y(e)}`);return e}function jf(e){if(e==="")throw new m(`Int cannot represent non-integer value: ${y(e)}`);let t=Number(e);if(!Number.isInteger(t))throw new m(`Int cannot represent non-integer value: ${y(e)}`);if(t>er||t<tr)throw new m(`Int cannot represent non 32-bit signed integer value: ${y(e)}`);return t}function Dc(e){if(e>er||e<tr)throw new m(`Int cannot represent non 32-bit signed integer value: ${String(e)}`);return Number(e)}function Oc(e){if(!Number.isFinite(e))throw new m(`Float cannot represent non numeric value: ${y(e)}`);return e}function Bf(e){if(e==="")throw new m(`Float cannot represent non numeric value: ${y(e)}`);let t=Number(e);if(!Number.isFinite(t))throw new m(`Float cannot represent non numeric value: ${y(e)}`);return t}function Ac(e){let t=Number(e);if(!Number.isFinite(t))throw new m(`Float cannot represent non numeric value: ${y(e)} (value is too large)`);if(BigInt(t)!==e)throw new m(`Float cannot represent non numeric value: ${y(e)} (value would lose precision)`);return t}function Qf(e){if(!Number.isFinite(e))throw new m(`String cannot represent value: ${y(e)}`);return String(e)}function Yf(e){if(!Number.isFinite(e))throw new m(`Boolean cannot represent a non boolean value: ${y(e)}`);return e!==0}function ya(e){if(!Number.isInteger(e))throw new m(`ID cannot represent value: ${y(e)}`);return String(e)}var xc=Symbol("Directive");function nr(e){return Le(e,xc,Re)}function wc(e){if(!nr(e))throw Error(`Expected ${y(e)} to be a GraphQL directive.`);return e}class Re{constructor(e){if(this.__kind=xc,this.name=He(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=e.isRepeatable??!1,this.deprecationReason=e.deprecationReason,this.extensions=We(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],!Array.isArray(e.locations))nt(!1,`@${this.name} locations must be an Array.`);let t=e.args??{};if(!(ye(t)&&!Array.isArray(t)))nt(!1,`@${this.name} args must be an object with argument names as keys.`);this.args=Object.entries(t).map(([n,r])=>new di(this,n,r))}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:kt(this.args,(e)=>e.name,(e)=>e.toConfig()),isRepeatable:this.isRepeatable,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return"@"+this.name}toJSON(){return this.toString()}}var Ln=new Re({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[F.FIELD,F.FRAGMENT_SPREAD,F.INLINE_FRAGMENT],args:{if:{type:new V(ge),description:"Included when true."}}}),kn=new Re({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[F.FIELD,F.FRAGMENT_SPREAD,F.INLINE_FRAGMENT],args:{if:{type:new V(ge),description:"Skipped when true."}}}),Xt=new Re({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[F.FRAGMENT_SPREAD,F.INLINE_FRAGMENT],args:{if:{type:new V(ge),description:"Deferred when true or undefined.",default:{value:!0}},label:{type:ie,description:"Unique name"}}}),vt=new Re({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[F.FIELD],args:{initialCount:{default:{value:0},type:new V(wn),description:"Number of items to return immediately"},if:{type:new V(ge),description:"Stream when true or undefined.",default:{value:!0}},label:{type:ie,description:"Unique name"}}}),yi="No longer supported",mn=new Re({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[F.FIELD_DEFINITION,F.ARGUMENT_DEFINITION,F.INPUT_FIELD_DEFINITION,F.ENUM_VALUE,F.DIRECTIVE_DEFINITION],args:{reason:{type:new V(ie),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/).",default:{value:yi}}}}),gi=new Re({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[F.SCALAR],args:{url:{type:new V(ie),description:"The URL that specifies the behavior of this scalar."}}}),Ni=new Re({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[F.INPUT_OBJECT],args:{}}),Rc=new Re({name:"experimental_disableErrorPropagation",description:"Disables error propagation.",locations:[F.QUERY,F.MUTATION,F.SUBSCRIPTION]}),je=Object.freeze([Ln,kn,mn,gi,Ni]);function Vt(e){return je.some(({name:t})=>t===e.name)}function Fn(e,t){if(w(t)){let n=Fn(e,t.ofType);if(n?.kind===le)return null;return n}if(e===null)return{kind:le};if(e===void 0)return null;if(j(t)){let n=t.ofType;if(et(e)){let r=[];for(let i of e){let o=Fn(i,n);if(o!=null)r.push(o)}return{kind:Ae,values:r}}return Fn(e,n)}if(k(t)){if(!ye(e))return null;let n=[];for(let r of Object.values(t.getFields())){let i=Fn(e[r.name],r.type);if(i)n.push({kind:un,name:{kind:Ne,value:r.name},value:i})}return{kind:Ve,fields:n}}if(ve(t)){let n=t.coerceOutputValue(e);if(n==null)return null;if(typeof n==="boolean")return{kind:tt,value:n};if(typeof n==="number"&&Number.isFinite(n)){let r=String(n);return Lc.test(r)?{kind:Oe,value:r}:{kind:Bt,value:r}}if(typeof n==="bigint")return{kind:Oe,value:String(n)};if(typeof n==="string"){if(z(t))return{kind:Ot,value:n};if(t===Rn&&Lc.test(n))return{kind:Oe,value:n};return{kind:Ie,value:n}}throw TypeError(`Cannot convert value to AST: ${y(n)}.`)}U(!1,"Unexpected input type: "+y(t))}var Lc=/^-?(?:0|[1-9][0-9]*)$/;function vr(e){let{type:t,default:n}=e;if(n){let i=n.literal??zt(n.value,t);if(i==null)U(!1,"Invalid default value");return i}let r=e.defaultValue;if(r!==void 0){let i=Fn(r,t);if(i==null)U(!1,"Invalid default value");return i}return}var br=new Ee({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:ie,resolve:(e)=>e.description},types:{description:"A list of all types supported by this server.",type:new V(new oe(new V(mt))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new V(mt),resolve:(e)=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:mt,resolve:(e)=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:mt,resolve:(e)=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new V(new oe(new V(Ao))),args:{includeDeprecated:{type:new V(ge),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>t===!0?e.getDirectives():e.getDirectives().filter((n)=>n.deprecationReason==null)}})}),Ao=new Ee({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 V(ie),resolve:(e)=>e.name},description:{type:ie,resolve:(e)=>e.description},isRepeatable:{type:new V(ge),resolve:(e)=>e.isRepeatable},locations:{type:new V(new oe(new V(xo))),resolve:(e)=>e.locations},args:{type:new V(new oe(new V(_r))),args:{includeDeprecated:{type:new V(ge),default:{value:!1}}},resolve(e,{includeDeprecated:t}){return t===!0?e.args:e.args.filter((n)=>n.deprecationReason==null)}},isDeprecated:{type:new V(ge),resolve:(e)=>e.deprecationReason!=null},deprecationReason:{type:ie,resolve:(e)=>e.deprecationReason}})}),xo=new we({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:F.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:F.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:F.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:F.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:F.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:F.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:F.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:F.VARIABLE_DEFINITION,description:"Location adjacent to an operation variable definition."},FRAGMENT_VARIABLE_DEFINITION:{value:F.FRAGMENT_VARIABLE_DEFINITION,description:"Location adjacent to a fragment variable definition."},SCHEMA:{value:F.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:F.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:F.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:F.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:F.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:F.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:F.UNION,description:"Location adjacent to a union definition."},ENUM:{value:F.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:F.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:F.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:F.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."},DIRECTIVE_DEFINITION:{value:F.DIRECTIVE_DEFINITION,description:"Location adjacent to a directive definition."}}}),mt=new Ee({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 V(Lo),resolve(e){if(ae(e))return ue.SCALAR;if(L(e))return ue.OBJECT;if(P(e))return ue.INTERFACE;if(te(e))return ue.UNION;if(z(e))return ue.ENUM;if(k(e))return ue.INPUT_OBJECT;if(j(e))return ue.LIST;if(w(e))return ue.NON_NULL;U(!1,`Unexpected type: "${y(e)}".`)}},name:{type:ie,resolve:(e)=>("name"in e)?e.name:void 0},description:{type:ie,resolve:(e)=>("description"in e)?e.description:void 0},specifiedByURL:{type:ie,resolve:(e)=>("specifiedByURL"in e)?e.specifiedByURL:void 0},fields:{type:new oe(new V(wo)),args:{includeDeprecated:{type:new V(ge),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(L(e)||P(e)){let n=Object.values(e.getFields());return t===!0?n:n.filter((r)=>r.deprecationReason==null)}}},interfaces:{type:new oe(new V(mt)),resolve(e){if(L(e)||P(e))return e.getInterfaces()}},possibleTypes:{type:new oe(new V(mt)),resolve(e,t,n,{schema:r}){if(Ke(e))return r.getPossibleTypes(e)}},enumValues:{type:new oe(new V(Ro)),args:{includeDeprecated:{type:new V(ge),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(z(e)){let n=e.getValues();return t===!0?n:n.filter((r)=>r.deprecationReason==null)}}},inputFields:{type:new oe(new V(_r)),args:{includeDeprecated:{type:new V(ge),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(k(e)){let n=Object.values(e.getFields());return t===!0?n:n.filter((r)=>r.deprecationReason==null)}}},ofType:{type:mt,resolve:(e)=>("ofType"in e)?e.ofType:void 0},isOneOf:{type:ge,resolve:(e)=>{if(k(e))return e.isOneOf}}})}),wo=new Ee({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 V(ie),resolve:(e)=>e.name},description:{type:ie,resolve:(e)=>e.description},args:{type:new V(new oe(new V(_r))),args:{includeDeprecated:{type:new V(ge),default:{value:!1}}},resolve(e,{includeDeprecated:t}){return t===!0?e.args:e.args.filter((n)=>n.deprecationReason==null)}},type:{type:new V(mt),resolve:(e)=>e.type},isDeprecated:{type:new V(ge),resolve:(e)=>e.deprecationReason!=null},deprecationReason:{type:ie,resolve:(e)=>e.deprecationReason}})}),_r=new Ee({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 V(ie),resolve:(e)=>e.name},description:{type:ie,resolve:(e)=>e.description},type:{type:new V(mt),resolve:(e)=>e.type},defaultValue:{type:ie,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let t=vr(e);if(t)return ee(t);return null}},isDeprecated:{type:new V(ge),resolve:(e)=>e.deprecationReason!=null},deprecationReason:{type:ie,resolve:(e)=>e.deprecationReason}})}),Ro=new Ee({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 V(ie),resolve:(e)=>e.name},description:{type:ie,resolve:(e)=>e.description},isDeprecated:{type:new V(ge),resolve:(e)=>e.deprecationReason!=null},deprecationReason:{type:ie,resolve:(e)=>e.deprecationReason}})}),ue={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"},Lo=new we({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:ue.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:ue.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:ue.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:ue.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:ue.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:ue.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:ue.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:ue.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Ii=new zn(void 0,"__schema",{type:new V(br),description:"Access the current type schema of this server.",resolve:(e,t,n,{schema:r})=>r}),vi=new zn(void 0,"__type",{type:mt,description:"Request the type information of a single type.",args:{name:{type:new V(ie)}},resolve:(e,{name:t},n,{schema:r})=>r.getType(t)}),bi=new zn(void 0,"__typename",{type:new V(ie),description:"The name of the current Object type at runtime.",resolve:(e,t,n,{parentType:r})=>r.name}),Mt=Object.freeze([br,Ao,xo,mt,wo,_r,Ro,Lo]);function ht(e){return Mt.some(({name:t})=>e.name===t)}function rr(e){return Le(e,kc,ot)}function Sr(e){if(!rr(e))throw Error(`Expected ${y(e)} to be a GraphQL schema.`);return e}var kc=Symbol("Schema");class ot{constructor(e){this.__kind=kc,this.assumeValid=e.assumeValid??!1,this.__validationErrors=e.assumeValid===!0?[]:void 0,this.description=e.description,this.extensions=We(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives??je;let t=new Set(e.types);if(e.types!=null)for(let n of e.types)t.delete(n),Ut(n,t);if(this._queryType!=null)Ut(this._queryType,t);if(this._mutationType!=null)Ut(this._mutationType,t);if(this._subscriptionType!=null)Ut(this._subscriptionType,t);for(let n of this._directives)if(nr(n))for(let r of n.args)Ut(r.type,t);Ut(br,t),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(let n of t){if(n==null)continue;let r=n.name;if(this._typeMap[r]!==void 0)throw Error(`Schema must contain uniquely named types but contains multiple types named "${r}".`);if(this._typeMap[r]=n,P(n)){for(let i of n.getInterfaces())if(P(i)){let o=this._implementationsMap[i.name];o??=this._implementationsMap[i.name]={objects:[],interfaces:[]},o.interfaces.push(n)}}else if(L(n)){for(let i of n.getInterfaces())if(P(i)){let o=this._implementationsMap[i.name];o??=this._implementationsMap[i.name]={objects:[],interfaces:[]},o.objects.push(n)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case re.QUERY:return this.getQueryType();case re.MUTATION:return this.getMutationType();case re.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return te(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){return this._implementationsMap[e.name]??{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap.get(e);if(n===void 0){if(te(e))n=new Set(e.getTypes());else{let r=this.getImplementations(e);n=new Set([...r.objects,...r.interfaces])}this._subTypeMap.set(e,n)}return n.has(t)}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find((t)=>t.name===e)}getField(e,t){switch(t){case Ii.name:return this.getQueryType()===e?Ii:void 0;case vi.name:return this.getQueryType()===e?vi:void 0;case bi.name:return bi}if("getFields"in e)return e.getFields()[t];return}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.assumeValid}}}function Ut(e,t){let n=pe(e);if(!t.has(n)){if(t.add(n),te(n))for(let r of n.getTypes())Ut(r,t);else if(L(n)||P(n)){for(let r of n.getInterfaces())Ut(r,t);for(let r of Object.values(n.getFields())){Ut(r.type,t);for(let i of r.args)Ut(i.type,t)}}else if(k(n))for(let r of Object.values(n.getFields()))Ut(r.type,t)}return t}function Di(e){if(Sr(e),e.__validationErrors)return e.__validationErrors;let t=new Uc(e);qf(t),Kf(t),Jf(t);let n=t.getErrors();return e.__validationErrors=n,n}function Dr(e){let t=Di(e);if(t.length!==0)throw Error(t.map((n)=>n.message).join(` + +`))}class Uc{constructor(e){this._errors=[],this.schema=e}reportError(e,t){let n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new m(e,{nodes:n}))}getErrors(){return this._errors}}function qf(e){let t=e.schema;if(t.getQueryType()==null)e.reportError("Query root type must be provided.",t.astNode);let n=new Fe;for(let r of Object.values(re)){let i=t.getRootType(r);if(i!=null)if(!L(i)){let o=Vu(r),s=y(i);e.reportError(r===re.QUERY?`${o} root type must be Object type, it cannot be ${s}.`:`${o} root type must be Object type if provided, it cannot be ${s}.`,Fc(t,r)??i.astNode)}else n.add(i,r)}for(let[r,i]of n)if(i.length>1){let o=Uu(i);e.reportError(`All root types must be different, "${r}" type is used as ${o} root types.`,i.map((s)=>Fc(t,s)))}}function Fc(e,t){return[e.astNode,...e.extensionASTNodes].flatMap((n)=>n?.operationTypes??[]).find((n)=>n.operation===t)?.type}function Kf(e){for(let t of e.schema.getDirectives()){if(!nr(t)){e.reportError(`Expected directive but got: ${y(t)}.`,t?.astNode);continue}if(ir(e,t),t.locations.length===0)e.reportError(`Directive ${t} must include 1 or more locations.`,t.astNode);for(let n of t.args){if(ir(e,n),!xe(n.type))e.reportError(`The type of ${n} must be Input Type but got: ${y(n.type)}.`,n.astNode);if(ze(n)&&n.deprecationReason!=null)e.reportError(`Required argument ${n} cannot be deprecated.`,[ko(n.astNode),n.astNode?.type]);ga(e,n)}}}function ga(e,t){let n=t.default;if(!n)return;let r=[];if(Na(n,t.type,(i,o)=>{r.push([i,o])}),r.length===0)return;if(!n.literal)try{let i=_i(n.value,t.type),o=[];if(Zn(i,t.type,(s,a)=>{o.push([s,a])}),o.length===0){e.reportError(`${t} has invalid default value: ${y(n.value)}. Did you mean: ${y(i)}?`,t.astNode?.defaultValue);return}}catch(i){}for(let[i,o]of r)e.reportError(`${t} has invalid default value${qn(o)}: ${i.message}`,i.nodes??t.astNode?.defaultValue)}function Na(e,t,n,r){if(e.literal){xn(e.literal,t,n,void 0,void 0,r);return}Zn(e.value,t,n,r)}function _i(e,t){if(w(t))return _i(e,t.ofType);if(e===null)return null;if(j(t)){if(et(e))return Array.from(e,(n)=>_i(n,t.ofType));return[_i(e,t.ofType)]}if(k(t)){if(!ye(e))U(!1);let n=t.getFields();return Gt(e,(r,i)=>{if(!(i in n))U(!1);return _i(r,n[i].type)})}return It(t),t.coerceOutputValue(e)}function ir(e,t){if(t.name.startsWith("__"))e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function Jf(e){let t=rd(e),n=e.schema.getTypeMap(),r=new Map;for(let o of Object.values(n)){if(!rt(o)){e.reportError(`Expected GraphQL named type but got: ${y(o)}.`,o.astNode);continue}if(!ht(o))ir(e,o);if(L(o))Cc(e,o),Vc(e,o);else if(P(o))Cc(e,o),Vc(e,o);else if(te(o))zf(e,o);else if(z(o))Xf(e,o);else if(k(o))Zf(e,o),i(o),t(o)}td(e,r);function i(o){r.set(o,{inputObj:o,targets:[],dependents:[],unresolvedTargetCount:0,hasFiniteValue:!1})}}function Cc(e,t){let n=Object.values(t.getFields());if(n.length===0)e.reportError(`Type ${t} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let r of n){if(ir(e,r),!Nt(r.type))e.reportError(`The type of ${r} must be Output Type but got: ${y(r.type)}.`,r.astNode?.type);for(let i of r.args){if(ir(e,i),!xe(i.type))e.reportError(`The type of ${i} must be Input Type but got: ${y(i.type)}.`,i.astNode?.type);if(ze(i)&&i.deprecationReason!=null)e.reportError(`Required argument ${i} cannot be deprecated.`,[ko(i.astNode),i.astNode?.type]);ga(e,i)}}}function Vc(e,t){let n=new Set;for(let r of t.getInterfaces()){if(!P(r)){e.reportError(`Type ${t} must only implement Interface types, it cannot implement ${y(r)}.`,Si(t,r));continue}if(t===r){e.reportError(`Type ${t} cannot implement itself because it would create a circular reference.`,Si(t,r));continue}if(n.has(r.name)){e.reportError(`Type ${t} can only implement ${r} once.`,Si(t,r));continue}n.add(r.name),Hf(e,t,r),Wf(e,t,r)}}function Wf(e,t,n){let r=t.getFields();for(let i of Object.values(n.getFields())){let o=r[i.name];if(o==null){e.reportError(`Interface field ${i} expected but ${t} does not provide it.`,[i.astNode,t.astNode,...t.extensionASTNodes]);continue}if(!Ht(e.schema,o.type,i.type))e.reportError(`Interface field ${i} expects type ${i.type} but ${o} is type ${o.type}.`,[i.astNode?.type,o.astNode?.type]);for(let s of i.args){let a=o.args.find((u)=>u.name===s.name);if(!a){e.reportError(`Interface field argument ${s} expected but ${o} does not provide it.`,[s.astNode,o.astNode]);continue}if(!Nr(s.type,a.type))e.reportError(`Interface field argument ${s} expects type ${s.type} but ${a} is type ${a.type}.`,[s.astNode?.type,a.astNode?.type])}for(let s of o.args)if(ze(s)){if(!i.args.find((u)=>u.name===s.name))e.reportError(`Argument "${s}" must not be required type "${s.type}" if not provided by the Interface field "${i}".`,[s.astNode,i.astNode])}if(o.deprecationReason!=null&&i.deprecationReason==null)e.reportError(`Interface field ${n.name}.${i.name} is not deprecated, so implementation field ${t.name}.${o.name} must not be deprecated.`,[ko(o.astNode),o.astNode?.type])}}function Hf(e,t,n){let r=t.getInterfaces();for(let i of n.getInterfaces())if(!r.includes(i))e.reportError(i===t?`Type ${t} cannot implement ${n} because it would create a circular reference.`:`Type ${t} must implement ${i} because it is implemented by ${n}.`,[...Si(n,i),...Si(t,n)])}function zf(e,t){let n=t.getTypes();if(n.length===0)e.reportError(`Union type ${t} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let r=new Set;for(let i of n){if(r.has(i.name)){e.reportError(`Union type ${t} can only include type ${i} once.`,Mc(t,i.name));continue}if(r.add(i.name),!L(i))e.reportError(`Union type ${t} can only include Object types, it cannot include ${y(i)}.`,Mc(t,String(i)))}}function Xf(e,t){let n=t.getValues();if(n.length===0)e.reportError(`Enum type ${t} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(let r of n)ir(e,r)}function Zf(e,t){let n=Object.values(t.getFields());if(n.length===0)e.reportError(`Input Object type ${t} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let r of n){if(ir(e,r),!xe(r.type))e.reportError(`The type of ${r} must be Input Type but got: ${y(r.type)}.`,r.astNode?.type);if(Xe(r)&&r.deprecationReason!=null)e.reportError(`Required input field ${r} cannot be deprecated.`,[ko(r.astNode),r.astNode?.type]);if(ga(e,r),t.isOneOf)ed(t,r,e)}}function ed(e,t,n){if(w(t.type))n.reportError(`OneOf input field ${e}.${t.name} must be nullable.`,t.astNode?.type);if(t.default!==void 0||t.defaultValue!==void 0)n.reportError(`OneOf input field ${e}.${t.name} cannot have a default value.`,t.astNode)}function td(e,t){let n=[];for(let c of t.values()){let l=c.inputObj,p=Object.values(l.getFields());for(let f of p){let d=nd(l,f.type);if(d===void 0)continue;c.targets.push({field:f,target:d});let E=t.get(d);if(E!==void 0)E.dependents.push(c)}if(l.isOneOf){if(p.length===0||c.targets.length<p.length)a(c)}else if(c.unresolvedTargetCount=c.targets.length,c.targets.length===0)a(c)}let r;while((r=n.pop())!==void 0)for(let c of r.dependents){if(c.hasFiniteValue)continue;if(c.inputObj.isOneOf){a(c);continue}if(--c.unresolvedTargetCount,c.unresolvedTargetCount===0)a(c)}let i=new Set,o=[],s=new Map;for(let c of t.values())if(!c.hasFiniteValue)u(c);function a(c){if(!c.hasFiniteValue)c.hasFiniteValue=!0,n.push(c)}function u(c){let l=c.inputObj;if(i.has(l))return;i.add(l),s.set(l,o.length);for(let{field:p,target:f}of c.targets){let d=t.get(f);if(d?.hasFiniteValue!==!1)continue;let E=s.get(f);if(o.push({fieldStr:`${l}.${p.name}`,astNode:p.astNode}),E===void 0)u(d);else{let I=o.slice(E),S=I.map((G)=>G.fieldStr).join(", ");e.reportError(`Input Object ${f} cannot be provided a finite value because it references itself through fields: ${S}.`,I.map((G)=>G.astNode))}o.pop()}s.delete(l)}}function nd(e,t){if(e.isOneOf){if(k(t))return t;return}if(w(t)&&k(t.ofType))return t.ofType}function rd(e){let t=Object.create(null),n=[],r=Object.create(null);return function(u){return i(u,Object.create(null))};function i(a,u){if(et(u)){for(let c of u)i(a,c);return}else if(!ye(u))return;for(let c of Object.values(a.getFields())){let l=pe(c.type);if(!k(l))continue;if(Object.hasOwn(u,c.name))i(l,u[c.name]);else s(c,l,`${a}.${c.name}`)}}function o(a,u){if(u.kind===Ae){for(let l of u.values)o(a,l);return}else if(u.kind!==Ve)return;let c=sn(u.fields,(l)=>l.name.value);for(let l of Object.values(a.getFields())){let p=pe(l.type);if(!k(p))continue;if(Object.hasOwn(c,l.name))o(p,c[l.name].value);else s(l,p,`${a}.${l.name}`)}}function s(a,u,c){let l=a.default;if(l===void 0)return;let p=r[c];if(p!==void 0){e.reportError(`Invalid circular reference. The default value of Input Object field ${c} references itself${p<n.length?` via the default values of: ${n.slice(p).map(([f])=>f).join(", ")}`:""}.`,n.slice(p-1).map(([,f])=>f));return}if(t[c]===void 0){if(t[c]=!0,r[c]=n.push([c,a.astNode?.defaultValue]),l.literal)o(u,l.literal);else i(u,l.value);n.pop(),r[c]=void 0}}}function Si(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n!=null?[n,...r]:r).flatMap((o)=>o.interfaces??[]).filter((o)=>o.name.value===t.name)}function Mc(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n!=null?[n,...r]:r).flatMap((o)=>o.types??[]).filter((o)=>o.name.value===t)}function ko(e){return e?.directives?.find((t)=>t.name.value===mn.name)}function de(e,t,n){return new m(`Syntax Error: ${n}`,{source:e,positions:[t]})}function id(){let e;try{let t=globalThis.process;if(typeof t?.getBuiltinModule==="function")e=t.getBuiltinModule("node:diagnostics_channel")}catch{}return e}var or=id(),Ia=or?.tracingChannel("graphql:parse"),va=or?.tracingChannel("graphql:validate"),Oi=or?.tracingChannel("graphql:execute"),Pc=or?.tracingChannel("graphql:execute:variableCoercion"),ba=or?.tracingChannel("graphql:execute:rootSelectionSet"),_a=or?.tracingChannel("graphql:subscribe"),sr=or?.tracingChannel("graphql:resolve"),od=["start","end","asyncStart","asyncEnd","error"];function st(e){if(e==null)return!1;let t=e.hasSubscribers;if(t!==void 0)return t;for(let n of od)if(e[n].hasSubscribers)return!0;return!1}function Cn(e,t,n){let r=t;return e.start.runStores(r,()=>{let i;try{i=n()}catch(o){throw r.error=o,e.error.publish(r),e.end.publish(r),o}if(!Be(i))return r.result=i,e.end.publish(r),i;return e.end.publish(r),i.then((o)=>(r.result=o,e.asyncStart.publish(r),e.asyncEnd.publish(r),o),(o)=>{throw r.error=o,e.error.publish(r),e.asyncStart.publish(r),e.asyncEnd.publish(r),o})})}var T={SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",DOT:".",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"};class ar{constructor(e){let t=new bn(T.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==T.EOF)do if(e.next)e=e.next;else{let t=sd(this,e.end);e.next=t,t.prev=e,e=t}while(e.kind===T.COMMENT);return e}}function Co(e){return e===T.BANG||e===T.DOLLAR||e===T.AMP||e===T.PAREN_L||e===T.PAREN_R||e===T.DOT||e===T.SPREAD||e===T.COLON||e===T.EQUALS||e===T.AT||e===T.BRACKET_L||e===T.BRACKET_R||e===T.BRACE_L||e===T.PIPE||e===T.BRACE_R}function Or(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Vo(e,t){return Gc(e.charCodeAt(t))&&jc(e.charCodeAt(t+1))}function Gc(e){return e>=55296&&e<=56319}function jc(e){return e>=56320&&e<=57343}function hn(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return T.EOF;else if(n>=32&&n<=126){let r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function me(e,t,n,r,i){let o=e.line,s=1+n-e.lineStart;return new bn(t,n,r,o,s,i)}function sd(e,t){let n=e.source.body,r=n.length,i=t;while(i<r){let o=n.charCodeAt(i);switch(o){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:if(n.charCodeAt(i+1)===10)i+=2;else++i;++e.line,e.lineStart=i;continue;case 35:return ad(e,i);case 33:return me(e,T.BANG,i,i+1);case 36:return me(e,T.DOLLAR,i,i+1);case 38:return me(e,T.AMP,i,i+1);case 40:return me(e,T.PAREN_L,i,i+1);case 41:return me(e,T.PAREN_R,i,i+1);case 46:{let s=n.charCodeAt(i+1);if(s===46&&n.charCodeAt(i+2)===46)return me(e,T.SPREAD,i,i+3);if(s===46)throw de(e.source,i,'Unexpected "..", did you mean "..."?');else if(Kn(s)){let a=e.source.body.slice(i+1,Fo(e,i+1,s));throw de(e.source,i,`Invalid number, expected digit before ".", did you mean "0.${a}"?`)}break}case 58:return me(e,T.COLON,i,i+1);case 61:return me(e,T.EQUALS,i,i+1);case 64:return me(e,T.AT,i,i+1);case 91:return me(e,T.BRACKET_L,i,i+1);case 93:return me(e,T.BRACKET_R,i,i+1);case 123:return me(e,T.BRACE_L,i,i+1);case 124:return me(e,T.PIPE,i,i+1);case 125:return me(e,T.BRACE_R,i,i+1);case 34:if(n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34)return dd(e,i);return cd(e,i)}if(Kn(o)||o===45)return ud(e,i,o);if(Jn(o))return Sa(e,i);throw de(e.source,i,o===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Or(o)||Vo(n,i)?`Unexpected character: ${hn(e,i)}.`:`Invalid character: ${hn(e,i)}.`)}return me(e,T.EOF,r,r)}function ad(e,t){let n=e.source.body,r=n.length,i=t+1;while(i<r){let o=n.charCodeAt(i);if(o===10||o===13)break;if(Or(o))++i;else if(Vo(n,i))i+=2;else break}return me(e,T.COMMENT,t,i,n.slice(t+1,i))}function ud(e,t,n){let r=e.source.body,i=t,o=n,s=!1;if(o===45)o=r.charCodeAt(++i);if(o===48){if(o=r.charCodeAt(++i),Kn(o))throw de(e.source,i,`Invalid number, unexpected digit after 0: ${hn(e,i)}.`)}else i=Fo(e,i,o),o=r.charCodeAt(i);if(o===46)s=!0,o=r.charCodeAt(++i),i=Fo(e,i,o),o=r.charCodeAt(i);if(o===69||o===101){if(s=!0,o=r.charCodeAt(++i),o===43||o===45)o=r.charCodeAt(++i);i=Fo(e,i,o),o=r.charCodeAt(i)}if(o===46||Jn(o))throw de(e.source,i,`Invalid number, expected digit but got: ${hn(e,i)}.`);return me(e,s?T.FLOAT:T.INT,t,i,r.slice(t,i))}function Fo(e,t,n){if(!Kn(n))throw de(e.source,t,`Invalid number, expected digit but got: ${hn(e,t)}.`);let r=e.source.body,i=t+1;while(Kn(r.charCodeAt(i)))++i;return i}function cd(e,t){let n=e.source.body,r=n.length,i=t+1,o=i,s="";while(i<r){let a=n.charCodeAt(i);if(a===34)return s+=n.slice(o,i),me(e,T.STRING,t,i+1,s);if(a===92){s+=n.slice(o,i);let u=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?ld(e,i):pd(e,i):fd(e,i);s+=u.value,i+=u.size,o=i;continue}if(a===10||a===13)break;if(Or(a))++i;else if(Vo(n,i))i+=2;else throw de(e.source,i,`Invalid character within String: ${hn(e,i)}.`)}throw de(e.source,i,"Unterminated string.")}function ld(e,t){let n=e.source.body,r=0,i=3;while(i<12){let o=n.charCodeAt(t+i++);if(o===125){if(i<5||!Or(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|Ai(o),r<0)break}throw de(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function pd(e,t){let n=e.source.body,r=$c(n,t+2);if(Or(r))return{value:String.fromCodePoint(r),size:6};if(Gc(r)){if(n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let i=$c(n,t+8);if(jc(i))return{value:String.fromCodePoint(r,i),size:12}}}throw de(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function $c(e,t){return Ai(e.charCodeAt(t))<<12|Ai(e.charCodeAt(t+1))<<8|Ai(e.charCodeAt(t+2))<<4|Ai(e.charCodeAt(t+3))}function Ai(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function fd(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:` +`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw de(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function dd(e,t){let n=e.source.body,r=n.length,i=e.lineStart,o=t+3,s=o,a="",u=[];while(o<r){let c=n.charCodeAt(o);if(c===34&&n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34){a+=n.slice(s,o),u.push(a);let l=me(e,T.BLOCK_STRING,t,o+3,Bu(u).join(` +`));return e.line+=u.length-1,e.lineStart=i,l}if(c===92&&n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34&&n.charCodeAt(o+3)===34){a+=n.slice(s,o),s=o+1,o+=4;continue}if(c===10||c===13){if(a+=n.slice(s,o),u.push(a),c===13&&n.charCodeAt(o+1)===10)o+=2;else++o;a="",s=o,i=o;continue}if(Or(c))++o;else if(Vo(n,o))o+=2;else throw de(e.source,o,`Invalid character within String: ${hn(e,o)}.`)}throw de(e.source,o,"Unterminated string.")}function Sa(e,t){let n=e.source.body,r=n.length,i=t+1;while(i<r){let o=n.charCodeAt(i);if(go(o))++i;else break}return me(e,T.NAME,t,i,n.slice(t,i))}class Da{constructor(e){this.line=1,this.lineStart=0;let t=new bn(T.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t}get[Symbol.toStringTag](){return"SchemaCoordinateLexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==T.EOF){let t=md(this,e.end);e.next=t,t.prev=e,e=t}return e}}function md(e,t){let n=e.source.body,r=n.length,i=t;if(i<r){let o=n.charCodeAt(i);switch(o){case 46:return me(e,T.DOT,i,i+1);case 40:return me(e,T.PAREN_L,i,i+1);case 41:return me(e,T.PAREN_R,i,i+1);case 58:return me(e,T.COLON,i,i+1);case 64:return me(e,T.AT,i,i+1)}if(Jn(o))return Sa(e,i);throw de(e.source,i,`Invalid character: ${hn(e,i)}.`)}return me(e,T.EOF,r,r)}var Bc=Symbol("Source");class Pt{constructor(e,t="GraphQL request",n={line:1,column:1}){if(this.__kind=Bc,this.body=e,this.name=t,this.locationOffset=n,!(this.locationOffset.line>0))nt(!1,"line in locationOffset is 1-indexed and must be positive.");if(!(this.locationOffset.column>0))nt(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function xi(e){return Le(e,Bc,Pt)}function bt(e,t){return st(Ia)?Ia.traceSync(()=>Qc(e,t),{source:e}):Qc(e,t)}function Qc(e,t){let n=new Ar(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}function Yc(e,t){let n=new Ar(e,t);n.expectToken(T.SOF);let r=n.parseValueLiteral(!1);return n.expectToken(T.EOF),r}function Uo(e,t){let n=new Ar(e,t);n.expectToken(T.SOF);let r=n.parseConstValueLiteral();return n.expectToken(T.EOF),r}function qc(e,t){let n=new Ar(e,t);n.expectToken(T.SOF);let r=n.parseTypeReference();return n.expectToken(T.EOF),r}function Po(e){let t=xi(e)?e:new Pt(e),n=new Da(t),r=new Ar(e,{lexer:n});r.expectToken(T.SOF);let i=r.parseSchemaCoordinate();return r.expectToken(T.EOF),i}class Ar{constructor(e,t={}){let{lexer:n,...r}=t;if(n)this._lexer=n;else{let i=xi(e)?e:new Pt(e);this._lexer=new ar(i)}this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let e=this.expectToken(T.NAME);return this.node(e,{kind:Ne,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:jt,definitions:this.many(T.SOF,this.parseDefinition,T.EOF)})}parseDefinition(){if(this.peek(T.BRACE_L))return this.parseOperationDefinition();let e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===T.BRACE_L)throw de(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(t.kind===T.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(e)throw de(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");switch(t.value){case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){let e=this._lexer.token;if(this.peek(T.BRACE_L))return this.node(e,{kind:Tt,operation:re.QUERY,description:void 0,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});let t=this.parseDescription(),n=this.parseOperationType(),r;if(this.peek(T.NAME))r=this.parseName();return this.node(e,{kind:Tt,operation:n,description:t,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let e=this.expectToken(T.NAME);switch(e.value){case"query":return re.QUERY;case"mutation":return re.MUTATION;case"subscription":return re.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(T.PAREN_L,this.parseVariableDefinition,T.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:ri,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(T.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(T.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let e=this._lexer.token;return this.expectToken(T.DOLLAR),this.node(e,{kind:Ce,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:ao,selections:this.many(T.BRACE_L,this.parseSelection,T.BRACE_R)})}parseSelection(){return this.peek(T.SPREAD)?this.parseFragment():this.parseField()}parseField(){let e=this._lexer.token,t=this.parseName(),n,r;if(this.expectOptionalToken(T.COLON))n=t,r=this.parseName();else r=t;return this.node(e,{kind:an,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(T.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){let t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(T.PAREN_L,t,T.PAREN_R)}parseFragmentArguments(){let e=this.parseFragmentArgument;return this.optionalMany(T.PAREN_L,e,T.PAREN_R)}parseArgument(e=!1){let t=this._lexer.token,n=this.parseName();return this.expectToken(T.COLON),this.node(t,{kind:ii,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){let e=this._lexer.token,t=this.parseName();return this.expectToken(T.COLON),this.node(e,{kind:uo,name:t,value:this.parseValueLiteral(!1)})}parseFragment(){let e=this._lexer.token;this.expectToken(T.SPREAD);let t=this.expectOptionalKeyword("on");if(!t&&this.peek(T.NAME)){let n=this.parseFragmentName();if(this.peek(T.PAREN_L)&&this._options.experimentalFragmentArguments)return this.node(e,{kind:Dt,name:n,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)});return this.node(e,{kind:Dt,name:n,directives:this.parseDirectives(!1)})}return this.node(e,{kind:_n,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let e=this._lexer.token,t=this.parseDescription();if(this.expectKeyword("fragment"),this._options.experimentalFragmentArguments===!0)return this.node(e,{kind:Qe,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()});return this.node(e,{kind:Qe,description:t,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(e){let t=this._lexer.token;switch(t.kind){case T.BRACKET_L:return this.parseList(e);case T.BRACE_L:return this.parseObject(e);case T.INT:return this.advanceLexer(),this.node(t,{kind:Oe,value:t.value});case T.FLOAT:return this.advanceLexer(),this.node(t,{kind:Bt,value:t.value});case T.STRING:case T.BLOCK_STRING:return this.parseStringLiteral();case T.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:tt,value:!0});case"false":return this.node(t,{kind:tt,value:!1});case"null":return this.node(t,{kind:le});default:return this.node(t,{kind:Ot,value:t.value})}case T.DOLLAR:if(e)if(this.expectToken(T.DOLLAR),this._lexer.token.kind===T.NAME){let n=this._lexer.token.value;throw de(this._lexer.source,t.start,`Unexpected variable "$${n}" in constant value.`)}else throw this.unexpected(t);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:Ie,value:e.value,block:e.kind===T.BLOCK_STRING})}parseList(e){let t=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:Ae,values:this.any(T.BRACKET_L,t,T.BRACKET_R)})}parseObject(e){let t=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:Ve,fields:this.any(T.BRACE_L,t,T.BRACE_R)})}parseObjectField(e){let t=this._lexer.token,n=this.parseName();return this.expectToken(T.COLON),this.node(t,{kind:un,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){let t=[];while(this.peek(T.AT))t.push(this.parseDirective(e));if(t.length)return t;return}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){let t=this._lexer.token;return this.expectToken(T.AT),this.node(t,{kind:oi,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){let e=this._lexer.token,t;if(this.expectOptionalToken(T.BRACKET_L)){let n=this.parseTypeReference();this.expectToken(T.BRACKET_R),t=this.node(e,{kind:Dn,type:n})}else t=this.parseNamedType();if(this.expectOptionalToken(T.BANG))return this.node(e,{kind:cn,type:t});return t}parseNamedType(){return this.node(this._lexer.token,{kind:Sn,name:this.parseName()})}peekDescription(){return this.peek(T.STRING)||this.peek(T.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");let n=this.parseConstDirectives(),r=this.many(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);return this.node(e,{kind:Ye,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){let e=this._lexer.token,t=this.parseOperationType();this.expectToken(T.COLON);let n=this.parseNamedType();return this.node(e,{kind:si,operation:t,type:n})}parseScalarTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");let n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:Qt,description:t,name:n,directives:r})}parseObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:At,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(T.AMP,this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(T.BRACE_L,this.parseFieldDefinition,T.BRACE_R)}parseFieldDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(T.COLON);let i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:co,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(T.PAREN_L,this.parseInputValueDef,T.PAREN_R)}parseInputValueDef(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(T.COLON);let r=this.parseTypeReference(),i;if(this.expectOptionalToken(T.EQUALS))i=this.parseConstValueLiteral();let o=this.parseConstDirectives();return this.node(e,{kind:ai,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:xt,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:wt,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(T.EQUALS)?this.delimitedMany(T.PIPE,this.parseNamedType):void 0}parseEnumTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:Yt,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(T.BRACE_L,this.parseEnumValueDefinition,T.BRACE_R)}parseEnumValueDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:lo,description:t,name:n,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw de(this._lexer.source,this._lexer.token.start,`${Mo(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:yt,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(T.BRACE_L,this.parseInputValueDef,T.BRACE_R)}parseTypeSystemExtension(){let e=this._lexer.lookahead();if(e.kind===T.NAME)switch(e.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();case"directive":return this.parseDirectiveExtension()}throw this.unexpected(e)}parseSchemaExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let t=this.parseConstDirectives(),n=this.optionalMany(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);if(t===void 0&&n===void 0)throw this.unexpected();return this.node(e,{kind:Rt,directives:t,operationTypes:n})}parseScalarTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let t=this.parseName(),n=this.parseConstDirectives();if(n===void 0)throw this.unexpected();return this.node(e,{kind:ln,name:t,directives:n})}parseObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(n===void 0&&r===void 0&&i===void 0)throw this.unexpected();return this.node(e,{kind:qt,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(n===void 0&&r===void 0&&i===void 0)throw this.unexpected();return this.node(e,{kind:Kt,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(n===void 0&&r===void 0)throw this.unexpected();return this.node(e,{kind:Jt,name:t,directives:n,types:r})}parseEnumTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(n===void 0&&r===void 0)throw this.unexpected();return this.node(e,{kind:pn,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(n===void 0&&r===void 0)throw this.unexpected();return this.node(e,{kind:Lt,name:t,directives:n,fields:r})}parseDirectiveExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(T.AT);let t=this.parseName(),n=this.parseConstDirectives();if(n===void 0)throw this.unexpected();return this.node(e,{kind:Tr,name:t,directives:n})}parseDirectiveDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(T.AT);let n=this.parseName(),r=this.parseArgumentDefs(),i=this.parseConstDirectives(),o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let s=this.parseDirectiveLocations();return this.node(e,{kind:pt,description:t,name:n,arguments:r,directives:i,repeatable:o,locations:s})}parseDirectiveLocations(){return this.delimitedMany(T.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let e=this._lexer.token,t=this.parseName();if(Object.hasOwn(F,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){let e=this._lexer.token,t=this.expectOptionalToken(T.AT),n=this.parseName(),r;if(!t&&this.expectOptionalToken(T.DOT))r=this.parseName();let i;if((t||r)&&this.expectOptionalToken(T.PAREN_L))i=this.parseName(),this.expectToken(T.COLON),this.expectToken(T.PAREN_R);if(t){if(i)return this.node(e,{kind:Eo,name:n,argumentName:i});return this.node(e,{kind:ho,name:n})}else if(r){if(i)return this.node(e,{kind:mo,name:n,fieldName:r,argumentName:i});return this.node(e,{kind:fo,name:n,memberName:r})}return this.node(e,{kind:po,name:n})}node(e,t){if(this._options.noLocation!==!0)t.loc=new ei(e,this._lexer.lastToken,this._lexer.source);return t}peek(e){return this._lexer.token.kind===e}expectToken(e){let t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw de(this._lexer.source,t.start,`Expected ${Kc(e)}, found ${Mo(t)}.`)}expectOptionalToken(e){if(this._lexer.token.kind===e)return this.advanceLexer(),!0;return!1}expectKeyword(e){let t=this._lexer.token;if(t.kind===T.NAME&&t.value===e)this.advanceLexer();else throw de(this._lexer.source,t.start,`Expected "${e}", found ${Mo(t)}.`)}expectOptionalKeyword(e){let t=this._lexer.token;if(t.kind===T.NAME&&t.value===e)return this.advanceLexer(),!0;return!1}unexpected(e){let t=e??this._lexer.token;return de(this._lexer.source,t.start,`Unexpected ${Mo(t)}.`)}any(e,t,n){this.expectToken(e);let r=[];while(!this.expectOptionalToken(n))r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){let r=[];do r.push(t.call(this));while(!this.expectOptionalToken(n));return r}return}many(e,t,n){this.expectToken(e);let r=[];do r.push(t.call(this));while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);let n=[];do n.push(t.call(this));while(this.expectOptionalToken(e));return n}advanceLexer(){let{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==T.EOF){if(++this._tokenCounter,e!==void 0&&this._tokenCounter>e)throw de(this._lexer.source,t.start,`Document contains more than ${e} tokens. Parsing aborted.`)}}}function Mo(e){let t=e.value;return Kc(e.kind)+(t!=null?` "${t}"`:"")}function Kc(e){return Co(e)?`"${e}"`:e}function Te(e,t){switch(t.kind){case Dn:{let n=Te(e,t.type);return n&&new oe(n)}case cn:{let n=Te(e,t.type);return n&&new V(n)}case Sn:return e.getType(t.name.value)}}class ur{constructor(e,t,n){if(this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._fragmentSignaturesByName=n??(()=>null),this._fragmentSignature=null,this._fragmentArgument=null,t){if(xe(t))this._inputTypeStack.push(t);if(dt(t))this._parentTypeStack.push(t);if(Nt(t))this._typeStack.push(t)}}get[Symbol.toStringTag](){return"TypeInfo"}getType(){return this._typeStack.at(-1)}getParentType(){return this._parentTypeStack.at(-1)}getInputType(){return this._inputTypeStack.at(-1)}getParentInputType(){return this._inputTypeStack.at(-2)}getFieldDef(){return this._fieldDefStack.at(-1)}getDefaultValue(){return this._defaultValueStack.at(-1)}getDirective(){return this._directive}getArgument(){return this._argument}getFragmentSignature(){return this._fragmentSignature}getFragmentSignatureByName(){return this._fragmentSignaturesByName}getFragmentArgument(){return this._fragmentArgument}getEnumValue(){return this._enumValue}enter(e){let t=this._schema;switch(e.kind){case jt:{let n=hd(e);this._fragmentSignaturesByName=(r)=>n.get(r);break}case ao:{let n=pe(this.getType());this._parentTypeStack.push(dt(n)?n:void 0);break}case an:{let n=this.getParentType(),r,i;if(n){if(r=t.getField(n,e.name.value),r)i=r.type}this._fieldDefStack.push(r),this._typeStack.push(Nt(i)?i:void 0);break}case oi:this._directive=t.getDirective(e.name.value);break;case Tt:{let n=t.getRootType(e.operation);this._typeStack.push(L(n)?n:void 0);break}case Dt:{this._fragmentSignature=this.getFragmentSignatureByName()(e.name.value);break}case _n:case Qe:{let n=e.typeCondition,r=n?Te(t,n):pe(this.getType());this._typeStack.push(Nt(r)?r:void 0);break}case ri:{let n=Te(t,e.type);this._inputTypeStack.push(xe(n)?n:void 0);break}case ii:{let n,r,i=this.getDirective()??this.getFieldDef();if(i){if(n=i.args.find((o)=>o.name===e.name.value),n)r=n.type}this._argument=n,this._defaultValueStack.push(n?.default??n?.defaultValue??void 0),this._inputTypeStack.push(xe(r)?r:void 0);break}case uo:{let r=this.getFragmentSignature()?.variableDefinitions.get(e.name.value);this._fragmentArgument=r;let i;if(r)i=Te(this._schema,r.type);this._inputTypeStack.push(xe(i)?i:void 0);break}case Ae:{let n=gr(this.getInputType()),r=j(n)?n.ofType:void 0;this._defaultValueStack.push(void 0),this._inputTypeStack.push(xe(r)?r:void 0);break}case un:{let n=pe(this.getInputType()),r,i;if(k(n)){if(i=n.getFields()[e.name.value],i!=null)r=i.type}this._defaultValueStack.push(i?.default??i?.defaultValue??void 0),this._inputTypeStack.push(xe(r)?r:void 0);break}case Ot:{let n=pe(this.getInputType()),r;if(z(n))r=n.getValue(e.value);this._enumValue=r;break}default:}}leave(e){switch(e.kind){case jt:this._fragmentSignaturesByName=()=>null;break;case ao:this._parentTypeStack.pop();break;case an:this._fieldDefStack.pop(),this._typeStack.pop();break;case oi:this._directive=null;break;case Dt:this._fragmentSignature=null;break;case Tt:case _n:case Qe:this._typeStack.pop();break;case ri:this._inputTypeStack.pop();break;case ii:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case uo:{this._fragmentArgument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break}case Ae:case un:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case Ot:this._enumValue=null;break;default:}}}function hd(e){let t=new Map;for(let n of e.definitions)if(n.kind===Qe){let r=new Map;if(n.variableDefinitions)for(let o of n.variableDefinitions)r.set(o.variable.name.value,o);let i={definition:n,variableDefinitions:r};t.set(n.name.value,i)}return t}function xr(e,t){return{enter(...n){let r=n[0];e.enter(r);let i=Hn(t,r.kind).enter;if(i){let o=i.apply(t,n);if(o!==void 0){if(e.leave(r),ni(o))e.enter(o)}return o}},leave(...n){let r=n[0],i=Hn(t,r.kind).leave,o;if(i)o=i.apply(t,n);return e.leave(r),o}}}function $o(e){let t=new Map;return{Directive(n){if(n.name.value===Xt.name||n.name.value===vt.name){let i=n.arguments?.find((s)=>s.name.value==="label")?.value;if(!i||i.kind===le)return;if(i.kind!==Ie){e.reportError(new m(`Argument "@${n.name.value}(label:)" must be a static string.`,{nodes:n}));return}let o=t.get(i.value);if(o!=null)e.reportError(new m('Value for arguments "defer(label:)" and "stream(label:)" must be unique across all Defer/Stream directive usages.',{nodes:[o,n]}));else t.set(i.value,n)}}}}function Go(e){return{OperationDefinition(t){let n=e.getDocument(),r=new Map;for(let s of n.definitions)if(s.kind===Qe)r.set(s.name.value,s);if(t.operation!=="subscription"&&t.operation!=="mutation")return;let o=e.getSchema().getRootType(t.operation);if(o)Oa({context:e,operationType:t.operation,rootType:o,fragments:r,selectionSet:t.selectionSet,visitedFragments:new Set})}}}function Oa({context:e,operationType:t,rootType:n,fragments:r,selectionSet:i,visitedFragments:o}){for(let s of i.selections)if(s.kind==="Field"){let a=s.directives?.find((u)=>u.name.value===vt.name);if(a)e.reportError(new m(`Stream directive cannot be used on root ${t} type "${n}".`,{nodes:a}))}else if(s.kind==="FragmentSpread"){let a=s.name.value;if(o.has(a))continue;let u=r.get(a);if(u){let c=Jc(s);if(c!==void 0)e.reportError(new m(`Defer directive cannot be used on root ${t} type "${n}".`,{nodes:c}));Oa({context:e,operationType:t,rootType:n,fragments:r,selectionSet:u.selectionSet,visitedFragments:o})}o.add(a)}else if(s.kind==="InlineFragment"){let a=Jc(s);if(a!==void 0)e.reportError(new m(`Defer directive cannot be used on root ${t} type "${n}".`,{nodes:a}));Oa({context:e,operationType:t,rootType:n,fragments:r,selectionSet:s.selectionSet,visitedFragments:o})}}function Jc(e){return e.directives?.find((t)=>t.name.value===Xt.name)}function Wc(e){let t=e.arguments?.find((n)=>n.name.value==="if");if(!t)return!1;if(t.value.kind===tt){if(t.value.value)return!1}else if(t.value.kind!==Ce)return!1;return!0}function Ed(e){let t=e.arguments?.find((n)=>n.name.value==="if");if(!t)return!0;if(t.value.kind===tt){if(t.value.value)return!0;return!1}return!0}function Td(e){let t=e.arguments?.find((n)=>n.name.value==="if");if(!t)return!1;if(t?.value.kind===tt){if(t.value.value)return!1;return!0}return!0}function jo(e){return{OperationDefinition(t){if(t.operation!==re.SUBSCRIPTION)return;let n=e.getDocument(),r=new Map;for(let o of n.definitions)if(o.kind===Qe)r.set(o.name.value,o);let i=new Set;Aa({context:e,fragments:r,selectionSet:t.selectionSet,parentNodes:[],visitedFragments:i})}}}function Aa({context:e,fragments:t,selectionSet:n,parentNodes:r,visitedFragments:i}){for(let o of n.selections){let s=o.directives?.find((u)=>u.name.value===kn.name);if(s&&Ed(s))continue;let a=o.directives?.find((u)=>u.name.value===Ln.name);if(a&&Td(a))continue;for(let u of o.directives??[])if(u.name.value===Xt.name){if(!Wc(u))e.reportError(new m("Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.",{nodes:[u,...r]}))}else if(u.name.value===vt.name){if(!Wc(u))e.reportError(new m("Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.",{nodes:[u,...r]}))}if(o.kind==="FragmentSpread"){let u=o.name.value;if(i.has(u))continue;i.add(u);let c=t.get(u);if(c)Aa({context:e,fragments:t,parentNodes:[o,...r],selectionSet:c?.selectionSet,visitedFragments:i})}else if(o.selectionSet)Aa({context:e,fragments:t,selectionSet:o.selectionSet,parentNodes:r,visitedFragments:i})}}function Qo(e){return wi(e)||Ri(e)||Li(e)}function wi(e){return e.kind===Tt||e.kind===Qe}function Yo(e){return e.operation===re.SUBSCRIPTION}function Hc(e){return e.kind===an||e.kind===Dt||e.kind===_n}function xa(e){return e.kind===Ce||e.kind===Oe||e.kind===Bt||e.kind===Ie||e.kind===tt||e.kind===le||e.kind===Ot||e.kind===Ae||e.kind===Ve}function Bo(e){return xa(e)&&(e.kind===Ae?e.values.some(Bo):e.kind===Ve?e.fields.some((t)=>Bo(t.value)):e.kind!==Ce)}function zc(e){return e.kind===Sn||e.kind===Dn||e.kind===cn}function Ri(e){return e.kind===Ye||En(e)||e.kind===pt}function En(e){return e.kind===Qt||e.kind===At||e.kind===xt||e.kind===wt||e.kind===Yt||e.kind===yt}function Li(e){return e.kind===Rt||e.kind===Tr||ki(e)}function ki(e){return e.kind===ln||e.kind===qt||e.kind===Kt||e.kind===Jt||e.kind===pn||e.kind===Lt}function Xc(e){return e.kind===po||e.kind===fo||e.kind===mo||e.kind===ho||e.kind===Eo}function qo(e){return{Document(t){for(let n of t.definitions)if(!wi(n)){let r=n.kind===Ye||n.kind===Rt?"schema":'"'+n.name.value+'"';e.reportError(new m(`The ${r} definition is not executable.`,{nodes:n}))}return!1}}}function Ko(e){return{Field(t){let n=e.getParentType();if(n){if(!e.getFieldDef()){let i=e.getSchema(),o=t.name.value,s=qe("to use an inline fragment on",e.hideSuggestions?[]:yd(i,n,o));if(s==="")s=qe(e.hideSuggestions?[]:gd(n,o));e.reportError(new m(`Cannot query field "${o}" on type "${n}".`+s,{nodes:t}))}}}}}function yd(e,t,n){if(!Ke(t))return[];let r=new Set,i=Object.create(null);for(let o of e.getPossibleTypes(t)){if(o.getFields()[n]==null)continue;r.add(o),i[o.name]=1;for(let s of o.getInterfaces()){if(s.getFields()[n]==null)continue;r.add(s),i[s.name]=(i[s.name]??0)+1}}return[...r].sort((o,s)=>{let a=i[s.name]-i[o.name];if(a!==0)return a;if(P(o)&&e.isSubType(o,s))return-1;if(P(s)&&e.isSubType(s,o))return 1;return fn(o.name,s.name)}).map((o)=>o.name)}function gd(e,t){if(L(e)||P(e)){let n=Object.keys(e.getFields());return Je(t,n)}return[]}function Jo(e){return{InlineFragment(t){let n=t.typeCondition;if(n){let r=Te(e.getSchema(),n);if(r&&!dt(r)){let i=ee(n);e.reportError(new m(`Fragment cannot condition on non composite type "${i}".`,{nodes:n}))}}},FragmentDefinition(t){let n=Te(e.getSchema(),t.typeCondition);if(n&&!dt(n)){let r=ee(t.typeCondition);e.reportError(new m(`Fragment "${t.name.value}" cannot condition on non composite type "${r}".`,{nodes:t.typeCondition}))}}}}function Wo(e){return{...wa(e),FragmentArgument(t){let n=e.getFragmentSignature();if(n){if(!n.variableDefinitions.get(t.name.value)){let i=t.name.value,o=e.hideSuggestions?[]:Je(i,Array.from(n.variableDefinitions.values()).map((s)=>s.variable.name.value));e.reportError(new m(`Unknown argument "${i}" on fragment "${n.definition.name.value}".`+qe(o),{nodes:t}))}}},Argument(t){let n=e.getArgument(),r=e.getFieldDef();if(!n&&r){let i=t.name.value,o=e.hideSuggestions?[]:Je(i,r.args.map((s)=>s.name));e.reportError(new m(`Unknown argument "${i}" on field "${r}".`+qe(o),{nodes:t}))}}}}function wa(e){let t=new Map,n=e.getSchema(),r=n?n.getDirectives():je;for(let o of r)t.set(o.name,o.args.map((s)=>s.name));let i=e.getDocument().definitions;for(let o of i)if(o.kind===pt){let s=o.arguments??[];t.set(o.name.value,s.map((a)=>a.name.value))}return{Directive(o){let s=o.name.value,a=t.get(s);if(o.arguments!=null&&a!=null)for(let u of o.arguments){let c=u.name.value;if(!a.includes(c)){let l=Je(c,a);e.reportError(new m(`Unknown argument "${c}" on directive "@${s}".`+(e.hideSuggestions?"":qe(l)),{nodes:u}))}}return!1}}}function Fi(e){let t=new Map,n=e.getSchema(),r=n?n.getDirectives():je;for(let o of r)t.set(o.name,o.locations);let i=e.getDocument().definitions;for(let o of i)if(o.kind===pt)t.set(o.name.value,o.locations.map((s)=>s.value));return{Directive(o,s,a,u,c){let l=o.name.value,p=t.get(l);if(p==null){e.reportError(new m(`Unknown directive "@${l}".`,{nodes:o}));return}let f=Nd(c);if(f!=null&&!p.includes(f))e.reportError(new m(`Directive "@${l}" may not be used on ${f}.`,{nodes:o}))}}}function Nd(e){let t=e.at(-1);if(!(t!=null&&("kind"in t)))U(!1);switch(t.kind){case Tt:return Id(t.operation);case an:return F.FIELD;case Dt:return F.FRAGMENT_SPREAD;case _n:return F.INLINE_FRAGMENT;case Qe:return F.FRAGMENT_DEFINITION;case ri:{let n=e[e.length-3];if(!("kind"in n))U(!1);return n.kind===Tt?F.VARIABLE_DEFINITION:F.FRAGMENT_VARIABLE_DEFINITION}case Ye:case Rt:return F.SCHEMA;case Qt:case ln:return F.SCALAR;case At:case qt:return F.OBJECT;case co:return F.FIELD_DEFINITION;case xt:case Kt:return F.INTERFACE;case wt:case Jt:return F.UNION;case Yt:case pn:return F.ENUM;case lo:return F.ENUM_VALUE;case yt:case Lt:return F.INPUT_OBJECT;case ai:{let n=e.at(-3);if(!(n!=null&&("kind"in n)))U(!1);return n.kind===yt||n.kind===Lt?F.INPUT_FIELD_DEFINITION:F.ARGUMENT_DEFINITION}case pt:case Tr:return F.DIRECTIVE_DEFINITION;default:U(!1,"Unexpected kind: "+y(t.kind))}}function Id(e){switch(e){case re.QUERY:return F.QUERY;case re.MUTATION:return F.MUTATION;case re.SUBSCRIPTION:return F.SUBSCRIPTION}}function Ho(e){return{FragmentSpread(t){let n=t.name.value;if(!e.getFragment(n))e.reportError(new m(`Unknown fragment "${n}".`,{nodes:t.name}))}}}function zo(e){let t=e.getSchema();return{OperationDefinition(n){let r=n.operation;if(!t.getRootType(r))e.reportError(new m(`The ${r} operation is not supported by the schema.`,{nodes:n}))}}}function Ci(e){let{definitions:t}=e.getDocument(),n=e.getSchema()?.getTypeMap()??{},r=new Set([...Object.keys(n),...t.filter(En).map((i)=>i.name.value)]);return{NamedType(i,o,s,a,u){let c=i.name.value;if(!r.has(c)){let l=u[2]??s,p=l!=null&&vd(l);if(p&&Zc.has(c))return;let f=e.hideSuggestions?[]:Je(c,p?[...Zc,...r]:[...r]);e.reportError(new m(`Unknown type "${c}".`+qe(f),{nodes:i}))}}}}var Zc=new Set([...Ct,...Mt].map((e)=>e.name));function vd(e){return"kind"in e&&(Ri(e)||Li(e))}function Xo(e){let t=0;return{Document(n){t=n.definitions.filter((r)=>r.kind===Tt).length},OperationDefinition(n){if(!n.name&&t>1)e.reportError(new m("This anonymous operation must be the only defined operation.",{nodes:n}))}}}function Zo(e){let t=e.getSchema(),n=t?.astNode??t?.getQueryType()??t?.getMutationType()??t?.getSubscriptionType(),r=0;return{SchemaDefinition(i){if(n){e.reportError(new m("Cannot define a new schema within a schema extension.",{nodes:i}));return}if(r>0)e.reportError(new m("Must provide only one schema definition.",{nodes:i}));++r}}}var bd=3;function es(e){function t(n,r=Object.create(null),i=0){if(n.kind===Dt){let o=n.name.value;if(r[o]===!0)return!1;let s=e.getFragment(o);if(!s)return!1;try{return r[o]=!0,t(s,r,i)}finally{r[o]=void 0}}if(n.kind===an&&(n.name.value==="fields"||n.name.value==="interfaces"||n.name.value==="possibleTypes"||n.name.value==="inputFields")){if(i++,i>=bd)return!0}if("selectionSet"in n&&n.selectionSet){for(let o of n.selectionSet.selections)if(t(o,r,i))return!0}return!1}return{Field(n){if(n.name.value==="__schema"||n.name.value==="__type"){if(t(n))return e.reportError(new m("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}}function ts(e){let t=new Set,n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(o){return i(o),!1}};function i(o){if(t.has(o.name.value))return;let s=o.name.value;t.add(s);let a=e.getFragmentSpreads(o.selectionSet);if(a.length===0)return;r[s]=n.length;for(let u of a){let c=u.name.value,l=r[c];if(n.push(u),l===void 0){let p=e.getFragment(c);if(p)i(p)}else{let p=n.slice(l),f=p.slice(0,-1).map((d)=>'"'+d.name.value+'"').join(", ");e.reportError(new m(`Cannot spread fragment "${c}" within itself`+(f!==""?` via ${f}.`:"."),{nodes:p}))}n.pop()}r[s]=void 0}}function ns(e){return{OperationDefinition(t){let n=new Set(t.variableDefinitions?.map((i)=>i.variable.name.value)),r=e.getRecursiveVariableUsages(t);for(let{node:i,fragmentVariableDefinition:o}of r){if(o)continue;let s=i.name.value;if(!n.has(s))e.reportError(new m(t.name?`Variable "$${s}" is not defined by operation "${t.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[i,t]}))}}}}function rs(e){let t=new Set,n=[];return{OperationDefinition(r){for(let i of e.getRecursivelyReferencedFragments(r))t.add(i.name.value);return!1},FragmentDefinition(r){return n.push(r),!1},Document:{leave(){for(let r of n){let i=r.name.value;if(!t.has(i))e.reportError(new m(`Fragment "${i}" is never used.`,{nodes:r}))}}}}}function is(e){return{FragmentDefinition(t){let n=e.getVariableUsages(t),r=new Set(n.map(({node:o})=>o.name.value)),i=t.variableDefinitions??[];for(let o of i){let s=o.variable.name.value;if(!r.has(s))e.reportError(new m(`Variable "$${s}" is never used in fragment "${t.name.value}".`,{nodes:o}))}},OperationDefinition(t){let n=e.getRecursiveVariableUsages(t),r=new Set;for(let{node:o,fragmentVariableDefinition:s}of n){let a=o.name.value;if(!s)r.add(a)}let i=t.variableDefinitions??[];for(let o of i){let s=o.variable.name.value;if(!r.has(s))e.reportError(new m(t.name?`Variable "$${s}" is never used in operation "${t.name.value}".`:`Variable "$${s}" is never used.`,{nodes:o}))}}}}function cr(e){switch(e.kind){case Ve:return{...e,fields:_d(e.fields)};case Ae:return{...e,values:e.values.map(cr)};case Oe:case Bt:case Ie:case tt:case le:case Ot:case Ce:return e}}function _d(e){return e.map((t)=>({...t,value:cr(t.value)})).sort((t,n)=>fn(t.name.value,n.name.value))}function nl(e){if(Array.isArray(e))return e.map(([t,n])=>`subfields "${t}" conflict because `+nl(n)).join(" and ");return e}function us(e){let t=new Ca,n=new ol,r=new Map;return{SelectionSet(i){let o=Sd(e,r,t,n,e.getParentType(),i);for(let[[s,a],u,c]of o){let l=nl(a);e.reportError(new m(`Fields "${s}" conflict because ${l}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:u.concat(c)}))}}}}function Sd(e,t,n,r,i,o){let s=[],[a,u]=as(e,t,i,o,void 0);if(Od(e,s,t,n,r,a),u.length!==0)for(let c=0;c<u.length;c++){os(e,s,t,n,r,!1,a,u[c]);for(let l=c+1;l<u.length;l++)ss(e,s,t,n,r,!1,u[c],u[l])}return s}function os(e,t,n,r,i,o,s,a){if(r.has(s,a.key,o))return;r.add(s,a.key,o);let u=e.getFragment(a.node.name.value);if(!u)return;let[c,l]=La(e,n,u,a.varMap);if(s===c)return;ka(e,t,n,r,i,o,s,void 0,c,a.varMap);for(let p of l)os(e,t,n,r,i,o,s,p)}function ss(e,t,n,r,i,o,s,a){if(s.key===a.key)return;if(s.node.name.value===a.node.name.value){if(!Fa(s.node.arguments,s.varMap,a.node.arguments,a.varMap)){e.reportError(new m(`Spreads "${s.node.name.value}" conflict because ${s.key} and ${a.key} have different fragment arguments.`,{nodes:[s.node,a.node]}));return}}if(i.has(s.key,a.key,o))return;i.add(s.key,a.key,o);let u=e.getFragment(s.node.name.value),c=e.getFragment(a.node.name.value);if(!u||!c)return;let[l,p]=La(e,n,u,s.varMap),[f,d]=La(e,n,c,a.varMap);ka(e,t,n,r,i,o,l,s.varMap,f,a.varMap);for(let E of d)ss(e,t,n,r,i,o,s,E);for(let E of p)ss(e,t,n,r,i,o,E,a)}function Dd(e,t,n,r,i,o,s,a,u,c,l){let p=[],[f,d]=as(e,t,o,s,a),[E,I]=as(e,t,u,c,l);ka(e,p,t,n,r,i,f,a,E,l);for(let S of I)os(e,p,t,n,r,i,f,S);for(let S of d)os(e,p,t,n,r,i,E,S);for(let S of d)for(let G of I)ss(e,p,t,n,r,i,S,G);return p}function Od(e,t,n,r,i,o){for(let[s,a]of o.entries())if(a.length>1)for(let u=0;u<a.length;u++)for(let c=u+1;c<a.length;c++){let l=rl(e,n,r,i,!1,s,a[u],void 0,a[c],void 0);if(l)t.push(l)}}function ka(e,t,n,r,i,o,s,a,u,c){for(let[l,p]of s.entries()){let f=u.get(l);if(f!=null)for(let d of p)for(let E of f){let I=rl(e,n,r,i,o,l,d,a,E,c);if(I)t.push(I)}}}function rl(e,t,n,r,i,o,s,a,u,c){let[l,p,f]=s,[d,E,I]=u,S=i||l!==d&&L(l)&&L(d);if(!S){let A=p.name.value,h=E.name.value;if(A!==h)return[[o,`"${A}" and "${h}" are different fields`],[p],[E]];if(!Fa(p.arguments,a,E.arguments,c))return[[o,"they have differing arguments"],[p],[E]]}let G=p.directives,Z=E.directives,W=Ad(G,a,Z,c);if(W!==void 0)return[[o,W],[p],[E]];let H=f?.type,Y=I?.type;if(H&&Y&&Ra(H,Y))return[[o,`they return conflicting types "${y(H)}" and "${y(Y)}"`],[p],[E]];let ne=p.selectionSet,b=E.selectionSet;if(ne&&b){let A=Dd(e,t,n,r,S,pe(H),ne,a,pe(Y),b,c);return wd(A,o,p,E)}}function Fa(e,t,n,r){if(e===void 0||e.length===0)return n===void 0||n.length===0;if(n===void 0||n.length===0)return!1;if(e.length!==n.length)return!1;let i=new Map(n.map(({name:o,value:s})=>[o.value,r===void 0?s:Vi(s,r)]));return e.every((o)=>{let s=o.value;if(t)s=Vi(s,t);let a=i.get(o.name.value);if(a===void 0)return!1;return el(s)===el(a)})}function Vi(e,t){switch(e.kind){case Ce:return t.get(e.name.value)??e;case Ae:return{...e,values:e.values.map((n)=>Vi(n,t))};case Ve:return{...e,fields:e.fields.map((n)=>({...n,value:Vi(n.value,t)}))};default:return e}}function el(e){return ee(cr(e))}function tl(e){return e?.find((t)=>t.name.value==="stream")}function Ad(e,t,n,r){let i=tl(e),o=tl(n);if(!i&&!o)return;else if(i&&o){if(Fa(i.arguments,t,o.arguments,r))return"they have overlapping stream directives. See https://github.com/graphql/defer-stream-wg/discussions/100";return"they have overlapping stream directives"}return"they have overlapping stream directives"}function Ra(e,t){if(j(e))return j(t)?Ra(e.ofType,t.ofType):!0;if(j(t))return!0;if(w(e))return w(t)?Ra(e.ofType,t.ofType):!0;if(w(t))return!0;if(ve(e)||ve(t))return e!==t;return!1}function as(e,t,n,r,i){let o=t.get(r);if(o)return o;let s=new Map,a=new Map;il(e,n,r,s,a,i);let u=[s,Array.from(a.values())];return t.set(r,u),u}function La(e,t,n,r){let i=t.get(n.selectionSet);if(i)return i;let o=Te(e.getSchema(),n.typeCondition);return as(e,t,o,n.selectionSet,r)}function il(e,t,n,r,i,o){for(let s of n.selections)switch(s.kind){case an:{let a=s.name.value,u;if(L(t)||P(t))u=t.getFields()[a];let c=s.alias?s.alias.value:a,l=r.get(c);if(l==null)l=[],r.set(c,l);l.push([t,s,u]);break}case Dt:{let a=xd(e,s,o);i.set(a.key,a);break}case _n:{let a=s.typeCondition,u=a?Te(e.getSchema(),a):t;il(e,u,s.selectionSet,r,i,o);break}}}function xd(e,t,n){let r="",i=new Map,o=e.getFragmentSignatureByName()(t.name.value),s=new Map;if(t.arguments)for(let a of t.arguments)s.set(a.name.value,a.value);if(o?.variableDefinitions){r+=t.name.value+"(";for(let[a,u]of o.variableDefinitions){let c=s.get(a);if(c)r+=a+": "+ee(cr(c));let l=s.get(a);if(l!==void 0)i.set(a,n!==void 0?Vi(l,n):l);else if(u.defaultValue)i.set(a,u.defaultValue)}r+=")"}return{key:r,node:t,varMap:i.size>0?i:void 0}}function wd(e,t,n,r){if(e.length>0)return[[t,e.map(([i])=>i)],[n,...e.map(([,i])=>i).flat()],[r,...e.map(([,,i])=>i).flat()]]}class Ca{constructor(){this._data=new Map}has(e,t,n){let r=this._data.get(e)?.get(t);if(r===void 0)return!1;return n?!0:n===r}add(e,t,n){let r=this._data.get(e);if(r===void 0)this._data.set(e,new Map([[t,n]]));else r.set(t,n)}}class ol{constructor(){this._orderedPairSet=new Ca}has(e,t,n){return e<t?this._orderedPairSet.has(e,t,n):this._orderedPairSet.has(t,e,n)}add(e,t,n){if(e<t)this._orderedPairSet.add(e,t,n);else this._orderedPairSet.add(t,e,n)}}function cs(e){return{InlineFragment(t){let n=e.getType(),r=e.getParentType();if(dt(n)&&dt(r)&&!mi(e.getSchema(),n,r)){let i=y(r),o=y(n);e.reportError(new m(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${o}".`,{nodes:t}))}},FragmentSpread(t){let n=t.name.value,r=Rd(e,n),i=e.getParentType();if(r&&i&&!mi(e.getSchema(),r,i)){let o=y(i),s=y(r);e.reportError(new m(`Fragment "${n}" cannot be spread here as objects of type "${o}" can never be of type "${s}".`,{nodes:t}))}}}}function Rd(e,t){let n=e.getFragment(t);if(n){let r=Te(e.getSchema(),n.typeCondition);if(dt(r))return r}}function ls(e){let t=e.getSchema(),n=new Map;for(let i of e.getDocument().definitions)if(En(i))n.set(i.name.value,i);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(i){let o=i.name.value,s=n.get(o),a=t?.getType(o),u;if(s!=null)u=Ld[s.kind];else if(a)u=kd(a);if(u!=null){if(u!==i.kind){let c=Fd(i.kind);e.reportError(new m(`Cannot extend non-${c} type "${o}".`,{nodes:s?[s,i]:i}))}}else{let c=[...n.keys(),...Object.keys(t?.getTypeMap()??{})];e.reportError(new m(`Cannot extend type "${o}" because it is not defined.`+qe(Je(o,c)),{nodes:i.name}))}}}var Ld={[Qt]:ln,[At]:qt,[xt]:Kt,[wt]:Jt,[Yt]:pn,[yt]:Lt};function kd(e){if(ae(e))return ln;if(L(e))return qt;if(P(e))return Kt;if(te(e))return Jt;if(z(e))return pn;if(k(e))return Lt;U(!1,"Unexpected type: "+y(e))}function Fd(e){switch(e){case ln:return"scalar";case qt:return"object";case Kt:return"interface";case Jt:return"union";case pn:return"enum";case Lt:return"input object";default:U(!1,"Unexpected kind: "+y(e))}}function ps(e){return{...Va(e),Field:{leave(t){let n=e.getFieldDef();if(!n)return!1;let r=new Set(t.arguments?.map((i)=>i.name.value));for(let i of n.args)if(!r.has(i.name)&&ze(i))e.reportError(new m(`Argument "${i}" of type "${i.type}" is required, but it was not provided.`,{nodes:t}))}},FragmentSpread:{leave(t){let n=e.getFragmentSignature();if(!n)return!1;let r=new Set(t.arguments?.map((i)=>i.name.value));for(let[i,o]of n.variableDefinitions)if(!r.has(i)&&sl(o)){let s=Te(e.getSchema(),o.type),a=y(s);e.reportError(new m(`Fragment "${t.name.value}" argument "${i}" of type "${a}" is required, but it was not provided.`,{nodes:t}))}}}}}function Va(e){let t=new Map,r=e.getSchema()?.getDirectives()??je;for(let o of r)t.set(o.name,new Map(o.args.filter(ze).map((s)=>[s.name,s])));let i=e.getDocument().definitions;for(let o of i)if(o.kind===pt){let s=o.arguments??[];t.set(o.name.value,new Map(s.filter(sl).map((a)=>[a.name.value,a])))}return{Directive:{leave(o){let s=o.name.value,a=t.get(s);if(a!=null){let u=o.arguments??[],c=new Set(u.map((l)=>l.name.value));for(let[l,p]of a.entries())if(!c.has(l)){let f=yr(p.type)?y(p.type):ee(p.type);e.reportError(new m(`Argument "@${s}(${l}:)" of type "${f}" is required, but it was not provided.`,{nodes:o}))}}}}}}function sl(e){return e.type.kind===cn&&e.defaultValue==null}function fs(e){return{Field(t){let n=e.getType(),r=t.selectionSet;if(n){if(ve(pe(n))){if(r){let i=t.name.value,o=y(n);e.reportError(new m(`Field "${i}" must not have a selection since type "${o}" has no subfields.`,{nodes:r}))}}else if(!r){let i=t.name.value,o=y(n);e.reportError(new m(`Field "${i}" of type "${o}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:t}))}else if(r.selections.length===0){let i=t.name.value,o=y(n);e.reportError(new m(`Field "${i}" of type "${o}" must have at least one field selected.`,{nodes:t}))}}}}}function Tn(e,t){if(w(t)){if(e==null)return;return Tn(e,t.ofType)}if(e==null)return null;if(j(t)){if(!et(e)){let i=Tn(e,t.ofType);if(i===void 0)return;return[i]}let r=[];for(let i of e){let o=Tn(i,t.ofType);if(o===void 0)return;r.push(o)}return r}if(k(t)){if(!ye(e)||Array.isArray(e))return;let r=Object.create(null),i=t.getFields(),o=0;for(let s of Object.keys(e)){if(e[s]===void 0)continue;if(o++,!Object.hasOwn(i,s))return}for(let s of Object.values(i)){let a=e[s.name];if(a===void 0){if(Xe(s))return;let u=ds(s);if(u!==void 0)r[s.name]=u}else{let u=Tn(a,s.type);if(u===void 0)return;r[s.name]=u}}if(t.isOneOf){let s=Object.keys(r);if(o!==1||s.length!==1)return;let a=s[0];if(r[a]===null)return}return r}let n=It(t);try{return n.coerceInputValue(e)}catch(r){}}function yn(e,t,n,r){if(e.kind===Ce){let o=al(e,n,r);if(o==null&&w(t))return;return o}if(w(t)){if(e.kind===le)return;return yn(e,t.ofType,n,r)}if(e.kind===le)return null;if(j(t)){if(e.kind!==Ae){let s=yn(e,t.ofType,n,r);if(s===void 0)return;return[s]}let o=[];for(let s of e.values){let a=yn(s,t.ofType,n,r);if(a===void 0)if(s.kind===Ce&&al(s,n,r)==null&&!w(t.ofType))a=null;else return;o.push(a)}return o}if(k(t)){if(e.kind!==Ve)return;let o=Object.create(null),s=t.getFields();if(e.fields.some((c)=>!Object.hasOwn(s,c.name.value)))return;let u=new Map(e.fields.map((c)=>[c.name.value,c]));for(let c of Object.values(s)){let l=u.get(c.name);if(!l||l.value.kind===Ce&&Cd(l.value,n,r)){if(Xe(c))return;let p=ds(c);if(p!==void 0)o[c.name]=p}else{let p=yn(l.value,c.type,n,r);if(p===void 0)return;o[c.name]=p}}if(t.isOneOf){let c=Object.keys(o);if(u.size!==1||c.length!==1)return;for(let[l,p]of u)if(p.value.kind===le||o[l]===null)return}return o}let i=It(t);try{return i.coerceInputLiteral?i.coerceInputLiteral(dn(e,n,r)):i.parseLiteral(e,n?.coerced)}catch(o){}}function al(e,t,n){let r=e.name.value;if(n?.sources[r]!==void 0)return n.coerced[r];return t?.coerced[r]}function Cd(e,t,n){let r=e.name.value;return(n?.sources[r]!==void 0?n.coerced:t?.coerced)?.[r]===void 0}function ds(e){let t=e._memoizedCoercedDefaultValue;if(t!==void 0)return t;let n=e.default;if(n!==void 0){if(t=n.literal?yn(n.literal,e.type):Tn(n.value,e.type),t===void 0)U(!1,`Expected value of type "${e.type}" to be valid, found: ${y(n.literal??n.value)}.`);return e._memoizedCoercedDefaultValue=t,t}let r=e.defaultValue;if(r!==void 0)e._memoizedCoercedDefaultValue=r;return r}function ms(e,t){let n=t.variable.name.value,r=Te(e,t.type);if(!xe(r)){let o=ee(t.type);return new m(`Variable "$${n}" expected value of type "${o}" which cannot be used as an input type.`,{nodes:t.type})}let i=t.defaultValue;return{name:n,type:r,default:i&&{literal:i}}}function Mi(e,t,n,r){let i=[],o=r?.maxErrors;try{let s=Vd(e,t,n,(a)=>{if(o!=null&&i.length>=o)throw new m("Too many errors processing variables, error limit reached. Execution aborted.");i.push(a)},r?.hideSuggestions);if(i.length===0)return{variableValues:s}}catch(s){i.push(De(s))}return{errors:i}}function Vd(e,t,n,r,i){let o=Object.create(null),s=Object.create(null);for(let a of t){let u=ms(e,a);if(u instanceof m){r(u);continue}let{name:c,type:l}=u,p=Object.hasOwn(n,c)?n[c]:void 0;if(p===void 0){if(o[c]={signature:u},a.defaultValue){Ua(s,c,u,(d,E)=>{r(new m(`Variable "$${c}" has invalid default value${qn(E)}: ${d.message}`,{nodes:a}))},i);continue}else if(!w(l))continue}else o[c]={signature:u,value:p};let f=Tn(p,l);if(f!==void 0)s[c]=f;else Zn(p,l,(d,E)=>{r(new m(`Variable "$${c}" has invalid value${qn(E)}: ${d.message}`,{nodes:a,originalError:d}))},i)}return{sources:o,coerced:s}}function Ua(e,t,n,r,i){try{let o=ds(n);if(o!==void 0)e[t]=o}catch(o){let s=n.default;if(s===void 0)throw o;let a=!1;if(Na(s,n.type,(u,c)=>{a=!0,r(u,c)},i),!a)r(De(o),[])}}function ul(e,t,n,r,i){let o=e.arguments??[],s=new Map(o.map((c)=>[c.name.value,c])),a=Object.create(null),u=Object.create(null);for(let[c,l]of Object.entries(t)){let p=s.get(c);if(p!==void 0)a[c]=r==null?{signature:l,value:p.value}:{signature:l,value:p.value,fragmentVariableValues:r};else a[c]={signature:l};cl(u,e,c,l,p,n,r,i)}return{sources:a,coerced:u}}function _t(e,t,n,r,i){let o=Object.create(null),s=t.arguments??[],a=new Map(s.map((u)=>[u.name.value,u]));for(let u of e.args){let c=u.name;cl(o,t,c,u,a.get(u.name),n,r,i)}return o}function cl(e,t,n,r,i,o,s,a){let u=r.type,c=(f,d)=>{throw new m(`${Ma(r,t)} has invalid default value${qn(d)}: ${f.message}`,{nodes:t})};if(!i){if(ze(r))throw new m(`${Ma(r,t)} of required type "${u}" was not provided.`,{nodes:t});Ua(e,n,r,c,a);return}let l=i.value;if(l.kind===Ce){let f=l.name.value,d=s?.sources[f]?s:o;if((d==null||!Object.hasOwn(d.coerced,f))&&!ze(r)){Ua(e,n,r,c,a);return}}let p=yn(l,u,o,s);if(p===void 0)xn(l,u,(f,d)=>{throw f.message=`${Ma(r,t)} has invalid value${qn(d)}: ${f.message}`,f},o,s,a),U(!1,"Invalid argument");e[n]=p}function Ma(e,t){return li(e)?`Argument "${e}"`:`Variable "$${e.name}" defined by fragment "${t.name.value}"`}function Zt(e,t,n,r,i){let o=t.directives?.find((s)=>s.name.value===e.name);if(o)return _t(e,o,n,r,i)}function wr(e,t,n,r,i,o,s=!1){let a=new Fe,u=[],c={schema:e,fragments:t,variableValues:n,runtimeType:r,visitedFragmentNames:new Map,hideSuggestions:o,forbiddenDirectiveInstances:[],forbidSkipAndInclude:s};return Ui(c,i,a,u),{groupedFieldSet:a,newDeferUsages:u,forbiddenDirectiveInstances:c.forbiddenDirectiveInstances}}function fl(e,t,n,r,i,o){let s={schema:e,fragments:t,variableValues:n,runtimeType:r,visitedFragmentNames:new Map,hideSuggestions:o,forbiddenDirectiveInstances:[],forbidSkipAndInclude:!1},a=new Fe,u=[];for(let c of i){let l=c.node.selectionSet;if(l){let{deferUsage:p,fragmentVariableValues:f}=c;Ui(s,l,a,u,p,f)}}return{groupedFieldSet:a,newDeferUsages:u}}function Ui(e,t,n,r,i,o){let{schema:s,fragments:a,variableValues:u,runtimeType:c,visitedFragmentNames:l,hideSuggestions:p}=e;for(let f of t.selections)switch(f.kind){case an:{if(!Pa(e,f,u,o))continue;n.add(Md(f),{node:f,deferUsage:i,fragmentVariableValues:o});break}case _n:{if(!Pa(e,f,u,o)||!pl(s,f,c))continue;let d=ll(u,o,f,i);if(!d)Ui(e,f.selectionSet,n,r,i,o);else r.push(d),Ui(e,f.selectionSet,n,r,d,o);break}case Dt:{let d=f.name.value;if(!Pa(e,f,u,o))continue;let E=a[d];if(E==null||!pl(s,E.definition,c))continue;let I=ll(u,o,f,i),S=l.get(d),G;if(!I){if(S===!1)continue;l.set(d,!1),G=i}else{if(S!==void 0)continue;l.set(d,!0),r.push(I),G=I}let Z=E.variableSignatures,W;if(Z)W=ul(f,Z,u,o,p);Ui(e,E.definition.selectionSet,n,r,G,W);break}}}function ll(e,t,n,r){let i=Zt(Xt,n,e,t);if(!i)return;if(i.if===!1)return;return{label:typeof i.label==="string"?i.label:void 0,parentDeferUsage:r}}function Pa(e,t,n,r){let i=t.directives?.find((u)=>u.name.value===kn.name);if(i&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(i),!1;if((i?_t(kn,i,n,r,e.hideSuggestions):void 0)?.if===!0)return!1;let s=t.directives?.find((u)=>u.name.value===Ln.name);if(s&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(s),!1;if((s?_t(Ln,s,n,r,e.hideSuggestions):void 0)?.if===!1)return!1;return!0}function pl(e,t,n){let r=t.typeCondition;if(!r)return!0;let i=Te(e,r);if(i===n)return!0;if(Ke(i))return e.isSubType(i,n);return!1}function Md(e){return e.alias?e.alias.value:e.name.value}function $a(e){return e.map((t)=>t.node)}function hs(e){return{OperationDefinition(t){if(t.operation==="subscription"){let n=e.getSchema(),r=n.getSubscriptionType();if(r){let i=t.name?t.name.value:null,o=Object.create(null),s=e.getDocument(),a=Object.create(null);for(let l of s.definitions)if(l.kind===Qe)a[l.name.value]={definition:l};let{groupedFieldSet:u,forbiddenDirectiveInstances:c}=wr(n,a,o,r,t.selectionSet,e.hideSuggestions,!0);if(c.length>0){e.reportError(new m(i!=null?`Subscription "${i}" must not use \`@skip\` or \`@include\` directives in the top level selection.`:"Anonymous Subscription must not use `@skip` or `@include` directives in the top level selection.",{nodes:c}));return}if(u.size>1){let f=[...u.values()].slice(1).flatMap((d)=>$a(d));e.reportError(new m(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:f}))}for(let l of u.values())if($a(l)[0].name.value.startsWith("__"))e.reportError(new m(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:$a(l)}))}}}}}function Es(e){return{Directive(t){let n=e.getFieldDef(),r=e.getParentType();if(n&&r&&t.name.value===vt.name&&!(j(n.type)||On(n.type)&&j(n.type.ofType)))e.reportError(new m(`Directive "@stream" cannot be used on non-list field "${r}.${n.name}".`,{nodes:t}))}}}function Rr(e,t){let n=new Fe;for(let r of e)n.add(t(r),r);return n}function Ts(e){return{DirectiveDefinition(r){let i=r.arguments??[];return n(`@${r.name.value}`,i)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(r){let i=r.name.value,o=r.fields??[];for(let s of o){let a=s.name.value,u=s.arguments??[];n(`${i}.${a}`,u)}return!1}function n(r,i){let o=Rr(i,(s)=>s.name.value);for(let[s,a]of o)if(a.length>1)e.reportError(new m(`Argument "${r}(${s}:)" can only be defined once.`,{nodes:a.map((u)=>u.name)}));return!1}}function Pi(e){return{Field:t,Directive:t};function t(n){let r=n.arguments??[],i=Rr(r,(o)=>o.name.value);for(let[o,s]of i)if(s.length>1)e.reportError(new m(`There can be only one argument named "${o}".`,{nodes:s.map((a)=>a.name)}))}}function ys(e){let t=new Map,n=e.getSchema();return{DirectiveDefinition(r){let i=r.name.value;if(n?.getDirective(i)){e.reportError(new m(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}let o=t.get(i);if(o)e.reportError(new m(`There can be only one directive named "@${i}".`,{nodes:[o,r.name]}));else t.set(i,r.name);return!1}}}function $i(e){let t=new Map,n=e.getSchema(),r=n?n.getDirectives():je;for(let u of r)t.set(u.name,!u.isRepeatable);let i=e.getDocument().definitions;for(let u of i)if(u.kind===pt)t.set(u.name.value,!u.repeatable);let o=new Map,s=new Map,a=new Map;return{enter(u){if(!("directives"in u)||!u.directives)return;let c;if(u.kind===Ye||u.kind===Rt)c=o;else if(En(u)||ki(u)){let l=u.name.value;if(c=s.get(l),c===void 0)c=new Map,s.set(l,c)}else if(u.kind===pt||u.kind===Tr){let l=u.name.value;if(c=a.get(l),c===void 0)c=new Map,a.set(l,c)}else c=new Map;for(let l of u.directives){let p=l.name.value;if(t.get(p)===!0){let f=c.get(p);if(f!=null)e.reportError(new m(`The directive "@${p}" can only be used once at this location.`,{nodes:[f,l]}));else c.set(p,l)}}}}}function gs(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(o){let s=o.name.value,a=r.get(s);if(a==null)a=new Map,r.set(s,a);let u=o.values??[];for(let c of u){let l=c.name.value,p=n[s];if(z(p)&&p.getValue(l)){e.reportError(new m(`Enum value "${s}.${l}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:c.name}));continue}let f=a.get(l);if(f!=null)e.reportError(new m(`Enum value "${s}.${l}" can only be defined once.`,{nodes:[f,c.name]}));else a.set(l,c.name)}return!1}}function Ns(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(o){let s=o.name.value,a=r.get(s);if(a==null)a=new Map,r.set(s,a);let u=o.fields??[];for(let c of u){let l=c.name.value;if(Ud(n[s],l)){e.reportError(new m(`Field "${s}.${l}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:c.name}));continue}let p=a.get(l);if(p!=null)e.reportError(new m(`Field "${s}.${l}" can only be defined once.`,{nodes:[p,c.name]}));else a.set(l,c.name)}return!1}}function Ud(e,t){if(L(e)||P(e)||k(e))return e.getFields()[t]!=null;return!1}function Is(e){let t=new Map;return{OperationDefinition:()=>!1,FragmentDefinition(n){let r=n.name.value,i=t.get(r);if(i!=null)e.reportError(new m(`There can be only one fragment named "${r}".`,{nodes:[i,n.name]}));else t.set(r,n.name);return!1}}}function Gi(e){let t=[],n=new Map;return{ObjectValue:{enter(){t.push(n),n=new Map},leave(){let r=t.pop();if(r==null)U(!1);n=r}},ObjectField(r){let i=r.name.value,o=n.get(i);if(o!=null)e.reportError(new m(`There can be only one input field named "${i}".`,{nodes:[o,r.name]}));else n.set(i,r.name)}}}function vs(e){let t=new Map;return{OperationDefinition(n){let r=n.name;if(r!=null){let i=t.get(r.value);if(i!=null)e.reportError(new m(`There can be only one operation named "${r.value}".`,{nodes:[i,r]}));else t.set(r.value,r)}return!1},FragmentDefinition:()=>!1}}function bs(e){let t=e.getSchema(),n=new Map,r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(o){let s=o.operationTypes??[];for(let a of s){let u=a.operation,c=n.get(u);if(r[u])e.reportError(new m(`Type for ${u} already defined in the schema. It cannot be redefined.`,{nodes:a}));else if(c)e.reportError(new m(`There can be only one ${u} type in schema.`,{nodes:[c,a]}));else n.set(u,a)}return!1}}function _s(e){let t=new Map,n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(i){let o=i.name.value;if(n?.getType(o)){e.reportError(new m(`Type "${o}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}));return}let s=t.get(o);if(s!=null)e.reportError(new m(`There can be only one type named "${o}".`,{nodes:[s,i.name]}));else t.set(o,i.name);return!1}}function Ss(e){return{OperationDefinition(t){let n=t.variableDefinitions??[],r=Rr(n,(i)=>i.variable.name.value);for(let[i,o]of r)if(o.length>1)e.reportError(new m(`There can be only one variable named "$${i}".`,{nodes:o.map((s)=>s.variable.name)}))}}}function Ds(e){return{NullValue:(t)=>Vn(e,t,e.getInputType()),ListValue:(t)=>Vn(e,t,e.getParentInputType()),ObjectValue:(t)=>Vn(e,t,e.getInputType()),EnumValue:(t)=>Vn(e,t,e.getInputType()),IntValue:(t)=>Vn(e,t,e.getInputType()),FloatValue:(t)=>Vn(e,t,e.getInputType()),StringValue:(t)=>Vn(e,t,e.getInputType()),BooleanValue:(t)=>Vn(e,t,e.getInputType())}}function Vn(e,t,n){if(n)xn(t,n,(r)=>{e.reportError(r)},void 0,void 0,e.hideSuggestions);return!1}function Os(e){return{VariableDefinition(t){let n=Te(e.getSchema(),t.type);if(n!==void 0&&!xe(n)){let r=t.variable.name.value,i=ee(t.type);e.reportError(new m(`Variable "$${r}" cannot be non-input type "${i}".`,{nodes:t.type}))}}}}function As(e){let t;return{OperationDefinition:{enter(){t=new Map},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i,type:o,parentType:s,defaultValue:a,fragmentVariableDefinition:u}of r){let c=i.name.value,l=u;if(l??=t.get(c),l&&o){let p=e.getSchema(),f=Te(p,l.type);if(f&&!Pd(p,f,l.defaultValue,o,a))e.reportError(new m(`Variable "$${c}" of type "${f}" used in position expecting type "${o}".`,{nodes:[l,i]}));if(k(s)&&s.isOneOf&&pi(f))e.reportError(new m(`Variable "$${c}" is of type "${f}" but must be non-nullable to be used for OneOf Input Object "${s}".`,{nodes:[l,i]}))}}}},VariableDefinition(n){t.set(n.variable.name.value,n)}}}function Pd(e,t,n,r,i){if(w(r)&&!w(t)){if(!(n!=null&&n.kind!==le)&&i===void 0)return!1;let a=r.ofType;return Ht(e,t,a)}return Ht(e,t,r)}var Ga=Object.freeze([es]),xs=Object.freeze([qo,zo,vs,Xo,hs,Ci,Jo,Os,fs,Ko,Is,Ho,rs,cs,ts,Ss,ns,is,Fi,$i,Go,jo,$o,Es,Wo,Pi,Ds,ps,As,us,Gi,...Ga]),dl=Object.freeze([Zo,bs,_s,gs,Ns,Ts,ys,Ci,Fi,$i,ls,wa,Pi,Gi,Va]);class ja{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(let n of this.getDocument().definitions)if(n.kind===Qe)t[n.name.value]=n;this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];let n=[e],r;while(r=n.pop())for(let i of r.selections)if(i.kind===Dt)t.push(i);else if(i.selectionSet)n.push(i.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];let n=new Set,r=[e.selectionSet],i;while(i=r.pop())for(let o of this.getFragmentSpreads(i)){let s=o.name.value;if(!n.has(s)){n.add(s);let a=this.getFragment(s);if(a)t.push(a),r.push(a.selectionSet)}}this._recursivelyReferencedFragments.set(e,t)}return t}}class Ba extends ja{constructor(e,t,n){super(e,n);this._schema=t}get hideSuggestions(){return!1}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class ji extends ja{constructor(e,t,n,r,i){super(t,r);this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map,this._hideSuggestions=i??!1}get[Symbol.toStringTag](){return"ValidationContext"}get hideSuggestions(){return this._hideSuggestions}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){let n=[],r=new ur(this._schema,void 0,this._typeInfo.getFragmentSignatureByName()),i=e.kind===Qe?e:void 0;ft(e,xr(r,{VariableDefinition:()=>!1,Variable(o){let s;if(i)s=r.getFragmentSignatureByName()(i.name.value)?.variableDefinitions.get(o.name.value),n.push({node:o,type:r.getInputType(),parentType:r.getParentInputType(),defaultValue:void 0,fragmentVariableDefinition:s});else n.push({node:o,type:r.getInputType(),parentType:r.getParentInputType(),defaultValue:r.getDefaultValue(),fragmentVariableDefinition:void 0})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(let n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}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()}getFragmentSignature(){return this._typeInfo.getFragmentSignature()}getFragmentSignatureByName(){return this._typeInfo.getFragmentSignatureByName()}getEnumValue(){return this._typeInfo.getEnumValue()}}var $d=Gt(ti,(e)=>e.filter((t)=>t!=="description")),Qa=new m("Too many validation errors, error limit reached. Validation aborted.");function Lr(e,t,n=xs,r){return st(va)?va.traceSync(()=>ml(e,t,n,r),{schema:e,document:t}):ml(e,t,n,r)}function ml(e,t,n,r){let i=r?.maxErrors??100,o=r?.hideSuggestions??!1;Dr(e);let s=[],a=new ur(e),u=new ji(e,t,a,(l)=>{if(s.length>=i)throw Qa;s.push(l)},o),c=ui(n.map((l)=>l(u)));try{ft(t,xr(a,c),$d)}catch(l){if(l===Qa)s.push(Qa);else throw l}return s}function hl(e,t,n=dl){let r=[],i=new Ba(e,t,(s)=>{r.push(s)}),o=n.map((s)=>s(i));return ft(e,ui(o)),r}function El(e){let t=hl(e);if(t.length!==0)throw Error(t.map((n)=>n.message).join(` + +`))}function Tl(e,t){let n=hl(e,t);if(n.length!==0)throw Error(n.map((r)=>r.message).join(` + +`))}function kr(e){return typeof e?.[Symbol.asyncIterator]==="function"}function en(e,t,n){let r=oo(e);if(Gd(r))return r;return new m(r.message,{nodes:r.nodes??t,source:r.source,positions:r.positions,path:n,originalError:r})}function Gd(e){return Array.isArray(e.path)}function Fr(e,t){let n=null;for(let r of e.definitions)if(r.kind===Tt){if(t==null){if(n)return null;n=r}else if(r.name?.value===t)return r}return n}function ws(e,t,n,r,i,o,s){let{schema:a,fragmentDefinitions:u,rootValue:c,operation:l,variableValues:p}=e;return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:i,schema:a,fragments:u,rootValue:c,operation:l,variableValues:p,getAbortSignal:o,getAsyncHelpers:s}}function lr(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function Ya(e){let{promise:t,resolve:n,reject:r}=lr(),i=!1,o=(a)=>{if(i)return;i=!0,n(a)},s=(a)=>{if(i)return;i=!0,r(a)};return e.then(o,s),{promise:t,abort(a){s(a)}}}function qa(e,t){let n=Ya(e);if(t.aborted)return n.abort(t.reason),n.promise;let r=()=>{t.removeEventListener("abort",r),n.abort(t.reason)};return t.addEventListener("abort",r),n.promise.then(()=>{t.removeEventListener("abort",r)},()=>{t.removeEventListener("abort",r)}),n.promise}class Ka{constructor(){this.pendingAsyncWork=new Set}add(e){let t=this.pendingAsyncWork,n=e.then(()=>{t.delete(n)},()=>{t.delete(n)});t.add(n)}addValues(e){for(let t of e)if(Be(t))this.add(t)}wait(){if(this.pendingAsyncWork.size===0)return;return this.waitForPendingAsyncWork()}promiseAllTrackOnReject(e){let t=Promise.all(e);return t.then(void 0,()=>{this.addValues(e)}),t}async waitForPendingAsyncWork(){while(this.pendingAsyncWork.size>0)await Promise.allSettled(Array.from(this.pendingAsyncWork))}}function Rs(e){let t=new Ka,n,r=(o)=>t.promiseAllTrackOnReject(o);return{asyncWorkTracker:t,getAbortSignal:()=>e,getAsyncHelpers:()=>n??={promiseAll:r,track:(o)=>t.addValues(o)},promiseAll:r}}function Cr(e){let t;return function(r,i){t??=new WeakMap;let o=t.get(r);if(o===void 0)o=new WeakMap,t.set(r,o);let s=o.get(i);if(s===void 0)s=e(r,i),o.set(i,s);return s}}function yl(e){let t;return function(r,i,o){t??=new WeakMap;let s=t.get(r);if(s===void 0)s=new WeakMap,t.set(r,s);let a=s.get(i);if(a===void 0)a=new WeakMap,s.set(i,a);let u=a.get(o);if(u===void 0)u=e(r,i,o),a.set(o,u);return u}}function gl(e,t){let n=Object.keys(e),r=Object.values(e);return t(r).then((i)=>{let o=Object.create(null);for(let s=0;s<n.length;++s)o[n[s]]=i[s];return o})}function Nl(e,t,n){let r=n;for(let i of e)r=K(r)?r.then((o)=>t(o,i)):t(r,i);return r}class Bi extends Error{constructor(e,t){super(jd(e),{cause:e});this.name="AbortedGraphQLExecutionError",this.abortedResult=t}get[Symbol.toStringTag](){return"AbortedGraphQLExecutionError"}}function jd(e){if(e instanceof Error)return e.message;if(typeof e==="object"&&e!==null&&"message"in e&&typeof e.message==="string")return e.message;return String(e)}function Ls(e){let t=[];try{while(!0){let n=e.next();if(n.done)return t;if(Be(n.value))t.push(n.value)}}catch{return t}}function Il(e,t){let{operation:n,variableValues:r}=e,i=Zt(vt,t[0].node,r,t[0].fragmentVariableValues);if(!i)return;if(i.if===!1)return;if(typeof i.initialCount!=="number")U(!1,"initialCount must be a number");if(!(i.initialCount>=0))U(!1,"initialCount must be a positive integer");if(n.operation===re.SUBSCRIPTION)U(!1,"`@stream` directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.");let o=t.map((s)=>({node:s.node,deferUsage:void 0,fragmentVariableValues:s.fragmentVariableValues}));return{initialCount:i.initialCount,label:typeof i.label==="string"?i.label:void 0,fieldDetailsList:o}}function vl(e,t){try{e?.(t)}catch{}}function bl(e,t,n){let r=t.asyncWorkTracker.wait();if(r===void 0){vl(n,{validatedExecutionArgs:e});return}r.then(()=>{vl(n,{validatedExecutionArgs:e})}).catch(()=>{return})}async function Qi(e){try{await e.return?.()}catch{}}var Bd=yl((e,t,n)=>{let{schema:r,fragments:i,variableValues:o,hideSuggestions:s}=e;return fl(r,i,o,t,n,s)}),ks=Cr((e,t)=>Il(e,t));class _l{constructor(){this._errorPositions=new Set,this._errors=[]}get errors(){return this._errors}add(e,t){if(this.hasNulledPosition(t))return;this._errorPositions.add(t),this._errors.push(e)}hasNulledPosition(e){let t=e;while(t!==void 0){if(this._errorPositions.has(t))return!0;t=t.prev}return this._errorPositions.has(void 0)}}var Qd=Error("This operation was aborted");class Yi{constructor(e,t){if(this.validatedExecutionArgs=e,this.aborted=!1,this.abortReason=Qd,this.collectedErrors=new _l,t===void 0)this.resolverAbortController=new AbortController,this.sharedExecutionContext=Rs(this.resolverAbortController.signal);else this.sharedExecutionContext=t;let{getAbortSignal:n,getAsyncHelpers:r,promiseAll:i}=this.sharedExecutionContext;this.getAbortSignal=n,this.getAsyncHelpers=r,this.promiseAll=i}executeRootSelectionSet(e){if(!st(ba))return this.executeRootSelectionSetImpl(e);return Cn(ba,this.buildExecuteContextFromValidatedArgs(this.validatedExecutionArgs),()=>this.executeRootSelectionSetImpl(e))}buildExecuteContextFromValidatedArgs(e){return{schema:e.schema,document:e.document,operation:e.operation,rawVariableValues:e.rawVariableValues,operationName:e.operation.name?.value,operationType:e.operation.operation}}executeRootSelectionSetImpl(e){let t=this.validatedExecutionArgs.externalAbortSignal,n;if(t){t.throwIfAborted();let o=()=>{this.abort(t.reason)};n=()=>t.removeEventListener("abort",o),t.addEventListener("abort",o)}let r=()=>{n?.()},i;try{let{schema:o,fragments:s,rootValue:a,operation:u,variableValues:c,hideSuggestions:l}=this.validatedExecutionArgs,{operation:p,selectionSet:f}=u,d=o.getRootType(p);if(d==null)throw new m(`Schema is not configured to execute ${p} operation.`,{nodes:u});let{groupedFieldSet:E,newDeferUsages:I}=wr(o,s,c,d,f,l);if(i=this.executeCollectedRootFields(d,a,E,e??p===re.MUTATION,I),K(i)){let S=i.then((W)=>(r(),this.buildResponse(W)),(W)=>(r(),this.collectedErrors.add(De(W),void 0),this.buildResponse(null)));this.sharedExecutionContext.asyncWorkTracker.add(S);let{promise:G,abort:Z}=Ya(S.then((W)=>this.finish(W)));if(this.abortResultPromise=()=>{Z(this.createAbortedExecutionError(S))},this.aborted)this.abortResultPromise();return G}r()}catch(o){return r(),this.collectedErrors.add(De(o),void 0),this.finish(this.buildResponse(null))}return this.finish(this.buildResponse(i))}abort(e){if(this.aborted)return;if(this.aborted=!0,e!==void 0)this.abortReason=e;this.abortResultPromise?.(),this.resolverAbortController?.abort(this.abortReason)}finish(e){if(this.aborted)throw this.createAbortedExecutionError(e);return this.aborted=!0,e}createAbortedExecutionError(e){return new Bi(this.abortReason,e)}getFinishSharedExecution(){let e=this.resolverAbortController,t=this.validatedExecutionArgs.hooks?.asyncWorkFinished;if(t===void 0)return()=>e?.abort();let n=this.validatedExecutionArgs,r=this.sharedExecutionContext;return()=>{e?.abort(),bl(n,r,t)}}buildResponse(e){this.getFinishSharedExecution()();let t=this.collectedErrors.errors;return t.length?{errors:t,data:e}:{data:e}}executeCollectedRootFields(e,t,n,r,i){return this.executeRootGroupedFieldSet(e,t,n,r,void 0)}executeRootGroupedFieldSet(e,t,n,r,i){return r?this.executeFieldsSerially(e,t,void 0,n,i):this.executeFields(e,t,void 0,n,i)}executeFieldsSerially(e,t,n,r,i){let o=st(sr)?sr:void 0;return Nl(r,(s,[a,u])=>{if(this.aborted)throw Error("Aborted!");let c=Pe(n,a,e.name),l=this.executeField(e,t,u,c,i,o);if(l===void 0)return s;if(K(l))return l.then((p)=>(s[a]=p,o=st(sr)?sr:void 0,s));return s[a]=l,s},Object.create(null))}executeFields(e,t,n,r,i){let o=Object.create(null),s=!1,a=st(sr)?sr:void 0;try{for(let[u,c]of r){let l=Pe(n,u,e.name),p=this.executeField(e,t,c,l,i,a);if(p!==void 0){if(o[u]=p,K(p))s=!0}}}catch(u){if(s)this.sharedExecutionContext.asyncWorkTracker.addValues(Object.values(o));throw u}if(!s)return o;return gl(o,this.promiseAll)}executeField(e,t,n,r,i,o){let s=this.validatedExecutionArgs,{schema:a,contextValue:u,variableValues:c,hideSuggestions:l}=s,p=n[0],f=p.node,d=f.name.value,E=a.getField(e,d);if(!E)return;let I=E.type,S=E.resolve??s.fieldResolver;if(o!==void 0){let Z=S;S=(W,H,Y,ne)=>Cn(o,this.buildResolveContext(H,ne,E.resolve===void 0),()=>Z(W,H,Y,ne))}let G=ws(s,E,Mn(n),e,r,this.getAbortSignal,this.getAsyncHelpers);try{let Z=_t(E,f,c,p.fragmentVariableValues,l),W=S(t,Z,u,G);if(Be(W))return this.completePromisedValue(I,n,G,r,W,i);let H=this.completeValue(I,n,G,r,W,i);if(K(H))return H.then(void 0,(Y)=>(this.handleFieldError(Y,I,n,r),null));return H}catch(Z){return this.handleFieldError(Z,I,n,r),null}}buildResolveContext(e,t,n){let r;return{fieldName:t.fieldName,alias:String(t.path.key),parentType:t.parentType.name,fieldType:String(t.returnType),args:e,isDefaultResolver:n,get fieldPath(){return r??=fe(t.path).join("."),r}}}handleFieldError(e,t,n,r){let i=en(e,Mn(n),fe(r));if(this.validatedExecutionArgs.errorPropagation&&w(t))throw i;this.collectedErrors.add(i,r)}completeValue(e,t,n,r,i,o){if(i instanceof Error)throw i;if(w(e)){let s=this.completeValue(e.ofType,t,n,r,i,o);if(s===null)throw Error(`Cannot return null for non-nullable field ${n.parentType}.${n.fieldName}.`);return s}if(i==null)return null;if(j(e))return this.completeListValue(e,t,n,r,i,o);if(ve(e))return this.completeLeafValue(e,i);if(Ke(e))return this.completeAbstractValue(e,t,n,r,i,o);if(L(e))return this.completeObjectValue(e,t,n,r,i,o);U(!1,"Cannot complete value of unexpected output type: "+y(e))}async completePromisedValue(e,t,n,r,i,o){try{let s=await i;if(this.aborted)throw Error("Aborted!");let a=this.completeValue(e,t,n,r,s,o);if(K(a))a=await a;return a}catch(s){return this.handleFieldError(s,e,t,r),null}}async completeAsyncIterableValue(e,t,n,r,i,o){let s=typeof r.key==="number"?void 0:ks(this.validatedExecutionArgs,t),a=!1,u=[],c=i[Symbol.asyncIterator](),l=0,p;try{while(!0){if(s?.initialCount===l&&this.handleStream(l,r,{handle:c,isAsync:!0},s,n,e))break;let f=Pe(r,l,void 0);try{p=await c.next()}catch(E){throw en(E,Mn(t),fe(r))}if(this.aborted||p.done)break;let d=p.value;if(this.completeMaybePromisedListItemValue(d,u,e,t,n,f,o))a=!0;l++}}catch(f){if(this.sharedExecutionContext.asyncWorkTracker.add(Qi(c)),a)this.sharedExecutionContext.asyncWorkTracker.addValues(u);throw f}if(this.aborted){if(!p?.done)this.sharedExecutionContext.asyncWorkTracker.add(Qi(c));throw Error("Aborted!")}return a?this.promiseAll(u):u}handleStream(e,t,n,r,i,o){return!1}completeListValue(e,t,n,r,i,o){let s=e.ofType;if(kr(i))return this.completeAsyncIterableValue(s,t,n,r,i,o);if(!et(i))throw new m(`Expected Iterable, but did not find one for field "${n.parentType}.${n.fieldName}".`);return this.completeIterableValue(s,t,n,r,i,o)}completeIterableValue(e,t,n,r,i,o){let s=typeof r.key==="number"?void 0:ks(this.validatedExecutionArgs,t),a=!1,u=[],c=0,l=i[Symbol.iterator]();try{while(!0){if(s?.initialCount===c&&this.handleStream(c,r,{handle:l},s,n,e))break;let p=l.next();if(p.done)break;let f=p.value,d=Pe(r,c,void 0);if(this.completeMaybePromisedListItemValue(f,u,e,t,n,d,o))a=!0;c++}}catch(p){let f=this.sharedExecutionContext.asyncWorkTracker;if(a)f.addValues(u);throw f.addValues(Ls(l)),p}return a?this.promiseAll(u):u}completeMaybePromisedListItemValue(e,t,n,r,i,o,s){if(Be(e))return t.push(this.completePromisedListItemValue(e,n,r,i,o,s)),!0;else if(this.completeListItemValue(e,t,n,r,i,o,s))return!0;return!1}completeListItemValue(e,t,n,r,i,o,s){try{let a=this.completeValue(n,r,i,o,e,s);if(K(a))return t.push(a.then(void 0,(u)=>(this.handleFieldError(u,n,r,o),null))),!0;t.push(a)}catch(a){this.handleFieldError(a,n,r,o),t.push(null)}return!1}async completePromisedListItemValue(e,t,n,r,i,o){try{let s=await e;if(this.aborted)throw Error("Aborted!");let a=this.completeValue(t,n,r,i,s,o);if(K(a))a=await a;return a}catch(s){return this.handleFieldError(s,t,n,i),null}}completeLeafValue(e,t){let n=e.coerceOutputValue(t);if(n==null)throw Error(`Expected \`${y(e)}.coerceOutputValue(${y(t)})\` to return non-nullable value, returned: ${y(n)}`);return n}completeAbstractValue(e,t,n,r,i,o){let s=this.validatedExecutionArgs,{schema:a,contextValue:u}=s,l=(e.resolveType??s.typeResolver)(i,u,n,e);if(Be(l))return l.then((p)=>{if(this.aborted)throw Error("Aborted!");return this.completeObjectValue(this.ensureValidRuntimeType(p,a,e,t,n,i),t,n,r,i,o)});return this.completeObjectValue(this.ensureValidRuntimeType(l,a,e,t,n,i),t,n,r,i,o)}ensureValidRuntimeType(e,t,n,r,i,o){if(e==null)throw new m(`Abstract type "${n}" must resolve to an Object type at runtime for field "${i.parentType}.${i.fieldName}". Either the "${n}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,{nodes:Mn(r)});if(typeof e!=="string")throw new m(`Abstract type "${n}" must resolve to an Object type at runtime for field "${i.parentType}.${i.fieldName}" with value ${y(o)}, received "${y(e)}", which is not a valid Object type name.`);let s=t.getType(e);if(s==null)throw new m(`Abstract type "${n}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:Mn(r)});if(!L(s))throw new m(`Abstract type "${n}" was resolved to a non-object type "${e}".`,{nodes:Mn(r)});if(!t.isSubType(n,s))throw new m(`Runtime Object type "${s}" is not a possible type for "${n}".`,{nodes:Mn(r)});return s}completeObjectValue(e,t,n,r,i,o){if(e.isTypeOf){let s=e.isTypeOf(i,this.validatedExecutionArgs.contextValue,n);if(Be(s))return s.then((a)=>{if(this.aborted)throw Error("Aborted!");if(!a)throw this.invalidReturnTypeError(e,i,t);return this.collectAndExecuteSubfields(e,t,r,i,o)});if(!s)throw this.invalidReturnTypeError(e,i,t)}return this.collectAndExecuteSubfields(e,t,r,i,o)}invalidReturnTypeError(e,t,n){return new m(`Expected value of type "${e}" but got: ${y(t)}.`,{nodes:Mn(n)})}collectAndExecuteSubfields(e,t,n,r,i){let{groupedFieldSet:o,newDeferUsages:s}=Bd(this.validatedExecutionArgs,e,t);return this.executeCollectedSubfields(e,r,n,o,s,i)}executeCollectedSubfields(e,t,n,r,i,o){return this.executeFields(e,t,n,r,void 0)}}function Mn(e){return e.map((t)=>t.node)}var Ja="Executing this GraphQL operation would unexpectedly produce multiple payloads (due to @defer or @stream directive)";class Fs extends Yi{executeCollectedRootFields(e,t,n,r,i){if(i.length>0){if(this.validatedExecutionArgs.operation.operation===re.SUBSCRIPTION)U(!1,"`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.");let o=Error(Ja);throw this.abort(o),o}return this.executeRootGroupedFieldSet(e,t,n,r,void 0)}executeCollectedSubfields(e,t,n,r,i){if(i.length>0){if(this.validatedExecutionArgs.operation.operation===re.SUBSCRIPTION)U(!1,"`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.");let o=Error(Ja);throw this.abort(o),o}return this.executeFields(e,t,n,r,void 0)}completeListValue(e,t,n,r,i,o){if(ks(this.validatedExecutionArgs,t)!==void 0){if(this.validatedExecutionArgs.operation.operation===re.SUBSCRIPTION)U(!1,"`@stream` directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.");let a=Error(Ja);throw this.abort(a),a}return super.completeListValue(e,t,n,r,i,o)}}function Cs(e){let t;return function(r){t??=new WeakMap;let i=t.get(r);if(i===void 0)i=e(r),t.set(r,i);return i}}function Vr(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Vs(e,t){for(let n of e.keys())if(Vr(n,t))return e.get(n);return}function Wa(e,t=new Set){let n=new Map,r=new Map;for(let[i,o]of e){let s=Yd(o);if(Vr(s,t)){n.set(i,o);continue}let a=Vs(r,s);if(a===void 0)a=new Map,r.set(s,a);a.set(i,o)}return{groupedFieldSet:n,newGroupedFieldSets:r}}function Yd(e){let t=new Set;for(let n of e){let r=n.deferUsage;if(r===void 0)return t.clear(),t;t.add(r)}for(let n of t){let r=n.parentDeferUsage;while(r!==void 0){if(t.has(r)){t.delete(n);break}r=r.parentDeferUsage}}return t}class Ha{constructor(e,t){this._fn=e,this._onAbort=t}prime(){if(this._maybePromise)return this._maybePromise;try{let e=this._fn();if(K(e))this._maybePromise={status:"pending",promise:e},e.then((t)=>{this._maybePromise={status:"fulfilled",value:t}},(t)=>{this._maybePromise={status:"rejected",reason:t}});else this._maybePromise={status:"fulfilled",value:e}}catch(e){this._maybePromise={status:"rejected",reason:e}}return this._maybePromise}result(){let e=this.prime();switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;case"pending":return e.promise}}abort(e){let t=this._maybePromise;if(!t){this._maybePromise={status:"rejected",reason:e};return}if(t.status==="pending"){if(this._maybePromise={status:"rejected",reason:e},this._onAbort)return this._onAbort(e)}}}var za=Symbol.asyncDispose??Symbol.for("Symbol.asyncDispose");function Un(e,t,n=t){let r=!1,i=!1,o=(s)=>{if(r||i)return;return i=!0,qd(s)};return{[Symbol.asyncIterator](){return this},next(){let s=e.next();return s.then((a)=>{if(a.done)r=!0}).catch(()=>{return}),s},async return(){return await o(t),e.return()},async throw(s){return await o(()=>n(s)),e.throw(s)},async[za](){if(await o(t),typeof e[za]==="function")await e[za]()}}}function qd(e){try{let t=e();if(K(t))return t.catch(()=>{})}catch{}}function pr(e,t){let n=e[Symbol.asyncIterator](),r=n.return?.bind(n),i=n.throw?.bind(n),o=r?()=>Sl(r):()=>Promise.resolve(),s=i?(a)=>Sl(()=>i(a)):o;return Un(Kd(e,t),o,s)}async function Sl(e){try{await e()}catch{}}async function*Kd(e,t){for await(let n of e){let r=t(n);if(K(r)){yield await r;continue}yield r}}class qi{constructor(e,t=1){this._backlog=0,this._waiters=[],this._entries=[],this._isStopped=!1,this._stopRequested=!1,this._stopCleanupCallbacks=[],this._batchRequests=new Set,this._capacity=this._normalizeCapacity(t);let{promise:n,resolve:r}=lr();this._resolveStarted=r;try{let i=e({push:this._push.bind(this),stop:this._stop.bind(this),onStop:this._onStop.bind(this),started:n});if(K(i))i.catch(this._stop.bind(this))}catch(i){let o=this._stop(i);if(K(o))o.catch(()=>{return})}}subscribe(e=(t)=>Array.from(t)){let t=this._iteratorLoop(e);return Un(t,()=>this.cancel(),this.abort.bind(this))}cancel(){if(this._stopRequested)return this._stopCompletion;return this._terminate(void 0,()=>{this._isStopped=!0,this._batchRequests.forEach((e)=>e.resolve(void 0)),this._batchRequests.clear()})}abort(e){if(this._stopRequested)return this._stopCompletion;return this._terminate(e,()=>{if(this._isStopped=!0,this._batchRequests.size){this._batchRequests.forEach((t)=>t.reject(e)),this._batchRequests.clear();return}this._entries.push({kind:"item",settled:{status:"rejected",reason:e}})})}async forEachBatch(e){let t=this.subscribe(async(n)=>{let{promise:r,resolve:i}=lr(),o=function*(){yield*n,i()}();await Promise.all([e(o),r])});for await(let n of t);}setCapacity(e){this._capacity=this._normalizeCapacity(e),this._flush()}getCapacity(){return this._capacity}isStopped(){return this._isStopped}_normalizeCapacity(e){return Math.max(1,Math.floor(e))}_flush(){while(this._waiters.length>0&&this._backlog<this._capacity)this._waiters.shift()?.()}_reserve(){if(this._backlog+=1,this._backlog<this._capacity)return;let{promise:e,resolve:t}=lr();return this._waiters.push(t),e}_release(){if(this._backlog>0)this._backlog-=1;this._flush()}_onStop(e){if(this._stopRequested)throw Error("Cannot register onStop cleanup after stop has been requested.");this._stopCleanupCallbacks.push(e)}_runStopCleanup(e,t){this._stopRequested=!0;let n=this._stopCleanupCallbacks.flatMap((i)=>{try{let o=i(e);return K(o)?[o]:[]}catch{return[]}}),r=n.length>0?Promise.allSettled(n).then(()=>{return}):void 0;if(K(r))return this._stopCompletion=r.then(t,t).then(()=>{return}),this._stopCompletion;t()}async*_iteratorLoop(e){this._resolveStarted();let t;while(t=await this._waitForNextBatch()){let n=e(t);if(K(n))n=await n;if(n===void 0)continue;yield n}}_waitForNextBatch(){let{promise:e,resolve:t,reject:n}=lr();return this._batchRequests.add({resolve:t,reject:n}),this._deliverBatchIfReady(),e}_push(e){if(this._stopRequested)return;let t=this._reserve();if(K(e)){let n={kind:"item"};this._entries.push(n),e.then((r)=>{n.settled={status:"fulfilled",value:r},this._deliverBatchIfReady()},(r)=>{n.settled={status:"rejected",reason:r},this._deliverBatchIfReady()})}else this._entries.push({kind:"item",settled:{status:"fulfilled",value:e}}),this._deliverBatchIfReady();return t}_terminate(e,t){for(let n of this._entries)if(n.kind==="item")this._release();return this._entries.length=0,this._runStopCleanup(e,t)}_stop(e){if(this._stopRequested)return this._stopCompletion;let t=this._runStopCleanup(e,()=>{if(e===void 0){if(this._entries.length===0){this._isStopped=!0,this._deliverBatchIfReady();return}this._entries.push({kind:"stop"}),this._deliverBatchIfReady();return}this._entries.push({kind:"item",settled:{status:"rejected",reason:e}}),this._entries.push({kind:"stop"}),this._deliverBatchIfReady()});if(K(t))t.catch(()=>{return});return t}_deliverBatchIfReady(){if(!this._batchRequests.size)return;let e=this._entries[0],t=this._batchRequests;if(e!==void 0){if(e.kind==="stop")U(!1);let n=e.settled;if(n!==void 0){if(n.status==="fulfilled"){this._batchRequests=new Set,t.forEach((r)=>r.resolve(this._drainBatch()));return}this._entries.shift(),this._release(),this._isStopped=!0,this._batchRequests=new Set,t.forEach((r)=>r.reject(n.reason))}}else if(this._isStopped)this._batchRequests=new Set,t.forEach((n)=>n.resolve(void 0))}*_drainBatch(){while(!0){let e=this._entries[0];if(e===void 0)return;if(e.kind==="stop"){this._isStopped=!0,this._entries.shift();return}let t=e.settled;if(t===void 0||t.status==="rejected")return;this._entries.shift(),this._release(),yield t.value}}}function Ms(e){let t=new Set,n=new Set,r=new Map,i=new Map,o,s,{newGroups:a,newStreams:u}=I(e),c=H(a);for(let N of c)t.add(N);for(let N of u)n.add(N);let l=new qi(({push:N,stop:g,onStop:_,started:B})=>{o=N,s=g,B.then(()=>{for(let X of t)ne(X);for(let X of n)A(X)}),_((X)=>p(X))},1).subscribe((N)=>h(N));return{initialGroups:c,initialStreams:u,events:l};function p(N){let g=[];for(let _ of t)f(_,N,g);for(let _ of n)E(_,N,g);if(g.length>0)return Promise.allSettled(g).then(()=>{return})}function f(N,g,_){let B=r.get(N);if(B){for(let X of B.tasks)d(X,g,_);for(let X of B.childGroups)f(X,g,_)}}function d(N,g,_){let B=N.computation.abort(g);if(K(B))_.push(B);let X=i.get(N);if(X)for(let he of X.childStreams)E(he,g,_)}function E(N,g,_){let B=N.queue.abort(g);if(K(B))_.push(B)}function I(N,g){if(!N)return{newGroups:[],newStreams:[]};let{groups:_,tasks:B,streams:X}=N,he=_?S(_,g):[];if(B)for(let on of B)Z(on);let lt=X?W(X,g):[];return{newGroups:he,newStreams:lt}}function S(N,g){let _=new Set(N),B=new Set,X=[];for(let he of N)G(he,_,X,B,g);return X}function G(N,g,_,B,X){if(B.has(N))return;B.add(N);let he=N.parent;if(he!==void 0&&g.has(he))G(he,g,_,B,X);let lt={childGroups:[],tasks:new Set,pending:0};if(r.set(N,lt),X===void 0&&!he)_.push(N);else if(he)r.get(he)?.childGroups.push(N)}function Z(N){for(let g of N.groups){let _=r.get(g);if(_){if(_.tasks.add(N),_.pending++,t.has(g))b(N)}}}function W(N,g){if(!g)return N;let _=i.get(g);if(_)_.childStreams.push(...N);return[]}function H(N,g=[]){for(let _ of N){let B=r.get(_);if(B)if(B.pending===0)r.delete(_),H(B.childGroups,g);else g.push(_)}return g}function Y(N,g){for(let _ of N)t.add(_),ne(_);for(let _ of g)n.add(_),A(_)}function ne(N){let g=r.get(N);if(g)for(let _ of g.tasks)b(_)}function b(N){if(i.has(N))return;i.set(N,{value:void 0,childStreams:[]});try{let g=N.computation.result();if(K(g))g.then((_)=>{o({kind:"TASK_SUCCESS",task:N,result:_})},(_)=>{o({kind:"TASK_FAILURE",task:N,error:_})});else o({kind:"TASK_SUCCESS",task:N,result:g})}catch(g){o({kind:"TASK_FAILURE",task:N,error:g})}}async function A(N){try{await N.queue.forEachBatch(async(g)=>{let _=o({kind:"STREAM_ITEMS",stream:N,items:g});if(K(_))await _}),o({kind:"STREAM_SUCCESS",stream:N})}catch(g){o({kind:"STREAM_FAILURE",stream:N,error:g})}}function h(N){let g=[];for(let _ of N)switch(_.kind){case"TASK_SUCCESS":g.push(...D(_));break;case"TASK_FAILURE":g.push(...R(_));break;case"STREAM_ITEMS":g.push(...q(_));break;case"STREAM_SUCCESS":if(n.has(_.stream))n.delete(_.stream),g.push(_);break;case"STREAM_FAILURE":n.delete(_.stream),g.push(_);break}if(t.size===0&&n.size===0)s(),g.push({kind:"WORK_QUEUE_TERMINATION"});return g.length>0?g:void 0}function D(N){let{task:g,result:_}=N,{value:B,work:X}=_,he=i.get(g);if(he)he.value=B;I(X,g);let lt=[],on=[],Er=[];for(let Bn of g.groups){let Qn=r.get(Bn);if(Qn){if(Qn.pending--,t.has(Bn)&&Qn.pending===0){let{groupValuesEvent:Xr,groupSuccessEvent:df,newGroups:mf,newStreams:hf}=ce(Bn,Qn);if(Xr)lt.push(Xr);lt.push(df),on.push(...mf),Er.push(...hf)}}}return Y(on,Er),lt}function R(N){let{task:g,error:_}=N;i.delete(g);let B=[];for(let X of g.groups){let he=r.get(X);if(he)B.push(Ue(X,he,_))}return B}function q(N){let{stream:g,items:_}=N,B=[],X=[],he=[];for(let{value:on,work:Er}of _){let{newGroups:Bn,newStreams:Qn}=I(Er),Xr=H(Bn);Y(Xr,Qn),B.push(on),X.push(...Xr),he.push(...Qn)}let lt={kind:"STREAM_VALUES",stream:g,values:B,newGroups:X,newStreams:he};if(g.queue.isStopped())return n.delete(g),[lt,{kind:"STREAM_SUCCESS",stream:g}];return[lt]}function ce(N,g){r.delete(N);let _=[],B=[];for(let he of g.tasks){let lt=i.get(he);if(lt){let{value:on,childStreams:Er}=lt;if(on!==void 0)_.push(on);for(let Bn of Er)B.push(Bn);O(he)}}let X=H(g.childGroups);return t.delete(N),{groupValuesEvent:_.length?{kind:"GROUP_VALUES",group:N,values:_}:void 0,groupSuccessEvent:{kind:"GROUP_SUCCESS",group:N,newGroups:X,newStreams:B},newGroups:X,newStreams:B}}function Ue(N,g,_){return v(N,g),t.delete(N),{kind:"GROUP_FAILURE",group:N,error:_}}function v(N,g){r.delete(N);for(let _ of g.tasks)if(_.groups.every((B)=>!r.has(B)))O(_);for(let _ of g.childGroups){let B=r.get(_);if(B)v(_,B)}}function O(N){for(let g of N.groups)r.get(g)?.tasks.delete(N);i.delete(N)}}class Xa{constructor(){this._ids=new Map,this._nextId=0}buildResponse(e,t,n,r,i){let{initialGroups:o,initialStreams:s,events:a}=Ms(n);function u(){f.throw(r?.reason).catch(()=>{})}if(r)r.addEventListener("abort",u);let c=()=>{i(),r?.removeEventListener("abort",u)},l=this._toPendingResults(o,s),p=t.length?{errors:t,data:e,pending:l,hasNext:!0}:{data:e,pending:l,hasNext:!0},f=Un(pr(a,(d)=>this._handleBatch(d,c)),()=>c());return{initialResult:p,subsequentResults:f}}_ensureId(e){let t=this._ids.get(e);if(t!==void 0)return t;return t=String(this._nextId++),this._ids.set(e,t),t}_toPendingResults(e,t){let n=[];for(let r of[e,t])for(let i of r){let s={id:this._ensureId(i),path:fe(i.path)};if(i.label!==void 0)s.label=i.label;n.push(s)}return n}_handleBatch(e,t){let n={pending:[],incremental:[],completed:[],hasNext:!0};for(let u of e)this._handleWorkQueueEvent(u,n,t);let{incremental:r,completed:i,pending:o,hasNext:s}=n,a={hasNext:s};if(o.length>0)a.pending=o;if(r.length>0)a.incremental=r;if(i.length>0)a.completed=i;return a}_handleWorkQueueEvent(e,t,n){switch(e.kind){case"GROUP_VALUES":{let r=e.group,i=this._ensureId(r);for(let o of e.values){let{bestId:s,subPath:a}=this._getBestIdAndSubPath(i,r,o),u={id:s,data:o.data};if(o.errors!==void 0)u.errors=o.errors;if(a!==void 0)u.subPath=a;t.incremental.push(u)}break}case"GROUP_SUCCESS":{let r=e.group,i=this._ensureId(r);if(t.completed.push({id:i}),this._ids.delete(r),e.newGroups.length>0||e.newStreams.length>0)t.pending.push(...this._toPendingResults(e.newGroups,e.newStreams));break}case"GROUP_FAILURE":{let{group:r,error:i}=e,o=this._ensureId(r);t.completed.push({id:o,errors:[De(i)]}),this._ids.delete(r);break}case"STREAM_VALUES":{let r=e.stream,i=this._ensureId(r),{values:o,newGroups:s,newStreams:a}=e,u=[],c=[];for(let l of o)if(u.push(l.item),l.errors!==void 0)c.push(...l.errors);if(t.incremental.push(c.length>0?{id:i,items:u,errors:c}:{id:i,items:u}),s.length>0||a.length>0)t.pending.push(...this._toPendingResults(s,a));break}case"STREAM_SUCCESS":{let r=e.stream;t.completed.push({id:this._ensureId(r)}),this._ids.delete(r);break}case"STREAM_FAILURE":{let r=e.stream;t.completed.push({id:this._ensureId(r),errors:[De(e.error)]}),this._ids.delete(r);break}case"WORK_QUEUE_TERMINATION":{n?.(),t.hasNext=!1;break}}}_getBestIdAndSubPath(e,t,n){let r=fe(t.path).length,i=e;for(let s of n.deliveryGroups){if(s===t)continue;let a=this._ids.get(s);if(a===void 0)continue;let c=fe(s.path).length;if(c>r)r=c,i=a}let o=n.path.slice(r);return{bestId:i,subPath:o.length>0?o:void 0}}}var Dl=Cs((e)=>Wa(e)),Jd=Cr((e,t)=>Wa(e,t));class Mr extends Yi{constructor(e,t,n){super(e,t);this.deferUsageSet=n,this.groups=[],this.tasks=[],this.streams=[]}getCreateSubExecutor(){let e=this.validatedExecutionArgs,t=this.sharedExecutionContext;return(n)=>new Mr(e,t,n)}abort(e){super.abort(e);for(let t of this.tasks){let n=t.computation.abort(e);if(K(n))U(!1)}for(let t of this.streams){let n=t.queue.abort(e);if(K(n))U(!1)}}buildResponse(e){let t=this.getIncrementalWork(),{tasks:n,streams:r}=t;if(n?.length===0&&r?.length===0)return super.buildResponse(e);let i=this.collectedErrors.errors;if(e===null)U(!1);return new Xa().buildResponse(e,i,t,this.validatedExecutionArgs.externalAbortSignal,this.getFinishSharedExecution())}executeCollectedRootFields(e,t,n,r,i){if(i.length===0)return this.executeRootGroupedFieldSet(e,t,n,r,void 0);if(this.validatedExecutionArgs.operation.operation===re.SUBSCRIPTION)U(!1,"`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.");let{newDeliveryGroups:o,newDeliveryGroupMap:s}=this.getNewDeliveryGroupMap(i,void 0,void 0),{groupedFieldSet:a,newGroupedFieldSets:u}=this.buildRootExecutionPlan(n),c=this.executeRootGroupedFieldSet(e,t,a,r,s);if(this.groups.push(...o),u.size>0)this.collectExecutionGroups(e,t,void 0,u,s);return c}buildRootExecutionPlan(e){return Dl(e)}executeCollectedSubfields(e,t,n,r,i,o){if(i.length>0){if(this.validatedExecutionArgs.operation.operation===re.SUBSCRIPTION)U(!1,"`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.")}if(o===void 0&&i.length===0)return this.executeFields(e,t,n,r,o);let{newDeliveryGroups:s,newDeliveryGroupMap:a}=this.getNewDeliveryGroupMap(i,o,n),{groupedFieldSet:u,newGroupedFieldSets:c}=this.buildSubExecutionPlan(r),l=this.executeFields(e,t,n,u,a);if(this.groups.push(...s),c.size>0)this.collectExecutionGroups(e,t,n,c,a);return l}buildSubExecutionPlan(e){return this.deferUsageSet===void 0?Dl(e):Jd(e,this.deferUsageSet)}collectExecutionGroups(e,t,n,r,i){let o=this.getCreateSubExecutor();for(let[s,a]of r){let u=Hd(s,i),c=o(s),l={groups:u,path:n,computation:new Ha(()=>c.executeExecutionGroup(u,e,t,n,a,i),(f)=>c.abort(f))},p=this.deferUsageSet;if(this.validatedExecutionArgs.enableEarlyExecution)if(this.shouldDefer(p,s))Promise.resolve().then(()=>l.computation.prime());else l.computation.prime();this.tasks.push(l)}}executeExecutionGroup(e,t,n,r,i,o){let s;try{s=this.executeFields(t,n,r,i,o)}catch(a){throw this.abort(),a}if(K(s))return s.then((a)=>this.buildExecutionGroupResult(e,r,a),(a)=>{throw this.abort(),a});return this.buildExecutionGroupResult(e,r,s)}buildExecutionGroupResult(e,t,n){let r=n,i=this.collectedErrors.errors;return this.finish({value:i.length?{deliveryGroups:e,path:fe(t),errors:i,data:r}:{deliveryGroups:e,path:fe(t),data:r},work:this.getIncrementalWork()})}getIncrementalWork(){let{groups:e,tasks:t,streams:n,collectedErrors:r}=this;if(r.errors.length===0)return{groups:e,tasks:t,streams:n};let i=Error("Cancelled secondary to null within original result"),o=[];for(let a of t)if(r.hasNulledPosition(a.path)){let u=a.computation.abort(i);if(K(u))U(!1)}else o.push(a);let s=[];for(let a of n)if(r.hasNulledPosition(a.path)){let u=a.queue.abort(i);if(K(u))U(!1)}else s.push(a);return{groups:e,tasks:o,streams:s}}getNewDeliveryGroupMap(e,t,n){let r=[],i=new Map(t);for(let o of e){let s=o.parentDeferUsage,a=s===void 0?void 0:Ol(s,i),u={path:n,label:o.label,parent:a};r.push(u),i.set(o,u)}return{newDeliveryGroups:r,newDeliveryGroupMap:i}}shouldDefer(e,t){return e===void 0||!Array.from(t).every((n)=>e.has(n))}handleStream(e,t,n,r,i,o){let{handle:s,isAsync:a}=n,u=this.buildStreamItemQueue(e,t,s,r.fieldDetailsList,i,o,a),c={label:r.label,path:t,queue:u,initialCount:e};return this.streams.push(c),!0}buildStreamItemQueue(e,t,n,r,i,o,s){let a=this.getCreateSubExecutor(),{enableEarlyExecution:u}=this.validatedExecutionArgs,c=this.sharedExecutionContext;return new qi(async({push:p,stop:f,onStop:d,started:E})=>{let I=new Set,S=!1,G=!1;if(d((W)=>{if(G=!0,!S){for(let H of I)H(W);if(s)c.asyncWorkTracker.add(Qi(n));else c.asyncWorkTracker.addValues(Ls(n))}}),await(u?Promise.resolve():E),G)return;let Z=e;while(!0){let W;try{if(s){if(W=await n.next(),G)return}else W=n.next()}catch(A){throw en(A,Wd(r),fe(t))}if(W.done){S=!0;let A=f();if(K(A))A.catch(()=>{return});return}let H=Pe(t,Z,void 0),Y=a(),ne=Y.completeStreamItem(H,W.value,r,i,o);if(K(ne)){if(u){let A=(h)=>Y.abort(h);I.add(A),ne=ne.finally(()=>{I.delete(A)})}else if(ne=await ne,G)return}let b=p(ne);if(K(b)){if(await b,G)return}Z+=1}},100)}completeStreamItem(e,t,n,r,i){if(Be(t))return this.completePromisedValue(i,n,r,e,t,void 0).then((s)=>this.buildStreamItemResult(s),(s)=>(this.handleFieldError(s,i,n,e),this.buildStreamItemResult(null))).then(void 0,(s)=>{throw this.abort(),s});let o;try{try{o=this.completeValue(i,n,r,e,t,void 0)}catch(s){return this.handleFieldError(s,i,n,e),this.buildStreamItemResult(null)}}catch(s){throw this.abort(),s}if(K(o))return o.then((s)=>this.buildStreamItemResult(s),(s)=>(this.handleFieldError(s,i,n,e),this.buildStreamItemResult(null))).then(void 0,(s)=>{throw this.abort(),s});return this.buildStreamItemResult(o)}buildStreamItemResult(e){let t=e,n=this.collectedErrors.errors,r=this.getIncrementalWork();return this.finish(n.length>0?{value:{item:t,errors:n},work:r}:{value:{item:t},work:r})}}function Wd(e){return e.map((t)=>t.node)}function Hd(e,t){return Array.from(e).map((n)=>Ol(n,t))}function Ol(e,t){return t.get(e)}var zd="The provided schema unexpectedly contains experimental directives (@defer or @stream). These directives may only be utilized if experimental execution features are explicitly enabled.";function Ur(e){if(!st(Oi))return Al(e);return Cn(Oi,Za(e),()=>Al(e))}function Za(e){let t,n=()=>{if(t===void 0)t=Fr(e.document,e.operationName);return t};return{schema:e.schema,document:e.document,rawVariableValues:e.variableValues,get operationName(){return e.operationName??n()?.name?.value},get operationType(){return n()?.operation}}}function Al(e){if(e.schema.getDirective("defer")||e.schema.getDirective("stream"))throw Error(zd);let t=fr(e);if(!("schema"in t))return{errors:t};return tu(t)}function eu(e){if(!st(Oi))return xl(e);return Cn(Oi,Za(e),()=>xl(e))}function xl(e){let t=fr(e);if(!("schema"in t))return{errors:t};return nu(t)}function tu(e){return new Fs(e).executeRootSelectionSet()}function nu(e){return new Mr(e).executeRootSelectionSet()}function $s(e){let t=eu(e);if(K(t)||"initialResult"in t)throw Error("GraphQL execution failed to complete synchronously.");return t}function ru(e){return new Fs(e).executeRootSelectionSet(!1)}function Pr(e){if(!st(_a))return wl(e);return Cn(_a,Za(e),()=>wl(e))}function wl(e){let t=ou(e);if(!("schema"in t))return{errors:t};let n=iu(t);if(K(n))return n.then((r)=>kr(r)?Ps(t,r):r);return kr(n)?Ps(t,n):n}function iu(e){if(!("operation"in e))throw new m("Passing ExecutionArgs to createSourceEventStream() was removed in graphql-js@17.0.0; call validateSubscriptionArgs() first and pass the result instead, or use subscribe() for the full subscription pipeline.");try{let t=Zd(e);if(K(t))return t.then(void 0,(n)=>({errors:[De(n)]}));return t}catch(t){return{errors:[De(t)]}}}function fr(e){let{schema:t,document:n,rootValue:r,contextValue:i,variableValues:o,operationName:s,fieldResolver:a,typeResolver:u,subscribeFieldResolver:c,abortSignal:l,enableEarlyExecution:p,hooks:f,options:d}=e;Dr(t);let E,I=Object.create(null),S=Object.create(null),G=[];for(let h of n.definitions)switch(h.kind){case Tt:if(s==null){if(E!==void 0)return[new m("Must provide operation name if query contains multiple operations.")];E=h}else if(h.name?.value===s)E=h;break;case Qe:{I[h.name.value]=h;let D;if(h.variableDefinitions){let R=Object.create(null);for(let q of h.variableDefinitions){let ce=ms(t,q);if(ce instanceof m){G.push(ce);continue}R[ce.name]=ce}D=R}S[h.name.value]={definition:h,variableSignatures:D};break}default:}if(!E){if(s!=null)return[new m(`Unknown operation named "${s}".`)];return[new m("Must provide an operation.")]}if(G.length>0)return G;let Z=E.variableDefinitions??[],W=e.hideSuggestions??!1,H=o??{},Y={maxErrors:d?.maxCoercionErrors??50,hideSuggestions:W},ne=Pc,b=st(ne)?Cn(ne,{schema:t,document:n,operation:E,rawVariableValues:o,operationName:E.name?.value,operationType:E.operation},()=>Mi(t,Z,H,Y)):Mi(t,Z,H,Y);if(b.errors)return b.errors;let A=!E.directives?.find((h)=>h.name.value===Rc.name);return{schema:t,document:n,fragmentDefinitions:I,fragments:S,rootValue:r,contextValue:i,operation:E,variableValues:b.variableValues,fieldResolver:a??Us,typeResolver:u??su,subscribeFieldResolver:c??Us,hideSuggestions:W,errorPropagation:A,externalAbortSignal:l??void 0,enableEarlyExecution:p===!0,hooks:f??void 0,rawVariableValues:o}}function ou(e){let t=fr(e);if(!("schema"in t))return t;return Xd(t),t}function Xd(e){if(!Yo(e.operation))throw new m("Expected subscription operation.")}var su=function(e,t,n,r){if(ye(e)&&typeof e.__typename==="string")return e.__typename;let i=n.schema.getPossibleTypes(r),o=[];try{for(let s=0;s<i.length;s++){let a=i[s];if(a.isTypeOf){let u=a.isTypeOf(e,t,n);if(Be(u))o[s]=u;else if(u){if(o.length)n.getAsyncHelpers().track(o);return a.name}}}}catch(s){if(o.length)n.getAsyncHelpers().track(o);throw s}if(o.length)return n.getAsyncHelpers().promiseAll(o).then((s)=>{for(let a=0;a<s.length;a++)if(s[a])return i[a].name})},Us=function(e,t,n,r){if(ye(e)||typeof e==="function"){let i=e[r.fieldName];if(typeof i==="function")return e[r.fieldName](t,n,r);return i}};function Ps(e,t,n=ru){function r(o){let s={...e,rootValue:o};return n(s)}let i=e.externalAbortSignal;if(i){let o=pr(t,r);return{...o,next:()=>qa(o.next(),i)}}return pr(t,r)}function Zd(e){let{schema:t,fragments:n,rootValue:r,contextValue:i,operation:o,variableValues:s,hideSuggestions:a,externalAbortSignal:u}=e,c=t.getSubscriptionType();if(c==null)throw new m("Schema is not configured to execute subscription operation.",{nodes:o});let{groupedFieldSet:l}=wr(t,n,s,c,o.selectionSet,a),p=l.entries().next().value,[f,d]=p,E=d[0],I=E.node,S=I.name.value,G=t.getField(c,S),Z=d.map((ne)=>ne.node);if(!G)throw new m(`The subscription field "${S}" is not defined.`,{nodes:Z});let W=Rs(u),H=Pe(void 0,f,c.name),Y=ws(e,G,Z,c,H,W.getAbortSignal,W.getAsyncHelpers);try{let ne=_t(G,I,s,E.fragmentVariableValues,a),A=(G.subscribe??e.subscribeFieldResolver)(r,ne,i,Y);if(Be(A)){let h=Promise.resolve(A);return(u?qa(h,u):h).then(Rl).then(void 0,(R)=>{throw en(R,em(d),fe(H))})}return Rl(A)}catch(ne){throw en(ne,Z,fe(H))}}function Rl(e){if(e instanceof Error)throw e;if(!kr(e))throw new m(`Subscription field must return Async Iterable. Received: ${y(e)}.`);return e}function em(e){return e.map((t)=>t.node)}var au={parse:bt,validate:Lr,execute:Ur,subscribe:Pr};function tm(e){return new Promise((t)=>t(Fl(e)))}function nm(e){let t=Fl(e);if(K(t))throw Error("GraphQL execution failed to complete synchronously.");return t}function Fl(e){let t=e.harness??au,{schema:n,source:r}=e,i=Di(n);if(i.length>0)return{errors:i};let o;try{o=t.parse(r,e)}catch(s){return{errors:[De(s)]}}if(K(o))return o.then((s)=>Ll(t,e,n,s),(s)=>({errors:[De(s)]}));return Ll(t,e,n,o)}function Ll(e,t,n,r){let i=e.validate(n,r,t.rules,t);if(K(i))return i.then((o)=>kl(e,t,o,r));return kl(e,t,i,r)}function kl(e,t,n,r){if(n.length>0)return{errors:n};return e.execute({...t,document:r})}class uu{constructor(){this._indices=new Map}buildResponse(e,t,n,r,i){let{initialStreams:o,events:s}=Ms(n);for(let p of o)this._indices.set(p,p.initialCount);function a(){l.throw(r?.reason).catch(()=>{})}if(r)r.addEventListener("abort",a);let u=()=>{i(),r?.removeEventListener("abort",a)},c=t.length?{errors:t,data:e,hasNext:!0}:{data:e,hasNext:!0},l=Un(pr(s,(p)=>this._handleBatch(p,u)),()=>u());return{initialResult:c,subsequentResults:l}}_handleBatch(e,t){let n={incremental:[],hasNext:!0};for(let s of e)this._handleWorkQueueEvent(s,n,t);let{incremental:r,hasNext:i}=n,o={hasNext:i};if(r.length>0)o.incremental=r;return o}_handleWorkQueueEvent(e,t,n){switch(e.kind){case"GROUP_VALUES":{let r=e.group;for(let i of e.values)t.incremental.push(Gs({data:i.data,path:fe(r.path)},r.label,i.errors));break}case"GROUP_SUCCESS":break;case"GROUP_FAILURE":{let r=e.group;t.incremental.push(Gs({data:null,path:fe(r.path)},r.label,[De(e.error)]));break}case"STREAM_VALUES":{let r=e.stream,{values:i}=e,o=[],s=[];for(let u of i)if(o.push(u.item),u.errors!==void 0)s.push(...u.errors);let a=this._indices.get(r);if(a===void 0)a=r.initialCount,this._indices.set(r,a);this._indices.set(r,a+o.length),t.incremental.push(Gs({items:o,path:fe(Pe(r.path,a,void 0))},r.label,s.length>0?s:void 0));break}case"STREAM_SUCCESS":{this._indices.delete(e.stream);break}case"STREAM_FAILURE":{this._indices.delete(e.stream);let r=e.stream;t.incremental.push(Gs({items:null,path:fe(r.path)},r.label,[De(e.error)]));break}case"WORK_QUEUE_TERMINATION":{n?.(),t.hasNext=!1;break}}}}function Gs(e,t,n){let r=e;if(n!==void 0)r.errors=n;if(t!==void 0)r.label=t;return r}var Cl=Cs((e)=>Vl(e)),rm=Cr((e,t)=>Vl(e,t));class js extends Mr{getCreateSubExecutor(){let e=this.validatedExecutionArgs,t=this.sharedExecutionContext;return(n)=>new js(e,t,n)}buildResponse(e){let t=this.getIncrementalWork(),{tasks:n,streams:r}=t;if(n?.length===0&&r?.length===0)return super.buildResponse(e);let i=this.collectedErrors.errors;if(e===null)U(!1);return new uu().buildResponse(e,i,t,this.validatedExecutionArgs.externalAbortSignal,this.getFinishSharedExecution())}buildRootExecutionPlan(e){return Cl(e)}buildSubExecutionPlan(e){return this.deferUsageSet===void 0?Cl(e):rm(e,this.deferUsageSet)}}function Vl(e,t=new Set){let n=new Fe,r=new Map;for(let[i,o]of e)for(let s of o){let a=s.deferUsage,u=a===void 0?new Set:new Set([a]);if(Vr(t,u))n.add(i,s);else{let c=Vs(r,u);if(c===void 0)c=new Fe,r.set(u,c);c.add(i,s)}}return{groupedFieldSet:n,newGroupedFieldSets:r}}function Ml(e){let t=fr(e);if(!("schema"in t))return{errors:t};return cu(t)}function cu(e){return new js(e).executeRootSelectionSet()}function Ul(e){return{Field(t){let n=e.getFieldDef(),r=n?.deprecationReason;if(n&&r!=null)e.reportError(new m(`The field ${n} is deprecated. ${r}`,{nodes:t}))},Argument(t){let n=e.getArgument(),r=n?.deprecationReason;if(n&&r!=null)e.reportError(new m(`The argument "${n}" is deprecated. ${r}`,{nodes:t}))},ObjectField(t){let n=pe(e.getParentInputType());if(k(n)){let r=n.getFields()[t.name.value],i=r?.deprecationReason;if(i!=null)e.reportError(new m(`The input field ${r} is deprecated. ${i}`,{nodes:t}))}},EnumValue(t){let n=e.getEnumValue(),r=n?.deprecationReason;if(n&&r!=null)e.reportError(new m(`The enum value "${n}" is deprecated. ${r}`,{nodes:t}))}}}function Pl(e){return{Field(t){let n=pe(e.getType());if(n&&ht(n))e.reportError(new m(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}}function Bs(e){let t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,experimentalDirectiveDeprecation:!1,oneOf:!1,typeDepth:9,...e},n=t.descriptions?"description":"",r=t.specifiedByUrl?"specifiedByURL":"",i=t.directiveIsRepeatable?"isRepeatable":"",o=t.schemaDescription?n:"";function s(l){return t.inputValueDeprecation?l:""}function a(l){return t.experimentalDirectiveDeprecation?l:""}let u=t.oneOf?"isOneOf":"";function c(l,p){if(l<=0)return"";if(l>100)throw Error("Please set typeDepth to a reasonable value between 0 and 100; the default is 9.");return` +${p}ofType { +${p} name +${p} kind${c(l-1,p+" ")} +${p}}`}return` + query IntrospectionQuery { + __schema { + ${o} + queryType { name kind } + mutationType { name kind } + subscriptionType { name kind } + types { + ...FullType + } + directives${a("(includeDeprecated: true)")} { + name + ${n} + ${i} + ${a("isDeprecated")} + ${a("deprecationReason")} + locations + args${s("(includeDeprecated: true)")} { + ...InputValue + } + } + } + } + + fragment FullType on __Type { + kind + name + ${n} + ${r} + ${u} + fields(includeDeprecated: true) { + name + ${n} + args${s("(includeDeprecated: true)")} { + ...InputValue + } + type { + ...TypeRef + } + isDeprecated + deprecationReason + } + inputFields${s("(includeDeprecated: true)")} { + ...InputValue + } + interfaces { + ...TypeRef + } + enumValues(includeDeprecated: true) { + name + ${n} + isDeprecated + deprecationReason + } + possibleTypes { + ...TypeRef + } + } + + fragment InputValue on __InputValue { + name + ${n} + type { ...TypeRef } + defaultValue + ${s("isDeprecated")} + ${s("deprecationReason")} + } + + fragment TypeRef on __Type { + kind + name${c(t.typeDepth," ")} + } + `}function $l(e,t){let n={specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,experimentalDirectiveDeprecation:!0,oneOf:!0,...t},r=bt(Bs(n)),i=$s({schema:e,document:r});if(!(i.errors==null&&i.data!=null))U(!1);return i.data}function Gl(e,t){if(!(ye(e)&&ye(e.__schema)))nt(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${y(e)}.`);let n=e.__schema,r=new Map(n.types.map((h)=>[h.name,f(h)]));for(let h of[...Ct,...Mt])if(r.has(h.name))r.set(h.name,h);let i=n.queryType!=null?l(n.queryType):null,o=n.mutationType!=null?l(n.mutationType):null,s=n.subscriptionType!=null?l(n.subscriptionType):null,a=n.directives!=null?n.directives.map(A):[];return new ot({description:n.description,query:i,mutation:o,subscription:s,types:[...r.values()],directives:a,assumeValid:t?.assumeValid});function u(h){if(h.kind===ue.LIST){let D=h.ofType;if(D==null)throw Error("Decorated type deeper than introspection query.");return new oe(u(D))}if(h.kind===ue.NON_NULL){let D=h.ofType;if(D==null)throw Error("Decorated type deeper than introspection query.");let R=u(D);return new V(So(R))}return c(h)}function c(h){let D=h.name;if(!D)throw Error(`Unknown type reference: ${y(h)}.`);let R=r.get(D);if(R==null)throw Error(`Invalid or incomplete schema, unknown type: ${D}. Ensure that a full introspection query is used in order to build a client schema.`);return R}function l(h){return bo(c(h))}function p(h){return _o(c(h))}function f(h){switch(h.kind){case ue.SCALAR:return d(h);case ue.OBJECT:return I(h);case ue.INTERFACE:return S(h);case ue.UNION:return G(h);case ue.ENUM:return Z(h);case ue.INPUT_OBJECT:return W(h);default:throw Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${y(h)}.`)}}function d(h){return new ke({name:h.name,description:h.description,specifiedByURL:h.specifiedByURL})}function E(h){if(h.interfaces===null&&h.kind===ue.INTERFACE)return[];if(h.interfaces==null){let D=y(h);throw Error(`Introspection result missing interfaces: ${D}.`)}return h.interfaces.map(p)}function I(h){return new Ee({name:h.name,description:h.description,interfaces:()=>E(h),fields:()=>H(h)})}function S(h){return new Me({name:h.name,description:h.description,interfaces:()=>E(h),fields:()=>H(h)})}function G(h){if(h.possibleTypes==null){let D=y(h);throw Error(`Introspection result missing possibleTypes: ${D}.`)}return new it({name:h.name,description:h.description,types:()=>h.possibleTypes.map(l)})}function Z(h){if(h.enumValues==null){let D=y(h);throw Error(`Introspection result missing enumValues: ${D}.`)}return new we({name:h.name,description:h.description,values:kt(h.enumValues,(D)=>D.name,(D)=>({description:D.description,deprecationReason:D.deprecationReason}))})}function W(h){if(h.inputFields==null){let D=y(h);throw Error(`Introspection result missing inputFields: ${D}.`)}return new Ge({name:h.name,description:h.description,fields:()=>ne(h.inputFields),isOneOf:h.isOneOf})}function H(h){if(h.fields==null)throw Error(`Introspection result missing fields: ${y(h)}.`);return kt(h.fields,(D)=>D.name,Y)}function Y(h){let D=u(h.type);if(!Nt(D)){let R=y(D);throw Error(`Introspection must provide output type for fields, but received: ${R}.`)}if(h.args==null){let R=y(h);throw Error(`Introspection result missing field args: ${R}.`)}return{description:h.description,deprecationReason:h.deprecationReason,type:D,args:ne(h.args)}}function ne(h){return kt(h,(D)=>D.name,b)}function b(h){let D=u(h.type);if(!xe(D)){let R=y(D);throw Error(`Introspection must provide input type for arguments, but received: ${R}.`)}return{description:h.description,type:D,default:h.defaultValue!=null?{literal:Uo(h.defaultValue)}:void 0,deprecationReason:h.deprecationReason}}function A(h){if(h.args==null){let D=y(h);throw Error(`Introspection result missing directive args: ${D}.`)}if(h.locations==null){let D=y(h);throw Error(`Introspection result missing directive locations: ${D}.`)}return new Re({name:h.name,description:h.description,isRepeatable:h.isRepeatable,deprecationReason:h.deprecationReason,locations:h.locations.slice(),args:ne(h.args)})}}var se={SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD:"FIELD",ARGUMENT:"ARGUMENT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD:"INPUT_FIELD",DIRECTIVE:"DIRECTIVE"};function Qs(e,t){let n=t({getNamedType:u,setNamedType:c,getNamedTypes:l}),r=new Map;for(let b of e.types){let A=b.name,h=p(b);if(h)r.set(A,h)}let i=[];for(let b of e.directives){if(Vt(b)){i.push(b);continue}let A=ne(b.toConfig());if(A)i.push(new Re(A))}let o={...e,query:e.query&&u(e.query.name),mutation:e.mutation&&u(e.mutation.name),subscription:e.subscription&&u(e.subscription.name),types:Array.from(r.values()),directives:i},s=n[se.SCHEMA];return s==null?o:s(o);function a(b){if(j(b))return new oe(a(b.ofType));if(w(b))return new V(a(b.ofType));return u(b.name)}function u(b){let A=im.get(b)??r.get(b);if(A===void 0)U(!1,`Unknown type: "${b}".`);return A}function c(b){r.set(b.name,b)}function l(){return Array.from(r.values())}function p(b){if(ht(b)||Ze(b))return b;if(ae(b))return f(b);if(L(b))return d(b);if(P(b))return S(b);if(te(b))return G(b);if(z(b))return Z(b);if(k(b))return H(b);U(!1,"Unexpected type: "+y(b))}function f(b){let A=b.toConfig(),h=n[se.SCALAR];return A=h==null?A:h(A),new ke(A)}function d(b){let A=b.toConfig(),h={...A,interfaces:()=>A.interfaces.map((R)=>u(R.name)),fields:()=>E(A.fields,b.name)},D=n[se.OBJECT];return h=D==null?h:D(h),new Ee(h)}function E(b,A){let h=Object.create(null);for(let[D,R]of Object.entries(b)){let q={...R,type:a(R.type),args:I(R.args,D,A)},ce=n[se.FIELD];if(ce)q=ce(q,A);h[D]=q}return h}function I(b,A,h){let D=Object.create(null);for(let[R,q]of Object.entries(b)){let ce={...q,type:a(q.type)},Ue=n[se.ARGUMENT];if(Ue)ce=Ue(ce,A,h);D[R]=ce}return D}function S(b){let A=b.toConfig(),h={...A,interfaces:()=>A.interfaces.map((R)=>u(R.name)),fields:()=>E(A.fields,b.name)},D=n[se.INTERFACE];return h=D==null?h:D(h),new Me(h)}function G(b){let A=b.toConfig(),h={...A,types:()=>A.types.map((R)=>u(R.name))},D=n[se.UNION];return h=D==null?h:D(h),new it(h)}function Z(b){let A=b.toConfig(),h={...A,values:()=>{let R=Object.create(null);for(let[q,ce]of Object.entries(A.values)){let Ue=W(ce,q,b.name);R[q]=Ue}return R}},D=n[se.ENUM];return h=D==null?h:D(h),new we(h)}function W(b,A,h){let D={...b},R=n[se.ENUM_VALUE];return R==null?D:R(D,A,h)}function H(b){let A=b.toConfig(),h={...A,fields:()=>{let R=Object.create(null);for(let[q,ce]of Object.entries(A.fields)){let Ue=Y(ce,q,b.name);R[q]=Ue}return R}},D=n[se.INPUT_OBJECT];return h=D==null?h:D(h),new Ge(h)}function Y(b,A,h){let D={...b,type:a(b.type)},R=n[se.INPUT_FIELD];return R==null?D:R(D,A,h)}function ne(b){let A={...b,args:I(b.args,b.name,void 0)},h=n[se.DIRECTIVE];return h==null?A:h(A)}}var im=new Map([...Ct,...Mt].map((e)=>[e.name,e]));function jl(e,t,n){if(Sr(e),n?.assumeValid!==!0&&n?.assumeValidSDL!==!0)Tl(t,e);let r=e.toConfig(),i=pu(r,t,n);return r===i?e:new ot(i)}function pu(e,t,n){let r=[],i=new Fe,o=new Fe,s=new Fe,a=new Fe,u=new Fe,c=new Fe,l=new Fe,p=[],f,d=[],E=!1;for(let I of t.definitions){switch(I.kind){case Ye:f=I;break;case Rt:d.push(I);break;case pt:p.push(I);break;case Tr:l.add(I.name.value,I);break;case Qt:case At:case xt:case wt:case Yt:case yt:r.push(I);break;case ln:i.add(I.name.value,I);break;case qt:o.add(I.name.value,I);break;case Kt:s.add(I.name.value,I);break;case Jt:a.add(I.name.value,I);break;case pn:u.add(I.name.value,I);break;case Lt:c.add(I.name.value,I);break;default:continue}E=!0}if(!E)return e;return Qs(e,(I)=>{let{getNamedType:S,setNamedType:G,getNamedTypes:Z}=I;return{[se.SCHEMA]:(v)=>{for(let N of r){let g=om.get(N.name.value)??Ue(N);G(g)}let O={query:v.query&&S(v.query.name),mutation:v.mutation&&S(v.mutation.name),subscription:v.subscription&&S(v.subscription.name),...f&&W([f]),...W(d)};return{description:f?.description?.value??v.description,...O,types:Z(),directives:[...v.directives.map(b),...p.map(ne)],extensions:v.extensions,astNode:f??v.astNode,extensionASTNodes:v.extensionASTNodes.concat(d),assumeValid:n?.assumeValid??!1}},[se.INPUT_OBJECT]:(v)=>{let O=c.get(v.name)??[];return{...v,fields:()=>({...v.fields(),...D(O)}),extensionASTNodes:v.extensionASTNodes.concat(O)}},[se.ENUM]:(v)=>{let O=u.get(v.name)??[];return{...v,values:()=>({...v.values(),...R(O)}),extensionASTNodes:v.extensionASTNodes.concat(O)}},[se.SCALAR]:(v)=>{let O=i.get(v.name)??[],N=v.specifiedByURL;for(let g of O)N=lu(g)??N;return{...v,specifiedByURL:N,extensionASTNodes:v.extensionASTNodes.concat(O)}},[se.OBJECT]:(v)=>{let O=o.get(v.name)??[];return{...v,interfaces:()=>[...v.interfaces(),...q(O)],fields:()=>({...v.fields(),...A(O)}),extensionASTNodes:v.extensionASTNodes.concat(O)}},[se.INTERFACE]:(v)=>{let O=s.get(v.name)??[];return{...v,interfaces:()=>[...v.interfaces(),...q(O)],fields:()=>({...v.fields(),...A(O)}),extensionASTNodes:v.extensionASTNodes.concat(O)}},[se.UNION]:(v)=>{let O=a.get(v.name)??[];return{...v,types:()=>[...v.types(),...ce(O)],extensionASTNodes:v.extensionASTNodes.concat(O)}}};function W(v){let O={};for(let N of v){let g=N.operationTypes??[];for(let _ of g)O[_.operation]=H(_.type)}return O}function H(v){let O=v.name.value,N=S(O);if(N===void 0)U(!1,`Unknown type: "${O}".`);return N}function Y(v){if(v.kind===Dn)return new oe(Y(v.type));if(v.kind===cn)return new V(Y(v.type));return H(v)}function ne(v){let O=l.get(v.name.value)??[],N=dr(v)??O.map((g)=>dr(g)).find((g)=>g!=null);return new Re({name:v.name.value,description:v.description?.value,locations:v.locations.map(({value:g})=>g),isRepeatable:v.repeatable,args:h(v.arguments),deprecationReason:N,astNode:v,extensionASTNodes:O})}function b(v){let O=l.get(v.name)??[];if(O.length===0)return v;let N=v.deprecationReason??O.map((g)=>dr(g)).find((g)=>g!=null);return new Re({...v.toConfig(),deprecationReason:N,extensionASTNodes:v.extensionASTNodes.concat(O)})}function A(v){let O=Object.create(null);for(let N of v){let g=N.fields??[];for(let _ of g)O[_.name.value]={type:Y(_.type),description:_.description?.value,args:h(_.arguments),deprecationReason:dr(_),astNode:_}}return O}function h(v){let O=v??[],N=Object.create(null);for(let g of O){let _=Y(g.type);N[g.name.value]={type:_,description:g.description?.value,default:g.defaultValue&&{literal:g.defaultValue},deprecationReason:dr(g),astNode:g}}return N}function D(v){let O=Object.create(null);for(let N of v){let g=N.fields??[];for(let _ of g){let B=Y(_.type);O[_.name.value]={type:B,description:_.description?.value,default:_.defaultValue&&{literal:_.defaultValue},deprecationReason:dr(_),astNode:_}}}return O}function R(v){let O=Object.create(null);for(let N of v){let g=N.values??[];for(let _ of g)O[_.name.value]={description:_.description?.value,deprecationReason:dr(_),astNode:_}}return O}function q(v){return v.flatMap((O)=>O.interfaces?.map(H)??[])}function ce(v){return v.flatMap((O)=>O.types?.map(H)??[])}function Ue(v){let O=v.name.value;switch(v.kind){case At:{let N=o.get(O)??[],g=[v,...N];return new Ee({name:O,description:v.description?.value,interfaces:()=>q(g),fields:()=>A(g),astNode:v,extensionASTNodes:N})}case xt:{let N=s.get(O)??[],g=[v,...N];return new Me({name:O,description:v.description?.value,interfaces:()=>q(g),fields:()=>A(g),astNode:v,extensionASTNodes:N})}case Yt:{let N=u.get(O)??[],g=[v,...N];return new we({name:O,description:v.description?.value,values:()=>R(g),astNode:v,extensionASTNodes:N})}case wt:{let N=a.get(O)??[],g=[v,...N];return new it({name:O,description:v.description?.value,types:()=>ce(g),astNode:v,extensionASTNodes:N})}case Qt:{let N=i.get(O)??[],g=lu(v);for(let _ of N)g=lu(_)??g;return new ke({name:O,description:v.description?.value,specifiedByURL:g,astNode:v,extensionASTNodes:N})}case yt:{let N=c.get(O)??[],g=[v,...N];return new Ge({name:O,description:v.description?.value,fields:()=>D(g),astNode:v,extensionASTNodes:N,isOneOf:sm(v)})}}}})}var om=new Map([...Ct,...Mt].map((e)=>[e.name,e]));function dr(e){return Zt(mn,e)?.reason}function lu(e){return Zt(gi,e)?.url}function sm(e){return Boolean(Zt(Ni,e))}function Ki(e,t){if(t?.assumeValid!==!0&&t?.assumeValidSDL!==!0)El(e);let n={description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},r=pu(n,e,t);if(r.astNode==null)for(let o of r.types)switch(o.name){case"Query":r.query=o;break;case"Mutation":r.mutation=o;break;case"Subscription":r.subscription=o;break}let i=[...r.directives,...je.filter((o)=>r.directives.every((s)=>s.name!==o.name))];return new ot({...r,directives:i})}function Ys(e,t){let n=bt(e,{noLocation:t?.noLocation,experimentalFragmentArguments:t?.experimentalFragmentArguments});return Ki(n,{assumeValidSDL:t?.assumeValidSDL,assumeValid:t?.assumeValid})}function Bl(e){return new ot(Qs(e.toConfig(),()=>({[se.OBJECT]:(t)=>({...t,interfaces:()=>Ji(t.interfaces()),fields:()=>$r(t.fields())}),[se.FIELD]:(t)=>({...t,args:$r(t.args)}),[se.INTERFACE]:(t)=>({...t,interfaces:()=>Ji(t.interfaces()),fields:()=>$r(t.fields())}),[se.UNION]:(t)=>({...t,types:()=>Ji(t.types())}),[se.ENUM]:(t)=>({...t,values:()=>$r(t.values())}),[se.INPUT_OBJECT]:(t)=>({...t,fields:()=>$r(t.fields())}),[se.DIRECTIVE]:(t)=>({...t,locations:Ql(t.locations,(n)=>n),args:$r(t.args)}),[se.SCHEMA]:(t)=>({...t,types:Ji(t.types),directives:Ji(t.directives)})})))}function $r(e){let t=Object.create(null);for(let n of Object.keys(e).sort(fn))t[n]=e[n];return t}function Ji(e){return Ql(e,(t)=>t.name)}function Ql(e,t){return e.slice().sort((n,r)=>{let i=t(n),o=t(r);return fn(i,o)})}function Yl(e){return Kl(e,(t)=>!Vt(t),am)}function ql(e){return Kl(e,Vt,ht)}function am(e){return!Ze(e)&&!ht(e)}function Kl(e,t,n){let r=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(n);return[um(e),...r.map((o)=>hu(o)),...i.map((o)=>du(o))].filter(Boolean).join(` + +`)}function um(e){let t=e.getQueryType(),n=e.getMutationType(),r=e.getSubscriptionType();if(!t&&!n&&!r)return;if(e.description!=null||!cm(e))return St(e)+`schema { +`+(t?` query: ${t} +`:"")+(n?` mutation: ${n} +`:"")+(r?` subscription: ${r} +`:"")+"}"}function cm(e){return e.getQueryType()==e.getType("Query")&&e.getMutationType()==e.getType("Mutation")&&e.getSubscriptionType()==e.getType("Subscription")}function du(e){if(ae(e))return lm(e);if(L(e))return pm(e);if(P(e))return fm(e);if(te(e))return dm(e);if(z(e))return mm(e);if(k(e))return hm(e);U(!1,"Unexpected type: "+y(e))}function lm(e){return St(e)+`scalar ${e}`+Em(e)}function Jl(e){let t=e.getInterfaces();return t.length?" implements "+t.map((n)=>n.name).join(" & "):""}function pm(e){return St(e)+`type ${e}`+Jl(e)+Wl(e)}function fm(e){return St(e)+`interface ${e}`+Jl(e)+Wl(e)}function dm(e){let t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return St(e)+`union ${e.name}`+n}function mm(e){let t=e.getValues().map((n,r)=>St(n," ",!r)+" "+n.name+qs(n.deprecationReason));return St(e)+`enum ${e}`+mu(t)}function hm(e){let t=Object.values(e.getFields()).map((n,r)=>St(n," ",!r)+" "+fu(n));return St(e)+`input ${e}`+(e.isOneOf?" @oneOf":"")+mu(t)}function Wl(e){let t=Object.values(e.getFields()).map((n,r)=>St(n," ",!r)+" "+n.name+Hl(n.args," ")+": "+String(n.type)+qs(n.deprecationReason));return mu(t)}function mu(e){return e.length!==0?` { +`+e.join(` +`)+` +}`:""}function Hl(e,t=""){if(e.length===0)return"";if(e.every((n)=>n.description==null))return"("+e.map(fu).join(", ")+")";return`( +`+e.map((n,r)=>St(n," "+t,!r)+" "+t+fu(n)).join(` +`)+` +`+t+")"}function fu(e){let t=e.name+": "+String(e.type),n=vr(e);if(n)t+=` = ${ee(n)}`;return t+qs(e.deprecationReason)}function hu(e){return St(e)+`directive ${e}`+Hl(e.args)+qs(e.deprecationReason)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}function qs(e){if(e==null)return"";if(e!==yi)return` @deprecated(reason: ${ee({kind:Ie,value:e})})`;return" @deprecated"}function Em(e){if(e.specifiedByURL==null)return"";return` @specifiedBy(url: ${ee({kind:Ie,value:e.specifiedByURL})})`}function St(e,t="",n=!0){let{description:r}=e;if(r==null)return"";let i=ee({kind:Ie,value:r,block:Qu(r)});return(t&&!n?` +`+t:t)+i.replaceAll(` +`,` +`+t)+` +`}function Pn(e,t,n){if(!e)return;if(e.kind===Ce){let r=e.name.value;if(n==null||!Object.hasOwn(n,r))return;let i=n[r];if(i===void 0)return;if(i===null&&w(t))return;return i}if(w(t)){if(e.kind===le)return;return Pn(e,t.ofType,n)}if(e.kind===le)return null;if(j(t)){let r=t.ofType;if(e.kind===Ae){let o=[];for(let s of e.values)if(zl(s,n)){if(w(r))return;o.push(null)}else{let a=Pn(s,r,n);if(a===void 0)return;o.push(a)}return o}let i=Pn(e,r,n);if(i===void 0)return;return[i]}if(k(t)){if(e.kind!==Ve)return;let r=Object.create(null),i=t.getFields();if(e.fields.some((a)=>!Object.hasOwn(i,a.name.value)))return;let s=new Map(e.fields.map((a)=>[a.name.value,a]));for(let a of Object.values(i)){let u=s.get(a.name);if(u==null||zl(u.value,n)){if(a.defaultValue!==void 0)r[a.name]=a.defaultValue;else if(w(a.type))return;continue}let c=Pn(u.value,a.type,n);if(c===void 0)return;r[a.name]=c}if(t.isOneOf){let a=Object.keys(r);if(s.size!==1||a.length!==1)return;for(let[u,c]of s)if(c.value.kind===le||r[u]===null)return}return r}if(ve(t)){let r;try{r=t.parseLiteral(e,n)}catch(i){return}if(r===void 0)return;return r}U(!1,"Unexpected input type: "+y(t))}function zl(e,t){return e.kind===Ce&&(t?.[e.name.value]===void 0||!Object.hasOwn(t,e.name.value))}function Xl(e){let t=[];for(let n of e)t.push(...n.definitions);return{kind:jt,definitions:t}}function ep(e){let t=[],n=Object.create(null);for(let i of e.definitions)switch(i.kind){case Tt:t.push(i);break;case Qe:n[i.name.value]=Zl(i.selectionSet);break;default:}let r=Object.create(null);for(let i of t){let o=new Set;for(let a of Zl(i.selectionSet))tp(o,n,a);let s=i.name?i.name.value:"";r[s]={kind:jt,definitions:e.definitions.filter((a)=>a===i||a.kind===Qe&&o.has(a.name.value))}}return r}function tp(e,t,n){if(!e.has(n)){e.add(n);let r=t[n];if(r!==void 0)for(let i of r)tp(e,t,i)}}function Zl(e){let t=[];return ft(e,{FragmentSpread(n){t.push(n.name.value)}}),t}function np(e){let t=xi(e)?e:new Pt(e),n=t.body,r=new ar(t),i="",o=!1;while(r.advance().kind!==T.EOF){let s=r.token,a=s.kind,u=!Co(s.kind);if(o){if(u||s.kind===T.SPREAD)i+=" "}let c=n.slice(s.start,s.end);if(a===T.BLOCK_STRING)i+=No(s.value,{minimize:!0});else i+=c;o=u}return i}var Se={TYPE_REMOVED:"TYPE_REMOVED",TYPE_CHANGED_KIND:"TYPE_CHANGED_KIND",TYPE_REMOVED_FROM_UNION:"TYPE_REMOVED_FROM_UNION",VALUE_REMOVED_FROM_ENUM:"VALUE_REMOVED_FROM_ENUM",REQUIRED_INPUT_FIELD_ADDED:"REQUIRED_INPUT_FIELD_ADDED",IMPLEMENTED_INTERFACE_REMOVED:"IMPLEMENTED_INTERFACE_REMOVED",FIELD_REMOVED:"FIELD_REMOVED",FIELD_CHANGED_KIND:"FIELD_CHANGED_KIND",REQUIRED_ARG_ADDED:"REQUIRED_ARG_ADDED",ARG_REMOVED:"ARG_REMOVED",ARG_CHANGED_KIND:"ARG_CHANGED_KIND",DIRECTIVE_REMOVED:"DIRECTIVE_REMOVED",DIRECTIVE_ARG_REMOVED:"DIRECTIVE_ARG_REMOVED",REQUIRED_DIRECTIVE_ARG_ADDED:"REQUIRED_DIRECTIVE_ARG_ADDED",DIRECTIVE_REPEATABLE_REMOVED:"DIRECTIVE_REPEATABLE_REMOVED",DIRECTIVE_LOCATION_REMOVED:"DIRECTIVE_LOCATION_REMOVED"},at={VALUE_ADDED_TO_ENUM:"VALUE_ADDED_TO_ENUM",TYPE_ADDED_TO_UNION:"TYPE_ADDED_TO_UNION",OPTIONAL_INPUT_FIELD_ADDED:"OPTIONAL_INPUT_FIELD_ADDED",OPTIONAL_ARG_ADDED:"OPTIONAL_ARG_ADDED",IMPLEMENTED_INTERFACE_ADDED:"IMPLEMENTED_INTERFACE_ADDED",ARG_DEFAULT_VALUE_CHANGE:"ARG_DEFAULT_VALUE_CHANGE",INPUT_FIELD_DEFAULT_VALUE_CHANGE:"INPUT_FIELD_DEFAULT_VALUE_CHANGE"},_e={DESCRIPTION_CHANGED:"DESCRIPTION_CHANGED",TYPE_ADDED:"TYPE_ADDED",OPTIONAL_INPUT_FIELD_ADDED:"OPTIONAL_INPUT_FIELD_ADDED",OPTIONAL_ARG_ADDED:"OPTIONAL_ARG_ADDED",DIRECTIVE_ADDED:"DIRECTIVE_ADDED",FIELD_ADDED:"FIELD_ADDED",DIRECTIVE_REPEATABLE_ADDED:"DIRECTIVE_REPEATABLE_ADDED",DIRECTIVE_LOCATION_ADDED:"DIRECTIVE_LOCATION_ADDED",OPTIONAL_DIRECTIVE_ARG_ADDED:"OPTIONAL_DIRECTIVE_ARG_ADDED",FIELD_CHANGED_KIND_SAFE:"FIELD_CHANGED_KIND_SAFE",ARG_CHANGED_KIND_SAFE:"ARG_CHANGED_KIND_SAFE",ARG_DEFAULT_VALUE_ADDED:"ARG_DEFAULT_VALUE_ADDED",INPUT_FIELD_DEFAULT_VALUE_ADDED:"INPUT_FIELD_DEFAULT_VALUE_ADDED"};function sp(e,t){return Ks(e,t).filter((n)=>(n.type in Se))}function ap(e,t){return Ks(e,t).filter((n)=>(n.type in at))}function Ks(e,t){return[...ym(e,t),...Tm(e,t)]}function Tm(e,t){let n=[],r=gn(e.getDirectives(),t.getDirectives());for(let i of r.removed)n.push({type:Se.DIRECTIVE_REMOVED,description:`Directive ${i} was removed.`});for(let i of r.added)n.push({type:_e.DIRECTIVE_ADDED,description:`Directive @${i.name} was added.`});for(let[i,o]of r.persisted){let s=gn(i.args,o.args);for(let a of s.added)if(ze(a))n.push({type:Se.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required argument ${a} was added.`});else n.push({type:_e.OPTIONAL_DIRECTIVE_ARG_ADDED,description:`An optional argument @${i.name}(${a.name}:) was added.`});for(let a of s.removed)n.push({type:Se.DIRECTIVE_ARG_REMOVED,description:`Argument ${a} was removed.`});for(let[a,u]of s.persisted){let c=Gr(a.type,u.type),l=jr(a),p=jr(u);if(!c)n.push({type:Se.ARG_CHANGED_KIND,description:`Argument @${i.name}(${a.name}:) has changed type from ${String(a.type)} to ${String(u.type)}.`});else if(l!==void 0){if(p===void 0)n.push({type:at.ARG_DEFAULT_VALUE_CHANGE,description:`@${i.name}(${a.name}:) defaultValue was removed.`});else if(l!==p)n.push({type:at.ARG_DEFAULT_VALUE_CHANGE,description:`@${i.name}(${a.name}:) has changed defaultValue from ${l} to ${p}.`})}else if(p!==void 0&&l===void 0)n.push({type:_e.ARG_DEFAULT_VALUE_ADDED,description:`@${i.name}(${a.name}:) added a defaultValue ${p}.`});else if(a.type.toString()!==u.type.toString())n.push({type:_e.ARG_CHANGED_KIND_SAFE,description:`Argument @${i.name}(${a.name}:) has changed type from ${String(a.type)} to ${String(u.type)}.`});if(a.description!==u.description)n.push({type:_e.DESCRIPTION_CHANGED,description:`Description of @${i.name}(${i.name}) has changed to "${u.description}".`})}if(i.isRepeatable&&!o.isRepeatable)n.push({type:Se.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${i}.`});else if(o.isRepeatable&&!i.isRepeatable)n.push({type:_e.DIRECTIVE_REPEATABLE_ADDED,description:`Repeatable flag was added to @${i.name}.`});if(i.description!==o.description)n.push({type:_e.DESCRIPTION_CHANGED,description:`Description of @${i.name} has changed to "${o.description}".`});for(let a of i.locations)if(!o.locations.includes(a))n.push({type:Se.DIRECTIVE_LOCATION_REMOVED,description:`${a} was removed from ${i}.`});for(let a of o.locations)if(!i.locations.includes(a))n.push({type:_e.DIRECTIVE_LOCATION_ADDED,description:`${a} was added to @${i.name}.`})}return n}function ym(e,t){let n=[],r=gn(Object.values(e.getTypeMap()),Object.values(t.getTypeMap()));for(let i of r.removed)n.push({type:Se.TYPE_REMOVED,description:Ze(i)?`Standard scalar ${i} was removed because it is not referenced anymore.`:`${i} was removed.`});for(let i of r.added)n.push({type:_e.TYPE_ADDED,description:`${i} was added.`});for(let[i,o]of r.persisted){if(i.description!==o.description)n.push({type:_e.DESCRIPTION_CHANGED,description:`Description of ${i.name} has changed to "${o.description}".`});if(z(i)&&z(o))n.push(...Im(i,o));else if(te(i)&&te(o))n.push(...Nm(i,o));else if(k(i)&&k(o))n.push(...gm(i,o));else if(L(i)&&L(o))n.push(...ip(i,o),...rp(i,o));else if(P(i)&&P(o))n.push(...ip(i,o),...rp(i,o));else if(i.constructor!==o.constructor)n.push({type:Se.TYPE_CHANGED_KIND,description:`${i} changed from ${op(i)} to ${op(o)}.`})}return n}function gm(e,t){let n=[],r=gn(Object.values(e.getFields()),Object.values(t.getFields()));for(let i of r.added)if(Xe(i))n.push({type:Se.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${i} was added.`});else n.push({type:at.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${i} was added.`});for(let i of r.removed)n.push({type:Se.FIELD_REMOVED,description:`Field ${i} was removed.`});for(let[i,o]of r.persisted){let s=Gr(i.type,o.type),a=jr(i),u=jr(o);if(!s)n.push({type:Se.FIELD_CHANGED_KIND,description:`Field ${o} changed type from ${i.type} to ${o.type}.`});else if(a!==void 0){if(u===void 0)n.push({type:at.INPUT_FIELD_DEFAULT_VALUE_CHANGE,description:`${i} defaultValue was removed.`});else if(a!==u)n.push({type:at.INPUT_FIELD_DEFAULT_VALUE_CHANGE,description:`${i} has changed defaultValue from ${a} to ${u}.`})}else if(u!==void 0&&a===void 0)n.push({type:_e.INPUT_FIELD_DEFAULT_VALUE_ADDED,description:`${i} added a defaultValue ${u}.`});else if(i.type.toString()!==o.type.toString())n.push({type:_e.FIELD_CHANGED_KIND_SAFE,description:`Field ${e}.${i.name} changed type from ${String(i.type)} to ${String(o.type)}.`});if(i.description!==o.description)n.push({type:_e.DESCRIPTION_CHANGED,description:`Description of input-field ${t}.${o.name} has changed to "${o.description}".`})}return n}function Nm(e,t){let n=[],r=gn(e.getTypes(),t.getTypes());for(let i of r.added)n.push({type:at.TYPE_ADDED_TO_UNION,description:`${i} was added to union type ${e}.`});for(let i of r.removed)n.push({type:Se.TYPE_REMOVED_FROM_UNION,description:`${i} was removed from union type ${e}.`});return n}function Im(e,t){let n=[],r=gn(e.getValues(),t.getValues());for(let i of r.added)n.push({type:at.VALUE_ADDED_TO_ENUM,description:`Enum value ${i} was added.`});for(let i of r.removed)n.push({type:Se.VALUE_REMOVED_FROM_ENUM,description:`Enum value ${i} was removed.`});for(let[i,o]of r.persisted)if(i.description!==o.description)n.push({type:_e.DESCRIPTION_CHANGED,description:`Description of enum value ${e}.${i.name} has changed to "${o.description}".`});return n}function rp(e,t){let n=[],r=gn(e.getInterfaces(),t.getInterfaces());for(let i of r.added)n.push({type:at.IMPLEMENTED_INTERFACE_ADDED,description:`${i} added to interfaces implemented by ${e}.`});for(let i of r.removed)n.push({type:Se.IMPLEMENTED_INTERFACE_REMOVED,description:`${e} no longer implements interface ${i}.`});return n}function ip(e,t){let n=[],r=gn(Object.values(e.getFields()),Object.values(t.getFields()));for(let i of r.removed)n.push({type:Se.FIELD_REMOVED,description:`Field ${i} was removed.`});for(let i of r.added)n.push({type:_e.FIELD_ADDED,description:`Field ${e}.${i.name} was added.`});for(let[i,o]of r.persisted){if(n.push(...vm(i,o)),!Wi(i.type,o.type))n.push({type:Se.FIELD_CHANGED_KIND,description:`Field ${o} changed type from ${i.type} to ${o.type}.`});else if(i.type.toString()!==o.type.toString())n.push({type:_e.FIELD_CHANGED_KIND_SAFE,description:`Field ${e}.${i.name} changed type from ${String(i.type)} to ${String(o.type)}.`});if(i.description!==o.description)n.push({type:_e.DESCRIPTION_CHANGED,description:`Description of field ${e}.${i.name} has changed to "${o.description}".`})}return n}function vm(e,t){let n=[],r=gn(e.args,t.args);for(let i of r.removed)n.push({type:Se.ARG_REMOVED,description:`Argument ${i} was removed.`});for(let[i,o]of r.persisted){let s=Gr(i.type,o.type),a=jr(i),u=jr(o);if(!s)n.push({type:Se.ARG_CHANGED_KIND,description:`Argument ${o} has changed type from ${i.type} to ${o.type}.`});else if(a!==void 0){if(u===void 0)n.push({type:at.ARG_DEFAULT_VALUE_CHANGE,description:`${i} defaultValue was removed.`});else if(a!==u)n.push({type:at.ARG_DEFAULT_VALUE_CHANGE,description:`${i} has changed defaultValue from ${a} to ${u}.`})}else if(u!==void 0&&a===void 0)n.push({type:_e.ARG_DEFAULT_VALUE_ADDED,description:`${i} added a defaultValue ${u}.`});else if(i.type.toString()!==o.type.toString())n.push({type:_e.ARG_CHANGED_KIND_SAFE,description:`Argument ${i} has changed type from ${String(i.type)} to ${String(o.type)}.`});if(i.description!==o.description)n.push({type:_e.DESCRIPTION_CHANGED,description:`Description of argument ${i} has changed to "${o.description}".`})}for(let i of r.added)if(ze(i))n.push({type:Se.REQUIRED_ARG_ADDED,description:`A required argument ${i} was added.`});else n.push({type:at.OPTIONAL_ARG_ADDED,description:`An optional argument ${i} was added.`});return n}function Wi(e,t){if(j(e))return j(t)&&Wi(e.ofType,t.ofType)||w(t)&&Wi(e,t.ofType);if(w(e))return w(t)&&Wi(e.ofType,t.ofType);return rt(t)&&e.name===t.name||w(t)&&Wi(e,t.ofType)}function Gr(e,t){if(j(e))return j(t)&&Gr(e.ofType,t.ofType);if(w(e))return w(t)&&Gr(e.ofType,t.ofType)||!w(t)&&Gr(e.ofType,t);return rt(t)&&e.name===t.name}function op(e){if(ae(e))return"a Scalar type";if(L(e))return"an Object type";if(P(e))return"an Interface type";if(te(e))return"a Union type";if(z(e))return"an Enum type";if(k(e))return"an Input type";U(!1,"Unexpected type: "+y(e))}function jr(e){let t=vr(e);if(t)return ee(cr(t))}function gn(e,t){let n=[],r=[],i=[],o=sn(e,({name:a})=>a),s=sn(t,({name:a})=>a);for(let a of e){let u=s[a.name];if(u===void 0)r.push(a);else i.push([a,u])}for(let a of t)if(o[a.name]===void 0)n.push(a);return{added:n,persisted:i,removed:r}}function up(e,t){return Eu(e,Po(t))}function bm(e,t){let n=t.name.value,r=e.getType(n);if(r==null)return;return{kind:"NamedType",type:r}}function _m(e,t){let n=t.name.value,r=e.getType(n);if(!r)throw Error(`Expected ${y(n)} to be defined as a type in the schema.`);if(!z(r)&&!k(r)&&!L(r)&&!P(r))throw Error(`Expected ${y(n)} to be an Enum, Input Object, Object or Interface type.`);if(z(r)){let s=t.memberName.value,a=r.getValue(s);if(a==null)return;return{kind:"EnumValue",type:r,enumValue:a}}if(k(r)){let s=t.memberName.value,a=r.getFields()[s];if(a==null)return;return{kind:"InputField",type:r,inputField:a}}let i=t.memberName.value,o=e.getField(r,i);if(o==null)return;return{kind:"Field",type:r,field:o}}function Sm(e,t){let n=t.name.value,r=e.getType(n);if(r==null)throw Error(`Expected ${y(n)} to be defined as a type in the schema.`);if(!L(r)&&!P(r))throw Error(`Expected ${y(n)} to be an object type or interface type.`);let i=t.fieldName.value,o=e.getField(r,i);if(o==null)throw Error(`Expected ${y(i)} to exist as a field of type ${y(n)} in the schema.`);let s=t.argumentName.value,a=o.args.find((u)=>u.name===s);if(a==null)return;return{kind:"FieldArgument",type:r,field:o,fieldArgument:a}}function Dm(e,t){let n=t.name.value,r=e.getDirective(n);if(!r)return;return{kind:"Directive",directive:r}}function Om(e,t){let n=t.name.value,r=e.getDirective(n);if(!r)throw Error(`Expected ${y(n)} to be defined as a directive in the schema.`);let{argumentName:{value:i}}=t,o=r.args.find((s)=>s.name===i);if(!o)return;return{kind:"DirectiveArgument",directive:r,directiveArgument:o}}function Eu(e,t){switch(t.kind){case po:return bm(e,t);case fo:return _m(e,t);case mo:return Sm(e,t);case ho:return Dm(e,t);case Eo:return Om(e,t)}}var Js=(e)=>Array.isArray(e)?e:e?[e]:[];function Am(e,t){if(String(e)<String(t))return-1;if(String(e)>String(t))return 1;return 0}function cp(e){let t;if("alias"in e)t=e.alias?.value;if(t==null&&"name"in e)t=e.name?.value;if(t==null)t=e.kind;return t}function $n(e,t,n){let r=cp(e),i=cp(t);if(typeof n==="function")return n(r,i);return Am(r,i)}function Br(e){return e!=null}function Qr(e){let t=new WeakMap;return function(r){let i=t.get(r);if(i===void 0){let o=e(r);return t.set(r,o),o}return i}}function lp(e,t,n=["directives"]){let r={};if(e.extensions){let s=e.extensions;for(let a of n)s=s?.[a];if(s!=null)for(let a in s){let u=s[a],c=a;if(Array.isArray(u))for(let l of u){let p=r[c];if(!p)p=[],r[c]=p;p.push(l)}else{let l=r[c];if(!l)l=[],r[c]=l;l.push(u)}}}let i=Qr((s)=>JSON.stringify(s)),o=[];if(e.astNode)o.push(e.astNode);if(e.extensionASTNodes)o.push(...e.extensionASTNodes);for(let s of o)if(s.directives?.length)for(let a of s.directives){let u=a.name.value,c=r[u];if(!c)c=[],r[u]=c;let l=t?.getDirective(u),p={};if(l)p=_t(l,a);if(a.arguments)for(let f of a.arguments){let d=f.name.value;if(p[d]==null){let E=l?.args.find((I)=>I.name===d);if(E)p[d]=Pn(f.value,E.type)}if(p[d]==null)p[d]=Wt(f.value)}if(o.length>0&&c.length>0){let f=i(p);if(c.some((d)=>i(d)===f))continue}c.push(p)}return r}function Tu(e,t=["directives"]){let n=lp(e,void 0,t);return Object.entries(n).map(([r,i])=>i?.map((o)=>({name:r,args:o}))).flat(1/0).filter(Boolean)}function xm(){let e=globalThis.process?.getBuiltinModule;if(typeof e!=="function")return;try{let t=e("util");if(typeof t?.inspect!=="function")return;return(n)=>t.inspect(n,{depth:3,colors:!1,compact:!0,breakLength:1/0}).replaceAll("[Object: null prototype] ","")}catch{return}}var pp=xm();function yu(e,t=3){if(t>0&&e!=null&&typeof e.toJSON==="function")try{let n=e.toJSON();if(n!==e)return typeof n==="string"?n:yu(n,t-1)}catch{}if(pp)return pp(e);if(typeof e==="string")return JSON.stringify(e);if(typeof e==="function")return e.name?`[function ${e.name}]`:"[function]";if(e===void 0)return"undefined";try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function tn(e){if(w(e)){let t=tn(e.ofType);if(t.kind===cn)throw Error(`Invalid type node ${yu(e)}. Inner type of non-null type cannot be a non-null type.`);return{kind:cn,type:t}}else if(j(e))return{kind:Dn,type:tn(e.ofType)};return{kind:Sn,name:{kind:Ne,value:e.name}}}function Nn(e){if(e===null)return{kind:le};if(e===void 0)return null;if(Array.isArray(e)){let t=[];for(let n of e){let r=Nn(n);if(r!=null)t.push(r)}return{kind:Ae,values:t}}if(typeof e==="object"){if(e?.toJSON)return Nn(e.toJSON());let t=[];for(let n in e){let r=e[n],i=Nn(r);if(i)t.push({kind:un,name:{kind:Ne,value:n},value:i})}return{kind:Ve,fields:t}}if(typeof e==="boolean")return{kind:tt,value:e};if(typeof e==="bigint")return{kind:Oe,value:String(e)};if(typeof e==="number"&&isFinite(e)){let t=String(e);return wm.test(t)?{kind:Oe,value:t}:{kind:Bt,value:t}}if(typeof e==="string")return{kind:Ie,value:e};throw TypeError(`Cannot convert value to AST: ${e}.`)}var wm=/^-?(?:0|[1-9][0-9]*)$/;function fp(e){return e!=null&&typeof e==="object"&&typeof e[Symbol.iterator]==="function"}function dp(e){return typeof e==="object"&&e!==null}function Hi(e){return e==="__proto__"||e==="constructor"||e==="prototype"}function In(e,t){if(w(t)){let n=In(e,t.ofType);if(n?.kind===le)return null;return n}if(e===null)return{kind:le};if(e===void 0)return null;if(j(t)){let n=t.ofType;if(fp(e)){let r=[];for(let i of e){let o=In(i,n);if(o!=null)r.push(o)}return{kind:Ae,values:r}}return In(e,n)}if(k(t)){if(!dp(e))return null;let n=[];for(let r of Object.values(t.getFields())){let i=In(e[r.name],r.type);if(i)n.push({kind:un,name:{kind:Ne,value:r.name},value:i})}return{kind:Ve,fields:n}}if(ve(t)){if(z(t)){let n=t.getValues();for(let r of n){if(r.value===e){e=r.name;break}if(r.name===e){e=r.name;break}}return{kind:Ot,value:e}}else e=t.serialize(e);if(e==null)return null;if(t.name==="ID"&&typeof e==="string"&&Rm.test(e))return{kind:Oe,value:e}}return Nn(e)}var Rm=/^-?(?:0|[1-9][0-9]*)$/;var gu=(e)=>{if("default"in e){if(!e.default)return;if("value"in e.default)return Nn(e.default.value)??void 0;let t=Wt(e.default.literal);return In(t,e.type)??void 0}return e.defaultValue!==void 0?In(e.defaultValue,e.type)??void 0:void 0};function mp(e){return e.trim().length>0}function Et(e){if(typeof e.description==="string"){if(!mp(e.description))return;return{kind:Ie,value:e.description,block:!0}}if(e.astNode?.description&&mp(e.astNode.description.value))return{...e.astNode.description,block:!0}}var NR=Qr(function(t){let n=Lm(t);return new Set([...n].map((r)=>r.name))}),Lm=Qr(function(t){let n=Nu(t);return new Set(n.values())}),Nu=Qr(function(t){let n=new Map,r=t.getQueryType();if(r)n.set("query",r);let i=t.getMutationType();if(i)n.set("mutation",i);let o=t.getSubscriptionType();if(o)n.set("subscription",o);return n});function hp(e,t={}){let n=t.pathToDirectivesInExtensions,r=e.getTypeMap(),i=km(e,n),o=i!=null?[i]:[],s=e.getDirectives();for(let a of s){if(Vt(a))continue;o.push(Fm(a,e,n))}for(let a in r){let u=r[a],c=Ze(u),l=ht(u);if(c||l)continue;if(L(u))o.push(Cm(u,e,n));else if(P(u))o.push(Vm(u,e,n));else if(te(u))o.push(Mm(u,e,n));else if(k(u))o.push(Um(u,e,n));else if(z(u))o.push(Pm(u,e,n));else if(ae(u))o.push($m(u,e,n));else throw Error(`Unknown type ${u}.`)}return{kind:jt,definitions:o}}function km(e,t){let n=new Map([["query",void 0],["mutation",void 0],["subscription",void 0]]),r=[];if(e.astNode!=null)r.push(e.astNode);if(e.extensionASTNodes!=null)for(let c of e.extensionASTNodes)r.push(c);for(let c of r)if(c.operationTypes)for(let l of c.operationTypes)n.set(l.operation,l);let i=Nu(e);for(let[c,l]of n){let p=i.get(c);if(p!=null){let f=tn(p);if(l!=null)l.type=f;else n.set(c,{kind:si,operation:c,type:f})}else n.set(c,void 0)}let o=[...n.values()].filter(Br),s=nn(e,e,t);if(!o.length&&!s.length)return null;let a={kind:o.length?Ye:Rt,operationTypes:o,directives:s},u=Et(e);if(u)a.description=u;return a}function Fm(e,t,n){return{kind:pt,description:Et(e),name:{kind:Ne,value:e.name},arguments:e.args?.map((r)=>Ep(r,t,n)),repeatable:e.isRepeatable,locations:e.locations?.map((r)=>({kind:Ne,value:r}))||[]}}function nn(e,t,n){let r=[],i=Tu(e,n),o;if(i!=null)o=yp(t,i);let s=null,a=null,u=null;if(o!=null)r=o.filter((c)=>je.every((l)=>l.name!==c.name.value)),s=o.find((c)=>c.name.value==="deprecated"),a=o.find((c)=>c.name.value==="specifiedBy"),u=o.find((c)=>c.name.value==="oneOf");if(e.deprecationReason!=null&&s==null)s=Bm(e.deprecationReason);if(e.specifiedByUrl!=null||e.specifiedByURL!=null&&a==null){let l={url:e.specifiedByUrl||e.specifiedByURL};a=zi("specifiedBy",l)}if(e.isOneOf&&u==null)u=zi("oneOf");if(s!=null)r.push(s);if(a!=null)r.push(a);if(u!=null)r.push(u);return r}function Ep(e,t,n){return{kind:ai,description:Et(e),name:{kind:Ne,value:e.name},type:tn(e.type),defaultValue:gu(e),directives:nn(e,t,n)}}function Cm(e,t,n){return{kind:At,description:Et(e),name:{kind:Ne,value:e.name},fields:Object.values(e.getFields()).map((r)=>Tp(r,t,n)),interfaces:Object.values(e.getInterfaces()).map((r)=>tn(r)),directives:nn(e,t,n)}}function Vm(e,t,n){let r={kind:xt,description:Et(e),name:{kind:Ne,value:e.name},fields:Object.values(e.getFields()).map((i)=>Tp(i,t,n)),directives:nn(e,t,n)};if("getInterfaces"in e)r.interfaces=Object.values(e.getInterfaces()).map((i)=>tn(i));return r}function Mm(e,t,n){return{kind:wt,description:Et(e),name:{kind:Ne,value:e.name},directives:nn(e,t,n),types:e.getTypes().map((r)=>tn(r))}}function Um(e,t,n){return{kind:yt,description:Et(e),name:{kind:Ne,value:e.name},fields:Object.values(e.getFields()).map((r)=>Gm(r,t,n)),directives:nn(e,t,n)}}function Pm(e,t,n){return{kind:Yt,description:Et(e),name:{kind:Ne,value:e.name},values:Object.values(e.getValues()).map((r)=>jm(r,t,n)),directives:nn(e,t,n)}}function $m(e,t,n){let r=Tu(e,n),i=yp(t,r),o=e.specifiedByUrl||e.specifiedByURL;if(o&&!i.some((s)=>s.name.value==="specifiedBy")){let s={url:o};i.push(zi("specifiedBy",s))}return{kind:Qt,description:Et(e),name:{kind:Ne,value:e.name},directives:i}}function Tp(e,t,n){return{kind:co,description:Et(e),name:{kind:Ne,value:e.name},arguments:e.args.map((r)=>Ep(r,t,n)),type:tn(e.type),directives:nn(e,t,n)}}function Gm(e,t,n){return{kind:ai,description:Et(e),name:{kind:Ne,value:e.name},type:tn(e.type),directives:nn(e,t,n),defaultValue:gu(e)}}function jm(e,t,n){return{kind:lo,description:Et(e),name:{kind:Ne,value:e.name},directives:nn(e,t,n)}}function Bm(e){return zi("deprecated",{reason:e},mn)}function zi(e,t,n){let r=[];for(let i in t){let o=t[i],s;if(n!=null){let a=n.args.find((u)=>u.name===i);if(a)s=In(o,a.type)}if(s==null)s=Nn(o);if(s!=null)r.push({kind:ii,name:{kind:Ne,value:i},value:s})}return{kind:oi,name:{kind:Ne,value:e},arguments:r}}function yp(e,t){let n=[];for(let{name:r,args:i}of t){let o=e?.getDirective(r);n.push(zi(r,i,o))}return n}var Qm=80,Yr={};function Hs(){Yr={}}function vp(e){let t=e.name?.value;if(t==null)return;switch(Ws(e,t),e.kind){case"EnumTypeDefinition":if(e.values)for(let n of e.values)Ws(n,t,n.name.value);break;case"ObjectTypeDefinition":case"InputObjectTypeDefinition":case"InterfaceTypeDefinition":if(e.fields){for(let n of e.fields)if(Ws(n,t,n.name.value),Wm(n)&&n.arguments)for(let r of n.arguments)Ws(r,t,n.name.value,r.name.value)}break}}function Ws(e,t,n,r){let i=Hm(e);if(typeof i!=="string"||i.length===0)return;let o=[t];if(n){if(o.push(n),r)o.push(r)}let s=o.join(".");if(!Yr[s])Yr[s]=[];Yr[s].push(i)}function Ym(e){return` +# `+e.replace(/\n/g,` +# `)}function M(e,t){return e?e.filter((n)=>n).join(t||""):""}function gp(e){return e?.some((t)=>t.includes(` +`))??!1}function qm(e){return(t,n,r,i,o)=>{let s=[],a=i.reduce((l,p)=>{if(["fields","arguments","values"].includes(p)&&l.name)s.push(l.name.value);return l[p]},o[0]),u=[...s,a?.name?.value].filter(Boolean).join("."),c=[];if(t.kind.includes("Definition")&&Yr[u])c.push(...Yr[u]);return M([...c.map(Ym),t.description,e(t,n,r,i,o)],` +`)}}function Xi(e){return e&&` ${e.replace(/\n/g,` + `)}`}function $t(e){return e&&e.length!==0?`{ +${Xi(M(e,` +`))} +}`:""}function be(e,t,n){return t?e+t+(n||""):""}function Km(e,t=!1){let n=e.replace(/\\/g,"\\\\").replace(/"""/g,'\\"""');return(e[0]===" "||e[0]==="\t")&&e.indexOf(` +`)===-1?`"""${n.replace(/"$/,`" +`)}"""`:`""" +${t?n:Xi(n)} +"""`}var Np={Name:{leave:(e)=>e.value},Variable:{leave:(e)=>"$"+e.name},Document:{leave:(e)=>M(e.definitions,` + +`)},OperationDefinition:{leave:(e)=>{let t=be("(",M(e.variableDefinitions,", "),")");return M([e.operation,M([e.name,t]),M(e.directives," ")]," ")+" "+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+be(" = ",n)+be(" ",M(r," "))},SelectionSet:{leave:({selections:e})=>$t(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let o=be("",e,": ")+t,s=o+be("(",M(n,", "),")");if(s.length>Qm)s=o+be(`( +`,Xi(M(n,` +`)),` +)`);return M([s,M(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+be(" ",M(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>M(["...",be("on ",e),M(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${be("(",M(n,", "),")")} on ${t} ${be("",M(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>{if(t)return Km(e);return JSON.stringify(e)}},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+M(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+M(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+be("(",M(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({directives:e,operationTypes:t})=>M(["schema",M(e," "),$t(t)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({name:e,directives:t})=>M(["scalar",e,M(t," ")]," ")},ObjectTypeDefinition:{leave:({name:e,interfaces:t,directives:n,fields:r})=>M(["type",e,be("implements ",M(t," & ")),M(n," "),$t(r)]," ")},FieldDefinition:{leave:({name:e,arguments:t,type:n,directives:r})=>e+(gp(t)?be(`( +`,Xi(M(t,` +`)),` +)`):be("(",M(t,", "),")"))+": "+n+be(" ",M(r," "))},InputValueDefinition:{leave:({name:e,type:t,defaultValue:n,directives:r})=>M([e+": "+t,be("= ",n),M(r," ")]," ")},InterfaceTypeDefinition:{leave:({name:e,interfaces:t,directives:n,fields:r})=>M(["interface",e,be("implements ",M(t," & ")),M(n," "),$t(r)]," ")},UnionTypeDefinition:{leave:({name:e,directives:t,types:n})=>M(["union",e,M(t," "),be("= ",M(n," | "))]," ")},EnumTypeDefinition:{leave:({name:e,directives:t,values:n})=>M(["enum",e,M(t," "),$t(n)]," ")},EnumValueDefinition:{leave:({name:e,directives:t})=>M([e,M(t," ")]," ")},InputObjectTypeDefinition:{leave:({name:e,directives:t,fields:n})=>M(["input",e,M(t," "),$t(n)]," ")},DirectiveDefinition:{leave:({name:e,arguments:t,repeatable:n,locations:r})=>"directive @"+e+(gp(t)?be(`( +`,Xi(M(t,` +`)),` +)`):be("(",M(t,", "),")"))+(n?" repeatable":"")+" on "+M(r," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>M(["extend schema",M(e," "),$t(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>M(["extend scalar",e,M(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>M(["extend type",e,be("implements ",M(t," & ")),M(n," "),$t(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>M(["extend interface",e,be("implements ",M(t," & ")),M(n," "),$t(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>M(["extend union",e,M(t," "),be("= ",M(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>M(["extend enum",e,M(t," "),$t(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>M(["extend input",e,M(t," "),$t(n)]," ")}},Jm=Object.keys(Np).reduce((e,t)=>({...e,[t]:{leave:qm(Np[t].leave)}}),{});function bp(e){return ft(e,Jm)}function Wm(e){return e.kind==="FieldDefinition"}function Hm(e){let t=zm(e);if(t!==void 0)return Xm(` +${t}`)}function zm(e){let t=e.loc;if(!t)return;let n=[],r=t.startToken.prev;while(r!=null&&r.kind===T.COMMENT&&r.next!=null&&r.prev!=null&&r.line+1===r.next.line&&r.line!==r.prev.line){let i=String(r.value);n.push(i),r=r.prev}return n.length>0?n.reverse().join(` +`):void 0}function Xm(e){let t=e.split(/\r\n|[\n\r]/g),n=Zm(t);if(n!==0)for(let r=1;r<t.length;r++)t[r]=t[r].slice(n);while(t.length>0&&Ip(t[0]))t.shift();while(t.length>0&&Ip(t[t.length-1]))t.pop();return t.join(` +`)}function Zm(e){let t=null;for(let n=1;n<e.length;n++){let r=e[n],i=_p(r);if(i===r.length)continue;if(t===null||i<t){if(t=i,t===0)break}}return t===null?0:t}function _p(e){let t=0;while(t<e.length&&(e[t]===" "||e[t]==="\t"))t++;return t}function Ip(e){return _p(e)===e.length}var Q;(function(e){e.TYPE="MapperKind.TYPE",e.SCALAR_TYPE="MapperKind.SCALAR_TYPE",e.ENUM_TYPE="MapperKind.ENUM_TYPE",e.COMPOSITE_TYPE="MapperKind.COMPOSITE_TYPE",e.OBJECT_TYPE="MapperKind.OBJECT_TYPE",e.INPUT_OBJECT_TYPE="MapperKind.INPUT_OBJECT_TYPE",e.ABSTRACT_TYPE="MapperKind.ABSTRACT_TYPE",e.UNION_TYPE="MapperKind.UNION_TYPE",e.INTERFACE_TYPE="MapperKind.INTERFACE_TYPE",e.ROOT_OBJECT="MapperKind.ROOT_OBJECT",e.QUERY="MapperKind.QUERY",e.MUTATION="MapperKind.MUTATION",e.SUBSCRIPTION="MapperKind.SUBSCRIPTION",e.DIRECTIVE="MapperKind.DIRECTIVE",e.FIELD="MapperKind.FIELD",e.COMPOSITE_FIELD="MapperKind.COMPOSITE_FIELD",e.OBJECT_FIELD="MapperKind.OBJECT_FIELD",e.ROOT_FIELD="MapperKind.ROOT_FIELD",e.QUERY_ROOT_FIELD="MapperKind.QUERY_ROOT_FIELD",e.MUTATION_ROOT_FIELD="MapperKind.MUTATION_ROOT_FIELD",e.SUBSCRIPTION_ROOT_FIELD="MapperKind.SUBSCRIPTION_ROOT_FIELD",e.INTERFACE_FIELD="MapperKind.INTERFACE_FIELD",e.INPUT_OBJECT_FIELD="MapperKind.INPUT_OBJECT_FIELD",e.ARGUMENT="MapperKind.ARGUMENT",e.ENUM_VALUE="MapperKind.ENUM_VALUE"})(Q||(Q={}));function mr(e,t){if(t){let n=e[t.name];if(L(n))return n}}function Sp(e){if("getFields"in e){let t=e.getFields();for(let n in t)return t[n].name==="_fake"}return!1}function Dp(e){switch(e.name){case wn.name:return wn;case Ir.name:return Ir;case ie.name:return ie;case ge.name:return ge;case Rn.name:return Rn;default:return e}}function Op(e,t){let n=Object.create(null);for(let f in e)n[f]=e[f];let r=Object.create(null);for(let f in n){let d=n[f];if(d==null||f.startsWith("__"))continue;let E=d.name;if(E.startsWith("__"))continue;if(r[E]!=null){console.warn(`Duplicate schema type name ${E} found; keeping the existing one found in the schema`);continue}r[E]=d}for(let f in r)r[f]=a(r[f]);let i=t.map((f)=>o(f));return{typeMap:r,directives:i};function o(f){if(Vt(f))return f;let d=f.toConfig();return d.args=s(d.args),new Re(d)}function s(f){let d={};for(let E in f){let I=f[E],S=p(I.type);if(S!=null)I.type=S,d[E]=I}return d}function a(f){if(L(f)){let d=f.toConfig(),E={...d,fields:()=>u(d.fields),interfaces:()=>l(d.interfaces)};return new Ee(E)}else if(P(f)){let d=f.toConfig(),E={...d,fields:()=>u(d.fields)};if("interfaces"in E)E.interfaces=()=>l(d.interfaces);return new Me(E)}else if(te(f)){let d=f.toConfig(),E={...d,types:()=>l(d.types)};return new it(E)}else if(k(f)){let d=f.toConfig(),E={...d,fields:()=>c(d.fields)};return new Ge(E)}else if(z(f)){let d=f.toConfig();return new we(d)}else if(ae(f)){if(Ze(f))return f;let d=f.toConfig();return new ke(d)}throw Error(`Unexpected schema type: ${f}`)}function u(f){let d={};for(let E in f){let I=f[E],S=p(I.type);if(S!=null&&I.args)I.type=S,I.args=s(I.args),d[E]=I}return d}function c(f){let d={};for(let E in f){let I=f[E],S=p(I.type);if(S!=null)I.type=S,d[E]=I}return d}function l(f){let d=[];for(let E of f){let I=p(E);if(I!=null)d.push(I)}return d}function p(f){if(j(f)){let d=p(f.ofType);return d!=null?new oe(d):null}else if(w(f)){let d=p(f.ofType);return d!=null?new V(d):null}else if(rt(f)){let d=n[f.name];if(d===void 0)d=Sp(f)?Dp(f):a(f),r[d.name]=n[f.name]=d;return d!=null?r[d.name]:null}return null}}function zs(e,t,n=null,r=null){if(t==null)return t;let i=gr(e);if(ve(i))return n!=null?n(i,t):t;else if(j(i))return Js(t).map((o)=>zs(i.ofType,o,n,r));else if(k(i)){let o=i.getFields(),s={};for(let a in t){let u=o[a];if(u!=null)s[a]=zs(u.type,t[a],n,r)}return r!=null?r(i,s):s}}function Xs(e,t){return zs(e,t,(n,r)=>{try{return n.serialize(r)}catch{return r}})}function Zs(e,t){return zs(e,t,(n,r)=>{try{return n.parseValue(r)}catch{return r}})}function Zi(e,t={}){let n=wp(xp(Iu(Ap(th(Iu(Ap(e.getTypeMap(),e,Xs),e,t,(a)=>ve(a)),e,t),e,Zs),e,t,(a)=>!ve(a)),e,t),e,t),r=e.getDirectives(),i=nh(r,e,t),{typeMap:o,directives:s}=Op(n,i);return new ot({...e.toConfig(),query:mr(o,mr(n,e.getQueryType())),mutation:mr(o,mr(n,e.getMutationType())),subscription:mr(o,mr(n,e.getSubscriptionType())),types:Object.values(o),directives:s})}var eh=["String","ID","Int","Float","Boolean"];function Iu(e,t,n,r=()=>!0){let i={};for(let o in e)if(!o.startsWith("__")&&!eh.includes(o)){let s=e[o];if(s==null||!r(s)){i[o]=s;continue}let a=ih(t,n,o);if(a==null){i[o]=s;continue}let u=a(s,t);if(u===void 0){i[o]=s;continue}i[o]=u}return i}function th(e,t,n){let r=ch(n);if(!r)return e;return Iu(e,t,{[Q.ENUM_TYPE]:(i)=>{let o=i.toConfig(),s=o.values,a={};for(let u in s){let c=s[u],l=r(c,i.name,t,u);if(l===void 0)a[u]=c;else if(Array.isArray(l)){let[p,f]=l;a[p]=f===void 0?c:f}else if(l!==null)a[u]=l}return ea(new we({...o,values:a}))}},(i)=>z(i))}function Ap(e,t,n){let r=wp(e,t,{[Q.ARGUMENT]:(i)=>{if(i.defaultValue===void 0)return i;let o=ta(e,i.type);if(o!=null)return{...i,defaultValue:n(o,i.defaultValue)}}});return xp(r,t,{[Q.INPUT_OBJECT_FIELD]:(i)=>{if(i.defaultValue===void 0)return i;let o=ta(r,i.type);if(o!=null)return{...i,defaultValue:n(o,i.defaultValue)}}})}function ta(e,t){if(j(t)){let n=ta(e,t.ofType);return n!=null?new oe(n):null}else if(w(t)){let n=ta(e,t.ofType);return n!=null?new V(n):null}else if(rt(t)){let n=e[t.name];return n!=null?n:null}return null}function xp(e,t,n){let r={};for(let i in e)if(!i.startsWith("__")){let o=e[i];if(!L(o)&&!P(o)&&!k(o)){r[i]=o;continue}let s=sh(t,n,i);if(s==null){r[i]=o;continue}let a=o.toConfig(),u=a.fields,c={};for(let l in u){let p=u[l],f=s(p,l,i,t);if(f===void 0)c[l]=p;else if(Array.isArray(f)){let[d,E]=f;if(E.astNode!=null)E.astNode={...E.astNode,name:{...E.astNode.name,value:d}};c[d]=E===void 0?p:E}else if(f!==null)c[l]=f}if(L(o))r[i]=ea(new Ee({...a,fields:c}));else if(P(o))r[i]=ea(new Me({...a,fields:c}));else r[i]=ea(new Ge({...a,fields:c}))}return r}function wp(e,t,n){let r={};for(let i in e)if(!i.startsWith("__")){let o=e[i];if(!L(o)&&!P(o)){r[i]=o;continue}let s=ah(n);if(s==null){r[i]=o;continue}let a=o.toConfig(),u=a.fields,c={};for(let l in u){let p=u[l],f=p.args;if(f==null){c[l]=p;continue}let d=Object.keys(f);if(!d.length){c[l]=p;continue}let E={};for(let I of d){let S=f[I],G=s(S,l,i,t);if(G===void 0)E[I]=S;else if(Array.isArray(G)){let[Z,W]=G;E[Z]=W}else if(G!==null)E[I]=G}c[l]={...p,args:E}}if(L(o))r[i]=new Ee({...a,fields:c});else if(P(o))r[i]=new Me({...a,fields:c});else r[i]=new Ge({...a,fields:c})}return r}function nh(e,t,n){let r=uh(n);if(r==null)return e.slice();let i=[];for(let o of e){let s=r(o,t);if(s===void 0)i.push(o);else if(s!==null)i.push(s)}return i}function rh(e,t){let n=e.getType(t),r=[Q.TYPE];if(L(n)){if(r.push(Q.COMPOSITE_TYPE,Q.OBJECT_TYPE),t===e.getQueryType()?.name)r.push(Q.ROOT_OBJECT,Q.QUERY);else if(t===e.getMutationType()?.name)r.push(Q.ROOT_OBJECT,Q.MUTATION);else if(t===e.getSubscriptionType()?.name)r.push(Q.ROOT_OBJECT,Q.SUBSCRIPTION)}else if(k(n))r.push(Q.INPUT_OBJECT_TYPE);else if(P(n))r.push(Q.COMPOSITE_TYPE,Q.ABSTRACT_TYPE,Q.INTERFACE_TYPE);else if(te(n))r.push(Q.COMPOSITE_TYPE,Q.ABSTRACT_TYPE,Q.UNION_TYPE);else if(z(n))r.push(Q.ENUM_TYPE);else if(ae(n))r.push(Q.SCALAR_TYPE);return r}function ih(e,t,n){let r=rh(e,n),i,o=[...r];while(!i&&o.length>0){let s=o.pop();i=t[s]}return i!=null?i:null}function oh(e,t){let n=e.getType(t),r=[Q.FIELD];if(L(n)){if(r.push(Q.COMPOSITE_FIELD,Q.OBJECT_FIELD),t===e.getQueryType()?.name)r.push(Q.ROOT_FIELD,Q.QUERY_ROOT_FIELD);else if(t===e.getMutationType()?.name)r.push(Q.ROOT_FIELD,Q.MUTATION_ROOT_FIELD);else if(t===e.getSubscriptionType()?.name)r.push(Q.ROOT_FIELD,Q.SUBSCRIPTION_ROOT_FIELD)}else if(P(n))r.push(Q.COMPOSITE_FIELD,Q.INTERFACE_FIELD);else if(k(n))r.push(Q.INPUT_OBJECT_FIELD);return r}function sh(e,t,n){let r=oh(e,n),i,o=[...r];while(!i&&o.length>0){let s=o.pop();i=t[s]}return i??null}function ah(e){let t=e[Q.ARGUMENT];return t!=null?t:null}function uh(e){let t=e[Q.DIRECTIVE];return t!=null?t:null}function ch(e){let t=e[Q.ENUM_VALUE];return t!=null?t:null}function ea(e){if(L(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.fields){let i=t.fields[r];if(i.astNode!=null)n.push(i.astNode)}t.astNode={...t.astNode,kind:At,fields:n}}if(t.extensionASTNodes!=null)t.extensionASTNodes=t.extensionASTNodes.map((n)=>({...n,kind:qt,fields:void 0}));return new Ee(t)}else if(P(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.fields){let i=t.fields[r];if(i.astNode!=null)n.push(i.astNode)}t.astNode={...t.astNode,kind:xt,fields:n}}if(t.extensionASTNodes!=null)t.extensionASTNodes=t.extensionASTNodes.map((n)=>({...n,kind:Kt,fields:void 0}));return new Me(t)}else if(k(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.fields){let i=t.fields[r];if(i.astNode!=null)n.push(i.astNode)}t.astNode={...t.astNode,kind:yt,fields:n}}if(t.extensionASTNodes!=null)t.extensionASTNodes=t.extensionASTNodes.map((n)=>({...n,kind:Lt,fields:void 0}));return new Ge(t)}else if(z(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.values){let i=t.values[r];if(i.astNode!=null)n.push(i.astNode)}t.astNode={...t.astNode,values:n}}if(t.extensionASTNodes!=null)t.extensionASTNodes=t.extensionASTNodes.map((n)=>({...n,values:void 0}));return new we(t)}else return e}function Rp(e){return lh(e.getTypeMap(),e.getDirectives()),e}function lh(e,t){let n=Object.create(null);for(let c in e){let l=e[c];if(l==null||c.startsWith("__"))continue;let p=l.name;if(p.startsWith("__"))continue;if(n[p]!=null){console.warn(`Duplicate schema type name ${p} found; keeping the existing one found in the schema`);continue}n[p]=l}for(let c in n){let l=n[c];e[c]=l}for(let c of t)c.args=c.args.filter((l)=>(l.type=u(l.type),l.type!==null));for(let c in e){let l=e[c];if(!c.startsWith("__")&&c in n){if(l!=null)r(l)}}for(let c in e)if(!c.startsWith("__")&&!(c in n))delete e[c];function r(c){if(L(c)){i(c),o(c);return}else if(P(c)){if(i(c),"getInterfaces"in c)o(c);return}else if(te(c)){a(c);return}else if(k(c)){s(c);return}else if(ve(c))return;throw Error(`Unexpected schema type: ${c}`)}function i(c){let l=c.getFields();for(let[p,f]of Object.entries(l))if(f.args.map((d)=>(d.type=u(d.type),d.type===null?null:d)).filter(Boolean),f.type=u(f.type),f.type===null)delete l[p]}function o(c){if("getInterfaces"in c){let l=c.getInterfaces();l.push(...l.splice(0).map((p)=>u(p)).filter(Boolean))}}function s(c){let l=c.getFields();for(let[p,f]of Object.entries(l))if(f.type=u(f.type),f.type===null)delete l[p]}function a(c){let l=c.getTypes();l.push(...l.splice(0).map((p)=>u(p)).filter(Boolean))}function u(c){if(j(c)){let l=u(c.ofType);return l!=null?new oe(l):null}else if(w(c)){let l=u(c.ofType);return l!=null?new V(l):null}else if(rt(c)){let l=e[c.name];if(l&&c!==l)return l}return c}}function na(e,t){let n=e.getTypeMap();for(let r in n){let i=n[r];if(!pe(i).name.startsWith("__")&&L(i)){let o=i.getFields();for(let s in o){let a=o[s];t(a,r,s)}}}}function vu(e,t){let n=e.getTypeMap();for(let r in n){let i=n[r];if(!pe(i).name.startsWith("__")){if(L(i)){let o=i.getFields();for(let s in o){let a=o[s];for(let u of a.args)u.defaultValue=t(u.type,u.defaultValue)}}else if(k(i)){let o=i.getFields();for(let s in o){let a=o[s];a.defaultValue=t(a.type,a.defaultValue)}}}}}function ph(e){return e!=null&&typeof e==="object"&&!Array.isArray(e)}function fh(e){return{enumerable:e?.enumerable??!1,nonEnumerable:e?.nonEnumerable??!1}}function dh(e,t=!1,n=!1,r=!1){if(ph(e))return{respectPrototype:e.respectPrototype??!1,respectArrays:e.respectArrays??!1,respectArrayLength:e.respectArrayLength??!1,respectSymbols:fh(e.respectSymbols)};return{respectPrototype:e??!1,respectArrays:t,respectArrayLength:n,respectSymbols:{enumerable:!1,nonEnumerable:r}}}function ra(e,t=!1,n=!1,r=!1,i=!1){let o=dh(t,n,r,i);return eo(e,o)}function eo(e,t){let{respectPrototype:n,respectArrayLength:r,respectSymbols:i}=t,{enumerable:o,nonEnumerable:s}=i;if(e.length===0)return;if(e.length===1)return e[0];let a,u=!0,c=e.every((f)=>{if(Array.isArray(f)){if(a===void 0)return a=f.length,!0;else if(a===f.length)return!0}else u=!1;return!1});if(r&&c)return Array(a).fill(null).map((f,d)=>eo(e.map((E)=>E[d]),t));if(u)return e.flat(1);let l,p;if(n){if(p=e.find((f)=>Lp(f)),p){if(l==null)l={};Object.setPrototypeOf(l,Object.create(Object.getPrototypeOf(p)))}}for(let f of e){if(f===void 0)continue;if(Lp(f)){if(l==null)l={};if(p){let d=Object.getPrototypeOf(l),E=Object.getPrototypeOf(f);if(E)for(let I of Object.getOwnPropertyNames(E)){let S=Object.getOwnPropertyDescriptor(E,I);if(Br(S))Object.defineProperty(d,I,S)}}for(let d in f){if(Hi(d))continue;if(Object.prototype.hasOwnProperty.call(l,d)&&f[d]!==void 0)l[d]=eo([l[d],f[d]],t);else l[d]=f[d]}if(l!=null&&(o||s))for(let d of Object.getOwnPropertySymbols(f)){if(!Object.getOwnPropertyDescriptor(f,d).enumerable){if(s)if(Object.prototype.hasOwnProperty.call(l,d)){let S=Object.getOwnPropertyDescriptor(l,d);if(S.configurable)Object.defineProperty(l,d,{value:f[d],writable:!0,enumerable:!1,configurable:!0});else if(S.writable||S.set)l[d]=f[d]}else Object.defineProperty(l,d,{value:f[d],writable:!0,enumerable:!1,configurable:!0});continue}if(!o)continue;let I=Object.prototype.hasOwnProperty.call(l,d);if(I&&f[d]!==void 0){let S=Object.getOwnPropertyDescriptor(l,d),G=eo([l[d],f[d]],t);if(S.writable||S.set)l[d]=G;else if(S.configurable)Object.defineProperty(l,d,{value:G,writable:!0,enumerable:!0,configurable:!0})}else if(!I)l[d]=f[d];else{let S=Object.getOwnPropertyDescriptor(l,d);if(S.writable||S.set)l[d]=f[d];else if(S.configurable)Object.defineProperty(l,d,{value:f[d],writable:!0,enumerable:!0,configurable:!0})}}}else if(Array.isArray(f))if(!Array.isArray(l))l=f;else l=eo([l,f],t);else l=f}return l}function Lp(e){return e&&typeof e==="object"&&!Array.isArray(e)}function kp(e){return e&&typeof e==="object"&&"kind"in e&&e.kind===jt}function bu(e,t){if(!e||Array.isArray(e)&&e.length===0)return{};if(!Array.isArray(e))return e;if(e.length===1)return e[0]||{};let n=[];for(let i of e){if(Array.isArray(i))i=bu(i);if(typeof i==="object"&&i)n.push(i)}let r=ra(n,{respectPrototype:!0,respectSymbols:{enumerable:!0,nonEnumerable:!0}});if(t?.exclusions)for(let i of t.exclusions){let[o,s]=i.split(".");if(Hi(o)||Hi(s))continue;if(!s||s==="*")delete r[o];else if(r[o])delete r[o][s]}return r}function Fp(e,t,n){let r=mh([...t,...e].filter(Br),n);if(n&&n.sort)r.sort($n);return r}function mh(e,t){return e.reduce((n,r)=>{let i=n.findIndex((o)=>o.name.value===r.name.value);if(i===-1)return n.concat([r]);else if(!t?.reverseArguments)n[i]=r;return n},[])}function Cp(e){let t=new Set,n=new Set;for(let r of e){let i=r.name.value;if(t.has(i))n.add(i);else t.add(i)}return n}function hh(e,t,n,r){let i=t?.[e.name.value];if(i)return!!i.repeatable;return!!(n?.has(e.name.value)||r?.has(e.name.value))}function Vp(e,t){return t.some(({value:n})=>n===e.value)}function Eh(e,t){let n=[];for(let r of[...t,...e]){let i=n.findIndex((o)=>o.name.value===r.name.value);if(i===-1)n.push(r);else{let o=n[i];if(o.value.kind==="ListValue"){let s=o.value.values,a=r.value.values;o.value={...o.value,values:Pp(s,a,(u,c)=>{let l=u.value;return!l||!c.some((p)=>p.value===l)})}}else o.value=r.value}}return n}var _u=(e,t)=>{if(e.kind===t.kind)switch(e.kind){case Ae:return e.values.length===t.values.length&&e.values.every((n)=>t.values.find((r)=>_u(n,r)));case Ce:case le:return!0;case Ve:return e.fields.length===t.fields.length&&e.fields.every((n)=>t.fields.find((r)=>n.name.value===r.name.value&&_u(n.value,r.value)));default:return e.value===t.value}return!1},Su=(e)=>e.name.value==="link",Mp=(e)=>{let t=Su(e)?e.arguments?.find((n)=>n.name.value==="url")?.value:void 0;return t?.kind==="StringValue"?t.value:void 0},Th=(e,t)=>e.name.value===t.name.value&&e.value.kind===t.value.kind&&_u(e.value,t.value),yh=(e,t)=>!!(e.name.value===t.name.value&&(e.arguments===t.arguments||e.arguments?.length===t.arguments?.length&&e.arguments?.every((r)=>t.arguments?.find((i)=>Th(r,i)))));function $e(e=[],t=[],n,r){let i=n&&n.reverseDirectives,o=i?e:t,s=i?t:e,a=new Set(e.map((p)=>p.name.value)),u=new Set(t.map((p)=>p.name.value)),c=new Set;for(let p of Cp(e))if(!u.has(p))c.add(p);for(let p of Cp(t))if(!a.has(p))c.add(p);let l=[];for(let p of[...o,...s])if(hh(p,r,n?.repeatableLinkImports,c)){if(!l.find((d)=>yh(p,d)))l.push(p)}else{let f=l.findIndex((d)=>d.name.value===p.name.value);if(f===-1)l.push(p);else{if(Su(p)&&Su(l[f])){let E=Mp(p),I=Mp(l[f]);if(E&&I&&E!==I){l.push(p);continue}}let d=Eh(p.arguments??[],l[f].arguments??[]);l[f]={...l[f],arguments:d.length===0?void 0:d}}}return l}function Up(e,t){if(t)return{...e,arguments:Pp(t.arguments||[],e.arguments||[],(n,r)=>!Vp(n.name,r.map((i)=>i.name))),locations:[...t.locations,...e.locations.filter((n)=>!Vp(n,t.locations))]};return e}function Pp(e,t,n){return e.concat(t.filter((r)=>n(r,e)))}function $p(e,t,n,r){if(n?.consistentEnumMerge){let s=[];if(e)s.push(...e);e=t,t=s}let i=new Map;if(e)for(let s of e)i.set(s.name.value,s);if(t)for(let s of t){let a=s.name.value;if(i.has(a)){let u=i.get(a);u.description=s.description||u.description,u.directives=$e(s.directives,u.directives,r)}else i.set(a,s)}let o=[...i.values()];if(n&&n.sort)o.sort($n);return o}function Gp(e,t,n,r){if(t)return{name:e.name,description:e.description||t.description,kind:n?.convertExtensions||e.kind==="EnumTypeDefinition"||t.kind==="EnumTypeDefinition"?"EnumTypeDefinition":"EnumTypeExtension",loc:e.loc,directives:$e(e.directives,t.directives,n,r),values:$p(e.values,t.values,n)};return n?.convertExtensions?{...e,kind:Yt}:e}function jp(e){return typeof e==="string"}function Bp(e){return e instanceof Pt}function Du(e){let t=e;while(t.kind===Dn||t.kind==="NonNullType")t=t.type;return t}function Ou(e){return e.kind!==Sn}function ia(e){return e.kind===Dn}function jn(e){return e.kind===cn}function to(e){if(ia(e))return`[${to(e.type)}]`;if(jn(e))return`${to(e.type)}!`;return e.name.value}var Gn;(function(e){e[e.A_SMALLER_THAN_B=-1]="A_SMALLER_THAN_B",e[e.A_EQUALS_B=0]="A_EQUALS_B",e[e.A_GREATER_THAN_B=1]="A_GREATER_THAN_B"})(Gn||(Gn={}));function Qp(e,t){if(e==null&&t==null)return Gn.A_EQUALS_B;if(e==null)return Gn.A_SMALLER_THAN_B;if(t==null)return Gn.A_GREATER_THAN_B;if(e<t)return Gn.A_SMALLER_THAN_B;if(e>t)return Gn.A_GREATER_THAN_B;return Gn.A_EQUALS_B}function gh(e,t){let n=e.findIndex((r)=>r.name.value===t.name.value);return[n>-1?e[n]:null,n]}function qr(e,t,n,r,i){let o=[];if(n!=null)o.push(...n);if(t!=null)for(let s of t){let[a,u]=gh(o,s);if(a&&!r?.ignoreFieldConflicts){let c=r?.onFieldTypeConflict&&r.onFieldTypeConflict(a,s,e,r?.throwOnConflict)||Nh(e,a,s,r?.throwOnConflict);c.arguments=Fp(s.arguments||[],a.arguments||[],r),c.directives=$e(s.directives,a.directives,r,i),c.description=s.description||a.description,o[u]=c}else o.push(s)}if(r&&r.sort)o.sort($n);if(r&&r.exclusions){let s=r.exclusions;return o.filter((a)=>!s.includes(`${e.name.value}.${a.name.value}`))}return o}function Nh(e,t,n,r=!1){let i=to(t.type),o=to(n.type);if(i!==o){let s=Du(t.type),a=Du(n.type);if(s.name.value!==a.name.value)throw Error(`Field "${n.name.value}" already defined with a different type. Declared as "${s.name.value}", but you tried to override with "${a.name.value}"`);if(!no(t.type,n.type,!r))throw Error(`Field '${e.name.value}.${t.name.value}' changed type from '${i}' to '${o}'`)}if(jn(n.type)&&!jn(t.type))t.type=n.type;return t}function no(e,t,n=!1){if(!Ou(e)&&!Ou(t))return e.toString()===t.toString();if(jn(t)){let r=jn(e)?e.type:e;return no(r,t.type)}if(jn(e))return no(t,e,n);if(ia(e))return ia(t)&&no(e.type,t.type)||jn(t)&&no(e,t.type);return!1}function Yp(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n?.convertExtensions||e.kind==="InputObjectTypeDefinition"||t.kind==="InputObjectTypeDefinition"?"InputObjectTypeDefinition":"InputObjectTypeExtension",loc:e.loc,fields:qr(e,e.fields,t.fields,n),directives:$e(e.directives,t.directives,n,r)}}catch(i){throw Error(`Unable to merge GraphQL input type "${e.name.value}": ${i.message}`)}return n?.convertExtensions?{...e,kind:yt}:e}function Ih(e,t){return!!e.find((n)=>n.name.value===t.name.value)}function Kr(e=[],t=[],n={}){let r=[...t,...e.filter((i)=>!Ih(t,i))];if(n&&n.sort)r.sort($n);return r}function qp(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n?.convertExtensions||e.kind==="InterfaceTypeDefinition"||t.kind==="InterfaceTypeDefinition"?"InterfaceTypeDefinition":"InterfaceTypeExtension",loc:e.loc,fields:qr(e,e.fields,t.fields,n,r),directives:$e(e.directives,t.directives,n,r),interfaces:e.interfaces?Kr(e.interfaces,t.interfaces,n):void 0}}catch(i){throw Error(`Unable to merge GraphQL interface "${e.name.value}": ${i.message}`)}return n?.convertExtensions?{...e,kind:xt}:e}function Kp(e,t,n,r){if(t)return{name:e.name,description:e.description||t.description,kind:n?.convertExtensions||e.kind==="ScalarTypeDefinition"||t.kind==="ScalarTypeDefinition"?"ScalarTypeDefinition":"ScalarTypeExtension",loc:e.loc,directives:$e(e.directives,t.directives,n,r)};return n?.convertExtensions?{...e,kind:Qt}:e}var oa={query:"Query",mutation:"Mutation",subscription:"Subscription"};function vh(e=[],t=[]){let n=[];for(let r in oa){let i=e.find((o)=>o.operation===r)||t.find((o)=>o.operation===r);if(i)n.push(i)}return n}function Jp(e,t,n,r){if(t)return{kind:e.kind===Ye||t.kind===Ye?Ye:Rt,description:e.description||t.description,directives:$e(e.directives,t.directives,n,r),operationTypes:vh(e.operationTypes,t.operationTypes)};return n?.convertExtensions?{...e,kind:Ye}:e}function Wp(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n?.convertExtensions||e.kind==="ObjectTypeDefinition"||t.kind==="ObjectTypeDefinition"?"ObjectTypeDefinition":"ObjectTypeExtension",loc:e.loc,fields:qr(e,e.fields,t.fields,n,r),directives:$e(e.directives,t.directives,n,r),interfaces:Kr(e.interfaces,t.interfaces,n)}}catch(i){throw Error(`Unable to merge GraphQL type "${e.name.value}": ${i.message}`)}return n?.convertExtensions?{...e,kind:At}:e}function Hp(e,t,n,r){if(t)return{name:e.name,description:e.description||t.description,directives:$e(e.directives,t.directives,n,r),kind:n?.convertExtensions||e.kind==="UnionTypeDefinition"||t.kind==="UnionTypeDefinition"?wt:Jt,loc:e.loc,types:Kr(e.types,t.types,n)};return n?.convertExtensions?{...e,kind:wt}:e}var hr="SCHEMA_DEF_SYMBOL";function bh(e){return"name"in e}function Au(e,t,n={}){let r=n;for(let i of e)if(bh(i)){let o=i.name?.value;if(t?.commentDescriptions)vp(i);if(o==null)continue;if(t?.exclusions?.includes(o+".*")||t?.exclusions?.includes(o))delete r[o];else switch(i.kind){case At:case qt:r[o]=Wp(i,r[o],t,n);break;case Yt:case pn:r[o]=Gp(i,r[o],t,n);break;case wt:case Jt:r[o]=Hp(i,r[o],t,n);break;case Qt:case ln:r[o]=Kp(i,r[o],t,n);break;case yt:case Lt:r[o]=Yp(i,r[o],t,n);break;case xt:case Kt:r[o]=qp(i,r[o],t,n);break;case pt:if(r[o]){if(o in{}){if(!_h(r[o]))r[o]=void 0}}r[o]=Up(i,r[o]);break}}else if(i.kind===Ye||i.kind===Rt)r[hr]=Jp(i,r[hr],t,n);return r}function _h(e){return e!=null&&typeof e==="object"&&"kind"in e&&typeof e.kind==="string"}function zp(e){return e.as??e.url.name}function Sh(e){let t=zp(e);return t&&`@${t}`}function sa(e,t){if(e.url.name&&t===`@${e.url.name}`)return Sh(e).substring(1);let n=e.imports.find((i)=>i.name===t),r=n?.as??n?.name??Dh(zp(e),t);return r.startsWith("@")?r.substring(1):r}function Dh(e,t){if(e?.length){if(t.startsWith("@"))return`@${e}__${t.substring(1)}`;return`${e}__${t}`}return t}function Xp(e){let t=[];for(let n of e.definitions)if(n.kind===Rt||n.kind===Ye){let i=n.directives?.filter((a)=>a.name.value==="link")?.map((a)=>Oh(a.arguments??[])).filter((a)=>a!==void 0)??[];t=t.concat(i);let s=n.directives?.filter(({name:a})=>a.value==="core")?.map((a)=>Ah(a.arguments??[])).filter((a)=>a!==void 0);if(s)t=t.concat(...s)}return t}function Oh(e){let t,n=[],r;for(let i of e)switch(i.name.value){case"url":{if(i.value.kind===Ie)t=Zp(i.value.value);break}case"import":{n=xh(i.value);break}case"as":{if(i.value.kind===Ie)r=i.value.value??void 0;break}default:}if(t!==void 0)return{url:t,as:r,imports:n}}function Ah(e){let t=e.find(({name:n,value:r})=>n.value==="feature"&&r.kind===Ie);if(t)return{url:Zp(t.value.value),imports:[]}}function xh(e){if(e.kind===Ae)return e.values.map((n)=>{let r;if(n.kind===Ie)r={name:n.value};else if(n.kind===Ve){let i="",o;for(let s of n.fields)if(s.name.value==="name"){if(s.value.kind===Ie)i=s.value.value}else if(s.name.value==="as"){if(s.value.kind===Ie)o=s.value.value}r={name:i,as:o}}return r}).filter((n)=>n!==void 0);return[]}var wh=/v(\d{1,3})\.(\d{1,4})/i;function Zp(e){let t=new URL(e),n=t.pathname.split("/").filter(Boolean),r=n[n.length-1];if(r){if(wh.test(r)){let i=n[n.length-2];return{identity:t.origin+(i?`/${n.slice(0,n.length-1).join("/")}`:""),name:i??null,version:r}}return{identity:`${t.origin}/${n.join("/")}`,name:r,version:null}}return{identity:t.origin,name:null,version:null}}function xu(e,t){Hs();let n={kind:jt,definitions:Rh(e,{useSchemaDefinition:!0,forceSchemaDefinition:!1,throwOnConflict:!1,commentDescriptions:!1,...t})},r;if(t?.commentDescriptions)r=bp(n);else r=n;return Hs(),r}function Jr(e,t,n=[],r=[],i=new Set,o=new Set){let s=(a)=>{o.add(a)};if(e&&!i.has(e))if(i.add(e),typeof e==="function")Jr(e(),t,n,r,i,o);else if(Array.isArray(e))for(let a of e)Jr(a,t,n,r,i,o);else if(rr(e)){let a=hp(e,t);Jr(a.definitions,t,n,r,i,o)}else if(jp(e)||Bp(e)){let a=bt(e,t);Jr(a.definitions,t,n,r,i,o)}else if(typeof e==="object"&&Qo(e)){let a=Xp({definitions:[e],kind:jt}),u="https://specs.apollo.dev/federation",c="https://specs.apollo.dev/link",l=a.find((f)=>f.url.identity==="https://specs.apollo.dev/federation");if(l)s(sa(l,"@composeDirective")),s(sa(l,"@key"));let p=a.find((f)=>f.url.identity==="https://specs.apollo.dev/link");if(p)s(sa(p,"@link"));if(e.kind===pt)n.push(e);else r.push(e)}else if(kp(e))Jr(e.definitions,t,n,r,i,o);else throw Error(`typeDefs must contain only strings, documents, schemas, or functions, got ${typeof e}`);return{allDirectives:n,allNodes:r,repeatableLinkImports:o}}function Rh(e,t){Hs();let{allDirectives:n,allNodes:r,repeatableLinkImports:i}=Jr(e,t),o=Au(n,t);t.repeatableLinkImports=i;let s=Au(r,t,o);if(t?.useSchemaDefinition){let u=s[hr]||{kind:Ye,operationTypes:[]},c=u,l=c.operationTypes??=[];for(let p in oa)if(!l.find((d)=>d.operation===p)){let d=oa[p],E=s[d];if(E!=null&&E.name!=null)l.push({kind:si,type:{kind:Sn,name:E.name},operation:p})}if(u?.operationTypes?.length!=null&&u.operationTypes.length>0)s[hr]=u}if(t?.forceSchemaDefinition&&!s[hr]?.operationTypes?.length)s[hr]={kind:Ye,operationTypes:[{kind:si,operation:"query",type:{kind:Sn,name:{kind:Ne,value:"Query"}}}]};let a=Object.values(s);if(t?.sort){let u=typeof t.sort==="function"?t.sort:Qp;a.sort((c,l)=>u(c.name?.value,l.name?.value))}return a}var Lh={respectArrays:!0,respectSymbols:{enumerable:!0,nonEnumerable:!0}};function Wr(e,t){if(!e||!t||t===e.extensions)return;if(!e.extensions){e.extensions=t;return}e.extensions=ra([e.extensions,t],Lh)}function ef(e,t){Wr(e,t.schemaExtensions);for(let[n,r]of Object.entries(t.types||{})){let i=e.getType(n);if(i){if(Wr(i,r.extensions),r.type==="object"||r.type==="interface")for(let[o,s]of Object.entries(r.fields)){let a=i.getFields()[o];if(a){Wr(a,s.extensions);for(let[u,c]of Object.entries(s.arguments))Wr(a.args.find((l)=>l.name===u),c)}}else if(r.type==="input")for(let[o,s]of Object.entries(r.fields)){let a=i.getFields()[o];Wr(a,s.extensions)}else if(r.type==="enum")for(let[o,s]of Object.entries(r.values)){let a=i.getValue(o);Wr(a,s)}}}return e}function tf(e,t){Zi(e,{[Q.ABSTRACT_TYPE]:(n)=>{if(!n.resolveType){let r=`Type "${n.name}" is missing a "__resolveType" resolver. Pass 'ignore' into "resolverValidationOptions.requireResolversForResolveType" to disable this error.`;if(t==="error")throw Error(r);if(t==="warn")console.warn(r)}return}})}function nf(e,t){let n={},r=e.getTypeMap();for(let i in r){let o=r[i];if("getInterfaces"in o){n[i]={};for(let a of o.getInterfaces())if(t[a.name]){for(let u in t[a.name])if(u==="__isTypeOf"||!u.startsWith("__"))n[i][u]=t[a.name][u]}let s=t[i];n[i]={...n[i],...s}}else{let s=t[i];if(s!=null)n[i]=s}}return n}function rf({schema:e,resolvers:t,defaultFieldResolver:n,resolverValidationOptions:r={},inheritResolversFromInterfaces:i=!1,updateResolversInPlace:o=!1}){let{requireResolversToMatchSchema:s="error",requireResolversForResolveType:a}=r,u=i?nf(e,t):t;for(let c in u){let l=u[c];if(typeof l!=="object")throw Error(`"${c}" defined in resolvers, but has invalid value "${l}". The resolver's value must be of type object.`);let f=e.getType(c);if(f==null){let d=`"${c}" defined in resolvers, but not in schema`;if(s&&s!=="error"){if(s==="warn")console.warn(d);continue}throw Error(d)}else if(Ze(f))for(let d in l)if(d.startsWith("__"))Hr(f,d.substring(2),l[d]);else Hr(f,d,l[d]);else if(z(f)){let d=f.getValues();for(let E in l)if(!E.startsWith("__")&&!d.some((I)=>I.name===E)&&s&&s!=="ignore"){let I=`${f.name}.${E} was defined in resolvers, but not present within ${f.name}`;if(s==="error")throw Error(I);else console.warn(I)}}else if(te(f)){for(let d in l)if(!d.startsWith("__")&&s&&s!=="ignore"){let E=`${f.name}.${d} was defined in resolvers, but ${f.name} is not an object or interface type`;if(s==="error")throw Error(E);else console.warn(E)}}else if(L(f)||P(f)){for(let d in l)if(!d.startsWith("__"))if(f.getFields()[d]==null){if(s&&s!=="ignore"){let S=`${c}.${d} defined in resolvers, but not in schema`;if(s==="error")throw Error(S);else console.error(S)}}else{let S=l[d];if(typeof S!=="function"&&typeof S!=="object")throw Error(`Resolver ${c}.${d} must be object or function`)}}}if(e=o?Fh(e,u,n):Ch(e,u,n),a&&a!=="ignore")tf(e,a);return e}var kh={serialize:"coerceOutputValue",parseValue:"coerceInputValue"};function Hr(e,t,n){e[t]=n;let r=kh[t];if(r)e[r]=n}function Fh(e,t,n){let r=e.getTypeMap();for(let i in t){let o=e.getType(i),s=t[i];if(ae(o))for(let a in s)if(a.startsWith("__"))Hr(o,a.substring(2),s[a]);else if(a==="astNode"&&o.astNode!=null)o.astNode={...o.astNode,description:s?.astNode?.description??o.astNode.description,directives:(o.astNode.directives??[]).concat(s?.astNode?.directives??[])};else if(a==="extensionASTNodes"&&o.extensionASTNodes!=null)o.extensionASTNodes=o.extensionASTNodes.concat(s?.extensionASTNodes??[]);else if(a==="extensions"&&o.extensions!=null&&s.extensions!=null)o.extensions=Object.assign(Object.create(null),o.extensions,s.extensions);else Hr(o,a,s[a]);else if(z(o)){let a=o.toConfig(),u=a.values;for(let c in s)if(c.startsWith("__"))a[c.substring(2)]=s[c];else if(c==="astNode"&&a.astNode!=null)a.astNode={...a.astNode,description:s?.astNode?.description??a.astNode.description,directives:(a.astNode.directives??[]).concat(s?.astNode?.directives??[])};else if(c==="extensionASTNodes"&&a.extensionASTNodes!=null)a.extensionASTNodes=a.extensionASTNodes.concat(s?.extensionASTNodes??[]);else if(c==="extensions"&&o.extensions!=null&&s.extensions!=null)o.extensions=Object.assign(Object.create(null),o.extensions,s.extensions);else if(u[c])u[c].value=s[c];r[i]=new we(a)}else if(te(o)){for(let a in s)if(a.startsWith("__"))o[a.substring(2)]=s[a]}else if(L(o)||P(o))for(let a in s){if(a.startsWith("__")){o[a.substring(2)]=s[a];continue}let c=o.getFields()[a];if(c!=null){let l=s[a];if(typeof l==="function")c.resolve=l.bind(s);else of(c,l)}}}if(vu(e,Xs),Rp(e),vu(e,Zs),n!=null)na(e,(i)=>{if(!i.resolve)i.resolve=n});return e}function Ch(e,t,n){if(e=Zi(e,{[Q.SCALAR_TYPE]:(r)=>{let i=r.toConfig(),o=t[r.name];if(!Ze(r)&&o!=null){let s=["parseValue","coerceInputValue"].some((u)=>(u in o)||(`__${u}`in o)),a=["parseLiteral","coerceInputLiteral"].some((u)=>(u in o)||(`__${u}`in o));for(let u in o)if(u.startsWith("__"))Hr(i,u.substring(2),o[u]);else if(u==="astNode"&&i.astNode!=null)i.astNode={...i.astNode,description:o?.astNode?.description??i.astNode.description,directives:(i.astNode.directives??[]).concat(o?.astNode?.directives??[])};else if(u==="extensionASTNodes"&&i.extensionASTNodes!=null)i.extensionASTNodes=i.extensionASTNodes.concat(o?.extensionASTNodes??[]);else if(u==="extensions"&&i.extensions!=null&&o.extensions!=null)i.extensions=Object.assign(Object.create(null),r.extensions,o.extensions);else Hr(i,u,o[u]);if(s&&!a)delete i.parseLiteral;return new ke(i)}},[Q.ENUM_TYPE]:(r)=>{let i=t[r.name],o=r.toConfig(),s=o.values;if(i!=null){for(let a in i)if(a.startsWith("__"))o[a.substring(2)]=i[a];else if(a==="astNode"&&o.astNode!=null)o.astNode={...o.astNode,description:i?.astNode?.description??o.astNode.description,directives:(o.astNode.directives??[]).concat(i?.astNode?.directives??[])};else if(a==="extensionASTNodes"&&o.extensionASTNodes!=null)o.extensionASTNodes=o.extensionASTNodes.concat(i?.extensionASTNodes??[]);else if(a==="extensions"&&o.extensions!=null&&i.extensions!=null)o.extensions=Object.assign(Object.create(null),r.extensions,i.extensions);else if(s[a])s[a].value=i[a];return new we(o)}},[Q.UNION_TYPE]:(r)=>{let i=t[r.name];if(i!=null){let o=r.toConfig();if(i.__resolveType)o.resolveType=i.__resolveType;return new it(o)}},[Q.OBJECT_TYPE]:(r)=>{let i=t[r.name];if(i!=null){let o=r.toConfig();if(i.__isTypeOf)o.isTypeOf=i.__isTypeOf;return new Ee(o)}},[Q.INTERFACE_TYPE]:(r)=>{let i=t[r.name];if(i!=null){let o=r.toConfig();if(i.__resolveType)o.resolveType=i.__resolveType;return new Me(o)}},[Q.COMPOSITE_FIELD]:(r,i,o)=>{let s=t[o];if(s!=null){let a=s[i];if(a!=null){let u={...r};if(typeof a==="function")u.resolve=a.bind(s);else of(u,a);return u}}}}),n!=null)e=Zi(e,{[Q.OBJECT_FIELD]:(r)=>({...r,resolve:r.resolve!=null?r.resolve:n})});return e}function of(e,t){for(let n in t)e[n]=t[n]}function sf(e,t={}){let{requireResolversForArgs:n,requireResolversForNonScalar:r,requireResolversForAllFields:i}=t;if(i&&(n||r))throw TypeError("requireResolversForAllFields takes precedence over the more specific assertions. Please configure either requireResolversForAllFields or requireResolversForArgs / requireResolversForNonScalar, but not a combination of them.");na(e,(o,s,a)=>{if(i)wu("requireResolversForAllFields",i,o,s,a);if(n&&o.args.length>0)wu("requireResolversForArgs",n,o,s,a);if(r!=="ignore"&&!ae(pe(o.type)))wu("requireResolversForNonScalar",r,o,s,a)})}function wu(e,t,n,r,i){if(!n.resolve){let o=`Resolver missing for "${r}.${i}". +To disable this validator, use: + resolverValidationOptions: { + ${e}: 'ignore' + }`;if(t==="error")throw Error(o);if(t==="warn")console.warn(o);return}if(typeof n.resolve!=="function")throw Error(`Resolver "${r}.${i}" must be a function`)}function Vh({typeDefs:e,resolvers:t={},resolverValidationOptions:n={},inheritResolversFromInterfaces:r=!1,updateResolversInPlace:i=!1,schemaExtensions:o,defaultFieldResolver:s,...a}){if(typeof n!=="object")throw Error("Expected `resolverValidationOptions` to be an object");if(!e)throw Error("Must provide typeDefs");let u;if(rr(e))u=e;else if(a?.commentDescriptions){let c=xu(e,{...a,commentDescriptions:!0});u=Ys(c,a)}else{let c=xu(e,a);u=Ki(c,a)}if(u=rf({schema:u,resolvers:bu(t),resolverValidationOptions:n,inheritResolversFromInterfaces:r,updateResolversInPlace:i,defaultFieldResolver:s}),Object.keys(n).length>0)sf(u,n);if(o)for(let c of Js(o))ef(u,c);return u}function ut(e){if(e===null)return"null";if(Array.isArray(e))return"array";return typeof e}function rn(e){return ut(e)==="object"}function af(e){return typeof Object(e)[Symbol.asyncIterator]==="function"}function aa(e){return rn(e)&&typeof Object(e)[Symbol.asyncIterator]==="function"&&typeof e.return==="function"}function Mh(e){return Array.isArray(e)&&e.length>0&&e.every((t)=>("message"in t))}var uf="graphql-transport-ws";var vn=((e)=>(e[e.InternalServerError=4500]="InternalServerError",e[e.InternalClientError=4005]="InternalClientError",e[e.BadRequest=4400]="BadRequest",e[e.BadResponse=4004]="BadResponse",e[e.Unauthorized=4401]="Unauthorized",e[e.Forbidden=4403]="Forbidden",e[e.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",e[e.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",e[e.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",e[e.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",e[e.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests",e))(vn||{}),ct=((e)=>(e.ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete",e))(ct||{});function cf(e){if(!rn(e))throw Error(`Message is expected to be an object, but got ${ut(e)}`);if(!e.type)throw Error("Message is missing the 'type' property");if(typeof e.type!=="string")throw Error(`Message is expects the 'type' property to be a string, but got ${ut(e.type)}`);switch(e.type){case"connection_init":case"connection_ack":case"ping":case"pong":{if(e.payload!=null&&!rn(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break}case"subscribe":{if(typeof e.id!=="string")throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${ut(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!rn(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${ut(e.payload)}`);if(typeof e.payload.query!=="string")throw Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${ut(e.payload.query)}`);if(e.payload.variables!=null&&!rn(e.payload.variables))throw Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${ut(e.payload.variables)}`);if(e.payload.operationName!=null&&ut(e.payload.operationName)!=="string")throw Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${ut(e.payload.operationName)}`);if(e.payload.extensions!=null&&!rn(e.payload.extensions))throw Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${ut(e.payload.extensions)}`);break}case"next":{if(typeof e.id!=="string")throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${ut(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!rn(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${ut(e.payload)}`);break}case"error":{if(typeof e.id!=="string")throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${ut(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!Mh(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break}case"complete":{if(typeof e.id!=="string")throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${ut(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);break}default:throw Error(`Invalid message 'type' property "${e.type}"`)}return e}function lf(e,t){return cf(typeof e==="string"?JSON.parse(e,t):e)}function zr(e,t){return cf(e),JSON.stringify(e,t)}function pf(e){let{schema:t,context:n,roots:r,parse:i,validate:o,execute:s,subscribe:a,connectionInitWaitTimeout:u=3000,onConnect:c,onDisconnect:l,onPing:p,onPong:f,onClose:d,onSubscribe:E,onOperation:I,onNext:S,onError:G,onComplete:Z,jsonMessageReviver:W,jsonMessageReplacer:H}=e;return{opened(Y,ne){let b={connectionInitReceived:!1,acknowledged:!1,subscriptions:Object.create(null),extra:ne};if(Y.protocol!==uf)return Y.close(vn.SubprotocolNotAcceptable,"Subprotocol not acceptable"),async(h,D)=>{await d?.(b,h,D)};let A=u>0&&isFinite(u)?setTimeout(()=>{if(!b.connectionInitReceived)Y.close(vn.ConnectionInitialisationTimeout,"Connection initialisation timeout")},u):null;return Y.onMessage(async function(D){let R;try{R=lf(D,W)}catch(q){return Y.close(vn.BadRequest,"Invalid message received")}switch(R.type){case ct.ConnectionInit:{if(b.connectionInitReceived)return Y.close(vn.TooManyInitialisationRequests,"Too many initialisation requests");if(b.connectionInitReceived=!0,rn(R.payload))b.connectionParams=R.payload;let q=await c?.(b);if(q===!1)return Y.close(vn.Forbidden,"Forbidden");b.acknowledged=!0,await Y.send(zr(rn(q)?{type:ct.ConnectionAck,payload:q}:{type:ct.ConnectionAck},H));return}case ct.Ping:{if(await p?.(b,R.payload),Y.onPing)return await Y.onPing(R.payload);await Y.send(zr(R.payload?{type:ct.Pong,payload:R.payload}:{type:ct.Pong},H));return}case ct.Pong:return await f?.(b,R.payload),await Y.onPong?.(R.payload);case ct.Subscribe:{if(!b.acknowledged)return Y.close(vn.Unauthorized,"Unauthorized");let{id:q,payload:ce}=R;if(q in b.subscriptions)return Y.close(vn.SubscriberAlreadyExists,`Subscriber for ${q} already exists`);b.subscriptions[q]=null;let Ue={next:async(v,{id:O,payload:N},g)=>{let{errors:_,...B}=v,X=await S?.(b,O,N,g,v);await Y.send(zr({id:O,type:ct.Next,payload:X||{...B,..._?{errors:_.map((he)=>he.toJSON())}:{}}},H))},error:async(v,{id:O,payload:N})=>{let g=await G?.(b,O,N,v);await Y.send(zr({id:O,type:ct.Error,payload:g||v.map((_)=>_.toJSON())},H))},complete:async(v,{id:O,payload:N})=>{if(await Z?.(b,O,N),v)await Y.send(zr({id:O,type:ct.Complete},H))}};try{let v,O=await E?.(b,R.id,R.payload);if(O){if(ff(O))return q in b.subscriptions?await Ue.error(O,R):void 0;else if(Array.isArray(O))throw Error("Invalid return value from onSubscribe hook, expected an array of GraphQLError objects");v=O}else{if(!t)throw Error("The GraphQL schema is not provided");let B={operationName:ce.operationName,document:(i??bt)(ce.query),variableValues:ce.variables};v={...B,schema:typeof t==="function"?await t(b,q,ce,B):t};let X=(o??Lr)(v.schema,v.document);if(X.length>0)return q in b.subscriptions?await Ue.error(X,R):void 0}let N=Fr(v.document,v.operationName);if(!N)return q in b.subscriptions?await Ue.error([new m("Unable to identify operation")],R):void 0;if(!("rootValue"in v))v.rootValue=r?.[N.operation];if(!("contextValue"in v))v.contextValue=typeof n==="function"?await n(b,q,ce,v):n;let g;if(N.operation==="subscription")g=await(a??Pr)(v);else g=await(s??Ur)(v);let _=await I?.(b,q,ce,v,g);if(_)g=_;if(af(g))if(!(q in b.subscriptions)){if(aa(g))g.return(void 0)}else{b.subscriptions[q]=g;try{for await(let B of g)await Ue.next(B,R,v)}catch(B){let X=B instanceof Error?B:Error(String(B));await Ue.error([ro.major>=17?new m(X.message,{cause:X}):ro.major>=16?new m(X.message,{originalError:X}):new m(X.message,null,null,null,null,X)],R),delete b.subscriptions[q]}}else if(q in b.subscriptions)await Ue.next(g,R,v);await Ue.complete(q in b.subscriptions,R)}finally{delete b.subscriptions[q]}return}case ct.Complete:{let q=b.subscriptions[R.id];if(delete b.subscriptions[R.id],aa(q))await q.return(void 0);return}default:throw Error(`Unexpected message of type ${R.type} received`)}}),async(h,D)=>{if(A)clearTimeout(A);let R={...b.subscriptions};if(b.subscriptions=Object.create(null),await Promise.all(Object.values(R).filter(aa).map((q)=>q.return(void 0))),b.acknowledged)await l?.(b,h,D);await d?.(b,h,D)}}}}function ff(e){return Array.isArray(e)&&e.length>0&&e.every((t)=>t instanceof m)}export{Bi as AbortedGraphQLExecutionError,Wn as BREAK,Se as BreakingChangeType,yi as DEFAULT_DEPRECATION_REASON,at as DangerousChangeType,$o as DeferStreamDirectiveLabelRule,Go as DeferStreamDirectiveOnRootFieldRule,jo as DeferStreamDirectiveOnValidOperationsRule,F as DirectiveLocation,qo as ExecutableDefinitionsRule,Ko as FieldsOnCorrectTypeRule,Jo as FragmentsOnCompositeTypesRule,er as GRAPHQL_MAX_INT,tr as GRAPHQL_MIN_INT,ge as GraphQLBoolean,Xt as GraphQLDeferDirective,mn as GraphQLDeprecatedDirective,Re as GraphQLDirective,we as GraphQLEnumType,m as GraphQLError,Ir as GraphQLFloat,Rn as GraphQLID,Ln as GraphQLIncludeDirective,Ge as GraphQLInputObjectType,wn as GraphQLInt,Me as GraphQLInterfaceType,oe as GraphQLList,V as GraphQLNonNull,Ee as GraphQLObjectType,Ni as GraphQLOneOfDirective,ke as GraphQLScalarType,ot as GraphQLSchema,kn as GraphQLSkipDirective,gi as GraphQLSpecifiedByDirective,vt as GraphQLStreamDirective,ie as GraphQLString,it as GraphQLUnionType,C as Kind,Wo as KnownArgumentNamesRule,Fi as KnownDirectivesRule,Ho as KnownFragmentNamesRule,zo as KnownOperationTypesRule,Ci as KnownTypeNamesRule,ar as Lexer,ei as Location,Xo as LoneAnonymousOperationRule,Zo as LoneSchemaDefinitionRule,es as MaxIntrospectionDepthRule,Ul as NoDeprecatedCustomRule,ts as NoFragmentCyclesRule,Pl as NoSchemaIntrospectionCustomRule,ns as NoUndefinedVariablesRule,rs as NoUnusedFragmentsRule,is as NoUnusedVariablesRule,re as OperationTypeNode,us as OverlappingFieldsCanBeMergedRule,cs as PossibleFragmentSpreadsRule,ls as PossibleTypeExtensionsRule,ps as ProvidedRequiredArgumentsRule,_e as SafeChangeType,fs as ScalarLeafsRule,Ii as SchemaMetaFieldDef,hs as SingleFieldSubscriptionsRule,Pt as Source,Es as StreamDirectiveOnListFieldRule,bn as Token,T as TokenKind,ur as TypeInfo,ue as TypeKind,vi as TypeMetaFieldDef,bi as TypeNameMetaFieldDef,Ts as UniqueArgumentDefinitionNamesRule,Pi as UniqueArgumentNamesRule,ys as UniqueDirectiveNamesRule,$i as UniqueDirectivesPerLocationRule,gs as UniqueEnumValueNamesRule,Ns as UniqueFieldDefinitionNamesRule,Is as UniqueFragmentNamesRule,Gi as UniqueInputFieldNamesRule,vs as UniqueOperationNamesRule,bs as UniqueOperationTypesRule,_s as UniqueTypeNamesRule,Ss as UniqueVariableNamesRule,ji as ValidationContext,Ds as ValuesOfCorrectTypeRule,Os as VariablesAreInputTypesRule,As as VariablesInAllowedPositionRule,Ao as __Directive,xo as __DirectiveLocation,Ro as __EnumValue,wo as __Field,_r as __InputValue,br as __Schema,mt as __Type,Lo as __TypeKind,yc as assertAbstractType,Zu as assertArgument,Tc as assertCompositeType,wc as assertDirective,ic as assertEnumType,sc as assertEnumValue,Io as assertEnumValueName,zu as assertField,lc as assertInputField,uc as assertInputObjectType,hc as assertInputType,_o as assertInterfaceType,It as assertLeafType,fc as assertListType,He as assertName,Nc as assertNamedType,mc as assertNonNullType,So as assertNullableType,bo as assertObjectType,Ec as assertOutputType,Wu as assertScalarType,Sr as assertSchema,Ku as assertType,nc as assertUnionType,Dr as assertValidSchema,gc as assertWrappingType,Fn as astFromValue,Ki as buildASTSchema,Gl as buildClientSchema,Ys as buildSchema,yn as coerceInputLiteral,Tn as coerceInputValue,Xl as concatAST,iu as createSourceEventStream,Us as defaultFieldResolver,au as defaultHarness,su as defaultTypeResolver,mi as doTypesOverlap,Af as enableDevMode,Ur as execute,tu as executeRootSelectionSet,ru as executeSubscriptionEvent,$s as executeSync,eu as experimentalExecuteIncrementally,nu as experimentalExecuteRootSelectionSet,jl as extendSchema,sp as findBreakingChanges,ap as findDangerousChanges,Ks as findSchemaChanges,_t as getArgumentValues,Zt as getDirectiveValues,Hn as getEnterLeaveForKind,Bs as getIntrospectionQuery,Yn as getLocation,pe as getNamedType,gr as getNullableType,Fr as getOperationAST,Mi as getVariableValues,tm as graphql,nm as graphqlSync,$l as introspectionFromSchema,Mt as introspectionTypes,Ke as isAbstractType,li as isArgument,dt as isCompositeType,Bo as isConstValueNode,Qo as isDefinitionNode,xf as isDevModeEnabled,nr as isDirective,z as isEnumType,ma as isEnumValue,Nr as isEqualType,wi as isExecutableDefinitionNode,da as isField,ha as isInputField,k as isInputObjectType,xe as isInputType,P as isInterfaceType,ht as isIntrospectionType,ve as isLeafType,j as isListType,rt as isNamedType,w as isNonNullType,pi as isNullableType,L as isObjectType,Nt as isOutputType,ze as isRequiredArgument,Xe as isRequiredInputField,ae as isScalarType,rr as isSchema,Xc as isSchemaCoordinateNode,Hc as isSelectionNode,Vt as isSpecifiedDirective,Ze as isSpecifiedScalarType,Yo as isSubscriptionOperationDefinitionNode,yr as isType,En as isTypeDefinitionNode,ki as isTypeExtensionNode,zc as isTypeNode,Ht as isTypeSubTypeOf,Ri as isTypeSystemDefinitionNode,Li as isTypeSystemExtensionNode,te as isUnionType,xa as isValueNode,On as isWrappingType,Ml as legacyExecuteIncrementally,cu as legacyExecuteRootSelectionSet,Bl as lexicographicSortSchema,en as locatedError,Vh as makeExecutableSchema,pf as makeServer,Ps as mapSourceToResponseEvent,bt as parse,Uo as parseConstValue,Po as parseSchemaCoordinate,qc as parseType,Yc as parseValue,ee as print,hu as printDirective,ql as printIntrospectionSchema,so as printLocation,Yl as printSchema,Zr as printSourceLocation,du as printType,Ga as recommendedRules,dn as replaceVariables,Eu as resolveASTSchemaCoordinate,fi as resolveObjMapThunk,Do as resolveReadonlyArrayThunk,up as resolveSchemaCoordinate,fe as responsePathAsArray,ep as separateOperations,je as specifiedDirectives,xs as specifiedRules,Ct as specifiedScalarTypes,np as stripIgnoredCharacters,Pr as subscribe,de as syntaxError,Te as typeFromAST,Lr as validate,fr as validateExecutionArgs,xn as validateInputLiteral,Zn as validateInputValue,Di as validateSchema,ou as validateSubscriptionArgs,Pn as valueFromAST,Wt as valueFromASTUntyped,zt as valueToLiteral,Nf as version,ro as versionInfo,ft as visit,ui as visitInParallel,xr as visitWithTypeInfo}; |