diff --git a/composition-go/index.global.js b/composition-go/index.global.js index b202ad9013..ed8576263b 100644 --- a/composition-go/index.global.js +++ b/composition-go/index.global.js @@ -11,17 +11,17 @@ class URL { } } } -"use strict";var shim=(()=>{var bC=Object.create;var fl=Object.defineProperty,_C=Object.defineProperties,OC=Object.getOwnPropertyDescriptor,SC=Object.getOwnPropertyDescriptors,DC=Object.getOwnPropertyNames,kO=Object.getOwnPropertySymbols,AC=Object.getPrototypeOf,PO=Object.prototype.hasOwnProperty,wC=Object.prototype.propertyIsEnumerable;var Qt=Math.pow,MT=(e,t,n)=>t in e?fl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,D=(e,t)=>{for(var n in t||(t={}))PO.call(t,n)&&MT(e,n,t[n]);if(kO)for(var n of kO(t))wC.call(t,n)&&MT(e,n,t[n]);return e},x=(e,t)=>_C(e,SC(t));var Y=(e,t)=>()=>(e&&(t=e(e=0)),t);var F=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ml=(e,t)=>{for(var n in t)fl(e,n,{get:t[n],enumerable:!0})},xO=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of DC(t))!PO.call(e,i)&&i!==n&&fl(e,i,{get:()=>t[i],enumerable:!(r=OC(t,i))||r.enumerable});return e};var Lf=(e,t,n)=>(n=e!=null?bC(AC(e)):{},xO(t||!e||!e.__esModule?fl(n,"default",{value:e,enumerable:!0}):n,e)),Te=e=>xO(fl({},"__esModule",{value:!0}),e);var S=(e,t,n)=>(MT(e,typeof t!="symbol"?t+"":t,n),n);var Wt=(e,t,n)=>new Promise((r,i)=>{var o=c=>{try{a(n.next(c))}catch(u){i(u)}},s=c=>{try{a(n.throw(c))}catch(u){i(u)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,s);a((n=n.apply(e,t)).next())});var d=Y(()=>{"use strict"});var g={};ml(g,{_debugEnd:()=>b0,_debugProcess:()=>I0,_events:()=>j0,_eventsCount:()=>V0,_exiting:()=>r0,_fatalExceptions:()=>E0,_getActiveHandles:()=>a0,_getActiveRequests:()=>s0,_kill:()=>c0,_linkedBinding:()=>t0,_maxListeners:()=>U0,_preload_modules:()=>x0,_rawDebug:()=>ZO,_startProfilerIdleNotifier:()=>_0,_stopProfilerIdleNotifier:()=>O0,_tickCallback:()=>v0,abort:()=>w0,addListener:()=>$0,allowedNodeEnvironmentFlags:()=>h0,arch:()=>VO,argv:()=>qO,argv0:()=>P0,assert:()=>y0,binding:()=>JO,chdir:()=>HO,config:()=>i0,cpuUsage:()=>Pf,cwd:()=>XO,debugPort:()=>k0,default:()=>X0,dlopen:()=>o0,domain:()=>n0,emit:()=>Q0,emitWarning:()=>YO,env:()=>GO,execArgv:()=>BO,execPath:()=>F0,exit:()=>f0,features:()=>T0,hasUncaughtExceptionCaptureCallback:()=>g0,hrtime:()=>kf,kill:()=>d0,listeners:()=>z0,memoryUsage:()=>p0,moduleLoadList:()=>e0,nextTick:()=>MO,off:()=>q0,on:()=>Po,once:()=>G0,openStdin:()=>m0,pid:()=>R0,platform:()=>$O,ppid:()=>L0,prependListener:()=>Y0,prependOnceListener:()=>J0,reallyExit:()=>u0,release:()=>WO,removeAllListeners:()=>K0,removeListener:()=>B0,resourceUsage:()=>l0,setSourceMapsEnabled:()=>C0,setUncaughtExceptionCaptureCallback:()=>N0,stderr:()=>D0,stdin:()=>A0,stdout:()=>S0,title:()=>jO,umask:()=>zO,uptime:()=>M0,version:()=>KO,versions:()=>QO});function VT(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function RC(){!ku||!Aa||(ku=!1,Aa.length?ko=Aa.concat(ko):Ff=-1,ko.length&&CO())}function CO(){if(!ku){var e=setTimeout(RC,0);ku=!0;for(var t=ko.length;t;){for(Aa=ko,ko=[];++Ff1)for(var n=1;n{"use strict";d();m();f();ko=[],ku=!1,Ff=-1;UO.prototype.run=function(){this.fun.apply(null,this.array)};jO="browser",VO="x64",$O="browser",GO={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},qO=["/usr/bin/node"],BO=[],KO="v16.8.0",QO={},YO=function(e,t){console.warn((t?t+": ":"")+e)},JO=function(e){VT("binding")},zO=function(e){return 0},XO=function(){return"/"},HO=function(e){},WO={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};ZO=Zn,e0=[];n0={},r0=!1,i0={};u0=Zn,c0=Zn,Pf=function(){return{}},l0=Pf,p0=Pf,d0=Zn,f0=Zn,m0=Zn,h0={};T0={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},E0=Zn,N0=Zn;v0=Zn,I0=Zn,b0=Zn,_0=Zn,O0=Zn,S0=void 0,D0=void 0,A0=void 0,w0=Zn,R0=2,L0=1,F0="/bin/usr/node",k0=9229,P0="node",x0=[],C0=Zn,Qs={now:typeof performance!="undefined"?performance.now.bind(performance):void 0,timing:typeof performance!="undefined"?performance.timing:void 0};Qs.now===void 0&&(UT=Date.now(),Qs.timing&&Qs.timing.navigationStart&&(UT=Qs.timing.navigationStart),Qs.now=()=>Date.now()-UT);jT=1e9;kf.bigint=function(e){var t=kf(e);return typeof BigInt=="undefined"?t[0]*jT+t[1]:BigInt(t[0]*jT)+BigInt(t[1])};U0=10,j0={},V0=0;$0=Po,G0=Po,q0=Po,B0=Po,K0=Po,Q0=Zn,Y0=Po,J0=Po;X0={version:KO,versions:QO,arch:VO,platform:$O,release:WO,_rawDebug:ZO,moduleLoadList:e0,binding:JO,_linkedBinding:t0,_events:j0,_eventsCount:V0,_maxListeners:U0,on:Po,addListener:$0,once:G0,off:q0,removeListener:B0,removeAllListeners:K0,emit:Q0,prependListener:Y0,prependOnceListener:J0,listeners:z0,domain:n0,_exiting:r0,config:i0,dlopen:o0,uptime:M0,_getActiveRequests:s0,_getActiveHandles:a0,reallyExit:u0,_kill:c0,cpuUsage:Pf,resourceUsage:l0,memoryUsage:p0,kill:d0,exit:f0,openStdin:m0,allowedNodeEnvironmentFlags:h0,assert:y0,features:T0,_fatalExceptions:E0,setUncaughtExceptionCaptureCallback:N0,hasUncaughtExceptionCaptureCallback:g0,emitWarning:YO,nextTick:MO,_tickCallback:v0,_debugProcess:I0,_debugEnd:b0,_startProfilerIdleNotifier:_0,_stopProfilerIdleNotifier:O0,stdout:S0,stdin:A0,stderr:D0,abort:w0,umask:zO,chdir:HO,cwd:XO,env:GO,title:jO,argv:qO,execArgv:BO,pid:R0,ppid:L0,execPath:F0,debugPort:k0,hrtime:kf,argv0:P0,_preload_modules:x0,setSourceMapsEnabled:C0}});var f=Y(()=>{"use strict";H0()});function LC(){if(W0)return hl;W0=!0,hl.byteLength=a,hl.toByteArray=u,hl.fromByteArray=h;for(var e=[],t=[],n=typeof Uint8Array!="undefined"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=r.length;i0)throw new Error("Invalid string. Length must be a multiple of 4");var O=y.indexOf("=");O===-1&&(O=N);var w=O===N?0:4-O%4;return[O,w]}function a(y){var N=s(y),O=N[0],w=N[1];return(O+w)*3/4-w}function c(y,N,O){return(N+O)*3/4-O}function u(y){var N,O=s(y),w=O[0],M=O[1],W=new n(c(y,w,M)),K=0,te=M>0?w-4:w,pe;for(pe=0;pe>16&255,W[K++]=N>>8&255,W[K++]=N&255;return M===2&&(N=t[y.charCodeAt(pe)]<<2|t[y.charCodeAt(pe+1)]>>4,W[K++]=N&255),M===1&&(N=t[y.charCodeAt(pe)]<<10|t[y.charCodeAt(pe+1)]<<4|t[y.charCodeAt(pe+2)]>>2,W[K++]=N>>8&255,W[K++]=N&255),W}function l(y){return e[y>>18&63]+e[y>>12&63]+e[y>>6&63]+e[y&63]}function p(y,N,O){for(var w,M=[],W=N;Wte?te:K+W));return w===1?(N=y[O-1],M.push(e[N>>2]+e[N<<4&63]+"==")):w===2&&(N=(y[O-2]<<8)+y[O-1],M.push(e[N>>10]+e[N>>4&63]+e[N<<2&63]+"=")),M.join("")}return hl}function FC(){if(Z0)return xf;Z0=!0;return xf.read=function(e,t,n,r,i){var o,s,a=i*8-r-1,c=(1<>1,l=-7,p=n?i-1:0,h=n?-1:1,y=e[t+p];for(p+=h,o=y&(1<<-l)-1,y>>=-l,l+=a;l>0;o=o*256+e[t+p],p+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=s*256+e[t+p],p+=h,l-=8);if(o===0)o=1-u;else{if(o===c)return s?NaN:(y?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-u}return(y?-1:1)*s*Math.pow(2,o-r)},xf.write=function(e,t,n,r,i,o){var s,a,c,u=o*8-i-1,l=(1<>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=r?0:o-1,N=r?1:-1,O=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+p>=1?t+=h/c:t+=h*Math.pow(2,1-p),t*c>=2&&(s++,c/=2),s+p>=l?(a=0,s=l):s+p>=1?(a=(t*c-1)*Math.pow(2,i),s=s+p):(a=t*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;e[n+y]=a&255,y+=N,a/=256,i-=8);for(s=s<0;e[n+y]=s&255,y+=N,s/=256,u-=8);e[n+y-N]|=O*128},xf}function kC(){if(eS)return wa;eS=!0;let e=LC(),t=FC(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;wa.Buffer=s,wa.SlowBuffer=M,wa.INSPECT_MAX_BYTES=50;let r=2147483647;wa.kMaxLength=r,s.TYPED_ARRAY_SUPPORT=i(),!s.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{let _=new Uint8Array(1),T={foo:function(){return 42}};return Object.setPrototypeOf(T,Uint8Array.prototype),Object.setPrototypeOf(_,T),_.foo()===42}catch(_){return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(_){if(_>r)throw new RangeError('The value "'+_+'" is invalid for option "size"');let T=new Uint8Array(_);return Object.setPrototypeOf(T,s.prototype),T}function s(_,T,E){if(typeof _=="number"){if(typeof T=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return l(_)}return a(_,T,E)}s.poolSize=8192;function a(_,T,E){if(typeof _=="string")return p(_,T);if(ArrayBuffer.isView(_))return y(_);if(_==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof _);if(Vt(_,ArrayBuffer)||_&&Vt(_.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(Vt(_,SharedArrayBuffer)||_&&Vt(_.buffer,SharedArrayBuffer)))return N(_,T,E);if(typeof _=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let A=_.valueOf&&_.valueOf();if(A!=null&&A!==_)return s.from(A,T,E);let U=O(_);if(U)return U;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof _[Symbol.toPrimitive]=="function")return s.from(_[Symbol.toPrimitive]("string"),T,E);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof _)}s.from=function(_,T,E){return a(_,T,E)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function c(_){if(typeof _!="number")throw new TypeError('"size" argument must be of type number');if(_<0)throw new RangeError('The value "'+_+'" is invalid for option "size"')}function u(_,T,E){return c(_),_<=0?o(_):T!==void 0?typeof E=="string"?o(_).fill(T,E):o(_).fill(T):o(_)}s.alloc=function(_,T,E){return u(_,T,E)};function l(_){return c(_),o(_<0?0:w(_)|0)}s.allocUnsafe=function(_){return l(_)},s.allocUnsafeSlow=function(_){return l(_)};function p(_,T){if((typeof T!="string"||T==="")&&(T="utf8"),!s.isEncoding(T))throw new TypeError("Unknown encoding: "+T);let E=W(_,T)|0,A=o(E),U=A.write(_,T);return U!==E&&(A=A.slice(0,U)),A}function h(_){let T=_.length<0?0:w(_.length)|0,E=o(T);for(let A=0;A=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return _|0}function M(_){return+_!=_&&(_=0),s.alloc(+_)}s.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==s.prototype},s.compare=function(T,E){if(Vt(T,Uint8Array)&&(T=s.from(T,T.offset,T.byteLength)),Vt(E,Uint8Array)&&(E=s.from(E,E.offset,E.byteLength)),!s.isBuffer(T)||!s.isBuffer(E))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===E)return 0;let A=T.length,U=E.length;for(let Q=0,ee=Math.min(A,U);QU.length?(s.isBuffer(ee)||(ee=s.from(ee)),ee.copy(U,Q)):Uint8Array.prototype.set.call(U,ee,Q);else if(s.isBuffer(ee))ee.copy(U,Q);else throw new TypeError('"list" argument must be an Array of Buffers');Q+=ee.length}return U};function W(_,T){if(s.isBuffer(_))return _.length;if(ArrayBuffer.isView(_)||Vt(_,ArrayBuffer))return _.byteLength;if(typeof _!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof _);let E=_.length,A=arguments.length>2&&arguments[2]===!0;if(!A&&E===0)return 0;let U=!1;for(;;)switch(T){case"ascii":case"latin1":case"binary":return E;case"utf8":case"utf-8":return Fu(_).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E*2;case"hex":return E>>>1;case"base64":return dl(_).length;default:if(U)return A?-1:Fu(_).length;T=(""+T).toLowerCase(),U=!0}}s.byteLength=W;function K(_,T,E){let A=!1;if((T===void 0||T<0)&&(T=0),T>this.length||((E===void 0||E>this.length)&&(E=this.length),E<=0)||(E>>>=0,T>>>=0,E<=T))return"";for(_||(_="utf8");;)switch(_){case"hex":return _i(this,T,E);case"utf8":case"utf-8":return wn(this,T,E);case"ascii":return Sr(this,T,E);case"latin1":case"binary":return qi(this,T,E);case"base64":return jn(this,T,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return mr(this,T,E);default:if(A)throw new TypeError("Unknown encoding: "+_);_=(_+"").toLowerCase(),A=!0}}s.prototype._isBuffer=!0;function te(_,T,E){let A=_[T];_[T]=_[E],_[E]=A}s.prototype.swap16=function(){let T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let E=0;EE&&(T+=" ... "),""},n&&(s.prototype[n]=s.prototype.inspect),s.prototype.compare=function(T,E,A,U,Q){if(Vt(T,Uint8Array)&&(T=s.from(T,T.offset,T.byteLength)),!s.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(E===void 0&&(E=0),A===void 0&&(A=T?T.length:0),U===void 0&&(U=0),Q===void 0&&(Q=this.length),E<0||A>T.length||U<0||Q>this.length)throw new RangeError("out of range index");if(U>=Q&&E>=A)return 0;if(U>=Q)return-1;if(E>=A)return 1;if(E>>>=0,A>>>=0,U>>>=0,Q>>>=0,this===T)return 0;let ee=Q-U,at=A-E,fn=Math.min(ee,at),Ht=this.slice(U,Q),mn=T.slice(E,A);for(let $t=0;$t2147483647?E=2147483647:E<-2147483648&&(E=-2147483648),E=+E,hr(E)&&(E=U?0:_.length-1),E<0&&(E=_.length+E),E>=_.length){if(U)return-1;E=_.length-1}else if(E<0)if(U)E=0;else return-1;if(typeof T=="string"&&(T=s.from(T,A)),s.isBuffer(T))return T.length===0?-1:qe(_,T,E,A,U);if(typeof T=="number")return T=T&255,typeof Uint8Array.prototype.indexOf=="function"?U?Uint8Array.prototype.indexOf.call(_,T,E):Uint8Array.prototype.lastIndexOf.call(_,T,E):qe(_,[T],E,A,U);throw new TypeError("val must be string, number or Buffer")}function qe(_,T,E,A,U){let Q=1,ee=_.length,at=T.length;if(A!==void 0&&(A=String(A).toLowerCase(),A==="ucs2"||A==="ucs-2"||A==="utf16le"||A==="utf-16le")){if(_.length<2||T.length<2)return-1;Q=2,ee/=2,at/=2,E/=2}function fn(mn,$t){return Q===1?mn[$t]:mn.readUInt16BE($t*Q)}let Ht;if(U){let mn=-1;for(Ht=E;Htee&&(E=ee-at),Ht=E;Ht>=0;Ht--){let mn=!0;for(let $t=0;$tU&&(A=U)):A=U;let Q=T.length;A>Q/2&&(A=Q/2);let ee;for(ee=0;ee>>0,isFinite(A)?(A=A>>>0,U===void 0&&(U="utf8")):(U=A,A=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let Q=this.length-E;if((A===void 0||A>Q)&&(A=Q),T.length>0&&(A<0||E<0)||E>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");let ee=!1;for(;;)switch(U){case"hex":return st(this,T,E,A);case"utf8":case"utf-8":return ft(this,T,E,A);case"ascii":case"latin1":case"binary":return L(this,T,E,A);case"base64":return ne(this,T,E,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return mt(this,T,E,A);default:if(ee)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),ee=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function jn(_,T,E){return T===0&&E===_.length?e.fromByteArray(_):e.fromByteArray(_.slice(T,E))}function wn(_,T,E){E=Math.min(_.length,E);let A=[],U=T;for(;U239?4:Q>223?3:Q>191?2:1;if(U+at<=E){let fn,Ht,mn,$t;switch(at){case 1:Q<128&&(ee=Q);break;case 2:fn=_[U+1],(fn&192)===128&&($t=(Q&31)<<6|fn&63,$t>127&&(ee=$t));break;case 3:fn=_[U+1],Ht=_[U+2],(fn&192)===128&&(Ht&192)===128&&($t=(Q&15)<<12|(fn&63)<<6|Ht&63,$t>2047&&($t<55296||$t>57343)&&(ee=$t));break;case 4:fn=_[U+1],Ht=_[U+2],mn=_[U+3],(fn&192)===128&&(Ht&192)===128&&(mn&192)===128&&($t=(Q&15)<<18|(fn&63)<<12|(Ht&63)<<6|mn&63,$t>65535&&$t<1114112&&(ee=$t))}}ee===null?(ee=65533,at=1):ee>65535&&(ee-=65536,A.push(ee>>>10&1023|55296),ee=56320|ee&1023),A.push(ee),U+=at}return jr(A)}let ei=4096;function jr(_){let T=_.length;if(T<=ei)return String.fromCharCode.apply(String,_);let E="",A=0;for(;AA)&&(E=A);let U="";for(let Q=T;QA&&(T=A),E<0?(E+=A,E<0&&(E=0)):E>A&&(E=A),EE)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(T,E,A){T=T>>>0,E=E>>>0,A||Dt(T,E,this.length);let U=this[T],Q=1,ee=0;for(;++ee>>0,E=E>>>0,A||Dt(T,E,this.length);let U=this[T+--E],Q=1;for(;E>0&&(Q*=256);)U+=this[T+--E]*Q;return U},s.prototype.readUint8=s.prototype.readUInt8=function(T,E){return T=T>>>0,E||Dt(T,1,this.length),this[T]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(T,E){return T=T>>>0,E||Dt(T,2,this.length),this[T]|this[T+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(T,E){return T=T>>>0,E||Dt(T,2,this.length),this[T]<<8|this[T+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(T,E){return T=T>>>0,E||Dt(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(T,E){return T=T>>>0,E||Dt(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},s.prototype.readBigUInt64LE=Ks(function(T){T=T>>>0,Ke(T,"offset");let E=this[T],A=this[T+7];(E===void 0||A===void 0)&&Ut(T,this.length-8);let U=E+this[++T]*Qt(2,8)+this[++T]*Qt(2,16)+this[++T]*Qt(2,24),Q=this[++T]+this[++T]*Qt(2,8)+this[++T]*Qt(2,16)+A*Qt(2,24);return BigInt(U)+(BigInt(Q)<>>0,Ke(T,"offset");let E=this[T],A=this[T+7];(E===void 0||A===void 0)&&Ut(T,this.length-8);let U=E*Qt(2,24)+this[++T]*Qt(2,16)+this[++T]*Qt(2,8)+this[++T],Q=this[++T]*Qt(2,24)+this[++T]*Qt(2,16)+this[++T]*Qt(2,8)+A;return(BigInt(U)<>>0,E=E>>>0,A||Dt(T,E,this.length);let U=this[T],Q=1,ee=0;for(;++ee=Q&&(U-=Math.pow(2,8*E)),U},s.prototype.readIntBE=function(T,E,A){T=T>>>0,E=E>>>0,A||Dt(T,E,this.length);let U=E,Q=1,ee=this[T+--U];for(;U>0&&(Q*=256);)ee+=this[T+--U]*Q;return Q*=128,ee>=Q&&(ee-=Math.pow(2,8*E)),ee},s.prototype.readInt8=function(T,E){return T=T>>>0,E||Dt(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},s.prototype.readInt16LE=function(T,E){T=T>>>0,E||Dt(T,2,this.length);let A=this[T]|this[T+1]<<8;return A&32768?A|4294901760:A},s.prototype.readInt16BE=function(T,E){T=T>>>0,E||Dt(T,2,this.length);let A=this[T+1]|this[T]<<8;return A&32768?A|4294901760:A},s.prototype.readInt32LE=function(T,E){return T=T>>>0,E||Dt(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},s.prototype.readInt32BE=function(T,E){return T=T>>>0,E||Dt(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},s.prototype.readBigInt64LE=Ks(function(T){T=T>>>0,Ke(T,"offset");let E=this[T],A=this[T+7];(E===void 0||A===void 0)&&Ut(T,this.length-8);let U=this[T+4]+this[T+5]*Qt(2,8)+this[T+6]*Qt(2,16)+(A<<24);return(BigInt(U)<>>0,Ke(T,"offset");let E=this[T],A=this[T+7];(E===void 0||A===void 0)&&Ut(T,this.length-8);let U=(E<<24)+this[++T]*Qt(2,16)+this[++T]*Qt(2,8)+this[++T];return(BigInt(U)<>>0,E||Dt(T,4,this.length),t.read(this,T,!0,23,4)},s.prototype.readFloatBE=function(T,E){return T=T>>>0,E||Dt(T,4,this.length),t.read(this,T,!1,23,4)},s.prototype.readDoubleLE=function(T,E){return T=T>>>0,E||Dt(T,8,this.length),t.read(this,T,!0,52,8)},s.prototype.readDoubleBE=function(T,E){return T=T>>>0,E||Dt(T,8,this.length),t.read(this,T,!1,52,8)};function dn(_,T,E,A,U,Q){if(!s.isBuffer(_))throw new TypeError('"buffer" argument must be a Buffer instance');if(T>U||T_.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(T,E,A,U){if(T=+T,E=E>>>0,A=A>>>0,!U){let at=Math.pow(2,8*A)-1;dn(this,T,E,A,at,0)}let Q=1,ee=0;for(this[E]=T&255;++ee>>0,A=A>>>0,!U){let at=Math.pow(2,8*A)-1;dn(this,T,E,A,at,0)}let Q=A-1,ee=1;for(this[E+Q]=T&255;--Q>=0&&(ee*=256);)this[E+Q]=T/ee&255;return E+A},s.prototype.writeUint8=s.prototype.writeUInt8=function(T,E,A){return T=+T,E=E>>>0,A||dn(this,T,E,1,255,0),this[E]=T&255,E+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(T,E,A){return T=+T,E=E>>>0,A||dn(this,T,E,2,65535,0),this[E]=T&255,this[E+1]=T>>>8,E+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(T,E,A){return T=+T,E=E>>>0,A||dn(this,T,E,2,65535,0),this[E]=T>>>8,this[E+1]=T&255,E+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(T,E,A){return T=+T,E=E>>>0,A||dn(this,T,E,4,4294967295,0),this[E+3]=T>>>24,this[E+2]=T>>>16,this[E+1]=T>>>8,this[E]=T&255,E+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(T,E,A){return T=+T,E=E>>>0,A||dn(this,T,E,4,4294967295,0),this[E]=T>>>24,this[E+1]=T>>>16,this[E+2]=T>>>8,this[E+3]=T&255,E+4};function R(_,T,E,A,U){Nt(T,A,U,_,E,7);let Q=Number(T&BigInt(4294967295));_[E++]=Q,Q=Q>>8,_[E++]=Q,Q=Q>>8,_[E++]=Q,Q=Q>>8,_[E++]=Q;let ee=Number(T>>BigInt(32)&BigInt(4294967295));return _[E++]=ee,ee=ee>>8,_[E++]=ee,ee=ee>>8,_[E++]=ee,ee=ee>>8,_[E++]=ee,E}function J(_,T,E,A,U){Nt(T,A,U,_,E,7);let Q=Number(T&BigInt(4294967295));_[E+7]=Q,Q=Q>>8,_[E+6]=Q,Q=Q>>8,_[E+5]=Q,Q=Q>>8,_[E+4]=Q;let ee=Number(T>>BigInt(32)&BigInt(4294967295));return _[E+3]=ee,ee=ee>>8,_[E+2]=ee,ee=ee>>8,_[E+1]=ee,ee=ee>>8,_[E]=ee,E+8}s.prototype.writeBigUInt64LE=Ks(function(T,E=0){return R(this,T,E,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=Ks(function(T,E=0){return J(this,T,E,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(T,E,A,U){if(T=+T,E=E>>>0,!U){let fn=Math.pow(2,8*A-1);dn(this,T,E,A,fn-1,-fn)}let Q=0,ee=1,at=0;for(this[E]=T&255;++Q>0)-at&255;return E+A},s.prototype.writeIntBE=function(T,E,A,U){if(T=+T,E=E>>>0,!U){let fn=Math.pow(2,8*A-1);dn(this,T,E,A,fn-1,-fn)}let Q=A-1,ee=1,at=0;for(this[E+Q]=T&255;--Q>=0&&(ee*=256);)T<0&&at===0&&this[E+Q+1]!==0&&(at=1),this[E+Q]=(T/ee>>0)-at&255;return E+A},s.prototype.writeInt8=function(T,E,A){return T=+T,E=E>>>0,A||dn(this,T,E,1,127,-128),T<0&&(T=255+T+1),this[E]=T&255,E+1},s.prototype.writeInt16LE=function(T,E,A){return T=+T,E=E>>>0,A||dn(this,T,E,2,32767,-32768),this[E]=T&255,this[E+1]=T>>>8,E+2},s.prototype.writeInt16BE=function(T,E,A){return T=+T,E=E>>>0,A||dn(this,T,E,2,32767,-32768),this[E]=T>>>8,this[E+1]=T&255,E+2},s.prototype.writeInt32LE=function(T,E,A){return T=+T,E=E>>>0,A||dn(this,T,E,4,2147483647,-2147483648),this[E]=T&255,this[E+1]=T>>>8,this[E+2]=T>>>16,this[E+3]=T>>>24,E+4},s.prototype.writeInt32BE=function(T,E,A){return T=+T,E=E>>>0,A||dn(this,T,E,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[E]=T>>>24,this[E+1]=T>>>16,this[E+2]=T>>>8,this[E+3]=T&255,E+4},s.prototype.writeBigInt64LE=Ks(function(T,E=0){return R(this,T,E,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=Ks(function(T,E=0){return J(this,T,E,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function B(_,T,E,A,U,Q){if(E+A>_.length)throw new RangeError("Index out of range");if(E<0)throw new RangeError("Index out of range")}function X(_,T,E,A,U){return T=+T,E=E>>>0,U||B(_,T,E,4),t.write(_,T,E,A,23,4),E+4}s.prototype.writeFloatLE=function(T,E,A){return X(this,T,E,!0,A)},s.prototype.writeFloatBE=function(T,E,A){return X(this,T,E,!1,A)};function we(_,T,E,A,U){return T=+T,E=E>>>0,U||B(_,T,E,8),t.write(_,T,E,A,52,8),E+8}s.prototype.writeDoubleLE=function(T,E,A){return we(this,T,E,!0,A)},s.prototype.writeDoubleBE=function(T,E,A){return we(this,T,E,!1,A)},s.prototype.copy=function(T,E,A,U){if(!s.isBuffer(T))throw new TypeError("argument should be a Buffer");if(A||(A=0),!U&&U!==0&&(U=this.length),E>=T.length&&(E=T.length),E||(E=0),U>0&&U=this.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),T.length-E>>0,A=A===void 0?this.length:A>>>0,T||(T=0);let Q;if(typeof T=="number")for(Q=E;QQt(2,32)?U=Ne(String(E)):typeof E=="bigint"&&(U=String(E),(E>Qt(BigInt(2),BigInt(32))||E<-Qt(BigInt(2),BigInt(32)))&&(U=Ne(U)),U+="n"),A+=` It must be ${T}. Received ${U}`,A},RangeError);function Ne(_){let T="",E=_.length,A=_[0]==="-"?1:0;for(;E>=A+4;E-=3)T=`_${_.slice(E-3,E)}${T}`;return`${_.slice(0,E)}${T}`}function Pe(_,T,E){Ke(T,"offset"),(_[T]===void 0||_[T+E]===void 0)&&Ut(T,_.length-(E+1))}function Nt(_,T,E,A,U,Q){if(_>E||_3?T===0||T===BigInt(0)?at=`>= 0${ee} and < 2${ee} ** ${(Q+1)*8}${ee}`:at=`>= -(2${ee} ** ${(Q+1)*8-1}${ee}) and < 2 ** ${(Q+1)*8-1}${ee}`:at=`>= ${T}${ee} and <= ${E}${ee}`,new C.ERR_OUT_OF_RANGE("value",at,_)}Pe(A,U,Q)}function Ke(_,T){if(typeof _!="number")throw new C.ERR_INVALID_ARG_TYPE(T,"number",_)}function Ut(_,T,E){throw Math.floor(_)!==_?(Ke(_,E),new C.ERR_OUT_OF_RANGE(E||"offset","an integer",_)):T<0?new C.ERR_BUFFER_OUT_OF_BOUNDS:new C.ERR_OUT_OF_RANGE(E||"offset",`>= ${E?1:0} and <= ${T}`,_)}let Sa=/[^+/0-9A-Za-z-_]/g;function Af(_){if(_=_.split("=")[0],_=_.trim().replace(Sa,""),_.length<2)return"";for(;_.length%4!==0;)_=_+"=";return _}function Fu(_,T){T=T||1/0;let E,A=_.length,U=null,Q=[];for(let ee=0;ee55295&&E<57344){if(!U){if(E>56319){(T-=3)>-1&&Q.push(239,191,189);continue}else if(ee+1===A){(T-=3)>-1&&Q.push(239,191,189);continue}U=E;continue}if(E<56320){(T-=3)>-1&&Q.push(239,191,189),U=E;continue}E=(U-55296<<10|E-56320)+65536}else U&&(T-=3)>-1&&Q.push(239,191,189);if(U=null,E<128){if((T-=1)<0)break;Q.push(E)}else if(E<2048){if((T-=2)<0)break;Q.push(E>>6|192,E&63|128)}else if(E<65536){if((T-=3)<0)break;Q.push(E>>12|224,E>>6&63|128,E&63|128)}else if(E<1114112){if((T-=4)<0)break;Q.push(E>>18|240,E>>12&63|128,E>>6&63|128,E&63|128)}else throw new Error("Invalid code point")}return Q}function wf(_){let T=[];for(let E=0;E<_.length;++E)T.push(_.charCodeAt(E)&255);return T}function Rf(_,T){let E,A,U,Q=[];for(let ee=0;ee<_.length&&!((T-=2)<0);++ee)E=_.charCodeAt(ee),A=E>>8,U=E%256,Q.push(U),Q.push(A);return Q}function dl(_){return e.toByteArray(Af(_))}function Da(_,T,E,A){let U;for(U=0;U=T.length||U>=_.length);++U)T[U+E]=_[U];return U}function Vt(_,T){return _ instanceof T||_!=null&&_.constructor!=null&&_.constructor.name!=null&&_.constructor.name===T.name}function hr(_){return _!==_}let vC=function(){let _="0123456789abcdef",T=new Array(256);for(let E=0;E<16;++E){let A=E*16;for(let U=0;U<16;++U)T[A+U]=_[E]+_[U]}return T}();function Ks(_){return typeof BigInt=="undefined"?IC:_}function IC(){throw new Error("BigInt not supported")}return wa}var hl,W0,xf,Z0,wa,eS,Ra,v,SH,DH,tS=Y(()=>{"use strict";d();m();f();hl={},W0=!1;xf={},Z0=!1;wa={},eS=!1;Ra=kC();Ra.Buffer;Ra.SlowBuffer;Ra.INSPECT_MAX_BYTES;Ra.kMaxLength;v=Ra.Buffer,SH=Ra.INSPECT_MAX_BYTES,DH=Ra.kMaxLength});var m=Y(()=>{"use strict";tS()});var nS,rS,iS=Y(()=>{"use strict";d();m();f();nS="16.7.1",rS=Object.freeze({major:16,minor:7,patch:1,preReleaseTag:null})});function xe(e,t){if(!!!e)throw new Error(t)}var yr=Y(()=>{"use strict";d();m();f()});function er(e){return typeof(e==null?void 0:e.then)=="function"}var Cf=Y(()=>{"use strict";d();m();f()});function hn(e){return typeof e=="object"&&e!==null}var Bi=Y(()=>{"use strict";d();m();f()});function ut(e,t){if(!!!e)throw new Error(t!=null?t:"Unexpected invariant triggered.")}var tr=Y(()=>{"use strict";d();m();f()});function Ys(e,t){let n=0,r=1;for(let i of e.body.matchAll(PC)){if(typeof i.index=="number"||ut(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}var PC,Mf=Y(()=>{"use strict";d();m();f();tr();PC=/\r\n|[\n\r]/g});function yl(e){return Pu(e.source,Ys(e.source,e.start))}function Pu(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,c=t.column+a,u=`${e.name}:${s}:${c} -`,l=r.split(/\r\n|[\n\r]/g),p=l[i];if(p.length>120){let h=Math.floor(c/80),y=c%80,N=[];for(let O=0;O["|",O]),["|","^".padStart(y)],["|",N[h+1]]])}return u+oS([[`${s-1} |`,l[i-1]],[`${s} |`,p],["|","^".padStart(c)],[`${s+1} |`,l[i+1]]])}function oS(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(` -`)}var $T=Y(()=>{"use strict";d();m();f();Mf()});function xC(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}function sS(e){return e===void 0||e.length===0?void 0:e}function GT(e){return e.toString()}function qT(e){return e.toJSON()}var j,Ve=Y(()=>{"use strict";d();m();f();Bi();Mf();$T();j=class e extends Error{constructor(t,...n){var r,i,o;let{nodes:s,source:a,positions:c,path:u,originalError:l,extensions:p}=xC(n);super(t),this.name="GraphQLError",this.path=u!=null?u:void 0,this.originalError=l!=null?l:void 0,this.nodes=sS(Array.isArray(s)?s:s?[s]:void 0);let h=sS((r=this.nodes)===null||r===void 0?void 0:r.map(N=>N.loc).filter(N=>N!=null));this.source=a!=null?a:h==null||(i=h[0])===null||i===void 0?void 0:i.source,this.positions=c!=null?c:h==null?void 0:h.map(N=>N.start),this.locations=c&&a?c.map(N=>Ys(a,N)):h==null?void 0:h.map(N=>Ys(N.source,N.start));let y=hn(l==null?void 0:l.extensions)?l==null?void 0:l.extensions:void 0;this.extensions=(o=p!=null?p:y)!==null&&o!==void 0?o:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),l!=null&&l.stack?Object.defineProperty(this,"stack",{value:l.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=` +"use strict";var shim=(()=>{var dk=Object.create;var wc=Object.defineProperty,pk=Object.defineProperties,fk=Object.getOwnPropertyDescriptor,mk=Object.getOwnPropertyDescriptors,hk=Object.getOwnPropertyNames,Rv=Object.getOwnPropertySymbols,Tk=Object.getPrototypeOf,kv=Object.prototype.hasOwnProperty,yk=Object.prototype.propertyIsEnumerable;var Ot=Math.pow,cT=(e,t,n)=>t in e?wc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,A=(e,t)=>{for(var n in t||(t={}))kv.call(t,n)&&cT(e,n,t[n]);if(Rv)for(var n of Rv(t))yk.call(t,n)&&cT(e,n,t[n]);return e},M=(e,t)=>pk(e,mk(t));var j=(e,t)=>()=>(e&&(t=e(e=0)),t);var L=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Fc=(e,t)=>{for(var n in t)wc(e,n,{get:t[n],enumerable:!0})},xv=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of hk(t))!kv.call(e,i)&&i!==n&&wc(e,i,{get:()=>t[i],enumerable:!(r=fk(t,i))||r.enumerable});return e};var Op=(e,t,n)=>(n=e!=null?dk(Tk(e)):{},xv(t||!e||!e.__esModule?wc(n,"default",{value:e,enumerable:!0}):n,e)),se=e=>xv(wc({},"__esModule",{value:!0}),e);var S=(e,t,n)=>(cT(e,typeof t!="symbol"?t+"":t,n),n);var nr=(e,t,n)=>new Promise((r,i)=>{var s=u=>{try{a(n.next(u))}catch(c){i(c)}},o=u=>{try{a(n.throw(u))}catch(c){i(c)}},a=u=>u.done?r(u.value):Promise.resolve(u.value).then(s,o);a((n=n.apply(e,t)).next())});var d=j(()=>{"use strict"});var g={};Fc(g,{_debugEnd:()=>v_,_debugProcess:()=>I_,_events:()=>C_,_eventsCount:()=>B_,_exiting:()=>n_,_fatalExceptions:()=>y_,_getActiveHandles:()=>o_,_getActiveRequests:()=>s_,_kill:()=>u_,_linkedBinding:()=>e_,_maxListeners:()=>U_,_preload_modules:()=>x_,_rawDebug:()=>Wv,_startProfilerIdleNotifier:()=>__,_stopProfilerIdleNotifier:()=>b_,_tickCallback:()=>g_,abort:()=>A_,addListener:()=>$_,allowedNodeEnvironmentFlags:()=>m_,arch:()=>Bv,argv:()=>jv,argv0:()=>k_,assert:()=>h_,binding:()=>Yv,chdir:()=>Xv,config:()=>r_,cpuUsage:()=>Fp,cwd:()=>zv,debugPort:()=>R_,default:()=>z_,dlopen:()=>i_,domain:()=>t_,emit:()=>K_,emitWarning:()=>Qv,env:()=>Vv,execArgv:()=>Gv,execPath:()=>L_,exit:()=>p_,features:()=>T_,hasUncaughtExceptionCaptureCallback:()=>N_,hrtime:()=>wp,kill:()=>d_,listeners:()=>J_,memoryUsage:()=>l_,moduleLoadList:()=>Zv,nextTick:()=>Mv,off:()=>j_,on:()=>Wi,once:()=>V_,openStdin:()=>f_,pid:()=>w_,platform:()=>$v,ppid:()=>F_,prependListener:()=>Q_,prependOnceListener:()=>Y_,reallyExit:()=>a_,release:()=>Hv,removeAllListeners:()=>q_,removeListener:()=>G_,resourceUsage:()=>c_,setSourceMapsEnabled:()=>P_,setUncaughtExceptionCaptureCallback:()=>E_,stderr:()=>D_,stdin:()=>O_,stdout:()=>S_,title:()=>Cv,umask:()=>Jv,uptime:()=>M_,version:()=>qv,versions:()=>Kv});function pT(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function Ek(){!Wa||!ea||(Wa=!1,ea.length?Hi=ea.concat(Hi):Ap=-1,Hi.length&&Pv())}function Pv(){if(!Wa){var e=setTimeout(Ek,0);Wa=!0;for(var t=Hi.length;t;){for(ea=Hi,Hi=[];++Ap1)for(var n=1;n{"use strict";d();f();p();Hi=[],Wa=!1,Ap=-1;Uv.prototype.run=function(){this.fun.apply(null,this.array)};Cv="browser",Bv="x64",$v="browser",Vv={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},jv=["/usr/bin/node"],Gv=[],qv="v16.8.0",Kv={},Qv=function(e,t){console.warn((t?t+": ":"")+e)},Yv=function(e){pT("binding")},Jv=function(e){return 0},zv=function(){return"/"},Xv=function(e){},Hv={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};Wv=jn,Zv=[];t_={},n_=!1,r_={};a_=jn,u_=jn,Fp=function(){return{}},c_=Fp,l_=Fp,d_=jn,p_=jn,f_=jn,m_={};T_={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},y_=jn,E_=jn;g_=jn,I_=jn,v_=jn,__=jn,b_=jn,S_=void 0,D_=void 0,O_=void 0,A_=jn,w_=2,F_=1,L_="/bin/usr/node",R_=9229,k_="node",x_=[],P_=jn,po={now:typeof performance!="undefined"?performance.now.bind(performance):void 0,timing:typeof performance!="undefined"?performance.timing:void 0};po.now===void 0&&(lT=Date.now(),po.timing&&po.timing.navigationStart&&(lT=po.timing.navigationStart),po.now=()=>Date.now()-lT);dT=1e9;wp.bigint=function(e){var t=wp(e);return typeof BigInt=="undefined"?t[0]*dT+t[1]:BigInt(t[0]*dT)+BigInt(t[1])};U_=10,C_={},B_=0;$_=Wi,V_=Wi,j_=Wi,G_=Wi,q_=Wi,K_=jn,Q_=Wi,Y_=Wi;z_={version:qv,versions:Kv,arch:Bv,platform:$v,release:Hv,_rawDebug:Wv,moduleLoadList:Zv,binding:Yv,_linkedBinding:e_,_events:C_,_eventsCount:B_,_maxListeners:U_,on:Wi,addListener:$_,once:V_,off:j_,removeListener:G_,removeAllListeners:q_,emit:K_,prependListener:Q_,prependOnceListener:Y_,listeners:J_,domain:t_,_exiting:n_,config:r_,dlopen:i_,uptime:M_,_getActiveRequests:s_,_getActiveHandles:o_,reallyExit:a_,_kill:u_,cpuUsage:Fp,resourceUsage:c_,memoryUsage:l_,kill:d_,exit:p_,openStdin:f_,allowedNodeEnvironmentFlags:m_,assert:h_,features:T_,_fatalExceptions:y_,setUncaughtExceptionCaptureCallback:E_,hasUncaughtExceptionCaptureCallback:N_,emitWarning:Qv,nextTick:Mv,_tickCallback:g_,_debugProcess:I_,_debugEnd:v_,_startProfilerIdleNotifier:__,_stopProfilerIdleNotifier:b_,stdout:S_,stdin:O_,stderr:D_,abort:A_,umask:Jv,chdir:Xv,cwd:zv,env:Vv,title:Cv,argv:jv,execArgv:Gv,pid:w_,ppid:F_,execPath:L_,debugPort:R_,hrtime:wp,argv0:k_,_preload_modules:x_,setSourceMapsEnabled:P_}});var p=j(()=>{"use strict";X_()});function Nk(){if(H_)return Lc;H_=!0,Lc.byteLength=a,Lc.toByteArray=c,Lc.fromByteArray=h;for(var e=[],t=[],n=typeof Uint8Array!="undefined"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=r.length;i0)throw new Error("Invalid string. Length must be a multiple of 4");var D=E.indexOf("=");D===-1&&(D=N);var w=D===N?0:4-D%4;return[D,w]}function a(E){var N=o(E),D=N[0],w=N[1];return(D+w)*3/4-w}function u(E,N,D){return(N+D)*3/4-D}function c(E){var N,D=o(E),w=D[0],x=D[1],Y=new n(u(E,w,x)),Q=0,W=x>0?w-4:w,Ie;for(Ie=0;Ie>16&255,Y[Q++]=N>>8&255,Y[Q++]=N&255;return x===2&&(N=t[E.charCodeAt(Ie)]<<2|t[E.charCodeAt(Ie+1)]>>4,Y[Q++]=N&255),x===1&&(N=t[E.charCodeAt(Ie)]<<10|t[E.charCodeAt(Ie+1)]<<4|t[E.charCodeAt(Ie+2)]>>2,Y[Q++]=N>>8&255,Y[Q++]=N&255),Y}function l(E){return e[E>>18&63]+e[E>>12&63]+e[E>>6&63]+e[E&63]}function m(E,N,D){for(var w,x=[],Y=N;YW?W:Q+Y));return w===1?(N=E[D-1],x.push(e[N>>2]+e[N<<4&63]+"==")):w===2&&(N=(E[D-2]<<8)+E[D-1],x.push(e[N>>10]+e[N>>4&63]+e[N<<2&63]+"=")),x.join("")}return Lc}function gk(){if(W_)return Lp;W_=!0;return Lp.read=function(e,t,n,r,i){var s,o,a=i*8-r-1,u=(1<>1,l=-7,m=n?i-1:0,h=n?-1:1,E=e[t+m];for(m+=h,s=E&(1<<-l)-1,E>>=-l,l+=a;l>0;s=s*256+e[t+m],m+=h,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=r;l>0;o=o*256+e[t+m],m+=h,l-=8);if(s===0)s=1-c;else{if(s===u)return o?NaN:(E?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-c}return(E?-1:1)*o*Math.pow(2,s-r)},Lp.write=function(e,t,n,r,i,s){var o,a,u,c=s*8-i-1,l=(1<>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=r?0:s-1,N=r?1:-1,D=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+m>=1?t+=h/u:t+=h*Math.pow(2,1-m),t*u>=2&&(o++,u/=2),o+m>=l?(a=0,o=l):o+m>=1?(a=(t*u-1)*Math.pow(2,i),o=o+m):(a=t*Math.pow(2,m-1)*Math.pow(2,i),o=0));i>=8;e[n+E]=a&255,E+=N,a/=256,i-=8);for(o=o<0;e[n+E]=o&255,E+=N,o/=256,c-=8);e[n+E-N]|=D*128},Lp}function Ik(){if(Z_)return ta;Z_=!0;let e=Nk(),t=gk(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ta.Buffer=o,ta.SlowBuffer=x,ta.INSPECT_MAX_BYTES=50;let r=2147483647;ta.kMaxLength=r,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{let b=new Uint8Array(1),T={foo:function(){return 42}};return Object.setPrototypeOf(T,Uint8Array.prototype),Object.setPrototypeOf(b,T),b.foo()===42}catch(b){return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function s(b){if(b>r)throw new RangeError('The value "'+b+'" is invalid for option "size"');let T=new Uint8Array(b);return Object.setPrototypeOf(T,o.prototype),T}function o(b,T,y){if(typeof b=="number"){if(typeof T=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return l(b)}return a(b,T,y)}o.poolSize=8192;function a(b,T,y){if(typeof b=="string")return m(b,T);if(ArrayBuffer.isView(b))return E(b);if(b==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b);if(vt(b,ArrayBuffer)||b&&vt(b.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(vt(b,SharedArrayBuffer)||b&&vt(b.buffer,SharedArrayBuffer)))return N(b,T,y);if(typeof b=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let O=b.valueOf&&b.valueOf();if(O!=null&&O!==b)return o.from(O,T,y);let R=D(b);if(R)return R;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof b[Symbol.toPrimitive]=="function")return o.from(b[Symbol.toPrimitive]("string"),T,y);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b)}o.from=function(b,T,y){return a(b,T,y)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function u(b){if(typeof b!="number")throw new TypeError('"size" argument must be of type number');if(b<0)throw new RangeError('The value "'+b+'" is invalid for option "size"')}function c(b,T,y){return u(b),b<=0?s(b):T!==void 0?typeof y=="string"?s(b).fill(T,y):s(b).fill(T):s(b)}o.alloc=function(b,T,y){return c(b,T,y)};function l(b){return u(b),s(b<0?0:w(b)|0)}o.allocUnsafe=function(b){return l(b)},o.allocUnsafeSlow=function(b){return l(b)};function m(b,T){if((typeof T!="string"||T==="")&&(T="utf8"),!o.isEncoding(T))throw new TypeError("Unknown encoding: "+T);let y=Y(b,T)|0,O=s(y),R=O.write(b,T);return R!==y&&(O=O.slice(0,R)),O}function h(b){let T=b.length<0?0:w(b.length)|0,y=s(T);for(let O=0;O=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return b|0}function x(b){return+b!=b&&(b=0),o.alloc(+b)}o.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==o.prototype},o.compare=function(T,y){if(vt(T,Uint8Array)&&(T=o.from(T,T.offset,T.byteLength)),vt(y,Uint8Array)&&(y=o.from(y,y.offset,y.byteLength)),!o.isBuffer(T)||!o.isBuffer(y))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===y)return 0;let O=T.length,R=y.length;for(let $=0,z=Math.min(O,R);$R.length?(o.isBuffer(z)||(z=o.from(z)),z.copy(R,$)):Uint8Array.prototype.set.call(R,z,$);else if(o.isBuffer(z))z.copy(R,$);else throw new TypeError('"list" argument must be an Array of Buffers');$+=z.length}return R};function Y(b,T){if(o.isBuffer(b))return b.length;if(ArrayBuffer.isView(b)||vt(b,ArrayBuffer))return b.byteLength;if(typeof b!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof b);let y=b.length,O=arguments.length>2&&arguments[2]===!0;if(!O&&y===0)return 0;let R=!1;for(;;)switch(T){case"ascii":case"latin1":case"binary":return y;case"utf8":case"utf-8":return Ha(b).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y*2;case"hex":return y>>>1;case"base64":return Ac(b).length;default:if(R)return O?-1:Ha(b).length;T=(""+T).toLowerCase(),R=!0}}o.byteLength=Y;function Q(b,T,y){let O=!1;if((T===void 0||T<0)&&(T=0),T>this.length||((y===void 0||y>this.length)&&(y=this.length),y<=0)||(y>>>=0,T>>>=0,y<=T))return"";for(b||(b="utf8");;)switch(b){case"hex":return co(this,T,y);case"utf8":case"utf-8":return Nr(this,T,y);case"ascii":return ei(this,T,y);case"latin1":case"binary":return Ho(this,T,y);case"base64":return Zr(this,T,y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ni(this,T,y);default:if(O)throw new TypeError("Unknown encoding: "+b);b=(b+"").toLowerCase(),O=!0}}o.prototype._isBuffer=!0;function W(b,T,y){let O=b[T];b[T]=b[y],b[y]=O}o.prototype.swap16=function(){let T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let y=0;yy&&(T+=" ... "),""},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(T,y,O,R,$){if(vt(T,Uint8Array)&&(T=o.from(T,T.offset,T.byteLength)),!o.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(y===void 0&&(y=0),O===void 0&&(O=T?T.length:0),R===void 0&&(R=0),$===void 0&&($=this.length),y<0||O>T.length||R<0||$>this.length)throw new RangeError("out of range index");if(R>=$&&y>=O)return 0;if(R>=$)return-1;if(y>=O)return 1;if(y>>>=0,O>>>=0,R>>>=0,$>>>=0,this===T)return 0;let z=$-R,Je=O-y,Ht=Math.min(z,Je),Ut=this.slice(R,$),Wt=T.slice(y,O);for(let _t=0;_t2147483647?y=2147483647:y<-2147483648&&(y=-2147483648),y=+y,tr(y)&&(y=R?0:b.length-1),y<0&&(y=b.length+y),y>=b.length){if(R)return-1;y=b.length-1}else if(y<0)if(R)y=0;else return-1;if(typeof T=="string"&&(T=o.from(T,O)),o.isBuffer(T))return T.length===0?-1:Qe(b,T,y,O,R);if(typeof T=="number")return T=T&255,typeof Uint8Array.prototype.indexOf=="function"?R?Uint8Array.prototype.indexOf.call(b,T,y):Uint8Array.prototype.lastIndexOf.call(b,T,y):Qe(b,[T],y,O,R);throw new TypeError("val must be string, number or Buffer")}function Qe(b,T,y,O,R){let $=1,z=b.length,Je=T.length;if(O!==void 0&&(O=String(O).toLowerCase(),O==="ucs2"||O==="ucs-2"||O==="utf16le"||O==="utf-16le")){if(b.length<2||T.length<2)return-1;$=2,z/=2,Je/=2,y/=2}function Ht(Wt,_t){return $===1?Wt[_t]:Wt.readUInt16BE(_t*$)}let Ut;if(R){let Wt=-1;for(Ut=y;Utz&&(y=z-Je),Ut=y;Ut>=0;Ut--){let Wt=!0;for(let _t=0;_tR&&(O=R)):O=R;let $=T.length;O>$/2&&(O=$/2);let z;for(z=0;z>>0,isFinite(O)?(O=O>>>0,R===void 0&&(R="utf8")):(R=O,O=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let $=this.length-y;if((O===void 0||O>$)&&(O=$),T.length>0&&(O<0||y<0)||y>this.length)throw new RangeError("Attempt to write outside buffer bounds");R||(R="utf8");let z=!1;for(;;)switch(R){case"hex":return et(this,T,y,O);case"utf8":case"utf-8":return Pt(this,T,y,O);case"ascii":case"latin1":case"binary":return X(this,T,y,O);case"base64":return De(this,T,y,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return sn(this,T,y,O);default:if(z)throw new TypeError("Unknown encoding: "+R);R=(""+R).toLowerCase(),z=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Zr(b,T,y){return T===0&&y===b.length?e.fromByteArray(b):e.fromByteArray(b.slice(T,y))}function Nr(b,T,y){y=Math.min(b.length,y);let O=[],R=T;for(;R239?4:$>223?3:$>191?2:1;if(R+Je<=y){let Ht,Ut,Wt,_t;switch(Je){case 1:$<128&&(z=$);break;case 2:Ht=b[R+1],(Ht&192)===128&&(_t=($&31)<<6|Ht&63,_t>127&&(z=_t));break;case 3:Ht=b[R+1],Ut=b[R+2],(Ht&192)===128&&(Ut&192)===128&&(_t=($&15)<<12|(Ht&63)<<6|Ut&63,_t>2047&&(_t<55296||_t>57343)&&(z=_t));break;case 4:Ht=b[R+1],Ut=b[R+2],Wt=b[R+3],(Ht&192)===128&&(Ut&192)===128&&(Wt&192)===128&&(_t=($&15)<<18|(Ht&63)<<12|(Ut&63)<<6|Wt&63,_t>65535&&_t<1114112&&(z=_t))}}z===null?(z=65533,Je=1):z>65535&&(z-=65536,O.push(z>>>10&1023|55296),z=56320|z&1023),O.push(z),R+=Je}return uo(O)}let Ei=4096;function uo(b){let T=b.length;if(T<=Ei)return String.fromCharCode.apply(String,b);let y="",O=0;for(;OO)&&(y=O);let R="";for(let $=T;$O&&(T=O),y<0?(y+=O,y<0&&(y=0)):y>O&&(y=O),yy)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(T,y,O){T=T>>>0,y=y>>>0,O||Nt(T,y,this.length);let R=this[T],$=1,z=0;for(;++z>>0,y=y>>>0,O||Nt(T,y,this.length);let R=this[T+--y],$=1;for(;y>0&&($*=256);)R+=this[T+--y]*$;return R},o.prototype.readUint8=o.prototype.readUInt8=function(T,y){return T=T>>>0,y||Nt(T,1,this.length),this[T]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(T,y){return T=T>>>0,y||Nt(T,2,this.length),this[T]|this[T+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(T,y){return T=T>>>0,y||Nt(T,2,this.length),this[T]<<8|this[T+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(T,y){return T=T>>>0,y||Nt(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(T,y){return T=T>>>0,y||Nt(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},o.prototype.readBigUInt64LE=lo(function(T){T=T>>>0,ze(T,"offset");let y=this[T],O=this[T+7];(y===void 0||O===void 0)&&Et(T,this.length-8);let R=y+this[++T]*Ot(2,8)+this[++T]*Ot(2,16)+this[++T]*Ot(2,24),$=this[++T]+this[++T]*Ot(2,8)+this[++T]*Ot(2,16)+O*Ot(2,24);return BigInt(R)+(BigInt($)<>>0,ze(T,"offset");let y=this[T],O=this[T+7];(y===void 0||O===void 0)&&Et(T,this.length-8);let R=y*Ot(2,24)+this[++T]*Ot(2,16)+this[++T]*Ot(2,8)+this[++T],$=this[++T]*Ot(2,24)+this[++T]*Ot(2,16)+this[++T]*Ot(2,8)+O;return(BigInt(R)<>>0,y=y>>>0,O||Nt(T,y,this.length);let R=this[T],$=1,z=0;for(;++z=$&&(R-=Math.pow(2,8*y)),R},o.prototype.readIntBE=function(T,y,O){T=T>>>0,y=y>>>0,O||Nt(T,y,this.length);let R=y,$=1,z=this[T+--R];for(;R>0&&($*=256);)z+=this[T+--R]*$;return $*=128,z>=$&&(z-=Math.pow(2,8*y)),z},o.prototype.readInt8=function(T,y){return T=T>>>0,y||Nt(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},o.prototype.readInt16LE=function(T,y){T=T>>>0,y||Nt(T,2,this.length);let O=this[T]|this[T+1]<<8;return O&32768?O|4294901760:O},o.prototype.readInt16BE=function(T,y){T=T>>>0,y||Nt(T,2,this.length);let O=this[T+1]|this[T]<<8;return O&32768?O|4294901760:O},o.prototype.readInt32LE=function(T,y){return T=T>>>0,y||Nt(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},o.prototype.readInt32BE=function(T,y){return T=T>>>0,y||Nt(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},o.prototype.readBigInt64LE=lo(function(T){T=T>>>0,ze(T,"offset");let y=this[T],O=this[T+7];(y===void 0||O===void 0)&&Et(T,this.length-8);let R=this[T+4]+this[T+5]*Ot(2,8)+this[T+6]*Ot(2,16)+(O<<24);return(BigInt(R)<>>0,ze(T,"offset");let y=this[T],O=this[T+7];(y===void 0||O===void 0)&&Et(T,this.length-8);let R=(y<<24)+this[++T]*Ot(2,16)+this[++T]*Ot(2,8)+this[++T];return(BigInt(R)<>>0,y||Nt(T,4,this.length),t.read(this,T,!0,23,4)},o.prototype.readFloatBE=function(T,y){return T=T>>>0,y||Nt(T,4,this.length),t.read(this,T,!1,23,4)},o.prototype.readDoubleLE=function(T,y){return T=T>>>0,y||Nt(T,8,this.length),t.read(this,T,!0,52,8)},o.prototype.readDoubleBE=function(T,y){return T=T>>>0,y||Nt(T,8,this.length),t.read(this,T,!1,52,8)};function dn(b,T,y,O,R,$){if(!o.isBuffer(b))throw new TypeError('"buffer" argument must be a Buffer instance');if(T>R||T<$)throw new RangeError('"value" argument is out of bounds');if(y+O>b.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(T,y,O,R){if(T=+T,y=y>>>0,O=O>>>0,!R){let Je=Math.pow(2,8*O)-1;dn(this,T,y,O,Je,0)}let $=1,z=0;for(this[y]=T&255;++z>>0,O=O>>>0,!R){let Je=Math.pow(2,8*O)-1;dn(this,T,y,O,Je,0)}let $=O-1,z=1;for(this[y+$]=T&255;--$>=0&&(z*=256);)this[y+$]=T/z&255;return y+O},o.prototype.writeUint8=o.prototype.writeUInt8=function(T,y,O){return T=+T,y=y>>>0,O||dn(this,T,y,1,255,0),this[y]=T&255,y+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(T,y,O){return T=+T,y=y>>>0,O||dn(this,T,y,2,65535,0),this[y]=T&255,this[y+1]=T>>>8,y+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(T,y,O){return T=+T,y=y>>>0,O||dn(this,T,y,2,65535,0),this[y]=T>>>8,this[y+1]=T&255,y+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(T,y,O){return T=+T,y=y>>>0,O||dn(this,T,y,4,4294967295,0),this[y+3]=T>>>24,this[y+2]=T>>>16,this[y+1]=T>>>8,this[y]=T&255,y+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(T,y,O){return T=+T,y=y>>>0,O||dn(this,T,y,4,4294967295,0),this[y]=T>>>24,this[y+1]=T>>>16,this[y+2]=T>>>8,this[y+3]=T&255,y+4};function K(b,T,y,O,R){ft(T,O,R,b,y,7);let $=Number(T&BigInt(4294967295));b[y++]=$,$=$>>8,b[y++]=$,$=$>>8,b[y++]=$,$=$>>8,b[y++]=$;let z=Number(T>>BigInt(32)&BigInt(4294967295));return b[y++]=z,z=z>>8,b[y++]=z,z=z>>8,b[y++]=z,z=z>>8,b[y++]=z,y}function ae(b,T,y,O,R){ft(T,O,R,b,y,7);let $=Number(T&BigInt(4294967295));b[y+7]=$,$=$>>8,b[y+6]=$,$=$>>8,b[y+5]=$,$=$>>8,b[y+4]=$;let z=Number(T>>BigInt(32)&BigInt(4294967295));return b[y+3]=z,z=z>>8,b[y+2]=z,z=z>>8,b[y+1]=z,z=z>>8,b[y]=z,y+8}o.prototype.writeBigUInt64LE=lo(function(T,y=0){return K(this,T,y,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=lo(function(T,y=0){return ae(this,T,y,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(T,y,O,R){if(T=+T,y=y>>>0,!R){let Ht=Math.pow(2,8*O-1);dn(this,T,y,O,Ht-1,-Ht)}let $=0,z=1,Je=0;for(this[y]=T&255;++$>0)-Je&255;return y+O},o.prototype.writeIntBE=function(T,y,O,R){if(T=+T,y=y>>>0,!R){let Ht=Math.pow(2,8*O-1);dn(this,T,y,O,Ht-1,-Ht)}let $=O-1,z=1,Je=0;for(this[y+$]=T&255;--$>=0&&(z*=256);)T<0&&Je===0&&this[y+$+1]!==0&&(Je=1),this[y+$]=(T/z>>0)-Je&255;return y+O},o.prototype.writeInt8=function(T,y,O){return T=+T,y=y>>>0,O||dn(this,T,y,1,127,-128),T<0&&(T=255+T+1),this[y]=T&255,y+1},o.prototype.writeInt16LE=function(T,y,O){return T=+T,y=y>>>0,O||dn(this,T,y,2,32767,-32768),this[y]=T&255,this[y+1]=T>>>8,y+2},o.prototype.writeInt16BE=function(T,y,O){return T=+T,y=y>>>0,O||dn(this,T,y,2,32767,-32768),this[y]=T>>>8,this[y+1]=T&255,y+2},o.prototype.writeInt32LE=function(T,y,O){return T=+T,y=y>>>0,O||dn(this,T,y,4,2147483647,-2147483648),this[y]=T&255,this[y+1]=T>>>8,this[y+2]=T>>>16,this[y+3]=T>>>24,y+4},o.prototype.writeInt32BE=function(T,y,O){return T=+T,y=y>>>0,O||dn(this,T,y,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[y]=T>>>24,this[y+1]=T>>>16,this[y+2]=T>>>8,this[y+3]=T&255,y+4},o.prototype.writeBigInt64LE=lo(function(T,y=0){return K(this,T,y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=lo(function(T,y=0){return ae(this,T,y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function te(b,T,y,O,R,$){if(y+O>b.length)throw new RangeError("Index out of range");if(y<0)throw new RangeError("Index out of range")}function ue(b,T,y,O,R){return T=+T,y=y>>>0,R||te(b,T,y,4),t.write(b,T,y,O,23,4),y+4}o.prototype.writeFloatLE=function(T,y,O){return ue(this,T,y,!0,O)},o.prototype.writeFloatBE=function(T,y,O){return ue(this,T,y,!1,O)};function lt(b,T,y,O,R){return T=+T,y=y>>>0,R||te(b,T,y,8),t.write(b,T,y,O,52,8),y+8}o.prototype.writeDoubleLE=function(T,y,O){return lt(this,T,y,!0,O)},o.prototype.writeDoubleBE=function(T,y,O){return lt(this,T,y,!1,O)},o.prototype.copy=function(T,y,O,R){if(!o.isBuffer(T))throw new TypeError("argument should be a Buffer");if(O||(O=0),!R&&R!==0&&(R=this.length),y>=T.length&&(y=T.length),y||(y=0),R>0&&R=this.length)throw new RangeError("Index out of range");if(R<0)throw new RangeError("sourceEnd out of bounds");R>this.length&&(R=this.length),T.length-y>>0,O=O===void 0?this.length:O>>>0,T||(T=0);let $;if(typeof T=="number")for($=y;$Ot(2,32)?R=ge(String(y)):typeof y=="bigint"&&(R=String(y),(y>Ot(BigInt(2),BigInt(32))||y<-Ot(BigInt(2),BigInt(32)))&&(R=ge(R)),R+="n"),O+=` It must be ${T}. Received ${R}`,O},RangeError);function ge(b){let T="",y=b.length,O=b[0]==="-"?1:0;for(;y>=O+4;y-=3)T=`_${b.slice(y-3,y)}${T}`;return`${b.slice(0,y)}${T}`}function ke(b,T,y){ze(T,"offset"),(b[T]===void 0||b[T+y]===void 0)&&Et(T,b.length-(y+1))}function ft(b,T,y,O,R,$){if(b>y||b3?T===0||T===BigInt(0)?Je=`>= 0${z} and < 2${z} ** ${($+1)*8}${z}`:Je=`>= -(2${z} ** ${($+1)*8-1}${z}) and < 2 ** ${($+1)*8-1}${z}`:Je=`>= ${T}${z} and <= ${y}${z}`,new P.ERR_OUT_OF_RANGE("value",Je,b)}ke(O,R,$)}function ze(b,T){if(typeof b!="number")throw new P.ERR_INVALID_ARG_TYPE(T,"number",b)}function Et(b,T,y){throw Math.floor(b)!==b?(ze(b,y),new P.ERR_OUT_OF_RANGE(y||"offset","an integer",b)):T<0?new P.ERR_BUFFER_OUT_OF_BOUNDS:new P.ERR_OUT_OF_RANGE(y||"offset",`>= ${y?1:0} and <= ${T}`,b)}let Wo=/[^+/0-9A-Za-z-_]/g;function bp(b){if(b=b.split("=")[0],b=b.trim().replace(Wo,""),b.length<2)return"";for(;b.length%4!==0;)b=b+"=";return b}function Ha(b,T){T=T||1/0;let y,O=b.length,R=null,$=[];for(let z=0;z55295&&y<57344){if(!R){if(y>56319){(T-=3)>-1&&$.push(239,191,189);continue}else if(z+1===O){(T-=3)>-1&&$.push(239,191,189);continue}R=y;continue}if(y<56320){(T-=3)>-1&&$.push(239,191,189),R=y;continue}y=(R-55296<<10|y-56320)+65536}else R&&(T-=3)>-1&&$.push(239,191,189);if(R=null,y<128){if((T-=1)<0)break;$.push(y)}else if(y<2048){if((T-=2)<0)break;$.push(y>>6|192,y&63|128)}else if(y<65536){if((T-=3)<0)break;$.push(y>>12|224,y>>6&63|128,y&63|128)}else if(y<1114112){if((T-=4)<0)break;$.push(y>>18|240,y>>12&63|128,y>>6&63|128,y&63|128)}else throw new Error("Invalid code point")}return $}function Sp(b){let T=[];for(let y=0;y>8,R=y%256,$.push(R),$.push(O);return $}function Ac(b){return e.toByteArray(bp(b))}function Zo(b,T,y,O){let R;for(R=0;R=T.length||R>=b.length);++R)T[R+y]=b[R];return R}function vt(b,T){return b instanceof T||b!=null&&b.constructor!=null&&b.constructor.name!=null&&b.constructor.name===T.name}function tr(b){return b!==b}let ck=function(){let b="0123456789abcdef",T=new Array(256);for(let y=0;y<16;++y){let O=y*16;for(let R=0;R<16;++R)T[O+R]=b[y]+b[R]}return T}();function lo(b){return typeof BigInt=="undefined"?lk:b}function lk(){throw new Error("BigInt not supported")}return ta}var Lc,H_,Lp,W_,ta,Z_,na,I,HJ,WJ,eb=j(()=>{"use strict";d();f();p();Lc={},H_=!1;Lp={},W_=!1;ta={},Z_=!1;na=Ik();na.Buffer;na.SlowBuffer;na.INSPECT_MAX_BYTES;na.kMaxLength;I=na.Buffer,HJ=na.INSPECT_MAX_BYTES,WJ=na.kMaxLength});var f=j(()=>{"use strict";eb()});var tb,nb,rb=j(()=>{"use strict";d();f();p();tb="16.7.1",nb=Object.freeze({major:16,minor:7,patch:1,preReleaseTag:null})});function Oe(e,t){if(!!!e)throw new Error(t)}var rr=j(()=>{"use strict";d();f();p()});function Gn(e){return typeof(e==null?void 0:e.then)=="function"}var Rp=j(()=>{"use strict";d();f();p()});function Zt(e){return typeof e=="object"&&e!==null}var gi=j(()=>{"use strict";d();f();p()});function Xe(e,t){if(!!!e)throw new Error(t!=null?t:"Unexpected invariant triggered.")}var qn=j(()=>{"use strict";d();f();p()});function fo(e,t){let n=0,r=1;for(let i of e.body.matchAll(vk)){if(typeof i.index=="number"||Xe(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}var vk,kp=j(()=>{"use strict";d();f();p();qn();vk=/\r\n|[\n\r]/g});function Rc(e){return Za(e.source,fo(e.source,e.start))}function Za(e,t){let n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,s=e.locationOffset.line-1,o=t.line+s,a=t.line===1?n:0,u=t.column+a,c=`${e.name}:${o}:${u} +`,l=r.split(/\r\n|[\n\r]/g),m=l[i];if(m.length>120){let h=Math.floor(u/80),E=u%80,N=[];for(let D=0;D["|",D]),["|","^".padStart(E)],["|",N[h+1]]])}return c+ib([[`${o-1} |`,l[i-1]],[`${o} |`,m],["|","^".padStart(u)],[`${o+1} |`,l[i+1]]])}function ib(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(` +`)}var fT=j(()=>{"use strict";d();f();p();kp()});function _k(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}function sb(e){return e===void 0||e.length===0?void 0:e}function mT(e){return e.toString()}function hT(e){return e.toJSON()}var k,Re=j(()=>{"use strict";d();f();p();gi();kp();fT();k=class e extends Error{constructor(t,...n){var r,i,s;let{nodes:o,source:a,positions:u,path:c,originalError:l,extensions:m}=_k(n);super(t),this.name="GraphQLError",this.path=c!=null?c:void 0,this.originalError=l!=null?l:void 0,this.nodes=sb(Array.isArray(o)?o:o?[o]:void 0);let h=sb((r=this.nodes)===null||r===void 0?void 0:r.map(N=>N.loc).filter(N=>N!=null));this.source=a!=null?a:h==null||(i=h[0])===null||i===void 0?void 0:i.source,this.positions=u!=null?u:h==null?void 0:h.map(N=>N.start),this.locations=u&&a?u.map(N=>fo(a,N)):h==null?void 0:h.map(N=>fo(N.source,N.start));let E=Zt(l==null?void 0:l.extensions)?l==null?void 0:l.extensions:void 0;this.extensions=(s=m!=null?m:E)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),l!=null&&l.stack?Object.defineProperty(this,"stack",{value:l.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=` -`+yl(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=` +`+Rc(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=` -`+Pu(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}});function on(e,t,n){return new j(`Syntax Error: ${n}`,{source:e,positions:[t]})}var Uf=Y(()=>{"use strict";d();m();f();Ve()});function Tl(e){let t=e==null?void 0:e.kind;return typeof t=="string"&&CC.has(t)}var La,Js,BT,CC,Yt,Ki=Y(()=>{"use strict";d();m();f();La=class{constructor(t,n,r){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},Js=class{constructor(t,n,r,i,o,s){this.kind=t,this.start=n,this.end=r,this.line=i,this.column=o,this.value=s,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}}},BT={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},CC=new Set(Object.keys(BT));(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(Yt||(Yt={}))});var Ae,xu=Y(()=>{"use strict";d();m();f();(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(Ae||(Ae={}))});var b,vt=Y(()=>{"use strict";d();m();f();(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(b||(b={}))});function jf(e){return e===9||e===32}function Cu(e){return e>=48&&e<=57}function aS(e){return e>=97&&e<=122||e>=65&&e<=90}function El(e){return aS(e)||e===95}function Vf(e){return aS(e)||Cu(e)||e===95}var $f=Y(()=>{"use strict";d();m();f()});function uS(e){var t;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let s=0;sa===0?s:s.slice(n)).slice((t=r)!==null&&t!==void 0?t:0,i+1)}function MC(e){let t=0;for(;t1&&r.slice(1).every(y=>y.length===0||jf(y.charCodeAt(0))),s=n.endsWith('\\"""'),a=e.endsWith('"')&&!s,c=e.endsWith("\\"),u=a||c,l=!(t!=null&&t.minimize)&&(!i||e.length>70||u||o||s),p="",h=i&&jf(e.charCodeAt(0));return(l&&!h||o)&&(p+=` -`),p+=n,(l||u)&&(p+=` -`),'"""'+p+'"""'}var Nl=Y(()=>{"use strict";d();m();f();$f()});var H,gl=Y(()=>{"use strict";d();m();f();(function(e){e.SOF="",e.EOF="",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(H||(H={}))});function qf(e){return e===H.BANG||e===H.DOLLAR||e===H.AMP||e===H.PAREN_L||e===H.PAREN_R||e===H.SPREAD||e===H.COLON||e===H.EQUALS||e===H.AT||e===H.BRACKET_L||e===H.BRACKET_R||e===H.BRACE_L||e===H.PIPE||e===H.BRACE_R}function Mu(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Bf(e,t){return pS(e.charCodeAt(t))&&dS(e.charCodeAt(t+1))}function pS(e){return e>=55296&&e<=56319}function dS(e){return e>=56320&&e<=57343}function Fa(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return H.EOF;if(n>=32&&n<=126){let r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function _n(e,t,n,r,i){let o=e.line,s=1+n-e.lineStart;return new Js(t,n,r,o,s,i)}function UC(e,t){let n=e.source.body,r=n.length,i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function BC(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:" ",size:2}}throw on(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function KC(e,t){let n=e.source.body,r=n.length,i=e.lineStart,o=t+3,s=o,a="",c=[];for(;o{"use strict";d();m();f();Uf();Ki();Nl();$f();gl();xo=class{constructor(t){let n=new Js(H.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==H.EOF)do if(t.next)t=t.next;else{let n=UC(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===H.COMMENT);return t}}});function q(e){return Qf(e,[])}function Qf(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return YC(e,t);default:return String(e)}}function YC(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(JC(e)){let r=e.toJSON();if(r!==e)return typeof r=="string"?r:Qf(r,n)}else if(Array.isArray(e))return XC(e,n);return zC(e,n)}function JC(e){return typeof e.toJSON=="function"}function zC(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>2?"["+HC(e)+"]":"{ "+n.map(([i,o])=>i+": "+Qf(o,t)).join(", ")+" }"}function XC(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;o1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function HC(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}var xt=Y(()=>{"use strict";d();m();f()});var Tr,Il=Y(()=>{"use strict";d();m();f();xt();Tr=globalThis.process&&globalThis.process.env.NODE_ENV==="production"?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var r;let i=n.prototype[Symbol.toStringTag],o=Symbol.toStringTag in t?t[Symbol.toStringTag]:(r=t.constructor)===null||r===void 0?void 0:r.name;if(i===o){let s=q(t);throw new Error(`Cannot use ${i} "${s}" from another module or realm. +`+Za(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}});function Gt(e,t,n){return new k(`Syntax Error: ${n}`,{source:e,positions:[t]})}var xp=j(()=>{"use strict";d();f();p();Re()});function kc(e){let t=e==null?void 0:e.kind;return typeof t=="string"&&bk.has(t)}var ra,mo,TT,bk,At,Ii=j(()=>{"use strict";d();f();p();ra=class{constructor(t,n,r){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},mo=class{constructor(t,n,r,i,s,o){this.kind=t,this.start=n,this.end=r,this.line=i,this.column=s,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}}},TT={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},bk=new Set(Object.keys(TT));(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(At||(At={}))});var Ne,eu=j(()=>{"use strict";d();f();p();(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(Ne||(Ne={}))});var _,at=j(()=>{"use strict";d();f();p();(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(_||(_={}))});function Pp(e){return e===9||e===32}function tu(e){return e>=48&&e<=57}function ob(e){return e>=97&&e<=122||e>=65&&e<=90}function xc(e){return ob(e)||e===95}function Mp(e){return ob(e)||tu(e)||e===95}var Up=j(()=>{"use strict";d();f();p()});function ab(e){var t;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let o=0;oa===0?o:o.slice(n)).slice((t=r)!==null&&t!==void 0?t:0,i+1)}function Sk(e){let t=0;for(;t1&&r.slice(1).every(E=>E.length===0||Pp(E.charCodeAt(0))),o=n.endsWith('\\"""'),a=e.endsWith('"')&&!o,u=e.endsWith("\\"),c=a||u,l=!(t!=null&&t.minimize)&&(!i||e.length>70||c||s||o),m="",h=i&&Pp(e.charCodeAt(0));return(l&&!h||s)&&(m+=` +`),m+=n,(l||c)&&(m+=` +`),'"""'+m+'"""'}var Pc=j(()=>{"use strict";d();f();p();Up()});var q,Mc=j(()=>{"use strict";d();f();p();(function(e){e.SOF="",e.EOF="",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(q||(q={}))});function Bp(e){return e===q.BANG||e===q.DOLLAR||e===q.AMP||e===q.PAREN_L||e===q.PAREN_R||e===q.SPREAD||e===q.COLON||e===q.EQUALS||e===q.AT||e===q.BRACKET_L||e===q.BRACKET_R||e===q.BRACE_L||e===q.PIPE||e===q.BRACE_R}function nu(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function $p(e,t){return lb(e.charCodeAt(t))&&db(e.charCodeAt(t+1))}function lb(e){return e>=55296&&e<=56319}function db(e){return e>=56320&&e<=57343}function ia(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return q.EOF;if(n>=32&&n<=126){let r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function pn(e,t,n,r,i){let s=e.line,o=1+n-e.lineStart;return new mo(t,n,r,s,o,i)}function Dk(e,t){let n=e.source.body,r=n.length,i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Rk(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:" ",size:2}}throw Gt(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function kk(e,t){let n=e.source.body,r=n.length,i=e.lineStart,s=t+3,o=s,a="",u=[];for(;s{"use strict";d();f();p();xp();Ii();Pc();Up();Mc();Zi=class{constructor(t){let n=new mo(q.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==q.EOF)do if(t.next)t=t.next;else{let n=Dk(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===q.COMMENT);return t}}});function B(e){return jp(e,[])}function jp(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return Pk(e,t);default:return String(e)}}function Pk(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(Mk(e)){let r=e.toJSON();if(r!==e)return typeof r=="string"?r:jp(r,n)}else if(Array.isArray(e))return Ck(e,n);return Uk(e,n)}function Mk(e){return typeof e.toJSON=="function"}function Uk(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>2?"["+Bk(e)+"]":"{ "+n.map(([i,s])=>i+": "+jp(s,t)).join(", ")+" }"}function Ck(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 s=0;s1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function Bk(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}var mt=j(()=>{"use strict";d();f();p()});var ir,Cc=j(()=>{"use strict";d();f();p();mt();ir=globalThis.process&&globalThis.process.env.NODE_ENV==="production"?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var r;let i=n.prototype[Symbol.toStringTag],s=Symbol.toStringTag in t?t[Symbol.toStringTag]:(r=t.constructor)===null||r===void 0?void 0:r.name;if(i===s){let o=B(t);throw new Error(`Cannot use ${i} "${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 @@ -32,45 +32,45 @@ 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 Yf(e){return Tr(e,Qi)}var Qi,Jf=Y(()=>{"use strict";d();m();f();yr();xt();Il();Qi=class{constructor(t,n="GraphQL request",r={line:1,column:1}){typeof t=="string"||xe(!1,`Body must be a string. Received: ${q(t)}.`),this.body=t,this.name=n,this.locationOffset=r,this.locationOffset.line>0||xe(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||xe(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}});function Oi(e,t){return new Uu(e,t).parseDocument()}function bl(e,t){let n=new Uu(e,t);n.expectToken(H.SOF);let r=n.parseValueLiteral(!1);return n.expectToken(H.EOF),r}function QT(e,t){let n=new Uu(e,t);n.expectToken(H.SOF);let r=n.parseConstValueLiteral();return n.expectToken(H.EOF),r}function YT(e,t){let n=new Uu(e,t);n.expectToken(H.SOF);let r=n.parseTypeReference();return n.expectToken(H.EOF),r}function zf(e){let t=e.value;return fS(e.kind)+(t!=null?` "${t}"`:"")}function fS(e){return qf(e)?`"${e}"`:e}var Uu,ju=Y(()=>{"use strict";d();m();f();Uf();Ki();xu();vt();Kf();Jf();gl();Uu=class{constructor(t,n={}){let r=Yf(t)?t:new Qi(t);this._lexer=new xo(r),this._options=n,this._tokenCounter=0}parseName(){let t=this.expectToken(H.NAME);return this.node(t,{kind:b.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:b.DOCUMENT,definitions:this.many(H.SOF,this.parseDefinition,H.EOF)})}parseDefinition(){if(this.peek(H.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===H.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw on(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(H.BRACE_L))return this.node(t,{kind:b.OPERATION_DEFINITION,operation:Yt.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let n=this.parseOperationType(),r;return this.peek(H.NAME)&&(r=this.parseName()),this.node(t,{kind:b.OPERATION_DEFINITION,operation:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(H.NAME);switch(t.value){case"query":return Yt.QUERY;case"mutation":return Yt.MUTATION;case"subscription":return Yt.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(H.PAREN_L,this.parseVariableDefinition,H.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:b.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(H.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(H.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(H.DOLLAR),this.node(t,{kind:b.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:b.SELECTION_SET,selections:this.many(H.BRACE_L,this.parseSelection,H.BRACE_R)})}parseSelection(){return this.peek(H.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),r,i;return this.expectOptionalToken(H.COLON)?(r=n,i=this.parseName()):i=n,this.node(t,{kind:b.FIELD,alias:r,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(H.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(H.PAREN_L,n,H.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,r=this.parseName();return this.expectToken(H.COLON),this.node(n,{kind:b.ARGUMENT,name:r,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(H.SPREAD);let n=this.expectOptionalKeyword("on");return!n&&this.peek(H.NAME)?this.node(t,{kind:b.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:b.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:b.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:b.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case H.BRACKET_L:return this.parseList(t);case H.BRACE_L:return this.parseObject(t);case H.INT:return this.advanceLexer(),this.node(n,{kind:b.INT,value:n.value});case H.FLOAT:return this.advanceLexer(),this.node(n,{kind:b.FLOAT,value:n.value});case H.STRING:case H.BLOCK_STRING:return this.parseStringLiteral();case H.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:b.BOOLEAN,value:!0});case"false":return this.node(n,{kind:b.BOOLEAN,value:!1});case"null":return this.node(n,{kind:b.NULL});default:return this.node(n,{kind:b.ENUM,value:n.value})}case H.DOLLAR:if(t)if(this.expectToken(H.DOLLAR),this._lexer.token.kind===H.NAME){let r=this._lexer.token.value;throw on(this._lexer.source,n.start,`Unexpected variable "$${r}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:b.STRING,value:t.value,block:t.kind===H.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:b.LIST,values:this.any(H.BRACKET_L,n,H.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:b.OBJECT,fields:this.any(H.BRACE_L,n,H.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,r=this.parseName();return this.expectToken(H.COLON),this.node(n,{kind:b.OBJECT_FIELD,name:r,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(H.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(H.AT),this.node(n,{kind:b.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(H.BRACKET_L)){let r=this.parseTypeReference();this.expectToken(H.BRACKET_R),n=this.node(t,{kind:b.LIST_TYPE,type:r})}else n=this.parseNamedType();return this.expectOptionalToken(H.BANG)?this.node(t,{kind:b.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:b.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(H.STRING)||this.peek(H.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let r=this.parseConstDirectives(),i=this.many(H.BRACE_L,this.parseOperationTypeDefinition,H.BRACE_R);return this.node(t,{kind:b.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:i})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(H.COLON);let r=this.parseNamedType();return this.node(t,{kind:b.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let r=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:b.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let r=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:b.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:o,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(H.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(H.BRACE_L,this.parseFieldDefinition,H.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseName(),i=this.parseArgumentDefs();this.expectToken(H.COLON);let o=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(t,{kind:b.FIELD_DEFINITION,description:n,name:r,arguments:i,type:o,directives:s})}parseArgumentDefs(){return this.optionalMany(H.PAREN_L,this.parseInputValueDef,H.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(H.COLON);let i=this.parseTypeReference(),o;this.expectOptionalToken(H.EQUALS)&&(o=this.parseConstValueLiteral());let s=this.parseConstDirectives();return this.node(t,{kind:b.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:o,directives:s})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let r=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:b.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:o,fields:s})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let r=this.parseName(),i=this.parseConstDirectives(),o=this.parseUnionMemberTypes();return this.node(t,{kind:b.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:o})}parseUnionMemberTypes(){return this.expectOptionalToken(H.EQUALS)?this.delimitedMany(H.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let r=this.parseName(),i=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();return this.node(t,{kind:b.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:o})}parseEnumValuesDefinition(){return this.optionalMany(H.BRACE_L,this.parseEnumValueDefinition,H.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:b.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw on(this._lexer.source,this._lexer.token.start,`${zf(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let r=this.parseName(),i=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();return this.node(t,{kind:b.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:o})}parseInputFieldsDefinition(){return this.optionalMany(H.BRACE_L,this.parseInputValueDef,H.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===H.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),r=this.optionalMany(H.BRACE_L,this.parseOperationTypeDefinition,H.BRACE_R);if(n.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:b.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),r=this.parseConstDirectives();if(r.length===0)throw this.unexpected();return this.node(t,{kind:b.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:b.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:o})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:b.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:b.UNION_TYPE_EXTENSION,name:n,directives:r,types:i})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:b.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:b.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(H.AT);let r=this.parseName(),i=this.parseArgumentDefs(),o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let s=this.parseDirectiveLocations();return this.node(t,{kind:b.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,repeatable:o,locations:s})}parseDirectiveLocations(){return this.delimitedMany(H.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(Ae,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new La(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw on(this._lexer.source,n.start,`Expected ${fS(t)}, found ${zf(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===H.NAME&&n.value===t)this.advanceLexer();else throw on(this._lexer.source,n.start,`Expected "${t}", found ${zf(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===H.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t!=null?t:this._lexer.token;return on(this._lexer.source,n.start,`Unexpected ${zf(n)}.`)}any(t,n,r){this.expectToken(t);let i=[];for(;!this.expectOptionalToken(r);)i.push(n.call(this));return i}optionalMany(t,n,r){if(this.expectOptionalToken(t)){let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}return[]}many(t,n,r){this.expectToken(t);let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}delimitedMany(t,n){this.expectOptionalToken(t);let r=[];do r.push(n.call(this));while(this.expectOptionalToken(t));return r}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(t!==void 0&&n.kind!==H.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw on(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}});function nr(e,t){let[n,r]=t?[e,t]:[void 0,e],i=" Did you mean ";n&&(i+=n+" ");let o=r.map(c=>`"${c}"`);switch(o.length){case 0:return"";case 1:return i+o[0]+"?";case 2:return i+o[0]+" or "+o[1]+"?"}let s=o.slice(0,5),a=s.pop();return i+s.join(", ")+", or "+a+"?"}var zs=Y(()=>{"use strict";d();m();f()});function JT(e){return e}var mS=Y(()=>{"use strict";d();m();f()});function rr(e,t){let n=Object.create(null);for(let r of e)n[t(r)]=r;return n}var Xs=Y(()=>{"use strict";d();m();f()});function ti(e,t,n){let r=Object.create(null);for(let i of e)r[t(i)]=n(i);return r}var _l=Y(()=>{"use strict";d();m();f()});function Si(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}var zT=Y(()=>{"use strict";d();m();f()});function Co(e,t){let n=0,r=0;for(;n0);let a=0;do++r,a=a*10+o-XT,o=t.charCodeAt(r);while(Xf(o)&&a>0);if(sa)return 1}else{if(io)return 1;++n,++r}}return e.length-t.length}function Xf(e){return!isNaN(e)&&XT<=e&&e<=WC}var XT,WC,Ol=Y(()=>{"use strict";d();m();f();XT=48,WC=57});function Er(e,t){let n=Object.create(null),r=new HT(e),i=Math.floor(e.length*.4)+1;for(let o of t){let s=r.measure(o,i);s!==void 0&&(n[o]=s)}return Object.keys(n).sort((o,s)=>{let a=n[o]-n[s];return a!==0?a:Co(o,s)})}function hS(e){let t=e.length,n=new Array(t);for(let r=0;r{"use strict";d();m();f();Ol();HT=class{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=hS(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,n){if(this._input===t)return 0;let r=t.toLowerCase();if(this._inputLowerCase===r)return 1;let i=hS(r),o=this._inputArray;if(i.lengthn)return;let c=this._rows;for(let l=0;l<=a;l++)c[0][l]=l;for(let l=1;l<=s;l++){let p=c[(l-1)%3],h=c[l%3],y=h[0]=l;for(let N=1;N<=a;N++){let O=i[l-1]===o[N-1]?0:1,w=Math.min(p[N]+1,h[N-1]+1,p[N-1]+O);if(l>1&&N>1&&i[l-1]===o[N-2]&&i[l-2]===o[N-1]){let M=c[(l-2)%3][N-2];w=Math.min(w,M+1)}wn)return}let u=c[s%3][a];return u<=n?u:void 0}}});function Nr(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;return t}var Hf=Y(()=>{"use strict";d();m();f()});function yS(e){return`"${e.replace(ZC,eM)}"`}function eM(e){return tM[e.charCodeAt(0)]}var ZC,tM,TS=Y(()=>{"use strict";d();m();f();ZC=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;tM=["\\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"]});function ni(e,t,n=BT){let r=new Map;for(let M of Object.values(b))r.set(M,Mo(t,M));let i,o=Array.isArray(e),s=[e],a=-1,c=[],u=e,l,p,h=[],y=[];do{a++;let M=a===s.length,W=M&&c.length!==0;if(M){if(l=y.length===0?void 0:h[h.length-1],u=p,p=y.pop(),W)if(o){u=u.slice();let te=0;for(let[pe,qe]of c){let st=pe-te;qe===null?(u.splice(st,1),te++):u[st]=qe}}else{u=Object.defineProperties({},Object.getOwnPropertyDescriptors(u));for(let[te,pe]of c)u[te]=pe}a=i.index,s=i.keys,c=i.edits,o=i.inArray,i=i.prev}else if(p){if(l=o?a:s[a],u=p[l],u==null)continue;h.push(l)}let K;if(!Array.isArray(u)){var N,O;Tl(u)||xe(!1,`Invalid AST Node: ${q(u)}.`);let te=M?(N=r.get(u.kind))===null||N===void 0?void 0:N.leave:(O=r.get(u.kind))===null||O===void 0?void 0:O.enter;if(K=te==null?void 0:te.call(t,u,l,p,h,y),K===Ws)break;if(K===!1){if(!M){h.pop();continue}}else if(K!==void 0&&(c.push([l,K]),!M))if(Tl(K))u=K;else{h.pop();continue}}if(K===void 0&&W&&c.push([l,u]),M)h.pop();else{var w;i={inArray:o,index:a,keys:s,edits:c,prev:i},o=Array.isArray(u),s=o?u:(w=n[u.kind])!==null&&w!==void 0?w:[],a=-1,c=[],p&&y.push(p),p=u}}while(i!==void 0);return c.length!==0?c[c.length-1][1]:e}function Vu(e){let t=new Array(e.length).fill(null),n=Object.create(null);for(let r of Object.values(b)){let i=!1,o=new Array(e.length).fill(void 0),s=new Array(e.length).fill(void 0);for(let c=0;c{"use strict";d();m();f();yr();xt();Ki();vt();Ws=Object.freeze({})});function Ze(e){return ni(e,rM)}function ve(e,t=""){var n;return(n=e==null?void 0:e.filter(r=>r).join(t))!==null&&n!==void 0?n:""}function Di(e){return ct(`{ -`,Wf(ve(e,` +spurious results.`)}}return!1}});function Gp(e){return ir(e,vi)}var vi,qp=j(()=>{"use strict";d();f();p();rr();mt();Cc();vi=class{constructor(t,n="GraphQL request",r={line:1,column:1}){typeof t=="string"||Oe(!1,`Body must be a string. Received: ${B(t)}.`),this.body=t,this.name=n,this.locationOffset=r,this.locationOffset.line>0||Oe(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Oe(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}});function ti(e,t){return new ru(e,t).parseDocument()}function Bc(e,t){let n=new ru(e,t);n.expectToken(q.SOF);let r=n.parseValueLiteral(!1);return n.expectToken(q.EOF),r}function ET(e,t){let n=new ru(e,t);n.expectToken(q.SOF);let r=n.parseConstValueLiteral();return n.expectToken(q.EOF),r}function NT(e,t){let n=new ru(e,t);n.expectToken(q.SOF);let r=n.parseTypeReference();return n.expectToken(q.EOF),r}function Kp(e){let t=e.value;return pb(e.kind)+(t!=null?` "${t}"`:"")}function pb(e){return Bp(e)?`"${e}"`:e}var ru,iu=j(()=>{"use strict";d();f();p();xp();Ii();eu();at();Vp();qp();Mc();ru=class{constructor(t,n={}){let r=Gp(t)?t:new vi(t);this._lexer=new Zi(r),this._options=n,this._tokenCounter=0}parseName(){let t=this.expectToken(q.NAME);return this.node(t,{kind:_.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:_.DOCUMENT,definitions:this.many(q.SOF,this.parseDefinition,q.EOF)})}parseDefinition(){if(this.peek(q.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===q.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw Gt(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(q.BRACE_L))return this.node(t,{kind:_.OPERATION_DEFINITION,operation:At.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let n=this.parseOperationType(),r;return this.peek(q.NAME)&&(r=this.parseName()),this.node(t,{kind:_.OPERATION_DEFINITION,operation:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(q.NAME);switch(t.value){case"query":return At.QUERY;case"mutation":return At.MUTATION;case"subscription":return At.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(q.PAREN_L,this.parseVariableDefinition,q.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:_.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(q.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(q.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(q.DOLLAR),this.node(t,{kind:_.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:_.SELECTION_SET,selections:this.many(q.BRACE_L,this.parseSelection,q.BRACE_R)})}parseSelection(){return this.peek(q.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),r,i;return this.expectOptionalToken(q.COLON)?(r=n,i=this.parseName()):i=n,this.node(t,{kind:_.FIELD,alias:r,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(q.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(q.PAREN_L,n,q.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,r=this.parseName();return this.expectToken(q.COLON),this.node(n,{kind:_.ARGUMENT,name:r,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(q.SPREAD);let n=this.expectOptionalKeyword("on");return!n&&this.peek(q.NAME)?this.node(t,{kind:_.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:_.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:_.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:_.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case q.BRACKET_L:return this.parseList(t);case q.BRACE_L:return this.parseObject(t);case q.INT:return this.advanceLexer(),this.node(n,{kind:_.INT,value:n.value});case q.FLOAT:return this.advanceLexer(),this.node(n,{kind:_.FLOAT,value:n.value});case q.STRING:case q.BLOCK_STRING:return this.parseStringLiteral();case q.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:_.BOOLEAN,value:!0});case"false":return this.node(n,{kind:_.BOOLEAN,value:!1});case"null":return this.node(n,{kind:_.NULL});default:return this.node(n,{kind:_.ENUM,value:n.value})}case q.DOLLAR:if(t)if(this.expectToken(q.DOLLAR),this._lexer.token.kind===q.NAME){let r=this._lexer.token.value;throw Gt(this._lexer.source,n.start,`Unexpected variable "$${r}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:_.STRING,value:t.value,block:t.kind===q.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:_.LIST,values:this.any(q.BRACKET_L,n,q.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:_.OBJECT,fields:this.any(q.BRACE_L,n,q.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,r=this.parseName();return this.expectToken(q.COLON),this.node(n,{kind:_.OBJECT_FIELD,name:r,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(q.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(q.AT),this.node(n,{kind:_.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(q.BRACKET_L)){let r=this.parseTypeReference();this.expectToken(q.BRACKET_R),n=this.node(t,{kind:_.LIST_TYPE,type:r})}else n=this.parseNamedType();return this.expectOptionalToken(q.BANG)?this.node(t,{kind:_.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:_.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(q.STRING)||this.peek(q.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let r=this.parseConstDirectives(),i=this.many(q.BRACE_L,this.parseOperationTypeDefinition,q.BRACE_R);return this.node(t,{kind:_.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:i})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(q.COLON);let r=this.parseNamedType();return this.node(t,{kind:_.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let r=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:_.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:_.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(q.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(q.BRACE_L,this.parseFieldDefinition,q.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseName(),i=this.parseArgumentDefs();this.expectToken(q.COLON);let s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:_.FIELD_DEFINITION,description:n,name:r,arguments:i,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(q.PAREN_L,this.parseInputValueDef,q.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(q.COLON);let i=this.parseTypeReference(),s;this.expectOptionalToken(q.EQUALS)&&(s=this.parseConstValueLiteral());let o=this.parseConstDirectives();return this.node(t,{kind:_.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:_.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let r=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:_.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(q.EQUALS)?this.delimitedMany(q.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let r=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:_.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:s})}parseEnumValuesDefinition(){return this.optionalMany(q.BRACE_L,this.parseEnumValueDefinition,q.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:_.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw Gt(this._lexer.source,this._lexer.token.start,`${Kp(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let r=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:_.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(q.BRACE_L,this.parseInputValueDef,q.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===q.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),r=this.optionalMany(q.BRACE_L,this.parseOperationTypeDefinition,q.BRACE_R);if(n.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:_.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),r=this.parseConstDirectives();if(r.length===0)throw this.unexpected();return this.node(t,{kind:_.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:_.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:_.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:_.UNION_TYPE_EXTENSION,name:n,directives:r,types:i})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:_.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:_.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(q.AT);let r=this.parseName(),i=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let o=this.parseDirectiveLocations();return this.node(t,{kind:_.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(q.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(Ne,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new ra(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw Gt(this._lexer.source,n.start,`Expected ${pb(t)}, found ${Kp(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===q.NAME&&n.value===t)this.advanceLexer();else throw Gt(this._lexer.source,n.start,`Expected "${t}", found ${Kp(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===q.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t!=null?t:this._lexer.token;return Gt(this._lexer.source,n.start,`Unexpected ${Kp(n)}.`)}any(t,n,r){this.expectToken(t);let i=[];for(;!this.expectOptionalToken(r);)i.push(n.call(this));return i}optionalMany(t,n,r){if(this.expectOptionalToken(t)){let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}return[]}many(t,n,r){this.expectToken(t);let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}delimitedMany(t,n){this.expectOptionalToken(t);let r=[];do r.push(n.call(this));while(this.expectOptionalToken(t));return r}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(t!==void 0&&n.kind!==q.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw Gt(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}});function Kn(e,t){let[n,r]=t?[e,t]:[void 0,e],i=" Did you mean ";n&&(i+=n+" ");let s=r.map(u=>`"${u}"`);switch(s.length){case 0:return"";case 1:return i+s[0]+"?";case 2:return i+s[0]+" or "+s[1]+"?"}let o=s.slice(0,5),a=o.pop();return i+o.join(", ")+", or "+a+"?"}var ho=j(()=>{"use strict";d();f();p()});function gT(e){return e}var fb=j(()=>{"use strict";d();f();p()});function Qn(e,t){let n=Object.create(null);for(let r of e)n[t(r)]=r;return n}var To=j(()=>{"use strict";d();f();p()});function kr(e,t,n){let r=Object.create(null);for(let i of e)r[t(i)]=n(i);return r}var $c=j(()=>{"use strict";d();f();p()});function ni(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}var IT=j(()=>{"use strict";d();f();p()});function es(e,t){let n=0,r=0;for(;n0);let a=0;do++r,a=a*10+s-vT,s=t.charCodeAt(r);while(Qp(s)&&a>0);if(oa)return 1}else{if(is)return 1;++n,++r}}return e.length-t.length}function Qp(e){return!isNaN(e)&&vT<=e&&e<=$k}var vT,$k,Vc=j(()=>{"use strict";d();f();p();vT=48,$k=57});function sr(e,t){let n=Object.create(null),r=new _T(e),i=Math.floor(e.length*.4)+1;for(let s of t){let o=r.measure(s,i);o!==void 0&&(n[s]=o)}return Object.keys(n).sort((s,o)=>{let a=n[s]-n[o];return a!==0?a:es(s,o)})}function mb(e){let t=e.length,n=new Array(t);for(let r=0;r{"use strict";d();f();p();Vc();_T=class{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=mb(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,n){if(this._input===t)return 0;let r=t.toLowerCase();if(this._inputLowerCase===r)return 1;let i=mb(r),s=this._inputArray;if(i.lengthn)return;let u=this._rows;for(let l=0;l<=a;l++)u[0][l]=l;for(let l=1;l<=o;l++){let m=u[(l-1)%3],h=u[l%3],E=h[0]=l;for(let N=1;N<=a;N++){let D=i[l-1]===s[N-1]?0:1,w=Math.min(m[N]+1,h[N-1]+1,m[N-1]+D);if(l>1&&N>1&&i[l-1]===s[N-2]&&i[l-2]===s[N-1]){let x=u[(l-2)%3][N-2];w=Math.min(w,x+1)}wn)return}let c=u[o%3][a];return c<=n?c:void 0}}});function or(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;return t}var Yp=j(()=>{"use strict";d();f();p()});function hb(e){return`"${e.replace(Vk,jk)}"`}function jk(e){return Gk[e.charCodeAt(0)]}var Vk,Gk,Tb=j(()=>{"use strict";d();f();p();Vk=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;Gk=["\\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"]});function xr(e,t,n=TT){let r=new Map;for(let x of Object.values(_))r.set(x,ts(t,x));let i,s=Array.isArray(e),o=[e],a=-1,u=[],c=e,l,m,h=[],E=[];do{a++;let x=a===o.length,Y=x&&u.length!==0;if(x){if(l=E.length===0?void 0:h[h.length-1],c=m,m=E.pop(),Y)if(s){c=c.slice();let W=0;for(let[Ie,Qe]of u){let et=Ie-W;Qe===null?(c.splice(et,1),W++):c[et]=Qe}}else{c=Object.defineProperties({},Object.getOwnPropertyDescriptors(c));for(let[W,Ie]of u)c[W]=Ie}a=i.index,o=i.keys,u=i.edits,s=i.inArray,i=i.prev}else if(m){if(l=s?a:o[a],c=m[l],c==null)continue;h.push(l)}let Q;if(!Array.isArray(c)){var N,D;kc(c)||Oe(!1,`Invalid AST Node: ${B(c)}.`);let W=x?(N=r.get(c.kind))===null||N===void 0?void 0:N.leave:(D=r.get(c.kind))===null||D===void 0?void 0:D.enter;if(Q=W==null?void 0:W.call(t,c,l,m,h,E),Q===Eo)break;if(Q===!1){if(!x){h.pop();continue}}else if(Q!==void 0&&(u.push([l,Q]),!x))if(kc(Q))c=Q;else{h.pop();continue}}if(Q===void 0&&Y&&u.push([l,c]),x)h.pop();else{var w;i={inArray:s,index:a,keys:o,edits:u,prev:i},s=Array.isArray(c),o=s?c:(w=n[c.kind])!==null&&w!==void 0?w:[],a=-1,u=[],m&&E.push(m),m=c}}while(i!==void 0);return u.length!==0?u[u.length-1][1]:e}function su(e){let t=new Array(e.length).fill(null),n=Object.create(null);for(let r of Object.values(_)){let i=!1,s=new Array(e.length).fill(void 0),o=new Array(e.length).fill(void 0);for(let u=0;u{"use strict";d();f();p();rr();mt();Ii();at();Eo=Object.freeze({})});function Ve(e){return xr(e,Kk)}function fe(e,t=""){var n;return(n=e==null?void 0:e.filter(r=>r).join(t))!==null&&n!==void 0?n:""}function ri(e){return He(`{ +`,Jp(fe(e,` `)),` -}`)}function ct(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function Wf(e){return ct(" ",e.replace(/\n/g,` - `))}function ES(e){var t;return(t=e==null?void 0:e.some(n=>n.includes(` -`)))!==null&&t!==void 0?t:!1}var nM,rM,Vr=Y(()=>{"use strict";d();m();f();Nl();TS();ka();nM=80,rM={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>ve(e.definitions,` +}`)}function He(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function Jp(e){return He(" ",e.replace(/\n/g,` + `))}function yb(e){var t;return(t=e==null?void 0:e.some(n=>n.includes(` +`)))!==null&&t!==void 0?t:!1}var qk,Kk,gr=j(()=>{"use strict";d();f();p();Pc();Tb();sa();qk=80,Kk={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>fe(e.definitions,` -`)},OperationDefinition:{leave(e){let t=ct("(",ve(e.variableDefinitions,", "),")"),n=ve([e.operation,ve([e.name,t]),ve(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+ct(" = ",n)+ct(" ",ve(r," "))},SelectionSet:{leave:({selections:e})=>Di(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let o=ct("",e,": ")+t,s=o+ct("(",ve(n,", "),")");return s.length>nM&&(s=o+ct(`( -`,Wf(ve(n,` +`)},OperationDefinition:{leave(e){let t=He("(",fe(e.variableDefinitions,", "),")"),n=fe([e.operation,fe([e.name,t]),fe(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+He(" = ",n)+He(" ",fe(r," "))},SelectionSet:{leave:({selections:e})=>ri(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let s=He("",e,": ")+t,o=s+He("(",fe(n,", "),")");return o.length>qk&&(o=s+He(`( +`,Jp(fe(n,` `)),` -)`)),ve([s,ve(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+ct(" ",ve(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>ve(["...",ct("on ",e),ve(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${ct("(",ve(n,", "),")")} on ${t} ${ct("",ve(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?Gf(e):yS(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+ve(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+ve(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+ct("(",ve(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>ct("",e,` -`)+ve(["schema",ve(t," "),Di(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>ct("",e,` -`)+ve(["scalar",t,ve(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>ct("",e,` -`)+ve(["type",t,ct("implements ",ve(n," & ")),ve(r," "),Di(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>ct("",e,` -`)+t+(ES(n)?ct(`( -`,Wf(ve(n,` +)`)),fe([o,fe(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+He(" ",fe(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>fe(["...",He("on ",e),fe(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${He("(",fe(n,", "),")")} on ${t} ${He("",fe(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?Cp(e):hb(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+fe(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+fe(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+He("(",fe(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>He("",e,` +`)+fe(["schema",fe(t," "),ri(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>He("",e,` +`)+fe(["scalar",t,fe(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>He("",e,` +`)+fe(["type",t,He("implements ",fe(n," & ")),fe(r," "),ri(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>He("",e,` +`)+t+(yb(n)?He(`( +`,Jp(fe(n,` `)),` -)`):ct("(",ve(n,", "),")"))+": "+r+ct(" ",ve(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>ct("",e,` -`)+ve([t+": "+n,ct("= ",r),ve(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>ct("",e,` -`)+ve(["interface",t,ct("implements ",ve(n," & ")),ve(r," "),Di(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>ct("",e,` -`)+ve(["union",t,ve(n," "),ct("= ",ve(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>ct("",e,` -`)+ve(["enum",t,ve(n," "),Di(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>ct("",e,` -`)+ve([t,ve(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>ct("",e,` -`)+ve(["input",t,ve(n," "),Di(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>ct("",e,` -`)+"directive @"+t+(ES(n)?ct(`( -`,Wf(ve(n,` +)`):He("(",fe(n,", "),")"))+": "+r+He(" ",fe(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>He("",e,` +`)+fe([t+": "+n,He("= ",r),fe(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>He("",e,` +`)+fe(["interface",t,He("implements ",fe(n," & ")),fe(r," "),ri(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>He("",e,` +`)+fe(["union",t,fe(n," "),He("= ",fe(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>He("",e,` +`)+fe(["enum",t,fe(n," "),ri(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>He("",e,` +`)+fe([t,fe(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>He("",e,` +`)+fe(["input",t,fe(n," "),ri(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>He("",e,` +`)+"directive @"+t+(yb(n)?He(`( +`,Jp(fe(n,` `)),` -)`):ct("(",ve(n,", "),")"))+(r?" repeatable":"")+" on "+ve(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>ve(["extend schema",ve(e," "),Di(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>ve(["extend scalar",e,ve(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>ve(["extend type",e,ct("implements ",ve(t," & ")),ve(n," "),Di(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>ve(["extend interface",e,ct("implements ",ve(t," & ")),ve(n," "),Di(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>ve(["extend union",e,ve(t," "),ct("= ",ve(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>ve(["extend enum",e,ve(t," "),Di(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>ve(["extend input",e,ve(t," "),Di(n)]," ")}}});function Pa(e,t){switch(e.kind){case b.NULL:return null;case b.INT:return parseInt(e.value,10);case b.FLOAT:return parseFloat(e.value);case b.STRING:case b.ENUM:case b.BOOLEAN:return e.value;case b.LIST:return e.values.map(n=>Pa(n,t));case b.OBJECT:return ti(e.fields,n=>n.name.value,n=>Pa(n.value,t));case b.VARIABLE:return t==null?void 0:t[e.name.value]}}var ZT=Y(()=>{"use strict";d();m();f();_l();vt()});function Vn(e){if(e!=null||xe(!1,"Must provide name."),typeof e=="string"||xe(!1,"Expected name to be a string."),e.length===0)throw new j("Expected name to be a non-empty string.");for(let t=1;t{"use strict";d();m();f();yr();Ve();$f()});function Zs(e){return sn(e)||Ue(e)||ze(e)||At(e)||gt(e)||He(e)||tt(e)||Oe(e)}function eE(e){if(!Zs(e))throw new Error(`Expected ${q(e)} to be a GraphQL type.`);return e}function sn(e){return Tr(e,Qn)}function tE(e){if(!sn(e))throw new Error(`Expected ${q(e)} to be a GraphQL Scalar type.`);return e}function Ue(e){return Tr(e,On)}function Al(e){if(!Ue(e))throw new Error(`Expected ${q(e)} to be a GraphQL Object type.`);return e}function ze(e){return Tr(e,$r)}function wl(e){if(!ze(e))throw new Error(`Expected ${q(e)} to be a GraphQL Interface type.`);return e}function At(e){return Tr(e,Gr)}function nE(e){if(!At(e))throw new Error(`Expected ${q(e)} to be a GraphQL Union type.`);return e}function gt(e){return Tr(e,ir)}function rE(e){if(!gt(e))throw new Error(`Expected ${q(e)} to be a GraphQL Enum type.`);return e}function He(e){return Tr(e,qr)}function iE(e){if(!He(e))throw new Error(`Expected ${q(e)} to be a GraphQL Input Object type.`);return e}function tt(e){return Tr(e,Jt)}function oE(e){if(!tt(e))throw new Error(`Expected ${q(e)} to be a GraphQL List type.`);return e}function Oe(e){return Tr(e,Ge)}function sE(e){if(!Oe(e))throw new Error(`Expected ${q(e)} to be a GraphQL Non-Null type.`);return e}function vn(e){return sn(e)||gt(e)||He(e)||xa(e)&&vn(e.ofType)}function aE(e){if(!vn(e))throw new Error(`Expected ${q(e)} to be a GraphQL input type.`);return e}function Br(e){return sn(e)||Ue(e)||ze(e)||At(e)||gt(e)||xa(e)&&Br(e.ofType)}function uE(e){if(!Br(e))throw new Error(`Expected ${q(e)} to be a GraphQL output type.`);return e}function Rn(e){return sn(e)||gt(e)}function cE(e){if(!Rn(e))throw new Error(`Expected ${q(e)} to be a GraphQL leaf type.`);return e}function gr(e){return Ue(e)||ze(e)||At(e)}function lE(e){if(!gr(e))throw new Error(`Expected ${q(e)} to be a GraphQL composite type.`);return e}function Yn(e){return ze(e)||At(e)}function pE(e){if(!Yn(e))throw new Error(`Expected ${q(e)} to be a GraphQL abstract type.`);return e}function xa(e){return tt(e)||Oe(e)}function dE(e){if(!xa(e))throw new Error(`Expected ${q(e)} to be a GraphQL wrapping type.`);return e}function Rl(e){return Zs(e)&&!Oe(e)}function Ll(e){if(!Rl(e))throw new Error(`Expected ${q(e)} to be a GraphQL nullable type.`);return e}function Ca(e){if(e)return Oe(e)?e.ofType:e}function Uo(e){return sn(e)||Ue(e)||ze(e)||At(e)||gt(e)||He(e)}function fE(e){if(!Uo(e))throw new Error(`Expected ${q(e)} to be a GraphQL named type.`);return e}function Zt(e){if(e){let t=e;for(;xa(t);)t=t.ofType;return t}}function Fl(e){return typeof e=="function"?e():e}function kl(e){return typeof e=="function"?e():e}function NS(e){var t;let n=Fl((t=e.interfaces)!==null&&t!==void 0?t:[]);return Array.isArray(n)||xe(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}function gS(e){let t=kl(e.fields);return $u(t)||xe(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Si(t,(n,r)=>{var i;$u(n)||xe(!1,`${e.name}.${r} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||xe(!1,`${e.name}.${r} field resolver must be a function if provided, but got: ${q(n.resolve)}.`);let o=(i=n.args)!==null&&i!==void 0?i:{};return $u(o)||xe(!1,`${e.name}.${r} args must be an object with argument names as keys.`),{name:Vn(r),description:n.description,type:n.type,args:mE(o),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:Nr(n.extensions),astNode:n.astNode}})}function mE(e){return Object.entries(e).map(([t,n])=>({name:Vn(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:Nr(n.extensions),astNode:n.astNode}))}function $u(e){return hn(e)&&!Array.isArray(e)}function vS(e){return Si(e,t=>({description:t.description,type:t.type,args:hE(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function hE(e){return ti(e,t=>t.name,t=>({description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function Kr(e){return Oe(e.type)&&e.defaultValue===void 0}function iM(e){let t=Fl(e.types);return Array.isArray(t)||xe(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}function Zf(e,t){let n=e.getValues().map(i=>i.name),r=Er(t,n);return nr("the enum value",r)}function oM(e,t){return $u(t)||xe(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([n,r])=>($u(r)||xe(!1,`${e}.${n} must refer to an object with a "value" key representing an internal value but got: ${q(r)}.`),{name:Sl(n),description:r.description,value:r.value!==void 0?r.value:n,deprecationReason:r.deprecationReason,extensions:Nr(r.extensions),astNode:r.astNode}))}function sM(e){let t=kl(e.fields);return $u(t)||xe(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Si(t,(n,r)=>(!("resolve"in n)||xe(!1,`${e.name}.${r} field has a resolve property, but Input Types cannot define resolvers.`),{name:Vn(r),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:Nr(n.extensions),astNode:n.astNode}))}function jo(e){return Oe(e.type)&&e.defaultValue===void 0}var Jt,Ge,Qn,On,$r,Gr,ir,qr,ht=Y(()=>{"use strict";d();m();f();yr();zs();mS();xt();Il();Bi();Xs();_l();zT();Hs();Hf();Ve();vt();Vr();ZT();Dl();Jt=class{constructor(t){Zs(t)||xe(!1,`Expected ${q(t)} to be a GraphQL type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}},Ge=class{constructor(t){Rl(t)||xe(!1,`Expected ${q(t)} to be a GraphQL nullable type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}};Qn=class{constructor(t){var n,r,i,o;let s=(n=t.parseValue)!==null&&n!==void 0?n:JT;this.name=Vn(t.name),this.description=t.description,this.specifiedByURL=t.specifiedByURL,this.serialize=(r=t.serialize)!==null&&r!==void 0?r:JT,this.parseValue=s,this.parseLiteral=(i=t.parseLiteral)!==null&&i!==void 0?i:(a,c)=>s(Pa(a,c)),this.extensions=Nr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(o=t.extensionASTNodes)!==null&&o!==void 0?o:[],t.specifiedByURL==null||typeof t.specifiedByURL=="string"||xe(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${q(t.specifiedByURL)}.`),t.serialize==null||typeof t.serialize=="function"||xe(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||xe(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},On=class{constructor(t){var n;this.name=Vn(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=Nr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>gS(t),this._interfaces=()=>NS(t),t.isTypeOf==null||typeof t.isTypeOf=="function"||xe(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${q(t.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:vS(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};$r=class{constructor(t){var n;this.name=Vn(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=Nr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=gS.bind(void 0,t),this._interfaces=NS.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||xe(!1,`${this.name} must provide "resolveType" as a function, but got: ${q(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:vS(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},Gr=class{constructor(t){var n;this.name=Vn(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=Nr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=iM.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||xe(!1,`${this.name} must provide "resolveType" as a function, but got: ${q(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};ir=class{constructor(t){var n;this.name=Vn(t.name),this.description=t.description,this.extensions=Nr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=oM(this.name,t.values),this._valueLookup=new Map(this._values.map(r=>[r.value,r])),this._nameLookup=rr(this._values,r=>r.name)}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(t){return this._nameLookup[t]}serialize(t){let n=this._valueLookup.get(t);if(n===void 0)throw new j(`Enum "${this.name}" cannot represent value: ${q(t)}`);return n.name}parseValue(t){if(typeof t!="string"){let r=q(t);throw new j(`Enum "${this.name}" cannot represent non-string value: ${r}.`+Zf(this,r))}let n=this.getValue(t);if(n==null)throw new j(`Value "${t}" does not exist in "${this.name}" enum.`+Zf(this,t));return n.value}parseLiteral(t,n){if(t.kind!==b.ENUM){let i=Ze(t);throw new j(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+Zf(this,i),{nodes:t})}let r=this.getValue(t.value);if(r==null){let i=Ze(t);throw new j(`Value "${i}" does not exist in "${this.name}" enum.`+Zf(this,i),{nodes:t})}return r.value}toConfig(){let t=ti(this.getValues(),n=>n.name,n=>({description:n.description,value:n.value,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,values:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};qr=class{constructor(t){var n;this.name=Vn(t.name),this.description=t.description,this.extensions=Nr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=sM.bind(void 0,t)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){let t=Si(this.getFields(),n=>({description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,fields:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}});function Ma(e,t){return e===t?!0:Oe(e)&&Oe(t)||tt(e)&&tt(t)?Ma(e.ofType,t.ofType):!1}function Ai(e,t,n){return t===n?!0:Oe(n)?Oe(t)?Ai(e,t.ofType,n.ofType):!1:Oe(t)?Ai(e,t.ofType,n):tt(n)?tt(t)?Ai(e,t.ofType,n.ofType):!1:tt(t)?!1:Yn(n)&&(ze(t)||Ue(t))&&e.isSubType(n,t)}function Gu(e,t,n){return t===n?!0:Yn(t)?Yn(n)?e.getPossibleTypes(t).some(r=>e.isSubType(n,r)):e.isSubType(t,n):Yn(n)?e.isSubType(n,t):!1}var Pl=Y(()=>{"use strict";d();m();f();ht()});function wi(e){return Yi.some(({name:t})=>e.name===t)}function xl(e){if(hn(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!hn(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}var qu,Bu,em,tm,zt,Jn,Ku,Yi,Ji=Y(()=>{"use strict";d();m();f();xt();Bi();Ve();vt();Vr();ht();qu=2147483647,Bu=-2147483648,em=new Qn({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){let t=xl(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isInteger(n))throw new j(`Int cannot represent non-integer value: ${q(t)}`);if(n>qu||nqu||equ||tt===e.name)}var zn,Qu,Yu,Ju,zi,zu,or,Dr=Y(()=>{"use strict";d();m();f();yr();xt();Il();Bi();Hf();xu();Dl();ht();Ji();zn=class{constructor(t){var n,r;this.name=Vn(t.name),this.description=t.description,this.locations=t.locations,this.isRepeatable=(n=t.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=Nr(t.extensions),this.astNode=t.astNode,Array.isArray(t.locations)||xe(!1,`@${t.name} locations must be an Array.`);let i=(r=t.args)!==null&&r!==void 0?r:{};hn(i)&&!Array.isArray(i)||xe(!1,`@${t.name} args must be an object with argument names as keys.`),this.args=mE(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:hE(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}},Qu=new zn({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[Ae.FIELD,Ae.FRAGMENT_SPREAD,Ae.INLINE_FRAGMENT],args:{if:{type:new Ge(Jn),description:"Included when true."}}}),Yu=new zn({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[Ae.FIELD,Ae.FRAGMENT_SPREAD,Ae.INLINE_FRAGMENT],args:{if:{type:new Ge(Jn),description:"Skipped when true."}}}),Ju="No longer supported",zi=new zn({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[Ae.FIELD_DEFINITION,Ae.ARGUMENT_DEFINITION,Ae.INPUT_FIELD_DEFINITION,Ae.ENUM_VALUE],args:{reason:{type:zt,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:Ju}}}),zu=new zn({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[Ae.SCALAR],args:{url:{type:new Ge(zt),description:"The URL that specifies the behavior of this scalar."}}}),or=Object.freeze([Qu,Yu,zi,zu])});function Xu(e){return typeof e=="object"&&typeof(e==null?void 0:e[Symbol.iterator])=="function"}var nm=Y(()=>{"use strict";d();m();f()});function Xn(e,t){if(Oe(t)){let n=Xn(e,t.ofType);return(n==null?void 0:n.kind)===b.NULL?null:n}if(e===null)return{kind:b.NULL};if(e===void 0)return null;if(tt(t)){let n=t.ofType;if(Xu(e)){let r=[];for(let i of e){let o=Xn(i,n);o!=null&&r.push(o)}return{kind:b.LIST,values:r}}return Xn(e,n)}if(He(t)){if(!hn(e))return null;let n=[];for(let r of Object.values(t.getFields())){let i=Xn(e[r.name],r.type);i&&n.push({kind:b.OBJECT_FIELD,name:{kind:b.NAME,value:r.name},value:i})}return{kind:b.OBJECT,fields:n}}if(Rn(t)){let n=t.serialize(e);if(n==null)return null;if(typeof n=="boolean")return{kind:b.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){let r=String(n);return IS.test(r)?{kind:b.INT,value:r}:{kind:b.FLOAT,value:r}}if(typeof n=="string")return gt(t)?{kind:b.ENUM,value:n}:t===Ku&&IS.test(n)?{kind:b.INT,value:n}:{kind:b.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${q(n)}.`)}ut(!1,"Unexpected input type: "+q(t))}var IS,Cl=Y(()=>{"use strict";d();m();f();xt();tr();nm();Bi();vt();ht();Ji();IS=/^-?(?:0|[1-9][0-9]*)$/});function sr(e){return Xi.some(({name:t})=>e.name===t)}var Ua,Ml,Ul,Ar,jl,ja,Vl,wt,$l,Vo,$o,Go,Xi,ri=Y(()=>{"use strict";d();m();f();xt();tr();xu();Vr();Cl();ht();Ji();Ua=new On({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:zt,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new Ge(new Jt(new Ge(Ar))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new Ge(Ar),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Ar,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Ar,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new Ge(new Jt(new Ge(Ml))),resolve:e=>e.getDirectives()}})}),Ml=new On({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document. +)`):He("(",fe(n,", "),")"))+(r?" repeatable":"")+" on "+fe(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>fe(["extend schema",fe(e," "),ri(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>fe(["extend scalar",e,fe(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>fe(["extend type",e,He("implements ",fe(t," & ")),fe(n," "),ri(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>fe(["extend interface",e,He("implements ",fe(t," & ")),fe(n," "),ri(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>fe(["extend union",e,fe(t," "),He("= ",fe(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>fe(["extend enum",e,fe(t," "),ri(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>fe(["extend input",e,fe(t," "),ri(n)]," ")}}});function oa(e,t){switch(e.kind){case _.NULL:return null;case _.INT:return parseInt(e.value,10);case _.FLOAT:return parseFloat(e.value);case _.STRING:case _.ENUM:case _.BOOLEAN:return e.value;case _.LIST:return e.values.map(n=>oa(n,t));case _.OBJECT:return kr(e.fields,n=>n.name.value,n=>oa(n.value,t));case _.VARIABLE:return t==null?void 0:t[e.name.value]}}var ST=j(()=>{"use strict";d();f();p();$c();at()});function Dn(e){if(e!=null||Oe(!1,"Must provide name."),typeof e=="string"||Oe(!1,"Expected name to be a string."),e.length===0)throw new k("Expected name to be a non-empty string.");for(let t=1;t{"use strict";d();f();p();rr();Re();Up()});function No(e){return qt(e)||we(e)||Ce(e)||dt(e)||it(e)||Be(e)||qe(e)||Te(e)}function DT(e){if(!No(e))throw new Error(`Expected ${B(e)} to be a GraphQL type.`);return e}function qt(e){return ir(e,xn)}function OT(e){if(!qt(e))throw new Error(`Expected ${B(e)} to be a GraphQL Scalar type.`);return e}function we(e){return ir(e,fn)}function qc(e){if(!we(e))throw new Error(`Expected ${B(e)} to be a GraphQL Object type.`);return e}function Ce(e){return ir(e,Ir)}function Kc(e){if(!Ce(e))throw new Error(`Expected ${B(e)} to be a GraphQL Interface type.`);return e}function dt(e){return ir(e,vr)}function AT(e){if(!dt(e))throw new Error(`Expected ${B(e)} to be a GraphQL Union type.`);return e}function it(e){return ir(e,Yn)}function wT(e){if(!it(e))throw new Error(`Expected ${B(e)} to be a GraphQL Enum type.`);return e}function Be(e){return ir(e,_r)}function FT(e){if(!Be(e))throw new Error(`Expected ${B(e)} to be a GraphQL Input Object type.`);return e}function qe(e){return ir(e,wt)}function LT(e){if(!qe(e))throw new Error(`Expected ${B(e)} to be a GraphQL List type.`);return e}function Te(e){return ir(e,xe)}function RT(e){if(!Te(e))throw new Error(`Expected ${B(e)} to be a GraphQL Non-Null type.`);return e}function on(e){return qt(e)||it(e)||Be(e)||aa(e)&&on(e.ofType)}function kT(e){if(!on(e))throw new Error(`Expected ${B(e)} to be a GraphQL input type.`);return e}function br(e){return qt(e)||we(e)||Ce(e)||dt(e)||it(e)||aa(e)&&br(e.ofType)}function xT(e){if(!br(e))throw new Error(`Expected ${B(e)} to be a GraphQL output type.`);return e}function yn(e){return qt(e)||it(e)}function PT(e){if(!yn(e))throw new Error(`Expected ${B(e)} to be a GraphQL leaf type.`);return e}function ar(e){return we(e)||Ce(e)||dt(e)}function MT(e){if(!ar(e))throw new Error(`Expected ${B(e)} to be a GraphQL composite type.`);return e}function Pn(e){return Ce(e)||dt(e)}function UT(e){if(!Pn(e))throw new Error(`Expected ${B(e)} to be a GraphQL abstract type.`);return e}function aa(e){return qe(e)||Te(e)}function CT(e){if(!aa(e))throw new Error(`Expected ${B(e)} to be a GraphQL wrapping type.`);return e}function Qc(e){return No(e)&&!Te(e)}function Yc(e){if(!Qc(e))throw new Error(`Expected ${B(e)} to be a GraphQL nullable type.`);return e}function ua(e){if(e)return Te(e)?e.ofType:e}function ns(e){return qt(e)||we(e)||Ce(e)||dt(e)||it(e)||Be(e)}function BT(e){if(!ns(e))throw new Error(`Expected ${B(e)} to be a GraphQL named type.`);return e}function Ct(e){if(e){let t=e;for(;aa(t);)t=t.ofType;return t}}function Jc(e){return typeof e=="function"?e():e}function zc(e){return typeof e=="function"?e():e}function Eb(e){var t;let n=Jc((t=e.interfaces)!==null&&t!==void 0?t:[]);return Array.isArray(n)||Oe(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}function Nb(e){let t=zc(e.fields);return ou(t)||Oe(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),ni(t,(n,r)=>{var i;ou(n)||Oe(!1,`${e.name}.${r} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||Oe(!1,`${e.name}.${r} field resolver must be a function if provided, but got: ${B(n.resolve)}.`);let s=(i=n.args)!==null&&i!==void 0?i:{};return ou(s)||Oe(!1,`${e.name}.${r} args must be an object with argument names as keys.`),{name:Dn(r),description:n.description,type:n.type,args:$T(s),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:or(n.extensions),astNode:n.astNode}})}function $T(e){return Object.entries(e).map(([t,n])=>({name:Dn(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:or(n.extensions),astNode:n.astNode}))}function ou(e){return Zt(e)&&!Array.isArray(e)}function gb(e){return ni(e,t=>({description:t.description,type:t.type,args:VT(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function VT(e){return kr(e,t=>t.name,t=>({description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function Sr(e){return Te(e.type)&&e.defaultValue===void 0}function Qk(e){let t=Jc(e.types);return Array.isArray(t)||Oe(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}function zp(e,t){let n=e.getValues().map(i=>i.name),r=sr(t,n);return Kn("the enum value",r)}function Yk(e,t){return ou(t)||Oe(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([n,r])=>(ou(r)||Oe(!1,`${e}.${n} must refer to an object with a "value" key representing an internal value but got: ${B(r)}.`),{name:jc(n),description:r.description,value:r.value!==void 0?r.value:n,deprecationReason:r.deprecationReason,extensions:or(r.extensions),astNode:r.astNode}))}function Jk(e){let t=zc(e.fields);return ou(t)||Oe(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),ni(t,(n,r)=>(!("resolve"in n)||Oe(!1,`${e.name}.${r} field has a resolve property, but Input Types cannot define resolvers.`),{name:Dn(r),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:or(n.extensions),astNode:n.astNode}))}function rs(e){return Te(e.type)&&e.defaultValue===void 0}var wt,xe,xn,fn,Ir,vr,Yn,_r,tt=j(()=>{"use strict";d();f();p();rr();ho();fb();mt();Cc();gi();To();$c();IT();yo();Yp();Re();at();gr();ST();Gc();wt=class{constructor(t){No(t)||Oe(!1,`Expected ${B(t)} to be a GraphQL type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}},xe=class{constructor(t){Qc(t)||Oe(!1,`Expected ${B(t)} to be a GraphQL nullable type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}};xn=class{constructor(t){var n,r,i,s;let o=(n=t.parseValue)!==null&&n!==void 0?n:gT;this.name=Dn(t.name),this.description=t.description,this.specifiedByURL=t.specifiedByURL,this.serialize=(r=t.serialize)!==null&&r!==void 0?r:gT,this.parseValue=o,this.parseLiteral=(i=t.parseLiteral)!==null&&i!==void 0?i:(a,u)=>o(oa(a,u)),this.extensions=or(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(s=t.extensionASTNodes)!==null&&s!==void 0?s:[],t.specifiedByURL==null||typeof t.specifiedByURL=="string"||Oe(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${B(t.specifiedByURL)}.`),t.serialize==null||typeof t.serialize=="function"||Oe(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||Oe(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},fn=class{constructor(t){var n;this.name=Dn(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=or(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>Nb(t),this._interfaces=()=>Eb(t),t.isTypeOf==null||typeof t.isTypeOf=="function"||Oe(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${B(t.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:gb(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};Ir=class{constructor(t){var n;this.name=Dn(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=or(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=Nb.bind(void 0,t),this._interfaces=Eb.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||Oe(!1,`${this.name} must provide "resolveType" as a function, but got: ${B(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:gb(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},vr=class{constructor(t){var n;this.name=Dn(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=or(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=Qk.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||Oe(!1,`${this.name} must provide "resolveType" as a function, but got: ${B(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};Yn=class{constructor(t){var n;this.name=Dn(t.name),this.description=t.description,this.extensions=or(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=Yk(this.name,t.values),this._valueLookup=new Map(this._values.map(r=>[r.value,r])),this._nameLookup=Qn(this._values,r=>r.name)}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(t){return this._nameLookup[t]}serialize(t){let n=this._valueLookup.get(t);if(n===void 0)throw new k(`Enum "${this.name}" cannot represent value: ${B(t)}`);return n.name}parseValue(t){if(typeof t!="string"){let r=B(t);throw new k(`Enum "${this.name}" cannot represent non-string value: ${r}.`+zp(this,r))}let n=this.getValue(t);if(n==null)throw new k(`Value "${t}" does not exist in "${this.name}" enum.`+zp(this,t));return n.value}parseLiteral(t,n){if(t.kind!==_.ENUM){let i=Ve(t);throw new k(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+zp(this,i),{nodes:t})}let r=this.getValue(t.value);if(r==null){let i=Ve(t);throw new k(`Value "${i}" does not exist in "${this.name}" enum.`+zp(this,i),{nodes:t})}return r.value}toConfig(){let t=kr(this.getValues(),n=>n.name,n=>({description:n.description,value:n.value,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,values:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};_r=class{constructor(t){var n;this.name=Dn(t.name),this.description=t.description,this.extensions=or(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=Jk.bind(void 0,t)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){let t=ni(this.getFields(),n=>({description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,fields:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}});function ca(e,t){return e===t?!0:Te(e)&&Te(t)||qe(e)&&qe(t)?ca(e.ofType,t.ofType):!1}function ii(e,t,n){return t===n?!0:Te(n)?Te(t)?ii(e,t.ofType,n.ofType):!1:Te(t)?ii(e,t.ofType,n):qe(n)?qe(t)?ii(e,t.ofType,n.ofType):!1:qe(t)?!1:Pn(n)&&(Ce(t)||we(t))&&e.isSubType(n,t)}function au(e,t,n){return t===n?!0:Pn(t)?Pn(n)?e.getPossibleTypes(t).some(r=>e.isSubType(n,r)):e.isSubType(t,n):Pn(n)?e.isSubType(n,t):!1}var Xc=j(()=>{"use strict";d();f();p();tt()});function si(e){return _i.some(({name:t})=>e.name===t)}function Hc(e){if(Zt(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!Zt(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}var uu,cu,Xp,Hp,Ft,Mn,lu,_i,bi=j(()=>{"use strict";d();f();p();mt();gi();Re();at();gr();tt();uu=2147483647,cu=-2147483648,Xp=new xn({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){let t=Hc(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isInteger(n))throw new k(`Int cannot represent non-integer value: ${B(t)}`);if(n>uu||nuu||euu||tt===e.name)}var Un,du,pu,fu,Si,mu,Jn,dr=j(()=>{"use strict";d();f();p();rr();mt();Cc();gi();Yp();eu();Gc();tt();bi();Un=class{constructor(t){var n,r;this.name=Dn(t.name),this.description=t.description,this.locations=t.locations,this.isRepeatable=(n=t.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=or(t.extensions),this.astNode=t.astNode,Array.isArray(t.locations)||Oe(!1,`@${t.name} locations must be an Array.`);let i=(r=t.args)!==null&&r!==void 0?r:{};Zt(i)&&!Array.isArray(i)||Oe(!1,`@${t.name} args must be an object with argument names as keys.`),this.args=$T(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:VT(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}},du=new Un({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[Ne.FIELD,Ne.FRAGMENT_SPREAD,Ne.INLINE_FRAGMENT],args:{if:{type:new xe(Mn),description:"Included when true."}}}),pu=new Un({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[Ne.FIELD,Ne.FRAGMENT_SPREAD,Ne.INLINE_FRAGMENT],args:{if:{type:new xe(Mn),description:"Skipped when true."}}}),fu="No longer supported",Si=new Un({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[Ne.FIELD_DEFINITION,Ne.ARGUMENT_DEFINITION,Ne.INPUT_FIELD_DEFINITION,Ne.ENUM_VALUE],args:{reason:{type:Ft,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:fu}}}),mu=new Un({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[Ne.SCALAR],args:{url:{type:new xe(Ft),description:"The URL that specifies the behavior of this scalar."}}}),Jn=Object.freeze([du,pu,Si,mu])});function hu(e){return typeof e=="object"&&typeof(e==null?void 0:e[Symbol.iterator])=="function"}var Wp=j(()=>{"use strict";d();f();p()});function Cn(e,t){if(Te(t)){let n=Cn(e,t.ofType);return(n==null?void 0:n.kind)===_.NULL?null:n}if(e===null)return{kind:_.NULL};if(e===void 0)return null;if(qe(t)){let n=t.ofType;if(hu(e)){let r=[];for(let i of e){let s=Cn(i,n);s!=null&&r.push(s)}return{kind:_.LIST,values:r}}return Cn(e,n)}if(Be(t)){if(!Zt(e))return null;let n=[];for(let r of Object.values(t.getFields())){let i=Cn(e[r.name],r.type);i&&n.push({kind:_.OBJECT_FIELD,name:{kind:_.NAME,value:r.name},value:i})}return{kind:_.OBJECT,fields:n}}if(yn(t)){let n=t.serialize(e);if(n==null)return null;if(typeof n=="boolean")return{kind:_.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){let r=String(n);return Ib.test(r)?{kind:_.INT,value:r}:{kind:_.FLOAT,value:r}}if(typeof n=="string")return it(t)?{kind:_.ENUM,value:n}:t===lu&&Ib.test(n)?{kind:_.INT,value:n}:{kind:_.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${B(n)}.`)}Xe(!1,"Unexpected input type: "+B(t))}var Ib,Wc=j(()=>{"use strict";d();f();p();mt();qn();Wp();gi();at();tt();bi();Ib=/^-?(?:0|[1-9][0-9]*)$/});function zn(e){return Di.some(({name:t})=>e.name===t)}var la,Zc,el,pr,tl,da,nl,pt,rl,is,ss,os,Di,Pr=j(()=>{"use strict";d();f();p();mt();qn();eu();gr();Wc();tt();bi();la=new fn({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:Ft,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new xe(new wt(new xe(pr))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new xe(pr),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:pr,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:pr,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new xe(new wt(new xe(Zc))),resolve:e=>e.getDirectives()}})}),Zc=new fn({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 Ge(zt),resolve:e=>e.name},description:{type:zt,resolve:e=>e.description},isRepeatable:{type:new Ge(Jn),resolve:e=>e.isRepeatable},locations:{type:new Ge(new Jt(new Ge(Ul))),resolve:e=>e.locations},args:{type:new Ge(new Jt(new Ge(ja))),args:{includeDeprecated:{type:Jn,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}}})}),Ul=new ir({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:Ae.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:Ae.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:Ae.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:Ae.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:Ae.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:Ae.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:Ae.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:Ae.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:Ae.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:Ae.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:Ae.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:Ae.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:Ae.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:Ae.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:Ae.UNION,description:"Location adjacent to a union definition."},ENUM:{value:Ae.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:Ae.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:Ae.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:Ae.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Ar=new On({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 Ge($l),resolve(e){if(sn(e))return wt.SCALAR;if(Ue(e))return wt.OBJECT;if(ze(e))return wt.INTERFACE;if(At(e))return wt.UNION;if(gt(e))return wt.ENUM;if(He(e))return wt.INPUT_OBJECT;if(tt(e))return wt.LIST;if(Oe(e))return wt.NON_NULL;ut(!1,`Unexpected type: "${q(e)}".`)}},name:{type:zt,resolve:e=>"name"in e?e.name:void 0},description:{type:zt,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:zt,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new Jt(new Ge(jl)),args:{includeDeprecated:{type:Jn,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Ue(e)||ze(e)){let n=Object.values(e.getFields());return t?n:n.filter(r=>r.deprecationReason==null)}}},interfaces:{type:new Jt(new Ge(Ar)),resolve(e){if(Ue(e)||ze(e))return e.getInterfaces()}},possibleTypes:{type:new Jt(new Ge(Ar)),resolve(e,t,n,{schema:r}){if(Yn(e))return r.getPossibleTypes(e)}},enumValues:{type:new Jt(new Ge(Vl)),args:{includeDeprecated:{type:Jn,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(gt(e)){let n=e.getValues();return t?n:n.filter(r=>r.deprecationReason==null)}}},inputFields:{type:new Jt(new Ge(ja)),args:{includeDeprecated:{type:Jn,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(He(e)){let n=Object.values(e.getFields());return t?n:n.filter(r=>r.deprecationReason==null)}}},ofType:{type:Ar,resolve:e=>"ofType"in e?e.ofType:void 0}})}),jl=new On({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 Ge(zt),resolve:e=>e.name},description:{type:zt,resolve:e=>e.description},args:{type:new Ge(new Jt(new Ge(ja))),args:{includeDeprecated:{type:Jn,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new Ge(Ar),resolve:e=>e.type},isDeprecated:{type:new Ge(Jn),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:zt,resolve:e=>e.deprecationReason}})}),ja=new On({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 Ge(zt),resolve:e=>e.name},description:{type:zt,resolve:e=>e.description},type:{type:new Ge(Ar),resolve:e=>e.type},defaultValue:{type:zt,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:n}=e,r=Xn(n,t);return r?Ze(r):null}},isDeprecated:{type:new Ge(Jn),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:zt,resolve:e=>e.deprecationReason}})}),Vl=new On({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 Ge(zt),resolve:e=>e.name},description:{type:zt,resolve:e=>e.description},isDeprecated:{type:new Ge(Jn),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:zt,resolve:e=>e.deprecationReason}})});(function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"})(wt||(wt={}));$l=new ir({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:wt.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:wt.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:wt.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:wt.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:wt.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:wt.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:wt.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:wt.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Vo={name:"__schema",type:new Ge(Ua),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},$o={name:"__type",type:Ar,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new Ge(zt),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Go={name:"__typename",type:new Ge(zt),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Xi=Object.freeze([Ua,Ml,Ul,Ar,jl,ja,Vl,$l])});function rm(e){return Tr(e,wr)}function Va(e){if(!rm(e))throw new Error(`Expected ${q(e)} to be a GraphQL schema.`);return e}function Ri(e,t){let n=Zt(e);if(!t.has(n)){if(t.add(n),At(n))for(let r of n.getTypes())Ri(r,t);else if(Ue(n)||ze(n)){for(let r of n.getInterfaces())Ri(r,t);for(let r of Object.values(n.getFields())){Ri(r.type,t);for(let i of r.args)Ri(i.type,t)}}else if(He(n))for(let r of Object.values(n.getFields()))Ri(r.type,t)}return t}var wr,$a=Y(()=>{"use strict";d();m();f();yr();xt();Il();Bi();Hf();Ki();ht();Dr();ri();wr=class{constructor(t){var n,r;this.__validationErrors=t.assumeValid===!0?[]:void 0,hn(t)||xe(!1,"Must provide configuration object."),!t.types||Array.isArray(t.types)||xe(!1,`"types" must be Array if provided but got: ${q(t.types)}.`),!t.directives||Array.isArray(t.directives)||xe(!1,`"directives" must be Array if provided but got: ${q(t.directives)}.`),this.description=t.description,this.extensions=Nr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(r=t.directives)!==null&&r!==void 0?r:or;let i=new Set(t.types);if(t.types!=null)for(let o of t.types)i.delete(o),Ri(o,i);this._queryType!=null&&Ri(this._queryType,i),this._mutationType!=null&&Ri(this._mutationType,i),this._subscriptionType!=null&&Ri(this._subscriptionType,i);for(let o of this._directives)if(ea(o))for(let s of o.args)Ri(s.type,i);Ri(Ua,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let o of i){if(o==null)continue;let s=o.name;if(s||xe(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[s]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${s}".`);if(this._typeMap[s]=o,ze(o)){for(let a of o.getInterfaces())if(ze(a)){let c=this._implementationsMap[a.name];c===void 0&&(c=this._implementationsMap[a.name]={objects:[],interfaces:[]}),c.interfaces.push(o)}}else if(Ue(o)){for(let a of o.getInterfaces())if(ze(a)){let c=this._implementationsMap[a.name];c===void 0&&(c=this._implementationsMap[a.name]={objects:[],interfaces:[]}),c.objects.push(o)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case Yt.QUERY:return this.getQueryType();case Yt.MUTATION:return this.getMutationType();case Yt.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return At(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){let n=this._implementationsMap[t.name];return n!=null?n:{objects:[],interfaces:[]}}isSubType(t,n){let r=this._subTypeMap[t.name];if(r===void 0){if(r=Object.create(null),At(t))for(let i of t.getTypes())r[i.name]=!0;else{let i=this.getImplementations(t);for(let o of i.objects)r[o.name]=!0;for(let o of i.interfaces)r[o.name]=!0}this._subTypeMap[t.name]=r}return r[n.name]!==void 0}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(n=>n.name===t)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}});function Hu(e){if(Va(e),e.__validationErrors)return e.__validationErrors;let t=new EE(e);aM(t),uM(t),cM(t);let n=t.getErrors();return e.__validationErrors=n,n}function qa(e){let t=Hu(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(` +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 xe(Ft),resolve:e=>e.name},description:{type:Ft,resolve:e=>e.description},isRepeatable:{type:new xe(Mn),resolve:e=>e.isRepeatable},locations:{type:new xe(new wt(new xe(el))),resolve:e=>e.locations},args:{type:new xe(new wt(new xe(da))),args:{includeDeprecated:{type:Mn,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}}})}),el=new Yn({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:Ne.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:Ne.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:Ne.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:Ne.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:Ne.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:Ne.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:Ne.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:Ne.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:Ne.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:Ne.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:Ne.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:Ne.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:Ne.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:Ne.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:Ne.UNION,description:"Location adjacent to a union definition."},ENUM:{value:Ne.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:Ne.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:Ne.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:Ne.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),pr=new fn({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 xe(rl),resolve(e){if(qt(e))return pt.SCALAR;if(we(e))return pt.OBJECT;if(Ce(e))return pt.INTERFACE;if(dt(e))return pt.UNION;if(it(e))return pt.ENUM;if(Be(e))return pt.INPUT_OBJECT;if(qe(e))return pt.LIST;if(Te(e))return pt.NON_NULL;Xe(!1,`Unexpected type: "${B(e)}".`)}},name:{type:Ft,resolve:e=>"name"in e?e.name:void 0},description:{type:Ft,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:Ft,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new wt(new xe(tl)),args:{includeDeprecated:{type:Mn,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(we(e)||Ce(e)){let n=Object.values(e.getFields());return t?n:n.filter(r=>r.deprecationReason==null)}}},interfaces:{type:new wt(new xe(pr)),resolve(e){if(we(e)||Ce(e))return e.getInterfaces()}},possibleTypes:{type:new wt(new xe(pr)),resolve(e,t,n,{schema:r}){if(Pn(e))return r.getPossibleTypes(e)}},enumValues:{type:new wt(new xe(nl)),args:{includeDeprecated:{type:Mn,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(it(e)){let n=e.getValues();return t?n:n.filter(r=>r.deprecationReason==null)}}},inputFields:{type:new wt(new xe(da)),args:{includeDeprecated:{type:Mn,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Be(e)){let n=Object.values(e.getFields());return t?n:n.filter(r=>r.deprecationReason==null)}}},ofType:{type:pr,resolve:e=>"ofType"in e?e.ofType:void 0}})}),tl=new fn({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 xe(Ft),resolve:e=>e.name},description:{type:Ft,resolve:e=>e.description},args:{type:new xe(new wt(new xe(da))),args:{includeDeprecated:{type:Mn,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new xe(pr),resolve:e=>e.type},isDeprecated:{type:new xe(Mn),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:Ft,resolve:e=>e.deprecationReason}})}),da=new fn({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 xe(Ft),resolve:e=>e.name},description:{type:Ft,resolve:e=>e.description},type:{type:new xe(pr),resolve:e=>e.type},defaultValue:{type:Ft,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:n}=e,r=Cn(n,t);return r?Ve(r):null}},isDeprecated:{type:new xe(Mn),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:Ft,resolve:e=>e.deprecationReason}})}),nl=new fn({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 xe(Ft),resolve:e=>e.name},description:{type:Ft,resolve:e=>e.description},isDeprecated:{type:new xe(Mn),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:Ft,resolve:e=>e.deprecationReason}})});(function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"})(pt||(pt={}));rl=new Yn({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:pt.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:pt.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:pt.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:pt.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:pt.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:pt.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:pt.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:pt.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),is={name:"__schema",type:new xe(la),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},ss={name:"__type",type:pr,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new xe(Ft),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},os={name:"__typename",type:new xe(Ft),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Di=Object.freeze([la,Zc,el,pr,tl,da,nl,rl])});function Zp(e){return ir(e,fr)}function pa(e){if(!Zp(e))throw new Error(`Expected ${B(e)} to be a GraphQL schema.`);return e}function oi(e,t){let n=Ct(e);if(!t.has(n)){if(t.add(n),dt(n))for(let r of n.getTypes())oi(r,t);else if(we(n)||Ce(n)){for(let r of n.getInterfaces())oi(r,t);for(let r of Object.values(n.getFields())){oi(r.type,t);for(let i of r.args)oi(i.type,t)}}else if(Be(n))for(let r of Object.values(n.getFields()))oi(r.type,t)}return t}var fr,fa=j(()=>{"use strict";d();f();p();rr();mt();Cc();gi();Yp();Ii();tt();dr();Pr();fr=class{constructor(t){var n,r;this.__validationErrors=t.assumeValid===!0?[]:void 0,Zt(t)||Oe(!1,"Must provide configuration object."),!t.types||Array.isArray(t.types)||Oe(!1,`"types" must be Array if provided but got: ${B(t.types)}.`),!t.directives||Array.isArray(t.directives)||Oe(!1,`"directives" must be Array if provided but got: ${B(t.directives)}.`),this.description=t.description,this.extensions=or(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(r=t.directives)!==null&&r!==void 0?r:Jn;let i=new Set(t.types);if(t.types!=null)for(let s of t.types)i.delete(s),oi(s,i);this._queryType!=null&&oi(this._queryType,i),this._mutationType!=null&&oi(this._mutationType,i),this._subscriptionType!=null&&oi(this._subscriptionType,i);for(let s of this._directives)if(go(s))for(let o of s.args)oi(o.type,i);oi(la,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let s of i){if(s==null)continue;let o=s.name;if(o||Oe(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[o]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${o}".`);if(this._typeMap[o]=s,Ce(s)){for(let a of s.getInterfaces())if(Ce(a)){let u=this._implementationsMap[a.name];u===void 0&&(u=this._implementationsMap[a.name]={objects:[],interfaces:[]}),u.interfaces.push(s)}}else if(we(s)){for(let a of s.getInterfaces())if(Ce(a)){let u=this._implementationsMap[a.name];u===void 0&&(u=this._implementationsMap[a.name]={objects:[],interfaces:[]}),u.objects.push(s)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case At.QUERY:return this.getQueryType();case At.MUTATION:return this.getMutationType();case At.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return dt(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){let n=this._implementationsMap[t.name];return n!=null?n:{objects:[],interfaces:[]}}isSubType(t,n){let r=this._subTypeMap[t.name];if(r===void 0){if(r=Object.create(null),dt(t))for(let i of t.getTypes())r[i.name]=!0;else{let i=this.getImplementations(t);for(let s of i.objects)r[s.name]=!0;for(let s of i.interfaces)r[s.name]=!0}this._subTypeMap[t.name]=r}return r[n.name]!==void 0}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(n=>n.name===t)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}});function Tu(e){if(pa(e),e.__validationErrors)return e.__validationErrors;let t=new qT(e);zk(t),Xk(t),Hk(t);let n=t.getErrors();return e.__validationErrors=n,n}function ha(e){let t=Tu(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(` -`))}function aM(e){let t=e.schema,n=t.getQueryType();if(!n)e.reportError("Query root type must be provided.",t.astNode);else if(!Ue(n)){var r;e.reportError(`Query root type must be Object type, it cannot be ${q(n)}.`,(r=TE(t,Yt.QUERY))!==null&&r!==void 0?r:n.astNode)}let i=t.getMutationType();if(i&&!Ue(i)){var o;e.reportError(`Mutation root type must be Object type if provided, it cannot be ${q(i)}.`,(o=TE(t,Yt.MUTATION))!==null&&o!==void 0?o:i.astNode)}let s=t.getSubscriptionType();if(s&&!Ue(s)){var a;e.reportError(`Subscription root type must be Object type if provided, it cannot be ${q(s)}.`,(a=TE(t,Yt.SUBSCRIPTION))!==null&&a!==void 0?a:s.astNode)}}function TE(e,t){var n;return(n=[e.astNode,...e.extensionASTNodes].flatMap(r=>{var i;return(i=r==null?void 0:r.operationTypes)!==null&&i!==void 0?i:[]}).find(r=>r.operation===t))===null||n===void 0?void 0:n.type}function uM(e){for(let n of e.schema.getDirectives()){if(!ea(n)){e.reportError(`Expected directive but got: ${q(n)}.`,n==null?void 0:n.astNode);continue}Ga(e,n);for(let r of n.args)if(Ga(e,r),vn(r.type)||e.reportError(`The type of @${n.name}(${r.name}:) must be Input Type but got: ${q(r.type)}.`,r.astNode),Kr(r)&&r.deprecationReason!=null){var t;e.reportError(`Required argument @${n.name}(${r.name}:) cannot be deprecated.`,[NE(r.astNode),(t=r.astNode)===null||t===void 0?void 0:t.type])}}}function Ga(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function cM(e){let t=hM(e),n=e.schema.getTypeMap();for(let r of Object.values(n)){if(!Uo(r)){e.reportError(`Expected GraphQL named type but got: ${q(r)}.`,r.astNode);continue}sr(r)||Ga(e,r),Ue(r)||ze(r)?(bS(e,r),_S(e,r)):At(r)?dM(e,r):gt(r)?fM(e,r):He(r)&&(mM(e,r),t(r))}}function bS(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let s of n){if(Ga(e,s),!Br(s.type)){var r;e.reportError(`The type of ${t.name}.${s.name} must be Output Type but got: ${q(s.type)}.`,(r=s.astNode)===null||r===void 0?void 0:r.type)}for(let a of s.args){let c=a.name;if(Ga(e,a),!vn(a.type)){var i;e.reportError(`The type of ${t.name}.${s.name}(${c}:) must be Input Type but got: ${q(a.type)}.`,(i=a.astNode)===null||i===void 0?void 0:i.type)}if(Kr(a)&&a.deprecationReason!=null){var o;e.reportError(`Required argument ${t.name}.${s.name}(${c}:) cannot be deprecated.`,[NE(a.astNode),(o=a.astNode)===null||o===void 0?void 0:o.type])}}}}function _S(e,t){let n=Object.create(null);for(let r of t.getInterfaces()){if(!ze(r)){e.reportError(`Type ${q(t)} must only implement Interface types, it cannot implement ${q(r)}.`,Gl(t,r));continue}if(t===r){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,Gl(t,r));continue}if(n[r.name]){e.reportError(`Type ${t.name} can only implement ${r.name} once.`,Gl(t,r));continue}n[r.name]=!0,pM(e,t,r),lM(e,t,r)}}function lM(e,t,n){let r=t.getFields();for(let c of Object.values(n.getFields())){let u=c.name,l=r[u];if(!l){e.reportError(`Interface field ${n.name}.${u} expected but ${t.name} does not provide it.`,[c.astNode,t.astNode,...t.extensionASTNodes]);continue}if(!Ai(e.schema,l.type,c.type)){var i,o;e.reportError(`Interface field ${n.name}.${u} expects type ${q(c.type)} but ${t.name}.${u} is type ${q(l.type)}.`,[(i=c.astNode)===null||i===void 0?void 0:i.type,(o=l.astNode)===null||o===void 0?void 0:o.type])}for(let p of c.args){let h=p.name,y=l.args.find(N=>N.name===h);if(!y){e.reportError(`Interface field argument ${n.name}.${u}(${h}:) expected but ${t.name}.${u} does not provide it.`,[p.astNode,l.astNode]);continue}if(!Ma(p.type,y.type)){var s,a;e.reportError(`Interface field argument ${n.name}.${u}(${h}:) expects type ${q(p.type)} but ${t.name}.${u}(${h}:) is type ${q(y.type)}.`,[(s=p.astNode)===null||s===void 0?void 0:s.type,(a=y.astNode)===null||a===void 0?void 0:a.type])}}for(let p of l.args){let h=p.name;!c.args.find(N=>N.name===h)&&Kr(p)&&e.reportError(`Object field ${t.name}.${u} includes required argument ${h} that is missing from the Interface field ${n.name}.${u}.`,[p.astNode,c.astNode])}}}function pM(e,t,n){let r=t.getInterfaces();for(let i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...Gl(n,i),...Gl(t,n)])}function dM(e,t){let n=t.getTypes();n.length===0&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let r=Object.create(null);for(let i of n){if(r[i.name]){e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,OS(t,i.name));continue}r[i.name]=!0,Ue(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${q(i)}.`,OS(t,String(i)))}}function fM(e,t){let n=t.getValues();n.length===0&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(let r of n)Ga(e,r)}function mM(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let o of n){if(Ga(e,o),!vn(o.type)){var r;e.reportError(`The type of ${t.name}.${o.name} must be Input Type but got: ${q(o.type)}.`,(r=o.astNode)===null||r===void 0?void 0:r.type)}if(jo(o)&&o.deprecationReason!=null){var i;e.reportError(`Required input field ${t.name}.${o.name} cannot be deprecated.`,[NE(o.astNode),(i=o.astNode)===null||i===void 0?void 0:i.type])}}}function hM(e){let t=Object.create(null),n=[],r=Object.create(null);return i;function i(o){if(t[o.name])return;t[o.name]=!0,r[o.name]=n.length;let s=Object.values(o.getFields());for(let a of s)if(Oe(a.type)&&He(a.type.ofType)){let c=a.type.ofType,u=r[c.name];if(n.push(a),u===void 0)i(c);else{let l=n.slice(u),p=l.map(h=>h.name).join(".");e.reportError(`Cannot reference Input Object "${c.name}" within itself through a series of non-null fields: "${p}".`,l.map(h=>h.astNode))}n.pop()}r[o.name]=void 0}}function Gl(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n!=null?[n,...r]:r).flatMap(o=>{var s;return(s=o.interfaces)!==null&&s!==void 0?s:[]}).filter(o=>o.name.value===t.name)}function OS(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n!=null?[n,...r]:r).flatMap(o=>{var s;return(s=o.types)!==null&&s!==void 0?s:[]}).filter(o=>o.name.value===t)}function NE(e){var t;return e==null||(t=e.directives)===null||t===void 0?void 0:t.find(n=>n.name.value===zi.name)}var EE,ql=Y(()=>{"use strict";d();m();f();xt();Ve();Ki();Pl();ht();Dr();ri();$a();EE=class{constructor(t){this._errors=[],this.schema=t}reportError(t,n){let r=Array.isArray(n)?n.filter(Boolean):n;this._errors.push(new j(t,{nodes:r}))}getErrors(){return this._errors}}});function en(e,t){switch(t.kind){case b.LIST_TYPE:{let n=en(e,t.type);return n&&new Jt(n)}case b.NON_NULL_TYPE:{let n=en(e,t.type);return n&&new Ge(n)}case b.NAMED_TYPE:return e.getType(t.name.value)}}var Hi=Y(()=>{"use strict";d();m();f();vt();ht()});function yM(e,t,n){let r=n.name.value;if(r===Vo.name&&e.getQueryType()===t)return Vo;if(r===$o.name&&e.getQueryType()===t)return $o;if(r===Go.name&&gr(t))return Go;if(Ue(t)||ze(t))return t.getFields()[r]}function Ba(e,t){return{enter(...n){let r=n[0];e.enter(r);let i=Mo(t,r.kind).enter;if(i){let o=i.apply(t,n);return o!==void 0&&(e.leave(r),Tl(o)&&e.enter(o)),o}},leave(...n){let r=n[0],i=Mo(t,r.kind).leave,o;return i&&(o=i.apply(t,n)),e.leave(r),o}}}var qo,im=Y(()=>{"use strict";d();m();f();Ki();vt();ka();ht();ri();Hi();qo=class{constructor(t,n,r){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=r!=null?r:yM,n&&(vn(n)&&this._inputTypeStack.push(n),gr(n)&&this._parentTypeStack.push(n),Br(n)&&this._typeStack.push(n))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(t){let n=this._schema;switch(t.kind){case b.SELECTION_SET:{let i=Zt(this.getType());this._parentTypeStack.push(gr(i)?i:void 0);break}case b.FIELD:{let i=this.getParentType(),o,s;i&&(o=this._getFieldDef(n,i,t),o&&(s=o.type)),this._fieldDefStack.push(o),this._typeStack.push(Br(s)?s:void 0);break}case b.DIRECTIVE:this._directive=n.getDirective(t.name.value);break;case b.OPERATION_DEFINITION:{let i=n.getRootType(t.operation);this._typeStack.push(Ue(i)?i:void 0);break}case b.INLINE_FRAGMENT:case b.FRAGMENT_DEFINITION:{let i=t.typeCondition,o=i?en(n,i):Zt(this.getType());this._typeStack.push(Br(o)?o:void 0);break}case b.VARIABLE_DEFINITION:{let i=en(n,t.type);this._inputTypeStack.push(vn(i)?i:void 0);break}case b.ARGUMENT:{var r;let i,o,s=(r=this.getDirective())!==null&&r!==void 0?r:this.getFieldDef();s&&(i=s.args.find(a=>a.name===t.name.value),i&&(o=i.type)),this._argument=i,this._defaultValueStack.push(i?i.defaultValue:void 0),this._inputTypeStack.push(vn(o)?o:void 0);break}case b.LIST:{let i=Ca(this.getInputType()),o=tt(i)?i.ofType:i;this._defaultValueStack.push(void 0),this._inputTypeStack.push(vn(o)?o:void 0);break}case b.OBJECT_FIELD:{let i=Zt(this.getInputType()),o,s;He(i)&&(s=i.getFields()[t.name.value],s&&(o=s.type)),this._defaultValueStack.push(s?s.defaultValue:void 0),this._inputTypeStack.push(vn(o)?o:void 0);break}case b.ENUM:{let i=Zt(this.getInputType()),o;gt(i)&&(o=i.getValue(t.value)),this._enumValue=o;break}default:}}leave(t){switch(t.kind){case b.SELECTION_SET:this._parentTypeStack.pop();break;case b.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case b.DIRECTIVE:this._directive=null;break;case b.OPERATION_DEFINITION:case b.INLINE_FRAGMENT:case b.FRAGMENT_DEFINITION:this._typeStack.pop();break;case b.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case b.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case b.LIST:case b.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case b.ENUM:this._enumValue=null;break;default:}}}});function gE(e){return Wu(e)||Zu(e)||ec(e)}function Wu(e){return e.kind===b.OPERATION_DEFINITION||e.kind===b.FRAGMENT_DEFINITION}function vE(e){return e.kind===b.FIELD||e.kind===b.FRAGMENT_SPREAD||e.kind===b.INLINE_FRAGMENT}function om(e){return e.kind===b.VARIABLE||e.kind===b.INT||e.kind===b.FLOAT||e.kind===b.STRING||e.kind===b.BOOLEAN||e.kind===b.NULL||e.kind===b.ENUM||e.kind===b.LIST||e.kind===b.OBJECT}function Bl(e){return om(e)&&(e.kind===b.LIST?e.values.some(Bl):e.kind===b.OBJECT?e.fields.some(t=>Bl(t.value)):e.kind!==b.VARIABLE)}function IE(e){return e.kind===b.NAMED_TYPE||e.kind===b.LIST_TYPE||e.kind===b.NON_NULL_TYPE}function Zu(e){return e.kind===b.SCHEMA_DEFINITION||ii(e)||e.kind===b.DIRECTIVE_DEFINITION}function ii(e){return e.kind===b.SCALAR_TYPE_DEFINITION||e.kind===b.OBJECT_TYPE_DEFINITION||e.kind===b.INTERFACE_TYPE_DEFINITION||e.kind===b.UNION_TYPE_DEFINITION||e.kind===b.ENUM_TYPE_DEFINITION||e.kind===b.INPUT_OBJECT_TYPE_DEFINITION}function ec(e){return e.kind===b.SCHEMA_EXTENSION||na(e)}function na(e){return e.kind===b.SCALAR_TYPE_EXTENSION||e.kind===b.OBJECT_TYPE_EXTENSION||e.kind===b.INTERFACE_TYPE_EXTENSION||e.kind===b.UNION_TYPE_EXTENSION||e.kind===b.ENUM_TYPE_EXTENSION||e.kind===b.INPUT_OBJECT_TYPE_EXTENSION}var Ka=Y(()=>{"use strict";d();m();f();vt()});function Kl(e){return{Document(t){for(let n of t.definitions)if(!Wu(n)){let r=n.kind===b.SCHEMA_DEFINITION||n.kind===b.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new j(`The ${r} definition is not executable.`,{nodes:n}))}return!1}}}var bE=Y(()=>{"use strict";d();m();f();Ve();vt();Ka()});function Ql(e){return{Field(t){let n=e.getParentType();if(n&&!e.getFieldDef()){let i=e.getSchema(),o=t.name.value,s=nr("to use an inline fragment on",TM(i,n,o));s===""&&(s=nr(EM(n,o))),e.reportError(new j(`Cannot query field "${o}" on type "${n.name}".`+s,{nodes:t}))}}}}function TM(e,t,n){if(!Yn(t))return[];let r=new Set,i=Object.create(null);for(let s of e.getPossibleTypes(t))if(s.getFields()[n]){r.add(s),i[s.name]=1;for(let a of s.getInterfaces()){var o;a.getFields()[n]&&(r.add(a),i[a.name]=((o=i[a.name])!==null&&o!==void 0?o:0)+1)}}return[...r].sort((s,a)=>{let c=i[a.name]-i[s.name];return c!==0?c:ze(s)&&e.isSubType(s,a)?-1:ze(a)&&e.isSubType(a,s)?1:Co(s.name,a.name)}).map(s=>s.name)}function EM(e,t){if(Ue(e)||ze(e)){let n=Object.keys(e.getFields());return Er(t,n)}return[]}var _E=Y(()=>{"use strict";d();m();f();zs();Ol();Hs();Ve();ht()});function Yl(e){return{InlineFragment(t){let n=t.typeCondition;if(n){let r=en(e.getSchema(),n);if(r&&!gr(r)){let i=Ze(n);e.reportError(new j(`Fragment cannot condition on non composite type "${i}".`,{nodes:n}))}}},FragmentDefinition(t){let n=en(e.getSchema(),t.typeCondition);if(n&&!gr(n)){let r=Ze(t.typeCondition);e.reportError(new j(`Fragment "${t.name.value}" cannot condition on non composite type "${r}".`,{nodes:t.typeCondition}))}}}}var OE=Y(()=>{"use strict";d();m();f();Ve();Vr();ht();Hi()});function Jl(e){return x(D({},SE(e)),{Argument(t){let n=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!n&&r&&i){let o=t.name.value,s=r.args.map(c=>c.name),a=Er(o,s);e.reportError(new j(`Unknown argument "${o}" on field "${i.name}.${r.name}".`+nr(a),{nodes:t}))}}})}function SE(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():or;for(let s of r)t[s.name]=s.args.map(a=>a.name);let i=e.getDocument().definitions;for(let s of i)if(s.kind===b.DIRECTIVE_DEFINITION){var o;let a=(o=s.arguments)!==null&&o!==void 0?o:[];t[s.name.value]=a.map(c=>c.name.value)}return{Directive(s){let a=s.name.value,c=t[a];if(s.arguments&&c)for(let u of s.arguments){let l=u.name.value;if(!c.includes(l)){let p=Er(l,c);e.reportError(new j(`Unknown argument "${l}" on directive "@${a}".`+nr(p),{nodes:u}))}}return!1}}}var DE=Y(()=>{"use strict";d();m();f();zs();Hs();Ve();vt();Dr()});function tc(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():or;for(let o of r)t[o.name]=o.locations;let i=e.getDocument().definitions;for(let o of i)o.kind===b.DIRECTIVE_DEFINITION&&(t[o.name.value]=o.locations.map(s=>s.value));return{Directive(o,s,a,c,u){let l=o.name.value,p=t[l];if(!p){e.reportError(new j(`Unknown directive "@${l}".`,{nodes:o}));return}let h=NM(u);h&&!p.includes(h)&&e.reportError(new j(`Directive "@${l}" may not be used on ${h}.`,{nodes:o}))}}}function NM(e){let t=e[e.length-1];switch("kind"in t||ut(!1),t.kind){case b.OPERATION_DEFINITION:return gM(t.operation);case b.FIELD:return Ae.FIELD;case b.FRAGMENT_SPREAD:return Ae.FRAGMENT_SPREAD;case b.INLINE_FRAGMENT:return Ae.INLINE_FRAGMENT;case b.FRAGMENT_DEFINITION:return Ae.FRAGMENT_DEFINITION;case b.VARIABLE_DEFINITION:return Ae.VARIABLE_DEFINITION;case b.SCHEMA_DEFINITION:case b.SCHEMA_EXTENSION:return Ae.SCHEMA;case b.SCALAR_TYPE_DEFINITION:case b.SCALAR_TYPE_EXTENSION:return Ae.SCALAR;case b.OBJECT_TYPE_DEFINITION:case b.OBJECT_TYPE_EXTENSION:return Ae.OBJECT;case b.FIELD_DEFINITION:return Ae.FIELD_DEFINITION;case b.INTERFACE_TYPE_DEFINITION:case b.INTERFACE_TYPE_EXTENSION:return Ae.INTERFACE;case b.UNION_TYPE_DEFINITION:case b.UNION_TYPE_EXTENSION:return Ae.UNION;case b.ENUM_TYPE_DEFINITION:case b.ENUM_TYPE_EXTENSION:return Ae.ENUM;case b.ENUM_VALUE_DEFINITION:return Ae.ENUM_VALUE;case b.INPUT_OBJECT_TYPE_DEFINITION:case b.INPUT_OBJECT_TYPE_EXTENSION:return Ae.INPUT_OBJECT;case b.INPUT_VALUE_DEFINITION:{let n=e[e.length-3];return"kind"in n||ut(!1),n.kind===b.INPUT_OBJECT_TYPE_DEFINITION?Ae.INPUT_FIELD_DEFINITION:Ae.ARGUMENT_DEFINITION}default:ut(!1,"Unexpected kind: "+q(t.kind))}}function gM(e){switch(e){case Yt.QUERY:return Ae.QUERY;case Yt.MUTATION:return Ae.MUTATION;case Yt.SUBSCRIPTION:return Ae.SUBSCRIPTION}}var AE=Y(()=>{"use strict";d();m();f();xt();tr();Ve();Ki();xu();vt();Dr()});function zl(e){return{FragmentSpread(t){let n=t.name.value;e.getFragment(n)||e.reportError(new j(`Unknown fragment "${n}".`,{nodes:t.name}))}}}var wE=Y(()=>{"use strict";d();m();f();Ve()});function nc(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);for(let o of e.getDocument().definitions)ii(o)&&(r[o.name.value]=!0);let i=[...Object.keys(n),...Object.keys(r)];return{NamedType(o,s,a,c,u){let l=o.name.value;if(!n[l]&&!r[l]){var p;let h=(p=u[2])!==null&&p!==void 0?p:a,y=h!=null&&vM(h);if(y&&SS.includes(l))return;let N=Er(l,y?SS.concat(i):i);e.reportError(new j(`Unknown type "${l}".`+nr(N),{nodes:o}))}}}}function vM(e){return"kind"in e&&(Zu(e)||ec(e))}var SS,RE=Y(()=>{"use strict";d();m();f();zs();Hs();Ve();Ka();ri();Ji();SS=[...Yi,...Xi].map(e=>e.name)});function Xl(e){let t=0;return{Document(n){t=n.definitions.filter(r=>r.kind===b.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new j("This anonymous operation must be the only defined operation.",{nodes:n}))}}}var LE=Y(()=>{"use strict";d();m();f();Ve();vt()});function Hl(e){var t,n,r;let i=e.getSchema(),o=(t=(n=(r=i==null?void 0:i.astNode)!==null&&r!==void 0?r:i==null?void 0:i.getQueryType())!==null&&n!==void 0?n:i==null?void 0:i.getMutationType())!==null&&t!==void 0?t:i==null?void 0:i.getSubscriptionType(),s=0;return{SchemaDefinition(a){if(o){e.reportError(new j("Cannot define a new schema within a schema extension.",{nodes:a}));return}s>0&&e.reportError(new j("Must provide only one schema definition.",{nodes:a})),++s}}}var FE=Y(()=>{"use strict";d();m();f();Ve()});function Wl(e){let t=Object.create(null),n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(o){return i(o),!1}};function i(o){if(t[o.name.value])return;let s=o.name.value;t[s]=!0;let a=e.getFragmentSpreads(o.selectionSet);if(a.length!==0){r[s]=n.length;for(let c of a){let u=c.name.value,l=r[u];if(n.push(c),l===void 0){let p=e.getFragment(u);p&&i(p)}else{let p=n.slice(l),h=p.slice(0,-1).map(y=>'"'+y.name.value+'"').join(", ");e.reportError(new j(`Cannot spread fragment "${u}" within itself`+(h!==""?` via ${h}.`:"."),{nodes:p}))}n.pop()}r[s]=void 0}}}var kE=Y(()=>{"use strict";d();m();f();Ve()});function Zl(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i}of r){let o=i.name.value;t[o]!==!0&&e.reportError(new j(n.name?`Variable "$${o}" is not defined by operation "${n.name.value}".`:`Variable "$${o}" is not defined.`,{nodes:[i,n]}))}}},VariableDefinition(n){t[n.variable.name.value]=!0}}}var PE=Y(()=>{"use strict";d();m();f();Ve()});function ep(e){let t=[],n=[];return{OperationDefinition(r){return t.push(r),!1},FragmentDefinition(r){return n.push(r),!1},Document:{leave(){let r=Object.create(null);for(let i of t)for(let o of e.getRecursivelyReferencedFragments(i))r[o.name.value]=!0;for(let i of n){let o=i.name.value;r[o]!==!0&&e.reportError(new j(`Fragment "${o}" is never used.`,{nodes:i}))}}}}}var xE=Y(()=>{"use strict";d();m();f();Ve()});function tp(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(n){let r=Object.create(null),i=e.getRecursiveVariableUsages(n);for(let{node:o}of i)r[o.name.value]=!0;for(let o of t){let s=o.variable.name.value;r[s]!==!0&&e.reportError(new j(n.name?`Variable "$${s}" is never used in operation "${n.name.value}".`:`Variable "$${s}" is never used.`,{nodes:o}))}}},VariableDefinition(n){t.push(n)}}}var CE=Y(()=>{"use strict";d();m();f();Ve()});function rc(e){switch(e.kind){case b.OBJECT:return x(D({},e),{fields:IM(e.fields)});case b.LIST:return x(D({},e),{values:e.values.map(rc)});case b.INT:case b.FLOAT:case b.STRING:case b.BOOLEAN:case b.NULL:case b.ENUM:case b.VARIABLE:return e}}function IM(e){return e.map(t=>x(D({},t),{value:rc(t.value)})).sort((t,n)=>Co(t.name.value,n.name.value))}var ME=Y(()=>{"use strict";d();m();f();Ol();vt()});function AS(e){return Array.isArray(e)?e.map(([t,n])=>`subfields "${t}" conflict because `+AS(n)).join(" and "):e}function np(e){let t=new VE,n=new Map;return{SelectionSet(r){let i=bM(e,n,t,e.getParentType(),r);for(let[[o,s],a,c]of i){let u=AS(s);e.reportError(new j(`Fields "${o}" conflict because ${u}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:a.concat(c)}))}}}}function bM(e,t,n,r,i){let o=[],[s,a]=um(e,t,r,i);if(OM(e,o,t,n,s),a.length!==0)for(let c=0;c1)for(let a=0;a({kind:b.OBJECT_FIELD,name:i.name,value:i.value}))};return Ze(rc(r))}function UE(e,t){return tt(e)?tt(t)?UE(e.ofType,t.ofType):!0:tt(t)?!0:Oe(e)?Oe(t)?UE(e.ofType,t.ofType):!0:Oe(t)?!0:Rn(e)||Rn(t)?e!==t:!1}function um(e,t,n,r){let i=t.get(r);if(i)return i;let o=Object.create(null),s=Object.create(null);RS(e,n,r,o,s);let a=[o,Object.keys(s)];return t.set(r,a),a}function jE(e,t,n){let r=t.get(n.selectionSet);if(r)return r;let i=en(e.getSchema(),n.typeCondition);return um(e,t,i,n.selectionSet)}function RS(e,t,n,r,i){for(let o of n.selections)switch(o.kind){case b.FIELD:{let s=o.name.value,a;(Ue(t)||ze(t))&&(a=t.getFields()[s]);let c=o.alias?o.alias.value:s;r[c]||(r[c]=[]),r[c].push([t,o,a]);break}case b.FRAGMENT_SPREAD:i[o.name.value]=!0;break;case b.INLINE_FRAGMENT:{let s=o.typeCondition,a=s?en(e.getSchema(),s):t;RS(e,a,o.selectionSet,r,i);break}}}function SM(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()]]}var VE,GE=Y(()=>{"use strict";d();m();f();xt();Ve();vt();Vr();ht();ME();Hi();VE=class{constructor(){this._data=new Map}has(t,n,r){var i;let[o,s]=t{"use strict";d();m();f();xt();Ve();ht();Pl();Hi()});function ip(e){let t=e.getSchema(),n=Object.create(null);for(let i of e.getDocument().definitions)ii(i)&&(n[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[o],a=t==null?void 0:t.getType(o),c;if(s?c=AM[s.kind]:a&&(c=wM(a)),c){if(c!==i.kind){let u=RM(i.kind);e.reportError(new j(`Cannot extend non-${u} type "${o}".`,{nodes:s?[s,i]:i}))}}else{let u=Object.keys(D(D({},n),t==null?void 0:t.getTypeMap())),l=Er(o,u);e.reportError(new j(`Cannot extend type "${o}" because it is not defined.`+nr(l),{nodes:i.name}))}}}function wM(e){if(sn(e))return b.SCALAR_TYPE_EXTENSION;if(Ue(e))return b.OBJECT_TYPE_EXTENSION;if(ze(e))return b.INTERFACE_TYPE_EXTENSION;if(At(e))return b.UNION_TYPE_EXTENSION;if(gt(e))return b.ENUM_TYPE_EXTENSION;if(He(e))return b.INPUT_OBJECT_TYPE_EXTENSION;ut(!1,"Unexpected type: "+q(e))}function RM(e){switch(e){case b.SCALAR_TYPE_EXTENSION:return"scalar";case b.OBJECT_TYPE_EXTENSION:return"object";case b.INTERFACE_TYPE_EXTENSION:return"interface";case b.UNION_TYPE_EXTENSION:return"union";case b.ENUM_TYPE_EXTENSION:return"enum";case b.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:ut(!1,"Unexpected kind: "+q(e))}}var AM,BE=Y(()=>{"use strict";d();m();f();zs();xt();tr();Hs();Ve();vt();Ka();ht();AM={[b.SCALAR_TYPE_DEFINITION]:b.SCALAR_TYPE_EXTENSION,[b.OBJECT_TYPE_DEFINITION]:b.OBJECT_TYPE_EXTENSION,[b.INTERFACE_TYPE_DEFINITION]:b.INTERFACE_TYPE_EXTENSION,[b.UNION_TYPE_DEFINITION]:b.UNION_TYPE_EXTENSION,[b.ENUM_TYPE_DEFINITION]:b.ENUM_TYPE_EXTENSION,[b.INPUT_OBJECT_TYPE_DEFINITION]:b.INPUT_OBJECT_TYPE_EXTENSION}});function op(e){return x(D({},KE(e)),{Field:{leave(t){var n;let r=e.getFieldDef();if(!r)return!1;let i=new Set((n=t.arguments)===null||n===void 0?void 0:n.map(o=>o.name.value));for(let o of r.args)if(!i.has(o.name)&&Kr(o)){let s=q(o.type);e.reportError(new j(`Field "${r.name}" argument "${o.name}" of type "${s}" is required, but it was not provided.`,{nodes:t}))}}}})}function KE(e){var t;let n=Object.create(null),r=e.getSchema(),i=(t=r==null?void 0:r.getDirectives())!==null&&t!==void 0?t:or;for(let a of i)n[a.name]=rr(a.args.filter(Kr),c=>c.name);let o=e.getDocument().definitions;for(let a of o)if(a.kind===b.DIRECTIVE_DEFINITION){var s;let c=(s=a.arguments)!==null&&s!==void 0?s:[];n[a.name.value]=rr(c.filter(LM),u=>u.name.value)}return{Directive:{leave(a){let c=a.name.value,u=n[c];if(u){var l;let p=(l=a.arguments)!==null&&l!==void 0?l:[],h=new Set(p.map(y=>y.name.value));for(let[y,N]of Object.entries(u))if(!h.has(y)){let O=Zs(N.type)?q(N.type):Ze(N.type);e.reportError(new j(`Directive "@${c}" argument "${y}" of type "${O}" is required, but it was not provided.`,{nodes:a}))}}}}}}function LM(e){return e.type.kind===b.NON_NULL_TYPE&&e.defaultValue==null}var QE=Y(()=>{"use strict";d();m();f();xt();Xs();Ve();vt();Vr();ht();Dr()});function sp(e){return{Field(t){let n=e.getType(),r=t.selectionSet;if(n){if(Rn(Zt(n))){if(r){let i=t.name.value,o=q(n);e.reportError(new j(`Field "${i}" must not have a selection since type "${o}" has no subfields.`,{nodes:r}))}}else if(!r){let i=t.name.value,o=q(n);e.reportError(new j(`Field "${i}" of type "${o}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:t}))}}}}}var YE=Y(()=>{"use strict";d();m();f();xt();Ve();ht()});function cm(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}var JE=Y(()=>{"use strict";d();m();f()});function Bo(e,t,n){return{prev:e,key:t,typename:n}}function $n(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}var ap=Y(()=>{"use strict";d();m();f()});function cp(e,t,n=FM){return up(e,t,n,void 0)}function FM(e,t,n){let r="Invalid value "+q(t);throw e.length>0&&(r+=` at "value${cm(e)}"`),n.message=r+": "+n.message,n}function up(e,t,n,r){if(Oe(t)){if(e!=null)return up(e,t.ofType,n,r);n($n(r),e,new j(`Expected non-nullable type "${q(t)}" not to be null.`));return}if(e==null)return null;if(tt(t)){let i=t.ofType;return Xu(e)?Array.from(e,(o,s)=>{let a=Bo(r,s,void 0);return up(o,i,n,a)}):[up(e,i,n,r)]}if(He(t)){if(!hn(e)){n($n(r),e,new j(`Expected type "${t.name}" to be an object.`));return}let i={},o=t.getFields();for(let s of Object.values(o)){let a=e[s.name];if(a===void 0){if(s.defaultValue!==void 0)i[s.name]=s.defaultValue;else if(Oe(s.type)){let c=q(s.type);n($n(r),e,new j(`Field "${s.name}" of required type "${c}" was not provided.`))}continue}i[s.name]=up(a,s.type,n,Bo(r,s.name,t.name))}for(let s of Object.keys(e))if(!o[s]){let a=Er(s,Object.keys(t.getFields()));n($n(r),e,new j(`Field "${s}" is not defined by type "${t.name}".`+nr(a)))}return i}if(Rn(t)){let i;try{i=t.parseValue(e)}catch(o){o instanceof j?n($n(r),e,o):n($n(r),e,new j(`Expected type "${t.name}". `+o.message,{originalError:o}));return}return i===void 0&&n($n(r),e,new j(`Expected type "${t.name}".`)),i}ut(!1,"Unexpected input type: "+q(t))}var zE=Y(()=>{"use strict";d();m();f();zs();xt();tr();nm();Bi();ap();JE();Hs();Ve();ht()});function vr(e,t,n){if(e){if(e.kind===b.VARIABLE){let r=e.name.value;if(n==null||n[r]===void 0)return;let i=n[r];return i===null&&Oe(t)?void 0:i}if(Oe(t))return e.kind===b.NULL?void 0:vr(e,t.ofType,n);if(e.kind===b.NULL)return null;if(tt(t)){let r=t.ofType;if(e.kind===b.LIST){let o=[];for(let s of e.values)if(LS(s,n)){if(Oe(r))return;o.push(null)}else{let a=vr(s,r,n);if(a===void 0)return;o.push(a)}return o}let i=vr(e,r,n);return i===void 0?void 0:[i]}if(He(t)){if(e.kind!==b.OBJECT)return;let r=Object.create(null),i=rr(e.fields,o=>o.name.value);for(let o of Object.values(t.getFields())){let s=i[o.name];if(!s||LS(s.value,n)){if(o.defaultValue!==void 0)r[o.name]=o.defaultValue;else if(Oe(o.type))return;continue}let a=vr(s.value,o.type,n);if(a===void 0)return;r[o.name]=a}return r}if(Rn(t)){let r;try{r=t.parseLiteral(e,n)}catch(i){return}return r===void 0?void 0:r}ut(!1,"Unexpected input type: "+q(t))}}function LS(e,t){return e.kind===b.VARIABLE&&(t==null||t[e.name.value]===void 0)}var lp=Y(()=>{"use strict";d();m();f();xt();tr();Xs();vt();ht()});function pp(e,t,n,r){let i=[],o=r==null?void 0:r.maxErrors;try{let s=kM(e,t,n,a=>{if(o!=null&&i.length>=o)throw new j("Too many errors processing variables, error limit reached. Execution aborted.");i.push(a)});if(i.length===0)return{coerced:s}}catch(s){i.push(s)}return{errors:i}}function kM(e,t,n,r){let i={};for(let o of t){let s=o.variable.name.value,a=en(e,o.type);if(!vn(a)){let u=Ze(o.type);r(new j(`Variable "$${s}" expected value of type "${u}" which cannot be used as an input type.`,{nodes:o.type}));continue}if(!FS(n,s)){if(o.defaultValue)i[s]=vr(o.defaultValue,a);else if(Oe(a)){let u=q(a);r(new j(`Variable "$${s}" of required type "${u}" was not provided.`,{nodes:o}))}continue}let c=n[s];if(c===null&&Oe(a)){let u=q(a);r(new j(`Variable "$${s}" of non-null type "${u}" must not be null.`,{nodes:o}));continue}i[s]=cp(c,a,(u,l,p)=>{let h=`Variable "$${s}" got invalid value `+q(l);u.length>0&&(h+=` at "${s}${cm(u)}"`),r(new j(h+"; "+p.message,{nodes:o,originalError:p}))})}return i}function ra(e,t,n){var r;let i={},o=(r=t.arguments)!==null&&r!==void 0?r:[],s=rr(o,a=>a.name.value);for(let a of e.args){let c=a.name,u=a.type,l=s[c];if(!l){if(a.defaultValue!==void 0)i[c]=a.defaultValue;else if(Oe(u))throw new j(`Argument "${c}" of required type "${q(u)}" was not provided.`,{nodes:t});continue}let p=l.value,h=p.kind===b.NULL;if(p.kind===b.VARIABLE){let N=p.name.value;if(n==null||!FS(n,N)){if(a.defaultValue!==void 0)i[c]=a.defaultValue;else if(Oe(u))throw new j(`Argument "${c}" of required type "${q(u)}" was provided the variable "$${N}" which was not provided a runtime value.`,{nodes:p});continue}h=n[N]==null}if(h&&Oe(u))throw new j(`Argument "${c}" of non-null type "${q(u)}" must not be null.`,{nodes:p});let y=vr(p,u,n);if(y===void 0)throw new j(`Argument "${c}" has invalid value ${Ze(p)}.`,{nodes:p});i[c]=y}return i}function Ko(e,t,n){var r;let i=(r=t.directives)===null||r===void 0?void 0:r.find(o=>o.name.value===e.name);if(i)return ra(e,i,n)}function FS(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var ic=Y(()=>{"use strict";d();m();f();xt();Xs();JE();Ve();vt();Vr();ht();zE();Hi();lp()});function oc(e,t,n,r,i){let o=new Map;return lm(e,t,n,r,i,o,new Set),o}function PS(e,t,n,r,i){let o=new Map,s=new Set;for(let a of i)a.selectionSet&&lm(e,t,n,r,a.selectionSet,o,s);return o}function lm(e,t,n,r,i,o,s){for(let a of i.selections)switch(a.kind){case b.FIELD:{if(!XE(n,a))continue;let c=PM(a),u=o.get(c);u!==void 0?u.push(a):o.set(c,[a]);break}case b.INLINE_FRAGMENT:{if(!XE(n,a)||!kS(e,a,r))continue;lm(e,t,n,r,a.selectionSet,o,s);break}case b.FRAGMENT_SPREAD:{let c=a.name.value;if(s.has(c)||!XE(n,a))continue;s.add(c);let u=t[c];if(!u||!kS(e,u,r))continue;lm(e,t,n,r,u.selectionSet,o,s);break}}}function XE(e,t){let n=Ko(Yu,t,e);if((n==null?void 0:n.if)===!0)return!1;let r=Ko(Qu,t,e);return(r==null?void 0:r.if)!==!1}function kS(e,t,n){let r=t.typeCondition;if(!r)return!0;let i=en(e,r);return i===n?!0:Yn(i)?e.isSubType(i,n):!1}function PM(e){return e.alias?e.alias.value:e.name.value}var pm=Y(()=>{"use strict";d();m();f();vt();ht();Dr();Hi();ic()});function dp(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 u of s.definitions)u.kind===b.FRAGMENT_DEFINITION&&(a[u.name.value]=u);let c=oc(n,a,o,r,t.selectionSet);if(c.size>1){let p=[...c.values()].slice(1).flat();e.reportError(new j(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:p}))}for(let u of c.values())u[0].name.value.startsWith("__")&&e.reportError(new j(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:u}))}}}}}var HE=Y(()=>{"use strict";d();m();f();Ve();vt();pm()});function sc(e,t){let n=new Map;for(let r of e){let i=t(r),o=n.get(i);o===void 0?n.set(i,[r]):o.push(r)}return n}var dm=Y(()=>{"use strict";d();m();f()});function fp(e){return{DirectiveDefinition(r){var i;let o=(i=r.arguments)!==null&&i!==void 0?i:[];return n(`@${r.name.value}`,o)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(r){var i;let o=r.name.value,s=(i=r.fields)!==null&&i!==void 0?i:[];for(let c of s){var a;let u=c.name.value,l=(a=c.arguments)!==null&&a!==void 0?a:[];n(`${o}.${u}`,l)}return!1}function n(r,i){let o=sc(i,s=>s.name.value);for(let[s,a]of o)a.length>1&&e.reportError(new j(`Argument "${r}(${s}:)" can only be defined once.`,{nodes:a.map(c=>c.name)}));return!1}}var WE=Y(()=>{"use strict";d();m();f();dm();Ve()});function ac(e){return{Field:t,Directive:t};function t(n){var r;let i=(r=n.arguments)!==null&&r!==void 0?r:[],o=sc(i,s=>s.name.value);for(let[s,a]of o)a.length>1&&e.reportError(new j(`There can be only one argument named "${s}".`,{nodes:a.map(c=>c.name)}))}}var ZE=Y(()=>{"use strict";d();m();f();dm();Ve()});function mp(e){let t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(r){let i=r.name.value;if(n!=null&&n.getDirective(i)){e.reportError(new j(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}return t[i]?e.reportError(new j(`There can be only one directive named "@${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1}}}var eN=Y(()=>{"use strict";d();m();f();Ve()});function uc(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():or;for(let a of r)t[a.name]=!a.isRepeatable;let i=e.getDocument().definitions;for(let a of i)a.kind===b.DIRECTIVE_DEFINITION&&(t[a.name.value]=!a.repeatable);let o=Object.create(null),s=Object.create(null);return{enter(a){if(!("directives"in a)||!a.directives)return;let c;if(a.kind===b.SCHEMA_DEFINITION||a.kind===b.SCHEMA_EXTENSION)c=o;else if(ii(a)||na(a)){let u=a.name.value;c=s[u],c===void 0&&(s[u]=c=Object.create(null))}else c=Object.create(null);for(let u of a.directives){let l=u.name.value;t[l]&&(c[l]?e.reportError(new j(`The directive "@${l}" can only be used once at this location.`,{nodes:[c[l],u]})):c[l]=u)}}}}var tN=Y(()=>{"use strict";d();m();f();Ve();vt();Ka();Dr()});function hp(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(o){var s;let a=o.name.value;r[a]||(r[a]=Object.create(null));let c=(s=o.values)!==null&&s!==void 0?s:[],u=r[a];for(let l of c){let p=l.name.value,h=n[a];gt(h)&&h.getValue(p)?e.reportError(new j(`Enum value "${a}.${p}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name})):u[p]?e.reportError(new j(`Enum value "${a}.${p}" can only be defined once.`,{nodes:[u[p],l.name]})):u[p]=l.name}return!1}}var nN=Y(()=>{"use strict";d();m();f();Ve();ht()});function yp(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(o){var s;let a=o.name.value;r[a]||(r[a]=Object.create(null));let c=(s=o.fields)!==null&&s!==void 0?s:[],u=r[a];for(let l of c){let p=l.name.value;xM(n[a],p)?e.reportError(new j(`Field "${a}.${p}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name})):u[p]?e.reportError(new j(`Field "${a}.${p}" can only be defined once.`,{nodes:[u[p],l.name]})):u[p]=l.name}return!1}}function xM(e,t){return Ue(e)||ze(e)||He(e)?e.getFields()[t]!=null:!1}var rN=Y(()=>{"use strict";d();m();f();Ve();ht()});function Tp(e){let t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){let r=n.name.value;return t[r]?e.reportError(new j(`There can be only one fragment named "${r}".`,{nodes:[t[r],n.name]})):t[r]=n.name,!1}}}var iN=Y(()=>{"use strict";d();m();f();Ve()});function cc(e){let t=[],n=Object.create(null);return{ObjectValue:{enter(){t.push(n),n=Object.create(null)},leave(){let r=t.pop();r||ut(!1),n=r}},ObjectField(r){let i=r.name.value;n[i]?e.reportError(new j(`There can be only one input field named "${i}".`,{nodes:[n[i],r.name]})):n[i]=r.name}}}var oN=Y(()=>{"use strict";d();m();f();tr();Ve()});function Ep(e){let t=Object.create(null);return{OperationDefinition(n){let r=n.name;return r&&(t[r.value]?e.reportError(new j(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),!1},FragmentDefinition:()=>!1}}var sN=Y(()=>{"use strict";d();m();f();Ve()});function Np(e){let t=e.getSchema(),n=Object.create(null),r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(o){var s;let a=(s=o.operationTypes)!==null&&s!==void 0?s:[];for(let c of a){let u=c.operation,l=n[u];r[u]?e.reportError(new j(`Type for ${u} already defined in the schema. It cannot be redefined.`,{nodes:c})):l?e.reportError(new j(`There can be only one ${u} type in schema.`,{nodes:[l,c]})):n[u]=c}return!1}}var aN=Y(()=>{"use strict";d();m();f();Ve()});function gp(e){let t=Object.create(null),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!=null&&n.getType(o)){e.reportError(new j(`Type "${o}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}));return}return t[o]?e.reportError(new j(`There can be only one type named "${o}".`,{nodes:[t[o],i.name]})):t[o]=i.name,!1}}var uN=Y(()=>{"use strict";d();m();f();Ve()});function vp(e){return{OperationDefinition(t){var n;let r=(n=t.variableDefinitions)!==null&&n!==void 0?n:[],i=sc(r,o=>o.variable.name.value);for(let[o,s]of i)s.length>1&&e.reportError(new j(`There can be only one variable named "$${o}".`,{nodes:s.map(a=>a.variable.name)}))}}}var cN=Y(()=>{"use strict";d();m();f();dm();Ve()});function Ip(e){return{ListValue(t){let n=Ca(e.getParentInputType());if(!tt(n))return Qa(e,t),!1},ObjectValue(t){let n=Zt(e.getInputType());if(!He(n))return Qa(e,t),!1;let r=rr(t.fields,i=>i.name.value);for(let i of Object.values(n.getFields()))if(!r[i.name]&&jo(i)){let s=q(i.type);e.reportError(new j(`Field "${n.name}.${i.name}" of required type "${s}" was not provided.`,{nodes:t}))}},ObjectField(t){let n=Zt(e.getParentInputType());if(!e.getInputType()&&He(n)){let i=Er(t.name.value,Object.keys(n.getFields()));e.reportError(new j(`Field "${t.name.value}" is not defined by type "${n.name}".`+nr(i),{nodes:t}))}},NullValue(t){let n=e.getInputType();Oe(n)&&e.reportError(new j(`Expected value of type "${q(n)}", found ${Ze(t)}.`,{nodes:t}))},EnumValue:t=>Qa(e,t),IntValue:t=>Qa(e,t),FloatValue:t=>Qa(e,t),StringValue:t=>Qa(e,t),BooleanValue:t=>Qa(e,t)}}function Qa(e,t){let n=e.getInputType();if(!n)return;let r=Zt(n);if(!Rn(r)){let i=q(n);e.reportError(new j(`Expected value of type "${i}", found ${Ze(t)}.`,{nodes:t}));return}try{if(r.parseLiteral(t,void 0)===void 0){let o=q(n);e.reportError(new j(`Expected value of type "${o}", found ${Ze(t)}.`,{nodes:t}))}}catch(i){let o=q(n);i instanceof j?e.reportError(i):e.reportError(new j(`Expected value of type "${o}", found ${Ze(t)}; `+i.message,{nodes:t,originalError:i}))}}var lN=Y(()=>{"use strict";d();m();f();zs();xt();Xs();Hs();Ve();Vr();ht()});function bp(e){return{VariableDefinition(t){let n=en(e.getSchema(),t.type);if(n!==void 0&&!vn(n)){let r=t.variable.name.value,i=Ze(t.type);e.reportError(new j(`Variable "$${r}" cannot be non-input type "${i}".`,{nodes:t.type}))}}}}var pN=Y(()=>{"use strict";d();m();f();Ve();Vr();ht();Hi()});function _p(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i,type:o,defaultValue:s}of r){let a=i.name.value,c=t[a];if(c&&o){let u=e.getSchema(),l=en(u,c.type);if(l&&!CM(u,l,c.defaultValue,o,s)){let p=q(l),h=q(o);e.reportError(new j(`Variable "$${a}" of type "${p}" used in position expecting type "${h}".`,{nodes:[c,i]}))}}}}},VariableDefinition(n){t[n.variable.name.value]=n}}}function CM(e,t,n,r,i){if(Oe(r)&&!Oe(t)){if(!(n!=null&&n.kind!==b.NULL)&&!(i!==void 0))return!1;let a=r.ofType;return Ai(e,t,a)}return Ai(e,t,r)}var dN=Y(()=>{"use strict";d();m();f();xt();Ve();vt();ht();Pl();Hi()});var Op,xS,fN=Y(()=>{"use strict";d();m();f();bE();_E();OE();DE();AE();wE();RE();LE();FE();kE();PE();xE();CE();GE();qE();BE();QE();YE();HE();WE();ZE();eN();tN();nN();rN();iN();oN();sN();aN();uN();cN();lN();pN();dN();Op=Object.freeze([Kl,Ep,Xl,dp,nc,Yl,bp,sp,Ql,Tp,zl,ep,rp,Wl,vp,Zl,tp,tc,uc,Jl,ac,Ip,op,_p,np,cc]),xS=Object.freeze([Hl,Np,gp,hp,yp,fp,mp,nc,tc,uc,ip,SE,ac,cc,KE])});var fm,mm,Ya,mN=Y(()=>{"use strict";d();m();f();vt();ka();im();fm=class{constructor(t,n){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(let r of this.getDocument().definitions)r.kind===b.FRAGMENT_DEFINITION&&(n[r.name.value]=r);this._fragments=n}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];let r=[t],i;for(;i=r.pop();)for(let o of i.selections)o.kind===b.FRAGMENT_SPREAD?n.push(o):o.selectionSet&&r.push(o.selectionSet);this._fragmentSpreads.set(t,n)}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];let r=Object.create(null),i=[t.selectionSet],o;for(;o=i.pop();)for(let s of this.getFragmentSpreads(o)){let a=s.name.value;if(r[a]!==!0){r[a]=!0;let c=this.getFragment(a);c&&(n.push(c),i.push(c.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}},mm=class extends fm{constructor(t,n,r){super(t,r),this._schema=n}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}},Ya=class extends fm{constructor(t,n,r,i){super(n,i),this._schema=t,this._typeInfo=r,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(t){let n=this._variableUsages.get(t);if(!n){let r=[],i=new qo(this._schema);ni(t,Ba(i,{VariableDefinition:()=>!1,Variable(o){r.push({node:o,type:i.getInputType(),defaultValue:i.getDefaultValue()})}})),n=r,this._variableUsages.set(t,n)}return n}getRecursiveVariableUsages(t){let n=this._recursiveVariableUsages.get(t);if(!n){n=this.getVariableUsages(t);for(let r of this.getRecursivelyReferencedFragments(t))n=n.concat(this.getVariableUsages(r));this._recursiveVariableUsages.set(t,n)}return n}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}});function Sp(e,t,n=Op,r,i=new qo(e)){var o;let s=(o=r==null?void 0:r.maxErrors)!==null&&o!==void 0?o:100;t||xe(!1,"Must provide document."),qa(e);let a=Object.freeze({}),c=[],u=new Ya(e,t,i,p=>{if(c.length>=s)throw c.push(new j("Too many validation errors, error limit reached. Validation aborted.")),a;c.push(p)}),l=Vu(n.map(p=>p(u)));try{ni(t,Ba(i,l))}catch(p){if(p!==a)throw p}return c}function CS(e,t,n=xS){let r=[],i=new mm(e,t,s=>{r.push(s)}),o=n.map(s=>s(i));return ni(e,Vu(o)),r}function MS(e){let t=CS(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(` +`))}function zk(e){let t=e.schema,n=t.getQueryType();if(!n)e.reportError("Query root type must be provided.",t.astNode);else if(!we(n)){var r;e.reportError(`Query root type must be Object type, it cannot be ${B(n)}.`,(r=GT(t,At.QUERY))!==null&&r!==void 0?r:n.astNode)}let i=t.getMutationType();if(i&&!we(i)){var s;e.reportError(`Mutation root type must be Object type if provided, it cannot be ${B(i)}.`,(s=GT(t,At.MUTATION))!==null&&s!==void 0?s:i.astNode)}let o=t.getSubscriptionType();if(o&&!we(o)){var a;e.reportError(`Subscription root type must be Object type if provided, it cannot be ${B(o)}.`,(a=GT(t,At.SUBSCRIPTION))!==null&&a!==void 0?a:o.astNode)}}function GT(e,t){var n;return(n=[e.astNode,...e.extensionASTNodes].flatMap(r=>{var i;return(i=r==null?void 0:r.operationTypes)!==null&&i!==void 0?i:[]}).find(r=>r.operation===t))===null||n===void 0?void 0:n.type}function Xk(e){for(let n of e.schema.getDirectives()){if(!go(n)){e.reportError(`Expected directive but got: ${B(n)}.`,n==null?void 0:n.astNode);continue}ma(e,n);for(let r of n.args)if(ma(e,r),on(r.type)||e.reportError(`The type of @${n.name}(${r.name}:) must be Input Type but got: ${B(r.type)}.`,r.astNode),Sr(r)&&r.deprecationReason!=null){var t;e.reportError(`Required argument @${n.name}(${r.name}:) cannot be deprecated.`,[KT(r.astNode),(t=r.astNode)===null||t===void 0?void 0:t.type])}}}function ma(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function Hk(e){let t=rx(e),n=e.schema.getTypeMap();for(let r of Object.values(n)){if(!ns(r)){e.reportError(`Expected GraphQL named type but got: ${B(r)}.`,r.astNode);continue}zn(r)||ma(e,r),we(r)||Ce(r)?(vb(e,r),_b(e,r)):dt(r)?ex(e,r):it(r)?tx(e,r):Be(r)&&(nx(e,r),t(r))}}function vb(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let o of n){if(ma(e,o),!br(o.type)){var r;e.reportError(`The type of ${t.name}.${o.name} must be Output Type but got: ${B(o.type)}.`,(r=o.astNode)===null||r===void 0?void 0:r.type)}for(let a of o.args){let u=a.name;if(ma(e,a),!on(a.type)){var i;e.reportError(`The type of ${t.name}.${o.name}(${u}:) must be Input Type but got: ${B(a.type)}.`,(i=a.astNode)===null||i===void 0?void 0:i.type)}if(Sr(a)&&a.deprecationReason!=null){var s;e.reportError(`Required argument ${t.name}.${o.name}(${u}:) cannot be deprecated.`,[KT(a.astNode),(s=a.astNode)===null||s===void 0?void 0:s.type])}}}}function _b(e,t){let n=Object.create(null);for(let r of t.getInterfaces()){if(!Ce(r)){e.reportError(`Type ${B(t)} must only implement Interface types, it cannot implement ${B(r)}.`,il(t,r));continue}if(t===r){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,il(t,r));continue}if(n[r.name]){e.reportError(`Type ${t.name} can only implement ${r.name} once.`,il(t,r));continue}n[r.name]=!0,Zk(e,t,r),Wk(e,t,r)}}function Wk(e,t,n){let r=t.getFields();for(let u of Object.values(n.getFields())){let c=u.name,l=r[c];if(!l){e.reportError(`Interface field ${n.name}.${c} expected but ${t.name} does not provide it.`,[u.astNode,t.astNode,...t.extensionASTNodes]);continue}if(!ii(e.schema,l.type,u.type)){var i,s;e.reportError(`Interface field ${n.name}.${c} expects type ${B(u.type)} but ${t.name}.${c} is type ${B(l.type)}.`,[(i=u.astNode)===null||i===void 0?void 0:i.type,(s=l.astNode)===null||s===void 0?void 0:s.type])}for(let m of u.args){let h=m.name,E=l.args.find(N=>N.name===h);if(!E){e.reportError(`Interface field argument ${n.name}.${c}(${h}:) expected but ${t.name}.${c} does not provide it.`,[m.astNode,l.astNode]);continue}if(!ca(m.type,E.type)){var o,a;e.reportError(`Interface field argument ${n.name}.${c}(${h}:) expects type ${B(m.type)} but ${t.name}.${c}(${h}:) is type ${B(E.type)}.`,[(o=m.astNode)===null||o===void 0?void 0:o.type,(a=E.astNode)===null||a===void 0?void 0:a.type])}}for(let m of l.args){let h=m.name;!u.args.find(N=>N.name===h)&&Sr(m)&&e.reportError(`Object field ${t.name}.${c} includes required argument ${h} that is missing from the Interface field ${n.name}.${c}.`,[m.astNode,u.astNode])}}}function Zk(e,t,n){let r=t.getInterfaces();for(let i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...il(n,i),...il(t,n)])}function ex(e,t){let n=t.getTypes();n.length===0&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let r=Object.create(null);for(let i of n){if(r[i.name]){e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,bb(t,i.name));continue}r[i.name]=!0,we(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${B(i)}.`,bb(t,String(i)))}}function tx(e,t){let n=t.getValues();n.length===0&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(let r of n)ma(e,r)}function nx(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let s of n){if(ma(e,s),!on(s.type)){var r;e.reportError(`The type of ${t.name}.${s.name} must be Input Type but got: ${B(s.type)}.`,(r=s.astNode)===null||r===void 0?void 0:r.type)}if(rs(s)&&s.deprecationReason!=null){var i;e.reportError(`Required input field ${t.name}.${s.name} cannot be deprecated.`,[KT(s.astNode),(i=s.astNode)===null||i===void 0?void 0:i.type])}}}function rx(e){let t=Object.create(null),n=[],r=Object.create(null);return i;function i(s){if(t[s.name])return;t[s.name]=!0,r[s.name]=n.length;let o=Object.values(s.getFields());for(let a of o)if(Te(a.type)&&Be(a.type.ofType)){let u=a.type.ofType,c=r[u.name];if(n.push(a),c===void 0)i(u);else{let l=n.slice(c),m=l.map(h=>h.name).join(".");e.reportError(`Cannot reference Input Object "${u.name}" within itself through a series of non-null fields: "${m}".`,l.map(h=>h.astNode))}n.pop()}r[s.name]=void 0}}function il(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n!=null?[n,...r]:r).flatMap(s=>{var o;return(o=s.interfaces)!==null&&o!==void 0?o:[]}).filter(s=>s.name.value===t.name)}function bb(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n!=null?[n,...r]:r).flatMap(s=>{var o;return(o=s.types)!==null&&o!==void 0?o:[]}).filter(s=>s.name.value===t)}function KT(e){var t;return e==null||(t=e.directives)===null||t===void 0?void 0:t.find(n=>n.name.value===Si.name)}var qT,sl=j(()=>{"use strict";d();f();p();mt();Re();Ii();Xc();tt();dr();Pr();fa();qT=class{constructor(t){this._errors=[],this.schema=t}reportError(t,n){let r=Array.isArray(n)?n.filter(Boolean):n;this._errors.push(new k(t,{nodes:r}))}getErrors(){return this._errors}}});function Bt(e,t){switch(t.kind){case _.LIST_TYPE:{let n=Bt(e,t.type);return n&&new wt(n)}case _.NON_NULL_TYPE:{let n=Bt(e,t.type);return n&&new xe(n)}case _.NAMED_TYPE:return e.getType(t.name.value)}}var Oi=j(()=>{"use strict";d();f();p();at();tt()});function ix(e,t,n){let r=n.name.value;if(r===is.name&&e.getQueryType()===t)return is;if(r===ss.name&&e.getQueryType()===t)return ss;if(r===os.name&&ar(t))return os;if(we(t)||Ce(t))return t.getFields()[r]}function Ta(e,t){return{enter(...n){let r=n[0];e.enter(r);let i=ts(t,r.kind).enter;if(i){let s=i.apply(t,n);return s!==void 0&&(e.leave(r),kc(s)&&e.enter(s)),s}},leave(...n){let r=n[0],i=ts(t,r.kind).leave,s;return i&&(s=i.apply(t,n)),e.leave(r),s}}}var as,ef=j(()=>{"use strict";d();f();p();Ii();at();sa();tt();Pr();Oi();as=class{constructor(t,n,r){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=r!=null?r:ix,n&&(on(n)&&this._inputTypeStack.push(n),ar(n)&&this._parentTypeStack.push(n),br(n)&&this._typeStack.push(n))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(t){let n=this._schema;switch(t.kind){case _.SELECTION_SET:{let i=Ct(this.getType());this._parentTypeStack.push(ar(i)?i:void 0);break}case _.FIELD:{let i=this.getParentType(),s,o;i&&(s=this._getFieldDef(n,i,t),s&&(o=s.type)),this._fieldDefStack.push(s),this._typeStack.push(br(o)?o:void 0);break}case _.DIRECTIVE:this._directive=n.getDirective(t.name.value);break;case _.OPERATION_DEFINITION:{let i=n.getRootType(t.operation);this._typeStack.push(we(i)?i:void 0);break}case _.INLINE_FRAGMENT:case _.FRAGMENT_DEFINITION:{let i=t.typeCondition,s=i?Bt(n,i):Ct(this.getType());this._typeStack.push(br(s)?s:void 0);break}case _.VARIABLE_DEFINITION:{let i=Bt(n,t.type);this._inputTypeStack.push(on(i)?i:void 0);break}case _.ARGUMENT:{var r;let i,s,o=(r=this.getDirective())!==null&&r!==void 0?r:this.getFieldDef();o&&(i=o.args.find(a=>a.name===t.name.value),i&&(s=i.type)),this._argument=i,this._defaultValueStack.push(i?i.defaultValue:void 0),this._inputTypeStack.push(on(s)?s:void 0);break}case _.LIST:{let i=ua(this.getInputType()),s=qe(i)?i.ofType:i;this._defaultValueStack.push(void 0),this._inputTypeStack.push(on(s)?s:void 0);break}case _.OBJECT_FIELD:{let i=Ct(this.getInputType()),s,o;Be(i)&&(o=i.getFields()[t.name.value],o&&(s=o.type)),this._defaultValueStack.push(o?o.defaultValue:void 0),this._inputTypeStack.push(on(s)?s:void 0);break}case _.ENUM:{let i=Ct(this.getInputType()),s;it(i)&&(s=i.getValue(t.value)),this._enumValue=s;break}default:}}leave(t){switch(t.kind){case _.SELECTION_SET:this._parentTypeStack.pop();break;case _.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case _.DIRECTIVE:this._directive=null;break;case _.OPERATION_DEFINITION:case _.INLINE_FRAGMENT:case _.FRAGMENT_DEFINITION:this._typeStack.pop();break;case _.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case _.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case _.LIST:case _.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case _.ENUM:this._enumValue=null;break;default:}}}});function QT(e){return yu(e)||Eu(e)||Nu(e)}function yu(e){return e.kind===_.OPERATION_DEFINITION||e.kind===_.FRAGMENT_DEFINITION}function YT(e){return e.kind===_.FIELD||e.kind===_.FRAGMENT_SPREAD||e.kind===_.INLINE_FRAGMENT}function tf(e){return e.kind===_.VARIABLE||e.kind===_.INT||e.kind===_.FLOAT||e.kind===_.STRING||e.kind===_.BOOLEAN||e.kind===_.NULL||e.kind===_.ENUM||e.kind===_.LIST||e.kind===_.OBJECT}function ol(e){return tf(e)&&(e.kind===_.LIST?e.values.some(ol):e.kind===_.OBJECT?e.fields.some(t=>ol(t.value)):e.kind!==_.VARIABLE)}function JT(e){return e.kind===_.NAMED_TYPE||e.kind===_.LIST_TYPE||e.kind===_.NON_NULL_TYPE}function Eu(e){return e.kind===_.SCHEMA_DEFINITION||Mr(e)||e.kind===_.DIRECTIVE_DEFINITION}function Mr(e){return e.kind===_.SCALAR_TYPE_DEFINITION||e.kind===_.OBJECT_TYPE_DEFINITION||e.kind===_.INTERFACE_TYPE_DEFINITION||e.kind===_.UNION_TYPE_DEFINITION||e.kind===_.ENUM_TYPE_DEFINITION||e.kind===_.INPUT_OBJECT_TYPE_DEFINITION}function Nu(e){return e.kind===_.SCHEMA_EXTENSION||vo(e)}function vo(e){return e.kind===_.SCALAR_TYPE_EXTENSION||e.kind===_.OBJECT_TYPE_EXTENSION||e.kind===_.INTERFACE_TYPE_EXTENSION||e.kind===_.UNION_TYPE_EXTENSION||e.kind===_.ENUM_TYPE_EXTENSION||e.kind===_.INPUT_OBJECT_TYPE_EXTENSION}var ya=j(()=>{"use strict";d();f();p();at()});function al(e){return{Document(t){for(let n of t.definitions)if(!yu(n)){let r=n.kind===_.SCHEMA_DEFINITION||n.kind===_.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new k(`The ${r} definition is not executable.`,{nodes:n}))}return!1}}}var zT=j(()=>{"use strict";d();f();p();Re();at();ya()});function ul(e){return{Field(t){let n=e.getParentType();if(n&&!e.getFieldDef()){let i=e.getSchema(),s=t.name.value,o=Kn("to use an inline fragment on",sx(i,n,s));o===""&&(o=Kn(ox(n,s))),e.reportError(new k(`Cannot query field "${s}" on type "${n.name}".`+o,{nodes:t}))}}}}function sx(e,t,n){if(!Pn(t))return[];let r=new Set,i=Object.create(null);for(let o of e.getPossibleTypes(t))if(o.getFields()[n]){r.add(o),i[o.name]=1;for(let a of o.getInterfaces()){var s;a.getFields()[n]&&(r.add(a),i[a.name]=((s=i[a.name])!==null&&s!==void 0?s:0)+1)}}return[...r].sort((o,a)=>{let u=i[a.name]-i[o.name];return u!==0?u:Ce(o)&&e.isSubType(o,a)?-1:Ce(a)&&e.isSubType(a,o)?1:es(o.name,a.name)}).map(o=>o.name)}function ox(e,t){if(we(e)||Ce(e)){let n=Object.keys(e.getFields());return sr(t,n)}return[]}var XT=j(()=>{"use strict";d();f();p();ho();Vc();yo();Re();tt()});function cl(e){return{InlineFragment(t){let n=t.typeCondition;if(n){let r=Bt(e.getSchema(),n);if(r&&!ar(r)){let i=Ve(n);e.reportError(new k(`Fragment cannot condition on non composite type "${i}".`,{nodes:n}))}}},FragmentDefinition(t){let n=Bt(e.getSchema(),t.typeCondition);if(n&&!ar(n)){let r=Ve(t.typeCondition);e.reportError(new k(`Fragment "${t.name.value}" cannot condition on non composite type "${r}".`,{nodes:t.typeCondition}))}}}}var HT=j(()=>{"use strict";d();f();p();Re();gr();tt();Oi()});function ll(e){return M(A({},WT(e)),{Argument(t){let n=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!n&&r&&i){let s=t.name.value,o=r.args.map(u=>u.name),a=sr(s,o);e.reportError(new k(`Unknown argument "${s}" on field "${i.name}.${r.name}".`+Kn(a),{nodes:t}))}}})}function WT(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Jn;for(let o of r)t[o.name]=o.args.map(a=>a.name);let i=e.getDocument().definitions;for(let o of i)if(o.kind===_.DIRECTIVE_DEFINITION){var s;let a=(s=o.arguments)!==null&&s!==void 0?s:[];t[o.name.value]=a.map(u=>u.name.value)}return{Directive(o){let a=o.name.value,u=t[a];if(o.arguments&&u)for(let c of o.arguments){let l=c.name.value;if(!u.includes(l)){let m=sr(l,u);e.reportError(new k(`Unknown argument "${l}" on directive "@${a}".`+Kn(m),{nodes:c}))}}return!1}}}var ZT=j(()=>{"use strict";d();f();p();ho();yo();Re();at();dr()});function gu(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Jn;for(let s of r)t[s.name]=s.locations;let i=e.getDocument().definitions;for(let s of i)s.kind===_.DIRECTIVE_DEFINITION&&(t[s.name.value]=s.locations.map(o=>o.value));return{Directive(s,o,a,u,c){let l=s.name.value,m=t[l];if(!m){e.reportError(new k(`Unknown directive "@${l}".`,{nodes:s}));return}let h=ax(c);h&&!m.includes(h)&&e.reportError(new k(`Directive "@${l}" may not be used on ${h}.`,{nodes:s}))}}}function ax(e){let t=e[e.length-1];switch("kind"in t||Xe(!1),t.kind){case _.OPERATION_DEFINITION:return ux(t.operation);case _.FIELD:return Ne.FIELD;case _.FRAGMENT_SPREAD:return Ne.FRAGMENT_SPREAD;case _.INLINE_FRAGMENT:return Ne.INLINE_FRAGMENT;case _.FRAGMENT_DEFINITION:return Ne.FRAGMENT_DEFINITION;case _.VARIABLE_DEFINITION:return Ne.VARIABLE_DEFINITION;case _.SCHEMA_DEFINITION:case _.SCHEMA_EXTENSION:return Ne.SCHEMA;case _.SCALAR_TYPE_DEFINITION:case _.SCALAR_TYPE_EXTENSION:return Ne.SCALAR;case _.OBJECT_TYPE_DEFINITION:case _.OBJECT_TYPE_EXTENSION:return Ne.OBJECT;case _.FIELD_DEFINITION:return Ne.FIELD_DEFINITION;case _.INTERFACE_TYPE_DEFINITION:case _.INTERFACE_TYPE_EXTENSION:return Ne.INTERFACE;case _.UNION_TYPE_DEFINITION:case _.UNION_TYPE_EXTENSION:return Ne.UNION;case _.ENUM_TYPE_DEFINITION:case _.ENUM_TYPE_EXTENSION:return Ne.ENUM;case _.ENUM_VALUE_DEFINITION:return Ne.ENUM_VALUE;case _.INPUT_OBJECT_TYPE_DEFINITION:case _.INPUT_OBJECT_TYPE_EXTENSION:return Ne.INPUT_OBJECT;case _.INPUT_VALUE_DEFINITION:{let n=e[e.length-3];return"kind"in n||Xe(!1),n.kind===_.INPUT_OBJECT_TYPE_DEFINITION?Ne.INPUT_FIELD_DEFINITION:Ne.ARGUMENT_DEFINITION}default:Xe(!1,"Unexpected kind: "+B(t.kind))}}function ux(e){switch(e){case At.QUERY:return Ne.QUERY;case At.MUTATION:return Ne.MUTATION;case At.SUBSCRIPTION:return Ne.SUBSCRIPTION}}var ey=j(()=>{"use strict";d();f();p();mt();qn();Re();Ii();eu();at();dr()});function dl(e){return{FragmentSpread(t){let n=t.name.value;e.getFragment(n)||e.reportError(new k(`Unknown fragment "${n}".`,{nodes:t.name}))}}}var ty=j(()=>{"use strict";d();f();p();Re()});function Iu(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);for(let s of e.getDocument().definitions)Mr(s)&&(r[s.name.value]=!0);let i=[...Object.keys(n),...Object.keys(r)];return{NamedType(s,o,a,u,c){let l=s.name.value;if(!n[l]&&!r[l]){var m;let h=(m=c[2])!==null&&m!==void 0?m:a,E=h!=null&&cx(h);if(E&&Sb.includes(l))return;let N=sr(l,E?Sb.concat(i):i);e.reportError(new k(`Unknown type "${l}".`+Kn(N),{nodes:s}))}}}}function cx(e){return"kind"in e&&(Eu(e)||Nu(e))}var Sb,ny=j(()=>{"use strict";d();f();p();ho();yo();Re();ya();Pr();bi();Sb=[..._i,...Di].map(e=>e.name)});function pl(e){let t=0;return{Document(n){t=n.definitions.filter(r=>r.kind===_.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new k("This anonymous operation must be the only defined operation.",{nodes:n}))}}}var ry=j(()=>{"use strict";d();f();p();Re();at()});function fl(e){var t,n,r;let i=e.getSchema(),s=(t=(n=(r=i==null?void 0:i.astNode)!==null&&r!==void 0?r:i==null?void 0:i.getQueryType())!==null&&n!==void 0?n:i==null?void 0:i.getMutationType())!==null&&t!==void 0?t:i==null?void 0:i.getSubscriptionType(),o=0;return{SchemaDefinition(a){if(s){e.reportError(new k("Cannot define a new schema within a schema extension.",{nodes:a}));return}o>0&&e.reportError(new k("Must provide only one schema definition.",{nodes:a})),++o}}}var iy=j(()=>{"use strict";d();f();p();Re()});function ml(e){let t=Object.create(null),n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(s){return i(s),!1}};function i(s){if(t[s.name.value])return;let o=s.name.value;t[o]=!0;let a=e.getFragmentSpreads(s.selectionSet);if(a.length!==0){r[o]=n.length;for(let u of a){let c=u.name.value,l=r[c];if(n.push(u),l===void 0){let m=e.getFragment(c);m&&i(m)}else{let m=n.slice(l),h=m.slice(0,-1).map(E=>'"'+E.name.value+'"').join(", ");e.reportError(new k(`Cannot spread fragment "${c}" within itself`+(h!==""?` via ${h}.`:"."),{nodes:m}))}n.pop()}r[o]=void 0}}}var sy=j(()=>{"use strict";d();f();p();Re()});function hl(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i}of r){let s=i.name.value;t[s]!==!0&&e.reportError(new k(n.name?`Variable "$${s}" is not defined by operation "${n.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[i,n]}))}}},VariableDefinition(n){t[n.variable.name.value]=!0}}}var oy=j(()=>{"use strict";d();f();p();Re()});function Tl(e){let t=[],n=[];return{OperationDefinition(r){return t.push(r),!1},FragmentDefinition(r){return n.push(r),!1},Document:{leave(){let r=Object.create(null);for(let i of t)for(let s of e.getRecursivelyReferencedFragments(i))r[s.name.value]=!0;for(let i of n){let s=i.name.value;r[s]!==!0&&e.reportError(new k(`Fragment "${s}" is never used.`,{nodes:i}))}}}}}var ay=j(()=>{"use strict";d();f();p();Re()});function yl(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(n){let r=Object.create(null),i=e.getRecursiveVariableUsages(n);for(let{node:s}of i)r[s.name.value]=!0;for(let s of t){let o=s.variable.name.value;r[o]!==!0&&e.reportError(new k(n.name?`Variable "$${o}" is never used in operation "${n.name.value}".`:`Variable "$${o}" is never used.`,{nodes:s}))}}},VariableDefinition(n){t.push(n)}}}var uy=j(()=>{"use strict";d();f();p();Re()});function vu(e){switch(e.kind){case _.OBJECT:return M(A({},e),{fields:lx(e.fields)});case _.LIST:return M(A({},e),{values:e.values.map(vu)});case _.INT:case _.FLOAT:case _.STRING:case _.BOOLEAN:case _.NULL:case _.ENUM:case _.VARIABLE:return e}}function lx(e){return e.map(t=>M(A({},t),{value:vu(t.value)})).sort((t,n)=>es(t.name.value,n.name.value))}var cy=j(()=>{"use strict";d();f();p();Vc();at()});function Ob(e){return Array.isArray(e)?e.map(([t,n])=>`subfields "${t}" conflict because `+Ob(n)).join(" and "):e}function El(e){let t=new py,n=new Map;return{SelectionSet(r){let i=dx(e,n,t,e.getParentType(),r);for(let[[s,o],a,u]of i){let c=Ob(o);e.reportError(new k(`Fields "${s}" conflict because ${c}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:a.concat(u)}))}}}}function dx(e,t,n,r,i){let s=[],[o,a]=sf(e,t,r,i);if(fx(e,s,t,n,o),a.length!==0)for(let u=0;u1)for(let a=0;a({kind:_.OBJECT_FIELD,name:i.name,value:i.value}))};return Ve(vu(r))}function ly(e,t){return qe(e)?qe(t)?ly(e.ofType,t.ofType):!0:qe(t)?!0:Te(e)?Te(t)?ly(e.ofType,t.ofType):!0:Te(t)?!0:yn(e)||yn(t)?e!==t:!1}function sf(e,t,n,r){let i=t.get(r);if(i)return i;let s=Object.create(null),o=Object.create(null);wb(e,n,r,s,o);let a=[s,Object.keys(o)];return t.set(r,a),a}function dy(e,t,n){let r=t.get(n.selectionSet);if(r)return r;let i=Bt(e.getSchema(),n.typeCondition);return sf(e,t,i,n.selectionSet)}function wb(e,t,n,r,i){for(let s of n.selections)switch(s.kind){case _.FIELD:{let o=s.name.value,a;(we(t)||Ce(t))&&(a=t.getFields()[o]);let u=s.alias?s.alias.value:o;r[u]||(r[u]=[]),r[u].push([t,s,a]);break}case _.FRAGMENT_SPREAD:i[s.name.value]=!0;break;case _.INLINE_FRAGMENT:{let o=s.typeCondition,a=o?Bt(e.getSchema(),o):t;wb(e,a,s.selectionSet,r,i);break}}}function mx(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()]]}var py,my=j(()=>{"use strict";d();f();p();mt();Re();at();gr();tt();cy();Oi();py=class{constructor(){this._data=new Map}has(t,n,r){var i;let[s,o]=t{"use strict";d();f();p();mt();Re();tt();Xc();Oi()});function gl(e){let t=e.getSchema(),n=Object.create(null);for(let i of e.getDocument().definitions)Mr(i)&&(n[i.name.value]=i);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(i){let s=i.name.value,o=n[s],a=t==null?void 0:t.getType(s),u;if(o?u=Tx[o.kind]:a&&(u=yx(a)),u){if(u!==i.kind){let c=Ex(i.kind);e.reportError(new k(`Cannot extend non-${c} type "${s}".`,{nodes:o?[o,i]:i}))}}else{let c=Object.keys(A(A({},n),t==null?void 0:t.getTypeMap())),l=sr(s,c);e.reportError(new k(`Cannot extend type "${s}" because it is not defined.`+Kn(l),{nodes:i.name}))}}}function yx(e){if(qt(e))return _.SCALAR_TYPE_EXTENSION;if(we(e))return _.OBJECT_TYPE_EXTENSION;if(Ce(e))return _.INTERFACE_TYPE_EXTENSION;if(dt(e))return _.UNION_TYPE_EXTENSION;if(it(e))return _.ENUM_TYPE_EXTENSION;if(Be(e))return _.INPUT_OBJECT_TYPE_EXTENSION;Xe(!1,"Unexpected type: "+B(e))}function Ex(e){switch(e){case _.SCALAR_TYPE_EXTENSION:return"scalar";case _.OBJECT_TYPE_EXTENSION:return"object";case _.INTERFACE_TYPE_EXTENSION:return"interface";case _.UNION_TYPE_EXTENSION:return"union";case _.ENUM_TYPE_EXTENSION:return"enum";case _.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:Xe(!1,"Unexpected kind: "+B(e))}}var Tx,Ty=j(()=>{"use strict";d();f();p();ho();mt();qn();yo();Re();at();ya();tt();Tx={[_.SCALAR_TYPE_DEFINITION]:_.SCALAR_TYPE_EXTENSION,[_.OBJECT_TYPE_DEFINITION]:_.OBJECT_TYPE_EXTENSION,[_.INTERFACE_TYPE_DEFINITION]:_.INTERFACE_TYPE_EXTENSION,[_.UNION_TYPE_DEFINITION]:_.UNION_TYPE_EXTENSION,[_.ENUM_TYPE_DEFINITION]:_.ENUM_TYPE_EXTENSION,[_.INPUT_OBJECT_TYPE_DEFINITION]:_.INPUT_OBJECT_TYPE_EXTENSION}});function Il(e){return M(A({},yy(e)),{Field:{leave(t){var n;let r=e.getFieldDef();if(!r)return!1;let i=new Set((n=t.arguments)===null||n===void 0?void 0:n.map(s=>s.name.value));for(let s of r.args)if(!i.has(s.name)&&Sr(s)){let o=B(s.type);e.reportError(new k(`Field "${r.name}" argument "${s.name}" of type "${o}" is required, but it was not provided.`,{nodes:t}))}}}})}function yy(e){var t;let n=Object.create(null),r=e.getSchema(),i=(t=r==null?void 0:r.getDirectives())!==null&&t!==void 0?t:Jn;for(let a of i)n[a.name]=Qn(a.args.filter(Sr),u=>u.name);let s=e.getDocument().definitions;for(let a of s)if(a.kind===_.DIRECTIVE_DEFINITION){var o;let u=(o=a.arguments)!==null&&o!==void 0?o:[];n[a.name.value]=Qn(u.filter(Nx),c=>c.name.value)}return{Directive:{leave(a){let u=a.name.value,c=n[u];if(c){var l;let m=(l=a.arguments)!==null&&l!==void 0?l:[],h=new Set(m.map(E=>E.name.value));for(let[E,N]of Object.entries(c))if(!h.has(E)){let D=No(N.type)?B(N.type):Ve(N.type);e.reportError(new k(`Directive "@${u}" argument "${E}" of type "${D}" is required, but it was not provided.`,{nodes:a}))}}}}}}function Nx(e){return e.type.kind===_.NON_NULL_TYPE&&e.defaultValue==null}var Ey=j(()=>{"use strict";d();f();p();mt();To();Re();at();gr();tt();dr()});function vl(e){return{Field(t){let n=e.getType(),r=t.selectionSet;if(n){if(yn(Ct(n))){if(r){let i=t.name.value,s=B(n);e.reportError(new k(`Field "${i}" must not have a selection since type "${s}" has no subfields.`,{nodes:r}))}}else if(!r){let i=t.name.value,s=B(n);e.reportError(new k(`Field "${i}" of type "${s}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:t}))}}}}}var Ny=j(()=>{"use strict";d();f();p();mt();Re();tt()});function of(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}var gy=j(()=>{"use strict";d();f();p()});function us(e,t,n){return{prev:e,key:t,typename:n}}function On(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}var _l=j(()=>{"use strict";d();f();p()});function Sl(e,t,n=gx){return bl(e,t,n,void 0)}function gx(e,t,n){let r="Invalid value "+B(t);throw e.length>0&&(r+=` at "value${of(e)}"`),n.message=r+": "+n.message,n}function bl(e,t,n,r){if(Te(t)){if(e!=null)return bl(e,t.ofType,n,r);n(On(r),e,new k(`Expected non-nullable type "${B(t)}" not to be null.`));return}if(e==null)return null;if(qe(t)){let i=t.ofType;return hu(e)?Array.from(e,(s,o)=>{let a=us(r,o,void 0);return bl(s,i,n,a)}):[bl(e,i,n,r)]}if(Be(t)){if(!Zt(e)){n(On(r),e,new k(`Expected type "${t.name}" to be an object.`));return}let i={},s=t.getFields();for(let o of Object.values(s)){let a=e[o.name];if(a===void 0){if(o.defaultValue!==void 0)i[o.name]=o.defaultValue;else if(Te(o.type)){let u=B(o.type);n(On(r),e,new k(`Field "${o.name}" of required type "${u}" was not provided.`))}continue}i[o.name]=bl(a,o.type,n,us(r,o.name,t.name))}for(let o of Object.keys(e))if(!s[o]){let a=sr(o,Object.keys(t.getFields()));n(On(r),e,new k(`Field "${o}" is not defined by type "${t.name}".`+Kn(a)))}return i}if(yn(t)){let i;try{i=t.parseValue(e)}catch(s){s instanceof k?n(On(r),e,s):n(On(r),e,new k(`Expected type "${t.name}". `+s.message,{originalError:s}));return}return i===void 0&&n(On(r),e,new k(`Expected type "${t.name}".`)),i}Xe(!1,"Unexpected input type: "+B(t))}var Iy=j(()=>{"use strict";d();f();p();ho();mt();qn();Wp();gi();_l();gy();yo();Re();tt()});function ur(e,t,n){if(e){if(e.kind===_.VARIABLE){let r=e.name.value;if(n==null||n[r]===void 0)return;let i=n[r];return i===null&&Te(t)?void 0:i}if(Te(t))return e.kind===_.NULL?void 0:ur(e,t.ofType,n);if(e.kind===_.NULL)return null;if(qe(t)){let r=t.ofType;if(e.kind===_.LIST){let s=[];for(let o of e.values)if(Fb(o,n)){if(Te(r))return;s.push(null)}else{let a=ur(o,r,n);if(a===void 0)return;s.push(a)}return s}let i=ur(e,r,n);return i===void 0?void 0:[i]}if(Be(t)){if(e.kind!==_.OBJECT)return;let r=Object.create(null),i=Qn(e.fields,s=>s.name.value);for(let s of Object.values(t.getFields())){let o=i[s.name];if(!o||Fb(o.value,n)){if(s.defaultValue!==void 0)r[s.name]=s.defaultValue;else if(Te(s.type))return;continue}let a=ur(o.value,s.type,n);if(a===void 0)return;r[s.name]=a}return r}if(yn(t)){let r;try{r=t.parseLiteral(e,n)}catch(i){return}return r===void 0?void 0:r}Xe(!1,"Unexpected input type: "+B(t))}}function Fb(e,t){return e.kind===_.VARIABLE&&(t==null||t[e.name.value]===void 0)}var Dl=j(()=>{"use strict";d();f();p();mt();qn();To();at();tt()});function Ol(e,t,n,r){let i=[],s=r==null?void 0:r.maxErrors;try{let o=Ix(e,t,n,a=>{if(s!=null&&i.length>=s)throw new k("Too many errors processing variables, error limit reached. Execution aborted.");i.push(a)});if(i.length===0)return{coerced:o}}catch(o){i.push(o)}return{errors:i}}function Ix(e,t,n,r){let i={};for(let s of t){let o=s.variable.name.value,a=Bt(e,s.type);if(!on(a)){let c=Ve(s.type);r(new k(`Variable "$${o}" expected value of type "${c}" which cannot be used as an input type.`,{nodes:s.type}));continue}if(!Lb(n,o)){if(s.defaultValue)i[o]=ur(s.defaultValue,a);else if(Te(a)){let c=B(a);r(new k(`Variable "$${o}" of required type "${c}" was not provided.`,{nodes:s}))}continue}let u=n[o];if(u===null&&Te(a)){let c=B(a);r(new k(`Variable "$${o}" of non-null type "${c}" must not be null.`,{nodes:s}));continue}i[o]=Sl(u,a,(c,l,m)=>{let h=`Variable "$${o}" got invalid value `+B(l);c.length>0&&(h+=` at "${o}${of(c)}"`),r(new k(h+"; "+m.message,{nodes:s,originalError:m}))})}return i}function _o(e,t,n){var r;let i={},s=(r=t.arguments)!==null&&r!==void 0?r:[],o=Qn(s,a=>a.name.value);for(let a of e.args){let u=a.name,c=a.type,l=o[u];if(!l){if(a.defaultValue!==void 0)i[u]=a.defaultValue;else if(Te(c))throw new k(`Argument "${u}" of required type "${B(c)}" was not provided.`,{nodes:t});continue}let m=l.value,h=m.kind===_.NULL;if(m.kind===_.VARIABLE){let N=m.name.value;if(n==null||!Lb(n,N)){if(a.defaultValue!==void 0)i[u]=a.defaultValue;else if(Te(c))throw new k(`Argument "${u}" of required type "${B(c)}" was provided the variable "$${N}" which was not provided a runtime value.`,{nodes:m});continue}h=n[N]==null}if(h&&Te(c))throw new k(`Argument "${u}" of non-null type "${B(c)}" must not be null.`,{nodes:m});let E=ur(m,c,n);if(E===void 0)throw new k(`Argument "${u}" has invalid value ${Ve(m)}.`,{nodes:m});i[u]=E}return i}function cs(e,t,n){var r;let i=(r=t.directives)===null||r===void 0?void 0:r.find(s=>s.name.value===e.name);if(i)return _o(e,i,n)}function Lb(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var _u=j(()=>{"use strict";d();f();p();mt();To();gy();Re();at();gr();tt();Iy();Oi();Dl()});function bu(e,t,n,r,i){let s=new Map;return af(e,t,n,r,i,s,new Set),s}function kb(e,t,n,r,i){let s=new Map,o=new Set;for(let a of i)a.selectionSet&&af(e,t,n,r,a.selectionSet,s,o);return s}function af(e,t,n,r,i,s,o){for(let a of i.selections)switch(a.kind){case _.FIELD:{if(!vy(n,a))continue;let u=vx(a),c=s.get(u);c!==void 0?c.push(a):s.set(u,[a]);break}case _.INLINE_FRAGMENT:{if(!vy(n,a)||!Rb(e,a,r))continue;af(e,t,n,r,a.selectionSet,s,o);break}case _.FRAGMENT_SPREAD:{let u=a.name.value;if(o.has(u)||!vy(n,a))continue;o.add(u);let c=t[u];if(!c||!Rb(e,c,r))continue;af(e,t,n,r,c.selectionSet,s,o);break}}}function vy(e,t){let n=cs(pu,t,e);if((n==null?void 0:n.if)===!0)return!1;let r=cs(du,t,e);return(r==null?void 0:r.if)!==!1}function Rb(e,t,n){let r=t.typeCondition;if(!r)return!0;let i=Bt(e,r);return i===n?!0:Pn(i)?e.isSubType(i,n):!1}function vx(e){return e.alias?e.alias.value:e.name.value}var uf=j(()=>{"use strict";d();f();p();at();tt();dr();Oi();_u()});function Al(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,s=Object.create(null),o=e.getDocument(),a=Object.create(null);for(let c of o.definitions)c.kind===_.FRAGMENT_DEFINITION&&(a[c.name.value]=c);let u=bu(n,a,s,r,t.selectionSet);if(u.size>1){let m=[...u.values()].slice(1).flat();e.reportError(new k(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:m}))}for(let c of u.values())c[0].name.value.startsWith("__")&&e.reportError(new k(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:c}))}}}}}var _y=j(()=>{"use strict";d();f();p();Re();at();uf()});function Su(e,t){let n=new Map;for(let r of e){let i=t(r),s=n.get(i);s===void 0?n.set(i,[r]):s.push(r)}return n}var cf=j(()=>{"use strict";d();f();p()});function wl(e){return{DirectiveDefinition(r){var i;let s=(i=r.arguments)!==null&&i!==void 0?i:[];return n(`@${r.name.value}`,s)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(r){var i;let s=r.name.value,o=(i=r.fields)!==null&&i!==void 0?i:[];for(let u of o){var a;let c=u.name.value,l=(a=u.arguments)!==null&&a!==void 0?a:[];n(`${s}.${c}`,l)}return!1}function n(r,i){let s=Su(i,o=>o.name.value);for(let[o,a]of s)a.length>1&&e.reportError(new k(`Argument "${r}(${o}:)" can only be defined once.`,{nodes:a.map(u=>u.name)}));return!1}}var by=j(()=>{"use strict";d();f();p();cf();Re()});function Du(e){return{Field:t,Directive:t};function t(n){var r;let i=(r=n.arguments)!==null&&r!==void 0?r:[],s=Su(i,o=>o.name.value);for(let[o,a]of s)a.length>1&&e.reportError(new k(`There can be only one argument named "${o}".`,{nodes:a.map(u=>u.name)}))}}var Sy=j(()=>{"use strict";d();f();p();cf();Re()});function Fl(e){let t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(r){let i=r.name.value;if(n!=null&&n.getDirective(i)){e.reportError(new k(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}return t[i]?e.reportError(new k(`There can be only one directive named "@${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1}}}var Dy=j(()=>{"use strict";d();f();p();Re()});function Ou(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Jn;for(let a of r)t[a.name]=!a.isRepeatable;let i=e.getDocument().definitions;for(let a of i)a.kind===_.DIRECTIVE_DEFINITION&&(t[a.name.value]=!a.repeatable);let s=Object.create(null),o=Object.create(null);return{enter(a){if(!("directives"in a)||!a.directives)return;let u;if(a.kind===_.SCHEMA_DEFINITION||a.kind===_.SCHEMA_EXTENSION)u=s;else if(Mr(a)||vo(a)){let c=a.name.value;u=o[c],u===void 0&&(o[c]=u=Object.create(null))}else u=Object.create(null);for(let c of a.directives){let l=c.name.value;t[l]&&(u[l]?e.reportError(new k(`The directive "@${l}" can only be used once at this location.`,{nodes:[u[l],c]})):u[l]=c)}}}}var Oy=j(()=>{"use strict";d();f();p();Re();at();ya();dr()});function Ll(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(s){var o;let a=s.name.value;r[a]||(r[a]=Object.create(null));let u=(o=s.values)!==null&&o!==void 0?o:[],c=r[a];for(let l of u){let m=l.name.value,h=n[a];it(h)&&h.getValue(m)?e.reportError(new k(`Enum value "${a}.${m}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name})):c[m]?e.reportError(new k(`Enum value "${a}.${m}" can only be defined once.`,{nodes:[c[m],l.name]})):c[m]=l.name}return!1}}var Ay=j(()=>{"use strict";d();f();p();Re();tt()});function Rl(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(s){var o;let a=s.name.value;r[a]||(r[a]=Object.create(null));let u=(o=s.fields)!==null&&o!==void 0?o:[],c=r[a];for(let l of u){let m=l.name.value;_x(n[a],m)?e.reportError(new k(`Field "${a}.${m}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name})):c[m]?e.reportError(new k(`Field "${a}.${m}" can only be defined once.`,{nodes:[c[m],l.name]})):c[m]=l.name}return!1}}function _x(e,t){return we(e)||Ce(e)||Be(e)?e.getFields()[t]!=null:!1}var wy=j(()=>{"use strict";d();f();p();Re();tt()});function kl(e){let t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){let r=n.name.value;return t[r]?e.reportError(new k(`There can be only one fragment named "${r}".`,{nodes:[t[r],n.name]})):t[r]=n.name,!1}}}var Fy=j(()=>{"use strict";d();f();p();Re()});function Au(e){let t=[],n=Object.create(null);return{ObjectValue:{enter(){t.push(n),n=Object.create(null)},leave(){let r=t.pop();r||Xe(!1),n=r}},ObjectField(r){let i=r.name.value;n[i]?e.reportError(new k(`There can be only one input field named "${i}".`,{nodes:[n[i],r.name]})):n[i]=r.name}}}var Ly=j(()=>{"use strict";d();f();p();qn();Re()});function xl(e){let t=Object.create(null);return{OperationDefinition(n){let r=n.name;return r&&(t[r.value]?e.reportError(new k(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),!1},FragmentDefinition:()=>!1}}var Ry=j(()=>{"use strict";d();f();p();Re()});function Pl(e){let t=e.getSchema(),n=Object.create(null),r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(s){var o;let a=(o=s.operationTypes)!==null&&o!==void 0?o:[];for(let u of a){let c=u.operation,l=n[c];r[c]?e.reportError(new k(`Type for ${c} already defined in the schema. It cannot be redefined.`,{nodes:u})):l?e.reportError(new k(`There can be only one ${c} type in schema.`,{nodes:[l,u]})):n[c]=u}return!1}}var ky=j(()=>{"use strict";d();f();p();Re()});function Ml(e){let t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(i){let s=i.name.value;if(n!=null&&n.getType(s)){e.reportError(new k(`Type "${s}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}));return}return t[s]?e.reportError(new k(`There can be only one type named "${s}".`,{nodes:[t[s],i.name]})):t[s]=i.name,!1}}var xy=j(()=>{"use strict";d();f();p();Re()});function Ul(e){return{OperationDefinition(t){var n;let r=(n=t.variableDefinitions)!==null&&n!==void 0?n:[],i=Su(r,s=>s.variable.name.value);for(let[s,o]of i)o.length>1&&e.reportError(new k(`There can be only one variable named "$${s}".`,{nodes:o.map(a=>a.variable.name)}))}}}var Py=j(()=>{"use strict";d();f();p();cf();Re()});function Cl(e){return{ListValue(t){let n=ua(e.getParentInputType());if(!qe(n))return Ea(e,t),!1},ObjectValue(t){let n=Ct(e.getInputType());if(!Be(n))return Ea(e,t),!1;let r=Qn(t.fields,i=>i.name.value);for(let i of Object.values(n.getFields()))if(!r[i.name]&&rs(i)){let o=B(i.type);e.reportError(new k(`Field "${n.name}.${i.name}" of required type "${o}" was not provided.`,{nodes:t}))}},ObjectField(t){let n=Ct(e.getParentInputType());if(!e.getInputType()&&Be(n)){let i=sr(t.name.value,Object.keys(n.getFields()));e.reportError(new k(`Field "${t.name.value}" is not defined by type "${n.name}".`+Kn(i),{nodes:t}))}},NullValue(t){let n=e.getInputType();Te(n)&&e.reportError(new k(`Expected value of type "${B(n)}", found ${Ve(t)}.`,{nodes:t}))},EnumValue:t=>Ea(e,t),IntValue:t=>Ea(e,t),FloatValue:t=>Ea(e,t),StringValue:t=>Ea(e,t),BooleanValue:t=>Ea(e,t)}}function Ea(e,t){let n=e.getInputType();if(!n)return;let r=Ct(n);if(!yn(r)){let i=B(n);e.reportError(new k(`Expected value of type "${i}", found ${Ve(t)}.`,{nodes:t}));return}try{if(r.parseLiteral(t,void 0)===void 0){let s=B(n);e.reportError(new k(`Expected value of type "${s}", found ${Ve(t)}.`,{nodes:t}))}}catch(i){let s=B(n);i instanceof k?e.reportError(i):e.reportError(new k(`Expected value of type "${s}", found ${Ve(t)}; `+i.message,{nodes:t,originalError:i}))}}var My=j(()=>{"use strict";d();f();p();ho();mt();To();yo();Re();gr();tt()});function Bl(e){return{VariableDefinition(t){let n=Bt(e.getSchema(),t.type);if(n!==void 0&&!on(n)){let r=t.variable.name.value,i=Ve(t.type);e.reportError(new k(`Variable "$${r}" cannot be non-input type "${i}".`,{nodes:t.type}))}}}}var Uy=j(()=>{"use strict";d();f();p();Re();gr();tt();Oi()});function $l(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i,type:s,defaultValue:o}of r){let a=i.name.value,u=t[a];if(u&&s){let c=e.getSchema(),l=Bt(c,u.type);if(l&&!bx(c,l,u.defaultValue,s,o)){let m=B(l),h=B(s);e.reportError(new k(`Variable "$${a}" of type "${m}" used in position expecting type "${h}".`,{nodes:[u,i]}))}}}}},VariableDefinition(n){t[n.variable.name.value]=n}}}function bx(e,t,n,r,i){if(Te(r)&&!Te(t)){if(!(n!=null&&n.kind!==_.NULL)&&!(i!==void 0))return!1;let a=r.ofType;return ii(e,t,a)}return ii(e,t,r)}var Cy=j(()=>{"use strict";d();f();p();mt();Re();at();tt();Xc();Oi()});var Vl,xb,By=j(()=>{"use strict";d();f();p();zT();XT();HT();ZT();ey();ty();ny();ry();iy();sy();oy();ay();uy();my();hy();Ty();Ey();Ny();_y();by();Sy();Dy();Oy();Ay();wy();Fy();Ly();Ry();ky();xy();Py();My();Uy();Cy();Vl=Object.freeze([al,xl,pl,Al,Iu,cl,Bl,vl,ul,kl,dl,Tl,Nl,ml,Ul,hl,yl,gu,Ou,ll,Du,Cl,Il,$l,El,Au]),xb=Object.freeze([fl,Pl,Ml,Ll,Rl,wl,Fl,Iu,gu,Ou,gl,WT,Du,Au,yy])});var lf,df,Na,$y=j(()=>{"use strict";d();f();p();at();sa();ef();lf=class{constructor(t,n){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(let r of this.getDocument().definitions)r.kind===_.FRAGMENT_DEFINITION&&(n[r.name.value]=r);this._fragments=n}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];let r=[t],i;for(;i=r.pop();)for(let s of i.selections)s.kind===_.FRAGMENT_SPREAD?n.push(s):s.selectionSet&&r.push(s.selectionSet);this._fragmentSpreads.set(t,n)}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];let r=Object.create(null),i=[t.selectionSet],s;for(;s=i.pop();)for(let o of this.getFragmentSpreads(s)){let a=o.name.value;if(r[a]!==!0){r[a]=!0;let u=this.getFragment(a);u&&(n.push(u),i.push(u.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}},df=class extends lf{constructor(t,n,r){super(t,r),this._schema=n}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}},Na=class extends lf{constructor(t,n,r,i){super(n,i),this._schema=t,this._typeInfo=r,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(t){let n=this._variableUsages.get(t);if(!n){let r=[],i=new as(this._schema);xr(t,Ta(i,{VariableDefinition:()=>!1,Variable(s){r.push({node:s,type:i.getInputType(),defaultValue:i.getDefaultValue()})}})),n=r,this._variableUsages.set(t,n)}return n}getRecursiveVariableUsages(t){let n=this._recursiveVariableUsages.get(t);if(!n){n=this.getVariableUsages(t);for(let r of this.getRecursivelyReferencedFragments(t))n=n.concat(this.getVariableUsages(r));this._recursiveVariableUsages.set(t,n)}return n}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}});function jl(e,t,n=Vl,r,i=new as(e)){var s;let o=(s=r==null?void 0:r.maxErrors)!==null&&s!==void 0?s:100;t||Oe(!1,"Must provide document."),ha(e);let a=Object.freeze({}),u=[],c=new Na(e,t,i,m=>{if(u.length>=o)throw u.push(new k("Too many validation errors, error limit reached. Validation aborted.")),a;u.push(m)}),l=su(n.map(m=>m(c)));try{xr(t,Ta(i,l))}catch(m){if(m!==a)throw m}return u}function Pb(e,t,n=xb){let r=[],i=new df(e,t,o=>{r.push(o)}),s=n.map(o=>o(i));return xr(e,su(s)),r}function Mb(e){let t=Pb(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(` -`))}function US(e,t){let n=CS(e,t);if(n.length!==0)throw new Error(n.map(r=>r.message).join(` +`))}function Ub(e,t){let n=Pb(e,t);if(n.length!==0)throw new Error(n.map(r=>r.message).join(` -`))}var Dp=Y(()=>{"use strict";d();m();f();yr();Ve();ka();ql();im();fN();mN()});function jS(e){let t;return function(r,i,o){t===void 0&&(t=new WeakMap);let s=t.get(r);s===void 0&&(s=new WeakMap,t.set(r,s));let a=s.get(i);a===void 0&&(a=new WeakMap,s.set(i,a));let c=a.get(o);return c===void 0&&(c=e(r,i,o),a.set(o,c)),c}}var VS=Y(()=>{"use strict";d();m();f()});function hN(e){return Promise.all(Object.values(e)).then(t=>{let n=Object.create(null);for(let[r,i]of Object.keys(e).entries())n[i]=t[r];return n})}var $S=Y(()=>{"use strict";d();m();f()});function GS(e,t,n){let r=n;for(let i of e)r=er(r)?r.then(o=>t(o,i)):t(r,i);return r}var qS=Y(()=>{"use strict";d();m();f();Cf()});function BS(e){return e instanceof Error?e:new yN(e)}var yN,KS=Y(()=>{"use strict";d();m();f();xt();yN=class extends Error{constructor(t){super("Unexpected error value: "+q(t)),this.name="NonErrorThrown",this.thrownValue=t}}});function Wi(e,t,n){var r;let i=BS(e);return MM(i)?i:new j(i.message,{nodes:(r=i.nodes)!==null&&r!==void 0?r:t,source:i.source,positions:i.positions,path:n,originalError:i})}function MM(e){return Array.isArray(e.path)}var hm=Y(()=>{"use strict";d();m();f();KS();Ve()});function ia(e){arguments.length<2||xe(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:t,document:n,variableValues:r,rootValue:i}=e;EN(t,n,r);let o=NN(e);if(!("schema"in o))return{errors:o};try{let{operation:s}=o,a=jM(o,s,i);return er(a)?a.then(c=>ym(c,o.errors),c=>(o.errors.push(c),ym(null,o.errors))):ym(a,o.errors)}catch(s){return o.errors.push(s),ym(null,o.errors)}}function Rp(e){let t=ia(e);if(er(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function ym(e,t){return t.length===0?{data:e}:{errors:t,data:e}}function EN(e,t,n){t||xe(!1,"Must provide document."),qa(e),n==null||hn(n)||xe(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function NN(e){var t,n;let{schema:r,document:i,rootValue:o,contextValue:s,variableValues:a,operationName:c,fieldResolver:u,typeResolver:l,subscribeFieldResolver:p}=e,h,y=Object.create(null);for(let w of i.definitions)switch(w.kind){case b.OPERATION_DEFINITION:if(c==null){if(h!==void 0)return[new j("Must provide operation name if query contains multiple operations.")];h=w}else((t=w.name)===null||t===void 0?void 0:t.value)===c&&(h=w);break;case b.FRAGMENT_DEFINITION:y[w.name.value]=w;break;default:}if(!h)return c!=null?[new j(`Unknown operation named "${c}".`)]:[new j("Must provide an operation.")];let N=(n=h.variableDefinitions)!==null&&n!==void 0?n:[],O=pp(r,N,a!=null?a:{},{maxErrors:50});return O.errors?O.errors:{schema:r,fragments:y,rootValue:o,contextValue:s,operation:h,variableValues:O.coerced,fieldResolver:u!=null?u:wp,typeResolver:l!=null?l:Nm,subscribeFieldResolver:p!=null?p:wp,errors:[]}}function jM(e,t,n){let r=e.schema.getRootType(t.operation);if(r==null)throw new j(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});let i=oc(e.schema,e.fragments,e.variableValues,r,t.selectionSet),o=void 0;switch(t.operation){case Yt.QUERY:return Tm(e,r,n,o,i);case Yt.MUTATION:return VM(e,r,n,o,i);case Yt.SUBSCRIPTION:return Tm(e,r,n,o,i)}}function VM(e,t,n,r,i){return GS(i.entries(),(o,[s,a])=>{let c=Bo(r,s,t.name),u=JS(e,t,n,a,c);return u===void 0?o:er(u)?u.then(l=>(o[s]=l,o)):(o[s]=u,o)},Object.create(null))}function Tm(e,t,n,r,i){let o=Object.create(null),s=!1;try{for(let[a,c]of i.entries()){let u=Bo(r,a,t.name),l=JS(e,t,n,c,u);l!==void 0&&(o[a]=l,er(l)&&(s=!0))}}catch(a){if(s)return hN(o).finally(()=>{throw a});throw a}return s?hN(o):o}function JS(e,t,n,r,i){var o;let s=vN(e.schema,t,r[0]);if(!s)return;let a=s.type,c=(o=s.resolve)!==null&&o!==void 0?o:e.fieldResolver,u=gN(e,s,r,t,i);try{let l=ra(s,r[0],e.variableValues),p=e.contextValue,h=c(n,l,p,u),y;return er(h)?y=h.then(N=>Ap(e,a,r,u,i,N)):y=Ap(e,a,r,u,i,h),er(y)?y.then(void 0,N=>{let O=Wi(N,r,$n(i));return Em(O,a,e)}):y}catch(l){let p=Wi(l,r,$n(i));return Em(p,a,e)}}function gN(e,t,n,r,i){return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function Em(e,t,n){if(Oe(t))throw e;return n.errors.push(e),null}function Ap(e,t,n,r,i,o){if(o instanceof Error)throw o;if(Oe(t)){let s=Ap(e,t.ofType,n,r,i,o);if(s===null)throw new Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return s}if(o==null)return null;if(tt(t))return $M(e,t,n,r,i,o);if(Rn(t))return GM(t,o);if(Yn(t))return qM(e,t,n,r,i,o);if(Ue(t))return TN(e,t,n,r,i,o);ut(!1,"Cannot complete value of unexpected output type: "+q(t))}function $M(e,t,n,r,i,o){if(!Xu(o))throw new j(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);let s=t.ofType,a=!1,c=Array.from(o,(u,l)=>{let p=Bo(i,l,void 0);try{let h;return er(u)?h=u.then(y=>Ap(e,s,n,r,p,y)):h=Ap(e,s,n,r,p,u),er(h)?(a=!0,h.then(void 0,y=>{let N=Wi(y,n,$n(p));return Em(N,s,e)})):h}catch(h){let y=Wi(h,n,$n(p));return Em(y,s,e)}});return a?Promise.all(c):c}function GM(e,t){let n=e.serialize(t);if(n==null)throw new Error(`Expected \`${q(e)}.serialize(${q(t)})\` to return non-nullable value, returned: ${q(n)}`);return n}function qM(e,t,n,r,i,o){var s;let a=(s=t.resolveType)!==null&&s!==void 0?s:e.typeResolver,c=e.contextValue,u=a(o,c,r,t);return er(u)?u.then(l=>TN(e,QS(l,e,t,n,r,o),n,r,i,o)):TN(e,QS(u,e,t,n,r,o),n,r,i,o)}function QS(e,t,n,r,i,o){if(e==null)throw new j(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${n.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if(Ue(e))throw new j("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if(typeof e!="string")throw new j(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${q(o)}, received "${q(e)}".`);let s=t.schema.getType(e);if(s==null)throw new j(`Abstract type "${n.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!Ue(s))throw new j(`Abstract type "${n.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(!t.schema.isSubType(n,s))throw new j(`Runtime Object type "${s.name}" is not a possible type for "${n.name}".`,{nodes:r});return s}function TN(e,t,n,r,i,o){let s=UM(e,t,n);if(t.isTypeOf){let a=t.isTypeOf(o,e.contextValue,r);if(er(a))return a.then(c=>{if(!c)throw YS(t,o,n);return Tm(e,t,o,i,s)});if(!a)throw YS(t,o,n)}return Tm(e,t,o,i,s)}function YS(e,t,n){return new j(`Expected value of type "${e.name}" but got: ${q(t)}.`,{nodes:n})}function vN(e,t,n){let r=n.name.value;return r===Vo.name&&e.getQueryType()===t?Vo:r===$o.name&&e.getQueryType()===t?$o:r===Go.name?Go:t.getFields()[r]}var UM,Nm,wp,Lp=Y(()=>{"use strict";d();m();f();yr();xt();tr();nm();Bi();Cf();VS();ap();$S();qS();Ve();hm();Ki();vt();ht();ri();ql();pm();ic();UM=jS((e,t,n)=>PS(e.schema,e.fragments,e.variableValues,t,n));Nm=function(e,t,n,r){if(hn(e)&&typeof e.__typename=="string")return e.__typename;let i=n.schema.getPossibleTypes(r),o=[];for(let s=0;s{for(let a=0;at(HS(e)))}function XS(e){let t=HS(e);if(er(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function HS(e){arguments.length<2||xe(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:t,source:n,rootValue:r,contextValue:i,variableValues:o,operationName:s,fieldResolver:a,typeResolver:c}=e,u=Hu(t);if(u.length>0)return{errors:u};let l;try{l=Oi(n)}catch(h){return{errors:[h]}}let p=Sp(t,l);return p.length>0?{errors:p}:ia({schema:t,document:l,rootValue:r,contextValue:i,variableValues:o,operationName:s,fieldResolver:a,typeResolver:c})}var WS=Y(()=>{"use strict";d();m();f();yr();Cf();ju();ql();Dp();Lp()});var ZS=Y(()=>{"use strict";d();m();f();$a();ht();Dr();Ji();ri();ql();Dl()});var eD=Y(()=>{"use strict";d();m();f();Jf();Mf();$T();vt();gl();Kf();ju();Vr();ka();Ki();Ka();xu()});function IN(e){return typeof(e==null?void 0:e[Symbol.asyncIterator])=="function"}var tD=Y(()=>{"use strict";d();m();f()});function nD(e,t){let n=e[Symbol.asyncIterator]();function r(o){return Wt(this,null,function*(){if(o.done)return o;try{return{value:yield t(o.value),done:!1}}catch(s){if(typeof n.return=="function")try{yield n.return()}catch(a){}throw s}})}return{next(){return Wt(this,null,function*(){return r(yield n.next())})},return(){return Wt(this,null,function*(){return typeof n.return=="function"?r(yield n.return()):{value:void 0,done:!0}})},throw(o){return Wt(this,null,function*(){if(typeof n.throw=="function")return r(yield n.throw(o));throw o})},[Symbol.asyncIterator](){return this}}}var rD=Y(()=>{"use strict";d();m();f()});function bN(t){return Wt(this,arguments,function*(e){arguments.length<2||xe(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let n=yield gm(e);return IN(n)?nD(n,i=>ia(x(D({},e),{rootValue:i}))):n})}function BM(e){let t=e[0];return t&&"document"in t?t:{schema:t,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]}}function gm(...e){return Wt(this,null,function*(){let t=BM(e),{schema:n,document:r,variableValues:i}=t;EN(n,r,i);let o=NN(t);if(!("schema"in o))return{errors:o};try{let s=yield KM(o);if(!IN(s))throw new Error(`Subscription field must return Async Iterable. Received: ${q(s)}.`);return s}catch(s){if(s instanceof j)return{errors:[s]};throw s}})}function KM(e){return Wt(this,null,function*(){let{schema:t,fragments:n,operation:r,variableValues:i,rootValue:o}=e,s=t.getSubscriptionType();if(s==null)throw new j("Schema is not configured to execute subscription operation.",{nodes:r});let a=oc(t,n,i,s,r.selectionSet),[c,u]=[...a.entries()][0],l=vN(t,s,u[0]);if(!l){let N=u[0].name.value;throw new j(`The subscription field "${N}" is not defined.`,{nodes:u})}let p=Bo(void 0,c,s.name),h=gN(e,l,u,s,p);try{var y;let N=ra(l,u[0],i),O=e.contextValue,M=yield((y=l.subscribe)!==null&&y!==void 0?y:e.subscribeFieldResolver)(o,N,O,h);if(M instanceof Error)throw M;return M}catch(N){throw Wi(N,u,$n(p))}})}var iD=Y(()=>{"use strict";d();m();f();yr();xt();tD();ap();Ve();hm();pm();Lp();rD();ic()});var oD=Y(()=>{"use strict";d();m();f();ap();Lp();iD();ic()});function _N(e){return{Field(t){let n=e.getFieldDef(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){let i=e.getParentType();i!=null||ut(!1),e.reportError(new j(`The field ${i.name}.${n.name} is deprecated. ${r}`,{nodes:t}))}},Argument(t){let n=e.getArgument(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){let i=e.getDirective();if(i!=null)e.reportError(new j(`Directive "@${i.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}));else{let o=e.getParentType(),s=e.getFieldDef();o!=null&&s!=null||ut(!1),e.reportError(new j(`Field "${o.name}.${s.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}))}}},ObjectField(t){let n=Zt(e.getParentInputType());if(He(n)){let r=n.getFields()[t.name.value],i=r==null?void 0:r.deprecationReason;i!=null&&e.reportError(new j(`The input field ${n.name}.${r.name} is deprecated. ${i}`,{nodes:t}))}},EnumValue(t){let n=e.getEnumValue(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){let i=Zt(e.getInputType());i!=null||ut(!1),e.reportError(new j(`The enum value "${i.name}.${n.name}" is deprecated. ${r}`,{nodes:t}))}}}}var sD=Y(()=>{"use strict";d();m();f();tr();Ve();ht()});function ON(e){return{Field(t){let n=Zt(e.getType());n&&sr(n)&&e.reportError(new j(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}}var aD=Y(()=>{"use strict";d();m();f();Ve();ht();ri()});var uD=Y(()=>{"use strict";d();m();f();Dp();mN();fN();bE();_E();OE();DE();AE();wE();RE();LE();kE();PE();xE();CE();GE();qE();QE();YE();HE();ZE();tN();iN();oN();sN();cN();lN();pN();dN();FE();aN();uN();nN();rN();WE();eN();BE();sD();aD()});var cD=Y(()=>{"use strict";d();m();f();Ve();Uf();hm()});function Fp(e){let t=D({descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1},e),n=t.descriptions?"description":"",r=t.specifiedByUrl?"specifiedByURL":"",i=t.directiveIsRepeatable?"isRepeatable":"",o=t.schemaDescription?n:"";function s(a){return t.inputValueDeprecation?a:""}return` +`))}var Gl=j(()=>{"use strict";d();f();p();rr();Re();sa();sl();ef();By();$y()});function Cb(e){let t;return function(r,i,s){t===void 0&&(t=new WeakMap);let o=t.get(r);o===void 0&&(o=new WeakMap,t.set(r,o));let a=o.get(i);a===void 0&&(a=new WeakMap,o.set(i,a));let u=a.get(s);return u===void 0&&(u=e(r,i,s),a.set(s,u)),u}}var Bb=j(()=>{"use strict";d();f();p()});function Vy(e){return Promise.all(Object.values(e)).then(t=>{let n=Object.create(null);for(let[r,i]of Object.keys(e).entries())n[i]=t[r];return n})}var $b=j(()=>{"use strict";d();f();p()});function Vb(e,t,n){let r=n;for(let i of e)r=Gn(r)?r.then(s=>t(s,i)):t(r,i);return r}var jb=j(()=>{"use strict";d();f();p();Rp()});function Gb(e){return e instanceof Error?e:new jy(e)}var jy,qb=j(()=>{"use strict";d();f();p();mt();jy=class extends Error{constructor(t){super("Unexpected error value: "+B(t)),this.name="NonErrorThrown",this.thrownValue=t}}});function Ai(e,t,n){var r;let i=Gb(e);return Sx(i)?i:new k(i.message,{nodes:(r=i.nodes)!==null&&r!==void 0?r:t,source:i.source,positions:i.positions,path:n,originalError:i})}function Sx(e){return Array.isArray(e.path)}var pf=j(()=>{"use strict";d();f();p();qb();Re()});function bo(e){arguments.length<2||Oe(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:t,document:n,variableValues:r,rootValue:i}=e;qy(t,n,r);let s=Ky(e);if(!("schema"in s))return{errors:s};try{let{operation:o}=s,a=Ox(s,o,i);return Gn(a)?a.then(u=>ff(u,s.errors),u=>(s.errors.push(u),ff(null,s.errors))):ff(a,s.errors)}catch(o){return s.errors.push(o),ff(null,s.errors)}}function Ql(e){let t=bo(e);if(Gn(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function ff(e,t){return t.length===0?{data:e}:{errors:t,data:e}}function qy(e,t,n){t||Oe(!1,"Must provide document."),ha(e),n==null||Zt(n)||Oe(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function Ky(e){var t,n;let{schema:r,document:i,rootValue:s,contextValue:o,variableValues:a,operationName:u,fieldResolver:c,typeResolver:l,subscribeFieldResolver:m}=e,h,E=Object.create(null);for(let w of i.definitions)switch(w.kind){case _.OPERATION_DEFINITION:if(u==null){if(h!==void 0)return[new k("Must provide operation name if query contains multiple operations.")];h=w}else((t=w.name)===null||t===void 0?void 0:t.value)===u&&(h=w);break;case _.FRAGMENT_DEFINITION:E[w.name.value]=w;break;default:}if(!h)return u!=null?[new k(`Unknown operation named "${u}".`)]:[new k("Must provide an operation.")];let N=(n=h.variableDefinitions)!==null&&n!==void 0?n:[],D=Ol(r,N,a!=null?a:{},{maxErrors:50});return D.errors?D.errors:{schema:r,fragments:E,rootValue:s,contextValue:o,operation:h,variableValues:D.coerced,fieldResolver:c!=null?c:Kl,typeResolver:l!=null?l:Tf,subscribeFieldResolver:m!=null?m:Kl,errors:[]}}function Ox(e,t,n){let r=e.schema.getRootType(t.operation);if(r==null)throw new k(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});let i=bu(e.schema,e.fragments,e.variableValues,r,t.selectionSet),s=void 0;switch(t.operation){case At.QUERY:return mf(e,r,n,s,i);case At.MUTATION:return Ax(e,r,n,s,i);case At.SUBSCRIPTION:return mf(e,r,n,s,i)}}function Ax(e,t,n,r,i){return Vb(i.entries(),(s,[o,a])=>{let u=us(r,o,t.name),c=Yb(e,t,n,a,u);return c===void 0?s:Gn(c)?c.then(l=>(s[o]=l,s)):(s[o]=c,s)},Object.create(null))}function mf(e,t,n,r,i){let s=Object.create(null),o=!1;try{for(let[a,u]of i.entries()){let c=us(r,a,t.name),l=Yb(e,t,n,u,c);l!==void 0&&(s[a]=l,Gn(l)&&(o=!0))}}catch(a){if(o)return Vy(s).finally(()=>{throw a});throw a}return o?Vy(s):s}function Yb(e,t,n,r,i){var s;let o=Yy(e.schema,t,r[0]);if(!o)return;let a=o.type,u=(s=o.resolve)!==null&&s!==void 0?s:e.fieldResolver,c=Qy(e,o,r,t,i);try{let l=_o(o,r[0],e.variableValues),m=e.contextValue,h=u(n,l,m,c),E;return Gn(h)?E=h.then(N=>ql(e,a,r,c,i,N)):E=ql(e,a,r,c,i,h),Gn(E)?E.then(void 0,N=>{let D=Ai(N,r,On(i));return hf(D,a,e)}):E}catch(l){let m=Ai(l,r,On(i));return hf(m,a,e)}}function Qy(e,t,n,r,i){return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function hf(e,t,n){if(Te(t))throw e;return n.errors.push(e),null}function ql(e,t,n,r,i,s){if(s instanceof Error)throw s;if(Te(t)){let o=ql(e,t.ofType,n,r,i,s);if(o===null)throw new Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return o}if(s==null)return null;if(qe(t))return wx(e,t,n,r,i,s);if(yn(t))return Fx(t,s);if(Pn(t))return Lx(e,t,n,r,i,s);if(we(t))return Gy(e,t,n,r,i,s);Xe(!1,"Cannot complete value of unexpected output type: "+B(t))}function wx(e,t,n,r,i,s){if(!hu(s))throw new k(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);let o=t.ofType,a=!1,u=Array.from(s,(c,l)=>{let m=us(i,l,void 0);try{let h;return Gn(c)?h=c.then(E=>ql(e,o,n,r,m,E)):h=ql(e,o,n,r,m,c),Gn(h)?(a=!0,h.then(void 0,E=>{let N=Ai(E,n,On(m));return hf(N,o,e)})):h}catch(h){let E=Ai(h,n,On(m));return hf(E,o,e)}});return a?Promise.all(u):u}function Fx(e,t){let n=e.serialize(t);if(n==null)throw new Error(`Expected \`${B(e)}.serialize(${B(t)})\` to return non-nullable value, returned: ${B(n)}`);return n}function Lx(e,t,n,r,i,s){var o;let a=(o=t.resolveType)!==null&&o!==void 0?o:e.typeResolver,u=e.contextValue,c=a(s,u,r,t);return Gn(c)?c.then(l=>Gy(e,Kb(l,e,t,n,r,s),n,r,i,s)):Gy(e,Kb(c,e,t,n,r,s),n,r,i,s)}function Kb(e,t,n,r,i,s){if(e==null)throw new k(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${n.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if(we(e))throw new k("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if(typeof e!="string")throw new k(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${B(s)}, received "${B(e)}".`);let o=t.schema.getType(e);if(o==null)throw new k(`Abstract type "${n.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!we(o))throw new k(`Abstract type "${n.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(!t.schema.isSubType(n,o))throw new k(`Runtime Object type "${o.name}" is not a possible type for "${n.name}".`,{nodes:r});return o}function Gy(e,t,n,r,i,s){let o=Dx(e,t,n);if(t.isTypeOf){let a=t.isTypeOf(s,e.contextValue,r);if(Gn(a))return a.then(u=>{if(!u)throw Qb(t,s,n);return mf(e,t,s,i,o)});if(!a)throw Qb(t,s,n)}return mf(e,t,s,i,o)}function Qb(e,t,n){return new k(`Expected value of type "${e.name}" but got: ${B(t)}.`,{nodes:n})}function Yy(e,t,n){let r=n.name.value;return r===is.name&&e.getQueryType()===t?is:r===ss.name&&e.getQueryType()===t?ss:r===os.name?os:t.getFields()[r]}var Dx,Tf,Kl,Yl=j(()=>{"use strict";d();f();p();rr();mt();qn();Wp();gi();Rp();Bb();_l();$b();jb();Re();pf();Ii();at();tt();Pr();sl();uf();_u();Dx=Cb((e,t,n)=>kb(e.schema,e.fragments,e.variableValues,t,n));Tf=function(e,t,n,r){if(Zt(e)&&typeof e.__typename=="string")return e.__typename;let i=n.schema.getPossibleTypes(r),s=[];for(let o=0;o{for(let a=0;at(Xb(e)))}function zb(e){let t=Xb(e);if(Gn(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function Xb(e){arguments.length<2||Oe(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:t,source:n,rootValue:r,contextValue:i,variableValues:s,operationName:o,fieldResolver:a,typeResolver:u}=e,c=Tu(t);if(c.length>0)return{errors:c};let l;try{l=ti(n)}catch(h){return{errors:[h]}}let m=jl(t,l);return m.length>0?{errors:m}:bo({schema:t,document:l,rootValue:r,contextValue:i,variableValues:s,operationName:o,fieldResolver:a,typeResolver:u})}var Hb=j(()=>{"use strict";d();f();p();rr();Rp();iu();sl();Gl();Yl()});var Wb=j(()=>{"use strict";d();f();p();fa();tt();dr();bi();Pr();sl();Gc()});var Zb=j(()=>{"use strict";d();f();p();qp();kp();fT();at();Mc();Vp();iu();gr();sa();Ii();ya();eu()});function Jy(e){return typeof(e==null?void 0:e[Symbol.asyncIterator])=="function"}var eS=j(()=>{"use strict";d();f();p()});function tS(e,t){let n=e[Symbol.asyncIterator]();function r(s){return nr(this,null,function*(){if(s.done)return s;try{return{value:yield t(s.value),done:!1}}catch(o){if(typeof n.return=="function")try{yield n.return()}catch(a){}throw o}})}return{next(){return nr(this,null,function*(){return r(yield n.next())})},return(){return nr(this,null,function*(){return typeof n.return=="function"?r(yield n.return()):{value:void 0,done:!0}})},throw(s){return nr(this,null,function*(){if(typeof n.throw=="function")return r(yield n.throw(s));throw s})},[Symbol.asyncIterator](){return this}}}var nS=j(()=>{"use strict";d();f();p()});function zy(t){return nr(this,arguments,function*(e){arguments.length<2||Oe(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let n=yield yf(e);return Jy(n)?tS(n,i=>bo(M(A({},e),{rootValue:i}))):n})}function Rx(e){let t=e[0];return t&&"document"in t?t:{schema:t,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]}}function yf(...e){return nr(this,null,function*(){let t=Rx(e),{schema:n,document:r,variableValues:i}=t;qy(n,r,i);let s=Ky(t);if(!("schema"in s))return{errors:s};try{let o=yield kx(s);if(!Jy(o))throw new Error(`Subscription field must return Async Iterable. Received: ${B(o)}.`);return o}catch(o){if(o instanceof k)return{errors:[o]};throw o}})}function kx(e){return nr(this,null,function*(){let{schema:t,fragments:n,operation:r,variableValues:i,rootValue:s}=e,o=t.getSubscriptionType();if(o==null)throw new k("Schema is not configured to execute subscription operation.",{nodes:r});let a=bu(t,n,i,o,r.selectionSet),[u,c]=[...a.entries()][0],l=Yy(t,o,c[0]);if(!l){let N=c[0].name.value;throw new k(`The subscription field "${N}" is not defined.`,{nodes:c})}let m=us(void 0,u,o.name),h=Qy(e,l,c,o,m);try{var E;let N=_o(l,c[0],i),D=e.contextValue,x=yield((E=l.subscribe)!==null&&E!==void 0?E:e.subscribeFieldResolver)(s,N,D,h);if(x instanceof Error)throw x;return x}catch(N){throw Ai(N,c,On(m))}})}var rS=j(()=>{"use strict";d();f();p();rr();mt();eS();_l();Re();pf();uf();Yl();nS();_u()});var iS=j(()=>{"use strict";d();f();p();_l();Yl();rS();_u()});function Xy(e){return{Field(t){let n=e.getFieldDef(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){let i=e.getParentType();i!=null||Xe(!1),e.reportError(new k(`The field ${i.name}.${n.name} is deprecated. ${r}`,{nodes:t}))}},Argument(t){let n=e.getArgument(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){let i=e.getDirective();if(i!=null)e.reportError(new k(`Directive "@${i.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}));else{let s=e.getParentType(),o=e.getFieldDef();s!=null&&o!=null||Xe(!1),e.reportError(new k(`Field "${s.name}.${o.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}))}}},ObjectField(t){let n=Ct(e.getParentInputType());if(Be(n)){let r=n.getFields()[t.name.value],i=r==null?void 0:r.deprecationReason;i!=null&&e.reportError(new k(`The input field ${n.name}.${r.name} is deprecated. ${i}`,{nodes:t}))}},EnumValue(t){let n=e.getEnumValue(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){let i=Ct(e.getInputType());i!=null||Xe(!1),e.reportError(new k(`The enum value "${i.name}.${n.name}" is deprecated. ${r}`,{nodes:t}))}}}}var sS=j(()=>{"use strict";d();f();p();qn();Re();tt()});function Hy(e){return{Field(t){let n=Ct(e.getType());n&&zn(n)&&e.reportError(new k(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}}var oS=j(()=>{"use strict";d();f();p();Re();tt();Pr()});var aS=j(()=>{"use strict";d();f();p();Gl();$y();By();zT();XT();HT();ZT();ey();ty();ny();ry();sy();oy();ay();uy();my();hy();Ey();Ny();_y();Sy();Oy();Fy();Ly();Ry();Py();My();Uy();Cy();iy();ky();xy();Ay();wy();by();Dy();Ty();sS();oS()});var uS=j(()=>{"use strict";d();f();p();Re();xp();pf()});function Jl(e){let t=A({descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1},e),n=t.descriptions?"description":"",r=t.specifiedByUrl?"specifiedByURL":"",i=t.directiveIsRepeatable?"isRepeatable":"",s=t.schemaDescription?n:"";function o(a){return t.inputValueDeprecation?a:""}return` query IntrospectionQuery { __schema { - ${o} + ${s} queryType { name } mutationType { name } subscriptionType { name } @@ -82,7 +82,7 @@ In some cases, you need to provide options to alter GraphQL's execution behavior ${n} ${i} locations - args${s("(includeDeprecated: true)")} { + args${o("(includeDeprecated: true)")} { ...InputValue } } @@ -97,7 +97,7 @@ In some cases, you need to provide options to alter GraphQL's execution behavior fields(includeDeprecated: true) { name ${n} - args${s("(includeDeprecated: true)")} { + args${o("(includeDeprecated: true)")} { ...InputValue } type { @@ -106,7 +106,7 @@ In some cases, you need to provide options to alter GraphQL's execution behavior isDeprecated deprecationReason } - inputFields${s("(includeDeprecated: true)")} { + inputFields${o("(includeDeprecated: true)")} { ...InputValue } interfaces { @@ -128,8 +128,8 @@ In some cases, you need to provide options to alter GraphQL's execution behavior ${n} type { ...TypeRef } defaultValue - ${s("isDeprecated")} - ${s("deprecationReason")} + ${o("isDeprecated")} + ${o("deprecationReason")} } fragment TypeRef on __Type { @@ -164,194 +164,188 @@ In some cases, you need to provide options to alter GraphQL's execution behavior } } } - `}var SN=Y(()=>{"use strict";d();m();f()});function DN(e,t){let n=null;for(let i of e.definitions)if(i.kind===b.OPERATION_DEFINITION){var r;if(t==null){if(n)return null;n=i}else if(((r=i.name)===null||r===void 0?void 0:r.value)===t)return i}return n}var lD=Y(()=>{"use strict";d();m();f();vt()});function AN(e,t){if(t.operation==="query"){let n=e.getQueryType();if(!n)throw new j("Schema does not define the required query root type.",{nodes:t});return n}if(t.operation==="mutation"){let n=e.getMutationType();if(!n)throw new j("Schema is not configured for mutations.",{nodes:t});return n}if(t.operation==="subscription"){let n=e.getSubscriptionType();if(!n)throw new j("Schema is not configured for subscriptions.",{nodes:t});return n}throw new j("Can only have query, mutation and subscription operations.",{nodes:t})}var pD=Y(()=>{"use strict";d();m();f();Ve()});function wN(e,t){let n=D({specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0},t),r=Oi(Fp(n)),i=Rp({schema:e,document:r});return!i.errors&&i.data||ut(!1),i.data}var dD=Y(()=>{"use strict";d();m();f();tr();ju();Lp();SN()});function RN(e,t){hn(e)&&hn(e.__schema)||xe(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${q(e)}.`);let n=e.__schema,r=ti(n.types,L=>L.name,L=>h(L));for(let L of[...Yi,...Xi])r[L.name]&&(r[L.name]=L);let i=n.queryType?l(n.queryType):null,o=n.mutationType?l(n.mutationType):null,s=n.subscriptionType?l(n.subscriptionType):null,a=n.directives?n.directives.map(ft):[];return new wr({description:n.description,query:i,mutation:o,subscription:s,types:Object.values(r),directives:a,assumeValid:t==null?void 0:t.assumeValid});function c(L){if(L.kind===wt.LIST){let ne=L.ofType;if(!ne)throw new Error("Decorated type deeper than introspection query.");return new Jt(c(ne))}if(L.kind===wt.NON_NULL){let ne=L.ofType;if(!ne)throw new Error("Decorated type deeper than introspection query.");let mt=c(ne);return new Ge(Ll(mt))}return u(L)}function u(L){let ne=L.name;if(!ne)throw new Error(`Unknown type reference: ${q(L)}.`);let mt=r[ne];if(!mt)throw new Error(`Invalid or incomplete schema, unknown type: ${ne}. Ensure that a full introspection query is used in order to build a client schema.`);return mt}function l(L){return Al(u(L))}function p(L){return wl(u(L))}function h(L){if(L!=null&&L.name!=null&&L.kind!=null)switch(L.kind){case wt.SCALAR:return y(L);case wt.OBJECT:return O(L);case wt.INTERFACE:return w(L);case wt.UNION:return M(L);case wt.ENUM:return W(L);case wt.INPUT_OBJECT:return K(L)}let ne=q(L);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${ne}.`)}function y(L){return new Qn({name:L.name,description:L.description,specifiedByURL:L.specifiedByURL})}function N(L){if(L.interfaces===null&&L.kind===wt.INTERFACE)return[];if(!L.interfaces){let ne=q(L);throw new Error(`Introspection result missing interfaces: ${ne}.`)}return L.interfaces.map(p)}function O(L){return new On({name:L.name,description:L.description,interfaces:()=>N(L),fields:()=>te(L)})}function w(L){return new $r({name:L.name,description:L.description,interfaces:()=>N(L),fields:()=>te(L)})}function M(L){if(!L.possibleTypes){let ne=q(L);throw new Error(`Introspection result missing possibleTypes: ${ne}.`)}return new Gr({name:L.name,description:L.description,types:()=>L.possibleTypes.map(l)})}function W(L){if(!L.enumValues){let ne=q(L);throw new Error(`Introspection result missing enumValues: ${ne}.`)}return new ir({name:L.name,description:L.description,values:ti(L.enumValues,ne=>ne.name,ne=>({description:ne.description,deprecationReason:ne.deprecationReason}))})}function K(L){if(!L.inputFields){let ne=q(L);throw new Error(`Introspection result missing inputFields: ${ne}.`)}return new qr({name:L.name,description:L.description,fields:()=>qe(L.inputFields)})}function te(L){if(!L.fields)throw new Error(`Introspection result missing fields: ${q(L)}.`);return ti(L.fields,ne=>ne.name,pe)}function pe(L){let ne=c(L.type);if(!Br(ne)){let mt=q(ne);throw new Error(`Introspection must provide output type for fields, but received: ${mt}.`)}if(!L.args){let mt=q(L);throw new Error(`Introspection result missing field args: ${mt}.`)}return{description:L.description,deprecationReason:L.deprecationReason,type:ne,args:qe(L.args)}}function qe(L){return ti(L,ne=>ne.name,st)}function st(L){let ne=c(L.type);if(!vn(ne)){let jn=q(ne);throw new Error(`Introspection must provide input type for arguments, but received: ${jn}.`)}let mt=L.defaultValue!=null?vr(bl(L.defaultValue),ne):void 0;return{description:L.description,type:ne,defaultValue:mt,deprecationReason:L.deprecationReason}}function ft(L){if(!L.args){let ne=q(L);throw new Error(`Introspection result missing directive args: ${ne}.`)}if(!L.locations){let ne=q(L);throw new Error(`Introspection result missing directive locations: ${ne}.`)}return new zn({name:L.name,description:L.description,isRepeatable:L.isRepeatable,locations:L.locations.slice(),args:qe(L.args)})}}var fD=Y(()=>{"use strict";d();m();f();yr();xt();Bi();_l();ju();ht();Dr();ri();Ji();$a();lp()});function LN(e,t,n){Va(e),t!=null&&t.kind===b.DOCUMENT||xe(!1,"Must provide valid Document AST."),(n==null?void 0:n.assumeValid)!==!0&&(n==null?void 0:n.assumeValidSDL)!==!0&&US(t,e);let r=e.toConfig(),i=FN(r,t,n);return r===i?e:new wr(i)}function FN(e,t,n){var r,i,o,s;let a=[],c=Object.create(null),u=[],l,p=[];for(let R of t.definitions)if(R.kind===b.SCHEMA_DEFINITION)l=R;else if(R.kind===b.SCHEMA_EXTENSION)p.push(R);else if(ii(R))a.push(R);else if(na(R)){let J=R.name.value,B=c[J];c[J]=B?B.concat([R]):[R]}else R.kind===b.DIRECTIVE_DEFINITION&&u.push(R);if(Object.keys(c).length===0&&a.length===0&&u.length===0&&p.length===0&&l==null)return e;let h=Object.create(null);for(let R of e.types)h[R.name]=W(R);for(let R of a){var y;let J=R.name.value;h[J]=(y=mD[J])!==null&&y!==void 0?y:dn(R)}let N=D(D({query:e.query&&w(e.query),mutation:e.mutation&&w(e.mutation),subscription:e.subscription&&w(e.subscription)},l&&mt([l])),mt(p));return x(D({description:(r=l)===null||r===void 0||(i=r.description)===null||i===void 0?void 0:i.value},N),{types:Object.values(h),directives:[...e.directives.map(M),...u.map(ei)],extensions:Object.create(null),astNode:(o=l)!==null&&o!==void 0?o:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(p),assumeValid:(s=n==null?void 0:n.assumeValid)!==null&&s!==void 0?s:!1});function O(R){return tt(R)?new Jt(O(R.ofType)):Oe(R)?new Ge(O(R.ofType)):w(R)}function w(R){return h[R.name]}function M(R){let J=R.toConfig();return new zn(x(D({},J),{args:Si(J.args,ne)}))}function W(R){if(sr(R)||wi(R))return R;if(sn(R))return pe(R);if(Ue(R))return qe(R);if(ze(R))return st(R);if(At(R))return ft(R);if(gt(R))return te(R);if(He(R))return K(R);ut(!1,"Unexpected type: "+q(R))}function K(R){var J;let B=R.toConfig(),X=(J=c[B.name])!==null&&J!==void 0?J:[];return new qr(x(D({},B),{fields:()=>D(D({},Si(B.fields,we=>x(D({},we),{type:O(we.type)}))),qi(X)),extensionASTNodes:B.extensionASTNodes.concat(X)}))}function te(R){var J;let B=R.toConfig(),X=(J=c[R.name])!==null&&J!==void 0?J:[];return new ir(x(D({},B),{values:D(D({},B.values),_i(X)),extensionASTNodes:B.extensionASTNodes.concat(X)}))}function pe(R){var J;let B=R.toConfig(),X=(J=c[B.name])!==null&&J!==void 0?J:[],we=B.specifiedByURL;for(let G of X){var C;we=(C=hD(G))!==null&&C!==void 0?C:we}return new Qn(x(D({},B),{specifiedByURL:we,extensionASTNodes:B.extensionASTNodes.concat(X)}))}function qe(R){var J;let B=R.toConfig(),X=(J=c[B.name])!==null&&J!==void 0?J:[];return new On(x(D({},B),{interfaces:()=>[...R.getInterfaces().map(w),...mr(X)],fields:()=>D(D({},Si(B.fields,L)),jr(X)),extensionASTNodes:B.extensionASTNodes.concat(X)}))}function st(R){var J;let B=R.toConfig(),X=(J=c[B.name])!==null&&J!==void 0?J:[];return new $r(x(D({},B),{interfaces:()=>[...R.getInterfaces().map(w),...mr(X)],fields:()=>D(D({},Si(B.fields,L)),jr(X)),extensionASTNodes:B.extensionASTNodes.concat(X)}))}function ft(R){var J;let B=R.toConfig(),X=(J=c[B.name])!==null&&J!==void 0?J:[];return new Gr(x(D({},B),{types:()=>[...R.getTypes().map(w),...Dt(X)],extensionASTNodes:B.extensionASTNodes.concat(X)}))}function L(R){return x(D({},R),{type:O(R.type),args:R.args&&Si(R.args,ne)})}function ne(R){return x(D({},R),{type:O(R.type)})}function mt(R){let J={};for(let X of R){var B;let we=(B=X.operationTypes)!==null&&B!==void 0?B:[];for(let C of we)J[C.operation]=jn(C.type)}return J}function jn(R){var J;let B=R.name.value,X=(J=mD[B])!==null&&J!==void 0?J:h[B];if(X===void 0)throw new Error(`Unknown type: "${B}".`);return X}function wn(R){return R.kind===b.LIST_TYPE?new Jt(wn(R.type)):R.kind===b.NON_NULL_TYPE?new Ge(wn(R.type)):jn(R)}function ei(R){var J;return new zn({name:R.name.value,description:(J=R.description)===null||J===void 0?void 0:J.value,locations:R.locations.map(({value:B})=>B),isRepeatable:R.repeatable,args:Sr(R.arguments),astNode:R})}function jr(R){let J=Object.create(null);for(let we of R){var B;let C=(B=we.fields)!==null&&B!==void 0?B:[];for(let G of C){var X;J[G.name.value]={type:wn(G.type),description:(X=G.description)===null||X===void 0?void 0:X.value,args:Sr(G.arguments),deprecationReason:vm(G),astNode:G}}}return J}function Sr(R){let J=R!=null?R:[],B=Object.create(null);for(let we of J){var X;let C=wn(we.type);B[we.name.value]={type:C,description:(X=we.description)===null||X===void 0?void 0:X.value,defaultValue:vr(we.defaultValue,C),deprecationReason:vm(we),astNode:we}}return B}function qi(R){let J=Object.create(null);for(let we of R){var B;let C=(B=we.fields)!==null&&B!==void 0?B:[];for(let G of C){var X;let Ne=wn(G.type);J[G.name.value]={type:Ne,description:(X=G.description)===null||X===void 0?void 0:X.value,defaultValue:vr(G.defaultValue,Ne),deprecationReason:vm(G),astNode:G}}}return J}function _i(R){let J=Object.create(null);for(let we of R){var B;let C=(B=we.values)!==null&&B!==void 0?B:[];for(let G of C){var X;J[G.name.value]={description:(X=G.description)===null||X===void 0?void 0:X.value,deprecationReason:vm(G),astNode:G}}}return J}function mr(R){return R.flatMap(J=>{var B,X;return(B=(X=J.interfaces)===null||X===void 0?void 0:X.map(jn))!==null&&B!==void 0?B:[]})}function Dt(R){return R.flatMap(J=>{var B,X;return(B=(X=J.types)===null||X===void 0?void 0:X.map(jn))!==null&&B!==void 0?B:[]})}function dn(R){var J;let B=R.name.value,X=(J=c[B])!==null&&J!==void 0?J:[];switch(R.kind){case b.OBJECT_TYPE_DEFINITION:{var we;let Ke=[R,...X];return new On({name:B,description:(we=R.description)===null||we===void 0?void 0:we.value,interfaces:()=>mr(Ke),fields:()=>jr(Ke),astNode:R,extensionASTNodes:X})}case b.INTERFACE_TYPE_DEFINITION:{var C;let Ke=[R,...X];return new $r({name:B,description:(C=R.description)===null||C===void 0?void 0:C.value,interfaces:()=>mr(Ke),fields:()=>jr(Ke),astNode:R,extensionASTNodes:X})}case b.ENUM_TYPE_DEFINITION:{var G;let Ke=[R,...X];return new ir({name:B,description:(G=R.description)===null||G===void 0?void 0:G.value,values:_i(Ke),astNode:R,extensionASTNodes:X})}case b.UNION_TYPE_DEFINITION:{var Ne;let Ke=[R,...X];return new Gr({name:B,description:(Ne=R.description)===null||Ne===void 0?void 0:Ne.value,types:()=>Dt(Ke),astNode:R,extensionASTNodes:X})}case b.SCALAR_TYPE_DEFINITION:{var Pe;return new Qn({name:B,description:(Pe=R.description)===null||Pe===void 0?void 0:Pe.value,specifiedByURL:hD(R),astNode:R,extensionASTNodes:X})}case b.INPUT_OBJECT_TYPE_DEFINITION:{var Nt;let Ke=[R,...X];return new qr({name:B,description:(Nt=R.description)===null||Nt===void 0?void 0:Nt.value,fields:()=>qi(Ke),astNode:R,extensionASTNodes:X})}}}}function vm(e){let t=Ko(zi,e);return t==null?void 0:t.reason}function hD(e){let t=Ko(zu,e);return t==null?void 0:t.url}var mD,kN=Y(()=>{"use strict";d();m();f();yr();xt();tr();Xs();zT();vt();Ka();ht();Dr();ri();Ji();$a();Dp();ic();lp();mD=rr([...Yi,...Xi],e=>e.name)});function Im(e,t){e!=null&&e.kind===b.DOCUMENT||xe(!1,"Must provide valid Document AST."),(t==null?void 0:t.assumeValid)!==!0&&(t==null?void 0:t.assumeValidSDL)!==!0&&MS(e);let r=FN({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},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,...or.filter(o=>r.directives.every(s=>s.name!==o.name))];return new wr(x(D({},r),{directives:i}))}function PN(e,t){let n=Oi(e,{noLocation:t==null?void 0:t.noLocation,allowLegacyFragmentVariables:t==null?void 0:t.allowLegacyFragmentVariables});return Im(n,{assumeValidSDL:t==null?void 0:t.assumeValidSDL,assumeValid:t==null?void 0:t.assumeValid})}var yD=Y(()=>{"use strict";d();m();f();yr();vt();ju();Dr();$a();Dp();kN()});function kp(e){let t=e.toConfig(),n=ti(xN(t.types),h=>h.name,p);return new wr(x(D({},t),{types:Object.values(n),directives:xN(t.directives).map(s),query:o(t.query),mutation:o(t.mutation),subscription:o(t.subscription)}));function r(h){return tt(h)?new Jt(r(h.ofType)):Oe(h)?new Ge(r(h.ofType)):i(h)}function i(h){return n[h.name]}function o(h){return h&&i(h)}function s(h){let y=h.toConfig();return new zn(x(D({},y),{locations:TD(y.locations,N=>N),args:a(y.args)}))}function a(h){return bm(h,y=>x(D({},y),{type:r(y.type)}))}function c(h){return bm(h,y=>x(D({},y),{type:r(y.type),args:y.args&&a(y.args)}))}function u(h){return bm(h,y=>x(D({},y),{type:r(y.type)}))}function l(h){return xN(h).map(i)}function p(h){if(sn(h)||sr(h))return h;if(Ue(h)){let y=h.toConfig();return new On(x(D({},y),{interfaces:()=>l(y.interfaces),fields:()=>c(y.fields)}))}if(ze(h)){let y=h.toConfig();return new $r(x(D({},y),{interfaces:()=>l(y.interfaces),fields:()=>c(y.fields)}))}if(At(h)){let y=h.toConfig();return new Gr(x(D({},y),{types:()=>l(y.types)}))}if(gt(h)){let y=h.toConfig();return new ir(x(D({},y),{values:bm(y.values,N=>N)}))}if(He(h)){let y=h.toConfig();return new qr(x(D({},y),{fields:()=>u(y.fields)}))}ut(!1,"Unexpected type: "+q(h))}}function bm(e,t){let n=Object.create(null);for(let r of Object.keys(e).sort(Co))n[r]=t(e[r]);return n}function xN(e){return TD(e,t=>t.name)}function TD(e,t){return e.slice().sort((n,r)=>{let i=t(n),o=t(r);return Co(i,o)})}var ED=Y(()=>{"use strict";d();m();f();xt();tr();_l();Ol();ht();Dr();ri();$a()});function Pp(e){return ND(e,t=>!ta(t),QM)}function MN(e){return ND(e,ta,sr)}function QM(e){return!wi(e)&&!sr(e)}function ND(e,t,n){let r=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(n);return[YM(e),...r.map(o=>tU(o)),...i.map(o=>_m(o))].filter(Boolean).join(` + `}var Wy=j(()=>{"use strict";d();f();p()});function Zy(e,t){let n=null;for(let i of e.definitions)if(i.kind===_.OPERATION_DEFINITION){var r;if(t==null){if(n)return null;n=i}else if(((r=i.name)===null||r===void 0?void 0:r.value)===t)return i}return n}var cS=j(()=>{"use strict";d();f();p();at()});function eE(e,t){if(t.operation==="query"){let n=e.getQueryType();if(!n)throw new k("Schema does not define the required query root type.",{nodes:t});return n}if(t.operation==="mutation"){let n=e.getMutationType();if(!n)throw new k("Schema is not configured for mutations.",{nodes:t});return n}if(t.operation==="subscription"){let n=e.getSubscriptionType();if(!n)throw new k("Schema is not configured for subscriptions.",{nodes:t});return n}throw new k("Can only have query, mutation and subscription operations.",{nodes:t})}var lS=j(()=>{"use strict";d();f();p();Re()});function tE(e,t){let n=A({specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0},t),r=ti(Jl(n)),i=Ql({schema:e,document:r});return!i.errors&&i.data||Xe(!1),i.data}var dS=j(()=>{"use strict";d();f();p();qn();iu();Yl();Wy()});function nE(e,t){Zt(e)&&Zt(e.__schema)||Oe(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${B(e)}.`);let n=e.__schema,r=kr(n.types,X=>X.name,X=>h(X));for(let X of[..._i,...Di])r[X.name]&&(r[X.name]=X);let i=n.queryType?l(n.queryType):null,s=n.mutationType?l(n.mutationType):null,o=n.subscriptionType?l(n.subscriptionType):null,a=n.directives?n.directives.map(Pt):[];return new fr({description:n.description,query:i,mutation:s,subscription:o,types:Object.values(r),directives:a,assumeValid:t==null?void 0:t.assumeValid});function u(X){if(X.kind===pt.LIST){let De=X.ofType;if(!De)throw new Error("Decorated type deeper than introspection query.");return new wt(u(De))}if(X.kind===pt.NON_NULL){let De=X.ofType;if(!De)throw new Error("Decorated type deeper than introspection query.");let sn=u(De);return new xe(Yc(sn))}return c(X)}function c(X){let De=X.name;if(!De)throw new Error(`Unknown type reference: ${B(X)}.`);let sn=r[De];if(!sn)throw new Error(`Invalid or incomplete schema, unknown type: ${De}. Ensure that a full introspection query is used in order to build a client schema.`);return sn}function l(X){return qc(c(X))}function m(X){return Kc(c(X))}function h(X){if(X!=null&&X.name!=null&&X.kind!=null)switch(X.kind){case pt.SCALAR:return E(X);case pt.OBJECT:return D(X);case pt.INTERFACE:return w(X);case pt.UNION:return x(X);case pt.ENUM:return Y(X);case pt.INPUT_OBJECT:return Q(X)}let De=B(X);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${De}.`)}function E(X){return new xn({name:X.name,description:X.description,specifiedByURL:X.specifiedByURL})}function N(X){if(X.interfaces===null&&X.kind===pt.INTERFACE)return[];if(!X.interfaces){let De=B(X);throw new Error(`Introspection result missing interfaces: ${De}.`)}return X.interfaces.map(m)}function D(X){return new fn({name:X.name,description:X.description,interfaces:()=>N(X),fields:()=>W(X)})}function w(X){return new Ir({name:X.name,description:X.description,interfaces:()=>N(X),fields:()=>W(X)})}function x(X){if(!X.possibleTypes){let De=B(X);throw new Error(`Introspection result missing possibleTypes: ${De}.`)}return new vr({name:X.name,description:X.description,types:()=>X.possibleTypes.map(l)})}function Y(X){if(!X.enumValues){let De=B(X);throw new Error(`Introspection result missing enumValues: ${De}.`)}return new Yn({name:X.name,description:X.description,values:kr(X.enumValues,De=>De.name,De=>({description:De.description,deprecationReason:De.deprecationReason}))})}function Q(X){if(!X.inputFields){let De=B(X);throw new Error(`Introspection result missing inputFields: ${De}.`)}return new _r({name:X.name,description:X.description,fields:()=>Qe(X.inputFields)})}function W(X){if(!X.fields)throw new Error(`Introspection result missing fields: ${B(X)}.`);return kr(X.fields,De=>De.name,Ie)}function Ie(X){let De=u(X.type);if(!br(De)){let sn=B(De);throw new Error(`Introspection must provide output type for fields, but received: ${sn}.`)}if(!X.args){let sn=B(X);throw new Error(`Introspection result missing field args: ${sn}.`)}return{description:X.description,deprecationReason:X.deprecationReason,type:De,args:Qe(X.args)}}function Qe(X){return kr(X,De=>De.name,et)}function et(X){let De=u(X.type);if(!on(De)){let Zr=B(De);throw new Error(`Introspection must provide input type for arguments, but received: ${Zr}.`)}let sn=X.defaultValue!=null?ur(Bc(X.defaultValue),De):void 0;return{description:X.description,type:De,defaultValue:sn,deprecationReason:X.deprecationReason}}function Pt(X){if(!X.args){let De=B(X);throw new Error(`Introspection result missing directive args: ${De}.`)}if(!X.locations){let De=B(X);throw new Error(`Introspection result missing directive locations: ${De}.`)}return new Un({name:X.name,description:X.description,isRepeatable:X.isRepeatable,locations:X.locations.slice(),args:Qe(X.args)})}}var pS=j(()=>{"use strict";d();f();p();rr();mt();gi();$c();iu();tt();dr();Pr();bi();fa();Dl()});function rE(e,t,n){pa(e),t!=null&&t.kind===_.DOCUMENT||Oe(!1,"Must provide valid Document AST."),(n==null?void 0:n.assumeValid)!==!0&&(n==null?void 0:n.assumeValidSDL)!==!0&&Ub(t,e);let r=e.toConfig(),i=iE(r,t,n);return r===i?e:new fr(i)}function iE(e,t,n){var r,i,s,o;let a=[],u=Object.create(null),c=[],l,m=[];for(let K of t.definitions)if(K.kind===_.SCHEMA_DEFINITION)l=K;else if(K.kind===_.SCHEMA_EXTENSION)m.push(K);else if(Mr(K))a.push(K);else if(vo(K)){let ae=K.name.value,te=u[ae];u[ae]=te?te.concat([K]):[K]}else K.kind===_.DIRECTIVE_DEFINITION&&c.push(K);if(Object.keys(u).length===0&&a.length===0&&c.length===0&&m.length===0&&l==null)return e;let h=Object.create(null);for(let K of e.types)h[K.name]=Y(K);for(let K of a){var E;let ae=K.name.value;h[ae]=(E=fS[ae])!==null&&E!==void 0?E:dn(K)}let N=A(A({query:e.query&&w(e.query),mutation:e.mutation&&w(e.mutation),subscription:e.subscription&&w(e.subscription)},l&&sn([l])),sn(m));return M(A({description:(r=l)===null||r===void 0||(i=r.description)===null||i===void 0?void 0:i.value},N),{types:Object.values(h),directives:[...e.directives.map(x),...c.map(Ei)],extensions:Object.create(null),astNode:(s=l)!==null&&s!==void 0?s:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(m),assumeValid:(o=n==null?void 0:n.assumeValid)!==null&&o!==void 0?o:!1});function D(K){return qe(K)?new wt(D(K.ofType)):Te(K)?new xe(D(K.ofType)):w(K)}function w(K){return h[K.name]}function x(K){let ae=K.toConfig();return new Un(M(A({},ae),{args:ni(ae.args,De)}))}function Y(K){if(zn(K)||si(K))return K;if(qt(K))return Ie(K);if(we(K))return Qe(K);if(Ce(K))return et(K);if(dt(K))return Pt(K);if(it(K))return W(K);if(Be(K))return Q(K);Xe(!1,"Unexpected type: "+B(K))}function Q(K){var ae;let te=K.toConfig(),ue=(ae=u[te.name])!==null&&ae!==void 0?ae:[];return new _r(M(A({},te),{fields:()=>A(A({},ni(te.fields,lt=>M(A({},lt),{type:D(lt.type)}))),Ho(ue)),extensionASTNodes:te.extensionASTNodes.concat(ue)}))}function W(K){var ae;let te=K.toConfig(),ue=(ae=u[K.name])!==null&&ae!==void 0?ae:[];return new Yn(M(A({},te),{values:A(A({},te.values),co(ue)),extensionASTNodes:te.extensionASTNodes.concat(ue)}))}function Ie(K){var ae;let te=K.toConfig(),ue=(ae=u[te.name])!==null&&ae!==void 0?ae:[],lt=te.specifiedByURL;for(let G of ue){var P;lt=(P=mS(G))!==null&&P!==void 0?P:lt}return new xn(M(A({},te),{specifiedByURL:lt,extensionASTNodes:te.extensionASTNodes.concat(ue)}))}function Qe(K){var ae;let te=K.toConfig(),ue=(ae=u[te.name])!==null&&ae!==void 0?ae:[];return new fn(M(A({},te),{interfaces:()=>[...K.getInterfaces().map(w),...Ni(ue)],fields:()=>A(A({},ni(te.fields,X)),uo(ue)),extensionASTNodes:te.extensionASTNodes.concat(ue)}))}function et(K){var ae;let te=K.toConfig(),ue=(ae=u[te.name])!==null&&ae!==void 0?ae:[];return new Ir(M(A({},te),{interfaces:()=>[...K.getInterfaces().map(w),...Ni(ue)],fields:()=>A(A({},ni(te.fields,X)),uo(ue)),extensionASTNodes:te.extensionASTNodes.concat(ue)}))}function Pt(K){var ae;let te=K.toConfig(),ue=(ae=u[te.name])!==null&&ae!==void 0?ae:[];return new vr(M(A({},te),{types:()=>[...K.getTypes().map(w),...Nt(ue)],extensionASTNodes:te.extensionASTNodes.concat(ue)}))}function X(K){return M(A({},K),{type:D(K.type),args:K.args&&ni(K.args,De)})}function De(K){return M(A({},K),{type:D(K.type)})}function sn(K){let ae={};for(let ue of K){var te;let lt=(te=ue.operationTypes)!==null&&te!==void 0?te:[];for(let P of lt)ae[P.operation]=Zr(P.type)}return ae}function Zr(K){var ae;let te=K.name.value,ue=(ae=fS[te])!==null&&ae!==void 0?ae:h[te];if(ue===void 0)throw new Error(`Unknown type: "${te}".`);return ue}function Nr(K){return K.kind===_.LIST_TYPE?new wt(Nr(K.type)):K.kind===_.NON_NULL_TYPE?new xe(Nr(K.type)):Zr(K)}function Ei(K){var ae;return new Un({name:K.name.value,description:(ae=K.description)===null||ae===void 0?void 0:ae.value,locations:K.locations.map(({value:te})=>te),isRepeatable:K.repeatable,args:ei(K.arguments),astNode:K})}function uo(K){let ae=Object.create(null);for(let lt of K){var te;let P=(te=lt.fields)!==null&&te!==void 0?te:[];for(let G of P){var ue;ae[G.name.value]={type:Nr(G.type),description:(ue=G.description)===null||ue===void 0?void 0:ue.value,args:ei(G.arguments),deprecationReason:Ef(G),astNode:G}}}return ae}function ei(K){let ae=K!=null?K:[],te=Object.create(null);for(let lt of ae){var ue;let P=Nr(lt.type);te[lt.name.value]={type:P,description:(ue=lt.description)===null||ue===void 0?void 0:ue.value,defaultValue:ur(lt.defaultValue,P),deprecationReason:Ef(lt),astNode:lt}}return te}function Ho(K){let ae=Object.create(null);for(let lt of K){var te;let P=(te=lt.fields)!==null&&te!==void 0?te:[];for(let G of P){var ue;let ge=Nr(G.type);ae[G.name.value]={type:ge,description:(ue=G.description)===null||ue===void 0?void 0:ue.value,defaultValue:ur(G.defaultValue,ge),deprecationReason:Ef(G),astNode:G}}}return ae}function co(K){let ae=Object.create(null);for(let lt of K){var te;let P=(te=lt.values)!==null&&te!==void 0?te:[];for(let G of P){var ue;ae[G.name.value]={description:(ue=G.description)===null||ue===void 0?void 0:ue.value,deprecationReason:Ef(G),astNode:G}}}return ae}function Ni(K){return K.flatMap(ae=>{var te,ue;return(te=(ue=ae.interfaces)===null||ue===void 0?void 0:ue.map(Zr))!==null&&te!==void 0?te:[]})}function Nt(K){return K.flatMap(ae=>{var te,ue;return(te=(ue=ae.types)===null||ue===void 0?void 0:ue.map(Zr))!==null&&te!==void 0?te:[]})}function dn(K){var ae;let te=K.name.value,ue=(ae=u[te])!==null&&ae!==void 0?ae:[];switch(K.kind){case _.OBJECT_TYPE_DEFINITION:{var lt;let ze=[K,...ue];return new fn({name:te,description:(lt=K.description)===null||lt===void 0?void 0:lt.value,interfaces:()=>Ni(ze),fields:()=>uo(ze),astNode:K,extensionASTNodes:ue})}case _.INTERFACE_TYPE_DEFINITION:{var P;let ze=[K,...ue];return new Ir({name:te,description:(P=K.description)===null||P===void 0?void 0:P.value,interfaces:()=>Ni(ze),fields:()=>uo(ze),astNode:K,extensionASTNodes:ue})}case _.ENUM_TYPE_DEFINITION:{var G;let ze=[K,...ue];return new Yn({name:te,description:(G=K.description)===null||G===void 0?void 0:G.value,values:co(ze),astNode:K,extensionASTNodes:ue})}case _.UNION_TYPE_DEFINITION:{var ge;let ze=[K,...ue];return new vr({name:te,description:(ge=K.description)===null||ge===void 0?void 0:ge.value,types:()=>Nt(ze),astNode:K,extensionASTNodes:ue})}case _.SCALAR_TYPE_DEFINITION:{var ke;return new xn({name:te,description:(ke=K.description)===null||ke===void 0?void 0:ke.value,specifiedByURL:mS(K),astNode:K,extensionASTNodes:ue})}case _.INPUT_OBJECT_TYPE_DEFINITION:{var ft;let ze=[K,...ue];return new _r({name:te,description:(ft=K.description)===null||ft===void 0?void 0:ft.value,fields:()=>Ho(ze),astNode:K,extensionASTNodes:ue})}}}}function Ef(e){let t=cs(Si,e);return t==null?void 0:t.reason}function mS(e){let t=cs(mu,e);return t==null?void 0:t.url}var fS,sE=j(()=>{"use strict";d();f();p();rr();mt();qn();To();IT();at();ya();tt();dr();Pr();bi();fa();Gl();_u();Dl();fS=Qn([..._i,...Di],e=>e.name)});function Nf(e,t){e!=null&&e.kind===_.DOCUMENT||Oe(!1,"Must provide valid Document AST."),(t==null?void 0:t.assumeValid)!==!0&&(t==null?void 0:t.assumeValidSDL)!==!0&&Mb(e);let r=iE({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(r.astNode==null)for(let s of r.types)switch(s.name){case"Query":r.query=s;break;case"Mutation":r.mutation=s;break;case"Subscription":r.subscription=s;break}let i=[...r.directives,...Jn.filter(s=>r.directives.every(o=>o.name!==s.name))];return new fr(M(A({},r),{directives:i}))}function oE(e,t){let n=ti(e,{noLocation:t==null?void 0:t.noLocation,allowLegacyFragmentVariables:t==null?void 0:t.allowLegacyFragmentVariables});return Nf(n,{assumeValidSDL:t==null?void 0:t.assumeValidSDL,assumeValid:t==null?void 0:t.assumeValid})}var hS=j(()=>{"use strict";d();f();p();rr();at();iu();dr();fa();Gl();sE()});function zl(e){let t=e.toConfig(),n=kr(aE(t.types),h=>h.name,m);return new fr(M(A({},t),{types:Object.values(n),directives:aE(t.directives).map(o),query:s(t.query),mutation:s(t.mutation),subscription:s(t.subscription)}));function r(h){return qe(h)?new wt(r(h.ofType)):Te(h)?new xe(r(h.ofType)):i(h)}function i(h){return n[h.name]}function s(h){return h&&i(h)}function o(h){let E=h.toConfig();return new Un(M(A({},E),{locations:TS(E.locations,N=>N),args:a(E.args)}))}function a(h){return gf(h,E=>M(A({},E),{type:r(E.type)}))}function u(h){return gf(h,E=>M(A({},E),{type:r(E.type),args:E.args&&a(E.args)}))}function c(h){return gf(h,E=>M(A({},E),{type:r(E.type)}))}function l(h){return aE(h).map(i)}function m(h){if(qt(h)||zn(h))return h;if(we(h)){let E=h.toConfig();return new fn(M(A({},E),{interfaces:()=>l(E.interfaces),fields:()=>u(E.fields)}))}if(Ce(h)){let E=h.toConfig();return new Ir(M(A({},E),{interfaces:()=>l(E.interfaces),fields:()=>u(E.fields)}))}if(dt(h)){let E=h.toConfig();return new vr(M(A({},E),{types:()=>l(E.types)}))}if(it(h)){let E=h.toConfig();return new Yn(M(A({},E),{values:gf(E.values,N=>N)}))}if(Be(h)){let E=h.toConfig();return new _r(M(A({},E),{fields:()=>c(E.fields)}))}Xe(!1,"Unexpected type: "+B(h))}}function gf(e,t){let n=Object.create(null);for(let r of Object.keys(e).sort(es))n[r]=t(e[r]);return n}function aE(e){return TS(e,t=>t.name)}function TS(e,t){return e.slice().sort((n,r)=>{let i=t(n),s=t(r);return es(i,s)})}var yS=j(()=>{"use strict";d();f();p();mt();qn();$c();Vc();tt();dr();Pr();fa()});function Xl(e){return ES(e,t=>!Io(t),xx)}function cE(e){return ES(e,Io,zn)}function xx(e){return!si(e)&&!zn(e)}function ES(e,t,n){let r=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(n);return[Px(e),...r.map(s=>Gx(s)),...i.map(s=>If(s))].filter(Boolean).join(` -`)}function YM(e){if(e.description==null&&JM(e))return;let t=[],n=e.getQueryType();n&&t.push(` query: ${n.name}`);let r=e.getMutationType();r&&t.push(` mutation: ${r.name}`);let i=e.getSubscriptionType();return i&&t.push(` subscription: ${i.name}`),oi(e)+`schema { +`)}function Px(e){if(e.description==null&&Mx(e))return;let t=[],n=e.getQueryType();n&&t.push(` query: ${n.name}`);let r=e.getMutationType();r&&t.push(` mutation: ${r.name}`);let i=e.getSubscriptionType();return i&&t.push(` subscription: ${i.name}`),Ur(e)+`schema { ${t.join(` `)} -}`}function JM(e){let t=e.getQueryType();if(t&&t.name!=="Query")return!1;let n=e.getMutationType();if(n&&n.name!=="Mutation")return!1;let r=e.getSubscriptionType();return!(r&&r.name!=="Subscription")}function _m(e){if(sn(e))return zM(e);if(Ue(e))return XM(e);if(ze(e))return HM(e);if(At(e))return WM(e);if(gt(e))return ZM(e);if(He(e))return eU(e);ut(!1,"Unexpected type: "+q(e))}function zM(e){return oi(e)+`scalar ${e.name}`+nU(e)}function gD(e){let t=e.getInterfaces();return t.length?" implements "+t.map(n=>n.name).join(" & "):""}function XM(e){return oi(e)+`type ${e.name}`+gD(e)+vD(e)}function HM(e){return oi(e)+`interface ${e.name}`+gD(e)+vD(e)}function WM(e){let t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return oi(e)+"union "+e.name+n}function ZM(e){let t=e.getValues().map((n,r)=>oi(n," ",!r)+" "+n.name+jN(n.deprecationReason));return oi(e)+`enum ${e.name}`+UN(t)}function eU(e){let t=Object.values(e.getFields()).map((n,r)=>oi(n," ",!r)+" "+CN(n));return oi(e)+`input ${e.name}`+UN(t)}function vD(e){let t=Object.values(e.getFields()).map((n,r)=>oi(n," ",!r)+" "+n.name+ID(n.args," ")+": "+String(n.type)+jN(n.deprecationReason));return UN(t)}function UN(e){return e.length!==0?` { +}`}function Mx(e){let t=e.getQueryType();if(t&&t.name!=="Query")return!1;let n=e.getMutationType();if(n&&n.name!=="Mutation")return!1;let r=e.getSubscriptionType();return!(r&&r.name!=="Subscription")}function If(e){if(qt(e))return Ux(e);if(we(e))return Cx(e);if(Ce(e))return Bx(e);if(dt(e))return $x(e);if(it(e))return Vx(e);if(Be(e))return jx(e);Xe(!1,"Unexpected type: "+B(e))}function Ux(e){return Ur(e)+`scalar ${e.name}`+qx(e)}function NS(e){let t=e.getInterfaces();return t.length?" implements "+t.map(n=>n.name).join(" & "):""}function Cx(e){return Ur(e)+`type ${e.name}`+NS(e)+gS(e)}function Bx(e){return Ur(e)+`interface ${e.name}`+NS(e)+gS(e)}function $x(e){let t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return Ur(e)+"union "+e.name+n}function Vx(e){let t=e.getValues().map((n,r)=>Ur(n," ",!r)+" "+n.name+dE(n.deprecationReason));return Ur(e)+`enum ${e.name}`+lE(t)}function jx(e){let t=Object.values(e.getFields()).map((n,r)=>Ur(n," ",!r)+" "+uE(n));return Ur(e)+`input ${e.name}`+lE(t)}function gS(e){let t=Object.values(e.getFields()).map((n,r)=>Ur(n," ",!r)+" "+n.name+IS(n.args," ")+": "+String(n.type)+dE(n.deprecationReason));return lE(t)}function lE(e){return e.length!==0?` { `+e.join(` `)+` -}`:""}function ID(e,t=""){return e.length===0?"":e.every(n=>!n.description)?"("+e.map(CN).join(", ")+")":`( -`+e.map((n,r)=>oi(n," "+t,!r)+" "+t+CN(n)).join(` +}`:""}function IS(e,t=""){return e.length===0?"":e.every(n=>!n.description)?"("+e.map(uE).join(", ")+")":`( +`+e.map((n,r)=>Ur(n," "+t,!r)+" "+t+uE(n)).join(` `)+` -`+t+")"}function CN(e){let t=Xn(e.defaultValue,e.type),n=e.name+": "+String(e.type);return t&&(n+=` = ${Ze(t)}`),n+jN(e.deprecationReason)}function tU(e){return oi(e)+"directive @"+e.name+ID(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}function jN(e){return e==null?"":e!==Ju?` @deprecated(reason: ${Ze({kind:b.STRING,value:e})})`:" @deprecated"}function nU(e){return e.specifiedByURL==null?"":` @specifiedBy(url: ${Ze({kind:b.STRING,value:e.specifiedByURL})})`}function oi(e,t="",n=!0){let{description:r}=e;if(r==null)return"";let i=Ze({kind:b.STRING,value:r,block:cS(r)});return(t&&!n?` +`+t+")"}function uE(e){let t=Cn(e.defaultValue,e.type),n=e.name+": "+String(e.type);return t&&(n+=` = ${Ve(t)}`),n+dE(e.deprecationReason)}function Gx(e){return Ur(e)+"directive @"+e.name+IS(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}function dE(e){return e==null?"":e!==fu?` @deprecated(reason: ${Ve({kind:_.STRING,value:e})})`:" @deprecated"}function qx(e){return e.specifiedByURL==null?"":` @specifiedBy(url: ${Ve({kind:_.STRING,value:e.specifiedByURL})})`}function Ur(e,t="",n=!0){let{description:r}=e;if(r==null)return"";let i=Ve({kind:_.STRING,value:r,block:ub(r)});return(t&&!n?` `+t:t)+i.replace(/\n/g,` `+t)+` -`}var bD=Y(()=>{"use strict";d();m();f();xt();tr();Nl();vt();Vr();ht();Dr();ri();Ji();Cl()});function VN(e){let t=[];for(let n of e)t.push(...n.definitions);return{kind:b.DOCUMENT,definitions:t}}var _D=Y(()=>{"use strict";d();m();f();vt()});function $N(e){let t=[],n=Object.create(null);for(let i of e.definitions)switch(i.kind){case b.OPERATION_DEFINITION:t.push(i);break;case b.FRAGMENT_DEFINITION:n[i.name.value]=OD(i.selectionSet);break;default:}let r=Object.create(null);for(let i of t){let o=new Set;for(let a of OD(i.selectionSet))SD(o,n,a);let s=i.name?i.name.value:"";r[s]={kind:b.DOCUMENT,definitions:e.definitions.filter(a=>a===i||a.kind===b.FRAGMENT_DEFINITION&&o.has(a.name.value))}}return r}function SD(e,t,n){if(!e.has(n)){e.add(n);let r=t[n];if(r!==void 0)for(let i of r)SD(e,t,i)}}function OD(e){let t=[];return ni(e,{FragmentSpread(n){t.push(n.name.value)}}),t}var DD=Y(()=>{"use strict";d();m();f();vt();ka()});function GN(e){let t=Yf(e)?e:new Qi(e),n=t.body,r=new xo(t),i="",o=!1;for(;r.advance().kind!==H.EOF;){let s=r.token,a=s.kind,c=!qf(s.kind);o&&(c||s.kind===H.SPREAD)&&(i+=" ");let u=n.slice(s.start,s.end);a===H.BLOCK_STRING?i+=Gf(s.value,{minimize:!0}):i+=u,o=c}return i}var AD=Y(()=>{"use strict";d();m();f();Nl();Kf();Jf();gl()});function qN(e){let t=Om(e);if(t)throw t;return e}function Om(e){if(typeof e=="string"||xe(!1,"Expected name to be a string."),e.startsWith("__"))return new j(`Name "${e}" must not begin with "__", which is reserved by GraphQL introspection.`);try{Vn(e)}catch(t){return t}}var wD=Y(()=>{"use strict";d();m();f();yr();Ve();Dl()});function BN(e,t){return PD(e,t).filter(n=>n.type in tn)}function KN(e,t){return PD(e,t).filter(n=>n.type in Qr)}function PD(e,t){return[...iU(e,t),...rU(e,t)]}function rU(e,t){let n=[],r=Qo(e.getDirectives(),t.getDirectives());for(let i of r.removed)n.push({type:tn.DIRECTIVE_REMOVED,description:`${i.name} was removed.`});for(let[i,o]of r.persisted){let s=Qo(i.args,o.args);for(let a of s.added)Kr(a)&&n.push({type:tn.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${a.name} on directive ${i.name} was added.`});for(let a of s.removed)n.push({type:tn.DIRECTIVE_ARG_REMOVED,description:`${a.name} was removed from ${i.name}.`});i.isRepeatable&&!o.isRepeatable&&n.push({type:tn.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${i.name}.`});for(let a of i.locations)o.locations.includes(a)||n.push({type:tn.DIRECTIVE_LOCATION_REMOVED,description:`${a} was removed from ${i.name}.`})}return n}function iU(e,t){let n=[],r=Qo(Object.values(e.getTypeMap()),Object.values(t.getTypeMap()));for(let i of r.removed)n.push({type:tn.TYPE_REMOVED,description:wi(i)?`Standard scalar ${i.name} was removed because it is not referenced anymore.`:`${i.name} was removed.`});for(let[i,o]of r.persisted)gt(i)&>(o)?n.push(...aU(i,o)):At(i)&&At(o)?n.push(...sU(i,o)):He(i)&&He(o)?n.push(...oU(i,o)):Ue(i)&&Ue(o)?n.push(...LD(i,o),...RD(i,o)):ze(i)&&ze(o)?n.push(...LD(i,o),...RD(i,o)):i.constructor!==o.constructor&&n.push({type:tn.TYPE_CHANGED_KIND,description:`${i.name} changed from ${FD(i)} to ${FD(o)}.`});return n}function oU(e,t){let n=[],r=Qo(Object.values(e.getFields()),Object.values(t.getFields()));for(let i of r.added)jo(i)?n.push({type:tn.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${i.name} on input type ${e.name} was added.`}):n.push({type:Qr.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${i.name} on input type ${e.name} was added.`});for(let i of r.removed)n.push({type:tn.FIELD_REMOVED,description:`${e.name}.${i.name} was removed.`});for(let[i,o]of r.persisted)Cp(i.type,o.type)||n.push({type:tn.FIELD_CHANGED_KIND,description:`${e.name}.${i.name} changed type from ${String(i.type)} to ${String(o.type)}.`});return n}function sU(e,t){let n=[],r=Qo(e.getTypes(),t.getTypes());for(let i of r.added)n.push({type:Qr.TYPE_ADDED_TO_UNION,description:`${i.name} was added to union type ${e.name}.`});for(let i of r.removed)n.push({type:tn.TYPE_REMOVED_FROM_UNION,description:`${i.name} was removed from union type ${e.name}.`});return n}function aU(e,t){let n=[],r=Qo(e.getValues(),t.getValues());for(let i of r.added)n.push({type:Qr.VALUE_ADDED_TO_ENUM,description:`${i.name} was added to enum type ${e.name}.`});for(let i of r.removed)n.push({type:tn.VALUE_REMOVED_FROM_ENUM,description:`${i.name} was removed from enum type ${e.name}.`});return n}function RD(e,t){let n=[],r=Qo(e.getInterfaces(),t.getInterfaces());for(let i of r.added)n.push({type:Qr.IMPLEMENTED_INTERFACE_ADDED,description:`${i.name} added to interfaces implemented by ${e.name}.`});for(let i of r.removed)n.push({type:tn.IMPLEMENTED_INTERFACE_REMOVED,description:`${e.name} no longer implements interface ${i.name}.`});return n}function LD(e,t){let n=[],r=Qo(Object.values(e.getFields()),Object.values(t.getFields()));for(let i of r.removed)n.push({type:tn.FIELD_REMOVED,description:`${e.name}.${i.name} was removed.`});for(let[i,o]of r.persisted)n.push(...uU(e,i,o)),xp(i.type,o.type)||n.push({type:tn.FIELD_CHANGED_KIND,description:`${e.name}.${i.name} changed type from ${String(i.type)} to ${String(o.type)}.`});return n}function uU(e,t,n){let r=[],i=Qo(t.args,n.args);for(let o of i.removed)r.push({type:tn.ARG_REMOVED,description:`${e.name}.${t.name} arg ${o.name} was removed.`});for(let[o,s]of i.persisted)if(!Cp(o.type,s.type))r.push({type:tn.ARG_CHANGED_KIND,description:`${e.name}.${t.name} arg ${o.name} has changed type from ${String(o.type)} to ${String(s.type)}.`});else if(o.defaultValue!==void 0)if(s.defaultValue===void 0)r.push({type:Qr.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${o.name} defaultValue was removed.`});else{let c=kD(o.defaultValue,o.type),u=kD(s.defaultValue,s.type);c!==u&&r.push({type:Qr.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${o.name} has changed defaultValue from ${c} to ${u}.`})}for(let o of i.added)Kr(o)?r.push({type:tn.REQUIRED_ARG_ADDED,description:`A required arg ${o.name} on ${e.name}.${t.name} was added.`}):r.push({type:Qr.OPTIONAL_ARG_ADDED,description:`An optional arg ${o.name} on ${e.name}.${t.name} was added.`});return r}function xp(e,t){return tt(e)?tt(t)&&xp(e.ofType,t.ofType)||Oe(t)&&xp(e,t.ofType):Oe(e)?Oe(t)&&xp(e.ofType,t.ofType):Uo(t)&&e.name===t.name||Oe(t)&&xp(e,t.ofType)}function Cp(e,t){return tt(e)?tt(t)&&Cp(e.ofType,t.ofType):Oe(e)?Oe(t)&&Cp(e.ofType,t.ofType)||!Oe(t)&&Cp(e.ofType,t):Uo(t)&&e.name===t.name}function FD(e){if(sn(e))return"a Scalar type";if(Ue(e))return"an Object type";if(ze(e))return"an Interface type";if(At(e))return"a Union type";if(gt(e))return"an Enum type";if(He(e))return"an Input type";ut(!1,"Unexpected type: "+q(e))}function kD(e,t){let n=Xn(e,t);return n!=null||ut(!1),Ze(rc(n))}function Qo(e,t){let n=[],r=[],i=[],o=rr(e,({name:a})=>a),s=rr(t,({name:a})=>a);for(let a of e){let c=s[a.name];c===void 0?r.push(a):i.push([a,c])}for(let a of t)o[a.name]===void 0&&n.push(a);return{added:n,persisted:i,removed:r}}var tn,Qr,xD=Y(()=>{"use strict";d();m();f();xt();tr();Xs();Vr();ht();Ji();Cl();ME();(function(e){e.TYPE_REMOVED="TYPE_REMOVED",e.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",e.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",e.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",e.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",e.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",e.FIELD_REMOVED="FIELD_REMOVED",e.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",e.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",e.ARG_REMOVED="ARG_REMOVED",e.ARG_CHANGED_KIND="ARG_CHANGED_KIND",e.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",e.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",e.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",e.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",e.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"})(tn||(tn={}));(function(e){e.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",e.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",e.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",e.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",e.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",e.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"})(Qr||(Qr={}))});var CD=Y(()=>{"use strict";d();m();f();SN();lD();pD();dD();fD();yD();kN();ED();bD();Hi();lp();ZT();Cl();im();zE();_D();DD();AD();Pl();wD();xD()});var Ie={};ml(Ie,{BREAK:()=>Ws,BreakingChangeType:()=>tn,DEFAULT_DEPRECATION_REASON:()=>Ju,DangerousChangeType:()=>Qr,DirectiveLocation:()=>Ae,ExecutableDefinitionsRule:()=>Kl,FieldsOnCorrectTypeRule:()=>Ql,FragmentsOnCompositeTypesRule:()=>Yl,GRAPHQL_MAX_INT:()=>qu,GRAPHQL_MIN_INT:()=>Bu,GraphQLBoolean:()=>Jn,GraphQLDeprecatedDirective:()=>zi,GraphQLDirective:()=>zn,GraphQLEnumType:()=>ir,GraphQLError:()=>j,GraphQLFloat:()=>tm,GraphQLID:()=>Ku,GraphQLIncludeDirective:()=>Qu,GraphQLInputObjectType:()=>qr,GraphQLInt:()=>em,GraphQLInterfaceType:()=>$r,GraphQLList:()=>Jt,GraphQLNonNull:()=>Ge,GraphQLObjectType:()=>On,GraphQLScalarType:()=>Qn,GraphQLSchema:()=>wr,GraphQLSkipDirective:()=>Yu,GraphQLSpecifiedByDirective:()=>zu,GraphQLString:()=>zt,GraphQLUnionType:()=>Gr,Kind:()=>b,KnownArgumentNamesRule:()=>Jl,KnownDirectivesRule:()=>tc,KnownFragmentNamesRule:()=>zl,KnownTypeNamesRule:()=>nc,Lexer:()=>xo,Location:()=>La,LoneAnonymousOperationRule:()=>Xl,LoneSchemaDefinitionRule:()=>Hl,NoDeprecatedCustomRule:()=>_N,NoFragmentCyclesRule:()=>Wl,NoSchemaIntrospectionCustomRule:()=>ON,NoUndefinedVariablesRule:()=>Zl,NoUnusedFragmentsRule:()=>ep,NoUnusedVariablesRule:()=>tp,OperationTypeNode:()=>Yt,OverlappingFieldsCanBeMergedRule:()=>np,PossibleFragmentSpreadsRule:()=>rp,PossibleTypeExtensionsRule:()=>ip,ProvidedRequiredArgumentsRule:()=>op,ScalarLeafsRule:()=>sp,SchemaMetaFieldDef:()=>Vo,SingleFieldSubscriptionsRule:()=>dp,Source:()=>Qi,Token:()=>Js,TokenKind:()=>H,TypeInfo:()=>qo,TypeKind:()=>wt,TypeMetaFieldDef:()=>$o,TypeNameMetaFieldDef:()=>Go,UniqueArgumentDefinitionNamesRule:()=>fp,UniqueArgumentNamesRule:()=>ac,UniqueDirectiveNamesRule:()=>mp,UniqueDirectivesPerLocationRule:()=>uc,UniqueEnumValueNamesRule:()=>hp,UniqueFieldDefinitionNamesRule:()=>yp,UniqueFragmentNamesRule:()=>Tp,UniqueInputFieldNamesRule:()=>cc,UniqueOperationNamesRule:()=>Ep,UniqueOperationTypesRule:()=>Np,UniqueTypeNamesRule:()=>gp,UniqueVariableNamesRule:()=>vp,ValidationContext:()=>Ya,ValuesOfCorrectTypeRule:()=>Ip,VariablesAreInputTypesRule:()=>bp,VariablesInAllowedPositionRule:()=>_p,__Directive:()=>Ml,__DirectiveLocation:()=>Ul,__EnumValue:()=>Vl,__Field:()=>jl,__InputValue:()=>ja,__Schema:()=>Ua,__Type:()=>Ar,__TypeKind:()=>$l,assertAbstractType:()=>pE,assertCompositeType:()=>lE,assertDirective:()=>yE,assertEnumType:()=>rE,assertEnumValueName:()=>Sl,assertInputObjectType:()=>iE,assertInputType:()=>aE,assertInterfaceType:()=>wl,assertLeafType:()=>cE,assertListType:()=>oE,assertName:()=>Vn,assertNamedType:()=>fE,assertNonNullType:()=>sE,assertNullableType:()=>Ll,assertObjectType:()=>Al,assertOutputType:()=>uE,assertScalarType:()=>tE,assertSchema:()=>Va,assertType:()=>eE,assertUnionType:()=>nE,assertValidName:()=>qN,assertValidSchema:()=>qa,assertWrappingType:()=>dE,astFromValue:()=>Xn,buildASTSchema:()=>Im,buildClientSchema:()=>RN,buildSchema:()=>PN,coerceInputValue:()=>cp,concatAST:()=>VN,createSourceEventStream:()=>gm,defaultFieldResolver:()=>wp,defaultTypeResolver:()=>Nm,doTypesOverlap:()=>Gu,execute:()=>ia,executeSync:()=>Rp,extendSchema:()=>LN,findBreakingChanges:()=>BN,findDangerousChanges:()=>KN,formatError:()=>qT,getArgumentValues:()=>ra,getDirectiveValues:()=>Ko,getEnterLeaveForKind:()=>Mo,getIntrospectionQuery:()=>Fp,getLocation:()=>Ys,getNamedType:()=>Zt,getNullableType:()=>Ca,getOperationAST:()=>DN,getOperationRootType:()=>AN,getVariableValues:()=>pp,getVisitFn:()=>WT,graphql:()=>zS,graphqlSync:()=>XS,introspectionFromSchema:()=>wN,introspectionTypes:()=>Xi,isAbstractType:()=>Yn,isCompositeType:()=>gr,isConstValueNode:()=>Bl,isDefinitionNode:()=>gE,isDirective:()=>ea,isEnumType:()=>gt,isEqualType:()=>Ma,isExecutableDefinitionNode:()=>Wu,isInputObjectType:()=>He,isInputType:()=>vn,isInterfaceType:()=>ze,isIntrospectionType:()=>sr,isLeafType:()=>Rn,isListType:()=>tt,isNamedType:()=>Uo,isNonNullType:()=>Oe,isNullableType:()=>Rl,isObjectType:()=>Ue,isOutputType:()=>Br,isRequiredArgument:()=>Kr,isRequiredInputField:()=>jo,isScalarType:()=>sn,isSchema:()=>rm,isSelectionNode:()=>vE,isSpecifiedDirective:()=>ta,isSpecifiedScalarType:()=>wi,isType:()=>Zs,isTypeDefinitionNode:()=>ii,isTypeExtensionNode:()=>na,isTypeNode:()=>IE,isTypeSubTypeOf:()=>Ai,isTypeSystemDefinitionNode:()=>Zu,isTypeSystemExtensionNode:()=>ec,isUnionType:()=>At,isValidNameError:()=>Om,isValueNode:()=>om,isWrappingType:()=>xa,lexicographicSortSchema:()=>kp,locatedError:()=>Wi,parse:()=>Oi,parseConstValue:()=>QT,parseType:()=>YT,parseValue:()=>bl,print:()=>Ze,printError:()=>GT,printIntrospectionSchema:()=>MN,printLocation:()=>yl,printSchema:()=>Pp,printSourceLocation:()=>Pu,printType:()=>_m,resolveObjMapThunk:()=>kl,resolveReadonlyArrayThunk:()=>Fl,responsePathAsArray:()=>$n,separateOperations:()=>$N,specifiedDirectives:()=>or,specifiedRules:()=>Op,specifiedScalarTypes:()=>Yi,stripIgnoredCharacters:()=>GN,subscribe:()=>bN,syntaxError:()=>on,typeFromAST:()=>en,validate:()=>Sp,validateSchema:()=>Hu,valueFromAST:()=>vr,valueFromASTUntyped:()=>Pa,version:()=>nS,versionInfo:()=>rS,visit:()=>ni,visitInParallel:()=>Vu,visitWithTypeInfo:()=>Ba});var he=Y(()=>{"use strict";d();m();f();iS();WS();ZS();eD();oD();uD();cD();CD()});var Li=F($=>{"use strict";d();m();f();Object.defineProperty($,"__esModule",{value:!0});$.QUOTATION_JOIN=$.QUERY_UPPER=$.QUERY=$.PROVIDES=$.PARENTS=$.OVERRIDE=$.OBJECT_UPPER=$.OPERATION_TO_DEFAULT=$.NAME=$.MUTATION_UPPER=$.MUTATION=$.KEY=$.LINK=$.INTERFACE_OBJECT=$.INTERFACE_UPPER=$.INACCESSIBLE=$.INPUT_OBJECT_UPPER=$.INPUT_FIELD_DEFINITION_UPPER=$.INLINE_FRAGMENT_UPPER=$.INLINE_FRAGMENT=$.FROM=$.FRAGMENT_REPRESENTATION=$.FRAGMENT_SPREAD_UPPER=$.FRAGMENT_DEFINITION_UPPER=$.FIELD_DEFINITION_UPPER=$.FIELDS=$.FIELD_SET_SCALAR=$.FIELD_UPPER=$.FIELD=$.EXTENSIONS=$.EXTENDS=$.EXTERNAL=$.EVENTS_SUBSCRIBE=$.EVENTS_REQUEST=$.EVENTS_PUBLISH=$.ENUM_VALUE_UPPER=$.ENUM_UPPER=$.ENTITY_UNION=$.ENTITIES_FIELD=$.ENTITIES=$.DIRECTIVE_DEFINITION=$.DEPRECATED=$.DEFAULT_SUBSCRIPTION=$.DEFAULT_QUERY=$.DEFAULT_MUTATION=$.COMPOSE_DIRECTIVE=$.BOOLEAN_TYPE=$.ARGUMENT_DEFINITION_UPPER=$.AUTHENTICATED=$.ANY_SCALAR=void 0;$.ROOT_TYPES=$.VARIABLE_DEFINITION_UPPER=$.URL_LOWER=$.UNION_UPPER=$.UNION=$.TOPIC=$.TAG=$.SUBSCRIPTION_UPPER=$.SUBSCRIPTION=$.STRING_SCALAR=$.SPECIFIED_BY=$.SOURCE_ID=$.SHAREABLE=$.SERVICE_FIELD=$.SERVICE_OBJECT=$.SELECTION_REPRESENTATION=$.SCOPE_SCALAR=$.SCOPES=$.SCHEMA_UPPER=$.SCHEMA=$.SCALAR_UPPER=$.RESOLVABLE=$.REQUIRES_SCOPES=$.REQUIRES=$.REASON=void 0;$.ANY_SCALAR="_Any";$.AUTHENTICATED="authenticated";$.ARGUMENT_DEFINITION_UPPER="ARGUMENT_DEFINITION";$.BOOLEAN_TYPE="Boolean";$.COMPOSE_DIRECTIVE="composeDirective";$.DEFAULT_MUTATION="Mutation";$.DEFAULT_QUERY="Query";$.DEFAULT_SUBSCRIPTION="Subscription";$.DEPRECATED="deprecated";$.DIRECTIVE_DEFINITION="directive definition";$.ENTITIES="entities";$.ENTITIES_FIELD="_entities";$.ENTITY_UNION="_Entity";$.ENUM_UPPER="ENUM";$.ENUM_VALUE_UPPER="ENUM_VALUE";$.EVENTS_PUBLISH="eventsPublish";$.EVENTS_REQUEST="eventsRequest";$.EVENTS_SUBSCRIBE="eventsSubscribe";$.EXTERNAL="external";$.EXTENDS="extends";$.EXTENSIONS="extensions";$.FIELD="field";$.FIELD_UPPER="FIELD";$.FIELD_SET_SCALAR="openfed__FieldSet";$.FIELDS="fields";$.FIELD_DEFINITION_UPPER="FIELD_DEFINITION";$.FRAGMENT_DEFINITION_UPPER="FRAGMENT_DEFINITION";$.FRAGMENT_SPREAD_UPPER="FRAGMENT_SPREAD";$.FRAGMENT_REPRESENTATION=" { ... }";$.FROM="from";$.INLINE_FRAGMENT="inlineFragment";$.INLINE_FRAGMENT_UPPER="INLINE_FRAGMENT";$.INPUT_FIELD_DEFINITION_UPPER="INPUT_FIELD_DEFINITION";$.INPUT_OBJECT_UPPER="INPUT_OBJECT";$.INACCESSIBLE="inaccessible";$.INTERFACE_UPPER="INTERFACE";$.INTERFACE_OBJECT="interfaceObject";$.LINK="link";$.KEY="key";$.MUTATION="Mutation";$.MUTATION_UPPER="MUTATION";$.NAME="name";$.OPERATION_TO_DEFAULT="operationTypeNodeToDefaultType";$.OBJECT_UPPER="OBJECT";$.OVERRIDE="override";$.PARENTS="parents";$.PROVIDES="provides";$.QUERY="Query";$.QUERY_UPPER="QUERY";$.QUOTATION_JOIN='", "';$.REASON="reason";$.REQUIRES="requires";$.REQUIRES_SCOPES="requiresScopes";$.RESOLVABLE="resolvable";$.SCALAR_UPPER="SCALAR";$.SCHEMA="schema";$.SCHEMA_UPPER="SCHEMA";$.SCOPES="scopes";$.SCOPE_SCALAR="openfed__Scope";$.SELECTION_REPRESENTATION=" { ... }";$.SERVICE_OBJECT="_Service";$.SERVICE_FIELD="_service";$.SHAREABLE="shareable";$.SOURCE_ID="sourceID";$.SPECIFIED_BY="specifiedBy";$.STRING_SCALAR="String";$.SUBSCRIPTION="Subscription";$.SUBSCRIPTION_UPPER="SUBSCRIPTION";$.TAG="tag";$.TOPIC="topic";$.UNION="union";$.UNION_UPPER="UNION";$.URL_LOWER="url";$.VARIABLE_DEFINITION_UPPER="VARIABLE_DEFINITION";$.ROOT_TYPES=new Set([$.MUTATION,$.QUERY,$.SUBSCRIPTION])});var Sm=F(Zi=>{"use strict";d();m();f();Object.defineProperty(Zi,"__esModule",{value:!0});Zi.isFieldInaccessible=Zi.newPersistedDirectivesContainer=Zi.MergeMethod=Zi.EXECUTABLE_DIRECTIVE_LOCATIONS=void 0;var oa=Li();Zi.EXECUTABLE_DIRECTIVE_LOCATIONS=new Set([oa.FIELD_UPPER,oa.FRAGMENT_DEFINITION_UPPER,oa.FRAGMENT_SPREAD_UPPER,oa.INLINE_FRAGMENT_UPPER,oa.MUTATION_UPPER,oa.QUERY_UPPER,oa.SUBSCRIPTION_UPPER]);var MD;(function(e){e[e.UNION=0]="UNION",e[e.INTERSECTION=1]="INTERSECTION",e[e.CONSISTENT=2]="CONSISTENT"})(MD||(Zi.MergeMethod=MD={}));function cU(){return{deprecated:{},directives:new Map,tags:new Map}}Zi.newPersistedDirectivesContainer=cU;function lU(e){return e.directives.directives.has(oa.INACCESSIBLE)}Zi.isFieldInaccessible=lU});var eo=F(Re=>{"use strict";d();m();f();Object.defineProperty(Re,"__esModule",{value:!0});Re.safeParse=Re.lexicographicallySortDocumentNode=Re.lexicographicallySortSelectionSetNode=Re.lexicographicallySortArgumentNodes=Re.setLongestDescriptionForNode=Re.formatDescription=Re.addConcreteTypesForUnion=Re.addConcreteTypesForImplementedInterfaces=Re.pushPersistedDirectivesAndGetNode=Re.mergeExecutableDirectiveLocations=Re.extractExecutableDirectiveLocations=Re.isKindAbstract=Re.operationTypeNodeToDefaultType=Re.nodeKindToDirectiveLocation=Re.setToNamedTypeNodeArray=Re.stringToNamedTypeNode=Re.setToNameNodeArray=Re.stringArrayToNameNodeArray=Re.stringToNameNode=Re.areBaseAndExtensionKindsCompatible=Re.isNodeOverridden=Re.isNodeExternal=Re.isNodeShareable=Re.extractInterfaces=Re.isNodeExtension=Re.isNodeInterfaceObject=Re.isObjectLikeNodeEntity=void 0;var et=(he(),Te(Ie)),an=Li(),UD=Yo(),pU=Sm();function dU(e){var t;if(!((t=e.directives)!=null&&t.length))return!1;for(let n of e.directives)if(n.name.value===an.KEY)return!0;return!1}Re.isObjectLikeNodeEntity=dU;function fU(e){var t;if(!((t=e.directives)!=null&&t.length))return!1;for(let n of e.directives)if(n.name.value===an.INTERFACE_OBJECT)return!0;return!1}Re.isNodeInterfaceObject=fU;function mU(e){var t;if(!((t=e.directives)!=null&&t.length))return!1;for(let n of e.directives)if(n.name.value===an.EXTENDS)return!0;return!1}Re.isNodeExtension=mU;function hU(e,t,n){if(!e.interfaces)return t;let r=e.name.value;for(let i of e.interfaces){let o=i.name.value;if(n&&t.has(o)){n.push((0,UD.duplicateInterfaceError)(o,r));continue}t.add(o)}return t}Re.extractInterfaces=hU;function yU(e){if(!e.directives)return!1;for(let t of e.directives)if(t.name.value===an.SHAREABLE)return!0;return!1}Re.isNodeShareable=yU;function TU(e){if(!e.directives)return!1;for(let t of e.directives)if(t.name.value===an.EXTERNAL)return!0;return!1}Re.isNodeExternal=TU;function EU(e){if(!e.directives)return!1;for(let t of e.directives)if(t.name.value===an.OVERRIDE)return!0;return!1}Re.isNodeOverridden=EU;function NU(e,t,n){switch(e){case et.Kind.ENUM_TYPE_DEFINITION:return t===et.Kind.ENUM_TYPE_EXTENSION;case et.Kind.INPUT_OBJECT_TYPE_DEFINITION:return t===et.Kind.INPUT_OBJECT_TYPE_EXTENSION;case et.Kind.INTERFACE_TYPE_DEFINITION:return t===et.Kind.INTERFACE_TYPE_EXTENSION;case et.Kind.OBJECT_TYPE_DEFINITION:return t===et.Kind.OBJECT_TYPE_EXTENSION;case et.Kind.SCALAR_TYPE_DEFINITION:return t===et.Kind.SCALAR_TYPE_EXTENSION;case et.Kind.UNION_TYPE_DEFINITION:return t===et.Kind.UNION_TYPE_EXTENSION;default:throw(0,UD.unexpectedKindFatalError)(n)}}Re.areBaseAndExtensionKindsCompatible=NU;function Dm(e){return{kind:et.Kind.NAME,value:e}}Re.stringToNameNode=Dm;function gU(e){let t=[];for(let n of e)t.push(Dm(n));return t}Re.stringArrayToNameNodeArray=gU;function vU(e){let t=[];for(let n of e)t.push(Dm(n));return t}Re.setToNameNodeArray=vU;function jD(e){return{kind:et.Kind.NAMED_TYPE,name:Dm(e)}}Re.stringToNamedTypeNode=jD;function IU(e){let t=[];for(let n of e)t.push(jD(n));return t}Re.setToNamedTypeNodeArray=IU;function bU(e){switch(e){case et.Kind.ARGUMENT:return an.ARGUMENT_DEFINITION_UPPER;case et.Kind.ENUM_TYPE_DEFINITION:case et.Kind.ENUM_TYPE_EXTENSION:return an.ENUM_UPPER;case et.Kind.ENUM_VALUE_DEFINITION:return an.ENUM_VALUE_UPPER;case et.Kind.FIELD_DEFINITION:return an.FIELD_DEFINITION_UPPER;case et.Kind.FRAGMENT_DEFINITION:return an.FRAGMENT_DEFINITION_UPPER;case et.Kind.FRAGMENT_SPREAD:return an.FRAGMENT_SPREAD_UPPER;case et.Kind.INLINE_FRAGMENT:return an.INLINE_FRAGMENT_UPPER;case et.Kind.INPUT_VALUE_DEFINITION:return an.INPUT_FIELD_DEFINITION_UPPER;case et.Kind.INPUT_OBJECT_TYPE_DEFINITION:case et.Kind.INPUT_OBJECT_TYPE_EXTENSION:return an.INPUT_OBJECT_UPPER;case et.Kind.INTERFACE_TYPE_DEFINITION:case et.Kind.INTERFACE_TYPE_EXTENSION:return an.INTERFACE_UPPER;case et.Kind.OBJECT_TYPE_DEFINITION:case et.Kind.OBJECT_TYPE_EXTENSION:return an.OBJECT_UPPER;case et.Kind.SCALAR_TYPE_DEFINITION:case et.Kind.SCALAR_TYPE_EXTENSION:return an.SCALAR_UPPER;case et.Kind.SCHEMA_DEFINITION:case et.Kind.SCHEMA_EXTENSION:return an.SCHEMA_UPPER;case et.Kind.UNION_TYPE_DEFINITION:case et.Kind.UNION_TYPE_EXTENSION:return an.UNION_UPPER;default:return e}}Re.nodeKindToDirectiveLocation=bU;Re.operationTypeNodeToDefaultType=new Map([[et.OperationTypeNode.MUTATION,an.MUTATION],[et.OperationTypeNode.QUERY,an.QUERY],[et.OperationTypeNode.SUBSCRIPTION,an.SUBSCRIPTION]]);function _U(e){return e===et.Kind.INTERFACE_TYPE_DEFINITION||e===et.Kind.UNION_TYPE_DEFINITION}Re.isKindAbstract=_U;function OU(e,t){for(let n of e){let r=n.value;pU.EXECUTABLE_DIRECTIVE_LOCATIONS.has(r)&&t.add(r)}return t}Re.extractExecutableDirectiveLocations=OU;function SU(e,t){let n=new Set;for(let r of e){let i=r.value;t.executableLocations.has(i)&&n.add(i)}return t.executableLocations=n,n}Re.mergeExecutableDirectiveLocations=SU;function DU(e){let t=[...e.directives.tags.values()],n=e.directives.deprecated.directive;n&&t.push(n);for(let r of e.directives.directives.values())t.push(...r);return e.node.directives=t,e.node}Re.pushPersistedDirectivesAndGetNode=DU;function AU(e,t){if(!e.interfaces||e.interfaces.length<1)return;let n=e.name.value;for(let r of e.interfaces){let i=r.name.value,o=t.get(i);o?o.add(n):t.set(i,new Set([n]))}}Re.addConcreteTypesForImplementedInterfaces=AU;function wU(e,t){if(!e.types||e.types.length<1)return;let n=e.name.value;for(let r of e.types){let i=r.name.value,o=t.get(n);o?o.add(i):t.set(n,new Set([i]))}}Re.addConcreteTypesForUnion=wU;function RU(e){if(!e)return e;let t=e.value;if(e.block){let n=t.split(` -`);n.length>1&&(t=n.map(r=>r.trimStart()).join(` -`))}return x(D({},e),{value:t,block:!0})}Re.formatDescription=RU;function LU(e,t){t&&(!e.description||t.value.length>e.description.value.length)&&(e.description=x(D({},t),{block:!0}))}Re.setLongestDescriptionForNode=LU;function VD(e){return e.arguments?e.arguments.sort((n,r)=>n.name.value.localeCompare(r.name.value)):e.arguments}Re.lexicographicallySortArgumentNodes=VD;function QN(e){let t=e.selections;return x(D({},e),{selections:t.sort((n,r)=>n.name.value.localeCompare(r.name.value)).map(n=>x(D({},n),{arguments:VD(n),selectionSet:n.selectionSet?QN(n.selectionSet):n.selectionSet}))})}Re.lexicographicallySortSelectionSetNode=QN;function FU(e){return x(D({},e),{definitions:e.definitions.map(t=>t.kind!==et.Kind.OPERATION_DEFINITION?t:x(D({},t),{selectionSet:QN(t.selectionSet)}))})}Re.lexicographicallySortDocumentNode=FU;function kU(e){try{return{documentNode:(0,et.parse)(e)}}catch(t){return{error:t}}}Re.safeParse=kU});var za=F(me=>{"use strict";d();m();f();Object.defineProperty(me,"__esModule",{value:!0});me.isNodeKindInterface=me.generateRequiresScopesDirective=me.generateAuthenticatedDirective=me.setAndGetValue=me.upsertAuthorizationConfiguration=me.upsertAuthorizationData=me.upsertFieldAuthorizationData=me.addAuthorizationDataProperties=me.mergeAuthorizationDataByAND=me.maxOrScopes=me.newAuthorizationData=me.getAuthorizationDataToUpdate=me.resetAuthorizationData=me.newFieldAuthorizationData=me.upsertEntityContainer=me.upsertEntityContainerProperties=me.newEntityContainer=me.getValueOrDefault=me.hasSimplePath=me.upsertEntityInterfaceFederationData=me.newEntityInterfaceFederationData=me.kindToTypeString=me.addSetsAndReturnMutationBoolean=me.addIterableValuesToSet=me.numberToOrdinal=me.mapToArrayOfValues=me.subtractSourceSetFromTargetSet=me.doSetsHaveAnyOverlap=me.getEntriesNotInHashSet=me.getAllSetDisparities=me.getOrThrowError=me.getAllMutualEntries=me.areSetsEqual=void 0;var un=(he(),Te(Ie)),Mp=Li(),PU=Yo(),YN=eo();function xU(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}me.areSetsEqual=xU;function CU(e,t){let n=new Set;for(let r of e)t.has(r)&&n.add(r);return n}me.getAllMutualEntries=CU;function MU(e,t,n){let r=e.get(t);if(r===void 0)throw(0,PU.invalidKeyFatalError)(t,n);return r}me.getOrThrowError=MU;function UU(e,t){let n=new Set(t),r=[];for(let i of e)n.delete(i)||r.push(i);for(let i of n)r.push(i);return r}me.getAllSetDisparities=UU;function jU(e,t){let n=[];for(let r of e)t.has(r)||n.push(r);return n}me.getEntriesNotInHashSet=jU;function VU(e,t){for(let n of e)if(t.has(n))return!0;return!1}me.doSetsHaveAnyOverlap=VU;function $U(e,t){for(let n of e)t.has(n)&&t.delete(n)}me.subtractSourceSetFromTargetSet=$U;function GU(e){let t=[];for(let n of e.values())t.push(n);return t}me.mapToArrayOfValues=GU;function qU(e){let t=e.toString();switch(t[t.length-1]){case"1":return`${t}st`;case"2":return`${t}nd`;case"3":return`${t}rd`;default:return`${t}th`}}me.numberToOrdinal=qU;function Ja(e,t){for(let n of e)t.add(n)}me.addIterableValuesToSet=Ja;function $D(e,t){let n=!1;for(let r of e)t.has(r)||(n=!0,t.add(r));return n}me.addSetsAndReturnMutationBoolean=$D;function BU(e){switch(e){case un.Kind.ENUM_TYPE_DEFINITION:return"enum";case un.Kind.ENUM_TYPE_EXTENSION:return"enum extension";case un.Kind.FIELD_DEFINITION:return Mp.FIELD;case un.Kind.INPUT_OBJECT_TYPE_DEFINITION:return"input object";case un.Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object extension";case un.Kind.INPUT_VALUE_DEFINITION:return"input value";case un.Kind.INTERFACE_TYPE_DEFINITION:return"interface";case un.Kind.INTERFACE_TYPE_EXTENSION:return"interface extension";case un.Kind.OBJECT_TYPE_DEFINITION:return"object";case un.Kind.OBJECT_TYPE_EXTENSION:return"object extension";case un.Kind.SCALAR_TYPE_DEFINITION:return"scalar";case un.Kind.SCALAR_TYPE_EXTENSION:return"scalar extension";case un.Kind.UNION_TYPE_DEFINITION:return Mp.UNION;case un.Kind.UNION_TYPE_EXTENSION:return"union extension";default:return e}}me.kindToTypeString=BU;function KU(e,t){return D({interfaceFieldNames:new Set(e.interfaceFieldNames),interfaceObjectFieldNames:new Set(e.interfaceObjectFieldNames),interfaceObjectSubgraphs:new Set(e.isInterfaceObject?[t]:[]),typeName:e.typeName},e.isInterfaceObject?{}:{concreteTypeNames:new Set(e.concreteTypeNames)})}me.newEntityInterfaceFederationData=KU;function QU(e,t,n){return Ja(t.interfaceFieldNames,e.interfaceFieldNames),Ja(t.interfaceObjectFieldNames,e.interfaceObjectFieldNames),t.isInterfaceObject?(e.interfaceObjectSubgraphs.add(n),!1):e.concreteTypeNames?$D(t.concreteTypeNames||new Set,e.concreteTypeNames):(e.concreteTypeNames=new Set(t.concreteTypeNames),!1)}me.upsertEntityInterfaceFederationData=QU;var JN=class{constructor(t){S(this,"set",new Set);S(this,"stack",[]);this.push(t)}has(t){return this.set.has(t)}push(t){this.stack.push(t),this.set.add(t)}pop(){let t=this.stack.pop();t&&this.set.delete(t)}};function YU(e,t,n){if(!e.hasNode(t)||!e.hasNode(n))return!1;let r=[e.outboundNeighbors(t)],i=new JN(t),o,s;for(;r.length>0;){if(o=r[r.length-1],s=o.pop(),!s){r.pop();continue}if(i.has(s))continue;if(s===n)return!0;i.push(s);let a=e.outboundNeighbors(s);a.length<0||r.push(a)}return!1}me.hasSimplePath=YU;function GD(e,t,n){let r=e.get(t);if(r)return r;let i=n();return e.set(t,i),i}me.getValueOrDefault=GD;function qD(e){return{fieldNames:new Set(e.fieldNames),keyFieldSets:new Set(e.keyFieldSets),subgraphNames:new Set(e.subgraphNames),typeName:e.typeName}}me.newEntityContainer=qD;function BD(e,t){Ja(e.fieldNames||[],t.fieldNames),Ja(e.keyFieldSets||[],t.keyFieldSets),Ja(e.subgraphNames||[],t.subgraphNames)}function JU(e,t){let n=e.get(t.typeName);n?BD(t,n):e.set(t.typeName,qD(t))}me.upsertEntityContainerProperties=JU;function zU(e,t){let n=e.get(t.typeName);n?BD(t,n):e.set(t.typeName,t)}me.upsertEntityContainer=zU;function zN(e){return{fieldName:e,requiresAuthentication:!1,requiredScopes:[]}}me.newFieldAuthorizationData=zN;function XU(e){e&&(e.requiresAuthentication=!1,e.requiredScopes=[],e.hasParentLevelAuthorization=!1)}me.resetAuthorizationData=XU;function HU(e,t,n){return t.kind===un.Kind.FIELD_DEFINITION?GD(e.fieldAuthorizationDataByFieldName,n,()=>zN(n)):(e.hasParentLevelAuthorization=!0,e)}me.getAuthorizationDataToUpdate=HU;function WU(e){return{fieldAuthorizationDataByFieldName:new Map,hasParentLevelAuthorization:!1,requiresAuthentication:!1,requiredScopes:[],typeName:e}}me.newAuthorizationData=WU;me.maxOrScopes=16;function KD(e,t){t.requiresAuthentication||(t.requiresAuthentication=e.requiresAuthentication);let n=e.requiredScopes.length;if(n<1)return!0;let r=t.requiredScopes.length;if(r<1){if(n>me.maxOrScopes)return!1;for(let o of e.requiredScopes)t.requiredScopes.push(new Set(o));return!0}if(n*r>me.maxOrScopes)return!1;let i=[];for(let o of t.requiredScopes)for(let s of e.requiredScopes){let a=new Set(o);Ja(s,a),i.push(a)}return t.requiredScopes=i,!0}me.mergeAuthorizationDataByAND=KD;function ZU(e,t){}me.addAuthorizationDataProperties=ZU;function QD(e,t){let n=t.fieldName,r=e.get(n);if(!r){if(t.requiredScopes.length>me.maxOrScopes)return!1;let i=zN(n);i.requiresAuthentication||(i.requiresAuthentication=t.requiresAuthentication);for(let o of t.requiredScopes)i.requiredScopes.push(new Set(o));return e.set(n,i),!0}return r.requiresAuthentication||(r.requiresAuthentication=t.requiresAuthentication),KD(t,r)}me.upsertFieldAuthorizationData=QD;function ej(e,t,n){let r=e.get(t.typeName);if(!r){e.set(t.typeName,t);return}for(let[i,o]of t.fieldAuthorizationDataByFieldName)QD(r.fieldAuthorizationDataByFieldName,o)||n.add(`${t.typeName}.${i}`)}me.upsertAuthorizationData=ej;function tj(e,t){let n=t.typeName;for(let[r,i]of t.fieldAuthorizationDataByFieldName){let o=`${n}.${r}`,s=e.get(o);s?(s.requiresAuthentication=i.requiresAuthentication,s.requiredScopes=i.requiredScopes.map(a=>[...a])):e.set(o,{argumentNames:[],typeName:n,fieldName:r,requiresAuthentication:i.requiresAuthentication,requiredScopes:i.requiredScopes.map(a=>[...a])})}}me.upsertAuthorizationConfiguration=tj;function nj(e,t,n){return e.set(t,n),n}me.setAndGetValue=nj;function rj(){return{kind:un.Kind.DIRECTIVE,name:(0,YN.stringToNameNode)(Mp.AUTHENTICATED)}}me.generateAuthenticatedDirective=rj;function ij(e){let t=[];for(let n of e){let r=[];for(let i of n)r.push({kind:un.Kind.STRING,value:i});t.push({kind:un.Kind.LIST,values:r})}return{kind:un.Kind.DIRECTIVE,name:(0,YN.stringToNameNode)(Mp.REQUIRES_SCOPES),arguments:[{kind:un.Kind.ARGUMENT,name:(0,YN.stringToNameNode)(Mp.SCOPES),value:{kind:un.Kind.LIST,values:t}}]}}me.generateRequiresScopesDirective=ij;function oj(e){return e===un.Kind.INTERFACE_TYPE_DEFINITION||e===un.Kind.INTERFACE_TYPE_EXTENSION}me.isNodeKindInterface=oj});var Yo=F(P=>{"use strict";d();m();f();Object.defineProperty(P,"__esModule",{value:!0});P.unexpectedKindFatalError=P.invalidKeyDirectivesError=P.invalidEntityKeyError=P.invalidNestingErrorMessage=P.invalidNestingClosureErrorMessage=P.invalidClosingBraceErrorMessage=P.invalidOpeningBraceErrorMessage=P.invalidGraphQLNameErrorMessage=P.invalidKeyDirectiveArgumentErrorMessage=P.invalidDirectiveArgumentTypeErrorMessage=P.duplicateDirectiveArgumentDefinitionErrorMessage=P.unexpectedDirectiveArgumentErrorMessage=P.undefinedRequiredArgumentsErrorMessage=P.unexpectedDirectiveArgumentsErrorMessage=P.invalidDirectiveLocationErrorMessage=P.invalidDirectiveError=P.invalidTagDirectiveError=P.invalidDeprecatedDirectiveError=P.invalidUnionError=P.invalidRepeatedDirectiveErrorMessage=P.federationRequiredInputFieldError=P.federationInvalidParentTypeError=P.federationUnexpectedNodeKindError=P.undefinedTypeError=P.unresolvableFieldError=P.undefinedEntityKeyErrorMessage=P.undefinedDirectiveError=P.shareableFieldDefinitionsError=P.operationDefinitionError=P.noDefinedUnionMembersError=P.noBaseTypeExtensionError=P.duplicateOperationTypeDefinitionError=P.duplicateTypeDefinitionError=P.duplicateValueExtensionError=P.duplicateUnionMemberError=P.duplicateInterfaceError=P.duplicateInterfaceExtensionError=P.duplicateFieldExtensionError=P.duplicateEnumValueDefinitionError=P.duplicateDirectiveDefinitionError=P.duplicateFieldDefinitionError=P.invalidSubgraphNamesError=P.incompatibleExtensionKindsError=P.incompatibleSharedEnumError=P.incompatibleArgumentDefaultValueTypeError=P.incompatibleArgumentDefaultValueError=P.incompatibleChildTypesError=P.incompatibleArgumentTypesError=P.incompatibleExtensionError=P.minimumSubgraphRequirementError=void 0;P.orScopesLimitError=P.undefinedEntityInterfaceImplementationsError=P.equivalentSourceAndTargetOverrideError=P.allFieldDefinitionsAreInaccessibleError=P.noFieldDefinitionsError=P.duplicateOverriddenFieldsError=P.duplicateOverriddenFieldErrorMessage=P.invalidSelectionOnUnionErrorMessage=P.invalidInlineFragmentTypeConditionErrorMessage=P.invalidInlineFragmentTypeConditionTypeErrorMessage=P.unknownInlineFragmentTypeConditionErrorMessage=P.inlineFragmentWithoutTypeConditionErrorMessage=P.invalidInlineFragmentTypeErrorMessage=P.unknownProvidesEntityErrorMessage=P.duplicateFieldInFieldSetErrorMessage=P.invalidProvidesOrRequiresDirectivesError=P.argumentsInKeyFieldSetErrorMessage=P.unexpectedArgumentErrorMessage=P.undefinedObjectLikeParentError=P.unparsableFieldSetSelectionErrorMessage=P.unparsableFieldSetErrorMessage=P.undefinedFieldInFieldSetErrorMessage=P.invalidSelectionSetDefinitionErrorMessage=P.invalidSelectionSetErrorMessage=P.unknownTypeInFieldSetErrorMessage=P.abstractTypeInKeyFieldSetErrorMessage=P.inlineFragmentInFieldSetErrorMessage=P.expectedEntityError=P.noConcreteTypesForAbstractTypeError=P.unexpectedObjectResponseType=P.noQueryRootTypeError=P.invalidArgumentsError=P.duplicateArgumentsError=P.invalidRequiredArgumentsError=P.unimplementedInterfaceFieldsError=P.subgraphInvalidSyntaxError=P.invalidRootTypeDefinitionError=P.invalidOperationTypeDefinitionError=P.invalidSubgraphNameErrorMessage=P.subgraphValidationFailureError=P.subgraphValidationError=P.unexpectedParentKindErrorMessage=P.invalidConfigurationResultFatalError=P.invalidKeyFatalError=P.unexpectedTypeNodeKindError=P.unexpectedDirectiveLocationError=P.unexpectedArgumentKindFatalError=P.argumentTypeMergeFatalError=P.fieldTypeMergeFatalError=P.incompatibleParentKindFatalError=void 0;var sj=eo(),aj=(he(),Te(Ie)),Up=za(),sa=Li();P.minimumSubgraphRequirementError=new Error("At least one subgraph is required for federation.");function uj(e,t,n){return new Error(`Extension error: - Incompatible types: "${e}" is type "${t}", but an extension of the same name is type "${n}.`)}P.incompatibleExtensionError=uj;function cj(e,t,n,r,i){return new Error(`Incompatible types when merging two instances of argument "${e}" for "${t}.${n}": - Expected type "${r}" but received "${i}"`)}P.incompatibleArgumentTypesError=cj;function lj(e,t,n,r){return new Error(`Incompatible types when merging two instances of "${e}.${t}": - Expected type "${n}" but received "${r}"`)}P.incompatibleChildTypesError=lj;function pj(e,t,n,r,i){return new Error(`Incompatible default values when merging two instances of argument "${e} for "${t}.${n}": - Expected value "${r}" but received "${i}"`)}P.incompatibleArgumentDefaultValueError=pj;function dj(e,t,n,r,i){return new Error(`Incompatible default values when merging two instances of argument "${e} for "${t}.${n}": - Expected type "${r}" but received "${i}"`)}P.incompatibleArgumentDefaultValueTypeError=dj;function fj(e){return new Error(`Enum "${e}" was used as both an input and output but was inconsistently defined across inclusive subgraphs.`)}P.incompatibleSharedEnumError=fj;function mj(e,t){let n=e.kind===aj.Kind.SCHEMA_EXTENSION?"schema":e.name.value;return new Error(`Expected extension "${n}" to be type ${t} but received ${e.kind}.`)}P.incompatibleExtensionKindsError=mj;function hj(e,t){let n="Subgraphs to be federated must each have a unique, non-empty name.";e.length>0&&(n+=` +`}var vS=j(()=>{"use strict";d();f();p();mt();qn();Pc();at();gr();tt();dr();Pr();bi();Wc()});function pE(e){let t=[];for(let n of e)t.push(...n.definitions);return{kind:_.DOCUMENT,definitions:t}}var _S=j(()=>{"use strict";d();f();p();at()});function fE(e){let t=[],n=Object.create(null);for(let i of e.definitions)switch(i.kind){case _.OPERATION_DEFINITION:t.push(i);break;case _.FRAGMENT_DEFINITION:n[i.name.value]=bS(i.selectionSet);break;default:}let r=Object.create(null);for(let i of t){let s=new Set;for(let a of bS(i.selectionSet))SS(s,n,a);let o=i.name?i.name.value:"";r[o]={kind:_.DOCUMENT,definitions:e.definitions.filter(a=>a===i||a.kind===_.FRAGMENT_DEFINITION&&s.has(a.name.value))}}return r}function SS(e,t,n){if(!e.has(n)){e.add(n);let r=t[n];if(r!==void 0)for(let i of r)SS(e,t,i)}}function bS(e){let t=[];return xr(e,{FragmentSpread(n){t.push(n.name.value)}}),t}var DS=j(()=>{"use strict";d();f();p();at();sa()});function mE(e){let t=Gp(e)?e:new vi(e),n=t.body,r=new Zi(t),i="",s=!1;for(;r.advance().kind!==q.EOF;){let o=r.token,a=o.kind,u=!Bp(o.kind);s&&(u||o.kind===q.SPREAD)&&(i+=" ");let c=n.slice(o.start,o.end);a===q.BLOCK_STRING?i+=Cp(o.value,{minimize:!0}):i+=c,s=u}return i}var OS=j(()=>{"use strict";d();f();p();Pc();Vp();qp();Mc()});function hE(e){let t=vf(e);if(t)throw t;return e}function vf(e){if(typeof e=="string"||Oe(!1,"Expected name to be a string."),e.startsWith("__"))return new k(`Name "${e}" must not begin with "__", which is reserved by GraphQL introspection.`);try{Dn(e)}catch(t){return t}}var AS=j(()=>{"use strict";d();f();p();rr();Re();Gc()});function TE(e,t){return kS(e,t).filter(n=>n.type in $t)}function yE(e,t){return kS(e,t).filter(n=>n.type in Dr)}function kS(e,t){return[...Qx(e,t),...Kx(e,t)]}function Kx(e,t){let n=[],r=ls(e.getDirectives(),t.getDirectives());for(let i of r.removed)n.push({type:$t.DIRECTIVE_REMOVED,description:`${i.name} was removed.`});for(let[i,s]of r.persisted){let o=ls(i.args,s.args);for(let a of o.added)Sr(a)&&n.push({type:$t.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${a.name} on directive ${i.name} was added.`});for(let a of o.removed)n.push({type:$t.DIRECTIVE_ARG_REMOVED,description:`${a.name} was removed from ${i.name}.`});i.isRepeatable&&!s.isRepeatable&&n.push({type:$t.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${i.name}.`});for(let a of i.locations)s.locations.includes(a)||n.push({type:$t.DIRECTIVE_LOCATION_REMOVED,description:`${a} was removed from ${i.name}.`})}return n}function Qx(e,t){let n=[],r=ls(Object.values(e.getTypeMap()),Object.values(t.getTypeMap()));for(let i of r.removed)n.push({type:$t.TYPE_REMOVED,description:si(i)?`Standard scalar ${i.name} was removed because it is not referenced anymore.`:`${i.name} was removed.`});for(let[i,s]of r.persisted)it(i)&&it(s)?n.push(...zx(i,s)):dt(i)&&dt(s)?n.push(...Jx(i,s)):Be(i)&&Be(s)?n.push(...Yx(i,s)):we(i)&&we(s)?n.push(...FS(i,s),...wS(i,s)):Ce(i)&&Ce(s)?n.push(...FS(i,s),...wS(i,s)):i.constructor!==s.constructor&&n.push({type:$t.TYPE_CHANGED_KIND,description:`${i.name} changed from ${LS(i)} to ${LS(s)}.`});return n}function Yx(e,t){let n=[],r=ls(Object.values(e.getFields()),Object.values(t.getFields()));for(let i of r.added)rs(i)?n.push({type:$t.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${i.name} on input type ${e.name} was added.`}):n.push({type:Dr.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${i.name} on input type ${e.name} was added.`});for(let i of r.removed)n.push({type:$t.FIELD_REMOVED,description:`${e.name}.${i.name} was removed.`});for(let[i,s]of r.persisted)Wl(i.type,s.type)||n.push({type:$t.FIELD_CHANGED_KIND,description:`${e.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return n}function Jx(e,t){let n=[],r=ls(e.getTypes(),t.getTypes());for(let i of r.added)n.push({type:Dr.TYPE_ADDED_TO_UNION,description:`${i.name} was added to union type ${e.name}.`});for(let i of r.removed)n.push({type:$t.TYPE_REMOVED_FROM_UNION,description:`${i.name} was removed from union type ${e.name}.`});return n}function zx(e,t){let n=[],r=ls(e.getValues(),t.getValues());for(let i of r.added)n.push({type:Dr.VALUE_ADDED_TO_ENUM,description:`${i.name} was added to enum type ${e.name}.`});for(let i of r.removed)n.push({type:$t.VALUE_REMOVED_FROM_ENUM,description:`${i.name} was removed from enum type ${e.name}.`});return n}function wS(e,t){let n=[],r=ls(e.getInterfaces(),t.getInterfaces());for(let i of r.added)n.push({type:Dr.IMPLEMENTED_INTERFACE_ADDED,description:`${i.name} added to interfaces implemented by ${e.name}.`});for(let i of r.removed)n.push({type:$t.IMPLEMENTED_INTERFACE_REMOVED,description:`${e.name} no longer implements interface ${i.name}.`});return n}function FS(e,t){let n=[],r=ls(Object.values(e.getFields()),Object.values(t.getFields()));for(let i of r.removed)n.push({type:$t.FIELD_REMOVED,description:`${e.name}.${i.name} was removed.`});for(let[i,s]of r.persisted)n.push(...Xx(e,i,s)),Hl(i.type,s.type)||n.push({type:$t.FIELD_CHANGED_KIND,description:`${e.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return n}function Xx(e,t,n){let r=[],i=ls(t.args,n.args);for(let s of i.removed)r.push({type:$t.ARG_REMOVED,description:`${e.name}.${t.name} arg ${s.name} was removed.`});for(let[s,o]of i.persisted)if(!Wl(s.type,o.type))r.push({type:$t.ARG_CHANGED_KIND,description:`${e.name}.${t.name} arg ${s.name} has changed type from ${String(s.type)} to ${String(o.type)}.`});else if(s.defaultValue!==void 0)if(o.defaultValue===void 0)r.push({type:Dr.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${s.name} defaultValue was removed.`});else{let u=RS(s.defaultValue,s.type),c=RS(o.defaultValue,o.type);u!==c&&r.push({type:Dr.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${s.name} has changed defaultValue from ${u} to ${c}.`})}for(let s of i.added)Sr(s)?r.push({type:$t.REQUIRED_ARG_ADDED,description:`A required arg ${s.name} on ${e.name}.${t.name} was added.`}):r.push({type:Dr.OPTIONAL_ARG_ADDED,description:`An optional arg ${s.name} on ${e.name}.${t.name} was added.`});return r}function Hl(e,t){return qe(e)?qe(t)&&Hl(e.ofType,t.ofType)||Te(t)&&Hl(e,t.ofType):Te(e)?Te(t)&&Hl(e.ofType,t.ofType):ns(t)&&e.name===t.name||Te(t)&&Hl(e,t.ofType)}function Wl(e,t){return qe(e)?qe(t)&&Wl(e.ofType,t.ofType):Te(e)?Te(t)&&Wl(e.ofType,t.ofType)||!Te(t)&&Wl(e.ofType,t):ns(t)&&e.name===t.name}function LS(e){if(qt(e))return"a Scalar type";if(we(e))return"an Object type";if(Ce(e))return"an Interface type";if(dt(e))return"a Union type";if(it(e))return"an Enum type";if(Be(e))return"an Input type";Xe(!1,"Unexpected type: "+B(e))}function RS(e,t){let n=Cn(e,t);return n!=null||Xe(!1),Ve(vu(n))}function ls(e,t){let n=[],r=[],i=[],s=Qn(e,({name:a})=>a),o=Qn(t,({name:a})=>a);for(let a of e){let u=o[a.name];u===void 0?r.push(a):i.push([a,u])}for(let a of t)s[a.name]===void 0&&n.push(a);return{added:n,persisted:i,removed:r}}var $t,Dr,xS=j(()=>{"use strict";d();f();p();mt();qn();To();gr();tt();bi();Wc();cy();(function(e){e.TYPE_REMOVED="TYPE_REMOVED",e.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",e.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",e.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",e.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",e.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",e.FIELD_REMOVED="FIELD_REMOVED",e.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",e.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",e.ARG_REMOVED="ARG_REMOVED",e.ARG_CHANGED_KIND="ARG_CHANGED_KIND",e.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",e.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",e.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",e.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",e.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"})($t||($t={}));(function(e){e.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",e.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",e.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",e.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",e.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",e.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"})(Dr||(Dr={}))});var PS=j(()=>{"use strict";d();f();p();Wy();cS();lS();dS();pS();hS();sE();yS();vS();Oi();Dl();ST();Wc();ef();Iy();_S();DS();OS();Xc();AS();xS()});var ce={};Fc(ce,{BREAK:()=>Eo,BreakingChangeType:()=>$t,DEFAULT_DEPRECATION_REASON:()=>fu,DangerousChangeType:()=>Dr,DirectiveLocation:()=>Ne,ExecutableDefinitionsRule:()=>al,FieldsOnCorrectTypeRule:()=>ul,FragmentsOnCompositeTypesRule:()=>cl,GRAPHQL_MAX_INT:()=>uu,GRAPHQL_MIN_INT:()=>cu,GraphQLBoolean:()=>Mn,GraphQLDeprecatedDirective:()=>Si,GraphQLDirective:()=>Un,GraphQLEnumType:()=>Yn,GraphQLError:()=>k,GraphQLFloat:()=>Hp,GraphQLID:()=>lu,GraphQLIncludeDirective:()=>du,GraphQLInputObjectType:()=>_r,GraphQLInt:()=>Xp,GraphQLInterfaceType:()=>Ir,GraphQLList:()=>wt,GraphQLNonNull:()=>xe,GraphQLObjectType:()=>fn,GraphQLScalarType:()=>xn,GraphQLSchema:()=>fr,GraphQLSkipDirective:()=>pu,GraphQLSpecifiedByDirective:()=>mu,GraphQLString:()=>Ft,GraphQLUnionType:()=>vr,Kind:()=>_,KnownArgumentNamesRule:()=>ll,KnownDirectivesRule:()=>gu,KnownFragmentNamesRule:()=>dl,KnownTypeNamesRule:()=>Iu,Lexer:()=>Zi,Location:()=>ra,LoneAnonymousOperationRule:()=>pl,LoneSchemaDefinitionRule:()=>fl,NoDeprecatedCustomRule:()=>Xy,NoFragmentCyclesRule:()=>ml,NoSchemaIntrospectionCustomRule:()=>Hy,NoUndefinedVariablesRule:()=>hl,NoUnusedFragmentsRule:()=>Tl,NoUnusedVariablesRule:()=>yl,OperationTypeNode:()=>At,OverlappingFieldsCanBeMergedRule:()=>El,PossibleFragmentSpreadsRule:()=>Nl,PossibleTypeExtensionsRule:()=>gl,ProvidedRequiredArgumentsRule:()=>Il,ScalarLeafsRule:()=>vl,SchemaMetaFieldDef:()=>is,SingleFieldSubscriptionsRule:()=>Al,Source:()=>vi,Token:()=>mo,TokenKind:()=>q,TypeInfo:()=>as,TypeKind:()=>pt,TypeMetaFieldDef:()=>ss,TypeNameMetaFieldDef:()=>os,UniqueArgumentDefinitionNamesRule:()=>wl,UniqueArgumentNamesRule:()=>Du,UniqueDirectiveNamesRule:()=>Fl,UniqueDirectivesPerLocationRule:()=>Ou,UniqueEnumValueNamesRule:()=>Ll,UniqueFieldDefinitionNamesRule:()=>Rl,UniqueFragmentNamesRule:()=>kl,UniqueInputFieldNamesRule:()=>Au,UniqueOperationNamesRule:()=>xl,UniqueOperationTypesRule:()=>Pl,UniqueTypeNamesRule:()=>Ml,UniqueVariableNamesRule:()=>Ul,ValidationContext:()=>Na,ValuesOfCorrectTypeRule:()=>Cl,VariablesAreInputTypesRule:()=>Bl,VariablesInAllowedPositionRule:()=>$l,__Directive:()=>Zc,__DirectiveLocation:()=>el,__EnumValue:()=>nl,__Field:()=>tl,__InputValue:()=>da,__Schema:()=>la,__Type:()=>pr,__TypeKind:()=>rl,assertAbstractType:()=>UT,assertCompositeType:()=>MT,assertDirective:()=>jT,assertEnumType:()=>wT,assertEnumValueName:()=>jc,assertInputObjectType:()=>FT,assertInputType:()=>kT,assertInterfaceType:()=>Kc,assertLeafType:()=>PT,assertListType:()=>LT,assertName:()=>Dn,assertNamedType:()=>BT,assertNonNullType:()=>RT,assertNullableType:()=>Yc,assertObjectType:()=>qc,assertOutputType:()=>xT,assertScalarType:()=>OT,assertSchema:()=>pa,assertType:()=>DT,assertUnionType:()=>AT,assertValidName:()=>hE,assertValidSchema:()=>ha,assertWrappingType:()=>CT,astFromValue:()=>Cn,buildASTSchema:()=>Nf,buildClientSchema:()=>nE,buildSchema:()=>oE,coerceInputValue:()=>Sl,concatAST:()=>pE,createSourceEventStream:()=>yf,defaultFieldResolver:()=>Kl,defaultTypeResolver:()=>Tf,doTypesOverlap:()=>au,execute:()=>bo,executeSync:()=>Ql,extendSchema:()=>rE,findBreakingChanges:()=>TE,findDangerousChanges:()=>yE,formatError:()=>hT,getArgumentValues:()=>_o,getDirectiveValues:()=>cs,getEnterLeaveForKind:()=>ts,getIntrospectionQuery:()=>Jl,getLocation:()=>fo,getNamedType:()=>Ct,getNullableType:()=>ua,getOperationAST:()=>Zy,getOperationRootType:()=>eE,getVariableValues:()=>Ol,getVisitFn:()=>bT,graphql:()=>Jb,graphqlSync:()=>zb,introspectionFromSchema:()=>tE,introspectionTypes:()=>Di,isAbstractType:()=>Pn,isCompositeType:()=>ar,isConstValueNode:()=>ol,isDefinitionNode:()=>QT,isDirective:()=>go,isEnumType:()=>it,isEqualType:()=>ca,isExecutableDefinitionNode:()=>yu,isInputObjectType:()=>Be,isInputType:()=>on,isInterfaceType:()=>Ce,isIntrospectionType:()=>zn,isLeafType:()=>yn,isListType:()=>qe,isNamedType:()=>ns,isNonNullType:()=>Te,isNullableType:()=>Qc,isObjectType:()=>we,isOutputType:()=>br,isRequiredArgument:()=>Sr,isRequiredInputField:()=>rs,isScalarType:()=>qt,isSchema:()=>Zp,isSelectionNode:()=>YT,isSpecifiedDirective:()=>Io,isSpecifiedScalarType:()=>si,isType:()=>No,isTypeDefinitionNode:()=>Mr,isTypeExtensionNode:()=>vo,isTypeNode:()=>JT,isTypeSubTypeOf:()=>ii,isTypeSystemDefinitionNode:()=>Eu,isTypeSystemExtensionNode:()=>Nu,isUnionType:()=>dt,isValidNameError:()=>vf,isValueNode:()=>tf,isWrappingType:()=>aa,lexicographicSortSchema:()=>zl,locatedError:()=>Ai,parse:()=>ti,parseConstValue:()=>ET,parseType:()=>NT,parseValue:()=>Bc,print:()=>Ve,printError:()=>mT,printIntrospectionSchema:()=>cE,printLocation:()=>Rc,printSchema:()=>Xl,printSourceLocation:()=>Za,printType:()=>If,resolveObjMapThunk:()=>zc,resolveReadonlyArrayThunk:()=>Jc,responsePathAsArray:()=>On,separateOperations:()=>fE,specifiedDirectives:()=>Jn,specifiedRules:()=>Vl,specifiedScalarTypes:()=>_i,stripIgnoredCharacters:()=>mE,subscribe:()=>zy,syntaxError:()=>Gt,typeFromAST:()=>Bt,validate:()=>jl,validateSchema:()=>Tu,valueFromAST:()=>ur,valueFromASTUntyped:()=>oa,version:()=>tb,versionInfo:()=>nb,visit:()=>xr,visitInParallel:()=>su,visitWithTypeInfo:()=>Ta});var ne=j(()=>{"use strict";d();f();p();rb();Hb();Wb();Zb();iS();aS();uS();PS()});var Or=L(U=>{"use strict";d();f();p();Object.defineProperty(U,"__esModule",{value:!0});U.PROVIDES=U.PARENT_EXTENSION_DATA_MAP=U.PARENT_DEFINITION_DATA_MAP=U.PARENTS=U.OVERRIDE=U.OBJECT_UPPER=U.OPERATION_TO_DEFAULT=U.NAME=U.N_A=U.MUTATION_UPPER=U.MUTATION=U.KEY=U.LINK=U.INTERFACE_OBJECT=U.INTERFACE_UPPER=U.INACCESSIBLE=U.INPUT_OBJECT_UPPER=U.INPUT_FIELD_DEFINITION_UPPER=U.INLINE_FRAGMENT_UPPER=U.INLINE_FRAGMENT=U.FROM=U.FRAGMENT_REPRESENTATION=U.FRAGMENT_SPREAD_UPPER=U.FRAGMENT_DEFINITION_UPPER=U.FIELD_DEFINITION_UPPER=U.FIELDS=U.FIELD_SET_SCALAR=U.FIELD_UPPER=U.FIELD=U.EXTENSIONS=U.EXTENDS=U.EXTERNAL=U.EVENTS_SUBSCRIBE=U.EVENTS_REQUEST=U.EVENTS_PUBLISH=U.ENUM_VALUE_UPPER=U.ENUM_UPPER=U.ENTITY_UNION=U.ENTITIES_FIELD=U.ENTITIES=U.DIRECTIVE_DEFINITION=U.DEPRECATED=U.DEFAULT_SUBSCRIPTION=U.DEFAULT_QUERY=U.DEFAULT_MUTATION=U.COMPOSE_DIRECTIVE=U.BOOLEAN_TYPE=U.ARGUMENT_DEFINITION_UPPER=U.AUTHENTICATED=U.ANY_SCALAR=void 0;U.IGNORED_PARENT_DIRECTIVES=U.ROOT_TYPES=U.VARIABLE_DEFINITION_UPPER=U.URL_LOWER=U.UNION_UPPER=U.UNION=U.TOPIC=U.TAG=U.SUBSCRIPTION_UPPER=U.SUBSCRIPTION=U.STRING_SCALAR=U.SPECIFIED_BY=U.SOURCE_ID=U.SHAREABLE=U.SERVICE_FIELD=U.SERVICE_OBJECT=U.SELECTION_REPRESENTATION=U.SCOPE_SCALAR=U.SCOPES=U.SCHEMA_UPPER=U.SCHEMA=U.SCALAR_UPPER=U.RESOLVABLE=U.REQUIRES_SCOPES=U.REQUIRES=U.REASON=U.QUOTATION_JOIN=U.QUERY_UPPER=U.QUERY=void 0;U.ANY_SCALAR="_Any";U.AUTHENTICATED="authenticated";U.ARGUMENT_DEFINITION_UPPER="ARGUMENT_DEFINITION";U.BOOLEAN_TYPE="Boolean";U.COMPOSE_DIRECTIVE="composeDirective";U.DEFAULT_MUTATION="Mutation";U.DEFAULT_QUERY="Query";U.DEFAULT_SUBSCRIPTION="Subscription";U.DEPRECATED="deprecated";U.DIRECTIVE_DEFINITION="directive definition";U.ENTITIES="entities";U.ENTITIES_FIELD="_entities";U.ENTITY_UNION="_Entity";U.ENUM_UPPER="ENUM";U.ENUM_VALUE_UPPER="ENUM_VALUE";U.EVENTS_PUBLISH="eventsPublish";U.EVENTS_REQUEST="eventsRequest";U.EVENTS_SUBSCRIBE="eventsSubscribe";U.EXTERNAL="external";U.EXTENDS="extends";U.EXTENSIONS="extensions";U.FIELD="field";U.FIELD_UPPER="FIELD";U.FIELD_SET_SCALAR="openfed__FieldSet";U.FIELDS="fields";U.FIELD_DEFINITION_UPPER="FIELD_DEFINITION";U.FRAGMENT_DEFINITION_UPPER="FRAGMENT_DEFINITION";U.FRAGMENT_SPREAD_UPPER="FRAGMENT_SPREAD";U.FRAGMENT_REPRESENTATION=" { ... }";U.FROM="from";U.INLINE_FRAGMENT="inlineFragment";U.INLINE_FRAGMENT_UPPER="INLINE_FRAGMENT";U.INPUT_FIELD_DEFINITION_UPPER="INPUT_FIELD_DEFINITION";U.INPUT_OBJECT_UPPER="INPUT_OBJECT";U.INACCESSIBLE="inaccessible";U.INTERFACE_UPPER="INTERFACE";U.INTERFACE_OBJECT="interfaceObject";U.LINK="link";U.KEY="key";U.MUTATION="Mutation";U.MUTATION_UPPER="MUTATION";U.N_A="N/A";U.NAME="name";U.OPERATION_TO_DEFAULT="operationTypeNodeToDefaultType";U.OBJECT_UPPER="OBJECT";U.OVERRIDE="override";U.PARENTS="parents";U.PARENT_DEFINITION_DATA_MAP="parentDefinitionDataByParentTypeName";U.PARENT_EXTENSION_DATA_MAP="parentExtensionDataByParentTypeName";U.PROVIDES="provides";U.QUERY="Query";U.QUERY_UPPER="QUERY";U.QUOTATION_JOIN='", "';U.REASON="reason";U.REQUIRES="requires";U.REQUIRES_SCOPES="requiresScopes";U.RESOLVABLE="resolvable";U.SCALAR_UPPER="SCALAR";U.SCHEMA="schema";U.SCHEMA_UPPER="SCHEMA";U.SCOPES="scopes";U.SCOPE_SCALAR="openfed__Scope";U.SELECTION_REPRESENTATION=" { ... }";U.SERVICE_OBJECT="_Service";U.SERVICE_FIELD="_service";U.SHAREABLE="shareable";U.SOURCE_ID="sourceID";U.SPECIFIED_BY="specifiedBy";U.STRING_SCALAR="String";U.SUBSCRIPTION="Subscription";U.SUBSCRIPTION_UPPER="SUBSCRIPTION";U.TAG="tag";U.TOPIC="topic";U.UNION="union";U.UNION_UPPER="UNION";U.URL_LOWER="url";U.VARIABLE_DEFINITION_UPPER="VARIABLE_DEFINITION";U.ROOT_TYPES=new Set([U.MUTATION,U.QUERY,U.SUBSCRIPTION]);U.IGNORED_PARENT_DIRECTIVES=new Set([U.AUTHENTICATED,U.EXTENDS,U.REQUIRES_SCOPES])});var ds=L(oe=>{"use strict";d();f();p();Object.defineProperty(oe,"__esModule",{value:!0});oe.isNodeKindInterface=oe.generateRequiresScopesDirective=oe.generateSimpleDirective=oe.setAndGetValue=oe.upsertAuthorizationConfiguration=oe.upsertAuthorizationData=oe.upsertFieldAuthorizationData=oe.mergeAuthorizationDataByAND=oe.maxOrScopes=oe.newAuthorizationData=oe.getAuthorizationDataToUpdate=oe.resetAuthorizationData=oe.newFieldAuthorizationData=oe.upsertEntityContainer=oe.upsertEntityContainerProperties=oe.newEntityContainer=oe.getValueOrDefault=oe.hasSimplePath=oe.upsertEntityInterfaceFederationData=oe.newEntityInterfaceFederationData=oe.kindToTypeString=oe.addSetsAndReturnMutationBoolean=oe.addIterableValuesToSet=oe.numberToOrdinal=oe.mapToArrayOfValues=oe.subtractSourceSetFromTargetSet=oe.doSetsHaveAnyOverlap=oe.getEntriesNotInHashSet=oe.getAllSetDisparities=oe.getOrThrowError=oe.getAllMutualEntries=oe.areSetsEqual=void 0;var Kt=(ne(),se(ce)),_f=Or(),Hx=ai(),EE=Ar();function Wx(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}oe.areSetsEqual=Wx;function Zx(e,t){let n=new Set;for(let r of e)t.has(r)&&n.add(r);return n}oe.getAllMutualEntries=Zx;function eP(e,t,n){let r=e.get(t);if(r===void 0)throw(0,Hx.invalidKeyFatalError)(t,n);return r}oe.getOrThrowError=eP;function tP(e,t){let n=new Set(t),r=[];for(let i of e)n.delete(i)||r.push(i);for(let i of n)r.push(i);return r}oe.getAllSetDisparities=tP;function nP(e,t){let n=[];for(let r of e)t.has(r)||n.push(r);return n}oe.getEntriesNotInHashSet=nP;function rP(e,t){for(let n of e)if(t.has(n))return!0;return!1}oe.doSetsHaveAnyOverlap=rP;function iP(e,t){for(let n of e)t.has(n)&&t.delete(n)}oe.subtractSourceSetFromTargetSet=iP;function sP(e){let t=[];for(let n of e.values())t.push(n);return t}oe.mapToArrayOfValues=sP;function oP(e){let t=e.toString();switch(t[t.length-1]){case"1":return`${t}st`;case"2":return`${t}nd`;case"3":return`${t}rd`;default:return`${t}th`}}oe.numberToOrdinal=oP;function ga(e,t){for(let n of e)t.add(n)}oe.addIterableValuesToSet=ga;function MS(e,t){let n=!1;for(let r of e)t.has(r)||(n=!0,t.add(r));return n}oe.addSetsAndReturnMutationBoolean=MS;function aP(e){switch(e){case Kt.Kind.ENUM_TYPE_DEFINITION:return"enum";case Kt.Kind.ENUM_TYPE_EXTENSION:return"enum extension";case Kt.Kind.FIELD_DEFINITION:return _f.FIELD;case Kt.Kind.INPUT_OBJECT_TYPE_DEFINITION:return"input object";case Kt.Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object extension";case Kt.Kind.INPUT_VALUE_DEFINITION:return"input value";case Kt.Kind.INTERFACE_TYPE_DEFINITION:return"interface";case Kt.Kind.INTERFACE_TYPE_EXTENSION:return"interface extension";case Kt.Kind.OBJECT_TYPE_DEFINITION:return"object";case Kt.Kind.OBJECT_TYPE_EXTENSION:return"object extension";case Kt.Kind.SCALAR_TYPE_DEFINITION:return"scalar";case Kt.Kind.SCALAR_TYPE_EXTENSION:return"scalar extension";case Kt.Kind.UNION_TYPE_DEFINITION:return _f.UNION;case Kt.Kind.UNION_TYPE_EXTENSION:return"union extension";default:return e}}oe.kindToTypeString=aP;function uP(e,t){return A({interfaceFieldNames:new Set(e.interfaceFieldNames),interfaceObjectFieldNames:new Set(e.interfaceObjectFieldNames),interfaceObjectSubgraphs:new Set(e.isInterfaceObject?[t]:[]),typeName:e.typeName},e.isInterfaceObject?{}:{concreteTypeNames:new Set(e.concreteTypeNames)})}oe.newEntityInterfaceFederationData=uP;function cP(e,t,n){return ga(t.interfaceFieldNames,e.interfaceFieldNames),ga(t.interfaceObjectFieldNames,e.interfaceObjectFieldNames),t.isInterfaceObject?(e.interfaceObjectSubgraphs.add(n),!1):e.concreteTypeNames?MS(t.concreteTypeNames||new Set,e.concreteTypeNames):(e.concreteTypeNames=new Set(t.concreteTypeNames),!1)}oe.upsertEntityInterfaceFederationData=cP;var NE=class{constructor(t){S(this,"set",new Set);S(this,"stack",[]);this.push(t)}has(t){return this.set.has(t)}push(t){this.stack.push(t),this.set.add(t)}pop(){let t=this.stack.pop();t&&this.set.delete(t)}};function lP(e,t,n){if(!e.hasNode(t)||!e.hasNode(n))return!1;let r=[e.outboundNeighbors(t)],i=new NE(t),s,o;for(;r.length>0;){if(s=r[r.length-1],o=s.pop(),!o){r.pop();continue}if(i.has(o))continue;if(o===n)return!0;i.push(o);let a=e.outboundNeighbors(o);a.length<0||r.push(a)}return!1}oe.hasSimplePath=lP;function US(e,t,n){let r=e.get(t);if(r)return r;let i=n();return e.set(t,i),i}oe.getValueOrDefault=US;function CS(e){return{fieldNames:new Set(e.fieldNames),keyFieldSets:new Set(e.keyFieldSets),subgraphNames:new Set(e.subgraphNames),typeName:e.typeName}}oe.newEntityContainer=CS;function BS(e,t){ga(e.fieldNames||[],t.fieldNames),ga(e.keyFieldSets||[],t.keyFieldSets),ga(e.subgraphNames||[],t.subgraphNames)}function dP(e,t){let n=e.get(t.typeName);n?BS(t,n):e.set(t.typeName,CS(t))}oe.upsertEntityContainerProperties=dP;function pP(e,t){let n=e.get(t.typeName);n?BS(t,n):e.set(t.typeName,t)}oe.upsertEntityContainer=pP;function gE(e){return{fieldName:e,requiresAuthentication:!1,requiredScopes:[]}}oe.newFieldAuthorizationData=gE;function fP(e){e&&(e.requiresAuthentication=!1,e.requiredScopes=[],e.hasParentLevelAuthorization=!1)}oe.resetAuthorizationData=fP;function mP(e,t,n){return t.kind===Kt.Kind.FIELD_DEFINITION?US(e.fieldAuthorizationDataByFieldName,n,()=>gE(n)):(e.hasParentLevelAuthorization=!0,e)}oe.getAuthorizationDataToUpdate=mP;function hP(e){return{fieldAuthorizationDataByFieldName:new Map,hasParentLevelAuthorization:!1,requiresAuthentication:!1,requiredScopes:[],typeName:e}}oe.newAuthorizationData=hP;oe.maxOrScopes=16;function $S(e,t){t.requiresAuthentication||(t.requiresAuthentication=e.requiresAuthentication);let n=e.requiredScopes.length;if(n<1)return!0;let r=t.requiredScopes.length;if(r<1){if(n>oe.maxOrScopes)return!1;for(let s of e.requiredScopes)t.requiredScopes.push(new Set(s));return!0}if(n*r>oe.maxOrScopes)return!1;let i=[];for(let s of t.requiredScopes)for(let o of e.requiredScopes){let a=new Set(s);ga(o,a),i.push(a)}return t.requiredScopes=i,!0}oe.mergeAuthorizationDataByAND=$S;function VS(e,t){let n=t.fieldName,r=e.get(n);if(!r){if(t.requiredScopes.length>oe.maxOrScopes)return!1;let i=gE(n);i.requiresAuthentication||(i.requiresAuthentication=t.requiresAuthentication);for(let s of t.requiredScopes)i.requiredScopes.push(new Set(s));return e.set(n,i),!0}return r.requiresAuthentication||(r.requiresAuthentication=t.requiresAuthentication),$S(t,r)}oe.upsertFieldAuthorizationData=VS;function TP(e,t,n){let r=e.get(t.typeName);if(!r){e.set(t.typeName,t);return}for(let[i,s]of t.fieldAuthorizationDataByFieldName)VS(r.fieldAuthorizationDataByFieldName,s)||n.add(`${t.typeName}.${i}`)}oe.upsertAuthorizationData=TP;function yP(e,t){let n=t.typeName;for(let[r,i]of t.fieldAuthorizationDataByFieldName){let s=`${n}.${r}`,o=e.get(s);o?(o.requiresAuthentication=i.requiresAuthentication,o.requiredScopes=i.requiredScopes.map(a=>[...a])):e.set(s,{argumentNames:[],typeName:n,fieldName:r,requiresAuthentication:i.requiresAuthentication,requiredScopes:i.requiredScopes.map(a=>[...a])})}}oe.upsertAuthorizationConfiguration=yP;function EP(e,t,n){return e.set(t,n),n}oe.setAndGetValue=EP;function NP(e){return{kind:Kt.Kind.DIRECTIVE,name:(0,EE.stringToNameNode)(e)}}oe.generateSimpleDirective=NP;function gP(e){let t=[];for(let n of e){let r=[];for(let i of n)r.push({kind:Kt.Kind.STRING,value:i});t.push({kind:Kt.Kind.LIST,values:r})}return{kind:Kt.Kind.DIRECTIVE,name:(0,EE.stringToNameNode)(_f.REQUIRES_SCOPES),arguments:[{kind:Kt.Kind.ARGUMENT,name:(0,EE.stringToNameNode)(_f.SCOPES),value:{kind:Kt.Kind.LIST,values:t}}]}}oe.generateRequiresScopesDirective=gP;function IP(e){return e===Kt.Kind.INTERFACE_TYPE_DEFINITION||e===Kt.Kind.INTERFACE_TYPE_EXTENSION}oe.isNodeKindInterface=IP});var ai=L(F=>{"use strict";d();f();p();Object.defineProperty(F,"__esModule",{value:!0});F.unexpectedDirectiveLocationError=F.unexpectedArgumentKindFatalError=F.argumentTypeMergeFatalError=F.fieldTypeMergeFatalError=F.incompatibleParentKindFatalError=F.unexpectedKindFatalError=F.invalidKeyDirectivesError=F.invalidKeyDirectiveArgumentErrorMessage=F.invalidDirectiveArgumentTypeErrorMessage=F.duplicateDirectiveArgumentDefinitionErrorMessage=F.unexpectedDirectiveArgumentErrorMessage=F.undefinedRequiredArgumentsErrorMessage=F.unexpectedDirectiveArgumentsErrorMessage=F.invalidDirectiveLocationErrorMessage=F.invalidDirectiveError=F.invalidTagDirectiveError=F.invalidDeprecatedDirectiveError=F.duplicateUnionMemberError=F.invalidUnionError=F.invalidRepeatedDirectiveErrorMessage=F.federationRequiredInputFieldError=F.federationInvalidParentTypeError=F.federationUnexpectedNodeKindError=F.undefinedTypeError=F.unresolvableFieldError=F.undefinedEntityKeyErrorMessage=F.undefinedDirectiveErrorMessage=F.shareableFieldDefinitionsError=F.operationDefinitionError=F.noDefinedUnionMembersError=F.noBaseTypeExtensionError=F.duplicateOperationTypeDefinitionError=F.duplicateTypeDefinitionError=F.duplicateValueExtensionError=F.duplicateUnionMemberExtensionError=F.duplicateInterfaceError=F.duplicateInterfaceExtensionError=F.duplicateFieldExtensionError=F.duplicateEnumValueDefinitionError=F.duplicateDirectiveDefinitionError=F.duplicateFieldDefinitionError=F.invalidSubgraphNamesError=F.incompatibleExtensionKindsError=F.incompatibleSharedEnumError=F.incompatibleArgumentDefaultValueTypeError=F.incompatibleArgumentDefaultValueError=F.incompatibleChildTypesError=F.incompatibleArgumentTypesError=F.incompatibleExtensionError=F.minimumSubgraphRequirementError=void 0;F.orScopesLimitError=F.undefinedEntityInterfaceImplementationsError=F.equivalentSourceAndTargetOverrideErrorMessage=F.allFieldDefinitionsAreInaccessibleError=F.noFieldDefinitionsError=F.duplicateOverriddenFieldsError=F.duplicateOverriddenFieldErrorMessage=F.invalidSelectionOnUnionErrorMessage=F.invalidInlineFragmentTypeConditionErrorMessage=F.invalidInlineFragmentTypeConditionTypeErrorMessage=F.unknownInlineFragmentTypeConditionErrorMessage=F.inlineFragmentWithoutTypeConditionErrorMessage=F.invalidInlineFragmentTypeErrorMessage=F.unknownProvidesEntityErrorMessage=F.duplicateFieldInFieldSetErrorMessage=F.invalidProvidesOrRequiresDirectivesError=F.argumentsInKeyFieldSetErrorMessage=F.unexpectedArgumentErrorMessage=F.undefinedObjectLikeParentError=F.unparsableFieldSetSelectionErrorMessage=F.unparsableFieldSetErrorMessage=F.undefinedFieldInFieldSetErrorMessage=F.invalidSelectionSetDefinitionErrorMessage=F.invalidSelectionSetErrorMessage=F.unknownTypeInFieldSetErrorMessage=F.abstractTypeInKeyFieldSetErrorMessage=F.inlineFragmentInFieldSetErrorMessage=F.expectedEntityError=F.noConcreteTypesForAbstractTypeError=F.unexpectedObjectResponseType=F.noQueryRootTypeError=F.invalidArgumentsError=F.duplicateArgumentsError=F.invalidRequiredArgumentsError=F.unimplementedInterfaceFieldsError=F.subgraphInvalidSyntaxError=F.invalidRootTypeDefinitionError=F.invalidOperationTypeDefinitionError=F.invalidSubgraphNameErrorMessage=F.subgraphValidationFailureError=F.subgraphValidationError=F.unexpectedParentKindErrorMessage=F.invalidConfigurationResultFatalError=F.invalidKeyFatalError=F.unexpectedTypeNodeKindFatalError=void 0;var vP=Ar(),_P=(ne(),se(ce)),Zl=ds(),So=Or();F.minimumSubgraphRequirementError=new Error("At least one subgraph is required for federation.");function bP(e,t,n){return new Error(`Extension error: + Incompatible types: "${e}" is type "${t}", but an extension of the same name is type "${n}.`)}F.incompatibleExtensionError=bP;function SP(e,t,n,r,i){return new Error(`Incompatible types when merging two instances of argument "${e}" for "${t}.${n}": + Expected type "${r}" but received "${i}"`)}F.incompatibleArgumentTypesError=SP;function DP(e,t,n,r){return new Error(`Incompatible types when merging two instances of "${e}.${t}": + Expected type "${n}" but received "${r}"`)}F.incompatibleChildTypesError=DP;function OP(e,t,n,r,i){return new Error(`Incompatible default values when merging two instances of argument "${e} for "${t}.${n}": + Expected value "${r}" but received "${i}"`)}F.incompatibleArgumentDefaultValueError=OP;function AP(e,t,n,r,i){return new Error(`Incompatible default values when merging two instances of argument "${e} for "${t}.${n}": + Expected type "${r}" but received "${i}"`)}F.incompatibleArgumentDefaultValueTypeError=AP;function wP(e){return new Error(`Enum "${e}" was used as both an input and output but was inconsistently defined across inclusive subgraphs.`)}F.incompatibleSharedEnumError=wP;function FP(e,t){let n=e.kind===_P.Kind.SCHEMA_EXTENSION?"schema":e.name.value;return new Error(`Expected extension "${n}" to be type ${t} but received ${e.kind}.`)}F.incompatibleExtensionKindsError=FP;function LP(e,t){let n="Subgraphs to be federated must each have a unique, non-empty name.";e.length>0&&(n+=` The following subgraph names are not unique: "`+e.join('", "')+'"');for(let r of t)n+=` - ${r}`;return new Error(n)}P.invalidSubgraphNamesError=hj;function yj(e,t){return new Error(`Extension error: - Field "${e} already exists on type "${t}".`)}P.duplicateFieldDefinitionError=yj;function Tj(e){return new Error(`The directive "${e}" has already been defined.`)}P.duplicateDirectiveDefinitionError=Tj;function Ej(e,t){return new Error(`Extension error: - Value "${e}" already exists on enum "${t}".`)}P.duplicateEnumValueDefinitionError=Ej;function Nj(e,t){return new Error(`Extension error: - More than one extension attempts to extend type "${e}" with the field "${t}".`)}P.duplicateFieldExtensionError=Nj;function gj(e,t){return new Error(`Extension error: - Interface "${e}" is already implemented by type "${t}".`)}P.duplicateInterfaceExtensionError=gj;function vj(e,t){return new Error(`Interface "${e}" can only be defined on type "${t}" once.`)}P.duplicateInterfaceError=vj;function Ij(e,t){return new Error(`Extension error: - Member "${e}" already exists on union "${t}".`)}P.duplicateUnionMemberError=Ij;function bj(e,t,n){return new Error(`Extension error: - More than one extension attempts to extend ${e} "${t}" with the value "${n}".`)}P.duplicateValueExtensionError=bj;function _j(e,t){return new Error(`The ${e} "${t}" can only be defined once.`)}P.duplicateTypeDefinitionError=_j;function Oj(e,t,n){return new Error(`The operation type "${e}" cannot be defined as "${t}" because it has already been defined as "${n}".`)}P.duplicateOperationTypeDefinitionError=Oj;function Sj(e){return new Error(`Extension error: - Could not extend the type "${e}" because no base definition exists.`)}P.noBaseTypeExtensionError=Sj;function Dj(e){return new Error(`The union "${e}" must define at least one union member.`)}P.noDefinedUnionMembersError=Dj;function Aj(e,t,n){return new Error(`Expected the response type "${e}" for operation "${t}" to be type object but received "${n}.`)}P.operationDefinitionError=Aj;function wj(e,t){let n=e.node.name.value,r=[];for(let i of e.fields.values()){let o=i.node.name.value;if(!t.has(o))continue;let s=[],a=[];for(let[c,u]of i.subgraphsByShareable)u?s.push(c):a.push(c);s.length<1?r.push(` - The field "${o}" is defined in the following subgraphs: "${[...i.subgraphNames].join('", "')}". + ${r}`;return new Error(n)}F.invalidSubgraphNamesError=LP;function RP(e,t){return new Error(`Extension error: + Field "${e} already exists on type "${t}".`)}F.duplicateFieldDefinitionError=RP;function kP(e){return new Error(`The directive "${e}" has already been defined.`)}F.duplicateDirectiveDefinitionError=kP;function xP(e,t){return new Error(`Extension error: + Value "${e}" already exists on enum "${t}".`)}F.duplicateEnumValueDefinitionError=xP;function PP(e,t){return new Error(`Extension error: + More than one extension attempts to extend type "${e}" with the field "${t}".`)}F.duplicateFieldExtensionError=PP;function MP(e,t){return new Error(`Extension error: + Interface "${e}" is already implemented by type "${t}".`)}F.duplicateInterfaceExtensionError=MP;function UP(e,t){return new Error(`Interface "${e}" can only be defined on type "${t}" once.`)}F.duplicateInterfaceError=UP;function CP(e,t){return new Error(`Extension error: + Member "${e}" already exists on union "${t}".`)}F.duplicateUnionMemberExtensionError=CP;function BP(e,t,n){return new Error(`Extension error: + More than one extension attempts to extend ${e} "${t}" with the value "${n}".`)}F.duplicateValueExtensionError=BP;function $P(e,t){return new Error(`The ${e} "${t}" can only be defined once.`)}F.duplicateTypeDefinitionError=$P;function VP(e,t,n){return new Error(`The operation type "${e}" cannot be defined as "${t}" because it has already been defined as "${n}".`)}F.duplicateOperationTypeDefinitionError=VP;function jP(e){return new Error(`Extension error: + Could not extend the type "${e}" because no base definition exists.`)}F.noBaseTypeExtensionError=jP;function GP(e,t=!1){return new Error("The union "+(t?"extension":"")+` "${e}" must define at least one union member.`)}F.noDefinedUnionMembersError=GP;function qP(e,t,n){return new Error(`Expected the response type "${e}" for operation "${t}" to be type object but received "${n}.`)}F.operationDefinitionError=qP;function KP(e,t){let n=e.node.name.value,r=[];for(let i of e.fields.values()){let s=i.node.name.value;if(!t.has(s))continue;let o=[],a=[];for(let[u,c]of i.subgraphsByShareable)c?o.push(u):a.push(u);o.length<1?r.push(` + The field "${s}" is defined in the following subgraphs: "${[...i.subgraphNames].join('", "')}". However, it is not declared "@shareable" in any of them.`):r.push(` - The field "${o}" is defined and declared "@shareable" in the following subgraph`+(s.length>1?"s":"")+': "'+s.join('", "')+`". + The field "${s}" is defined and declared "@shareable" in the following subgraph`+(o.length>1?"s":"")+': "'+o.join('", "')+`". However, it is not declared "@shareable" in the following subgraph`+(a.length>1?"s":"")+`: "${a.join('", "')}".`)}return new Error(`The object "${n}" defines the same fields in multiple subgraphs without the "@shareable" directive:${r.join(` -`)}`)}P.shareableFieldDefinitionsError=wj;function Rj(e,t){return new Error(`The directive "${e}" is declared on "${t}", but the directive is not defined in the schema.`)}P.undefinedDirectiveError=Rj;function Lj(e,t){return` The "fields" argument defines "${e}" as part of a key, but the field "${e}" is not defined on the object "${t}".`}P.undefinedEntityKeyErrorMessage=Lj;function Fj(e,t,n,r,i){let o=`${i}.${t}`;return new Error(`The path "${r}" cannot be resolved because: - The root type field "${e.path}" is defined in the following subgraph`+(e.subgraphs.size>1?"s":"")+': "'+[...e.subgraphs].join(sa.QUOTATION_JOIN)+`". - However, "${o}" is only defined in the following subgraph`+(n.length>1?"s":"")+': "'+n+`". - Consequently, "${o}" cannot be resolved through the root type field "${e.path}". +`)}`)}F.shareableFieldDefinitionsError=KP;function QP(e,t){return`The directive "${e}" is declared on "${t}", but the directive is not defined in the schema.`}F.undefinedDirectiveErrorMessage=QP;function YP(e,t){return` The "fields" argument defines "${e}" as part of a key, but the field "${e}" is not defined on the object "${t}".`}F.undefinedEntityKeyErrorMessage=YP;function JP(e,t,n,r,i){let s=`${i}.${t}`;return new Error(`The path "${r}" cannot be resolved because: + The root type field "${e.path}" is defined in the following subgraph`+(e.subgraphs.size>1?"s":"")+': "'+[...e.subgraphs].join(So.QUOTATION_JOIN)+`". + However, "${s}" is only defined in the following subgraph`+(n.length>1?"s":"")+': "'+n+`". + Consequently, "${s}" cannot be resolved through the root type field "${e.path}". Potential solutions: Convert "${i}" into an entity using the "@key" directive. - Add the shareable root type field "${e.path}" to `+(n.length>1?"one of the following subgraphs":"the following subgraph")+': "'+n.join(sa.QUOTATION_JOIN)+`". + Add the shareable root type field "${e.path}" to `+(n.length>1?"one of the following subgraphs":"the following subgraph")+': "'+n.join(So.QUOTATION_JOIN)+`". For example (note that V1 fields are shareable by default and do not require a directive): type ${e.typeName} { ... ${e.fieldName}: ${e.fieldTypeNodeString} @shareable - }`)}P.unresolvableFieldError=Fj;function kj(e){return new Error(`The type "${e}" was referenced in the schema, but it was never defined.`)}P.undefinedTypeError=kj;var Pj=(e,t)=>new Error(`Unexpected node kind for field "${e}.${t}".`);P.federationUnexpectedNodeKindError=Pj;var xj=(e,t)=>new Error(`Could not find parent type "${e}" for field "${t}".`);P.federationInvalidParentTypeError=xj;var Cj=(e,t)=>new Error(`Input object field "${e}.${t}" is required in at least one subgraph; consequently, "${t}" must be defined in all subgraphs that also define "${e}".`);P.federationRequiredInputFieldError=Cj;function Mj(e,t){return`The definition for the directive "${e}" does not define it as repeatable, but the same directive is declared more than once on type "${t}".`}P.invalidRepeatedDirectiveErrorMessage=Mj;function Uj(e){return new Error(`Union "${e}" must have at least one member.`)}P.invalidUnionError=Uj;P.invalidDeprecatedDirectiveError=new Error(` + }`)}F.unresolvableFieldError=JP;function zP(e){return new Error(`The type "${e}" was referenced in the schema, but it was never defined.`)}F.undefinedTypeError=zP;var XP=(e,t)=>new Error(`Unexpected node kind for field "${e}.${t}".`);F.federationUnexpectedNodeKindError=XP;var HP=(e,t)=>new Error(`Could not find parent type "${e}" for field "${t}".`);F.federationInvalidParentTypeError=HP;var WP=(e,t)=>new Error(`Input object field "${e}.${t}" is required in at least one subgraph; consequently, "${t}" must be defined in all subgraphs that also define "${e}".`);F.federationRequiredInputFieldError=WP;function ZP(e,t){return`The definition for the directive "${e}" does not define it as repeatable, but the same directive is declared more than once on type "${t}".`}F.invalidRepeatedDirectiveErrorMessage=ZP;function eM(e){return new Error(`Union "${e}" must have at least one member.`)}F.invalidUnionError=eM;function tM(e,t){return new Error(`Member "${e}" must only be defined on union "${t}" once.`)}F.duplicateUnionMemberError=tM;F.invalidDeprecatedDirectiveError=new Error(` Expected the @deprecated directive to have a single optional argument "reason" of the type "String!" -`);P.invalidTagDirectiveError=new Error(` +`);F.invalidTagDirectiveError=new Error(` Expected the @tag directive to have a single required argument "name" of the type "String!" -`);function jj(e,t,n){return new Error(`The directive "${e}" declared on "${t}" is invalid for the following reason`+(n.length>1?`s: +`);function nM(e,t,n){return new Error(`The directive "${e}" declared on "${t}" is invalid for the following reason`+(n.length>1?`s: `:`: `)+n.join(` -`))}P.invalidDirectiveError=jj;function Vj(e,t,n){return` "${e}" is type "${t}", but the directive "${n}" does not define "${(0,sj.nodeKindToDirectiveLocation)(t)}" as a valid location.`}P.invalidDirectiveLocationErrorMessage=Vj;function $j(e,t){var i;let n=e.name.value,r=((i=e.arguments)==null?void 0:i.length)||1;return` The definition for the directive "${n}" does not define any arguments. - However, the same directive declared on "${t}" defines ${r} argument`+(r>1?"s.":".")}P.unexpectedDirectiveArgumentsErrorMessage=$j;function Gj(e,t,n,r=[]){return` The definition for the directive "${e}" defines the following `+n.length+" required argument"+(n.length>1?"s: ":": ")+'"'+n.join('", "')+`". - However, the same directive that is declared on "${t}" does not define`+(r.length>0?` the following required arguments: "${r.join('", "')}"`:" any arguments.")}P.undefinedRequiredArgumentsErrorMessage=Gj;function qj(e,t){return` The definition for the directive "${e}" does not define an argument named "${t}".`}P.unexpectedDirectiveArgumentErrorMessage=qj;function Bj(e,t,n){return` The directive "${e}" that is declared on "${t}" defines the argument named "${n}" more than once.`}P.duplicateDirectiveArgumentDefinitionErrorMessage=Bj;function Kj(e,t,n,r){return` The ${e?"required ":""}argument "${t} must be type "${n}" and not type "${r}".`}P.invalidDirectiveArgumentTypeErrorMessage=Kj;function Qj(e){return` The required argument named "fields" must be type "String" and not type "${e}".`}P.invalidKeyDirectiveArgumentErrorMessage=Qj;function Yj(e,t){return` The ${e} "${t}" is an invalid GraphQL name: - GraphQL names must match the following regex: /[_a-zA-Z][_a-zA-Z0-9]*/`}P.invalidGraphQLNameErrorMessage=Yj;P.invalidOpeningBraceErrorMessage=` Unexpected brace opening: - Received an opening brace "{" before the parent value was defined.`;P.invalidClosingBraceErrorMessage=` Unexpected brace closure: - Received a closing brace "}" before any nested values were defined.`;P.invalidNestingClosureErrorMessage=` Unexpected brace closure: - Received a closing brace "}" before its corresponding opening brace "{" was defined.`;P.invalidNestingErrorMessage=` Invalid nesting: - A nested key was terminated without a closing brace "}".`;function Jj(e,t,n){return new Error(`The directive "key" declared on the object "${e}" with the "fields" argument value of "${t}" is invalid for the following reason: -`+n)}P.invalidEntityKeyError=Jj;function zj(e,t){return new Error(`The entity "${e}" defines the following invalid "key" directive`+(t.length>1?"s":"")+`: +`))}F.invalidDirectiveError=nM;function rM(e,t,n){return` "${e}" is type "${t}", but the directive "${n}" does not define "${(0,vP.nodeKindToDirectiveLocation)(t)}" as a valid location.`}F.invalidDirectiveLocationErrorMessage=rM;function iM(e,t){var i;let n=e.name.value,r=((i=e.arguments)==null?void 0:i.length)||1;return` The definition for the directive "${n}" does not define any arguments. + However, the same directive declared on "${t}" defines ${r} argument`+(r>1?"s.":".")}F.unexpectedDirectiveArgumentsErrorMessage=iM;function sM(e,t,n,r=[]){return` The definition for the directive "${e}" defines the following `+n.length+" required argument"+(n.length>1?"s: ":": ")+'"'+n.join('", "')+`". + However, the same directive that is declared on "${t}" does not define`+(r.length>0?` the following required arguments: "${r.join('", "')}"`:" any arguments.")}F.undefinedRequiredArgumentsErrorMessage=sM;function oM(e,t){return` The definition for the directive "${e}" does not define an argument named "${t}".`}F.unexpectedDirectiveArgumentErrorMessage=oM;function aM(e,t,n){return` The directive "${e}" that is declared on "${t}" defines the argument named "${n}" more than once.`}F.duplicateDirectiveArgumentDefinitionErrorMessage=aM;function uM(e,t,n,r){return` The ${e?"required ":""}argument "${t} must be type "${n}" and not type "${r}".`}F.invalidDirectiveArgumentTypeErrorMessage=uM;function cM(e){return` The required argument named "fields" must be type "String" and not type "${e}".`}F.invalidKeyDirectiveArgumentErrorMessage=cM;function lM(e,t){return new Error(`The entity "${e}" defines the following invalid "key" directive`+(t.length>1?"s":"")+`: `+t.join(` -`))}P.invalidKeyDirectivesError=zj;function Xj(e){return new Error(`Fatal: Unexpected type for "${e}"`)}P.unexpectedKindFatalError=Xj;function Hj(e,t,n){return new Error(`Fatal: Expected "${e}" to be type ${(0,Up.kindToTypeString)(t)} but received "${(0,Up.kindToTypeString)(n)}".`)}P.incompatibleParentKindFatalError=Hj;function Wj(e){return new Error(`Fatal: Unsuccessfully merged the cross-subgraph types of field "${e}" without producing a type error object.`)}P.fieldTypeMergeFatalError=Wj;function Zj(e,t){return new Error(`Fatal: Unsuccessfully merged the cross-subgraph types of argument "${e}" on field "${t}" without producing a type error object.`)}P.argumentTypeMergeFatalError=Zj;function eV(e,t){return new Error(`Fatal: Unexpected type for argument "${e}" on field "${t}".`)}P.unexpectedArgumentKindFatalError=eV;function tV(e){return new Error(`Fatal: Unknown directive location "${e}".`)}P.unexpectedDirectiveLocationError=tV;function nV(e){return new Error(`Fatal: Expected all constituent types of "${e}" to be one of the following: "LIST_TYPE", "NAMED_TYPE", or "NON_NULL_TYPE".`)}P.unexpectedTypeNodeKindError=nV;function rV(e,t){return new Error(`Fatal: Expected key "${e}" to exist in the map "${t}".`)}P.invalidKeyFatalError=rV;function iV(e){return new Error(`Fatal: Expected either errors or configurations for the path ${e}" but received neither".`)}P.invalidConfigurationResultFatalError=iV;function oV(e,t,n){return` Expected "${e}" to be type ${t} but received "${n}".`}P.unexpectedParentKindErrorMessage=oV;function sV(e,t){return new Error(`The subgraph "${e}" could not be federated for the following reason`+(t.length>1?"s":"")+`: +`))}F.invalidKeyDirectivesError=lM;function dM(e){return new Error(`Fatal: Unexpected type for "${e}"`)}F.unexpectedKindFatalError=dM;function pM(e,t,n){return new Error(`Fatal: Expected "${e}" to be type ${(0,Zl.kindToTypeString)(t)} but received "${(0,Zl.kindToTypeString)(n)}".`)}F.incompatibleParentKindFatalError=pM;function fM(e){return new Error(`Fatal: Unsuccessfully merged the cross-subgraph types of field "${e}" without producing a type error object.`)}F.fieldTypeMergeFatalError=fM;function mM(e,t){return new Error(`Fatal: Unsuccessfully merged the cross-subgraph types of argument "${e}" on field "${t}" without producing a type error object.`)}F.argumentTypeMergeFatalError=mM;function hM(e,t){return new Error(`Fatal: Unexpected type for argument "${e}" on field "${t}".`)}F.unexpectedArgumentKindFatalError=hM;function TM(e){return new Error(`Fatal: Unknown directive location "${e}".`)}F.unexpectedDirectiveLocationError=TM;function yM(e){return new Error(`Fatal: Expected all constituent types of "${e}" to be one of the following: "LIST_TYPE", "NAMED_TYPE", or "NON_NULL_TYPE".`)}F.unexpectedTypeNodeKindFatalError=yM;function EM(e,t){return new Error(`Fatal: Expected key "${e}" to exist in the map "${t}".`)}F.invalidKeyFatalError=EM;function NM(e){return new Error(`Fatal: Expected either errors or configurations for the path ${e}" but received neither".`)}F.invalidConfigurationResultFatalError=NM;function gM(e,t,n){return` Expected "${e}" to be type ${t} but received "${n}".`}F.unexpectedParentKindErrorMessage=gM;function IM(e,t){return new Error(`The subgraph "${e}" could not be federated for the following reason`+(t.length>1?"s":"")+`: `+t.map(n=>n.message).join(` -`))}P.subgraphValidationError=sV;P.subgraphValidationFailureError=new Error(" Fatal: Subgraph validation did not return a valid AST.");function aV(e,t){return`The ${(0,Up.numberToOrdinal)(e+1)} subgraph in the array did not define a name. Consequently, any further errors will temporarily identify this subgraph as "${t}".`}P.invalidSubgraphNameErrorMessage=aV;function uV(e,t,n){return new Error(`The schema definition defines the "${e}" operation as type "${t}". However, "${t}" was also used for the "${n}" operation. - If explicitly defined, each operation type must be a unique and valid Object type.`)}P.invalidOperationTypeDefinitionError=uV;function cV(e,t,n){return new Error(`The schema definition defines the "${e}" operation as type "${t}". However, the schema also defines another type named "${n}", which is the default (root) type name for the "${e}" operation. -For federation, it is only possible to use the default root types names ("Mutation", "Query", "Subscription") as operation definitions. No other definitions with these default root type names are valid.`)}P.invalidRootTypeDefinitionError=cV;function lV(e){let t="The subgraph has syntax errors and could not be parsed.";return e&&(t+=` - The reason provided was: `+e.message),new Error(t)}P.subgraphInvalidSyntaxError=lV;function pV(e,t,n){let r=[];for(let[i,o]of n){let s=` The implementation of interface "${i}" by "${e}" is invalid because: -`,a=o.unimplementedFields.length;a&&(s+=` The following field${a>1?"s are":" is"} not implemented: "`+o.unimplementedFields.join('", "')+`" -`);for(let[c,u]of o.invalidFieldImplementations){let l=u.unimplementedArguments.size,p=u.invalidImplementedArguments.length,h=u.invalidAdditionalArguments.size;if(s+=` The field "${c}" is invalid because: -`,l&&(s+=` The following argument${l>1?"s are":" is"} not implemented: "`+[...u.unimplementedArguments].join('", "')+`" -`),p){s+=` The following implemented argument${p>1?"s are":" is"} invalid: -`;for(let y of u.invalidImplementedArguments)s+=` The argument "${y.argumentName}" must define type "`+y.expectedType+`" and not "${y.actualType}" -`}h&&(s+=` If a field from an interface is implemented, any additional arguments that were not defined on the original interface field must be optional (nullable). -`,s+=" The following additional argument"+(u.invalidAdditionalArguments.size>1?"s are":" is")+' not defined as optional: "'+[...u.invalidAdditionalArguments].join('", "')+`" -`),u.implementedResponseType&&(s+=` The implemented response type "${u.implementedResponseType}" is not a valid subset (equally or more restrictive) of the response type "`+u.originalResponseType+`" for "${i}.${c}".`)}r.push(s)}return new Error(`The ${t} "${e}" has the following interface implementation errors: +`))}F.subgraphValidationError=IM;F.subgraphValidationFailureError=new Error(" Fatal: Subgraph validation did not return a valid AST.");function vM(e,t){return`The ${(0,Zl.numberToOrdinal)(e+1)} subgraph in the array did not define a name. Consequently, any further errors will temporarily identify this subgraph as "${t}".`}F.invalidSubgraphNameErrorMessage=vM;function _M(e,t,n){return new Error(`The schema definition defines the "${e}" operation as type "${t}". However, "${t}" was also used for the "${n}" operation. + If explicitly defined, each operation type must be a unique and valid Object type.`)}F.invalidOperationTypeDefinitionError=_M;function bM(e,t,n){return new Error(`The schema definition defines the "${e}" operation as type "${t}". However, the schema also defines another type named "${n}", which is the default (root) type name for the "${e}" operation. +For federation, it is only possible to use the default root types names ("Mutation", "Query", "Subscription") as operation definitions. No other definitions with these default root type names are valid.`)}F.invalidRootTypeDefinitionError=bM;function SM(e){let t="The subgraph has syntax errors and could not be parsed.";return e&&(t+=` + The reason provided was: `+e.message),new Error(t)}F.subgraphInvalidSyntaxError=SM;function DM(e,t,n){let r=[];for(let[i,s]of n){let o=` The implementation of interface "${i}" by "${e}" is invalid because: +`,a=s.unimplementedFields.length;a&&(o+=` The following field${a>1?"s are":" is"} not implemented: "`+s.unimplementedFields.join('", "')+`" +`);for(let[u,c]of s.invalidFieldImplementations){let l=c.unimplementedArguments.size,m=c.invalidImplementedArguments.length,h=c.invalidAdditionalArguments.size;if(o+=` The field "${u}" is invalid because: +`,l&&(o+=` The following argument${l>1?"s are":" is"} not implemented: "`+[...c.unimplementedArguments].join('", "')+`" +`),m){o+=` The following implemented argument${m>1?"s are":" is"} invalid: +`;for(let E of c.invalidImplementedArguments)o+=` The argument "${E.argumentName}" must define type "`+E.expectedType+`" and not "${E.actualType}" +`}h&&(o+=` If a field from an interface is implemented, any additional arguments that were not defined on the original interface field must be optional (nullable). +`,o+=" The following additional argument"+(c.invalidAdditionalArguments.size>1?"s are":" is")+' not defined as optional: "'+[...c.invalidAdditionalArguments].join('", "')+`" +`),c.implementedResponseType&&(o+=` The implemented response type "${c.implementedResponseType}" is not a valid subset (equally or more restrictive) of the response type "`+c.originalResponseType+`" for "${i}.${u}".`)}r.push(o)}return new Error(`The ${t} "${e}" has the following interface implementation errors: `+r.join(` -`))}P.unimplementedInterfaceFieldsError=pV;function dV(e,t,n){let r=`The ${e} "${t}" could not be federated because: +`))}F.unimplementedInterfaceFieldsError=DM;function OM(e,t,n){let r=`The ${e} "${t}" could not be federated because: `;for(let i of n)r+=` The argument "${i.argumentName}" is required in the following subgraph`+(i.requiredSubgraphs.length>1?"s":"")+': "'+i.requiredSubgraphs.join('", "')+`" However, the argument "${i.argumentName}" is not defined in the following subgraph`+(i.missingSubgraphs.length>1?"s":"")+': "'+i.missingSubgraphs.join('", "')+`" If an argument is required on a ${e} in any one subgraph, it must be at least defined as optional on all other definitions of that ${e} in all other subgraphs. -`;return new Error(r)}P.invalidRequiredArgumentsError=dV;function fV(e,t){return new Error(`The field "${e}" is invalid because: +`;return new Error(r)}F.invalidRequiredArgumentsError=OM;function AM(e,t){return new Error(`The field "${e}" is invalid because: The following argument`+(t.length>1?"s are":" is")+' defined more than once: "'+t.join('", "')+`" -`)}P.duplicateArgumentsError=fV;function mV(e,t){let n=`The field "${e}" is invalid because: +`)}F.duplicateArgumentsError=AM;function wM(e,t){let n=`The field "${e}" is invalid because: The named type (root type) of an input must be on of Enum, Input Object, or Scalar type. For example: "Float", "[[String!]]!", or "[SomeInputObjectName]" `;for(let r of t)n+=` The argument "${r.argumentName}" defines type "${r.typeName}" but the named type "${r.namedType}" is type "`+r.typeString+`", which is not a valid input type. -`;return new Error(n)}P.invalidArgumentsError=mV;P.noQueryRootTypeError=new Error(`A valid federated graph must have at least one populated query root type. +`;return new Error(n)}F.invalidArgumentsError=wM;F.noQueryRootTypeError=new Error(`A valid federated graph must have at least one populated query root type. For example: type Query { dummy: String - }`);function hV(e,t){return new Error(`Expected the path "${e}" to have the response type Enum, Interface, Object, Scalar, or Union but received ${t}.`)}P.unexpectedObjectResponseType=hV;function yV(e,t){return new Error(`Expected ${e} "${t}" to define at least one `+(e===sa.UNION?"member":"object that implements the interface")+" but received none")}P.noConcreteTypesForAbstractTypeError=yV;function TV(e){return new Error(`Expected object "${e}" to define a "key" directive, but it defines no directives.`)}P.expectedEntityError=TV;P.inlineFragmentInFieldSetErrorMessage=" Inline fragments are not currently supported within a FieldSet argument.";function EV(e,t,n,r){return` The following FieldSet is invalid: + }`);function FM(e,t){return new Error(`Expected the path "${e}" to have the response type Enum, Interface, Object, Scalar, or Union but received ${t}.`)}F.unexpectedObjectResponseType=FM;function LM(e,t){return new Error(`Expected ${e} "${t}" to define at least one `+(e===So.UNION?"member":"object that implements the interface")+" but received none")}F.noConcreteTypesForAbstractTypeError=LM;function RM(e){return new Error(`Expected object "${e}" to define a "key" directive, but it defines no directives.`)}F.expectedEntityError=RM;F.inlineFragmentInFieldSetErrorMessage=" Inline fragments are not currently supported within a FieldSet argument.";function kM(e,t,n,r){return` The following FieldSet is invalid: "${e}" This is because "${t}" returns "${n}", which is type "${r}". - Fields that return abstract types (interfaces and unions) cannot be included in the FieldSet of "@key" directives.`}P.abstractTypeInKeyFieldSetErrorMessage=EV;function NV(e,t,n){return` The following FieldSet is invalid: + Fields that return abstract types (interfaces and unions) cannot be included in the FieldSet of "@key" directives.`}F.abstractTypeInKeyFieldSetErrorMessage=kM;function xM(e,t,n){return` The following FieldSet is invalid: "${e}" - This is because "${t}" returns the unknown type "${n}".`}P.unknownTypeInFieldSetErrorMessage=NV;function gV(e,t,n,r){return` The following FieldSet is invalid: + This is because "${t}" returns the unknown type "${n}".`}F.unknownTypeInFieldSetErrorMessage=xM;function PM(e,t,n,r){return` The following FieldSet is invalid: "${e}" This is because "${t}" returns "${n}", which is type "${r}". - Types such as "${r}" that define fields must define a selection set with at least one field selection.`}P.invalidSelectionSetErrorMessage=gV;function vV(e,t,n,r){return` The following FieldSet is invalid: + Types such as "${r}" that define fields must define a selection set with at least one field selection.`}F.invalidSelectionSetErrorMessage=PM;function MM(e,t,n,r){return` The following FieldSet is invalid: "${e}" This is because "${t}" returns "${n}", which is type "${r}". - Types such as "${r}" that do not define fields cannot define a selection set.`}P.invalidSelectionSetDefinitionErrorMessage=vV;function IV(e,t,n){return` The following FieldSet is invalid: + Types such as "${r}" that do not define fields cannot define a selection set.`}F.invalidSelectionSetDefinitionErrorMessage=MM;function UM(e,t,n){return` The following FieldSet is invalid: "${e}" - This is because "${t}" does not define a field named "${n}".`}P.undefinedFieldInFieldSetErrorMessage=IV;function bV(e,t){let n=` The following FieldSet is invalid: + This is because "${t}" does not define a field named "${n}".`}F.undefinedFieldInFieldSetErrorMessage=UM;function CM(e,t){let n=` The following FieldSet is invalid: "${e}" The FieldSet could not be parsed.`;return t&&(n+=` - The reason provided was: `+t.message),n}P.unparsableFieldSetErrorMessage=bV;function _V(e,t){return` The following FieldSet is invalid: + The reason provided was: `+t.message),n}F.unparsableFieldSetErrorMessage=CM;function BM(e,t){return` The following FieldSet is invalid: "${e}" - This is because the selection set defined on "${t}" could not be parsed.`}P.unparsableFieldSetSelectionErrorMessage=_V;function OV(e){return new Error(` Expected an object/interface or object/interface extension named "${e}" to exist.`)}P.undefinedObjectLikeParentError=OV;function SV(e,t,n){return` The following FieldSet is invalid: + This is because the selection set defined on "${t}" could not be parsed.`}F.unparsableFieldSetSelectionErrorMessage=BM;function $M(e){return new Error(` Expected an object/interface or object/interface extension named "${e}" to exist.`)}F.undefinedObjectLikeParentError=$M;function VM(e,t,n){return` The following FieldSet is invalid: "${e}" - This is because "${t}" does not define an argument named "${n}".`}P.unexpectedArgumentErrorMessage=SV;function DV(e,t){return` The following FieldSet is invalid: + This is because "${t}" does not define an argument named "${n}".`}F.unexpectedArgumentErrorMessage=VM;function jM(e,t){return` The following FieldSet is invalid: "${e}" This is because "${t}" defines arguments. - Fields that define arguments cannot be included in the FieldSet of @key directives.`}P.argumentsInKeyFieldSetErrorMessage=DV;function AV(e,t){return new Error(`The following "${e}" directive`+(t.length>1?"s are":" is")+` invalid: + Fields that define arguments cannot be included in the FieldSet of @key directives.`}F.argumentsInKeyFieldSetErrorMessage=jM;function GM(e,t){return new Error(`The following "${e}" directive`+(t.length>1?"s are":" is")+` invalid: `+t.join(` -`))}P.invalidProvidesOrRequiresDirectivesError=AV;function wV(e,t){return` The following FieldSet is invalid: +`))}F.invalidProvidesOrRequiresDirectivesError=GM;function qM(e,t){return` The following FieldSet is invalid: "${e}" - This is because "${t}" was included in the FieldSet more than once.`}P.duplicateFieldInFieldSetErrorMessage=wV;function RV(e,t){return` A @provides directive is declared on "${e}". - However, the response type "${t}" object or object extension definition was not found.`}P.unknownProvidesEntityErrorMessage=RV;function LV(e,t,n,r){return` The following FieldSet is invalid: + This is because "${t}" was included in the FieldSet more than once.`}F.duplicateFieldInFieldSetErrorMessage=qM;function KM(e,t){return` A @provides directive is declared on "${e}". + However, the response type "${t}" object or object extension definition was not found.`}F.unknownProvidesEntityErrorMessage=KM;function QM(e,t,n,r){return` The following FieldSet is invalid: "${e}" This is because "${t}" defines an inline fragment with the type condition "${n}". However, "${r}" is not an abstract (interface or union) type. - Consequently, the only valid type condition would be "${r}".`}P.invalidInlineFragmentTypeErrorMessage=LV;function FV(e,t){return` The following FieldSet is invalid: + Consequently, the only valid type condition would be "${r}".`}F.invalidInlineFragmentTypeErrorMessage=QM;function YM(e,t){return` The following FieldSet is invalid: "${e}" - This is because "${t}" defines an inline fragment without a type condition.`}P.inlineFragmentWithoutTypeConditionErrorMessage=FV;function kV(e,t,n){return` The following FieldSet is invalid: + This is because "${t}" defines an inline fragment without a type condition.`}F.inlineFragmentWithoutTypeConditionErrorMessage=YM;function JM(e,t,n){return` The following FieldSet is invalid: "${e}" - This is because "${t}" defines an inline fragment with the unknown type condition "${n}".`}P.unknownInlineFragmentTypeConditionErrorMessage=kV;function PV(e,t,n,r){return` The following FieldSet is invalid: + This is because "${t}" defines an inline fragment with the unknown type condition "${n}".`}F.unknownInlineFragmentTypeConditionErrorMessage=JM;function zM(e,t,n,r){return` The following FieldSet is invalid: "${e}" This is because "${t}" defines an inline fragment with the type condition "${n}", which is type "${r}". - However, either an "interface" or "object" type was expected.`}P.invalidInlineFragmentTypeConditionTypeErrorMessage=PV;function xV(e,t,n,r,i){let o=` The following FieldSet is invalid: + However, either an "interface" or "object" type was expected.`}F.invalidInlineFragmentTypeConditionTypeErrorMessage=zM;function XM(e,t,n,r,i){let s=` The following FieldSet is invalid: "${e}" This is because "${t}" defines an inline fragment with the type condition "${n}". -`;return r==="interface"?o+` However, "${n}" does not implement "${i}"`:o+` However, "${n}" is not a member of the union "${i}".`}P.invalidInlineFragmentTypeConditionErrorMessage=xV;function CV(e,t,n){return` The following FieldSet is invalid: +`;return r==="interface"?s+` However, "${n}" does not implement "${i}"`:s+` However, "${n}" is not a member of the union "${i}".`}F.invalidInlineFragmentTypeConditionErrorMessage=XM;function HM(e,t,n){return` The following FieldSet is invalid: "${e}" This is because "${t}" returns "${n}", which is type "union". - Consequently, an inline fragment is required to make a selection on one of the union's members.`}P.invalidSelectionOnUnionErrorMessage=CV;function MV(e,t){return` The field "${e}" declares an @override directive in the following subgraphs: "`+t.join(sa.QUOTATION_JOIN)+'".'}P.duplicateOverriddenFieldErrorMessage=MV;function UV(e){return new Error("The @override directive must only be declared on one single instance of a field. However, an @override directive was declared on more than one instance of the following field"+(e.length>1?"s":"")+': "'+e.join(sa.QUOTATION_JOIN)+`". -`)}P.duplicateOverriddenFieldsError=UV;function jV(e,t){return new Error(`The ${e} "${t}" is invalid because it does not define any fields.`)}P.noFieldDefinitionsError=jV;function VV(e,t){return new Error(`The ${e} "${t}" is invalid because all its field definitions are declared "@inaccessible".`)}P.allFieldDefinitionsAreInaccessibleError=VV;function $V(e,t){return new Error(`Cannot override field "${t}" because the source and target subgraph names are both "${e}"`)}P.equivalentSourceAndTargetOverrideError=$V;function GV(e,t){let n=`Federation was unsuccessful because any one subgraph that defines a specific entity interface must also define each and every entity object that implements that entity interface. -`;for(let[r,i]of e){let s=(0,Up.getOrThrowError)(t,r,"entityInterfaceFederationDataByTypeName").concreteTypeNames;n+=` Across all subgraphs, the entity interface "${r}" is implemented by the following entity object`+(s.size>1?"s":"")+`: - "`+Array.from(s).join(sa.QUOTATION_JOIN)+`" + Consequently, an inline fragment is required to make a selection on one of the union's members.`}F.invalidSelectionOnUnionErrorMessage=HM;function WM(e,t){return` The field "${e}" declares an @override directive in the following subgraphs: "`+t.join(So.QUOTATION_JOIN)+'".'}F.duplicateOverriddenFieldErrorMessage=WM;function ZM(e){return new Error("The @override directive must only be declared on one single instance of a field. However, an @override directive was declared on more than one instance of the following field"+(e.length>1?"s":"")+': "'+e.join(So.QUOTATION_JOIN)+`". +`)}F.duplicateOverriddenFieldsError=ZM;function eU(e,t){return new Error(`The ${e} "${t}" is invalid because it does not define any fields.`)}F.noFieldDefinitionsError=eU;function tU(e,t){return new Error(`The ${e} "${t}" is invalid because all its field definitions are declared "@inaccessible".`)}F.allFieldDefinitionsAreInaccessibleError=tU;function nU(e,t){return`Cannot override field "${t}" because the source and target subgraph names are both "${e}"`}F.equivalentSourceAndTargetOverrideErrorMessage=nU;function rU(e,t){let n=`Federation was unsuccessful because any one subgraph that defines a specific entity interface must also define each and every entity object that implements that entity interface. +`;for(let[r,i]of e){let o=(0,Zl.getOrThrowError)(t,r,"entityInterfaceFederationDataByTypeName").concreteTypeNames;n+=` Across all subgraphs, the entity interface "${r}" is implemented by the following entity object`+(o.size>1?"s":"")+`: + "`+Array.from(o).join(So.QUOTATION_JOIN)+`" However, the definition of at least one of these implementations is missing in a subgraph that defines the entity interface "${r}": -`;for(let{subgraphName:a,concreteTypeNames:c}of i){let u=(0,Up.getEntriesNotInHashSet)(s,c);n+=` Subgraph "${a}" does not define the following implementations: "`+u.join(sa.QUOTATION_JOIN)+`" -`}}return new Error(n)}P.undefinedEntityInterfaceImplementationsError=GV;function qV(e,t){return new Error(`The maximum number of OR scopes that can be defined by @requiresScopes on a single field is ${e}. However, the following path`+(t.length>1?"s attempt":" attempts")+` to define more: - "`+t.join(sa.QUOTATION_JOIN)+`" -If you require more, please contact support.`)}P.orScopesLimitError=qV});var Vp=F(Rt=>{"use strict";d();m();f();Object.defineProperty(Rt,"__esModule",{value:!0});Rt.unionTypeDefinitionNodeToMutable=Rt.maximumTypeNesting=Rt.scalarTypeDefinitionNodeToMutable=Rt.objectTypeExtensionNodeToMutableDefinitionNode=Rt.objectTypeExtensionNodeToMutable=Rt.objectTypeDefinitionNodeToMutable=Rt.interfaceTypeDefinitionNodeToMutable=Rt.inputValueDefinitionNodeToMutable=Rt.inputObjectTypeDefinitionNodeToMutable=Rt.fieldDefinitionNodeToMutable=Rt.enumValueDefinitionNodeToMutable=Rt.enumTypeDefinitionNodeToMutable=Rt.directiveDefinitionNodeToMutable=Rt.deepCopyTypeNode=void 0;var jp=(he(),Te(Ie)),BV=Yo(),to=eo();function Am(e,t,n){if(e.fields)for(let r of e.fields)t.push(JD(r,e.name.value));if(e.interfaces)for(let r of e.interfaces)n.push(D({},r))}function XN(e,t,n){let r={kind:e.kind},i=r;for(let o=0;o0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return e}function e$(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function ZD(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=e$.bind(r);return i.listener=n,r.wrapFn=i,i}function eA(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?function(o){for(var s=new Array(o.length),a=0;a{"use strict";d();m();f();lc=typeof Reflect=="object"?Reflect:null,zD=lc&&typeof lc.apply=="function"?lc.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};rA=lc&&typeof lc.ownKeys=="function"?lc.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};XD=Number.isNaN||function(e){return e!=e};nA=jt,jt.EventEmitter=jt,jt.prototype._events=void 0,jt.prototype._eventsCount=0,jt.prototype._maxListeners=void 0;HD=10;Object.defineProperty(jt,"defaultMaxListeners",{enumerable:!0,get:function(){return HD},set:function(e){if(typeof e!="number"||e<0||XD(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");HD=e}}),jt.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},jt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||XD(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},jt.prototype.getMaxListeners=function(){return iA(this)},jt.prototype.emit=function(e){for(var t=[],n=1;n0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=i[e];if(a===void 0)return!1;if(typeof a=="function")zD(a,this,t);else{var c=a.length,u=oA(a,c);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;i===0?n.shift():function(a,c){for(;c+1=0;r--)this.removeListener(e,t[r]);return this},jt.prototype.listeners=function(e){return eA(this,e,!0)},jt.prototype.rawListeners=function(e){return eA(this,e,!1)},jt.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):tA.call(e,t)},jt.prototype.listenerCount=tA,jt.prototype.eventNames=function(){return this._eventsCount>0?rA(this._events):[]};Yr=nA;Yr.EventEmitter;Yr.defaultMaxListeners;Yr.init;Yr.listenerCount;Yr.EventEmitter;Yr.defaultMaxListeners;Yr.init;Yr.listenerCount});var sA,Xfe,Hfe,Wfe,Zfe,eme,aA=Y(()=>{"use strict";d();m();f();WN();WN();Yr.once=function(e,t){return new Promise((n,r)=>{function i(...s){o!==void 0&&e.removeListener("error",o),n(s)}let o;t!=="error"&&(o=s=>{e.removeListener(name,i),r(s)},e.once("error",o)),e.once(t,i)})};Yr.on=function(e,t){let n=[],r=[],i=null,o=!1,s={next(){return Wt(this,null,function*(){let l=n.shift();if(l)return createIterResult(l,!1);if(i){let p=Promise.reject(i);return i=null,p}return o?createIterResult(void 0,!0):new Promise((p,h)=>r.push({resolve:p,reject:h}))})},return(){return Wt(this,null,function*(){e.removeListener(t,a),e.removeListener("error",c),o=!0;for(let l of r)l.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)})},throw(l){i=l,e.removeListener(t,a),e.removeListener("error",c)},[Symbol.asyncIterator](){return this}};return e.on(t,a),e.on("error",c),s;function a(...l){let p=r.shift();p?p.resolve(createIterResult(l,!1)):n.push(l)}function c(l){o=!0;let p=r.shift();p?p.reject(l):i=l,s.return()}};({EventEmitter:sA,defaultMaxListeners:Xfe,init:Hfe,listenerCount:Wfe,on:Zfe,once:eme}=Yr)});var Rm=F((ame,uA)=>{"use strict";d();m();f();function no(e){if(typeof e!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=e}typeof Symbol!="undefined"&&(no.prototype[Symbol.iterator]=function(){return this});no.of=function(){var e=arguments,t=e.length,n=0;return new no(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})};no.empty=function(){var e=new no(function(){return{done:!0}});return e};no.fromSequence=function(e){var t=0,n=e.length;return new no(function(){return t>=n?{done:!0}:{done:!1,value:e[t++]}})};no.is=function(e){return e instanceof no?!0:typeof e=="object"&&e!==null&&typeof e.next=="function"};uA.exports=no});var cA=F(ZN=>{"use strict";d();m();f();ZN.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer!="undefined";ZN.SYMBOL_SUPPORT=typeof Symbol!="undefined"});var eg=F((hme,pA)=>{"use strict";d();m();f();var t$=Rm(),lA=cA(),n$=lA.ARRAY_BUFFER_SUPPORT,r$=lA.SYMBOL_SUPPORT;function i$(e){return typeof e=="string"||Array.isArray(e)||n$&&ArrayBuffer.isView(e)?t$.fromSequence(e):typeof e!="object"||e===null?null:r$&&typeof e[Symbol.iterator]=="function"?e[Symbol.iterator]():typeof e.next=="function"?e:null}pA.exports=function(t){var n=i$(t);if(!n)throw new Error("obliterator: target is not iterable nor a valid iterator.");return n}});var fA=F((Nme,dA)=>{"use strict";d();m();f();var o$=eg();dA.exports=function(t,n){for(var r=arguments.length>1?n:1/0,i=r!==1/0?new Array(r):[],o,s=0,a=o$(t);;){if(s===r)return i;if(o=a.next(),o.done)return s!==n&&(i.length=s),i;i[s++]=o.value}}});var hA=F((bme,mA)=>{"use strict";d();m();f();var s$=Rm(),a$=eg();mA.exports=function(){var t=arguments,n=null,r=-1;return new s$(function(){var o=null;do{if(n===null){if(r++,r>=t.length)return{done:!0};n=a$(t[r])}if(o=n.next(),o.done===!0){n=null;continue}break}while(!0);return o})}});var AA={};ml(AA,{DirectedGraph:()=>Bp,Graph:()=>Gt,InvalidArgumentsGraphError:()=>de,MultiDirectedGraph:()=>Yp,MultiGraph:()=>Qp,MultiUndirectedGraph:()=>Jp,NotFoundGraphError:()=>se,UndirectedGraph:()=>Kp,UsageGraphError:()=>je,default:()=>Gt});function u$(){let e=arguments[0];for(let t=1,n=arguments.length;te++}function gA(e,t){this.key=e,this.attributes=t,this.clear()}function vA(e,t){this.key=e,this.attributes=t,this.clear()}function IA(e,t){this.key=e,this.attributes=t,this.clear()}function dc(e,t,n,r,i){this.key=t,this.attributes=i,this.undirected=e,this.source=n,this.target=r}function Jo(e,t,n,r,i,o,s){let a,c,u,l;if(r=""+r,n===bA){if(a=e._nodes.get(r),!a)throw new se(`Graph.${t}: could not find the "${r}" node in the graph.`);u=i,l=o}else if(n===OA){if(i=""+i,c=e._edges.get(i),!c)throw new se(`Graph.${t}: could not find the "${i}" edge in the graph.`);let p=c.source.key,h=c.target.key;if(r===p)a=c.target;else if(r===h)a=c.source;else throw new se(`Graph.${t}: the "${r}" node is not attached to the "${i}" edge (${p}, ${h}).`);u=o,l=s}else{if(c=e._edges.get(r),!c)throw new se(`Graph.${t}: could not find the "${r}" edge in the graph.`);n===_A?a=c.source:a=c.target,u=i,l=o}return[a,u,l]}function p$(e,t,n){e.prototype[t]=function(r,i,o){let[s,a]=Jo(this,t,n,r,i,o);return s.attributes[a]}}function d$(e,t,n){e.prototype[t]=function(r,i){let[o]=Jo(this,t,n,r,i);return o.attributes}}function f$(e,t,n){e.prototype[t]=function(r,i,o){let[s,a]=Jo(this,t,n,r,i,o);return s.attributes.hasOwnProperty(a)}}function m$(e,t,n){e.prototype[t]=function(r,i,o,s){let[a,c,u]=Jo(this,t,n,r,i,o,s);return a.attributes[c]=u,this.emit("nodeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:c}),this}}function h$(e,t,n){e.prototype[t]=function(r,i,o,s){let[a,c,u]=Jo(this,t,n,r,i,o,s);if(typeof u!="function")throw new de(`Graph.${t}: updater should be a function.`);let l=a.attributes,p=u(l[c]);return l[c]=p,this.emit("nodeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:c}),this}}function y$(e,t,n){e.prototype[t]=function(r,i,o){let[s,a]=Jo(this,t,n,r,i,o);return delete s.attributes[a],this.emit("nodeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:a}),this}}function T$(e,t,n){e.prototype[t]=function(r,i,o){let[s,a]=Jo(this,t,n,r,i,o);if(!Hn(a))throw new de(`Graph.${t}: provided attributes are not a plain object.`);return s.attributes=a,this.emit("nodeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function E$(e,t,n){e.prototype[t]=function(r,i,o){let[s,a]=Jo(this,t,n,r,i,o);if(!Hn(a))throw new de(`Graph.${t}: provided attributes are not a plain object.`);return Ln(s.attributes,a),this.emit("nodeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:a}),this}}function N$(e,t,n){e.prototype[t]=function(r,i,o){let[s,a]=Jo(this,t,n,r,i,o);if(typeof a!="function")throw new de(`Graph.${t}: provided updater is not a function.`);return s.attributes=a(s.attributes),this.emit("nodeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}function v$(e){g$.forEach(function({name:t,attacher:n}){n(e,t("Node"),bA),n(e,t("Source"),_A),n(e,t("Target"),l$),n(e,t("Opposite"),OA)})}function I$(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new je(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new je(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let s=""+r,a=""+i;if(i=arguments[2],o=ai(this,s,a,n),!o)throw new se(`Graph.${t}: could not find an edge for the given path ("${s}" - "${a}").`)}else{if(n!=="mixed")throw new je(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new se(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return o.attributes[i]}}function b$(e,t,n){e.prototype[t]=function(r){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new je(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new je(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=""+r,s=""+arguments[1];if(i=ai(this,o,s,n),!i)throw new se(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!=="mixed")throw new je(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new se(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return i.attributes}}function _$(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new je(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new je(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let s=""+r,a=""+i;if(i=arguments[2],o=ai(this,s,a,n),!o)throw new se(`Graph.${t}: could not find an edge for the given path ("${s}" - "${a}").`)}else{if(n!=="mixed")throw new je(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new se(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return o.attributes.hasOwnProperty(i)}}function O$(e,t,n){e.prototype[t]=function(r,i,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new je(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new je(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=""+r,c=""+i;if(i=arguments[2],o=arguments[3],s=ai(this,a,c,n),!s)throw new se(`Graph.${t}: could not find an edge for the given path ("${a}" - "${c}").`)}else{if(n!=="mixed")throw new je(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new se(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return s.attributes[i]=o,this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:i}),this}}function S$(e,t,n){e.prototype[t]=function(r,i,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new je(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new je(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=""+r,c=""+i;if(i=arguments[2],o=arguments[3],s=ai(this,a,c,n),!s)throw new se(`Graph.${t}: could not find an edge for the given path ("${a}" - "${c}").`)}else{if(n!=="mixed")throw new je(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new se(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof o!="function")throw new de(`Graph.${t}: updater should be a function.`);return s.attributes[i]=o(s.attributes[i]),this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:i}),this}}function D$(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new je(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new je(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let s=""+r,a=""+i;if(i=arguments[2],o=ai(this,s,a,n),!o)throw new se(`Graph.${t}: could not find an edge for the given path ("${s}" - "${a}").`)}else{if(n!=="mixed")throw new je(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new se(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return delete o.attributes[i],this.emit("edgeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:i}),this}}function A$(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new je(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new je(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let s=""+r,a=""+i;if(i=arguments[2],o=ai(this,s,a,n),!o)throw new se(`Graph.${t}: could not find an edge for the given path ("${s}" - "${a}").`)}else{if(n!=="mixed")throw new je(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new se(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!Hn(i))throw new de(`Graph.${t}: provided attributes are not a plain object.`);return o.attributes=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}function w$(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new je(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new je(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let s=""+r,a=""+i;if(i=arguments[2],o=ai(this,s,a,n),!o)throw new se(`Graph.${t}: could not find an edge for the given path ("${s}" - "${a}").`)}else{if(n!=="mixed")throw new je(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new se(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!Hn(i))throw new de(`Graph.${t}: provided attributes are not a plain object.`);return Ln(o.attributes,i),this.emit("edgeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:i}),this}}function R$(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new je(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new je(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let s=""+r,a=""+i;if(i=arguments[2],o=ai(this,s,a,n),!o)throw new se(`Graph.${t}: could not find an edge for the given path ("${s}" - "${a}").`)}else{if(n!=="mixed")throw new je(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new se(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof i!="function")throw new de(`Graph.${t}: provided updater is not a function.`);return o.attributes=i(o.attributes),this.emit("edgeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}function F$(e){L$.forEach(function({name:t,attacher:n}){n(e,t("Edge"),"mixed"),n(e,t("DirectedEdge"),"directed"),n(e,t("UndirectedEdge"),"undirected")})}function P$(e,t,n,r){let i=!1;for(let o in t){if(o===r)continue;let s=t[o];if(i=n(s.key,s.attributes,s.source.key,s.target.key,s.source.attributes,s.target.attributes,s.undirected),e&&i)return s.key}}function x$(e,t,n,r){let i,o,s,a=!1;for(let c in t)if(c!==r){i=t[c];do{if(o=i.source,s=i.target,a=n(i.key,i.attributes,o.key,s.key,o.attributes,s.attributes,i.undirected),e&&a)return i.key;i=i.next}while(i!==void 0)}}function tg(e,t){let n=Object.keys(e),r=n.length,i,o=0;return new Jr.default(function(){do if(i)i=i.next;else{if(o>=r)return{done:!0};let a=n[o++];if(a===t){i=void 0;continue}i=e[a]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}})}function C$(e,t,n,r){let i=t[n];if(!i)return;let o=i.source,s=i.target;if(r(i.key,i.attributes,o.key,s.key,o.attributes,s.attributes,i.undirected)&&e)return i.key}function M$(e,t,n,r){let i=t[n];if(!i)return;let o=!1;do{if(o=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&o)return i.key;i=i.next}while(i!==void 0)}function ng(e,t){let n=e[t];return n.next!==void 0?new Jr.default(function(){if(!n)return{done:!0};let r={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:r}}):Jr.default.of({edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected})}function U$(e,t){if(e.size===0)return[];if(t==="mixed"||t===e.type)return typeof Array.from=="function"?Array.from(e._edges.keys()):(0,rg.default)(e._edges.keys(),e._edges.size);let n=t==="undirected"?e.undirectedSize:e.directedSize,r=new Array(n),i=t==="undirected",o=e._edges.values(),s=0,a,c;for(;a=o.next(),a.done!==!0;)c=a.value,c.undirected===i&&(r[s++]=c.key);return r}function SA(e,t,n,r){if(t.size===0)return;let i=n!=="mixed"&&n!==t.type,o=n==="undirected",s,a,c=!1,u=t._edges.values();for(;s=u.next(),s.done!==!0;){if(a=s.value,i&&a.undirected!==o)continue;let{key:l,attributes:p,source:h,target:y}=a;if(c=r(l,p,h.key,y.key,h.attributes,y.attributes,a.undirected),e&&c)return l}}function j$(e,t){if(e.size===0)return Jr.default.empty();let n=t!=="mixed"&&t!==e.type,r=t==="undirected",i=e._edges.values();return new Jr.default(function(){let s,a;for(;;){if(s=i.next(),s.done)return s;if(a=s.value,!(n&&a.undirected!==r))break}return{value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.undirected},done:!1}})}function ig(e,t,n,r,i,o){let s=t?x$:P$,a;if(n!=="undirected"&&(r!=="out"&&(a=s(e,i.in,o),e&&a)||r!=="in"&&(a=s(e,i.out,o,r?void 0:i.key),e&&a))||n!=="directed"&&(a=s(e,i.undirected,o),e&&a))return a}function V$(e,t,n,r){let i=[];return ig(!1,e,t,n,r,function(o){i.push(o)}),i}function $$(e,t,n){let r=Jr.default.empty();return e!=="undirected"&&(t!=="out"&&typeof n.in!="undefined"&&(r=(0,ro.default)(r,tg(n.in))),t!=="in"&&typeof n.out!="undefined"&&(r=(0,ro.default)(r,tg(n.out,t?void 0:n.key)))),e!=="directed"&&typeof n.undirected!="undefined"&&(r=(0,ro.default)(r,tg(n.undirected))),r}function og(e,t,n,r,i,o,s){let a=n?M$:C$,c;if(t!=="undirected"&&(typeof i.in!="undefined"&&r!=="out"&&(c=a(e,i.in,o,s),e&&c)||typeof i.out!="undefined"&&r!=="in"&&(r||i.key!==o)&&(c=a(e,i.out,o,s),e&&c))||t!=="directed"&&typeof i.undirected!="undefined"&&(c=a(e,i.undirected,o,s),e&&c))return c}function G$(e,t,n,r,i){let o=[];return og(!1,e,t,n,r,i,function(s){o.push(s)}),o}function q$(e,t,n,r){let i=Jr.default.empty();return e!=="undirected"&&(typeof n.in!="undefined"&&t!=="out"&&r in n.in&&(i=(0,ro.default)(i,ng(n.in,r))),typeof n.out!="undefined"&&t!=="in"&&r in n.out&&(t||n.key!==r)&&(i=(0,ro.default)(i,ng(n.out,r)))),e!=="directed"&&typeof n.undirected!="undefined"&&r in n.undirected&&(i=(0,ro.default)(i,ng(n.undirected,r))),i}function B$(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(o,s){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return U$(this,r);if(arguments.length===1){o=""+o;let a=this._nodes.get(o);if(typeof a=="undefined")throw new se(`Graph.${n}: could not find the "${o}" node in the graph.`);return V$(this.multi,r==="mixed"?this.type:r,i,a)}if(arguments.length===2){o=""+o,s=""+s;let a=this._nodes.get(o);if(!a)throw new se(`Graph.${n}: could not find the "${o}" source node in the graph.`);if(!this._nodes.has(s))throw new se(`Graph.${n}: could not find the "${s}" target node in the graph.`);return G$(r,this.multi,i,a,s)}throw new de(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function K$(e,t){let{name:n,type:r,direction:i}=t,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(u,l,p){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return p=u,SA(!1,this,r,p);if(arguments.length===2){u=""+u,p=l;let h=this._nodes.get(u);if(typeof h=="undefined")throw new se(`Graph.${o}: could not find the "${u}" node in the graph.`);return ig(!1,this.multi,r==="mixed"?this.type:r,i,h,p)}if(arguments.length===3){u=""+u,l=""+l;let h=this._nodes.get(u);if(!h)throw new se(`Graph.${o}: could not find the "${u}" source node in the graph.`);if(!this._nodes.has(l))throw new se(`Graph.${o}: could not find the "${l}" target node in the graph.`);return og(!1,r,this.multi,i,h,l,p)}throw new de(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};let s="map"+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(){let u=Array.prototype.slice.call(arguments),l=u.pop(),p;if(u.length===0){let h=0;r!=="directed"&&(h+=this.undirectedSize),r!=="undirected"&&(h+=this.directedSize),p=new Array(h);let y=0;u.push((N,O,w,M,W,K,te)=>{p[y++]=l(N,O,w,M,W,K,te)})}else p=[],u.push((h,y,N,O,w,M,W)=>{p.push(l(h,y,N,O,w,M,W))});return this[o].apply(this,u),p};let a="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[a]=function(){let u=Array.prototype.slice.call(arguments),l=u.pop(),p=[];return u.push((h,y,N,O,w,M,W)=>{l(h,y,N,O,w,M,W)&&p.push(h)}),this[o].apply(this,u),p};let c="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){let u=Array.prototype.slice.call(arguments);if(u.length<2||u.length>4)throw new de(`Graph.${c}: invalid number of arguments (expecting 2, 3 or 4 and got ${u.length}).`);if(typeof u[u.length-1]=="function"&&typeof u[u.length-2]!="function")throw new de(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let l,p;u.length===2?(l=u[0],p=u[1],u=[]):u.length===3?(l=u[1],p=u[2],u=[u[0]]):u.length===4&&(l=u[2],p=u[3],u=[u[0],u[1]]);let h=p;return u.push((y,N,O,w,M,W,K)=>{h=l(h,y,N,O,w,M,W,K)}),this[o].apply(this,u),h}}function Q$(e,t){let{name:n,type:r,direction:i}=t,o="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(c,u,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return l=c,SA(!0,this,r,l);if(arguments.length===2){c=""+c,l=u;let p=this._nodes.get(c);if(typeof p=="undefined")throw new se(`Graph.${o}: could not find the "${c}" node in the graph.`);return ig(!0,this.multi,r==="mixed"?this.type:r,i,p,l)}if(arguments.length===3){c=""+c,u=""+u;let p=this._nodes.get(c);if(!p)throw new se(`Graph.${o}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(u))throw new se(`Graph.${o}: could not find the "${u}" target node in the graph.`);return og(!0,r,this.multi,i,p,u,l)}throw new de(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};let s="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(){let c=Array.prototype.slice.call(arguments),u=c.pop();return c.push((p,h,y,N,O,w,M)=>u(p,h,y,N,O,w,M)),!!this[o].apply(this,c)};let a="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(){let c=Array.prototype.slice.call(arguments),u=c.pop();return c.push((p,h,y,N,O,w,M)=>!u(p,h,y,N,O,w,M)),!this[o].apply(this,c)}}function Y$(e,t){let{name:n,type:r,direction:i}=t,o=n.slice(0,-1)+"Entries";e.prototype[o]=function(s,a){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Jr.default.empty();if(!arguments.length)return j$(this,r);if(arguments.length===1){s=""+s;let c=this._nodes.get(s);if(!c)throw new se(`Graph.${o}: could not find the "${s}" node in the graph.`);return $$(r,i,c)}if(arguments.length===2){s=""+s,a=""+a;let c=this._nodes.get(s);if(!c)throw new se(`Graph.${o}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(a))throw new se(`Graph.${o}: could not find the "${a}" target node in the graph.`);return q$(r,i,c,a)}throw new de(`Graph.${o}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function J$(e){k$.forEach(t=>{B$(e,t),K$(e,t),Q$(e,t),Y$(e,t)})}function Fm(){this.A=null,this.B=null}function $p(e,t,n,r,i){for(let o in r){let s=r[o],a=s.source,c=s.target,u=a===n?c:a;if(t&&t.has(u.key))continue;let l=i(u.key,u.attributes);if(e&&l)return u.key}}function sg(e,t,n,r,i){if(t!=="mixed"){if(t==="undirected")return $p(e,null,r,r.undirected,i);if(typeof n=="string")return $p(e,null,r,r[n],i)}let o=new Fm,s;if(t!=="undirected"){if(n!=="out"){if(s=$p(e,null,r,r.in,i),e&&s)return s;o.wrap(r.in)}if(n!=="in"){if(s=$p(e,o,r,r.out,i),e&&s)return s;o.wrap(r.out)}}if(t!=="directed"&&(s=$p(e,o,r,r.undirected,i),e&&s))return s}function X$(e,t,n){if(e!=="mixed"){if(e==="undirected")return Object.keys(n.undirected);if(typeof t=="string")return Object.keys(n[t])}let r=[];return sg(!1,e,t,n,function(i){r.push(i)}),r}function Gp(e,t,n){let r=Object.keys(n),i=r.length,o=0;return new Jr.default(function(){let a=null;do{if(o>=i)return e&&e.wrap(n),{done:!0};let c=n[r[o++]],u=c.source,l=c.target;if(a=u===t?l:u,e&&e.has(a.key)){a=null;continue}}while(a===null);return{done:!1,value:{neighbor:a.key,attributes:a.attributes}}})}function H$(e,t,n){if(e!=="mixed"){if(e==="undirected")return Gp(null,n,n.undirected);if(typeof t=="string")return Gp(null,n,n[t])}let r=Jr.default.empty(),i=new Fm;return e!=="undirected"&&(t!=="out"&&(r=(0,ro.default)(r,Gp(i,n,n.in))),t!=="in"&&(r=(0,ro.default)(r,Gp(i,n,n.out)))),e!=="directed"&&(r=(0,ro.default)(r,Gp(i,n,n.undirected))),r}function W$(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(o){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];o=""+o;let s=this._nodes.get(o);if(typeof s=="undefined")throw new se(`Graph.${n}: could not find the "${o}" node in the graph.`);return X$(r==="mixed"?this.type:r,i,s)}}function Z$(e,t){let{name:n,type:r,direction:i}=t,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(u,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;u=""+u;let p=this._nodes.get(u);if(typeof p=="undefined")throw new se(`Graph.${o}: could not find the "${u}" node in the graph.`);sg(!1,r==="mixed"?this.type:r,i,p,l)};let s="map"+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(u,l){let p=[];return this[o](u,(h,y)=>{p.push(l(h,y))}),p};let a="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[a]=function(u,l){let p=[];return this[o](u,(h,y)=>{l(h,y)&&p.push(h)}),p};let c="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(u,l,p){if(arguments.length<3)throw new de(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let h=p;return this[o](u,(y,N)=>{h=l(h,y,N)}),h}}function eG(e,t){let{name:n,type:r,direction:i}=t,o=n[0].toUpperCase()+n.slice(1,-1),s="find"+o;e.prototype[s]=function(u,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;u=""+u;let p=this._nodes.get(u);if(typeof p=="undefined")throw new se(`Graph.${s}: could not find the "${u}" node in the graph.`);return sg(!0,r==="mixed"?this.type:r,i,p,l)};let a="some"+o;e.prototype[a]=function(u,l){return!!this[s](u,l)};let c="every"+o;e.prototype[c]=function(u,l){return!this[s](u,(h,y)=>!l(h,y))}}function tG(e,t){let{name:n,type:r,direction:i}=t,o=n.slice(0,-1)+"Entries";e.prototype[o]=function(s){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Jr.default.empty();s=""+s;let a=this._nodes.get(s);if(typeof a=="undefined")throw new se(`Graph.${o}: could not find the "${s}" node in the graph.`);return H$(r==="mixed"?this.type:r,i,a)}}function nG(e){z$.forEach(t=>{W$(e,t),Z$(e,t),eG(e,t),tG(e,t)})}function Lm(e,t,n,r,i){let o=r._nodes.values(),s=r.type,a,c,u,l,p,h,y;for(;a=o.next(),a.done!==!0;){let N=!1;if(c=a.value,s!=="undirected"){l=c.out;for(u in l){p=l[u];do{if(h=p.target,N=!0,y=i(c.key,h.key,c.attributes,h.attributes,p.key,p.attributes,p.undirected),e&&y)return p;p=p.next}while(p)}}if(s!=="directed"){l=c.undirected;for(u in l)if(!(t&&c.key>u)){p=l[u];do{if(h=p.target,h.key!==u&&(h=p.source),N=!0,y=i(c.key,h.key,c.attributes,h.attributes,p.key,p.attributes,p.undirected),e&&y)return p;p=p.next}while(p)}}if(n&&!N&&(y=i(c.key,null,c.attributes,null,null,null,null),e&&y))return null}}function rG(e,t){let n={key:e};return NA(t.attributes)||(n.attributes=Ln({},t.attributes)),n}function iG(e,t,n){let r={key:t,source:n.source.key,target:n.target.key};return NA(n.attributes)||(r.attributes=Ln({},n.attributes)),e==="mixed"&&n.undirected&&(r.undirected=!0),r}function oG(e){if(!Hn(e))throw new de('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in e))throw new de("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!Hn(e.attributes)||e.attributes===null))throw new de("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function sG(e){if(!Hn(e))throw new de('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in e))throw new de("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new de("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!Hn(e.attributes)||e.attributes===null))throw new de("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&typeof e.undirected!="boolean")throw new de("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}function pG(e,t,n){if(n&&!Hn(n))throw new de(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=""+t,n=n||{},e._nodes.has(t))throw new je(`Graph.addNode: the "${t}" node already exist in the graph.`);let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function EA(e,t,n){let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function DA(e,t,n,r,i,o,s,a){if(!r&&e.type==="undirected")throw new je(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new je(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(a&&!Hn(a))throw new de(`Graph.${t}: invalid attributes. Expecting an object but got "${a}"`);if(o=""+o,s=""+s,a=a||{},!e.allowSelfLoops&&o===s)throw new je(`Graph.${t}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let c=e._nodes.get(o),u=e._nodes.get(s);if(!c)throw new se(`Graph.${t}: source node "${o}" not found.`);if(!u)throw new se(`Graph.${t}: target node "${s}" not found.`);let l={key:null,undirected:r,source:o,target:s,attributes:a};if(n)i=e._edgeKeyGenerator();else if(i=""+i,e._edges.has(i))throw new je(`Graph.${t}: the "${i}" edge already exists in the graph.`);if(!e.multi&&(r?typeof c.undirected[s]!="undefined":typeof c.out[s]!="undefined"))throw new je(`Graph.${t}: an edge linking "${o}" to "${s}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);let p=new dc(r,i,c,u,a);e._edges.set(i,p);let h=o===s;return r?(c.undirectedDegree++,u.undirectedDegree++,h&&(c.undirectedLoops++,e._undirectedSelfLoopCount++)):(c.outDegree++,u.inDegree++,h&&(c.directedLoops++,e._directedSelfLoopCount++)),e.multi?p.attachMulti():p.attach(),r?e._undirectedSize++:e._directedSize++,l.key=i,e.emit("edgeAdded",l),i}function dG(e,t,n,r,i,o,s,a,c){if(!r&&e.type==="undirected")throw new je(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new je(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(a){if(c){if(typeof a!="function")throw new de(`Graph.${t}: invalid updater function. Expecting a function but got "${a}"`)}else if(!Hn(a))throw new de(`Graph.${t}: invalid attributes. Expecting an object but got "${a}"`)}o=""+o,s=""+s;let u;if(c&&(u=a,a=void 0),!e.allowSelfLoops&&o===s)throw new je(`Graph.${t}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let l=e._nodes.get(o),p=e._nodes.get(s),h,y;if(!n&&(h=e._edges.get(i),h)){if((h.source.key!==o||h.target.key!==s)&&(!r||h.source.key!==s||h.target.key!==o))throw new je(`Graph.${t}: inconsistency detected when attempting to merge the "${i}" edge with "${o}" source & "${s}" target vs. ("${h.source.key}", "${h.target.key}").`);y=h}if(!y&&!e.multi&&l&&(y=r?l.undirected[s]:l.out[s]),y){let W=[y.key,!1,!1,!1];if(c?!u:!a)return W;if(c){let K=y.attributes;y.attributes=u(K),e.emit("edgeAttributesUpdated",{type:"replace",key:y.key,attributes:y.attributes})}else Ln(y.attributes,a),e.emit("edgeAttributesUpdated",{type:"merge",key:y.key,attributes:y.attributes,data:a});return W}a=a||{},c&&u&&(a=u(a));let N={key:null,undirected:r,source:o,target:s,attributes:a};if(n)i=e._edgeKeyGenerator();else if(i=""+i,e._edges.has(i))throw new je(`Graph.${t}: the "${i}" edge already exists in the graph.`);let O=!1,w=!1;l||(l=EA(e,o,{}),O=!0,o===s&&(p=l,w=!0)),p||(p=EA(e,s,{}),w=!0),h=new dc(r,i,l,p,a),e._edges.set(i,h);let M=o===s;return r?(l.undirectedDegree++,p.undirectedDegree++,M&&(l.undirectedLoops++,e._undirectedSelfLoopCount++)):(l.outDegree++,p.inDegree++,M&&(l.directedLoops++,e._directedSelfLoopCount++)),e.multi?h.attachMulti():h.attach(),r?e._undirectedSize++:e._directedSize++,N.key=i,e.emit("edgeAdded",N),[i,!0,O,w]}function pc(e,t){e._edges.delete(t.key);let{source:n,target:r,attributes:i}=t,o=t.undirected,s=n===r;o?(n.undirectedDegree--,r.undirectedDegree--,s&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,s&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),o?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:i,source:n.key,target:r.key,undirected:o})}function fc(e){e.from=function(t,n){let r=Ln({},t.options,n),i=new e(r);return i.import(t),i}}var Jr,rg,ro,Ln,qp,de,se,je,bA,_A,l$,OA,g$,L$,k$,z$,aG,uG,TA,cG,lG,Gt,Bp,Kp,Qp,Yp,Jp,wA=Y(()=>{"use strict";d();m();f();aA();Jr=Lf(Rm()),rg=Lf(fA()),ro=Lf(hA());Ln=u$;typeof Object.assign=="function"&&(Ln=Object.assign);qp=class extends Error{constructor(t){super(),this.name="GraphError",this.message=t}},de=class e extends qp{constructor(t){super(t),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,e.prototype.constructor)}},se=class e extends qp{constructor(t){super(t),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,e.prototype.constructor)}},je=class e extends qp{constructor(t){super(t),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,e.prototype.constructor)}};gA.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};vA.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};IA.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};dc.prototype.attach=function(){let e="out",t="in";this.undirected&&(e=t="undirected");let n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)};dc.prototype.attachMulti=function(){let e="out",t="in",n=this.source.key,r=this.target.key;this.undirected&&(e=t="undirected");let i=this.source[e],o=i[r];if(typeof o=="undefined"){i[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}o.previous=this,this.next=o,i[r]=this,this.target[t][n]=this};dc.prototype.detach=function(){let e=this.source.key,t=this.target.key,n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][t],delete this.target[r][e]};dc.prototype.detachMulti=function(){let e=this.source.key,t=this.target.key,n="out",r="in";this.undirected&&(n=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};bA=0,_A=1,l$=2,OA=3;g$=[{name:e=>`get${e}Attribute`,attacher:p$},{name:e=>`get${e}Attributes`,attacher:d$},{name:e=>`has${e}Attribute`,attacher:f$},{name:e=>`set${e}Attribute`,attacher:m$},{name:e=>`update${e}Attribute`,attacher:h$},{name:e=>`remove${e}Attribute`,attacher:y$},{name:e=>`replace${e}Attributes`,attacher:T$},{name:e=>`merge${e}Attributes`,attacher:E$},{name:e=>`update${e}Attributes`,attacher:N$}];L$=[{name:e=>`get${e}Attribute`,attacher:I$},{name:e=>`get${e}Attributes`,attacher:b$},{name:e=>`has${e}Attribute`,attacher:_$},{name:e=>`set${e}Attribute`,attacher:O$},{name:e=>`update${e}Attribute`,attacher:S$},{name:e=>`remove${e}Attribute`,attacher:D$},{name:e=>`replace${e}Attributes`,attacher:A$},{name:e=>`merge${e}Attributes`,attacher:w$},{name:e=>`update${e}Attributes`,attacher:R$}];k$=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];z$=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];Fm.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)};Fm.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};aG=c$(),uG=new Set(["directed","undirected","mixed"]),TA=new Set(["domain","_events","_eventsCount","_maxListeners"]),cG=[{name:e=>`${e}Edge`,generateKey:!0},{name:e=>`${e}DirectedEdge`,generateKey:!0,type:"directed"},{name:e=>`${e}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:e=>`${e}EdgeWithKey`},{name:e=>`${e}DirectedEdgeWithKey`,type:"directed"},{name:e=>`${e}UndirectedEdgeWithKey`,type:"undirected"}],lG={allowSelfLoops:!0,multi:!1,type:"mixed"};Gt=class e extends sA{constructor(t){if(super(),t=Ln({},lG,t),typeof t.multi!="boolean")throw new de(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${t.multi}".`);if(!uG.has(t.type))throw new de(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${t.type}".`);if(typeof t.allowSelfLoops!="boolean")throw new de(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${t.allowSelfLoops}".`);let n=t.type==="mixed"?gA:t.type==="directed"?vA:IA;si(this,"NodeDataClass",n);let r="geid_"+aG()+"_",i=0,o=()=>{let s;do s=r+i++;while(this._edges.has(s));return s};si(this,"_attributes",{}),si(this,"_nodes",new Map),si(this,"_edges",new Map),si(this,"_directedSize",0),si(this,"_undirectedSize",0),si(this,"_directedSelfLoopCount",0),si(this,"_undirectedSelfLoopCount",0),si(this,"_edgeKeyGenerator",o),si(this,"_options",t),TA.forEach(s=>si(this,s,this[s])),Fi(this,"order",()=>this._nodes.size),Fi(this,"size",()=>this._edges.size),Fi(this,"directedSize",()=>this._directedSize),Fi(this,"undirectedSize",()=>this._undirectedSize),Fi(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Fi(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Fi(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Fi(this,"multi",this._options.multi),Fi(this,"type",this._options.type),Fi(this,"allowSelfLoops",this._options.allowSelfLoops),Fi(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(t){return this._nodes.has(""+t)}hasDirectedEdge(t,n){if(this.type==="undirected")return!1;if(arguments.length===1){let r=""+t,i=this._edges.get(r);return!!i&&!i.undirected}else if(arguments.length===2){t=""+t,n=""+n;let r=this._nodes.get(t);return r?r.out.hasOwnProperty(n):!1}throw new de(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(t,n){if(this.type==="directed")return!1;if(arguments.length===1){let r=""+t,i=this._edges.get(r);return!!i&&i.undirected}else if(arguments.length===2){t=""+t,n=""+n;let r=this._nodes.get(t);return r?r.undirected.hasOwnProperty(n):!1}throw new de(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(t,n){if(arguments.length===1){let r=""+t;return this._edges.has(r)}else if(arguments.length===2){t=""+t,n=""+n;let r=this._nodes.get(t);return r?typeof r.out!="undefined"&&r.out.hasOwnProperty(n)||typeof r.undirected!="undefined"&&r.undirected.hasOwnProperty(n):!1}throw new de(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(t,n){if(this.type==="undirected")return;if(t=""+t,n=""+n,this.multi)throw new je("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");let r=this._nodes.get(t);if(!r)throw new se(`Graph.directedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new se(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);let i=r.out&&r.out[n]||void 0;if(i)return i.key}undirectedEdge(t,n){if(this.type==="directed")return;if(t=""+t,n=""+n,this.multi)throw new je("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");let r=this._nodes.get(t);if(!r)throw new se(`Graph.undirectedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new se(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);let i=r.undirected&&r.undirected[n]||void 0;if(i)return i.key}edge(t,n){if(this.multi)throw new je("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t,n=""+n;let r=this._nodes.get(t);if(!r)throw new se(`Graph.edge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new se(`Graph.edge: could not find the "${n}" target node in the graph.`);let i=r.out&&r.out[n]||r.undirected&&r.undirected[n]||void 0;if(i)return i.key}areDirectedNeighbors(t,n){t=""+t,n=""+n;let r=this._nodes.get(t);if(!r)throw new se(`Graph.areDirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in||n in r.out}areOutNeighbors(t,n){t=""+t,n=""+n;let r=this._nodes.get(t);if(!r)throw new se(`Graph.areOutNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.out}areInNeighbors(t,n){t=""+t,n=""+n;let r=this._nodes.get(t);if(!r)throw new se(`Graph.areInNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in}areUndirectedNeighbors(t,n){t=""+t,n=""+n;let r=this._nodes.get(t);if(!r)throw new se(`Graph.areUndirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="directed"?!1:n in r.undirected}areNeighbors(t,n){t=""+t,n=""+n;let r=this._nodes.get(t);if(!r)throw new se(`Graph.areNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&(n in r.in||n in r.out)||this.type!=="directed"&&n in r.undirected}areInboundNeighbors(t,n){t=""+t,n=""+n;let r=this._nodes.get(t);if(!r)throw new se(`Graph.areInboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.in||this.type!=="directed"&&n in r.undirected}areOutboundNeighbors(t,n){t=""+t,n=""+n;let r=this._nodes.get(t);if(!r)throw new se(`Graph.areOutboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.out||this.type!=="directed"&&n in r.undirected}inDegree(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new se(`Graph.inDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree}outDegree(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new se(`Graph.outDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree}directedDegree(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new se(`Graph.directedDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree}undirectedDegree(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new se(`Graph.undirectedDegree: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree}inboundDegree(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new se(`Graph.inboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree),r}outboundDegree(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new se(`Graph.outboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.outDegree),r}degree(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new se(`Graph.degree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree),r}inDegreeWithoutSelfLoops(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new se(`Graph.inDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree-n.directedLoops}outDegreeWithoutSelfLoops(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new se(`Graph.outDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree-n.directedLoops}directedDegreeWithoutSelfLoops(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new se(`Graph.directedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree-n.directedLoops*2}undirectedDegreeWithoutSelfLoops(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new se(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree-n.undirectedLoops*2}inboundDegreeWithoutSelfLoops(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new se(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree,i+=n.directedLoops),r-i}outboundDegreeWithoutSelfLoops(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new se(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.outDegree,i+=n.directedLoops),r-i}degreeWithoutSelfLoops(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new se(`Graph.degreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree,i+=n.directedLoops*2),r-i}source(t){t=""+t;let n=this._edges.get(t);if(!n)throw new se(`Graph.source: could not find the "${t}" edge in the graph.`);return n.source.key}target(t){t=""+t;let n=this._edges.get(t);if(!n)throw new se(`Graph.target: could not find the "${t}" edge in the graph.`);return n.target.key}extremities(t){t=""+t;let n=this._edges.get(t);if(!n)throw new se(`Graph.extremities: could not find the "${t}" edge in the graph.`);return[n.source.key,n.target.key]}opposite(t,n){t=""+t,n=""+n;let r=this._edges.get(n);if(!r)throw new se(`Graph.opposite: could not find the "${n}" edge in the graph.`);let i=r.source.key,o=r.target.key;if(t===i)return o;if(t===o)return i;throw new se(`Graph.opposite: the "${t}" node is not attached to the "${n}" edge (${i}, ${o}).`)}hasExtremity(t,n){t=""+t,n=""+n;let r=this._edges.get(t);if(!r)throw new se(`Graph.hasExtremity: could not find the "${t}" edge in the graph.`);return r.source.key===n||r.target.key===n}isUndirected(t){t=""+t;let n=this._edges.get(t);if(!n)throw new se(`Graph.isUndirected: could not find the "${t}" edge in the graph.`);return n.undirected}isDirected(t){t=""+t;let n=this._edges.get(t);if(!n)throw new se(`Graph.isDirected: could not find the "${t}" edge in the graph.`);return!n.undirected}isSelfLoop(t){t=""+t;let n=this._edges.get(t);if(!n)throw new se(`Graph.isSelfLoop: could not find the "${t}" edge in the graph.`);return n.source===n.target}addNode(t,n){return pG(this,t,n).key}mergeNode(t,n){if(n&&!Hn(n))throw new de(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);t=""+t,n=n||{};let r=this._nodes.get(t);return r?(n&&(Ln(r.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:r.attributes,data:n})),[t,!1]):(r=new this.NodeDataClass(t,n),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:n}),[t,!0])}updateNode(t,n){if(n&&typeof n!="function")throw new de(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);t=""+t;let r=this._nodes.get(t);if(r){if(n){let o=r.attributes;r.attributes=n(o),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:r.attributes})}return[t,!1]}let i=n?n({}):{};return r=new this.NodeDataClass(t,i),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:i}),[t,!0]}dropNode(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new se(`Graph.dropNode: could not find the "${t}" node in the graph.`);let r;if(this.type!=="undirected"){for(let i in n.out){r=n.out[i];do pc(this,r),r=r.next;while(r)}for(let i in n.in){r=n.in[i];do pc(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(let i in n.undirected){r=n.undirected[i];do pc(this,r),r=r.next;while(r)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})}dropEdge(t){let n;if(arguments.length>1){let r=""+arguments[0],i=""+arguments[1];if(n=ai(this,r,i,this.type),!n)throw new se(`Graph.dropEdge: could not find the "${r}" -> "${i}" edge in the graph.`)}else if(t=""+t,n=this._edges.get(t),!n)throw new se(`Graph.dropEdge: could not find the "${t}" edge in the graph.`);return pc(this,n),this}dropDirectedEdge(t,n){if(arguments.length<2)throw new je("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new je("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");t=""+t,n=""+n;let r=ai(this,t,n,"directed");if(!r)throw new se(`Graph.dropDirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return pc(this,r),this}dropUndirectedEdge(t,n){if(arguments.length<2)throw new je("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new je("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");let r=ai(this,t,n,"undirected");if(!r)throw new se(`Graph.dropUndirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return pc(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){let t=this._nodes.values(),n;for(;n=t.next(),n.done!==!0;)n.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(t){return this._attributes[t]}getAttributes(){return this._attributes}hasAttribute(t){return this._attributes.hasOwnProperty(t)}setAttribute(t,n){return this._attributes[t]=n,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}updateAttribute(t,n){if(typeof n!="function")throw new de("Graph.updateAttribute: updater should be a function.");let r=this._attributes[t];return this._attributes[t]=n(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}removeAttribute(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this}replaceAttributes(t){if(!Hn(t))throw new de("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=t,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(t){if(!Hn(t))throw new de("Graph.mergeAttributes: provided attributes are not a plain object.");return Ln(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this}updateAttributes(t){if(typeof t!="function")throw new de("Graph.updateAttributes: provided updater is not a function.");return this._attributes=t(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(t,n){if(typeof t!="function")throw new de("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!yA(n))throw new de("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");let r=this._nodes.values(),i,o;for(;i=r.next(),i.done!==!0;)o=i.value,o.attributes=t(o.key,o.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(t,n){if(typeof t!="function")throw new de("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!yA(n))throw new de("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");let r=this._edges.values(),i,o,s,a;for(;i=r.next(),i.done!==!0;)o=i.value,s=o.source,a=o.target,o.attributes=t(o.key,o.attributes,s.key,a.key,s.attributes,a.attributes,o.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(t){if(typeof t!="function")throw new de("Graph.forEachAdjacencyEntry: expecting a callback.");Lm(!1,!1,!1,this,t)}forEachAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new de("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Lm(!1,!1,!0,this,t)}forEachAssymetricAdjacencyEntry(t){if(typeof t!="function")throw new de("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Lm(!1,!0,!1,this,t)}forEachAssymetricAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new de("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Lm(!1,!0,!0,this,t)}nodes(){return typeof Array.from=="function"?Array.from(this._nodes.keys()):(0,rg.default)(this._nodes.keys(),this._nodes.size)}forEachNode(t){if(typeof t!="function")throw new de("Graph.forEachNode: expecting a callback.");let n=this._nodes.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,t(i.key,i.attributes)}findNode(t){if(typeof t!="function")throw new de("Graph.findNode: expecting a callback.");let n=this._nodes.values(),r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,t(i.key,i.attributes))return i.key}mapNodes(t){if(typeof t!="function")throw new de("Graph.mapNode: expecting a callback.");let n=this._nodes.values(),r,i,o=new Array(this.order),s=0;for(;r=n.next(),r.done!==!0;)i=r.value,o[s++]=t(i.key,i.attributes);return o}someNode(t){if(typeof t!="function")throw new de("Graph.someNode: expecting a callback.");let n=this._nodes.values(),r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,t(i.key,i.attributes))return!0;return!1}everyNode(t){if(typeof t!="function")throw new de("Graph.everyNode: expecting a callback.");let n=this._nodes.values(),r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,!t(i.key,i.attributes))return!1;return!0}filterNodes(t){if(typeof t!="function")throw new de("Graph.filterNodes: expecting a callback.");let n=this._nodes.values(),r,i,o=[];for(;r=n.next(),r.done!==!0;)i=r.value,t(i.key,i.attributes)&&o.push(i.key);return o}reduceNodes(t,n){if(typeof t!="function")throw new de("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new de("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let r=n,i=this._nodes.values(),o,s;for(;o=i.next(),o.done!==!0;)s=o.value,r=t(r,s.key,s.attributes);return r}nodeEntries(){let t=this._nodes.values();return new Jr.default(()=>{let n=t.next();if(n.done)return n;let r=n.value;return{value:{node:r.key,attributes:r.attributes},done:!1}})}export(){let t=new Array(this._nodes.size),n=0;this._nodes.forEach((i,o)=>{t[n++]=rG(o,i)});let r=new Array(this._edges.size);return n=0,this._edges.forEach((i,o)=>{r[n++]=iG(this.type,o,i)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:r}}import(t,n=!1){if(t instanceof e)return t.forEachNode((c,u)=>{n?this.mergeNode(c,u):this.addNode(c,u)}),t.forEachEdge((c,u,l,p,h,y,N)=>{n?N?this.mergeUndirectedEdgeWithKey(c,l,p,u):this.mergeDirectedEdgeWithKey(c,l,p,u):N?this.addUndirectedEdgeWithKey(c,l,p,u):this.addDirectedEdgeWithKey(c,l,p,u)}),this;if(!Hn(t))throw new de("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!Hn(t.attributes))throw new de("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,i,o,s,a;if(t.nodes){if(o=t.nodes,!Array.isArray(o))throw new de("Graph.import: invalid nodes. Expecting an array.");for(r=0,i=o.length;r{let o=Ln({},r.attributes);r=new n.NodeDataClass(i,o),n._nodes.set(i,r)}),n}copy(t){if(t=t||{},typeof t.type=="string"&&t.type!==this.type&&t.type!=="mixed")throw new je(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${t.type}" because this would mean losing information about the current graph.`);if(typeof t.multi=="boolean"&&t.multi!==this.multi&&t.multi!==!0)throw new je("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof t.allowSelfLoops=="boolean"&&t.allowSelfLoops!==this.allowSelfLoops&&t.allowSelfLoops!==!0)throw new je("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");let n=this.emptyCopy(t),r=this._edges.values(),i,o;for(;i=r.next(),i.done!==!0;)o=i.value,DA(n,"copy",!1,o.undirected,o.key,o.source.key,o.target.key,Ln({},o.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){let t={};this._nodes.forEach((o,s)=>{t[s]=o.attributes});let n={},r={};this._edges.forEach((o,s)=>{let a=o.undirected?"--":"->",c="",u=o.source.key,l=o.target.key,p;o.undirected&&u>l&&(p=u,u=l,l=p);let h=`(${u})${a}(${l})`;s.startsWith("geid_")?this.multi&&(typeof r[h]=="undefined"?r[h]=0:r[h]++,c+=`${r[h]}. `):c+=`[${s}]: `,c+=h,n[c]=o.attributes});let i={};for(let o in this)this.hasOwnProperty(o)&&!TA.has(o)&&typeof this[o]!="function"&&typeof o!="symbol"&&(i[o]=this[o]);return i.attributes=this._attributes,i.nodes=t,i.edges=n,si(i,"constructor",this.constructor),i}};typeof Symbol!="undefined"&&(Gt.prototype[Symbol.for("nodejs.util.inspect.custom")]=Gt.prototype.inspect);cG.forEach(e=>{["add","merge","update"].forEach(t=>{let n=e.name(t),r=t==="add"?DA:dG;e.generateKey?Gt.prototype[n]=function(i,o,s){return r(this,n,!0,(e.type||this.type)==="undirected",null,i,o,s,t==="update")}:Gt.prototype[n]=function(i,o,s,a){return r(this,n,!1,(e.type||this.type)==="undirected",i,o,s,a,t==="update")}})});v$(Gt);F$(Gt);J$(Gt);nG(Gt);Bp=class extends Gt{constructor(t){let n=Ln({type:"directed"},t);if("multi"in n&&n.multi!==!1)throw new de("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new de('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}},Kp=class extends Gt{constructor(t){let n=Ln({type:"undirected"},t);if("multi"in n&&n.multi!==!1)throw new de("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new de('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}},Qp=class extends Gt{constructor(t){let n=Ln({multi:!0},t);if("multi"in n&&n.multi!==!0)throw new de("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}},Yp=class extends Gt{constructor(t){let n=Ln({type:"directed",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new de("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new de('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}},Jp=class extends Gt{constructor(t){let n=Ln({type:"undirected",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new de("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new de('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}};fc(Gt);fc(Bp);fc(Kp);fc(Qp);fc(Yp);fc(Jp);Gt.Graph=Gt;Gt.DirectedGraph=Bp;Gt.UndirectedGraph=Kp;Gt.MultiGraph=Qp;Gt.MultiDirectedGraph=Yp;Gt.MultiUndirectedGraph=Jp;Gt.InvalidArgumentsGraphError=de;Gt.NotFoundGraphError=se;Gt.UsageGraphError=je});var mc=F(io=>{"use strict";d();m();f();Object.defineProperty(io,"__esModule",{value:!0});io.getNamedTypeForChild=io.isTypeRequired=io.getMostRestrictiveMergedTypeNode=io.getLeastRestrictiveMergedTypeNode=void 0;var zo=(he(),Te(Ie)),RA=Yo(),ag=Vp(),Xa;(function(e){e[e.NONE=0]="NONE",e[e.CURRENT=1]="CURRENT",e[e.OTHER=2]="OTHER"})(Xa||(Xa={}));function LA(e,t,n,r,i){t=(0,ag.deepCopyTypeNode)(t,n,r);let o={kind:e.kind},s=Xa.NONE,a=o;for(let c=0;c{"use strict";d();m();f();Object.defineProperty(oo,"__esModule",{value:!0});oo.walkSubgraphToFederate=oo.walkSubgraphToCollectObjectLikesAndDirectiveDefinitions=oo.walkSubgraphToApplyFieldAuthorization=oo.recordSubgraphName=void 0;var ug=(he(),Te(Ie)),Wn=eo(),kA=mc(),Xo=za(),km=Li();function yG(e,t,n){if(!t.has(e)){t.add(e);return}n.add(e)}oo.recordSubgraphName=yG;function TG(e,t){let n,r=!1;(0,ug.visit)(t,{FieldDefinition:{enter(i){e.childName=i.name.value;let o=(0,kA.getNamedTypeForChild)(`${e.parentTypeName}.${e.childName}`,i.type),s=e.leafTypeNamesWithAuthorizationDirectives.has(o);if((!n||!n.hasParentLevelAuthorization)&&!s)return!1;n||(n=(0,Xo.setAndGetValue)(e.authorizationDataByParentTypeName,e.parentTypeName,(0,Xo.newAuthorizationData)(e.parentTypeName)));let a=(0,Xo.getValueOrDefault)(n.fieldAuthorizationDataByFieldName,e.childName,()=>(0,Xo.newFieldAuthorizationData)(e.childName));if(!(0,Xo.mergeAuthorizationDataByAND)(n,a))return e.invalidOrScopesHostPaths.add(`${e.parentTypeName}.${e.childName}`),!1;if(!s)return!1;if(r)return(0,Xo.getValueOrDefault)(e.heirFieldAuthorizationDataByTypeName,o,()=>[]).push(a),!1;let c=e.authorizationDataByParentTypeName.get(o);return c&&c.hasParentLevelAuthorization&&!(0,Xo.mergeAuthorizationDataByAND)(c,a)&&e.invalidOrScopesHostPaths.add(`${e.parentTypeName}.${e.childName}`),!1},leave(){e.childName=""}},InterfaceTypeDefinition:{enter(i){e.parentTypeName=i.name.value,n=e.getAuthorizationData(i),r=!0},leave(){e.parentTypeName="",n=void 0,r=!1}},InterfaceTypeExtension:{enter(i){e.parentTypeName=i.name.value,n=e.getAuthorizationData(i),r=!0},leave(){e.parentTypeName="",n=void 0,r=!1}},ObjectTypeDefinition:{enter(i){e.parentTypeName=i.name.value,n=e.getAuthorizationData(i)},leave(){e.parentTypeName="",n=void 0}},ObjectTypeExtension:{enter(i){e.parentTypeName=i.name.value,n=e.getAuthorizationData(i)},leave(){e.parentTypeName="",n=void 0}}})}oo.walkSubgraphToApplyFieldAuthorization=TG;function EG(e,t){t.definitions=(0,ug.visit)(t.definitions,{DirectiveDefinition:{enter(n){e.upsertDirectiveNode(n)}},InterfaceTypeDefinition:{enter(n){let r=n.name.value;if(e.upsertParentNode(n),!(0,Wn.isObjectLikeNodeEntity)(n))return!1;e.graph.hasNode(r)||e.graph.addNode(r)}},ObjectTypeDefinition:{enter(n){let r=n.name.value,i=t.operationTypes.get(r),o=i?(0,Xo.getOrThrowError)(Wn.operationTypeNodeToDefaultType,i,km.OPERATION_TO_DEFAULT):r;if(e.graph.hasNode(o)||e.graph.addNode(o),(0,Wn.isNodeInterfaceObject)(n))return!1;let s=e.entityContainersByTypeName.get(r);return s&&!(0,Wn.isObjectLikeNodeEntity)(n)&&e.validateKeyFieldSetsForImplicitEntity(s),(0,Wn.addConcreteTypesForImplementedInterfaces)(n,e.abstractToConcreteTypeNames),r==o?!1:(e.renamedTypeNameByOriginalTypeName.set(r,o),x(D({},n),{name:(0,Wn.stringToNameNode)(o)}))}},ObjectTypeExtension:{enter(n){let r=n.name.value,i=t.operationTypes.get(r),o=i?(0,Xo.getOrThrowError)(Wn.operationTypeNodeToDefaultType,i,km.OPERATION_TO_DEFAULT):r;return(0,Wn.addConcreteTypesForImplementedInterfaces)(n,e.abstractToConcreteTypeNames),e.graph.hasNode(o)||e.graph.addNode(o),r!==o?x(D({},n),{name:(0,Wn.stringToNameNode)(o)}):!1}},UnionTypeDefinition:{enter(n){e.upsertParentNode(n),(0,Wn.addConcreteTypesForUnion)(n,e.abstractToConcreteTypeNames)}}})}oo.walkSubgraphToCollectObjectLikesAndDirectiveDefinitions=EG;function NG(e,t,n){let r;(0,ug.visit)(e,{Directive:{enter(){return!1}},EnumTypeDefinition:{enter(i){n.parentTypeName=i.name.value,n.upsertParentNode(i)},leave(){n.parentTypeName=""}},EnumValueDefinition:{enter(i){n.childName=i.name.value,n.upsertValueNode(i)},leave(){n.childName=""}},FieldDefinition:{enter(i){let o=i.name.value;if(r!=null&&r.has(o))return!1;let s=`${n.parentTypeName}.${o}`,a=(0,kA.getNamedTypeForChild)(s,i.type);if(n.isParentRootType&&(o===km.SERVICE_FIELD||o===km.ENTITIES_FIELD))return!1;if(n.childName=o,n.upsertFieldNode(i),!n.graph.hasNode(n.parentTypeName)||n.graphEdges.has(s))return;n.graphEdges.add(s);let c=n.entityContainersByTypeName.get(n.parentTypeName);if(c&&!c.fieldNames.has(o))return;let u=n.abstractToConcreteTypeNames.get(a);if(u)for(let l of u)n.graph.addEdge(n.parentTypeName,l);n.graph.hasNode(a)&&n.graph.addEdge(n.parentTypeName,a)},leave(){n.childName=""}},InputObjectTypeDefinition:{enter(i){n.parentTypeName=i.name.value,n.isParentInputObject=!0,n.upsertParentNode(i)},leave(){n.parentTypeName="",n.isParentInputObject=!1}},InputValueDefinition:{enter(i){n.isParentInputObject&&(n.childName=i.name.value),n.upsertValueNode(i)},leave(){n.isParentInputObject&&(n.childName="")}},InterfaceTypeDefinition:{enter(i){n.parentTypeName=i.name.value,n.isCurrentParentInterface=!0,n.upsertParentNode(i)},leave(){n.parentTypeName="",n.isCurrentParentInterface=!1}},ObjectTypeDefinition:{enter(i){if(n.areFieldsExternal=(0,Wn.isNodeExternal)(i),n.areFieldsShareable=!n.isCurrentSubgraphVersionTwo||(0,Wn.isNodeShareable)(i),n.isCurrentParentEntity=(0,Wn.isObjectLikeNodeEntity)(i),n.isParentRootType=n.isObjectRootType(i),n.parentTypeName=i.name.value,(0,Wn.isNodeInterfaceObject)(i)){n.upsertInterfaceObjectParentNode(i);return}n.upsertParentNode(i),r=t.get(n.parentTypeName)},leave(){r=void 0,n.areFieldsExternal=!1,n.areFieldsShareable=!1,n.isCurrentParentEntity=!1,n.isParentRootType=!1,n.parentTypeName=""}},ObjectTypeExtension:{enter(i){let o=i.name.value;n.areFieldsExternal=(0,Wn.isNodeExternal)(i),n.areFieldsShareable=!n.isCurrentSubgraphVersionTwo||(0,Wn.isNodeShareable)(i),n.isCurrentParentExtensionType=!0,n.isCurrentParentEntity=(0,Wn.isObjectLikeNodeEntity)(i),n.parentTypeName=o,n.isParentRootType=n.isObjectRootType(i),n.upsertExtensionNode(i),r=t.get(n.parentTypeName)},leave(){r=void 0,n.areFieldsExternal=!1,n.areFieldsShareable=!1,n.isCurrentParentEntity=!1,n.isCurrentParentExtensionType=!1,n.parentTypeName="",n.isParentRootType=!1}},ScalarTypeDefinition:{enter(i){n.upsertParentNode(i)}}})}oo.walkSubgraphToFederate=NG});var Um={};ml(Um,{__addDisposableResource:()=>ew,__assign:()=>xm,__asyncDelegator:()=>QA,__asyncGenerator:()=>KA,__asyncValues:()=>YA,__await:()=>hc,__awaiter:()=>jA,__classPrivateFieldGet:()=>HA,__classPrivateFieldIn:()=>ZA,__classPrivateFieldSet:()=>WA,__createBinding:()=>Mm,__decorate:()=>CA,__disposeResources:()=>tw,__esDecorate:()=>gG,__exportStar:()=>$A,__extends:()=>PA,__generator:()=>VA,__importDefault:()=>XA,__importStar:()=>zA,__makeTemplateObject:()=>JA,__metadata:()=>UA,__param:()=>MA,__propKey:()=>IG,__read:()=>lg,__rest:()=>xA,__runInitializers:()=>vG,__setFunctionName:()=>bG,__spread:()=>GA,__spreadArray:()=>BA,__spreadArrays:()=>qA,__values:()=>Cm,default:()=>SG});function PA(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");cg(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function xA(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=0;a--)(s=e[a])&&(o=(i<3?s(o):i>3?s(t,n,o):s(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function MA(e,t){return function(n,r){t(n,r,e)}}function gG(e,t,n,r,i,o){function s(M){if(M!==void 0&&typeof M!="function")throw new TypeError("Function expected");return M}for(var a=r.kind,c=a==="getter"?"get":a==="setter"?"set":"value",u=!t&&e?r.static?e:e.prototype:null,l=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),p,h=!1,y=n.length-1;y>=0;y--){var N={};for(var O in r)N[O]=O==="access"?{}:r[O];for(var O in r.access)N.access[O]=r.access[O];N.addInitializer=function(M){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(M||null))};var w=(0,n[y])(a==="accessor"?{get:l.get,set:l.set}:l[c],N);if(a==="accessor"){if(w===void 0)continue;if(w===null||typeof w!="object")throw new TypeError("Object expected");(p=s(w.get))&&(l.get=p),(p=s(w.set))&&(l.set=p),(p=s(w.init))&&i.unshift(p)}else(p=s(w))&&(a==="field"?i.unshift(p):l[c]=p)}u&&Object.defineProperty(u,r.name,l),h=!0}function vG(e,t,n){for(var r=arguments.length>2,i=0;i0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function lg(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function GA(){for(var e=[],t=0;t1||a(h,y)})})}function a(h,y){try{c(r[h](y))}catch(N){p(o[0][3],N)}}function c(h){h.value instanceof hc?Promise.resolve(h.value.v).then(u,l):p(o[0][2],h)}function u(h){a("next",h)}function l(h){a("throw",h)}function p(h,y){h(y),o.shift(),o.length&&a(o[0][0],o[0][1])}}function QA(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,o){t[i]=e[i]?function(s){return(n=!n)?{value:hc(e[i](s)),done:!1}:o?o(s):s}:o}}function YA(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Cm=="function"?Cm(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(s){return new Promise(function(a,c){s=e[o](s),i(a,c,s.done,s.value)})}}function i(o,s,a,c){Promise.resolve(c).then(function(u){o({value:u,done:a})},s)}}function JA(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function zA(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Mm(t,e,n);return _G(t,e),t}function XA(e){return e&&e.__esModule?e:{default:e}}function HA(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function WA(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n}function ZA(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function ew(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose]}if(typeof r!="function")throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}function tw(e){function t(r){e.error=e.hasError?new OG(r,e.error,"An error was suppressed during disposal."):r,e.hasError=!0}function n(){for(;e.stack.length;){var r=e.stack.pop();try{var i=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(i).then(n,function(o){return t(o),n()})}catch(o){t(o)}}if(e.hasError)throw e.error}return n()}var cg,xm,Mm,_G,OG,SG,jm=Y(()=>{"use strict";d();m();f();cg=function(e,t){return cg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},cg(e,t)};xm=function(){return xm=Object.assign||function(t){for(var n,r=1,i=arguments.length;r{"use strict";d();m();f()});var zp=F(Gn=>{"use strict";d();m();f();Object.defineProperty(Gn,"__esModule",{value:!0});Gn.assertSome=Gn.isSome=Gn.compareNodes=Gn.nodeToString=Gn.compareStrings=Gn.isValidPath=Gn.isDocumentString=Gn.asArray=void 0;var DG=(he(),Te(Ie)),AG=e=>Array.isArray(e)?e:e?[e]:[];Gn.asArray=AG;var wG=/\.[a-z0-9]+$/i;function RG(e){if(typeof e!="string"||wG.test(e))return!1;try{return(0,DG.parse)(e),!0}catch(t){}return!1}Gn.isDocumentString=RG;var LG=/[‘“!%^<=>`]/;function FG(e){return typeof e=="string"&&!LG.test(e)}Gn.isValidPath=FG;function rw(e,t){return String(e)String(t)?1:0}Gn.compareStrings=rw;function pg(e){var n,r;let t;return"alias"in e&&(t=(n=e.alias)==null?void 0:n.value),t==null&&"name"in e&&(t=(r=e.name)==null?void 0:r.value),t==null&&(t=e.kind),t}Gn.nodeToString=pg;function kG(e,t,n){let r=pg(e),i=pg(t);return typeof n=="function"?n(r,i):rw(r,i)}Gn.compareNodes=kG;function PG(e){return e!=null}Gn.isSome=PG;function xG(e,t="Value should be something"){if(e==null)throw new Error(t)}Gn.assertSome=xG});var Vm=F(ui=>{"use strict";d();m();f();Object.defineProperty(ui,"__esModule",{value:!0});ui.hasOwnProperty=ui.promiseReduce=ui.isPromise=ui.isObjectLike=ui.isIterableObject=void 0;function CG(e){return e!=null&&typeof e=="object"&&Symbol.iterator in e}ui.isIterableObject=CG;function iw(e){return typeof e=="object"&&e!==null}ui.isObjectLike=iw;function ow(e){return iw(e)&&typeof e.then=="function"}ui.isPromise=ow;function MG(e,t,n){let r=n;for(let i of e)r=ow(r)?r.then(o=>t(o,i)):t(r,i);return r}ui.promiseReduce=MG;function UG(e,t){return Object.prototype.hasOwnProperty.call(e,t)}ui.hasOwnProperty=UG});var $m=F(yc=>{"use strict";d();m();f();Object.defineProperty(yc,"__esModule",{value:!0});yc.relocatedError=yc.createGraphQLError=void 0;var dg=(he(),Te(Ie));function sw(e,t){return dg.versionInfo.major>=17?new dg.GraphQLError(e,t):new dg.GraphQLError(e,t==null?void 0:t.nodes,t==null?void 0:t.source,t==null?void 0:t.positions,t==null?void 0:t.path,t==null?void 0:t.originalError,t==null?void 0:t.extensions)}yc.createGraphQLError=sw;function jG(e,t){return sw(e.message,{nodes:e.nodes,source:e.source,positions:e.positions,path:t==null?e.path:t,originalError:e,extensions:e.extensions})}yc.relocatedError=jG});var Xp=F(qm=>{"use strict";d();m();f();Object.defineProperty(qm,"__esModule",{value:!0});qm.inspect=void 0;var VG=(he(),Te(Ie)),cw=3;function $G(e){return Gm(e,[])}qm.inspect=$G;function Gm(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return GG(e,t);default:return String(e)}}function aw(e){return e instanceof VG.GraphQLError?e.toString():`${e.name}: ${e.message}; - ${e.stack}`}function GG(e,t){if(e===null)return"null";if(e instanceof Error)return e.name==="AggregateError"?aw(e)+` -`+uw(e.errors,t):aw(e);if(t.includes(e))return"[Circular]";let n=[...t,e];if(qG(e)){let r=e.toJSON();if(r!==e)return typeof r=="string"?r:Gm(r,n)}else if(Array.isArray(e))return uw(e,n);return BG(e,n)}function qG(e){return typeof e.toJSON=="function"}function BG(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>cw?"["+KG(e)+"]":"{ "+n.map(([i,o])=>i+": "+Gm(o,t)).join(", ")+" }"}function uw(e,t){if(e.length===0)return"[]";if(t.length>cw)return"[Array]";let n=e.length,r=[];for(let i=0;i{"use strict";d();m();f();Object.defineProperty(Km,"__esModule",{value:!0});Km.getArgumentValues=void 0;var QG=Vm(),Ha=(he(),Te(Ie)),Bm=$m(),fg=Xp();function YG(e,t,n={}){var s;let r={},o=((s=t.arguments)!=null?s:[]).reduce((a,c)=>x(D({},a),{[c.name.value]:c}),{});for(let{name:a,type:c,defaultValue:u}of e.args){let l=o[a];if(!l){if(u!==void 0)r[a]=u;else if((0,Ha.isNonNullType)(c))throw(0,Bm.createGraphQLError)(`Argument "${a}" of required type "${(0,fg.inspect)(c)}" was not provided.`,{nodes:[t]});continue}let p=l.value,h=p.kind===Ha.Kind.NULL;if(p.kind===Ha.Kind.VARIABLE){let N=p.name.value;if(n==null||!(0,QG.hasOwnProperty)(n,N)){if(u!==void 0)r[a]=u;else if((0,Ha.isNonNullType)(c))throw(0,Bm.createGraphQLError)(`Argument "${a}" of required type "${(0,fg.inspect)(c)}" was provided the variable "$${N}" which was not provided a runtime value.`,{nodes:[p]});continue}h=n[N]==null}if(h&&(0,Ha.isNonNullType)(c))throw(0,Bm.createGraphQLError)(`Argument "${a}" of non-null type "${(0,fg.inspect)(c)}" must not be null.`,{nodes:[p]});let y=(0,Ha.valueFromAST)(p,c,n);if(y===void 0)throw(0,Bm.createGraphQLError)(`Argument "${a}" has invalid value ${(0,Ha.print)(p)}.`,{nodes:[p]});r[a]=y}return r}Km.getArgumentValues=YG});var hg=F(so=>{"use strict";d();m();f();Object.defineProperty(so,"__esModule",{value:!0});so.getDirective=so.getDirectives=so.getDirectiveInExtensions=so.getDirectivesInExtensions=void 0;var pw=mg();function dw(e,t=["directives"]){return t.reduce((n,r)=>n==null?n:n[r],e==null?void 0:e.extensions)}so.getDirectivesInExtensions=dw;function lw(e,t){let n=e.filter(r=>r.name===t);if(n.length)return n.map(r=>{var i;return(i=r.args)!=null?i:{}})}function fw(e,t,n=["directives"]){let r=n.reduce((o,s)=>o==null?o:o[s],e==null?void 0:e.extensions);if(r===void 0)return;if(Array.isArray(r))return lw(r,t);let i=[];for(let[o,s]of Object.entries(r))if(Array.isArray(s))for(let a of s)i.push({name:o,args:a});else i.push({name:o,args:s});return lw(i,t)}so.getDirectiveInExtensions=fw;function JG(e,t,n=["directives"]){let r=dw(t,n);if(r!=null&&r.length>0)return r;let o=(e&&e.getDirectives?e.getDirectives():[]).reduce((c,u)=>(c[u.name]=u,c),{}),s=[];t.astNode&&s.push(t.astNode),"extensionASTNodes"in t&&t.extensionASTNodes&&(s=[...s,...t.extensionASTNodes]);let a=[];for(let c of s)if(c.directives)for(let u of c.directives){let l=o[u.name.value];l&&a.push({name:u.name.value,args:(0,pw.getArgumentValues)(l,u)})}return a}so.getDirectives=JG;function zG(e,t,n,r=["directives"]){let i=fw(t,n,r);if(i!=null)return i;let o=e&&e.getDirective?e.getDirective(n):void 0;if(o==null)return;let s=[];t.astNode&&s.push(t.astNode),"extensionASTNodes"in t&&t.extensionASTNodes&&(s=[...s,...t.extensionASTNodes]);let a=[];for(let c of s)if(c.directives)for(let u of c.directives)u.name.value===n&&a.push((0,pw.getArgumentValues)(o,u));if(a.length)return a}so.getDirective=zG});var yg=F(Qm=>{"use strict";d();m();f();Object.defineProperty(Qm,"__esModule",{value:!0});Qm.getFieldsWithDirectives=void 0;var XG=(he(),Te(Ie));function HG(e,t={}){let n={},r=["ObjectTypeDefinition","ObjectTypeExtension"];t.includeInputTypes&&(r=[...r,"InputObjectTypeDefinition","InputObjectTypeExtension"]);let i=e.definitions.filter(o=>r.includes(o.kind));for(let o of i){let s=o.name.value;if(o.fields!=null){for(let a of o.fields)if(a.directives&&a.directives.length>0){let c=a.name.value,u=`${s}.${c}`,l=a.directives.map(p=>({name:p.name.value,args:(p.arguments||[]).reduce((h,y)=>x(D({},h),{[y.name.value]:(0,XG.valueFromASTUntyped)(y.value)}),{})}));n[u]=l}}}return n}Qm.getFieldsWithDirectives=HG});var mw=F(Ym=>{"use strict";d();m();f();Object.defineProperty(Ym,"__esModule",{value:!0});Ym.getArgumentsWithDirectives=void 0;var Tg=(he(),Te(Ie));function WG(e){return e.kind===Tg.Kind.OBJECT_TYPE_DEFINITION||e.kind===Tg.Kind.OBJECT_TYPE_EXTENSION}function ZG(e){var r;let t={},n=e.definitions.filter(WG);for(let i of n)if(i.fields!=null)for(let o of i.fields){let s=(r=o.arguments)==null?void 0:r.filter(c=>{var u;return(u=c.directives)==null?void 0:u.length});if(!(s!=null&&s.length))continue;let a=t[`${i.name.value}.${o.name.value}`]={};for(let c of s){let u=c.directives.map(l=>({name:l.name.value,args:(l.arguments||[]).reduce((p,h)=>x(D({},p),{[h.name.value]:(0,Tg.valueFromASTUntyped)(h.value)}),{})}));a[c.name.value]=u}}return t}Ym.getArgumentsWithDirectives=ZG});var Eg=F(Jm=>{"use strict";d();m();f();Object.defineProperty(Jm,"__esModule",{value:!0});Jm.getImplementingTypes=void 0;var eq=(he(),Te(Ie));function tq(e,t){let n=t.getTypeMap(),r=[];for(let i in n){let o=n[i];(0,eq.isObjectType)(o)&&o.getInterfaces().find(a=>a.name===e)&&r.push(o.name)}return r}Jm.getImplementingTypes=tq});var gg=F(zm=>{"use strict";d();m();f();Object.defineProperty(zm,"__esModule",{value:!0});zm.astFromType=void 0;var Wa=(he(),Te(Ie)),nq=Xp();function Ng(e){if((0,Wa.isNonNullType)(e)){let t=Ng(e.ofType);if(t.kind===Wa.Kind.NON_NULL_TYPE)throw new Error(`Invalid type node ${(0,nq.inspect)(e)}. Inner type of non-null type cannot be a non-null type.`);return{kind:Wa.Kind.NON_NULL_TYPE,type:t}}else if((0,Wa.isListType)(e))return{kind:Wa.Kind.LIST_TYPE,type:Ng(e.ofType)};return{kind:Wa.Kind.NAMED_TYPE,name:{kind:Wa.Kind.NAME,value:e.name}}}zm.astFromType=Ng});var Hm=F(Xm=>{"use strict";d();m();f();Object.defineProperty(Xm,"__esModule",{value:!0});Xm.astFromValueUntyped=void 0;var ao=(he(),Te(Ie));function vg(e){if(e===null)return{kind:ao.Kind.NULL};if(e===void 0)return null;if(Array.isArray(e)){let t=[];for(let n of e){let r=vg(n);r!=null&&t.push(r)}return{kind:ao.Kind.LIST,values:t}}if(typeof e=="object"){let t=[];for(let n in e){let r=e[n],i=vg(r);i&&t.push({kind:ao.Kind.OBJECT_FIELD,name:{kind:ao.Kind.NAME,value:n},value:i})}return{kind:ao.Kind.OBJECT,fields:t}}if(typeof e=="boolean")return{kind:ao.Kind.BOOLEAN,value:e};if(typeof e=="bigint")return{kind:ao.Kind.INT,value:String(e)};if(typeof e=="number"&&isFinite(e)){let t=String(e);return rq.test(t)?{kind:ao.Kind.INT,value:t}:{kind:ao.Kind.FLOAT,value:t}}if(typeof e=="string")return{kind:ao.Kind.STRING,value:e};throw new TypeError(`Cannot convert value to AST: ${e}.`)}Xm.astFromValueUntyped=vg;var rq=/^-?(?:0|[1-9][0-9]*)$/});var Tc=F(ar=>{"use strict";d();m();f();Object.defineProperty(ar,"__esModule",{value:!0});ar.memoize2of5=ar.memoize2of4=ar.memoize5=ar.memoize4=ar.memoize3=ar.memoize2=ar.memoize1=void 0;function iq(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}}ar.memoize1=iq;function oq(e){let t=new WeakMap;return function(r,i){let o=t.get(r);if(!o){o=new WeakMap,t.set(r,o);let a=e(r,i);return o.set(i,a),a}let s=o.get(i);if(s===void 0){let a=e(r,i);return o.set(i,a),a}return s}}ar.memoize2=oq;function sq(e){let t=new WeakMap;return function(r,i,o){let s=t.get(r);if(!s){s=new WeakMap,t.set(r,s);let u=new WeakMap;s.set(i,u);let l=e(r,i,o);return u.set(o,l),l}let a=s.get(i);if(!a){a=new WeakMap,s.set(i,a);let u=e(r,i,o);return a.set(o,u),u}let c=a.get(o);if(c===void 0){let u=e(r,i,o);return a.set(o,u),u}return c}}ar.memoize3=sq;function aq(e){let t=new WeakMap;return function(r,i,o,s){let a=t.get(r);if(!a){a=new WeakMap,t.set(r,a);let p=new WeakMap;a.set(i,p);let h=new WeakMap;p.set(o,h);let y=e(r,i,o,s);return h.set(s,y),y}let c=a.get(i);if(!c){c=new WeakMap,a.set(i,c);let p=new WeakMap;c.set(o,p);let h=e(r,i,o,s);return p.set(s,h),h}let u=c.get(o);if(!u){let p=new WeakMap;c.set(o,p);let h=e(r,i,o,s);return p.set(s,h),h}let l=u.get(s);if(l===void 0){let p=e(r,i,o,s);return u.set(s,p),p}return l}}ar.memoize4=aq;function uq(e){let t=new WeakMap;return function(r,i,o,s,a){let c=t.get(r);if(!c){c=new WeakMap,t.set(r,c);let y=new WeakMap;c.set(i,y);let N=new WeakMap;y.set(o,N);let O=new WeakMap;N.set(s,O);let w=e(r,i,o,s,a);return O.set(a,w),w}let u=c.get(i);if(!u){u=new WeakMap,c.set(i,u);let y=new WeakMap;u.set(o,y);let N=new WeakMap;y.set(s,N);let O=e(r,i,o,s,a);return N.set(a,O),O}let l=u.get(o);if(!l){l=new WeakMap,u.set(o,l);let y=new WeakMap;l.set(s,y);let N=e(r,i,o,s,a);return y.set(a,N),N}let p=l.get(s);if(!p){p=new WeakMap,l.set(s,p);let y=e(r,i,o,s,a);return p.set(a,y),y}let h=p.get(a);if(h===void 0){let y=e(r,i,o,s,a);return p.set(a,y),y}return h}}ar.memoize5=uq;function cq(e){let t=new WeakMap;return function(r,i,o,s){let a=t.get(r);if(!a){a=new WeakMap,t.set(r,a);let u=e(r,i,o,s);return a.set(i,u),u}let c=a.get(i);if(c===void 0){let u=e(r,i,o,s);return a.set(i,u),u}return c}}ar.memoize2of4=cq;function lq(e){let t=new WeakMap;return function(r,i,o,s,a){let c=t.get(r);if(!c){c=new WeakMap,t.set(r,c);let l=e(r,i,o,s,a);return c.set(i,l),l}let u=c.get(i);if(u===void 0){let l=e(r,i,o,s,a);return c.set(i,l),l}return u}}ar.memoize2of5=lq});var Hp=F(zr=>{"use strict";d();m();f();Object.defineProperty(zr,"__esModule",{value:!0});zr.getRootTypeMap=zr.getRootTypes=zr.getRootTypeNames=zr.getDefinedRootType=void 0;var pq=$m(),Ig=Tc();function dq(e,t,n){let i=(0,zr.getRootTypeMap)(e).get(t);if(i==null)throw(0,pq.createGraphQLError)(`Schema is not configured to execute ${t} operation.`,{nodes:n});return i}zr.getDefinedRootType=dq;zr.getRootTypeNames=(0,Ig.memoize1)(function(t){let n=(0,zr.getRootTypes)(t);return new Set([...n].map(r=>r.name))});zr.getRootTypes=(0,Ig.memoize1)(function(t){let n=(0,zr.getRootTypeMap)(t);return new Set(n.values())});zr.getRootTypeMap=(0,Ig.memoize1)(function(t){let n=new Map,r=t.getQueryType();r&&n.set("query",r);let i=t.getMutationType();i&&n.set("mutation",i);let o=t.getSubscriptionType();return o&&n.set("subscription",o),n})});var yw=F(Wm=>{"use strict";d();m();f();Object.defineProperty(Wm,"__esModule",{value:!0});Wm.astFromValue=void 0;var Xr=(he(),Te(Ie)),hw=Vm(),fq=Xp(),mq=Hm();function Wp(e,t){if((0,Xr.isNonNullType)(t)){let n=Wp(e,t.ofType);return(n==null?void 0:n.kind)===Xr.Kind.NULL?null:n}if(e===null)return{kind:Xr.Kind.NULL};if(e===void 0)return null;if((0,Xr.isListType)(t)){let n=t.ofType;if((0,hw.isIterableObject)(e)){let r=[];for(let i of e){let o=Wp(i,n);o!=null&&r.push(o)}return{kind:Xr.Kind.LIST,values:r}}return Wp(e,n)}if((0,Xr.isInputObjectType)(t)){if(!(0,hw.isObjectLike)(e))return null;let n=[];for(let r of Object.values(t.getFields())){let i=Wp(e[r.name],r.type);i&&n.push({kind:Xr.Kind.OBJECT_FIELD,name:{kind:Xr.Kind.NAME,value:r.name},value:i})}return{kind:Xr.Kind.OBJECT,fields:n}}if((0,Xr.isLeafType)(t)){let n=t.serialize(e);return n==null?null:(0,Xr.isEnumType)(t)?{kind:Xr.Kind.ENUM,value:n}:t.name==="ID"&&typeof n=="string"&&hq.test(n)?{kind:Xr.Kind.INT,value:n}:(0,mq.astFromValueUntyped)(n)}console.assert(!1,"Unexpected input type: "+(0,fq.inspect)(t))}Wm.astFromValue=Wp;var hq=/^-?(?:0|[1-9][0-9]*)$/});var Dg=F(rt=>{"use strict";d();m();f();Object.defineProperty(rt,"__esModule",{value:!0});rt.makeDirectiveNodes=rt.makeDirectiveNode=rt.makeDeprecatedDirective=rt.astFromEnumValue=rt.astFromInputField=rt.astFromField=rt.astFromScalarType=rt.astFromEnumType=rt.astFromInputObjectType=rt.astFromUnionType=rt.astFromInterfaceType=rt.astFromObjectType=rt.astFromArg=rt.getDeprecatableDirectiveNodes=rt.getDirectiveNodes=rt.astFromDirective=rt.astFromSchema=rt.printSchemaWithDirectives=rt.getDocumentNodeFromSchema=void 0;var Le=(he(),Te(Ie)),Za=gg(),bg=hg(),yq=Hm(),Tq=zp(),Eq=Hp(),_g=yw();function Tw(e,t={}){let n=t.pathToDirectivesInExtensions,r=e.getTypeMap(),i=Ew(e,n),o=i!=null?[i]:[],s=e.getDirectives();for(let a of s)(0,Le.isSpecifiedDirective)(a)||o.push(Nw(a,e,n));for(let a in r){let c=r[a],u=(0,Le.isSpecifiedScalarType)(c),l=(0,Le.isIntrospectionType)(c);if(!(u||l))if((0,Le.isObjectType)(c))o.push(gw(c,e,n));else if((0,Le.isInterfaceType)(c))o.push(vw(c,e,n));else if((0,Le.isUnionType)(c))o.push(Iw(c,e,n));else if((0,Le.isInputObjectType)(c))o.push(bw(c,e,n));else if((0,Le.isEnumType)(c))o.push(_w(c,e,n));else if((0,Le.isScalarType)(c))o.push(Ow(c,e,n));else throw new Error(`Unknown type ${c}.`)}return{kind:Le.Kind.DOCUMENT,definitions:o}}rt.getDocumentNodeFromSchema=Tw;function Nq(e,t={}){let n=Tw(e,t);return(0,Le.print)(n)}rt.printSchemaWithDirectives=Nq;function Ew(e,t){var c,u;let n=new Map([["query",void 0],["mutation",void 0],["subscription",void 0]]),r=[];if(e.astNode!=null&&r.push(e.astNode),e.extensionASTNodes!=null)for(let l of e.extensionASTNodes)r.push(l);for(let l of r)if(l.operationTypes)for(let p of l.operationTypes)n.set(p.operation,p);let i=(0,Eq.getRootTypeMap)(e);for(let[l,p]of n){let h=i.get(l);if(h!=null){let y=(0,Za.astFromType)(h);p!=null?p.type=y:n.set(l,{kind:Le.Kind.OPERATION_TYPE_DEFINITION,operation:l,type:y})}}let o=[...n.values()].filter(Tq.isSome),s=eu(e,e,t);if(!o.length&&!s.length)return null;let a={kind:o!=null?Le.Kind.SCHEMA_DEFINITION:Le.Kind.SCHEMA_EXTENSION,operationTypes:o,directives:s};return a.description=((u=(c=e.astNode)==null?void 0:c.description)!=null?u:e.description!=null)?{kind:Le.Kind.STRING,value:e.description,block:!0}:void 0,a}rt.astFromSchema=Ew;function Nw(e,t,n){var r,i,o,s;return{kind:Le.Kind.DIRECTIVE_DEFINITION,description:(i=(r=e.astNode)==null?void 0:r.description)!=null?i:e.description?{kind:Le.Kind.STRING,value:e.description}:void 0,name:{kind:Le.Kind.NAME,value:e.name},arguments:(o=e.args)==null?void 0:o.map(a=>Og(a,t,n)),repeatable:e.isRepeatable,locations:((s=e.locations)==null?void 0:s.map(a=>({kind:Le.Kind.NAME,value:a})))||[]}}rt.astFromDirective=Nw;function eu(e,t,n){let r=(0,bg.getDirectivesInExtensions)(e,n),i=[];e.astNode!=null&&i.push(e.astNode),"extensionASTNodes"in e&&e.extensionASTNodes!=null&&(i=i.concat(e.extensionASTNodes));let o;if(r!=null)o=Zm(t,r);else{o=[];for(let s of i)s.directives&&o.push(...s.directives)}return o}rt.getDirectiveNodes=eu;function ed(e,t,n){var a,c;let r=[],i=null,o=(0,bg.getDirectivesInExtensions)(e,n),s;return o!=null?s=Zm(t,o):s=(a=e.astNode)==null?void 0:a.directives,s!=null&&(r=s.filter(u=>u.name.value!=="deprecated"),e.deprecationReason!=null&&(i=(c=s.filter(u=>u.name.value==="deprecated"))==null?void 0:c[0])),e.deprecationReason!=null&&i==null&&(i=Aw(e.deprecationReason)),i==null?r:[i].concat(r)}rt.getDeprecatableDirectiveNodes=ed;function Og(e,t,n){var r,i,o;return{kind:Le.Kind.INPUT_VALUE_DEFINITION,description:(i=(r=e.astNode)==null?void 0:r.description)!=null?i:e.description?{kind:Le.Kind.STRING,value:e.description,block:!0}:void 0,name:{kind:Le.Kind.NAME,value:e.name},type:(0,Za.astFromType)(e.type),defaultValue:e.defaultValue!==void 0&&(o=(0,_g.astFromValue)(e.defaultValue,e.type))!=null?o:void 0,directives:ed(e,t,n)}}rt.astFromArg=Og;function gw(e,t,n){var r,i;return{kind:Le.Kind.OBJECT_TYPE_DEFINITION,description:(i=(r=e.astNode)==null?void 0:r.description)!=null?i:e.description?{kind:Le.Kind.STRING,value:e.description,block:!0}:void 0,name:{kind:Le.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(o=>Sg(o,t,n)),interfaces:Object.values(e.getInterfaces()).map(o=>(0,Za.astFromType)(o)),directives:eu(e,t,n)}}rt.astFromObjectType=gw;function vw(e,t,n){var i,o;let r={kind:Le.Kind.INTERFACE_TYPE_DEFINITION,description:(o=(i=e.astNode)==null?void 0:i.description)!=null?o:e.description?{kind:Le.Kind.STRING,value:e.description,block:!0}:void 0,name:{kind:Le.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(s=>Sg(s,t,n)),directives:eu(e,t,n)};return"getInterfaces"in e&&(r.interfaces=Object.values(e.getInterfaces()).map(s=>(0,Za.astFromType)(s))),r}rt.astFromInterfaceType=vw;function Iw(e,t,n){var r,i;return{kind:Le.Kind.UNION_TYPE_DEFINITION,description:(i=(r=e.astNode)==null?void 0:r.description)!=null?i:e.description?{kind:Le.Kind.STRING,value:e.description,block:!0}:void 0,name:{kind:Le.Kind.NAME,value:e.name},directives:eu(e,t,n),types:e.getTypes().map(o=>(0,Za.astFromType)(o))}}rt.astFromUnionType=Iw;function bw(e,t,n){var r,i;return{kind:Le.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:(i=(r=e.astNode)==null?void 0:r.description)!=null?i:e.description?{kind:Le.Kind.STRING,value:e.description,block:!0}:void 0,name:{kind:Le.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(o=>Sw(o,t,n)),directives:eu(e,t,n)}}rt.astFromInputObjectType=bw;function _w(e,t,n){var r,i;return{kind:Le.Kind.ENUM_TYPE_DEFINITION,description:(i=(r=e.astNode)==null?void 0:r.description)!=null?i:e.description?{kind:Le.Kind.STRING,value:e.description,block:!0}:void 0,name:{kind:Le.Kind.NAME,value:e.name},values:Object.values(e.getValues()).map(o=>Dw(o,t,n)),directives:eu(e,t,n)}}rt.astFromEnumType=_w;function Ow(e,t,n){var s,a,c;let r=(0,bg.getDirectivesInExtensions)(e,n),i=r?Zm(t,r):((s=e.astNode)==null?void 0:s.directives)||[],o=e.specifiedByUrl||e.specifiedByURL;if(o&&!i.some(u=>u.name.value==="specifiedBy")){let u={url:o};i.push(Zp("specifiedBy",u))}return{kind:Le.Kind.SCALAR_TYPE_DEFINITION,description:(c=(a=e.astNode)==null?void 0:a.description)!=null?c:e.description?{kind:Le.Kind.STRING,value:e.description,block:!0}:void 0,name:{kind:Le.Kind.NAME,value:e.name},directives:i}}rt.astFromScalarType=Ow;function Sg(e,t,n){var r,i;return{kind:Le.Kind.FIELD_DEFINITION,description:(i=(r=e.astNode)==null?void 0:r.description)!=null?i:e.description?{kind:Le.Kind.STRING,value:e.description,block:!0}:void 0,name:{kind:Le.Kind.NAME,value:e.name},arguments:e.args.map(o=>Og(o,t,n)),type:(0,Za.astFromType)(e.type),directives:ed(e,t,n)}}rt.astFromField=Sg;function Sw(e,t,n){var r,i,o;return{kind:Le.Kind.INPUT_VALUE_DEFINITION,description:(i=(r=e.astNode)==null?void 0:r.description)!=null?i:e.description?{kind:Le.Kind.STRING,value:e.description,block:!0}:void 0,name:{kind:Le.Kind.NAME,value:e.name},type:(0,Za.astFromType)(e.type),directives:ed(e,t,n),defaultValue:(o=(0,_g.astFromValue)(e.defaultValue,e.type))!=null?o:void 0}}rt.astFromInputField=Sw;function Dw(e,t,n){var r,i;return{kind:Le.Kind.ENUM_VALUE_DEFINITION,description:(i=(r=e.astNode)==null?void 0:r.description)!=null?i:e.description?{kind:Le.Kind.STRING,value:e.description,block:!0}:void 0,name:{kind:Le.Kind.NAME,value:e.name},directives:ed(e,t,n)}}rt.astFromEnumValue=Dw;function Aw(e){return Zp("deprecated",{reason:e},Le.GraphQLDeprecatedDirective)}rt.makeDeprecatedDirective=Aw;function Zp(e,t,n){let r=[];if(n!=null)for(let i of n.args){let o=i.name,s=t[o];if(s!==void 0){let a=(0,_g.astFromValue)(s,i.type);a&&r.push({kind:Le.Kind.ARGUMENT,name:{kind:Le.Kind.NAME,value:o},value:a})}}else for(let i in t){let o=t[i],s=(0,yq.astFromValueUntyped)(o);s&&r.push({kind:Le.Kind.ARGUMENT,name:{kind:Le.Kind.NAME,value:i},value:s})}return{kind:Le.Kind.DIRECTIVE,name:{kind:Le.Kind.NAME,value:e},arguments:r}}rt.makeDirectiveNode=Zp;function Zm(e,t){let n=[];for(let r in t){let i=t[r],o=e==null?void 0:e.getDirective(r);if(Array.isArray(i))for(let s of i)n.push(Zp(r,s,o));else n.push(Zp(r,i,o))}return n}rt.makeDirectiveNodes=Zm});var Rw=F(Ec=>{"use strict";d();m();f();Object.defineProperty(Ec,"__esModule",{value:!0});Ec.createDefaultRules=Ec.validateGraphQlDocuments=void 0;var eh=(he(),Te(Ie));function gq(e,t,n=ww()){var s;let r=new Map;for(let a of t)for(let c of a.definitions)"name"in c&&c.name?r.set(`${c.kind}_${c.name.value}`,c):r.set(Date.now().toString(),c);let i={kind:eh.Kind.DOCUMENT,definitions:Array.from(r.values())},o=(0,eh.validate)(e,i,n);for(let a of o)if(a.stack=a.message,a.locations)for(let c of a.locations)a.stack+=` - at ${(s=a.source)==null?void 0:s.name}:${c.line}:${c.column}`;return o}Ec.validateGraphQlDocuments=gq;function ww(){let e=["NoUnusedFragmentsRule","NoUnusedVariablesRule","KnownDirectivesRule"];return eh.versionInfo.major<15&&(e=e.map(t=>t.replace(/Rule$/,""))),eh.specifiedRules.filter(t=>!e.includes(t.name))}Ec.createDefaultRules=ww});var Lw=F(th=>{"use strict";d();m();f();Object.defineProperty(th,"__esModule",{value:!0});th.parseGraphQLJSON=void 0;var vq=(he(),Te(Ie));function Iq(e){return e=e.toString(),e.charCodeAt(0)===65279&&(e=e.slice(1)),e}function bq(e){return JSON.parse(Iq(e))}function _q(e,t,n){let r=bq(t);if(r.data&&(r=r.data),r.kind==="Document")return{location:e,document:r};if(r.__schema){let i=(0,vq.buildClientSchema)(r,n);return{location:e,schema:i}}else if(typeof r=="string")return{location:e,rawSDL:r};throw new Error("Not valid JSON content")}th.parseGraphQLJSON=_q});var wg=F(yn=>{"use strict";d();m();f();Object.defineProperty(yn,"__esModule",{value:!0});yn.getBlockStringIndentation=yn.dedentBlockStringValue=yn.getLeadingCommentBlock=yn.getComment=yn.getDescription=yn.printWithComments=yn.printComment=yn.pushComment=yn.collectComment=yn.resetComments=void 0;var xw=(he(),Te(Ie)),Oq=80,Nc={};function Sq(){Nc={}}yn.resetComments=Sq;function Dq(e){var n;let t=(n=e.name)==null?void 0:n.value;if(t!=null)switch(td(e,t),e.kind){case"EnumTypeDefinition":if(e.values)for(let r of e.values)td(r,t,r.name.value);break;case"ObjectTypeDefinition":case"InputObjectTypeDefinition":case"InterfaceTypeDefinition":if(e.fields){for(let r of e.fields)if(td(r,t,r.name.value),Fq(r)&&r.arguments)for(let i of r.arguments)td(i,t,r.name.value,i.name.value)}break}}yn.collectComment=Dq;function td(e,t,n,r){let i=Ag(e);if(typeof i!="string"||i.length===0)return;let o=[t];n&&(o.push(n),r&&o.push(r));let s=o.join(".");Nc[s]||(Nc[s]=[]),Nc[s].push(i)}yn.pushComment=td;function Cw(e){return` +`;for(let{subgraphName:a,concreteTypeNames:u}of i){let c=(0,Zl.getEntriesNotInHashSet)(o,u);n+=` Subgraph "${a}" does not define the following implementations: "`+c.join(So.QUOTATION_JOIN)+`" +`}}return new Error(n)}F.undefinedEntityInterfaceImplementationsError=rU;function iU(e,t){return new Error(`The maximum number of OR scopes that can be defined by @requiresScopes on a single field is ${e}. However, the following path`+(t.length>1?"s attempt":" attempts")+` to define more: + "`+t.join(So.QUOTATION_JOIN)+`" +If you require more, please contact support.`)}F.orScopesLimitError=iU});var bf=L(wi=>{"use strict";d();f();p();Object.defineProperty(wi,"__esModule",{value:!0});wi.isFieldInaccessible=wi.newPersistedDirectivesContainer=wi.MergeMethod=wi.EXECUTABLE_DIRECTIVE_LOCATIONS=void 0;var Do=Or();wi.EXECUTABLE_DIRECTIVE_LOCATIONS=new Set([Do.FIELD_UPPER,Do.FRAGMENT_DEFINITION_UPPER,Do.FRAGMENT_SPREAD_UPPER,Do.INLINE_FRAGMENT_UPPER,Do.MUTATION_UPPER,Do.QUERY_UPPER,Do.SUBSCRIPTION_UPPER]);var jS;(function(e){e[e.UNION=0]="UNION",e[e.INTERSECTION=1]="INTERSECTION",e[e.CONSISTENT=2]="CONSISTENT"})(jS||(wi.MergeMethod=jS={}));function sU(){return{deprecated:{},directives:new Map,tags:new Map}}wi.newPersistedDirectivesContainer=sU;function oU(e){return e.directives.directives.has(Do.INACCESSIBLE)}wi.isFieldInaccessible=oU});var Ar=L(ve=>{"use strict";d();f();p();Object.defineProperty(ve,"__esModule",{value:!0});ve.safeParse=ve.lexicographicallySortDocumentNode=ve.lexicographicallySortSelectionSetNode=ve.lexicographicallySortArgumentNodes=ve.setLongestDescriptionForNode=ve.formatDescription=ve.addConcreteTypesForUnion=ve.addConcreteTypesForImplementedInterfaces=ve.pushPersistedDirectivesAndGetNode=ve.mergeExecutableDirectiveLocations=ve.extractExecutableDirectiveLocations=ve.isKindAbstract=ve.operationTypeNodeToDefaultType=ve.nodeKindToDirectiveLocation=ve.setToNamedTypeNodeArray=ve.stringToNamedTypeNode=ve.setToNameNodeArray=ve.stringArrayToNameNodeArray=ve.stringToNameNode=ve.areBaseAndExtensionKindsCompatible=ve.isNodeOverridden=ve.isNodeExternal=ve.isNodeShareable=ve.extractInterfaces=ve.isNodeExtension=ve.isNodeInterfaceObject=ve.isObjectLikeNodeEntity=void 0;var je=(ne(),se(ce)),Qt=Or(),GS=ai(),aU=bf();function uU(e){var t;if(!((t=e.directives)!=null&&t.length))return!1;for(let n of e.directives)if(n.name.value===Qt.KEY)return!0;return!1}ve.isObjectLikeNodeEntity=uU;function cU(e){var t;if(!((t=e.directives)!=null&&t.length))return!1;for(let n of e.directives)if(n.name.value===Qt.INTERFACE_OBJECT)return!0;return!1}ve.isNodeInterfaceObject=cU;function lU(e){var t;if(!((t=e.directives)!=null&&t.length))return!1;for(let n of e.directives)if(n.name.value===Qt.EXTENDS)return!0;return!1}ve.isNodeExtension=lU;function dU(e,t,n){if(!e.interfaces)return t;let r=e.name.value;for(let i of e.interfaces){let s=i.name.value;if(n&&t.has(s)){n.push((0,GS.duplicateInterfaceError)(s,r));continue}t.add(s)}return t}ve.extractInterfaces=dU;function pU(e){if(!e.directives)return!1;for(let t of e.directives)if(t.name.value===Qt.SHAREABLE)return!0;return!1}ve.isNodeShareable=pU;function fU(e){if(!e.directives)return!1;for(let t of e.directives)if(t.name.value===Qt.EXTERNAL)return!0;return!1}ve.isNodeExternal=fU;function mU(e){if(!e.directives)return!1;for(let t of e.directives)if(t.name.value===Qt.OVERRIDE)return!0;return!1}ve.isNodeOverridden=mU;function hU(e,t,n){switch(e){case je.Kind.ENUM_TYPE_DEFINITION:return t===je.Kind.ENUM_TYPE_EXTENSION;case je.Kind.INPUT_OBJECT_TYPE_DEFINITION:return t===je.Kind.INPUT_OBJECT_TYPE_EXTENSION;case je.Kind.INTERFACE_TYPE_DEFINITION:return t===je.Kind.INTERFACE_TYPE_EXTENSION;case je.Kind.OBJECT_TYPE_DEFINITION:return t===je.Kind.OBJECT_TYPE_EXTENSION;case je.Kind.SCALAR_TYPE_DEFINITION:return t===je.Kind.SCALAR_TYPE_EXTENSION;case je.Kind.UNION_TYPE_DEFINITION:return t===je.Kind.UNION_TYPE_EXTENSION;default:throw(0,GS.unexpectedKindFatalError)(n)}}ve.areBaseAndExtensionKindsCompatible=hU;function Sf(e){return{kind:je.Kind.NAME,value:e}}ve.stringToNameNode=Sf;function TU(e){let t=[];for(let n of e)t.push(Sf(n));return t}ve.stringArrayToNameNodeArray=TU;function yU(e){let t=[];for(let n of e)t.push(Sf(n));return t}ve.setToNameNodeArray=yU;function qS(e){return{kind:je.Kind.NAMED_TYPE,name:Sf(e)}}ve.stringToNamedTypeNode=qS;function EU(e){let t=[];for(let n of e)t.push(qS(n));return t}ve.setToNamedTypeNodeArray=EU;function NU(e){switch(e){case je.Kind.ARGUMENT:return Qt.ARGUMENT_DEFINITION_UPPER;case je.Kind.ENUM_TYPE_DEFINITION:case je.Kind.ENUM_TYPE_EXTENSION:return Qt.ENUM_UPPER;case je.Kind.ENUM_VALUE_DEFINITION:return Qt.ENUM_VALUE_UPPER;case je.Kind.FIELD_DEFINITION:return Qt.FIELD_DEFINITION_UPPER;case je.Kind.FRAGMENT_DEFINITION:return Qt.FRAGMENT_DEFINITION_UPPER;case je.Kind.FRAGMENT_SPREAD:return Qt.FRAGMENT_SPREAD_UPPER;case je.Kind.INLINE_FRAGMENT:return Qt.INLINE_FRAGMENT_UPPER;case je.Kind.INPUT_VALUE_DEFINITION:return Qt.INPUT_FIELD_DEFINITION_UPPER;case je.Kind.INPUT_OBJECT_TYPE_DEFINITION:case je.Kind.INPUT_OBJECT_TYPE_EXTENSION:return Qt.INPUT_OBJECT_UPPER;case je.Kind.INTERFACE_TYPE_DEFINITION:case je.Kind.INTERFACE_TYPE_EXTENSION:return Qt.INTERFACE_UPPER;case je.Kind.OBJECT_TYPE_DEFINITION:case je.Kind.OBJECT_TYPE_EXTENSION:return Qt.OBJECT_UPPER;case je.Kind.SCALAR_TYPE_DEFINITION:case je.Kind.SCALAR_TYPE_EXTENSION:return Qt.SCALAR_UPPER;case je.Kind.SCHEMA_DEFINITION:case je.Kind.SCHEMA_EXTENSION:return Qt.SCHEMA_UPPER;case je.Kind.UNION_TYPE_DEFINITION:case je.Kind.UNION_TYPE_EXTENSION:return Qt.UNION_UPPER;default:return e}}ve.nodeKindToDirectiveLocation=NU;ve.operationTypeNodeToDefaultType=new Map([[je.OperationTypeNode.MUTATION,Qt.MUTATION],[je.OperationTypeNode.QUERY,Qt.QUERY],[je.OperationTypeNode.SUBSCRIPTION,Qt.SUBSCRIPTION]]);function gU(e){return e===je.Kind.INTERFACE_TYPE_DEFINITION||e===je.Kind.UNION_TYPE_DEFINITION}ve.isKindAbstract=gU;function IU(e,t){for(let n of e){let r=n.value;aU.EXECUTABLE_DIRECTIVE_LOCATIONS.has(r)&&t.add(r)}return t}ve.extractExecutableDirectiveLocations=IU;function vU(e,t){let n=new Set;for(let r of e){let i=r.value;t.executableLocations.has(i)&&n.add(i)}return t.executableLocations=n,n}ve.mergeExecutableDirectiveLocations=vU;function _U(e){let t=[...e.directives.tags.values()],n=e.directives.deprecated.directive;n&&t.push(n);for(let r of e.directives.directives.values())t.push(...r);return e.node.directives=t,e.node}ve.pushPersistedDirectivesAndGetNode=_U;function bU(e,t){if(!e.interfaces||e.interfaces.length<1)return;let n=e.name.value;for(let r of e.interfaces){let i=r.name.value,s=t.get(i);s?s.add(n):t.set(i,new Set([n]))}}ve.addConcreteTypesForImplementedInterfaces=bU;function SU(e,t){if(!e.types||e.types.length<1)return;let n=e.name.value;for(let r of e.types){let i=r.name.value,s=t.get(n);s?s.add(i):t.set(n,new Set([i]))}}ve.addConcreteTypesForUnion=SU;function DU(e){if(!e)return e;let t=e.value;if(e.block){let n=t.split(` +`);n.length>1&&(t=n.map(r=>r.trimStart()).join(` +`))}return M(A({},e),{value:t,block:!0})}ve.formatDescription=DU;function OU(e,t){t&&(!e.description||t.value.length>e.description.value.length)&&(e.description=M(A({},t),{block:!0}))}ve.setLongestDescriptionForNode=OU;function KS(e){return e.arguments?e.arguments.sort((n,r)=>n.name.value.localeCompare(r.name.value)):e.arguments}ve.lexicographicallySortArgumentNodes=KS;function IE(e){let t=e.selections;return M(A({},e),{selections:t.sort((n,r)=>n.name.value.localeCompare(r.name.value)).map(n=>M(A({},n),{arguments:KS(n),selectionSet:n.selectionSet?IE(n.selectionSet):n.selectionSet}))})}ve.lexicographicallySortSelectionSetNode=IE;function AU(e){return M(A({},e),{definitions:e.definitions.map(t=>t.kind!==je.Kind.OPERATION_DEFINITION?t:M(A({},t),{selectionSet:IE(t.selectionSet)}))})}ve.lexicographicallySortDocumentNode=AU;function wU(e){try{return{documentNode:(0,je.parse)(e)}}catch(t){return{error:t}}}ve.safeParse=wU});var Oo=L(mn=>{"use strict";d();f();p();Object.defineProperty(mn,"__esModule",{value:!0});mn.INHERITABLE_DIRECTIVE_NAMES=mn.MAXIMUM_TYPE_NESTING=mn.SCOPE_SCALAR_DEFINITION=mn.FIELD_SET_SCALAR_DEFINITION=mn.VERSION_TWO_DIRECTIVE_DEFINITIONS=mn.BASE_DIRECTIVE_DEFINITIONS=mn.V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME=mn.BASE_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME=mn.BASE_SCALARS=void 0;var ye=(ne(),se(ce)),ee=Ar(),V=Or();mn.BASE_SCALARS=new Set(["_Any","_Entities","Boolean","Float","ID","Int",V.FIELD_SET_SCALAR,V.SCOPE_SCALAR,V.STRING_SCALAR]);var QS={arguments:[{kind:ye.Kind.INPUT_VALUE_DEFINITION,name:(0,ee.stringToNameNode)(V.REASON),type:(0,ee.stringToNamedTypeNode)(V.STRING_SCALAR),defaultValue:{kind:ye.Kind.STRING,value:"No longer supported"}}],kind:ye.Kind.DIRECTIVE_DEFINITION,locations:(0,ee.stringArrayToNameNodeArray)([V.ARGUMENT_DEFINITION_UPPER,V.ENUM_VALUE_UPPER,V.FIELD_DEFINITION_UPPER,V.INPUT_FIELD_DEFINITION_UPPER]),name:(0,ee.stringToNameNode)(V.DEPRECATED),repeatable:!1},YS={kind:ye.Kind.DIRECTIVE_DEFINITION,locations:(0,ee.stringArrayToNameNodeArray)([V.INTERFACE_UPPER,V.OBJECT_UPPER]),name:(0,ee.stringToNameNode)(V.EXTENDS),repeatable:!1},JS={kind:ye.Kind.DIRECTIVE_DEFINITION,locations:(0,ee.stringArrayToNameNodeArray)([V.FIELD_DEFINITION_UPPER,V.OBJECT_UPPER]),name:(0,ee.stringToNameNode)(V.EXTERNAL),repeatable:!1},zS={arguments:[{kind:ye.Kind.INPUT_VALUE_DEFINITION,name:(0,ee.stringToNameNode)(V.TOPIC),type:{kind:ye.Kind.NON_NULL_TYPE,type:(0,ee.stringToNamedTypeNode)(V.STRING_SCALAR)}},{kind:ye.Kind.INPUT_VALUE_DEFINITION,name:(0,ee.stringToNameNode)(V.SOURCE_ID),type:(0,ee.stringToNamedTypeNode)(V.STRING_SCALAR)}],kind:ye.Kind.DIRECTIVE_DEFINITION,locations:[(0,ee.stringToNameNode)(V.FIELD_DEFINITION_UPPER)],name:(0,ee.stringToNameNode)(V.EVENTS_PUBLISH),repeatable:!1},XS={arguments:[{kind:ye.Kind.INPUT_VALUE_DEFINITION,name:(0,ee.stringToNameNode)(V.TOPIC),type:{kind:ye.Kind.NON_NULL_TYPE,type:(0,ee.stringToNamedTypeNode)(V.STRING_SCALAR)}},{kind:ye.Kind.INPUT_VALUE_DEFINITION,name:(0,ee.stringToNameNode)(V.SOURCE_ID),type:(0,ee.stringToNamedTypeNode)(V.STRING_SCALAR)}],kind:ye.Kind.DIRECTIVE_DEFINITION,locations:[(0,ee.stringToNameNode)(V.FIELD_DEFINITION_UPPER)],name:(0,ee.stringToNameNode)(V.EVENTS_REQUEST),repeatable:!1},HS={arguments:[{kind:ye.Kind.INPUT_VALUE_DEFINITION,name:(0,ee.stringToNameNode)(V.TOPIC),type:{kind:ye.Kind.NON_NULL_TYPE,type:(0,ee.stringToNamedTypeNode)(V.STRING_SCALAR)}},{kind:ye.Kind.INPUT_VALUE_DEFINITION,name:(0,ee.stringToNameNode)(V.SOURCE_ID),type:(0,ee.stringToNamedTypeNode)(V.STRING_SCALAR)}],kind:ye.Kind.DIRECTIVE_DEFINITION,locations:[(0,ee.stringToNameNode)(V.FIELD_DEFINITION_UPPER)],name:(0,ee.stringToNameNode)(V.EVENTS_SUBSCRIBE),repeatable:!1},WS={arguments:[{kind:ye.Kind.INPUT_VALUE_DEFINITION,name:(0,ee.stringToNameNode)(V.FIELDS),type:{kind:ye.Kind.NON_NULL_TYPE,type:(0,ee.stringToNamedTypeNode)(V.FIELD_SET_SCALAR)}},{kind:ye.Kind.INPUT_VALUE_DEFINITION,name:(0,ee.stringToNameNode)(V.RESOLVABLE),type:(0,ee.stringToNamedTypeNode)(V.BOOLEAN_TYPE),defaultValue:{kind:ye.Kind.BOOLEAN,value:!0}}],kind:ye.Kind.DIRECTIVE_DEFINITION,locations:(0,ee.stringArrayToNameNodeArray)([V.INTERFACE_UPPER,V.OBJECT_UPPER]),name:(0,ee.stringToNameNode)(V.KEY),repeatable:!0},ZS={arguments:[{kind:ye.Kind.INPUT_VALUE_DEFINITION,name:(0,ee.stringToNameNode)(V.FIELDS),type:{kind:ye.Kind.NON_NULL_TYPE,type:(0,ee.stringToNamedTypeNode)(V.FIELD_SET_SCALAR)}}],kind:ye.Kind.DIRECTIVE_DEFINITION,locations:[(0,ee.stringToNameNode)(V.FIELD_DEFINITION_UPPER)],name:(0,ee.stringToNameNode)(V.PROVIDES),repeatable:!1},e0={arguments:[{kind:ye.Kind.INPUT_VALUE_DEFINITION,name:(0,ee.stringToNameNode)(V.FIELDS),type:{kind:ye.Kind.NON_NULL_TYPE,type:(0,ee.stringToNamedTypeNode)(V.FIELD_SET_SCALAR)}}],kind:ye.Kind.DIRECTIVE_DEFINITION,locations:[(0,ee.stringToNameNode)(V.FIELD_DEFINITION_UPPER)],name:(0,ee.stringToNameNode)(V.REQUIRES),repeatable:!1},t0={arguments:[{kind:ye.Kind.INPUT_VALUE_DEFINITION,name:(0,ee.stringToNameNode)(V.URL_LOWER),type:{kind:ye.Kind.NON_NULL_TYPE,type:(0,ee.stringToNamedTypeNode)(V.STRING_SCALAR)}}],kind:ye.Kind.DIRECTIVE_DEFINITION,locations:(0,ee.stringArrayToNameNodeArray)([V.SCALAR_UPPER]),name:(0,ee.stringToNameNode)(V.SPECIFIED_BY),repeatable:!1},n0={arguments:[{kind:ye.Kind.INPUT_VALUE_DEFINITION,name:(0,ee.stringToNameNode)(V.NAME),type:{kind:ye.Kind.NON_NULL_TYPE,type:(0,ee.stringToNamedTypeNode)(V.STRING_SCALAR)}}],kind:ye.Kind.DIRECTIVE_DEFINITION,locations:(0,ee.stringArrayToNameNodeArray)([V.ARGUMENT_DEFINITION_UPPER,V.ENUM_UPPER,V.ENUM_VALUE_UPPER,V.FIELD_DEFINITION_UPPER,V.INPUT_FIELD_DEFINITION_UPPER,V.INPUT_OBJECT_UPPER,V.INTERFACE_UPPER,V.OBJECT_UPPER,V.SCALAR_UPPER,V.UNION_UPPER]),name:(0,ee.stringToNameNode)(V.TAG),repeatable:!0};mn.BASE_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME=new Map([[V.DEPRECATED,QS],[V.EXTENDS,YS],[V.EXTERNAL,JS],[V.EVENTS_PUBLISH,zS],[V.EVENTS_REQUEST,XS],[V.EVENTS_SUBSCRIBE,HS],[V.KEY,WS],[V.PROVIDES,ZS],[V.REQUIRES,e0],[V.SPECIFIED_BY,t0],[V.TAG,n0]]);var r0={kind:ye.Kind.DIRECTIVE_DEFINITION,locations:(0,ee.stringArrayToNameNodeArray)([V.ENUM_UPPER,V.FIELD_DEFINITION_UPPER,V.INTERFACE_UPPER,V.OBJECT_UPPER,V.SCALAR_UPPER]),name:(0,ee.stringToNameNode)(V.AUTHENTICATED),repeatable:!1},i0={arguments:[{kind:ye.Kind.INPUT_VALUE_DEFINITION,name:(0,ee.stringToNameNode)(V.NAME),type:{kind:ye.Kind.NON_NULL_TYPE,type:(0,ee.stringToNamedTypeNode)(V.STRING_SCALAR)}}],kind:ye.Kind.DIRECTIVE_DEFINITION,locations:(0,ee.stringArrayToNameNodeArray)([V.SCHEMA_UPPER]),name:(0,ee.stringToNameNode)(V.COMPOSE_DIRECTIVE),repeatable:!0},s0={kind:ye.Kind.DIRECTIVE_DEFINITION,locations:(0,ee.stringArrayToNameNodeArray)([V.ARGUMENT_DEFINITION_UPPER,V.ENUM_UPPER,V.ENUM_VALUE_UPPER,V.FIELD_DEFINITION_UPPER,V.INPUT_FIELD_DEFINITION_UPPER,V.INPUT_OBJECT_UPPER,V.INTERFACE_UPPER,V.OBJECT_UPPER,V.SCALAR_UPPER,V.UNION_UPPER]),name:(0,ee.stringToNameNode)(V.INACCESSIBLE),repeatable:!1},o0={kind:ye.Kind.DIRECTIVE_DEFINITION,locations:(0,ee.stringArrayToNameNodeArray)([V.OBJECT_UPPER]),name:(0,ee.stringToNameNode)(V.INTERFACE_OBJECT),repeatable:!1},a0={arguments:[{kind:ye.Kind.INPUT_VALUE_DEFINITION,name:(0,ee.stringToNameNode)(V.URL_LOWER),type:{kind:ye.Kind.NON_NULL_TYPE,type:(0,ee.stringToNamedTypeNode)(V.STRING_SCALAR)}},{kind:ye.Kind.INPUT_VALUE_DEFINITION,name:(0,ee.stringToNameNode)("as"),type:(0,ee.stringToNamedTypeNode)(V.STRING_SCALAR)},{kind:ye.Kind.INPUT_VALUE_DEFINITION,name:(0,ee.stringToNameNode)("for"),type:(0,ee.stringToNamedTypeNode)(V.STRING_SCALAR)},{kind:ye.Kind.INPUT_VALUE_DEFINITION,name:(0,ee.stringToNameNode)("import"),type:{kind:ye.Kind.LIST_TYPE,type:(0,ee.stringToNamedTypeNode)(V.STRING_SCALAR)}}],kind:ye.Kind.DIRECTIVE_DEFINITION,locations:(0,ee.stringArrayToNameNodeArray)([V.SCHEMA_UPPER]),name:(0,ee.stringToNameNode)(V.LINK),repeatable:!0},u0={arguments:[{kind:ye.Kind.INPUT_VALUE_DEFINITION,name:(0,ee.stringToNameNode)(V.FROM),type:{kind:ye.Kind.NON_NULL_TYPE,type:(0,ee.stringToNamedTypeNode)(V.STRING_SCALAR)}}],kind:ye.Kind.DIRECTIVE_DEFINITION,locations:(0,ee.stringArrayToNameNodeArray)([V.FIELD_DEFINITION_UPPER]),name:(0,ee.stringToNameNode)(V.OVERRIDE),repeatable:!1},c0={arguments:[{kind:ye.Kind.INPUT_VALUE_DEFINITION,name:(0,ee.stringToNameNode)(V.SCOPES),type:{kind:ye.Kind.NON_NULL_TYPE,type:{kind:ye.Kind.LIST_TYPE,type:{kind:ye.Kind.NON_NULL_TYPE,type:{kind:ye.Kind.LIST_TYPE,type:{kind:ye.Kind.NON_NULL_TYPE,type:(0,ee.stringToNamedTypeNode)(V.SCOPE_SCALAR)}}}}}}],kind:ye.Kind.DIRECTIVE_DEFINITION,locations:(0,ee.stringArrayToNameNodeArray)([V.ENUM_UPPER,V.FIELD_DEFINITION_UPPER,V.INTERFACE_UPPER,V.OBJECT_UPPER,V.SCALAR_UPPER]),name:(0,ee.stringToNameNode)(V.REQUIRES_SCOPES),repeatable:!1},l0={kind:ye.Kind.DIRECTIVE_DEFINITION,locations:(0,ee.stringArrayToNameNodeArray)([V.FIELD_DEFINITION_UPPER,V.OBJECT_UPPER]),name:(0,ee.stringToNameNode)(V.SHAREABLE),repeatable:!1};mn.V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME=new Map([[V.AUTHENTICATED,r0],[V.COMPOSE_DIRECTIVE,i0],[V.INACCESSIBLE,s0],[V.INTERFACE_OBJECT,o0],[V.LINK,a0],[V.OVERRIDE,u0],[V.REQUIRES_SCOPES,c0],[V.SHAREABLE,l0]]);mn.BASE_DIRECTIVE_DEFINITIONS=[QS,YS,JS,zS,XS,HS,WS,ZS,e0,t0,n0];mn.VERSION_TWO_DIRECTIVE_DEFINITIONS=[r0,i0,s0,o0,a0,u0,c0,l0];mn.FIELD_SET_SCALAR_DEFINITION={kind:ye.Kind.SCALAR_TYPE_DEFINITION,name:(0,ee.stringToNameNode)(V.FIELD_SET_SCALAR)};mn.SCOPE_SCALAR_DEFINITION={kind:ye.Kind.SCALAR_TYPE_DEFINITION,name:(0,ee.stringToNameNode)(V.SCOPE_SCALAR)};mn.MAXIMUM_TYPE_NESTING=30;mn.INHERITABLE_DIRECTIVE_NAMES=[V.EXTERNAL,V.SHAREABLE]});var ed=L(Lt=>{"use strict";d();f();p();Object.defineProperty(Lt,"__esModule",{value:!0});Lt.deepCopyTypeNode=Lt.getMutableUnionNode=Lt.getMutableTypeNode=Lt.getMutableScalarNode=Lt.getMutableObjectExtensionNode=Lt.getMutableObjectNode=Lt.getMutableInterfaceNode=Lt.getMutableInputValueNode=Lt.getMutableInputObjectNode=Lt.getMutableFieldNode=Lt.getMutableEnumValueNode=Lt.getMutableEnumNode=void 0;var Ao=(ne(),se(ce)),Fi=Ar(),d0=ai(),Df=Oo();function FU(e){var t;return{kind:e.kind,name:A({},e.name),description:(0,Fi.formatDescription)(e.description),values:(t=e.values)==null?void 0:t.map(n=>p0(n))}}Lt.getMutableEnumNode=FU;function p0(e){return{directives:[],kind:e.kind,name:A({},e.name),description:(0,Fi.formatDescription)(e.description)}}Lt.getMutableEnumValueNode=p0;function LU(e,t){return{arguments:[],directives:[],kind:e.kind,name:A({},e.name),type:vE(e.type,t,e.name.value),description:(0,Fi.formatDescription)(e.description)}}Lt.getMutableFieldNode=LU;function RU(e){return{kind:e.kind,name:A({},e.name),description:(0,Fi.formatDescription)(e.description)}}Lt.getMutableInputObjectNode=RU;function kU(e,t,n){return{directives:[],kind:e.kind,name:A({},e.name),type:vE(e.type,t,n),defaultValue:e.defaultValue,description:(0,Fi.formatDescription)(e.description)}}Lt.getMutableInputValueNode=kU;function xU(e){return{kind:e.kind,name:A({},e.name),description:(0,Fi.formatDescription)(e.description)}}Lt.getMutableInterfaceNode=xU;function PU(e){return{kind:e.kind,name:A({},e.name),description:(0,Fi.formatDescription)(e.description)}}Lt.getMutableObjectNode=PU;function MU(e){let t=e.kind===Ao.Kind.OBJECT_TYPE_DEFINITION?e.description:void 0;return{kind:Ao.Kind.OBJECT_TYPE_EXTENSION,name:A({},e.name),description:(0,Fi.formatDescription)(t)}}Lt.getMutableObjectExtensionNode=MU;function UU(e){return{kind:e.kind,name:A({},e.name),description:(0,Fi.formatDescription)(e.description)}}Lt.getMutableScalarNode=UU;function CU(e,t){let n={kind:e.kind},r=n;for(let i=0;i{"use strict";d();f();p();Object.defineProperty(Rt,"__esModule",{value:!0});Rt.unionTypeDefinitionNodeToMutable=Rt.scalarTypeDefinitionNodeToMutable=Rt.objectTypeExtensionNodeToMutableDefinitionNode=Rt.objectTypeExtensionNodeToMutable=Rt.objectTypeDefinitionNodeToMutable=Rt.interfaceTypeDefinitionNodeToMutable=Rt.inputValueDefinitionNodeToMutable=Rt.inputObjectTypeDefinitionNodeToMutable=Rt.fieldDefinitionNodeToMutable=Rt.enumValueDefinitionNodeToMutable=Rt.enumTypeDefinitionNodeToMutable=Rt.directiveDefinitionNodeToMutable=void 0;var f0=(ne(),se(ce)),Li=Ar(),m0=ed();function Of(e,t,n){if(e.fields)for(let r of e.fields)t.push(T0(r,e.name.value));if(e.interfaces)for(let r of e.interfaces)n.push(A({},r))}function $U(e){return{arguments:e.arguments?[...e.arguments]:void 0,description:(0,Li.formatDescription)(e.description),kind:e.kind,locations:[...e.locations],name:A({},e.name),repeatable:e.repeatable}}Rt.directiveDefinitionNodeToMutable=$U;function VU(e){let t=[];if(e.values)for(let n of e.values)t.push(h0(n));return{description:(0,Li.formatDescription)(e.description),kind:e.kind,name:A({},e.name),values:t}}Rt.enumTypeDefinitionNodeToMutable=VU;function h0(e){return{description:(0,Li.formatDescription)(e.description),kind:e.kind,name:A({},e.name)}}Rt.enumValueDefinitionNodeToMutable=h0;function T0(e,t){let n=[];if(e.arguments)for(let r of e.arguments)n.push(_E(r,e.name.value));return{arguments:n,description:(0,Li.formatDescription)(e.description),kind:e.kind,name:A({},e.name),type:(0,m0.deepCopyTypeNode)(e.type,t,e.name.value)}}Rt.fieldDefinitionNodeToMutable=T0;function jU(e){let t=[];if(e.fields)for(let n of e.fields)t.push(_E(n,e.name.value));return{description:(0,Li.formatDescription)(e.description),fields:t,kind:e.kind,name:A({},e.name)}}Rt.inputObjectTypeDefinitionNodeToMutable=jU;function _E(e,t){return{defaultValue:e.defaultValue?A({},e.defaultValue):void 0,description:(0,Li.formatDescription)(e.description),directives:e.directives?[...e.directives]:void 0,kind:e.kind,name:A({},e.name),type:(0,m0.deepCopyTypeNode)(e.type,t,e.name.value)}}Rt.inputValueDefinitionNodeToMutable=_E;function GU(e){let t=[],n=[];return Of(e,t,n),{description:(0,Li.formatDescription)(e.description),fields:t,interfaces:n,kind:e.kind,name:A({},e.name)}}Rt.interfaceTypeDefinitionNodeToMutable=GU;function qU(e){let t=[],n=[];return Of(e,t,n),{description:(0,Li.formatDescription)(e.description),fields:t,interfaces:n,kind:e.kind,name:A({},e.name)}}Rt.objectTypeDefinitionNodeToMutable=qU;function KU(e){let t=[],n=[];return Of(e,t,n),{fields:t,interfaces:n,kind:e.kind,name:A({},e.name)}}Rt.objectTypeExtensionNodeToMutable=KU;function QU(e){let t=[],n=[];return Of(e,t,n),{fields:t,interfaces:n,kind:f0.Kind.OBJECT_TYPE_DEFINITION,name:A({},e.name)}}Rt.objectTypeExtensionNodeToMutableDefinitionNode=QU;function YU(e){return{description:(0,Li.formatDescription)(e.description),kind:f0.Kind.SCALAR_TYPE_DEFINITION,name:A({},e.name)}}Rt.scalarTypeDefinitionNodeToMutable=YU;function JU(e){let t=[];if(e.types)for(let n of e.types)t.push(A({},n));return{description:(0,Li.formatDescription)(e.description),kind:e.kind,name:A({},e.name),types:t}}Rt.unionTypeDefinitionNodeToMutable=JU});function gt(){gt.init.call(this)}function wf(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function D0(e){return e._maxListeners===void 0?gt.defaultMaxListeners:e._maxListeners}function g0(e,t,n,r){var i,s,o,a;if(wf(n),(s=e._events)===void 0?(s=e._events=Object.create(null),e._eventsCount=0):(s.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),o===void 0)o=s[t]=n,++e._eventsCount;else if(typeof o=="function"?o=s[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=D0(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,a=u,console&&console.warn&&console.warn(a)}return e}function zU(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function I0(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=zU.bind(r);return i.listener=n,r.wrapFn=i,i}function v0(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?function(s){for(var o=new Array(s.length),a=0;a{"use strict";d();f();p();wu=typeof Reflect=="object"?Reflect:null,y0=wu&&typeof wu.apply=="function"?wu.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};S0=wu&&typeof wu.ownKeys=="function"?wu.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};E0=Number.isNaN||function(e){return e!=e};b0=gt,gt.EventEmitter=gt,gt.prototype._events=void 0,gt.prototype._eventsCount=0,gt.prototype._maxListeners=void 0;N0=10;Object.defineProperty(gt,"defaultMaxListeners",{enumerable:!0,get:function(){return N0},set:function(e){if(typeof e!="number"||e<0||E0(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");N0=e}}),gt.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},gt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||E0(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},gt.prototype.getMaxListeners=function(){return D0(this)},gt.prototype.emit=function(e){for(var t=[],n=1;n0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var a=i[e];if(a===void 0)return!1;if(typeof a=="function")y0(a,this,t);else{var u=a.length,c=O0(a,u);for(n=0;n=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,i=s;break}if(i<0)return this;i===0?n.shift():function(a,u){for(;u+1=0;r--)this.removeListener(e,t[r]);return this},gt.prototype.listeners=function(e){return v0(this,e,!0)},gt.prototype.rawListeners=function(e){return v0(this,e,!1)},gt.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):_0.call(e,t)},gt.prototype.listenerCount=_0,gt.prototype.eventNames=function(){return this._eventsCount>0?S0(this._events):[]};wr=b0;wr.EventEmitter;wr.defaultMaxListeners;wr.init;wr.listenerCount;wr.EventEmitter;wr.defaultMaxListeners;wr.init;wr.listenerCount});var A0,Fae,Lae,Rae,kae,xae,w0=j(()=>{"use strict";d();f();p();bE();bE();wr.once=function(e,t){return new Promise((n,r)=>{function i(...o){s!==void 0&&e.removeListener("error",s),n(o)}let s;t!=="error"&&(s=o=>{e.removeListener(name,i),r(o)},e.once("error",s)),e.once(t,i)})};wr.on=function(e,t){let n=[],r=[],i=null,s=!1,o={next(){return nr(this,null,function*(){let l=n.shift();if(l)return createIterResult(l,!1);if(i){let m=Promise.reject(i);return i=null,m}return s?createIterResult(void 0,!0):new Promise((m,h)=>r.push({resolve:m,reject:h}))})},return(){return nr(this,null,function*(){e.removeListener(t,a),e.removeListener("error",u),s=!0;for(let l of r)l.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)})},throw(l){i=l,e.removeListener(t,a),e.removeListener("error",u)},[Symbol.asyncIterator](){return this}};return e.on(t,a),e.on("error",u),o;function a(...l){let m=r.shift();m?m.resolve(createIterResult(l,!1)):n.push(l)}function u(l){s=!0;let m=r.shift();m?m.reject(l):i=l,o.return()}};({EventEmitter:A0,defaultMaxListeners:Fae,init:Lae,listenerCount:Rae,on:kae,once:xae}=wr)});var Ff=L((Vae,F0)=>{"use strict";d();f();p();function Ri(e){if(typeof e!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=e}typeof Symbol!="undefined"&&(Ri.prototype[Symbol.iterator]=function(){return this});Ri.of=function(){var e=arguments,t=e.length,n=0;return new Ri(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})};Ri.empty=function(){var e=new Ri(function(){return{done:!0}});return e};Ri.fromSequence=function(e){var t=0,n=e.length;return new Ri(function(){return t>=n?{done:!0}:{done:!1,value:e[t++]}})};Ri.is=function(e){return e instanceof Ri?!0:typeof e=="object"&&e!==null&&typeof e.next=="function"};F0.exports=Ri});var L0=L(SE=>{"use strict";d();f();p();SE.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer!="undefined";SE.SYMBOL_SUPPORT=typeof Symbol!="undefined"});var DE=L((zae,k0)=>{"use strict";d();f();p();var XU=Ff(),R0=L0(),HU=R0.ARRAY_BUFFER_SUPPORT,WU=R0.SYMBOL_SUPPORT;function ZU(e){return typeof e=="string"||Array.isArray(e)||HU&&ArrayBuffer.isView(e)?XU.fromSequence(e):typeof e!="object"||e===null?null:WU&&typeof e[Symbol.iterator]=="function"?e[Symbol.iterator]():typeof e.next=="function"?e:null}k0.exports=function(t){var n=ZU(t);if(!n)throw new Error("obliterator: target is not iterable nor a valid iterator.");return n}});var P0=L((Zae,x0)=>{"use strict";d();f();p();var eC=DE();x0.exports=function(t,n){for(var r=arguments.length>1?n:1/0,i=r!==1/0?new Array(r):[],s,o=0,a=eC(t);;){if(o===r)return i;if(s=a.next(),s.done)return o!==n&&(i.length=o),i;i[o++]=s.value}}});var U0=L((rue,M0)=>{"use strict";d();f();p();var tC=Ff(),nC=DE();M0.exports=function(){var t=arguments,n=null,r=-1;return new tC(function(){var s=null;do{if(n===null){if(r++,r>=t.length)return{done:!0};n=nC(t[r])}if(s=n.next(),s.done===!0){n=null;continue}break}while(!0);return s})}});var X0={};Fc(X0,{DirectedGraph:()=>id,Graph:()=>bt,InvalidArgumentsGraphError:()=>re,MultiDirectedGraph:()=>ad,MultiGraph:()=>od,MultiUndirectedGraph:()=>ud,NotFoundGraphError:()=>Z,UndirectedGraph:()=>sd,UsageGraphError:()=>Fe,default:()=>bt});function rC(){let e=arguments[0];for(let t=1,n=arguments.length;te++}function j0(e,t){this.key=e,this.attributes=t,this.clear()}function G0(e,t){this.key=e,this.attributes=t,this.clear()}function q0(e,t){this.key=e,this.attributes=t,this.clear()}function Lu(e,t,n,r,i){this.key=t,this.attributes=i,this.undirected=e,this.source=n,this.target=r}function ps(e,t,n,r,i,s,o){let a,u,c,l;if(r=""+r,n===K0){if(a=e._nodes.get(r),!a)throw new Z(`Graph.${t}: could not find the "${r}" node in the graph.`);c=i,l=s}else if(n===Y0){if(i=""+i,u=e._edges.get(i),!u)throw new Z(`Graph.${t}: could not find the "${i}" edge in the graph.`);let m=u.source.key,h=u.target.key;if(r===m)a=u.target;else if(r===h)a=u.source;else throw new Z(`Graph.${t}: the "${r}" node is not attached to the "${i}" edge (${m}, ${h}).`);c=s,l=o}else{if(u=e._edges.get(r),!u)throw new Z(`Graph.${t}: could not find the "${r}" edge in the graph.`);n===Q0?a=u.source:a=u.target,c=i,l=s}return[a,c,l]}function oC(e,t,n){e.prototype[t]=function(r,i,s){let[o,a]=ps(this,t,n,r,i,s);return o.attributes[a]}}function aC(e,t,n){e.prototype[t]=function(r,i){let[s]=ps(this,t,n,r,i);return s.attributes}}function uC(e,t,n){e.prototype[t]=function(r,i,s){let[o,a]=ps(this,t,n,r,i,s);return o.attributes.hasOwnProperty(a)}}function cC(e,t,n){e.prototype[t]=function(r,i,s,o){let[a,u,c]=ps(this,t,n,r,i,s,o);return a.attributes[u]=c,this.emit("nodeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:u}),this}}function lC(e,t,n){e.prototype[t]=function(r,i,s,o){let[a,u,c]=ps(this,t,n,r,i,s,o);if(typeof c!="function")throw new re(`Graph.${t}: updater should be a function.`);let l=a.attributes,m=c(l[u]);return l[u]=m,this.emit("nodeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:u}),this}}function dC(e,t,n){e.prototype[t]=function(r,i,s){let[o,a]=ps(this,t,n,r,i,s);return delete o.attributes[a],this.emit("nodeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:a}),this}}function pC(e,t,n){e.prototype[t]=function(r,i,s){let[o,a]=ps(this,t,n,r,i,s);if(!Bn(a))throw new re(`Graph.${t}: provided attributes are not a plain object.`);return o.attributes=a,this.emit("nodeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}function fC(e,t,n){e.prototype[t]=function(r,i,s){let[o,a]=ps(this,t,n,r,i,s);if(!Bn(a))throw new re(`Graph.${t}: provided attributes are not a plain object.`);return En(o.attributes,a),this.emit("nodeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:a}),this}}function mC(e,t,n){e.prototype[t]=function(r,i,s){let[o,a]=ps(this,t,n,r,i,s);if(typeof a!="function")throw new re(`Graph.${t}: provided updater is not a function.`);return o.attributes=a(o.attributes),this.emit("nodeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}function TC(e){hC.forEach(function({name:t,attacher:n}){n(e,t("Node"),K0),n(e,t("Source"),Q0),n(e,t("Target"),sC),n(e,t("Opposite"),Y0)})}function yC(e,t,n){e.prototype[t]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Fe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Fe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=""+r,a=""+i;if(i=arguments[2],s=Br(this,o,a,n),!s)throw new Z(`Graph.${t}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(n!=="mixed")throw new Fe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new Z(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return s.attributes[i]}}function EC(e,t,n){e.prototype[t]=function(r){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Fe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new Fe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let s=""+r,o=""+arguments[1];if(i=Br(this,s,o,n),!i)throw new Z(`Graph.${t}: could not find an edge for the given path ("${s}" - "${o}").`)}else{if(n!=="mixed")throw new Fe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new Z(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return i.attributes}}function NC(e,t,n){e.prototype[t]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Fe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Fe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=""+r,a=""+i;if(i=arguments[2],s=Br(this,o,a,n),!s)throw new Z(`Graph.${t}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(n!=="mixed")throw new Fe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new Z(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return s.attributes.hasOwnProperty(i)}}function gC(e,t,n){e.prototype[t]=function(r,i,s){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Fe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Fe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=""+r,u=""+i;if(i=arguments[2],s=arguments[3],o=Br(this,a,u,n),!o)throw new Z(`Graph.${t}: could not find an edge for the given path ("${a}" - "${u}").`)}else{if(n!=="mixed")throw new Fe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new Z(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return o.attributes[i]=s,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:i}),this}}function IC(e,t,n){e.prototype[t]=function(r,i,s){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Fe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Fe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=""+r,u=""+i;if(i=arguments[2],s=arguments[3],o=Br(this,a,u,n),!o)throw new Z(`Graph.${t}: could not find an edge for the given path ("${a}" - "${u}").`)}else{if(n!=="mixed")throw new Fe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new Z(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof s!="function")throw new re(`Graph.${t}: updater should be a function.`);return o.attributes[i]=s(o.attributes[i]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:i}),this}}function vC(e,t,n){e.prototype[t]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Fe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Fe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=""+r,a=""+i;if(i=arguments[2],s=Br(this,o,a,n),!s)throw new Z(`Graph.${t}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(n!=="mixed")throw new Fe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new Z(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return delete s.attributes[i],this.emit("edgeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:i}),this}}function _C(e,t,n){e.prototype[t]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Fe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Fe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=""+r,a=""+i;if(i=arguments[2],s=Br(this,o,a,n),!s)throw new Z(`Graph.${t}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(n!=="mixed")throw new Fe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new Z(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!Bn(i))throw new re(`Graph.${t}: provided attributes are not a plain object.`);return s.attributes=i,this.emit("edgeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function bC(e,t,n){e.prototype[t]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Fe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Fe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=""+r,a=""+i;if(i=arguments[2],s=Br(this,o,a,n),!s)throw new Z(`Graph.${t}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(n!=="mixed")throw new Fe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new Z(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!Bn(i))throw new re(`Graph.${t}: provided attributes are not a plain object.`);return En(s.attributes,i),this.emit("edgeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:i}),this}}function SC(e,t,n){e.prototype[t]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Fe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Fe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=""+r,a=""+i;if(i=arguments[2],s=Br(this,o,a,n),!s)throw new Z(`Graph.${t}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(n!=="mixed")throw new Fe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new Z(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof i!="function")throw new re(`Graph.${t}: provided updater is not a function.`);return s.attributes=i(s.attributes),this.emit("edgeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}function OC(e){DC.forEach(function({name:t,attacher:n}){n(e,t("Edge"),"mixed"),n(e,t("DirectedEdge"),"directed"),n(e,t("UndirectedEdge"),"undirected")})}function wC(e,t,n,r){let i=!1;for(let s in t){if(s===r)continue;let o=t[s];if(i=n(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),e&&i)return o.key}}function FC(e,t,n,r){let i,s,o,a=!1;for(let u in t)if(u!==r){i=t[u];do{if(s=i.source,o=i.target,a=n(i.key,i.attributes,s.key,o.key,s.attributes,o.attributes,i.undirected),e&&a)return i.key;i=i.next}while(i!==void 0)}}function OE(e,t){let n=Object.keys(e),r=n.length,i,s=0;return new Fr.default(function(){do if(i)i=i.next;else{if(s>=r)return{done:!0};let a=n[s++];if(a===t){i=void 0;continue}i=e[a]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}})}function LC(e,t,n,r){let i=t[n];if(!i)return;let s=i.source,o=i.target;if(r(i.key,i.attributes,s.key,o.key,s.attributes,o.attributes,i.undirected)&&e)return i.key}function RC(e,t,n,r){let i=t[n];if(!i)return;let s=!1;do{if(s=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&s)return i.key;i=i.next}while(i!==void 0)}function AE(e,t){let n=e[t];return n.next!==void 0?new Fr.default(function(){if(!n)return{done:!0};let r={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:r}}):Fr.default.of({edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected})}function kC(e,t){if(e.size===0)return[];if(t==="mixed"||t===e.type)return typeof Array.from=="function"?Array.from(e._edges.keys()):(0,wE.default)(e._edges.keys(),e._edges.size);let n=t==="undirected"?e.undirectedSize:e.directedSize,r=new Array(n),i=t==="undirected",s=e._edges.values(),o=0,a,u;for(;a=s.next(),a.done!==!0;)u=a.value,u.undirected===i&&(r[o++]=u.key);return r}function J0(e,t,n,r){if(t.size===0)return;let i=n!=="mixed"&&n!==t.type,s=n==="undirected",o,a,u=!1,c=t._edges.values();for(;o=c.next(),o.done!==!0;){if(a=o.value,i&&a.undirected!==s)continue;let{key:l,attributes:m,source:h,target:E}=a;if(u=r(l,m,h.key,E.key,h.attributes,E.attributes,a.undirected),e&&u)return l}}function xC(e,t){if(e.size===0)return Fr.default.empty();let n=t!=="mixed"&&t!==e.type,r=t==="undirected",i=e._edges.values();return new Fr.default(function(){let o,a;for(;;){if(o=i.next(),o.done)return o;if(a=o.value,!(n&&a.undirected!==r))break}return{value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.undirected},done:!1}})}function FE(e,t,n,r,i,s){let o=t?FC:wC,a;if(n!=="undirected"&&(r!=="out"&&(a=o(e,i.in,s),e&&a)||r!=="in"&&(a=o(e,i.out,s,r?void 0:i.key),e&&a))||n!=="directed"&&(a=o(e,i.undirected,s),e&&a))return a}function PC(e,t,n,r){let i=[];return FE(!1,e,t,n,r,function(s){i.push(s)}),i}function MC(e,t,n){let r=Fr.default.empty();return e!=="undirected"&&(t!=="out"&&typeof n.in!="undefined"&&(r=(0,ki.default)(r,OE(n.in))),t!=="in"&&typeof n.out!="undefined"&&(r=(0,ki.default)(r,OE(n.out,t?void 0:n.key)))),e!=="directed"&&typeof n.undirected!="undefined"&&(r=(0,ki.default)(r,OE(n.undirected))),r}function LE(e,t,n,r,i,s,o){let a=n?RC:LC,u;if(t!=="undirected"&&(typeof i.in!="undefined"&&r!=="out"&&(u=a(e,i.in,s,o),e&&u)||typeof i.out!="undefined"&&r!=="in"&&(r||i.key!==s)&&(u=a(e,i.out,s,o),e&&u))||t!=="directed"&&typeof i.undirected!="undefined"&&(u=a(e,i.undirected,s,o),e&&u))return u}function UC(e,t,n,r,i){let s=[];return LE(!1,e,t,n,r,i,function(o){s.push(o)}),s}function CC(e,t,n,r){let i=Fr.default.empty();return e!=="undirected"&&(typeof n.in!="undefined"&&t!=="out"&&r in n.in&&(i=(0,ki.default)(i,AE(n.in,r))),typeof n.out!="undefined"&&t!=="in"&&r in n.out&&(t||n.key!==r)&&(i=(0,ki.default)(i,AE(n.out,r)))),e!=="directed"&&typeof n.undirected!="undefined"&&r in n.undirected&&(i=(0,ki.default)(i,AE(n.undirected,r))),i}function BC(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(s,o){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return kC(this,r);if(arguments.length===1){s=""+s;let a=this._nodes.get(s);if(typeof a=="undefined")throw new Z(`Graph.${n}: could not find the "${s}" node in the graph.`);return PC(this.multi,r==="mixed"?this.type:r,i,a)}if(arguments.length===2){s=""+s,o=""+o;let a=this._nodes.get(s);if(!a)throw new Z(`Graph.${n}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(o))throw new Z(`Graph.${n}: could not find the "${o}" target node in the graph.`);return UC(r,this.multi,i,a,o)}throw new re(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function $C(e,t){let{name:n,type:r,direction:i}=t,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(c,l,m){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return m=c,J0(!1,this,r,m);if(arguments.length===2){c=""+c,m=l;let h=this._nodes.get(c);if(typeof h=="undefined")throw new Z(`Graph.${s}: could not find the "${c}" node in the graph.`);return FE(!1,this.multi,r==="mixed"?this.type:r,i,h,m)}if(arguments.length===3){c=""+c,l=""+l;let h=this._nodes.get(c);if(!h)throw new Z(`Graph.${s}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(l))throw new Z(`Graph.${s}: could not find the "${l}" target node in the graph.`);return LE(!1,r,this.multi,i,h,l,m)}throw new re(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};let o="map"+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(){let c=Array.prototype.slice.call(arguments),l=c.pop(),m;if(c.length===0){let h=0;r!=="directed"&&(h+=this.undirectedSize),r!=="undirected"&&(h+=this.directedSize),m=new Array(h);let E=0;c.push((N,D,w,x,Y,Q,W)=>{m[E++]=l(N,D,w,x,Y,Q,W)})}else m=[],c.push((h,E,N,D,w,x,Y)=>{m.push(l(h,E,N,D,w,x,Y))});return this[s].apply(this,c),m};let a="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[a]=function(){let c=Array.prototype.slice.call(arguments),l=c.pop(),m=[];return c.push((h,E,N,D,w,x,Y)=>{l(h,E,N,D,w,x,Y)&&m.push(h)}),this[s].apply(this,c),m};let u="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(){let c=Array.prototype.slice.call(arguments);if(c.length<2||c.length>4)throw new re(`Graph.${u}: invalid number of arguments (expecting 2, 3 or 4 and got ${c.length}).`);if(typeof c[c.length-1]=="function"&&typeof c[c.length-2]!="function")throw new re(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let l,m;c.length===2?(l=c[0],m=c[1],c=[]):c.length===3?(l=c[1],m=c[2],c=[c[0]]):c.length===4&&(l=c[2],m=c[3],c=[c[0],c[1]]);let h=m;return c.push((E,N,D,w,x,Y,Q)=>{h=l(h,E,N,D,w,x,Y,Q)}),this[s].apply(this,c),h}}function VC(e,t){let{name:n,type:r,direction:i}=t,s="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(u,c,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return l=u,J0(!0,this,r,l);if(arguments.length===2){u=""+u,l=c;let m=this._nodes.get(u);if(typeof m=="undefined")throw new Z(`Graph.${s}: could not find the "${u}" node in the graph.`);return FE(!0,this.multi,r==="mixed"?this.type:r,i,m,l)}if(arguments.length===3){u=""+u,c=""+c;let m=this._nodes.get(u);if(!m)throw new Z(`Graph.${s}: could not find the "${u}" source node in the graph.`);if(!this._nodes.has(c))throw new Z(`Graph.${s}: could not find the "${c}" target node in the graph.`);return LE(!0,r,this.multi,i,m,c,l)}throw new re(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};let o="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(){let u=Array.prototype.slice.call(arguments),c=u.pop();return u.push((m,h,E,N,D,w,x)=>c(m,h,E,N,D,w,x)),!!this[s].apply(this,u)};let a="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(){let u=Array.prototype.slice.call(arguments),c=u.pop();return u.push((m,h,E,N,D,w,x)=>!c(m,h,E,N,D,w,x)),!this[s].apply(this,u)}}function jC(e,t){let{name:n,type:r,direction:i}=t,s=n.slice(0,-1)+"Entries";e.prototype[s]=function(o,a){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Fr.default.empty();if(!arguments.length)return xC(this,r);if(arguments.length===1){o=""+o;let u=this._nodes.get(o);if(!u)throw new Z(`Graph.${s}: could not find the "${o}" node in the graph.`);return MC(r,i,u)}if(arguments.length===2){o=""+o,a=""+a;let u=this._nodes.get(o);if(!u)throw new Z(`Graph.${s}: could not find the "${o}" source node in the graph.`);if(!this._nodes.has(a))throw new Z(`Graph.${s}: could not find the "${a}" target node in the graph.`);return CC(r,i,u,a)}throw new re(`Graph.${s}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function GC(e){AC.forEach(t=>{BC(e,t),$C(e,t),VC(e,t),jC(e,t)})}function Rf(){this.A=null,this.B=null}function td(e,t,n,r,i){for(let s in r){let o=r[s],a=o.source,u=o.target,c=a===n?u:a;if(t&&t.has(c.key))continue;let l=i(c.key,c.attributes);if(e&&l)return c.key}}function RE(e,t,n,r,i){if(t!=="mixed"){if(t==="undirected")return td(e,null,r,r.undirected,i);if(typeof n=="string")return td(e,null,r,r[n],i)}let s=new Rf,o;if(t!=="undirected"){if(n!=="out"){if(o=td(e,null,r,r.in,i),e&&o)return o;s.wrap(r.in)}if(n!=="in"){if(o=td(e,s,r,r.out,i),e&&o)return o;s.wrap(r.out)}}if(t!=="directed"&&(o=td(e,s,r,r.undirected,i),e&&o))return o}function KC(e,t,n){if(e!=="mixed"){if(e==="undirected")return Object.keys(n.undirected);if(typeof t=="string")return Object.keys(n[t])}let r=[];return RE(!1,e,t,n,function(i){r.push(i)}),r}function nd(e,t,n){let r=Object.keys(n),i=r.length,s=0;return new Fr.default(function(){let a=null;do{if(s>=i)return e&&e.wrap(n),{done:!0};let u=n[r[s++]],c=u.source,l=u.target;if(a=c===t?l:c,e&&e.has(a.key)){a=null;continue}}while(a===null);return{done:!1,value:{neighbor:a.key,attributes:a.attributes}}})}function QC(e,t,n){if(e!=="mixed"){if(e==="undirected")return nd(null,n,n.undirected);if(typeof t=="string")return nd(null,n,n[t])}let r=Fr.default.empty(),i=new Rf;return e!=="undirected"&&(t!=="out"&&(r=(0,ki.default)(r,nd(i,n,n.in))),t!=="in"&&(r=(0,ki.default)(r,nd(i,n,n.out)))),e!=="directed"&&(r=(0,ki.default)(r,nd(i,n,n.undirected))),r}function YC(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(s){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];s=""+s;let o=this._nodes.get(s);if(typeof o=="undefined")throw new Z(`Graph.${n}: could not find the "${s}" node in the graph.`);return KC(r==="mixed"?this.type:r,i,o)}}function JC(e,t){let{name:n,type:r,direction:i}=t,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(c,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;c=""+c;let m=this._nodes.get(c);if(typeof m=="undefined")throw new Z(`Graph.${s}: could not find the "${c}" node in the graph.`);RE(!1,r==="mixed"?this.type:r,i,m,l)};let o="map"+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(c,l){let m=[];return this[s](c,(h,E)=>{m.push(l(h,E))}),m};let a="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[a]=function(c,l){let m=[];return this[s](c,(h,E)=>{l(h,E)&&m.push(h)}),m};let u="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(c,l,m){if(arguments.length<3)throw new re(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let h=m;return this[s](c,(E,N)=>{h=l(h,E,N)}),h}}function zC(e,t){let{name:n,type:r,direction:i}=t,s=n[0].toUpperCase()+n.slice(1,-1),o="find"+s;e.prototype[o]=function(c,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;c=""+c;let m=this._nodes.get(c);if(typeof m=="undefined")throw new Z(`Graph.${o}: could not find the "${c}" node in the graph.`);return RE(!0,r==="mixed"?this.type:r,i,m,l)};let a="some"+s;e.prototype[a]=function(c,l){return!!this[o](c,l)};let u="every"+s;e.prototype[u]=function(c,l){return!this[o](c,(h,E)=>!l(h,E))}}function XC(e,t){let{name:n,type:r,direction:i}=t,s=n.slice(0,-1)+"Entries";e.prototype[s]=function(o){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Fr.default.empty();o=""+o;let a=this._nodes.get(o);if(typeof a=="undefined")throw new Z(`Graph.${s}: could not find the "${o}" node in the graph.`);return QC(r==="mixed"?this.type:r,i,a)}}function HC(e){qC.forEach(t=>{YC(e,t),JC(e,t),zC(e,t),XC(e,t)})}function Lf(e,t,n,r,i){let s=r._nodes.values(),o=r.type,a,u,c,l,m,h,E;for(;a=s.next(),a.done!==!0;){let N=!1;if(u=a.value,o!=="undirected"){l=u.out;for(c in l){m=l[c];do{if(h=m.target,N=!0,E=i(u.key,h.key,u.attributes,h.attributes,m.key,m.attributes,m.undirected),e&&E)return m;m=m.next}while(m)}}if(o!=="directed"){l=u.undirected;for(c in l)if(!(t&&u.key>c)){m=l[c];do{if(h=m.target,h.key!==c&&(h=m.source),N=!0,E=i(u.key,h.key,u.attributes,h.attributes,m.key,m.attributes,m.undirected),e&&E)return m;m=m.next}while(m)}}if(n&&!N&&(E=i(u.key,null,u.attributes,null,null,null,null),e&&E))return null}}function WC(e,t){let n={key:e};return V0(t.attributes)||(n.attributes=En({},t.attributes)),n}function ZC(e,t,n){let r={key:t,source:n.source.key,target:n.target.key};return V0(n.attributes)||(r.attributes=En({},n.attributes)),e==="mixed"&&n.undirected&&(r.undirected=!0),r}function eB(e){if(!Bn(e))throw new re('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in e))throw new re("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!Bn(e.attributes)||e.attributes===null))throw new re("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function tB(e){if(!Bn(e))throw new re('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in e))throw new re("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new re("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!Bn(e.attributes)||e.attributes===null))throw new re("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&typeof e.undirected!="boolean")throw new re("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}function oB(e,t,n){if(n&&!Bn(n))throw new re(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=""+t,n=n||{},e._nodes.has(t))throw new Fe(`Graph.addNode: the "${t}" node already exist in the graph.`);let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function $0(e,t,n){let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function z0(e,t,n,r,i,s,o,a){if(!r&&e.type==="undirected")throw new Fe(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Fe(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(a&&!Bn(a))throw new re(`Graph.${t}: invalid attributes. Expecting an object but got "${a}"`);if(s=""+s,o=""+o,a=a||{},!e.allowSelfLoops&&s===o)throw new Fe(`Graph.${t}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let u=e._nodes.get(s),c=e._nodes.get(o);if(!u)throw new Z(`Graph.${t}: source node "${s}" not found.`);if(!c)throw new Z(`Graph.${t}: target node "${o}" not found.`);let l={key:null,undirected:r,source:s,target:o,attributes:a};if(n)i=e._edgeKeyGenerator();else if(i=""+i,e._edges.has(i))throw new Fe(`Graph.${t}: the "${i}" edge already exists in the graph.`);if(!e.multi&&(r?typeof u.undirected[o]!="undefined":typeof u.out[o]!="undefined"))throw new Fe(`Graph.${t}: an edge linking "${s}" to "${o}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);let m=new Lu(r,i,u,c,a);e._edges.set(i,m);let h=s===o;return r?(u.undirectedDegree++,c.undirectedDegree++,h&&(u.undirectedLoops++,e._undirectedSelfLoopCount++)):(u.outDegree++,c.inDegree++,h&&(u.directedLoops++,e._directedSelfLoopCount++)),e.multi?m.attachMulti():m.attach(),r?e._undirectedSize++:e._directedSize++,l.key=i,e.emit("edgeAdded",l),i}function aB(e,t,n,r,i,s,o,a,u){if(!r&&e.type==="undirected")throw new Fe(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Fe(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(a){if(u){if(typeof a!="function")throw new re(`Graph.${t}: invalid updater function. Expecting a function but got "${a}"`)}else if(!Bn(a))throw new re(`Graph.${t}: invalid attributes. Expecting an object but got "${a}"`)}s=""+s,o=""+o;let c;if(u&&(c=a,a=void 0),!e.allowSelfLoops&&s===o)throw new Fe(`Graph.${t}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let l=e._nodes.get(s),m=e._nodes.get(o),h,E;if(!n&&(h=e._edges.get(i),h)){if((h.source.key!==s||h.target.key!==o)&&(!r||h.source.key!==o||h.target.key!==s))throw new Fe(`Graph.${t}: inconsistency detected when attempting to merge the "${i}" edge with "${s}" source & "${o}" target vs. ("${h.source.key}", "${h.target.key}").`);E=h}if(!E&&!e.multi&&l&&(E=r?l.undirected[o]:l.out[o]),E){let Y=[E.key,!1,!1,!1];if(u?!c:!a)return Y;if(u){let Q=E.attributes;E.attributes=c(Q),e.emit("edgeAttributesUpdated",{type:"replace",key:E.key,attributes:E.attributes})}else En(E.attributes,a),e.emit("edgeAttributesUpdated",{type:"merge",key:E.key,attributes:E.attributes,data:a});return Y}a=a||{},u&&c&&(a=c(a));let N={key:null,undirected:r,source:s,target:o,attributes:a};if(n)i=e._edgeKeyGenerator();else if(i=""+i,e._edges.has(i))throw new Fe(`Graph.${t}: the "${i}" edge already exists in the graph.`);let D=!1,w=!1;l||(l=$0(e,s,{}),D=!0,s===o&&(m=l,w=!0)),m||(m=$0(e,o,{}),w=!0),h=new Lu(r,i,l,m,a),e._edges.set(i,h);let x=s===o;return r?(l.undirectedDegree++,m.undirectedDegree++,x&&(l.undirectedLoops++,e._undirectedSelfLoopCount++)):(l.outDegree++,m.inDegree++,x&&(l.directedLoops++,e._directedSelfLoopCount++)),e.multi?h.attachMulti():h.attach(),r?e._undirectedSize++:e._directedSize++,N.key=i,e.emit("edgeAdded",N),[i,!0,D,w]}function Fu(e,t){e._edges.delete(t.key);let{source:n,target:r,attributes:i}=t,s=t.undirected,o=n===r;s?(n.undirectedDegree--,r.undirectedDegree--,o&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,o&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),s?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:i,source:n.key,target:r.key,undirected:s})}function Ru(e){e.from=function(t,n){let r=En({},t.options,n),i=new e(r);return i.import(t),i}}var Fr,wE,ki,En,rd,re,Z,Fe,K0,Q0,sC,Y0,hC,DC,AC,qC,nB,rB,B0,iB,sB,bt,id,sd,od,ad,ud,H0=j(()=>{"use strict";d();f();p();w0();Fr=Op(Ff()),wE=Op(P0()),ki=Op(U0());En=rC;typeof Object.assign=="function"&&(En=Object.assign);rd=class extends Error{constructor(t){super(),this.name="GraphError",this.message=t}},re=class e extends rd{constructor(t){super(t),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,e.prototype.constructor)}},Z=class e extends rd{constructor(t){super(t),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,e.prototype.constructor)}},Fe=class e extends rd{constructor(t){super(t),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,e.prototype.constructor)}};j0.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};G0.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};q0.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};Lu.prototype.attach=function(){let e="out",t="in";this.undirected&&(e=t="undirected");let n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)};Lu.prototype.attachMulti=function(){let e="out",t="in",n=this.source.key,r=this.target.key;this.undirected&&(e=t="undirected");let i=this.source[e],s=i[r];if(typeof s=="undefined"){i[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}s.previous=this,this.next=s,i[r]=this,this.target[t][n]=this};Lu.prototype.detach=function(){let e=this.source.key,t=this.target.key,n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][t],delete this.target[r][e]};Lu.prototype.detachMulti=function(){let e=this.source.key,t=this.target.key,n="out",r="in";this.undirected&&(n=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};K0=0,Q0=1,sC=2,Y0=3;hC=[{name:e=>`get${e}Attribute`,attacher:oC},{name:e=>`get${e}Attributes`,attacher:aC},{name:e=>`has${e}Attribute`,attacher:uC},{name:e=>`set${e}Attribute`,attacher:cC},{name:e=>`update${e}Attribute`,attacher:lC},{name:e=>`remove${e}Attribute`,attacher:dC},{name:e=>`replace${e}Attributes`,attacher:pC},{name:e=>`merge${e}Attributes`,attacher:fC},{name:e=>`update${e}Attributes`,attacher:mC}];DC=[{name:e=>`get${e}Attribute`,attacher:yC},{name:e=>`get${e}Attributes`,attacher:EC},{name:e=>`has${e}Attribute`,attacher:NC},{name:e=>`set${e}Attribute`,attacher:gC},{name:e=>`update${e}Attribute`,attacher:IC},{name:e=>`remove${e}Attribute`,attacher:vC},{name:e=>`replace${e}Attributes`,attacher:_C},{name:e=>`merge${e}Attributes`,attacher:bC},{name:e=>`update${e}Attributes`,attacher:SC}];AC=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];qC=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];Rf.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)};Rf.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};nB=iC(),rB=new Set(["directed","undirected","mixed"]),B0=new Set(["domain","_events","_eventsCount","_maxListeners"]),iB=[{name:e=>`${e}Edge`,generateKey:!0},{name:e=>`${e}DirectedEdge`,generateKey:!0,type:"directed"},{name:e=>`${e}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:e=>`${e}EdgeWithKey`},{name:e=>`${e}DirectedEdgeWithKey`,type:"directed"},{name:e=>`${e}UndirectedEdgeWithKey`,type:"undirected"}],sB={allowSelfLoops:!0,multi:!1,type:"mixed"};bt=class e extends A0{constructor(t){if(super(),t=En({},sB,t),typeof t.multi!="boolean")throw new re(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${t.multi}".`);if(!rB.has(t.type))throw new re(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${t.type}".`);if(typeof t.allowSelfLoops!="boolean")throw new re(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${t.allowSelfLoops}".`);let n=t.type==="mixed"?j0:t.type==="directed"?G0:q0;Cr(this,"NodeDataClass",n);let r="geid_"+nB()+"_",i=0,s=()=>{let o;do o=r+i++;while(this._edges.has(o));return o};Cr(this,"_attributes",{}),Cr(this,"_nodes",new Map),Cr(this,"_edges",new Map),Cr(this,"_directedSize",0),Cr(this,"_undirectedSize",0),Cr(this,"_directedSelfLoopCount",0),Cr(this,"_undirectedSelfLoopCount",0),Cr(this,"_edgeKeyGenerator",s),Cr(this,"_options",t),B0.forEach(o=>Cr(this,o,this[o])),ui(this,"order",()=>this._nodes.size),ui(this,"size",()=>this._edges.size),ui(this,"directedSize",()=>this._directedSize),ui(this,"undirectedSize",()=>this._undirectedSize),ui(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),ui(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),ui(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),ui(this,"multi",this._options.multi),ui(this,"type",this._options.type),ui(this,"allowSelfLoops",this._options.allowSelfLoops),ui(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(t){return this._nodes.has(""+t)}hasDirectedEdge(t,n){if(this.type==="undirected")return!1;if(arguments.length===1){let r=""+t,i=this._edges.get(r);return!!i&&!i.undirected}else if(arguments.length===2){t=""+t,n=""+n;let r=this._nodes.get(t);return r?r.out.hasOwnProperty(n):!1}throw new re(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(t,n){if(this.type==="directed")return!1;if(arguments.length===1){let r=""+t,i=this._edges.get(r);return!!i&&i.undirected}else if(arguments.length===2){t=""+t,n=""+n;let r=this._nodes.get(t);return r?r.undirected.hasOwnProperty(n):!1}throw new re(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(t,n){if(arguments.length===1){let r=""+t;return this._edges.has(r)}else if(arguments.length===2){t=""+t,n=""+n;let r=this._nodes.get(t);return r?typeof r.out!="undefined"&&r.out.hasOwnProperty(n)||typeof r.undirected!="undefined"&&r.undirected.hasOwnProperty(n):!1}throw new re(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(t,n){if(this.type==="undirected")return;if(t=""+t,n=""+n,this.multi)throw new Fe("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");let r=this._nodes.get(t);if(!r)throw new Z(`Graph.directedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Z(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);let i=r.out&&r.out[n]||void 0;if(i)return i.key}undirectedEdge(t,n){if(this.type==="directed")return;if(t=""+t,n=""+n,this.multi)throw new Fe("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");let r=this._nodes.get(t);if(!r)throw new Z(`Graph.undirectedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Z(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);let i=r.undirected&&r.undirected[n]||void 0;if(i)return i.key}edge(t,n){if(this.multi)throw new Fe("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t,n=""+n;let r=this._nodes.get(t);if(!r)throw new Z(`Graph.edge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Z(`Graph.edge: could not find the "${n}" target node in the graph.`);let i=r.out&&r.out[n]||r.undirected&&r.undirected[n]||void 0;if(i)return i.key}areDirectedNeighbors(t,n){t=""+t,n=""+n;let r=this._nodes.get(t);if(!r)throw new Z(`Graph.areDirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in||n in r.out}areOutNeighbors(t,n){t=""+t,n=""+n;let r=this._nodes.get(t);if(!r)throw new Z(`Graph.areOutNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.out}areInNeighbors(t,n){t=""+t,n=""+n;let r=this._nodes.get(t);if(!r)throw new Z(`Graph.areInNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in}areUndirectedNeighbors(t,n){t=""+t,n=""+n;let r=this._nodes.get(t);if(!r)throw new Z(`Graph.areUndirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="directed"?!1:n in r.undirected}areNeighbors(t,n){t=""+t,n=""+n;let r=this._nodes.get(t);if(!r)throw new Z(`Graph.areNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&(n in r.in||n in r.out)||this.type!=="directed"&&n in r.undirected}areInboundNeighbors(t,n){t=""+t,n=""+n;let r=this._nodes.get(t);if(!r)throw new Z(`Graph.areInboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.in||this.type!=="directed"&&n in r.undirected}areOutboundNeighbors(t,n){t=""+t,n=""+n;let r=this._nodes.get(t);if(!r)throw new Z(`Graph.areOutboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.out||this.type!=="directed"&&n in r.undirected}inDegree(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new Z(`Graph.inDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree}outDegree(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new Z(`Graph.outDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree}directedDegree(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new Z(`Graph.directedDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree}undirectedDegree(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new Z(`Graph.undirectedDegree: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree}inboundDegree(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new Z(`Graph.inboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree),r}outboundDegree(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new Z(`Graph.outboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.outDegree),r}degree(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new Z(`Graph.degree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree),r}inDegreeWithoutSelfLoops(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new Z(`Graph.inDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree-n.directedLoops}outDegreeWithoutSelfLoops(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new Z(`Graph.outDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree-n.directedLoops}directedDegreeWithoutSelfLoops(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new Z(`Graph.directedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree-n.directedLoops*2}undirectedDegreeWithoutSelfLoops(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new Z(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree-n.undirectedLoops*2}inboundDegreeWithoutSelfLoops(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new Z(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree,i+=n.directedLoops),r-i}outboundDegreeWithoutSelfLoops(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new Z(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.outDegree,i+=n.directedLoops),r-i}degreeWithoutSelfLoops(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new Z(`Graph.degreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree,i+=n.directedLoops*2),r-i}source(t){t=""+t;let n=this._edges.get(t);if(!n)throw new Z(`Graph.source: could not find the "${t}" edge in the graph.`);return n.source.key}target(t){t=""+t;let n=this._edges.get(t);if(!n)throw new Z(`Graph.target: could not find the "${t}" edge in the graph.`);return n.target.key}extremities(t){t=""+t;let n=this._edges.get(t);if(!n)throw new Z(`Graph.extremities: could not find the "${t}" edge in the graph.`);return[n.source.key,n.target.key]}opposite(t,n){t=""+t,n=""+n;let r=this._edges.get(n);if(!r)throw new Z(`Graph.opposite: could not find the "${n}" edge in the graph.`);let i=r.source.key,s=r.target.key;if(t===i)return s;if(t===s)return i;throw new Z(`Graph.opposite: the "${t}" node is not attached to the "${n}" edge (${i}, ${s}).`)}hasExtremity(t,n){t=""+t,n=""+n;let r=this._edges.get(t);if(!r)throw new Z(`Graph.hasExtremity: could not find the "${t}" edge in the graph.`);return r.source.key===n||r.target.key===n}isUndirected(t){t=""+t;let n=this._edges.get(t);if(!n)throw new Z(`Graph.isUndirected: could not find the "${t}" edge in the graph.`);return n.undirected}isDirected(t){t=""+t;let n=this._edges.get(t);if(!n)throw new Z(`Graph.isDirected: could not find the "${t}" edge in the graph.`);return!n.undirected}isSelfLoop(t){t=""+t;let n=this._edges.get(t);if(!n)throw new Z(`Graph.isSelfLoop: could not find the "${t}" edge in the graph.`);return n.source===n.target}addNode(t,n){return oB(this,t,n).key}mergeNode(t,n){if(n&&!Bn(n))throw new re(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);t=""+t,n=n||{};let r=this._nodes.get(t);return r?(n&&(En(r.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:r.attributes,data:n})),[t,!1]):(r=new this.NodeDataClass(t,n),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:n}),[t,!0])}updateNode(t,n){if(n&&typeof n!="function")throw new re(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);t=""+t;let r=this._nodes.get(t);if(r){if(n){let s=r.attributes;r.attributes=n(s),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:r.attributes})}return[t,!1]}let i=n?n({}):{};return r=new this.NodeDataClass(t,i),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:i}),[t,!0]}dropNode(t){t=""+t;let n=this._nodes.get(t);if(!n)throw new Z(`Graph.dropNode: could not find the "${t}" node in the graph.`);let r;if(this.type!=="undirected"){for(let i in n.out){r=n.out[i];do Fu(this,r),r=r.next;while(r)}for(let i in n.in){r=n.in[i];do Fu(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(let i in n.undirected){r=n.undirected[i];do Fu(this,r),r=r.next;while(r)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})}dropEdge(t){let n;if(arguments.length>1){let r=""+arguments[0],i=""+arguments[1];if(n=Br(this,r,i,this.type),!n)throw new Z(`Graph.dropEdge: could not find the "${r}" -> "${i}" edge in the graph.`)}else if(t=""+t,n=this._edges.get(t),!n)throw new Z(`Graph.dropEdge: could not find the "${t}" edge in the graph.`);return Fu(this,n),this}dropDirectedEdge(t,n){if(arguments.length<2)throw new Fe("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Fe("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");t=""+t,n=""+n;let r=Br(this,t,n,"directed");if(!r)throw new Z(`Graph.dropDirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Fu(this,r),this}dropUndirectedEdge(t,n){if(arguments.length<2)throw new Fe("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Fe("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");let r=Br(this,t,n,"undirected");if(!r)throw new Z(`Graph.dropUndirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Fu(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){let t=this._nodes.values(),n;for(;n=t.next(),n.done!==!0;)n.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(t){return this._attributes[t]}getAttributes(){return this._attributes}hasAttribute(t){return this._attributes.hasOwnProperty(t)}setAttribute(t,n){return this._attributes[t]=n,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}updateAttribute(t,n){if(typeof n!="function")throw new re("Graph.updateAttribute: updater should be a function.");let r=this._attributes[t];return this._attributes[t]=n(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}removeAttribute(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this}replaceAttributes(t){if(!Bn(t))throw new re("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=t,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(t){if(!Bn(t))throw new re("Graph.mergeAttributes: provided attributes are not a plain object.");return En(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this}updateAttributes(t){if(typeof t!="function")throw new re("Graph.updateAttributes: provided updater is not a function.");return this._attributes=t(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(t,n){if(typeof t!="function")throw new re("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!C0(n))throw new re("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");let r=this._nodes.values(),i,s;for(;i=r.next(),i.done!==!0;)s=i.value,s.attributes=t(s.key,s.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(t,n){if(typeof t!="function")throw new re("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!C0(n))throw new re("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");let r=this._edges.values(),i,s,o,a;for(;i=r.next(),i.done!==!0;)s=i.value,o=s.source,a=s.target,s.attributes=t(s.key,s.attributes,o.key,a.key,o.attributes,a.attributes,s.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(t){if(typeof t!="function")throw new re("Graph.forEachAdjacencyEntry: expecting a callback.");Lf(!1,!1,!1,this,t)}forEachAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new re("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Lf(!1,!1,!0,this,t)}forEachAssymetricAdjacencyEntry(t){if(typeof t!="function")throw new re("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Lf(!1,!0,!1,this,t)}forEachAssymetricAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new re("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Lf(!1,!0,!0,this,t)}nodes(){return typeof Array.from=="function"?Array.from(this._nodes.keys()):(0,wE.default)(this._nodes.keys(),this._nodes.size)}forEachNode(t){if(typeof t!="function")throw new re("Graph.forEachNode: expecting a callback.");let n=this._nodes.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,t(i.key,i.attributes)}findNode(t){if(typeof t!="function")throw new re("Graph.findNode: expecting a callback.");let n=this._nodes.values(),r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,t(i.key,i.attributes))return i.key}mapNodes(t){if(typeof t!="function")throw new re("Graph.mapNode: expecting a callback.");let n=this._nodes.values(),r,i,s=new Array(this.order),o=0;for(;r=n.next(),r.done!==!0;)i=r.value,s[o++]=t(i.key,i.attributes);return s}someNode(t){if(typeof t!="function")throw new re("Graph.someNode: expecting a callback.");let n=this._nodes.values(),r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,t(i.key,i.attributes))return!0;return!1}everyNode(t){if(typeof t!="function")throw new re("Graph.everyNode: expecting a callback.");let n=this._nodes.values(),r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,!t(i.key,i.attributes))return!1;return!0}filterNodes(t){if(typeof t!="function")throw new re("Graph.filterNodes: expecting a callback.");let n=this._nodes.values(),r,i,s=[];for(;r=n.next(),r.done!==!0;)i=r.value,t(i.key,i.attributes)&&s.push(i.key);return s}reduceNodes(t,n){if(typeof t!="function")throw new re("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new re("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let r=n,i=this._nodes.values(),s,o;for(;s=i.next(),s.done!==!0;)o=s.value,r=t(r,o.key,o.attributes);return r}nodeEntries(){let t=this._nodes.values();return new Fr.default(()=>{let n=t.next();if(n.done)return n;let r=n.value;return{value:{node:r.key,attributes:r.attributes},done:!1}})}export(){let t=new Array(this._nodes.size),n=0;this._nodes.forEach((i,s)=>{t[n++]=WC(s,i)});let r=new Array(this._edges.size);return n=0,this._edges.forEach((i,s)=>{r[n++]=ZC(this.type,s,i)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:r}}import(t,n=!1){if(t instanceof e)return t.forEachNode((u,c)=>{n?this.mergeNode(u,c):this.addNode(u,c)}),t.forEachEdge((u,c,l,m,h,E,N)=>{n?N?this.mergeUndirectedEdgeWithKey(u,l,m,c):this.mergeDirectedEdgeWithKey(u,l,m,c):N?this.addUndirectedEdgeWithKey(u,l,m,c):this.addDirectedEdgeWithKey(u,l,m,c)}),this;if(!Bn(t))throw new re("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!Bn(t.attributes))throw new re("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,i,s,o,a;if(t.nodes){if(s=t.nodes,!Array.isArray(s))throw new re("Graph.import: invalid nodes. Expecting an array.");for(r=0,i=s.length;r{let s=En({},r.attributes);r=new n.NodeDataClass(i,s),n._nodes.set(i,r)}),n}copy(t){if(t=t||{},typeof t.type=="string"&&t.type!==this.type&&t.type!=="mixed")throw new Fe(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${t.type}" because this would mean losing information about the current graph.`);if(typeof t.multi=="boolean"&&t.multi!==this.multi&&t.multi!==!0)throw new Fe("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof t.allowSelfLoops=="boolean"&&t.allowSelfLoops!==this.allowSelfLoops&&t.allowSelfLoops!==!0)throw new Fe("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");let n=this.emptyCopy(t),r=this._edges.values(),i,s;for(;i=r.next(),i.done!==!0;)s=i.value,z0(n,"copy",!1,s.undirected,s.key,s.source.key,s.target.key,En({},s.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){let t={};this._nodes.forEach((s,o)=>{t[o]=s.attributes});let n={},r={};this._edges.forEach((s,o)=>{let a=s.undirected?"--":"->",u="",c=s.source.key,l=s.target.key,m;s.undirected&&c>l&&(m=c,c=l,l=m);let h=`(${c})${a}(${l})`;o.startsWith("geid_")?this.multi&&(typeof r[h]=="undefined"?r[h]=0:r[h]++,u+=`${r[h]}. `):u+=`[${o}]: `,u+=h,n[u]=s.attributes});let i={};for(let s in this)this.hasOwnProperty(s)&&!B0.has(s)&&typeof this[s]!="function"&&typeof s!="symbol"&&(i[s]=this[s]);return i.attributes=this._attributes,i.nodes=t,i.edges=n,Cr(i,"constructor",this.constructor),i}};typeof Symbol!="undefined"&&(bt.prototype[Symbol.for("nodejs.util.inspect.custom")]=bt.prototype.inspect);iB.forEach(e=>{["add","merge","update"].forEach(t=>{let n=e.name(t),r=t==="add"?z0:aB;e.generateKey?bt.prototype[n]=function(i,s,o){return r(this,n,!0,(e.type||this.type)==="undirected",null,i,s,o,t==="update")}:bt.prototype[n]=function(i,s,o,a){return r(this,n,!1,(e.type||this.type)==="undirected",i,s,o,a,t==="update")}})});TC(bt);OC(bt);GC(bt);HC(bt);id=class extends bt{constructor(t){let n=En({type:"directed"},t);if("multi"in n&&n.multi!==!1)throw new re("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new re('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}},sd=class extends bt{constructor(t){let n=En({type:"undirected"},t);if("multi"in n&&n.multi!==!1)throw new re("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new re('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}},od=class extends bt{constructor(t){let n=En({multi:!0},t);if("multi"in n&&n.multi!==!0)throw new re("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}},ad=class extends bt{constructor(t){let n=En({type:"directed",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new re("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new re('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}},ud=class extends bt{constructor(t){let n=En({type:"undirected",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new re("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new re('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}};Ru(bt);Ru(id);Ru(sd);Ru(od);Ru(ad);Ru(ud);bt.Graph=bt;bt.DirectedGraph=id;bt.UndirectedGraph=sd;bt.MultiGraph=od;bt.MultiDirectedGraph=ad;bt.MultiUndirectedGraph=ud;bt.InvalidArgumentsGraphError=re;bt.NotFoundGraphError=Z;bt.UsageGraphError=Fe});var wo=L(xi=>{"use strict";d();f();p();Object.defineProperty(xi,"__esModule",{value:!0});xi.getNamedTypeForChild=xi.isTypeRequired=xi.getMostRestrictiveMergedTypeNode=xi.getLeastRestrictiveMergedTypeNode=void 0;var fs=(ne(),se(ce)),Z0=ai(),uB=ed(),W0=Oo(),Ia;(function(e){e[e.NONE=0]="NONE",e[e.CURRENT=1]="CURRENT",e[e.OTHER=2]="OTHER"})(Ia||(Ia={}));function eD(e,t,n,r,i){t=(0,uB.deepCopyTypeNode)(t,n,r);let s={kind:e.kind},o=Ia.NONE,a=s;for(let u=0;u{"use strict";d();f();p();Object.defineProperty(Fo,"__esModule",{value:!0});Fo.walkSubgraphToFederate=Fo.walkSubgraphToCollectObjectLikesAndDirectiveDefinitions=Fo.recordSubgraphName=void 0;var rD=(ne(),se(ce)),$n=Ar(),pB=wo(),nD=ds(),kf=Or();function fB(e,t,n){if(!t.has(e)){t.add(e);return}n.add(e)}Fo.recordSubgraphName=fB;function mB(e,t){t.definitions=(0,rD.visit)(t.definitions,{DirectiveDefinition:{enter(n){e.upsertDirectiveNode(n)}},InterfaceTypeDefinition:{enter(n){let r=n.name.value;if(e.upsertParentNode(n),!(0,$n.isObjectLikeNodeEntity)(n))return!1;e.graph.hasNode(r)||e.graph.addNode(r)}},ObjectTypeDefinition:{enter(n){let r=n.name.value,i=t.operationTypes.get(r),s=i?(0,nD.getOrThrowError)($n.operationTypeNodeToDefaultType,i,kf.OPERATION_TO_DEFAULT):r;if(e.graph.hasNode(s)||e.graph.addNode(s),(0,$n.isNodeInterfaceObject)(n))return!1;let o=e.entityContainersByTypeName.get(r);return o&&!(0,$n.isObjectLikeNodeEntity)(n)&&e.validateKeyFieldSetsForImplicitEntity(o),(0,$n.addConcreteTypesForImplementedInterfaces)(n,e.abstractToConcreteTypeNames),r==s?!1:(e.renamedTypeNameByOriginalTypeName.set(r,s),M(A({},n),{name:(0,$n.stringToNameNode)(s)}))}},ObjectTypeExtension:{enter(n){let r=n.name.value,i=t.operationTypes.get(r),s=i?(0,nD.getOrThrowError)($n.operationTypeNodeToDefaultType,i,kf.OPERATION_TO_DEFAULT):r;return(0,$n.addConcreteTypesForImplementedInterfaces)(n,e.abstractToConcreteTypeNames),e.graph.hasNode(s)||e.graph.addNode(s),r!==s?M(A({},n),{name:(0,$n.stringToNameNode)(s)}):!1}},UnionTypeDefinition:{enter(n){e.upsertParentNode(n),(0,$n.addConcreteTypesForUnion)(n,e.abstractToConcreteTypeNames)}}})}Fo.walkSubgraphToCollectObjectLikesAndDirectiveDefinitions=mB;function hB(e,t,n){let r;(0,rD.visit)(e,{Directive:{enter(){return!1}},EnumTypeDefinition:{enter(i){n.parentTypeName=i.name.value,n.upsertParentNode(i)},leave(){n.parentTypeName=""}},EnumValueDefinition:{enter(i){n.childName=i.name.value,n.upsertValueNode(i)},leave(){n.childName=""}},FieldDefinition:{enter(i){let s=i.name.value;if(r!=null&&r.has(s))return!1;let o=`${n.parentTypeName}.${s}`,a=(0,pB.getNamedTypeForChild)(o,i.type);if(n.isParentRootType&&(s===kf.SERVICE_FIELD||s===kf.ENTITIES_FIELD))return!1;if(n.childName=s,n.upsertFieldNode(i),!n.graph.hasNode(n.parentTypeName)||n.graphEdges.has(o))return;n.graphEdges.add(o);let u=n.entityContainersByTypeName.get(n.parentTypeName);if(u&&!u.fieldNames.has(s))return;let c=n.abstractToConcreteTypeNames.get(a);if(c)for(let l of c)n.graph.addEdge(n.parentTypeName,l);n.graph.hasNode(a)&&n.graph.addEdge(n.parentTypeName,a)},leave(){n.childName=""}},InputObjectTypeDefinition:{enter(i){n.parentTypeName=i.name.value,n.isParentInputObject=!0,n.upsertParentNode(i)},leave(){n.parentTypeName="",n.isParentInputObject=!1}},InputValueDefinition:{enter(i){n.isParentInputObject&&(n.childName=i.name.value),n.upsertValueNode(i)},leave(){n.isParentInputObject&&(n.childName="")}},InterfaceTypeDefinition:{enter(i){n.parentTypeName=i.name.value,n.isCurrentParentInterface=!0,n.upsertParentNode(i)},leave(){n.parentTypeName="",n.isCurrentParentInterface=!1}},ObjectTypeDefinition:{enter(i){if(n.areFieldsExternal=(0,$n.isNodeExternal)(i),n.areFieldsShareable=!n.isCurrentSubgraphVersionTwo||(0,$n.isNodeShareable)(i),n.isCurrentParentEntity=(0,$n.isObjectLikeNodeEntity)(i),n.isParentRootType=n.isObjectRootType(i),n.parentTypeName=i.name.value,(0,$n.isNodeInterfaceObject)(i)){n.upsertInterfaceObjectParentNode(i);return}n.upsertParentNode(i),r=t.get(n.parentTypeName)},leave(){r=void 0,n.areFieldsExternal=!1,n.areFieldsShareable=!1,n.isCurrentParentEntity=!1,n.isParentRootType=!1,n.parentTypeName=""}},ObjectTypeExtension:{enter(i){let s=i.name.value;n.areFieldsExternal=(0,$n.isNodeExternal)(i),n.areFieldsShareable=!n.isCurrentSubgraphVersionTwo||(0,$n.isNodeShareable)(i),n.isCurrentParentExtensionType=!0,n.isCurrentParentEntity=(0,$n.isObjectLikeNodeEntity)(i),n.parentTypeName=s,n.isParentRootType=n.isObjectRootType(i),n.upsertExtensionNode(i),r=t.get(n.parentTypeName)},leave(){r=void 0,n.areFieldsExternal=!1,n.areFieldsShareable=!1,n.isCurrentParentEntity=!1,n.isCurrentParentExtensionType=!1,n.parentTypeName="",n.isParentRootType=!1}},ScalarTypeDefinition:{enter(i){n.upsertParentNode(i)}}})}Fo.walkSubgraphToFederate=hB});var Cf={};Fc(Cf,{__addDisposableResource:()=>bD,__assign:()=>Pf,__asyncDelegator:()=>TD,__asyncGenerator:()=>hD,__asyncValues:()=>yD,__await:()=>ku,__awaiter:()=>cD,__classPrivateFieldGet:()=>ID,__classPrivateFieldIn:()=>_D,__classPrivateFieldSet:()=>vD,__createBinding:()=>Uf,__decorate:()=>oD,__disposeResources:()=>SD,__esDecorate:()=>TB,__exportStar:()=>dD,__extends:()=>iD,__generator:()=>lD,__importDefault:()=>gD,__importStar:()=>ND,__makeTemplateObject:()=>ED,__metadata:()=>uD,__param:()=>aD,__propKey:()=>EB,__read:()=>xE,__rest:()=>sD,__runInitializers:()=>yB,__setFunctionName:()=>NB,__spread:()=>pD,__spreadArray:()=>mD,__spreadArrays:()=>fD,__values:()=>Mf,default:()=>vB});function iD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");kE(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function sD(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}function aD(e,t){return function(n,r){t(n,r,e)}}function TB(e,t,n,r,i,s){function o(x){if(x!==void 0&&typeof x!="function")throw new TypeError("Function expected");return x}for(var a=r.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!t&&e?r.static?e:e.prototype:null,l=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),m,h=!1,E=n.length-1;E>=0;E--){var N={};for(var D in r)N[D]=D==="access"?{}:r[D];for(var D in r.access)N.access[D]=r.access[D];N.addInitializer=function(x){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(x||null))};var w=(0,n[E])(a==="accessor"?{get:l.get,set:l.set}:l[u],N);if(a==="accessor"){if(w===void 0)continue;if(w===null||typeof w!="object")throw new TypeError("Object expected");(m=o(w.get))&&(l.get=m),(m=o(w.set))&&(l.set=m),(m=o(w.init))&&i.unshift(m)}else(m=o(w))&&(a==="field"?i.unshift(m):l[u]=m)}c&&Object.defineProperty(c,r.name,l),h=!0}function yB(e,t,n){for(var r=arguments.length>2,i=0;i0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function xE(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s}function pD(){for(var e=[],t=0;t1||a(h,E)})})}function a(h,E){try{u(r[h](E))}catch(N){m(s[0][3],N)}}function u(h){h.value instanceof ku?Promise.resolve(h.value.v).then(c,l):m(s[0][2],h)}function c(h){a("next",h)}function l(h){a("throw",h)}function m(h,E){h(E),s.shift(),s.length&&a(s[0][0],s[0][1])}}function TD(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,s){t[i]=e[i]?function(o){return(n=!n)?{value:ku(e[i](o)),done:!1}:s?s(o):o}:s}}function yD(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Mf=="function"?Mf(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=e[s]&&function(o){return new Promise(function(a,u){o=e[s](o),i(a,u,o.done,o.value)})}}function i(s,o,a,u){Promise.resolve(u).then(function(c){s({value:c,done:a})},o)}}function ED(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function ND(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Uf(t,e,n);return gB(t,e),t}function gD(e){return e&&e.__esModule?e:{default:e}}function ID(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function vD(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n}function _D(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function bD(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose]}if(typeof r!="function")throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}function SD(e){function t(r){e.error=e.hasError?new IB(r,e.error,"An error was suppressed during disposal."):r,e.hasError=!0}function n(){for(;e.stack.length;){var r=e.stack.pop();try{var i=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(i).then(n,function(s){return t(s),n()})}catch(s){t(s)}}if(e.hasError)throw e.error}return n()}var kE,Pf,Uf,gB,IB,vB,Bf=j(()=>{"use strict";d();f();p();kE=function(e,t){return kE=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},kE(e,t)};Pf=function(){return Pf=Object.assign||function(t){for(var n,r=1,i=arguments.length;r{"use strict";d();f();p()});var cd=L(An=>{"use strict";d();f();p();Object.defineProperty(An,"__esModule",{value:!0});An.assertSome=An.isSome=An.compareNodes=An.nodeToString=An.compareStrings=An.isValidPath=An.isDocumentString=An.asArray=void 0;var _B=(ne(),se(ce)),bB=e=>Array.isArray(e)?e:e?[e]:[];An.asArray=bB;var SB=/\.[a-z0-9]+$/i;function DB(e){if(typeof e!="string"||SB.test(e))return!1;try{return(0,_B.parse)(e),!0}catch(t){}return!1}An.isDocumentString=DB;var OB=/[‘“!%^<=>`]/;function AB(e){return typeof e=="string"&&!OB.test(e)}An.isValidPath=AB;function OD(e,t){return String(e)String(t)?1:0}An.compareStrings=OD;function PE(e){var n,r;let t;return"alias"in e&&(t=(n=e.alias)==null?void 0:n.value),t==null&&"name"in e&&(t=(r=e.name)==null?void 0:r.value),t==null&&(t=e.kind),t}An.nodeToString=PE;function wB(e,t,n){let r=PE(e),i=PE(t);return typeof n=="function"?n(r,i):OD(r,i)}An.compareNodes=wB;function FB(e){return e!=null}An.isSome=FB;function LB(e,t="Value should be something"){if(e==null)throw new Error(t)}An.assertSome=LB});var $f=L($r=>{"use strict";d();f();p();Object.defineProperty($r,"__esModule",{value:!0});$r.hasOwnProperty=$r.promiseReduce=$r.isPromise=$r.isObjectLike=$r.isIterableObject=void 0;function RB(e){return e!=null&&typeof e=="object"&&Symbol.iterator in e}$r.isIterableObject=RB;function AD(e){return typeof e=="object"&&e!==null}$r.isObjectLike=AD;function wD(e){return AD(e)&&typeof e.then=="function"}$r.isPromise=wD;function kB(e,t,n){let r=n;for(let i of e)r=wD(r)?r.then(s=>t(s,i)):t(r,i);return r}$r.promiseReduce=kB;function xB(e,t){return Object.prototype.hasOwnProperty.call(e,t)}$r.hasOwnProperty=xB});var Vf=L(xu=>{"use strict";d();f();p();Object.defineProperty(xu,"__esModule",{value:!0});xu.relocatedError=xu.createGraphQLError=void 0;var ME=(ne(),se(ce));function FD(e,t){return ME.versionInfo.major>=17?new ME.GraphQLError(e,t):new ME.GraphQLError(e,t==null?void 0:t.nodes,t==null?void 0:t.source,t==null?void 0:t.positions,t==null?void 0:t.path,t==null?void 0:t.originalError,t==null?void 0:t.extensions)}xu.createGraphQLError=FD;function PB(e,t){return FD(e.message,{nodes:e.nodes,source:e.source,positions:e.positions,path:t==null?e.path:t,originalError:e,extensions:e.extensions})}xu.relocatedError=PB});var ld=L(Gf=>{"use strict";d();f();p();Object.defineProperty(Gf,"__esModule",{value:!0});Gf.inspect=void 0;var MB=(ne(),se(ce)),kD=3;function UB(e){return jf(e,[])}Gf.inspect=UB;function jf(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return CB(e,t);default:return String(e)}}function LD(e){return e instanceof MB.GraphQLError?e.toString():`${e.name}: ${e.message}; + ${e.stack}`}function CB(e,t){if(e===null)return"null";if(e instanceof Error)return e.name==="AggregateError"?LD(e)+` +`+RD(e.errors,t):LD(e);if(t.includes(e))return"[Circular]";let n=[...t,e];if(BB(e)){let r=e.toJSON();if(r!==e)return typeof r=="string"?r:jf(r,n)}else if(Array.isArray(e))return RD(e,n);return $B(e,n)}function BB(e){return typeof e.toJSON=="function"}function $B(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>kD?"["+VB(e)+"]":"{ "+n.map(([i,s])=>i+": "+jf(s,t)).join(", ")+" }"}function RD(e,t){if(e.length===0)return"[]";if(t.length>kD)return"[Array]";let n=e.length,r=[];for(let i=0;i{"use strict";d();f();p();Object.defineProperty(Kf,"__esModule",{value:!0});Kf.getArgumentValues=void 0;var jB=$f(),va=(ne(),se(ce)),qf=Vf(),UE=ld();function GB(e,t,n={}){var o;let r={},s=((o=t.arguments)!=null?o:[]).reduce((a,u)=>M(A({},a),{[u.name.value]:u}),{});for(let{name:a,type:u,defaultValue:c}of e.args){let l=s[a];if(!l){if(c!==void 0)r[a]=c;else if((0,va.isNonNullType)(u))throw(0,qf.createGraphQLError)(`Argument "${a}" of required type "${(0,UE.inspect)(u)}" was not provided.`,{nodes:[t]});continue}let m=l.value,h=m.kind===va.Kind.NULL;if(m.kind===va.Kind.VARIABLE){let N=m.name.value;if(n==null||!(0,jB.hasOwnProperty)(n,N)){if(c!==void 0)r[a]=c;else if((0,va.isNonNullType)(u))throw(0,qf.createGraphQLError)(`Argument "${a}" of required type "${(0,UE.inspect)(u)}" was provided the variable "$${N}" which was not provided a runtime value.`,{nodes:[m]});continue}h=n[N]==null}if(h&&(0,va.isNonNullType)(u))throw(0,qf.createGraphQLError)(`Argument "${a}" of non-null type "${(0,UE.inspect)(u)}" must not be null.`,{nodes:[m]});let E=(0,va.valueFromAST)(m,u,n);if(E===void 0)throw(0,qf.createGraphQLError)(`Argument "${a}" has invalid value ${(0,va.print)(m)}.`,{nodes:[m]});r[a]=E}return r}Kf.getArgumentValues=GB});var BE=L(Pi=>{"use strict";d();f();p();Object.defineProperty(Pi,"__esModule",{value:!0});Pi.getDirective=Pi.getDirectives=Pi.getDirectiveInExtensions=Pi.getDirectivesInExtensions=void 0;var PD=CE();function MD(e,t=["directives"]){return t.reduce((n,r)=>n==null?n:n[r],e==null?void 0:e.extensions)}Pi.getDirectivesInExtensions=MD;function xD(e,t){let n=e.filter(r=>r.name===t);if(n.length)return n.map(r=>{var i;return(i=r.args)!=null?i:{}})}function UD(e,t,n=["directives"]){let r=n.reduce((s,o)=>s==null?s:s[o],e==null?void 0:e.extensions);if(r===void 0)return;if(Array.isArray(r))return xD(r,t);let i=[];for(let[s,o]of Object.entries(r))if(Array.isArray(o))for(let a of o)i.push({name:s,args:a});else i.push({name:s,args:o});return xD(i,t)}Pi.getDirectiveInExtensions=UD;function qB(e,t,n=["directives"]){let r=MD(t,n);if(r!=null&&r.length>0)return r;let s=(e&&e.getDirectives?e.getDirectives():[]).reduce((u,c)=>(u[c.name]=c,u),{}),o=[];t.astNode&&o.push(t.astNode),"extensionASTNodes"in t&&t.extensionASTNodes&&(o=[...o,...t.extensionASTNodes]);let a=[];for(let u of o)if(u.directives)for(let c of u.directives){let l=s[c.name.value];l&&a.push({name:c.name.value,args:(0,PD.getArgumentValues)(l,c)})}return a}Pi.getDirectives=qB;function KB(e,t,n,r=["directives"]){let i=UD(t,n,r);if(i!=null)return i;let s=e&&e.getDirective?e.getDirective(n):void 0;if(s==null)return;let o=[];t.astNode&&o.push(t.astNode),"extensionASTNodes"in t&&t.extensionASTNodes&&(o=[...o,...t.extensionASTNodes]);let a=[];for(let u of o)if(u.directives)for(let c of u.directives)c.name.value===n&&a.push((0,PD.getArgumentValues)(s,c));if(a.length)return a}Pi.getDirective=KB});var $E=L(Qf=>{"use strict";d();f();p();Object.defineProperty(Qf,"__esModule",{value:!0});Qf.getFieldsWithDirectives=void 0;var QB=(ne(),se(ce));function YB(e,t={}){let n={},r=["ObjectTypeDefinition","ObjectTypeExtension"];t.includeInputTypes&&(r=[...r,"InputObjectTypeDefinition","InputObjectTypeExtension"]);let i=e.definitions.filter(s=>r.includes(s.kind));for(let s of i){let o=s.name.value;if(s.fields!=null){for(let a of s.fields)if(a.directives&&a.directives.length>0){let u=a.name.value,c=`${o}.${u}`,l=a.directives.map(m=>({name:m.name.value,args:(m.arguments||[]).reduce((h,E)=>M(A({},h),{[E.name.value]:(0,QB.valueFromASTUntyped)(E.value)}),{})}));n[c]=l}}}return n}Qf.getFieldsWithDirectives=YB});var CD=L(Yf=>{"use strict";d();f();p();Object.defineProperty(Yf,"__esModule",{value:!0});Yf.getArgumentsWithDirectives=void 0;var VE=(ne(),se(ce));function JB(e){return e.kind===VE.Kind.OBJECT_TYPE_DEFINITION||e.kind===VE.Kind.OBJECT_TYPE_EXTENSION}function zB(e){var r;let t={},n=e.definitions.filter(JB);for(let i of n)if(i.fields!=null)for(let s of i.fields){let o=(r=s.arguments)==null?void 0:r.filter(u=>{var c;return(c=u.directives)==null?void 0:c.length});if(!(o!=null&&o.length))continue;let a=t[`${i.name.value}.${s.name.value}`]={};for(let u of o){let c=u.directives.map(l=>({name:l.name.value,args:(l.arguments||[]).reduce((m,h)=>M(A({},m),{[h.name.value]:(0,VE.valueFromASTUntyped)(h.value)}),{})}));a[u.name.value]=c}}return t}Yf.getArgumentsWithDirectives=zB});var jE=L(Jf=>{"use strict";d();f();p();Object.defineProperty(Jf,"__esModule",{value:!0});Jf.getImplementingTypes=void 0;var XB=(ne(),se(ce));function HB(e,t){let n=t.getTypeMap(),r=[];for(let i in n){let s=n[i];(0,XB.isObjectType)(s)&&s.getInterfaces().find(a=>a.name===e)&&r.push(s.name)}return r}Jf.getImplementingTypes=HB});var qE=L(zf=>{"use strict";d();f();p();Object.defineProperty(zf,"__esModule",{value:!0});zf.astFromType=void 0;var _a=(ne(),se(ce)),WB=ld();function GE(e){if((0,_a.isNonNullType)(e)){let t=GE(e.ofType);if(t.kind===_a.Kind.NON_NULL_TYPE)throw new Error(`Invalid type node ${(0,WB.inspect)(e)}. Inner type of non-null type cannot be a non-null type.`);return{kind:_a.Kind.NON_NULL_TYPE,type:t}}else if((0,_a.isListType)(e))return{kind:_a.Kind.LIST_TYPE,type:GE(e.ofType)};return{kind:_a.Kind.NAMED_TYPE,name:{kind:_a.Kind.NAME,value:e.name}}}zf.astFromType=GE});var Hf=L(Xf=>{"use strict";d();f();p();Object.defineProperty(Xf,"__esModule",{value:!0});Xf.astFromValueUntyped=void 0;var Mi=(ne(),se(ce));function KE(e){if(e===null)return{kind:Mi.Kind.NULL};if(e===void 0)return null;if(Array.isArray(e)){let t=[];for(let n of e){let r=KE(n);r!=null&&t.push(r)}return{kind:Mi.Kind.LIST,values:t}}if(typeof e=="object"){let t=[];for(let n in e){let r=e[n],i=KE(r);i&&t.push({kind:Mi.Kind.OBJECT_FIELD,name:{kind:Mi.Kind.NAME,value:n},value:i})}return{kind:Mi.Kind.OBJECT,fields:t}}if(typeof e=="boolean")return{kind:Mi.Kind.BOOLEAN,value:e};if(typeof e=="bigint")return{kind:Mi.Kind.INT,value:String(e)};if(typeof e=="number"&&isFinite(e)){let t=String(e);return ZB.test(t)?{kind:Mi.Kind.INT,value:t}:{kind:Mi.Kind.FLOAT,value:t}}if(typeof e=="string")return{kind:Mi.Kind.STRING,value:e};throw new TypeError(`Cannot convert value to AST: ${e}.`)}Xf.astFromValueUntyped=KE;var ZB=/^-?(?:0|[1-9][0-9]*)$/});var Pu=L(Xn=>{"use strict";d();f();p();Object.defineProperty(Xn,"__esModule",{value:!0});Xn.memoize2of5=Xn.memoize2of4=Xn.memoize5=Xn.memoize4=Xn.memoize3=Xn.memoize2=Xn.memoize1=void 0;function e$(e){let t=new WeakMap;return function(r){let i=t.get(r);if(i===void 0){let s=e(r);return t.set(r,s),s}return i}}Xn.memoize1=e$;function t$(e){let t=new WeakMap;return function(r,i){let s=t.get(r);if(!s){s=new WeakMap,t.set(r,s);let a=e(r,i);return s.set(i,a),a}let o=s.get(i);if(o===void 0){let a=e(r,i);return s.set(i,a),a}return o}}Xn.memoize2=t$;function n$(e){let t=new WeakMap;return function(r,i,s){let o=t.get(r);if(!o){o=new WeakMap,t.set(r,o);let c=new WeakMap;o.set(i,c);let l=e(r,i,s);return c.set(s,l),l}let a=o.get(i);if(!a){a=new WeakMap,o.set(i,a);let c=e(r,i,s);return a.set(s,c),c}let u=a.get(s);if(u===void 0){let c=e(r,i,s);return a.set(s,c),c}return u}}Xn.memoize3=n$;function r$(e){let t=new WeakMap;return function(r,i,s,o){let a=t.get(r);if(!a){a=new WeakMap,t.set(r,a);let m=new WeakMap;a.set(i,m);let h=new WeakMap;m.set(s,h);let E=e(r,i,s,o);return h.set(o,E),E}let u=a.get(i);if(!u){u=new WeakMap,a.set(i,u);let m=new WeakMap;u.set(s,m);let h=e(r,i,s,o);return m.set(o,h),h}let c=u.get(s);if(!c){let m=new WeakMap;u.set(s,m);let h=e(r,i,s,o);return m.set(o,h),h}let l=c.get(o);if(l===void 0){let m=e(r,i,s,o);return c.set(o,m),m}return l}}Xn.memoize4=r$;function i$(e){let t=new WeakMap;return function(r,i,s,o,a){let u=t.get(r);if(!u){u=new WeakMap,t.set(r,u);let E=new WeakMap;u.set(i,E);let N=new WeakMap;E.set(s,N);let D=new WeakMap;N.set(o,D);let w=e(r,i,s,o,a);return D.set(a,w),w}let c=u.get(i);if(!c){c=new WeakMap,u.set(i,c);let E=new WeakMap;c.set(s,E);let N=new WeakMap;E.set(o,N);let D=e(r,i,s,o,a);return N.set(a,D),D}let l=c.get(s);if(!l){l=new WeakMap,c.set(s,l);let E=new WeakMap;l.set(o,E);let N=e(r,i,s,o,a);return E.set(a,N),N}let m=l.get(o);if(!m){m=new WeakMap,l.set(o,m);let E=e(r,i,s,o,a);return m.set(a,E),E}let h=m.get(a);if(h===void 0){let E=e(r,i,s,o,a);return m.set(a,E),E}return h}}Xn.memoize5=i$;function s$(e){let t=new WeakMap;return function(r,i,s,o){let a=t.get(r);if(!a){a=new WeakMap,t.set(r,a);let c=e(r,i,s,o);return a.set(i,c),c}let u=a.get(i);if(u===void 0){let c=e(r,i,s,o);return a.set(i,c),c}return u}}Xn.memoize2of4=s$;function o$(e){let t=new WeakMap;return function(r,i,s,o,a){let u=t.get(r);if(!u){u=new WeakMap,t.set(r,u);let l=e(r,i,s,o,a);return u.set(i,l),l}let c=u.get(i);if(c===void 0){let l=e(r,i,s,o,a);return u.set(i,l),l}return c}}Xn.memoize2of5=o$});var dd=L(Lr=>{"use strict";d();f();p();Object.defineProperty(Lr,"__esModule",{value:!0});Lr.getRootTypeMap=Lr.getRootTypes=Lr.getRootTypeNames=Lr.getDefinedRootType=void 0;var a$=Vf(),QE=Pu();function u$(e,t,n){let i=(0,Lr.getRootTypeMap)(e).get(t);if(i==null)throw(0,a$.createGraphQLError)(`Schema is not configured to execute ${t} operation.`,{nodes:n});return i}Lr.getDefinedRootType=u$;Lr.getRootTypeNames=(0,QE.memoize1)(function(t){let n=(0,Lr.getRootTypes)(t);return new Set([...n].map(r=>r.name))});Lr.getRootTypes=(0,QE.memoize1)(function(t){let n=(0,Lr.getRootTypeMap)(t);return new Set(n.values())});Lr.getRootTypeMap=(0,QE.memoize1)(function(t){let n=new Map,r=t.getQueryType();r&&n.set("query",r);let i=t.getMutationType();i&&n.set("mutation",i);let s=t.getSubscriptionType();return s&&n.set("subscription",s),n})});var $D=L(Wf=>{"use strict";d();f();p();Object.defineProperty(Wf,"__esModule",{value:!0});Wf.astFromValue=void 0;var Rr=(ne(),se(ce)),BD=$f(),c$=ld(),l$=Hf();function pd(e,t){if((0,Rr.isNonNullType)(t)){let n=pd(e,t.ofType);return(n==null?void 0:n.kind)===Rr.Kind.NULL?null:n}if(e===null)return{kind:Rr.Kind.NULL};if(e===void 0)return null;if((0,Rr.isListType)(t)){let n=t.ofType;if((0,BD.isIterableObject)(e)){let r=[];for(let i of e){let s=pd(i,n);s!=null&&r.push(s)}return{kind:Rr.Kind.LIST,values:r}}return pd(e,n)}if((0,Rr.isInputObjectType)(t)){if(!(0,BD.isObjectLike)(e))return null;let n=[];for(let r of Object.values(t.getFields())){let i=pd(e[r.name],r.type);i&&n.push({kind:Rr.Kind.OBJECT_FIELD,name:{kind:Rr.Kind.NAME,value:r.name},value:i})}return{kind:Rr.Kind.OBJECT,fields:n}}if((0,Rr.isLeafType)(t)){let n=t.serialize(e);return n==null?null:(0,Rr.isEnumType)(t)?{kind:Rr.Kind.ENUM,value:n}:t.name==="ID"&&typeof n=="string"&&d$.test(n)?{kind:Rr.Kind.INT,value:n}:(0,l$.astFromValueUntyped)(n)}console.assert(!1,"Unexpected input type: "+(0,c$.inspect)(t))}Wf.astFromValue=pd;var d$=/^-?(?:0|[1-9][0-9]*)$/});var HE=L(Ye=>{"use strict";d();f();p();Object.defineProperty(Ye,"__esModule",{value:!0});Ye.makeDirectiveNodes=Ye.makeDirectiveNode=Ye.makeDeprecatedDirective=Ye.astFromEnumValue=Ye.astFromInputField=Ye.astFromField=Ye.astFromScalarType=Ye.astFromEnumType=Ye.astFromInputObjectType=Ye.astFromUnionType=Ye.astFromInterfaceType=Ye.astFromObjectType=Ye.astFromArg=Ye.getDeprecatableDirectiveNodes=Ye.getDirectiveNodes=Ye.astFromDirective=Ye.astFromSchema=Ye.printSchemaWithDirectives=Ye.getDocumentNodeFromSchema=void 0;var _e=(ne(),se(ce)),ba=qE(),YE=BE(),p$=Hf(),f$=cd(),m$=dd(),JE=$D();function VD(e,t={}){let n=t.pathToDirectivesInExtensions,r=e.getTypeMap(),i=jD(e,n),s=i!=null?[i]:[],o=e.getDirectives();for(let a of o)(0,_e.isSpecifiedDirective)(a)||s.push(GD(a,e,n));for(let a in r){let u=r[a],c=(0,_e.isSpecifiedScalarType)(u),l=(0,_e.isIntrospectionType)(u);if(!(c||l))if((0,_e.isObjectType)(u))s.push(qD(u,e,n));else if((0,_e.isInterfaceType)(u))s.push(KD(u,e,n));else if((0,_e.isUnionType)(u))s.push(QD(u,e,n));else if((0,_e.isInputObjectType)(u))s.push(YD(u,e,n));else if((0,_e.isEnumType)(u))s.push(JD(u,e,n));else if((0,_e.isScalarType)(u))s.push(zD(u,e,n));else throw new Error(`Unknown type ${u}.`)}return{kind:_e.Kind.DOCUMENT,definitions:s}}Ye.getDocumentNodeFromSchema=VD;function h$(e,t={}){let n=VD(e,t);return(0,_e.print)(n)}Ye.printSchemaWithDirectives=h$;function jD(e,t){var u,c;let n=new Map([["query",void 0],["mutation",void 0],["subscription",void 0]]),r=[];if(e.astNode!=null&&r.push(e.astNode),e.extensionASTNodes!=null)for(let l of e.extensionASTNodes)r.push(l);for(let l of r)if(l.operationTypes)for(let m of l.operationTypes)n.set(m.operation,m);let i=(0,m$.getRootTypeMap)(e);for(let[l,m]of n){let h=i.get(l);if(h!=null){let E=(0,ba.astFromType)(h);m!=null?m.type=E:n.set(l,{kind:_e.Kind.OPERATION_TYPE_DEFINITION,operation:l,type:E})}}let s=[...n.values()].filter(f$.isSome),o=Sa(e,e,t);if(!s.length&&!o.length)return null;let a={kind:s!=null?_e.Kind.SCHEMA_DEFINITION:_e.Kind.SCHEMA_EXTENSION,operationTypes:s,directives:o};return a.description=((c=(u=e.astNode)==null?void 0:u.description)!=null?c:e.description!=null)?{kind:_e.Kind.STRING,value:e.description,block:!0}:void 0,a}Ye.astFromSchema=jD;function GD(e,t,n){var r,i,s,o;return{kind:_e.Kind.DIRECTIVE_DEFINITION,description:(i=(r=e.astNode)==null?void 0:r.description)!=null?i:e.description?{kind:_e.Kind.STRING,value:e.description}:void 0,name:{kind:_e.Kind.NAME,value:e.name},arguments:(s=e.args)==null?void 0:s.map(a=>zE(a,t,n)),repeatable:e.isRepeatable,locations:((o=e.locations)==null?void 0:o.map(a=>({kind:_e.Kind.NAME,value:a})))||[]}}Ye.astFromDirective=GD;function Sa(e,t,n){let r=(0,YE.getDirectivesInExtensions)(e,n),i=[];e.astNode!=null&&i.push(e.astNode),"extensionASTNodes"in e&&e.extensionASTNodes!=null&&(i=i.concat(e.extensionASTNodes));let s;if(r!=null)s=Zf(t,r);else{s=[];for(let o of i)o.directives&&s.push(...o.directives)}return s}Ye.getDirectiveNodes=Sa;function md(e,t,n){var a,u;let r=[],i=null,s=(0,YE.getDirectivesInExtensions)(e,n),o;return s!=null?o=Zf(t,s):o=(a=e.astNode)==null?void 0:a.directives,o!=null&&(r=o.filter(c=>c.name.value!=="deprecated"),e.deprecationReason!=null&&(i=(u=o.filter(c=>c.name.value==="deprecated"))==null?void 0:u[0])),e.deprecationReason!=null&&i==null&&(i=WD(e.deprecationReason)),i==null?r:[i].concat(r)}Ye.getDeprecatableDirectiveNodes=md;function zE(e,t,n){var r,i,s;return{kind:_e.Kind.INPUT_VALUE_DEFINITION,description:(i=(r=e.astNode)==null?void 0:r.description)!=null?i:e.description?{kind:_e.Kind.STRING,value:e.description,block:!0}:void 0,name:{kind:_e.Kind.NAME,value:e.name},type:(0,ba.astFromType)(e.type),defaultValue:e.defaultValue!==void 0&&(s=(0,JE.astFromValue)(e.defaultValue,e.type))!=null?s:void 0,directives:md(e,t,n)}}Ye.astFromArg=zE;function qD(e,t,n){var r,i;return{kind:_e.Kind.OBJECT_TYPE_DEFINITION,description:(i=(r=e.astNode)==null?void 0:r.description)!=null?i:e.description?{kind:_e.Kind.STRING,value:e.description,block:!0}:void 0,name:{kind:_e.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(s=>XE(s,t,n)),interfaces:Object.values(e.getInterfaces()).map(s=>(0,ba.astFromType)(s)),directives:Sa(e,t,n)}}Ye.astFromObjectType=qD;function KD(e,t,n){var i,s;let r={kind:_e.Kind.INTERFACE_TYPE_DEFINITION,description:(s=(i=e.astNode)==null?void 0:i.description)!=null?s:e.description?{kind:_e.Kind.STRING,value:e.description,block:!0}:void 0,name:{kind:_e.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(o=>XE(o,t,n)),directives:Sa(e,t,n)};return"getInterfaces"in e&&(r.interfaces=Object.values(e.getInterfaces()).map(o=>(0,ba.astFromType)(o))),r}Ye.astFromInterfaceType=KD;function QD(e,t,n){var r,i;return{kind:_e.Kind.UNION_TYPE_DEFINITION,description:(i=(r=e.astNode)==null?void 0:r.description)!=null?i:e.description?{kind:_e.Kind.STRING,value:e.description,block:!0}:void 0,name:{kind:_e.Kind.NAME,value:e.name},directives:Sa(e,t,n),types:e.getTypes().map(s=>(0,ba.astFromType)(s))}}Ye.astFromUnionType=QD;function YD(e,t,n){var r,i;return{kind:_e.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:(i=(r=e.astNode)==null?void 0:r.description)!=null?i:e.description?{kind:_e.Kind.STRING,value:e.description,block:!0}:void 0,name:{kind:_e.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(s=>XD(s,t,n)),directives:Sa(e,t,n)}}Ye.astFromInputObjectType=YD;function JD(e,t,n){var r,i;return{kind:_e.Kind.ENUM_TYPE_DEFINITION,description:(i=(r=e.astNode)==null?void 0:r.description)!=null?i:e.description?{kind:_e.Kind.STRING,value:e.description,block:!0}:void 0,name:{kind:_e.Kind.NAME,value:e.name},values:Object.values(e.getValues()).map(s=>HD(s,t,n)),directives:Sa(e,t,n)}}Ye.astFromEnumType=JD;function zD(e,t,n){var o,a,u;let r=(0,YE.getDirectivesInExtensions)(e,n),i=r?Zf(t,r):((o=e.astNode)==null?void 0:o.directives)||[],s=e.specifiedByUrl||e.specifiedByURL;if(s&&!i.some(c=>c.name.value==="specifiedBy")){let c={url:s};i.push(fd("specifiedBy",c))}return{kind:_e.Kind.SCALAR_TYPE_DEFINITION,description:(u=(a=e.astNode)==null?void 0:a.description)!=null?u:e.description?{kind:_e.Kind.STRING,value:e.description,block:!0}:void 0,name:{kind:_e.Kind.NAME,value:e.name},directives:i}}Ye.astFromScalarType=zD;function XE(e,t,n){var r,i;return{kind:_e.Kind.FIELD_DEFINITION,description:(i=(r=e.astNode)==null?void 0:r.description)!=null?i:e.description?{kind:_e.Kind.STRING,value:e.description,block:!0}:void 0,name:{kind:_e.Kind.NAME,value:e.name},arguments:e.args.map(s=>zE(s,t,n)),type:(0,ba.astFromType)(e.type),directives:md(e,t,n)}}Ye.astFromField=XE;function XD(e,t,n){var r,i,s;return{kind:_e.Kind.INPUT_VALUE_DEFINITION,description:(i=(r=e.astNode)==null?void 0:r.description)!=null?i:e.description?{kind:_e.Kind.STRING,value:e.description,block:!0}:void 0,name:{kind:_e.Kind.NAME,value:e.name},type:(0,ba.astFromType)(e.type),directives:md(e,t,n),defaultValue:(s=(0,JE.astFromValue)(e.defaultValue,e.type))!=null?s:void 0}}Ye.astFromInputField=XD;function HD(e,t,n){var r,i;return{kind:_e.Kind.ENUM_VALUE_DEFINITION,description:(i=(r=e.astNode)==null?void 0:r.description)!=null?i:e.description?{kind:_e.Kind.STRING,value:e.description,block:!0}:void 0,name:{kind:_e.Kind.NAME,value:e.name},directives:md(e,t,n)}}Ye.astFromEnumValue=HD;function WD(e){return fd("deprecated",{reason:e},_e.GraphQLDeprecatedDirective)}Ye.makeDeprecatedDirective=WD;function fd(e,t,n){let r=[];if(n!=null)for(let i of n.args){let s=i.name,o=t[s];if(o!==void 0){let a=(0,JE.astFromValue)(o,i.type);a&&r.push({kind:_e.Kind.ARGUMENT,name:{kind:_e.Kind.NAME,value:s},value:a})}}else for(let i in t){let s=t[i],o=(0,p$.astFromValueUntyped)(s);o&&r.push({kind:_e.Kind.ARGUMENT,name:{kind:_e.Kind.NAME,value:i},value:o})}return{kind:_e.Kind.DIRECTIVE,name:{kind:_e.Kind.NAME,value:e},arguments:r}}Ye.makeDirectiveNode=fd;function Zf(e,t){let n=[];for(let r in t){let i=t[r],s=e==null?void 0:e.getDirective(r);if(Array.isArray(i))for(let o of i)n.push(fd(r,o,s));else n.push(fd(r,i,s))}return n}Ye.makeDirectiveNodes=Zf});var eO=L(Mu=>{"use strict";d();f();p();Object.defineProperty(Mu,"__esModule",{value:!0});Mu.createDefaultRules=Mu.validateGraphQlDocuments=void 0;var em=(ne(),se(ce));function T$(e,t,n=ZD()){var o;let r=new Map;for(let a of t)for(let u of a.definitions)"name"in u&&u.name?r.set(`${u.kind}_${u.name.value}`,u):r.set(Date.now().toString(),u);let i={kind:em.Kind.DOCUMENT,definitions:Array.from(r.values())},s=(0,em.validate)(e,i,n);for(let a of s)if(a.stack=a.message,a.locations)for(let u of a.locations)a.stack+=` + at ${(o=a.source)==null?void 0:o.name}:${u.line}:${u.column}`;return s}Mu.validateGraphQlDocuments=T$;function ZD(){let e=["NoUnusedFragmentsRule","NoUnusedVariablesRule","KnownDirectivesRule"];return em.versionInfo.major<15&&(e=e.map(t=>t.replace(/Rule$/,""))),em.specifiedRules.filter(t=>!e.includes(t.name))}Mu.createDefaultRules=ZD});var tO=L(tm=>{"use strict";d();f();p();Object.defineProperty(tm,"__esModule",{value:!0});tm.parseGraphQLJSON=void 0;var y$=(ne(),se(ce));function E$(e){return e=e.toString(),e.charCodeAt(0)===65279&&(e=e.slice(1)),e}function N$(e){return JSON.parse(E$(e))}function g$(e,t,n){let r=N$(t);if(r.data&&(r=r.data),r.kind==="Document")return{location:e,document:r};if(r.__schema){let i=(0,y$.buildClientSchema)(r,n);return{location:e,schema:i}}else if(typeof r=="string")return{location:e,rawSDL:r};throw new Error("Not valid JSON content")}tm.parseGraphQLJSON=g$});var ZE=L(en=>{"use strict";d();f();p();Object.defineProperty(en,"__esModule",{value:!0});en.getBlockStringIndentation=en.dedentBlockStringValue=en.getLeadingCommentBlock=en.getComment=en.getDescription=en.printWithComments=en.printComment=en.pushComment=en.collectComment=en.resetComments=void 0;var sO=(ne(),se(ce)),I$=80,Uu={};function v$(){Uu={}}en.resetComments=v$;function _$(e){var n;let t=(n=e.name)==null?void 0:n.value;if(t!=null)switch(hd(e,t),e.kind){case"EnumTypeDefinition":if(e.values)for(let r of e.values)hd(r,t,r.name.value);break;case"ObjectTypeDefinition":case"InputObjectTypeDefinition":case"InterfaceTypeDefinition":if(e.fields){for(let r of e.fields)if(hd(r,t,r.name.value),A$(r)&&r.arguments)for(let i of r.arguments)hd(i,t,r.name.value,i.name.value)}break}}en.collectComment=_$;function hd(e,t,n,r){let i=WE(e);if(typeof i!="string"||i.length===0)return;let s=[t];n&&(s.push(n),r&&s.push(r));let o=s.join(".");Uu[o]||(Uu[o]=[]),Uu[o].push(i)}en.pushComment=hd;function oO(e){return` # `+e.replace(/\n/g,` -# `)}yn.printComment=Cw;function ge(e,t){return e?e.filter(n=>n).join(t||""):""}function Fw(e){var t;return(t=e==null?void 0:e.some(n=>n.includes(` -`)))!=null?t:!1}function Aq(e){return(t,n,r,i,o)=>{var l;let s=[],a=i.reduce((p,h)=>(["fields","arguments","values"].includes(h)&&p.name&&s.push(p.name.value),p[h]),o[0]),c=[...s,(l=a==null?void 0:a.name)==null?void 0:l.value].filter(Boolean).join("."),u=[];return t.kind.includes("Definition")&&Nc[c]&&u.push(...Nc[c]),ge([...u.map(Cw),t.description,e(t,n,r,i,o)],` -`)}}function nd(e){return e&&` ${e.replace(/\n/g,` - `)}`}function ki(e){return e&&e.length!==0?`{ -${nd(ge(e,` +# `)}en.printComment=oO;function pe(e,t){return e?e.filter(n=>n).join(t||""):""}function nO(e){var t;return(t=e==null?void 0:e.some(n=>n.includes(` +`)))!=null?t:!1}function b$(e){return(t,n,r,i,s)=>{var l;let o=[],a=i.reduce((m,h)=>(["fields","arguments","values"].includes(h)&&m.name&&o.push(m.name.value),m[h]),s[0]),u=[...o,(l=a==null?void 0:a.name)==null?void 0:l.value].filter(Boolean).join("."),c=[];return t.kind.includes("Definition")&&Uu[u]&&c.push(...Uu[u]),pe([...c.map(oO),t.description,e(t,n,r,i,s)],` +`)}}function Td(e){return e&&` ${e.replace(/\n/g,` + `)}`}function ci(e){return e&&e.length!==0?`{ +${Td(pe(e,` `))} -}`:""}function cn(e,t,n){return t?e+t+(n||""):""}function wq(e,t=!1){let n=e.replace(/"""/g,'\\"""');return(e[0]===" "||e[0]===" ")&&e.indexOf(` +}`:""}function Yt(e,t,n){return t?e+t+(n||""):""}function S$(e,t=!1){let n=e.replace(/"""/g,'\\"""');return(e[0]===" "||e[0]===" ")&&e.indexOf(` `)===-1?`"""${n.replace(/"$/,`" `)}"""`:`""" -${t?n:nd(n)} -"""`}var kw={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>ge(e.definitions,` +${t?n:Td(n)} +"""`}var rO={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>pe(e.definitions,` -`)},OperationDefinition:{leave:e=>{let t=cn("(",ge(e.variableDefinitions,", "),")");return ge([e.operation,ge([e.name,t]),ge(e.directives," ")]," ")+" "+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+cn(" = ",n)+cn(" ",ge(r," "))},SelectionSet:{leave:({selections:e})=>ki(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let o=cn("",e,": ")+t,s=o+cn("(",ge(n,", "),")");return s.length>Oq&&(s=o+cn(`( -`,nd(ge(n,` +`)},OperationDefinition:{leave:e=>{let t=Yt("(",pe(e.variableDefinitions,", "),")");return pe([e.operation,pe([e.name,t]),pe(e.directives," ")]," ")+" "+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+Yt(" = ",n)+Yt(" ",pe(r," "))},SelectionSet:{leave:({selections:e})=>ci(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let s=Yt("",e,": ")+t,o=s+Yt("(",pe(n,", "),")");return o.length>I$&&(o=s+Yt(`( +`,Td(pe(n,` `)),` -)`)),ge([s,ge(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+cn(" ",ge(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>ge(["...",cn("on ",e),ge(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${cn("(",ge(n,", "),")")} on ${t} ${cn("",ge(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?wq(e):JSON.stringify(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+ge(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+ge(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+cn("(",ge(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({directives:e,operationTypes:t})=>ge(["schema",ge(e," "),ki(t)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({name:e,directives:t})=>ge(["scalar",e,ge(t," ")]," ")},ObjectTypeDefinition:{leave:({name:e,interfaces:t,directives:n,fields:r})=>ge(["type",e,cn("implements ",ge(t," & ")),ge(n," "),ki(r)]," ")},FieldDefinition:{leave:({name:e,arguments:t,type:n,directives:r})=>e+(Fw(t)?cn(`( -`,nd(ge(t,` +)`)),pe([o,pe(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+Yt(" ",pe(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>pe(["...",Yt("on ",e),pe(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${Yt("(",pe(n,", "),")")} on ${t} ${Yt("",pe(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?S$(e):JSON.stringify(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+pe(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+pe(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Yt("(",pe(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({directives:e,operationTypes:t})=>pe(["schema",pe(e," "),ci(t)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({name:e,directives:t})=>pe(["scalar",e,pe(t," ")]," ")},ObjectTypeDefinition:{leave:({name:e,interfaces:t,directives:n,fields:r})=>pe(["type",e,Yt("implements ",pe(t," & ")),pe(n," "),ci(r)]," ")},FieldDefinition:{leave:({name:e,arguments:t,type:n,directives:r})=>e+(nO(t)?Yt(`( +`,Td(pe(t,` `)),` -)`):cn("(",ge(t,", "),")"))+": "+n+cn(" ",ge(r," "))},InputValueDefinition:{leave:({name:e,type:t,defaultValue:n,directives:r})=>ge([e+": "+t,cn("= ",n),ge(r," ")]," ")},InterfaceTypeDefinition:{leave:({name:e,interfaces:t,directives:n,fields:r})=>ge(["interface",e,cn("implements ",ge(t," & ")),ge(n," "),ki(r)]," ")},UnionTypeDefinition:{leave:({name:e,directives:t,types:n})=>ge(["union",e,ge(t," "),cn("= ",ge(n," | "))]," ")},EnumTypeDefinition:{leave:({name:e,directives:t,values:n})=>ge(["enum",e,ge(t," "),ki(n)]," ")},EnumValueDefinition:{leave:({name:e,directives:t})=>ge([e,ge(t," ")]," ")},InputObjectTypeDefinition:{leave:({name:e,directives:t,fields:n})=>ge(["input",e,ge(t," "),ki(n)]," ")},DirectiveDefinition:{leave:({name:e,arguments:t,repeatable:n,locations:r})=>"directive @"+e+(Fw(t)?cn(`( -`,nd(ge(t,` +)`):Yt("(",pe(t,", "),")"))+": "+n+Yt(" ",pe(r," "))},InputValueDefinition:{leave:({name:e,type:t,defaultValue:n,directives:r})=>pe([e+": "+t,Yt("= ",n),pe(r," ")]," ")},InterfaceTypeDefinition:{leave:({name:e,interfaces:t,directives:n,fields:r})=>pe(["interface",e,Yt("implements ",pe(t," & ")),pe(n," "),ci(r)]," ")},UnionTypeDefinition:{leave:({name:e,directives:t,types:n})=>pe(["union",e,pe(t," "),Yt("= ",pe(n," | "))]," ")},EnumTypeDefinition:{leave:({name:e,directives:t,values:n})=>pe(["enum",e,pe(t," "),ci(n)]," ")},EnumValueDefinition:{leave:({name:e,directives:t})=>pe([e,pe(t," ")]," ")},InputObjectTypeDefinition:{leave:({name:e,directives:t,fields:n})=>pe(["input",e,pe(t," "),ci(n)]," ")},DirectiveDefinition:{leave:({name:e,arguments:t,repeatable:n,locations:r})=>"directive @"+e+(nO(t)?Yt(`( +`,Td(pe(t,` `)),` -)`):cn("(",ge(t,", "),")"))+(n?" repeatable":"")+" on "+ge(r," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>ge(["extend schema",ge(e," "),ki(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>ge(["extend scalar",e,ge(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>ge(["extend type",e,cn("implements ",ge(t," & ")),ge(n," "),ki(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>ge(["extend interface",e,cn("implements ",ge(t," & ")),ge(n," "),ki(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>ge(["extend union",e,ge(t," "),cn("= ",ge(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>ge(["extend enum",e,ge(t," "),ki(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>ge(["extend input",e,ge(t," "),ki(n)]," ")}},Rq=Object.keys(kw).reduce((e,t)=>x(D({},e),{[t]:{leave:Aq(kw[t].leave)}}),{});function Lq(e){return(0,xw.visit)(e,Rq)}yn.printWithComments=Lq;function Fq(e){return e.kind==="FieldDefinition"}function kq(e,t){if(e.description!=null)return e.description.value;if(t!=null&&t.commentDescriptions)return Ag(e)}yn.getDescription=kq;function Ag(e){let t=Mw(e);if(t!==void 0)return Uw(` -${t}`)}yn.getComment=Ag;function Mw(e){let t=e.loc;if(!t)return;let n=[],r=t.startToken.prev;for(;r!=null&&r.kind===xw.TokenKind.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}yn.getLeadingCommentBlock=Mw;function Uw(e){let t=e.split(/\r\n|[\n\r]/g),n=jw(t);if(n!==0)for(let r=1;r0&&Pw(t[0]);)t.shift();for(;t.length>0&&Pw(t[t.length-1]);)t.pop();return t.join(` -`)}yn.dedentBlockStringValue=Uw;function jw(e){let t=null;for(let n=1;n{"use strict";d();m();f();Object.defineProperty(aa,"__esModule",{value:!0});aa.isDescribable=aa.transformCommentsToDescriptions=aa.parseGraphQLSDL=void 0;var ci=(he(),Te(Ie)),$w=wg();function Pq(e,t,n={}){let r;try{n.commentDescriptions&&t.includes("#")?(r=Gw(t,n),n.noLocation&&(r=(0,ci.parse)((0,ci.print)(r),n))):r=(0,ci.parse)(new ci.Source(t,e),n)}catch(i){if(i.message.includes("EOF")&&t.replace(/(\#[^*]*)/g,"").trim()==="")r={kind:ci.Kind.DOCUMENT,definitions:[]};else throw i}return{location:e,document:r}}aa.parseGraphQLSDL=Pq;function Gw(e,t={}){let n=(0,ci.parse)(e,x(D({},t),{noLocation:!1}));return(0,ci.visit)(n,{leave:i=>{if(qw(i)){let o=(0,$w.getLeadingCommentBlock)(i);if(o!==void 0){let s=(0,$w.dedentBlockStringValue)(` -`+o),a=s.includes(` -`);return i.description?x(D({},i),{description:x(D({},i.description),{value:i.description.value+` -`+s,block:!0})}):x(D({},i),{description:{kind:ci.Kind.STRING,value:s,block:a}})}}}})}aa.transformCommentsToDescriptions=Gw;function qw(e){return(0,ci.isTypeSystemDefinitionNode)(e)||e.kind===ci.Kind.FIELD_DEFINITION||e.kind===ci.Kind.INPUT_VALUE_DEFINITION||e.kind===ci.Kind.ENUM_VALUE_DEFINITION}aa.isDescribable=qw});var Ww=F(rh=>{"use strict";d();m();f();Object.defineProperty(rh,"__esModule",{value:!0});rh.buildOperationNodeForField=void 0;var We=(he(),Te(Ie)),Jw=Hp(),Fg=[],nh=new Map;function zw(e){Fg.push(e)}function Kw(){Fg=[]}function Qw(){nh=new Map}function xq({schema:e,kind:t,field:n,models:r,ignore:i=[],depthLimit:o,circularReferenceDepth:s,argNames:a,selectedFields:c=!0}){Kw(),Qw();let u=(0,Jw.getRootTypeNames)(e),l=Cq({schema:e,fieldName:n,kind:t,models:r||[],ignore:i,depthLimit:o||1/0,circularReferenceDepth:s||1,argNames:a,selectedFields:c,rootTypeNames:u});return l.variableDefinitions=[...Fg],Kw(),Qw(),l}rh.buildOperationNodeForField=xq;function Cq({schema:e,fieldName:t,kind:n,models:r,ignore:i,depthLimit:o,circularReferenceDepth:s,argNames:a,selectedFields:c,rootTypeNames:u}){let l=(0,Jw.getDefinedRootType)(e,n),p=l.getFields()[t],h=`${t}_${n}`;if(p.args)for(let y of p.args){let N=y.name;(!a||a.includes(N))&&zw(Xw(y,N))}return{kind:We.Kind.OPERATION_DEFINITION,operation:n,name:{kind:We.Kind.NAME,value:h},variableDefinitions:[],selectionSet:{kind:We.Kind.SELECTION_SET,selections:[Hw({type:l,field:p,models:r,firstCall:!0,path:[],ancestors:[],ignore:i,depthLimit:o,circularReferenceDepth:s,schema:e,depth:0,argNames:a,selectedFields:c,rootTypeNames:u})]}}}function Lg({parent:e,type:t,models:n,firstCall:r,path:i,ancestors:o,ignore:s,depthLimit:a,circularReferenceDepth:c,schema:u,depth:l,argNames:p,selectedFields:h,rootTypeNames:y}){if(!(typeof h=="boolean"&&l>a)){if((0,We.isUnionType)(t)){let N=t.getTypes();return{kind:We.Kind.SELECTION_SET,selections:N.filter(O=>!Rg([...o,O],{depth:c})).map(O=>({kind:We.Kind.INLINE_FRAGMENT,typeCondition:{kind:We.Kind.NAMED_TYPE,name:{kind:We.Kind.NAME,value:O.name}},selectionSet:Lg({parent:t,type:O,models:n,path:i,ancestors:o,ignore:s,depthLimit:a,circularReferenceDepth:c,schema:u,depth:l,argNames:p,selectedFields:h,rootTypeNames:y})})).filter(O=>{var w,M;return((M=(w=O==null?void 0:O.selectionSet)==null?void 0:w.selections)==null?void 0:M.length)>0})}}if((0,We.isInterfaceType)(t)){let N=Object.values(u.getTypeMap()).filter(O=>(0,We.isObjectType)(O)&&O.getInterfaces().includes(t));return{kind:We.Kind.SELECTION_SET,selections:N.filter(O=>!Rg([...o,O],{depth:c})).map(O=>({kind:We.Kind.INLINE_FRAGMENT,typeCondition:{kind:We.Kind.NAMED_TYPE,name:{kind:We.Kind.NAME,value:O.name}},selectionSet:Lg({parent:t,type:O,models:n,path:i,ancestors:o,ignore:s,depthLimit:a,circularReferenceDepth:c,schema:u,depth:l,argNames:p,selectedFields:h,rootTypeNames:y})})).filter(O=>{var w,M;return((M=(w=O==null?void 0:O.selectionSet)==null?void 0:w.selections)==null?void 0:M.length)>0})}}if((0,We.isObjectType)(t)&&!y.has(t.name)){let N=s.includes(t.name)||s.includes(`${e.name}.${i[i.length-1]}`),O=n.includes(t.name);if(!r&&O&&!N)return{kind:We.Kind.SELECTION_SET,selections:[{kind:We.Kind.FIELD,name:{kind:We.Kind.NAME,value:"id"}}]};let w=t.getFields();return{kind:We.Kind.SELECTION_SET,selections:Object.keys(w).filter(M=>!Rg([...o,(0,We.getNamedType)(w[M].type)],{depth:c})).map(M=>{let W=typeof h=="object"?h[M]:!0;return W?Hw({type:t,field:w[M],models:n,path:[...i,M],ancestors:o,ignore:s,depthLimit:a,circularReferenceDepth:c,schema:u,depth:l,argNames:p,selectedFields:W,rootTypeNames:y}):null}).filter(M=>{var W,K;return M==null?!1:"selectionSet"in M?!!((K=(W=M.selectionSet)==null?void 0:W.selections)!=null&&K.length):!0})}}}}function Xw(e,t){function n(r){return(0,We.isListType)(r)?{kind:We.Kind.LIST_TYPE,type:n(r.ofType)}:(0,We.isNonNullType)(r)?{kind:We.Kind.NON_NULL_TYPE,type:n(r.ofType)}:{kind:We.Kind.NAMED_TYPE,name:{kind:We.Kind.NAME,value:r.name}}}return{kind:We.Kind.VARIABLE_DEFINITION,variable:{kind:We.Kind.VARIABLE,name:{kind:We.Kind.NAME,value:t||e.name}},type:n(e.type)}}function Yw(e,t){return[...t,e].join("_")}function Hw({type:e,field:t,models:n,firstCall:r,path:i,ancestors:o,ignore:s,depthLimit:a,circularReferenceDepth:c,schema:u,depth:l,argNames:p,selectedFields:h,rootTypeNames:y}){let N=(0,We.getNamedType)(t.type),O=[],w=!1;if(t.args&&t.args.length&&(O=t.args.map(te=>{let pe=Yw(te.name,i);return p&&!p.includes(pe)?((0,We.isNonNullType)(te.type)&&(w=!0),null):(r||zw(Xw(te,pe)),{kind:We.Kind.ARGUMENT,name:{kind:We.Kind.NAME,value:te.name},value:{kind:We.Kind.VARIABLE,name:{kind:We.Kind.NAME,value:Yw(te.name,i)}}})}).filter(Boolean)),w)return null;let M=[...i,t.name],W=M.join("."),K=t.name;return nh.has(W)&&nh.get(W)!==t.type.toString()&&(K+=t.type.toString().replace("!","NonNull").replace("[","List").replace("]","")),nh.set(W,t.type.toString()),!(0,We.isScalarType)(N)&&!(0,We.isEnumType)(N)?x(D({kind:We.Kind.FIELD,name:{kind:We.Kind.NAME,value:t.name}},K!==t.name&&{alias:{kind:We.Kind.NAME,value:K}}),{selectionSet:Lg({parent:e,type:N,models:n,firstCall:r,path:M,ancestors:[...o,e],ignore:s,depthLimit:a,circularReferenceDepth:c,schema:u,depth:l+1,argNames:p,selectedFields:h,rootTypeNames:y})||void 0,arguments:O}):x(D({kind:We.Kind.FIELD,name:{kind:We.Kind.NAME,value:t.name}},K!==t.name&&{alias:{kind:We.Kind.NAME,value:K}}),{arguments:O})}function Rg(e,t={depth:1}){let n=e[e.length-1];return(0,We.isScalarType)(n)?!1:e.filter(i=>i.name===n.name).length>t.depth}});var eR=F(ih=>{"use strict";d();m();f();Object.defineProperty(ih,"__esModule",{value:!0});ih.DirectiveLocation=void 0;var Zw;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(Zw||(ih.DirectiveLocation=Zw={}))});var tu=F(oh=>{"use strict";d();m();f();Object.defineProperty(oh,"__esModule",{value:!0});oh.MapperKind=void 0;var tR;(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"})(tR||(oh.MapperKind=tR={}))});var kg=F(sh=>{"use strict";d();m();f();Object.defineProperty(sh,"__esModule",{value:!0});sh.getObjectTypeFromTypeMap=void 0;var Mq=(he(),Te(Ie));function Uq(e,t){if(t){let n=e[t.name];if((0,Mq.isObjectType)(n))return n}}sh.getObjectTypeFromTypeMap=Uq});var Cg=F(uo=>{"use strict";d();m();f();Object.defineProperty(uo,"__esModule",{value:!0});uo.getBuiltInForStub=uo.isNamedStub=uo.createStub=uo.createNamedStub=void 0;var qn=(he(),Te(Ie));function Pg(e,t){let n;return t==="object"?n=qn.GraphQLObjectType:t==="interface"?n=qn.GraphQLInterfaceType:n=qn.GraphQLInputObjectType,new n({name:e,fields:{_fake:{type:qn.GraphQLString}}})}uo.createNamedStub=Pg;function xg(e,t){switch(e.kind){case qn.Kind.LIST_TYPE:return new qn.GraphQLList(xg(e.type,t));case qn.Kind.NON_NULL_TYPE:return new qn.GraphQLNonNull(xg(e.type,t));default:return t==="output"?Pg(e.name.value,"object"):Pg(e.name.value,"input")}}uo.createStub=xg;function jq(e){if("getFields"in e){let t=e.getFields();for(let n in t)return t[n].name==="_fake"}return!1}uo.isNamedStub=jq;function Vq(e){switch(e.name){case qn.GraphQLInt.name:return qn.GraphQLInt;case qn.GraphQLFloat.name:return qn.GraphQLFloat;case qn.GraphQLString.name:return qn.GraphQLString;case qn.GraphQLBoolean.name:return qn.GraphQLBoolean;case qn.GraphQLID.name:return qn.GraphQLID;default:return e}}uo.getBuiltInForStub=Vq});var uh=F(ah=>{"use strict";d();m();f();Object.defineProperty(ah,"__esModule",{value:!0});ah.rewireTypes=void 0;var Sn=(he(),Te(Ie)),nR=Cg();function $q(e,t){let n=Object.create(null);for(let h in e)n[h]=e[h];let r=Object.create(null);for(let h in n){let y=n[h];if(y==null||h.startsWith("__"))continue;let N=y.name;if(!N.startsWith("__")){if(r[N]!=null){console.warn(`Duplicate schema type name ${N} found; keeping the existing one found in the schema`);continue}r[N]=y}}for(let h in r)r[h]=a(r[h]);let i=t.map(h=>o(h));return{typeMap:r,directives:i};function o(h){if((0,Sn.isSpecifiedDirective)(h))return h;let y=h.toConfig();return y.args=s(y.args),new Sn.GraphQLDirective(y)}function s(h){let y={};for(let N in h){let O=h[N],w=p(O.type);w!=null&&(O.type=w,y[N]=O)}return y}function a(h){if((0,Sn.isObjectType)(h)){let y=h.toConfig(),N=x(D({},y),{fields:()=>c(y.fields),interfaces:()=>l(y.interfaces)});return new Sn.GraphQLObjectType(N)}else if((0,Sn.isInterfaceType)(h)){let y=h.toConfig(),N=x(D({},y),{fields:()=>c(y.fields)});return"interfaces"in N&&(N.interfaces=()=>l(y.interfaces)),new Sn.GraphQLInterfaceType(N)}else if((0,Sn.isUnionType)(h)){let y=h.toConfig(),N=x(D({},y),{types:()=>l(y.types)});return new Sn.GraphQLUnionType(N)}else if((0,Sn.isInputObjectType)(h)){let y=h.toConfig(),N=x(D({},y),{fields:()=>u(y.fields)});return new Sn.GraphQLInputObjectType(N)}else if((0,Sn.isEnumType)(h)){let y=h.toConfig();return new Sn.GraphQLEnumType(y)}else if((0,Sn.isScalarType)(h)){if((0,Sn.isSpecifiedScalarType)(h))return h;let y=h.toConfig();return new Sn.GraphQLScalarType(y)}throw new Error(`Unexpected schema type: ${h}`)}function c(h){let y={};for(let N in h){let O=h[N],w=p(O.type);w!=null&&O.args&&(O.type=w,O.args=s(O.args),y[N]=O)}return y}function u(h){let y={};for(let N in h){let O=h[N],w=p(O.type);w!=null&&(O.type=w,y[N]=O)}return y}function l(h){let y=[];for(let N of h){let O=p(N);O!=null&&y.push(O)}return y}function p(h){if((0,Sn.isListType)(h)){let y=p(h.ofType);return y!=null?new Sn.GraphQLList(y):null}else if((0,Sn.isNonNullType)(h)){let y=p(h.ofType);return y!=null?new Sn.GraphQLNonNull(y):null}else if((0,Sn.isNamedType)(h)){let y=n[h.name];return y===void 0&&(y=(0,nR.isNamedStub)(h)?(0,nR.getBuiltInForStub)(h):a(h),r[y.name]=n[h.name]=y),y!=null?r[y.name]:null}return null}}ah.rewireTypes=$q});var Mg=F(co=>{"use strict";d();m();f();Object.defineProperty(co,"__esModule",{value:!0});co.parseInputValueLiteral=co.parseInputValue=co.serializeInputValue=co.transformInputValue=void 0;var ch=(he(),Te(Ie)),Gq=zp();function gc(e,t,n=null,r=null){if(t==null)return t;let i=(0,ch.getNullableType)(e);if((0,ch.isLeafType)(i))return n!=null?n(i,t):t;if((0,ch.isListType)(i))return(0,Gq.asArray)(t).map(o=>gc(i.ofType,o,n,r));if((0,ch.isInputObjectType)(i)){let o=i.getFields(),s={};for(let a in t){let c=o[a];c!=null&&(s[a]=gc(c.type,t[a],n,r))}return r!=null?r(i,s):s}}co.transformInputValue=gc;function qq(e,t){return gc(e,t,(n,r)=>{try{return n.serialize(r)}catch(i){return r}})}co.serializeInputValue=qq;function Bq(e,t){return gc(e,t,(n,r)=>{try{return n.parseValue(r)}catch(i){return r}})}co.parseInputValue=Bq;function Kq(e,t){return gc(e,t,(n,r)=>n.parseLiteral(r,{}))}co.parseInputValueLiteral=Kq});var bc=F(Ic=>{"use strict";d();m();f();Object.defineProperty(Ic,"__esModule",{value:!0});Ic.correctASTNodes=Ic.mapSchema=void 0;var Qe=(he(),Te(Ie)),vc=kg(),lt=tu(),Qq=uh(),rR=Mg();function Yq(e,t={}){let n=sR(oR(Ug(iR(Jq(Ug(iR(e.getTypeMap(),e,rR.serializeInputValue),e,t,a=>(0,Qe.isLeafType)(a)),e,t),e,rR.parseInputValue),e,t,a=>!(0,Qe.isLeafType)(a)),e,t),e,t),r=e.getDirectives(),i=zq(r,e,t),{typeMap:o,directives:s}=(0,Qq.rewireTypes)(n,i);return new Qe.GraphQLSchema(x(D({},e.toConfig()),{query:(0,vc.getObjectTypeFromTypeMap)(o,(0,vc.getObjectTypeFromTypeMap)(n,e.getQueryType())),mutation:(0,vc.getObjectTypeFromTypeMap)(o,(0,vc.getObjectTypeFromTypeMap)(n,e.getMutationType())),subscription:(0,vc.getObjectTypeFromTypeMap)(o,(0,vc.getObjectTypeFromTypeMap)(n,e.getSubscriptionType())),types:Object.values(o),directives:s}))}Ic.mapSchema=Yq;function Ug(e,t,n,r=()=>!0){let i={};for(let o in e)if(!o.startsWith("__")){let s=e[o];if(s==null||!r(s)){i[o]=s;continue}let a=Hq(t,n,o);if(a==null){i[o]=s;continue}let c=a(s,t);if(c===void 0){i[o]=s;continue}i[o]=c}return i}function Jq(e,t,n){let r=nB(n);return r?Ug(e,t,{[lt.MapperKind.ENUM_TYPE]:i=>{let o=i.toConfig(),s=o.values,a={};for(let c in s){let u=s[c],l=r(u,i.name,t,c);if(l===void 0)a[c]=u;else if(Array.isArray(l)){let[p,h]=l;a[p]=h===void 0?u:h}else l!==null&&(a[c]=l)}return rd(new Qe.GraphQLEnumType(x(D({},o),{values:a})))}},i=>(0,Qe.isEnumType)(i)):e}function iR(e,t,n){let r=sR(e,t,{[lt.MapperKind.ARGUMENT]:i=>{if(i.defaultValue===void 0)return i;let o=lh(e,i.type);if(o!=null)return x(D({},i),{defaultValue:n(o,i.defaultValue)})}});return oR(r,t,{[lt.MapperKind.INPUT_OBJECT_FIELD]:i=>{if(i.defaultValue===void 0)return i;let o=lh(r,i.type);if(o!=null)return x(D({},i),{defaultValue:n(o,i.defaultValue)})}})}function lh(e,t){if((0,Qe.isListType)(t)){let n=lh(e,t.ofType);return n!=null?new Qe.GraphQLList(n):null}else if((0,Qe.isNonNullType)(t)){let n=lh(e,t.ofType);return n!=null?new Qe.GraphQLNonNull(n):null}else if((0,Qe.isNamedType)(t)){let n=e[t.name];return n!=null?n:null}return null}function oR(e,t,n){let r={};for(let i in e)if(!i.startsWith("__")){let o=e[i];if(!(0,Qe.isObjectType)(o)&&!(0,Qe.isInterfaceType)(o)&&!(0,Qe.isInputObjectType)(o)){r[i]=o;continue}let s=Zq(t,n,i);if(s==null){r[i]=o;continue}let a=o.toConfig(),c=a.fields,u={};for(let l in c){let p=c[l],h=s(p,l,i,t);if(h===void 0)u[l]=p;else if(Array.isArray(h)){let[y,N]=h;N.astNode!=null&&(N.astNode=x(D({},N.astNode),{name:x(D({},N.astNode.name),{value:y})})),u[y]=N===void 0?p:N}else h!==null&&(u[l]=h)}(0,Qe.isObjectType)(o)?r[i]=rd(new Qe.GraphQLObjectType(x(D({},a),{fields:u}))):(0,Qe.isInterfaceType)(o)?r[i]=rd(new Qe.GraphQLInterfaceType(x(D({},a),{fields:u}))):r[i]=rd(new Qe.GraphQLInputObjectType(x(D({},a),{fields:u})))}return r}function sR(e,t,n){let r={};for(let i in e)if(!i.startsWith("__")){let o=e[i];if(!(0,Qe.isObjectType)(o)&&!(0,Qe.isInterfaceType)(o)){r[i]=o;continue}let s=eB(n);if(s==null){r[i]=o;continue}let a=o.toConfig(),c=a.fields,u={};for(let l in c){let p=c[l],h=p.args;if(h==null){u[l]=p;continue}let y=Object.keys(h);if(!y.length){u[l]=p;continue}let N={};for(let O of y){let w=h[O],M=s(w,l,i,t);if(M===void 0)N[O]=w;else if(Array.isArray(M)){let[W,K]=M;N[W]=K}else M!==null&&(N[O]=M)}u[l]=x(D({},p),{args:N})}(0,Qe.isObjectType)(o)?r[i]=new Qe.GraphQLObjectType(x(D({},a),{fields:u})):(0,Qe.isInterfaceType)(o)?r[i]=new Qe.GraphQLInterfaceType(x(D({},a),{fields:u})):r[i]=new Qe.GraphQLInputObjectType(x(D({},a),{fields:u}))}return r}function zq(e,t,n){let r=tB(n);if(r==null)return e.slice();let i=[];for(let o of e){let s=r(o,t);s===void 0?i.push(o):s!==null&&i.push(s)}return i}function Xq(e,t){var i,o,s;let n=e.getType(t),r=[lt.MapperKind.TYPE];return(0,Qe.isObjectType)(n)?(r.push(lt.MapperKind.COMPOSITE_TYPE,lt.MapperKind.OBJECT_TYPE),t===((i=e.getQueryType())==null?void 0:i.name)?r.push(lt.MapperKind.ROOT_OBJECT,lt.MapperKind.QUERY):t===((o=e.getMutationType())==null?void 0:o.name)?r.push(lt.MapperKind.ROOT_OBJECT,lt.MapperKind.MUTATION):t===((s=e.getSubscriptionType())==null?void 0:s.name)&&r.push(lt.MapperKind.ROOT_OBJECT,lt.MapperKind.SUBSCRIPTION)):(0,Qe.isInputObjectType)(n)?r.push(lt.MapperKind.INPUT_OBJECT_TYPE):(0,Qe.isInterfaceType)(n)?r.push(lt.MapperKind.COMPOSITE_TYPE,lt.MapperKind.ABSTRACT_TYPE,lt.MapperKind.INTERFACE_TYPE):(0,Qe.isUnionType)(n)?r.push(lt.MapperKind.COMPOSITE_TYPE,lt.MapperKind.ABSTRACT_TYPE,lt.MapperKind.UNION_TYPE):(0,Qe.isEnumType)(n)?r.push(lt.MapperKind.ENUM_TYPE):(0,Qe.isScalarType)(n)&&r.push(lt.MapperKind.SCALAR_TYPE),r}function Hq(e,t,n){let r=Xq(e,n),i,o=[...r];for(;!i&&o.length>0;){let s=o.pop();i=t[s]}return i!=null?i:null}function Wq(e,t){var i,o,s;let n=e.getType(t),r=[lt.MapperKind.FIELD];return(0,Qe.isObjectType)(n)?(r.push(lt.MapperKind.COMPOSITE_FIELD,lt.MapperKind.OBJECT_FIELD),t===((i=e.getQueryType())==null?void 0:i.name)?r.push(lt.MapperKind.ROOT_FIELD,lt.MapperKind.QUERY_ROOT_FIELD):t===((o=e.getMutationType())==null?void 0:o.name)?r.push(lt.MapperKind.ROOT_FIELD,lt.MapperKind.MUTATION_ROOT_FIELD):t===((s=e.getSubscriptionType())==null?void 0:s.name)&&r.push(lt.MapperKind.ROOT_FIELD,lt.MapperKind.SUBSCRIPTION_ROOT_FIELD)):(0,Qe.isInterfaceType)(n)?r.push(lt.MapperKind.COMPOSITE_FIELD,lt.MapperKind.INTERFACE_FIELD):(0,Qe.isInputObjectType)(n)&&r.push(lt.MapperKind.INPUT_OBJECT_FIELD),r}function Zq(e,t,n){let r=Wq(e,n),i,o=[...r];for(;!i&&o.length>0;){let s=o.pop();i=t[s]}return i!=null?i:null}function eB(e){let t=e[lt.MapperKind.ARGUMENT];return t!=null?t:null}function tB(e){let t=e[lt.MapperKind.DIRECTIVE];return t!=null?t:null}function nB(e){let t=e[lt.MapperKind.ENUM_VALUE];return t!=null?t:null}function rd(e){if((0,Qe.isObjectType)(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.fields){let i=t.fields[r];i.astNode!=null&&n.push(i.astNode)}t.astNode=x(D({},t.astNode),{kind:Qe.Kind.OBJECT_TYPE_DEFINITION,fields:n})}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(n=>x(D({},n),{kind:Qe.Kind.OBJECT_TYPE_EXTENSION,fields:void 0}))),new Qe.GraphQLObjectType(t)}else if((0,Qe.isInterfaceType)(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.fields){let i=t.fields[r];i.astNode!=null&&n.push(i.astNode)}t.astNode=x(D({},t.astNode),{kind:Qe.Kind.INTERFACE_TYPE_DEFINITION,fields:n})}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(n=>x(D({},n),{kind:Qe.Kind.INTERFACE_TYPE_EXTENSION,fields:void 0}))),new Qe.GraphQLInterfaceType(t)}else if((0,Qe.isInputObjectType)(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.fields){let i=t.fields[r];i.astNode!=null&&n.push(i.astNode)}t.astNode=x(D({},t.astNode),{kind:Qe.Kind.INPUT_OBJECT_TYPE_DEFINITION,fields:n})}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(n=>x(D({},n),{kind:Qe.Kind.INPUT_OBJECT_TYPE_EXTENSION,fields:void 0}))),new Qe.GraphQLInputObjectType(t)}else if((0,Qe.isEnumType)(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.values){let i=t.values[r];i.astNode!=null&&n.push(i.astNode)}t.astNode=x(D({},t.astNode),{values:n})}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(n=>x(D({},n),{values:void 0}))),new Qe.GraphQLEnumType(t)}else return e}Ic.correctASTNodes=rd});var aR=F(dh=>{"use strict";d();m();f();Object.defineProperty(dh,"__esModule",{value:!0});dh.filterSchema=void 0;var ph=(he(),Te(Ie)),Ho=tu(),rB=bc();function iB({schema:e,typeFilter:t=()=>!0,fieldFilter:n=void 0,rootFieldFilter:r=void 0,objectFieldFilter:i=void 0,interfaceFieldFilter:o=void 0,inputObjectFieldFilter:s=void 0,argumentFilter:a=void 0}){return(0,rB.mapSchema)(e,{[Ho.MapperKind.QUERY]:u=>jg(u,"Query",r,a),[Ho.MapperKind.MUTATION]:u=>jg(u,"Mutation",r,a),[Ho.MapperKind.SUBSCRIPTION]:u=>jg(u,"Subscription",r,a),[Ho.MapperKind.OBJECT_TYPE]:u=>t(u.name,u)?Vg(ph.GraphQLObjectType,u,i||n,a):null,[Ho.MapperKind.INTERFACE_TYPE]:u=>t(u.name,u)?Vg(ph.GraphQLInterfaceType,u,o||n,a):null,[Ho.MapperKind.INPUT_OBJECT_TYPE]:u=>t(u.name,u)?Vg(ph.GraphQLInputObjectType,u,s||n):null,[Ho.MapperKind.UNION_TYPE]:u=>t(u.name,u)?void 0:null,[Ho.MapperKind.ENUM_TYPE]:u=>t(u.name,u)?void 0:null,[Ho.MapperKind.SCALAR_TYPE]:u=>t(u.name,u)?void 0:null})}dh.filterSchema=iB;function jg(e,t,n,r){if(n||r){let i=e.toConfig();for(let o in i.fields){let s=i.fields[o];if(n&&!n(t,o,i.fields[o]))delete i.fields[o];else if(r&&s.args)for(let a in s.args)r(t,o,a,s.args[a])||delete s.args[a]}return new ph.GraphQLObjectType(i)}return e}function Vg(e,t,n,r){if(n||r){let i=t.toConfig();for(let o in i.fields){let s=i.fields[o];if(n&&!n(t.name,o,i.fields[o]))delete i.fields[o];else if(r&&"args"in s)for(let a in s.args)r(t.name,o,a,s.args[a])||delete s.args[a]}return new e(i)}}});var cR=F(_c=>{"use strict";d();m();f();Object.defineProperty(_c,"__esModule",{value:!0});_c.healTypes=_c.healSchema=void 0;var lo=(he(),Te(Ie));function oB(e){return uR(e.getTypeMap(),e.getDirectives()),e}_c.healSchema=oB;function uR(e,t){let n=Object.create(null);for(let u in e){let l=e[u];if(l==null||u.startsWith("__"))continue;let p=l.name;if(!p.startsWith("__")){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 u in n){let l=n[u];e[u]=l}for(let u of t)u.args=u.args.filter(l=>(l.type=c(l.type),l.type!==null));for(let u in e){let l=e[u];!u.startsWith("__")&&u in n&&l!=null&&r(l)}for(let u in e)!u.startsWith("__")&&!(u in n)&&delete e[u];function r(u){if((0,lo.isObjectType)(u)){i(u),o(u);return}else if((0,lo.isInterfaceType)(u)){i(u),"getInterfaces"in u&&o(u);return}else if((0,lo.isUnionType)(u)){a(u);return}else if((0,lo.isInputObjectType)(u)){s(u);return}else if((0,lo.isLeafType)(u))return;throw new Error(`Unexpected schema type: ${u}`)}function i(u){let l=u.getFields();for(let[p,h]of Object.entries(l))h.args.map(y=>(y.type=c(y.type),y.type===null?null:y)).filter(Boolean),h.type=c(h.type),h.type===null&&delete l[p]}function o(u){if("getInterfaces"in u){let l=u.getInterfaces();l.push(...l.splice(0).map(p=>c(p)).filter(Boolean))}}function s(u){let l=u.getFields();for(let[p,h]of Object.entries(l))h.type=c(h.type),h.type===null&&delete l[p]}function a(u){let l=u.getTypes();l.push(...l.splice(0).map(p=>c(p)).filter(Boolean))}function c(u){if((0,lo.isListType)(u)){let l=c(u.ofType);return l!=null?new lo.GraphQLList(l):null}else if((0,lo.isNonNullType)(u)){let l=c(u.ofType);return l!=null?new lo.GraphQLNonNull(l):null}else if((0,lo.isNamedType)(u)){let l=e[u.name];if(l&&u!==l)return l}return u}}_c.healTypes=uR});var lR=F(fh=>{"use strict";d();m();f();Object.defineProperty(fh,"__esModule",{value:!0});fh.getResolversFromSchema=void 0;var nu=(he(),Te(Ie));function sB(e,t){var i,o;let n=Object.create(null),r=e.getTypeMap();for(let s in r)if(!s.startsWith("__")){let a=r[s];if((0,nu.isScalarType)(a)){if(!(0,nu.isSpecifiedScalarType)(a)){let c=a.toConfig();delete c.astNode,n[s]=new nu.GraphQLScalarType(c)}}else if((0,nu.isEnumType)(a)){n[s]={};let c=a.getValues();for(let u of c)n[s][u.name]=u.value}else if((0,nu.isInterfaceType)(a))a.resolveType!=null&&(n[s]={__resolveType:a.resolveType});else if((0,nu.isUnionType)(a))a.resolveType!=null&&(n[s]={__resolveType:a.resolveType});else if((0,nu.isObjectType)(a)){n[s]={},a.isTypeOf!=null&&(n[s].__isTypeOf=a.isTypeOf);let c=a.getFields();for(let u in c){let l=c[u];if(l.subscribe!=null&&(n[s][u]=n[s][u]||{},n[s][u].subscribe=l.subscribe),l.resolve!=null&&((i=l.resolve)==null?void 0:i.name)!=="defaultFieldResolver"){switch((o=l.resolve)==null?void 0:o.name){case"defaultMergedResolver":if(!t)continue;break;case"defaultFieldResolver":continue}n[s][u]=n[s][u]||{},n[s][u].resolve=l.resolve}}}}return n}fh.getResolversFromSchema=sB});var dR=F(mh=>{"use strict";d();m();f();Object.defineProperty(mh,"__esModule",{value:!0});mh.forEachField=void 0;var pR=(he(),Te(Ie));function aB(e,t){let n=e.getTypeMap();for(let r in n){let i=n[r];if(!(0,pR.getNamedType)(i).name.startsWith("__")&&(0,pR.isObjectType)(i)){let o=i.getFields();for(let s in o){let a=o[s];t(a,r,s)}}}}mh.forEachField=aB});var fR=F(hh=>{"use strict";d();m();f();Object.defineProperty(hh,"__esModule",{value:!0});hh.forEachDefaultValue=void 0;var $g=(he(),Te(Ie));function uB(e,t){let n=e.getTypeMap();for(let r in n){let i=n[r];if(!(0,$g.getNamedType)(i).name.startsWith("__")){if((0,$g.isObjectType)(i)){let o=i.getFields();for(let s in o){let a=o[s];for(let c of a.args)c.defaultValue=t(c.type,c.defaultValue)}}else if((0,$g.isInputObjectType)(i)){let o=i.getFields();for(let s in o){let a=o[s];a.defaultValue=t(a.type,a.defaultValue)}}}}}hh.forEachDefaultValue=uB});var Bg=F(yh=>{"use strict";d();m();f();Object.defineProperty(yh,"__esModule",{value:!0});yh.addTypes=void 0;var Gg=(he(),Te(Ie)),qg=kg(),cB=uh();function lB(e,t){let n=e.toConfig(),r={};for(let a of n.types)r[a.name]=a;let i={};for(let a of n.directives)i[a.name]=a;for(let a of t)(0,Gg.isNamedType)(a)?r[a.name]=a:(0,Gg.isDirective)(a)&&(i[a.name]=a);let{typeMap:o,directives:s}=(0,cB.rewireTypes)(r,Object.values(i));return new Gg.GraphQLSchema(x(D({},n),{query:(0,qg.getObjectTypeFromTypeMap)(o,e.getQueryType()),mutation:(0,qg.getObjectTypeFromTypeMap)(o,e.getMutationType()),subscription:(0,qg.getObjectTypeFromTypeMap)(o,e.getSubscriptionType()),types:Object.values(o),directives:s}))}yh.addTypes=lB});var hR=F(Eh=>{"use strict";d();m();f();Object.defineProperty(Eh,"__esModule",{value:!0});Eh.pruneSchema=void 0;var Fn=(he(),Te(Ie)),pB=bc(),dB=tu(),fB=Hp(),mB=Eg();function hB(e,t={}){let{skipEmptyCompositeTypePruning:n,skipEmptyUnionPruning:r,skipPruning:i,skipUnimplementedInterfacesPruning:o,skipUnusedTypesPruning:s}=t,a=[],c=e;do{let u=yB(c);if(i){let l=[];for(let p in c.getTypeMap()){if(p.startsWith("__"))continue;let h=c.getType(p);h&&i(h)&&l.push(p)}u=mR(l,c,u)}a=[],c=(0,pB.mapSchema)(c,{[dB.MapperKind.TYPE]:l=>!u.has(l.name)&&!(0,Fn.isSpecifiedScalarType)(l)?((0,Fn.isUnionType)(l)||(0,Fn.isInputObjectType)(l)||(0,Fn.isInterfaceType)(l)||(0,Fn.isObjectType)(l)||(0,Fn.isScalarType)(l))&&(s||(0,Fn.isUnionType)(l)&&r&&!Object.keys(l.getTypes()).length||((0,Fn.isInputObjectType)(l)||(0,Fn.isInterfaceType)(l)||(0,Fn.isObjectType)(l))&&n&&!Object.keys(l.getFields()).length||(0,Fn.isInterfaceType)(l)&&o)?l:(a.push(l.name),u.delete(l.name),null):l})}while(a.length);return c}Eh.pruneSchema=hB;function yB(e){let t=[];for(let n of(0,fB.getRootTypes)(e))t.push(n.name);return mR(t,e)}function mR(e,t,n=new Set){let r=new Map;for(;e.length;){let i=e.pop();if(n.has(i)&&r[i]!==!0)continue;let o=t.getType(i);if(o){if((0,Fn.isUnionType)(o)&&e.push(...o.getTypes().map(s=>s.name)),(0,Fn.isInterfaceType)(o)&&r[i]===!0&&(e.push(...(0,mB.getImplementingTypes)(o.name,t)),r[i]=!1),(0,Fn.isEnumType)(o)&&e.push(...o.getValues().flatMap(s=>s.astNode?Th(t,s.astNode):[])),"getInterfaces"in o&&e.push(...o.getInterfaces().map(s=>s.name)),"getFields"in o){let s=o.getFields(),a=Object.entries(s);if(!a.length)continue;for(let[,c]of a){(0,Fn.isObjectType)(o)&&e.push(...c.args.flatMap(l=>{let p=[(0,Fn.getNamedType)(l.type).name];return l.astNode&&p.push(...Th(t,l.astNode)),p}));let u=(0,Fn.getNamedType)(c.type);e.push(u.name),c.astNode&&e.push(...Th(t,c.astNode)),(0,Fn.isInterfaceType)(u)&&!(u.name in r)&&(r[u.name]=!0)}}o.astNode&&e.push(...Th(t,o.astNode)),n.add(i)}}return n}function Th(e,t){var n;return((n=t.directives)!=null?n:[]).flatMap(r=>{var i,o;return(o=(i=e.getDirective(r.name.value))==null?void 0:i.args.map(s=>(0,Fn.getNamedType)(s.type).name))!=null?o:[]})}});var TR=F(Nh=>{"use strict";d();m();f();Object.defineProperty(Nh,"__esModule",{value:!0});Nh.mergeDeep=void 0;var TB=zp();function yR(e,t=!1){let n=e[0]||{},r={};t&&Object.setPrototypeOf(r,Object.create(Object.getPrototypeOf(n)));for(let i of e)if(Kg(n)&&Kg(i)){if(t){let o=Object.getPrototypeOf(r),s=Object.getPrototypeOf(i);if(s)for(let a of Object.getOwnPropertyNames(s)){let c=Object.getOwnPropertyDescriptor(s,a);(0,TB.isSome)(c)&&Object.defineProperty(o,a,c)}}for(let o in i)Kg(i[o])?o in r?r[o]=yR([r[o],i[o]],t):Object.assign(r,{[o]:i[o]}):Object.assign(r,{[o]:i[o]})}return r}Nh.mergeDeep=yR;function Kg(e){return e&&typeof e=="object"&&!Array.isArray(e)}});var ER=F(gh=>{"use strict";d();m();f();Object.defineProperty(gh,"__esModule",{value:!0});gh.parseSelectionSet=void 0;var EB=(he(),Te(Ie));function NB(e,t){return(0,EB.parse)(e,t).definitions[0].selectionSet}gh.parseSelectionSet=NB});var NR=F(vh=>{"use strict";d();m();f();Object.defineProperty(vh,"__esModule",{value:!0});vh.getResponseKeyFromInfo=void 0;function gB(e){return e.fieldNodes[0].alias!=null?e.fieldNodes[0].alias.value:e.fieldName}vh.getResponseKeyFromInfo=gB});var gR=F(po=>{"use strict";d();m();f();Object.defineProperty(po,"__esModule",{value:!0});po.modifyObjectFields=po.selectObjectFields=po.removeObjectFields=po.appendObjectFields=void 0;var Ih=(he(),Te(Ie)),bh=tu(),ru=bc(),vB=Bg();function IB(e,t,n){return e.getType(t)==null?(0,vB.addTypes)(e,[new Ih.GraphQLObjectType({name:t,fields:n})]):(0,ru.mapSchema)(e,{[bh.MapperKind.OBJECT_TYPE]:r=>{if(r.name===t){let i=r.toConfig(),o=i.fields,s={};for(let a in o)s[a]=o[a];for(let a in n)s[a]=n[a];return(0,ru.correctASTNodes)(new Ih.GraphQLObjectType(x(D({},i),{fields:s})))}}})}po.appendObjectFields=IB;function bB(e,t,n){let r={};return[(0,ru.mapSchema)(e,{[bh.MapperKind.OBJECT_TYPE]:o=>{if(o.name===t){let s=o.toConfig(),a=s.fields,c={};for(let u in a){let l=a[u];n(u,l)?r[u]=l:c[u]=l}return(0,ru.correctASTNodes)(new Ih.GraphQLObjectType(x(D({},s),{fields:c})))}}}),r]}po.removeObjectFields=bB;function _B(e,t,n){let r={};return(0,ru.mapSchema)(e,{[bh.MapperKind.OBJECT_TYPE]:i=>{if(i.name===t){let s=i.toConfig().fields;for(let a in s){let c=s[a];n(a,c)&&(r[a]=c)}}}}),r}po.selectObjectFields=_B;function OB(e,t,n,r){let i={};return[(0,ru.mapSchema)(e,{[bh.MapperKind.OBJECT_TYPE]:s=>{if(s.name===t){let a=s.toConfig(),c=a.fields,u={};for(let l in c){let p=c[l];n(l,p)?i[l]=p:u[l]=p}for(let l in r){let p=r[l];u[l]=p}return(0,ru.correctASTNodes)(new Ih.GraphQLObjectType(x(D({},a),{fields:u})))}}}),i]}po.modifyObjectFields=OB});var vR=F(_h=>{"use strict";d();m();f();Object.defineProperty(_h,"__esModule",{value:!0});_h.renameType=void 0;var li=(he(),Te(Ie));function SB(e,t){if((0,li.isObjectType)(e))return new li.GraphQLObjectType(x(D({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:x(D({},e.astNode),{name:x(D({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>x(D({},n),{name:x(D({},n.name),{value:t})}))}));if((0,li.isInterfaceType)(e))return new li.GraphQLInterfaceType(x(D({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:x(D({},e.astNode),{name:x(D({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>x(D({},n),{name:x(D({},n.name),{value:t})}))}));if((0,li.isUnionType)(e))return new li.GraphQLUnionType(x(D({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:x(D({},e.astNode),{name:x(D({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>x(D({},n),{name:x(D({},n.name),{value:t})}))}));if((0,li.isInputObjectType)(e))return new li.GraphQLInputObjectType(x(D({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:x(D({},e.astNode),{name:x(D({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>x(D({},n),{name:x(D({},n.name),{value:t})}))}));if((0,li.isEnumType)(e))return new li.GraphQLEnumType(x(D({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:x(D({},e.astNode),{name:x(D({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>x(D({},n),{name:x(D({},n.name),{value:t})}))}));if((0,li.isScalarType)(e))return new li.GraphQLScalarType(x(D({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:x(D({},e.astNode),{name:x(D({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>x(D({},n),{name:x(D({},n.name),{value:t})}))}));throw new Error(`Unknown type ${e}.`)}_h.renameType=SB});var _R=F(Oh=>{"use strict";d();m();f();Object.defineProperty(Oh,"__esModule",{value:!0});Oh.mapAsyncIterator=void 0;function DB(e,t,n){let r,i;typeof e.return=="function"&&(r=e.return,i=a=>{let c=()=>Promise.reject(a);return r.call(e).then(c,c)});function o(a){return a.done?a:IR(a.value,t).then(bR,i)}let s;if(n){let a=n;s=c=>IR(c,a).then(bR,i)}return{next(){return e.next().then(o,s)},return(){return r?r.call(e).then(o,s):Promise.resolve({value:void 0,done:!0})},throw(a){return typeof e.throw=="function"?e.throw(a).then(o,s):Promise.reject(a).catch(i)},[Symbol.asyncIterator](){return this}}}Oh.mapAsyncIterator=DB;function IR(e,t){return new Promise(n=>n(t(e)))}function bR(e){return{value:e,done:!1}}});var OR=F(Oc=>{"use strict";d();m();f();Object.defineProperty(Oc,"__esModule",{value:!0});Oc.createVariableNameGenerator=Oc.updateArgument=void 0;var iu=(he(),Te(Ie)),AB=gg();function wB(e,t,n,r,i,o,s){if(e[r]={kind:iu.Kind.ARGUMENT,name:{kind:iu.Kind.NAME,value:r},value:{kind:iu.Kind.VARIABLE,name:{kind:iu.Kind.NAME,value:i}}},t[i]={kind:iu.Kind.VARIABLE_DEFINITION,variable:{kind:iu.Kind.VARIABLE,name:{kind:iu.Kind.NAME,value:i}},type:(0,AB.astFromType)(o)},s!==void 0){n[i]=s;return}i in n&&delete n[i]}Oc.updateArgument=wB;function RB(e){let t=0;return n=>{let r;do r=`_v${(t++).toString()}_${n}`;while(r in e);return r}}Oc.createVariableNameGenerator=RB});var SR=F(Sh=>{"use strict";d();m();f();Object.defineProperty(Sh,"__esModule",{value:!0});Sh.implementsAbstractType=void 0;var Qg=(he(),Te(Ie));function LB(e,t,n){return n==null||t==null?!1:t===n?!0:(0,Qg.isCompositeType)(t)&&(0,Qg.isCompositeType)(n)?(0,Qg.doTypesOverlap)(e,t,n):!1}Sh.implementsAbstractType=LB});var DR=F(Dh=>{"use strict";d();m();f();Object.defineProperty(Dh,"__esModule",{value:!0});Dh.observableToAsyncIterable=void 0;function FB(e){let t=[],n=[],r=!0,i=l=>{t.length!==0?t.shift()({value:l,done:!1}):n.push({value:l,done:!1})},o=l=>{t.length!==0?t.shift()({value:{errors:[l]},done:!1}):n.push({value:{errors:[l]},done:!1})},s=()=>{t.length!==0?t.shift()({done:!0}):n.push({done:!0})},a=()=>new Promise(l=>{if(n.length!==0){let p=n.shift();l(p)}else t.push(l)}),c=e.subscribe({next(l){i(l)},error(l){o(l)},complete(){s()}}),u=()=>{if(r){r=!1,c.unsubscribe();for(let l of t)l({value:void 0,done:!0});t.length=0,n.length=0}};return{next(){return r?a():this.return()},return(){return u(),Promise.resolve({value:void 0,done:!0})},throw(l){return u(),Promise.reject(l)},[Symbol.asyncIterator](){return this}}}Dh.observableToAsyncIterable=FB});var Yg=F(Sc=>{"use strict";d();m();f();Object.defineProperty(Sc,"__esModule",{value:!0});Sc.getOperationASTFromRequest=Sc.getOperationASTFromDocument=void 0;var kB=(he(),Te(Ie)),PB=Tc();function AR(e,t){let n=(0,kB.getOperationAST)(e,t);if(!n)throw new Error(`Cannot infer operation ${t||""}`);return n}Sc.getOperationASTFromDocument=AR;Sc.getOperationASTFromRequest=(0,PB.memoize1)(function(t){return AR(t.document,t.operationName)})});var Jg=F(Dc=>{"use strict";d();m();f();Object.defineProperty(Dc,"__esModule",{value:!0});Dc.GraphQLStreamDirective=Dc.GraphQLDeferDirective=void 0;var pi=(he(),Te(Ie));Dc.GraphQLDeferDirective=new pi.GraphQLDirective({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[pi.DirectiveLocation.FRAGMENT_SPREAD,pi.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new pi.GraphQLNonNull(pi.GraphQLBoolean),description:"Deferred when true or undefined.",defaultValue:!0},label:{type:pi.GraphQLString,description:"Unique name"}}});Dc.GraphQLStreamDirective=new pi.GraphQLDirective({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[pi.DirectiveLocation.FIELD],args:{if:{type:new pi.GraphQLNonNull(pi.GraphQLBoolean),description:"Stream when true or undefined.",defaultValue:!0},label:{type:pi.GraphQLString,description:"Unique name"},initialCount:{defaultValue:0,type:pi.GraphQLInt,description:"Number of items to return immediately"}}})});var wR=F(Ah=>{"use strict";d();m();f();Object.defineProperty(Ah,"__esModule",{value:!0});Ah.AccumulatorMap=void 0;var zg=class extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(t,n){let r=this.get(t);r===void 0?this.set(t,[n]):r.push(n)}};Ah.AccumulatorMap=zg});var Wg=F(Rr=>{"use strict";d();m();f();Object.defineProperty(Rr,"__esModule",{value:!0});Rr.collectSubFields=Rr.getDeferValues=Rr.getFieldEntryKey=Rr.doesFragmentConditionMatch=Rr.shouldIncludeNode=Rr.collectFields=void 0;var xB=Tc(),fo=(he(),Te(Ie)),CB=Jg(),Rh=wR();function Ac(e,t,n,r,i,o,s,a){for(let c of i.selections)switch(c.kind){case fo.Kind.FIELD:{if(!wh(n,c))continue;o.add(RR(c),c);break}case fo.Kind.INLINE_FRAGMENT:{if(!wh(n,c)||!Xg(e,c,r))continue;let u=Hg(n,c);if(u){let l=new Rh.AccumulatorMap;Ac(e,t,n,r,c.selectionSet,l,s,a),s.push({label:u.label,fields:l})}else Ac(e,t,n,r,c.selectionSet,o,s,a);break}case fo.Kind.FRAGMENT_SPREAD:{let u=c.name.value;if(!wh(n,c))continue;let l=Hg(n,c);if(a.has(u)&&!l)continue;let p=t[u];if(!p||!Xg(e,p,r))continue;if(l||a.add(u),l){let h=new Rh.AccumulatorMap;Ac(e,t,n,r,p.selectionSet,h,s,a),s.push({label:l.label,fields:h})}else Ac(e,t,n,r,p.selectionSet,o,s,a);break}}}function MB(e,t,n,r,i){let o=new Rh.AccumulatorMap,s=[];return Ac(e,t,n,r,i,o,s,new Set),{fields:o,patches:s}}Rr.collectFields=MB;function wh(e,t){let n=(0,fo.getDirectiveValues)(fo.GraphQLSkipDirective,t,e);if((n==null?void 0:n.if)===!0)return!1;let r=(0,fo.getDirectiveValues)(fo.GraphQLIncludeDirective,t,e);return(r==null?void 0:r.if)!==!1}Rr.shouldIncludeNode=wh;function Xg(e,t,n){let r=t.typeCondition;if(!r)return!0;let i=(0,fo.typeFromAST)(e,r);return i===n?!0:(0,fo.isAbstractType)(i)?e.getPossibleTypes(i).includes(n):!1}Rr.doesFragmentConditionMatch=Xg;function RR(e){return e.alias?e.alias.value:e.name.value}Rr.getFieldEntryKey=RR;function Hg(e,t){let n=(0,fo.getDirectiveValues)(CB.GraphQLDeferDirective,t,e);if(n&&n.if!==!1)return{label:typeof n.label=="string"?n.label:void 0}}Rr.getDeferValues=Hg;Rr.collectSubFields=(0,xB.memoize5)(function(t,n,r,i,o){let s=new Rh.AccumulatorMap,a=new Set,c=[],u={fields:s,patches:c};for(let l of o)l.selectionSet&&Ac(t,n,r,i,l.selectionSet,s,c,a);return u})});var kR=F(ca=>{"use strict";d();m();f();Object.defineProperty(ca,"__esModule",{value:!0});ca.visitResult=ca.visitErrors=ca.visitData=void 0;var UB=Yg(),ua=(he(),Te(Ie)),Zg=Wg();function ev(e,t,n){if(Array.isArray(e))return e.map(r=>ev(r,t,n));if(typeof e=="object"){let r=t!=null?t(e):e;if(r!=null)for(let i in r){let o=r[i];Object.defineProperty(r,i,{value:ev(o,t,n)})}return n!=null?n(r):r}return e}ca.visitData=ev;function jB(e,t){return e.map(n=>t(n))}ca.visitErrors=jB;function VB(e,t,n,r,i){let o=t.document.definitions.reduce((h,y)=>(y.kind===ua.Kind.FRAGMENT_DEFINITION&&(h[y.name.value]=y),h),{}),s=t.variables||{},a={segmentInfoMap:new Map,unpathedErrors:new Set},c=e.data,u=e.errors,l=u!=null&&i!=null,p=(0,UB.getOperationASTFromRequest)(t);return c!=null&&p!=null&&(e.data=qB(c,p,n,o,s,r,l?u:void 0,a)),u!=null&&i&&(e.errors=$B(u,i,a)),e}ca.visitResult=VB;function $B(e,t,n){let r=n.segmentInfoMap,i=n.unpathedErrors,o=t.__unpathed;return e.map(s=>{let a=r.get(s),c=a==null?s:a.reduceRight((u,l)=>{let p=l.type.name,h=t[p];if(h==null)return u;let y=h[l.fieldName];return y==null?u:y(u,l.pathIndex)},s);return o&&i.has(s)?o(c):c})}function GB(e,t){switch(t.operation){case"query":return e.getQueryType();case"mutation":return e.getMutationType();case"subscription":return e.getSubscriptionType()}}function qB(e,t,n,r,i,o,s,a){let c=GB(n,t),{fields:u}=(0,Zg.collectFields)(n,r,i,c,t.selectionSet);return tv(e,c,u,n,r,i,o,0,s,a)}function tv(e,t,n,r,i,o,s,a,c,u){var W;let l=t.getFields(),p=s==null?void 0:s[t.name],h=p==null?void 0:p.__enter,y=h!=null?h(e):e,N,O=null;if(c!=null){N=KB(c,a),O=N.errorMap;for(let K of N.unpathedErrors)u.unpathedErrors.add(K)}for(let[K,te]of n){let pe=te[0].name.value,qe=(W=l[pe])==null?void 0:W.type;if(qe==null)switch(pe){case"__typename":qe=ua.TypeNameMetaFieldDef.type;break;case"__schema":qe=ua.SchemaMetaFieldDef.type;break;case"__type":qe=ua.TypeMetaFieldDef.type;break}let st=a+1,ft;O&&(ft=O[K],ft!=null&&delete O[K],QB(t,pe,st,ft,u));let L=FR(e[K],qe,te,r,i,o,s,st,ft,u);LR(y,K,L,p,pe)}let w=y.__typename;if(w!=null&&LR(y,"__typename",w,p,"__typename"),O)for(let K in O){let te=O[K];for(let pe of te)u.unpathedErrors.add(pe)}let M=p==null?void 0:p.__leave;return M!=null?M(y):y}function LR(e,t,n,r,i){if(r==null){e[t]=n;return}let o=r[i];if(o==null){e[t]=n;return}let s=o(n);if(s===void 0){delete e[t];return}e[t]=s}function BB(e,t,n,r,i,o,s,a,c,u){return e.map(l=>FR(l,t,n,r,i,o,s,a+1,c,u))}function FR(e,t,n,r,i,o,s,a,c=[],u){if(e==null)return e;let l=(0,ua.getNullableType)(t);if((0,ua.isListType)(l))return BB(e,l.ofType,n,r,i,o,s,a,c,u);if((0,ua.isAbstractType)(l)){let y=r.getType(e.__typename),{fields:N}=(0,Zg.collectSubFields)(r,i,o,y,n);return tv(e,y,N,r,i,o,s,a,c,u)}else if((0,ua.isObjectType)(l)){let{fields:y}=(0,Zg.collectSubFields)(r,i,o,l,n);return tv(e,l,y,r,i,o,s,a,c,u)}let p=s==null?void 0:s[l.name];if(p==null)return e;let h=p(e);return h===void 0?e:h}function KB(e,t){var i;let n=Object.create(null),r=new Set;for(let o of e){let s=(i=o.path)==null?void 0:i[t];if(s==null){r.add(o);continue}s in n?n[s].push(o):n[s]=[o]}return{errorMap:n,unpathedErrors:r}}function QB(e,t,n,r=[],i){for(let o of r){let s={type:e,fieldName:t,pathIndex:n},a=i.segmentInfoMap.get(o);a==null?i.segmentInfoMap.set(o,[s]):a.push(s)}}});var PR=F(Lh=>{"use strict";d();m();f();Object.defineProperty(Lh,"__esModule",{value:!0});Lh.valueMatchesCriteria=void 0;function nv(e,t){return e==null?e===t:Array.isArray(e)?Array.isArray(t)&&e.every((n,r)=>nv(n,t[r])):typeof e=="object"?typeof t=="object"&&t&&Object.keys(t).every(n=>nv(e[n],t[n])):t instanceof RegExp?t.test(e):e===t}Lh.valueMatchesCriteria=nv});var xR=F(Fh=>{"use strict";d();m();f();Object.defineProperty(Fh,"__esModule",{value:!0});Fh.isAsyncIterable=void 0;function YB(e){return typeof e=="object"&&e!=null&&Symbol.asyncIterator in e&&typeof e[Symbol.asyncIterator]=="function"}Fh.isAsyncIterable=YB});var CR=F(kh=>{"use strict";d();m();f();Object.defineProperty(kh,"__esModule",{value:!0});kh.isDocumentNode=void 0;var JB=(he(),Te(Ie));function zB(e){return e&&typeof e=="object"&&"kind"in e&&e.kind===JB.Kind.DOCUMENT}kh.isDocumentNode=zB});var MR=F(()=>{"use strict";d();m();f()});var $R=F(la=>{"use strict";d();m();f();Object.defineProperty(la,"__esModule",{value:!0});la.withCancel=la.getAsyncIterableWithCancel=la.getAsyncIteratorWithCancel=void 0;var XB=Tc();function HB(e){return Wt(this,null,function*(){return{value:e,done:!0}})}var UR=(0,XB.memoize2)(function(t,n){return function(...i){return Reflect.apply(n,t,i)}});function jR(e,t){return new Proxy(e,{has(n,r){return r==="return"?!0:Reflect.has(n,r)},get(n,r,i){let o=Reflect.get(n,r,i);if(r==="return"){let s=o||HB;return function(c){return Wt(this,null,function*(){let u=yield t(c);return Reflect.apply(s,n,[u])})}}else if(typeof o=="function")return UR(n,o);return o}})}la.getAsyncIteratorWithCancel=jR;function VR(e,t){return new Proxy(e,{get(n,r,i){let o=Reflect.get(n,r,i);return Symbol.asyncIterator===r?function(){let a=Reflect.apply(o,n,[]);return jR(a,t)}:typeof o=="function"?UR(n,o):o}})}la.getAsyncIterableWithCancel=VR;la.withCancel=VR});var GR=F(Ph=>{"use strict";d();m();f();Object.defineProperty(Ph,"__esModule",{value:!0});Ph.fixSchemaAst=void 0;var WB=(he(),Te(Ie)),ZB=Dg();function eK(e,t){let n=(0,ZB.getDocumentNodeFromSchema)(e);return(0,WB.buildASTSchema)(n,D({},t||{}))}function tK(e,t){let n;return(!e.astNode||!e.extensionASTNodes)&&(n=eK(e,t)),!e.astNode&&(n!=null&&n.astNode)&&(e.astNode=n.astNode),!e.extensionASTNodes&&(n!=null&&n.astNode)&&(e.extensionASTNodes=n.extensionASTNodes),e}Ph.fixSchemaAst=tK});var qR=F(xh=>{"use strict";d();m();f();Object.defineProperty(xh,"__esModule",{value:!0});xh.extractExtensionsFromSchema=void 0;var nK=bc(),Wo=tu();function rK(e){let t={schemaExtensions:e.extensions||{},types:{}};return(0,nK.mapSchema)(e,{[Wo.MapperKind.OBJECT_TYPE]:n=>(t.types[n.name]={fields:{},type:"object",extensions:n.extensions||{}},n),[Wo.MapperKind.INTERFACE_TYPE]:n=>(t.types[n.name]={fields:{},type:"interface",extensions:n.extensions||{}},n),[Wo.MapperKind.FIELD]:(n,r,i)=>{t.types[i].fields[r]={arguments:{},extensions:n.extensions||{}};let o=n.args;if(o!=null)for(let s in o)t.types[i].fields[r].arguments[s]=o[s].extensions||{};return n},[Wo.MapperKind.ENUM_TYPE]:n=>(t.types[n.name]={values:{},type:"enum",extensions:n.extensions||{}},n),[Wo.MapperKind.ENUM_VALUE]:(n,r,i,o)=>(t.types[r].values[o]=n.extensions||{},n),[Wo.MapperKind.SCALAR_TYPE]:n=>(t.types[n.name]={type:"scalar",extensions:n.extensions||{}},n),[Wo.MapperKind.UNION_TYPE]:n=>(t.types[n.name]={type:"union",extensions:n.extensions||{}},n),[Wo.MapperKind.INPUT_OBJECT_TYPE]:n=>(t.types[n.name]={fields:{},type:"input",extensions:n.extensions||{}},n),[Wo.MapperKind.INPUT_OBJECT_FIELD]:(n,r,i)=>(t.types[i].fields[r]={extensions:n.extensions||{}},n)}),t}xh.extractExtensionsFromSchema=rK});var BR=F(pa=>{"use strict";d();m();f();Object.defineProperty(pa,"__esModule",{value:!0});pa.printPathArray=pa.pathToArray=pa.addPath=void 0;function iK(e,t,n){return{prev:e,key:t,typename:n}}pa.addPath=iK;function oK(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}pa.pathToArray=oK;function sK(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}pa.printPathArray=sK});var Pi=F(Fe=>{"use strict";d();m();f();Object.defineProperty(Fe,"__esModule",{value:!0});var Ce=(jm(),Te(Um));Ce.__exportStar(nw(),Fe);Ce.__exportStar(zp(),Fe);Ce.__exportStar(hg(),Fe);Ce.__exportStar(yg(),Fe);Ce.__exportStar(mw(),Fe);Ce.__exportStar(Eg(),Fe);Ce.__exportStar(Dg(),Fe);Ce.__exportStar(yg(),Fe);Ce.__exportStar(Rw(),Fe);Ce.__exportStar(Lw(),Fe);Ce.__exportStar(Bw(),Fe);Ce.__exportStar(Ww(),Fe);Ce.__exportStar(eR(),Fe);Ce.__exportStar(aR(),Fe);Ce.__exportStar(cR(),Fe);Ce.__exportStar(lR(),Fe);Ce.__exportStar(dR(),Fe);Ce.__exportStar(fR(),Fe);Ce.__exportStar(bc(),Fe);Ce.__exportStar(Bg(),Fe);Ce.__exportStar(uh(),Fe);Ce.__exportStar(hR(),Fe);Ce.__exportStar(TR(),Fe);Ce.__exportStar(tu(),Fe);Ce.__exportStar(Cg(),Fe);Ce.__exportStar(ER(),Fe);Ce.__exportStar(NR(),Fe);Ce.__exportStar(gR(),Fe);Ce.__exportStar(vR(),Fe);Ce.__exportStar(Mg(),Fe);Ce.__exportStar(_R(),Fe);Ce.__exportStar(OR(),Fe);Ce.__exportStar(SR(),Fe);Ce.__exportStar($m(),Fe);Ce.__exportStar(DR(),Fe);Ce.__exportStar(kR(),Fe);Ce.__exportStar(mg(),Fe);Ce.__exportStar(PR(),Fe);Ce.__exportStar(xR(),Fe);Ce.__exportStar(CR(),Fe);Ce.__exportStar(Hm(),Fe);Ce.__exportStar(MR(),Fe);Ce.__exportStar($R(),Fe);Ce.__exportStar(Hp(),Fe);Ce.__exportStar(wg(),Fe);Ce.__exportStar(Wg(),Fe);Ce.__exportStar(Xp(),Fe);Ce.__exportStar(Tc(),Fe);Ce.__exportStar(GR(),Fe);Ce.__exportStar(Yg(),Fe);Ce.__exportStar(qR(),Fe);Ce.__exportStar(BR(),Fe);Ce.__exportStar(Vm(),Fe);Ce.__exportStar(Jg(),Fe)});var QR=F(Ch=>{"use strict";d();m();f();Object.defineProperty(Ch,"__esModule",{value:!0});Ch.mergeResolvers=void 0;var aK=Pi();function KR(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=new Array;for(let i of e)Array.isArray(i)&&(i=KR(i)),typeof i=="object"&&i&&n.push(i);let r=(0,aK.mergeDeep)(n,!0);if(t!=null&&t.exclusions)for(let i of t.exclusions){let[o,s]=i.split(".");!s||s==="*"?delete r[o]:r[o]&&delete r[o][s]}return r}Ch.mergeResolvers=KR});var rv=F(Mh=>{"use strict";d();m();f();Object.defineProperty(Mh,"__esModule",{value:!0});Mh.mergeArguments=void 0;var YR=Pi();function uK(e,t,n){let r=cK([...t,...e].filter(YR.isSome),n);return n&&n.sort&&r.sort(YR.compareNodes),r}Mh.mergeArguments=uK;function cK(e,t){return e.reduce((n,r)=>{let i=n.findIndex(o=>o.name.value===r.name.value);return i===-1?n.concat([r]):(t!=null&&t.reverseArguments||(n[i]=r),n)},[])}});var di=F(wc=>{"use strict";d();m();f();Object.defineProperty(wc,"__esModule",{value:!0});wc.mergeDirective=wc.mergeDirectives=void 0;var JR=(he(),Te(Ie)),lK=Pi();function pK(e,t){return!!e.find(n=>n.name.value===t.name.value)}function zR(e,t){var n;return!!((n=t==null?void 0:t[e.name.value])!=null&&n.repeatable)}function dK(e,t){return t.some(({value:n})=>n===e.value)}function XR(e,t){let n=[...t];for(let r of e){let i=n.findIndex(o=>o.name.value===r.name.value);if(i>-1){let o=n[i];if(o.value.kind==="ListValue"){let s=o.value.values,a=r.value.values;o.value.values=TK(s,a,(c,u)=>{let l=c.value;return!l||!u.some(p=>p.value===l)})}else o.value=r.value}else n.push(r)}return n}function fK(e,t){return e.map((n,r,i)=>{let o=i.findIndex(s=>s.name.value===n.name.value);if(o!==r&&!zR(n,t)){let s=i[o];return n.arguments=XR(n.arguments,s.arguments),null}return n}).filter(lK.isSome)}function mK(e=[],t=[],n,r){let i=n&&n.reverseDirectives,o=i?e:t,s=i?t:e,a=fK([...o],r);for(let c of s)if(pK(a,c)&&!zR(c,r)){let u=a.findIndex(p=>p.name.value===c.name.value),l=a[u];a[u].arguments=XR(c.arguments||[],l.arguments||[])}else a.push(c);return a}wc.mergeDirectives=mK;function hK(e,t){let n=(0,JR.print)(x(D({},e),{description:void 0})),r=(0,JR.print)(x(D({},t),{description:void 0})),i=new RegExp("(directive @w*d*)|( on .*$)","g");if(!(n.replace(i,"")===r.replace(i,"")))throw new Error(`Unable to merge GraphQL directive "${e.name.value}". +)`):Yt("(",pe(t,", "),")"))+(n?" repeatable":"")+" on "+pe(r," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>pe(["extend schema",pe(e," "),ci(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>pe(["extend scalar",e,pe(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>pe(["extend type",e,Yt("implements ",pe(t," & ")),pe(n," "),ci(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>pe(["extend interface",e,Yt("implements ",pe(t," & ")),pe(n," "),ci(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>pe(["extend union",e,pe(t," "),Yt("= ",pe(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>pe(["extend enum",e,pe(t," "),ci(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>pe(["extend input",e,pe(t," "),ci(n)]," ")}},D$=Object.keys(rO).reduce((e,t)=>M(A({},e),{[t]:{leave:b$(rO[t].leave)}}),{});function O$(e){return(0,sO.visit)(e,D$)}en.printWithComments=O$;function A$(e){return e.kind==="FieldDefinition"}function w$(e,t){if(e.description!=null)return e.description.value;if(t!=null&&t.commentDescriptions)return WE(e)}en.getDescription=w$;function WE(e){let t=aO(e);if(t!==void 0)return uO(` +${t}`)}en.getComment=WE;function aO(e){let t=e.loc;if(!t)return;let n=[],r=t.startToken.prev;for(;r!=null&&r.kind===sO.TokenKind.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}en.getLeadingCommentBlock=aO;function uO(e){let t=e.split(/\r\n|[\n\r]/g),n=cO(t);if(n!==0)for(let r=1;r0&&iO(t[0]);)t.shift();for(;t.length>0&&iO(t[t.length-1]);)t.pop();return t.join(` +`)}en.dedentBlockStringValue=uO;function cO(e){let t=null;for(let n=1;n{"use strict";d();f();p();Object.defineProperty(Lo,"__esModule",{value:!0});Lo.isDescribable=Lo.transformCommentsToDescriptions=Lo.parseGraphQLSDL=void 0;var Vr=(ne(),se(ce)),dO=ZE();function F$(e,t,n={}){let r;try{n.commentDescriptions&&t.includes("#")?(r=pO(t,n),n.noLocation&&(r=(0,Vr.parse)((0,Vr.print)(r),n))):r=(0,Vr.parse)(new Vr.Source(t,e),n)}catch(i){if(i.message.includes("EOF")&&t.replace(/(\#[^*]*)/g,"").trim()==="")r={kind:Vr.Kind.DOCUMENT,definitions:[]};else throw i}return{location:e,document:r}}Lo.parseGraphQLSDL=F$;function pO(e,t={}){let n=(0,Vr.parse)(e,M(A({},t),{noLocation:!1}));return(0,Vr.visit)(n,{leave:i=>{if(fO(i)){let s=(0,dO.getLeadingCommentBlock)(i);if(s!==void 0){let o=(0,dO.dedentBlockStringValue)(` +`+s),a=o.includes(` +`);return i.description?M(A({},i),{description:M(A({},i.description),{value:i.description.value+` +`+o,block:!0})}):M(A({},i),{description:{kind:Vr.Kind.STRING,value:o,block:a}})}}}})}Lo.transformCommentsToDescriptions=pO;function fO(e){return(0,Vr.isTypeSystemDefinitionNode)(e)||e.kind===Vr.Kind.FIELD_DEFINITION||e.kind===Vr.Kind.INPUT_VALUE_DEFINITION||e.kind===Vr.Kind.ENUM_VALUE_DEFINITION}Lo.isDescribable=fO});var vO=L(rm=>{"use strict";d();f();p();Object.defineProperty(rm,"__esModule",{value:!0});rm.buildOperationNodeForField=void 0;var $e=(ne(),se(ce)),EO=dd(),nN=[],nm=new Map;function NO(e){nN.push(e)}function hO(){nN=[]}function TO(){nm=new Map}function L$({schema:e,kind:t,field:n,models:r,ignore:i=[],depthLimit:s,circularReferenceDepth:o,argNames:a,selectedFields:u=!0}){hO(),TO();let c=(0,EO.getRootTypeNames)(e),l=R$({schema:e,fieldName:n,kind:t,models:r||[],ignore:i,depthLimit:s||1/0,circularReferenceDepth:o||1,argNames:a,selectedFields:u,rootTypeNames:c});return l.variableDefinitions=[...nN],hO(),TO(),l}rm.buildOperationNodeForField=L$;function R$({schema:e,fieldName:t,kind:n,models:r,ignore:i,depthLimit:s,circularReferenceDepth:o,argNames:a,selectedFields:u,rootTypeNames:c}){let l=(0,EO.getDefinedRootType)(e,n),m=l.getFields()[t],h=`${t}_${n}`;if(m.args)for(let E of m.args){let N=E.name;(!a||a.includes(N))&&NO(gO(E,N))}return{kind:$e.Kind.OPERATION_DEFINITION,operation:n,name:{kind:$e.Kind.NAME,value:h},variableDefinitions:[],selectionSet:{kind:$e.Kind.SELECTION_SET,selections:[IO({type:l,field:m,models:r,firstCall:!0,path:[],ancestors:[],ignore:i,depthLimit:s,circularReferenceDepth:o,schema:e,depth:0,argNames:a,selectedFields:u,rootTypeNames:c})]}}}function tN({parent:e,type:t,models:n,firstCall:r,path:i,ancestors:s,ignore:o,depthLimit:a,circularReferenceDepth:u,schema:c,depth:l,argNames:m,selectedFields:h,rootTypeNames:E}){if(!(typeof h=="boolean"&&l>a)){if((0,$e.isUnionType)(t)){let N=t.getTypes();return{kind:$e.Kind.SELECTION_SET,selections:N.filter(D=>!eN([...s,D],{depth:u})).map(D=>({kind:$e.Kind.INLINE_FRAGMENT,typeCondition:{kind:$e.Kind.NAMED_TYPE,name:{kind:$e.Kind.NAME,value:D.name}},selectionSet:tN({parent:t,type:D,models:n,path:i,ancestors:s,ignore:o,depthLimit:a,circularReferenceDepth:u,schema:c,depth:l,argNames:m,selectedFields:h,rootTypeNames:E})})).filter(D=>{var w,x;return((x=(w=D==null?void 0:D.selectionSet)==null?void 0:w.selections)==null?void 0:x.length)>0})}}if((0,$e.isInterfaceType)(t)){let N=Object.values(c.getTypeMap()).filter(D=>(0,$e.isObjectType)(D)&&D.getInterfaces().includes(t));return{kind:$e.Kind.SELECTION_SET,selections:N.filter(D=>!eN([...s,D],{depth:u})).map(D=>({kind:$e.Kind.INLINE_FRAGMENT,typeCondition:{kind:$e.Kind.NAMED_TYPE,name:{kind:$e.Kind.NAME,value:D.name}},selectionSet:tN({parent:t,type:D,models:n,path:i,ancestors:s,ignore:o,depthLimit:a,circularReferenceDepth:u,schema:c,depth:l,argNames:m,selectedFields:h,rootTypeNames:E})})).filter(D=>{var w,x;return((x=(w=D==null?void 0:D.selectionSet)==null?void 0:w.selections)==null?void 0:x.length)>0})}}if((0,$e.isObjectType)(t)&&!E.has(t.name)){let N=o.includes(t.name)||o.includes(`${e.name}.${i[i.length-1]}`),D=n.includes(t.name);if(!r&&D&&!N)return{kind:$e.Kind.SELECTION_SET,selections:[{kind:$e.Kind.FIELD,name:{kind:$e.Kind.NAME,value:"id"}}]};let w=t.getFields();return{kind:$e.Kind.SELECTION_SET,selections:Object.keys(w).filter(x=>!eN([...s,(0,$e.getNamedType)(w[x].type)],{depth:u})).map(x=>{let Y=typeof h=="object"?h[x]:!0;return Y?IO({type:t,field:w[x],models:n,path:[...i,x],ancestors:s,ignore:o,depthLimit:a,circularReferenceDepth:u,schema:c,depth:l,argNames:m,selectedFields:Y,rootTypeNames:E}):null}).filter(x=>{var Y,Q;return x==null?!1:"selectionSet"in x?!!((Q=(Y=x.selectionSet)==null?void 0:Y.selections)!=null&&Q.length):!0})}}}}function gO(e,t){function n(r){return(0,$e.isListType)(r)?{kind:$e.Kind.LIST_TYPE,type:n(r.ofType)}:(0,$e.isNonNullType)(r)?{kind:$e.Kind.NON_NULL_TYPE,type:n(r.ofType)}:{kind:$e.Kind.NAMED_TYPE,name:{kind:$e.Kind.NAME,value:r.name}}}return{kind:$e.Kind.VARIABLE_DEFINITION,variable:{kind:$e.Kind.VARIABLE,name:{kind:$e.Kind.NAME,value:t||e.name}},type:n(e.type)}}function yO(e,t){return[...t,e].join("_")}function IO({type:e,field:t,models:n,firstCall:r,path:i,ancestors:s,ignore:o,depthLimit:a,circularReferenceDepth:u,schema:c,depth:l,argNames:m,selectedFields:h,rootTypeNames:E}){let N=(0,$e.getNamedType)(t.type),D=[],w=!1;if(t.args&&t.args.length&&(D=t.args.map(W=>{let Ie=yO(W.name,i);return m&&!m.includes(Ie)?((0,$e.isNonNullType)(W.type)&&(w=!0),null):(r||NO(gO(W,Ie)),{kind:$e.Kind.ARGUMENT,name:{kind:$e.Kind.NAME,value:W.name},value:{kind:$e.Kind.VARIABLE,name:{kind:$e.Kind.NAME,value:yO(W.name,i)}}})}).filter(Boolean)),w)return null;let x=[...i,t.name],Y=x.join("."),Q=t.name;return nm.has(Y)&&nm.get(Y)!==t.type.toString()&&(Q+=t.type.toString().replace("!","NonNull").replace("[","List").replace("]","")),nm.set(Y,t.type.toString()),!(0,$e.isScalarType)(N)&&!(0,$e.isEnumType)(N)?M(A({kind:$e.Kind.FIELD,name:{kind:$e.Kind.NAME,value:t.name}},Q!==t.name&&{alias:{kind:$e.Kind.NAME,value:Q}}),{selectionSet:tN({parent:e,type:N,models:n,firstCall:r,path:x,ancestors:[...s,e],ignore:o,depthLimit:a,circularReferenceDepth:u,schema:c,depth:l+1,argNames:m,selectedFields:h,rootTypeNames:E})||void 0,arguments:D}):M(A({kind:$e.Kind.FIELD,name:{kind:$e.Kind.NAME,value:t.name}},Q!==t.name&&{alias:{kind:$e.Kind.NAME,value:Q}}),{arguments:D})}function eN(e,t={depth:1}){let n=e[e.length-1];return(0,$e.isScalarType)(n)?!1:e.filter(i=>i.name===n.name).length>t.depth}});var bO=L(im=>{"use strict";d();f();p();Object.defineProperty(im,"__esModule",{value:!0});im.DirectiveLocation=void 0;var _O;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(_O||(im.DirectiveLocation=_O={}))});var Da=L(sm=>{"use strict";d();f();p();Object.defineProperty(sm,"__esModule",{value:!0});sm.MapperKind=void 0;var SO;(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"})(SO||(sm.MapperKind=SO={}))});var rN=L(om=>{"use strict";d();f();p();Object.defineProperty(om,"__esModule",{value:!0});om.getObjectTypeFromTypeMap=void 0;var k$=(ne(),se(ce));function x$(e,t){if(t){let n=e[t.name];if((0,k$.isObjectType)(n))return n}}om.getObjectTypeFromTypeMap=x$});var oN=L(Ui=>{"use strict";d();f();p();Object.defineProperty(Ui,"__esModule",{value:!0});Ui.getBuiltInForStub=Ui.isNamedStub=Ui.createStub=Ui.createNamedStub=void 0;var wn=(ne(),se(ce));function iN(e,t){let n;return t==="object"?n=wn.GraphQLObjectType:t==="interface"?n=wn.GraphQLInterfaceType:n=wn.GraphQLInputObjectType,new n({name:e,fields:{_fake:{type:wn.GraphQLString}}})}Ui.createNamedStub=iN;function sN(e,t){switch(e.kind){case wn.Kind.LIST_TYPE:return new wn.GraphQLList(sN(e.type,t));case wn.Kind.NON_NULL_TYPE:return new wn.GraphQLNonNull(sN(e.type,t));default:return t==="output"?iN(e.name.value,"object"):iN(e.name.value,"input")}}Ui.createStub=sN;function P$(e){if("getFields"in e){let t=e.getFields();for(let n in t)return t[n].name==="_fake"}return!1}Ui.isNamedStub=P$;function M$(e){switch(e.name){case wn.GraphQLInt.name:return wn.GraphQLInt;case wn.GraphQLFloat.name:return wn.GraphQLFloat;case wn.GraphQLString.name:return wn.GraphQLString;case wn.GraphQLBoolean.name:return wn.GraphQLBoolean;case wn.GraphQLID.name:return wn.GraphQLID;default:return e}}Ui.getBuiltInForStub=M$});var um=L(am=>{"use strict";d();f();p();Object.defineProperty(am,"__esModule",{value:!0});am.rewireTypes=void 0;var hn=(ne(),se(ce)),DO=oN();function U$(e,t){let n=Object.create(null);for(let h in e)n[h]=e[h];let r=Object.create(null);for(let h in n){let E=n[h];if(E==null||h.startsWith("__"))continue;let N=E.name;if(!N.startsWith("__")){if(r[N]!=null){console.warn(`Duplicate schema type name ${N} found; keeping the existing one found in the schema`);continue}r[N]=E}}for(let h in r)r[h]=a(r[h]);let i=t.map(h=>s(h));return{typeMap:r,directives:i};function s(h){if((0,hn.isSpecifiedDirective)(h))return h;let E=h.toConfig();return E.args=o(E.args),new hn.GraphQLDirective(E)}function o(h){let E={};for(let N in h){let D=h[N],w=m(D.type);w!=null&&(D.type=w,E[N]=D)}return E}function a(h){if((0,hn.isObjectType)(h)){let E=h.toConfig(),N=M(A({},E),{fields:()=>u(E.fields),interfaces:()=>l(E.interfaces)});return new hn.GraphQLObjectType(N)}else if((0,hn.isInterfaceType)(h)){let E=h.toConfig(),N=M(A({},E),{fields:()=>u(E.fields)});return"interfaces"in N&&(N.interfaces=()=>l(E.interfaces)),new hn.GraphQLInterfaceType(N)}else if((0,hn.isUnionType)(h)){let E=h.toConfig(),N=M(A({},E),{types:()=>l(E.types)});return new hn.GraphQLUnionType(N)}else if((0,hn.isInputObjectType)(h)){let E=h.toConfig(),N=M(A({},E),{fields:()=>c(E.fields)});return new hn.GraphQLInputObjectType(N)}else if((0,hn.isEnumType)(h)){let E=h.toConfig();return new hn.GraphQLEnumType(E)}else if((0,hn.isScalarType)(h)){if((0,hn.isSpecifiedScalarType)(h))return h;let E=h.toConfig();return new hn.GraphQLScalarType(E)}throw new Error(`Unexpected schema type: ${h}`)}function u(h){let E={};for(let N in h){let D=h[N],w=m(D.type);w!=null&&D.args&&(D.type=w,D.args=o(D.args),E[N]=D)}return E}function c(h){let E={};for(let N in h){let D=h[N],w=m(D.type);w!=null&&(D.type=w,E[N]=D)}return E}function l(h){let E=[];for(let N of h){let D=m(N);D!=null&&E.push(D)}return E}function m(h){if((0,hn.isListType)(h)){let E=m(h.ofType);return E!=null?new hn.GraphQLList(E):null}else if((0,hn.isNonNullType)(h)){let E=m(h.ofType);return E!=null?new hn.GraphQLNonNull(E):null}else if((0,hn.isNamedType)(h)){let E=n[h.name];return E===void 0&&(E=(0,DO.isNamedStub)(h)?(0,DO.getBuiltInForStub)(h):a(h),r[E.name]=n[h.name]=E),E!=null?r[E.name]:null}return null}}am.rewireTypes=U$});var aN=L(Ci=>{"use strict";d();f();p();Object.defineProperty(Ci,"__esModule",{value:!0});Ci.parseInputValueLiteral=Ci.parseInputValue=Ci.serializeInputValue=Ci.transformInputValue=void 0;var cm=(ne(),se(ce)),C$=cd();function Cu(e,t,n=null,r=null){if(t==null)return t;let i=(0,cm.getNullableType)(e);if((0,cm.isLeafType)(i))return n!=null?n(i,t):t;if((0,cm.isListType)(i))return(0,C$.asArray)(t).map(s=>Cu(i.ofType,s,n,r));if((0,cm.isInputObjectType)(i)){let s=i.getFields(),o={};for(let a in t){let u=s[a];u!=null&&(o[a]=Cu(u.type,t[a],n,r))}return r!=null?r(i,o):o}}Ci.transformInputValue=Cu;function B$(e,t){return Cu(e,t,(n,r)=>{try{return n.serialize(r)}catch(i){return r}})}Ci.serializeInputValue=B$;function $$(e,t){return Cu(e,t,(n,r)=>{try{return n.parseValue(r)}catch(i){return r}})}Ci.parseInputValue=$$;function V$(e,t){return Cu(e,t,(n,r)=>n.parseLiteral(r,{}))}Ci.parseInputValueLiteral=V$});var Vu=L($u=>{"use strict";d();f();p();Object.defineProperty($u,"__esModule",{value:!0});$u.correctASTNodes=$u.mapSchema=void 0;var Me=(ne(),se(ce)),Bu=rN(),We=Da(),j$=um(),OO=aN();function G$(e,t={}){let n=FO(wO(uN(AO(q$(uN(AO(e.getTypeMap(),e,OO.serializeInputValue),e,t,a=>(0,Me.isLeafType)(a)),e,t),e,OO.parseInputValue),e,t,a=>!(0,Me.isLeafType)(a)),e,t),e,t),r=e.getDirectives(),i=K$(r,e,t),{typeMap:s,directives:o}=(0,j$.rewireTypes)(n,i);return new Me.GraphQLSchema(M(A({},e.toConfig()),{query:(0,Bu.getObjectTypeFromTypeMap)(s,(0,Bu.getObjectTypeFromTypeMap)(n,e.getQueryType())),mutation:(0,Bu.getObjectTypeFromTypeMap)(s,(0,Bu.getObjectTypeFromTypeMap)(n,e.getMutationType())),subscription:(0,Bu.getObjectTypeFromTypeMap)(s,(0,Bu.getObjectTypeFromTypeMap)(n,e.getSubscriptionType())),types:Object.values(s),directives:o}))}$u.mapSchema=G$;function uN(e,t,n,r=()=>!0){let i={};for(let s in e)if(!s.startsWith("__")){let o=e[s];if(o==null||!r(o)){i[s]=o;continue}let a=Y$(t,n,s);if(a==null){i[s]=o;continue}let u=a(o,t);if(u===void 0){i[s]=o;continue}i[s]=u}return i}function q$(e,t,n){let r=W$(n);return r?uN(e,t,{[We.MapperKind.ENUM_TYPE]:i=>{let s=i.toConfig(),o=s.values,a={};for(let u in o){let c=o[u],l=r(c,i.name,t,u);if(l===void 0)a[u]=c;else if(Array.isArray(l)){let[m,h]=l;a[m]=h===void 0?c:h}else l!==null&&(a[u]=l)}return yd(new Me.GraphQLEnumType(M(A({},s),{values:a})))}},i=>(0,Me.isEnumType)(i)):e}function AO(e,t,n){let r=FO(e,t,{[We.MapperKind.ARGUMENT]:i=>{if(i.defaultValue===void 0)return i;let s=lm(e,i.type);if(s!=null)return M(A({},i),{defaultValue:n(s,i.defaultValue)})}});return wO(r,t,{[We.MapperKind.INPUT_OBJECT_FIELD]:i=>{if(i.defaultValue===void 0)return i;let s=lm(r,i.type);if(s!=null)return M(A({},i),{defaultValue:n(s,i.defaultValue)})}})}function lm(e,t){if((0,Me.isListType)(t)){let n=lm(e,t.ofType);return n!=null?new Me.GraphQLList(n):null}else if((0,Me.isNonNullType)(t)){let n=lm(e,t.ofType);return n!=null?new Me.GraphQLNonNull(n):null}else if((0,Me.isNamedType)(t)){let n=e[t.name];return n!=null?n:null}return null}function wO(e,t,n){let r={};for(let i in e)if(!i.startsWith("__")){let s=e[i];if(!(0,Me.isObjectType)(s)&&!(0,Me.isInterfaceType)(s)&&!(0,Me.isInputObjectType)(s)){r[i]=s;continue}let o=z$(t,n,i);if(o==null){r[i]=s;continue}let a=s.toConfig(),u=a.fields,c={};for(let l in u){let m=u[l],h=o(m,l,i,t);if(h===void 0)c[l]=m;else if(Array.isArray(h)){let[E,N]=h;N.astNode!=null&&(N.astNode=M(A({},N.astNode),{name:M(A({},N.astNode.name),{value:E})})),c[E]=N===void 0?m:N}else h!==null&&(c[l]=h)}(0,Me.isObjectType)(s)?r[i]=yd(new Me.GraphQLObjectType(M(A({},a),{fields:c}))):(0,Me.isInterfaceType)(s)?r[i]=yd(new Me.GraphQLInterfaceType(M(A({},a),{fields:c}))):r[i]=yd(new Me.GraphQLInputObjectType(M(A({},a),{fields:c})))}return r}function FO(e,t,n){let r={};for(let i in e)if(!i.startsWith("__")){let s=e[i];if(!(0,Me.isObjectType)(s)&&!(0,Me.isInterfaceType)(s)){r[i]=s;continue}let o=X$(n);if(o==null){r[i]=s;continue}let a=s.toConfig(),u=a.fields,c={};for(let l in u){let m=u[l],h=m.args;if(h==null){c[l]=m;continue}let E=Object.keys(h);if(!E.length){c[l]=m;continue}let N={};for(let D of E){let w=h[D],x=o(w,l,i,t);if(x===void 0)N[D]=w;else if(Array.isArray(x)){let[Y,Q]=x;N[Y]=Q}else x!==null&&(N[D]=x)}c[l]=M(A({},m),{args:N})}(0,Me.isObjectType)(s)?r[i]=new Me.GraphQLObjectType(M(A({},a),{fields:c})):(0,Me.isInterfaceType)(s)?r[i]=new Me.GraphQLInterfaceType(M(A({},a),{fields:c})):r[i]=new Me.GraphQLInputObjectType(M(A({},a),{fields:c}))}return r}function K$(e,t,n){let r=H$(n);if(r==null)return e.slice();let i=[];for(let s of e){let o=r(s,t);o===void 0?i.push(s):o!==null&&i.push(o)}return i}function Q$(e,t){var i,s,o;let n=e.getType(t),r=[We.MapperKind.TYPE];return(0,Me.isObjectType)(n)?(r.push(We.MapperKind.COMPOSITE_TYPE,We.MapperKind.OBJECT_TYPE),t===((i=e.getQueryType())==null?void 0:i.name)?r.push(We.MapperKind.ROOT_OBJECT,We.MapperKind.QUERY):t===((s=e.getMutationType())==null?void 0:s.name)?r.push(We.MapperKind.ROOT_OBJECT,We.MapperKind.MUTATION):t===((o=e.getSubscriptionType())==null?void 0:o.name)&&r.push(We.MapperKind.ROOT_OBJECT,We.MapperKind.SUBSCRIPTION)):(0,Me.isInputObjectType)(n)?r.push(We.MapperKind.INPUT_OBJECT_TYPE):(0,Me.isInterfaceType)(n)?r.push(We.MapperKind.COMPOSITE_TYPE,We.MapperKind.ABSTRACT_TYPE,We.MapperKind.INTERFACE_TYPE):(0,Me.isUnionType)(n)?r.push(We.MapperKind.COMPOSITE_TYPE,We.MapperKind.ABSTRACT_TYPE,We.MapperKind.UNION_TYPE):(0,Me.isEnumType)(n)?r.push(We.MapperKind.ENUM_TYPE):(0,Me.isScalarType)(n)&&r.push(We.MapperKind.SCALAR_TYPE),r}function Y$(e,t,n){let r=Q$(e,n),i,s=[...r];for(;!i&&s.length>0;){let o=s.pop();i=t[o]}return i!=null?i:null}function J$(e,t){var i,s,o;let n=e.getType(t),r=[We.MapperKind.FIELD];return(0,Me.isObjectType)(n)?(r.push(We.MapperKind.COMPOSITE_FIELD,We.MapperKind.OBJECT_FIELD),t===((i=e.getQueryType())==null?void 0:i.name)?r.push(We.MapperKind.ROOT_FIELD,We.MapperKind.QUERY_ROOT_FIELD):t===((s=e.getMutationType())==null?void 0:s.name)?r.push(We.MapperKind.ROOT_FIELD,We.MapperKind.MUTATION_ROOT_FIELD):t===((o=e.getSubscriptionType())==null?void 0:o.name)&&r.push(We.MapperKind.ROOT_FIELD,We.MapperKind.SUBSCRIPTION_ROOT_FIELD)):(0,Me.isInterfaceType)(n)?r.push(We.MapperKind.COMPOSITE_FIELD,We.MapperKind.INTERFACE_FIELD):(0,Me.isInputObjectType)(n)&&r.push(We.MapperKind.INPUT_OBJECT_FIELD),r}function z$(e,t,n){let r=J$(e,n),i,s=[...r];for(;!i&&s.length>0;){let o=s.pop();i=t[o]}return i!=null?i:null}function X$(e){let t=e[We.MapperKind.ARGUMENT];return t!=null?t:null}function H$(e){let t=e[We.MapperKind.DIRECTIVE];return t!=null?t:null}function W$(e){let t=e[We.MapperKind.ENUM_VALUE];return t!=null?t:null}function yd(e){if((0,Me.isObjectType)(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.fields){let i=t.fields[r];i.astNode!=null&&n.push(i.astNode)}t.astNode=M(A({},t.astNode),{kind:Me.Kind.OBJECT_TYPE_DEFINITION,fields:n})}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(n=>M(A({},n),{kind:Me.Kind.OBJECT_TYPE_EXTENSION,fields:void 0}))),new Me.GraphQLObjectType(t)}else if((0,Me.isInterfaceType)(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.fields){let i=t.fields[r];i.astNode!=null&&n.push(i.astNode)}t.astNode=M(A({},t.astNode),{kind:Me.Kind.INTERFACE_TYPE_DEFINITION,fields:n})}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(n=>M(A({},n),{kind:Me.Kind.INTERFACE_TYPE_EXTENSION,fields:void 0}))),new Me.GraphQLInterfaceType(t)}else if((0,Me.isInputObjectType)(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.fields){let i=t.fields[r];i.astNode!=null&&n.push(i.astNode)}t.astNode=M(A({},t.astNode),{kind:Me.Kind.INPUT_OBJECT_TYPE_DEFINITION,fields:n})}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(n=>M(A({},n),{kind:Me.Kind.INPUT_OBJECT_TYPE_EXTENSION,fields:void 0}))),new Me.GraphQLInputObjectType(t)}else if((0,Me.isEnumType)(e)){let t=e.toConfig();if(t.astNode!=null){let n=[];for(let r in t.values){let i=t.values[r];i.astNode!=null&&n.push(i.astNode)}t.astNode=M(A({},t.astNode),{values:n})}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(n=>M(A({},n),{values:void 0}))),new Me.GraphQLEnumType(t)}else return e}$u.correctASTNodes=yd});var LO=L(pm=>{"use strict";d();f();p();Object.defineProperty(pm,"__esModule",{value:!0});pm.filterSchema=void 0;var dm=(ne(),se(ce)),ms=Da(),Z$=Vu();function eV({schema:e,typeFilter:t=()=>!0,fieldFilter:n=void 0,rootFieldFilter:r=void 0,objectFieldFilter:i=void 0,interfaceFieldFilter:s=void 0,inputObjectFieldFilter:o=void 0,argumentFilter:a=void 0}){return(0,Z$.mapSchema)(e,{[ms.MapperKind.QUERY]:c=>cN(c,"Query",r,a),[ms.MapperKind.MUTATION]:c=>cN(c,"Mutation",r,a),[ms.MapperKind.SUBSCRIPTION]:c=>cN(c,"Subscription",r,a),[ms.MapperKind.OBJECT_TYPE]:c=>t(c.name,c)?lN(dm.GraphQLObjectType,c,i||n,a):null,[ms.MapperKind.INTERFACE_TYPE]:c=>t(c.name,c)?lN(dm.GraphQLInterfaceType,c,s||n,a):null,[ms.MapperKind.INPUT_OBJECT_TYPE]:c=>t(c.name,c)?lN(dm.GraphQLInputObjectType,c,o||n):null,[ms.MapperKind.UNION_TYPE]:c=>t(c.name,c)?void 0:null,[ms.MapperKind.ENUM_TYPE]:c=>t(c.name,c)?void 0:null,[ms.MapperKind.SCALAR_TYPE]:c=>t(c.name,c)?void 0:null})}pm.filterSchema=eV;function cN(e,t,n,r){if(n||r){let i=e.toConfig();for(let s in i.fields){let o=i.fields[s];if(n&&!n(t,s,i.fields[s]))delete i.fields[s];else if(r&&o.args)for(let a in o.args)r(t,s,a,o.args[a])||delete o.args[a]}return new dm.GraphQLObjectType(i)}return e}function lN(e,t,n,r){if(n||r){let i=t.toConfig();for(let s in i.fields){let o=i.fields[s];if(n&&!n(t.name,s,i.fields[s]))delete i.fields[s];else if(r&&"args"in o)for(let a in o.args)r(t.name,s,a,o.args[a])||delete o.args[a]}return new e(i)}}});var kO=L(ju=>{"use strict";d();f();p();Object.defineProperty(ju,"__esModule",{value:!0});ju.healTypes=ju.healSchema=void 0;var Bi=(ne(),se(ce));function tV(e){return RO(e.getTypeMap(),e.getDirectives()),e}ju.healSchema=tV;function RO(e,t){let n=Object.create(null);for(let c in e){let l=e[c];if(l==null||c.startsWith("__"))continue;let m=l.name;if(!m.startsWith("__")){if(n[m]!=null){console.warn(`Duplicate schema type name ${m} found; keeping the existing one found in the schema`);continue}n[m]=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];!c.startsWith("__")&&c in n&&l!=null&&r(l)}for(let c in e)!c.startsWith("__")&&!(c in n)&&delete e[c];function r(c){if((0,Bi.isObjectType)(c)){i(c),s(c);return}else if((0,Bi.isInterfaceType)(c)){i(c),"getInterfaces"in c&&s(c);return}else if((0,Bi.isUnionType)(c)){a(c);return}else if((0,Bi.isInputObjectType)(c)){o(c);return}else if((0,Bi.isLeafType)(c))return;throw new Error(`Unexpected schema type: ${c}`)}function i(c){let l=c.getFields();for(let[m,h]of Object.entries(l))h.args.map(E=>(E.type=u(E.type),E.type===null?null:E)).filter(Boolean),h.type=u(h.type),h.type===null&&delete l[m]}function s(c){if("getInterfaces"in c){let l=c.getInterfaces();l.push(...l.splice(0).map(m=>u(m)).filter(Boolean))}}function o(c){let l=c.getFields();for(let[m,h]of Object.entries(l))h.type=u(h.type),h.type===null&&delete l[m]}function a(c){let l=c.getTypes();l.push(...l.splice(0).map(m=>u(m)).filter(Boolean))}function u(c){if((0,Bi.isListType)(c)){let l=u(c.ofType);return l!=null?new Bi.GraphQLList(l):null}else if((0,Bi.isNonNullType)(c)){let l=u(c.ofType);return l!=null?new Bi.GraphQLNonNull(l):null}else if((0,Bi.isNamedType)(c)){let l=e[c.name];if(l&&c!==l)return l}return c}}ju.healTypes=RO});var xO=L(fm=>{"use strict";d();f();p();Object.defineProperty(fm,"__esModule",{value:!0});fm.getResolversFromSchema=void 0;var Oa=(ne(),se(ce));function nV(e,t){var i,s;let n=Object.create(null),r=e.getTypeMap();for(let o in r)if(!o.startsWith("__")){let a=r[o];if((0,Oa.isScalarType)(a)){if(!(0,Oa.isSpecifiedScalarType)(a)){let u=a.toConfig();delete u.astNode,n[o]=new Oa.GraphQLScalarType(u)}}else if((0,Oa.isEnumType)(a)){n[o]={};let u=a.getValues();for(let c of u)n[o][c.name]=c.value}else if((0,Oa.isInterfaceType)(a))a.resolveType!=null&&(n[o]={__resolveType:a.resolveType});else if((0,Oa.isUnionType)(a))a.resolveType!=null&&(n[o]={__resolveType:a.resolveType});else if((0,Oa.isObjectType)(a)){n[o]={},a.isTypeOf!=null&&(n[o].__isTypeOf=a.isTypeOf);let u=a.getFields();for(let c in u){let l=u[c];if(l.subscribe!=null&&(n[o][c]=n[o][c]||{},n[o][c].subscribe=l.subscribe),l.resolve!=null&&((i=l.resolve)==null?void 0:i.name)!=="defaultFieldResolver"){switch((s=l.resolve)==null?void 0:s.name){case"defaultMergedResolver":if(!t)continue;break;case"defaultFieldResolver":continue}n[o][c]=n[o][c]||{},n[o][c].resolve=l.resolve}}}}return n}fm.getResolversFromSchema=nV});var MO=L(mm=>{"use strict";d();f();p();Object.defineProperty(mm,"__esModule",{value:!0});mm.forEachField=void 0;var PO=(ne(),se(ce));function rV(e,t){let n=e.getTypeMap();for(let r in n){let i=n[r];if(!(0,PO.getNamedType)(i).name.startsWith("__")&&(0,PO.isObjectType)(i)){let s=i.getFields();for(let o in s){let a=s[o];t(a,r,o)}}}}mm.forEachField=rV});var UO=L(hm=>{"use strict";d();f();p();Object.defineProperty(hm,"__esModule",{value:!0});hm.forEachDefaultValue=void 0;var dN=(ne(),se(ce));function iV(e,t){let n=e.getTypeMap();for(let r in n){let i=n[r];if(!(0,dN.getNamedType)(i).name.startsWith("__")){if((0,dN.isObjectType)(i)){let s=i.getFields();for(let o in s){let a=s[o];for(let u of a.args)u.defaultValue=t(u.type,u.defaultValue)}}else if((0,dN.isInputObjectType)(i)){let s=i.getFields();for(let o in s){let a=s[o];a.defaultValue=t(a.type,a.defaultValue)}}}}}hm.forEachDefaultValue=iV});var mN=L(Tm=>{"use strict";d();f();p();Object.defineProperty(Tm,"__esModule",{value:!0});Tm.addTypes=void 0;var pN=(ne(),se(ce)),fN=rN(),sV=um();function oV(e,t){let n=e.toConfig(),r={};for(let a of n.types)r[a.name]=a;let i={};for(let a of n.directives)i[a.name]=a;for(let a of t)(0,pN.isNamedType)(a)?r[a.name]=a:(0,pN.isDirective)(a)&&(i[a.name]=a);let{typeMap:s,directives:o}=(0,sV.rewireTypes)(r,Object.values(i));return new pN.GraphQLSchema(M(A({},n),{query:(0,fN.getObjectTypeFromTypeMap)(s,e.getQueryType()),mutation:(0,fN.getObjectTypeFromTypeMap)(s,e.getMutationType()),subscription:(0,fN.getObjectTypeFromTypeMap)(s,e.getSubscriptionType()),types:Object.values(s),directives:o}))}Tm.addTypes=oV});var BO=L(Em=>{"use strict";d();f();p();Object.defineProperty(Em,"__esModule",{value:!0});Em.pruneSchema=void 0;var Nn=(ne(),se(ce)),aV=Vu(),uV=Da(),cV=dd(),lV=jE();function dV(e,t={}){let{skipEmptyCompositeTypePruning:n,skipEmptyUnionPruning:r,skipPruning:i,skipUnimplementedInterfacesPruning:s,skipUnusedTypesPruning:o}=t,a=[],u=e;do{let c=pV(u);if(i){let l=[];for(let m in u.getTypeMap()){if(m.startsWith("__"))continue;let h=u.getType(m);h&&i(h)&&l.push(m)}c=CO(l,u,c)}a=[],u=(0,aV.mapSchema)(u,{[uV.MapperKind.TYPE]:l=>!c.has(l.name)&&!(0,Nn.isSpecifiedScalarType)(l)?((0,Nn.isUnionType)(l)||(0,Nn.isInputObjectType)(l)||(0,Nn.isInterfaceType)(l)||(0,Nn.isObjectType)(l)||(0,Nn.isScalarType)(l))&&(o||(0,Nn.isUnionType)(l)&&r&&!Object.keys(l.getTypes()).length||((0,Nn.isInputObjectType)(l)||(0,Nn.isInterfaceType)(l)||(0,Nn.isObjectType)(l))&&n&&!Object.keys(l.getFields()).length||(0,Nn.isInterfaceType)(l)&&s)?l:(a.push(l.name),c.delete(l.name),null):l})}while(a.length);return u}Em.pruneSchema=dV;function pV(e){let t=[];for(let n of(0,cV.getRootTypes)(e))t.push(n.name);return CO(t,e)}function CO(e,t,n=new Set){let r=new Map;for(;e.length;){let i=e.pop();if(n.has(i)&&r[i]!==!0)continue;let s=t.getType(i);if(s){if((0,Nn.isUnionType)(s)&&e.push(...s.getTypes().map(o=>o.name)),(0,Nn.isInterfaceType)(s)&&r[i]===!0&&(e.push(...(0,lV.getImplementingTypes)(s.name,t)),r[i]=!1),(0,Nn.isEnumType)(s)&&e.push(...s.getValues().flatMap(o=>o.astNode?ym(t,o.astNode):[])),"getInterfaces"in s&&e.push(...s.getInterfaces().map(o=>o.name)),"getFields"in s){let o=s.getFields(),a=Object.entries(o);if(!a.length)continue;for(let[,u]of a){(0,Nn.isObjectType)(s)&&e.push(...u.args.flatMap(l=>{let m=[(0,Nn.getNamedType)(l.type).name];return l.astNode&&m.push(...ym(t,l.astNode)),m}));let c=(0,Nn.getNamedType)(u.type);e.push(c.name),u.astNode&&e.push(...ym(t,u.astNode)),(0,Nn.isInterfaceType)(c)&&!(c.name in r)&&(r[c.name]=!0)}}s.astNode&&e.push(...ym(t,s.astNode)),n.add(i)}}return n}function ym(e,t){var n;return((n=t.directives)!=null?n:[]).flatMap(r=>{var i,s;return(s=(i=e.getDirective(r.name.value))==null?void 0:i.args.map(o=>(0,Nn.getNamedType)(o.type).name))!=null?s:[]})}});var VO=L(Nm=>{"use strict";d();f();p();Object.defineProperty(Nm,"__esModule",{value:!0});Nm.mergeDeep=void 0;var fV=cd();function $O(e,t=!1){let n=e[0]||{},r={};t&&Object.setPrototypeOf(r,Object.create(Object.getPrototypeOf(n)));for(let i of e)if(hN(n)&&hN(i)){if(t){let s=Object.getPrototypeOf(r),o=Object.getPrototypeOf(i);if(o)for(let a of Object.getOwnPropertyNames(o)){let u=Object.getOwnPropertyDescriptor(o,a);(0,fV.isSome)(u)&&Object.defineProperty(s,a,u)}}for(let s in i)hN(i[s])?s in r?r[s]=$O([r[s],i[s]],t):Object.assign(r,{[s]:i[s]}):Object.assign(r,{[s]:i[s]})}return r}Nm.mergeDeep=$O;function hN(e){return e&&typeof e=="object"&&!Array.isArray(e)}});var jO=L(gm=>{"use strict";d();f();p();Object.defineProperty(gm,"__esModule",{value:!0});gm.parseSelectionSet=void 0;var mV=(ne(),se(ce));function hV(e,t){return(0,mV.parse)(e,t).definitions[0].selectionSet}gm.parseSelectionSet=hV});var GO=L(Im=>{"use strict";d();f();p();Object.defineProperty(Im,"__esModule",{value:!0});Im.getResponseKeyFromInfo=void 0;function TV(e){return e.fieldNodes[0].alias!=null?e.fieldNodes[0].alias.value:e.fieldName}Im.getResponseKeyFromInfo=TV});var qO=L($i=>{"use strict";d();f();p();Object.defineProperty($i,"__esModule",{value:!0});$i.modifyObjectFields=$i.selectObjectFields=$i.removeObjectFields=$i.appendObjectFields=void 0;var vm=(ne(),se(ce)),_m=Da(),Aa=Vu(),yV=mN();function EV(e,t,n){return e.getType(t)==null?(0,yV.addTypes)(e,[new vm.GraphQLObjectType({name:t,fields:n})]):(0,Aa.mapSchema)(e,{[_m.MapperKind.OBJECT_TYPE]:r=>{if(r.name===t){let i=r.toConfig(),s=i.fields,o={};for(let a in s)o[a]=s[a];for(let a in n)o[a]=n[a];return(0,Aa.correctASTNodes)(new vm.GraphQLObjectType(M(A({},i),{fields:o})))}}})}$i.appendObjectFields=EV;function NV(e,t,n){let r={};return[(0,Aa.mapSchema)(e,{[_m.MapperKind.OBJECT_TYPE]:s=>{if(s.name===t){let o=s.toConfig(),a=o.fields,u={};for(let c in a){let l=a[c];n(c,l)?r[c]=l:u[c]=l}return(0,Aa.correctASTNodes)(new vm.GraphQLObjectType(M(A({},o),{fields:u})))}}}),r]}$i.removeObjectFields=NV;function gV(e,t,n){let r={};return(0,Aa.mapSchema)(e,{[_m.MapperKind.OBJECT_TYPE]:i=>{if(i.name===t){let o=i.toConfig().fields;for(let a in o){let u=o[a];n(a,u)&&(r[a]=u)}}}}),r}$i.selectObjectFields=gV;function IV(e,t,n,r){let i={};return[(0,Aa.mapSchema)(e,{[_m.MapperKind.OBJECT_TYPE]:o=>{if(o.name===t){let a=o.toConfig(),u=a.fields,c={};for(let l in u){let m=u[l];n(l,m)?i[l]=m:c[l]=m}for(let l in r){let m=r[l];c[l]=m}return(0,Aa.correctASTNodes)(new vm.GraphQLObjectType(M(A({},a),{fields:c})))}}}),i]}$i.modifyObjectFields=IV});var KO=L(bm=>{"use strict";d();f();p();Object.defineProperty(bm,"__esModule",{value:!0});bm.renameType=void 0;var jr=(ne(),se(ce));function vV(e,t){if((0,jr.isObjectType)(e))return new jr.GraphQLObjectType(M(A({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:M(A({},e.astNode),{name:M(A({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>M(A({},n),{name:M(A({},n.name),{value:t})}))}));if((0,jr.isInterfaceType)(e))return new jr.GraphQLInterfaceType(M(A({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:M(A({},e.astNode),{name:M(A({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>M(A({},n),{name:M(A({},n.name),{value:t})}))}));if((0,jr.isUnionType)(e))return new jr.GraphQLUnionType(M(A({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:M(A({},e.astNode),{name:M(A({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>M(A({},n),{name:M(A({},n.name),{value:t})}))}));if((0,jr.isInputObjectType)(e))return new jr.GraphQLInputObjectType(M(A({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:M(A({},e.astNode),{name:M(A({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>M(A({},n),{name:M(A({},n.name),{value:t})}))}));if((0,jr.isEnumType)(e))return new jr.GraphQLEnumType(M(A({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:M(A({},e.astNode),{name:M(A({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>M(A({},n),{name:M(A({},n.name),{value:t})}))}));if((0,jr.isScalarType)(e))return new jr.GraphQLScalarType(M(A({},e.toConfig()),{name:t,astNode:e.astNode==null?e.astNode:M(A({},e.astNode),{name:M(A({},e.astNode.name),{value:t})}),extensionASTNodes:e.extensionASTNodes==null?e.extensionASTNodes:e.extensionASTNodes.map(n=>M(A({},n),{name:M(A({},n.name),{value:t})}))}));throw new Error(`Unknown type ${e}.`)}bm.renameType=vV});var JO=L(Sm=>{"use strict";d();f();p();Object.defineProperty(Sm,"__esModule",{value:!0});Sm.mapAsyncIterator=void 0;function _V(e,t,n){let r,i;typeof e.return=="function"&&(r=e.return,i=a=>{let u=()=>Promise.reject(a);return r.call(e).then(u,u)});function s(a){return a.done?a:QO(a.value,t).then(YO,i)}let o;if(n){let a=n;o=u=>QO(u,a).then(YO,i)}return{next(){return e.next().then(s,o)},return(){return r?r.call(e).then(s,o):Promise.resolve({value:void 0,done:!0})},throw(a){return typeof e.throw=="function"?e.throw(a).then(s,o):Promise.reject(a).catch(i)},[Symbol.asyncIterator](){return this}}}Sm.mapAsyncIterator=_V;function QO(e,t){return new Promise(n=>n(t(e)))}function YO(e){return{value:e,done:!1}}});var zO=L(Gu=>{"use strict";d();f();p();Object.defineProperty(Gu,"__esModule",{value:!0});Gu.createVariableNameGenerator=Gu.updateArgument=void 0;var wa=(ne(),se(ce)),bV=qE();function SV(e,t,n,r,i,s,o){if(e[r]={kind:wa.Kind.ARGUMENT,name:{kind:wa.Kind.NAME,value:r},value:{kind:wa.Kind.VARIABLE,name:{kind:wa.Kind.NAME,value:i}}},t[i]={kind:wa.Kind.VARIABLE_DEFINITION,variable:{kind:wa.Kind.VARIABLE,name:{kind:wa.Kind.NAME,value:i}},type:(0,bV.astFromType)(s)},o!==void 0){n[i]=o;return}i in n&&delete n[i]}Gu.updateArgument=SV;function DV(e){let t=0;return n=>{let r;do r=`_v${(t++).toString()}_${n}`;while(r in e);return r}}Gu.createVariableNameGenerator=DV});var XO=L(Dm=>{"use strict";d();f();p();Object.defineProperty(Dm,"__esModule",{value:!0});Dm.implementsAbstractType=void 0;var TN=(ne(),se(ce));function OV(e,t,n){return n==null||t==null?!1:t===n?!0:(0,TN.isCompositeType)(t)&&(0,TN.isCompositeType)(n)?(0,TN.doTypesOverlap)(e,t,n):!1}Dm.implementsAbstractType=OV});var HO=L(Om=>{"use strict";d();f();p();Object.defineProperty(Om,"__esModule",{value:!0});Om.observableToAsyncIterable=void 0;function AV(e){let t=[],n=[],r=!0,i=l=>{t.length!==0?t.shift()({value:l,done:!1}):n.push({value:l,done:!1})},s=l=>{t.length!==0?t.shift()({value:{errors:[l]},done:!1}):n.push({value:{errors:[l]},done:!1})},o=()=>{t.length!==0?t.shift()({done:!0}):n.push({done:!0})},a=()=>new Promise(l=>{if(n.length!==0){let m=n.shift();l(m)}else t.push(l)}),u=e.subscribe({next(l){i(l)},error(l){s(l)},complete(){o()}}),c=()=>{if(r){r=!1,u.unsubscribe();for(let l of t)l({value:void 0,done:!0});t.length=0,n.length=0}};return{next(){return r?a():this.return()},return(){return c(),Promise.resolve({value:void 0,done:!0})},throw(l){return c(),Promise.reject(l)},[Symbol.asyncIterator](){return this}}}Om.observableToAsyncIterable=AV});var yN=L(qu=>{"use strict";d();f();p();Object.defineProperty(qu,"__esModule",{value:!0});qu.getOperationASTFromRequest=qu.getOperationASTFromDocument=void 0;var wV=(ne(),se(ce)),FV=Pu();function WO(e,t){let n=(0,wV.getOperationAST)(e,t);if(!n)throw new Error(`Cannot infer operation ${t||""}`);return n}qu.getOperationASTFromDocument=WO;qu.getOperationASTFromRequest=(0,FV.memoize1)(function(t){return WO(t.document,t.operationName)})});var EN=L(Ku=>{"use strict";d();f();p();Object.defineProperty(Ku,"__esModule",{value:!0});Ku.GraphQLStreamDirective=Ku.GraphQLDeferDirective=void 0;var Gr=(ne(),se(ce));Ku.GraphQLDeferDirective=new Gr.GraphQLDirective({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[Gr.DirectiveLocation.FRAGMENT_SPREAD,Gr.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new Gr.GraphQLNonNull(Gr.GraphQLBoolean),description:"Deferred when true or undefined.",defaultValue:!0},label:{type:Gr.GraphQLString,description:"Unique name"}}});Ku.GraphQLStreamDirective=new Gr.GraphQLDirective({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[Gr.DirectiveLocation.FIELD],args:{if:{type:new Gr.GraphQLNonNull(Gr.GraphQLBoolean),description:"Stream when true or undefined.",defaultValue:!0},label:{type:Gr.GraphQLString,description:"Unique name"},initialCount:{defaultValue:0,type:Gr.GraphQLInt,description:"Number of items to return immediately"}}})});var ZO=L(Am=>{"use strict";d();f();p();Object.defineProperty(Am,"__esModule",{value:!0});Am.AccumulatorMap=void 0;var NN=class extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(t,n){let r=this.get(t);r===void 0?this.set(t,[n]):r.push(n)}};Am.AccumulatorMap=NN});var vN=L(mr=>{"use strict";d();f();p();Object.defineProperty(mr,"__esModule",{value:!0});mr.collectSubFields=mr.getDeferValues=mr.getFieldEntryKey=mr.doesFragmentConditionMatch=mr.shouldIncludeNode=mr.collectFields=void 0;var LV=Pu(),Vi=(ne(),se(ce)),RV=EN(),Fm=ZO();function Qu(e,t,n,r,i,s,o,a){for(let u of i.selections)switch(u.kind){case Vi.Kind.FIELD:{if(!wm(n,u))continue;s.add(eA(u),u);break}case Vi.Kind.INLINE_FRAGMENT:{if(!wm(n,u)||!gN(e,u,r))continue;let c=IN(n,u);if(c){let l=new Fm.AccumulatorMap;Qu(e,t,n,r,u.selectionSet,l,o,a),o.push({label:c.label,fields:l})}else Qu(e,t,n,r,u.selectionSet,s,o,a);break}case Vi.Kind.FRAGMENT_SPREAD:{let c=u.name.value;if(!wm(n,u))continue;let l=IN(n,u);if(a.has(c)&&!l)continue;let m=t[c];if(!m||!gN(e,m,r))continue;if(l||a.add(c),l){let h=new Fm.AccumulatorMap;Qu(e,t,n,r,m.selectionSet,h,o,a),o.push({label:l.label,fields:h})}else Qu(e,t,n,r,m.selectionSet,s,o,a);break}}}function kV(e,t,n,r,i){let s=new Fm.AccumulatorMap,o=[];return Qu(e,t,n,r,i,s,o,new Set),{fields:s,patches:o}}mr.collectFields=kV;function wm(e,t){let n=(0,Vi.getDirectiveValues)(Vi.GraphQLSkipDirective,t,e);if((n==null?void 0:n.if)===!0)return!1;let r=(0,Vi.getDirectiveValues)(Vi.GraphQLIncludeDirective,t,e);return(r==null?void 0:r.if)!==!1}mr.shouldIncludeNode=wm;function gN(e,t,n){let r=t.typeCondition;if(!r)return!0;let i=(0,Vi.typeFromAST)(e,r);return i===n?!0:(0,Vi.isAbstractType)(i)?e.getPossibleTypes(i).includes(n):!1}mr.doesFragmentConditionMatch=gN;function eA(e){return e.alias?e.alias.value:e.name.value}mr.getFieldEntryKey=eA;function IN(e,t){let n=(0,Vi.getDirectiveValues)(RV.GraphQLDeferDirective,t,e);if(n&&n.if!==!1)return{label:typeof n.label=="string"?n.label:void 0}}mr.getDeferValues=IN;mr.collectSubFields=(0,LV.memoize5)(function(t,n,r,i,s){let o=new Fm.AccumulatorMap,a=new Set,u=[],c={fields:o,patches:u};for(let l of s)l.selectionSet&&Qu(t,n,r,i,l.selectionSet,o,u,a);return c})});var rA=L(ko=>{"use strict";d();f();p();Object.defineProperty(ko,"__esModule",{value:!0});ko.visitResult=ko.visitErrors=ko.visitData=void 0;var xV=yN(),Ro=(ne(),se(ce)),_N=vN();function bN(e,t,n){if(Array.isArray(e))return e.map(r=>bN(r,t,n));if(typeof e=="object"){let r=t!=null?t(e):e;if(r!=null)for(let i in r){let s=r[i];Object.defineProperty(r,i,{value:bN(s,t,n)})}return n!=null?n(r):r}return e}ko.visitData=bN;function PV(e,t){return e.map(n=>t(n))}ko.visitErrors=PV;function MV(e,t,n,r,i){let s=t.document.definitions.reduce((h,E)=>(E.kind===Ro.Kind.FRAGMENT_DEFINITION&&(h[E.name.value]=E),h),{}),o=t.variables||{},a={segmentInfoMap:new Map,unpathedErrors:new Set},u=e.data,c=e.errors,l=c!=null&&i!=null,m=(0,xV.getOperationASTFromRequest)(t);return u!=null&&m!=null&&(e.data=BV(u,m,n,s,o,r,l?c:void 0,a)),c!=null&&i&&(e.errors=UV(c,i,a)),e}ko.visitResult=MV;function UV(e,t,n){let r=n.segmentInfoMap,i=n.unpathedErrors,s=t.__unpathed;return e.map(o=>{let a=r.get(o),u=a==null?o:a.reduceRight((c,l)=>{let m=l.type.name,h=t[m];if(h==null)return c;let E=h[l.fieldName];return E==null?c:E(c,l.pathIndex)},o);return s&&i.has(o)?s(u):u})}function CV(e,t){switch(t.operation){case"query":return e.getQueryType();case"mutation":return e.getMutationType();case"subscription":return e.getSubscriptionType()}}function BV(e,t,n,r,i,s,o,a){let u=CV(n,t),{fields:c}=(0,_N.collectFields)(n,r,i,u,t.selectionSet);return SN(e,u,c,n,r,i,s,0,o,a)}function SN(e,t,n,r,i,s,o,a,u,c){var Y;let l=t.getFields(),m=o==null?void 0:o[t.name],h=m==null?void 0:m.__enter,E=h!=null?h(e):e,N,D=null;if(u!=null){N=VV(u,a),D=N.errorMap;for(let Q of N.unpathedErrors)c.unpathedErrors.add(Q)}for(let[Q,W]of n){let Ie=W[0].name.value,Qe=(Y=l[Ie])==null?void 0:Y.type;if(Qe==null)switch(Ie){case"__typename":Qe=Ro.TypeNameMetaFieldDef.type;break;case"__schema":Qe=Ro.SchemaMetaFieldDef.type;break;case"__type":Qe=Ro.TypeMetaFieldDef.type;break}let et=a+1,Pt;D&&(Pt=D[Q],Pt!=null&&delete D[Q],jV(t,Ie,et,Pt,c));let X=nA(e[Q],Qe,W,r,i,s,o,et,Pt,c);tA(E,Q,X,m,Ie)}let w=E.__typename;if(w!=null&&tA(E,"__typename",w,m,"__typename"),D)for(let Q in D){let W=D[Q];for(let Ie of W)c.unpathedErrors.add(Ie)}let x=m==null?void 0:m.__leave;return x!=null?x(E):E}function tA(e,t,n,r,i){if(r==null){e[t]=n;return}let s=r[i];if(s==null){e[t]=n;return}let o=s(n);if(o===void 0){delete e[t];return}e[t]=o}function $V(e,t,n,r,i,s,o,a,u,c){return e.map(l=>nA(l,t,n,r,i,s,o,a+1,u,c))}function nA(e,t,n,r,i,s,o,a,u=[],c){if(e==null)return e;let l=(0,Ro.getNullableType)(t);if((0,Ro.isListType)(l))return $V(e,l.ofType,n,r,i,s,o,a,u,c);if((0,Ro.isAbstractType)(l)){let E=r.getType(e.__typename),{fields:N}=(0,_N.collectSubFields)(r,i,s,E,n);return SN(e,E,N,r,i,s,o,a,u,c)}else if((0,Ro.isObjectType)(l)){let{fields:E}=(0,_N.collectSubFields)(r,i,s,l,n);return SN(e,l,E,r,i,s,o,a,u,c)}let m=o==null?void 0:o[l.name];if(m==null)return e;let h=m(e);return h===void 0?e:h}function VV(e,t){var i;let n=Object.create(null),r=new Set;for(let s of e){let o=(i=s.path)==null?void 0:i[t];if(o==null){r.add(s);continue}o in n?n[o].push(s):n[o]=[s]}return{errorMap:n,unpathedErrors:r}}function jV(e,t,n,r=[],i){for(let s of r){let o={type:e,fieldName:t,pathIndex:n},a=i.segmentInfoMap.get(s);a==null?i.segmentInfoMap.set(s,[o]):a.push(o)}}});var iA=L(Lm=>{"use strict";d();f();p();Object.defineProperty(Lm,"__esModule",{value:!0});Lm.valueMatchesCriteria=void 0;function DN(e,t){return e==null?e===t:Array.isArray(e)?Array.isArray(t)&&e.every((n,r)=>DN(n,t[r])):typeof e=="object"?typeof t=="object"&&t&&Object.keys(t).every(n=>DN(e[n],t[n])):t instanceof RegExp?t.test(e):e===t}Lm.valueMatchesCriteria=DN});var sA=L(Rm=>{"use strict";d();f();p();Object.defineProperty(Rm,"__esModule",{value:!0});Rm.isAsyncIterable=void 0;function GV(e){return typeof e=="object"&&e!=null&&Symbol.asyncIterator in e&&typeof e[Symbol.asyncIterator]=="function"}Rm.isAsyncIterable=GV});var oA=L(km=>{"use strict";d();f();p();Object.defineProperty(km,"__esModule",{value:!0});km.isDocumentNode=void 0;var qV=(ne(),se(ce));function KV(e){return e&&typeof e=="object"&&"kind"in e&&e.kind===qV.Kind.DOCUMENT}km.isDocumentNode=KV});var aA=L(()=>{"use strict";d();f();p()});var dA=L(xo=>{"use strict";d();f();p();Object.defineProperty(xo,"__esModule",{value:!0});xo.withCancel=xo.getAsyncIterableWithCancel=xo.getAsyncIteratorWithCancel=void 0;var QV=Pu();function YV(e){return nr(this,null,function*(){return{value:e,done:!0}})}var uA=(0,QV.memoize2)(function(t,n){return function(...i){return Reflect.apply(n,t,i)}});function cA(e,t){return new Proxy(e,{has(n,r){return r==="return"?!0:Reflect.has(n,r)},get(n,r,i){let s=Reflect.get(n,r,i);if(r==="return"){let o=s||YV;return function(u){return nr(this,null,function*(){let c=yield t(u);return Reflect.apply(o,n,[c])})}}else if(typeof s=="function")return uA(n,s);return s}})}xo.getAsyncIteratorWithCancel=cA;function lA(e,t){return new Proxy(e,{get(n,r,i){let s=Reflect.get(n,r,i);return Symbol.asyncIterator===r?function(){let a=Reflect.apply(s,n,[]);return cA(a,t)}:typeof s=="function"?uA(n,s):s}})}xo.getAsyncIterableWithCancel=lA;xo.withCancel=lA});var pA=L(xm=>{"use strict";d();f();p();Object.defineProperty(xm,"__esModule",{value:!0});xm.fixSchemaAst=void 0;var JV=(ne(),se(ce)),zV=HE();function XV(e,t){let n=(0,zV.getDocumentNodeFromSchema)(e);return(0,JV.buildASTSchema)(n,A({},t||{}))}function HV(e,t){let n;return(!e.astNode||!e.extensionASTNodes)&&(n=XV(e,t)),!e.astNode&&(n!=null&&n.astNode)&&(e.astNode=n.astNode),!e.extensionASTNodes&&(n!=null&&n.astNode)&&(e.extensionASTNodes=n.extensionASTNodes),e}xm.fixSchemaAst=HV});var fA=L(Pm=>{"use strict";d();f();p();Object.defineProperty(Pm,"__esModule",{value:!0});Pm.extractExtensionsFromSchema=void 0;var WV=Vu(),hs=Da();function ZV(e){let t={schemaExtensions:e.extensions||{},types:{}};return(0,WV.mapSchema)(e,{[hs.MapperKind.OBJECT_TYPE]:n=>(t.types[n.name]={fields:{},type:"object",extensions:n.extensions||{}},n),[hs.MapperKind.INTERFACE_TYPE]:n=>(t.types[n.name]={fields:{},type:"interface",extensions:n.extensions||{}},n),[hs.MapperKind.FIELD]:(n,r,i)=>{t.types[i].fields[r]={arguments:{},extensions:n.extensions||{}};let s=n.args;if(s!=null)for(let o in s)t.types[i].fields[r].arguments[o]=s[o].extensions||{};return n},[hs.MapperKind.ENUM_TYPE]:n=>(t.types[n.name]={values:{},type:"enum",extensions:n.extensions||{}},n),[hs.MapperKind.ENUM_VALUE]:(n,r,i,s)=>(t.types[r].values[s]=n.extensions||{},n),[hs.MapperKind.SCALAR_TYPE]:n=>(t.types[n.name]={type:"scalar",extensions:n.extensions||{}},n),[hs.MapperKind.UNION_TYPE]:n=>(t.types[n.name]={type:"union",extensions:n.extensions||{}},n),[hs.MapperKind.INPUT_OBJECT_TYPE]:n=>(t.types[n.name]={fields:{},type:"input",extensions:n.extensions||{}},n),[hs.MapperKind.INPUT_OBJECT_FIELD]:(n,r,i)=>(t.types[i].fields[r]={extensions:n.extensions||{}},n)}),t}Pm.extractExtensionsFromSchema=ZV});var mA=L(Po=>{"use strict";d();f();p();Object.defineProperty(Po,"__esModule",{value:!0});Po.printPathArray=Po.pathToArray=Po.addPath=void 0;function ej(e,t,n){return{prev:e,key:t,typename:n}}Po.addPath=ej;function tj(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}Po.pathToArray=tj;function nj(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}Po.printPathArray=nj});var li=L(be=>{"use strict";d();f();p();Object.defineProperty(be,"__esModule",{value:!0});var Ae=(Bf(),se(Cf));Ae.__exportStar(DD(),be);Ae.__exportStar(cd(),be);Ae.__exportStar(BE(),be);Ae.__exportStar($E(),be);Ae.__exportStar(CD(),be);Ae.__exportStar(jE(),be);Ae.__exportStar(HE(),be);Ae.__exportStar($E(),be);Ae.__exportStar(eO(),be);Ae.__exportStar(tO(),be);Ae.__exportStar(mO(),be);Ae.__exportStar(vO(),be);Ae.__exportStar(bO(),be);Ae.__exportStar(LO(),be);Ae.__exportStar(kO(),be);Ae.__exportStar(xO(),be);Ae.__exportStar(MO(),be);Ae.__exportStar(UO(),be);Ae.__exportStar(Vu(),be);Ae.__exportStar(mN(),be);Ae.__exportStar(um(),be);Ae.__exportStar(BO(),be);Ae.__exportStar(VO(),be);Ae.__exportStar(Da(),be);Ae.__exportStar(oN(),be);Ae.__exportStar(jO(),be);Ae.__exportStar(GO(),be);Ae.__exportStar(qO(),be);Ae.__exportStar(KO(),be);Ae.__exportStar(aN(),be);Ae.__exportStar(JO(),be);Ae.__exportStar(zO(),be);Ae.__exportStar(XO(),be);Ae.__exportStar(Vf(),be);Ae.__exportStar(HO(),be);Ae.__exportStar(rA(),be);Ae.__exportStar(CE(),be);Ae.__exportStar(iA(),be);Ae.__exportStar(sA(),be);Ae.__exportStar(oA(),be);Ae.__exportStar(Hf(),be);Ae.__exportStar(aA(),be);Ae.__exportStar(dA(),be);Ae.__exportStar(dd(),be);Ae.__exportStar(ZE(),be);Ae.__exportStar(vN(),be);Ae.__exportStar(ld(),be);Ae.__exportStar(Pu(),be);Ae.__exportStar(pA(),be);Ae.__exportStar(yN(),be);Ae.__exportStar(fA(),be);Ae.__exportStar(mA(),be);Ae.__exportStar($f(),be);Ae.__exportStar(EN(),be)});var TA=L(Mm=>{"use strict";d();f();p();Object.defineProperty(Mm,"__esModule",{value:!0});Mm.mergeResolvers=void 0;var rj=li();function hA(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=new Array;for(let i of e)Array.isArray(i)&&(i=hA(i)),typeof i=="object"&&i&&n.push(i);let r=(0,rj.mergeDeep)(n,!0);if(t!=null&&t.exclusions)for(let i of t.exclusions){let[s,o]=i.split(".");!o||o==="*"?delete r[s]:r[s]&&delete r[s][o]}return r}Mm.mergeResolvers=hA});var ON=L(Um=>{"use strict";d();f();p();Object.defineProperty(Um,"__esModule",{value:!0});Um.mergeArguments=void 0;var yA=li();function ij(e,t,n){let r=sj([...t,...e].filter(yA.isSome),n);return n&&n.sort&&r.sort(yA.compareNodes),r}Um.mergeArguments=ij;function sj(e,t){return e.reduce((n,r)=>{let i=n.findIndex(s=>s.name.value===r.name.value);return i===-1?n.concat([r]):(t!=null&&t.reverseArguments||(n[i]=r),n)},[])}});var qr=L(Yu=>{"use strict";d();f();p();Object.defineProperty(Yu,"__esModule",{value:!0});Yu.mergeDirective=Yu.mergeDirectives=void 0;var EA=(ne(),se(ce)),oj=li();function aj(e,t){return!!e.find(n=>n.name.value===t.name.value)}function NA(e,t){var n;return!!((n=t==null?void 0:t[e.name.value])!=null&&n.repeatable)}function uj(e,t){return t.some(({value:n})=>n===e.value)}function gA(e,t){let n=[...t];for(let r of e){let i=n.findIndex(s=>s.name.value===r.name.value);if(i>-1){let s=n[i];if(s.value.kind==="ListValue"){let o=s.value.values,a=r.value.values;s.value.values=fj(o,a,(u,c)=>{let l=u.value;return!l||!c.some(m=>m.value===l)})}else s.value=r.value}else n.push(r)}return n}function cj(e,t){return e.map((n,r,i)=>{let s=i.findIndex(o=>o.name.value===n.name.value);if(s!==r&&!NA(n,t)){let o=i[s];return n.arguments=gA(n.arguments,o.arguments),null}return n}).filter(oj.isSome)}function lj(e=[],t=[],n,r){let i=n&&n.reverseDirectives,s=i?e:t,o=i?t:e,a=cj([...s],r);for(let u of o)if(aj(a,u)&&!NA(u,r)){let c=a.findIndex(m=>m.name.value===u.name.value),l=a[c];a[c].arguments=gA(u.arguments||[],l.arguments||[])}else a.push(u);return a}Yu.mergeDirectives=lj;function dj(e,t){let n=(0,EA.print)(M(A({},e),{description:void 0})),r=(0,EA.print)(M(A({},t),{description:void 0})),i=new RegExp("(directive @w*d*)|( on .*$)","g");if(!(n.replace(i,"")===r.replace(i,"")))throw new Error(`Unable to merge GraphQL directive "${e.name.value}". Existing directive: ${r} Received directive: - ${n}`)}function yK(e,t){return t?(hK(e,t),x(D({},e),{locations:[...t.locations,...e.locations.filter(n=>!dK(n,t.locations))]})):e}wc.mergeDirective=yK;function TK(e,t,n){return e.concat(t.filter(r=>n(r,e)))}});var iv=F(Uh=>{"use strict";d();m();f();Object.defineProperty(Uh,"__esModule",{value:!0});Uh.mergeEnumValues=void 0;var EK=di(),NK=Pi();function gK(e,t,n,r){if(n!=null&&n.consistentEnumMerge){let s=[];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 c=i.get(a);c.description=s.description||c.description,c.directives=(0,EK.mergeDirectives)(s.directives,c.directives,r)}else i.set(a,s)}let o=[...i.values()];return n&&n.sort&&o.sort(NK.compareNodes),o}Uh.mergeEnumValues=gK});var ov=F(jh=>{"use strict";d();m();f();Object.defineProperty(jh,"__esModule",{value:!0});jh.mergeEnum=void 0;var vK=(he(),Te(Ie)),IK=di(),bK=iv();function _K(e,t,n,r){return t?{name:e.name,description:e.description||t.description,kind:n!=null&&n.convertExtensions||e.kind==="EnumTypeDefinition"||t.kind==="EnumTypeDefinition"?"EnumTypeDefinition":"EnumTypeExtension",loc:e.loc,directives:(0,IK.mergeDirectives)(e.directives,t.directives,n,r),values:(0,bK.mergeEnumValues)(e.values,t.values,n)}:n!=null&&n.convertExtensions?x(D({},e),{kind:vK.Kind.ENUM_TYPE_DEFINITION}):e}jh.mergeEnum=_K});var Vh=F(In=>{"use strict";d();m();f();Object.defineProperty(In,"__esModule",{value:!0});In.defaultStringComparator=In.CompareVal=In.printTypeNode=In.isNonNullTypeNode=In.isListTypeNode=In.isWrappingTypeNode=In.extractType=In.isSourceTypes=In.isStringTypes=void 0;var id=(he(),Te(Ie));function OK(e){return typeof e=="string"}In.isStringTypes=OK;function SK(e){return e instanceof id.Source}In.isSourceTypes=SK;function DK(e){let t=e;for(;t.kind===id.Kind.LIST_TYPE||t.kind==="NonNullType";)t=t.type;return t}In.extractType=DK;function AK(e){return e.kind!==id.Kind.NAMED_TYPE}In.isWrappingTypeNode=AK;function HR(e){return e.kind===id.Kind.LIST_TYPE}In.isListTypeNode=HR;function WR(e){return e.kind===id.Kind.NON_NULL_TYPE}In.isNonNullTypeNode=WR;function sv(e){return HR(e)?`[${sv(e.type)}]`:WR(e)?`${sv(e.type)}!`:e.name.value}In.printTypeNode=sv;var ou;(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"})(ou=In.CompareVal||(In.CompareVal={}));function wK(e,t){return e==null&&t==null?ou.A_EQUALS_B:e==null?ou.A_SMALLER_THAN_B:t==null?ou.A_GREATER_THAN_B:et?ou.A_GREATER_THAN_B:ou.A_EQUALS_B}In.defaultStringComparator=wK});var sd=F($h=>{"use strict";d();m();f();Object.defineProperty($h,"__esModule",{value:!0});$h.mergeFields=void 0;var Lr=Vh(),RK=di(),LK=Pi(),FK=rv();function kK(e,t){let n=e.findIndex(r=>r.name.value===t.name.value);return[n>-1?e[n]:null,n]}function PK(e,t,n,r,i){let o=[];if(n!=null&&o.push(...n),t!=null)for(let s of t){let[a,c]=kK(o,s);if(a&&!(r!=null&&r.ignoreFieldConflicts)){let u=(r==null?void 0:r.onFieldTypeConflict)&&r.onFieldTypeConflict(a,s,e,r==null?void 0:r.throwOnConflict)||xK(e,a,s,r==null?void 0:r.throwOnConflict);u.arguments=(0,FK.mergeArguments)(s.arguments||[],a.arguments||[],r),u.directives=(0,RK.mergeDirectives)(s.directives,a.directives,r,i),u.description=s.description||a.description,o[c]=u}else o.push(s)}if(r&&r.sort&&o.sort(LK.compareNodes),r&&r.exclusions){let s=r.exclusions;return o.filter(a=>!s.includes(`${e.name.value}.${a.name.value}`))}return o}$h.mergeFields=PK;function xK(e,t,n,r=!1){let i=(0,Lr.printTypeNode)(t.type),o=(0,Lr.printTypeNode)(n.type);if(i!==o){let s=(0,Lr.extractType)(t.type),a=(0,Lr.extractType)(n.type);if(s.name.value!==a.name.value)throw new 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(!od(t.type,n.type,!r))throw new Error(`Field '${e.name.value}.${t.name.value}' changed type from '${i}' to '${o}'`)}return(0,Lr.isNonNullTypeNode)(n.type)&&!(0,Lr.isNonNullTypeNode)(t.type)&&(t.type=n.type),t}function od(e,t,n=!1){if(!(0,Lr.isWrappingTypeNode)(e)&&!(0,Lr.isWrappingTypeNode)(t))return e.toString()===t.toString();if((0,Lr.isNonNullTypeNode)(t)){let r=(0,Lr.isNonNullTypeNode)(e)?e.type:e;return od(r,t.type)}return(0,Lr.isNonNullTypeNode)(e)?od(t,e,n):(0,Lr.isListTypeNode)(e)?(0,Lr.isListTypeNode)(t)&&od(e.type,t.type)||(0,Lr.isNonNullTypeNode)(t)&&od(e,t.type):!1}});var av=F(Gh=>{"use strict";d();m();f();Object.defineProperty(Gh,"__esModule",{value:!0});Gh.mergeInputType=void 0;var CK=(he(),Te(Ie)),MK=sd(),UK=di();function jK(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n!=null&&n.convertExtensions||e.kind==="InputObjectTypeDefinition"||t.kind==="InputObjectTypeDefinition"?"InputObjectTypeDefinition":"InputObjectTypeExtension",loc:e.loc,fields:(0,MK.mergeFields)(e,e.fields,t.fields,n),directives:(0,UK.mergeDirectives)(e.directives,t.directives,n,r)}}catch(i){throw new Error(`Unable to merge GraphQL input type "${e.name.value}": ${i.message}`)}return n!=null&&n.convertExtensions?x(D({},e),{kind:CK.Kind.INPUT_OBJECT_TYPE_DEFINITION}):e}Gh.mergeInputType=jK});var ad=F(qh=>{"use strict";d();m();f();Object.defineProperty(qh,"__esModule",{value:!0});qh.mergeNamedTypeArray=void 0;var VK=Pi();function $K(e,t){return!!e.find(n=>n.name.value===t.name.value)}function GK(e=[],t=[],n={}){let r=[...t,...e.filter(i=>!$K(t,i))];return n&&n.sort&&r.sort(VK.compareNodes),r}qh.mergeNamedTypeArray=GK});var uv=F(Bh=>{"use strict";d();m();f();Object.defineProperty(Bh,"__esModule",{value:!0});Bh.mergeInterface=void 0;var qK=(he(),Te(Ie)),BK=sd(),KK=di(),QK=ad();function YK(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n!=null&&n.convertExtensions||e.kind==="InterfaceTypeDefinition"||t.kind==="InterfaceTypeDefinition"?"InterfaceTypeDefinition":"InterfaceTypeExtension",loc:e.loc,fields:(0,BK.mergeFields)(e,e.fields,t.fields,n),directives:(0,KK.mergeDirectives)(e.directives,t.directives,n,r),interfaces:e.interfaces?(0,QK.mergeNamedTypeArray)(e.interfaces,t.interfaces,n):void 0}}catch(i){throw new Error(`Unable to merge GraphQL interface "${e.name.value}": ${i.message}`)}return n!=null&&n.convertExtensions?x(D({},e),{kind:qK.Kind.INTERFACE_TYPE_DEFINITION}):e}Bh.mergeInterface=YK});var cv=F(Kh=>{"use strict";d();m();f();Object.defineProperty(Kh,"__esModule",{value:!0});Kh.mergeType=void 0;var JK=(he(),Te(Ie)),zK=sd(),XK=di(),HK=ad();function WK(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n!=null&&n.convertExtensions||e.kind==="ObjectTypeDefinition"||t.kind==="ObjectTypeDefinition"?"ObjectTypeDefinition":"ObjectTypeExtension",loc:e.loc,fields:(0,zK.mergeFields)(e,e.fields,t.fields,n),directives:(0,XK.mergeDirectives)(e.directives,t.directives,n,r),interfaces:(0,HK.mergeNamedTypeArray)(e.interfaces,t.interfaces,n)}}catch(i){throw new Error(`Unable to merge GraphQL type "${e.name.value}": ${i.message}`)}return n!=null&&n.convertExtensions?x(D({},e),{kind:JK.Kind.OBJECT_TYPE_DEFINITION}):e}Kh.mergeType=WK});var lv=F(Qh=>{"use strict";d();m();f();Object.defineProperty(Qh,"__esModule",{value:!0});Qh.mergeScalar=void 0;var ZK=(he(),Te(Ie)),e1=di();function t1(e,t,n,r){return t?{name:e.name,description:e.description||t.description,kind:n!=null&&n.convertExtensions||e.kind==="ScalarTypeDefinition"||t.kind==="ScalarTypeDefinition"?"ScalarTypeDefinition":"ScalarTypeExtension",loc:e.loc,directives:(0,e1.mergeDirectives)(e.directives,t.directives,n,r)}:n!=null&&n.convertExtensions?x(D({},e),{kind:ZK.Kind.SCALAR_TYPE_DEFINITION}):e}Qh.mergeScalar=t1});var dv=F(Yh=>{"use strict";d();m();f();Object.defineProperty(Yh,"__esModule",{value:!0});Yh.mergeUnion=void 0;var pv=(he(),Te(Ie)),n1=di(),r1=ad();function i1(e,t,n,r){return t?{name:e.name,description:e.description||t.description,directives:(0,n1.mergeDirectives)(e.directives,t.directives,n,r),kind:n!=null&&n.convertExtensions||e.kind==="UnionTypeDefinition"||t.kind==="UnionTypeDefinition"?pv.Kind.UNION_TYPE_DEFINITION:pv.Kind.UNION_TYPE_EXTENSION,loc:e.loc,types:(0,r1.mergeNamedTypeArray)(e.types,t.types,n)}:n!=null&&n.convertExtensions?x(D({},e),{kind:pv.Kind.UNION_TYPE_DEFINITION}):e}Yh.mergeUnion=i1});var fv=F(su=>{"use strict";d();m();f();Object.defineProperty(su,"__esModule",{value:!0});su.mergeSchemaDefs=su.DEFAULT_OPERATION_TYPE_NAME_MAP=void 0;var ud=(he(),Te(Ie)),o1=di();su.DEFAULT_OPERATION_TYPE_NAME_MAP={query:"Query",mutation:"Mutation",subscription:"Subscription"};function s1(e=[],t=[]){let n=[];for(let r in su.DEFAULT_OPERATION_TYPE_NAME_MAP){let i=e.find(o=>o.operation===r)||t.find(o=>o.operation===r);i&&n.push(i)}return n}function a1(e,t,n,r){return t?{kind:e.kind===ud.Kind.SCHEMA_DEFINITION||t.kind===ud.Kind.SCHEMA_DEFINITION?ud.Kind.SCHEMA_DEFINITION:ud.Kind.SCHEMA_EXTENSION,description:e.description||t.description,directives:(0,o1.mergeDirectives)(e.directives,t.directives,n,r),operationTypes:s1(e.operationTypes,t.operationTypes)}:n!=null&&n.convertExtensions?x(D({},e),{kind:ud.Kind.SCHEMA_DEFINITION}):e}su.mergeSchemaDefs=a1});var mv=F(mo=>{"use strict";d();m();f();Object.defineProperty(mo,"__esModule",{value:!0});mo.mergeGraphQLNodes=mo.isNamedDefinitionNode=mo.schemaDefSymbol=void 0;var Ir=(he(),Te(Ie)),u1=cv(),c1=ov(),l1=lv(),p1=dv(),d1=av(),f1=uv(),m1=di(),h1=fv(),y1=Pi();mo.schemaDefSymbol="SCHEMA_DEF_SYMBOL";function ZR(e){return"name"in e}mo.isNamedDefinitionNode=ZR;function T1(e,t,n={}){var i,o,s;let r=n;for(let a of e)if(ZR(a)){let c=(i=a.name)==null?void 0:i.value;if(t!=null&&t.commentDescriptions&&(0,y1.collectComment)(a),c==null)continue;if((o=t==null?void 0:t.exclusions)!=null&&o.includes(c+".*")||(s=t==null?void 0:t.exclusions)!=null&&s.includes(c))delete r[c];else switch(a.kind){case Ir.Kind.OBJECT_TYPE_DEFINITION:case Ir.Kind.OBJECT_TYPE_EXTENSION:r[c]=(0,u1.mergeType)(a,r[c],t,n);break;case Ir.Kind.ENUM_TYPE_DEFINITION:case Ir.Kind.ENUM_TYPE_EXTENSION:r[c]=(0,c1.mergeEnum)(a,r[c],t,n);break;case Ir.Kind.UNION_TYPE_DEFINITION:case Ir.Kind.UNION_TYPE_EXTENSION:r[c]=(0,p1.mergeUnion)(a,r[c],t,n);break;case Ir.Kind.SCALAR_TYPE_DEFINITION:case Ir.Kind.SCALAR_TYPE_EXTENSION:r[c]=(0,l1.mergeScalar)(a,r[c],t,n);break;case Ir.Kind.INPUT_OBJECT_TYPE_DEFINITION:case Ir.Kind.INPUT_OBJECT_TYPE_EXTENSION:r[c]=(0,d1.mergeInputType)(a,r[c],t,n);break;case Ir.Kind.INTERFACE_TYPE_DEFINITION:case Ir.Kind.INTERFACE_TYPE_EXTENSION:r[c]=(0,f1.mergeInterface)(a,r[c],t,n);break;case Ir.Kind.DIRECTIVE_DEFINITION:r[c]=(0,m1.mergeDirective)(a,r[c]);break}}else(a.kind===Ir.Kind.SCHEMA_DEFINITION||a.kind===Ir.Kind.SCHEMA_EXTENSION)&&(r[mo.schemaDefSymbol]=(0,h1.mergeSchemaDefs)(a,r[mo.schemaDefSymbol],t));return r}mo.mergeGraphQLNodes=T1});var nL=F(kc=>{"use strict";d();m();f();Object.defineProperty(kc,"__esModule",{value:!0});kc.mergeGraphQLTypes=kc.mergeTypeDefs=void 0;var fi=(he(),Te(Ie)),hv=Vh(),Rc=mv(),Fc=Pi(),eL=fv();function E1(e,t){(0,Fc.resetComments)();let n={kind:fi.Kind.DOCUMENT,definitions:tL(e,D({useSchemaDefinition:!0,forceSchemaDefinition:!1,throwOnConflict:!1,commentDescriptions:!1},t))},r;return t!=null&&t.commentDescriptions?r=(0,Fc.printWithComments)(n):r=n,(0,Fc.resetComments)(),r}kc.mergeTypeDefs=E1;function Lc(e,t,n=[],r=[],i=new Set){if(e&&!i.has(e))if(i.add(e),typeof e=="function")Lc(e(),t,n,r,i);else if(Array.isArray(e))for(let o of e)Lc(o,t,n,r,i);else if((0,fi.isSchema)(e)){let o=(0,Fc.getDocumentNodeFromSchema)(e,t);Lc(o.definitions,t,n,r,i)}else if((0,hv.isStringTypes)(e)||(0,hv.isSourceTypes)(e)){let o=(0,fi.parse)(e,t);Lc(o.definitions,t,n,r,i)}else if(typeof e=="object"&&(0,fi.isDefinitionNode)(e))e.kind===fi.Kind.DIRECTIVE_DEFINITION?n.push(e):r.push(e);else if((0,Fc.isDocumentNode)(e))Lc(e.definitions,t,n,r,i);else throw new Error(`typeDefs must contain only strings, documents, schemas, or functions, got ${typeof e}`);return{allDirectives:n,allNodes:r}}function tL(e,t){var a,c,u;(0,Fc.resetComments)();let{allDirectives:n,allNodes:r}=Lc(e,t),i=(0,Rc.mergeGraphQLNodes)(n,t),o=(0,Rc.mergeGraphQLNodes)(r,t,i);if(t!=null&&t.useSchemaDefinition){let l=o[Rc.schemaDefSymbol]||{kind:fi.Kind.SCHEMA_DEFINITION,operationTypes:[]},p=l.operationTypes;for(let h in eL.DEFAULT_OPERATION_TYPE_NAME_MAP)if(!p.find(N=>N.operation===h)){let N=eL.DEFAULT_OPERATION_TYPE_NAME_MAP[h],O=o[N];O!=null&&O.name!=null&&p.push({kind:fi.Kind.OPERATION_TYPE_DEFINITION,type:{kind:fi.Kind.NAMED_TYPE,name:O.name},operation:h})}((a=l==null?void 0:l.operationTypes)==null?void 0:a.length)!=null&&l.operationTypes.length>0&&(o[Rc.schemaDefSymbol]=l)}t!=null&&t.forceSchemaDefinition&&!((u=(c=o[Rc.schemaDefSymbol])==null?void 0:c.operationTypes)!=null&&u.length)&&(o[Rc.schemaDefSymbol]={kind:fi.Kind.SCHEMA_DEFINITION,operationTypes:[{kind:fi.Kind.OPERATION_TYPE_DEFINITION,operation:"query",type:{kind:fi.Kind.NAMED_TYPE,name:{kind:fi.Kind.NAME,value:"Query"}}}]});let s=Object.values(o);if(t!=null&&t.sort){let l=typeof t.sort=="function"?t.sort:hv.defaultStringComparator;s.sort((p,h)=>{var y,N;return l((y=p.name)==null?void 0:y.value,(N=h.name)==null?void 0:N.value)})}return s}kc.mergeGraphQLTypes=tL});var rL=F(ur=>{"use strict";d();m();f();Object.defineProperty(ur,"__esModule",{value:!0});var Fr=(jm(),Te(Um));Fr.__exportStar(rv(),ur);Fr.__exportStar(di(),ur);Fr.__exportStar(iv(),ur);Fr.__exportStar(ov(),ur);Fr.__exportStar(sd(),ur);Fr.__exportStar(av(),ur);Fr.__exportStar(uv(),ur);Fr.__exportStar(ad(),ur);Fr.__exportStar(mv(),ur);Fr.__exportStar(nL(),ur);Fr.__exportStar(lv(),ur);Fr.__exportStar(cv(),ur);Fr.__exportStar(dv(),ur);Fr.__exportStar(Vh(),ur)});var oL=F(da=>{"use strict";d();m();f();Object.defineProperty(da,"__esModule",{value:!0});da.applyExtensions=da.mergeExtensions=da.extractExtensionsFromSchema=void 0;var iL=Pi(),N1=Pi();Object.defineProperty(da,"extractExtensionsFromSchema",{enumerable:!0,get:function(){return N1.extractExtensionsFromSchema}});function g1(e){return(0,iL.mergeDeep)(e)}da.mergeExtensions=g1;function Pc(e,t){e&&(e.extensions=(0,iL.mergeDeep)([e.extensions||{},t||{}]))}function v1(e,t){Pc(e,t.schemaExtensions);for(let[n,r]of Object.entries(t.types||{})){let i=e.getType(n);if(i){if(Pc(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){Pc(a,s.extensions);for(let[c,u]of Object.entries(s.arguments))Pc(a.args.find(l=>l.name===c),u)}}else if(r.type==="input")for(let[o,s]of Object.entries(r.fields)){let a=i.getFields()[o];Pc(a,s.extensions)}else if(r.type==="enum")for(let[o,s]of Object.entries(r.values)){let a=i.getValue(o);Pc(a,s)}}}return e}da.applyExtensions=v1});var Tv=F(cd=>{"use strict";d();m();f();Object.defineProperty(cd,"__esModule",{value:!0});var yv=(jm(),Te(Um));yv.__exportStar(QR(),cd);yv.__exportStar(rL(),cd);yv.__exportStar(oL(),cd)});var Jh=F(cr=>{"use strict";d();m();f();Object.defineProperty(cr,"__esModule",{value:!0});cr.SCOPE_SCALAR_DEFINITION=cr.FIELD_SET_SCALAR_DEFINITION=cr.VERSION_TWO_DIRECTIVE_DEFINITIONS=cr.BASE_DIRECTIVE_DEFINITIONS=cr.VERSION_TWO_DIRECTIVES=cr.VERSION_ONE_DIRECTIVES=cr.BASE_SCALARS=void 0;var Se=(he(),Te(Ie)),ue=eo(),z=Li();cr.BASE_SCALARS=new Set(["_Any","_Entities","Boolean","Float","ID","Int",z.FIELD_SET_SCALAR,z.SCOPE_SCALAR,z.STRING_SCALAR]);cr.VERSION_ONE_DIRECTIVES=new Set([z.DEPRECATED,z.EXTENDS,z.EXTERNAL,z.KEY,z.PROVIDES,z.REQUIRES,z.SPECIFIED_BY,z.TAG]);cr.VERSION_TWO_DIRECTIVES=new Set([z.AUTHENTICATED,z.COMPOSE_DIRECTIVE,z.LINK,z.OVERRIDE,z.INACCESSIBLE,z.INTERFACE_OBJECT,z.REQUIRES_SCOPES,z.SHAREABLE]);cr.BASE_DIRECTIVE_DEFINITIONS=[{arguments:[{kind:Se.Kind.INPUT_VALUE_DEFINITION,name:(0,ue.stringToNameNode)(z.REASON),type:(0,ue.stringToNamedTypeNode)(z.STRING_SCALAR),defaultValue:{kind:Se.Kind.STRING,value:"No longer supported"}}],kind:Se.Kind.DIRECTIVE_DEFINITION,locations:(0,ue.stringArrayToNameNodeArray)([z.ARGUMENT_DEFINITION_UPPER,z.ENUM_VALUE_UPPER,z.FIELD_DEFINITION_UPPER,z.INPUT_FIELD_DEFINITION_UPPER]),name:(0,ue.stringToNameNode)(z.DEPRECATED),repeatable:!1},{kind:Se.Kind.DIRECTIVE_DEFINITION,locations:(0,ue.stringArrayToNameNodeArray)([z.INTERFACE_UPPER,z.OBJECT_UPPER]),name:(0,ue.stringToNameNode)(z.EXTENDS),repeatable:!1},{kind:Se.Kind.DIRECTIVE_DEFINITION,locations:(0,ue.stringArrayToNameNodeArray)([z.FIELD_DEFINITION_UPPER,z.OBJECT_UPPER]),name:(0,ue.stringToNameNode)(z.EXTERNAL),repeatable:!1},{arguments:[{kind:Se.Kind.INPUT_VALUE_DEFINITION,name:(0,ue.stringToNameNode)(z.TOPIC),type:{kind:Se.Kind.NON_NULL_TYPE,type:(0,ue.stringToNamedTypeNode)(z.STRING_SCALAR)}},{kind:Se.Kind.INPUT_VALUE_DEFINITION,name:(0,ue.stringToNameNode)(z.SOURCE_ID),type:(0,ue.stringToNamedTypeNode)(z.STRING_SCALAR)}],kind:Se.Kind.DIRECTIVE_DEFINITION,locations:[(0,ue.stringToNameNode)(z.FIELD_DEFINITION_UPPER)],name:(0,ue.stringToNameNode)(z.EVENTS_PUBLISH),repeatable:!1},{arguments:[{kind:Se.Kind.INPUT_VALUE_DEFINITION,name:(0,ue.stringToNameNode)(z.TOPIC),type:{kind:Se.Kind.NON_NULL_TYPE,type:(0,ue.stringToNamedTypeNode)(z.STRING_SCALAR)}},{kind:Se.Kind.INPUT_VALUE_DEFINITION,name:(0,ue.stringToNameNode)(z.SOURCE_ID),type:(0,ue.stringToNamedTypeNode)(z.STRING_SCALAR)}],kind:Se.Kind.DIRECTIVE_DEFINITION,locations:[(0,ue.stringToNameNode)(z.FIELD_DEFINITION_UPPER)],name:(0,ue.stringToNameNode)(z.EVENTS_REQUEST),repeatable:!1},{arguments:[{kind:Se.Kind.INPUT_VALUE_DEFINITION,name:(0,ue.stringToNameNode)(z.TOPIC),type:{kind:Se.Kind.NON_NULL_TYPE,type:(0,ue.stringToNamedTypeNode)(z.STRING_SCALAR)}},{kind:Se.Kind.INPUT_VALUE_DEFINITION,name:(0,ue.stringToNameNode)(z.SOURCE_ID),type:(0,ue.stringToNamedTypeNode)(z.STRING_SCALAR)}],kind:Se.Kind.DIRECTIVE_DEFINITION,locations:[(0,ue.stringToNameNode)(z.FIELD_DEFINITION_UPPER)],name:(0,ue.stringToNameNode)(z.EVENTS_SUBSCRIBE),repeatable:!1},{arguments:[{kind:Se.Kind.INPUT_VALUE_DEFINITION,name:(0,ue.stringToNameNode)(z.FIELDS),type:{kind:Se.Kind.NON_NULL_TYPE,type:(0,ue.stringToNamedTypeNode)(z.FIELD_SET_SCALAR)}},{kind:Se.Kind.INPUT_VALUE_DEFINITION,name:(0,ue.stringToNameNode)(z.RESOLVABLE),type:(0,ue.stringToNamedTypeNode)(z.BOOLEAN_TYPE),defaultValue:{kind:Se.Kind.BOOLEAN,value:!0}}],kind:Se.Kind.DIRECTIVE_DEFINITION,locations:(0,ue.stringArrayToNameNodeArray)([z.INTERFACE_UPPER,z.OBJECT_UPPER]),name:(0,ue.stringToNameNode)(z.KEY),repeatable:!0},{arguments:[{kind:Se.Kind.INPUT_VALUE_DEFINITION,name:(0,ue.stringToNameNode)(z.FIELDS),type:{kind:Se.Kind.NON_NULL_TYPE,type:(0,ue.stringToNamedTypeNode)(z.FIELD_SET_SCALAR)}}],kind:Se.Kind.DIRECTIVE_DEFINITION,locations:[(0,ue.stringToNameNode)(z.FIELD_DEFINITION_UPPER)],name:(0,ue.stringToNameNode)(z.PROVIDES),repeatable:!1},{arguments:[{kind:Se.Kind.INPUT_VALUE_DEFINITION,name:(0,ue.stringToNameNode)(z.FIELDS),type:{kind:Se.Kind.NON_NULL_TYPE,type:(0,ue.stringToNamedTypeNode)(z.FIELD_SET_SCALAR)}}],kind:Se.Kind.DIRECTIVE_DEFINITION,locations:[(0,ue.stringToNameNode)(z.FIELD_DEFINITION_UPPER)],name:(0,ue.stringToNameNode)(z.REQUIRES),repeatable:!1},{arguments:[{kind:Se.Kind.INPUT_VALUE_DEFINITION,name:(0,ue.stringToNameNode)(z.URL_LOWER),type:{kind:Se.Kind.NON_NULL_TYPE,type:(0,ue.stringToNamedTypeNode)(z.STRING_SCALAR)}}],kind:Se.Kind.DIRECTIVE_DEFINITION,locations:(0,ue.stringArrayToNameNodeArray)([z.SCALAR_UPPER]),name:(0,ue.stringToNameNode)(z.SPECIFIED_BY),repeatable:!1},{arguments:[{kind:Se.Kind.INPUT_VALUE_DEFINITION,name:(0,ue.stringToNameNode)(z.NAME),type:{kind:Se.Kind.NON_NULL_TYPE,type:(0,ue.stringToNamedTypeNode)(z.STRING_SCALAR)}}],kind:Se.Kind.DIRECTIVE_DEFINITION,locations:(0,ue.stringArrayToNameNodeArray)([z.ARGUMENT_DEFINITION_UPPER,z.ENUM_UPPER,z.ENUM_VALUE_UPPER,z.FIELD_DEFINITION_UPPER,z.INPUT_FIELD_DEFINITION_UPPER,z.INPUT_OBJECT_UPPER,z.INTERFACE_UPPER,z.OBJECT_UPPER,z.SCALAR_UPPER,z.UNION_UPPER]),name:(0,ue.stringToNameNode)(z.TAG),repeatable:!0}];cr.VERSION_TWO_DIRECTIVE_DEFINITIONS=[{kind:Se.Kind.DIRECTIVE_DEFINITION,locations:(0,ue.stringArrayToNameNodeArray)([z.ENUM_UPPER,z.FIELD_DEFINITION_UPPER,z.INTERFACE_UPPER,z.OBJECT_UPPER,z.SCALAR_UPPER]),name:(0,ue.stringToNameNode)(z.AUTHENTICATED),repeatable:!1},{arguments:[{kind:Se.Kind.INPUT_VALUE_DEFINITION,name:(0,ue.stringToNameNode)(z.NAME),type:{kind:Se.Kind.NON_NULL_TYPE,type:(0,ue.stringToNamedTypeNode)(z.STRING_SCALAR)}}],kind:Se.Kind.DIRECTIVE_DEFINITION,locations:(0,ue.stringArrayToNameNodeArray)([z.SCHEMA_UPPER]),name:(0,ue.stringToNameNode)(z.COMPOSE_DIRECTIVE),repeatable:!0},{kind:Se.Kind.DIRECTIVE_DEFINITION,locations:(0,ue.stringArrayToNameNodeArray)([z.ARGUMENT_DEFINITION_UPPER,z.ENUM_UPPER,z.ENUM_VALUE_UPPER,z.FIELD_DEFINITION_UPPER,z.INPUT_FIELD_DEFINITION_UPPER,z.INPUT_OBJECT_UPPER,z.INTERFACE_UPPER,z.OBJECT_UPPER,z.SCALAR_UPPER,z.UNION_UPPER]),name:(0,ue.stringToNameNode)(z.INACCESSIBLE),repeatable:!1},{kind:Se.Kind.DIRECTIVE_DEFINITION,locations:(0,ue.stringArrayToNameNodeArray)([z.OBJECT_UPPER]),name:(0,ue.stringToNameNode)(z.INTERFACE_OBJECT),repeatable:!1},{arguments:[{kind:Se.Kind.INPUT_VALUE_DEFINITION,name:(0,ue.stringToNameNode)(z.URL_LOWER),type:{kind:Se.Kind.NON_NULL_TYPE,type:(0,ue.stringToNamedTypeNode)(z.STRING_SCALAR)}},{kind:Se.Kind.INPUT_VALUE_DEFINITION,name:(0,ue.stringToNameNode)("as"),type:(0,ue.stringToNamedTypeNode)(z.STRING_SCALAR)},{kind:Se.Kind.INPUT_VALUE_DEFINITION,name:(0,ue.stringToNameNode)("for"),type:(0,ue.stringToNamedTypeNode)(z.STRING_SCALAR)},{kind:Se.Kind.INPUT_VALUE_DEFINITION,name:(0,ue.stringToNameNode)("import"),type:{kind:Se.Kind.LIST_TYPE,type:(0,ue.stringToNamedTypeNode)(z.STRING_SCALAR)}}],kind:Se.Kind.DIRECTIVE_DEFINITION,locations:(0,ue.stringArrayToNameNodeArray)([z.SCHEMA_UPPER]),name:(0,ue.stringToNameNode)(z.LINK),repeatable:!0},{arguments:[{kind:Se.Kind.INPUT_VALUE_DEFINITION,name:(0,ue.stringToNameNode)(z.FROM),type:{kind:Se.Kind.NON_NULL_TYPE,type:(0,ue.stringToNamedTypeNode)(z.STRING_SCALAR)}}],kind:Se.Kind.DIRECTIVE_DEFINITION,locations:(0,ue.stringArrayToNameNodeArray)([z.FIELD_DEFINITION_UPPER]),name:(0,ue.stringToNameNode)(z.OVERRIDE),repeatable:!1},{arguments:[{kind:Se.Kind.INPUT_VALUE_DEFINITION,name:(0,ue.stringToNameNode)(z.SCOPES),type:{kind:Se.Kind.NON_NULL_TYPE,type:{kind:Se.Kind.LIST_TYPE,type:{kind:Se.Kind.NON_NULL_TYPE,type:{kind:Se.Kind.LIST_TYPE,type:{kind:Se.Kind.NON_NULL_TYPE,type:(0,ue.stringToNamedTypeNode)(z.SCOPE_SCALAR)}}}}}}],kind:Se.Kind.DIRECTIVE_DEFINITION,locations:(0,ue.stringArrayToNameNodeArray)([z.ENUM_UPPER,z.FIELD_DEFINITION_UPPER,z.INTERFACE_UPPER,z.OBJECT_UPPER,z.SCALAR_UPPER]),name:(0,ue.stringToNameNode)(z.REQUIRES_SCOPES),repeatable:!1},{kind:Se.Kind.DIRECTIVE_DEFINITION,locations:(0,ue.stringArrayToNameNodeArray)([z.FIELD_DEFINITION_UPPER,z.OBJECT_UPPER]),name:(0,ue.stringToNameNode)(z.SHAREABLE),repeatable:!1}];cr.FIELD_SET_SCALAR_DEFINITION={kind:Se.Kind.SCALAR_TYPE_DEFINITION,name:(0,ue.stringToNameNode)(z.FIELD_SET_SCALAR)};cr.SCOPE_SCALAR_DEFINITION={kind:Se.Kind.SCALAR_TYPE_DEFINITION,name:(0,ue.stringToNameNode)(z.SCOPE_SCALAR)}});var gv=F(Ot=>{"use strict";d();m();f();Object.defineProperty(Ot,"__esModule",{value:!0});Ot.isNodeQuery=Ot.validateAndAddDirectivesWithFieldSetToConfigurationData=Ot.getNormalizedFieldSet=Ot.extractFieldSetValue=Ot.addNonExternalFieldsToSet=Ot.getDefinedArgumentsForDirective=Ot.getDirectiveDefinitionArgumentSets=Ot.areNodeKindAndDirectiveLocationCompatible=Ot.unionContainerToNode=Ot.schemaContainerToNode=Ot.scalarContainerToNode=Ot.objectLikeContainerToNode=Ot.inputObjectContainerToNode=Ot.enumContainerToNode=Ot.newFieldSetContainer=void 0;var fe=(he(),Te(Ie)),kr=za(),xc=eo(),Tn=Li(),ld=mc(),pt=Yo(),aL=Jh();function I1(){return{keys:new Set,provides:new Map,requires:new Map}}Ot.newFieldSetContainer=I1;function Ev(e,t,n){let r=[];for(let i of t.values()){let o=`${n}.${i.name}`;e.validateChildDirectives(i,o),r.push(i.node)}return r}function b1(e,t,n){return e.mergeDirectives(t.directives,n),{description:t.description,directives:e.getValidatedAndNormalizedParentDirectives(t),kind:t.kind,name:t.name,values:Ev(e,t.values,t.name.value)}}Ot.enumContainerToNode=b1;function _1(e,t,n){return e.mergeDirectives(t.directives,n),{description:t.description,directives:e.getValidatedAndNormalizedParentDirectives(t),fields:Ev(e,t.fields,t.name.value),kind:t.kind,name:t.name}}Ot.inputObjectContainerToNode=_1;function O1(e,t,n){return e.mergeDirectives(t.directives,n),{description:t.kind===fe.Kind.OBJECT_TYPE_EXTENSION?void 0:t.description,directives:e.getValidatedAndNormalizedParentDirectives(t),fields:Ev(e,t.fields,t.name.value),interfaces:(0,xc.setToNamedTypeNodeArray)(t.interfaces),kind:t.kind,name:t.name}}Ot.objectLikeContainerToNode=O1;function S1(e,t,n){return e.mergeDirectives(t.directives,n),{description:t.description,directives:e.getValidatedAndNormalizedParentDirectives(t),kind:t.kind,name:t.name}}Ot.scalarContainerToNode=S1;function D1(e,t){return{description:t.description,directives:e.getValidatedAndNormalizedParentDirectives(t),kind:t.kind,operationTypes:(0,kr.mapToArrayOfValues)(t.operationTypes)}}Ot.schemaContainerToNode=D1;function A1(e,t,n){return e.mergeUniqueUnionMembers(t,n),e.mergeDirectives(t.directives,n),{description:t.description,directives:e.getValidatedAndNormalizedParentDirectives(t),kind:t.kind,name:t.name,types:(0,kr.mapToArrayOfValues)(t.types)}}Ot.unionContainerToNode=A1;function w1(e,t){for(let n of t.locations){let r=n.value.toUpperCase();switch(r){case Tn.ARGUMENT_DEFINITION_UPPER:if(e===fe.Kind.INPUT_VALUE_DEFINITION)return!0;break;case Tn.ENUM_UPPER:if(e===fe.Kind.ENUM_TYPE_DEFINITION||e===fe.Kind.ENUM_TYPE_EXTENSION)return!0;break;case Tn.ENUM_VALUE_UPPER:if(e===fe.Kind.ENUM_VALUE_DEFINITION)return!0;break;case Tn.FIELD_UPPER:if(e===fe.Kind.FIELD)return!0;break;case Tn.FIELD_DEFINITION_UPPER:if(e===fe.Kind.FIELD_DEFINITION)return!0;break;case Tn.INLINE_FRAGMENT_UPPER:if(e===fe.Kind.INLINE_FRAGMENT)return!0;break;case Tn.INPUT_FIELD_DEFINITION_UPPER:if(e===fe.Kind.INPUT_VALUE_DEFINITION)return!0;break;case Tn.INPUT_OBJECT_UPPER:if(e===fe.Kind.INPUT_OBJECT_TYPE_DEFINITION||e===fe.Kind.INPUT_OBJECT_TYPE_EXTENSION)return!0;break;case Tn.INTERFACE_UPPER:if(e===fe.Kind.INTERFACE_TYPE_DEFINITION||e===fe.Kind.INTERFACE_TYPE_EXTENSION)return!0;break;case Tn.OBJECT_UPPER:if(e===fe.Kind.OBJECT_TYPE_DEFINITION||e===fe.Kind.OBJECT_TYPE_EXTENSION)return!0;break;case Tn.FRAGMENT_DEFINITION_UPPER:if(e===fe.Kind.FRAGMENT_DEFINITION)return!0;break;case Tn.FRAGMENT_SPREAD_UPPER:if(e===fe.Kind.FRAGMENT_SPREAD)return!0;break;case Tn.SCALAR_UPPER:if(e===fe.Kind.SCALAR_TYPE_DEFINITION||e===fe.Kind.SCALAR_TYPE_EXTENSION)return!0;break;case Tn.SCHEMA_UPPER:if(e===fe.Kind.SCHEMA_DEFINITION||e===fe.Kind.SCHEMA_EXTENSION)return!0;break;case Tn.UNION_UPPER:if(e===fe.Kind.UNION_TYPE_DEFINITION||e===fe.Kind.UNION_TYPE_EXTENSION)return!0;break;case Tn.VARIABLE_DEFINITION_UPPER:if(e===fe.Kind.VARIABLE_DEFINITION)return!0;break;case Tn.QUERY_UPPER:case Tn.MUTATION_UPPER:case Tn.SUBSCRIPTION_UPPER:if(e===fe.Kind.OPERATION_DEFINITION)return!0;break;default:throw(0,pt.unexpectedDirectiveLocationError)(r)}}return!1}Ot.areNodeKindAndDirectiveLocationCompatible=w1;function R1(e,t,n){for(let r of e){let i=r.name.value;t.add(i),r.type.kind===fe.Kind.NON_NULL_TYPE&&!r.defaultValue&&n.add(i)}}Ot.getDirectiveDefinitionArgumentSets=R1;function L1(e,t,n,r,i){let o=new Set;for(let s of e){let a=s.name.value;if(!t.has(a)){i.push((0,pt.unexpectedDirectiveArgumentErrorMessage)(n,a));continue}if(o.has(a)){i.push((0,pt.duplicateDirectiveArgumentDefinitionErrorMessage)(n,r,a));continue}o.add(a)}return o}Ot.getDefinedArgumentsForDirective=L1;function F1(e,t){for(let[n,r]of e)r.directives.has(Tn.EXTERNAL)||t.add(n)}Ot.addNonExternalFieldsToSet=F1;function k1(e,t,n){if(!n||n.length>1)return;let r=n[0].arguments;if(!r||r.length!==1)return;let i=r[0];i.name.value!==Tn.FIELDS||i.value.kind!==fe.Kind.STRING||t.set(e,i.value.value)}Ot.extractFieldSetValue=k1;function Nv(e){return(0,fe.print)((0,xc.lexicographicallySortDocumentNode)(e)).replaceAll(/\s+/g," ").slice(2,-2)}Ot.getNormalizedFieldSet=Nv;function P1(e,t,n,r){let{error:i,documentNode:o}=(0,xc.safeParse)("{"+n+"}");if(i||!o)return{errorMessage:(0,pt.unparsableFieldSetErrorMessage)(n,i)};let s,a=[t],c=[],u=-1,l=!0,p=r,h=t.name.value;return(0,fe.visit)(o,{Argument:{enter(y){return!1}},Field:{enter(y){let N=a[u],O=N.name.value;if(N.kind===fe.Kind.UNION_TYPE_DEFINITION)return s=(0,pt.invalidSelectionOnUnionErrorMessage)(n,h,O),fe.BREAK;if(l)return s=(0,pt.invalidSelectionSetErrorMessage)(n,h,O,(0,kr.kindToTypeString)(N.kind)),fe.BREAK;let w=y.name.value;h=`${O}.${w}`,p=w;let M=N.fields.get(w);if(!M)return s=(0,pt.undefinedFieldInFieldSetErrorMessage)(n,O,w),fe.BREAK;if(c[u].has(w))return s=(0,pt.duplicateFieldInFieldSetErrorMessage)(n,h),fe.BREAK;c[u].add(w);let W=(0,ld.getNamedTypeForChild)(h,M.node.type);if(aL.BASE_SCALARS.has(W))return;let K=e.parentContainerByTypeName.get(W)||e.extensionContainerByTypeName.get(W);if(!K)return s=(0,pt.unknownTypeInFieldSetErrorMessage)(n,h,W),fe.BREAK;if(K.kind===fe.Kind.OBJECT_TYPE_DEFINITION||K.kind===fe.Kind.OBJECT_TYPE_EXTENSION||K.kind===fe.Kind.INTERFACE_TYPE_DEFINITION||K.kind===fe.Kind.UNION_TYPE_DEFINITION){l=!0,a.push(K);return}}},InlineFragment:{enter(y){let N=a[u],O=N.name.value;if(!y.typeCondition)return s=(0,pt.inlineFragmentWithoutTypeConditionErrorMessage)(n,h),fe.BREAK;let w=y.typeCondition.name.value;if(w===O){a.push(N),l=!0;return}if(!(0,xc.isKindAbstract)(N.kind))return s=(0,pt.invalidInlineFragmentTypeErrorMessage)(n,h,w,O),fe.BREAK;let M=e.parentContainerByTypeName.get(w)||e.extensionContainerByTypeName.get(w);if(!M)return s=(0,pt.unknownInlineFragmentTypeConditionErrorMessage)(n,h,w),fe.BREAK;if(M.kind!==fe.Kind.INTERFACE_TYPE_DEFINITION&&M.kind!==fe.Kind.OBJECT_TYPE_DEFINITION&&M.kind!==fe.Kind.OBJECT_TYPE_EXTENSION&&M.kind!==fe.Kind.UNION_TYPE_DEFINITION)return s=(0,pt.invalidInlineFragmentTypeConditionTypeErrorMessage)(n,h,w,(0,kr.kindToTypeString)(M.kind)),fe.BREAK;let W=e.abstractToConcreteTypeNames.get(O);if(!W||!W.has(w))return s=(0,pt.invalidInlineFragmentTypeConditionErrorMessage)(n,h,w,(0,kr.kindToTypeString)(N.kind),O),fe.BREAK;l=!0,a.push(M)},leave(){a.pop()}},SelectionSet:{enter(){if(!l){let y=a[u];if(y.kind===fe.Kind.UNION_TYPE_DEFINITION)return s=(0,pt.unparsableFieldSetSelectionErrorMessage)(n,p),fe.BREAK;let N=y.fields.get(p);if(!N)return s=(0,pt.undefinedFieldInFieldSetErrorMessage)(n,h,p),fe.BREAK;let O=(0,ld.getNamedTypeForChild)(h,N.node.type),w=e.parentContainerByTypeName.get(O),M=w?w.kind:fe.Kind.SCALAR_TYPE_DEFINITION;return s=(0,pt.invalidSelectionSetDefinitionErrorMessage)(n,h,O,(0,kr.kindToTypeString)(M)),fe.BREAK}if(u+=1,l=!1,u<0||u>=a.length)return s=(0,pt.unparsableFieldSetSelectionErrorMessage)(n,p),fe.BREAK;c.push(new Set)},leave(){if(l){let y=a[u+1];s=(0,pt.invalidSelectionSetErrorMessage)(n,h,y.name.value,(0,kr.kindToTypeString)(y.kind)),l=!1}u-=1,a.pop(),c.pop()}}}),s?{errorMessage:s}:{configuration:{fieldName:r,selectionSet:Nv(o)}}}function x1(e,t,n,r,i){let o=t.name.value,s=[],a=[],c=new Set;for(let u of n){let{error:l,documentNode:p}=(0,xc.safeParse)("{"+u+"}");if(l||!p){s.push((0,pt.unparsableFieldSetErrorMessage)(u,l));continue}let h=[t],y=[],N=-1,O=!0,w="";(0,fe.visit)(p,{Argument:{enter(M){return s.push((0,pt.unexpectedArgumentErrorMessage)(u,`${h[N].name.value}.${w}`,M.name.value)),fe.BREAK}},Field:{enter(M){let W=h[N-1],K=h[N],te=K.name.value;if(O)return s.push((0,pt.invalidSelectionSetErrorMessage)(u,`${W.name.value}.${w}`,te,(0,kr.kindToTypeString)(K.kind))),fe.BREAK;let pe=M.name.value,qe=`${te}.${pe}`;w=pe;let st=K.fields.get(pe);if(!st)return s.push((0,pt.undefinedFieldInFieldSetErrorMessage)(u,te,pe)),fe.BREAK;if(st.arguments.size)return s.push((0,pt.argumentsInKeyFieldSetErrorMessage)(u,qe)),fe.BREAK;if(y[N].has(pe))return s.push((0,pt.duplicateFieldInFieldSetErrorMessage)(u,qe)),fe.BREAK;y[N].add(pe),N===0&&(c.add(pe),r.add(pe)),(0,kr.getValueOrDefault)(e.keyFieldNamesByParentTypeName,te,()=>new Set).add(pe);let ft=(0,ld.getNamedTypeForChild)(qe,st.node.type);if(aL.BASE_SCALARS.has(ft))return;let L=e.parentContainerByTypeName.get(ft)||e.extensionContainerByTypeName.get(ft);if(!L)return s.push((0,pt.unknownTypeInFieldSetErrorMessage)(u,qe,ft)),fe.BREAK;if(L.kind===fe.Kind.OBJECT_TYPE_DEFINITION||L.kind===fe.Kind.OBJECT_TYPE_EXTENSION){O=!0,h.push(L);return}if((0,xc.isKindAbstract)(L.kind))return s.push((0,pt.abstractTypeInKeyFieldSetErrorMessage)(u,qe,ft,(0,kr.kindToTypeString)(L.kind))),fe.BREAK}},InlineFragment:{enter(){return s.push(pt.inlineFragmentInFieldSetErrorMessage),fe.BREAK}},SelectionSet:{enter(){if(!O){let M=h[N],K=`${M.name.value}.${w}`,te=M.fields.get(w);if(!te)return s.push((0,pt.undefinedFieldInFieldSetErrorMessage)(u,K,w)),fe.BREAK;let pe=(0,ld.getNamedTypeForChild)(K,te.node.type),qe=e.parentContainerByTypeName.get(pe),st=qe?qe.kind:fe.Kind.SCALAR_TYPE_DEFINITION;return s.push((0,pt.invalidSelectionSetDefinitionErrorMessage)(u,K,pe,(0,kr.kindToTypeString)(st))),fe.BREAK}if(N+=1,O=!1,N<0||N>=h.length)return s.push((0,pt.unparsableFieldSetSelectionErrorMessage)(u,w)),fe.BREAK;y.push(new Set)},leave(){if(O){let W=h[N].name.value,K=h[N+1],te=`${W}.${w}`;s.push((0,pt.invalidSelectionSetErrorMessage)(u,te,K.name.value,(0,kr.kindToTypeString)(K.kind))),O=!1}N-=1,h.pop(),y.pop()}}}),s.length||a.push(D({fieldName:"",selectionSet:Nv(p)},i?{disableEntityResolver:!0}:{}))}if(s.length){e.errors.push((0,pt.invalidKeyDirectivesError)(o,s));return}if(a.length)return a}var pd;(function(e){e.PROVIDES="provides",e.REQUIRES="requires"})(pd||(pd={}));function C1(e,t,n,r,i){if(t!==pd.PROVIDES)return e.entityContainerByTypeName.has(i)?{fieldSetParentContainer:n}:{};let o=(0,kr.getOrThrowError)(n.fields,r,`${i}.fields`),s=(0,ld.getNamedTypeForChild)(`${i}.${r}`,o.node.type);if(!e.entityContainerByTypeName.has(s))return{};let a=e.parentContainerByTypeName.get(s)||e.extensionContainerByTypeName.get(s);return!a||a.kind!==fe.Kind.OBJECT_TYPE_DEFINITION&&a.kind!==fe.Kind.OBJECT_TYPE_EXTENSION?{errorString:(0,pt.unknownProvidesEntityErrorMessage)(`${i}.${r}`,s)}:{fieldSetParentContainer:a}}function sL(e,t,n,r){let i=[],o=[],s=t.name.value;for(let[a,c]of n){let{fieldSetParentContainer:u,errorString:l}=C1(e,r,t,a,s),p=`${s}.${a}`;if(l){i.push(l);continue}if(!u)continue;let{errorMessage:h,configuration:y}=P1(e,u,c,a);if(h){i.push(` On "${s}.${a}" \u2014`+h);continue}if(y){o.push(y);continue}throw(0,pt.invalidConfigurationResultFatalError)(p)}if(i.length){e.errors.push((0,pt.invalidProvidesOrRequiresDirectivesError)(r,i));return}if(o.length)return o}function M1(e,t,n){let r=(0,kr.getOrThrowError)(e.configurationDataMap,t.name.value,"configurationDataMap"),i=x1(e,t,n.keys,r.fieldNames,n.disableEntityResolver);i&&(r.keys=i);let o=sL(e,t,n.provides,pd.PROVIDES);o&&(r.provides=o);let s=sL(e,t,n.requires,pd.REQUIRES);s&&(r.requires=s)}Ot.validateAndAddDirectivesWithFieldSetToConfigurationData=M1;function U1(e,t){return e===Tn.QUERY||t===fe.OperationTypeNode.QUERY}Ot.isNodeQuery=U1});var br=F(vv=>{"use strict";d();m();f();Object.defineProperty(vv,"__esModule",{value:!0});vv.devAssert=j1;function j1(e,t){if(!!!e)throw new Error(t)}});var ho=F(Iv=>{"use strict";d();m();f();Object.defineProperty(Iv,"__esModule",{value:!0});Iv.isObjectLike=V1;function V1(e){return typeof e=="object"&&e!==null}});var lr=F(bv=>{"use strict";d();m();f();Object.defineProperty(bv,"__esModule",{value:!0});bv.invariant=$1;function $1(e,t){if(!!!e)throw new Error(t!=null?t:"Unexpected invariant triggered.")}});var zh=F(_v=>{"use strict";d();m();f();Object.defineProperty(_v,"__esModule",{value:!0});_v.getLocation=B1;var G1=lr(),q1=/\r\n|[\n\r]/g;function B1(e,t){let n=0,r=1;for(let i of e.body.matchAll(q1)){if(typeof i.index=="number"||(0,G1.invariant)(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}});var Ov=F(Xh=>{"use strict";d();m();f();Object.defineProperty(Xh,"__esModule",{value:!0});Xh.printLocation=Q1;Xh.printSourceLocation=cL;var K1=zh();function Q1(e){return cL(e.source,(0,K1.getLocation)(e.source,e.start))}function cL(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,c=t.column+a,u=`${e.name}:${s}:${c} -`,l=r.split(/\r\n|[\n\r]/g),p=l[i];if(p.length>120){let h=Math.floor(c/80),y=c%80,N=[];for(let O=0;O["|",O]),["|","^".padStart(y)],["|",N[h+1]]])}return u+uL([[`${s-1} |`,l[i-1]],[`${s} |`,p],["|","^".padStart(c)],[`${s+1} |`,l[i+1]]])}function uL(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(` -`)}});var $e=F(Cc=>{"use strict";d();m();f();Object.defineProperty(Cc,"__esModule",{value:!0});Cc.GraphQLError=void 0;Cc.formatError=X1;Cc.printError=z1;var Y1=ho(),lL=zh(),pL=Ov();function J1(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}var Sv=class e extends Error{constructor(t,...n){var r,i,o;let{nodes:s,source:a,positions:c,path:u,originalError:l,extensions:p}=J1(n);super(t),this.name="GraphQLError",this.path=u!=null?u:void 0,this.originalError=l!=null?l:void 0,this.nodes=dL(Array.isArray(s)?s:s?[s]:void 0);let h=dL((r=this.nodes)===null||r===void 0?void 0:r.map(N=>N.loc).filter(N=>N!=null));this.source=a!=null?a:h==null||(i=h[0])===null||i===void 0?void 0:i.source,this.positions=c!=null?c:h==null?void 0:h.map(N=>N.start),this.locations=c&&a?c.map(N=>(0,lL.getLocation)(a,N)):h==null?void 0:h.map(N=>(0,lL.getLocation)(N.source,N.start));let y=(0,Y1.isObjectLike)(l==null?void 0:l.extensions)?l==null?void 0:l.extensions:void 0;this.extensions=(o=p!=null?p:y)!==null&&o!==void 0?o:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),l!=null&&l.stack?Object.defineProperty(this,"stack",{value:l.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=` + ${n}`)}function pj(e,t){return t?(dj(e,t),M(A({},e),{locations:[...t.locations,...e.locations.filter(n=>!uj(n,t.locations))]})):e}Yu.mergeDirective=pj;function fj(e,t,n){return e.concat(t.filter(r=>n(r,e)))}});var AN=L(Cm=>{"use strict";d();f();p();Object.defineProperty(Cm,"__esModule",{value:!0});Cm.mergeEnumValues=void 0;var mj=qr(),hj=li();function Tj(e,t,n,r){if(n!=null&&n.consistentEnumMerge){let o=[];e&&o.push(...e),e=t,t=o}let i=new Map;if(e)for(let o of e)i.set(o.name.value,o);if(t)for(let o of t){let a=o.name.value;if(i.has(a)){let u=i.get(a);u.description=o.description||u.description,u.directives=(0,mj.mergeDirectives)(o.directives,u.directives,r)}else i.set(a,o)}let s=[...i.values()];return n&&n.sort&&s.sort(hj.compareNodes),s}Cm.mergeEnumValues=Tj});var wN=L(Bm=>{"use strict";d();f();p();Object.defineProperty(Bm,"__esModule",{value:!0});Bm.mergeEnum=void 0;var yj=(ne(),se(ce)),Ej=qr(),Nj=AN();function gj(e,t,n,r){return t?{name:e.name,description:e.description||t.description,kind:n!=null&&n.convertExtensions||e.kind==="EnumTypeDefinition"||t.kind==="EnumTypeDefinition"?"EnumTypeDefinition":"EnumTypeExtension",loc:e.loc,directives:(0,Ej.mergeDirectives)(e.directives,t.directives,n,r),values:(0,Nj.mergeEnumValues)(e.values,t.values,n)}:n!=null&&n.convertExtensions?M(A({},e),{kind:yj.Kind.ENUM_TYPE_DEFINITION}):e}Bm.mergeEnum=gj});var $m=L(an=>{"use strict";d();f();p();Object.defineProperty(an,"__esModule",{value:!0});an.defaultStringComparator=an.CompareVal=an.printTypeNode=an.isNonNullTypeNode=an.isListTypeNode=an.isWrappingTypeNode=an.extractType=an.isSourceTypes=an.isStringTypes=void 0;var Ed=(ne(),se(ce));function Ij(e){return typeof e=="string"}an.isStringTypes=Ij;function vj(e){return e instanceof Ed.Source}an.isSourceTypes=vj;function _j(e){let t=e;for(;t.kind===Ed.Kind.LIST_TYPE||t.kind==="NonNullType";)t=t.type;return t}an.extractType=_j;function bj(e){return e.kind!==Ed.Kind.NAMED_TYPE}an.isWrappingTypeNode=bj;function IA(e){return e.kind===Ed.Kind.LIST_TYPE}an.isListTypeNode=IA;function vA(e){return e.kind===Ed.Kind.NON_NULL_TYPE}an.isNonNullTypeNode=vA;function FN(e){return IA(e)?`[${FN(e.type)}]`:vA(e)?`${FN(e.type)}!`:e.name.value}an.printTypeNode=FN;var Fa;(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"})(Fa=an.CompareVal||(an.CompareVal={}));function Sj(e,t){return e==null&&t==null?Fa.A_EQUALS_B:e==null?Fa.A_SMALLER_THAN_B:t==null?Fa.A_GREATER_THAN_B:et?Fa.A_GREATER_THAN_B:Fa.A_EQUALS_B}an.defaultStringComparator=Sj});var gd=L(Vm=>{"use strict";d();f();p();Object.defineProperty(Vm,"__esModule",{value:!0});Vm.mergeFields=void 0;var hr=$m(),Dj=qr(),Oj=li(),Aj=ON();function wj(e,t){let n=e.findIndex(r=>r.name.value===t.name.value);return[n>-1?e[n]:null,n]}function Fj(e,t,n,r,i){let s=[];if(n!=null&&s.push(...n),t!=null)for(let o of t){let[a,u]=wj(s,o);if(a&&!(r!=null&&r.ignoreFieldConflicts)){let c=(r==null?void 0:r.onFieldTypeConflict)&&r.onFieldTypeConflict(a,o,e,r==null?void 0:r.throwOnConflict)||Lj(e,a,o,r==null?void 0:r.throwOnConflict);c.arguments=(0,Aj.mergeArguments)(o.arguments||[],a.arguments||[],r),c.directives=(0,Dj.mergeDirectives)(o.directives,a.directives,r,i),c.description=o.description||a.description,s[u]=c}else s.push(o)}if(r&&r.sort&&s.sort(Oj.compareNodes),r&&r.exclusions){let o=r.exclusions;return s.filter(a=>!o.includes(`${e.name.value}.${a.name.value}`))}return s}Vm.mergeFields=Fj;function Lj(e,t,n,r=!1){let i=(0,hr.printTypeNode)(t.type),s=(0,hr.printTypeNode)(n.type);if(i!==s){let o=(0,hr.extractType)(t.type),a=(0,hr.extractType)(n.type);if(o.name.value!==a.name.value)throw new Error(`Field "${n.name.value}" already defined with a different type. Declared as "${o.name.value}", but you tried to override with "${a.name.value}"`);if(!Nd(t.type,n.type,!r))throw new Error(`Field '${e.name.value}.${t.name.value}' changed type from '${i}' to '${s}'`)}return(0,hr.isNonNullTypeNode)(n.type)&&!(0,hr.isNonNullTypeNode)(t.type)&&(t.type=n.type),t}function Nd(e,t,n=!1){if(!(0,hr.isWrappingTypeNode)(e)&&!(0,hr.isWrappingTypeNode)(t))return e.toString()===t.toString();if((0,hr.isNonNullTypeNode)(t)){let r=(0,hr.isNonNullTypeNode)(e)?e.type:e;return Nd(r,t.type)}return(0,hr.isNonNullTypeNode)(e)?Nd(t,e,n):(0,hr.isListTypeNode)(e)?(0,hr.isListTypeNode)(t)&&Nd(e.type,t.type)||(0,hr.isNonNullTypeNode)(t)&&Nd(e,t.type):!1}});var LN=L(jm=>{"use strict";d();f();p();Object.defineProperty(jm,"__esModule",{value:!0});jm.mergeInputType=void 0;var Rj=(ne(),se(ce)),kj=gd(),xj=qr();function Pj(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n!=null&&n.convertExtensions||e.kind==="InputObjectTypeDefinition"||t.kind==="InputObjectTypeDefinition"?"InputObjectTypeDefinition":"InputObjectTypeExtension",loc:e.loc,fields:(0,kj.mergeFields)(e,e.fields,t.fields,n),directives:(0,xj.mergeDirectives)(e.directives,t.directives,n,r)}}catch(i){throw new Error(`Unable to merge GraphQL input type "${e.name.value}": ${i.message}`)}return n!=null&&n.convertExtensions?M(A({},e),{kind:Rj.Kind.INPUT_OBJECT_TYPE_DEFINITION}):e}jm.mergeInputType=Pj});var Id=L(Gm=>{"use strict";d();f();p();Object.defineProperty(Gm,"__esModule",{value:!0});Gm.mergeNamedTypeArray=void 0;var Mj=li();function Uj(e,t){return!!e.find(n=>n.name.value===t.name.value)}function Cj(e=[],t=[],n={}){let r=[...t,...e.filter(i=>!Uj(t,i))];return n&&n.sort&&r.sort(Mj.compareNodes),r}Gm.mergeNamedTypeArray=Cj});var RN=L(qm=>{"use strict";d();f();p();Object.defineProperty(qm,"__esModule",{value:!0});qm.mergeInterface=void 0;var Bj=(ne(),se(ce)),$j=gd(),Vj=qr(),jj=Id();function Gj(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n!=null&&n.convertExtensions||e.kind==="InterfaceTypeDefinition"||t.kind==="InterfaceTypeDefinition"?"InterfaceTypeDefinition":"InterfaceTypeExtension",loc:e.loc,fields:(0,$j.mergeFields)(e,e.fields,t.fields,n),directives:(0,Vj.mergeDirectives)(e.directives,t.directives,n,r),interfaces:e.interfaces?(0,jj.mergeNamedTypeArray)(e.interfaces,t.interfaces,n):void 0}}catch(i){throw new Error(`Unable to merge GraphQL interface "${e.name.value}": ${i.message}`)}return n!=null&&n.convertExtensions?M(A({},e),{kind:Bj.Kind.INTERFACE_TYPE_DEFINITION}):e}qm.mergeInterface=Gj});var kN=L(Km=>{"use strict";d();f();p();Object.defineProperty(Km,"__esModule",{value:!0});Km.mergeType=void 0;var qj=(ne(),se(ce)),Kj=gd(),Qj=qr(),Yj=Id();function Jj(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n!=null&&n.convertExtensions||e.kind==="ObjectTypeDefinition"||t.kind==="ObjectTypeDefinition"?"ObjectTypeDefinition":"ObjectTypeExtension",loc:e.loc,fields:(0,Kj.mergeFields)(e,e.fields,t.fields,n),directives:(0,Qj.mergeDirectives)(e.directives,t.directives,n,r),interfaces:(0,Yj.mergeNamedTypeArray)(e.interfaces,t.interfaces,n)}}catch(i){throw new Error(`Unable to merge GraphQL type "${e.name.value}": ${i.message}`)}return n!=null&&n.convertExtensions?M(A({},e),{kind:qj.Kind.OBJECT_TYPE_DEFINITION}):e}Km.mergeType=Jj});var xN=L(Qm=>{"use strict";d();f();p();Object.defineProperty(Qm,"__esModule",{value:!0});Qm.mergeScalar=void 0;var zj=(ne(),se(ce)),Xj=qr();function Hj(e,t,n,r){return t?{name:e.name,description:e.description||t.description,kind:n!=null&&n.convertExtensions||e.kind==="ScalarTypeDefinition"||t.kind==="ScalarTypeDefinition"?"ScalarTypeDefinition":"ScalarTypeExtension",loc:e.loc,directives:(0,Xj.mergeDirectives)(e.directives,t.directives,n,r)}:n!=null&&n.convertExtensions?M(A({},e),{kind:zj.Kind.SCALAR_TYPE_DEFINITION}):e}Qm.mergeScalar=Hj});var MN=L(Ym=>{"use strict";d();f();p();Object.defineProperty(Ym,"__esModule",{value:!0});Ym.mergeUnion=void 0;var PN=(ne(),se(ce)),Wj=qr(),Zj=Id();function eG(e,t,n,r){return t?{name:e.name,description:e.description||t.description,directives:(0,Wj.mergeDirectives)(e.directives,t.directives,n,r),kind:n!=null&&n.convertExtensions||e.kind==="UnionTypeDefinition"||t.kind==="UnionTypeDefinition"?PN.Kind.UNION_TYPE_DEFINITION:PN.Kind.UNION_TYPE_EXTENSION,loc:e.loc,types:(0,Zj.mergeNamedTypeArray)(e.types,t.types,n)}:n!=null&&n.convertExtensions?M(A({},e),{kind:PN.Kind.UNION_TYPE_DEFINITION}):e}Ym.mergeUnion=eG});var UN=L(La=>{"use strict";d();f();p();Object.defineProperty(La,"__esModule",{value:!0});La.mergeSchemaDefs=La.DEFAULT_OPERATION_TYPE_NAME_MAP=void 0;var vd=(ne(),se(ce)),tG=qr();La.DEFAULT_OPERATION_TYPE_NAME_MAP={query:"Query",mutation:"Mutation",subscription:"Subscription"};function nG(e=[],t=[]){let n=[];for(let r in La.DEFAULT_OPERATION_TYPE_NAME_MAP){let i=e.find(s=>s.operation===r)||t.find(s=>s.operation===r);i&&n.push(i)}return n}function rG(e,t,n,r){return t?{kind:e.kind===vd.Kind.SCHEMA_DEFINITION||t.kind===vd.Kind.SCHEMA_DEFINITION?vd.Kind.SCHEMA_DEFINITION:vd.Kind.SCHEMA_EXTENSION,description:e.description||t.description,directives:(0,tG.mergeDirectives)(e.directives,t.directives,n,r),operationTypes:nG(e.operationTypes,t.operationTypes)}:n!=null&&n.convertExtensions?M(A({},e),{kind:vd.Kind.SCHEMA_DEFINITION}):e}La.mergeSchemaDefs=rG});var CN=L(ji=>{"use strict";d();f();p();Object.defineProperty(ji,"__esModule",{value:!0});ji.mergeGraphQLNodes=ji.isNamedDefinitionNode=ji.schemaDefSymbol=void 0;var cr=(ne(),se(ce)),iG=kN(),sG=wN(),oG=xN(),aG=MN(),uG=LN(),cG=RN(),lG=qr(),dG=UN(),pG=li();ji.schemaDefSymbol="SCHEMA_DEF_SYMBOL";function _A(e){return"name"in e}ji.isNamedDefinitionNode=_A;function fG(e,t,n={}){var i,s,o;let r=n;for(let a of e)if(_A(a)){let u=(i=a.name)==null?void 0:i.value;if(t!=null&&t.commentDescriptions&&(0,pG.collectComment)(a),u==null)continue;if((s=t==null?void 0:t.exclusions)!=null&&s.includes(u+".*")||(o=t==null?void 0:t.exclusions)!=null&&o.includes(u))delete r[u];else switch(a.kind){case cr.Kind.OBJECT_TYPE_DEFINITION:case cr.Kind.OBJECT_TYPE_EXTENSION:r[u]=(0,iG.mergeType)(a,r[u],t,n);break;case cr.Kind.ENUM_TYPE_DEFINITION:case cr.Kind.ENUM_TYPE_EXTENSION:r[u]=(0,sG.mergeEnum)(a,r[u],t,n);break;case cr.Kind.UNION_TYPE_DEFINITION:case cr.Kind.UNION_TYPE_EXTENSION:r[u]=(0,aG.mergeUnion)(a,r[u],t,n);break;case cr.Kind.SCALAR_TYPE_DEFINITION:case cr.Kind.SCALAR_TYPE_EXTENSION:r[u]=(0,oG.mergeScalar)(a,r[u],t,n);break;case cr.Kind.INPUT_OBJECT_TYPE_DEFINITION:case cr.Kind.INPUT_OBJECT_TYPE_EXTENSION:r[u]=(0,uG.mergeInputType)(a,r[u],t,n);break;case cr.Kind.INTERFACE_TYPE_DEFINITION:case cr.Kind.INTERFACE_TYPE_EXTENSION:r[u]=(0,cG.mergeInterface)(a,r[u],t,n);break;case cr.Kind.DIRECTIVE_DEFINITION:r[u]=(0,lG.mergeDirective)(a,r[u]);break}}else(a.kind===cr.Kind.SCHEMA_DEFINITION||a.kind===cr.Kind.SCHEMA_EXTENSION)&&(r[ji.schemaDefSymbol]=(0,dG.mergeSchemaDefs)(a,r[ji.schemaDefSymbol],t));return r}ji.mergeGraphQLNodes=fG});var DA=L(Hu=>{"use strict";d();f();p();Object.defineProperty(Hu,"__esModule",{value:!0});Hu.mergeGraphQLTypes=Hu.mergeTypeDefs=void 0;var Kr=(ne(),se(ce)),BN=$m(),Ju=CN(),Xu=li(),bA=UN();function mG(e,t){(0,Xu.resetComments)();let n={kind:Kr.Kind.DOCUMENT,definitions:SA(e,A({useSchemaDefinition:!0,forceSchemaDefinition:!1,throwOnConflict:!1,commentDescriptions:!1},t))},r;return t!=null&&t.commentDescriptions?r=(0,Xu.printWithComments)(n):r=n,(0,Xu.resetComments)(),r}Hu.mergeTypeDefs=mG;function zu(e,t,n=[],r=[],i=new Set){if(e&&!i.has(e))if(i.add(e),typeof e=="function")zu(e(),t,n,r,i);else if(Array.isArray(e))for(let s of e)zu(s,t,n,r,i);else if((0,Kr.isSchema)(e)){let s=(0,Xu.getDocumentNodeFromSchema)(e,t);zu(s.definitions,t,n,r,i)}else if((0,BN.isStringTypes)(e)||(0,BN.isSourceTypes)(e)){let s=(0,Kr.parse)(e,t);zu(s.definitions,t,n,r,i)}else if(typeof e=="object"&&(0,Kr.isDefinitionNode)(e))e.kind===Kr.Kind.DIRECTIVE_DEFINITION?n.push(e):r.push(e);else if((0,Xu.isDocumentNode)(e))zu(e.definitions,t,n,r,i);else throw new Error(`typeDefs must contain only strings, documents, schemas, or functions, got ${typeof e}`);return{allDirectives:n,allNodes:r}}function SA(e,t){var a,u,c;(0,Xu.resetComments)();let{allDirectives:n,allNodes:r}=zu(e,t),i=(0,Ju.mergeGraphQLNodes)(n,t),s=(0,Ju.mergeGraphQLNodes)(r,t,i);if(t!=null&&t.useSchemaDefinition){let l=s[Ju.schemaDefSymbol]||{kind:Kr.Kind.SCHEMA_DEFINITION,operationTypes:[]},m=l.operationTypes;for(let h in bA.DEFAULT_OPERATION_TYPE_NAME_MAP)if(!m.find(N=>N.operation===h)){let N=bA.DEFAULT_OPERATION_TYPE_NAME_MAP[h],D=s[N];D!=null&&D.name!=null&&m.push({kind:Kr.Kind.OPERATION_TYPE_DEFINITION,type:{kind:Kr.Kind.NAMED_TYPE,name:D.name},operation:h})}((a=l==null?void 0:l.operationTypes)==null?void 0:a.length)!=null&&l.operationTypes.length>0&&(s[Ju.schemaDefSymbol]=l)}t!=null&&t.forceSchemaDefinition&&!((c=(u=s[Ju.schemaDefSymbol])==null?void 0:u.operationTypes)!=null&&c.length)&&(s[Ju.schemaDefSymbol]={kind:Kr.Kind.SCHEMA_DEFINITION,operationTypes:[{kind:Kr.Kind.OPERATION_TYPE_DEFINITION,operation:"query",type:{kind:Kr.Kind.NAMED_TYPE,name:{kind:Kr.Kind.NAME,value:"Query"}}}]});let o=Object.values(s);if(t!=null&&t.sort){let l=typeof t.sort=="function"?t.sort:BN.defaultStringComparator;o.sort((m,h)=>{var E,N;return l((E=m.name)==null?void 0:E.value,(N=h.name)==null?void 0:N.value)})}return o}Hu.mergeGraphQLTypes=SA});var OA=L(Hn=>{"use strict";d();f();p();Object.defineProperty(Hn,"__esModule",{value:!0});var Tr=(Bf(),se(Cf));Tr.__exportStar(ON(),Hn);Tr.__exportStar(qr(),Hn);Tr.__exportStar(AN(),Hn);Tr.__exportStar(wN(),Hn);Tr.__exportStar(gd(),Hn);Tr.__exportStar(LN(),Hn);Tr.__exportStar(RN(),Hn);Tr.__exportStar(Id(),Hn);Tr.__exportStar(CN(),Hn);Tr.__exportStar(DA(),Hn);Tr.__exportStar(xN(),Hn);Tr.__exportStar(kN(),Hn);Tr.__exportStar(MN(),Hn);Tr.__exportStar($m(),Hn)});var wA=L(Mo=>{"use strict";d();f();p();Object.defineProperty(Mo,"__esModule",{value:!0});Mo.applyExtensions=Mo.mergeExtensions=Mo.extractExtensionsFromSchema=void 0;var AA=li(),hG=li();Object.defineProperty(Mo,"extractExtensionsFromSchema",{enumerable:!0,get:function(){return hG.extractExtensionsFromSchema}});function TG(e){return(0,AA.mergeDeep)(e)}Mo.mergeExtensions=TG;function Wu(e,t){e&&(e.extensions=(0,AA.mergeDeep)([e.extensions||{},t||{}]))}function yG(e,t){Wu(e,t.schemaExtensions);for(let[n,r]of Object.entries(t.types||{})){let i=e.getType(n);if(i){if(Wu(i,r.extensions),r.type==="object"||r.type==="interface")for(let[s,o]of Object.entries(r.fields)){let a=i.getFields()[s];if(a){Wu(a,o.extensions);for(let[u,c]of Object.entries(o.arguments))Wu(a.args.find(l=>l.name===u),c)}}else if(r.type==="input")for(let[s,o]of Object.entries(r.fields)){let a=i.getFields()[s];Wu(a,o.extensions)}else if(r.type==="enum")for(let[s,o]of Object.entries(r.values)){let a=i.getValue(s);Wu(a,o)}}}return e}Mo.applyExtensions=yG});var VN=L(_d=>{"use strict";d();f();p();Object.defineProperty(_d,"__esModule",{value:!0});var $N=(Bf(),se(Cf));$N.__exportStar(TA(),_d);$N.__exportStar(OA(),_d);$N.__exportStar(wA(),_d)});var Zu=L(Fn=>{"use strict";d();f();p();Object.defineProperty(Fn,"__esModule",{value:!0});Fn.isNodeQuery=Fn.validateAndAddDirectivesWithFieldSetToConfigurationData=Fn.getNormalizedFieldSet=Fn.extractFieldSetValue=Fn.addNonExternalFieldsToSet=Fn.getDirectiveDefinitionArgumentSets=Fn.areNodeKindAndDirectiveLocationCompatible=Fn.newFieldSetContainer=void 0;var ie=(ne(),se(ce)),Qr=ds(),bd=Ar(),tn=Or(),Sd=wo(),st=ai(),LA=Oo();function EG(){return{keys:new Set,provides:new Map,requires:new Map}}Fn.newFieldSetContainer=EG;function NG(e,t,n=!1){for(let r of t.locations){let i=r.value.toUpperCase();switch(i){case tn.ARGUMENT_DEFINITION_UPPER:if(!n)break;if(e===ie.Kind.INPUT_VALUE_DEFINITION)return!0;break;case tn.ENUM_UPPER:if(e===ie.Kind.ENUM_TYPE_DEFINITION||e===ie.Kind.ENUM_TYPE_EXTENSION)return!0;break;case tn.ENUM_VALUE_UPPER:if(e===ie.Kind.ENUM_VALUE_DEFINITION)return!0;break;case tn.FIELD_UPPER:if(e===ie.Kind.FIELD)return!0;break;case tn.FIELD_DEFINITION_UPPER:if(e===ie.Kind.FIELD_DEFINITION)return!0;break;case tn.INLINE_FRAGMENT_UPPER:if(e===ie.Kind.INLINE_FRAGMENT)return!0;break;case tn.INPUT_FIELD_DEFINITION_UPPER:if(e===ie.Kind.INPUT_VALUE_DEFINITION)return!0;break;case tn.INPUT_OBJECT_UPPER:if(e===ie.Kind.INPUT_OBJECT_TYPE_DEFINITION||e===ie.Kind.INPUT_OBJECT_TYPE_EXTENSION)return!0;break;case tn.INTERFACE_UPPER:if(e===ie.Kind.INTERFACE_TYPE_DEFINITION||e===ie.Kind.INTERFACE_TYPE_EXTENSION)return!0;break;case tn.OBJECT_UPPER:if(e===ie.Kind.OBJECT_TYPE_DEFINITION||e===ie.Kind.OBJECT_TYPE_EXTENSION)return!0;break;case tn.FRAGMENT_DEFINITION_UPPER:if(e===ie.Kind.FRAGMENT_DEFINITION)return!0;break;case tn.FRAGMENT_SPREAD_UPPER:if(e===ie.Kind.FRAGMENT_SPREAD)return!0;break;case tn.SCALAR_UPPER:if(e===ie.Kind.SCALAR_TYPE_DEFINITION||e===ie.Kind.SCALAR_TYPE_EXTENSION)return!0;break;case tn.SCHEMA_UPPER:if(e===ie.Kind.SCHEMA_DEFINITION||e===ie.Kind.SCHEMA_EXTENSION)return!0;break;case tn.UNION_UPPER:if(e===ie.Kind.UNION_TYPE_DEFINITION||e===ie.Kind.UNION_TYPE_EXTENSION)return!0;break;case tn.VARIABLE_DEFINITION_UPPER:if(e===ie.Kind.VARIABLE_DEFINITION)return!0;break;case tn.QUERY_UPPER:case tn.MUTATION_UPPER:case tn.SUBSCRIPTION_UPPER:if(e===ie.Kind.OPERATION_DEFINITION)return!0;break;default:throw(0,st.unexpectedDirectiveLocationError)(i)}}return!1}Fn.areNodeKindAndDirectiveLocationCompatible=NG;function gG(e,t,n){for(let r of e){let i=r.name.value;t.set(i,r.type),r.type.kind===ie.Kind.NON_NULL_TYPE&&!r.defaultValue&&n.add(i)}}Fn.getDirectiveDefinitionArgumentSets=gG;function IG(e,t){for(let[n,r]of e)r.directivesByDirectiveName.has(tn.EXTERNAL)||t.add(n)}Fn.addNonExternalFieldsToSet=IG;function vG(e,t,n){if(!n||n.length>1)return;let r=n[0].arguments;if(!r||r.length!==1)return;let i=r[0];i.name.value!==tn.FIELDS||i.value.kind!==ie.Kind.STRING||t.set(e,i.value.value)}Fn.extractFieldSetValue=vG;function jN(e){return(0,ie.print)((0,bd.lexicographicallySortDocumentNode)(e)).replaceAll(/\s+/g," ").slice(2,-2)}Fn.getNormalizedFieldSet=jN;function _G(e,t,n,r){let{error:i,documentNode:s}=(0,bd.safeParse)("{"+n+"}");if(i||!s)return{errorMessage:(0,st.unparsableFieldSetErrorMessage)(n,i)};let o,a=[t],u=[],c=-1,l=!0,m=r,h=t.typeName;return(0,ie.visit)(s,{Argument:{enter(){return!1}},Field:{enter(E){let N=a[c],D=N.typeName;if(N.kind===ie.Kind.UNION_TYPE_DEFINITION)return o=(0,st.invalidSelectionOnUnionErrorMessage)(n,h,D),ie.BREAK;if(l)return o=(0,st.invalidSelectionSetErrorMessage)(n,h,D,(0,Qr.kindToTypeString)(N.kind)),ie.BREAK;let w=E.name.value;h=`${D}.${w}`,m=w;let x=N.fieldDataByFieldName.get(w);if(!x)return o=(0,st.undefinedFieldInFieldSetErrorMessage)(n,D,w),ie.BREAK;if(u[c].has(w))return o=(0,st.duplicateFieldInFieldSetErrorMessage)(n,h),ie.BREAK;u[c].add(w);let Y=(0,Sd.getNamedTypeForChild)(h,x.node.type);if(LA.BASE_SCALARS.has(Y))return;let Q=e.parentDefinitionDataByTypeName.get(Y)||e.parentExtensionDataByTypeName.get(Y);if(!Q)return o=(0,st.unknownTypeInFieldSetErrorMessage)(n,h,Y),ie.BREAK;if(Q.kind===ie.Kind.OBJECT_TYPE_DEFINITION||Q.kind===ie.Kind.OBJECT_TYPE_EXTENSION||Q.kind===ie.Kind.INTERFACE_TYPE_DEFINITION||Q.kind===ie.Kind.UNION_TYPE_DEFINITION){l=!0,a.push(Q);return}}},InlineFragment:{enter(E){let N=a[c],D=N.typeName;if(!E.typeCondition)return o=(0,st.inlineFragmentWithoutTypeConditionErrorMessage)(n,h),ie.BREAK;let w=E.typeCondition.name.value;if(w===D){a.push(N),l=!0;return}if(!(0,bd.isKindAbstract)(N.kind))return o=(0,st.invalidInlineFragmentTypeErrorMessage)(n,h,w,D),ie.BREAK;let x=e.parentDefinitionDataByTypeName.get(w)||e.parentExtensionDataByTypeName.get(w);if(!x)return o=(0,st.unknownInlineFragmentTypeConditionErrorMessage)(n,h,w),ie.BREAK;if(x.kind!==ie.Kind.INTERFACE_TYPE_DEFINITION&&x.kind!==ie.Kind.OBJECT_TYPE_DEFINITION&&x.kind!==ie.Kind.OBJECT_TYPE_EXTENSION&&x.kind!==ie.Kind.UNION_TYPE_DEFINITION)return o=(0,st.invalidInlineFragmentTypeConditionTypeErrorMessage)(n,h,w,(0,Qr.kindToTypeString)(x.kind)),ie.BREAK;let Y=e.abstractToConcreteTypeNames.get(D);if(!Y||!Y.has(w))return o=(0,st.invalidInlineFragmentTypeConditionErrorMessage)(n,h,w,(0,Qr.kindToTypeString)(N.kind),D),ie.BREAK;l=!0,a.push(x)},leave(){a.pop()}},SelectionSet:{enter(){if(!l){let E=a[c];if(E.kind===ie.Kind.UNION_TYPE_DEFINITION)return o=(0,st.unparsableFieldSetSelectionErrorMessage)(n,m),ie.BREAK;let N=E.fieldDataByFieldName.get(m);if(!N)return o=(0,st.undefinedFieldInFieldSetErrorMessage)(n,h,m),ie.BREAK;let D=(0,Sd.getNamedTypeForChild)(h,N.node.type),w=e.parentDefinitionDataByTypeName.get(D),x=w?w.kind:ie.Kind.SCALAR_TYPE_DEFINITION;return o=(0,st.invalidSelectionSetDefinitionErrorMessage)(n,h,D,(0,Qr.kindToTypeString)(x)),ie.BREAK}if(c+=1,l=!1,c<0||c>=a.length)return o=(0,st.unparsableFieldSetSelectionErrorMessage)(n,m),ie.BREAK;u.push(new Set)},leave(){if(l){let E=a[c+1];o=(0,st.invalidSelectionSetErrorMessage)(n,h,E.typeName,(0,Qr.kindToTypeString)(E.kind)),l=!1}c-=1,a.pop(),u.pop()}}}),o?{errorMessage:o}:{configuration:{fieldName:r,selectionSet:jN(s)}}}function bG(e,t,n,r){let i=t.typeName,s=[],o=[];for(let a of n){let{error:u,documentNode:c}=(0,bd.safeParse)("{"+a+"}");if(u||!c){s.push((0,st.unparsableFieldSetErrorMessage)(a,u));continue}let l=[t],m=[],h=-1,E=!0,N="";(0,ie.visit)(c,{Argument:{enter(D){return s.push((0,st.unexpectedArgumentErrorMessage)(a,`${l[h].typeName}.${N}`,D.name.value)),ie.BREAK}},Field:{enter(D){let w=l[h-1],x=l[h],Y=x.typeName;if(E)return s.push((0,st.invalidSelectionSetErrorMessage)(a,`${w.typeName}.${N}`,Y,(0,Qr.kindToTypeString)(x.kind))),ie.BREAK;let Q=D.name.value,W=`${Y}.${Q}`;N=Q;let Ie=x.fieldDataByFieldName.get(Q);if(!Ie)return s.push((0,st.undefinedFieldInFieldSetErrorMessage)(a,Y,Q)),ie.BREAK;if(Ie.argumentDataByArgumentName.size)return s.push((0,st.argumentsInKeyFieldSetErrorMessage)(a,W)),ie.BREAK;if(m[h].has(Q))return s.push((0,st.duplicateFieldInFieldSetErrorMessage)(a,W)),ie.BREAK;m[h].add(Q),(0,Qr.getValueOrDefault)(e.keyFieldNamesByParentTypeName,Y,()=>new Set).add(Q);let Qe=(0,Sd.getNamedTypeForChild)(W,Ie.node.type);if(LA.BASE_SCALARS.has(Qe))return;let et=e.parentDefinitionDataByTypeName.get(Qe)||e.parentExtensionDataByTypeName.get(Qe);if(!et)return s.push((0,st.unknownTypeInFieldSetErrorMessage)(a,W,Qe)),ie.BREAK;if(et.kind===ie.Kind.OBJECT_TYPE_DEFINITION||et.kind===ie.Kind.OBJECT_TYPE_EXTENSION){E=!0,l.push(et);return}if((0,bd.isKindAbstract)(et.kind))return s.push((0,st.abstractTypeInKeyFieldSetErrorMessage)(a,W,Qe,(0,Qr.kindToTypeString)(et.kind))),ie.BREAK}},InlineFragment:{enter(){return s.push(st.inlineFragmentInFieldSetErrorMessage),ie.BREAK}},SelectionSet:{enter(){if(!E){let D=l[h],x=`${D.typeName}.${N}`,Y=D.fieldDataByFieldName.get(N);if(!Y)return s.push((0,st.undefinedFieldInFieldSetErrorMessage)(a,x,N)),ie.BREAK;let Q=(0,Sd.getNamedTypeForChild)(x,Y.node.type),W=e.parentDefinitionDataByTypeName.get(Q),Ie=W?W.kind:ie.Kind.SCALAR_TYPE_DEFINITION;return s.push((0,st.invalidSelectionSetDefinitionErrorMessage)(a,x,Q,(0,Qr.kindToTypeString)(Ie))),ie.BREAK}if(h+=1,E=!1,h<0||h>=l.length)return s.push((0,st.unparsableFieldSetSelectionErrorMessage)(a,N)),ie.BREAK;m.push(new Set)},leave(){if(E){let w=l[h].typeName,x=l[h+1],Y=`${w}.${N}`;s.push((0,st.invalidSelectionSetErrorMessage)(a,Y,x.typeName,(0,Qr.kindToTypeString)(x.kind))),E=!1}h-=1,l.pop(),m.pop()}}}),s.length||o.push(A({fieldName:"",selectionSet:jN(c)},r?{disableEntityResolver:!0}:{}))}if(s.length){e.errors.push((0,st.invalidKeyDirectivesError)(i,s));return}if(o.length)return o}var Dd;(function(e){e.PROVIDES="provides",e.REQUIRES="requires"})(Dd||(Dd={}));function SG(e,t,n,r,i){if(t!==Dd.PROVIDES)return e.entityContainerByTypeName.has(i)?{fieldSetParentContainer:n}:{};let s=(0,Qr.getOrThrowError)(n.fieldDataByFieldName,r,`${i}.fields`),o=(0,Sd.getNamedTypeForChild)(`${i}.${r}`,s.node.type);if(!e.entityContainerByTypeName.has(o))return{};let a=e.parentDefinitionDataByTypeName.get(o)||e.parentExtensionDataByTypeName.get(o);return!a||a.kind!==ie.Kind.OBJECT_TYPE_DEFINITION&&a.kind!==ie.Kind.OBJECT_TYPE_EXTENSION?{errorString:(0,st.unknownProvidesEntityErrorMessage)(`${i}.${r}`,o)}:{fieldSetParentContainer:a}}function FA(e,t,n,r){let i=[],s=[],o=t.typeName;for(let[a,u]of n){let{fieldSetParentContainer:c,errorString:l}=SG(e,r,t,a,o),m=`${o}.${a}`;if(l){i.push(l);continue}if(!c)continue;let{errorMessage:h,configuration:E}=_G(e,c,u,a);if(h){i.push(` On "${o}.${a}" \u2014`+h);continue}if(E){s.push(E);continue}throw(0,st.invalidConfigurationResultFatalError)(m)}if(i.length){e.errors.push((0,st.invalidProvidesOrRequiresDirectivesError)(r,i));return}if(s.length)return s}function DG(e,t,n){let r=(0,Qr.getOrThrowError)(e.configurationDataMap,t.typeName,"configurationDataMap"),i=bG(e,t,n.keys,n.disableEntityResolver);i&&(r.keys=i);let s=FA(e,t,n.provides,Dd.PROVIDES);s&&(r.provides=s);let o=FA(e,t,n.requires,Dd.REQUIRES);o&&(r.requires=o)}Fn.validateAndAddDirectivesWithFieldSetToConfigurationData=DG;function OG(e,t){return e===tn.QUERY||t===ie.OperationTypeNode.QUERY}Fn.isNodeQuery=OG});var Ra=L(GN=>{"use strict";d();f();p();Object.defineProperty(GN,"__esModule",{value:!0});GN.devAssert=AG;function AG(e,t){if(!!!e)throw new Error(t)}});var Uo=L(qN=>{"use strict";d();f();p();Object.defineProperty(qN,"__esModule",{value:!0});qN.isObjectLike=wG;function wG(e){return typeof e=="object"&&e!==null}});var Ts=L(KN=>{"use strict";d();f();p();Object.defineProperty(KN,"__esModule",{value:!0});KN.invariant=FG;function FG(e,t){if(!!!e)throw new Error(t!=null?t:"Unexpected invariant triggered.")}});var YN=L(QN=>{"use strict";d();f();p();Object.defineProperty(QN,"__esModule",{value:!0});QN.getLocation=kG;var LG=Ts(),RG=/\r\n|[\n\r]/g;function kG(e,t){let n=0,r=1;for(let i of e.body.matchAll(RG)){if(typeof i.index=="number"||(0,LG.invariant)(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}});var xA=L(Jm=>{"use strict";d();f();p();Object.defineProperty(Jm,"__esModule",{value:!0});Jm.printLocation=PG;Jm.printSourceLocation=kA;var xG=YN();function PG(e){return kA(e.source,(0,xG.getLocation)(e.source,e.start))}function kA(e,t){let n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,s=e.locationOffset.line-1,o=t.line+s,a=t.line===1?n:0,u=t.column+a,c=`${e.name}:${o}:${u} +`,l=r.split(/\r\n|[\n\r]/g),m=l[i];if(m.length>120){let h=Math.floor(u/80),E=u%80,N=[];for(let D=0;D["|",D]),["|","^".padStart(E)],["|",N[h+1]]])}return c+RA([[`${o-1} |`,l[i-1]],[`${o} |`,m],["|","^".padStart(u)],[`${o+1} |`,l[i+1]]])}function RA(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(` +`)}});var Ge=L(ec=>{"use strict";d();f();p();Object.defineProperty(ec,"__esModule",{value:!0});ec.GraphQLError=void 0;ec.formatError=BG;ec.printError=CG;var MG=Uo(),PA=YN(),MA=xA();function UG(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}var JN=class e extends Error{constructor(t,...n){var r,i,s;let{nodes:o,source:a,positions:u,path:c,originalError:l,extensions:m}=UG(n);super(t),this.name="GraphQLError",this.path=c!=null?c:void 0,this.originalError=l!=null?l:void 0,this.nodes=UA(Array.isArray(o)?o:o?[o]:void 0);let h=UA((r=this.nodes)===null||r===void 0?void 0:r.map(N=>N.loc).filter(N=>N!=null));this.source=a!=null?a:h==null||(i=h[0])===null||i===void 0?void 0:i.source,this.positions=u!=null?u:h==null?void 0:h.map(N=>N.start),this.locations=u&&a?u.map(N=>(0,PA.getLocation)(a,N)):h==null?void 0:h.map(N=>(0,PA.getLocation)(N.source,N.start));let E=(0,MG.isObjectLike)(l==null?void 0:l.extensions)?l==null?void 0:l.extensions:void 0;this.extensions=(s=m!=null?m:E)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),l!=null&&l.stack?Object.defineProperty(this,"stack",{value:l.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=` -`+(0,pL.printLocation)(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=` +`+(0,MA.printLocation)(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=` -`+(0,pL.printSourceLocation)(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};Cc.GraphQLError=Sv;function dL(e){return e===void 0||e.length===0?void 0:e}function z1(e){return e.toString()}function X1(e){return e.toJSON()}});var Ct=F(Dv=>{"use strict";d();m();f();Object.defineProperty(Dv,"__esModule",{value:!0});Dv.inspect=W1;var H1=10,fL=2;function W1(e){return Hh(e,[])}function Hh(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return Z1(e,t);default:return String(e)}}function Z1(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(eQ(e)){let r=e.toJSON();if(r!==e)return typeof r=="string"?r:Hh(r,n)}else if(Array.isArray(e))return nQ(e,n);return tQ(e,n)}function eQ(e){return typeof e.toJSON=="function"}function tQ(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>fL?"["+rQ(e)+"]":"{ "+n.map(([i,o])=>i+": "+Hh(o,t)).join(", ")+" }"}function nQ(e,t){if(e.length===0)return"[]";if(t.length>fL)return"[Array]";let n=Math.min(H1,e.length),r=e.length-n,i=[];for(let o=0;o1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function rQ(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}});var yo=F(mi=>{"use strict";d();m();f();Object.defineProperty(mi,"__esModule",{value:!0});mi.Token=mi.QueryDocumentKeys=mi.OperationTypeNode=mi.Location=void 0;mi.isNode=oQ;var Av=class{constructor(t,n,r){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}};mi.Location=Av;var wv=class{constructor(t,n,r,i,o,s){this.kind=t,this.start=n,this.end=r,this.line=i,this.column=o,this.value=s,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}}};mi.Token=wv;var mL={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};mi.QueryDocumentKeys=mL;var iQ=new Set(Object.keys(mL));function oQ(e){let t=e==null?void 0:e.kind;return typeof t=="string"&&iQ.has(t)}var Rv;mi.OperationTypeNode=Rv;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(Rv||(mi.OperationTypeNode=Rv={}))});var It=F(dd=>{"use strict";d();m();f();Object.defineProperty(dd,"__esModule",{value:!0});dd.Kind=void 0;var Lv;dd.Kind=Lv;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(Lv||(dd.Kind=Lv={}))});var au=F(fa=>{"use strict";d();m();f();Object.defineProperty(fa,"__esModule",{value:!0});fa.BREAK=void 0;fa.getEnterLeaveForKind=Wh;fa.getVisitFn=lQ;fa.visit=uQ;fa.visitInParallel=cQ;var sQ=br(),aQ=Ct(),Fv=yo(),hL=It(),Mc=Object.freeze({});fa.BREAK=Mc;function uQ(e,t,n=Fv.QueryDocumentKeys){let r=new Map;for(let M of Object.values(hL.Kind))r.set(M,Wh(t,M));let i,o=Array.isArray(e),s=[e],a=-1,c=[],u=e,l,p,h=[],y=[];do{a++;let M=a===s.length,W=M&&c.length!==0;if(M){if(l=y.length===0?void 0:h[h.length-1],u=p,p=y.pop(),W)if(o){u=u.slice();let te=0;for(let[pe,qe]of c){let st=pe-te;qe===null?(u.splice(st,1),te++):u[st]=qe}}else{u=Object.defineProperties({},Object.getOwnPropertyDescriptors(u));for(let[te,pe]of c)u[te]=pe}a=i.index,s=i.keys,c=i.edits,o=i.inArray,i=i.prev}else if(p){if(l=o?a:s[a],u=p[l],u==null)continue;h.push(l)}let K;if(!Array.isArray(u)){var N,O;(0,Fv.isNode)(u)||(0,sQ.devAssert)(!1,`Invalid AST Node: ${(0,aQ.inspect)(u)}.`);let te=M?(N=r.get(u.kind))===null||N===void 0?void 0:N.leave:(O=r.get(u.kind))===null||O===void 0?void 0:O.enter;if(K=te==null?void 0:te.call(t,u,l,p,h,y),K===Mc)break;if(K===!1){if(!M){h.pop();continue}}else if(K!==void 0&&(c.push([l,K]),!M))if((0,Fv.isNode)(K))u=K;else{h.pop();continue}}if(K===void 0&&W&&c.push([l,u]),M)h.pop();else{var w;i={inArray:o,index:a,keys:s,edits:c,prev:i},o=Array.isArray(u),s=o?u:(w=n[u.kind])!==null&&w!==void 0?w:[],a=-1,c=[],p&&y.push(p),p=u}}while(i!==void 0);return c.length!==0?c[c.length-1][1]:e}function cQ(e){let t=new Array(e.length).fill(null),n=Object.create(null);for(let r of Object.values(hL.Kind)){let i=!1,o=new Array(e.length).fill(void 0),s=new Array(e.length).fill(void 0);for(let c=0;c{"use strict";d();m();f();Object.defineProperty(kv,"__esModule",{value:!0});kv.didYouMean=dQ;var pQ=5;function dQ(e,t){let[n,r]=t?[e,t]:[void 0,e],i=" Did you mean ";n&&(i+=n+" ");let o=r.map(c=>`"${c}"`);switch(o.length){case 0:return"";case 1:return i+o[0]+"?";case 2:return i+o[0]+" or "+o[1]+"?"}let s=o.slice(0,pQ),a=s.pop();return i+s.join(", ")+", or "+a+"?"}});var yL=F(Pv=>{"use strict";d();m();f();Object.defineProperty(Pv,"__esModule",{value:!0});Pv.identityFunc=fQ;function fQ(e){return e}});var fd=F(Zh=>{"use strict";d();m();f();Object.defineProperty(Zh,"__esModule",{value:!0});Zh.instanceOf=void 0;var mQ=Ct(),hQ=globalThis.process&&globalThis.process.env.NODE_ENV==="production"?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var r;let i=n.prototype[Symbol.toStringTag],o=Symbol.toStringTag in t?t[Symbol.toStringTag]:(r=t.constructor)===null||r===void 0?void 0:r.name;if(i===o){let s=(0,mQ.inspect)(t);throw new Error(`Cannot use ${i} "${s}" from another module or realm. +`+(0,MA.printSourceLocation)(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};ec.GraphQLError=JN;function UA(e){return e===void 0||e.length===0?void 0:e}function CG(e){return e.toString()}function BG(e){return e.toJSON()}});var un=L(zN=>{"use strict";d();f();p();Object.defineProperty(zN,"__esModule",{value:!0});zN.inspect=VG;var $G=10,CA=2;function VG(e){return zm(e,[])}function zm(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return jG(e,t);default:return String(e)}}function jG(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(GG(e)){let r=e.toJSON();if(r!==e)return typeof r=="string"?r:zm(r,n)}else if(Array.isArray(e))return KG(e,n);return qG(e,n)}function GG(e){return typeof e.toJSON=="function"}function qG(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>CA?"["+QG(e)+"]":"{ "+n.map(([i,s])=>i+": "+zm(s,t)).join(", ")+" }"}function KG(e,t){if(e.length===0)return"[]";if(t.length>CA)return"[Array]";let n=Math.min($G,e.length),r=e.length-n,i=[];for(let s=0;s1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function QG(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}});var tc=L(Yr=>{"use strict";d();f();p();Object.defineProperty(Yr,"__esModule",{value:!0});Yr.Token=Yr.QueryDocumentKeys=Yr.OperationTypeNode=Yr.Location=void 0;Yr.isNode=JG;var XN=class{constructor(t,n,r){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}};Yr.Location=XN;var HN=class{constructor(t,n,r,i,s,o){this.kind=t,this.start=n,this.end=r,this.line=i,this.column=s,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}}};Yr.Token=HN;var BA={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};Yr.QueryDocumentKeys=BA;var YG=new Set(Object.keys(BA));function JG(e){let t=e==null?void 0:e.kind;return typeof t=="string"&&YG.has(t)}var WN;Yr.OperationTypeNode=WN;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(WN||(Yr.OperationTypeNode=WN={}))});var Vt=L(Od=>{"use strict";d();f();p();Object.defineProperty(Od,"__esModule",{value:!0});Od.Kind=void 0;var ZN;Od.Kind=ZN;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(ZN||(Od.Kind=ZN={}))});var Ad=L(Co=>{"use strict";d();f();p();Object.defineProperty(Co,"__esModule",{value:!0});Co.BREAK=void 0;Co.getEnterLeaveForKind=Xm;Co.getVisitFn=ZG;Co.visit=HG;Co.visitInParallel=WG;var zG=Ra(),XG=un(),eg=tc(),$A=Vt(),nc=Object.freeze({});Co.BREAK=nc;function HG(e,t,n=eg.QueryDocumentKeys){let r=new Map;for(let x of Object.values($A.Kind))r.set(x,Xm(t,x));let i,s=Array.isArray(e),o=[e],a=-1,u=[],c=e,l,m,h=[],E=[];do{a++;let x=a===o.length,Y=x&&u.length!==0;if(x){if(l=E.length===0?void 0:h[h.length-1],c=m,m=E.pop(),Y)if(s){c=c.slice();let W=0;for(let[Ie,Qe]of u){let et=Ie-W;Qe===null?(c.splice(et,1),W++):c[et]=Qe}}else{c=Object.defineProperties({},Object.getOwnPropertyDescriptors(c));for(let[W,Ie]of u)c[W]=Ie}a=i.index,o=i.keys,u=i.edits,s=i.inArray,i=i.prev}else if(m){if(l=s?a:o[a],c=m[l],c==null)continue;h.push(l)}let Q;if(!Array.isArray(c)){var N,D;(0,eg.isNode)(c)||(0,zG.devAssert)(!1,`Invalid AST Node: ${(0,XG.inspect)(c)}.`);let W=x?(N=r.get(c.kind))===null||N===void 0?void 0:N.leave:(D=r.get(c.kind))===null||D===void 0?void 0:D.enter;if(Q=W==null?void 0:W.call(t,c,l,m,h,E),Q===nc)break;if(Q===!1){if(!x){h.pop();continue}}else if(Q!==void 0&&(u.push([l,Q]),!x))if((0,eg.isNode)(Q))c=Q;else{h.pop();continue}}if(Q===void 0&&Y&&u.push([l,c]),x)h.pop();else{var w;i={inArray:s,index:a,keys:o,edits:u,prev:i},s=Array.isArray(c),o=s?c:(w=n[c.kind])!==null&&w!==void 0?w:[],a=-1,u=[],m&&E.push(m),m=c}}while(i!==void 0);return u.length!==0?u[u.length-1][1]:e}function WG(e){let t=new Array(e.length).fill(null),n=Object.create(null);for(let r of Object.values($A.Kind)){let i=!1,s=new Array(e.length).fill(void 0),o=new Array(e.length).fill(void 0);for(let u=0;u{"use strict";d();f();p();Object.defineProperty(tg,"__esModule",{value:!0});tg.didYouMean=tq;var eq=5;function tq(e,t){let[n,r]=t?[e,t]:[void 0,e],i=" Did you mean ";n&&(i+=n+" ");let s=r.map(u=>`"${u}"`);switch(s.length){case 0:return"";case 1:return i+s[0]+"?";case 2:return i+s[0]+" or "+s[1]+"?"}let o=s.slice(0,eq),a=o.pop();return i+o.join(", ")+", or "+a+"?"}});var VA=L(ng=>{"use strict";d();f();p();Object.defineProperty(ng,"__esModule",{value:!0});ng.identityFunc=nq;function nq(e){return e}});var Wm=L(Hm=>{"use strict";d();f();p();Object.defineProperty(Hm,"__esModule",{value:!0});Hm.instanceOf=void 0;var rq=un(),iq=globalThis.process&&globalThis.process.env.NODE_ENV==="production"?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var r;let i=n.prototype[Symbol.toStringTag],s=Symbol.toStringTag in t?t[Symbol.toStringTag]:(r=t.constructor)===null||r===void 0?void 0:r.name;if(i===s){let o=(0,rq.inspect)(t);throw new Error(`Cannot use ${i} "${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 @@ -362,163 +356,50 @@ 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};Zh.instanceOf=hQ});var ha=F(xv=>{"use strict";d();m();f();Object.defineProperty(xv,"__esModule",{value:!0});xv.keyMap=yQ;function yQ(e,t){let n=Object.create(null);for(let r of e)n[t(r)]=r;return n}});var md=F(Cv=>{"use strict";d();m();f();Object.defineProperty(Cv,"__esModule",{value:!0});Cv.keyValMap=TQ;function TQ(e,t,n){let r=Object.create(null);for(let i of e)r[t(i)]=n(i);return r}});var Uv=F(Mv=>{"use strict";d();m();f();Object.defineProperty(Mv,"__esModule",{value:!0});Mv.mapValue=EQ;function EQ(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}});var hd=F(Vv=>{"use strict";d();m();f();Object.defineProperty(Vv,"__esModule",{value:!0});Vv.naturalCompare=NQ;function NQ(e,t){let n=0,r=0;for(;n0);let a=0;do++r,a=a*10+o-jv,o=t.charCodeAt(r);while(ey(o)&&a>0);if(sa)return 1}else{if(io)return 1;++n,++r}}return e.length-t.length}var jv=48,gQ=57;function ey(e){return!isNaN(e)&&jv<=e&&e<=gQ}});var ya=F(Gv=>{"use strict";d();m();f();Object.defineProperty(Gv,"__esModule",{value:!0});Gv.suggestionList=IQ;var vQ=hd();function IQ(e,t){let n=Object.create(null),r=new $v(e),i=Math.floor(e.length*.4)+1;for(let o of t){let s=r.measure(o,i);s!==void 0&&(n[o]=s)}return Object.keys(n).sort((o,s)=>{let a=n[o]-n[s];return a!==0?a:(0,vQ.naturalCompare)(o,s)})}var $v=class{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=TL(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,n){if(this._input===t)return 0;let r=t.toLowerCase();if(this._inputLowerCase===r)return 1;let i=TL(r),o=this._inputArray;if(i.lengthn)return;let c=this._rows;for(let l=0;l<=a;l++)c[0][l]=l;for(let l=1;l<=s;l++){let p=c[(l-1)%3],h=c[l%3],y=h[0]=l;for(let N=1;N<=a;N++){let O=i[l-1]===o[N-1]?0:1,w=Math.min(p[N]+1,h[N-1]+1,p[N-1]+O);if(l>1&&N>1&&i[l-1]===o[N-2]&&i[l-2]===o[N-1]){let M=c[(l-2)%3][N-2];w=Math.min(w,M+1)}wn)return}let u=c[s%3][a];return u<=n?u:void 0}};function TL(e){let t=e.length,n=new Array(t);for(let r=0;r{"use strict";d();m();f();Object.defineProperty(qv,"__esModule",{value:!0});qv.toObjMap=bQ;function bQ(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;return t}});var ny=F(uu=>{"use strict";d();m();f();Object.defineProperty(uu,"__esModule",{value:!0});uu.isDigit=EL;uu.isLetter=Bv;uu.isNameContinue=SQ;uu.isNameStart=OQ;uu.isWhiteSpace=_Q;function _Q(e){return e===9||e===32}function EL(e){return e>=48&&e<=57}function Bv(e){return e>=97&&e<=122||e>=65&&e<=90}function OQ(e){return Bv(e)||e===95}function SQ(e){return Bv(e)||EL(e)||e===95}});var Td=F(yd=>{"use strict";d();m();f();Object.defineProperty(yd,"__esModule",{value:!0});yd.dedentBlockStringLines=DQ;yd.isPrintableAsBlockString=wQ;yd.printBlockString=RQ;var Kv=ny();function DQ(e){var t;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let s=0;sa===0?s:s.slice(n)).slice((t=r)!==null&&t!==void 0?t:0,i+1)}function AQ(e){let t=0;for(;t1&&r.slice(1).every(y=>y.length===0||(0,Kv.isWhiteSpace)(y.charCodeAt(0))),s=n.endsWith('\\"""'),a=e.endsWith('"')&&!s,c=e.endsWith("\\"),u=a||c,l=!(t!=null&&t.minimize)&&(!i||e.length>70||u||o||s),p="",h=i&&(0,Kv.isWhiteSpace)(e.charCodeAt(0));return(l&&!h||o)&&(p+=` -`),p+=n,(l||u)&&(p+=` -`),'"""'+p+'"""'}});var NL=F(Qv=>{"use strict";d();m();f();Object.defineProperty(Qv,"__esModule",{value:!0});Qv.printString=LQ;function LQ(e){return`"${e.replace(FQ,kQ)}"`}var FQ=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function kQ(e){return PQ[e.charCodeAt(0)]}var PQ=["\\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 Hr=F(Yv=>{"use strict";d();m();f();Object.defineProperty(Yv,"__esModule",{value:!0});Yv.print=UQ;var xQ=Td(),CQ=NL(),MQ=au();function UQ(e){return(0,MQ.visit)(e,VQ)}var jQ=80,VQ={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>be(e.definitions,` +spurious results.`)}}return!1};Hm.instanceOf=iq});var rc=L(rg=>{"use strict";d();f();p();Object.defineProperty(rg,"__esModule",{value:!0});rg.keyMap=sq;function sq(e,t){let n=Object.create(null);for(let r of e)n[t(r)]=r;return n}});var sg=L(ig=>{"use strict";d();f();p();Object.defineProperty(ig,"__esModule",{value:!0});ig.keyValMap=oq;function oq(e,t,n){let r=Object.create(null);for(let i of e)r[t(i)]=n(i);return r}});var jA=L(og=>{"use strict";d();f();p();Object.defineProperty(og,"__esModule",{value:!0});og.mapValue=aq;function aq(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}});var eh=L(ug=>{"use strict";d();f();p();Object.defineProperty(ug,"__esModule",{value:!0});ug.naturalCompare=uq;function uq(e,t){let n=0,r=0;for(;n0);let a=0;do++r,a=a*10+s-ag,s=t.charCodeAt(r);while(Zm(s)&&a>0);if(oa)return 1}else{if(is)return 1;++n,++r}}return e.length-t.length}var ag=48,cq=57;function Zm(e){return!isNaN(e)&&ag<=e&&e<=cq}});var $o=L(lg=>{"use strict";d();f();p();Object.defineProperty(lg,"__esModule",{value:!0});lg.suggestionList=dq;var lq=eh();function dq(e,t){let n=Object.create(null),r=new cg(e),i=Math.floor(e.length*.4)+1;for(let s of t){let o=r.measure(s,i);o!==void 0&&(n[s]=o)}return Object.keys(n).sort((s,o)=>{let a=n[s]-n[o];return a!==0?a:(0,lq.naturalCompare)(s,o)})}var cg=class{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=GA(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,n){if(this._input===t)return 0;let r=t.toLowerCase();if(this._inputLowerCase===r)return 1;let i=GA(r),s=this._inputArray;if(i.lengthn)return;let u=this._rows;for(let l=0;l<=a;l++)u[0][l]=l;for(let l=1;l<=o;l++){let m=u[(l-1)%3],h=u[l%3],E=h[0]=l;for(let N=1;N<=a;N++){let D=i[l-1]===s[N-1]?0:1,w=Math.min(m[N]+1,h[N-1]+1,m[N-1]+D);if(l>1&&N>1&&i[l-1]===s[N-2]&&i[l-2]===s[N-1]){let x=u[(l-2)%3][N-2];w=Math.min(w,x+1)}wn)return}let c=u[o%3][a];return c<=n?c:void 0}};function GA(e){let t=e.length,n=new Array(t);for(let r=0;r{"use strict";d();f();p();Object.defineProperty(dg,"__esModule",{value:!0});dg.toObjMap=pq;function pq(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;return t}});var fg=L(ka=>{"use strict";d();f();p();Object.defineProperty(ka,"__esModule",{value:!0});ka.isDigit=qA;ka.isLetter=pg;ka.isNameContinue=hq;ka.isNameStart=mq;ka.isWhiteSpace=fq;function fq(e){return e===9||e===32}function qA(e){return e>=48&&e<=57}function pg(e){return e>=97&&e<=122||e>=65&&e<=90}function mq(e){return pg(e)||e===95}function hq(e){return pg(e)||qA(e)||e===95}});var KA=L(wd=>{"use strict";d();f();p();Object.defineProperty(wd,"__esModule",{value:!0});wd.dedentBlockStringLines=Tq;wd.isPrintableAsBlockString=Eq;wd.printBlockString=Nq;var mg=fg();function Tq(e){var t;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let o=0;oa===0?o:o.slice(n)).slice((t=r)!==null&&t!==void 0?t:0,i+1)}function yq(e){let t=0;for(;t1&&r.slice(1).every(E=>E.length===0||(0,mg.isWhiteSpace)(E.charCodeAt(0))),o=n.endsWith('\\"""'),a=e.endsWith('"')&&!o,u=e.endsWith("\\"),c=a||u,l=!(t!=null&&t.minimize)&&(!i||e.length>70||c||s||o),m="",h=i&&(0,mg.isWhiteSpace)(e.charCodeAt(0));return(l&&!h||s)&&(m+=` +`),m+=n,(l||c)&&(m+=` +`),'"""'+m+'"""'}});var QA=L(hg=>{"use strict";d();f();p();Object.defineProperty(hg,"__esModule",{value:!0});hg.printString=gq;function gq(e){return`"${e.replace(Iq,vq)}"`}var Iq=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function vq(e){return _q[e.charCodeAt(0)]}var _q=["\\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 Gi=L(Tg=>{"use strict";d();f();p();Object.defineProperty(Tg,"__esModule",{value:!0});Tg.print=Oq;var bq=KA(),Sq=QA(),Dq=Ad();function Oq(e){return(0,Dq.visit)(e,wq)}var Aq=80,wq={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>me(e.definitions,` -`)},OperationDefinition:{leave(e){let t=dt("(",be(e.variableDefinitions,", "),")"),n=be([e.operation,be([e.name,t]),be(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+dt(" = ",n)+dt(" ",be(r," "))},SelectionSet:{leave:({selections:e})=>xi(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let o=dt("",e,": ")+t,s=o+dt("(",be(n,", "),")");return s.length>jQ&&(s=o+dt(`( -`,ry(be(n,` +`)},OperationDefinition:{leave(e){let t=Ze("(",me(e.variableDefinitions,", "),")"),n=me([e.operation,me([e.name,t]),me(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+Ze(" = ",n)+Ze(" ",me(r," "))},SelectionSet:{leave:({selections:e})=>di(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let s=Ze("",e,": ")+t,o=s+Ze("(",me(n,", "),")");return o.length>Aq&&(o=s+Ze(`( +`,nh(me(n,` `)),` -)`)),be([s,be(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+dt(" ",be(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>be(["...",dt("on ",e),be(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${dt("(",be(n,", "),")")} on ${t} ${dt("",be(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?(0,xQ.printBlockString)(e):(0,CQ.printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+be(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+be(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+dt("(",be(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>dt("",e,` -`)+be(["schema",be(t," "),xi(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>dt("",e,` -`)+be(["scalar",t,be(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>dt("",e,` -`)+be(["type",t,dt("implements ",be(n," & ")),be(r," "),xi(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>dt("",e,` -`)+t+(gL(n)?dt(`( -`,ry(be(n,` +)`)),me([o,me(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+Ze(" ",me(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>me(["...",Ze("on ",e),me(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${Ze("(",me(n,", "),")")} on ${t} ${Ze("",me(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?(0,bq.printBlockString)(e):(0,Sq.printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+me(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+me(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Ze("(",me(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Ze("",e,` +`)+me(["schema",me(t," "),di(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Ze("",e,` +`)+me(["scalar",t,me(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Ze("",e,` +`)+me(["type",t,Ze("implements ",me(n," & ")),me(r," "),di(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>Ze("",e,` +`)+t+(YA(n)?Ze(`( +`,nh(me(n,` `)),` -)`):dt("(",be(n,", "),")"))+": "+r+dt(" ",be(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>dt("",e,` -`)+be([t+": "+n,dt("= ",r),be(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>dt("",e,` -`)+be(["interface",t,dt("implements ",be(n," & ")),be(r," "),xi(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>dt("",e,` -`)+be(["union",t,be(n," "),dt("= ",be(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>dt("",e,` -`)+be(["enum",t,be(n," "),xi(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>dt("",e,` -`)+be([t,be(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>dt("",e,` -`)+be(["input",t,be(n," "),xi(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>dt("",e,` -`)+"directive @"+t+(gL(n)?dt(`( -`,ry(be(n,` +)`):Ze("(",me(n,", "),")"))+": "+r+Ze(" ",me(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>Ze("",e,` +`)+me([t+": "+n,Ze("= ",r),me(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Ze("",e,` +`)+me(["interface",t,Ze("implements ",me(n," & ")),me(r," "),di(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>Ze("",e,` +`)+me(["union",t,me(n," "),Ze("= ",me(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>Ze("",e,` +`)+me(["enum",t,me(n," "),di(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Ze("",e,` +`)+me([t,me(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>Ze("",e,` +`)+me(["input",t,me(n," "),di(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>Ze("",e,` +`)+"directive @"+t+(YA(n)?Ze(`( +`,nh(me(n,` `)),` -)`):dt("(",be(n,", "),")"))+(r?" repeatable":"")+" on "+be(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>be(["extend schema",be(e," "),xi(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>be(["extend scalar",e,be(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>be(["extend type",e,dt("implements ",be(t," & ")),be(n," "),xi(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>be(["extend interface",e,dt("implements ",be(t," & ")),be(n," "),xi(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>be(["extend union",e,be(t," "),dt("= ",be(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>be(["extend enum",e,be(t," "),xi(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>be(["extend input",e,be(t," "),xi(n)]," ")}};function be(e,t=""){var n;return(n=e==null?void 0:e.filter(r=>r).join(t))!==null&&n!==void 0?n:""}function xi(e){return dt(`{ -`,ry(be(e,` +)`):Ze("(",me(n,", "),")"))+(r?" repeatable":"")+" on "+me(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>me(["extend schema",me(e," "),di(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>me(["extend scalar",e,me(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>me(["extend type",e,Ze("implements ",me(t," & ")),me(n," "),di(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>me(["extend interface",e,Ze("implements ",me(t," & ")),me(n," "),di(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>me(["extend union",e,me(t," "),Ze("= ",me(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>me(["extend enum",e,me(t," "),di(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>me(["extend input",e,me(t," "),di(n)]," ")}};function me(e,t=""){var n;return(n=e==null?void 0:e.filter(r=>r).join(t))!==null&&n!==void 0?n:""}function di(e){return Ze(`{ +`,nh(me(e,` `)),` -}`)}function dt(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function ry(e){return dt(" ",e.replace(/\n/g,` - `))}function gL(e){var t;return(t=e==null?void 0:e.some(n=>n.includes(` -`)))!==null&&t!==void 0?t:!1}});var Xv=F(zv=>{"use strict";d();m();f();Object.defineProperty(zv,"__esModule",{value:!0});zv.valueFromASTUntyped=Jv;var $Q=md(),Zo=It();function Jv(e,t){switch(e.kind){case Zo.Kind.NULL:return null;case Zo.Kind.INT:return parseInt(e.value,10);case Zo.Kind.FLOAT:return parseFloat(e.value);case Zo.Kind.STRING:case Zo.Kind.ENUM:case Zo.Kind.BOOLEAN:return e.value;case Zo.Kind.LIST:return e.values.map(n=>Jv(n,t));case Zo.Kind.OBJECT:return(0,$Q.keyValMap)(e.fields,n=>n.name.value,n=>Jv(n.value,t));case Zo.Kind.VARIABLE:return t==null?void 0:t[e.name.value]}}});var Ed=F(oy=>{"use strict";d();m();f();Object.defineProperty(oy,"__esModule",{value:!0});oy.assertEnumValueName=GQ;oy.assertName=bL;var vL=br(),iy=$e(),IL=ny();function bL(e){if(e!=null||(0,vL.devAssert)(!1,"Must provide name."),typeof e=="string"||(0,vL.devAssert)(!1,"Expected name to be a string."),e.length===0)throw new iy.GraphQLError("Expected name to be a non-empty string.");for(let t=1;t{"use strict";d();m();f();Object.defineProperty(De,"__esModule",{value:!0});De.GraphQLUnionType=De.GraphQLScalarType=De.GraphQLObjectType=De.GraphQLNonNull=De.GraphQLList=De.GraphQLInterfaceType=De.GraphQLInputObjectType=De.GraphQLEnumType=void 0;De.argsToArgsConfig=xL;De.assertAbstractType=u2;De.assertCompositeType=a2;De.assertEnumType=e2;De.assertInputObjectType=t2;De.assertInputType=i2;De.assertInterfaceType=WQ;De.assertLeafType=s2;De.assertListType=n2;De.assertNamedType=d2;De.assertNonNullType=r2;De.assertNullableType=l2;De.assertObjectType=HQ;De.assertOutputType=o2;De.assertScalarType=XQ;De.assertType=zQ;De.assertUnionType=ZQ;De.assertWrappingType=c2;De.defineArguments=kL;De.getNamedType=f2;De.getNullableType=p2;De.isAbstractType=wL;De.isCompositeType=AL;De.isEnumType=du;De.isInputObjectType=gd;De.isInputType=Hv;De.isInterfaceType=lu;De.isLeafType=DL;De.isListType=Ty;De.isNamedType=RL;De.isNonNullType=Ea;De.isNullableType=Zv;De.isObjectType=jc;De.isOutputType=Wv;De.isRequiredArgument=m2;De.isRequiredInputField=E2;De.isScalarType=cu;De.isType=yy;De.isUnionType=pu;De.isWrappingType=vd;De.resolveObjMapThunk=tI;De.resolveReadonlyArrayThunk=eI;var Bn=br(),qQ=ma(),_L=yL(),qt=Ct(),Ta=fd(),BQ=ho(),KQ=ha(),SL=md(),hy=Uv(),QQ=ya(),To=ty(),Nd=$e(),YQ=It(),OL=Hr(),JQ=Xv(),Eo=Ed();function yy(e){return cu(e)||jc(e)||lu(e)||pu(e)||du(e)||gd(e)||Ty(e)||Ea(e)}function zQ(e){if(!yy(e))throw new Error(`Expected ${(0,qt.inspect)(e)} to be a GraphQL type.`);return e}function cu(e){return(0,Ta.instanceOf)(e,cy)}function XQ(e){if(!cu(e))throw new Error(`Expected ${(0,qt.inspect)(e)} to be a GraphQL Scalar type.`);return e}function jc(e){return(0,Ta.instanceOf)(e,ly)}function HQ(e){if(!jc(e))throw new Error(`Expected ${(0,qt.inspect)(e)} to be a GraphQL Object type.`);return e}function lu(e){return(0,Ta.instanceOf)(e,py)}function WQ(e){if(!lu(e))throw new Error(`Expected ${(0,qt.inspect)(e)} to be a GraphQL Interface type.`);return e}function pu(e){return(0,Ta.instanceOf)(e,dy)}function ZQ(e){if(!pu(e))throw new Error(`Expected ${(0,qt.inspect)(e)} to be a GraphQL Union type.`);return e}function du(e){return(0,Ta.instanceOf)(e,fy)}function e2(e){if(!du(e))throw new Error(`Expected ${(0,qt.inspect)(e)} to be a GraphQL Enum type.`);return e}function gd(e){return(0,Ta.instanceOf)(e,my)}function t2(e){if(!gd(e))throw new Error(`Expected ${(0,qt.inspect)(e)} to be a GraphQL Input Object type.`);return e}function Ty(e){return(0,Ta.instanceOf)(e,ay)}function n2(e){if(!Ty(e))throw new Error(`Expected ${(0,qt.inspect)(e)} to be a GraphQL List type.`);return e}function Ea(e){return(0,Ta.instanceOf)(e,uy)}function r2(e){if(!Ea(e))throw new Error(`Expected ${(0,qt.inspect)(e)} to be a GraphQL Non-Null type.`);return e}function Hv(e){return cu(e)||du(e)||gd(e)||vd(e)&&Hv(e.ofType)}function i2(e){if(!Hv(e))throw new Error(`Expected ${(0,qt.inspect)(e)} to be a GraphQL input type.`);return e}function Wv(e){return cu(e)||jc(e)||lu(e)||pu(e)||du(e)||vd(e)&&Wv(e.ofType)}function o2(e){if(!Wv(e))throw new Error(`Expected ${(0,qt.inspect)(e)} to be a GraphQL output type.`);return e}function DL(e){return cu(e)||du(e)}function s2(e){if(!DL(e))throw new Error(`Expected ${(0,qt.inspect)(e)} to be a GraphQL leaf type.`);return e}function AL(e){return jc(e)||lu(e)||pu(e)}function a2(e){if(!AL(e))throw new Error(`Expected ${(0,qt.inspect)(e)} to be a GraphQL composite type.`);return e}function wL(e){return lu(e)||pu(e)}function u2(e){if(!wL(e))throw new Error(`Expected ${(0,qt.inspect)(e)} to be a GraphQL abstract type.`);return e}var ay=class{constructor(t){yy(t)||(0,Bn.devAssert)(!1,`Expected ${(0,qt.inspect)(t)} to be a GraphQL type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}};De.GraphQLList=ay;var uy=class{constructor(t){Zv(t)||(0,Bn.devAssert)(!1,`Expected ${(0,qt.inspect)(t)} to be a GraphQL nullable type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}};De.GraphQLNonNull=uy;function vd(e){return Ty(e)||Ea(e)}function c2(e){if(!vd(e))throw new Error(`Expected ${(0,qt.inspect)(e)} to be a GraphQL wrapping type.`);return e}function Zv(e){return yy(e)&&!Ea(e)}function l2(e){if(!Zv(e))throw new Error(`Expected ${(0,qt.inspect)(e)} to be a GraphQL nullable type.`);return e}function p2(e){if(e)return Ea(e)?e.ofType:e}function RL(e){return cu(e)||jc(e)||lu(e)||pu(e)||du(e)||gd(e)}function d2(e){if(!RL(e))throw new Error(`Expected ${(0,qt.inspect)(e)} to be a GraphQL named type.`);return e}function f2(e){if(e){let t=e;for(;vd(t);)t=t.ofType;return t}}function eI(e){return typeof e=="function"?e():e}function tI(e){return typeof e=="function"?e():e}var cy=class{constructor(t){var n,r,i,o;let s=(n=t.parseValue)!==null&&n!==void 0?n:_L.identityFunc;this.name=(0,Eo.assertName)(t.name),this.description=t.description,this.specifiedByURL=t.specifiedByURL,this.serialize=(r=t.serialize)!==null&&r!==void 0?r:_L.identityFunc,this.parseValue=s,this.parseLiteral=(i=t.parseLiteral)!==null&&i!==void 0?i:(a,c)=>s((0,JQ.valueFromASTUntyped)(a,c)),this.extensions=(0,To.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(o=t.extensionASTNodes)!==null&&o!==void 0?o:[],t.specifiedByURL==null||typeof t.specifiedByURL=="string"||(0,Bn.devAssert)(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${(0,qt.inspect)(t.specifiedByURL)}.`),t.serialize==null||typeof t.serialize=="function"||(0,Bn.devAssert)(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||(0,Bn.devAssert)(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};De.GraphQLScalarType=cy;var ly=class{constructor(t){var n;this.name=(0,Eo.assertName)(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=(0,To.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>FL(t),this._interfaces=()=>LL(t),t.isTypeOf==null||typeof t.isTypeOf=="function"||(0,Bn.devAssert)(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${(0,qt.inspect)(t.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:PL(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};De.GraphQLObjectType=ly;function LL(e){var t;let n=eI((t=e.interfaces)!==null&&t!==void 0?t:[]);return Array.isArray(n)||(0,Bn.devAssert)(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}function FL(e){let t=tI(e.fields);return Uc(t)||(0,Bn.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,hy.mapValue)(t,(n,r)=>{var i;Uc(n)||(0,Bn.devAssert)(!1,`${e.name}.${r} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||(0,Bn.devAssert)(!1,`${e.name}.${r} field resolver must be a function if provided, but got: ${(0,qt.inspect)(n.resolve)}.`);let o=(i=n.args)!==null&&i!==void 0?i:{};return Uc(o)||(0,Bn.devAssert)(!1,`${e.name}.${r} args must be an object with argument names as keys.`),{name:(0,Eo.assertName)(r),description:n.description,type:n.type,args:kL(o),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:(0,To.toObjMap)(n.extensions),astNode:n.astNode}})}function kL(e){return Object.entries(e).map(([t,n])=>({name:(0,Eo.assertName)(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:(0,To.toObjMap)(n.extensions),astNode:n.astNode}))}function Uc(e){return(0,BQ.isObjectLike)(e)&&!Array.isArray(e)}function PL(e){return(0,hy.mapValue)(e,t=>({description:t.description,type:t.type,args:xL(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function xL(e){return(0,SL.keyValMap)(e,t=>t.name,t=>({description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function m2(e){return Ea(e.type)&&e.defaultValue===void 0}var py=class{constructor(t){var n;this.name=(0,Eo.assertName)(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=(0,To.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=FL.bind(void 0,t),this._interfaces=LL.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||(0,Bn.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,qt.inspect)(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:PL(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};De.GraphQLInterfaceType=py;var dy=class{constructor(t){var n;this.name=(0,Eo.assertName)(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=(0,To.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=h2.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||(0,Bn.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,qt.inspect)(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};De.GraphQLUnionType=dy;function h2(e){let t=eI(e.types);return Array.isArray(t)||(0,Bn.devAssert)(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}var fy=class{constructor(t){var n;this.name=(0,Eo.assertName)(t.name),this.description=t.description,this.extensions=(0,To.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=y2(this.name,t.values),this._valueLookup=new Map(this._values.map(r=>[r.value,r])),this._nameLookup=(0,KQ.keyMap)(this._values,r=>r.name)}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(t){return this._nameLookup[t]}serialize(t){let n=this._valueLookup.get(t);if(n===void 0)throw new Nd.GraphQLError(`Enum "${this.name}" cannot represent value: ${(0,qt.inspect)(t)}`);return n.name}parseValue(t){if(typeof t!="string"){let r=(0,qt.inspect)(t);throw new Nd.GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${r}.`+sy(this,r))}let n=this.getValue(t);if(n==null)throw new Nd.GraphQLError(`Value "${t}" does not exist in "${this.name}" enum.`+sy(this,t));return n.value}parseLiteral(t,n){if(t.kind!==YQ.Kind.ENUM){let i=(0,OL.print)(t);throw new Nd.GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+sy(this,i),{nodes:t})}let r=this.getValue(t.value);if(r==null){let i=(0,OL.print)(t);throw new Nd.GraphQLError(`Value "${i}" does not exist in "${this.name}" enum.`+sy(this,i),{nodes:t})}return r.value}toConfig(){let t=(0,SL.keyValMap)(this.getValues(),n=>n.name,n=>({description:n.description,value:n.value,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,values:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};De.GraphQLEnumType=fy;function sy(e,t){let n=e.getValues().map(i=>i.name),r=(0,QQ.suggestionList)(t,n);return(0,qQ.didYouMean)("the enum value",r)}function y2(e,t){return Uc(t)||(0,Bn.devAssert)(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([n,r])=>(Uc(r)||(0,Bn.devAssert)(!1,`${e}.${n} must refer to an object with a "value" key representing an internal value but got: ${(0,qt.inspect)(r)}.`),{name:(0,Eo.assertEnumValueName)(n),description:r.description,value:r.value!==void 0?r.value:n,deprecationReason:r.deprecationReason,extensions:(0,To.toObjMap)(r.extensions),astNode:r.astNode}))}var my=class{constructor(t){var n;this.name=(0,Eo.assertName)(t.name),this.description=t.description,this.extensions=(0,To.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=T2.bind(void 0,t)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){let t=(0,hy.mapValue)(this.getFields(),n=>({description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,fields:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};De.GraphQLInputObjectType=my;function T2(e){let t=tI(e.fields);return Uc(t)||(0,Bn.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,hy.mapValue)(t,(n,r)=>(!("resolve"in n)||(0,Bn.devAssert)(!1,`${e.name}.${r} field has a resolve property, but Input Types cannot define resolvers.`),{name:(0,Eo.assertName)(r),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:(0,To.toObjMap)(n.extensions),astNode:n.astNode}))}function E2(e){return Ea(e.type)&&e.defaultValue===void 0}});var bd=F(Id=>{"use strict";d();m();f();Object.defineProperty(Id,"__esModule",{value:!0});Id.doTypesOverlap=N2;Id.isEqualType=nI;Id.isTypeSubTypeOf=Ey;var pr=yt();function nI(e,t){return e===t?!0:(0,pr.isNonNullType)(e)&&(0,pr.isNonNullType)(t)||(0,pr.isListType)(e)&&(0,pr.isListType)(t)?nI(e.ofType,t.ofType):!1}function Ey(e,t,n){return t===n?!0:(0,pr.isNonNullType)(n)?(0,pr.isNonNullType)(t)?Ey(e,t.ofType,n.ofType):!1:(0,pr.isNonNullType)(t)?Ey(e,t.ofType,n):(0,pr.isListType)(n)?(0,pr.isListType)(t)?Ey(e,t.ofType,n.ofType):!1:(0,pr.isListType)(t)?!1:(0,pr.isAbstractType)(n)&&((0,pr.isInterfaceType)(t)||(0,pr.isObjectType)(t))&&e.isSubType(n,t)}function N2(e,t,n){return t===n?!0:(0,pr.isAbstractType)(t)?(0,pr.isAbstractType)(n)?e.getPossibleTypes(t).some(r=>e.isSubType(n,r)):e.isSubType(t,n):(0,pr.isAbstractType)(n)?e.isSubType(n,t):!1}});var Vc=F(_d=>{"use strict";d();m();f();Object.defineProperty(_d,"__esModule",{value:!0});_d.DirectiveLocation=void 0;var rI;_d.DirectiveLocation=rI;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(rI||(_d.DirectiveLocation=rI={}))});var No=F(kn=>{"use strict";d();m();f();Object.defineProperty(kn,"__esModule",{value:!0});kn.GraphQLString=kn.GraphQLInt=kn.GraphQLID=kn.GraphQLFloat=kn.GraphQLBoolean=kn.GRAPHQL_MIN_INT=kn.GRAPHQL_MAX_INT=void 0;kn.isSpecifiedScalarType=g2;kn.specifiedScalarTypes=void 0;var Ci=Ct(),CL=ho(),Kn=$e(),fu=It(),Od=Hr(),Sd=yt(),Ny=2147483647;kn.GRAPHQL_MAX_INT=Ny;var gy=-2147483648;kn.GRAPHQL_MIN_INT=gy;var ML=new Sd.GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){let t=Dd(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isInteger(n))throw new Kn.GraphQLError(`Int cannot represent non-integer value: ${(0,Ci.inspect)(t)}`);if(n>Ny||nNy||eNy||te.name===t)}function Dd(e){if((0,CL.isObjectLike)(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!(0,CL.isObjectLike)(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}});var Pr=F(Pn=>{"use strict";d();m();f();Object.defineProperty(Pn,"__esModule",{value:!0});Pn.GraphQLSpecifiedByDirective=Pn.GraphQLSkipDirective=Pn.GraphQLIncludeDirective=Pn.GraphQLDirective=Pn.GraphQLDeprecatedDirective=Pn.DEFAULT_DEPRECATION_REASON=void 0;Pn.assertDirective=S2;Pn.isDirective=BL;Pn.isSpecifiedDirective=D2;Pn.specifiedDirectives=void 0;var qL=br(),v2=Ct(),I2=fd(),b2=ho(),_2=ty(),Mi=Vc(),O2=Ed(),Ad=yt(),vy=No();function BL(e){return(0,I2.instanceOf)(e,Na)}function S2(e){if(!BL(e))throw new Error(`Expected ${(0,v2.inspect)(e)} to be a GraphQL directive.`);return e}var Na=class{constructor(t){var n,r;this.name=(0,O2.assertName)(t.name),this.description=t.description,this.locations=t.locations,this.isRepeatable=(n=t.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=(0,_2.toObjMap)(t.extensions),this.astNode=t.astNode,Array.isArray(t.locations)||(0,qL.devAssert)(!1,`@${t.name} locations must be an Array.`);let i=(r=t.args)!==null&&r!==void 0?r:{};(0,b2.isObjectLike)(i)&&!Array.isArray(i)||(0,qL.devAssert)(!1,`@${t.name} args must be an object with argument names as keys.`),this.args=(0,Ad.defineArguments)(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:(0,Ad.argsToArgsConfig)(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}};Pn.GraphQLDirective=Na;var KL=new Na({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[Mi.DirectiveLocation.FIELD,Mi.DirectiveLocation.FRAGMENT_SPREAD,Mi.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new Ad.GraphQLNonNull(vy.GraphQLBoolean),description:"Included when true."}}});Pn.GraphQLIncludeDirective=KL;var QL=new Na({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[Mi.DirectiveLocation.FIELD,Mi.DirectiveLocation.FRAGMENT_SPREAD,Mi.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new Ad.GraphQLNonNull(vy.GraphQLBoolean),description:"Skipped when true."}}});Pn.GraphQLSkipDirective=QL;var YL="No longer supported";Pn.DEFAULT_DEPRECATION_REASON=YL;var JL=new Na({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[Mi.DirectiveLocation.FIELD_DEFINITION,Mi.DirectiveLocation.ARGUMENT_DEFINITION,Mi.DirectiveLocation.INPUT_FIELD_DEFINITION,Mi.DirectiveLocation.ENUM_VALUE],args:{reason:{type:vy.GraphQLString,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:YL}}});Pn.GraphQLDeprecatedDirective=JL;var zL=new Na({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[Mi.DirectiveLocation.SCALAR],args:{url:{type:new Ad.GraphQLNonNull(vy.GraphQLString),description:"The URL that specifies the behavior of this scalar."}}});Pn.GraphQLSpecifiedByDirective=zL;var XL=Object.freeze([KL,QL,JL,zL]);Pn.specifiedDirectives=XL;function D2(e){return XL.some(({name:t})=>t===e.name)}});var Iy=F(iI=>{"use strict";d();m();f();Object.defineProperty(iI,"__esModule",{value:!0});iI.isIterableObject=A2;function A2(e){return typeof e=="object"&&typeof(e==null?void 0:e[Symbol.iterator])=="function"}});var Ld=F(oI=>{"use strict";d();m();f();Object.defineProperty(oI,"__esModule",{value:!0});oI.astFromValue=Rd;var HL=Ct(),w2=lr(),R2=Iy(),L2=ho(),hi=It(),wd=yt(),F2=No();function Rd(e,t){if((0,wd.isNonNullType)(t)){let n=Rd(e,t.ofType);return(n==null?void 0:n.kind)===hi.Kind.NULL?null:n}if(e===null)return{kind:hi.Kind.NULL};if(e===void 0)return null;if((0,wd.isListType)(t)){let n=t.ofType;if((0,R2.isIterableObject)(e)){let r=[];for(let i of e){let o=Rd(i,n);o!=null&&r.push(o)}return{kind:hi.Kind.LIST,values:r}}return Rd(e,n)}if((0,wd.isInputObjectType)(t)){if(!(0,L2.isObjectLike)(e))return null;let n=[];for(let r of Object.values(t.getFields())){let i=Rd(e[r.name],r.type);i&&n.push({kind:hi.Kind.OBJECT_FIELD,name:{kind:hi.Kind.NAME,value:r.name},value:i})}return{kind:hi.Kind.OBJECT,fields:n}}if((0,wd.isLeafType)(t)){let n=t.serialize(e);if(n==null)return null;if(typeof n=="boolean")return{kind:hi.Kind.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){let r=String(n);return WL.test(r)?{kind:hi.Kind.INT,value:r}:{kind:hi.Kind.FLOAT,value:r}}if(typeof n=="string")return(0,wd.isEnumType)(t)?{kind:hi.Kind.ENUM,value:n}:t===F2.GraphQLID&&WL.test(n)?{kind:hi.Kind.INT,value:n}:{kind:hi.Kind.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${(0,HL.inspect)(n)}.`)}(0,w2.invariant)(!1,"Unexpected input type: "+(0,HL.inspect)(t))}var WL=/^-?(?:0|[1-9][0-9]*)$/});var Ti=F(Mt=>{"use strict";d();m();f();Object.defineProperty(Mt,"__esModule",{value:!0});Mt.introspectionTypes=Mt.__TypeKind=Mt.__Type=Mt.__Schema=Mt.__InputValue=Mt.__Field=Mt.__EnumValue=Mt.__DirectiveLocation=Mt.__Directive=Mt.TypeNameMetaFieldDef=Mt.TypeMetaFieldDef=Mt.TypeKind=Mt.SchemaMetaFieldDef=void 0;Mt.isIntrospectionType=V2;var k2=Ct(),P2=lr(),xn=Vc(),x2=Hr(),C2=Ld(),_e=yt(),Bt=No(),sI=new _e.GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:Bt.GraphQLString,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new _e.GraphQLNonNull(new _e.GraphQLList(new _e.GraphQLNonNull(yi))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new _e.GraphQLNonNull(yi),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:yi,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:yi,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new _e.GraphQLNonNull(new _e.GraphQLList(new _e.GraphQLNonNull(aI))),resolve:e=>e.getDirectives()}})});Mt.__Schema=sI;var aI=new _e.GraphQLObjectType({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document. +}`)}function Ze(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function nh(e){return Ze(" ",e.replace(/\n/g,` + `))}function YA(e){var t;return(t=e==null?void 0:e.some(n=>n.includes(` +`)))!==null&&t!==void 0?t:!1}});var JA=L(Eg=>{"use strict";d();f();p();Object.defineProperty(Eg,"__esModule",{value:!0});Eg.valueFromASTUntyped=yg;var Fq=sg(),ys=Vt();function yg(e,t){switch(e.kind){case ys.Kind.NULL:return null;case ys.Kind.INT:return parseInt(e.value,10);case ys.Kind.FLOAT:return parseFloat(e.value);case ys.Kind.STRING:case ys.Kind.ENUM:case ys.Kind.BOOLEAN:return e.value;case ys.Kind.LIST:return e.values.map(n=>yg(n,t));case ys.Kind.OBJECT:return(0,Fq.keyValMap)(e.fields,n=>n.name.value,n=>yg(n.value,t));case ys.Kind.VARIABLE:return t==null?void 0:t[e.name.value]}}});var Ng=L(ih=>{"use strict";d();f();p();Object.defineProperty(ih,"__esModule",{value:!0});ih.assertEnumValueName=Lq;ih.assertName=HA;var zA=Ra(),rh=Ge(),XA=fg();function HA(e){if(e!=null||(0,zA.devAssert)(!1,"Must provide name."),typeof e=="string"||(0,zA.devAssert)(!1,"Expected name to be a string."),e.length===0)throw new rh.GraphQLError("Expected name to be a non-empty string.");for(let t=1;t{"use strict";d();f();p();Object.defineProperty(Ee,"__esModule",{value:!0});Ee.GraphQLUnionType=Ee.GraphQLScalarType=Ee.GraphQLObjectType=Ee.GraphQLNonNull=Ee.GraphQLList=Ee.GraphQLInterfaceType=Ee.GraphQLInputObjectType=Ee.GraphQLEnumType=void 0;Ee.argsToArgsConfig=cw;Ee.assertAbstractType=Hq;Ee.assertCompositeType=Xq;Ee.assertEnumType=Gq;Ee.assertInputObjectType=qq;Ee.assertInputType=Yq;Ee.assertInterfaceType=Vq;Ee.assertLeafType=zq;Ee.assertListType=Kq;Ee.assertNamedType=t1;Ee.assertNonNullType=Qq;Ee.assertNullableType=Zq;Ee.assertObjectType=$q;Ee.assertOutputType=Jq;Ee.assertScalarType=Bq;Ee.assertType=Cq;Ee.assertUnionType=jq;Ee.assertWrappingType=Wq;Ee.defineArguments=aw;Ee.getNamedType=n1;Ee.getNullableType=e1;Ee.isAbstractType=rw;Ee.isCompositeType=nw;Ee.isEnumType=Ua;Ee.isInputObjectType=Ld;Ee.isInputType=gg;Ee.isInterfaceType=Pa;Ee.isLeafType=tw;Ee.isListType=Th;Ee.isNamedType=iw;Ee.isNonNullType=jo;Ee.isNullableType=vg;Ee.isObjectType=sc;Ee.isOutputType=Ig;Ee.isRequiredArgument=r1;Ee.isRequiredInputField=a1;Ee.isScalarType=xa;Ee.isType=hh;Ee.isUnionType=Ma;Ee.isWrappingType=Rd;Ee.resolveObjMapThunk=bg;Ee.resolveReadonlyArrayThunk=_g;var Ln=Ra(),Rq=Bo(),WA=VA(),St=un(),Vo=Wm(),kq=Uo(),xq=rc(),ew=sg(),mh=jA(),Pq=$o(),qi=th(),Fd=Ge(),Mq=Vt(),ZA=Gi(),Uq=JA(),Ki=Ng();function hh(e){return xa(e)||sc(e)||Pa(e)||Ma(e)||Ua(e)||Ld(e)||Th(e)||jo(e)}function Cq(e){if(!hh(e))throw new Error(`Expected ${(0,St.inspect)(e)} to be a GraphQL type.`);return e}function xa(e){return(0,Vo.instanceOf)(e,uh)}function Bq(e){if(!xa(e))throw new Error(`Expected ${(0,St.inspect)(e)} to be a GraphQL Scalar type.`);return e}function sc(e){return(0,Vo.instanceOf)(e,ch)}function $q(e){if(!sc(e))throw new Error(`Expected ${(0,St.inspect)(e)} to be a GraphQL Object type.`);return e}function Pa(e){return(0,Vo.instanceOf)(e,lh)}function Vq(e){if(!Pa(e))throw new Error(`Expected ${(0,St.inspect)(e)} to be a GraphQL Interface type.`);return e}function Ma(e){return(0,Vo.instanceOf)(e,dh)}function jq(e){if(!Ma(e))throw new Error(`Expected ${(0,St.inspect)(e)} to be a GraphQL Union type.`);return e}function Ua(e){return(0,Vo.instanceOf)(e,ph)}function Gq(e){if(!Ua(e))throw new Error(`Expected ${(0,St.inspect)(e)} to be a GraphQL Enum type.`);return e}function Ld(e){return(0,Vo.instanceOf)(e,fh)}function qq(e){if(!Ld(e))throw new Error(`Expected ${(0,St.inspect)(e)} to be a GraphQL Input Object type.`);return e}function Th(e){return(0,Vo.instanceOf)(e,oh)}function Kq(e){if(!Th(e))throw new Error(`Expected ${(0,St.inspect)(e)} to be a GraphQL List type.`);return e}function jo(e){return(0,Vo.instanceOf)(e,ah)}function Qq(e){if(!jo(e))throw new Error(`Expected ${(0,St.inspect)(e)} to be a GraphQL Non-Null type.`);return e}function gg(e){return xa(e)||Ua(e)||Ld(e)||Rd(e)&&gg(e.ofType)}function Yq(e){if(!gg(e))throw new Error(`Expected ${(0,St.inspect)(e)} to be a GraphQL input type.`);return e}function Ig(e){return xa(e)||sc(e)||Pa(e)||Ma(e)||Ua(e)||Rd(e)&&Ig(e.ofType)}function Jq(e){if(!Ig(e))throw new Error(`Expected ${(0,St.inspect)(e)} to be a GraphQL output type.`);return e}function tw(e){return xa(e)||Ua(e)}function zq(e){if(!tw(e))throw new Error(`Expected ${(0,St.inspect)(e)} to be a GraphQL leaf type.`);return e}function nw(e){return sc(e)||Pa(e)||Ma(e)}function Xq(e){if(!nw(e))throw new Error(`Expected ${(0,St.inspect)(e)} to be a GraphQL composite type.`);return e}function rw(e){return Pa(e)||Ma(e)}function Hq(e){if(!rw(e))throw new Error(`Expected ${(0,St.inspect)(e)} to be a GraphQL abstract type.`);return e}var oh=class{constructor(t){hh(t)||(0,Ln.devAssert)(!1,`Expected ${(0,St.inspect)(t)} to be a GraphQL type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}};Ee.GraphQLList=oh;var ah=class{constructor(t){vg(t)||(0,Ln.devAssert)(!1,`Expected ${(0,St.inspect)(t)} to be a GraphQL nullable type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}};Ee.GraphQLNonNull=ah;function Rd(e){return Th(e)||jo(e)}function Wq(e){if(!Rd(e))throw new Error(`Expected ${(0,St.inspect)(e)} to be a GraphQL wrapping type.`);return e}function vg(e){return hh(e)&&!jo(e)}function Zq(e){if(!vg(e))throw new Error(`Expected ${(0,St.inspect)(e)} to be a GraphQL nullable type.`);return e}function e1(e){if(e)return jo(e)?e.ofType:e}function iw(e){return xa(e)||sc(e)||Pa(e)||Ma(e)||Ua(e)||Ld(e)}function t1(e){if(!iw(e))throw new Error(`Expected ${(0,St.inspect)(e)} to be a GraphQL named type.`);return e}function n1(e){if(e){let t=e;for(;Rd(t);)t=t.ofType;return t}}function _g(e){return typeof e=="function"?e():e}function bg(e){return typeof e=="function"?e():e}var uh=class{constructor(t){var n,r,i,s;let o=(n=t.parseValue)!==null&&n!==void 0?n:WA.identityFunc;this.name=(0,Ki.assertName)(t.name),this.description=t.description,this.specifiedByURL=t.specifiedByURL,this.serialize=(r=t.serialize)!==null&&r!==void 0?r:WA.identityFunc,this.parseValue=o,this.parseLiteral=(i=t.parseLiteral)!==null&&i!==void 0?i:(a,u)=>o((0,Uq.valueFromASTUntyped)(a,u)),this.extensions=(0,qi.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(s=t.extensionASTNodes)!==null&&s!==void 0?s:[],t.specifiedByURL==null||typeof t.specifiedByURL=="string"||(0,Ln.devAssert)(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${(0,St.inspect)(t.specifiedByURL)}.`),t.serialize==null||typeof t.serialize=="function"||(0,Ln.devAssert)(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||(0,Ln.devAssert)(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};Ee.GraphQLScalarType=uh;var ch=class{constructor(t){var n;this.name=(0,Ki.assertName)(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=(0,qi.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>ow(t),this._interfaces=()=>sw(t),t.isTypeOf==null||typeof t.isTypeOf=="function"||(0,Ln.devAssert)(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${(0,St.inspect)(t.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:uw(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};Ee.GraphQLObjectType=ch;function sw(e){var t;let n=_g((t=e.interfaces)!==null&&t!==void 0?t:[]);return Array.isArray(n)||(0,Ln.devAssert)(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}function ow(e){let t=bg(e.fields);return ic(t)||(0,Ln.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,mh.mapValue)(t,(n,r)=>{var i;ic(n)||(0,Ln.devAssert)(!1,`${e.name}.${r} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||(0,Ln.devAssert)(!1,`${e.name}.${r} field resolver must be a function if provided, but got: ${(0,St.inspect)(n.resolve)}.`);let s=(i=n.args)!==null&&i!==void 0?i:{};return ic(s)||(0,Ln.devAssert)(!1,`${e.name}.${r} args must be an object with argument names as keys.`),{name:(0,Ki.assertName)(r),description:n.description,type:n.type,args:aw(s),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:(0,qi.toObjMap)(n.extensions),astNode:n.astNode}})}function aw(e){return Object.entries(e).map(([t,n])=>({name:(0,Ki.assertName)(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:(0,qi.toObjMap)(n.extensions),astNode:n.astNode}))}function ic(e){return(0,kq.isObjectLike)(e)&&!Array.isArray(e)}function uw(e){return(0,mh.mapValue)(e,t=>({description:t.description,type:t.type,args:cw(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function cw(e){return(0,ew.keyValMap)(e,t=>t.name,t=>({description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function r1(e){return jo(e.type)&&e.defaultValue===void 0}var lh=class{constructor(t){var n;this.name=(0,Ki.assertName)(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=(0,qi.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=ow.bind(void 0,t),this._interfaces=sw.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||(0,Ln.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,St.inspect)(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:uw(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};Ee.GraphQLInterfaceType=lh;var dh=class{constructor(t){var n;this.name=(0,Ki.assertName)(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=(0,qi.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=i1.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||(0,Ln.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,St.inspect)(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};Ee.GraphQLUnionType=dh;function i1(e){let t=_g(e.types);return Array.isArray(t)||(0,Ln.devAssert)(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}var ph=class{constructor(t){var n;this.name=(0,Ki.assertName)(t.name),this.description=t.description,this.extensions=(0,qi.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=s1(this.name,t.values),this._valueLookup=new Map(this._values.map(r=>[r.value,r])),this._nameLookup=(0,xq.keyMap)(this._values,r=>r.name)}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(t){return this._nameLookup[t]}serialize(t){let n=this._valueLookup.get(t);if(n===void 0)throw new Fd.GraphQLError(`Enum "${this.name}" cannot represent value: ${(0,St.inspect)(t)}`);return n.name}parseValue(t){if(typeof t!="string"){let r=(0,St.inspect)(t);throw new Fd.GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${r}.`+sh(this,r))}let n=this.getValue(t);if(n==null)throw new Fd.GraphQLError(`Value "${t}" does not exist in "${this.name}" enum.`+sh(this,t));return n.value}parseLiteral(t,n){if(t.kind!==Mq.Kind.ENUM){let i=(0,ZA.print)(t);throw new Fd.GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+sh(this,i),{nodes:t})}let r=this.getValue(t.value);if(r==null){let i=(0,ZA.print)(t);throw new Fd.GraphQLError(`Value "${i}" does not exist in "${this.name}" enum.`+sh(this,i),{nodes:t})}return r.value}toConfig(){let t=(0,ew.keyValMap)(this.getValues(),n=>n.name,n=>({description:n.description,value:n.value,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,values:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};Ee.GraphQLEnumType=ph;function sh(e,t){let n=e.getValues().map(i=>i.name),r=(0,Pq.suggestionList)(t,n);return(0,Rq.didYouMean)("the enum value",r)}function s1(e,t){return ic(t)||(0,Ln.devAssert)(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([n,r])=>(ic(r)||(0,Ln.devAssert)(!1,`${e}.${n} must refer to an object with a "value" key representing an internal value but got: ${(0,St.inspect)(r)}.`),{name:(0,Ki.assertEnumValueName)(n),description:r.description,value:r.value!==void 0?r.value:n,deprecationReason:r.deprecationReason,extensions:(0,qi.toObjMap)(r.extensions),astNode:r.astNode}))}var fh=class{constructor(t){var n;this.name=(0,Ki.assertName)(t.name),this.description=t.description,this.extensions=(0,qi.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=o1.bind(void 0,t)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){let t=(0,mh.mapValue)(this.getFields(),n=>({description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,fields:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};Ee.GraphQLInputObjectType=fh;function o1(e){let t=bg(e.fields);return ic(t)||(0,Ln.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,mh.mapValue)(t,(n,r)=>(!("resolve"in n)||(0,Ln.devAssert)(!1,`${e.name}.${r} field has a resolve property, but Input Types cannot define resolvers.`),{name:(0,Ki.assertName)(r),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:(0,qi.toObjMap)(n.extensions),astNode:n.astNode}))}function a1(e){return jo(e.type)&&e.defaultValue===void 0}});var Eh=L(kd=>{"use strict";d();f();p();Object.defineProperty(kd,"__esModule",{value:!0});kd.doTypesOverlap=u1;kd.isEqualType=Sg;kd.isTypeSubTypeOf=yh;var Wn=kt();function Sg(e,t){return e===t?!0:(0,Wn.isNonNullType)(e)&&(0,Wn.isNonNullType)(t)||(0,Wn.isListType)(e)&&(0,Wn.isListType)(t)?Sg(e.ofType,t.ofType):!1}function yh(e,t,n){return t===n?!0:(0,Wn.isNonNullType)(n)?(0,Wn.isNonNullType)(t)?yh(e,t.ofType,n.ofType):!1:(0,Wn.isNonNullType)(t)?yh(e,t.ofType,n):(0,Wn.isListType)(n)?(0,Wn.isListType)(t)?yh(e,t.ofType,n.ofType):!1:(0,Wn.isListType)(t)?!1:(0,Wn.isAbstractType)(n)&&((0,Wn.isInterfaceType)(t)||(0,Wn.isObjectType)(t))&&e.isSubType(n,t)}function u1(e,t,n){return t===n?!0:(0,Wn.isAbstractType)(t)?(0,Wn.isAbstractType)(n)?e.getPossibleTypes(t).some(r=>e.isSubType(n,r)):e.isSubType(t,n):(0,Wn.isAbstractType)(n)?e.isSubType(n,t):!1}});var Nh=L(xd=>{"use strict";d();f();p();Object.defineProperty(xd,"__esModule",{value:!0});xd.DirectiveLocation=void 0;var Dg;xd.DirectiveLocation=Dg;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(Dg||(xd.DirectiveLocation=Dg={}))});var Cd=L(gn=>{"use strict";d();f();p();Object.defineProperty(gn,"__esModule",{value:!0});gn.GraphQLString=gn.GraphQLInt=gn.GraphQLID=gn.GraphQLFloat=gn.GraphQLBoolean=gn.GRAPHQL_MIN_INT=gn.GRAPHQL_MAX_INT=void 0;gn.isSpecifiedScalarType=c1;gn.specifiedScalarTypes=void 0;var pi=un(),lw=Uo(),Rn=Ge(),Ca=Vt(),Pd=Gi(),Md=kt(),gh=2147483647;gn.GRAPHQL_MAX_INT=gh;var Ih=-2147483648;gn.GRAPHQL_MIN_INT=Ih;var dw=new Md.GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){let t=Ud(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isInteger(n))throw new Rn.GraphQLError(`Int cannot represent non-integer value: ${(0,pi.inspect)(t)}`);if(n>gh||ngh||egh||te.name===t)}function Ud(e){if((0,lw.isObjectLike)(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!(0,lw.isObjectLike)(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}});var qo=L(In=>{"use strict";d();f();p();Object.defineProperty(In,"__esModule",{value:!0});In.GraphQLSpecifiedByDirective=In.GraphQLSkipDirective=In.GraphQLIncludeDirective=In.GraphQLDirective=In.GraphQLDeprecatedDirective=In.DEFAULT_DEPRECATION_REASON=void 0;In.assertDirective=h1;In.isDirective=Ew;In.isSpecifiedDirective=T1;In.specifiedDirectives=void 0;var yw=Ra(),l1=un(),d1=Wm(),p1=Uo(),f1=th(),fi=Nh(),m1=Ng(),Bd=kt(),vh=Cd();function Ew(e){return(0,d1.instanceOf)(e,Go)}function h1(e){if(!Ew(e))throw new Error(`Expected ${(0,l1.inspect)(e)} to be a GraphQL directive.`);return e}var Go=class{constructor(t){var n,r;this.name=(0,m1.assertName)(t.name),this.description=t.description,this.locations=t.locations,this.isRepeatable=(n=t.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=(0,f1.toObjMap)(t.extensions),this.astNode=t.astNode,Array.isArray(t.locations)||(0,yw.devAssert)(!1,`@${t.name} locations must be an Array.`);let i=(r=t.args)!==null&&r!==void 0?r:{};(0,p1.isObjectLike)(i)&&!Array.isArray(i)||(0,yw.devAssert)(!1,`@${t.name} args must be an object with argument names as keys.`),this.args=(0,Bd.defineArguments)(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:(0,Bd.argsToArgsConfig)(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}};In.GraphQLDirective=Go;var Nw=new Go({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[fi.DirectiveLocation.FIELD,fi.DirectiveLocation.FRAGMENT_SPREAD,fi.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new Bd.GraphQLNonNull(vh.GraphQLBoolean),description:"Included when true."}}});In.GraphQLIncludeDirective=Nw;var gw=new Go({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[fi.DirectiveLocation.FIELD,fi.DirectiveLocation.FRAGMENT_SPREAD,fi.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new Bd.GraphQLNonNull(vh.GraphQLBoolean),description:"Skipped when true."}}});In.GraphQLSkipDirective=gw;var Iw="No longer supported";In.DEFAULT_DEPRECATION_REASON=Iw;var vw=new Go({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[fi.DirectiveLocation.FIELD_DEFINITION,fi.DirectiveLocation.ARGUMENT_DEFINITION,fi.DirectiveLocation.INPUT_FIELD_DEFINITION,fi.DirectiveLocation.ENUM_VALUE],args:{reason:{type:vh.GraphQLString,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:Iw}}});In.GraphQLDeprecatedDirective=vw;var _w=new Go({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[fi.DirectiveLocation.SCALAR],args:{url:{type:new Bd.GraphQLNonNull(vh.GraphQLString),description:"The URL that specifies the behavior of this scalar."}}});In.GraphQLSpecifiedByDirective=_w;var bw=Object.freeze([Nw,gw,vw,_w]);In.specifiedDirectives=bw;function T1(e){return bw.some(({name:t})=>t===e.name)}});var Ag=L(Og=>{"use strict";d();f();p();Object.defineProperty(Og,"__esModule",{value:!0});Og.isIterableObject=y1;function y1(e){return typeof e=="object"&&typeof(e==null?void 0:e[Symbol.iterator])=="function"}});var Ow=L(wg=>{"use strict";d();f();p();Object.defineProperty(wg,"__esModule",{value:!0});wg.astFromValue=Vd;var Sw=un(),E1=Ts(),N1=Ag(),g1=Uo(),Jr=Vt(),$d=kt(),I1=Cd();function Vd(e,t){if((0,$d.isNonNullType)(t)){let n=Vd(e,t.ofType);return(n==null?void 0:n.kind)===Jr.Kind.NULL?null:n}if(e===null)return{kind:Jr.Kind.NULL};if(e===void 0)return null;if((0,$d.isListType)(t)){let n=t.ofType;if((0,N1.isIterableObject)(e)){let r=[];for(let i of e){let s=Vd(i,n);s!=null&&r.push(s)}return{kind:Jr.Kind.LIST,values:r}}return Vd(e,n)}if((0,$d.isInputObjectType)(t)){if(!(0,g1.isObjectLike)(e))return null;let n=[];for(let r of Object.values(t.getFields())){let i=Vd(e[r.name],r.type);i&&n.push({kind:Jr.Kind.OBJECT_FIELD,name:{kind:Jr.Kind.NAME,value:r.name},value:i})}return{kind:Jr.Kind.OBJECT,fields:n}}if((0,$d.isLeafType)(t)){let n=t.serialize(e);if(n==null)return null;if(typeof n=="boolean")return{kind:Jr.Kind.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){let r=String(n);return Dw.test(r)?{kind:Jr.Kind.INT,value:r}:{kind:Jr.Kind.FLOAT,value:r}}if(typeof n=="string")return(0,$d.isEnumType)(t)?{kind:Jr.Kind.ENUM,value:n}:t===I1.GraphQLID&&Dw.test(n)?{kind:Jr.Kind.INT,value:n}:{kind:Jr.Kind.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${(0,Sw.inspect)(n)}.`)}(0,E1.invariant)(!1,"Unexpected input type: "+(0,Sw.inspect)(t))}var Dw=/^-?(?:0|[1-9][0-9]*)$/});var Gd=L(ht=>{"use strict";d();f();p();Object.defineProperty(ht,"__esModule",{value:!0});ht.introspectionTypes=ht.__TypeKind=ht.__Type=ht.__Schema=ht.__InputValue=ht.__Field=ht.__EnumValue=ht.__DirectiveLocation=ht.__Directive=ht.TypeNameMetaFieldDef=ht.TypeMetaFieldDef=ht.TypeKind=ht.SchemaMetaFieldDef=void 0;ht.isIntrospectionType=w1;var v1=un(),_1=Ts(),vn=Nh(),b1=Gi(),S1=Ow(),he=kt(),Dt=Cd(),Fg=new he.GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:Dt.GraphQLString,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new he.GraphQLNonNull(new he.GraphQLList(new he.GraphQLNonNull(zr))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new he.GraphQLNonNull(zr),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:zr,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:zr,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new he.GraphQLNonNull(new he.GraphQLList(new he.GraphQLNonNull(Lg))),resolve:e=>e.getDirectives()}})});ht.__Schema=Fg;var Lg=new he.GraphQLObjectType({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document. -In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new _e.GraphQLNonNull(Bt.GraphQLString),resolve:e=>e.name},description:{type:Bt.GraphQLString,resolve:e=>e.description},isRepeatable:{type:new _e.GraphQLNonNull(Bt.GraphQLBoolean),resolve:e=>e.isRepeatable},locations:{type:new _e.GraphQLNonNull(new _e.GraphQLList(new _e.GraphQLNonNull(uI))),resolve:e=>e.locations},args:{type:new _e.GraphQLNonNull(new _e.GraphQLList(new _e.GraphQLNonNull(Fd))),args:{includeDeprecated:{type:Bt.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}}})});Mt.__Directive=aI;var uI=new _e.GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:xn.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:xn.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:xn.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:xn.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:xn.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:xn.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:xn.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:xn.DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:xn.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:xn.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:xn.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:xn.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:xn.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:xn.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:xn.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:xn.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:xn.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:xn.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:xn.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}});Mt.__DirectiveLocation=uI;var yi=new _e.GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new _e.GraphQLNonNull(pI),resolve(e){if((0,_e.isScalarType)(e))return Cn.SCALAR;if((0,_e.isObjectType)(e))return Cn.OBJECT;if((0,_e.isInterfaceType)(e))return Cn.INTERFACE;if((0,_e.isUnionType)(e))return Cn.UNION;if((0,_e.isEnumType)(e))return Cn.ENUM;if((0,_e.isInputObjectType)(e))return Cn.INPUT_OBJECT;if((0,_e.isListType)(e))return Cn.LIST;if((0,_e.isNonNullType)(e))return Cn.NON_NULL;(0,P2.invariant)(!1,`Unexpected type: "${(0,k2.inspect)(e)}".`)}},name:{type:Bt.GraphQLString,resolve:e=>"name"in e?e.name:void 0},description:{type:Bt.GraphQLString,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:Bt.GraphQLString,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new _e.GraphQLList(new _e.GraphQLNonNull(cI)),args:{includeDeprecated:{type:Bt.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,_e.isObjectType)(e)||(0,_e.isInterfaceType)(e)){let n=Object.values(e.getFields());return t?n:n.filter(r=>r.deprecationReason==null)}}},interfaces:{type:new _e.GraphQLList(new _e.GraphQLNonNull(yi)),resolve(e){if((0,_e.isObjectType)(e)||(0,_e.isInterfaceType)(e))return e.getInterfaces()}},possibleTypes:{type:new _e.GraphQLList(new _e.GraphQLNonNull(yi)),resolve(e,t,n,{schema:r}){if((0,_e.isAbstractType)(e))return r.getPossibleTypes(e)}},enumValues:{type:new _e.GraphQLList(new _e.GraphQLNonNull(lI)),args:{includeDeprecated:{type:Bt.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,_e.isEnumType)(e)){let n=e.getValues();return t?n:n.filter(r=>r.deprecationReason==null)}}},inputFields:{type:new _e.GraphQLList(new _e.GraphQLNonNull(Fd)),args:{includeDeprecated:{type:Bt.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,_e.isInputObjectType)(e)){let n=Object.values(e.getFields());return t?n:n.filter(r=>r.deprecationReason==null)}}},ofType:{type:yi,resolve:e=>"ofType"in e?e.ofType:void 0}})});Mt.__Type=yi;var cI=new _e.GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new _e.GraphQLNonNull(Bt.GraphQLString),resolve:e=>e.name},description:{type:Bt.GraphQLString,resolve:e=>e.description},args:{type:new _e.GraphQLNonNull(new _e.GraphQLList(new _e.GraphQLNonNull(Fd))),args:{includeDeprecated:{type:Bt.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new _e.GraphQLNonNull(yi),resolve:e=>e.type},isDeprecated:{type:new _e.GraphQLNonNull(Bt.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:Bt.GraphQLString,resolve:e=>e.deprecationReason}})});Mt.__Field=cI;var Fd=new _e.GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new _e.GraphQLNonNull(Bt.GraphQLString),resolve:e=>e.name},description:{type:Bt.GraphQLString,resolve:e=>e.description},type:{type:new _e.GraphQLNonNull(yi),resolve:e=>e.type},defaultValue:{type:Bt.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:n}=e,r=(0,C2.astFromValue)(n,t);return r?(0,x2.print)(r):null}},isDeprecated:{type:new _e.GraphQLNonNull(Bt.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:Bt.GraphQLString,resolve:e=>e.deprecationReason}})});Mt.__InputValue=Fd;var lI=new _e.GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new _e.GraphQLNonNull(Bt.GraphQLString),resolve:e=>e.name},description:{type:Bt.GraphQLString,resolve:e=>e.description},isDeprecated:{type:new _e.GraphQLNonNull(Bt.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:Bt.GraphQLString,resolve:e=>e.deprecationReason}})});Mt.__EnumValue=lI;var Cn;Mt.TypeKind=Cn;(function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"})(Cn||(Mt.TypeKind=Cn={}));var pI=new _e.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Cn.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Cn.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Cn.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Cn.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Cn.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Cn.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Cn.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Cn.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});Mt.__TypeKind=pI;var M2={name:"__schema",type:new _e.GraphQLNonNull(sI),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};Mt.SchemaMetaFieldDef=M2;var U2={name:"__type",type:yi,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new _e.GraphQLNonNull(Bt.GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};Mt.TypeMetaFieldDef=U2;var j2={name:"__typename",type:new _e.GraphQLNonNull(Bt.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};Mt.TypeNameMetaFieldDef=j2;var ZL=Object.freeze([sI,aI,uI,yi,cI,Fd,lI,pI]);Mt.introspectionTypes=ZL;function V2(e){return ZL.some(({name:t})=>e.name===t)}});var mu=F($c=>{"use strict";d();m();f();Object.defineProperty($c,"__esModule",{value:!0});$c.GraphQLSchema=void 0;$c.assertSchema=K2;$c.isSchema=tF;var by=br(),fI=Ct(),$2=fd(),G2=ho(),q2=ty(),dI=yo(),Ui=yt(),eF=Pr(),B2=Ti();function tF(e){return(0,$2.instanceOf)(e,_y)}function K2(e){if(!tF(e))throw new Error(`Expected ${(0,fI.inspect)(e)} to be a GraphQL schema.`);return e}var _y=class{constructor(t){var n,r;this.__validationErrors=t.assumeValid===!0?[]:void 0,(0,G2.isObjectLike)(t)||(0,by.devAssert)(!1,"Must provide configuration object."),!t.types||Array.isArray(t.types)||(0,by.devAssert)(!1,`"types" must be Array if provided but got: ${(0,fI.inspect)(t.types)}.`),!t.directives||Array.isArray(t.directives)||(0,by.devAssert)(!1,`"directives" must be Array if provided but got: ${(0,fI.inspect)(t.directives)}.`),this.description=t.description,this.extensions=(0,q2.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(r=t.directives)!==null&&r!==void 0?r:eF.specifiedDirectives;let i=new Set(t.types);if(t.types!=null)for(let o of t.types)i.delete(o),ji(o,i);this._queryType!=null&&ji(this._queryType,i),this._mutationType!=null&&ji(this._mutationType,i),this._subscriptionType!=null&&ji(this._subscriptionType,i);for(let o of this._directives)if((0,eF.isDirective)(o))for(let s of o.args)ji(s.type,i);ji(B2.__Schema,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let o of i){if(o==null)continue;let s=o.name;if(s||(0,by.devAssert)(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[s]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${s}".`);if(this._typeMap[s]=o,(0,Ui.isInterfaceType)(o)){for(let a of o.getInterfaces())if((0,Ui.isInterfaceType)(a)){let c=this._implementationsMap[a.name];c===void 0&&(c=this._implementationsMap[a.name]={objects:[],interfaces:[]}),c.interfaces.push(o)}}else if((0,Ui.isObjectType)(o)){for(let a of o.getInterfaces())if((0,Ui.isInterfaceType)(a)){let c=this._implementationsMap[a.name];c===void 0&&(c=this._implementationsMap[a.name]={objects:[],interfaces:[]}),c.objects.push(o)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case dI.OperationTypeNode.QUERY:return this.getQueryType();case dI.OperationTypeNode.MUTATION:return this.getMutationType();case dI.OperationTypeNode.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return(0,Ui.isUnionType)(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){let n=this._implementationsMap[t.name];return n!=null?n:{objects:[],interfaces:[]}}isSubType(t,n){let r=this._subTypeMap[t.name];if(r===void 0){if(r=Object.create(null),(0,Ui.isUnionType)(t))for(let i of t.getTypes())r[i.name]=!0;else{let i=this.getImplementations(t);for(let o of i.objects)r[o.name]=!0;for(let o of i.interfaces)r[o.name]=!0}this._subTypeMap[t.name]=r}return r[n.name]!==void 0}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(n=>n.name===t)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}};$c.GraphQLSchema=_y;function ji(e,t){let n=(0,Ui.getNamedType)(e);if(!t.has(n)){if(t.add(n),(0,Ui.isUnionType)(n))for(let r of n.getTypes())ji(r,t);else if((0,Ui.isObjectType)(n)||(0,Ui.isInterfaceType)(n)){for(let r of n.getInterfaces())ji(r,t);for(let r of Object.values(n.getFields())){ji(r.type,t);for(let i of r.args)ji(i.type,t)}}else if((0,Ui.isInputObjectType)(n))for(let r of Object.values(n.getFields()))ji(r.type,t)}return t}});var Pd=F(Oy=>{"use strict";d();m();f();Object.defineProperty(Oy,"__esModule",{value:!0});Oy.assertValidSchema=z2;Oy.validateSchema=aF;var dr=Ct(),Q2=$e(),mI=yo(),nF=bd(),bn=yt(),sF=Pr(),Y2=Ti(),J2=mu();function aF(e){if((0,J2.assertSchema)(e),e.__validationErrors)return e.__validationErrors;let t=new yI(e);X2(t),H2(t),W2(t);let n=t.getErrors();return e.__validationErrors=n,n}function z2(e){let t=aF(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(` +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 he.GraphQLNonNull(Dt.GraphQLString),resolve:e=>e.name},description:{type:Dt.GraphQLString,resolve:e=>e.description},isRepeatable:{type:new he.GraphQLNonNull(Dt.GraphQLBoolean),resolve:e=>e.isRepeatable},locations:{type:new he.GraphQLNonNull(new he.GraphQLList(new he.GraphQLNonNull(Rg))),resolve:e=>e.locations},args:{type:new he.GraphQLNonNull(new he.GraphQLList(new he.GraphQLNonNull(jd))),args:{includeDeprecated:{type:Dt.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}}})});ht.__Directive=Lg;var Rg=new he.GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:vn.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:vn.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:vn.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:vn.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:vn.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:vn.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:vn.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:vn.DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:vn.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:vn.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:vn.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:vn.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:vn.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:vn.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:vn.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:vn.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:vn.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:vn.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:vn.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}});ht.__DirectiveLocation=Rg;var zr=new he.GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new he.GraphQLNonNull(Pg),resolve(e){if((0,he.isScalarType)(e))return _n.SCALAR;if((0,he.isObjectType)(e))return _n.OBJECT;if((0,he.isInterfaceType)(e))return _n.INTERFACE;if((0,he.isUnionType)(e))return _n.UNION;if((0,he.isEnumType)(e))return _n.ENUM;if((0,he.isInputObjectType)(e))return _n.INPUT_OBJECT;if((0,he.isListType)(e))return _n.LIST;if((0,he.isNonNullType)(e))return _n.NON_NULL;(0,_1.invariant)(!1,`Unexpected type: "${(0,v1.inspect)(e)}".`)}},name:{type:Dt.GraphQLString,resolve:e=>"name"in e?e.name:void 0},description:{type:Dt.GraphQLString,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:Dt.GraphQLString,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new he.GraphQLList(new he.GraphQLNonNull(kg)),args:{includeDeprecated:{type:Dt.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,he.isObjectType)(e)||(0,he.isInterfaceType)(e)){let n=Object.values(e.getFields());return t?n:n.filter(r=>r.deprecationReason==null)}}},interfaces:{type:new he.GraphQLList(new he.GraphQLNonNull(zr)),resolve(e){if((0,he.isObjectType)(e)||(0,he.isInterfaceType)(e))return e.getInterfaces()}},possibleTypes:{type:new he.GraphQLList(new he.GraphQLNonNull(zr)),resolve(e,t,n,{schema:r}){if((0,he.isAbstractType)(e))return r.getPossibleTypes(e)}},enumValues:{type:new he.GraphQLList(new he.GraphQLNonNull(xg)),args:{includeDeprecated:{type:Dt.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,he.isEnumType)(e)){let n=e.getValues();return t?n:n.filter(r=>r.deprecationReason==null)}}},inputFields:{type:new he.GraphQLList(new he.GraphQLNonNull(jd)),args:{includeDeprecated:{type:Dt.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,he.isInputObjectType)(e)){let n=Object.values(e.getFields());return t?n:n.filter(r=>r.deprecationReason==null)}}},ofType:{type:zr,resolve:e=>"ofType"in e?e.ofType:void 0}})});ht.__Type=zr;var kg=new he.GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new he.GraphQLNonNull(Dt.GraphQLString),resolve:e=>e.name},description:{type:Dt.GraphQLString,resolve:e=>e.description},args:{type:new he.GraphQLNonNull(new he.GraphQLList(new he.GraphQLNonNull(jd))),args:{includeDeprecated:{type:Dt.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new he.GraphQLNonNull(zr),resolve:e=>e.type},isDeprecated:{type:new he.GraphQLNonNull(Dt.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:Dt.GraphQLString,resolve:e=>e.deprecationReason}})});ht.__Field=kg;var jd=new he.GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new he.GraphQLNonNull(Dt.GraphQLString),resolve:e=>e.name},description:{type:Dt.GraphQLString,resolve:e=>e.description},type:{type:new he.GraphQLNonNull(zr),resolve:e=>e.type},defaultValue:{type:Dt.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:n}=e,r=(0,S1.astFromValue)(n,t);return r?(0,b1.print)(r):null}},isDeprecated:{type:new he.GraphQLNonNull(Dt.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:Dt.GraphQLString,resolve:e=>e.deprecationReason}})});ht.__InputValue=jd;var xg=new he.GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new he.GraphQLNonNull(Dt.GraphQLString),resolve:e=>e.name},description:{type:Dt.GraphQLString,resolve:e=>e.description},isDeprecated:{type:new he.GraphQLNonNull(Dt.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:Dt.GraphQLString,resolve:e=>e.deprecationReason}})});ht.__EnumValue=xg;var _n;ht.TypeKind=_n;(function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"})(_n||(ht.TypeKind=_n={}));var Pg=new he.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:_n.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:_n.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:_n.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:_n.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:_n.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:_n.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:_n.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:_n.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});ht.__TypeKind=Pg;var D1={name:"__schema",type:new he.GraphQLNonNull(Fg),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};ht.SchemaMetaFieldDef=D1;var O1={name:"__type",type:zr,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new he.GraphQLNonNull(Dt.GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};ht.TypeMetaFieldDef=O1;var A1={name:"__typename",type:new he.GraphQLNonNull(Dt.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};ht.TypeNameMetaFieldDef=A1;var Aw=Object.freeze([Fg,Lg,Rg,zr,kg,jd,xg,Pg]);ht.introspectionTypes=Aw;function w1(e){return Aw.some(({name:t})=>e.name===t)}});var Lw=L(oc=>{"use strict";d();f();p();Object.defineProperty(oc,"__esModule",{value:!0});oc.GraphQLSchema=void 0;oc.assertSchema=x1;oc.isSchema=Fw;var _h=Ra(),Ug=un(),F1=Wm(),L1=Uo(),R1=th(),Mg=tc(),mi=kt(),ww=qo(),k1=Gd();function Fw(e){return(0,F1.instanceOf)(e,bh)}function x1(e){if(!Fw(e))throw new Error(`Expected ${(0,Ug.inspect)(e)} to be a GraphQL schema.`);return e}var bh=class{constructor(t){var n,r;this.__validationErrors=t.assumeValid===!0?[]:void 0,(0,L1.isObjectLike)(t)||(0,_h.devAssert)(!1,"Must provide configuration object."),!t.types||Array.isArray(t.types)||(0,_h.devAssert)(!1,`"types" must be Array if provided but got: ${(0,Ug.inspect)(t.types)}.`),!t.directives||Array.isArray(t.directives)||(0,_h.devAssert)(!1,`"directives" must be Array if provided but got: ${(0,Ug.inspect)(t.directives)}.`),this.description=t.description,this.extensions=(0,R1.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(r=t.directives)!==null&&r!==void 0?r:ww.specifiedDirectives;let i=new Set(t.types);if(t.types!=null)for(let s of t.types)i.delete(s),hi(s,i);this._queryType!=null&&hi(this._queryType,i),this._mutationType!=null&&hi(this._mutationType,i),this._subscriptionType!=null&&hi(this._subscriptionType,i);for(let s of this._directives)if((0,ww.isDirective)(s))for(let o of s.args)hi(o.type,i);hi(k1.__Schema,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let s of i){if(s==null)continue;let o=s.name;if(o||(0,_h.devAssert)(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[o]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${o}".`);if(this._typeMap[o]=s,(0,mi.isInterfaceType)(s)){for(let a of s.getInterfaces())if((0,mi.isInterfaceType)(a)){let u=this._implementationsMap[a.name];u===void 0&&(u=this._implementationsMap[a.name]={objects:[],interfaces:[]}),u.interfaces.push(s)}}else if((0,mi.isObjectType)(s)){for(let a of s.getInterfaces())if((0,mi.isInterfaceType)(a)){let u=this._implementationsMap[a.name];u===void 0&&(u=this._implementationsMap[a.name]={objects:[],interfaces:[]}),u.objects.push(s)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case Mg.OperationTypeNode.QUERY:return this.getQueryType();case Mg.OperationTypeNode.MUTATION:return this.getMutationType();case Mg.OperationTypeNode.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return(0,mi.isUnionType)(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){let n=this._implementationsMap[t.name];return n!=null?n:{objects:[],interfaces:[]}}isSubType(t,n){let r=this._subTypeMap[t.name];if(r===void 0){if(r=Object.create(null),(0,mi.isUnionType)(t))for(let i of t.getTypes())r[i.name]=!0;else{let i=this.getImplementations(t);for(let s of i.objects)r[s.name]=!0;for(let s of i.interfaces)r[s.name]=!0}this._subTypeMap[t.name]=r}return r[n.name]!==void 0}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(n=>n.name===t)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}};oc.GraphQLSchema=bh;function hi(e,t){let n=(0,mi.getNamedType)(e);if(!t.has(n)){if(t.add(n),(0,mi.isUnionType)(n))for(let r of n.getTypes())hi(r,t);else if((0,mi.isObjectType)(n)||(0,mi.isInterfaceType)(n)){for(let r of n.getInterfaces())hi(r,t);for(let r of Object.values(n.getFields())){hi(r.type,t);for(let i of r.args)hi(i.type,t)}}else if((0,mi.isInputObjectType)(n))for(let r of Object.values(n.getFields()))hi(r.type,t)}return t}});var Cw=L(Sh=>{"use strict";d();f();p();Object.defineProperty(Sh,"__esModule",{value:!0});Sh.assertValidSchema=C1;Sh.validateSchema=Uw;var Zn=un(),P1=Ge(),Cg=tc(),Rw=Eh(),cn=kt(),Mw=qo(),M1=Gd(),U1=Lw();function Uw(e){if((0,U1.assertSchema)(e),e.__validationErrors)return e.__validationErrors;let t=new $g(e);B1(t),$1(t),V1(t);let n=t.getErrors();return e.__validationErrors=n,n}function C1(e){let t=Uw(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(` -`))}var yI=class{constructor(t){this._errors=[],this.schema=t}reportError(t,n){let r=Array.isArray(n)?n.filter(Boolean):n;this._errors.push(new Q2.GraphQLError(t,{nodes:r}))}getErrors(){return this._errors}};function X2(e){let t=e.schema,n=t.getQueryType();if(!n)e.reportError("Query root type must be provided.",t.astNode);else if(!(0,bn.isObjectType)(n)){var r;e.reportError(`Query root type must be Object type, it cannot be ${(0,dr.inspect)(n)}.`,(r=hI(t,mI.OperationTypeNode.QUERY))!==null&&r!==void 0?r:n.astNode)}let i=t.getMutationType();if(i&&!(0,bn.isObjectType)(i)){var o;e.reportError(`Mutation root type must be Object type if provided, it cannot be ${(0,dr.inspect)(i)}.`,(o=hI(t,mI.OperationTypeNode.MUTATION))!==null&&o!==void 0?o:i.astNode)}let s=t.getSubscriptionType();if(s&&!(0,bn.isObjectType)(s)){var a;e.reportError(`Subscription root type must be Object type if provided, it cannot be ${(0,dr.inspect)(s)}.`,(a=hI(t,mI.OperationTypeNode.SUBSCRIPTION))!==null&&a!==void 0?a:s.astNode)}}function hI(e,t){var n;return(n=[e.astNode,...e.extensionASTNodes].flatMap(r=>{var i;return(i=r==null?void 0:r.operationTypes)!==null&&i!==void 0?i:[]}).find(r=>r.operation===t))===null||n===void 0?void 0:n.type}function H2(e){for(let n of e.schema.getDirectives()){if(!(0,sF.isDirective)(n)){e.reportError(`Expected directive but got: ${(0,dr.inspect)(n)}.`,n==null?void 0:n.astNode);continue}hu(e,n);for(let r of n.args)if(hu(e,r),(0,bn.isInputType)(r.type)||e.reportError(`The type of @${n.name}(${r.name}:) must be Input Type but got: ${(0,dr.inspect)(r.type)}.`,r.astNode),(0,bn.isRequiredArgument)(r)&&r.deprecationReason!=null){var t;e.reportError(`Required argument @${n.name}(${r.name}:) cannot be deprecated.`,[TI(r.astNode),(t=r.astNode)===null||t===void 0?void 0:t.type])}}}function hu(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function W2(e){let t=iY(e),n=e.schema.getTypeMap();for(let r of Object.values(n)){if(!(0,bn.isNamedType)(r)){e.reportError(`Expected GraphQL named type but got: ${(0,dr.inspect)(r)}.`,r.astNode);continue}(0,Y2.isIntrospectionType)(r)||hu(e,r),(0,bn.isObjectType)(r)||(0,bn.isInterfaceType)(r)?(rF(e,r),iF(e,r)):(0,bn.isUnionType)(r)?tY(e,r):(0,bn.isEnumType)(r)?nY(e,r):(0,bn.isInputObjectType)(r)&&(rY(e,r),t(r))}}function rF(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let s of n){if(hu(e,s),!(0,bn.isOutputType)(s.type)){var r;e.reportError(`The type of ${t.name}.${s.name} must be Output Type but got: ${(0,dr.inspect)(s.type)}.`,(r=s.astNode)===null||r===void 0?void 0:r.type)}for(let a of s.args){let c=a.name;if(hu(e,a),!(0,bn.isInputType)(a.type)){var i;e.reportError(`The type of ${t.name}.${s.name}(${c}:) must be Input Type but got: ${(0,dr.inspect)(a.type)}.`,(i=a.astNode)===null||i===void 0?void 0:i.type)}if((0,bn.isRequiredArgument)(a)&&a.deprecationReason!=null){var o;e.reportError(`Required argument ${t.name}.${s.name}(${c}:) cannot be deprecated.`,[TI(a.astNode),(o=a.astNode)===null||o===void 0?void 0:o.type])}}}}function iF(e,t){let n=Object.create(null);for(let r of t.getInterfaces()){if(!(0,bn.isInterfaceType)(r)){e.reportError(`Type ${(0,dr.inspect)(t)} must only implement Interface types, it cannot implement ${(0,dr.inspect)(r)}.`,kd(t,r));continue}if(t===r){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,kd(t,r));continue}if(n[r.name]){e.reportError(`Type ${t.name} can only implement ${r.name} once.`,kd(t,r));continue}n[r.name]=!0,eY(e,t,r),Z2(e,t,r)}}function Z2(e,t,n){let r=t.getFields();for(let c of Object.values(n.getFields())){let u=c.name,l=r[u];if(!l){e.reportError(`Interface field ${n.name}.${u} expected but ${t.name} does not provide it.`,[c.astNode,t.astNode,...t.extensionASTNodes]);continue}if(!(0,nF.isTypeSubTypeOf)(e.schema,l.type,c.type)){var i,o;e.reportError(`Interface field ${n.name}.${u} expects type ${(0,dr.inspect)(c.type)} but ${t.name}.${u} is type ${(0,dr.inspect)(l.type)}.`,[(i=c.astNode)===null||i===void 0?void 0:i.type,(o=l.astNode)===null||o===void 0?void 0:o.type])}for(let p of c.args){let h=p.name,y=l.args.find(N=>N.name===h);if(!y){e.reportError(`Interface field argument ${n.name}.${u}(${h}:) expected but ${t.name}.${u} does not provide it.`,[p.astNode,l.astNode]);continue}if(!(0,nF.isEqualType)(p.type,y.type)){var s,a;e.reportError(`Interface field argument ${n.name}.${u}(${h}:) expects type ${(0,dr.inspect)(p.type)} but ${t.name}.${u}(${h}:) is type ${(0,dr.inspect)(y.type)}.`,[(s=p.astNode)===null||s===void 0?void 0:s.type,(a=y.astNode)===null||a===void 0?void 0:a.type])}}for(let p of l.args){let h=p.name;!c.args.find(N=>N.name===h)&&(0,bn.isRequiredArgument)(p)&&e.reportError(`Object field ${t.name}.${u} includes required argument ${h} that is missing from the Interface field ${n.name}.${u}.`,[p.astNode,c.astNode])}}}function eY(e,t,n){let r=t.getInterfaces();for(let i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...kd(n,i),...kd(t,n)])}function tY(e,t){let n=t.getTypes();n.length===0&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let r=Object.create(null);for(let i of n){if(r[i.name]){e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,oF(t,i.name));continue}r[i.name]=!0,(0,bn.isObjectType)(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${(0,dr.inspect)(i)}.`,oF(t,String(i)))}}function nY(e,t){let n=t.getValues();n.length===0&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(let r of n)hu(e,r)}function rY(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let o of n){if(hu(e,o),!(0,bn.isInputType)(o.type)){var r;e.reportError(`The type of ${t.name}.${o.name} must be Input Type but got: ${(0,dr.inspect)(o.type)}.`,(r=o.astNode)===null||r===void 0?void 0:r.type)}if((0,bn.isRequiredInputField)(o)&&o.deprecationReason!=null){var i;e.reportError(`Required input field ${t.name}.${o.name} cannot be deprecated.`,[TI(o.astNode),(i=o.astNode)===null||i===void 0?void 0:i.type])}}}function iY(e){let t=Object.create(null),n=[],r=Object.create(null);return i;function i(o){if(t[o.name])return;t[o.name]=!0,r[o.name]=n.length;let s=Object.values(o.getFields());for(let a of s)if((0,bn.isNonNullType)(a.type)&&(0,bn.isInputObjectType)(a.type.ofType)){let c=a.type.ofType,u=r[c.name];if(n.push(a),u===void 0)i(c);else{let l=n.slice(u),p=l.map(h=>h.name).join(".");e.reportError(`Cannot reference Input Object "${c.name}" within itself through a series of non-null fields: "${p}".`,l.map(h=>h.astNode))}n.pop()}r[o.name]=void 0}}function kd(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n!=null?[n,...r]:r).flatMap(o=>{var s;return(s=o.interfaces)!==null&&s!==void 0?s:[]}).filter(o=>o.name.value===t.name)}function oF(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n!=null?[n,...r]:r).flatMap(o=>{var s;return(s=o.types)!==null&&s!==void 0?s:[]}).filter(o=>o.name.value===t)}function TI(e){var t;return e==null||(t=e.directives)===null||t===void 0?void 0:t.find(n=>n.name.value===sF.GraphQLDeprecatedDirective.name)}});var go=F(gI=>{"use strict";d();m();f();Object.defineProperty(gI,"__esModule",{value:!0});gI.typeFromAST=NI;var EI=It(),uF=yt();function NI(e,t){switch(t.kind){case EI.Kind.LIST_TYPE:{let n=NI(e,t.type);return n&&new uF.GraphQLList(n)}case EI.Kind.NON_NULL_TYPE:{let n=NI(e,t.type);return n&&new uF.GraphQLNonNull(n)}case EI.Kind.NAMED_TYPE:return e.getType(t.name.value)}}});var Sy=F(xd=>{"use strict";d();m();f();Object.defineProperty(xd,"__esModule",{value:!0});xd.TypeInfo=void 0;xd.visitWithTypeInfo=aY;var oY=yo(),En=It(),cF=au(),Nn=yt(),Gc=Ti(),lF=go(),vI=class{constructor(t,n,r){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=r!=null?r:sY,n&&((0,Nn.isInputType)(n)&&this._inputTypeStack.push(n),(0,Nn.isCompositeType)(n)&&this._parentTypeStack.push(n),(0,Nn.isOutputType)(n)&&this._typeStack.push(n))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(t){let n=this._schema;switch(t.kind){case En.Kind.SELECTION_SET:{let i=(0,Nn.getNamedType)(this.getType());this._parentTypeStack.push((0,Nn.isCompositeType)(i)?i:void 0);break}case En.Kind.FIELD:{let i=this.getParentType(),o,s;i&&(o=this._getFieldDef(n,i,t),o&&(s=o.type)),this._fieldDefStack.push(o),this._typeStack.push((0,Nn.isOutputType)(s)?s:void 0);break}case En.Kind.DIRECTIVE:this._directive=n.getDirective(t.name.value);break;case En.Kind.OPERATION_DEFINITION:{let i=n.getRootType(t.operation);this._typeStack.push((0,Nn.isObjectType)(i)?i:void 0);break}case En.Kind.INLINE_FRAGMENT:case En.Kind.FRAGMENT_DEFINITION:{let i=t.typeCondition,o=i?(0,lF.typeFromAST)(n,i):(0,Nn.getNamedType)(this.getType());this._typeStack.push((0,Nn.isOutputType)(o)?o:void 0);break}case En.Kind.VARIABLE_DEFINITION:{let i=(0,lF.typeFromAST)(n,t.type);this._inputTypeStack.push((0,Nn.isInputType)(i)?i:void 0);break}case En.Kind.ARGUMENT:{var r;let i,o,s=(r=this.getDirective())!==null&&r!==void 0?r:this.getFieldDef();s&&(i=s.args.find(a=>a.name===t.name.value),i&&(o=i.type)),this._argument=i,this._defaultValueStack.push(i?i.defaultValue:void 0),this._inputTypeStack.push((0,Nn.isInputType)(o)?o:void 0);break}case En.Kind.LIST:{let i=(0,Nn.getNullableType)(this.getInputType()),o=(0,Nn.isListType)(i)?i.ofType:i;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,Nn.isInputType)(o)?o:void 0);break}case En.Kind.OBJECT_FIELD:{let i=(0,Nn.getNamedType)(this.getInputType()),o,s;(0,Nn.isInputObjectType)(i)&&(s=i.getFields()[t.name.value],s&&(o=s.type)),this._defaultValueStack.push(s?s.defaultValue:void 0),this._inputTypeStack.push((0,Nn.isInputType)(o)?o:void 0);break}case En.Kind.ENUM:{let i=(0,Nn.getNamedType)(this.getInputType()),o;(0,Nn.isEnumType)(i)&&(o=i.getValue(t.value)),this._enumValue=o;break}default:}}leave(t){switch(t.kind){case En.Kind.SELECTION_SET:this._parentTypeStack.pop();break;case En.Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case En.Kind.DIRECTIVE:this._directive=null;break;case En.Kind.OPERATION_DEFINITION:case En.Kind.INLINE_FRAGMENT:case En.Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case En.Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case En.Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case En.Kind.LIST:case En.Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case En.Kind.ENUM:this._enumValue=null;break;default:}}};xd.TypeInfo=vI;function sY(e,t,n){let r=n.name.value;if(r===Gc.SchemaMetaFieldDef.name&&e.getQueryType()===t)return Gc.SchemaMetaFieldDef;if(r===Gc.TypeMetaFieldDef.name&&e.getQueryType()===t)return Gc.TypeMetaFieldDef;if(r===Gc.TypeNameMetaFieldDef.name&&(0,Nn.isCompositeType)(t))return Gc.TypeNameMetaFieldDef;if((0,Nn.isObjectType)(t)||(0,Nn.isInterfaceType)(t))return t.getFields()[r]}function aY(e,t){return{enter(...n){let r=n[0];e.enter(r);let i=(0,cF.getEnterLeaveForKind)(t,r.kind).enter;if(i){let o=i.apply(t,n);return o!==void 0&&(e.leave(r),(0,oY.isNode)(o)&&e.enter(o)),o}},leave(...n){let r=n[0],i=(0,cF.getEnterLeaveForKind)(t,r.kind).leave,o;return i&&(o=i.apply(t,n)),e.leave(r),o}}}});var yu=F(Ei=>{"use strict";d();m();f();Object.defineProperty(Ei,"__esModule",{value:!0});Ei.isConstValueNode=II;Ei.isDefinitionNode=uY;Ei.isExecutableDefinitionNode=pF;Ei.isSelectionNode=cY;Ei.isTypeDefinitionNode=mF;Ei.isTypeExtensionNode=yF;Ei.isTypeNode=lY;Ei.isTypeSystemDefinitionNode=fF;Ei.isTypeSystemExtensionNode=hF;Ei.isValueNode=dF;var Tt=It();function uY(e){return pF(e)||fF(e)||hF(e)}function pF(e){return e.kind===Tt.Kind.OPERATION_DEFINITION||e.kind===Tt.Kind.FRAGMENT_DEFINITION}function cY(e){return e.kind===Tt.Kind.FIELD||e.kind===Tt.Kind.FRAGMENT_SPREAD||e.kind===Tt.Kind.INLINE_FRAGMENT}function dF(e){return e.kind===Tt.Kind.VARIABLE||e.kind===Tt.Kind.INT||e.kind===Tt.Kind.FLOAT||e.kind===Tt.Kind.STRING||e.kind===Tt.Kind.BOOLEAN||e.kind===Tt.Kind.NULL||e.kind===Tt.Kind.ENUM||e.kind===Tt.Kind.LIST||e.kind===Tt.Kind.OBJECT}function II(e){return dF(e)&&(e.kind===Tt.Kind.LIST?e.values.some(II):e.kind===Tt.Kind.OBJECT?e.fields.some(t=>II(t.value)):e.kind!==Tt.Kind.VARIABLE)}function lY(e){return e.kind===Tt.Kind.NAMED_TYPE||e.kind===Tt.Kind.LIST_TYPE||e.kind===Tt.Kind.NON_NULL_TYPE}function fF(e){return e.kind===Tt.Kind.SCHEMA_DEFINITION||mF(e)||e.kind===Tt.Kind.DIRECTIVE_DEFINITION}function mF(e){return e.kind===Tt.Kind.SCALAR_TYPE_DEFINITION||e.kind===Tt.Kind.OBJECT_TYPE_DEFINITION||e.kind===Tt.Kind.INTERFACE_TYPE_DEFINITION||e.kind===Tt.Kind.UNION_TYPE_DEFINITION||e.kind===Tt.Kind.ENUM_TYPE_DEFINITION||e.kind===Tt.Kind.INPUT_OBJECT_TYPE_DEFINITION}function hF(e){return e.kind===Tt.Kind.SCHEMA_EXTENSION||yF(e)}function yF(e){return e.kind===Tt.Kind.SCALAR_TYPE_EXTENSION||e.kind===Tt.Kind.OBJECT_TYPE_EXTENSION||e.kind===Tt.Kind.INTERFACE_TYPE_EXTENSION||e.kind===Tt.Kind.UNION_TYPE_EXTENSION||e.kind===Tt.Kind.ENUM_TYPE_EXTENSION||e.kind===Tt.Kind.INPUT_OBJECT_TYPE_EXTENSION}});var _I=F(bI=>{"use strict";d();m();f();Object.defineProperty(bI,"__esModule",{value:!0});bI.ExecutableDefinitionsRule=fY;var pY=$e(),TF=It(),dY=yu();function fY(e){return{Document(t){for(let n of t.definitions)if(!(0,dY.isExecutableDefinitionNode)(n)){let r=n.kind===TF.Kind.SCHEMA_DEFINITION||n.kind===TF.Kind.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new pY.GraphQLError(`The ${r} definition is not executable.`,{nodes:n}))}return!1}}}});var SI=F(OI=>{"use strict";d();m();f();Object.defineProperty(OI,"__esModule",{value:!0});OI.FieldsOnCorrectTypeRule=TY;var EF=ma(),mY=hd(),hY=ya(),yY=$e(),Cd=yt();function TY(e){return{Field(t){let n=e.getParentType();if(n&&!e.getFieldDef()){let i=e.getSchema(),o=t.name.value,s=(0,EF.didYouMean)("to use an inline fragment on",EY(i,n,o));s===""&&(s=(0,EF.didYouMean)(NY(n,o))),e.reportError(new yY.GraphQLError(`Cannot query field "${o}" on type "${n.name}".`+s,{nodes:t}))}}}}function EY(e,t,n){if(!(0,Cd.isAbstractType)(t))return[];let r=new Set,i=Object.create(null);for(let s of e.getPossibleTypes(t))if(s.getFields()[n]){r.add(s),i[s.name]=1;for(let a of s.getInterfaces()){var o;a.getFields()[n]&&(r.add(a),i[a.name]=((o=i[a.name])!==null&&o!==void 0?o:0)+1)}}return[...r].sort((s,a)=>{let c=i[a.name]-i[s.name];return c!==0?c:(0,Cd.isInterfaceType)(s)&&e.isSubType(s,a)?-1:(0,Cd.isInterfaceType)(a)&&e.isSubType(a,s)?1:(0,mY.naturalCompare)(s.name,a.name)}).map(s=>s.name)}function NY(e,t){if((0,Cd.isObjectType)(e)||(0,Cd.isInterfaceType)(e)){let n=Object.keys(e.getFields());return(0,hY.suggestionList)(t,n)}return[]}});var AI=F(DI=>{"use strict";d();m();f();Object.defineProperty(DI,"__esModule",{value:!0});DI.FragmentsOnCompositeTypesRule=gY;var NF=$e(),gF=Hr(),vF=yt(),IF=go();function gY(e){return{InlineFragment(t){let n=t.typeCondition;if(n){let r=(0,IF.typeFromAST)(e.getSchema(),n);if(r&&!(0,vF.isCompositeType)(r)){let i=(0,gF.print)(n);e.reportError(new NF.GraphQLError(`Fragment cannot condition on non composite type "${i}".`,{nodes:n}))}}},FragmentDefinition(t){let n=(0,IF.typeFromAST)(e.getSchema(),t.typeCondition);if(n&&!(0,vF.isCompositeType)(n)){let r=(0,gF.print)(t.typeCondition);e.reportError(new NF.GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${r}".`,{nodes:t.typeCondition}))}}}}});var wI=F(Dy=>{"use strict";d();m();f();Object.defineProperty(Dy,"__esModule",{value:!0});Dy.KnownArgumentNamesOnDirectivesRule=SF;Dy.KnownArgumentNamesRule=bY;var bF=ma(),_F=ya(),OF=$e(),vY=It(),IY=Pr();function bY(e){return x(D({},SF(e)),{Argument(t){let n=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!n&&r&&i){let o=t.name.value,s=r.args.map(c=>c.name),a=(0,_F.suggestionList)(o,s);e.reportError(new OF.GraphQLError(`Unknown argument "${o}" on field "${i.name}.${r.name}".`+(0,bF.didYouMean)(a),{nodes:t}))}}})}function SF(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():IY.specifiedDirectives;for(let s of r)t[s.name]=s.args.map(a=>a.name);let i=e.getDocument().definitions;for(let s of i)if(s.kind===vY.Kind.DIRECTIVE_DEFINITION){var o;let a=(o=s.arguments)!==null&&o!==void 0?o:[];t[s.name.value]=a.map(c=>c.name.value)}return{Directive(s){let a=s.name.value,c=t[a];if(s.arguments&&c)for(let u of s.arguments){let l=u.name.value;if(!c.includes(l)){let p=(0,_F.suggestionList)(l,c);e.reportError(new OF.GraphQLError(`Unknown argument "${l}" on directive "@${a}".`+(0,bF.didYouMean)(p),{nodes:u}))}}return!1}}}});var kI=F(FI=>{"use strict";d();m();f();Object.defineProperty(FI,"__esModule",{value:!0});FI.KnownDirectivesRule=SY;var _Y=Ct(),RI=lr(),DF=$e(),LI=yo(),Mn=Vc(),Xt=It(),OY=Pr();function SY(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():OY.specifiedDirectives;for(let o of r)t[o.name]=o.locations;let i=e.getDocument().definitions;for(let o of i)o.kind===Xt.Kind.DIRECTIVE_DEFINITION&&(t[o.name.value]=o.locations.map(s=>s.value));return{Directive(o,s,a,c,u){let l=o.name.value,p=t[l];if(!p){e.reportError(new DF.GraphQLError(`Unknown directive "@${l}".`,{nodes:o}));return}let h=DY(u);h&&!p.includes(h)&&e.reportError(new DF.GraphQLError(`Directive "@${l}" may not be used on ${h}.`,{nodes:o}))}}}function DY(e){let t=e[e.length-1];switch("kind"in t||(0,RI.invariant)(!1),t.kind){case Xt.Kind.OPERATION_DEFINITION:return AY(t.operation);case Xt.Kind.FIELD:return Mn.DirectiveLocation.FIELD;case Xt.Kind.FRAGMENT_SPREAD:return Mn.DirectiveLocation.FRAGMENT_SPREAD;case Xt.Kind.INLINE_FRAGMENT:return Mn.DirectiveLocation.INLINE_FRAGMENT;case Xt.Kind.FRAGMENT_DEFINITION:return Mn.DirectiveLocation.FRAGMENT_DEFINITION;case Xt.Kind.VARIABLE_DEFINITION:return Mn.DirectiveLocation.VARIABLE_DEFINITION;case Xt.Kind.SCHEMA_DEFINITION:case Xt.Kind.SCHEMA_EXTENSION:return Mn.DirectiveLocation.SCHEMA;case Xt.Kind.SCALAR_TYPE_DEFINITION:case Xt.Kind.SCALAR_TYPE_EXTENSION:return Mn.DirectiveLocation.SCALAR;case Xt.Kind.OBJECT_TYPE_DEFINITION:case Xt.Kind.OBJECT_TYPE_EXTENSION:return Mn.DirectiveLocation.OBJECT;case Xt.Kind.FIELD_DEFINITION:return Mn.DirectiveLocation.FIELD_DEFINITION;case Xt.Kind.INTERFACE_TYPE_DEFINITION:case Xt.Kind.INTERFACE_TYPE_EXTENSION:return Mn.DirectiveLocation.INTERFACE;case Xt.Kind.UNION_TYPE_DEFINITION:case Xt.Kind.UNION_TYPE_EXTENSION:return Mn.DirectiveLocation.UNION;case Xt.Kind.ENUM_TYPE_DEFINITION:case Xt.Kind.ENUM_TYPE_EXTENSION:return Mn.DirectiveLocation.ENUM;case Xt.Kind.ENUM_VALUE_DEFINITION:return Mn.DirectiveLocation.ENUM_VALUE;case Xt.Kind.INPUT_OBJECT_TYPE_DEFINITION:case Xt.Kind.INPUT_OBJECT_TYPE_EXTENSION:return Mn.DirectiveLocation.INPUT_OBJECT;case Xt.Kind.INPUT_VALUE_DEFINITION:{let n=e[e.length-3];return"kind"in n||(0,RI.invariant)(!1),n.kind===Xt.Kind.INPUT_OBJECT_TYPE_DEFINITION?Mn.DirectiveLocation.INPUT_FIELD_DEFINITION:Mn.DirectiveLocation.ARGUMENT_DEFINITION}default:(0,RI.invariant)(!1,"Unexpected kind: "+(0,_Y.inspect)(t.kind))}}function AY(e){switch(e){case LI.OperationTypeNode.QUERY:return Mn.DirectiveLocation.QUERY;case LI.OperationTypeNode.MUTATION:return Mn.DirectiveLocation.MUTATION;case LI.OperationTypeNode.SUBSCRIPTION:return Mn.DirectiveLocation.SUBSCRIPTION}}});var xI=F(PI=>{"use strict";d();m();f();Object.defineProperty(PI,"__esModule",{value:!0});PI.KnownFragmentNamesRule=RY;var wY=$e();function RY(e){return{FragmentSpread(t){let n=t.name.value;e.getFragment(n)||e.reportError(new wY.GraphQLError(`Unknown fragment "${n}".`,{nodes:t.name}))}}}});var UI=F(MI=>{"use strict";d();m();f();Object.defineProperty(MI,"__esModule",{value:!0});MI.KnownTypeNamesRule=CY;var LY=ma(),FY=ya(),kY=$e(),CI=yu(),PY=Ti(),xY=No();function CY(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);for(let o of e.getDocument().definitions)(0,CI.isTypeDefinitionNode)(o)&&(r[o.name.value]=!0);let i=[...Object.keys(n),...Object.keys(r)];return{NamedType(o,s,a,c,u){let l=o.name.value;if(!n[l]&&!r[l]){var p;let h=(p=u[2])!==null&&p!==void 0?p:a,y=h!=null&&MY(h);if(y&&AF.includes(l))return;let N=(0,FY.suggestionList)(l,y?AF.concat(i):i);e.reportError(new kY.GraphQLError(`Unknown type "${l}".`+(0,LY.didYouMean)(N),{nodes:o}))}}}}var AF=[...xY.specifiedScalarTypes,...PY.introspectionTypes].map(e=>e.name);function MY(e){return"kind"in e&&((0,CI.isTypeSystemDefinitionNode)(e)||(0,CI.isTypeSystemExtensionNode)(e))}});var VI=F(jI=>{"use strict";d();m();f();Object.defineProperty(jI,"__esModule",{value:!0});jI.LoneAnonymousOperationRule=VY;var UY=$e(),jY=It();function VY(e){let t=0;return{Document(n){t=n.definitions.filter(r=>r.kind===jY.Kind.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new UY.GraphQLError("This anonymous operation must be the only defined operation.",{nodes:n}))}}}});var GI=F($I=>{"use strict";d();m();f();Object.defineProperty($I,"__esModule",{value:!0});$I.LoneSchemaDefinitionRule=$Y;var wF=$e();function $Y(e){var t,n,r;let i=e.getSchema(),o=(t=(n=(r=i==null?void 0:i.astNode)!==null&&r!==void 0?r:i==null?void 0:i.getQueryType())!==null&&n!==void 0?n:i==null?void 0:i.getMutationType())!==null&&t!==void 0?t:i==null?void 0:i.getSubscriptionType(),s=0;return{SchemaDefinition(a){if(o){e.reportError(new wF.GraphQLError("Cannot define a new schema within a schema extension.",{nodes:a}));return}s>0&&e.reportError(new wF.GraphQLError("Must provide only one schema definition.",{nodes:a})),++s}}}});var BI=F(qI=>{"use strict";d();m();f();Object.defineProperty(qI,"__esModule",{value:!0});qI.NoFragmentCyclesRule=qY;var GY=$e();function qY(e){let t=Object.create(null),n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(o){return i(o),!1}};function i(o){if(t[o.name.value])return;let s=o.name.value;t[s]=!0;let a=e.getFragmentSpreads(o.selectionSet);if(a.length!==0){r[s]=n.length;for(let c of a){let u=c.name.value,l=r[u];if(n.push(c),l===void 0){let p=e.getFragment(u);p&&i(p)}else{let p=n.slice(l),h=p.slice(0,-1).map(y=>'"'+y.name.value+'"').join(", ");e.reportError(new GY.GraphQLError(`Cannot spread fragment "${u}" within itself`+(h!==""?` via ${h}.`:"."),{nodes:p}))}n.pop()}r[s]=void 0}}}});var QI=F(KI=>{"use strict";d();m();f();Object.defineProperty(KI,"__esModule",{value:!0});KI.NoUndefinedVariablesRule=KY;var BY=$e();function KY(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i}of r){let o=i.name.value;t[o]!==!0&&e.reportError(new BY.GraphQLError(n.name?`Variable "$${o}" is not defined by operation "${n.name.value}".`:`Variable "$${o}" is not defined.`,{nodes:[i,n]}))}}},VariableDefinition(n){t[n.variable.name.value]=!0}}}});var JI=F(YI=>{"use strict";d();m();f();Object.defineProperty(YI,"__esModule",{value:!0});YI.NoUnusedFragmentsRule=YY;var QY=$e();function YY(e){let t=[],n=[];return{OperationDefinition(r){return t.push(r),!1},FragmentDefinition(r){return n.push(r),!1},Document:{leave(){let r=Object.create(null);for(let i of t)for(let o of e.getRecursivelyReferencedFragments(i))r[o.name.value]=!0;for(let i of n){let o=i.name.value;r[o]!==!0&&e.reportError(new QY.GraphQLError(`Fragment "${o}" is never used.`,{nodes:i}))}}}}}});var XI=F(zI=>{"use strict";d();m();f();Object.defineProperty(zI,"__esModule",{value:!0});zI.NoUnusedVariablesRule=zY;var JY=$e();function zY(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(n){let r=Object.create(null),i=e.getRecursiveVariableUsages(n);for(let{node:o}of i)r[o.name.value]=!0;for(let o of t){let s=o.variable.name.value;r[s]!==!0&&e.reportError(new JY.GraphQLError(n.name?`Variable "$${s}" is never used in operation "${n.name.value}".`:`Variable "$${s}" is never used.`,{nodes:o}))}}},VariableDefinition(n){t.push(n)}}}});var ZI=F(WI=>{"use strict";d();m();f();Object.defineProperty(WI,"__esModule",{value:!0});WI.sortValueNode=HI;var XY=hd(),es=It();function HI(e){switch(e.kind){case es.Kind.OBJECT:return x(D({},e),{fields:HY(e.fields)});case es.Kind.LIST:return x(D({},e),{values:e.values.map(HI)});case es.Kind.INT:case es.Kind.FLOAT:case es.Kind.STRING:case es.Kind.BOOLEAN:case es.Kind.NULL:case es.Kind.ENUM:case es.Kind.VARIABLE:return e}}function HY(e){return e.map(t=>x(D({},t),{value:HI(t.value)})).sort((t,n)=>(0,XY.naturalCompare)(t.name.value,n.name.value))}});var ob=F(ib=>{"use strict";d();m();f();Object.defineProperty(ib,"__esModule",{value:!0});ib.OverlappingFieldsCanBeMergedRule=tJ;var RF=Ct(),WY=$e(),Md=It(),ZY=Hr(),xr=yt(),eJ=ZI(),FF=go();function kF(e){return Array.isArray(e)?e.map(([t,n])=>`subfields "${t}" conflict because `+kF(n)).join(" and "):e}function tJ(e){let t=new nb,n=new Map;return{SelectionSet(r){let i=nJ(e,n,t,e.getParentType(),r);for(let[[o,s],a,c]of i){let u=kF(s);e.reportError(new WY.GraphQLError(`Fields "${o}" conflict because ${u}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:a.concat(c)}))}}}}function nJ(e,t,n,r,i){let o=[],[s,a]=Ry(e,t,r,i);if(iJ(e,o,t,n,s),a.length!==0)for(let c=0;c1)for(let a=0;a({kind:Md.Kind.OBJECT_FIELD,name:i.name,value:i.value}))};return(0,ZY.print)((0,eJ.sortValueNode)(r))}function eb(e,t){return(0,xr.isListType)(e)?(0,xr.isListType)(t)?eb(e.ofType,t.ofType):!0:(0,xr.isListType)(t)?!0:(0,xr.isNonNullType)(e)?(0,xr.isNonNullType)(t)?eb(e.ofType,t.ofType):!0:(0,xr.isNonNullType)(t)?!0:(0,xr.isLeafType)(e)||(0,xr.isLeafType)(t)?e!==t:!1}function Ry(e,t,n,r){let i=t.get(r);if(i)return i;let o=Object.create(null),s=Object.create(null);xF(e,n,r,o,s);let a=[o,Object.keys(s)];return t.set(r,a),a}function tb(e,t,n){let r=t.get(n.selectionSet);if(r)return r;let i=(0,FF.typeFromAST)(e.getSchema(),n.typeCondition);return Ry(e,t,i,n.selectionSet)}function xF(e,t,n,r,i){for(let o of n.selections)switch(o.kind){case Md.Kind.FIELD:{let s=o.name.value,a;((0,xr.isObjectType)(t)||(0,xr.isInterfaceType)(t))&&(a=t.getFields()[s]);let c=o.alias?o.alias.value:s;r[c]||(r[c]=[]),r[c].push([t,o,a]);break}case Md.Kind.FRAGMENT_SPREAD:i[o.name.value]=!0;break;case Md.Kind.INLINE_FRAGMENT:{let s=o.typeCondition,a=s?(0,FF.typeFromAST)(e.getSchema(),s):t;xF(e,a,o.selectionSet,r,i);break}}}function oJ(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()]]}var nb=class{constructor(){this._data=new Map}has(t,n,r){var i;let[o,s]=t{"use strict";d();m();f();Object.defineProperty(ab,"__esModule",{value:!0});ab.PossibleFragmentSpreadsRule=aJ;var Ly=Ct(),CF=$e(),sb=yt(),MF=bd(),sJ=go();function aJ(e){return{InlineFragment(t){let n=e.getType(),r=e.getParentType();if((0,sb.isCompositeType)(n)&&(0,sb.isCompositeType)(r)&&!(0,MF.doTypesOverlap)(e.getSchema(),n,r)){let i=(0,Ly.inspect)(r),o=(0,Ly.inspect)(n);e.reportError(new CF.GraphQLError(`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=uJ(e,n),i=e.getParentType();if(r&&i&&!(0,MF.doTypesOverlap)(e.getSchema(),r,i)){let o=(0,Ly.inspect)(i),s=(0,Ly.inspect)(r);e.reportError(new CF.GraphQLError(`Fragment "${n}" cannot be spread here as objects of type "${o}" can never be of type "${s}".`,{nodes:t}))}}}}function uJ(e,t){let n=e.getFragment(t);if(n){let r=(0,sJ.typeFromAST)(e.getSchema(),n.typeCondition);if((0,sb.isCompositeType)(r))return r}}});var lb=F(cb=>{"use strict";d();m();f();Object.defineProperty(cb,"__esModule",{value:!0});cb.PossibleTypeExtensionsRule=dJ;var cJ=ma(),jF=Ct(),VF=lr(),lJ=ya(),UF=$e(),nn=It(),pJ=yu(),qc=yt();function dJ(e){let t=e.getSchema(),n=Object.create(null);for(let i of e.getDocument().definitions)(0,pJ.isTypeDefinitionNode)(i)&&(n[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[o],a=t==null?void 0:t.getType(o),c;if(s?c=fJ[s.kind]:a&&(c=mJ(a)),c){if(c!==i.kind){let u=hJ(i.kind);e.reportError(new UF.GraphQLError(`Cannot extend non-${u} type "${o}".`,{nodes:s?[s,i]:i}))}}else{let u=Object.keys(D(D({},n),t==null?void 0:t.getTypeMap())),l=(0,lJ.suggestionList)(o,u);e.reportError(new UF.GraphQLError(`Cannot extend type "${o}" because it is not defined.`+(0,cJ.didYouMean)(l),{nodes:i.name}))}}}var fJ={[nn.Kind.SCALAR_TYPE_DEFINITION]:nn.Kind.SCALAR_TYPE_EXTENSION,[nn.Kind.OBJECT_TYPE_DEFINITION]:nn.Kind.OBJECT_TYPE_EXTENSION,[nn.Kind.INTERFACE_TYPE_DEFINITION]:nn.Kind.INTERFACE_TYPE_EXTENSION,[nn.Kind.UNION_TYPE_DEFINITION]:nn.Kind.UNION_TYPE_EXTENSION,[nn.Kind.ENUM_TYPE_DEFINITION]:nn.Kind.ENUM_TYPE_EXTENSION,[nn.Kind.INPUT_OBJECT_TYPE_DEFINITION]:nn.Kind.INPUT_OBJECT_TYPE_EXTENSION};function mJ(e){if((0,qc.isScalarType)(e))return nn.Kind.SCALAR_TYPE_EXTENSION;if((0,qc.isObjectType)(e))return nn.Kind.OBJECT_TYPE_EXTENSION;if((0,qc.isInterfaceType)(e))return nn.Kind.INTERFACE_TYPE_EXTENSION;if((0,qc.isUnionType)(e))return nn.Kind.UNION_TYPE_EXTENSION;if((0,qc.isEnumType)(e))return nn.Kind.ENUM_TYPE_EXTENSION;if((0,qc.isInputObjectType)(e))return nn.Kind.INPUT_OBJECT_TYPE_EXTENSION;(0,VF.invariant)(!1,"Unexpected type: "+(0,jF.inspect)(e))}function hJ(e){switch(e){case nn.Kind.SCALAR_TYPE_EXTENSION:return"scalar";case nn.Kind.OBJECT_TYPE_EXTENSION:return"object";case nn.Kind.INTERFACE_TYPE_EXTENSION:return"interface";case nn.Kind.UNION_TYPE_EXTENSION:return"union";case nn.Kind.ENUM_TYPE_EXTENSION:return"enum";case nn.Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:(0,VF.invariant)(!1,"Unexpected kind: "+(0,jF.inspect)(e))}}});var db=F(Fy=>{"use strict";d();m();f();Object.defineProperty(Fy,"__esModule",{value:!0});Fy.ProvidedRequiredArgumentsOnDirectivesRule=KF;Fy.ProvidedRequiredArgumentsRule=EJ;var GF=Ct(),$F=ha(),qF=$e(),BF=It(),yJ=Hr(),pb=yt(),TJ=Pr();function EJ(e){return x(D({},KF(e)),{Field:{leave(t){var n;let r=e.getFieldDef();if(!r)return!1;let i=new Set((n=t.arguments)===null||n===void 0?void 0:n.map(o=>o.name.value));for(let o of r.args)if(!i.has(o.name)&&(0,pb.isRequiredArgument)(o)){let s=(0,GF.inspect)(o.type);e.reportError(new qF.GraphQLError(`Field "${r.name}" argument "${o.name}" of type "${s}" is required, but it was not provided.`,{nodes:t}))}}}})}function KF(e){var t;let n=Object.create(null),r=e.getSchema(),i=(t=r==null?void 0:r.getDirectives())!==null&&t!==void 0?t:TJ.specifiedDirectives;for(let a of i)n[a.name]=(0,$F.keyMap)(a.args.filter(pb.isRequiredArgument),c=>c.name);let o=e.getDocument().definitions;for(let a of o)if(a.kind===BF.Kind.DIRECTIVE_DEFINITION){var s;let c=(s=a.arguments)!==null&&s!==void 0?s:[];n[a.name.value]=(0,$F.keyMap)(c.filter(NJ),u=>u.name.value)}return{Directive:{leave(a){let c=a.name.value,u=n[c];if(u){var l;let p=(l=a.arguments)!==null&&l!==void 0?l:[],h=new Set(p.map(y=>y.name.value));for(let[y,N]of Object.entries(u))if(!h.has(y)){let O=(0,pb.isType)(N.type)?(0,GF.inspect)(N.type):(0,yJ.print)(N.type);e.reportError(new qF.GraphQLError(`Directive "@${c}" argument "${y}" of type "${O}" is required, but it was not provided.`,{nodes:a}))}}}}}}function NJ(e){return e.type.kind===BF.Kind.NON_NULL_TYPE&&e.defaultValue==null}});var mb=F(fb=>{"use strict";d();m();f();Object.defineProperty(fb,"__esModule",{value:!0});fb.ScalarLeafsRule=gJ;var QF=Ct(),YF=$e(),JF=yt();function gJ(e){return{Field(t){let n=e.getType(),r=t.selectionSet;if(n){if((0,JF.isLeafType)((0,JF.getNamedType)(n))){if(r){let i=t.name.value,o=(0,QF.inspect)(n);e.reportError(new YF.GraphQLError(`Field "${i}" must not have a selection since type "${o}" has no subfields.`,{nodes:r}))}}else if(!r){let i=t.name.value,o=(0,QF.inspect)(n);e.reportError(new YF.GraphQLError(`Field "${i}" of type "${o}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:t}))}}}}}});var yb=F(hb=>{"use strict";d();m();f();Object.defineProperty(hb,"__esModule",{value:!0});hb.printPathArray=vJ;function vJ(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}});var Ud=F(ky=>{"use strict";d();m();f();Object.defineProperty(ky,"__esModule",{value:!0});ky.addPath=IJ;ky.pathToArray=bJ;function IJ(e,t,n){return{prev:e,key:t,typename:n}}function bJ(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}});var Eb=F(Tb=>{"use strict";d();m();f();Object.defineProperty(Tb,"__esModule",{value:!0});Tb.coerceInputValue=RJ;var _J=ma(),Py=Ct(),OJ=lr(),SJ=Iy(),DJ=ho(),ts=Ud(),AJ=yb(),wJ=ya(),Tu=$e(),jd=yt();function RJ(e,t,n=LJ){return Vd(e,t,n,void 0)}function LJ(e,t,n){let r="Invalid value "+(0,Py.inspect)(t);throw e.length>0&&(r+=` at "value${(0,AJ.printPathArray)(e)}"`),n.message=r+": "+n.message,n}function Vd(e,t,n,r){if((0,jd.isNonNullType)(t)){if(e!=null)return Vd(e,t.ofType,n,r);n((0,ts.pathToArray)(r),e,new Tu.GraphQLError(`Expected non-nullable type "${(0,Py.inspect)(t)}" not to be null.`));return}if(e==null)return null;if((0,jd.isListType)(t)){let i=t.ofType;return(0,SJ.isIterableObject)(e)?Array.from(e,(o,s)=>{let a=(0,ts.addPath)(r,s,void 0);return Vd(o,i,n,a)}):[Vd(e,i,n,r)]}if((0,jd.isInputObjectType)(t)){if(!(0,DJ.isObjectLike)(e)){n((0,ts.pathToArray)(r),e,new Tu.GraphQLError(`Expected type "${t.name}" to be an object.`));return}let i={},o=t.getFields();for(let s of Object.values(o)){let a=e[s.name];if(a===void 0){if(s.defaultValue!==void 0)i[s.name]=s.defaultValue;else if((0,jd.isNonNullType)(s.type)){let c=(0,Py.inspect)(s.type);n((0,ts.pathToArray)(r),e,new Tu.GraphQLError(`Field "${s.name}" of required type "${c}" was not provided.`))}continue}i[s.name]=Vd(a,s.type,n,(0,ts.addPath)(r,s.name,t.name))}for(let s of Object.keys(e))if(!o[s]){let a=(0,wJ.suggestionList)(s,Object.keys(t.getFields()));n((0,ts.pathToArray)(r),e,new Tu.GraphQLError(`Field "${s}" is not defined by type "${t.name}".`+(0,_J.didYouMean)(a)))}return i}if((0,jd.isLeafType)(t)){let i;try{i=t.parseValue(e)}catch(o){o instanceof Tu.GraphQLError?n((0,ts.pathToArray)(r),e,o):n((0,ts.pathToArray)(r),e,new Tu.GraphQLError(`Expected type "${t.name}". `+o.message,{originalError:o}));return}return i===void 0&&n((0,ts.pathToArray)(r),e,new Tu.GraphQLError(`Expected type "${t.name}".`)),i}(0,OJ.invariant)(!1,"Unexpected input type: "+(0,Py.inspect)(t))}});var Gd=F(Nb=>{"use strict";d();m();f();Object.defineProperty(Nb,"__esModule",{value:!0});Nb.valueFromAST=$d;var FJ=Ct(),kJ=lr(),PJ=ha(),Bc=It(),Eu=yt();function $d(e,t,n){if(e){if(e.kind===Bc.Kind.VARIABLE){let r=e.name.value;if(n==null||n[r]===void 0)return;let i=n[r];return i===null&&(0,Eu.isNonNullType)(t)?void 0:i}if((0,Eu.isNonNullType)(t))return e.kind===Bc.Kind.NULL?void 0:$d(e,t.ofType,n);if(e.kind===Bc.Kind.NULL)return null;if((0,Eu.isListType)(t)){let r=t.ofType;if(e.kind===Bc.Kind.LIST){let o=[];for(let s of e.values)if(zF(s,n)){if((0,Eu.isNonNullType)(r))return;o.push(null)}else{let a=$d(s,r,n);if(a===void 0)return;o.push(a)}return o}let i=$d(e,r,n);return i===void 0?void 0:[i]}if((0,Eu.isInputObjectType)(t)){if(e.kind!==Bc.Kind.OBJECT)return;let r=Object.create(null),i=(0,PJ.keyMap)(e.fields,o=>o.name.value);for(let o of Object.values(t.getFields())){let s=i[o.name];if(!s||zF(s.value,n)){if(o.defaultValue!==void 0)r[o.name]=o.defaultValue;else if((0,Eu.isNonNullType)(o.type))return;continue}let a=$d(s.value,o.type,n);if(a===void 0)return;r[o.name]=a}return r}if((0,Eu.isLeafType)(t)){let r;try{r=t.parseLiteral(e,n)}catch(i){return}return r===void 0?void 0:r}(0,kJ.invariant)(!1,"Unexpected input type: "+(0,FJ.inspect)(t))}}function zF(e,t){return e.kind===Bc.Kind.VARIABLE&&(t==null||t[e.name.value]===void 0)}});var Yc=F(qd=>{"use strict";d();m();f();Object.defineProperty(qd,"__esModule",{value:!0});qd.getArgumentValues=ZF;qd.getDirectiveValues=$J;qd.getVariableValues=jJ;var Kc=Ct(),xJ=ha(),CJ=yb(),ns=$e(),XF=It(),HF=Hr(),Qc=yt(),MJ=Eb(),UJ=go(),WF=Gd();function jJ(e,t,n,r){let i=[],o=r==null?void 0:r.maxErrors;try{let s=VJ(e,t,n,a=>{if(o!=null&&i.length>=o)throw new ns.GraphQLError("Too many errors processing variables, error limit reached. Execution aborted.");i.push(a)});if(i.length===0)return{coerced:s}}catch(s){i.push(s)}return{errors:i}}function VJ(e,t,n,r){let i={};for(let o of t){let s=o.variable.name.value,a=(0,UJ.typeFromAST)(e,o.type);if(!(0,Qc.isInputType)(a)){let u=(0,HF.print)(o.type);r(new ns.GraphQLError(`Variable "$${s}" expected value of type "${u}" which cannot be used as an input type.`,{nodes:o.type}));continue}if(!ek(n,s)){if(o.defaultValue)i[s]=(0,WF.valueFromAST)(o.defaultValue,a);else if((0,Qc.isNonNullType)(a)){let u=(0,Kc.inspect)(a);r(new ns.GraphQLError(`Variable "$${s}" of required type "${u}" was not provided.`,{nodes:o}))}continue}let c=n[s];if(c===null&&(0,Qc.isNonNullType)(a)){let u=(0,Kc.inspect)(a);r(new ns.GraphQLError(`Variable "$${s}" of non-null type "${u}" must not be null.`,{nodes:o}));continue}i[s]=(0,MJ.coerceInputValue)(c,a,(u,l,p)=>{let h=`Variable "$${s}" got invalid value `+(0,Kc.inspect)(l);u.length>0&&(h+=` at "${s}${(0,CJ.printPathArray)(u)}"`),r(new ns.GraphQLError(h+"; "+p.message,{nodes:o,originalError:p}))})}return i}function ZF(e,t,n){var r;let i={},o=(r=t.arguments)!==null&&r!==void 0?r:[],s=(0,xJ.keyMap)(o,a=>a.name.value);for(let a of e.args){let c=a.name,u=a.type,l=s[c];if(!l){if(a.defaultValue!==void 0)i[c]=a.defaultValue;else if((0,Qc.isNonNullType)(u))throw new ns.GraphQLError(`Argument "${c}" of required type "${(0,Kc.inspect)(u)}" was not provided.`,{nodes:t});continue}let p=l.value,h=p.kind===XF.Kind.NULL;if(p.kind===XF.Kind.VARIABLE){let N=p.name.value;if(n==null||!ek(n,N)){if(a.defaultValue!==void 0)i[c]=a.defaultValue;else if((0,Qc.isNonNullType)(u))throw new ns.GraphQLError(`Argument "${c}" of required type "${(0,Kc.inspect)(u)}" was provided the variable "$${N}" which was not provided a runtime value.`,{nodes:p});continue}h=n[N]==null}if(h&&(0,Qc.isNonNullType)(u))throw new ns.GraphQLError(`Argument "${c}" of non-null type "${(0,Kc.inspect)(u)}" must not be null.`,{nodes:p});let y=(0,WF.valueFromAST)(p,u,n);if(y===void 0)throw new ns.GraphQLError(`Argument "${c}" has invalid value ${(0,HF.print)(p)}.`,{nodes:p});i[c]=y}return i}function $J(e,t,n){var r;let i=(r=t.directives)===null||r===void 0?void 0:r.find(o=>o.name.value===e.name);if(i)return ZF(e,i,n)}function ek(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var My=F(Cy=>{"use strict";d();m();f();Object.defineProperty(Cy,"__esModule",{value:!0});Cy.collectFields=BJ;Cy.collectSubfields=KJ;var gb=It(),GJ=yt(),tk=Pr(),qJ=go(),nk=Yc();function BJ(e,t,n,r,i){let o=new Map;return xy(e,t,n,r,i,o,new Set),o}function KJ(e,t,n,r,i){let o=new Map,s=new Set;for(let a of i)a.selectionSet&&xy(e,t,n,r,a.selectionSet,o,s);return o}function xy(e,t,n,r,i,o,s){for(let a of i.selections)switch(a.kind){case gb.Kind.FIELD:{if(!vb(n,a))continue;let c=QJ(a),u=o.get(c);u!==void 0?u.push(a):o.set(c,[a]);break}case gb.Kind.INLINE_FRAGMENT:{if(!vb(n,a)||!rk(e,a,r))continue;xy(e,t,n,r,a.selectionSet,o,s);break}case gb.Kind.FRAGMENT_SPREAD:{let c=a.name.value;if(s.has(c)||!vb(n,a))continue;s.add(c);let u=t[c];if(!u||!rk(e,u,r))continue;xy(e,t,n,r,u.selectionSet,o,s);break}}}function vb(e,t){let n=(0,nk.getDirectiveValues)(tk.GraphQLSkipDirective,t,e);if((n==null?void 0:n.if)===!0)return!1;let r=(0,nk.getDirectiveValues)(tk.GraphQLIncludeDirective,t,e);return(r==null?void 0:r.if)!==!1}function rk(e,t,n){let r=t.typeCondition;if(!r)return!0;let i=(0,qJ.typeFromAST)(e,r);return i===n?!0:(0,GJ.isAbstractType)(i)?e.isSubType(i,n):!1}function QJ(e){return e.alias?e.alias.value:e.name.value}});var bb=F(Ib=>{"use strict";d();m();f();Object.defineProperty(Ib,"__esModule",{value:!0});Ib.SingleFieldSubscriptionsRule=zJ;var ik=$e(),YJ=It(),JJ=My();function zJ(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 u of s.definitions)u.kind===YJ.Kind.FRAGMENT_DEFINITION&&(a[u.name.value]=u);let c=(0,JJ.collectFields)(n,a,o,r,t.selectionSet);if(c.size>1){let p=[...c.values()].slice(1).flat();e.reportError(new ik.GraphQLError(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:p}))}for(let u of c.values())u[0].name.value.startsWith("__")&&e.reportError(new ik.GraphQLError(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:u}))}}}}}});var Uy=F(_b=>{"use strict";d();m();f();Object.defineProperty(_b,"__esModule",{value:!0});_b.groupBy=XJ;function XJ(e,t){let n=new Map;for(let r of e){let i=t(r),o=n.get(i);o===void 0?n.set(i,[r]):o.push(r)}return n}});var Sb=F(Ob=>{"use strict";d();m();f();Object.defineProperty(Ob,"__esModule",{value:!0});Ob.UniqueArgumentDefinitionNamesRule=ZJ;var HJ=Uy(),WJ=$e();function ZJ(e){return{DirectiveDefinition(r){var i;let o=(i=r.arguments)!==null&&i!==void 0?i:[];return n(`@${r.name.value}`,o)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(r){var i;let o=r.name.value,s=(i=r.fields)!==null&&i!==void 0?i:[];for(let c of s){var a;let u=c.name.value,l=(a=c.arguments)!==null&&a!==void 0?a:[];n(`${o}.${u}`,l)}return!1}function n(r,i){let o=(0,HJ.groupBy)(i,s=>s.name.value);for(let[s,a]of o)a.length>1&&e.reportError(new WJ.GraphQLError(`Argument "${r}(${s}:)" can only be defined once.`,{nodes:a.map(c=>c.name)}));return!1}}});var Ab=F(Db=>{"use strict";d();m();f();Object.defineProperty(Db,"__esModule",{value:!0});Db.UniqueArgumentNamesRule=nz;var ez=Uy(),tz=$e();function nz(e){return{Field:t,Directive:t};function t(n){var r;let i=(r=n.arguments)!==null&&r!==void 0?r:[],o=(0,ez.groupBy)(i,s=>s.name.value);for(let[s,a]of o)a.length>1&&e.reportError(new tz.GraphQLError(`There can be only one argument named "${s}".`,{nodes:a.map(c=>c.name)}))}}});var Rb=F(wb=>{"use strict";d();m();f();Object.defineProperty(wb,"__esModule",{value:!0});wb.UniqueDirectiveNamesRule=rz;var ok=$e();function rz(e){let t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(r){let i=r.name.value;if(n!=null&&n.getDirective(i)){e.reportError(new ok.GraphQLError(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}return t[i]?e.reportError(new ok.GraphQLError(`There can be only one directive named "@${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1}}}});var kb=F(Fb=>{"use strict";d();m();f();Object.defineProperty(Fb,"__esModule",{value:!0});Fb.UniqueDirectivesPerLocationRule=sz;var iz=$e(),Lb=It(),sk=yu(),oz=Pr();function sz(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():oz.specifiedDirectives;for(let a of r)t[a.name]=!a.isRepeatable;let i=e.getDocument().definitions;for(let a of i)a.kind===Lb.Kind.DIRECTIVE_DEFINITION&&(t[a.name.value]=!a.repeatable);let o=Object.create(null),s=Object.create(null);return{enter(a){if(!("directives"in a)||!a.directives)return;let c;if(a.kind===Lb.Kind.SCHEMA_DEFINITION||a.kind===Lb.Kind.SCHEMA_EXTENSION)c=o;else if((0,sk.isTypeDefinitionNode)(a)||(0,sk.isTypeExtensionNode)(a)){let u=a.name.value;c=s[u],c===void 0&&(s[u]=c=Object.create(null))}else c=Object.create(null);for(let u of a.directives){let l=u.name.value;t[l]&&(c[l]?e.reportError(new iz.GraphQLError(`The directive "@${l}" can only be used once at this location.`,{nodes:[c[l],u]})):c[l]=u)}}}}});var xb=F(Pb=>{"use strict";d();m();f();Object.defineProperty(Pb,"__esModule",{value:!0});Pb.UniqueEnumValueNamesRule=uz;var ak=$e(),az=yt();function uz(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(o){var s;let a=o.name.value;r[a]||(r[a]=Object.create(null));let c=(s=o.values)!==null&&s!==void 0?s:[],u=r[a];for(let l of c){let p=l.name.value,h=n[a];(0,az.isEnumType)(h)&&h.getValue(p)?e.reportError(new ak.GraphQLError(`Enum value "${a}.${p}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name})):u[p]?e.reportError(new ak.GraphQLError(`Enum value "${a}.${p}" can only be defined once.`,{nodes:[u[p],l.name]})):u[p]=l.name}return!1}}});var Ub=F(Mb=>{"use strict";d();m();f();Object.defineProperty(Mb,"__esModule",{value:!0});Mb.UniqueFieldDefinitionNamesRule=cz;var uk=$e(),Cb=yt();function cz(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(o){var s;let a=o.name.value;r[a]||(r[a]=Object.create(null));let c=(s=o.fields)!==null&&s!==void 0?s:[],u=r[a];for(let l of c){let p=l.name.value;lz(n[a],p)?e.reportError(new uk.GraphQLError(`Field "${a}.${p}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name})):u[p]?e.reportError(new uk.GraphQLError(`Field "${a}.${p}" can only be defined once.`,{nodes:[u[p],l.name]})):u[p]=l.name}return!1}}function lz(e,t){return(0,Cb.isObjectType)(e)||(0,Cb.isInterfaceType)(e)||(0,Cb.isInputObjectType)(e)?e.getFields()[t]!=null:!1}});var Vb=F(jb=>{"use strict";d();m();f();Object.defineProperty(jb,"__esModule",{value:!0});jb.UniqueFragmentNamesRule=dz;var pz=$e();function dz(e){let t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){let r=n.name.value;return t[r]?e.reportError(new pz.GraphQLError(`There can be only one fragment named "${r}".`,{nodes:[t[r],n.name]})):t[r]=n.name,!1}}}});var Gb=F($b=>{"use strict";d();m();f();Object.defineProperty($b,"__esModule",{value:!0});$b.UniqueInputFieldNamesRule=hz;var fz=lr(),mz=$e();function hz(e){let t=[],n=Object.create(null);return{ObjectValue:{enter(){t.push(n),n=Object.create(null)},leave(){let r=t.pop();r||(0,fz.invariant)(!1),n=r}},ObjectField(r){let i=r.name.value;n[i]?e.reportError(new mz.GraphQLError(`There can be only one input field named "${i}".`,{nodes:[n[i],r.name]})):n[i]=r.name}}}});var Bb=F(qb=>{"use strict";d();m();f();Object.defineProperty(qb,"__esModule",{value:!0});qb.UniqueOperationNamesRule=Tz;var yz=$e();function Tz(e){let t=Object.create(null);return{OperationDefinition(n){let r=n.name;return r&&(t[r.value]?e.reportError(new yz.GraphQLError(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),!1},FragmentDefinition:()=>!1}}});var Qb=F(Kb=>{"use strict";d();m();f();Object.defineProperty(Kb,"__esModule",{value:!0});Kb.UniqueOperationTypesRule=Ez;var ck=$e();function Ez(e){let t=e.getSchema(),n=Object.create(null),r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(o){var s;let a=(s=o.operationTypes)!==null&&s!==void 0?s:[];for(let c of a){let u=c.operation,l=n[u];r[u]?e.reportError(new ck.GraphQLError(`Type for ${u} already defined in the schema. It cannot be redefined.`,{nodes:c})):l?e.reportError(new ck.GraphQLError(`There can be only one ${u} type in schema.`,{nodes:[l,c]})):n[u]=c}return!1}}});var Jb=F(Yb=>{"use strict";d();m();f();Object.defineProperty(Yb,"__esModule",{value:!0});Yb.UniqueTypeNamesRule=Nz;var lk=$e();function Nz(e){let t=Object.create(null),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!=null&&n.getType(o)){e.reportError(new lk.GraphQLError(`Type "${o}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}));return}return t[o]?e.reportError(new lk.GraphQLError(`There can be only one type named "${o}".`,{nodes:[t[o],i.name]})):t[o]=i.name,!1}}});var Xb=F(zb=>{"use strict";d();m();f();Object.defineProperty(zb,"__esModule",{value:!0});zb.UniqueVariableNamesRule=Iz;var gz=Uy(),vz=$e();function Iz(e){return{OperationDefinition(t){var n;let r=(n=t.variableDefinitions)!==null&&n!==void 0?n:[],i=(0,gz.groupBy)(r,o=>o.variable.name.value);for(let[o,s]of i)s.length>1&&e.reportError(new vz.GraphQLError(`There can be only one variable named "$${o}".`,{nodes:s.map(a=>a.variable.name)}))}}}});var Wb=F(Hb=>{"use strict";d();m();f();Object.defineProperty(Hb,"__esModule",{value:!0});Hb.ValuesOfCorrectTypeRule=Sz;var bz=ma(),Bd=Ct(),_z=ha(),Oz=ya(),gu=$e(),jy=Hr(),vo=yt();function Sz(e){return{ListValue(t){let n=(0,vo.getNullableType)(e.getParentInputType());if(!(0,vo.isListType)(n))return Nu(e,t),!1},ObjectValue(t){let n=(0,vo.getNamedType)(e.getInputType());if(!(0,vo.isInputObjectType)(n))return Nu(e,t),!1;let r=(0,_z.keyMap)(t.fields,i=>i.name.value);for(let i of Object.values(n.getFields()))if(!r[i.name]&&(0,vo.isRequiredInputField)(i)){let s=(0,Bd.inspect)(i.type);e.reportError(new gu.GraphQLError(`Field "${n.name}.${i.name}" of required type "${s}" was not provided.`,{nodes:t}))}},ObjectField(t){let n=(0,vo.getNamedType)(e.getParentInputType());if(!e.getInputType()&&(0,vo.isInputObjectType)(n)){let i=(0,Oz.suggestionList)(t.name.value,Object.keys(n.getFields()));e.reportError(new gu.GraphQLError(`Field "${t.name.value}" is not defined by type "${n.name}".`+(0,bz.didYouMean)(i),{nodes:t}))}},NullValue(t){let n=e.getInputType();(0,vo.isNonNullType)(n)&&e.reportError(new gu.GraphQLError(`Expected value of type "${(0,Bd.inspect)(n)}", found ${(0,jy.print)(t)}.`,{nodes:t}))},EnumValue:t=>Nu(e,t),IntValue:t=>Nu(e,t),FloatValue:t=>Nu(e,t),StringValue:t=>Nu(e,t),BooleanValue:t=>Nu(e,t)}}function Nu(e,t){let n=e.getInputType();if(!n)return;let r=(0,vo.getNamedType)(n);if(!(0,vo.isLeafType)(r)){let i=(0,Bd.inspect)(n);e.reportError(new gu.GraphQLError(`Expected value of type "${i}", found ${(0,jy.print)(t)}.`,{nodes:t}));return}try{if(r.parseLiteral(t,void 0)===void 0){let o=(0,Bd.inspect)(n);e.reportError(new gu.GraphQLError(`Expected value of type "${o}", found ${(0,jy.print)(t)}.`,{nodes:t}))}}catch(i){let o=(0,Bd.inspect)(n);i instanceof gu.GraphQLError?e.reportError(i):e.reportError(new gu.GraphQLError(`Expected value of type "${o}", found ${(0,jy.print)(t)}; `+i.message,{nodes:t,originalError:i}))}}});var e_=F(Zb=>{"use strict";d();m();f();Object.defineProperty(Zb,"__esModule",{value:!0});Zb.VariablesAreInputTypesRule=Lz;var Dz=$e(),Az=Hr(),wz=yt(),Rz=go();function Lz(e){return{VariableDefinition(t){let n=(0,Rz.typeFromAST)(e.getSchema(),t.type);if(n!==void 0&&!(0,wz.isInputType)(n)){let r=t.variable.name.value,i=(0,Az.print)(t.type);e.reportError(new Dz.GraphQLError(`Variable "$${r}" cannot be non-input type "${i}".`,{nodes:t.type}))}}}}});var n_=F(t_=>{"use strict";d();m();f();Object.defineProperty(t_,"__esModule",{value:!0});t_.VariablesInAllowedPositionRule=xz;var pk=Ct(),Fz=$e(),kz=It(),dk=yt(),fk=bd(),Pz=go();function xz(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i,type:o,defaultValue:s}of r){let a=i.name.value,c=t[a];if(c&&o){let u=e.getSchema(),l=(0,Pz.typeFromAST)(u,c.type);if(l&&!Cz(u,l,c.defaultValue,o,s)){let p=(0,pk.inspect)(l),h=(0,pk.inspect)(o);e.reportError(new Fz.GraphQLError(`Variable "$${a}" of type "${p}" used in position expecting type "${h}".`,{nodes:[c,i]}))}}}}},VariableDefinition(n){t[n.variable.name.value]=n}}}function Cz(e,t,n,r,i){if((0,dk.isNonNullType)(r)&&!(0,dk.isNonNullType)(t)){if(!(n!=null&&n.kind!==kz.Kind.NULL)&&!(i!==void 0))return!1;let a=r.ofType;return(0,fk.isTypeSubTypeOf)(e,t,a)}return(0,fk.isTypeSubTypeOf)(e,t,r)}});var r_=F(Jc=>{"use strict";d();m();f();Object.defineProperty(Jc,"__esModule",{value:!0});Jc.specifiedSDLRules=Jc.specifiedRules=void 0;var Mz=_I(),Uz=SI(),jz=AI(),mk=wI(),hk=kI(),Vz=xI(),yk=UI(),$z=VI(),Gz=GI(),qz=BI(),Bz=QI(),Kz=JI(),Qz=XI(),Yz=ob(),Jz=ub(),zz=lb(),Tk=db(),Xz=mb(),Hz=bb(),Wz=Sb(),Ek=Ab(),Zz=Rb(),Nk=kb(),e3=xb(),t3=Ub(),n3=Vb(),gk=Gb(),r3=Bb(),i3=Qb(),o3=Jb(),s3=Xb(),a3=Wb(),u3=e_(),c3=n_(),l3=Object.freeze([Mz.ExecutableDefinitionsRule,r3.UniqueOperationNamesRule,$z.LoneAnonymousOperationRule,Hz.SingleFieldSubscriptionsRule,yk.KnownTypeNamesRule,jz.FragmentsOnCompositeTypesRule,u3.VariablesAreInputTypesRule,Xz.ScalarLeafsRule,Uz.FieldsOnCorrectTypeRule,n3.UniqueFragmentNamesRule,Vz.KnownFragmentNamesRule,Kz.NoUnusedFragmentsRule,Jz.PossibleFragmentSpreadsRule,qz.NoFragmentCyclesRule,s3.UniqueVariableNamesRule,Bz.NoUndefinedVariablesRule,Qz.NoUnusedVariablesRule,hk.KnownDirectivesRule,Nk.UniqueDirectivesPerLocationRule,mk.KnownArgumentNamesRule,Ek.UniqueArgumentNamesRule,a3.ValuesOfCorrectTypeRule,Tk.ProvidedRequiredArgumentsRule,c3.VariablesInAllowedPositionRule,Yz.OverlappingFieldsCanBeMergedRule,gk.UniqueInputFieldNamesRule]);Jc.specifiedRules=l3;var p3=Object.freeze([Gz.LoneSchemaDefinitionRule,i3.UniqueOperationTypesRule,o3.UniqueTypeNamesRule,e3.UniqueEnumValueNamesRule,t3.UniqueFieldDefinitionNamesRule,Wz.UniqueArgumentDefinitionNamesRule,Zz.UniqueDirectiveNamesRule,yk.KnownTypeNamesRule,hk.KnownDirectivesRule,Nk.UniqueDirectivesPerLocationRule,zz.PossibleTypeExtensionsRule,mk.KnownArgumentNamesOnDirectivesRule,Ek.UniqueArgumentNamesRule,gk.UniqueInputFieldNamesRule,Tk.ProvidedRequiredArgumentsOnDirectivesRule]);Jc.specifiedSDLRules=p3});var s_=F(ga=>{"use strict";d();m();f();Object.defineProperty(ga,"__esModule",{value:!0});ga.ValidationContext=ga.SDLValidationContext=ga.ASTValidationContext=void 0;var vk=It(),d3=au(),Ik=Sy(),Kd=class{constructor(t,n){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(let r of this.getDocument().definitions)r.kind===vk.Kind.FRAGMENT_DEFINITION&&(n[r.name.value]=r);this._fragments=n}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];let r=[t],i;for(;i=r.pop();)for(let o of i.selections)o.kind===vk.Kind.FRAGMENT_SPREAD?n.push(o):o.selectionSet&&r.push(o.selectionSet);this._fragmentSpreads.set(t,n)}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];let r=Object.create(null),i=[t.selectionSet],o;for(;o=i.pop();)for(let s of this.getFragmentSpreads(o)){let a=s.name.value;if(r[a]!==!0){r[a]=!0;let c=this.getFragment(a);c&&(n.push(c),i.push(c.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}};ga.ASTValidationContext=Kd;var i_=class extends Kd{constructor(t,n,r){super(t,r),this._schema=n}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}};ga.SDLValidationContext=i_;var o_=class extends Kd{constructor(t,n,r,i){super(n,i),this._schema=t,this._typeInfo=r,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(t){let n=this._variableUsages.get(t);if(!n){let r=[],i=new Ik.TypeInfo(this._schema);(0,d3.visit)(t,(0,Ik.visitWithTypeInfo)(i,{VariableDefinition:()=>!1,Variable(o){r.push({node:o,type:i.getInputType(),defaultValue:i.getDefaultValue()})}})),n=r,this._variableUsages.set(t,n)}return n}getRecursiveVariableUsages(t){let n=this._recursiveVariableUsages.get(t);if(!n){n=this.getVariableUsages(t);for(let r of this.getRecursivelyReferencedFragments(t))n=n.concat(this.getVariableUsages(r));this._recursiveVariableUsages.set(t,n)}return n}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}};ga.ValidationContext=o_});var Xc=F(zc=>{"use strict";d();m();f();Object.defineProperty(zc,"__esModule",{value:!0});zc.assertValidSDL=T3;zc.assertValidSDLExtension=E3;zc.validate=y3;zc.validateSDL=a_;var f3=br(),m3=$e(),Vy=au(),h3=Pd(),bk=Sy(),_k=r_(),Ok=s_();function y3(e,t,n=_k.specifiedRules,r,i=new bk.TypeInfo(e)){var o;let s=(o=r==null?void 0:r.maxErrors)!==null&&o!==void 0?o:100;t||(0,f3.devAssert)(!1,"Must provide document."),(0,h3.assertValidSchema)(e);let a=Object.freeze({}),c=[],u=new Ok.ValidationContext(e,t,i,p=>{if(c.length>=s)throw c.push(new m3.GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),a;c.push(p)}),l=(0,Vy.visitInParallel)(n.map(p=>p(u)));try{(0,Vy.visit)(t,(0,bk.visitWithTypeInfo)(i,l))}catch(p){if(p!==a)throw p}return c}function a_(e,t,n=_k.specifiedSDLRules){let r=[],i=new Ok.SDLValidationContext(e,t,s=>{r.push(s)}),o=n.map(s=>s(i));return(0,Vy.visit)(e,(0,Vy.visitInParallel)(o)),r}function T3(e){let t=a_(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(` +`))}var $g=class{constructor(t){this._errors=[],this.schema=t}reportError(t,n){let r=Array.isArray(n)?n.filter(Boolean):n;this._errors.push(new P1.GraphQLError(t,{nodes:r}))}getErrors(){return this._errors}};function B1(e){let t=e.schema,n=t.getQueryType();if(!n)e.reportError("Query root type must be provided.",t.astNode);else if(!(0,cn.isObjectType)(n)){var r;e.reportError(`Query root type must be Object type, it cannot be ${(0,Zn.inspect)(n)}.`,(r=Bg(t,Cg.OperationTypeNode.QUERY))!==null&&r!==void 0?r:n.astNode)}let i=t.getMutationType();if(i&&!(0,cn.isObjectType)(i)){var s;e.reportError(`Mutation root type must be Object type if provided, it cannot be ${(0,Zn.inspect)(i)}.`,(s=Bg(t,Cg.OperationTypeNode.MUTATION))!==null&&s!==void 0?s:i.astNode)}let o=t.getSubscriptionType();if(o&&!(0,cn.isObjectType)(o)){var a;e.reportError(`Subscription root type must be Object type if provided, it cannot be ${(0,Zn.inspect)(o)}.`,(a=Bg(t,Cg.OperationTypeNode.SUBSCRIPTION))!==null&&a!==void 0?a:o.astNode)}}function Bg(e,t){var n;return(n=[e.astNode,...e.extensionASTNodes].flatMap(r=>{var i;return(i=r==null?void 0:r.operationTypes)!==null&&i!==void 0?i:[]}).find(r=>r.operation===t))===null||n===void 0?void 0:n.type}function $1(e){for(let n of e.schema.getDirectives()){if(!(0,Mw.isDirective)(n)){e.reportError(`Expected directive but got: ${(0,Zn.inspect)(n)}.`,n==null?void 0:n.astNode);continue}Ba(e,n);for(let r of n.args)if(Ba(e,r),(0,cn.isInputType)(r.type)||e.reportError(`The type of @${n.name}(${r.name}:) must be Input Type but got: ${(0,Zn.inspect)(r.type)}.`,r.astNode),(0,cn.isRequiredArgument)(r)&&r.deprecationReason!=null){var t;e.reportError(`Required argument @${n.name}(${r.name}:) cannot be deprecated.`,[Vg(r.astNode),(t=r.astNode)===null||t===void 0?void 0:t.type])}}}function Ba(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function V1(e){let t=Y1(e),n=e.schema.getTypeMap();for(let r of Object.values(n)){if(!(0,cn.isNamedType)(r)){e.reportError(`Expected GraphQL named type but got: ${(0,Zn.inspect)(r)}.`,r.astNode);continue}(0,M1.isIntrospectionType)(r)||Ba(e,r),(0,cn.isObjectType)(r)||(0,cn.isInterfaceType)(r)?(kw(e,r),xw(e,r)):(0,cn.isUnionType)(r)?q1(e,r):(0,cn.isEnumType)(r)?K1(e,r):(0,cn.isInputObjectType)(r)&&(Q1(e,r),t(r))}}function kw(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let o of n){if(Ba(e,o),!(0,cn.isOutputType)(o.type)){var r;e.reportError(`The type of ${t.name}.${o.name} must be Output Type but got: ${(0,Zn.inspect)(o.type)}.`,(r=o.astNode)===null||r===void 0?void 0:r.type)}for(let a of o.args){let u=a.name;if(Ba(e,a),!(0,cn.isInputType)(a.type)){var i;e.reportError(`The type of ${t.name}.${o.name}(${u}:) must be Input Type but got: ${(0,Zn.inspect)(a.type)}.`,(i=a.astNode)===null||i===void 0?void 0:i.type)}if((0,cn.isRequiredArgument)(a)&&a.deprecationReason!=null){var s;e.reportError(`Required argument ${t.name}.${o.name}(${u}:) cannot be deprecated.`,[Vg(a.astNode),(s=a.astNode)===null||s===void 0?void 0:s.type])}}}}function xw(e,t){let n=Object.create(null);for(let r of t.getInterfaces()){if(!(0,cn.isInterfaceType)(r)){e.reportError(`Type ${(0,Zn.inspect)(t)} must only implement Interface types, it cannot implement ${(0,Zn.inspect)(r)}.`,qd(t,r));continue}if(t===r){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,qd(t,r));continue}if(n[r.name]){e.reportError(`Type ${t.name} can only implement ${r.name} once.`,qd(t,r));continue}n[r.name]=!0,G1(e,t,r),j1(e,t,r)}}function j1(e,t,n){let r=t.getFields();for(let u of Object.values(n.getFields())){let c=u.name,l=r[c];if(!l){e.reportError(`Interface field ${n.name}.${c} expected but ${t.name} does not provide it.`,[u.astNode,t.astNode,...t.extensionASTNodes]);continue}if(!(0,Rw.isTypeSubTypeOf)(e.schema,l.type,u.type)){var i,s;e.reportError(`Interface field ${n.name}.${c} expects type ${(0,Zn.inspect)(u.type)} but ${t.name}.${c} is type ${(0,Zn.inspect)(l.type)}.`,[(i=u.astNode)===null||i===void 0?void 0:i.type,(s=l.astNode)===null||s===void 0?void 0:s.type])}for(let m of u.args){let h=m.name,E=l.args.find(N=>N.name===h);if(!E){e.reportError(`Interface field argument ${n.name}.${c}(${h}:) expected but ${t.name}.${c} does not provide it.`,[m.astNode,l.astNode]);continue}if(!(0,Rw.isEqualType)(m.type,E.type)){var o,a;e.reportError(`Interface field argument ${n.name}.${c}(${h}:) expects type ${(0,Zn.inspect)(m.type)} but ${t.name}.${c}(${h}:) is type ${(0,Zn.inspect)(E.type)}.`,[(o=m.astNode)===null||o===void 0?void 0:o.type,(a=E.astNode)===null||a===void 0?void 0:a.type])}}for(let m of l.args){let h=m.name;!u.args.find(N=>N.name===h)&&(0,cn.isRequiredArgument)(m)&&e.reportError(`Object field ${t.name}.${c} includes required argument ${h} that is missing from the Interface field ${n.name}.${c}.`,[m.astNode,u.astNode])}}}function G1(e,t,n){let r=t.getInterfaces();for(let i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...qd(n,i),...qd(t,n)])}function q1(e,t){let n=t.getTypes();n.length===0&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let r=Object.create(null);for(let i of n){if(r[i.name]){e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,Pw(t,i.name));continue}r[i.name]=!0,(0,cn.isObjectType)(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${(0,Zn.inspect)(i)}.`,Pw(t,String(i)))}}function K1(e,t){let n=t.getValues();n.length===0&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(let r of n)Ba(e,r)}function Q1(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let s of n){if(Ba(e,s),!(0,cn.isInputType)(s.type)){var r;e.reportError(`The type of ${t.name}.${s.name} must be Input Type but got: ${(0,Zn.inspect)(s.type)}.`,(r=s.astNode)===null||r===void 0?void 0:r.type)}if((0,cn.isRequiredInputField)(s)&&s.deprecationReason!=null){var i;e.reportError(`Required input field ${t.name}.${s.name} cannot be deprecated.`,[Vg(s.astNode),(i=s.astNode)===null||i===void 0?void 0:i.type])}}}function Y1(e){let t=Object.create(null),n=[],r=Object.create(null);return i;function i(s){if(t[s.name])return;t[s.name]=!0,r[s.name]=n.length;let o=Object.values(s.getFields());for(let a of o)if((0,cn.isNonNullType)(a.type)&&(0,cn.isInputObjectType)(a.type.ofType)){let u=a.type.ofType,c=r[u.name];if(n.push(a),c===void 0)i(u);else{let l=n.slice(c),m=l.map(h=>h.name).join(".");e.reportError(`Cannot reference Input Object "${u.name}" within itself through a series of non-null fields: "${m}".`,l.map(h=>h.astNode))}n.pop()}r[s.name]=void 0}}function qd(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n!=null?[n,...r]:r).flatMap(s=>{var o;return(o=s.interfaces)!==null&&o!==void 0?o:[]}).filter(s=>s.name.value===t.name)}function Pw(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n!=null?[n,...r]:r).flatMap(s=>{var o;return(o=s.types)!==null&&o!==void 0?o:[]}).filter(s=>s.name.value===t)}function Vg(e){var t;return e==null||(t=e.directives)===null||t===void 0?void 0:t.find(n=>n.name.value===Mw.GraphQLDeprecatedDirective.name)}});var Es=L(qg=>{"use strict";d();f();p();Object.defineProperty(qg,"__esModule",{value:!0});qg.typeFromAST=Gg;var jg=Vt(),Bw=kt();function Gg(e,t){switch(t.kind){case jg.Kind.LIST_TYPE:{let n=Gg(e,t.type);return n&&new Bw.GraphQLList(n)}case jg.Kind.NON_NULL_TYPE:{let n=Gg(e,t.type);return n&&new Bw.GraphQLNonNull(n)}case jg.Kind.NAMED_TYPE:return e.getType(t.name.value)}}});var Qg=L(Kd=>{"use strict";d();f();p();Object.defineProperty(Kd,"__esModule",{value:!0});Kd.TypeInfo=void 0;Kd.visitWithTypeInfo=X1;var J1=tc(),nn=Vt(),$w=Ad(),rn=kt(),ac=Gd(),Vw=Es(),Kg=class{constructor(t,n,r){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=r!=null?r:z1,n&&((0,rn.isInputType)(n)&&this._inputTypeStack.push(n),(0,rn.isCompositeType)(n)&&this._parentTypeStack.push(n),(0,rn.isOutputType)(n)&&this._typeStack.push(n))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(t){let n=this._schema;switch(t.kind){case nn.Kind.SELECTION_SET:{let i=(0,rn.getNamedType)(this.getType());this._parentTypeStack.push((0,rn.isCompositeType)(i)?i:void 0);break}case nn.Kind.FIELD:{let i=this.getParentType(),s,o;i&&(s=this._getFieldDef(n,i,t),s&&(o=s.type)),this._fieldDefStack.push(s),this._typeStack.push((0,rn.isOutputType)(o)?o:void 0);break}case nn.Kind.DIRECTIVE:this._directive=n.getDirective(t.name.value);break;case nn.Kind.OPERATION_DEFINITION:{let i=n.getRootType(t.operation);this._typeStack.push((0,rn.isObjectType)(i)?i:void 0);break}case nn.Kind.INLINE_FRAGMENT:case nn.Kind.FRAGMENT_DEFINITION:{let i=t.typeCondition,s=i?(0,Vw.typeFromAST)(n,i):(0,rn.getNamedType)(this.getType());this._typeStack.push((0,rn.isOutputType)(s)?s:void 0);break}case nn.Kind.VARIABLE_DEFINITION:{let i=(0,Vw.typeFromAST)(n,t.type);this._inputTypeStack.push((0,rn.isInputType)(i)?i:void 0);break}case nn.Kind.ARGUMENT:{var r;let i,s,o=(r=this.getDirective())!==null&&r!==void 0?r:this.getFieldDef();o&&(i=o.args.find(a=>a.name===t.name.value),i&&(s=i.type)),this._argument=i,this._defaultValueStack.push(i?i.defaultValue:void 0),this._inputTypeStack.push((0,rn.isInputType)(s)?s:void 0);break}case nn.Kind.LIST:{let i=(0,rn.getNullableType)(this.getInputType()),s=(0,rn.isListType)(i)?i.ofType:i;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,rn.isInputType)(s)?s:void 0);break}case nn.Kind.OBJECT_FIELD:{let i=(0,rn.getNamedType)(this.getInputType()),s,o;(0,rn.isInputObjectType)(i)&&(o=i.getFields()[t.name.value],o&&(s=o.type)),this._defaultValueStack.push(o?o.defaultValue:void 0),this._inputTypeStack.push((0,rn.isInputType)(s)?s:void 0);break}case nn.Kind.ENUM:{let i=(0,rn.getNamedType)(this.getInputType()),s;(0,rn.isEnumType)(i)&&(s=i.getValue(t.value)),this._enumValue=s;break}default:}}leave(t){switch(t.kind){case nn.Kind.SELECTION_SET:this._parentTypeStack.pop();break;case nn.Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case nn.Kind.DIRECTIVE:this._directive=null;break;case nn.Kind.OPERATION_DEFINITION:case nn.Kind.INLINE_FRAGMENT:case nn.Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case nn.Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case nn.Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case nn.Kind.LIST:case nn.Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case nn.Kind.ENUM:this._enumValue=null;break;default:}}};Kd.TypeInfo=Kg;function z1(e,t,n){let r=n.name.value;if(r===ac.SchemaMetaFieldDef.name&&e.getQueryType()===t)return ac.SchemaMetaFieldDef;if(r===ac.TypeMetaFieldDef.name&&e.getQueryType()===t)return ac.TypeMetaFieldDef;if(r===ac.TypeNameMetaFieldDef.name&&(0,rn.isCompositeType)(t))return ac.TypeNameMetaFieldDef;if((0,rn.isObjectType)(t)||(0,rn.isInterfaceType)(t))return t.getFields()[r]}function X1(e,t){return{enter(...n){let r=n[0];e.enter(r);let i=(0,$w.getEnterLeaveForKind)(t,r.kind).enter;if(i){let s=i.apply(t,n);return s!==void 0&&(e.leave(r),(0,J1.isNode)(s)&&e.enter(s)),s}},leave(...n){let r=n[0],i=(0,$w.getEnterLeaveForKind)(t,r.kind).leave,s;return i&&(s=i.apply(t,n)),e.leave(r),s}}}});var Qd=L(Xr=>{"use strict";d();f();p();Object.defineProperty(Xr,"__esModule",{value:!0});Xr.isConstValueNode=Yg;Xr.isDefinitionNode=H1;Xr.isExecutableDefinitionNode=jw;Xr.isSelectionNode=W1;Xr.isTypeDefinitionNode=Kw;Xr.isTypeExtensionNode=Yw;Xr.isTypeNode=Z1;Xr.isTypeSystemDefinitionNode=qw;Xr.isTypeSystemExtensionNode=Qw;Xr.isValueNode=Gw;var nt=Vt();function H1(e){return jw(e)||qw(e)||Qw(e)}function jw(e){return e.kind===nt.Kind.OPERATION_DEFINITION||e.kind===nt.Kind.FRAGMENT_DEFINITION}function W1(e){return e.kind===nt.Kind.FIELD||e.kind===nt.Kind.FRAGMENT_SPREAD||e.kind===nt.Kind.INLINE_FRAGMENT}function Gw(e){return e.kind===nt.Kind.VARIABLE||e.kind===nt.Kind.INT||e.kind===nt.Kind.FLOAT||e.kind===nt.Kind.STRING||e.kind===nt.Kind.BOOLEAN||e.kind===nt.Kind.NULL||e.kind===nt.Kind.ENUM||e.kind===nt.Kind.LIST||e.kind===nt.Kind.OBJECT}function Yg(e){return Gw(e)&&(e.kind===nt.Kind.LIST?e.values.some(Yg):e.kind===nt.Kind.OBJECT?e.fields.some(t=>Yg(t.value)):e.kind!==nt.Kind.VARIABLE)}function Z1(e){return e.kind===nt.Kind.NAMED_TYPE||e.kind===nt.Kind.LIST_TYPE||e.kind===nt.Kind.NON_NULL_TYPE}function qw(e){return e.kind===nt.Kind.SCHEMA_DEFINITION||Kw(e)||e.kind===nt.Kind.DIRECTIVE_DEFINITION}function Kw(e){return e.kind===nt.Kind.SCALAR_TYPE_DEFINITION||e.kind===nt.Kind.OBJECT_TYPE_DEFINITION||e.kind===nt.Kind.INTERFACE_TYPE_DEFINITION||e.kind===nt.Kind.UNION_TYPE_DEFINITION||e.kind===nt.Kind.ENUM_TYPE_DEFINITION||e.kind===nt.Kind.INPUT_OBJECT_TYPE_DEFINITION}function Qw(e){return e.kind===nt.Kind.SCHEMA_EXTENSION||Yw(e)}function Yw(e){return e.kind===nt.Kind.SCALAR_TYPE_EXTENSION||e.kind===nt.Kind.OBJECT_TYPE_EXTENSION||e.kind===nt.Kind.INTERFACE_TYPE_EXTENSION||e.kind===nt.Kind.UNION_TYPE_EXTENSION||e.kind===nt.Kind.ENUM_TYPE_EXTENSION||e.kind===nt.Kind.INPUT_OBJECT_TYPE_EXTENSION}});var zw=L(Jg=>{"use strict";d();f();p();Object.defineProperty(Jg,"__esModule",{value:!0});Jg.ExecutableDefinitionsRule=nK;var eK=Ge(),Jw=Vt(),tK=Qd();function nK(e){return{Document(t){for(let n of t.definitions)if(!(0,tK.isExecutableDefinitionNode)(n)){let r=n.kind===Jw.Kind.SCHEMA_DEFINITION||n.kind===Jw.Kind.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new eK.GraphQLError(`The ${r} definition is not executable.`,{nodes:n}))}return!1}}}});var Hw=L(zg=>{"use strict";d();f();p();Object.defineProperty(zg,"__esModule",{value:!0});zg.FieldsOnCorrectTypeRule=oK;var Xw=Bo(),rK=eh(),iK=$o(),sK=Ge(),Yd=kt();function oK(e){return{Field(t){let n=e.getParentType();if(n&&!e.getFieldDef()){let i=e.getSchema(),s=t.name.value,o=(0,Xw.didYouMean)("to use an inline fragment on",aK(i,n,s));o===""&&(o=(0,Xw.didYouMean)(uK(n,s))),e.reportError(new sK.GraphQLError(`Cannot query field "${s}" on type "${n.name}".`+o,{nodes:t}))}}}}function aK(e,t,n){if(!(0,Yd.isAbstractType)(t))return[];let r=new Set,i=Object.create(null);for(let o of e.getPossibleTypes(t))if(o.getFields()[n]){r.add(o),i[o.name]=1;for(let a of o.getInterfaces()){var s;a.getFields()[n]&&(r.add(a),i[a.name]=((s=i[a.name])!==null&&s!==void 0?s:0)+1)}}return[...r].sort((o,a)=>{let u=i[a.name]-i[o.name];return u!==0?u:(0,Yd.isInterfaceType)(o)&&e.isSubType(o,a)?-1:(0,Yd.isInterfaceType)(a)&&e.isSubType(a,o)?1:(0,rK.naturalCompare)(o.name,a.name)}).map(o=>o.name)}function uK(e,t){if((0,Yd.isObjectType)(e)||(0,Yd.isInterfaceType)(e)){let n=Object.keys(e.getFields());return(0,iK.suggestionList)(t,n)}return[]}});var nF=L(Xg=>{"use strict";d();f();p();Object.defineProperty(Xg,"__esModule",{value:!0});Xg.FragmentsOnCompositeTypesRule=cK;var Ww=Ge(),Zw=Gi(),eF=kt(),tF=Es();function cK(e){return{InlineFragment(t){let n=t.typeCondition;if(n){let r=(0,tF.typeFromAST)(e.getSchema(),n);if(r&&!(0,eF.isCompositeType)(r)){let i=(0,Zw.print)(n);e.reportError(new Ww.GraphQLError(`Fragment cannot condition on non composite type "${i}".`,{nodes:n}))}}},FragmentDefinition(t){let n=(0,tF.typeFromAST)(e.getSchema(),t.typeCondition);if(n&&!(0,eF.isCompositeType)(n)){let r=(0,Zw.print)(t.typeCondition);e.reportError(new Ww.GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${r}".`,{nodes:t.typeCondition}))}}}}});var aF=L(Dh=>{"use strict";d();f();p();Object.defineProperty(Dh,"__esModule",{value:!0});Dh.KnownArgumentNamesOnDirectivesRule=oF;Dh.KnownArgumentNamesRule=pK;var rF=Bo(),iF=$o(),sF=Ge(),lK=Vt(),dK=qo();function pK(e){return M(A({},oF(e)),{Argument(t){let n=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!n&&r&&i){let s=t.name.value,o=r.args.map(u=>u.name),a=(0,iF.suggestionList)(s,o);e.reportError(new sF.GraphQLError(`Unknown argument "${s}" on field "${i.name}.${r.name}".`+(0,rF.didYouMean)(a),{nodes:t}))}}})}function oF(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():dK.specifiedDirectives;for(let o of r)t[o.name]=o.args.map(a=>a.name);let i=e.getDocument().definitions;for(let o of i)if(o.kind===lK.Kind.DIRECTIVE_DEFINITION){var s;let a=(s=o.arguments)!==null&&s!==void 0?s:[];t[o.name.value]=a.map(u=>u.name.value)}return{Directive(o){let a=o.name.value,u=t[a];if(o.arguments&&u)for(let c of o.arguments){let l=c.name.value;if(!u.includes(l)){let m=(0,iF.suggestionList)(l,u);e.reportError(new sF.GraphQLError(`Unknown argument "${l}" on directive "@${a}".`+(0,rF.didYouMean)(m),{nodes:c}))}}return!1}}}});var cF=L(Zg=>{"use strict";d();f();p();Object.defineProperty(Zg,"__esModule",{value:!0});Zg.KnownDirectivesRule=hK;var fK=un(),Hg=Ts(),uF=Ge(),Wg=tc(),bn=Nh(),Mt=Vt(),mK=qo();function hK(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():mK.specifiedDirectives;for(let s of r)t[s.name]=s.locations;let i=e.getDocument().definitions;for(let s of i)s.kind===Mt.Kind.DIRECTIVE_DEFINITION&&(t[s.name.value]=s.locations.map(o=>o.value));return{Directive(s,o,a,u,c){let l=s.name.value,m=t[l];if(!m){e.reportError(new uF.GraphQLError(`Unknown directive "@${l}".`,{nodes:s}));return}let h=TK(c);h&&!m.includes(h)&&e.reportError(new uF.GraphQLError(`Directive "@${l}" may not be used on ${h}.`,{nodes:s}))}}}function TK(e){let t=e[e.length-1];switch("kind"in t||(0,Hg.invariant)(!1),t.kind){case Mt.Kind.OPERATION_DEFINITION:return yK(t.operation);case Mt.Kind.FIELD:return bn.DirectiveLocation.FIELD;case Mt.Kind.FRAGMENT_SPREAD:return bn.DirectiveLocation.FRAGMENT_SPREAD;case Mt.Kind.INLINE_FRAGMENT:return bn.DirectiveLocation.INLINE_FRAGMENT;case Mt.Kind.FRAGMENT_DEFINITION:return bn.DirectiveLocation.FRAGMENT_DEFINITION;case Mt.Kind.VARIABLE_DEFINITION:return bn.DirectiveLocation.VARIABLE_DEFINITION;case Mt.Kind.SCHEMA_DEFINITION:case Mt.Kind.SCHEMA_EXTENSION:return bn.DirectiveLocation.SCHEMA;case Mt.Kind.SCALAR_TYPE_DEFINITION:case Mt.Kind.SCALAR_TYPE_EXTENSION:return bn.DirectiveLocation.SCALAR;case Mt.Kind.OBJECT_TYPE_DEFINITION:case Mt.Kind.OBJECT_TYPE_EXTENSION:return bn.DirectiveLocation.OBJECT;case Mt.Kind.FIELD_DEFINITION:return bn.DirectiveLocation.FIELD_DEFINITION;case Mt.Kind.INTERFACE_TYPE_DEFINITION:case Mt.Kind.INTERFACE_TYPE_EXTENSION:return bn.DirectiveLocation.INTERFACE;case Mt.Kind.UNION_TYPE_DEFINITION:case Mt.Kind.UNION_TYPE_EXTENSION:return bn.DirectiveLocation.UNION;case Mt.Kind.ENUM_TYPE_DEFINITION:case Mt.Kind.ENUM_TYPE_EXTENSION:return bn.DirectiveLocation.ENUM;case Mt.Kind.ENUM_VALUE_DEFINITION:return bn.DirectiveLocation.ENUM_VALUE;case Mt.Kind.INPUT_OBJECT_TYPE_DEFINITION:case Mt.Kind.INPUT_OBJECT_TYPE_EXTENSION:return bn.DirectiveLocation.INPUT_OBJECT;case Mt.Kind.INPUT_VALUE_DEFINITION:{let n=e[e.length-3];return"kind"in n||(0,Hg.invariant)(!1),n.kind===Mt.Kind.INPUT_OBJECT_TYPE_DEFINITION?bn.DirectiveLocation.INPUT_FIELD_DEFINITION:bn.DirectiveLocation.ARGUMENT_DEFINITION}default:(0,Hg.invariant)(!1,"Unexpected kind: "+(0,fK.inspect)(t.kind))}}function yK(e){switch(e){case Wg.OperationTypeNode.QUERY:return bn.DirectiveLocation.QUERY;case Wg.OperationTypeNode.MUTATION:return bn.DirectiveLocation.MUTATION;case Wg.OperationTypeNode.SUBSCRIPTION:return bn.DirectiveLocation.SUBSCRIPTION}}});var lF=L(eI=>{"use strict";d();f();p();Object.defineProperty(eI,"__esModule",{value:!0});eI.KnownFragmentNamesRule=NK;var EK=Ge();function NK(e){return{FragmentSpread(t){let n=t.name.value;e.getFragment(n)||e.reportError(new EK.GraphQLError(`Unknown fragment "${n}".`,{nodes:t.name}))}}}});var pF=L(nI=>{"use strict";d();f();p();Object.defineProperty(nI,"__esModule",{value:!0});nI.KnownTypeNamesRule=SK;var gK=Bo(),IK=$o(),vK=Ge(),tI=Qd(),_K=Gd(),bK=Cd();function SK(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);for(let s of e.getDocument().definitions)(0,tI.isTypeDefinitionNode)(s)&&(r[s.name.value]=!0);let i=[...Object.keys(n),...Object.keys(r)];return{NamedType(s,o,a,u,c){let l=s.name.value;if(!n[l]&&!r[l]){var m;let h=(m=c[2])!==null&&m!==void 0?m:a,E=h!=null&&DK(h);if(E&&dF.includes(l))return;let N=(0,IK.suggestionList)(l,E?dF.concat(i):i);e.reportError(new vK.GraphQLError(`Unknown type "${l}".`+(0,gK.didYouMean)(N),{nodes:s}))}}}}var dF=[...bK.specifiedScalarTypes,..._K.introspectionTypes].map(e=>e.name);function DK(e){return"kind"in e&&((0,tI.isTypeSystemDefinitionNode)(e)||(0,tI.isTypeSystemExtensionNode)(e))}});var fF=L(rI=>{"use strict";d();f();p();Object.defineProperty(rI,"__esModule",{value:!0});rI.LoneAnonymousOperationRule=wK;var OK=Ge(),AK=Vt();function wK(e){let t=0;return{Document(n){t=n.definitions.filter(r=>r.kind===AK.Kind.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new OK.GraphQLError("This anonymous operation must be the only defined operation.",{nodes:n}))}}}});var hF=L(iI=>{"use strict";d();f();p();Object.defineProperty(iI,"__esModule",{value:!0});iI.LoneSchemaDefinitionRule=FK;var mF=Ge();function FK(e){var t,n,r;let i=e.getSchema(),s=(t=(n=(r=i==null?void 0:i.astNode)!==null&&r!==void 0?r:i==null?void 0:i.getQueryType())!==null&&n!==void 0?n:i==null?void 0:i.getMutationType())!==null&&t!==void 0?t:i==null?void 0:i.getSubscriptionType(),o=0;return{SchemaDefinition(a){if(s){e.reportError(new mF.GraphQLError("Cannot define a new schema within a schema extension.",{nodes:a}));return}o>0&&e.reportError(new mF.GraphQLError("Must provide only one schema definition.",{nodes:a})),++o}}}});var TF=L(sI=>{"use strict";d();f();p();Object.defineProperty(sI,"__esModule",{value:!0});sI.NoFragmentCyclesRule=RK;var LK=Ge();function RK(e){let t=Object.create(null),n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(s){return i(s),!1}};function i(s){if(t[s.name.value])return;let o=s.name.value;t[o]=!0;let a=e.getFragmentSpreads(s.selectionSet);if(a.length!==0){r[o]=n.length;for(let u of a){let c=u.name.value,l=r[c];if(n.push(u),l===void 0){let m=e.getFragment(c);m&&i(m)}else{let m=n.slice(l),h=m.slice(0,-1).map(E=>'"'+E.name.value+'"').join(", ");e.reportError(new LK.GraphQLError(`Cannot spread fragment "${c}" within itself`+(h!==""?` via ${h}.`:"."),{nodes:m}))}n.pop()}r[o]=void 0}}}});var yF=L(oI=>{"use strict";d();f();p();Object.defineProperty(oI,"__esModule",{value:!0});oI.NoUndefinedVariablesRule=xK;var kK=Ge();function xK(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i}of r){let s=i.name.value;t[s]!==!0&&e.reportError(new kK.GraphQLError(n.name?`Variable "$${s}" is not defined by operation "${n.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[i,n]}))}}},VariableDefinition(n){t[n.variable.name.value]=!0}}}});var EF=L(aI=>{"use strict";d();f();p();Object.defineProperty(aI,"__esModule",{value:!0});aI.NoUnusedFragmentsRule=MK;var PK=Ge();function MK(e){let t=[],n=[];return{OperationDefinition(r){return t.push(r),!1},FragmentDefinition(r){return n.push(r),!1},Document:{leave(){let r=Object.create(null);for(let i of t)for(let s of e.getRecursivelyReferencedFragments(i))r[s.name.value]=!0;for(let i of n){let s=i.name.value;r[s]!==!0&&e.reportError(new PK.GraphQLError(`Fragment "${s}" is never used.`,{nodes:i}))}}}}}});var NF=L(uI=>{"use strict";d();f();p();Object.defineProperty(uI,"__esModule",{value:!0});uI.NoUnusedVariablesRule=CK;var UK=Ge();function CK(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(n){let r=Object.create(null),i=e.getRecursiveVariableUsages(n);for(let{node:s}of i)r[s.name.value]=!0;for(let s of t){let o=s.variable.name.value;r[o]!==!0&&e.reportError(new UK.GraphQLError(n.name?`Variable "$${o}" is never used in operation "${n.name.value}".`:`Variable "$${o}" is never used.`,{nodes:s}))}}},VariableDefinition(n){t.push(n)}}}});var gF=L(lI=>{"use strict";d();f();p();Object.defineProperty(lI,"__esModule",{value:!0});lI.sortValueNode=cI;var BK=eh(),Ns=Vt();function cI(e){switch(e.kind){case Ns.Kind.OBJECT:return M(A({},e),{fields:$K(e.fields)});case Ns.Kind.LIST:return M(A({},e),{values:e.values.map(cI)});case Ns.Kind.INT:case Ns.Kind.FLOAT:case Ns.Kind.STRING:case Ns.Kind.BOOLEAN:case Ns.Kind.NULL:case Ns.Kind.ENUM:case Ns.Kind.VARIABLE:return e}}function $K(e){return e.map(t=>M(A({},t),{value:cI(t.value)})).sort((t,n)=>(0,BK.naturalCompare)(t.name.value,n.name.value))}});var OF=L(hI=>{"use strict";d();f();p();Object.defineProperty(hI,"__esModule",{value:!0});hI.OverlappingFieldsCanBeMergedRule=qK;var IF=un(),VK=Ge(),Jd=Vt(),jK=Gi(),yr=kt(),GK=gF(),_F=Es();function bF(e){return Array.isArray(e)?e.map(([t,n])=>`subfields "${t}" conflict because `+bF(n)).join(" and "):e}function qK(e){let t=new fI,n=new Map;return{SelectionSet(r){let i=KK(e,n,t,e.getParentType(),r);for(let[[s,o],a,u]of i){let c=bF(o);e.reportError(new VK.GraphQLError(`Fields "${s}" conflict because ${c}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:a.concat(u)}))}}}}function KK(e,t,n,r,i){let s=[],[o,a]=wh(e,t,r,i);if(YK(e,s,t,n,o),a.length!==0)for(let u=0;u1)for(let a=0;a({kind:Jd.Kind.OBJECT_FIELD,name:i.name,value:i.value}))};return(0,jK.print)((0,GK.sortValueNode)(r))}function dI(e,t){return(0,yr.isListType)(e)?(0,yr.isListType)(t)?dI(e.ofType,t.ofType):!0:(0,yr.isListType)(t)?!0:(0,yr.isNonNullType)(e)?(0,yr.isNonNullType)(t)?dI(e.ofType,t.ofType):!0:(0,yr.isNonNullType)(t)?!0:(0,yr.isLeafType)(e)||(0,yr.isLeafType)(t)?e!==t:!1}function wh(e,t,n,r){let i=t.get(r);if(i)return i;let s=Object.create(null),o=Object.create(null);DF(e,n,r,s,o);let a=[s,Object.keys(o)];return t.set(r,a),a}function pI(e,t,n){let r=t.get(n.selectionSet);if(r)return r;let i=(0,_F.typeFromAST)(e.getSchema(),n.typeCondition);return wh(e,t,i,n.selectionSet)}function DF(e,t,n,r,i){for(let s of n.selections)switch(s.kind){case Jd.Kind.FIELD:{let o=s.name.value,a;((0,yr.isObjectType)(t)||(0,yr.isInterfaceType)(t))&&(a=t.getFields()[o]);let u=s.alias?s.alias.value:o;r[u]||(r[u]=[]),r[u].push([t,s,a]);break}case Jd.Kind.FRAGMENT_SPREAD:i[s.name.value]=!0;break;case Jd.Kind.INLINE_FRAGMENT:{let o=s.typeCondition,a=o?(0,_F.typeFromAST)(e.getSchema(),o):t;DF(e,a,s.selectionSet,r,i);break}}}function JK(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()]]}var fI=class{constructor(){this._data=new Map}has(t,n,r){var i;let[s,o]=t{"use strict";d();f();p();Object.defineProperty(yI,"__esModule",{value:!0});yI.PossibleFragmentSpreadsRule=XK;var Fh=un(),AF=Ge(),TI=kt(),wF=Eh(),zK=Es();function XK(e){return{InlineFragment(t){let n=e.getType(),r=e.getParentType();if((0,TI.isCompositeType)(n)&&(0,TI.isCompositeType)(r)&&!(0,wF.doTypesOverlap)(e.getSchema(),n,r)){let i=(0,Fh.inspect)(r),s=(0,Fh.inspect)(n);e.reportError(new AF.GraphQLError(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${s}".`,{nodes:t}))}},FragmentSpread(t){let n=t.name.value,r=HK(e,n),i=e.getParentType();if(r&&i&&!(0,wF.doTypesOverlap)(e.getSchema(),r,i)){let s=(0,Fh.inspect)(i),o=(0,Fh.inspect)(r);e.reportError(new AF.GraphQLError(`Fragment "${n}" cannot be spread here as objects of type "${s}" can never be of type "${o}".`,{nodes:t}))}}}}function HK(e,t){let n=e.getFragment(t);if(n){let r=(0,zK.typeFromAST)(e.getSchema(),n.typeCondition);if((0,TI.isCompositeType)(r))return r}}});var xF=L(EI=>{"use strict";d();f();p();Object.defineProperty(EI,"__esModule",{value:!0});EI.PossibleTypeExtensionsRule=tQ;var WK=Bo(),RF=un(),kF=Ts(),ZK=$o(),LF=Ge(),jt=Vt(),eQ=Qd(),uc=kt();function tQ(e){let t=e.getSchema(),n=Object.create(null);for(let i of e.getDocument().definitions)(0,eQ.isTypeDefinitionNode)(i)&&(n[i.name.value]=i);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(i){let s=i.name.value,o=n[s],a=t==null?void 0:t.getType(s),u;if(o?u=nQ[o.kind]:a&&(u=rQ(a)),u){if(u!==i.kind){let c=iQ(i.kind);e.reportError(new LF.GraphQLError(`Cannot extend non-${c} type "${s}".`,{nodes:o?[o,i]:i}))}}else{let c=Object.keys(A(A({},n),t==null?void 0:t.getTypeMap())),l=(0,ZK.suggestionList)(s,c);e.reportError(new LF.GraphQLError(`Cannot extend type "${s}" because it is not defined.`+(0,WK.didYouMean)(l),{nodes:i.name}))}}}var nQ={[jt.Kind.SCALAR_TYPE_DEFINITION]:jt.Kind.SCALAR_TYPE_EXTENSION,[jt.Kind.OBJECT_TYPE_DEFINITION]:jt.Kind.OBJECT_TYPE_EXTENSION,[jt.Kind.INTERFACE_TYPE_DEFINITION]:jt.Kind.INTERFACE_TYPE_EXTENSION,[jt.Kind.UNION_TYPE_DEFINITION]:jt.Kind.UNION_TYPE_EXTENSION,[jt.Kind.ENUM_TYPE_DEFINITION]:jt.Kind.ENUM_TYPE_EXTENSION,[jt.Kind.INPUT_OBJECT_TYPE_DEFINITION]:jt.Kind.INPUT_OBJECT_TYPE_EXTENSION};function rQ(e){if((0,uc.isScalarType)(e))return jt.Kind.SCALAR_TYPE_EXTENSION;if((0,uc.isObjectType)(e))return jt.Kind.OBJECT_TYPE_EXTENSION;if((0,uc.isInterfaceType)(e))return jt.Kind.INTERFACE_TYPE_EXTENSION;if((0,uc.isUnionType)(e))return jt.Kind.UNION_TYPE_EXTENSION;if((0,uc.isEnumType)(e))return jt.Kind.ENUM_TYPE_EXTENSION;if((0,uc.isInputObjectType)(e))return jt.Kind.INPUT_OBJECT_TYPE_EXTENSION;(0,kF.invariant)(!1,"Unexpected type: "+(0,RF.inspect)(e))}function iQ(e){switch(e){case jt.Kind.SCALAR_TYPE_EXTENSION:return"scalar";case jt.Kind.OBJECT_TYPE_EXTENSION:return"object";case jt.Kind.INTERFACE_TYPE_EXTENSION:return"interface";case jt.Kind.UNION_TYPE_EXTENSION:return"union";case jt.Kind.ENUM_TYPE_EXTENSION:return"enum";case jt.Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:(0,kF.invariant)(!1,"Unexpected kind: "+(0,RF.inspect)(e))}}});var $F=L(Lh=>{"use strict";d();f();p();Object.defineProperty(Lh,"__esModule",{value:!0});Lh.ProvidedRequiredArgumentsOnDirectivesRule=BF;Lh.ProvidedRequiredArgumentsRule=aQ;var MF=un(),PF=rc(),UF=Ge(),CF=Vt(),sQ=Gi(),NI=kt(),oQ=qo();function aQ(e){return M(A({},BF(e)),{Field:{leave(t){var n;let r=e.getFieldDef();if(!r)return!1;let i=new Set((n=t.arguments)===null||n===void 0?void 0:n.map(s=>s.name.value));for(let s of r.args)if(!i.has(s.name)&&(0,NI.isRequiredArgument)(s)){let o=(0,MF.inspect)(s.type);e.reportError(new UF.GraphQLError(`Field "${r.name}" argument "${s.name}" of type "${o}" is required, but it was not provided.`,{nodes:t}))}}}})}function BF(e){var t;let n=Object.create(null),r=e.getSchema(),i=(t=r==null?void 0:r.getDirectives())!==null&&t!==void 0?t:oQ.specifiedDirectives;for(let a of i)n[a.name]=(0,PF.keyMap)(a.args.filter(NI.isRequiredArgument),u=>u.name);let s=e.getDocument().definitions;for(let a of s)if(a.kind===CF.Kind.DIRECTIVE_DEFINITION){var o;let u=(o=a.arguments)!==null&&o!==void 0?o:[];n[a.name.value]=(0,PF.keyMap)(u.filter(uQ),c=>c.name.value)}return{Directive:{leave(a){let u=a.name.value,c=n[u];if(c){var l;let m=(l=a.arguments)!==null&&l!==void 0?l:[],h=new Set(m.map(E=>E.name.value));for(let[E,N]of Object.entries(c))if(!h.has(E)){let D=(0,NI.isType)(N.type)?(0,MF.inspect)(N.type):(0,sQ.print)(N.type);e.reportError(new UF.GraphQLError(`Directive "@${u}" argument "${E}" of type "${D}" is required, but it was not provided.`,{nodes:a}))}}}}}}function uQ(e){return e.type.kind===CF.Kind.NON_NULL_TYPE&&e.defaultValue==null}});var qF=L(gI=>{"use strict";d();f();p();Object.defineProperty(gI,"__esModule",{value:!0});gI.ScalarLeafsRule=cQ;var VF=un(),jF=Ge(),GF=kt();function cQ(e){return{Field(t){let n=e.getType(),r=t.selectionSet;if(n){if((0,GF.isLeafType)((0,GF.getNamedType)(n))){if(r){let i=t.name.value,s=(0,VF.inspect)(n);e.reportError(new jF.GraphQLError(`Field "${i}" must not have a selection since type "${s}" has no subfields.`,{nodes:r}))}}else if(!r){let i=t.name.value,s=(0,VF.inspect)(n);e.reportError(new jF.GraphQLError(`Field "${i}" of type "${s}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:t}))}}}}}});var vI=L(II=>{"use strict";d();f();p();Object.defineProperty(II,"__esModule",{value:!0});II.printPathArray=lQ;function lQ(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}});var KF=L(Rh=>{"use strict";d();f();p();Object.defineProperty(Rh,"__esModule",{value:!0});Rh.addPath=dQ;Rh.pathToArray=pQ;function dQ(e,t,n){return{prev:e,key:t,typename:n}}function pQ(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}});var QF=L(_I=>{"use strict";d();f();p();Object.defineProperty(_I,"__esModule",{value:!0});_I.coerceInputValue=NQ;var fQ=Bo(),kh=un(),mQ=Ts(),hQ=Ag(),TQ=Uo(),gs=KF(),yQ=vI(),EQ=$o(),$a=Ge(),zd=kt();function NQ(e,t,n=gQ){return Xd(e,t,n,void 0)}function gQ(e,t,n){let r="Invalid value "+(0,kh.inspect)(t);throw e.length>0&&(r+=` at "value${(0,yQ.printPathArray)(e)}"`),n.message=r+": "+n.message,n}function Xd(e,t,n,r){if((0,zd.isNonNullType)(t)){if(e!=null)return Xd(e,t.ofType,n,r);n((0,gs.pathToArray)(r),e,new $a.GraphQLError(`Expected non-nullable type "${(0,kh.inspect)(t)}" not to be null.`));return}if(e==null)return null;if((0,zd.isListType)(t)){let i=t.ofType;return(0,hQ.isIterableObject)(e)?Array.from(e,(s,o)=>{let a=(0,gs.addPath)(r,o,void 0);return Xd(s,i,n,a)}):[Xd(e,i,n,r)]}if((0,zd.isInputObjectType)(t)){if(!(0,TQ.isObjectLike)(e)){n((0,gs.pathToArray)(r),e,new $a.GraphQLError(`Expected type "${t.name}" to be an object.`));return}let i={},s=t.getFields();for(let o of Object.values(s)){let a=e[o.name];if(a===void 0){if(o.defaultValue!==void 0)i[o.name]=o.defaultValue;else if((0,zd.isNonNullType)(o.type)){let u=(0,kh.inspect)(o.type);n((0,gs.pathToArray)(r),e,new $a.GraphQLError(`Field "${o.name}" of required type "${u}" was not provided.`))}continue}i[o.name]=Xd(a,o.type,n,(0,gs.addPath)(r,o.name,t.name))}for(let o of Object.keys(e))if(!s[o]){let a=(0,EQ.suggestionList)(o,Object.keys(t.getFields()));n((0,gs.pathToArray)(r),e,new $a.GraphQLError(`Field "${o}" is not defined by type "${t.name}".`+(0,fQ.didYouMean)(a)))}return i}if((0,zd.isLeafType)(t)){let i;try{i=t.parseValue(e)}catch(s){s instanceof $a.GraphQLError?n((0,gs.pathToArray)(r),e,s):n((0,gs.pathToArray)(r),e,new $a.GraphQLError(`Expected type "${t.name}". `+s.message,{originalError:s}));return}return i===void 0&&n((0,gs.pathToArray)(r),e,new $a.GraphQLError(`Expected type "${t.name}".`)),i}(0,mQ.invariant)(!1,"Unexpected input type: "+(0,kh.inspect)(t))}});var JF=L(bI=>{"use strict";d();f();p();Object.defineProperty(bI,"__esModule",{value:!0});bI.valueFromAST=Hd;var IQ=un(),vQ=Ts(),_Q=rc(),cc=Vt(),Va=kt();function Hd(e,t,n){if(e){if(e.kind===cc.Kind.VARIABLE){let r=e.name.value;if(n==null||n[r]===void 0)return;let i=n[r];return i===null&&(0,Va.isNonNullType)(t)?void 0:i}if((0,Va.isNonNullType)(t))return e.kind===cc.Kind.NULL?void 0:Hd(e,t.ofType,n);if(e.kind===cc.Kind.NULL)return null;if((0,Va.isListType)(t)){let r=t.ofType;if(e.kind===cc.Kind.LIST){let s=[];for(let o of e.values)if(YF(o,n)){if((0,Va.isNonNullType)(r))return;s.push(null)}else{let a=Hd(o,r,n);if(a===void 0)return;s.push(a)}return s}let i=Hd(e,r,n);return i===void 0?void 0:[i]}if((0,Va.isInputObjectType)(t)){if(e.kind!==cc.Kind.OBJECT)return;let r=Object.create(null),i=(0,_Q.keyMap)(e.fields,s=>s.name.value);for(let s of Object.values(t.getFields())){let o=i[s.name];if(!o||YF(o.value,n)){if(s.defaultValue!==void 0)r[s.name]=s.defaultValue;else if((0,Va.isNonNullType)(s.type))return;continue}let a=Hd(o.value,s.type,n);if(a===void 0)return;r[s.name]=a}return r}if((0,Va.isLeafType)(t)){let r;try{r=t.parseLiteral(e,n)}catch(i){return}return r===void 0?void 0:r}(0,vQ.invariant)(!1,"Unexpected input type: "+(0,IQ.inspect)(t))}}function YF(e,t){return e.kind===cc.Kind.VARIABLE&&(t==null||t[e.name.value]===void 0)}});var eL=L(Wd=>{"use strict";d();f();p();Object.defineProperty(Wd,"__esModule",{value:!0});Wd.getArgumentValues=WF;Wd.getDirectiveValues=FQ;Wd.getVariableValues=AQ;var lc=un(),bQ=rc(),SQ=vI(),Is=Ge(),zF=Vt(),XF=Gi(),dc=kt(),DQ=QF(),OQ=Es(),HF=JF();function AQ(e,t,n,r){let i=[],s=r==null?void 0:r.maxErrors;try{let o=wQ(e,t,n,a=>{if(s!=null&&i.length>=s)throw new Is.GraphQLError("Too many errors processing variables, error limit reached. Execution aborted.");i.push(a)});if(i.length===0)return{coerced:o}}catch(o){i.push(o)}return{errors:i}}function wQ(e,t,n,r){let i={};for(let s of t){let o=s.variable.name.value,a=(0,OQ.typeFromAST)(e,s.type);if(!(0,dc.isInputType)(a)){let c=(0,XF.print)(s.type);r(new Is.GraphQLError(`Variable "$${o}" expected value of type "${c}" which cannot be used as an input type.`,{nodes:s.type}));continue}if(!ZF(n,o)){if(s.defaultValue)i[o]=(0,HF.valueFromAST)(s.defaultValue,a);else if((0,dc.isNonNullType)(a)){let c=(0,lc.inspect)(a);r(new Is.GraphQLError(`Variable "$${o}" of required type "${c}" was not provided.`,{nodes:s}))}continue}let u=n[o];if(u===null&&(0,dc.isNonNullType)(a)){let c=(0,lc.inspect)(a);r(new Is.GraphQLError(`Variable "$${o}" of non-null type "${c}" must not be null.`,{nodes:s}));continue}i[o]=(0,DQ.coerceInputValue)(u,a,(c,l,m)=>{let h=`Variable "$${o}" got invalid value `+(0,lc.inspect)(l);c.length>0&&(h+=` at "${o}${(0,SQ.printPathArray)(c)}"`),r(new Is.GraphQLError(h+"; "+m.message,{nodes:s,originalError:m}))})}return i}function WF(e,t,n){var r;let i={},s=(r=t.arguments)!==null&&r!==void 0?r:[],o=(0,bQ.keyMap)(s,a=>a.name.value);for(let a of e.args){let u=a.name,c=a.type,l=o[u];if(!l){if(a.defaultValue!==void 0)i[u]=a.defaultValue;else if((0,dc.isNonNullType)(c))throw new Is.GraphQLError(`Argument "${u}" of required type "${(0,lc.inspect)(c)}" was not provided.`,{nodes:t});continue}let m=l.value,h=m.kind===zF.Kind.NULL;if(m.kind===zF.Kind.VARIABLE){let N=m.name.value;if(n==null||!ZF(n,N)){if(a.defaultValue!==void 0)i[u]=a.defaultValue;else if((0,dc.isNonNullType)(c))throw new Is.GraphQLError(`Argument "${u}" of required type "${(0,lc.inspect)(c)}" was provided the variable "$${N}" which was not provided a runtime value.`,{nodes:m});continue}h=n[N]==null}if(h&&(0,dc.isNonNullType)(c))throw new Is.GraphQLError(`Argument "${u}" of non-null type "${(0,lc.inspect)(c)}" must not be null.`,{nodes:m});let E=(0,HF.valueFromAST)(m,c,n);if(E===void 0)throw new Is.GraphQLError(`Argument "${u}" has invalid value ${(0,XF.print)(m)}.`,{nodes:m});i[u]=E}return i}function FQ(e,t,n){var r;let i=(r=t.directives)===null||r===void 0?void 0:r.find(s=>s.name.value===e.name);if(i)return WF(e,i,n)}function ZF(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var iL=L(Ph=>{"use strict";d();f();p();Object.defineProperty(Ph,"__esModule",{value:!0});Ph.collectFields=kQ;Ph.collectSubfields=xQ;var SI=Vt(),LQ=kt(),tL=qo(),RQ=Es(),nL=eL();function kQ(e,t,n,r,i){let s=new Map;return xh(e,t,n,r,i,s,new Set),s}function xQ(e,t,n,r,i){let s=new Map,o=new Set;for(let a of i)a.selectionSet&&xh(e,t,n,r,a.selectionSet,s,o);return s}function xh(e,t,n,r,i,s,o){for(let a of i.selections)switch(a.kind){case SI.Kind.FIELD:{if(!DI(n,a))continue;let u=PQ(a),c=s.get(u);c!==void 0?c.push(a):s.set(u,[a]);break}case SI.Kind.INLINE_FRAGMENT:{if(!DI(n,a)||!rL(e,a,r))continue;xh(e,t,n,r,a.selectionSet,s,o);break}case SI.Kind.FRAGMENT_SPREAD:{let u=a.name.value;if(o.has(u)||!DI(n,a))continue;o.add(u);let c=t[u];if(!c||!rL(e,c,r))continue;xh(e,t,n,r,c.selectionSet,s,o);break}}}function DI(e,t){let n=(0,nL.getDirectiveValues)(tL.GraphQLSkipDirective,t,e);if((n==null?void 0:n.if)===!0)return!1;let r=(0,nL.getDirectiveValues)(tL.GraphQLIncludeDirective,t,e);return(r==null?void 0:r.if)!==!1}function rL(e,t,n){let r=t.typeCondition;if(!r)return!0;let i=(0,RQ.typeFromAST)(e,r);return i===n?!0:(0,LQ.isAbstractType)(i)?e.isSubType(i,n):!1}function PQ(e){return e.alias?e.alias.value:e.name.value}});var oL=L(OI=>{"use strict";d();f();p();Object.defineProperty(OI,"__esModule",{value:!0});OI.SingleFieldSubscriptionsRule=CQ;var sL=Ge(),MQ=Vt(),UQ=iL();function CQ(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,s=Object.create(null),o=e.getDocument(),a=Object.create(null);for(let c of o.definitions)c.kind===MQ.Kind.FRAGMENT_DEFINITION&&(a[c.name.value]=c);let u=(0,UQ.collectFields)(n,a,s,r,t.selectionSet);if(u.size>1){let m=[...u.values()].slice(1).flat();e.reportError(new sL.GraphQLError(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:m}))}for(let c of u.values())c[0].name.value.startsWith("__")&&e.reportError(new sL.GraphQLError(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:c}))}}}}}});var Mh=L(AI=>{"use strict";d();f();p();Object.defineProperty(AI,"__esModule",{value:!0});AI.groupBy=BQ;function BQ(e,t){let n=new Map;for(let r of e){let i=t(r),s=n.get(i);s===void 0?n.set(i,[r]):s.push(r)}return n}});var aL=L(wI=>{"use strict";d();f();p();Object.defineProperty(wI,"__esModule",{value:!0});wI.UniqueArgumentDefinitionNamesRule=jQ;var $Q=Mh(),VQ=Ge();function jQ(e){return{DirectiveDefinition(r){var i;let s=(i=r.arguments)!==null&&i!==void 0?i:[];return n(`@${r.name.value}`,s)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(r){var i;let s=r.name.value,o=(i=r.fields)!==null&&i!==void 0?i:[];for(let u of o){var a;let c=u.name.value,l=(a=u.arguments)!==null&&a!==void 0?a:[];n(`${s}.${c}`,l)}return!1}function n(r,i){let s=(0,$Q.groupBy)(i,o=>o.name.value);for(let[o,a]of s)a.length>1&&e.reportError(new VQ.GraphQLError(`Argument "${r}(${o}:)" can only be defined once.`,{nodes:a.map(u=>u.name)}));return!1}}});var uL=L(FI=>{"use strict";d();f();p();Object.defineProperty(FI,"__esModule",{value:!0});FI.UniqueArgumentNamesRule=KQ;var GQ=Mh(),qQ=Ge();function KQ(e){return{Field:t,Directive:t};function t(n){var r;let i=(r=n.arguments)!==null&&r!==void 0?r:[],s=(0,GQ.groupBy)(i,o=>o.name.value);for(let[o,a]of s)a.length>1&&e.reportError(new qQ.GraphQLError(`There can be only one argument named "${o}".`,{nodes:a.map(u=>u.name)}))}}});var lL=L(LI=>{"use strict";d();f();p();Object.defineProperty(LI,"__esModule",{value:!0});LI.UniqueDirectiveNamesRule=QQ;var cL=Ge();function QQ(e){let t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(r){let i=r.name.value;if(n!=null&&n.getDirective(i)){e.reportError(new cL.GraphQLError(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}return t[i]?e.reportError(new cL.GraphQLError(`There can be only one directive named "@${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1}}}});var pL=L(kI=>{"use strict";d();f();p();Object.defineProperty(kI,"__esModule",{value:!0});kI.UniqueDirectivesPerLocationRule=zQ;var YQ=Ge(),RI=Vt(),dL=Qd(),JQ=qo();function zQ(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():JQ.specifiedDirectives;for(let a of r)t[a.name]=!a.isRepeatable;let i=e.getDocument().definitions;for(let a of i)a.kind===RI.Kind.DIRECTIVE_DEFINITION&&(t[a.name.value]=!a.repeatable);let s=Object.create(null),o=Object.create(null);return{enter(a){if(!("directives"in a)||!a.directives)return;let u;if(a.kind===RI.Kind.SCHEMA_DEFINITION||a.kind===RI.Kind.SCHEMA_EXTENSION)u=s;else if((0,dL.isTypeDefinitionNode)(a)||(0,dL.isTypeExtensionNode)(a)){let c=a.name.value;u=o[c],u===void 0&&(o[c]=u=Object.create(null))}else u=Object.create(null);for(let c of a.directives){let l=c.name.value;t[l]&&(u[l]?e.reportError(new YQ.GraphQLError(`The directive "@${l}" can only be used once at this location.`,{nodes:[u[l],c]})):u[l]=c)}}}}});var mL=L(xI=>{"use strict";d();f();p();Object.defineProperty(xI,"__esModule",{value:!0});xI.UniqueEnumValueNamesRule=HQ;var fL=Ge(),XQ=kt();function HQ(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(s){var o;let a=s.name.value;r[a]||(r[a]=Object.create(null));let u=(o=s.values)!==null&&o!==void 0?o:[],c=r[a];for(let l of u){let m=l.name.value,h=n[a];(0,XQ.isEnumType)(h)&&h.getValue(m)?e.reportError(new fL.GraphQLError(`Enum value "${a}.${m}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name})):c[m]?e.reportError(new fL.GraphQLError(`Enum value "${a}.${m}" can only be defined once.`,{nodes:[c[m],l.name]})):c[m]=l.name}return!1}}});var TL=L(MI=>{"use strict";d();f();p();Object.defineProperty(MI,"__esModule",{value:!0});MI.UniqueFieldDefinitionNamesRule=WQ;var hL=Ge(),PI=kt();function WQ(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(s){var o;let a=s.name.value;r[a]||(r[a]=Object.create(null));let u=(o=s.fields)!==null&&o!==void 0?o:[],c=r[a];for(let l of u){let m=l.name.value;ZQ(n[a],m)?e.reportError(new hL.GraphQLError(`Field "${a}.${m}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name})):c[m]?e.reportError(new hL.GraphQLError(`Field "${a}.${m}" can only be defined once.`,{nodes:[c[m],l.name]})):c[m]=l.name}return!1}}function ZQ(e,t){return(0,PI.isObjectType)(e)||(0,PI.isInterfaceType)(e)||(0,PI.isInputObjectType)(e)?e.getFields()[t]!=null:!1}});var yL=L(UI=>{"use strict";d();f();p();Object.defineProperty(UI,"__esModule",{value:!0});UI.UniqueFragmentNamesRule=tY;var eY=Ge();function tY(e){let t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){let r=n.name.value;return t[r]?e.reportError(new eY.GraphQLError(`There can be only one fragment named "${r}".`,{nodes:[t[r],n.name]})):t[r]=n.name,!1}}}});var EL=L(CI=>{"use strict";d();f();p();Object.defineProperty(CI,"__esModule",{value:!0});CI.UniqueInputFieldNamesRule=iY;var nY=Ts(),rY=Ge();function iY(e){let t=[],n=Object.create(null);return{ObjectValue:{enter(){t.push(n),n=Object.create(null)},leave(){let r=t.pop();r||(0,nY.invariant)(!1),n=r}},ObjectField(r){let i=r.name.value;n[i]?e.reportError(new rY.GraphQLError(`There can be only one input field named "${i}".`,{nodes:[n[i],r.name]})):n[i]=r.name}}}});var NL=L(BI=>{"use strict";d();f();p();Object.defineProperty(BI,"__esModule",{value:!0});BI.UniqueOperationNamesRule=oY;var sY=Ge();function oY(e){let t=Object.create(null);return{OperationDefinition(n){let r=n.name;return r&&(t[r.value]?e.reportError(new sY.GraphQLError(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),!1},FragmentDefinition:()=>!1}}});var IL=L($I=>{"use strict";d();f();p();Object.defineProperty($I,"__esModule",{value:!0});$I.UniqueOperationTypesRule=aY;var gL=Ge();function aY(e){let t=e.getSchema(),n=Object.create(null),r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(s){var o;let a=(o=s.operationTypes)!==null&&o!==void 0?o:[];for(let u of a){let c=u.operation,l=n[c];r[c]?e.reportError(new gL.GraphQLError(`Type for ${c} already defined in the schema. It cannot be redefined.`,{nodes:u})):l?e.reportError(new gL.GraphQLError(`There can be only one ${c} type in schema.`,{nodes:[l,u]})):n[c]=u}return!1}}});var _L=L(VI=>{"use strict";d();f();p();Object.defineProperty(VI,"__esModule",{value:!0});VI.UniqueTypeNamesRule=uY;var vL=Ge();function uY(e){let t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(i){let s=i.name.value;if(n!=null&&n.getType(s)){e.reportError(new vL.GraphQLError(`Type "${s}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}));return}return t[s]?e.reportError(new vL.GraphQLError(`There can be only one type named "${s}".`,{nodes:[t[s],i.name]})):t[s]=i.name,!1}}});var bL=L(jI=>{"use strict";d();f();p();Object.defineProperty(jI,"__esModule",{value:!0});jI.UniqueVariableNamesRule=dY;var cY=Mh(),lY=Ge();function dY(e){return{OperationDefinition(t){var n;let r=(n=t.variableDefinitions)!==null&&n!==void 0?n:[],i=(0,cY.groupBy)(r,s=>s.variable.name.value);for(let[s,o]of i)o.length>1&&e.reportError(new lY.GraphQLError(`There can be only one variable named "$${s}".`,{nodes:o.map(a=>a.variable.name)}))}}}});var SL=L(GI=>{"use strict";d();f();p();Object.defineProperty(GI,"__esModule",{value:!0});GI.ValuesOfCorrectTypeRule=hY;var pY=Bo(),Zd=un(),fY=rc(),mY=$o(),Ga=Ge(),Uh=Gi(),Qi=kt();function hY(e){return{ListValue(t){let n=(0,Qi.getNullableType)(e.getParentInputType());if(!(0,Qi.isListType)(n))return ja(e,t),!1},ObjectValue(t){let n=(0,Qi.getNamedType)(e.getInputType());if(!(0,Qi.isInputObjectType)(n))return ja(e,t),!1;let r=(0,fY.keyMap)(t.fields,i=>i.name.value);for(let i of Object.values(n.getFields()))if(!r[i.name]&&(0,Qi.isRequiredInputField)(i)){let o=(0,Zd.inspect)(i.type);e.reportError(new Ga.GraphQLError(`Field "${n.name}.${i.name}" of required type "${o}" was not provided.`,{nodes:t}))}},ObjectField(t){let n=(0,Qi.getNamedType)(e.getParentInputType());if(!e.getInputType()&&(0,Qi.isInputObjectType)(n)){let i=(0,mY.suggestionList)(t.name.value,Object.keys(n.getFields()));e.reportError(new Ga.GraphQLError(`Field "${t.name.value}" is not defined by type "${n.name}".`+(0,pY.didYouMean)(i),{nodes:t}))}},NullValue(t){let n=e.getInputType();(0,Qi.isNonNullType)(n)&&e.reportError(new Ga.GraphQLError(`Expected value of type "${(0,Zd.inspect)(n)}", found ${(0,Uh.print)(t)}.`,{nodes:t}))},EnumValue:t=>ja(e,t),IntValue:t=>ja(e,t),FloatValue:t=>ja(e,t),StringValue:t=>ja(e,t),BooleanValue:t=>ja(e,t)}}function ja(e,t){let n=e.getInputType();if(!n)return;let r=(0,Qi.getNamedType)(n);if(!(0,Qi.isLeafType)(r)){let i=(0,Zd.inspect)(n);e.reportError(new Ga.GraphQLError(`Expected value of type "${i}", found ${(0,Uh.print)(t)}.`,{nodes:t}));return}try{if(r.parseLiteral(t,void 0)===void 0){let s=(0,Zd.inspect)(n);e.reportError(new Ga.GraphQLError(`Expected value of type "${s}", found ${(0,Uh.print)(t)}.`,{nodes:t}))}}catch(i){let s=(0,Zd.inspect)(n);i instanceof Ga.GraphQLError?e.reportError(i):e.reportError(new Ga.GraphQLError(`Expected value of type "${s}", found ${(0,Uh.print)(t)}; `+i.message,{nodes:t,originalError:i}))}}});var DL=L(qI=>{"use strict";d();f();p();Object.defineProperty(qI,"__esModule",{value:!0});qI.VariablesAreInputTypesRule=gY;var TY=Ge(),yY=Gi(),EY=kt(),NY=Es();function gY(e){return{VariableDefinition(t){let n=(0,NY.typeFromAST)(e.getSchema(),t.type);if(n!==void 0&&!(0,EY.isInputType)(n)){let r=t.variable.name.value,i=(0,yY.print)(t.type);e.reportError(new TY.GraphQLError(`Variable "$${r}" cannot be non-input type "${i}".`,{nodes:t.type}))}}}}});var FL=L(KI=>{"use strict";d();f();p();Object.defineProperty(KI,"__esModule",{value:!0});KI.VariablesInAllowedPositionRule=bY;var OL=un(),IY=Ge(),vY=Vt(),AL=kt(),wL=Eh(),_Y=Es();function bY(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i,type:s,defaultValue:o}of r){let a=i.name.value,u=t[a];if(u&&s){let c=e.getSchema(),l=(0,_Y.typeFromAST)(c,u.type);if(l&&!SY(c,l,u.defaultValue,s,o)){let m=(0,OL.inspect)(l),h=(0,OL.inspect)(s);e.reportError(new IY.GraphQLError(`Variable "$${a}" of type "${m}" used in position expecting type "${h}".`,{nodes:[u,i]}))}}}}},VariableDefinition(n){t[n.variable.name.value]=n}}}function SY(e,t,n,r,i){if((0,AL.isNonNullType)(r)&&!(0,AL.isNonNullType)(t)){if(!(n!=null&&n.kind!==vY.Kind.NULL)&&!(i!==void 0))return!1;let a=r.ofType;return(0,wL.isTypeSubTypeOf)(e,t,a)}return(0,wL.isTypeSubTypeOf)(e,t,r)}});var CL=L(pc=>{"use strict";d();f();p();Object.defineProperty(pc,"__esModule",{value:!0});pc.specifiedSDLRules=pc.specifiedRules=void 0;var DY=zw(),OY=Hw(),AY=nF(),LL=aF(),RL=cF(),wY=lF(),kL=pF(),FY=fF(),LY=hF(),RY=TF(),kY=yF(),xY=EF(),PY=NF(),MY=OF(),UY=FF(),CY=xF(),xL=$F(),BY=qF(),$Y=oL(),VY=aL(),PL=uL(),jY=lL(),ML=pL(),GY=mL(),qY=TL(),KY=yL(),UL=EL(),QY=NL(),YY=IL(),JY=_L(),zY=bL(),XY=SL(),HY=DL(),WY=FL(),ZY=Object.freeze([DY.ExecutableDefinitionsRule,QY.UniqueOperationNamesRule,FY.LoneAnonymousOperationRule,$Y.SingleFieldSubscriptionsRule,kL.KnownTypeNamesRule,AY.FragmentsOnCompositeTypesRule,HY.VariablesAreInputTypesRule,BY.ScalarLeafsRule,OY.FieldsOnCorrectTypeRule,KY.UniqueFragmentNamesRule,wY.KnownFragmentNamesRule,xY.NoUnusedFragmentsRule,UY.PossibleFragmentSpreadsRule,RY.NoFragmentCyclesRule,zY.UniqueVariableNamesRule,kY.NoUndefinedVariablesRule,PY.NoUnusedVariablesRule,RL.KnownDirectivesRule,ML.UniqueDirectivesPerLocationRule,LL.KnownArgumentNamesRule,PL.UniqueArgumentNamesRule,XY.ValuesOfCorrectTypeRule,xL.ProvidedRequiredArgumentsRule,WY.VariablesInAllowedPositionRule,MY.OverlappingFieldsCanBeMergedRule,UL.UniqueInputFieldNamesRule]);pc.specifiedRules=ZY;var e2=Object.freeze([LY.LoneSchemaDefinitionRule,YY.UniqueOperationTypesRule,JY.UniqueTypeNamesRule,GY.UniqueEnumValueNamesRule,qY.UniqueFieldDefinitionNamesRule,VY.UniqueArgumentDefinitionNamesRule,jY.UniqueDirectiveNamesRule,kL.KnownTypeNamesRule,RL.KnownDirectivesRule,ML.UniqueDirectivesPerLocationRule,CY.PossibleTypeExtensionsRule,LL.KnownArgumentNamesOnDirectivesRule,PL.UniqueArgumentNamesRule,UL.UniqueInputFieldNamesRule,xL.ProvidedRequiredArgumentsOnDirectivesRule]);pc.specifiedSDLRules=e2});var VL=L(Ko=>{"use strict";d();f();p();Object.defineProperty(Ko,"__esModule",{value:!0});Ko.ValidationContext=Ko.SDLValidationContext=Ko.ASTValidationContext=void 0;var BL=Vt(),t2=Ad(),$L=Qg(),ep=class{constructor(t,n){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(let r of this.getDocument().definitions)r.kind===BL.Kind.FRAGMENT_DEFINITION&&(n[r.name.value]=r);this._fragments=n}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];let r=[t],i;for(;i=r.pop();)for(let s of i.selections)s.kind===BL.Kind.FRAGMENT_SPREAD?n.push(s):s.selectionSet&&r.push(s.selectionSet);this._fragmentSpreads.set(t,n)}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];let r=Object.create(null),i=[t.selectionSet],s;for(;s=i.pop();)for(let o of this.getFragmentSpreads(s)){let a=o.name.value;if(r[a]!==!0){r[a]=!0;let u=this.getFragment(a);u&&(n.push(u),i.push(u.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}};Ko.ASTValidationContext=ep;var QI=class extends ep{constructor(t,n,r){super(t,r),this._schema=n}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}};Ko.SDLValidationContext=QI;var YI=class extends ep{constructor(t,n,r,i){super(n,i),this._schema=t,this._typeInfo=r,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(t){let n=this._variableUsages.get(t);if(!n){let r=[],i=new $L.TypeInfo(this._schema);(0,t2.visit)(t,(0,$L.visitWithTypeInfo)(i,{VariableDefinition:()=>!1,Variable(s){r.push({node:s,type:i.getInputType(),defaultValue:i.getDefaultValue()})}})),n=r,this._variableUsages.set(t,n)}return n}getRecursiveVariableUsages(t){let n=this._recursiveVariableUsages.get(t);if(!n){n=this.getVariableUsages(t);for(let r of this.getRecursivelyReferencedFragments(t))n=n.concat(this.getVariableUsages(r));this._recursiveVariableUsages.set(t,n)}return n}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}};Ko.ValidationContext=YI});var KL=L(fc=>{"use strict";d();f();p();Object.defineProperty(fc,"__esModule",{value:!0});fc.assertValidSDL=o2;fc.assertValidSDLExtension=a2;fc.validate=s2;fc.validateSDL=JI;var n2=Ra(),r2=Ge(),Ch=Ad(),i2=Cw(),jL=Qg(),GL=CL(),qL=VL();function s2(e,t,n=GL.specifiedRules,r,i=new jL.TypeInfo(e)){var s;let o=(s=r==null?void 0:r.maxErrors)!==null&&s!==void 0?s:100;t||(0,n2.devAssert)(!1,"Must provide document."),(0,i2.assertValidSchema)(e);let a=Object.freeze({}),u=[],c=new qL.ValidationContext(e,t,i,m=>{if(u.length>=o)throw u.push(new r2.GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),a;u.push(m)}),l=(0,Ch.visitInParallel)(n.map(m=>m(c)));try{(0,Ch.visit)(t,(0,jL.visitWithTypeInfo)(i,l))}catch(m){if(m!==a)throw m}return u}function JI(e,t,n=GL.specifiedSDLRules){let r=[],i=new qL.SDLValidationContext(e,t,o=>{r.push(o)}),s=n.map(o=>o(i));return(0,Ch.visit)(e,(0,Ch.visitInParallel)(s)),r}function o2(e){let t=JI(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(` -`))}function E3(e,t){let n=a_(e,t);if(n.length!==0)throw new Error(n.map(r=>r.message).join(` +`))}function a2(e,t){let n=JI(e,t);if(n.length!==0)throw new Error(n.map(r=>r.message).join(` -`))}});var Ak=F(va=>{"use strict";d();m();f();Object.defineProperty(va,"__esModule",{value:!0});va.extendSchemaImpl=va.mapValue=va.AccumulatorMap=void 0;var Ee=(he(),Te(Ie)),rs=class extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(t,n){let r=this.get(t);r===void 0?this.set(t,[n]):r.push(n)}};va.AccumulatorMap=rs;function Hc(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}va.mapValue=Hc;function N3(e,t,n){var J,B,X,we;let r=[],i=new rs,o=new rs,s=new rs,a=new rs,c=new rs,u=new rs,l=[],p,h=[],y=!1;for(let C of t.definitions){switch(C.kind){case Ee.Kind.SCHEMA_DEFINITION:p=C;break;case Ee.Kind.SCHEMA_EXTENSION:h.push(C);break;case Ee.Kind.DIRECTIVE_DEFINITION:l.push(C);break;case Ee.Kind.SCALAR_TYPE_DEFINITION:case Ee.Kind.OBJECT_TYPE_DEFINITION:case Ee.Kind.INTERFACE_TYPE_DEFINITION:case Ee.Kind.UNION_TYPE_DEFINITION:case Ee.Kind.ENUM_TYPE_DEFINITION:case Ee.Kind.INPUT_OBJECT_TYPE_DEFINITION:r.push(C);break;case Ee.Kind.SCALAR_TYPE_EXTENSION:i.add(C.name.value,C);break;case Ee.Kind.OBJECT_TYPE_EXTENSION:o.add(C.name.value,C);break;case Ee.Kind.INTERFACE_TYPE_EXTENSION:s.add(C.name.value,C);break;case Ee.Kind.UNION_TYPE_EXTENSION:a.add(C.name.value,C);break;case Ee.Kind.ENUM_TYPE_EXTENSION:c.add(C.name.value,C);break;case Ee.Kind.INPUT_OBJECT_TYPE_EXTENSION:u.add(C.name.value,C);break;default:continue}y=!0}if(!y)return e;let N=new Map;for(let C of e.types){let G=K(C);G&&N.set(C.name,G)}for(let C of r){let G=C.name.value;N.set(G,(J=Sk.get(G))!=null?J:R(C))}for(let[C,G]of o)N.set(C,new Ee.GraphQLObjectType({name:C,interfaces:()=>Dt(G),fields:()=>Sr(G),extensionASTNodes:G}));if(n!=null&&n.addInvalidExtensionOrphans){for(let[C,G]of s)N.set(C,new Ee.GraphQLInterfaceType({name:C,interfaces:()=>Dt(G),fields:()=>Sr(G),extensionASTNodes:G}));for(let[C,G]of c)N.set(C,new Ee.GraphQLEnumType({name:C,values:mr(G),extensionASTNodes:G}));for(let[C,G]of a)N.set(C,new Ee.GraphQLUnionType({name:C,types:()=>dn(G),extensionASTNodes:G}));for(let[C,G]of i)N.set(C,new Ee.GraphQLScalarType({name:C,extensionASTNodes:G}));for(let[C,G]of u)N.set(C,new Ee.GraphQLInputObjectType({name:C,fields:()=>_i(G),extensionASTNodes:G}))}let O=D(D({query:e.query&&M(e.query),mutation:e.mutation&&M(e.mutation),subscription:e.subscription&&M(e.subscription)},p&&jn([p])),jn(h));return x(D({description:(X=(B=p==null?void 0:p.description)==null?void 0:B.value)!=null?X:e.description},O),{types:Array.from(N.values()),directives:[...e.directives.map(W),...l.map(jr)],extensions:e.extensions,astNode:p!=null?p:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(h),assumeValid:(we=n==null?void 0:n.assumeValid)!=null?we:!1});function w(C){return(0,Ee.isListType)(C)?new Ee.GraphQLList(w(C.ofType)):(0,Ee.isNonNullType)(C)?new Ee.GraphQLNonNull(w(C.ofType)):M(C)}function M(C){return N.get(C.name)}function W(C){if((0,Ee.isSpecifiedDirective)(C))return C;let G=C.toConfig();return new Ee.GraphQLDirective(x(D({},G),{args:Hc(G.args,mt)}))}function K(C){if((0,Ee.isIntrospectionType)(C)||(0,Ee.isSpecifiedScalarType)(C))return C;if((0,Ee.isScalarType)(C))return qe(C);if((0,Ee.isObjectType)(C))return st(C);if((0,Ee.isInterfaceType)(C))return ft(C);if((0,Ee.isUnionType)(C))return L(C);if((0,Ee.isEnumType)(C))return pe(C);if((0,Ee.isInputObjectType)(C))return te(C)}function te(C){var Pe;let G=C.toConfig(),Ne=(Pe=u.get(G.name))!=null?Pe:[];return new Ee.GraphQLInputObjectType(x(D({},G),{fields:()=>D(D({},Hc(G.fields,Nt=>x(D({},Nt),{type:w(Nt.type)}))),_i(Ne)),extensionASTNodes:G.extensionASTNodes.concat(Ne)}))}function pe(C){var Pe;let G=C.toConfig(),Ne=(Pe=c.get(C.name))!=null?Pe:[];return new Ee.GraphQLEnumType(x(D({},G),{values:D(D({},G.values),mr(Ne)),extensionASTNodes:G.extensionASTNodes.concat(Ne)}))}function qe(C){var Nt,Ke;let G=C.toConfig(),Ne=(Nt=i.get(G.name))!=null?Nt:[],Pe=G.specifiedByURL;for(let Ut of Ne)Pe=(Ke=Dk(Ut))!=null?Ke:Pe;return new Ee.GraphQLScalarType(x(D({},G),{specifiedByURL:Pe,extensionASTNodes:G.extensionASTNodes.concat(Ne)}))}function st(C){var Pe;let G=C.toConfig(),Ne=(Pe=o.get(G.name))!=null?Pe:[];return new Ee.GraphQLObjectType(x(D({},G),{interfaces:()=>[...C.getInterfaces().map(M),...Dt(Ne)],fields:()=>D(D({},Hc(G.fields,ne)),Sr(Ne)),extensionASTNodes:G.extensionASTNodes.concat(Ne)}))}function ft(C){var Pe;let G=C.toConfig(),Ne=(Pe=s.get(G.name))!=null?Pe:[];return new Ee.GraphQLInterfaceType(x(D({},G),{interfaces:()=>[...C.getInterfaces().map(M),...Dt(Ne)],fields:()=>D(D({},Hc(G.fields,ne)),Sr(Ne)),extensionASTNodes:G.extensionASTNodes.concat(Ne)}))}function L(C){var Pe;let G=C.toConfig(),Ne=(Pe=a.get(G.name))!=null?Pe:[];return new Ee.GraphQLUnionType(x(D({},G),{types:()=>[...C.getTypes().map(M),...dn(Ne)],extensionASTNodes:G.extensionASTNodes.concat(Ne)}))}function ne(C){return x(D({},C),{type:w(C.type),args:C.args&&Hc(C.args,mt)})}function mt(C){return x(D({},C),{type:w(C.type)})}function jn(C){var Ne;let G={};for(let Pe of C){let Nt=(Ne=Pe.operationTypes)!=null?Ne:[];for(let Ke of Nt)G[Ke.operation]=wn(Ke.type)}return G}function wn(C){var Pe;let G=C.name.value,Ne=(Pe=Sk.get(G))!=null?Pe:N.get(G);if(Ne===void 0)throw new Error(`Unknown type: "${G}".`);return Ne}function ei(C){return C.kind===Ee.Kind.LIST_TYPE?new Ee.GraphQLList(ei(C.type)):C.kind===Ee.Kind.NON_NULL_TYPE?new Ee.GraphQLNonNull(ei(C.type)):wn(C)}function jr(C){var G;return new Ee.GraphQLDirective({name:C.name.value,description:(G=C.description)==null?void 0:G.value,locations:C.locations.map(({value:Ne})=>Ne),isRepeatable:C.repeatable,args:qi(C.arguments),astNode:C})}function Sr(C){var Ne,Pe;let G=Object.create(null);for(let Nt of C){let Ke=(Ne=Nt.fields)!=null?Ne:[];for(let Ut of Ke)G[Ut.name.value]={type:ei(Ut.type),description:(Pe=Ut.description)==null?void 0:Pe.value,args:qi(Ut.arguments),deprecationReason:$y(Ut),astNode:Ut}}return G}function qi(C){var Pe;let G=C!=null?C:[],Ne=Object.create(null);for(let Nt of G){let Ke=ei(Nt.type);Ne[Nt.name.value]={type:Ke,description:(Pe=Nt.description)==null?void 0:Pe.value,defaultValue:(0,Ee.valueFromAST)(Nt.defaultValue,Ke),deprecationReason:$y(Nt),astNode:Nt}}return Ne}function _i(C){var Ne,Pe;let G=Object.create(null);for(let Nt of C){let Ke=(Ne=Nt.fields)!=null?Ne:[];for(let Ut of Ke){let Sa=ei(Ut.type);G[Ut.name.value]={type:Sa,description:(Pe=Ut.description)==null?void 0:Pe.value,defaultValue:(0,Ee.valueFromAST)(Ut.defaultValue,Sa),deprecationReason:$y(Ut),astNode:Ut}}}return G}function mr(C){var Ne,Pe;let G=Object.create(null);for(let Nt of C){let Ke=(Ne=Nt.values)!=null?Ne:[];for(let Ut of Ke)G[Ut.name.value]={description:(Pe=Ut.description)==null?void 0:Pe.value,deprecationReason:$y(Ut),astNode:Ut}}return G}function Dt(C){return C.flatMap(G=>{var Ne,Pe;return(Pe=(Ne=G.interfaces)==null?void 0:Ne.map(wn))!=null?Pe:[]})}function dn(C){return C.flatMap(G=>{var Ne,Pe;return(Pe=(Ne=G.types)==null?void 0:Ne.map(wn))!=null?Pe:[]})}function R(C){var Ne,Pe,Nt,Ke,Ut,Sa,Af,Fu,wf,Rf,dl,Da;let G=C.name.value;switch(C.kind){case Ee.Kind.OBJECT_TYPE_DEFINITION:{let Vt=(Ne=o.get(G))!=null?Ne:[],hr=[C,...Vt];return o.delete(G),new Ee.GraphQLObjectType({name:G,description:(Pe=C.description)==null?void 0:Pe.value,interfaces:()=>Dt(hr),fields:()=>Sr(hr),astNode:C,extensionASTNodes:Vt})}case Ee.Kind.INTERFACE_TYPE_DEFINITION:{let Vt=(Nt=s.get(G))!=null?Nt:[],hr=[C,...Vt];return s.delete(G),new Ee.GraphQLInterfaceType({name:G,description:(Ke=C.description)==null?void 0:Ke.value,interfaces:()=>Dt(hr),fields:()=>Sr(hr),astNode:C,extensionASTNodes:Vt})}case Ee.Kind.ENUM_TYPE_DEFINITION:{let Vt=(Ut=c.get(G))!=null?Ut:[],hr=[C,...Vt];return c.delete(G),new Ee.GraphQLEnumType({name:G,description:(Sa=C.description)==null?void 0:Sa.value,values:mr(hr),astNode:C,extensionASTNodes:Vt})}case Ee.Kind.UNION_TYPE_DEFINITION:{let Vt=(Af=a.get(G))!=null?Af:[],hr=[C,...Vt];return a.delete(G),new Ee.GraphQLUnionType({name:G,description:(Fu=C.description)==null?void 0:Fu.value,types:()=>dn(hr),astNode:C,extensionASTNodes:Vt})}case Ee.Kind.SCALAR_TYPE_DEFINITION:{let Vt=(wf=i.get(G))!=null?wf:[];return i.delete(G),new Ee.GraphQLScalarType({name:G,description:(Rf=C.description)==null?void 0:Rf.value,specifiedByURL:Dk(C),astNode:C,extensionASTNodes:Vt})}case Ee.Kind.INPUT_OBJECT_TYPE_DEFINITION:{let Vt=(dl=u.get(G))!=null?dl:[],hr=[C,...Vt];return u.delete(G),new Ee.GraphQLInputObjectType({name:G,description:(Da=C.description)==null?void 0:Da.value,fields:()=>_i(hr),astNode:C,extensionASTNodes:Vt})}}}}va.extendSchemaImpl=N3;var Sk=new Map([...Ee.specifiedScalarTypes,...Ee.introspectionTypes].map(e=>[e.name,e]));function $y(e){let t=(0,Ee.getDirectiveValues)(Ee.GraphQLDeprecatedDirective,e);return t==null?void 0:t.reason}function Dk(e){let t=(0,Ee.getDirectiveValues)(Ee.GraphQLSpecifiedByDirective,e);return t==null?void 0:t.url}});var Rk=F(Gy=>{"use strict";d();m();f();Object.defineProperty(Gy,"__esModule",{value:!0});Gy.buildASTSchema=void 0;var wk=(he(),Te(Ie)),g3=Xc(),v3=Ak();function I3(e,t){(t==null?void 0:t.assumeValid)!==!0&&(t==null?void 0:t.assumeValidSDL)!==!0&&(0,g3.assertValidSDL)(e);let n={description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},r=(0,v3.extendSchemaImpl)(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,...wk.specifiedDirectives.filter(o=>r.directives.every(s=>s.name!==o.name))];return new wk.GraphQLSchema(x(D({},r),{directives:i}))}Gy.buildASTSchema=I3});var Lk=F(qy=>{"use strict";d();m();f();Object.defineProperty(qy,"__esModule",{value:!0});qy.invalidOverrideTargetSubgraphNameWarning=void 0;var b3=Li();function _3(e,t,n){return`The object type "${t}" defines the directive "@override(from: "${e})" on the following field`+(n.length>1?"s":"")+': "'+n.join(b3.QUOTATION_JOIN)+`". +`))}});var JL=L(Qo=>{"use strict";d();f();p();Object.defineProperty(Qo,"__esModule",{value:!0});Qo.extendSchemaImpl=Qo.mapValue=Qo.AccumulatorMap=void 0;var le=(ne(),se(ce)),vs=class extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(t,n){let r=this.get(t);r===void 0?this.set(t,[n]):r.push(n)}};Qo.AccumulatorMap=vs;function mc(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}Qo.mapValue=mc;function u2(e,t,n){var ae,te,ue,lt;let r=[],i=new vs,s=new vs,o=new vs,a=new vs,u=new vs,c=new vs,l=[],m,h=[],E=!1;for(let P of t.definitions){switch(P.kind){case le.Kind.SCHEMA_DEFINITION:m=P;break;case le.Kind.SCHEMA_EXTENSION:h.push(P);break;case le.Kind.DIRECTIVE_DEFINITION:l.push(P);break;case le.Kind.SCALAR_TYPE_DEFINITION:case le.Kind.OBJECT_TYPE_DEFINITION:case le.Kind.INTERFACE_TYPE_DEFINITION:case le.Kind.UNION_TYPE_DEFINITION:case le.Kind.ENUM_TYPE_DEFINITION:case le.Kind.INPUT_OBJECT_TYPE_DEFINITION:r.push(P);break;case le.Kind.SCALAR_TYPE_EXTENSION:i.add(P.name.value,P);break;case le.Kind.OBJECT_TYPE_EXTENSION:s.add(P.name.value,P);break;case le.Kind.INTERFACE_TYPE_EXTENSION:o.add(P.name.value,P);break;case le.Kind.UNION_TYPE_EXTENSION:a.add(P.name.value,P);break;case le.Kind.ENUM_TYPE_EXTENSION:u.add(P.name.value,P);break;case le.Kind.INPUT_OBJECT_TYPE_EXTENSION:c.add(P.name.value,P);break;default:continue}E=!0}if(!E)return e;let N=new Map;for(let P of e.types){let G=Q(P);G&&N.set(P.name,G)}for(let P of r){let G=P.name.value;N.set(G,(ae=QL.get(G))!=null?ae:K(P))}for(let[P,G]of s)N.set(P,new le.GraphQLObjectType({name:P,interfaces:()=>Nt(G),fields:()=>ei(G),extensionASTNodes:G}));if(n!=null&&n.addInvalidExtensionOrphans){for(let[P,G]of o)N.set(P,new le.GraphQLInterfaceType({name:P,interfaces:()=>Nt(G),fields:()=>ei(G),extensionASTNodes:G}));for(let[P,G]of u)N.set(P,new le.GraphQLEnumType({name:P,values:Ni(G),extensionASTNodes:G}));for(let[P,G]of a)N.set(P,new le.GraphQLUnionType({name:P,types:()=>dn(G),extensionASTNodes:G}));for(let[P,G]of i)N.set(P,new le.GraphQLScalarType({name:P,extensionASTNodes:G}));for(let[P,G]of c)N.set(P,new le.GraphQLInputObjectType({name:P,fields:()=>co(G),extensionASTNodes:G}))}let D=A(A({query:e.query&&x(e.query),mutation:e.mutation&&x(e.mutation),subscription:e.subscription&&x(e.subscription)},m&&Zr([m])),Zr(h));return M(A({description:(ue=(te=m==null?void 0:m.description)==null?void 0:te.value)!=null?ue:e.description},D),{types:Array.from(N.values()),directives:[...e.directives.map(Y),...l.map(uo)],extensions:e.extensions,astNode:m!=null?m:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(h),assumeValid:(lt=n==null?void 0:n.assumeValid)!=null?lt:!1});function w(P){return(0,le.isListType)(P)?new le.GraphQLList(w(P.ofType)):(0,le.isNonNullType)(P)?new le.GraphQLNonNull(w(P.ofType)):x(P)}function x(P){return N.get(P.name)}function Y(P){if((0,le.isSpecifiedDirective)(P))return P;let G=P.toConfig();return new le.GraphQLDirective(M(A({},G),{args:mc(G.args,sn)}))}function Q(P){if((0,le.isIntrospectionType)(P)||(0,le.isSpecifiedScalarType)(P))return P;if((0,le.isScalarType)(P))return Qe(P);if((0,le.isObjectType)(P))return et(P);if((0,le.isInterfaceType)(P))return Pt(P);if((0,le.isUnionType)(P))return X(P);if((0,le.isEnumType)(P))return Ie(P);if((0,le.isInputObjectType)(P))return W(P)}function W(P){var ke;let G=P.toConfig(),ge=(ke=c.get(G.name))!=null?ke:[];return new le.GraphQLInputObjectType(M(A({},G),{fields:()=>A(A({},mc(G.fields,ft=>M(A({},ft),{type:w(ft.type)}))),co(ge)),extensionASTNodes:G.extensionASTNodes.concat(ge)}))}function Ie(P){var ke;let G=P.toConfig(),ge=(ke=u.get(P.name))!=null?ke:[];return new le.GraphQLEnumType(M(A({},G),{values:A(A({},G.values),Ni(ge)),extensionASTNodes:G.extensionASTNodes.concat(ge)}))}function Qe(P){var ft,ze;let G=P.toConfig(),ge=(ft=i.get(G.name))!=null?ft:[],ke=G.specifiedByURL;for(let Et of ge)ke=(ze=YL(Et))!=null?ze:ke;return new le.GraphQLScalarType(M(A({},G),{specifiedByURL:ke,extensionASTNodes:G.extensionASTNodes.concat(ge)}))}function et(P){var ke;let G=P.toConfig(),ge=(ke=s.get(G.name))!=null?ke:[];return new le.GraphQLObjectType(M(A({},G),{interfaces:()=>[...P.getInterfaces().map(x),...Nt(ge)],fields:()=>A(A({},mc(G.fields,De)),ei(ge)),extensionASTNodes:G.extensionASTNodes.concat(ge)}))}function Pt(P){var ke;let G=P.toConfig(),ge=(ke=o.get(G.name))!=null?ke:[];return new le.GraphQLInterfaceType(M(A({},G),{interfaces:()=>[...P.getInterfaces().map(x),...Nt(ge)],fields:()=>A(A({},mc(G.fields,De)),ei(ge)),extensionASTNodes:G.extensionASTNodes.concat(ge)}))}function X(P){var ke;let G=P.toConfig(),ge=(ke=a.get(G.name))!=null?ke:[];return new le.GraphQLUnionType(M(A({},G),{types:()=>[...P.getTypes().map(x),...dn(ge)],extensionASTNodes:G.extensionASTNodes.concat(ge)}))}function De(P){return M(A({},P),{type:w(P.type),args:P.args&&mc(P.args,sn)})}function sn(P){return M(A({},P),{type:w(P.type)})}function Zr(P){var ge;let G={};for(let ke of P){let ft=(ge=ke.operationTypes)!=null?ge:[];for(let ze of ft)G[ze.operation]=Nr(ze.type)}return G}function Nr(P){var ke;let G=P.name.value,ge=(ke=QL.get(G))!=null?ke:N.get(G);if(ge===void 0)throw new Error(`Unknown type: "${G}".`);return ge}function Ei(P){return P.kind===le.Kind.LIST_TYPE?new le.GraphQLList(Ei(P.type)):P.kind===le.Kind.NON_NULL_TYPE?new le.GraphQLNonNull(Ei(P.type)):Nr(P)}function uo(P){var G;return new le.GraphQLDirective({name:P.name.value,description:(G=P.description)==null?void 0:G.value,locations:P.locations.map(({value:ge})=>ge),isRepeatable:P.repeatable,args:Ho(P.arguments),astNode:P})}function ei(P){var ge,ke;let G=Object.create(null);for(let ft of P){let ze=(ge=ft.fields)!=null?ge:[];for(let Et of ze)G[Et.name.value]={type:Ei(Et.type),description:(ke=Et.description)==null?void 0:ke.value,args:Ho(Et.arguments),deprecationReason:Bh(Et),astNode:Et}}return G}function Ho(P){var ke;let G=P!=null?P:[],ge=Object.create(null);for(let ft of G){let ze=Ei(ft.type);ge[ft.name.value]={type:ze,description:(ke=ft.description)==null?void 0:ke.value,defaultValue:(0,le.valueFromAST)(ft.defaultValue,ze),deprecationReason:Bh(ft),astNode:ft}}return ge}function co(P){var ge,ke;let G=Object.create(null);for(let ft of P){let ze=(ge=ft.fields)!=null?ge:[];for(let Et of ze){let Wo=Ei(Et.type);G[Et.name.value]={type:Wo,description:(ke=Et.description)==null?void 0:ke.value,defaultValue:(0,le.valueFromAST)(Et.defaultValue,Wo),deprecationReason:Bh(Et),astNode:Et}}}return G}function Ni(P){var ge,ke;let G=Object.create(null);for(let ft of P){let ze=(ge=ft.values)!=null?ge:[];for(let Et of ze)G[Et.name.value]={description:(ke=Et.description)==null?void 0:ke.value,deprecationReason:Bh(Et),astNode:Et}}return G}function Nt(P){return P.flatMap(G=>{var ge,ke;return(ke=(ge=G.interfaces)==null?void 0:ge.map(Nr))!=null?ke:[]})}function dn(P){return P.flatMap(G=>{var ge,ke;return(ke=(ge=G.types)==null?void 0:ge.map(Nr))!=null?ke:[]})}function K(P){var ge,ke,ft,ze,Et,Wo,bp,Ha,Sp,Dp,Ac,Zo;let G=P.name.value;switch(P.kind){case le.Kind.OBJECT_TYPE_DEFINITION:{let vt=(ge=s.get(G))!=null?ge:[],tr=[P,...vt];return s.delete(G),new le.GraphQLObjectType({name:G,description:(ke=P.description)==null?void 0:ke.value,interfaces:()=>Nt(tr),fields:()=>ei(tr),astNode:P,extensionASTNodes:vt})}case le.Kind.INTERFACE_TYPE_DEFINITION:{let vt=(ft=o.get(G))!=null?ft:[],tr=[P,...vt];return o.delete(G),new le.GraphQLInterfaceType({name:G,description:(ze=P.description)==null?void 0:ze.value,interfaces:()=>Nt(tr),fields:()=>ei(tr),astNode:P,extensionASTNodes:vt})}case le.Kind.ENUM_TYPE_DEFINITION:{let vt=(Et=u.get(G))!=null?Et:[],tr=[P,...vt];return u.delete(G),new le.GraphQLEnumType({name:G,description:(Wo=P.description)==null?void 0:Wo.value,values:Ni(tr),astNode:P,extensionASTNodes:vt})}case le.Kind.UNION_TYPE_DEFINITION:{let vt=(bp=a.get(G))!=null?bp:[],tr=[P,...vt];return a.delete(G),new le.GraphQLUnionType({name:G,description:(Ha=P.description)==null?void 0:Ha.value,types:()=>dn(tr),astNode:P,extensionASTNodes:vt})}case le.Kind.SCALAR_TYPE_DEFINITION:{let vt=(Sp=i.get(G))!=null?Sp:[];return i.delete(G),new le.GraphQLScalarType({name:G,description:(Dp=P.description)==null?void 0:Dp.value,specifiedByURL:YL(P),astNode:P,extensionASTNodes:vt})}case le.Kind.INPUT_OBJECT_TYPE_DEFINITION:{let vt=(Ac=c.get(G))!=null?Ac:[],tr=[P,...vt];return c.delete(G),new le.GraphQLInputObjectType({name:G,description:(Zo=P.description)==null?void 0:Zo.value,fields:()=>co(tr),astNode:P,extensionASTNodes:vt})}}}}Qo.extendSchemaImpl=u2;var QL=new Map([...le.specifiedScalarTypes,...le.introspectionTypes].map(e=>[e.name,e]));function Bh(e){let t=(0,le.getDirectiveValues)(le.GraphQLDeprecatedDirective,e);return t==null?void 0:t.reason}function YL(e){let t=(0,le.getDirectiveValues)(le.GraphQLSpecifiedByDirective,e);return t==null?void 0:t.url}});var XL=L($h=>{"use strict";d();f();p();Object.defineProperty($h,"__esModule",{value:!0});$h.buildASTSchema=void 0;var zL=(ne(),se(ce)),c2=KL(),l2=JL();function d2(e,t){(t==null?void 0:t.assumeValid)!==!0&&(t==null?void 0:t.assumeValidSDL)!==!0&&(0,c2.assertValidSDL)(e);let n={description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},r=(0,l2.extendSchemaImpl)(n,e,t);if(r.astNode==null)for(let s of r.types)switch(s.name){case"Query":r.query=s;break;case"Mutation":r.mutation=s;break;case"Subscription":r.subscription=s;break}let i=[...r.directives,...zL.specifiedDirectives.filter(s=>r.directives.every(o=>o.name!==s.name))];return new zL.GraphQLSchema(M(A({},r),{directives:i}))}$h.buildASTSchema=d2});var zI=L(Vh=>{"use strict";d();f();p();Object.defineProperty(Vh,"__esModule",{value:!0});Vh.invalidOverrideTargetSubgraphNameWarning=void 0;var p2=Or();function f2(e,t,n){return`The object type "${t}" defines the directive "@override(from: "${e})" on the following field`+(n.length>1?"s":"")+': "'+n.join(p2.QUOTATION_JOIN)+`". The required "from" argument of type "String!" should be provided with an existing subgraph name. However, a subgraph by the name of "${e}" does not exist. -If this subgraph has been recently deleted, remember to clean up unused @override directives that reference this subgraph.`}qy.invalidOverrideTargetSubgraphNameWarning=_3});var u_=F(Io=>{"use strict";d();m();f();Object.defineProperty(Io,"__esModule",{value:!0});Io.batchNormalize=Io.NormalizationFactory=Io.normalizeSubgraph=Io.normalizeSubgraphFromString=void 0;var re=(he(),Te(Ie)),Kt=eo(),Lt=gv(),Cr=Jh(),vu=mc(),Me=za(),ae=Yo(),ye=Li(),O3=Rk(),Qd=Tv(),S3=Vp(),Fk=Pm(),D3=Lk();function A3(e){let{error:t,documentNode:n}=(0,Kt.safeParse)(e);return t||!n?{errors:[(0,ae.subgraphInvalidSyntaxError)(t)]}:new Yd().normalize(n)}Io.normalizeSubgraphFromString=A3;function kk(e,t){return new Yd(t).normalize(e)}Io.normalizeSubgraph=kk;var Yd=class{constructor(t){S(this,"abstractToConcreteTypeNames",new Map);S(this,"allDirectiveDefinitions",new Map);S(this,"argumentName","");S(this,"authorizationDataByParentTypeName",new Map);S(this,"childName","");S(this,"configurationDataMap",new Map);S(this,"customDirectiveDefinitions",new Map);S(this,"errors",[]);S(this,"entityContainerByTypeName",new Map);S(this,"entityInterfaces",new Map);S(this,"extensionContainerByTypeName",new Map);S(this,"interfaceTypeNamesWithAuthorizationDirectives",new Set);S(this,"isCurrentParentExtension",!1);S(this,"isCurrentParentRootType",!1);S(this,"isSubgraphVersionTwo",!1);S(this,"fieldSetContainerByTypeName",new Map);S(this,"heirFieldAuthorizationDataByTypeName",new Map);S(this,"handledRepeatedDirectivesByHostPath",new Map);S(this,"lastParentNodeKind",re.Kind.NULL);S(this,"lastChildNodeKind",re.Kind.NULL);S(this,"leafTypeNamesWithAuthorizationDirectives",new Set);S(this,"keyFieldNamesByParentTypeName",new Map);S(this,"operationTypeNames",new Map);S(this,"parentContainerByTypeName",new Map);S(this,"parentTypeName","");S(this,"parentsWithChildArguments",new Set);S(this,"eventsConfigurations",new Map);S(this,"overridesByTargetSubgraphName",new Map);S(this,"invalidOrScopesHostPaths",new Set);S(this,"schemaDefinition");S(this,"referencedDirectives",new Set);S(this,"referencedTypeNames",new Set);S(this,"warnings",[]);S(this,"subgraphName");for(let n of Cr.BASE_DIRECTIVE_DEFINITIONS)this.allDirectiveDefinitions.set(n.name.value,n);this.subgraphName=t,this.schemaDefinition={directives:new Map,kind:re.Kind.SCHEMA_DEFINITION,name:(0,Kt.stringToNameNode)(ye.SCHEMA),operationTypes:new Map}}validateInputNamedType(t){if(Cr.BASE_SCALARS.has(t))return{hasUnhandledError:!1,typeString:""};let n=this.parentContainerByTypeName.get(t);if(!n)return this.errors.push((0,ae.undefinedTypeError)(t)),{hasUnhandledError:!1,typeString:""};switch(n.kind){case re.Kind.ENUM_TYPE_DEFINITION:case re.Kind.INPUT_OBJECT_TYPE_DEFINITION:case re.Kind.SCALAR_TYPE_DEFINITION:return{hasUnhandledError:!1,typeString:""};default:return{hasUnhandledError:!0,typeString:(0,Me.kindToTypeString)(n.kind)}}}extractArguments(t,n,r){if(!t.arguments)return n;this.parentsWithChildArguments.add(this.parentTypeName);let i=new Set;for(let o of t.arguments){let s=o.name.value;if(n.has(s)){i.add(s);continue}n.set(s,(0,S3.inputValueDefinitionNodeToMutable)(o,this.parentTypeName))}return i.size>0&&this.errors.push((0,ae.duplicateArgumentsError)(r,[...i])),n}validateArguments(t,n){let r=[];for(let[i,o]of t.arguments){let s=(0,vu.getNamedTypeForChild)(n+`(${i}...)`,o.type),{hasUnhandledError:a,typeString:c}=this.validateInputNamedType(s);a&&r.push({argumentName:i,namedType:s,typeString:c,typeName:(0,Qd.printTypeNode)(o.type)})}r.length>0&&this.errors.push((0,ae.invalidArgumentsError)(n,r))}extractDirectives(t,n){if(!t.directives)return n;for(let r of t.directives){let i=r.name.value;if(i===ye.EXTENDS)continue;let o=n.get(i);if(o){o.push(r);continue}n.set(i,[r])}return n}getAuthorizationData(t){let n=this.authorizationDataByParentTypeName.get(this.parentTypeName);if((0,Me.resetAuthorizationData)(n),!t.directives)return n;let r=!1,i=[];for(let c of t.directives){let u=c.name.value;if(u===ye.AUTHENTICATED){if(r)return;r=!0;continue}if(u===ye.REQUIRES_SCOPES){if(i.length>0)return;i.push(c)}}if(!r&&i.length<1||((0,Me.isNodeKindInterface)(t.kind)&&this.interfaceTypeNamesWithAuthorizationDirectives.add(this.parentTypeName),n||(n=(0,Me.setAndGetValue)(this.authorizationDataByParentTypeName,this.parentTypeName,(0,Me.newAuthorizationData)(this.parentTypeName))),n.hasParentLevelAuthorization=!0,n.requiresAuthentication=r,i.length!==1))return n;let o=i[0];if(!o.arguments||o.arguments.length!==1)return;let s=o.arguments[0];if(s.name.value!==ye.SCOPES||s.value.kind!==re.Kind.LIST)return;let a=s.value.values;if(a.length<1)return n;if(a.length>Me.maxOrScopes){this.invalidOrScopesHostPaths.add(this.parentTypeName);return}for(let c of a){if(c.kind!==re.Kind.LIST)return;let u=new Set;for(let l of c.values){if(l.kind!==re.Kind.STRING)return;u.add(l.value)}u.size&&n.requiredScopes.push(u)}return n}extractDirectivesAndAuthorization(t,n){if(!t.directives)return n;let r=[];for(let s of t.directives){let a=s.name.value;if(a===ye.EXTENDS)continue;(a===ye.AUTHENTICATED||a===ye.REQUIRES_SCOPES)&&r.push(s);let c=n.get(a);if(c){c.push(s);continue}n.set(a,[s])}if(r.length<1)return n;t.kind!==re.Kind.FIELD_DEFINITION&&this.leafTypeNamesWithAuthorizationDirectives.add(this.parentTypeName);let i=(0,Me.getValueOrDefault)(this.authorizationDataByParentTypeName,this.parentTypeName,()=>(0,Me.newAuthorizationData)(this.parentTypeName)),o=(0,Me.getAuthorizationDataToUpdate)(i,t,this.childName);for(let s of r){if(s.name.value===ye.AUTHENTICATED){o.requiresAuthentication=!0;continue}if(!s.arguments||s.arguments.length!==1)break;let c=s.arguments[0];if(c.name.value!==ye.SCOPES||c.value.kind!==re.Kind.LIST)break;let u=c.value.values;if(!(u.length<1)){if(u.length>Me.maxOrScopes){this.invalidOrScopesHostPaths.add(this.parentTypeName);continue}for(let l of u){if(l.kind!==re.Kind.LIST)return n;let p=new Set;for(let h of l.values){if(h.kind!==re.Kind.STRING)return n;p.add(h.value)}p.size&&o.requiredScopes.push(p)}}}return n}extractUniqueUnionMembers(t,n){for(let r of t){let i=r.name.value;if(n.has(i)){this.errors.push(new Error(`Member "${i} can only be defined on union "${this.parentTypeName}" once.`));continue}Cr.BASE_SCALARS.has(i)||this.referencedTypeNames.add(i),n.set(i,r)}return n}mergeUniqueInterfaces(t,n,r){for(let i of t){if(!n.has(i)){n.add(i);continue}this.errors.push((0,ae.duplicateInterfaceExtensionError)(i,r))}}mergeUniqueUnionMembers(t,n){if(!n)return;let r=n.types,i=t.types,o=t.name.value;for(let[s,a]of r){if(!i.has(s)){i.set(s,a);continue}this.errors.push((0,ae.duplicateUnionMemberError)(s,o))}}mergeDirectives(t,n){if(n)for(let[r,i]of n.directives){let o=t.get(r);if(o){o.push(...i);continue}t.set(r,[...i])}}getValidatedAndNormalizedParentDirectives(t){let n=t.name.value,r=[];for(let[i,o]of t.directives){let s=this.allDirectiveDefinitions.get(i);if(!s){this.errors.push((0,ae.undefinedDirectiveError)(i,n));continue}let a=new Set,c=new Set;(0,Lt.getDirectiveDefinitionArgumentSets)(s.arguments||[],a,c);let u=new Set,l=[];for(let p of o){if((0,Lt.areNodeKindAndDirectiveLocationCompatible)(t.kind,s)||l.push((0,ae.invalidDirectiveLocationErrorMessage)(n,t.kind,i)),!s.repeatable&&o.length>1&&l.push((0,ae.invalidRepeatedDirectiveErrorMessage)(i,n)),!s.arguments||s.arguments.length<1){p.arguments&&p.arguments.length>0?l.push((0,ae.unexpectedDirectiveArgumentsErrorMessage)(p,n)):r.push(p);continue}if(!p.arguments||p.arguments.length<1){c.size>0?l.push((0,ae.undefinedRequiredArgumentsErrorMessage)(i,n,[...c])):r.push(p);continue}let h=(0,Lt.getDefinedArgumentsForDirective)(p.arguments,a,i,n,l),y=(0,Me.getEntriesNotInHashSet)(c,h);if(y.length>0&&l.push((0,ae.undefinedRequiredArgumentsErrorMessage)(i,n,[...c],y)),i===ye.KEY){let N=p.arguments[0].value.kind;if(N!==re.Kind.STRING){l.push((0,ae.invalidKeyDirectiveArgumentErrorMessage)(N));continue}let O=p.arguments[0].value.value;if(u.has(O))continue;u.add(O)}r.push(p)}l.length>0&&this.errors.push((0,ae.invalidDirectiveError)(i,n,l))}return r}convertKindForExtension(t){switch(t.kind){case re.Kind.INTERFACE_TYPE_DEFINITION:return re.Kind.INTERFACE_TYPE_EXTENSION;case re.Kind.OBJECT_TYPE_DEFINITION:return re.Kind.OBJECT_TYPE_EXTENSION;default:return t.kind}}handleInterfaceObject(t){var r;if(!(0,Kt.isNodeInterfaceObject)(t))return;let n=t.name.value;this.entityInterfaces.has(n)||this.entityInterfaces.set(n,{interfaceObjectFieldNames:new Set((r=t.fields)==null?void 0:r.map(i=>i.name.value)),interfaceFieldNames:new Set,isInterfaceObject:!0,typeName:n})}handleObjectLikeExtension(t){this.isCurrentParentExtension=!0;let n=this.extensionContainerByTypeName.get(this.parentTypeName),r=this.convertKindForExtension(t);if(n){if(n.kind!==r)return this.errors.push((0,ae.incompatibleExtensionKindsError)(t,n.kind)),!1;this.extractDirectives(t,n.directives),(0,Kt.extractInterfaces)(t,n.interfaces,this.errors);return}let i=(0,Kt.isObjectLikeNodeEntity)(t);if(this.extensionContainerByTypeName.set(this.parentTypeName,{directives:this.extractDirectives(t,new Map),fields:new Map,interfaces:(0,Kt.extractInterfaces)(t,new Set,this.errors),isEntity:i,kind:r,name:t.name}),t.kind===re.Kind.INTERFACE_TYPE_DEFINITION||t.kind===re.Kind.INTERFACE_TYPE_EXTENSION||!i)return;let o=(0,Me.getValueOrDefault)(this.fieldSetContainerByTypeName,this.parentTypeName,Lt.newFieldSetContainer);this.extractKeyFieldSets(t,o),(0,Me.upsertEntityContainerProperties)(this.entityContainerByTypeName,D({typeName:this.parentTypeName,keyFieldSets:o.keys},this.subgraphName?{subgraphNames:[this.subgraphName]}:{}))}validateChildDirectives(t,n){let r=t.node.kind;for(let[i,o]of t.directives){let s=this.allDirectiveDefinitions.get(i);if(!s){this.errors.push((0,ae.undefinedDirectiveError)(i,n));continue}let a=new Set,c=new Set;(0,Lt.getDirectiveDefinitionArgumentSets)(s.arguments||[],a,c);let u=[];for(let l of o){if((0,Lt.areNodeKindAndDirectiveLocationCompatible)(r,s)||u.push((0,ae.invalidDirectiveLocationErrorMessage)(n,r,i)),!s.repeatable&&o.length>1&&u.push((0,ae.invalidRepeatedDirectiveErrorMessage)(i,n)),!s.arguments||s.arguments.length<1){l.arguments&&l.arguments.length>0&&u.push((0,ae.unexpectedDirectiveArgumentsErrorMessage)(l,n));continue}if(!l.arguments||l.arguments.length<1){c.size>0&&u.push((0,ae.undefinedRequiredArgumentsErrorMessage)(i,n,[...c]));continue}let p=(0,Lt.getDefinedArgumentsForDirective)(l.arguments,a,i,n,u),h=(0,Me.getEntriesNotInHashSet)(c,p);h.length>0&&u.push((0,ae.undefinedRequiredArgumentsErrorMessage)(i,n,[...c],h))}u.length>0&&this.errors.push((0,ae.invalidDirectiveError)(i,n,u))}}isTypeValidImplementation(t,n){if(t.kind===re.Kind.NON_NULL_TYPE)return n.kind!==re.Kind.NON_NULL_TYPE?!1:this.isTypeValidImplementation(t.type,n.type);if(n.kind===re.Kind.NON_NULL_TYPE)return this.isTypeValidImplementation(t,n.type);switch(t.kind){case re.Kind.NAMED_TYPE:if(n.kind===re.Kind.NAMED_TYPE){let r=t.name.value,i=n.name.value;if(r===i)return!0;let o=this.abstractToConcreteTypeNames.get(r);return o?o.has(i):!1}return!1;default:return n.kind===re.Kind.LIST_TYPE?this.isTypeValidImplementation(t.type,n.type):!1}}canContainEventDirectives(){if(!this.isCurrentParentRootType)return!1;let t=this.operationTypeNames.get(this.parentTypeName);return t?t===re.OperationTypeNode.QUERY||t===re.OperationTypeNode.MUTATION||t===re.OperationTypeNode.SUBSCRIPTION:ye.ROOT_TYPES.has(this.parentTypeName)}extractKeyFieldSets(t,n){var s;let r=n.keys,i=t.name.value;if(!((s=t.directives)!=null&&s.length)){this.errors.push((0,ae.expectedEntityError)(i));return}let o=[];for(let a of t.directives)if(a.name.value===ye.KEY){if(!a.arguments||a.arguments.length<1){o.push((0,ae.undefinedRequiredArgumentsErrorMessage)(ye.KEY,i,[ye.FIELDS]));continue}for(let c of a.arguments){let u=c.name.value;if(c.name.value===ye.RESOLVABLE){c.value.kind===re.Kind.BOOLEAN&&!c.value.value&&(n.disableEntityResolver=!0);continue}if(c.name.value!==ye.FIELDS){o.push((0,ae.unexpectedDirectiveArgumentErrorMessage)(ye.KEY,u));break}if(c.value.kind!==re.Kind.STRING){o.push((0,ae.invalidKeyDirectiveArgumentErrorMessage)(c.value.kind));break}r.add(c.value.value)}}o.length&&this.errors.push((0,ae.invalidKeyDirectivesError)(i,o))}validateInterfaceImplementations(t){if(t.interfaces.size<1)return;let n=new Map;for(let r of t.interfaces){let i=(0,Me.getOrThrowError)(this.parentContainerByTypeName,r,ye.PARENTS);if(i.kind!==re.Kind.INTERFACE_TYPE_DEFINITION)throw(0,ae.incompatibleParentKindFatalError)(r,re.Kind.INTERFACE_TYPE_DEFINITION,i.kind);let o={invalidFieldImplementations:new Map,unimplementedFields:[]},s=!1;for(let[a,c]of i.fields){let u=!1,l=t.fields.get(a);if(!l){s=!0,o.unimplementedFields.push(a);continue}let p={invalidAdditionalArguments:new Set,invalidImplementedArguments:[],originalResponseType:(0,Qd.printTypeNode)(c.node.type),unimplementedArguments:new Set};this.isTypeValidImplementation(c.node.type,l.node.type)||(s=!0,u=!0,p.implementedResponseType=(0,Qd.printTypeNode)(l.node.type));let h=new Set;for(let[y,N]of c.arguments){h.add(y);let O=l.arguments.get(y);if(!O){s=!0,u=!0,p.unimplementedArguments.add(y);continue}let w=(0,Qd.printTypeNode)(O.type),M=(0,Qd.printTypeNode)(N.type);M!==w&&(s=!0,u=!0,p.invalidImplementedArguments.push({actualType:w,argumentName:y,expectedType:M}))}for(let[y,N]of l.arguments)h.has(y)||N.type.kind===re.Kind.NON_NULL_TYPE&&(s=!0,u=!0,p.invalidAdditionalArguments.add(y));u&&o.invalidFieldImplementations.set(a,p)}s&&n.set(r,o)}n.size&&this.errors.push((0,ae.unimplementedInterfaceFieldsError)(t.name.value,(0,Me.kindToTypeString)(t.kind),n))}handleOverride(t){if(t.name.value!==ye.OVERRIDE)return;let n=[],r=`${this.parentTypeName}.${this.childName}`,i=this.lastChildNodeKind===re.Kind.NULL?this.lastParentNodeKind:this.lastChildNodeKind;this.argumentName&&(r+=`(${this.argumentName}: ...)`,i=re.Kind.ARGUMENT),i!==re.Kind.FIELD_DEFINITION&&n.push((0,ae.invalidDirectiveLocationErrorMessage)(r,i,ye.OVERRIDE));let o="";if(t.arguments&&t.arguments.length>0){let c=new Set,u=new Set;for(let l of t.arguments){let p=l.name.value;if(p!==ye.FROM&&!c.has(p)){c.add(p),n.push((0,ae.unexpectedDirectiveArgumentErrorMessage)(ye.OVERRIDE,p));continue}if(c.has(p)){u.has(p)||n.push((0,ae.duplicateDirectiveArgumentDefinitionErrorMessage)(ye.OVERRIDE,r,p));continue}l.value.kind!==re.Kind.STRING?n.push((0,ae.invalidDirectiveArgumentTypeErrorMessage)(!0,ye.FROM,re.Kind.STRING,l.value.kind)):(c.add(ye.FROM),o=l.value.value,o===this.subgraphName&&this.errors.push((0,ae.equivalentSourceAndTargetOverrideError)(o,r)))}c.has(ye.FROM)||n.push((0,ae.undefinedRequiredArgumentsErrorMessage)(ye.OVERRIDE,r,[ye.FROM],[ye.FROM]))}else n.push((0,ae.undefinedRequiredArgumentsErrorMessage)(ye.OVERRIDE,r,[ye.FROM],[]));if(n.length>0){this.errors.push((0,ae.invalidDirectiveError)(ye.OVERRIDE,r,n));return}let s=(0,Me.getValueOrDefault)(this.overridesByTargetSubgraphName,o,()=>new Map),a=(0,Me.getValueOrDefault)(s,this.parentTypeName,()=>new Set);if(a.has(this.childName)){let c=this.handledRepeatedDirectivesByHostPath.get(r);if(c&&c.has(ye.OVERRIDE))return;(0,Me.getValueOrDefault)(this.handledRepeatedDirectivesByHostPath,r,()=>new Set).add(ye.OVERRIDE),this.errors.push((0,ae.invalidDirectiveError)(ye.OVERRIDE,r,[(0,ae.invalidRepeatedDirectiveErrorMessage)(ye.OVERRIDE,r)]));return}a.add(this.childName)}extractEventDirectives(t){if(t.directives)for(let n of t.directives){let r;switch(n.name.value){case ye.EVENTS_PUBLISH:{r="publish";break}case ye.EVENTS_REQUEST:{r="request";break}case ye.EVENTS_SUBSCRIBE:{r="subscribe";break}default:continue}let i,o;for(let a of n.arguments||[]){if(a.value.kind!==re.Kind.STRING)throw new Error(`Event directive arguments must be strings, ${a.value.kind} found in argument ${a.name}`);switch(a.name.value){case ye.TOPIC:{if(i!==void 0)throw new Error("Event directives must have exactly one topic argument, found multiple");if(!a.value.value)throw new Error("Event directives must have a non-empty topic argument");i=a.value.value;break}case ye.SOURCE_ID:{if(o!==void 0)throw new Error("Event directives must have exactly one sourceID argument, found multiple");if(!a.value.value)throw new Error("Event directives must have a non-empty sourceID argument");o=a.value.value;break}default:throw new Error(`Unknown argument ${a.name.value} found in event directive`)}}if(!i)throw new Error("Event directives must have a topic argument");(0,Me.getValueOrDefault)(this.eventsConfigurations,this.parentTypeName,()=>[]).push({type:r,fieldName:this.childName,topic:i,sourceId:o})}}normalize(t){let n=this,r=new Set,i=new Set;(0,re.visit)(t,{OperationTypeDefinition:{enter(u){let l=u.operation,p=`${n.parentTypeName}.${l}`,h=n.schemaDefinition.operationTypes.get(l),y=(0,vu.getNamedTypeForChild)(p,u.type);if(h)return(0,ae.duplicateOperationTypeDefinitionError)(l,y,(0,vu.getNamedTypeForChild)(p,h.type)),!1;let N=n.operationTypeNames.get(y);return N?n.errors.push((0,ae.invalidOperationTypeDefinitionError)(N,y,l)):(i.add(l),n.operationTypeNames.set(y,l),n.schemaDefinition.operationTypes.set(l,u)),!1}},SchemaDefinition:{enter(u){n.extractDirectives(u,n.schemaDefinition.directives),n.schemaDefinition.description=u.description}},SchemaExtension:{enter(u){n.extractDirectives(u,n.schemaDefinition.directives)}}}),(0,re.visit)(t,{DirectiveDefinition:{enter(u){let l=u.name.value;return r.has(l)?(n.errors.push((0,ae.duplicateDirectiveDefinitionError)(l)),!1):(r.add(l),Cr.VERSION_TWO_DIRECTIVES.has(l)?(n.isSubgraphVersionTwo=!0,!1):(Cr.VERSION_ONE_DIRECTIVES.has(l)||(n.allDirectiveDefinitions.set(l,u),n.customDirectiveDefinitions.set(l,u)),!1))}},Directive:{enter(u){let l=u.name.value;if(n.handleOverride(u),Cr.VERSION_TWO_DIRECTIVES.has(l))return n.isSubgraphVersionTwo=!0,!1;if(Cr.VERSION_ONE_DIRECTIVES.has(l))return!1;n.referencedDirectives.add(l)}},EnumTypeDefinition:{enter(u){let l=u.name.value;if(n.parentContainerByTypeName.has(l))return n.errors.push((0,ae.duplicateTypeDefinitionError)((0,Me.kindToTypeString)(u.kind),l)),!1;n.parentTypeName=l,n.lastParentNodeKind=u.kind;let p=n.extractDirectivesAndAuthorization(u,new Map);n.parentContainerByTypeName.set(l,{description:(0,Kt.formatDescription)(u.description),directives:p,kind:u.kind,name:u.name,values:new Map})},leave(){n.parentTypeName="",n.lastParentNodeKind=re.Kind.NULL}},EnumTypeExtension:{enter(u){let l=u.name.value;n.parentTypeName=l,n.lastParentNodeKind=u.kind,n.isCurrentParentExtension=!0;let p=n.extensionContainerByTypeName.get(n.parentTypeName);if(p){if(p.kind!==re.Kind.ENUM_TYPE_EXTENSION)return n.errors.push((0,ae.incompatibleExtensionKindsError)(u,p.kind)),!1;n.extractDirectivesAndAuthorization(u,p.directives);return}n.extensionContainerByTypeName.set(l,{directives:n.extractDirectivesAndAuthorization(u,new Map),kind:u.kind,name:u.name,values:new Map})},leave(){n.parentTypeName="",n.lastParentNodeKind=re.Kind.NULL,n.isCurrentParentExtension=!1}},EnumValueDefinition:{enter(u){let l=u.name.value;n.childName=l,n.lastChildNodeKind=u.kind;let p=n.isCurrentParentExtension?(0,Me.getOrThrowError)(n.extensionContainerByTypeName,n.parentTypeName,ye.EXTENSIONS):(0,Me.getOrThrowError)(n.parentContainerByTypeName,n.parentTypeName,ye.PARENTS);if(p.kind!==re.Kind.ENUM_TYPE_DEFINITION&&p.kind!==re.Kind.ENUM_TYPE_EXTENSION)throw(0,ae.unexpectedKindFatalError)(l);if(p.values.has(l)){let h=n.isCurrentParentExtension?(0,ae.duplicateValueExtensionError)("enum",n.parentTypeName,l):(0,ae.duplicateEnumValueDefinitionError)(l,n.parentTypeName);n.errors.push(h);return}p.values.set(l,{directives:n.extractDirectives(u,new Map),name:l,node:x(D({},u),{description:(0,Kt.formatDescription)(u.description)})})},leave(){n.childName="",n.lastChildNodeKind=re.Kind.NULL}},FieldDefinition:{enter(u){var W;let l=u.name.value;if(n.isCurrentParentRootType&&(l===ye.SERVICE_FIELD||l===ye.ENTITIES_FIELD))return!1;n.childName=l,n.lastChildNodeKind=u.kind,n.canContainEventDirectives()&&n.extractEventDirectives(u);let p=`${n.parentTypeName}.${l}`;n.lastChildNodeKind=u.kind;let h=(0,vu.getNamedTypeForChild)(p,u.type);Cr.BASE_SCALARS.has(h)||n.referencedTypeNames.add(h);let y=n.isCurrentParentExtension?(0,Me.getOrThrowError)(n.extensionContainerByTypeName,n.parentTypeName,ye.EXTENSIONS):(0,Me.getOrThrowError)(n.parentContainerByTypeName,n.parentTypeName,ye.PARENTS);if(y.kind!==re.Kind.OBJECT_TYPE_DEFINITION&&y.kind!==re.Kind.OBJECT_TYPE_EXTENSION&&y.kind!==re.Kind.INTERFACE_TYPE_DEFINITION&&y.kind!==re.Kind.INTERFACE_TYPE_EXTENSION)throw(0,ae.unexpectedKindFatalError)(n.parentTypeName);if(y.fields.has(l)){n.errors.push((0,ae.duplicateFieldDefinitionError)(l,n.parentTypeName));return}let N={arguments:n.extractArguments(u,new Map,p),directives:n.extractDirectivesAndAuthorization(u,new Map),name:l,node:x(D({},u),{arguments:(W=u.arguments)==null?void 0:W.map(K=>x(D({},K),{description:(0,Kt.formatDescription)(K.description)}))})};y.fields.set(l,N);let O=n.entityContainerByTypeName.get(n.parentTypeName);if(O){O.fieldNames.add(l);let K=n.fieldSetContainerByTypeName.get(n.parentTypeName);if(K){(0,Lt.extractFieldSetValue)(l,K.requires,N.directives.get(ye.REQUIRES)),(0,Lt.extractFieldSetValue)(l,K.provides,N.directives.get(ye.PROVIDES));return}}let w=N.directives.get(ye.PROVIDES);if(!w)return;let M=(0,Me.getValueOrDefault)(n.fieldSetContainerByTypeName,n.parentTypeName,Lt.newFieldSetContainer);(0,Lt.extractFieldSetValue)(l,M.provides,w)},leave(){n.childName="",n.lastChildNodeKind=re.Kind.NULL}},InputObjectTypeDefinition:{enter(u){let l=u.name.value;if(n.parentContainerByTypeName.has(l))return n.errors.push((0,ae.duplicateTypeDefinitionError)((0,Me.kindToTypeString)(u.kind),l)),!1;n.lastParentNodeKind=u.kind,n.parentTypeName=l,n.parentContainerByTypeName.set(l,{description:(0,Kt.formatDescription)(u.description),directives:n.extractDirectives(u,new Map),fields:new Map,kind:u.kind,name:u.name})},leave(){n.lastParentNodeKind=re.Kind.NULL,n.parentTypeName=""}},InputObjectTypeExtension:{enter(u){let l=u.name.value;n.parentTypeName=l,n.lastParentNodeKind=u.kind,n.isCurrentParentExtension=!0;let p=n.extensionContainerByTypeName.get(n.parentTypeName);if(p){if(p.kind!==re.Kind.INPUT_OBJECT_TYPE_EXTENSION)return n.errors.push((0,ae.incompatibleExtensionKindsError)(u,p.kind)),!1;n.extractDirectives(u,p.directives);return}n.extensionContainerByTypeName.set(l,{directives:n.extractDirectives(u,new Map),fields:new Map,kind:u.kind,name:u.name})},leave(){n.parentTypeName="",n.lastParentNodeKind=re.Kind.NULL,n.isCurrentParentExtension=!1}},InputValueDefinition:{enter(u){let l=u.name.value;if(n.lastParentNodeKind!==re.Kind.INPUT_OBJECT_TYPE_DEFINITION&&n.lastParentNodeKind!==re.Kind.INPUT_OBJECT_TYPE_EXTENSION){n.argumentName=l;return}n.childName=l,n.lastChildNodeKind=u.kind;let p=(0,vu.getNamedTypeForChild)(`${n.parentTypeName}.${l}`,u.type);Cr.BASE_SCALARS.has(p)||n.referencedTypeNames.add(p);let h=n.isCurrentParentExtension?(0,Me.getOrThrowError)(n.extensionContainerByTypeName,n.parentTypeName,ye.EXTENSIONS):(0,Me.getOrThrowError)(n.parentContainerByTypeName,n.parentTypeName,ye.PARENTS);if(h.kind!==re.Kind.INPUT_OBJECT_TYPE_DEFINITION&&h.kind!==re.Kind.INPUT_OBJECT_TYPE_EXTENSION)throw(0,ae.unexpectedKindFatalError)(n.parentTypeName);if(h.fields.has(l)){n.errors.push((0,ae.duplicateValueExtensionError)("input",n.parentTypeName,l));return}h.fields.set(l,{directives:n.extractDirectives(u,new Map),name:l,node:x(D({},u),{description:(0,Kt.formatDescription)(u.description)})})},leave(){n.argumentName="",n.lastChildNodeKind===re.Kind.INPUT_VALUE_DEFINITION&&(n.childName="",n.lastChildNodeKind=re.Kind.NULL)}},InterfaceTypeDefinition:{enter(u){var y;let l=u.name.value;if(n.parentTypeName=l,n.lastParentNodeKind=u.kind,(0,Kt.isNodeExtension)(u))return n.handleObjectLikeExtension(u);if(n.parentContainerByTypeName.has(l))return n.errors.push((0,ae.duplicateTypeDefinitionError)((0,Me.kindToTypeString)(u.kind),l)),!1;let p=(0,Kt.isObjectLikeNodeEntity)(u);if(n.parentContainerByTypeName.set(l,{description:(0,Kt.formatDescription)(u.description),directives:n.extractDirectives(u,new Map),fields:new Map,interfaces:(0,Kt.extractInterfaces)(u,new Set,n.errors),isEntity:p,kind:u.kind,name:u.name}),!p)return;n.entityInterfaces.set(l,{concreteTypeNames:new Set,interfaceFieldNames:new Set((y=u.fields)==null?void 0:y.map(N=>N.name.value)),interfaceObjectFieldNames:new Set,isInterfaceObject:!1,typeName:l}),(0,Me.upsertEntityContainerProperties)(n.entityContainerByTypeName,D({typeName:n.parentTypeName},n.subgraphName?{subgraphNames:[n.subgraphName]}:{}));let h=(0,Me.getValueOrDefault)(n.fieldSetContainerByTypeName,l,Lt.newFieldSetContainer);n.extractKeyFieldSets(u,h)},leave(){n.parentTypeName="",n.lastParentNodeKind=re.Kind.NULL,n.isCurrentParentExtension=!1}},InterfaceTypeExtension:{enter(u){return n.parentTypeName=u.name.value,n.lastParentNodeKind=u.kind,n.handleObjectLikeExtension(u)},leave(){n.isCurrentParentExtension=!1,n.parentTypeName="",n.lastParentNodeKind=re.Kind.NULL}},ObjectTypeDefinition:{enter(u){let l=u.name.value;if(l===ye.SERVICE_OBJECT)return!1;if(n.isCurrentParentRootType=ye.ROOT_TYPES.has(l)||n.operationTypeNames.has(l),n.parentTypeName=l,n.lastParentNodeKind=u.kind,(0,Kt.addConcreteTypesForImplementedInterfaces)(u,n.abstractToConcreteTypeNames),n.handleInterfaceObject(u),(0,Kt.isNodeExtension)(u))return n.handleObjectLikeExtension(u);if(n.parentContainerByTypeName.has(l))return n.errors.push((0,ae.duplicateTypeDefinitionError)((0,Me.kindToTypeString)(u.kind),l)),!1;let p=(0,Kt.isObjectLikeNodeEntity)(u);if(n.parentContainerByTypeName.set(l,{description:(0,Kt.formatDescription)(u.description),directives:n.extractDirectives(u,new Map),fields:new Map,interfaces:(0,Kt.extractInterfaces)(u,new Set,n.errors),isEntity:p,kind:u.kind,name:u.name}),!p)return;let h=(0,Me.getValueOrDefault)(n.fieldSetContainerByTypeName,l,Lt.newFieldSetContainer);n.extractKeyFieldSets(u,h),(0,Me.upsertEntityContainerProperties)(n.entityContainerByTypeName,D({typeName:n.parentTypeName,keyFieldSets:h.keys},n.subgraphName?{subgraphNames:[n.subgraphName]}:{}))},leave(){n.isCurrentParentRootType=!1,n.isCurrentParentExtension=!1,n.parentTypeName="",n.lastParentNodeKind=re.Kind.NULL}},ObjectTypeExtension:{enter(u){let l=u.name.value;return l===ye.SERVICE_OBJECT?!1:(n.isCurrentParentRootType=ye.ROOT_TYPES.has(l)||n.operationTypeNames.has(l),n.parentTypeName=l,n.lastParentNodeKind=u.kind,(0,Kt.addConcreteTypesForImplementedInterfaces)(u,n.abstractToConcreteTypeNames),n.handleObjectLikeExtension(u))},leave(){n.isCurrentParentRootType=!1,n.isCurrentParentExtension=!1,n.parentTypeName="",n.lastParentNodeKind=re.Kind.NULL}},ScalarTypeDefinition:{enter(u){let l=u.name.value;if(l===ye.ANY_SCALAR)return!1;if(n.parentContainerByTypeName.get(l))return n.errors.push((0,ae.duplicateTypeDefinitionError)((0,Me.kindToTypeString)(u.kind),l)),!1;n.parentTypeName=l,n.lastParentNodeKind=u.kind,n.parentContainerByTypeName.set(l,{description:(0,Kt.formatDescription)(u.description),directives:n.extractDirectivesAndAuthorization(u,new Map),kind:re.Kind.SCALAR_TYPE_DEFINITION,name:u.name})},leave(){n.parentTypeName="",n.lastParentNodeKind=re.Kind.NULL}},ScalarTypeExtension:{enter(u){let l=u.name.value;if(l===ye.ANY_SCALAR)return!1;let p=n.extensionContainerByTypeName.get(l);if(p){if(p.kind!==re.Kind.SCALAR_TYPE_EXTENSION)return n.errors.push((0,ae.incompatibleExtensionKindsError)(u,p.kind)),!1;n.extractDirectivesAndAuthorization(u,p.directives)}else n.parentTypeName=l,n.lastParentNodeKind=u.kind,n.extensionContainerByTypeName.set(l,{directives:n.extractDirectivesAndAuthorization(u,new Map),kind:u.kind,name:u.name});return!1},leave(){n.parentTypeName="",n.lastParentNodeKind=re.Kind.NULL}},UnionTypeDefinition:{enter(u){let l=u.name.value;if(l===ye.ENTITY_UNION)return!1;if(n.parentTypeName=l,n.parentContainerByTypeName.get(l))return n.errors.push((0,ae.duplicateTypeDefinitionError)((0,Me.kindToTypeString)(u.kind),l)),!1;if(!u.types)return n.errors.push((0,ae.noDefinedUnionMembersError)(l)),!1;n.lastParentNodeKind=u.kind,(0,Kt.addConcreteTypesForUnion)(u,n.abstractToConcreteTypeNames),n.parentContainerByTypeName.set(l,{description:(0,Kt.formatDescription)(u.description),directives:n.extractDirectives(u,new Map),kind:u.kind,name:u.name,types:n.extractUniqueUnionMembers([...u.types],new Map)})},leave(){n.parentTypeName="",n.lastParentNodeKind=re.Kind.NULL}},UnionTypeExtension:{enter(u){let l=u.name.value;if(l===ye.ENTITY_UNION)return!1;let p=n.extensionContainerByTypeName.get(l);if(!u.types)return n.errors.push(),!1;if(n.lastParentNodeKind=u.kind,(0,Kt.addConcreteTypesForUnion)(u,n.abstractToConcreteTypeNames),p){if(p.kind!==re.Kind.UNION_TYPE_EXTENSION)return n.errors.push((0,ae.incompatibleExtensionKindsError)(u,p.kind)),!1;n.extractDirectives(u,p.directives)}else n.extensionContainerByTypeName.set(l,{directives:n.extractDirectives(u,new Map),kind:u.kind,name:u.name,types:n.extractUniqueUnionMembers([...u.types],new Map)});return!1},leave(){n.lastParentNodeKind=re.Kind.NULL}}});let o=[];for(let u of Cr.BASE_DIRECTIVE_DEFINITIONS)o.push(u);if(o.push(Cr.FIELD_SET_SCALAR_DEFINITION),n.isSubgraphVersionTwo){for(let u of Cr.VERSION_TWO_DIRECTIVE_DEFINITIONS)o.push(u),this.allDirectiveDefinitions.set(u.name.value,u);o.push(Cr.SCOPE_SCALAR_DEFINITION)}for(let u of this.customDirectiveDefinitions.values())o.push(u);this.schemaDefinition.operationTypes.size>0&&o.push((0,Lt.schemaContainerToNode)(this,this.schemaDefinition));let s=new Set,a=new Set;for(let[u,l]of this.extensionContainerByTypeName){let p=this.entityContainerByTypeName.has(u),h={fieldNames:new Set,isRootNode:p,typeName:u};this.configurationDataMap.set(u,h),l.kind===re.Kind.OBJECT_TYPE_EXTENSION&&(this.operationTypeNames.has(u)&&(l.fields.delete(ye.SERVICE_FIELD),l.fields.delete(ye.ENTITIES_FIELD)),(0,Lt.addNonExternalFieldsToSet)(l.fields,h.fieldNames));let y=this.parentContainerByTypeName.get(u);if(!y){l.kind!==re.Kind.OBJECT_TYPE_EXTENSION?this.errors.push((0,ae.noBaseTypeExtensionError)(u)):(this.validateInterfaceImplementations(l),s.add(u),o.push((0,Lt.objectLikeContainerToNode)(this,l)));continue}if(!(0,Kt.areBaseAndExtensionKindsCompatible)(y.kind,l.kind,u)){this.errors.push((0,ae.incompatibleExtensionError)(u,y.kind,l.kind));continue}switch(y.kind){case re.Kind.ENUM_TYPE_DEFINITION:let N=l;for(let[K,te]of N.values){if(!y.values.has(K)){y.values.set(K,te);continue}this.errors.push((0,ae.duplicateEnumValueDefinitionError)(K,u))}o.push((0,Lt.enumContainerToNode)(this,y,N));break;case re.Kind.INPUT_OBJECT_TYPE_DEFINITION:let O=l;for(let[K,te]of O.fields){if(!y.fields.has(K)){y.fields.set(K,te);continue}this.errors.push((0,ae.duplicateFieldDefinitionError)(K,u))}o.push((0,Lt.inputObjectContainerToNode)(this,y,O));break;case re.Kind.INTERFACE_TYPE_DEFINITION:case re.Kind.OBJECT_TYPE_DEFINITION:let w=l,M=this.operationTypeNames.get(u);M&&(w.fields.delete(ye.SERVICE_FIELD),w.fields.delete(ye.ENTITIES_FIELD));for(let[K,te]of w.fields){if(te.arguments.size>0&&this.validateArguments(te,`${u}.${K}`),y.fields.has(K)){this.errors.push((0,ae.duplicateFieldDefinitionError)(K,u));continue}y.fields.set(K,te),te.arguments.has(ye.EXTERNAL)||h.fieldNames.add(K)}this.mergeUniqueInterfaces(w.interfaces,y.interfaces,u),this.validateInterfaceImplementations(y),o.push((0,Lt.objectLikeContainerToNode)(this,y,w)),y.fields.size<1&&!(0,Lt.isNodeQuery)(u,M)&&this.errors.push((0,ae.noFieldDefinitionsError)((0,Me.kindToTypeString)(y.kind),u)),(0,Lt.addNonExternalFieldsToSet)(y.fields,h.fieldNames);break;case re.Kind.SCALAR_TYPE_DEFINITION:o.push((0,Lt.scalarContainerToNode)(this,y,l));break;case re.Kind.UNION_TYPE_DEFINITION:let W=l;o.push((0,Lt.unionContainerToNode)(this,y,W));break;default:throw(0,ae.unexpectedKindFatalError)(u)}a.add(u)}for(let[u,l]of this.parentContainerByTypeName)if(!a.has(u))switch(l.kind){case re.Kind.ENUM_TYPE_DEFINITION:o.push((0,Lt.enumContainerToNode)(this,l));break;case re.Kind.INPUT_OBJECT_TYPE_DEFINITION:o.push((0,Lt.inputObjectContainerToNode)(this,l));break;case re.Kind.INTERFACE_TYPE_DEFINITION:case re.Kind.OBJECT_TYPE_DEFINITION:let p=this.entityContainerByTypeName.has(u),h=this.operationTypeNames.get(u);if(h&&(l.fields.delete(ye.SERVICE_FIELD),l.fields.delete(ye.ENTITIES_FIELD)),this.parentsWithChildArguments.has(u)){if(l.kind!==re.Kind.OBJECT_TYPE_DEFINITION&&l.kind!==re.Kind.INTERFACE_TYPE_DEFINITION)continue;for(let[w,M]of l.fields)this.validateArguments(M,`${u}.${w}`)}let y={fieldNames:new Set,isRootNode:p,typeName:u},N=this.entityInterfaces.get(u);N&&(N.concreteTypeNames=this.abstractToConcreteTypeNames.get(u)||new Set,y.isInterfaceObject=N.isInterfaceObject,y.entityInterfaceConcreteTypeNames=N.concreteTypeNames);let O=this.eventsConfigurations.get(u);O&&(y.events=O),this.configurationDataMap.set(u,y),(0,Lt.addNonExternalFieldsToSet)(l.fields,y.fieldNames),this.validateInterfaceImplementations(l),o.push((0,Lt.objectLikeContainerToNode)(this,l)),l.fields.size<1&&!(0,Lt.isNodeQuery)(u,h)&&this.errors.push((0,ae.noFieldDefinitionsError)((0,Me.kindToTypeString)(l.kind),u));break;case re.Kind.SCALAR_TYPE_DEFINITION:o.push((0,Lt.scalarContainerToNode)(this,l));break;case re.Kind.UNION_TYPE_DEFINITION:o.push((0,Lt.unionContainerToNode)(this,l));break;default:throw(0,ae.unexpectedKindFatalError)(u)}for(let u of Object.values(re.OperationTypeNode)){let l=this.schemaDefinition.operationTypes.get(u),p=(0,Me.getOrThrowError)(Kt.operationTypeNodeToDefaultType,u,ye.OPERATION_TO_DEFAULT),h=l?(0,vu.getNamedTypeForChild)(`schema.${u}`,l.type):p;if(h!==p&&(this.parentContainerByTypeName.has(p)||this.extensionContainerByTypeName.has(p))){this.errors.push((0,ae.invalidRootTypeDefinitionError)(u,h,p));continue}let y=this.parentContainerByTypeName.get(h),N=this.extensionContainerByTypeName.get(h);if(l){if(!y&&!N){this.errors.push((0,ae.undefinedTypeError)(h));continue}this.operationTypeNames.set(h,u)}if(!y&&!N)continue;let O=this.configurationDataMap.get(h);O&&(O.isRootNode=!0,O.typeName=p);let w=[y,N];for(let M of w)if(M){if(M.kind!==re.Kind.OBJECT_TYPE_DEFINITION&&M.kind!==re.Kind.OBJECT_TYPE_EXTENSION){this.errors.push((0,ae.operationDefinitionError)(h,u,M.kind));continue}for(let W of M.fields.values()){let K=W.name,te=`${h}.${K}`,pe=(0,vu.getNamedTypeForChild)(te,W.node.type);!Cr.BASE_SCALARS.has(pe)&&!this.parentContainerByTypeName.has(pe)&&!s.has(pe)&&this.errors.push((0,ae.undefinedTypeError)(pe))}}}for(let u of this.referencedTypeNames){if(this.parentContainerByTypeName.has(u)||this.entityContainerByTypeName.has(u))continue;let l=this.extensionContainerByTypeName.get(u);(!l||l.kind!==re.Kind.OBJECT_TYPE_EXTENSION)&&this.errors.push((0,ae.undefinedTypeError)(u))}for(let[u,l]of this.fieldSetContainerByTypeName){let p=this.parentContainerByTypeName.get(u)||this.extensionContainerByTypeName.get(u);if(!p||p.kind!==re.Kind.OBJECT_TYPE_DEFINITION&&p.kind!=re.Kind.OBJECT_TYPE_EXTENSION&&p.kind!==re.Kind.INTERFACE_TYPE_DEFINITION&&p.kind!==re.Kind.INTERFACE_TYPE_EXTENSION){this.errors.push((0,ae.undefinedObjectLikeParentError)(u));continue}(0,Lt.validateAndAddDirectivesWithFieldSetToConfigurationData)(this,p,l)}(0,Fk.walkSubgraphToApplyFieldAuthorization)(n,t);for(let u of this.interfaceTypeNamesWithAuthorizationDirectives){let l=n.authorizationDataByParentTypeName.get(u);if(!l)continue;let p=n.abstractToConcreteTypeNames.get(u);for(let h of p||[]){let y=(0,Me.getValueOrDefault)(n.authorizationDataByParentTypeName,h,()=>(0,Me.newAuthorizationData)(h));for(let[N,O]of l.fieldAuthorizationDataByFieldName)(0,Me.upsertFieldAuthorizationData)(y.fieldAuthorizationDataByFieldName,O)||this.invalidOrScopesHostPaths.add(`${h}.${N}`)}}for(let[u,l]of this.heirFieldAuthorizationDataByTypeName){let p=this.authorizationDataByParentTypeName.get(u);if(p)for(let h of l)(0,Me.mergeAuthorizationDataByAND)(p,h)||this.invalidOrScopesHostPaths.add(`${u}.${h.fieldName}`)}if(this.invalidOrScopesHostPaths.size>0&&this.errors.push((0,ae.orScopesLimitError)(Me.maxOrScopes,[...this.invalidOrScopesHostPaths])),this.errors.length>0)return{errors:this.errors};let c={kind:re.Kind.DOCUMENT,definitions:o};return{normalizationResult:{authorizationDataByParentTypeName:this.authorizationDataByParentTypeName,configurationDataMap:this.configurationDataMap,entityContainerByTypeName:this.entityContainerByTypeName,entityInterfaces:this.entityInterfaces,extensionContainerByTypeName:this.extensionContainerByTypeName,isVersionTwo:this.isSubgraphVersionTwo,keyFieldNamesByParentTypeName:this.keyFieldNamesByParentTypeName,operationTypes:this.operationTypeNames,overridesByTargetSubgraphName:this.overridesByTargetSubgraphName,parentContainerByTypeName:this.parentContainerByTypeName,subgraphAST:c,subgraphString:(0,re.print)(c),schema:(0,O3.buildASTSchema)(c,{assumeValid:!0})}}}};Io.NormalizationFactory=Yd;function w3(e){let t=new Map,n=new Map,r=new Map,i=new Map,o=new Map,s=new Set,a=new Map,c=new Set,u=new Set,l=[],p=new Set,h=[],y=[];for(let O of e)O.name&&(0,Fk.recordSubgraphName)(O.name,c,u);for(let O=0;Onew Map),ne=(0,Me.getValueOrDefault)(L,st,()=>new Set(ft));(0,Me.addIterableValuesToSet)(ft,ne)}for(let L of ft){let ne=`${st}.${L}`,mt=o.get(ne);if(!mt){o.set(ne,[M]);continue}mt.push(M),s.add(ne)}}}}let N=[];if(p.size>0&&N.push((0,ae.orScopesLimitError)(Me.maxOrScopes,[...p])),(l.length>0||u.size>0)&&N.push((0,ae.invalidSubgraphNamesError)([...u],l)),s.size>0){let O=[];for(let w of s){let M=(0,Me.getOrThrowError)(o,w,"overrideSourceSubgraphNamesByFieldPath");O.push((0,ae.duplicateOverriddenFieldErrorMessage)(w,M))}N.push((0,ae.duplicateOverriddenFieldsError)(O))}if(N.push(...y),N.length>0)return D({authorizationDataByParentTypeName:t,entityContainerByTypeName:n,errors:N,internalSubgraphBySubgraphName:r},h.length>0?{warnings:h}:{});for(let[O,w]of i){let M=(0,Me.getOrThrowError)(r,O,"internalSubgraphBySubgraphName");M.overriddenFieldNamesByParentTypeName=w;for(let[W,K]of w){let te=M.configurationDataMap.get(W);te&&((0,Me.subtractSourceSetFromTargetSet)(K,te.fieldNames),te.fieldNames.size<1&&M.configurationDataMap.delete(W))}}return D({authorizationDataByParentTypeName:t,entityContainerByTypeName:n,internalSubgraphBySubgraphName:r},h.length>0?{warnings:h}:{})}Io.batchNormalize=w3});var Pk=F(Wc=>{"use strict";d();m();f();Object.defineProperty(Wc,"__esModule",{value:!0});Wc.versionInfo=Wc.version=void 0;var R3="16.7.1";Wc.version=R3;var L3=Object.freeze({major:16,minor:7,patch:1,preReleaseTag:null});Wc.versionInfo=L3});var By=F(c_=>{"use strict";d();m();f();Object.defineProperty(c_,"__esModule",{value:!0});c_.isPromise=F3;function F3(e){return typeof(e==null?void 0:e.then)=="function"}});var Ky=F(l_=>{"use strict";d();m();f();Object.defineProperty(l_,"__esModule",{value:!0});l_.syntaxError=P3;var k3=$e();function P3(e,t,n){return new k3.GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}});var zd=F(Jd=>{"use strict";d();m();f();Object.defineProperty(Jd,"__esModule",{value:!0});Jd.TokenKind=void 0;var p_;Jd.TokenKind=p_;(function(e){e.SOF="",e.EOF="",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(p_||(Jd.TokenKind=p_={}))});var Yy=F(Hd=>{"use strict";d();m();f();Object.defineProperty(Hd,"__esModule",{value:!0});Hd.Lexer=void 0;Hd.isPunctuatorTokenKind=C3;var Vi=Ky(),Ck=yo(),x3=Td(),Iu=ny(),it=zd(),f_=class{constructor(t){let n=new Ck.Token(it.TokenKind.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==it.TokenKind.EOF)do if(t.next)t=t.next;else{let n=M3(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===it.TokenKind.COMMENT);return t}};Hd.Lexer=f_;function C3(e){return e===it.TokenKind.BANG||e===it.TokenKind.DOLLAR||e===it.TokenKind.AMP||e===it.TokenKind.PAREN_L||e===it.TokenKind.PAREN_R||e===it.TokenKind.SPREAD||e===it.TokenKind.COLON||e===it.TokenKind.EQUALS||e===it.TokenKind.AT||e===it.TokenKind.BRACKET_L||e===it.TokenKind.BRACKET_R||e===it.TokenKind.BRACE_L||e===it.TokenKind.PIPE||e===it.TokenKind.BRACE_R}function Zc(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Qy(e,t){return Mk(e.charCodeAt(t))&&Uk(e.charCodeAt(t+1))}function Mk(e){return e>=55296&&e<=56319}function Uk(e){return e>=56320&&e<=57343}function bu(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return it.TokenKind.EOF;if(n>=32&&n<=126){let r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Dn(e,t,n,r,i){let o=e.line,s=1+n-e.lineStart;return new Ck.Token(t,n,r,o,s,i)}function M3(e,t){let n=e.source.body,r=n.length,i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function q3(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:" ",size:2}}throw(0,Vi.syntaxError)(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function B3(e,t){let n=e.source.body,r=n.length,i=e.lineStart,o=t+3,s=o,a="",c=[];for(;o{"use strict";d();m();f();Object.defineProperty(Wd,"__esModule",{value:!0});Wd.Source=void 0;Wd.isSource=J3;var m_=br(),Q3=Ct(),Y3=fd(),Jy=class{constructor(t,n="GraphQL request",r={line:1,column:1}){typeof t=="string"||(0,m_.devAssert)(!1,`Body must be a string. Received: ${(0,Q3.inspect)(t)}.`),this.body=t,this.name=n,this.locationOffset=r,this.locationOffset.line>0||(0,m_.devAssert)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,m_.devAssert)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};Wd.Source=Jy;function J3(e){return(0,Y3.instanceOf)(e,Jy)}});var el=F(Ia=>{"use strict";d();m();f();Object.defineProperty(Ia,"__esModule",{value:!0});Ia.Parser=void 0;Ia.parse=X3;Ia.parseConstValue=W3;Ia.parseType=Z3;Ia.parseValue=H3;var _u=Ky(),Zd=yo(),z3=Vc(),Xe=It(),Vk=Yy(),jk=zy(),le=zd();function X3(e,t){return new Ou(e,t).parseDocument()}function H3(e,t){let n=new Ou(e,t);n.expectToken(le.TokenKind.SOF);let r=n.parseValueLiteral(!1);return n.expectToken(le.TokenKind.EOF),r}function W3(e,t){let n=new Ou(e,t);n.expectToken(le.TokenKind.SOF);let r=n.parseConstValueLiteral();return n.expectToken(le.TokenKind.EOF),r}function Z3(e,t){let n=new Ou(e,t);n.expectToken(le.TokenKind.SOF);let r=n.parseTypeReference();return n.expectToken(le.TokenKind.EOF),r}var Ou=class{constructor(t,n={}){let r=(0,jk.isSource)(t)?t:new jk.Source(t);this._lexer=new Vk.Lexer(r),this._options=n,this._tokenCounter=0}parseName(){let t=this.expectToken(le.TokenKind.NAME);return this.node(t,{kind:Xe.Kind.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:Xe.Kind.DOCUMENT,definitions:this.many(le.TokenKind.SOF,this.parseDefinition,le.TokenKind.EOF)})}parseDefinition(){if(this.peek(le.TokenKind.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===le.TokenKind.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw(0,_u.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(le.TokenKind.BRACE_L))return this.node(t,{kind:Xe.Kind.OPERATION_DEFINITION,operation:Zd.OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let n=this.parseOperationType(),r;return this.peek(le.TokenKind.NAME)&&(r=this.parseName()),this.node(t,{kind:Xe.Kind.OPERATION_DEFINITION,operation:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(le.TokenKind.NAME);switch(t.value){case"query":return Zd.OperationTypeNode.QUERY;case"mutation":return Zd.OperationTypeNode.MUTATION;case"subscription":return Zd.OperationTypeNode.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(le.TokenKind.PAREN_L,this.parseVariableDefinition,le.TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Xe.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(le.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(le.TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(le.TokenKind.DOLLAR),this.node(t,{kind:Xe.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Xe.Kind.SELECTION_SET,selections:this.many(le.TokenKind.BRACE_L,this.parseSelection,le.TokenKind.BRACE_R)})}parseSelection(){return this.peek(le.TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),r,i;return this.expectOptionalToken(le.TokenKind.COLON)?(r=n,i=this.parseName()):i=n,this.node(t,{kind:Xe.Kind.FIELD,alias:r,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(le.TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(le.TokenKind.PAREN_L,n,le.TokenKind.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,r=this.parseName();return this.expectToken(le.TokenKind.COLON),this.node(n,{kind:Xe.Kind.ARGUMENT,name:r,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(le.TokenKind.SPREAD);let n=this.expectOptionalKeyword("on");return!n&&this.peek(le.TokenKind.NAME)?this.node(t,{kind:Xe.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:Xe.Kind.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:Xe.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:Xe.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case le.TokenKind.BRACKET_L:return this.parseList(t);case le.TokenKind.BRACE_L:return this.parseObject(t);case le.TokenKind.INT:return this.advanceLexer(),this.node(n,{kind:Xe.Kind.INT,value:n.value});case le.TokenKind.FLOAT:return this.advanceLexer(),this.node(n,{kind:Xe.Kind.FLOAT,value:n.value});case le.TokenKind.STRING:case le.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case le.TokenKind.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:Xe.Kind.BOOLEAN,value:!0});case"false":return this.node(n,{kind:Xe.Kind.BOOLEAN,value:!1});case"null":return this.node(n,{kind:Xe.Kind.NULL});default:return this.node(n,{kind:Xe.Kind.ENUM,value:n.value})}case le.TokenKind.DOLLAR:if(t)if(this.expectToken(le.TokenKind.DOLLAR),this._lexer.token.kind===le.TokenKind.NAME){let r=this._lexer.token.value;throw(0,_u.syntaxError)(this._lexer.source,n.start,`Unexpected variable "$${r}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:Xe.Kind.STRING,value:t.value,block:t.kind===le.TokenKind.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:Xe.Kind.LIST,values:this.any(le.TokenKind.BRACKET_L,n,le.TokenKind.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:Xe.Kind.OBJECT,fields:this.any(le.TokenKind.BRACE_L,n,le.TokenKind.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,r=this.parseName();return this.expectToken(le.TokenKind.COLON),this.node(n,{kind:Xe.Kind.OBJECT_FIELD,name:r,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(le.TokenKind.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(le.TokenKind.AT),this.node(n,{kind:Xe.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(le.TokenKind.BRACKET_L)){let r=this.parseTypeReference();this.expectToken(le.TokenKind.BRACKET_R),n=this.node(t,{kind:Xe.Kind.LIST_TYPE,type:r})}else n=this.parseNamedType();return this.expectOptionalToken(le.TokenKind.BANG)?this.node(t,{kind:Xe.Kind.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:Xe.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(le.TokenKind.STRING)||this.peek(le.TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let r=this.parseConstDirectives(),i=this.many(le.TokenKind.BRACE_L,this.parseOperationTypeDefinition,le.TokenKind.BRACE_R);return this.node(t,{kind:Xe.Kind.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:i})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(le.TokenKind.COLON);let r=this.parseNamedType();return this.node(t,{kind:Xe.Kind.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let r=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:Xe.Kind.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let r=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:Xe.Kind.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:o,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(le.TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(le.TokenKind.BRACE_L,this.parseFieldDefinition,le.TokenKind.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseName(),i=this.parseArgumentDefs();this.expectToken(le.TokenKind.COLON);let o=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(t,{kind:Xe.Kind.FIELD_DEFINITION,description:n,name:r,arguments:i,type:o,directives:s})}parseArgumentDefs(){return this.optionalMany(le.TokenKind.PAREN_L,this.parseInputValueDef,le.TokenKind.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(le.TokenKind.COLON);let i=this.parseTypeReference(),o;this.expectOptionalToken(le.TokenKind.EQUALS)&&(o=this.parseConstValueLiteral());let s=this.parseConstDirectives();return this.node(t,{kind:Xe.Kind.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:o,directives:s})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let r=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:Xe.Kind.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:o,fields:s})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let r=this.parseName(),i=this.parseConstDirectives(),o=this.parseUnionMemberTypes();return this.node(t,{kind:Xe.Kind.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:o})}parseUnionMemberTypes(){return this.expectOptionalToken(le.TokenKind.EQUALS)?this.delimitedMany(le.TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let r=this.parseName(),i=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();return this.node(t,{kind:Xe.Kind.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:o})}parseEnumValuesDefinition(){return this.optionalMany(le.TokenKind.BRACE_L,this.parseEnumValueDefinition,le.TokenKind.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:Xe.Kind.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw(0,_u.syntaxError)(this._lexer.source,this._lexer.token.start,`${Xy(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let r=this.parseName(),i=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();return this.node(t,{kind:Xe.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:o})}parseInputFieldsDefinition(){return this.optionalMany(le.TokenKind.BRACE_L,this.parseInputValueDef,le.TokenKind.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===le.TokenKind.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),r=this.optionalMany(le.TokenKind.BRACE_L,this.parseOperationTypeDefinition,le.TokenKind.BRACE_R);if(n.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:Xe.Kind.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),r=this.parseConstDirectives();if(r.length===0)throw this.unexpected();return this.node(t,{kind:Xe.Kind.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:Xe.Kind.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:o})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:Xe.Kind.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:Xe.Kind.UNION_TYPE_EXTENSION,name:n,directives:r,types:i})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:Xe.Kind.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:Xe.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(le.TokenKind.AT);let r=this.parseName(),i=this.parseArgumentDefs(),o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let s=this.parseDirectiveLocations();return this.node(t,{kind:Xe.Kind.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,repeatable:o,locations:s})}parseDirectiveLocations(){return this.delimitedMany(le.TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(z3.DirectiveLocation,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new Zd.Location(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw(0,_u.syntaxError)(this._lexer.source,n.start,`Expected ${$k(t)}, found ${Xy(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===le.TokenKind.NAME&&n.value===t)this.advanceLexer();else throw(0,_u.syntaxError)(this._lexer.source,n.start,`Expected "${t}", found ${Xy(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===le.TokenKind.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t!=null?t:this._lexer.token;return(0,_u.syntaxError)(this._lexer.source,n.start,`Unexpected ${Xy(n)}.`)}any(t,n,r){this.expectToken(t);let i=[];for(;!this.expectOptionalToken(r);)i.push(n.call(this));return i}optionalMany(t,n,r){if(this.expectOptionalToken(t)){let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}return[]}many(t,n,r){this.expectToken(t);let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}delimitedMany(t,n){this.expectOptionalToken(t);let r=[];do r.push(n.call(this));while(this.expectOptionalToken(t));return r}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(t!==void 0&&n.kind!==le.TokenKind.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw(0,_u.syntaxError)(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}};Ia.Parser=Ou;function Xy(e){let t=e.value;return $k(e.kind)+(t!=null?` "${t}"`:"")}function $k(e){return(0,Vk.isPunctuatorTokenKind)(e)?`"${e}"`:e}});var Gk=F(h_=>{"use strict";d();m();f();Object.defineProperty(h_,"__esModule",{value:!0});h_.memoize3=e6;function e6(e){let t;return function(r,i,o){t===void 0&&(t=new WeakMap);let s=t.get(r);s===void 0&&(s=new WeakMap,t.set(r,s));let a=s.get(i);a===void 0&&(a=new WeakMap,s.set(i,a));let c=a.get(o);return c===void 0&&(c=e(r,i,o),a.set(o,c)),c}}});var qk=F(y_=>{"use strict";d();m();f();Object.defineProperty(y_,"__esModule",{value:!0});y_.promiseForObject=t6;function t6(e){return Promise.all(Object.values(e)).then(t=>{let n=Object.create(null);for(let[r,i]of Object.keys(e).entries())n[i]=t[r];return n})}});var Bk=F(T_=>{"use strict";d();m();f();Object.defineProperty(T_,"__esModule",{value:!0});T_.promiseReduce=r6;var n6=By();function r6(e,t,n){let r=n;for(let i of e)r=(0,n6.isPromise)(r)?r.then(o=>t(o,i)):t(r,i);return r}});var Kk=F(N_=>{"use strict";d();m();f();Object.defineProperty(N_,"__esModule",{value:!0});N_.toError=o6;var i6=Ct();function o6(e){return e instanceof Error?e:new E_(e)}var E_=class extends Error{constructor(t){super("Unexpected error value: "+(0,i6.inspect)(t)),this.name="NonErrorThrown",this.thrownValue=t}}});var Hy=F(g_=>{"use strict";d();m();f();Object.defineProperty(g_,"__esModule",{value:!0});g_.locatedError=u6;var s6=Kk(),a6=$e();function u6(e,t,n){var r;let i=(0,s6.toError)(e);return c6(i)?i:new a6.GraphQLError(i.message,{nodes:(r=i.nodes)!==null&&r!==void 0?r:t,source:i.source,positions:i.positions,path:n,originalError:i})}function c6(e){return Array.isArray(e.path)}});var tf=F(gi=>{"use strict";d();m();f();Object.defineProperty(gi,"__esModule",{value:!0});gi.assertValidExecutionArguments=Zk;gi.buildExecutionContext=eP;gi.buildResolveInfo=nP;gi.defaultTypeResolver=gi.defaultFieldResolver=void 0;gi.execute=Wk;gi.executeSync=y6;gi.getFieldDef=iP;var I_=br(),Su=Ct(),l6=lr(),p6=Iy(),O_=ho(),$i=By(),d6=Gk(),Du=Ud(),Qk=qk(),f6=Bk(),Ni=$e(),Zy=Hy(),v_=yo(),Yk=It(),ba=yt(),tl=Ti(),m6=Pd(),Xk=My(),Hk=Yc(),h6=(0,d6.memoize3)((e,t,n)=>(0,Xk.collectSubfields)(e.schema,e.fragments,e.variableValues,t,n));function Wk(e){arguments.length<2||(0,I_.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:t,document:n,variableValues:r,rootValue:i}=e;Zk(t,n,r);let o=eP(e);if(!("schema"in o))return{errors:o};try{let{operation:s}=o,a=T6(o,s,i);return(0,$i.isPromise)(a)?a.then(c=>Wy(c,o.errors),c=>(o.errors.push(c),Wy(null,o.errors))):Wy(a,o.errors)}catch(s){return o.errors.push(s),Wy(null,o.errors)}}function y6(e){let t=Wk(e);if((0,$i.isPromise)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function Wy(e,t){return t.length===0?{data:e}:{errors:t,data:e}}function Zk(e,t,n){t||(0,I_.devAssert)(!1,"Must provide document."),(0,m6.assertValidSchema)(e),n==null||(0,O_.isObjectLike)(n)||(0,I_.devAssert)(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function eP(e){var t,n;let{schema:r,document:i,rootValue:o,contextValue:s,variableValues:a,operationName:c,fieldResolver:u,typeResolver:l,subscribeFieldResolver:p}=e,h,y=Object.create(null);for(let w of i.definitions)switch(w.kind){case Yk.Kind.OPERATION_DEFINITION:if(c==null){if(h!==void 0)return[new Ni.GraphQLError("Must provide operation name if query contains multiple operations.")];h=w}else((t=w.name)===null||t===void 0?void 0:t.value)===c&&(h=w);break;case Yk.Kind.FRAGMENT_DEFINITION:y[w.name.value]=w;break;default:}if(!h)return c!=null?[new Ni.GraphQLError(`Unknown operation named "${c}".`)]:[new Ni.GraphQLError("Must provide an operation.")];let N=(n=h.variableDefinitions)!==null&&n!==void 0?n:[],O=(0,Hk.getVariableValues)(r,N,a!=null?a:{},{maxErrors:50});return O.errors?O.errors:{schema:r,fragments:y,rootValue:o,contextValue:s,operation:h,variableValues:O.coerced,fieldResolver:u!=null?u:__,typeResolver:l!=null?l:rP,subscribeFieldResolver:p!=null?p:__,errors:[]}}function T6(e,t,n){let r=e.schema.getRootType(t.operation);if(r==null)throw new Ni.GraphQLError(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});let i=(0,Xk.collectFields)(e.schema,e.fragments,e.variableValues,r,t.selectionSet),o=void 0;switch(t.operation){case v_.OperationTypeNode.QUERY:return eT(e,r,n,o,i);case v_.OperationTypeNode.MUTATION:return E6(e,r,n,o,i);case v_.OperationTypeNode.SUBSCRIPTION:return eT(e,r,n,o,i)}}function E6(e,t,n,r,i){return(0,f6.promiseReduce)(i.entries(),(o,[s,a])=>{let c=(0,Du.addPath)(r,s,t.name),u=tP(e,t,n,a,c);return u===void 0?o:(0,$i.isPromise)(u)?u.then(l=>(o[s]=l,o)):(o[s]=u,o)},Object.create(null))}function eT(e,t,n,r,i){let o=Object.create(null),s=!1;try{for(let[a,c]of i.entries()){let u=(0,Du.addPath)(r,a,t.name),l=tP(e,t,n,c,u);l!==void 0&&(o[a]=l,(0,$i.isPromise)(l)&&(s=!0))}}catch(a){if(s)return(0,Qk.promiseForObject)(o).finally(()=>{throw a});throw a}return s?(0,Qk.promiseForObject)(o):o}function tP(e,t,n,r,i){var o;let s=iP(e.schema,t,r[0]);if(!s)return;let a=s.type,c=(o=s.resolve)!==null&&o!==void 0?o:e.fieldResolver,u=nP(e,s,r,t,i);try{let l=(0,Hk.getArgumentValues)(s,r[0],e.variableValues),p=e.contextValue,h=c(n,l,p,u),y;return(0,$i.isPromise)(h)?y=h.then(N=>ef(e,a,r,u,i,N)):y=ef(e,a,r,u,i,h),(0,$i.isPromise)(y)?y.then(void 0,N=>{let O=(0,Zy.locatedError)(N,r,(0,Du.pathToArray)(i));return tT(O,a,e)}):y}catch(l){let p=(0,Zy.locatedError)(l,r,(0,Du.pathToArray)(i));return tT(p,a,e)}}function nP(e,t,n,r,i){return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function tT(e,t,n){if((0,ba.isNonNullType)(t))throw e;return n.errors.push(e),null}function ef(e,t,n,r,i,o){if(o instanceof Error)throw o;if((0,ba.isNonNullType)(t)){let s=ef(e,t.ofType,n,r,i,o);if(s===null)throw new Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return s}if(o==null)return null;if((0,ba.isListType)(t))return N6(e,t,n,r,i,o);if((0,ba.isLeafType)(t))return g6(t,o);if((0,ba.isAbstractType)(t))return v6(e,t,n,r,i,o);if((0,ba.isObjectType)(t))return b_(e,t,n,r,i,o);(0,l6.invariant)(!1,"Cannot complete value of unexpected output type: "+(0,Su.inspect)(t))}function N6(e,t,n,r,i,o){if(!(0,p6.isIterableObject)(o))throw new Ni.GraphQLError(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);let s=t.ofType,a=!1,c=Array.from(o,(u,l)=>{let p=(0,Du.addPath)(i,l,void 0);try{let h;return(0,$i.isPromise)(u)?h=u.then(y=>ef(e,s,n,r,p,y)):h=ef(e,s,n,r,p,u),(0,$i.isPromise)(h)?(a=!0,h.then(void 0,y=>{let N=(0,Zy.locatedError)(y,n,(0,Du.pathToArray)(p));return tT(N,s,e)})):h}catch(h){let y=(0,Zy.locatedError)(h,n,(0,Du.pathToArray)(p));return tT(y,s,e)}});return a?Promise.all(c):c}function g6(e,t){let n=e.serialize(t);if(n==null)throw new Error(`Expected \`${(0,Su.inspect)(e)}.serialize(${(0,Su.inspect)(t)})\` to return non-nullable value, returned: ${(0,Su.inspect)(n)}`);return n}function v6(e,t,n,r,i,o){var s;let a=(s=t.resolveType)!==null&&s!==void 0?s:e.typeResolver,c=e.contextValue,u=a(o,c,r,t);return(0,$i.isPromise)(u)?u.then(l=>b_(e,Jk(l,e,t,n,r,o),n,r,i,o)):b_(e,Jk(u,e,t,n,r,o),n,r,i,o)}function Jk(e,t,n,r,i,o){if(e==null)throw new Ni.GraphQLError(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${n.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if((0,ba.isObjectType)(e))throw new Ni.GraphQLError("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if(typeof e!="string")throw new Ni.GraphQLError(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${(0,Su.inspect)(o)}, received "${(0,Su.inspect)(e)}".`);let s=t.schema.getType(e);if(s==null)throw new Ni.GraphQLError(`Abstract type "${n.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!(0,ba.isObjectType)(s))throw new Ni.GraphQLError(`Abstract type "${n.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(!t.schema.isSubType(n,s))throw new Ni.GraphQLError(`Runtime Object type "${s.name}" is not a possible type for "${n.name}".`,{nodes:r});return s}function b_(e,t,n,r,i,o){let s=h6(e,t,n);if(t.isTypeOf){let a=t.isTypeOf(o,e.contextValue,r);if((0,$i.isPromise)(a))return a.then(c=>{if(!c)throw zk(t,o,n);return eT(e,t,o,i,s)});if(!a)throw zk(t,o,n)}return eT(e,t,o,i,s)}function zk(e,t,n){return new Ni.GraphQLError(`Expected value of type "${e.name}" but got: ${(0,Su.inspect)(t)}.`,{nodes:n})}var rP=function(e,t,n,r){if((0,O_.isObjectLike)(e)&&typeof e.__typename=="string")return e.__typename;let i=n.schema.getPossibleTypes(r),o=[];for(let s=0;s{for(let a=0;a{"use strict";d();m();f();Object.defineProperty(nT,"__esModule",{value:!0});nT.graphql=A6;nT.graphqlSync=w6;var I6=br(),b6=By(),_6=el(),O6=Pd(),S6=Xc(),D6=tf();function A6(e){return new Promise(t=>t(oP(e)))}function w6(e){let t=oP(e);if((0,b6.isPromise)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function oP(e){arguments.length<2||(0,I6.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:t,source:n,rootValue:r,contextValue:i,variableValues:o,operationName:s,fieldResolver:a,typeResolver:c}=e,u=(0,O6.validateSchema)(t);if(u.length>0)return{errors:u};let l;try{l=(0,_6.parse)(n)}catch(h){return{errors:[h]}}let p=(0,S6.validate)(t,l);return p.length>0?{errors:p}:(0,D6.execute)({schema:t,document:l,rootValue:r,contextValue:i,variableValues:o,operationName:s,fieldResolver:a,typeResolver:c})}});var cP=F(ie=>{"use strict";d();m();f();Object.defineProperty(ie,"__esModule",{value:!0});Object.defineProperty(ie,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return bo.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(ie,"GRAPHQL_MAX_INT",{enumerable:!0,get:function(){return is.GRAPHQL_MAX_INT}});Object.defineProperty(ie,"GRAPHQL_MIN_INT",{enumerable:!0,get:function(){return is.GRAPHQL_MIN_INT}});Object.defineProperty(ie,"GraphQLBoolean",{enumerable:!0,get:function(){return is.GraphQLBoolean}});Object.defineProperty(ie,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return bo.GraphQLDeprecatedDirective}});Object.defineProperty(ie,"GraphQLDirective",{enumerable:!0,get:function(){return bo.GraphQLDirective}});Object.defineProperty(ie,"GraphQLEnumType",{enumerable:!0,get:function(){return Ye.GraphQLEnumType}});Object.defineProperty(ie,"GraphQLFloat",{enumerable:!0,get:function(){return is.GraphQLFloat}});Object.defineProperty(ie,"GraphQLID",{enumerable:!0,get:function(){return is.GraphQLID}});Object.defineProperty(ie,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return bo.GraphQLIncludeDirective}});Object.defineProperty(ie,"GraphQLInputObjectType",{enumerable:!0,get:function(){return Ye.GraphQLInputObjectType}});Object.defineProperty(ie,"GraphQLInt",{enumerable:!0,get:function(){return is.GraphQLInt}});Object.defineProperty(ie,"GraphQLInterfaceType",{enumerable:!0,get:function(){return Ye.GraphQLInterfaceType}});Object.defineProperty(ie,"GraphQLList",{enumerable:!0,get:function(){return Ye.GraphQLList}});Object.defineProperty(ie,"GraphQLNonNull",{enumerable:!0,get:function(){return Ye.GraphQLNonNull}});Object.defineProperty(ie,"GraphQLObjectType",{enumerable:!0,get:function(){return Ye.GraphQLObjectType}});Object.defineProperty(ie,"GraphQLScalarType",{enumerable:!0,get:function(){return Ye.GraphQLScalarType}});Object.defineProperty(ie,"GraphQLSchema",{enumerable:!0,get:function(){return S_.GraphQLSchema}});Object.defineProperty(ie,"GraphQLSkipDirective",{enumerable:!0,get:function(){return bo.GraphQLSkipDirective}});Object.defineProperty(ie,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return bo.GraphQLSpecifiedByDirective}});Object.defineProperty(ie,"GraphQLString",{enumerable:!0,get:function(){return is.GraphQLString}});Object.defineProperty(ie,"GraphQLUnionType",{enumerable:!0,get:function(){return Ye.GraphQLUnionType}});Object.defineProperty(ie,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return Mr.SchemaMetaFieldDef}});Object.defineProperty(ie,"TypeKind",{enumerable:!0,get:function(){return Mr.TypeKind}});Object.defineProperty(ie,"TypeMetaFieldDef",{enumerable:!0,get:function(){return Mr.TypeMetaFieldDef}});Object.defineProperty(ie,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return Mr.TypeNameMetaFieldDef}});Object.defineProperty(ie,"__Directive",{enumerable:!0,get:function(){return Mr.__Directive}});Object.defineProperty(ie,"__DirectiveLocation",{enumerable:!0,get:function(){return Mr.__DirectiveLocation}});Object.defineProperty(ie,"__EnumValue",{enumerable:!0,get:function(){return Mr.__EnumValue}});Object.defineProperty(ie,"__Field",{enumerable:!0,get:function(){return Mr.__Field}});Object.defineProperty(ie,"__InputValue",{enumerable:!0,get:function(){return Mr.__InputValue}});Object.defineProperty(ie,"__Schema",{enumerable:!0,get:function(){return Mr.__Schema}});Object.defineProperty(ie,"__Type",{enumerable:!0,get:function(){return Mr.__Type}});Object.defineProperty(ie,"__TypeKind",{enumerable:!0,get:function(){return Mr.__TypeKind}});Object.defineProperty(ie,"assertAbstractType",{enumerable:!0,get:function(){return Ye.assertAbstractType}});Object.defineProperty(ie,"assertCompositeType",{enumerable:!0,get:function(){return Ye.assertCompositeType}});Object.defineProperty(ie,"assertDirective",{enumerable:!0,get:function(){return bo.assertDirective}});Object.defineProperty(ie,"assertEnumType",{enumerable:!0,get:function(){return Ye.assertEnumType}});Object.defineProperty(ie,"assertEnumValueName",{enumerable:!0,get:function(){return uP.assertEnumValueName}});Object.defineProperty(ie,"assertInputObjectType",{enumerable:!0,get:function(){return Ye.assertInputObjectType}});Object.defineProperty(ie,"assertInputType",{enumerable:!0,get:function(){return Ye.assertInputType}});Object.defineProperty(ie,"assertInterfaceType",{enumerable:!0,get:function(){return Ye.assertInterfaceType}});Object.defineProperty(ie,"assertLeafType",{enumerable:!0,get:function(){return Ye.assertLeafType}});Object.defineProperty(ie,"assertListType",{enumerable:!0,get:function(){return Ye.assertListType}});Object.defineProperty(ie,"assertName",{enumerable:!0,get:function(){return uP.assertName}});Object.defineProperty(ie,"assertNamedType",{enumerable:!0,get:function(){return Ye.assertNamedType}});Object.defineProperty(ie,"assertNonNullType",{enumerable:!0,get:function(){return Ye.assertNonNullType}});Object.defineProperty(ie,"assertNullableType",{enumerable:!0,get:function(){return Ye.assertNullableType}});Object.defineProperty(ie,"assertObjectType",{enumerable:!0,get:function(){return Ye.assertObjectType}});Object.defineProperty(ie,"assertOutputType",{enumerable:!0,get:function(){return Ye.assertOutputType}});Object.defineProperty(ie,"assertScalarType",{enumerable:!0,get:function(){return Ye.assertScalarType}});Object.defineProperty(ie,"assertSchema",{enumerable:!0,get:function(){return S_.assertSchema}});Object.defineProperty(ie,"assertType",{enumerable:!0,get:function(){return Ye.assertType}});Object.defineProperty(ie,"assertUnionType",{enumerable:!0,get:function(){return Ye.assertUnionType}});Object.defineProperty(ie,"assertValidSchema",{enumerable:!0,get:function(){return aP.assertValidSchema}});Object.defineProperty(ie,"assertWrappingType",{enumerable:!0,get:function(){return Ye.assertWrappingType}});Object.defineProperty(ie,"getNamedType",{enumerable:!0,get:function(){return Ye.getNamedType}});Object.defineProperty(ie,"getNullableType",{enumerable:!0,get:function(){return Ye.getNullableType}});Object.defineProperty(ie,"introspectionTypes",{enumerable:!0,get:function(){return Mr.introspectionTypes}});Object.defineProperty(ie,"isAbstractType",{enumerable:!0,get:function(){return Ye.isAbstractType}});Object.defineProperty(ie,"isCompositeType",{enumerable:!0,get:function(){return Ye.isCompositeType}});Object.defineProperty(ie,"isDirective",{enumerable:!0,get:function(){return bo.isDirective}});Object.defineProperty(ie,"isEnumType",{enumerable:!0,get:function(){return Ye.isEnumType}});Object.defineProperty(ie,"isInputObjectType",{enumerable:!0,get:function(){return Ye.isInputObjectType}});Object.defineProperty(ie,"isInputType",{enumerable:!0,get:function(){return Ye.isInputType}});Object.defineProperty(ie,"isInterfaceType",{enumerable:!0,get:function(){return Ye.isInterfaceType}});Object.defineProperty(ie,"isIntrospectionType",{enumerable:!0,get:function(){return Mr.isIntrospectionType}});Object.defineProperty(ie,"isLeafType",{enumerable:!0,get:function(){return Ye.isLeafType}});Object.defineProperty(ie,"isListType",{enumerable:!0,get:function(){return Ye.isListType}});Object.defineProperty(ie,"isNamedType",{enumerable:!0,get:function(){return Ye.isNamedType}});Object.defineProperty(ie,"isNonNullType",{enumerable:!0,get:function(){return Ye.isNonNullType}});Object.defineProperty(ie,"isNullableType",{enumerable:!0,get:function(){return Ye.isNullableType}});Object.defineProperty(ie,"isObjectType",{enumerable:!0,get:function(){return Ye.isObjectType}});Object.defineProperty(ie,"isOutputType",{enumerable:!0,get:function(){return Ye.isOutputType}});Object.defineProperty(ie,"isRequiredArgument",{enumerable:!0,get:function(){return Ye.isRequiredArgument}});Object.defineProperty(ie,"isRequiredInputField",{enumerable:!0,get:function(){return Ye.isRequiredInputField}});Object.defineProperty(ie,"isScalarType",{enumerable:!0,get:function(){return Ye.isScalarType}});Object.defineProperty(ie,"isSchema",{enumerable:!0,get:function(){return S_.isSchema}});Object.defineProperty(ie,"isSpecifiedDirective",{enumerable:!0,get:function(){return bo.isSpecifiedDirective}});Object.defineProperty(ie,"isSpecifiedScalarType",{enumerable:!0,get:function(){return is.isSpecifiedScalarType}});Object.defineProperty(ie,"isType",{enumerable:!0,get:function(){return Ye.isType}});Object.defineProperty(ie,"isUnionType",{enumerable:!0,get:function(){return Ye.isUnionType}});Object.defineProperty(ie,"isWrappingType",{enumerable:!0,get:function(){return Ye.isWrappingType}});Object.defineProperty(ie,"resolveObjMapThunk",{enumerable:!0,get:function(){return Ye.resolveObjMapThunk}});Object.defineProperty(ie,"resolveReadonlyArrayThunk",{enumerable:!0,get:function(){return Ye.resolveReadonlyArrayThunk}});Object.defineProperty(ie,"specifiedDirectives",{enumerable:!0,get:function(){return bo.specifiedDirectives}});Object.defineProperty(ie,"specifiedScalarTypes",{enumerable:!0,get:function(){return is.specifiedScalarTypes}});Object.defineProperty(ie,"validateSchema",{enumerable:!0,get:function(){return aP.validateSchema}});var S_=mu(),Ye=yt(),bo=Pr(),is=No(),Mr=Ti(),aP=Pd(),uP=Ed()});var pP=F(bt=>{"use strict";d();m();f();Object.defineProperty(bt,"__esModule",{value:!0});Object.defineProperty(bt,"BREAK",{enumerable:!0,get:function(){return nf.BREAK}});Object.defineProperty(bt,"DirectiveLocation",{enumerable:!0,get:function(){return C6.DirectiveLocation}});Object.defineProperty(bt,"Kind",{enumerable:!0,get:function(){return F6.Kind}});Object.defineProperty(bt,"Lexer",{enumerable:!0,get:function(){return P6.Lexer}});Object.defineProperty(bt,"Location",{enumerable:!0,get:function(){return D_.Location}});Object.defineProperty(bt,"OperationTypeNode",{enumerable:!0,get:function(){return D_.OperationTypeNode}});Object.defineProperty(bt,"Source",{enumerable:!0,get:function(){return R6.Source}});Object.defineProperty(bt,"Token",{enumerable:!0,get:function(){return D_.Token}});Object.defineProperty(bt,"TokenKind",{enumerable:!0,get:function(){return k6.TokenKind}});Object.defineProperty(bt,"getEnterLeaveForKind",{enumerable:!0,get:function(){return nf.getEnterLeaveForKind}});Object.defineProperty(bt,"getLocation",{enumerable:!0,get:function(){return L6.getLocation}});Object.defineProperty(bt,"getVisitFn",{enumerable:!0,get:function(){return nf.getVisitFn}});Object.defineProperty(bt,"isConstValueNode",{enumerable:!0,get:function(){return _o.isConstValueNode}});Object.defineProperty(bt,"isDefinitionNode",{enumerable:!0,get:function(){return _o.isDefinitionNode}});Object.defineProperty(bt,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return _o.isExecutableDefinitionNode}});Object.defineProperty(bt,"isSelectionNode",{enumerable:!0,get:function(){return _o.isSelectionNode}});Object.defineProperty(bt,"isTypeDefinitionNode",{enumerable:!0,get:function(){return _o.isTypeDefinitionNode}});Object.defineProperty(bt,"isTypeExtensionNode",{enumerable:!0,get:function(){return _o.isTypeExtensionNode}});Object.defineProperty(bt,"isTypeNode",{enumerable:!0,get:function(){return _o.isTypeNode}});Object.defineProperty(bt,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return _o.isTypeSystemDefinitionNode}});Object.defineProperty(bt,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return _o.isTypeSystemExtensionNode}});Object.defineProperty(bt,"isValueNode",{enumerable:!0,get:function(){return _o.isValueNode}});Object.defineProperty(bt,"parse",{enumerable:!0,get:function(){return rT.parse}});Object.defineProperty(bt,"parseConstValue",{enumerable:!0,get:function(){return rT.parseConstValue}});Object.defineProperty(bt,"parseType",{enumerable:!0,get:function(){return rT.parseType}});Object.defineProperty(bt,"parseValue",{enumerable:!0,get:function(){return rT.parseValue}});Object.defineProperty(bt,"print",{enumerable:!0,get:function(){return x6.print}});Object.defineProperty(bt,"printLocation",{enumerable:!0,get:function(){return lP.printLocation}});Object.defineProperty(bt,"printSourceLocation",{enumerable:!0,get:function(){return lP.printSourceLocation}});Object.defineProperty(bt,"visit",{enumerable:!0,get:function(){return nf.visit}});Object.defineProperty(bt,"visitInParallel",{enumerable:!0,get:function(){return nf.visitInParallel}});var R6=zy(),L6=zh(),lP=Ov(),F6=It(),k6=zd(),P6=Yy(),rT=el(),x6=Hr(),nf=au(),D_=yo(),_o=yu(),C6=Vc()});var dP=F(A_=>{"use strict";d();m();f();Object.defineProperty(A_,"__esModule",{value:!0});A_.isAsyncIterable=M6;function M6(e){return typeof(e==null?void 0:e[Symbol.asyncIterator])=="function"}});var fP=F(w_=>{"use strict";d();m();f();Object.defineProperty(w_,"__esModule",{value:!0});w_.mapAsyncIterator=U6;function U6(e,t){let n=e[Symbol.asyncIterator]();function r(o){return Wt(this,null,function*(){if(o.done)return o;try{return{value:yield t(o.value),done:!1}}catch(s){if(typeof n.return=="function")try{yield n.return()}catch(a){}throw s}})}return{next(){return Wt(this,null,function*(){return r(yield n.next())})},return(){return Wt(this,null,function*(){return typeof n.return=="function"?r(yield n.return()):{value:void 0,done:!0}})},throw(o){return Wt(this,null,function*(){if(typeof n.throw=="function")return r(yield n.throw(o));throw o})},[Symbol.asyncIterator](){return this}}}});var TP=F(iT=>{"use strict";d();m();f();Object.defineProperty(iT,"__esModule",{value:!0});iT.createSourceEventStream=yP;iT.subscribe=K6;var j6=br(),V6=Ct(),hP=dP(),mP=Ud(),R_=$e(),$6=Hy(),G6=My(),rf=tf(),q6=fP(),B6=Yc();function K6(t){return Wt(this,arguments,function*(e){arguments.length<2||(0,j6.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let n=yield yP(e);if(!(0,hP.isAsyncIterable)(n))return n;let r=i=>(0,rf.execute)(x(D({},e),{rootValue:i}));return(0,q6.mapAsyncIterator)(n,r)})}function Q6(e){let t=e[0];return t&&"document"in t?t:{schema:t,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]}}function yP(...e){return Wt(this,null,function*(){let t=Q6(e),{schema:n,document:r,variableValues:i}=t;(0,rf.assertValidExecutionArguments)(n,r,i);let o=(0,rf.buildExecutionContext)(t);if(!("schema"in o))return{errors:o};try{let s=yield Y6(o);if(!(0,hP.isAsyncIterable)(s))throw new Error(`Subscription field must return Async Iterable. Received: ${(0,V6.inspect)(s)}.`);return s}catch(s){if(s instanceof R_.GraphQLError)return{errors:[s]};throw s}})}function Y6(e){return Wt(this,null,function*(){let{schema:t,fragments:n,operation:r,variableValues:i,rootValue:o}=e,s=t.getSubscriptionType();if(s==null)throw new R_.GraphQLError("Schema is not configured to execute subscription operation.",{nodes:r});let a=(0,G6.collectFields)(t,n,i,s,r.selectionSet),[c,u]=[...a.entries()][0],l=(0,rf.getFieldDef)(t,s,u[0]);if(!l){let N=u[0].name.value;throw new R_.GraphQLError(`The subscription field "${N}" is not defined.`,{nodes:u})}let p=(0,mP.addPath)(void 0,c,s.name),h=(0,rf.buildResolveInfo)(e,l,u,s,p);try{var y;let N=(0,B6.getArgumentValues)(l,u[0],i),O=e.contextValue,M=yield((y=l.subscribe)!==null&&y!==void 0?y:e.subscribeFieldResolver)(o,N,O,h);if(M instanceof Error)throw M;return M}catch(N){throw(0,$6.locatedError)(N,u,(0,mP.pathToArray)(p))}})}});var NP=F(vi=>{"use strict";d();m();f();Object.defineProperty(vi,"__esModule",{value:!0});Object.defineProperty(vi,"createSourceEventStream",{enumerable:!0,get:function(){return EP.createSourceEventStream}});Object.defineProperty(vi,"defaultFieldResolver",{enumerable:!0,get:function(){return oT.defaultFieldResolver}});Object.defineProperty(vi,"defaultTypeResolver",{enumerable:!0,get:function(){return oT.defaultTypeResolver}});Object.defineProperty(vi,"execute",{enumerable:!0,get:function(){return oT.execute}});Object.defineProperty(vi,"executeSync",{enumerable:!0,get:function(){return oT.executeSync}});Object.defineProperty(vi,"getArgumentValues",{enumerable:!0,get:function(){return L_.getArgumentValues}});Object.defineProperty(vi,"getDirectiveValues",{enumerable:!0,get:function(){return L_.getDirectiveValues}});Object.defineProperty(vi,"getVariableValues",{enumerable:!0,get:function(){return L_.getVariableValues}});Object.defineProperty(vi,"responsePathAsArray",{enumerable:!0,get:function(){return J6.pathToArray}});Object.defineProperty(vi,"subscribe",{enumerable:!0,get:function(){return EP.subscribe}});var J6=Ud(),oT=tf(),EP=TP(),L_=Yc()});var gP=F(P_=>{"use strict";d();m();f();Object.defineProperty(P_,"__esModule",{value:!0});P_.NoDeprecatedCustomRule=z6;var F_=lr(),of=$e(),k_=yt();function z6(e){return{Field(t){let n=e.getFieldDef(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){let i=e.getParentType();i!=null||(0,F_.invariant)(!1),e.reportError(new of.GraphQLError(`The field ${i.name}.${n.name} is deprecated. ${r}`,{nodes:t}))}},Argument(t){let n=e.getArgument(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){let i=e.getDirective();if(i!=null)e.reportError(new of.GraphQLError(`Directive "@${i.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}));else{let o=e.getParentType(),s=e.getFieldDef();o!=null&&s!=null||(0,F_.invariant)(!1),e.reportError(new of.GraphQLError(`Field "${o.name}.${s.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}))}}},ObjectField(t){let n=(0,k_.getNamedType)(e.getParentInputType());if((0,k_.isInputObjectType)(n)){let r=n.getFields()[t.name.value],i=r==null?void 0:r.deprecationReason;i!=null&&e.reportError(new of.GraphQLError(`The input field ${n.name}.${r.name} is deprecated. ${i}`,{nodes:t}))}},EnumValue(t){let n=e.getEnumValue(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){let i=(0,k_.getNamedType)(e.getInputType());i!=null||(0,F_.invariant)(!1),e.reportError(new of.GraphQLError(`The enum value "${i.name}.${n.name}" is deprecated. ${r}`,{nodes:t}))}}}}});var vP=F(x_=>{"use strict";d();m();f();Object.defineProperty(x_,"__esModule",{value:!0});x_.NoSchemaIntrospectionCustomRule=Z6;var X6=$e(),H6=yt(),W6=Ti();function Z6(e){return{Field(t){let n=(0,H6.getNamedType)(e.getType());n&&(0,W6.isIntrospectionType)(n)&&e.reportError(new X6.GraphQLError(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}}});var IP=F(nt=>{"use strict";d();m();f();Object.defineProperty(nt,"__esModule",{value:!0});Object.defineProperty(nt,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return r4.ExecutableDefinitionsRule}});Object.defineProperty(nt,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return i4.FieldsOnCorrectTypeRule}});Object.defineProperty(nt,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return o4.FragmentsOnCompositeTypesRule}});Object.defineProperty(nt,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return s4.KnownArgumentNamesRule}});Object.defineProperty(nt,"KnownDirectivesRule",{enumerable:!0,get:function(){return a4.KnownDirectivesRule}});Object.defineProperty(nt,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return u4.KnownFragmentNamesRule}});Object.defineProperty(nt,"KnownTypeNamesRule",{enumerable:!0,get:function(){return c4.KnownTypeNamesRule}});Object.defineProperty(nt,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return l4.LoneAnonymousOperationRule}});Object.defineProperty(nt,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return w4.LoneSchemaDefinitionRule}});Object.defineProperty(nt,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return M4.NoDeprecatedCustomRule}});Object.defineProperty(nt,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return p4.NoFragmentCyclesRule}});Object.defineProperty(nt,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return U4.NoSchemaIntrospectionCustomRule}});Object.defineProperty(nt,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return d4.NoUndefinedVariablesRule}});Object.defineProperty(nt,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return f4.NoUnusedFragmentsRule}});Object.defineProperty(nt,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return m4.NoUnusedVariablesRule}});Object.defineProperty(nt,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return h4.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(nt,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return y4.PossibleFragmentSpreadsRule}});Object.defineProperty(nt,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return C4.PossibleTypeExtensionsRule}});Object.defineProperty(nt,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return T4.ProvidedRequiredArgumentsRule}});Object.defineProperty(nt,"ScalarLeafsRule",{enumerable:!0,get:function(){return E4.ScalarLeafsRule}});Object.defineProperty(nt,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return N4.SingleFieldSubscriptionsRule}});Object.defineProperty(nt,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return P4.UniqueArgumentDefinitionNamesRule}});Object.defineProperty(nt,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return g4.UniqueArgumentNamesRule}});Object.defineProperty(nt,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return x4.UniqueDirectiveNamesRule}});Object.defineProperty(nt,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return v4.UniqueDirectivesPerLocationRule}});Object.defineProperty(nt,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return F4.UniqueEnumValueNamesRule}});Object.defineProperty(nt,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return k4.UniqueFieldDefinitionNamesRule}});Object.defineProperty(nt,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return I4.UniqueFragmentNamesRule}});Object.defineProperty(nt,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return b4.UniqueInputFieldNamesRule}});Object.defineProperty(nt,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return _4.UniqueOperationNamesRule}});Object.defineProperty(nt,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return R4.UniqueOperationTypesRule}});Object.defineProperty(nt,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return L4.UniqueTypeNamesRule}});Object.defineProperty(nt,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return O4.UniqueVariableNamesRule}});Object.defineProperty(nt,"ValidationContext",{enumerable:!0,get:function(){return t4.ValidationContext}});Object.defineProperty(nt,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return S4.ValuesOfCorrectTypeRule}});Object.defineProperty(nt,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return D4.VariablesAreInputTypesRule}});Object.defineProperty(nt,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return A4.VariablesInAllowedPositionRule}});Object.defineProperty(nt,"specifiedRules",{enumerable:!0,get:function(){return n4.specifiedRules}});Object.defineProperty(nt,"validate",{enumerable:!0,get:function(){return e4.validate}});var e4=Xc(),t4=s_(),n4=r_(),r4=_I(),i4=SI(),o4=AI(),s4=wI(),a4=kI(),u4=xI(),c4=UI(),l4=VI(),p4=BI(),d4=QI(),f4=JI(),m4=XI(),h4=ob(),y4=ub(),T4=db(),E4=mb(),N4=bb(),g4=Ab(),v4=kb(),I4=Vb(),b4=Gb(),_4=Bb(),O4=Xb(),S4=Wb(),D4=e_(),A4=n_(),w4=GI(),R4=Qb(),L4=Jb(),F4=xb(),k4=Ub(),P4=Sb(),x4=Rb(),C4=lb(),M4=gP(),U4=vP()});var bP=F(Au=>{"use strict";d();m();f();Object.defineProperty(Au,"__esModule",{value:!0});Object.defineProperty(Au,"GraphQLError",{enumerable:!0,get:function(){return C_.GraphQLError}});Object.defineProperty(Au,"formatError",{enumerable:!0,get:function(){return C_.formatError}});Object.defineProperty(Au,"locatedError",{enumerable:!0,get:function(){return V4.locatedError}});Object.defineProperty(Au,"printError",{enumerable:!0,get:function(){return C_.printError}});Object.defineProperty(Au,"syntaxError",{enumerable:!0,get:function(){return j4.syntaxError}});var C_=$e(),j4=Ky(),V4=Hy()});var U_=F(M_=>{"use strict";d();m();f();Object.defineProperty(M_,"__esModule",{value:!0});M_.getIntrospectionQuery=$4;function $4(e){let t=D({descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1},e),n=t.descriptions?"description":"",r=t.specifiedByUrl?"specifiedByURL":"",i=t.directiveIsRepeatable?"isRepeatable":"",o=t.schemaDescription?n:"";function s(a){return t.inputValueDeprecation?a:""}return` - query IntrospectionQuery { - __schema { - ${o} - queryType { name } - mutationType { name } - subscriptionType { name } - types { - ...FullType - } - directives { - name - ${n} - ${i} - locations - args${s("(includeDeprecated: true)")} { - ...InputValue - } - } - } - } - - fragment FullType on __Type { - kind - name - ${n} - ${r} - 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 - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - } - } - } - } - } - } - } - } - `}});var _P=F(j_=>{"use strict";d();m();f();Object.defineProperty(j_,"__esModule",{value:!0});j_.getOperationAST=q4;var G4=It();function q4(e,t){let n=null;for(let i of e.definitions)if(i.kind===G4.Kind.OPERATION_DEFINITION){var r;if(t==null){if(n)return null;n=i}else if(((r=i.name)===null||r===void 0?void 0:r.value)===t)return i}return n}});var OP=F(V_=>{"use strict";d();m();f();Object.defineProperty(V_,"__esModule",{value:!0});V_.getOperationRootType=B4;var sT=$e();function B4(e,t){if(t.operation==="query"){let n=e.getQueryType();if(!n)throw new sT.GraphQLError("Schema does not define the required query root type.",{nodes:t});return n}if(t.operation==="mutation"){let n=e.getMutationType();if(!n)throw new sT.GraphQLError("Schema is not configured for mutations.",{nodes:t});return n}if(t.operation==="subscription"){let n=e.getSubscriptionType();if(!n)throw new sT.GraphQLError("Schema is not configured for subscriptions.",{nodes:t});return n}throw new sT.GraphQLError("Can only have query, mutation and subscription operations.",{nodes:t})}});var SP=F($_=>{"use strict";d();m();f();Object.defineProperty($_,"__esModule",{value:!0});$_.introspectionFromSchema=z4;var K4=lr(),Q4=el(),Y4=tf(),J4=U_();function z4(e,t){let n=D({specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0},t),r=(0,Q4.parse)((0,J4.getIntrospectionQuery)(n)),i=(0,Y4.executeSync)({schema:e,document:r});return!i.errors&&i.data||(0,K4.invariant)(!1),i.data}});var AP=F(G_=>{"use strict";d();m();f();Object.defineProperty(G_,"__esModule",{value:!0});G_.buildClientSchema=n8;var X4=br(),Wr=Ct(),DP=ho(),aT=md(),H4=el(),Zr=yt(),W4=Pr(),Oo=Ti(),Z4=No(),e8=mu(),t8=Gd();function n8(e,t){(0,DP.isObjectLike)(e)&&(0,DP.isObjectLike)(e.__schema)||(0,X4.devAssert)(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${(0,Wr.inspect)(e)}.`);let n=e.__schema,r=(0,aT.keyValMap)(n.types,L=>L.name,L=>h(L));for(let L of[...Z4.specifiedScalarTypes,...Oo.introspectionTypes])r[L.name]&&(r[L.name]=L);let i=n.queryType?l(n.queryType):null,o=n.mutationType?l(n.mutationType):null,s=n.subscriptionType?l(n.subscriptionType):null,a=n.directives?n.directives.map(ft):[];return new e8.GraphQLSchema({description:n.description,query:i,mutation:o,subscription:s,types:Object.values(r),directives:a,assumeValid:t==null?void 0:t.assumeValid});function c(L){if(L.kind===Oo.TypeKind.LIST){let ne=L.ofType;if(!ne)throw new Error("Decorated type deeper than introspection query.");return new Zr.GraphQLList(c(ne))}if(L.kind===Oo.TypeKind.NON_NULL){let ne=L.ofType;if(!ne)throw new Error("Decorated type deeper than introspection query.");let mt=c(ne);return new Zr.GraphQLNonNull((0,Zr.assertNullableType)(mt))}return u(L)}function u(L){let ne=L.name;if(!ne)throw new Error(`Unknown type reference: ${(0,Wr.inspect)(L)}.`);let mt=r[ne];if(!mt)throw new Error(`Invalid or incomplete schema, unknown type: ${ne}. Ensure that a full introspection query is used in order to build a client schema.`);return mt}function l(L){return(0,Zr.assertObjectType)(u(L))}function p(L){return(0,Zr.assertInterfaceType)(u(L))}function h(L){if(L!=null&&L.name!=null&&L.kind!=null)switch(L.kind){case Oo.TypeKind.SCALAR:return y(L);case Oo.TypeKind.OBJECT:return O(L);case Oo.TypeKind.INTERFACE:return w(L);case Oo.TypeKind.UNION:return M(L);case Oo.TypeKind.ENUM:return W(L);case Oo.TypeKind.INPUT_OBJECT:return K(L)}let ne=(0,Wr.inspect)(L);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${ne}.`)}function y(L){return new Zr.GraphQLScalarType({name:L.name,description:L.description,specifiedByURL:L.specifiedByURL})}function N(L){if(L.interfaces===null&&L.kind===Oo.TypeKind.INTERFACE)return[];if(!L.interfaces){let ne=(0,Wr.inspect)(L);throw new Error(`Introspection result missing interfaces: ${ne}.`)}return L.interfaces.map(p)}function O(L){return new Zr.GraphQLObjectType({name:L.name,description:L.description,interfaces:()=>N(L),fields:()=>te(L)})}function w(L){return new Zr.GraphQLInterfaceType({name:L.name,description:L.description,interfaces:()=>N(L),fields:()=>te(L)})}function M(L){if(!L.possibleTypes){let ne=(0,Wr.inspect)(L);throw new Error(`Introspection result missing possibleTypes: ${ne}.`)}return new Zr.GraphQLUnionType({name:L.name,description:L.description,types:()=>L.possibleTypes.map(l)})}function W(L){if(!L.enumValues){let ne=(0,Wr.inspect)(L);throw new Error(`Introspection result missing enumValues: ${ne}.`)}return new Zr.GraphQLEnumType({name:L.name,description:L.description,values:(0,aT.keyValMap)(L.enumValues,ne=>ne.name,ne=>({description:ne.description,deprecationReason:ne.deprecationReason}))})}function K(L){if(!L.inputFields){let ne=(0,Wr.inspect)(L);throw new Error(`Introspection result missing inputFields: ${ne}.`)}return new Zr.GraphQLInputObjectType({name:L.name,description:L.description,fields:()=>qe(L.inputFields)})}function te(L){if(!L.fields)throw new Error(`Introspection result missing fields: ${(0,Wr.inspect)(L)}.`);return(0,aT.keyValMap)(L.fields,ne=>ne.name,pe)}function pe(L){let ne=c(L.type);if(!(0,Zr.isOutputType)(ne)){let mt=(0,Wr.inspect)(ne);throw new Error(`Introspection must provide output type for fields, but received: ${mt}.`)}if(!L.args){let mt=(0,Wr.inspect)(L);throw new Error(`Introspection result missing field args: ${mt}.`)}return{description:L.description,deprecationReason:L.deprecationReason,type:ne,args:qe(L.args)}}function qe(L){return(0,aT.keyValMap)(L,ne=>ne.name,st)}function st(L){let ne=c(L.type);if(!(0,Zr.isInputType)(ne)){let jn=(0,Wr.inspect)(ne);throw new Error(`Introspection must provide input type for arguments, but received: ${jn}.`)}let mt=L.defaultValue!=null?(0,t8.valueFromAST)((0,H4.parseValue)(L.defaultValue),ne):void 0;return{description:L.description,type:ne,defaultValue:mt,deprecationReason:L.deprecationReason}}function ft(L){if(!L.args){let ne=(0,Wr.inspect)(L);throw new Error(`Introspection result missing directive args: ${ne}.`)}if(!L.locations){let ne=(0,Wr.inspect)(L);throw new Error(`Introspection result missing directive locations: ${ne}.`)}return new W4.GraphQLDirective({name:L.name,description:L.description,isRepeatable:L.isRepeatable,locations:L.locations.slice(),args:qe(L.args)})}}});var q_=F(lT=>{"use strict";d();m();f();Object.defineProperty(lT,"__esModule",{value:!0});lT.extendSchema=u8;lT.extendSchemaImpl=MP;var r8=br(),i8=Ct(),o8=lr(),s8=ha(),sf=Uv(),Ii=It(),wP=yu(),rn=yt(),cT=Pr(),PP=Ti(),xP=No(),RP=mu(),a8=Xc(),CP=Yc(),LP=Gd();function u8(e,t,n){(0,RP.assertSchema)(e),t!=null&&t.kind===Ii.Kind.DOCUMENT||(0,r8.devAssert)(!1,"Must provide valid Document AST."),(n==null?void 0:n.assumeValid)!==!0&&(n==null?void 0:n.assumeValidSDL)!==!0&&(0,a8.assertValidSDLExtension)(t,e);let r=e.toConfig(),i=MP(r,t,n);return r===i?e:new RP.GraphQLSchema(i)}function MP(e,t,n){var r,i,o,s;let a=[],c=Object.create(null),u=[],l,p=[];for(let R of t.definitions)if(R.kind===Ii.Kind.SCHEMA_DEFINITION)l=R;else if(R.kind===Ii.Kind.SCHEMA_EXTENSION)p.push(R);else if((0,wP.isTypeDefinitionNode)(R))a.push(R);else if((0,wP.isTypeExtensionNode)(R)){let J=R.name.value,B=c[J];c[J]=B?B.concat([R]):[R]}else R.kind===Ii.Kind.DIRECTIVE_DEFINITION&&u.push(R);if(Object.keys(c).length===0&&a.length===0&&u.length===0&&p.length===0&&l==null)return e;let h=Object.create(null);for(let R of e.types)h[R.name]=W(R);for(let R of a){var y;let J=R.name.value;h[J]=(y=FP[J])!==null&&y!==void 0?y:dn(R)}let N=D(D({query:e.query&&w(e.query),mutation:e.mutation&&w(e.mutation),subscription:e.subscription&&w(e.subscription)},l&&mt([l])),mt(p));return x(D({description:(r=l)===null||r===void 0||(i=r.description)===null||i===void 0?void 0:i.value},N),{types:Object.values(h),directives:[...e.directives.map(M),...u.map(ei)],extensions:Object.create(null),astNode:(o=l)!==null&&o!==void 0?o:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(p),assumeValid:(s=n==null?void 0:n.assumeValid)!==null&&s!==void 0?s:!1});function O(R){return(0,rn.isListType)(R)?new rn.GraphQLList(O(R.ofType)):(0,rn.isNonNullType)(R)?new rn.GraphQLNonNull(O(R.ofType)):w(R)}function w(R){return h[R.name]}function M(R){let J=R.toConfig();return new cT.GraphQLDirective(x(D({},J),{args:(0,sf.mapValue)(J.args,ne)}))}function W(R){if((0,PP.isIntrospectionType)(R)||(0,xP.isSpecifiedScalarType)(R))return R;if((0,rn.isScalarType)(R))return pe(R);if((0,rn.isObjectType)(R))return qe(R);if((0,rn.isInterfaceType)(R))return st(R);if((0,rn.isUnionType)(R))return ft(R);if((0,rn.isEnumType)(R))return te(R);if((0,rn.isInputObjectType)(R))return K(R);(0,o8.invariant)(!1,"Unexpected type: "+(0,i8.inspect)(R))}function K(R){var J;let B=R.toConfig(),X=(J=c[B.name])!==null&&J!==void 0?J:[];return new rn.GraphQLInputObjectType(x(D({},B),{fields:()=>D(D({},(0,sf.mapValue)(B.fields,we=>x(D({},we),{type:O(we.type)}))),qi(X)),extensionASTNodes:B.extensionASTNodes.concat(X)}))}function te(R){var J;let B=R.toConfig(),X=(J=c[R.name])!==null&&J!==void 0?J:[];return new rn.GraphQLEnumType(x(D({},B),{values:D(D({},B.values),_i(X)),extensionASTNodes:B.extensionASTNodes.concat(X)}))}function pe(R){var J;let B=R.toConfig(),X=(J=c[B.name])!==null&&J!==void 0?J:[],we=B.specifiedByURL;for(let G of X){var C;we=(C=kP(G))!==null&&C!==void 0?C:we}return new rn.GraphQLScalarType(x(D({},B),{specifiedByURL:we,extensionASTNodes:B.extensionASTNodes.concat(X)}))}function qe(R){var J;let B=R.toConfig(),X=(J=c[B.name])!==null&&J!==void 0?J:[];return new rn.GraphQLObjectType(x(D({},B),{interfaces:()=>[...R.getInterfaces().map(w),...mr(X)],fields:()=>D(D({},(0,sf.mapValue)(B.fields,L)),jr(X)),extensionASTNodes:B.extensionASTNodes.concat(X)}))}function st(R){var J;let B=R.toConfig(),X=(J=c[B.name])!==null&&J!==void 0?J:[];return new rn.GraphQLInterfaceType(x(D({},B),{interfaces:()=>[...R.getInterfaces().map(w),...mr(X)],fields:()=>D(D({},(0,sf.mapValue)(B.fields,L)),jr(X)),extensionASTNodes:B.extensionASTNodes.concat(X)}))}function ft(R){var J;let B=R.toConfig(),X=(J=c[B.name])!==null&&J!==void 0?J:[];return new rn.GraphQLUnionType(x(D({},B),{types:()=>[...R.getTypes().map(w),...Dt(X)],extensionASTNodes:B.extensionASTNodes.concat(X)}))}function L(R){return x(D({},R),{type:O(R.type),args:R.args&&(0,sf.mapValue)(R.args,ne)})}function ne(R){return x(D({},R),{type:O(R.type)})}function mt(R){let J={};for(let X of R){var B;let we=(B=X.operationTypes)!==null&&B!==void 0?B:[];for(let C of we)J[C.operation]=jn(C.type)}return J}function jn(R){var J;let B=R.name.value,X=(J=FP[B])!==null&&J!==void 0?J:h[B];if(X===void 0)throw new Error(`Unknown type: "${B}".`);return X}function wn(R){return R.kind===Ii.Kind.LIST_TYPE?new rn.GraphQLList(wn(R.type)):R.kind===Ii.Kind.NON_NULL_TYPE?new rn.GraphQLNonNull(wn(R.type)):jn(R)}function ei(R){var J;return new cT.GraphQLDirective({name:R.name.value,description:(J=R.description)===null||J===void 0?void 0:J.value,locations:R.locations.map(({value:B})=>B),isRepeatable:R.repeatable,args:Sr(R.arguments),astNode:R})}function jr(R){let J=Object.create(null);for(let we of R){var B;let C=(B=we.fields)!==null&&B!==void 0?B:[];for(let G of C){var X;J[G.name.value]={type:wn(G.type),description:(X=G.description)===null||X===void 0?void 0:X.value,args:Sr(G.arguments),deprecationReason:uT(G),astNode:G}}}return J}function Sr(R){let J=R!=null?R:[],B=Object.create(null);for(let we of J){var X;let C=wn(we.type);B[we.name.value]={type:C,description:(X=we.description)===null||X===void 0?void 0:X.value,defaultValue:(0,LP.valueFromAST)(we.defaultValue,C),deprecationReason:uT(we),astNode:we}}return B}function qi(R){let J=Object.create(null);for(let we of R){var B;let C=(B=we.fields)!==null&&B!==void 0?B:[];for(let G of C){var X;let Ne=wn(G.type);J[G.name.value]={type:Ne,description:(X=G.description)===null||X===void 0?void 0:X.value,defaultValue:(0,LP.valueFromAST)(G.defaultValue,Ne),deprecationReason:uT(G),astNode:G}}}return J}function _i(R){let J=Object.create(null);for(let we of R){var B;let C=(B=we.values)!==null&&B!==void 0?B:[];for(let G of C){var X;J[G.name.value]={description:(X=G.description)===null||X===void 0?void 0:X.value,deprecationReason:uT(G),astNode:G}}}return J}function mr(R){return R.flatMap(J=>{var B,X;return(B=(X=J.interfaces)===null||X===void 0?void 0:X.map(jn))!==null&&B!==void 0?B:[]})}function Dt(R){return R.flatMap(J=>{var B,X;return(B=(X=J.types)===null||X===void 0?void 0:X.map(jn))!==null&&B!==void 0?B:[]})}function dn(R){var J;let B=R.name.value,X=(J=c[B])!==null&&J!==void 0?J:[];switch(R.kind){case Ii.Kind.OBJECT_TYPE_DEFINITION:{var we;let Ke=[R,...X];return new rn.GraphQLObjectType({name:B,description:(we=R.description)===null||we===void 0?void 0:we.value,interfaces:()=>mr(Ke),fields:()=>jr(Ke),astNode:R,extensionASTNodes:X})}case Ii.Kind.INTERFACE_TYPE_DEFINITION:{var C;let Ke=[R,...X];return new rn.GraphQLInterfaceType({name:B,description:(C=R.description)===null||C===void 0?void 0:C.value,interfaces:()=>mr(Ke),fields:()=>jr(Ke),astNode:R,extensionASTNodes:X})}case Ii.Kind.ENUM_TYPE_DEFINITION:{var G;let Ke=[R,...X];return new rn.GraphQLEnumType({name:B,description:(G=R.description)===null||G===void 0?void 0:G.value,values:_i(Ke),astNode:R,extensionASTNodes:X})}case Ii.Kind.UNION_TYPE_DEFINITION:{var Ne;let Ke=[R,...X];return new rn.GraphQLUnionType({name:B,description:(Ne=R.description)===null||Ne===void 0?void 0:Ne.value,types:()=>Dt(Ke),astNode:R,extensionASTNodes:X})}case Ii.Kind.SCALAR_TYPE_DEFINITION:{var Pe;return new rn.GraphQLScalarType({name:B,description:(Pe=R.description)===null||Pe===void 0?void 0:Pe.value,specifiedByURL:kP(R),astNode:R,extensionASTNodes:X})}case Ii.Kind.INPUT_OBJECT_TYPE_DEFINITION:{var Nt;let Ke=[R,...X];return new rn.GraphQLInputObjectType({name:B,description:(Nt=R.description)===null||Nt===void 0?void 0:Nt.value,fields:()=>qi(Ke),astNode:R,extensionASTNodes:X})}}}}var FP=(0,s8.keyMap)([...xP.specifiedScalarTypes,...PP.introspectionTypes],e=>e.name);function uT(e){let t=(0,CP.getDirectiveValues)(cT.GraphQLDeprecatedDirective,e);return t==null?void 0:t.reason}function kP(e){let t=(0,CP.getDirectiveValues)(cT.GraphQLSpecifiedByDirective,e);return t==null?void 0:t.url}});var jP=F(pT=>{"use strict";d();m();f();Object.defineProperty(pT,"__esModule",{value:!0});pT.buildASTSchema=UP;pT.buildSchema=y8;var c8=br(),l8=It(),p8=el(),d8=Pr(),f8=mu(),m8=Xc(),h8=q_();function UP(e,t){e!=null&&e.kind===l8.Kind.DOCUMENT||(0,c8.devAssert)(!1,"Must provide valid Document AST."),(t==null?void 0:t.assumeValid)!==!0&&(t==null?void 0:t.assumeValidSDL)!==!0&&(0,m8.assertValidSDL)(e);let n={description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},r=(0,h8.extendSchemaImpl)(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,...d8.specifiedDirectives.filter(o=>r.directives.every(s=>s.name!==o.name))];return new f8.GraphQLSchema(x(D({},r),{directives:i}))}function y8(e,t){let n=(0,p8.parse)(e,{noLocation:t==null?void 0:t.noLocation,allowLegacyFragmentVariables:t==null?void 0:t.allowLegacyFragmentVariables});return UP(n,{assumeValidSDL:t==null?void 0:t.assumeValidSDL,assumeValid:t==null?void 0:t.assumeValid})}});var GP=F(K_=>{"use strict";d();m();f();Object.defineProperty(K_,"__esModule",{value:!0});K_.lexicographicSortSchema=b8;var T8=Ct(),E8=lr(),N8=md(),VP=hd(),_r=yt(),g8=Pr(),v8=Ti(),I8=mu();function b8(e){let t=e.toConfig(),n=(0,N8.keyValMap)(B_(t.types),h=>h.name,p);return new I8.GraphQLSchema(x(D({},t),{types:Object.values(n),directives:B_(t.directives).map(s),query:o(t.query),mutation:o(t.mutation),subscription:o(t.subscription)}));function r(h){return(0,_r.isListType)(h)?new _r.GraphQLList(r(h.ofType)):(0,_r.isNonNullType)(h)?new _r.GraphQLNonNull(r(h.ofType)):i(h)}function i(h){return n[h.name]}function o(h){return h&&i(h)}function s(h){let y=h.toConfig();return new g8.GraphQLDirective(x(D({},y),{locations:$P(y.locations,N=>N),args:a(y.args)}))}function a(h){return dT(h,y=>x(D({},y),{type:r(y.type)}))}function c(h){return dT(h,y=>x(D({},y),{type:r(y.type),args:y.args&&a(y.args)}))}function u(h){return dT(h,y=>x(D({},y),{type:r(y.type)}))}function l(h){return B_(h).map(i)}function p(h){if((0,_r.isScalarType)(h)||(0,v8.isIntrospectionType)(h))return h;if((0,_r.isObjectType)(h)){let y=h.toConfig();return new _r.GraphQLObjectType(x(D({},y),{interfaces:()=>l(y.interfaces),fields:()=>c(y.fields)}))}if((0,_r.isInterfaceType)(h)){let y=h.toConfig();return new _r.GraphQLInterfaceType(x(D({},y),{interfaces:()=>l(y.interfaces),fields:()=>c(y.fields)}))}if((0,_r.isUnionType)(h)){let y=h.toConfig();return new _r.GraphQLUnionType(x(D({},y),{types:()=>l(y.types)}))}if((0,_r.isEnumType)(h)){let y=h.toConfig();return new _r.GraphQLEnumType(x(D({},y),{values:dT(y.values,N=>N)}))}if((0,_r.isInputObjectType)(h)){let y=h.toConfig();return new _r.GraphQLInputObjectType(x(D({},y),{fields:()=>u(y.fields)}))}(0,E8.invariant)(!1,"Unexpected type: "+(0,T8.inspect)(h))}}function dT(e,t){let n=Object.create(null);for(let r of Object.keys(e).sort(VP.naturalCompare))n[r]=t(e[r]);return n}function B_(e){return $P(e,t=>t.name)}function $P(e,t){return e.slice().sort((n,r)=>{let i=t(n),o=t(r);return(0,VP.naturalCompare)(i,o)})}});var zP=F(af=>{"use strict";d();m();f();Object.defineProperty(af,"__esModule",{value:!0});af.printIntrospectionSchema=R8;af.printSchema=w8;af.printType=KP;var _8=Ct(),O8=lr(),S8=Td(),Y_=It(),fT=Hr(),nl=yt(),J_=Pr(),qP=Ti(),D8=No(),A8=Ld();function w8(e){return BP(e,t=>!(0,J_.isSpecifiedDirective)(t),L8)}function R8(e){return BP(e,J_.isSpecifiedDirective,qP.isIntrospectionType)}function L8(e){return!(0,D8.isSpecifiedScalarType)(e)&&!(0,qP.isIntrospectionType)(e)}function BP(e,t,n){let r=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(n);return[F8(e),...r.map(o=>V8(o)),...i.map(o=>KP(o))].filter(Boolean).join(` - -`)}function F8(e){if(e.description==null&&k8(e))return;let t=[],n=e.getQueryType();n&&t.push(` query: ${n.name}`);let r=e.getMutationType();r&&t.push(` mutation: ${r.name}`);let i=e.getSubscriptionType();return i&&t.push(` subscription: ${i.name}`),bi(e)+`schema { -${t.join(` -`)} -}`}function k8(e){let t=e.getQueryType();if(t&&t.name!=="Query")return!1;let n=e.getMutationType();if(n&&n.name!=="Mutation")return!1;let r=e.getSubscriptionType();return!(r&&r.name!=="Subscription")}function KP(e){if((0,nl.isScalarType)(e))return P8(e);if((0,nl.isObjectType)(e))return x8(e);if((0,nl.isInterfaceType)(e))return C8(e);if((0,nl.isUnionType)(e))return M8(e);if((0,nl.isEnumType)(e))return U8(e);if((0,nl.isInputObjectType)(e))return j8(e);(0,O8.invariant)(!1,"Unexpected type: "+(0,_8.inspect)(e))}function P8(e){return bi(e)+`scalar ${e.name}`+$8(e)}function QP(e){let t=e.getInterfaces();return t.length?" implements "+t.map(n=>n.name).join(" & "):""}function x8(e){return bi(e)+`type ${e.name}`+QP(e)+YP(e)}function C8(e){return bi(e)+`interface ${e.name}`+QP(e)+YP(e)}function M8(e){let t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return bi(e)+"union "+e.name+n}function U8(e){let t=e.getValues().map((n,r)=>bi(n," ",!r)+" "+n.name+X_(n.deprecationReason));return bi(e)+`enum ${e.name}`+z_(t)}function j8(e){let t=Object.values(e.getFields()).map((n,r)=>bi(n," ",!r)+" "+Q_(n));return bi(e)+`input ${e.name}`+z_(t)}function YP(e){let t=Object.values(e.getFields()).map((n,r)=>bi(n," ",!r)+" "+n.name+JP(n.args," ")+": "+String(n.type)+X_(n.deprecationReason));return z_(t)}function z_(e){return e.length!==0?` { -`+e.join(` -`)+` -}`:""}function JP(e,t=""){return e.length===0?"":e.every(n=>!n.description)?"("+e.map(Q_).join(", ")+")":`( -`+e.map((n,r)=>bi(n," "+t,!r)+" "+t+Q_(n)).join(` -`)+` -`+t+")"}function Q_(e){let t=(0,A8.astFromValue)(e.defaultValue,e.type),n=e.name+": "+String(e.type);return t&&(n+=` = ${(0,fT.print)(t)}`),n+X_(e.deprecationReason)}function V8(e){return bi(e)+"directive @"+e.name+JP(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}function X_(e){return e==null?"":e!==J_.DEFAULT_DEPRECATION_REASON?` @deprecated(reason: ${(0,fT.print)({kind:Y_.Kind.STRING,value:e})})`:" @deprecated"}function $8(e){return e.specifiedByURL==null?"":` @specifiedBy(url: ${(0,fT.print)({kind:Y_.Kind.STRING,value:e.specifiedByURL})})`}function bi(e,t="",n=!0){let{description:r}=e;if(r==null)return"";let i=(0,fT.print)({kind:Y_.Kind.STRING,value:r,block:(0,S8.isPrintableAsBlockString)(r)});return(t&&!n?` -`+t:t)+i.replace(/\n/g,` -`+t)+` -`}});var XP=F(H_=>{"use strict";d();m();f();Object.defineProperty(H_,"__esModule",{value:!0});H_.concatAST=q8;var G8=It();function q8(e){let t=[];for(let n of e)t.push(...n.definitions);return{kind:G8.Kind.DOCUMENT,definitions:t}}});var ZP=F(W_=>{"use strict";d();m();f();Object.defineProperty(W_,"__esModule",{value:!0});W_.separateOperations=K8;var mT=It(),B8=au();function K8(e){let t=[],n=Object.create(null);for(let i of e.definitions)switch(i.kind){case mT.Kind.OPERATION_DEFINITION:t.push(i);break;case mT.Kind.FRAGMENT_DEFINITION:n[i.name.value]=HP(i.selectionSet);break;default:}let r=Object.create(null);for(let i of t){let o=new Set;for(let a of HP(i.selectionSet))WP(o,n,a);let s=i.name?i.name.value:"";r[s]={kind:mT.Kind.DOCUMENT,definitions:e.definitions.filter(a=>a===i||a.kind===mT.Kind.FRAGMENT_DEFINITION&&o.has(a.name.value))}}return r}function WP(e,t,n){if(!e.has(n)){e.add(n);let r=t[n];if(r!==void 0)for(let i of r)WP(e,t,i)}}function HP(e){let t=[];return(0,B8.visit)(e,{FragmentSpread(n){t.push(n.name.value)}}),t}});var nx=F(eO=>{"use strict";d();m();f();Object.defineProperty(eO,"__esModule",{value:!0});eO.stripIgnoredCharacters=Y8;var Q8=Td(),ex=Yy(),tx=zy(),Z_=zd();function Y8(e){let t=(0,tx.isSource)(e)?e:new tx.Source(e),n=t.body,r=new ex.Lexer(t),i="",o=!1;for(;r.advance().kind!==Z_.TokenKind.EOF;){let s=r.token,a=s.kind,c=!(0,ex.isPunctuatorTokenKind)(s.kind);o&&(c||s.kind===Z_.TokenKind.SPREAD)&&(i+=" ");let u=n.slice(s.start,s.end);a===Z_.TokenKind.BLOCK_STRING?i+=(0,Q8.printBlockString)(s.value,{minimize:!0}):i+=u,o=c}return i}});var ix=F(hT=>{"use strict";d();m();f();Object.defineProperty(hT,"__esModule",{value:!0});hT.assertValidName=H8;hT.isValidNameError=rx;var J8=br(),z8=$e(),X8=Ed();function H8(e){let t=rx(e);if(t)throw t;return e}function rx(e){if(typeof e=="string"||(0,J8.devAssert)(!1,"Expected name to be a string."),e.startsWith("__"))return new z8.GraphQLError(`Name "${e}" must not begin with "__", which is reserved by GraphQL introspection.`);try{(0,X8.assertName)(e)}catch(t){return t}}});var dx=F(So=>{"use strict";d();m();f();Object.defineProperty(So,"__esModule",{value:!0});So.DangerousChangeType=So.BreakingChangeType=void 0;So.findBreakingChanges=rX;So.findDangerousChanges=iX;var W8=Ct(),lx=lr(),ox=ha(),Z8=Hr(),St=yt(),eX=No(),tX=Ld(),nX=ZI(),gn;So.BreakingChangeType=gn;(function(e){e.TYPE_REMOVED="TYPE_REMOVED",e.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",e.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",e.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",e.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",e.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",e.FIELD_REMOVED="FIELD_REMOVED",e.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",e.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",e.ARG_REMOVED="ARG_REMOVED",e.ARG_CHANGED_KIND="ARG_CHANGED_KIND",e.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",e.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",e.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",e.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",e.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"})(gn||(So.BreakingChangeType=gn={}));var Gi;So.DangerousChangeType=Gi;(function(e){e.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",e.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",e.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",e.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",e.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",e.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"})(Gi||(So.DangerousChangeType=Gi={}));function rX(e,t){return px(e,t).filter(n=>n.type in gn)}function iX(e,t){return px(e,t).filter(n=>n.type in Gi)}function px(e,t){return[...sX(e,t),...oX(e,t)]}function oX(e,t){let n=[],r=os(e.getDirectives(),t.getDirectives());for(let i of r.removed)n.push({type:gn.DIRECTIVE_REMOVED,description:`${i.name} was removed.`});for(let[i,o]of r.persisted){let s=os(i.args,o.args);for(let a of s.added)(0,St.isRequiredArgument)(a)&&n.push({type:gn.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${a.name} on directive ${i.name} was added.`});for(let a of s.removed)n.push({type:gn.DIRECTIVE_ARG_REMOVED,description:`${a.name} was removed from ${i.name}.`});i.isRepeatable&&!o.isRepeatable&&n.push({type:gn.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${i.name}.`});for(let a of i.locations)o.locations.includes(a)||n.push({type:gn.DIRECTIVE_LOCATION_REMOVED,description:`${a} was removed from ${i.name}.`})}return n}function sX(e,t){let n=[],r=os(Object.values(e.getTypeMap()),Object.values(t.getTypeMap()));for(let i of r.removed)n.push({type:gn.TYPE_REMOVED,description:(0,eX.isSpecifiedScalarType)(i)?`Standard scalar ${i.name} was removed because it is not referenced anymore.`:`${i.name} was removed.`});for(let[i,o]of r.persisted)(0,St.isEnumType)(i)&&(0,St.isEnumType)(o)?n.push(...cX(i,o)):(0,St.isUnionType)(i)&&(0,St.isUnionType)(o)?n.push(...uX(i,o)):(0,St.isInputObjectType)(i)&&(0,St.isInputObjectType)(o)?n.push(...aX(i,o)):(0,St.isObjectType)(i)&&(0,St.isObjectType)(o)?n.push(...ax(i,o),...sx(i,o)):(0,St.isInterfaceType)(i)&&(0,St.isInterfaceType)(o)?n.push(...ax(i,o),...sx(i,o)):i.constructor!==o.constructor&&n.push({type:gn.TYPE_CHANGED_KIND,description:`${i.name} changed from ${ux(i)} to ${ux(o)}.`});return n}function aX(e,t){let n=[],r=os(Object.values(e.getFields()),Object.values(t.getFields()));for(let i of r.added)(0,St.isRequiredInputField)(i)?n.push({type:gn.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${i.name} on input type ${e.name} was added.`}):n.push({type:Gi.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${i.name} on input type ${e.name} was added.`});for(let i of r.removed)n.push({type:gn.FIELD_REMOVED,description:`${e.name}.${i.name} was removed.`});for(let[i,o]of r.persisted)cf(i.type,o.type)||n.push({type:gn.FIELD_CHANGED_KIND,description:`${e.name}.${i.name} changed type from ${String(i.type)} to ${String(o.type)}.`});return n}function uX(e,t){let n=[],r=os(e.getTypes(),t.getTypes());for(let i of r.added)n.push({type:Gi.TYPE_ADDED_TO_UNION,description:`${i.name} was added to union type ${e.name}.`});for(let i of r.removed)n.push({type:gn.TYPE_REMOVED_FROM_UNION,description:`${i.name} was removed from union type ${e.name}.`});return n}function cX(e,t){let n=[],r=os(e.getValues(),t.getValues());for(let i of r.added)n.push({type:Gi.VALUE_ADDED_TO_ENUM,description:`${i.name} was added to enum type ${e.name}.`});for(let i of r.removed)n.push({type:gn.VALUE_REMOVED_FROM_ENUM,description:`${i.name} was removed from enum type ${e.name}.`});return n}function sx(e,t){let n=[],r=os(e.getInterfaces(),t.getInterfaces());for(let i of r.added)n.push({type:Gi.IMPLEMENTED_INTERFACE_ADDED,description:`${i.name} added to interfaces implemented by ${e.name}.`});for(let i of r.removed)n.push({type:gn.IMPLEMENTED_INTERFACE_REMOVED,description:`${e.name} no longer implements interface ${i.name}.`});return n}function ax(e,t){let n=[],r=os(Object.values(e.getFields()),Object.values(t.getFields()));for(let i of r.removed)n.push({type:gn.FIELD_REMOVED,description:`${e.name}.${i.name} was removed.`});for(let[i,o]of r.persisted)n.push(...lX(e,i,o)),uf(i.type,o.type)||n.push({type:gn.FIELD_CHANGED_KIND,description:`${e.name}.${i.name} changed type from ${String(i.type)} to ${String(o.type)}.`});return n}function lX(e,t,n){let r=[],i=os(t.args,n.args);for(let o of i.removed)r.push({type:gn.ARG_REMOVED,description:`${e.name}.${t.name} arg ${o.name} was removed.`});for(let[o,s]of i.persisted)if(!cf(o.type,s.type))r.push({type:gn.ARG_CHANGED_KIND,description:`${e.name}.${t.name} arg ${o.name} has changed type from ${String(o.type)} to ${String(s.type)}.`});else if(o.defaultValue!==void 0)if(s.defaultValue===void 0)r.push({type:Gi.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${o.name} defaultValue was removed.`});else{let c=cx(o.defaultValue,o.type),u=cx(s.defaultValue,s.type);c!==u&&r.push({type:Gi.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${o.name} has changed defaultValue from ${c} to ${u}.`})}for(let o of i.added)(0,St.isRequiredArgument)(o)?r.push({type:gn.REQUIRED_ARG_ADDED,description:`A required arg ${o.name} on ${e.name}.${t.name} was added.`}):r.push({type:Gi.OPTIONAL_ARG_ADDED,description:`An optional arg ${o.name} on ${e.name}.${t.name} was added.`});return r}function uf(e,t){return(0,St.isListType)(e)?(0,St.isListType)(t)&&uf(e.ofType,t.ofType)||(0,St.isNonNullType)(t)&&uf(e,t.ofType):(0,St.isNonNullType)(e)?(0,St.isNonNullType)(t)&&uf(e.ofType,t.ofType):(0,St.isNamedType)(t)&&e.name===t.name||(0,St.isNonNullType)(t)&&uf(e,t.ofType)}function cf(e,t){return(0,St.isListType)(e)?(0,St.isListType)(t)&&cf(e.ofType,t.ofType):(0,St.isNonNullType)(e)?(0,St.isNonNullType)(t)&&cf(e.ofType,t.ofType)||!(0,St.isNonNullType)(t)&&cf(e.ofType,t):(0,St.isNamedType)(t)&&e.name===t.name}function ux(e){if((0,St.isScalarType)(e))return"a Scalar type";if((0,St.isObjectType)(e))return"an Object type";if((0,St.isInterfaceType)(e))return"an Interface type";if((0,St.isUnionType)(e))return"a Union type";if((0,St.isEnumType)(e))return"an Enum type";if((0,St.isInputObjectType)(e))return"an Input type";(0,lx.invariant)(!1,"Unexpected type: "+(0,W8.inspect)(e))}function cx(e,t){let n=(0,tX.astFromValue)(e,t);return n!=null||(0,lx.invariant)(!1),(0,Z8.print)((0,nX.sortValueNode)(n))}function os(e,t){let n=[],r=[],i=[],o=(0,ox.keyMap)(e,({name:a})=>a),s=(0,ox.keyMap)(t,({name:a})=>a);for(let a of e){let c=s[a.name];c===void 0?r.push(a):i.push([a,c])}for(let a of t)o[a.name]===void 0&&n.push(a);return{added:n,persisted:i,removed:r}}});var yx=F(_t=>{"use strict";d();m();f();Object.defineProperty(_t,"__esModule",{value:!0});Object.defineProperty(_t,"BreakingChangeType",{enumerable:!0,get:function(){return yT.BreakingChangeType}});Object.defineProperty(_t,"DangerousChangeType",{enumerable:!0,get:function(){return yT.DangerousChangeType}});Object.defineProperty(_t,"TypeInfo",{enumerable:!0,get:function(){return mx.TypeInfo}});Object.defineProperty(_t,"assertValidName",{enumerable:!0,get:function(){return hx.assertValidName}});Object.defineProperty(_t,"astFromValue",{enumerable:!0,get:function(){return vX.astFromValue}});Object.defineProperty(_t,"buildASTSchema",{enumerable:!0,get:function(){return fx.buildASTSchema}});Object.defineProperty(_t,"buildClientSchema",{enumerable:!0,get:function(){return hX.buildClientSchema}});Object.defineProperty(_t,"buildSchema",{enumerable:!0,get:function(){return fx.buildSchema}});Object.defineProperty(_t,"coerceInputValue",{enumerable:!0,get:function(){return IX.coerceInputValue}});Object.defineProperty(_t,"concatAST",{enumerable:!0,get:function(){return bX.concatAST}});Object.defineProperty(_t,"doTypesOverlap",{enumerable:!0,get:function(){return nO.doTypesOverlap}});Object.defineProperty(_t,"extendSchema",{enumerable:!0,get:function(){return yX.extendSchema}});Object.defineProperty(_t,"findBreakingChanges",{enumerable:!0,get:function(){return yT.findBreakingChanges}});Object.defineProperty(_t,"findDangerousChanges",{enumerable:!0,get:function(){return yT.findDangerousChanges}});Object.defineProperty(_t,"getIntrospectionQuery",{enumerable:!0,get:function(){return pX.getIntrospectionQuery}});Object.defineProperty(_t,"getOperationAST",{enumerable:!0,get:function(){return dX.getOperationAST}});Object.defineProperty(_t,"getOperationRootType",{enumerable:!0,get:function(){return fX.getOperationRootType}});Object.defineProperty(_t,"introspectionFromSchema",{enumerable:!0,get:function(){return mX.introspectionFromSchema}});Object.defineProperty(_t,"isEqualType",{enumerable:!0,get:function(){return nO.isEqualType}});Object.defineProperty(_t,"isTypeSubTypeOf",{enumerable:!0,get:function(){return nO.isTypeSubTypeOf}});Object.defineProperty(_t,"isValidNameError",{enumerable:!0,get:function(){return hx.isValidNameError}});Object.defineProperty(_t,"lexicographicSortSchema",{enumerable:!0,get:function(){return TX.lexicographicSortSchema}});Object.defineProperty(_t,"printIntrospectionSchema",{enumerable:!0,get:function(){return tO.printIntrospectionSchema}});Object.defineProperty(_t,"printSchema",{enumerable:!0,get:function(){return tO.printSchema}});Object.defineProperty(_t,"printType",{enumerable:!0,get:function(){return tO.printType}});Object.defineProperty(_t,"separateOperations",{enumerable:!0,get:function(){return _X.separateOperations}});Object.defineProperty(_t,"stripIgnoredCharacters",{enumerable:!0,get:function(){return OX.stripIgnoredCharacters}});Object.defineProperty(_t,"typeFromAST",{enumerable:!0,get:function(){return EX.typeFromAST}});Object.defineProperty(_t,"valueFromAST",{enumerable:!0,get:function(){return NX.valueFromAST}});Object.defineProperty(_t,"valueFromASTUntyped",{enumerable:!0,get:function(){return gX.valueFromASTUntyped}});Object.defineProperty(_t,"visitWithTypeInfo",{enumerable:!0,get:function(){return mx.visitWithTypeInfo}});var pX=U_(),dX=_P(),fX=OP(),mX=SP(),hX=AP(),fx=jP(),yX=q_(),TX=GP(),tO=zP(),EX=go(),NX=Gd(),gX=Xv(),vX=Ld(),mx=Sy(),IX=Eb(),bX=XP(),_X=ZP(),OX=nx(),nO=bd(),hx=ix(),yT=dx()});var Nx=F(k=>{"use strict";d();m();f();Object.defineProperty(k,"__esModule",{value:!0});Object.defineProperty(k,"BREAK",{enumerable:!0,get:function(){return Ft.BREAK}});Object.defineProperty(k,"BreakingChangeType",{enumerable:!0,get:function(){return kt.BreakingChangeType}});Object.defineProperty(k,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return oe.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(k,"DangerousChangeType",{enumerable:!0,get:function(){return kt.DangerousChangeType}});Object.defineProperty(k,"DirectiveLocation",{enumerable:!0,get:function(){return Ft.DirectiveLocation}});Object.defineProperty(k,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return ot.ExecutableDefinitionsRule}});Object.defineProperty(k,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return ot.FieldsOnCorrectTypeRule}});Object.defineProperty(k,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return ot.FragmentsOnCompositeTypesRule}});Object.defineProperty(k,"GRAPHQL_MAX_INT",{enumerable:!0,get:function(){return oe.GRAPHQL_MAX_INT}});Object.defineProperty(k,"GRAPHQL_MIN_INT",{enumerable:!0,get:function(){return oe.GRAPHQL_MIN_INT}});Object.defineProperty(k,"GraphQLBoolean",{enumerable:!0,get:function(){return oe.GraphQLBoolean}});Object.defineProperty(k,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return oe.GraphQLDeprecatedDirective}});Object.defineProperty(k,"GraphQLDirective",{enumerable:!0,get:function(){return oe.GraphQLDirective}});Object.defineProperty(k,"GraphQLEnumType",{enumerable:!0,get:function(){return oe.GraphQLEnumType}});Object.defineProperty(k,"GraphQLError",{enumerable:!0,get:function(){return lf.GraphQLError}});Object.defineProperty(k,"GraphQLFloat",{enumerable:!0,get:function(){return oe.GraphQLFloat}});Object.defineProperty(k,"GraphQLID",{enumerable:!0,get:function(){return oe.GraphQLID}});Object.defineProperty(k,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return oe.GraphQLIncludeDirective}});Object.defineProperty(k,"GraphQLInputObjectType",{enumerable:!0,get:function(){return oe.GraphQLInputObjectType}});Object.defineProperty(k,"GraphQLInt",{enumerable:!0,get:function(){return oe.GraphQLInt}});Object.defineProperty(k,"GraphQLInterfaceType",{enumerable:!0,get:function(){return oe.GraphQLInterfaceType}});Object.defineProperty(k,"GraphQLList",{enumerable:!0,get:function(){return oe.GraphQLList}});Object.defineProperty(k,"GraphQLNonNull",{enumerable:!0,get:function(){return oe.GraphQLNonNull}});Object.defineProperty(k,"GraphQLObjectType",{enumerable:!0,get:function(){return oe.GraphQLObjectType}});Object.defineProperty(k,"GraphQLScalarType",{enumerable:!0,get:function(){return oe.GraphQLScalarType}});Object.defineProperty(k,"GraphQLSchema",{enumerable:!0,get:function(){return oe.GraphQLSchema}});Object.defineProperty(k,"GraphQLSkipDirective",{enumerable:!0,get:function(){return oe.GraphQLSkipDirective}});Object.defineProperty(k,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return oe.GraphQLSpecifiedByDirective}});Object.defineProperty(k,"GraphQLString",{enumerable:!0,get:function(){return oe.GraphQLString}});Object.defineProperty(k,"GraphQLUnionType",{enumerable:!0,get:function(){return oe.GraphQLUnionType}});Object.defineProperty(k,"Kind",{enumerable:!0,get:function(){return Ft.Kind}});Object.defineProperty(k,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return ot.KnownArgumentNamesRule}});Object.defineProperty(k,"KnownDirectivesRule",{enumerable:!0,get:function(){return ot.KnownDirectivesRule}});Object.defineProperty(k,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return ot.KnownFragmentNamesRule}});Object.defineProperty(k,"KnownTypeNamesRule",{enumerable:!0,get:function(){return ot.KnownTypeNamesRule}});Object.defineProperty(k,"Lexer",{enumerable:!0,get:function(){return Ft.Lexer}});Object.defineProperty(k,"Location",{enumerable:!0,get:function(){return Ft.Location}});Object.defineProperty(k,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return ot.LoneAnonymousOperationRule}});Object.defineProperty(k,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return ot.LoneSchemaDefinitionRule}});Object.defineProperty(k,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return ot.NoDeprecatedCustomRule}});Object.defineProperty(k,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return ot.NoFragmentCyclesRule}});Object.defineProperty(k,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return ot.NoSchemaIntrospectionCustomRule}});Object.defineProperty(k,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return ot.NoUndefinedVariablesRule}});Object.defineProperty(k,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return ot.NoUnusedFragmentsRule}});Object.defineProperty(k,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return ot.NoUnusedVariablesRule}});Object.defineProperty(k,"OperationTypeNode",{enumerable:!0,get:function(){return Ft.OperationTypeNode}});Object.defineProperty(k,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return ot.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(k,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return ot.PossibleFragmentSpreadsRule}});Object.defineProperty(k,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return ot.PossibleTypeExtensionsRule}});Object.defineProperty(k,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return ot.ProvidedRequiredArgumentsRule}});Object.defineProperty(k,"ScalarLeafsRule",{enumerable:!0,get:function(){return ot.ScalarLeafsRule}});Object.defineProperty(k,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return oe.SchemaMetaFieldDef}});Object.defineProperty(k,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return ot.SingleFieldSubscriptionsRule}});Object.defineProperty(k,"Source",{enumerable:!0,get:function(){return Ft.Source}});Object.defineProperty(k,"Token",{enumerable:!0,get:function(){return Ft.Token}});Object.defineProperty(k,"TokenKind",{enumerable:!0,get:function(){return Ft.TokenKind}});Object.defineProperty(k,"TypeInfo",{enumerable:!0,get:function(){return kt.TypeInfo}});Object.defineProperty(k,"TypeKind",{enumerable:!0,get:function(){return oe.TypeKind}});Object.defineProperty(k,"TypeMetaFieldDef",{enumerable:!0,get:function(){return oe.TypeMetaFieldDef}});Object.defineProperty(k,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return oe.TypeNameMetaFieldDef}});Object.defineProperty(k,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return ot.UniqueArgumentDefinitionNamesRule}});Object.defineProperty(k,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return ot.UniqueArgumentNamesRule}});Object.defineProperty(k,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return ot.UniqueDirectiveNamesRule}});Object.defineProperty(k,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return ot.UniqueDirectivesPerLocationRule}});Object.defineProperty(k,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return ot.UniqueEnumValueNamesRule}});Object.defineProperty(k,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return ot.UniqueFieldDefinitionNamesRule}});Object.defineProperty(k,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return ot.UniqueFragmentNamesRule}});Object.defineProperty(k,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return ot.UniqueInputFieldNamesRule}});Object.defineProperty(k,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return ot.UniqueOperationNamesRule}});Object.defineProperty(k,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return ot.UniqueOperationTypesRule}});Object.defineProperty(k,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return ot.UniqueTypeNamesRule}});Object.defineProperty(k,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return ot.UniqueVariableNamesRule}});Object.defineProperty(k,"ValidationContext",{enumerable:!0,get:function(){return ot.ValidationContext}});Object.defineProperty(k,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return ot.ValuesOfCorrectTypeRule}});Object.defineProperty(k,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return ot.VariablesAreInputTypesRule}});Object.defineProperty(k,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return ot.VariablesInAllowedPositionRule}});Object.defineProperty(k,"__Directive",{enumerable:!0,get:function(){return oe.__Directive}});Object.defineProperty(k,"__DirectiveLocation",{enumerable:!0,get:function(){return oe.__DirectiveLocation}});Object.defineProperty(k,"__EnumValue",{enumerable:!0,get:function(){return oe.__EnumValue}});Object.defineProperty(k,"__Field",{enumerable:!0,get:function(){return oe.__Field}});Object.defineProperty(k,"__InputValue",{enumerable:!0,get:function(){return oe.__InputValue}});Object.defineProperty(k,"__Schema",{enumerable:!0,get:function(){return oe.__Schema}});Object.defineProperty(k,"__Type",{enumerable:!0,get:function(){return oe.__Type}});Object.defineProperty(k,"__TypeKind",{enumerable:!0,get:function(){return oe.__TypeKind}});Object.defineProperty(k,"assertAbstractType",{enumerable:!0,get:function(){return oe.assertAbstractType}});Object.defineProperty(k,"assertCompositeType",{enumerable:!0,get:function(){return oe.assertCompositeType}});Object.defineProperty(k,"assertDirective",{enumerable:!0,get:function(){return oe.assertDirective}});Object.defineProperty(k,"assertEnumType",{enumerable:!0,get:function(){return oe.assertEnumType}});Object.defineProperty(k,"assertEnumValueName",{enumerable:!0,get:function(){return oe.assertEnumValueName}});Object.defineProperty(k,"assertInputObjectType",{enumerable:!0,get:function(){return oe.assertInputObjectType}});Object.defineProperty(k,"assertInputType",{enumerable:!0,get:function(){return oe.assertInputType}});Object.defineProperty(k,"assertInterfaceType",{enumerable:!0,get:function(){return oe.assertInterfaceType}});Object.defineProperty(k,"assertLeafType",{enumerable:!0,get:function(){return oe.assertLeafType}});Object.defineProperty(k,"assertListType",{enumerable:!0,get:function(){return oe.assertListType}});Object.defineProperty(k,"assertName",{enumerable:!0,get:function(){return oe.assertName}});Object.defineProperty(k,"assertNamedType",{enumerable:!0,get:function(){return oe.assertNamedType}});Object.defineProperty(k,"assertNonNullType",{enumerable:!0,get:function(){return oe.assertNonNullType}});Object.defineProperty(k,"assertNullableType",{enumerable:!0,get:function(){return oe.assertNullableType}});Object.defineProperty(k,"assertObjectType",{enumerable:!0,get:function(){return oe.assertObjectType}});Object.defineProperty(k,"assertOutputType",{enumerable:!0,get:function(){return oe.assertOutputType}});Object.defineProperty(k,"assertScalarType",{enumerable:!0,get:function(){return oe.assertScalarType}});Object.defineProperty(k,"assertSchema",{enumerable:!0,get:function(){return oe.assertSchema}});Object.defineProperty(k,"assertType",{enumerable:!0,get:function(){return oe.assertType}});Object.defineProperty(k,"assertUnionType",{enumerable:!0,get:function(){return oe.assertUnionType}});Object.defineProperty(k,"assertValidName",{enumerable:!0,get:function(){return kt.assertValidName}});Object.defineProperty(k,"assertValidSchema",{enumerable:!0,get:function(){return oe.assertValidSchema}});Object.defineProperty(k,"assertWrappingType",{enumerable:!0,get:function(){return oe.assertWrappingType}});Object.defineProperty(k,"astFromValue",{enumerable:!0,get:function(){return kt.astFromValue}});Object.defineProperty(k,"buildASTSchema",{enumerable:!0,get:function(){return kt.buildASTSchema}});Object.defineProperty(k,"buildClientSchema",{enumerable:!0,get:function(){return kt.buildClientSchema}});Object.defineProperty(k,"buildSchema",{enumerable:!0,get:function(){return kt.buildSchema}});Object.defineProperty(k,"coerceInputValue",{enumerable:!0,get:function(){return kt.coerceInputValue}});Object.defineProperty(k,"concatAST",{enumerable:!0,get:function(){return kt.concatAST}});Object.defineProperty(k,"createSourceEventStream",{enumerable:!0,get:function(){return Do.createSourceEventStream}});Object.defineProperty(k,"defaultFieldResolver",{enumerable:!0,get:function(){return Do.defaultFieldResolver}});Object.defineProperty(k,"defaultTypeResolver",{enumerable:!0,get:function(){return Do.defaultTypeResolver}});Object.defineProperty(k,"doTypesOverlap",{enumerable:!0,get:function(){return kt.doTypesOverlap}});Object.defineProperty(k,"execute",{enumerable:!0,get:function(){return Do.execute}});Object.defineProperty(k,"executeSync",{enumerable:!0,get:function(){return Do.executeSync}});Object.defineProperty(k,"extendSchema",{enumerable:!0,get:function(){return kt.extendSchema}});Object.defineProperty(k,"findBreakingChanges",{enumerable:!0,get:function(){return kt.findBreakingChanges}});Object.defineProperty(k,"findDangerousChanges",{enumerable:!0,get:function(){return kt.findDangerousChanges}});Object.defineProperty(k,"formatError",{enumerable:!0,get:function(){return lf.formatError}});Object.defineProperty(k,"getArgumentValues",{enumerable:!0,get:function(){return Do.getArgumentValues}});Object.defineProperty(k,"getDirectiveValues",{enumerable:!0,get:function(){return Do.getDirectiveValues}});Object.defineProperty(k,"getEnterLeaveForKind",{enumerable:!0,get:function(){return Ft.getEnterLeaveForKind}});Object.defineProperty(k,"getIntrospectionQuery",{enumerable:!0,get:function(){return kt.getIntrospectionQuery}});Object.defineProperty(k,"getLocation",{enumerable:!0,get:function(){return Ft.getLocation}});Object.defineProperty(k,"getNamedType",{enumerable:!0,get:function(){return oe.getNamedType}});Object.defineProperty(k,"getNullableType",{enumerable:!0,get:function(){return oe.getNullableType}});Object.defineProperty(k,"getOperationAST",{enumerable:!0,get:function(){return kt.getOperationAST}});Object.defineProperty(k,"getOperationRootType",{enumerable:!0,get:function(){return kt.getOperationRootType}});Object.defineProperty(k,"getVariableValues",{enumerable:!0,get:function(){return Do.getVariableValues}});Object.defineProperty(k,"getVisitFn",{enumerable:!0,get:function(){return Ft.getVisitFn}});Object.defineProperty(k,"graphql",{enumerable:!0,get:function(){return Ex.graphql}});Object.defineProperty(k,"graphqlSync",{enumerable:!0,get:function(){return Ex.graphqlSync}});Object.defineProperty(k,"introspectionFromSchema",{enumerable:!0,get:function(){return kt.introspectionFromSchema}});Object.defineProperty(k,"introspectionTypes",{enumerable:!0,get:function(){return oe.introspectionTypes}});Object.defineProperty(k,"isAbstractType",{enumerable:!0,get:function(){return oe.isAbstractType}});Object.defineProperty(k,"isCompositeType",{enumerable:!0,get:function(){return oe.isCompositeType}});Object.defineProperty(k,"isConstValueNode",{enumerable:!0,get:function(){return Ft.isConstValueNode}});Object.defineProperty(k,"isDefinitionNode",{enumerable:!0,get:function(){return Ft.isDefinitionNode}});Object.defineProperty(k,"isDirective",{enumerable:!0,get:function(){return oe.isDirective}});Object.defineProperty(k,"isEnumType",{enumerable:!0,get:function(){return oe.isEnumType}});Object.defineProperty(k,"isEqualType",{enumerable:!0,get:function(){return kt.isEqualType}});Object.defineProperty(k,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return Ft.isExecutableDefinitionNode}});Object.defineProperty(k,"isInputObjectType",{enumerable:!0,get:function(){return oe.isInputObjectType}});Object.defineProperty(k,"isInputType",{enumerable:!0,get:function(){return oe.isInputType}});Object.defineProperty(k,"isInterfaceType",{enumerable:!0,get:function(){return oe.isInterfaceType}});Object.defineProperty(k,"isIntrospectionType",{enumerable:!0,get:function(){return oe.isIntrospectionType}});Object.defineProperty(k,"isLeafType",{enumerable:!0,get:function(){return oe.isLeafType}});Object.defineProperty(k,"isListType",{enumerable:!0,get:function(){return oe.isListType}});Object.defineProperty(k,"isNamedType",{enumerable:!0,get:function(){return oe.isNamedType}});Object.defineProperty(k,"isNonNullType",{enumerable:!0,get:function(){return oe.isNonNullType}});Object.defineProperty(k,"isNullableType",{enumerable:!0,get:function(){return oe.isNullableType}});Object.defineProperty(k,"isObjectType",{enumerable:!0,get:function(){return oe.isObjectType}});Object.defineProperty(k,"isOutputType",{enumerable:!0,get:function(){return oe.isOutputType}});Object.defineProperty(k,"isRequiredArgument",{enumerable:!0,get:function(){return oe.isRequiredArgument}});Object.defineProperty(k,"isRequiredInputField",{enumerable:!0,get:function(){return oe.isRequiredInputField}});Object.defineProperty(k,"isScalarType",{enumerable:!0,get:function(){return oe.isScalarType}});Object.defineProperty(k,"isSchema",{enumerable:!0,get:function(){return oe.isSchema}});Object.defineProperty(k,"isSelectionNode",{enumerable:!0,get:function(){return Ft.isSelectionNode}});Object.defineProperty(k,"isSpecifiedDirective",{enumerable:!0,get:function(){return oe.isSpecifiedDirective}});Object.defineProperty(k,"isSpecifiedScalarType",{enumerable:!0,get:function(){return oe.isSpecifiedScalarType}});Object.defineProperty(k,"isType",{enumerable:!0,get:function(){return oe.isType}});Object.defineProperty(k,"isTypeDefinitionNode",{enumerable:!0,get:function(){return Ft.isTypeDefinitionNode}});Object.defineProperty(k,"isTypeExtensionNode",{enumerable:!0,get:function(){return Ft.isTypeExtensionNode}});Object.defineProperty(k,"isTypeNode",{enumerable:!0,get:function(){return Ft.isTypeNode}});Object.defineProperty(k,"isTypeSubTypeOf",{enumerable:!0,get:function(){return kt.isTypeSubTypeOf}});Object.defineProperty(k,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return Ft.isTypeSystemDefinitionNode}});Object.defineProperty(k,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return Ft.isTypeSystemExtensionNode}});Object.defineProperty(k,"isUnionType",{enumerable:!0,get:function(){return oe.isUnionType}});Object.defineProperty(k,"isValidNameError",{enumerable:!0,get:function(){return kt.isValidNameError}});Object.defineProperty(k,"isValueNode",{enumerable:!0,get:function(){return Ft.isValueNode}});Object.defineProperty(k,"isWrappingType",{enumerable:!0,get:function(){return oe.isWrappingType}});Object.defineProperty(k,"lexicographicSortSchema",{enumerable:!0,get:function(){return kt.lexicographicSortSchema}});Object.defineProperty(k,"locatedError",{enumerable:!0,get:function(){return lf.locatedError}});Object.defineProperty(k,"parse",{enumerable:!0,get:function(){return Ft.parse}});Object.defineProperty(k,"parseConstValue",{enumerable:!0,get:function(){return Ft.parseConstValue}});Object.defineProperty(k,"parseType",{enumerable:!0,get:function(){return Ft.parseType}});Object.defineProperty(k,"parseValue",{enumerable:!0,get:function(){return Ft.parseValue}});Object.defineProperty(k,"print",{enumerable:!0,get:function(){return Ft.print}});Object.defineProperty(k,"printError",{enumerable:!0,get:function(){return lf.printError}});Object.defineProperty(k,"printIntrospectionSchema",{enumerable:!0,get:function(){return kt.printIntrospectionSchema}});Object.defineProperty(k,"printLocation",{enumerable:!0,get:function(){return Ft.printLocation}});Object.defineProperty(k,"printSchema",{enumerable:!0,get:function(){return kt.printSchema}});Object.defineProperty(k,"printSourceLocation",{enumerable:!0,get:function(){return Ft.printSourceLocation}});Object.defineProperty(k,"printType",{enumerable:!0,get:function(){return kt.printType}});Object.defineProperty(k,"resolveObjMapThunk",{enumerable:!0,get:function(){return oe.resolveObjMapThunk}});Object.defineProperty(k,"resolveReadonlyArrayThunk",{enumerable:!0,get:function(){return oe.resolveReadonlyArrayThunk}});Object.defineProperty(k,"responsePathAsArray",{enumerable:!0,get:function(){return Do.responsePathAsArray}});Object.defineProperty(k,"separateOperations",{enumerable:!0,get:function(){return kt.separateOperations}});Object.defineProperty(k,"specifiedDirectives",{enumerable:!0,get:function(){return oe.specifiedDirectives}});Object.defineProperty(k,"specifiedRules",{enumerable:!0,get:function(){return ot.specifiedRules}});Object.defineProperty(k,"specifiedScalarTypes",{enumerable:!0,get:function(){return oe.specifiedScalarTypes}});Object.defineProperty(k,"stripIgnoredCharacters",{enumerable:!0,get:function(){return kt.stripIgnoredCharacters}});Object.defineProperty(k,"subscribe",{enumerable:!0,get:function(){return Do.subscribe}});Object.defineProperty(k,"syntaxError",{enumerable:!0,get:function(){return lf.syntaxError}});Object.defineProperty(k,"typeFromAST",{enumerable:!0,get:function(){return kt.typeFromAST}});Object.defineProperty(k,"validate",{enumerable:!0,get:function(){return ot.validate}});Object.defineProperty(k,"validateSchema",{enumerable:!0,get:function(){return oe.validateSchema}});Object.defineProperty(k,"valueFromAST",{enumerable:!0,get:function(){return kt.valueFromAST}});Object.defineProperty(k,"valueFromASTUntyped",{enumerable:!0,get:function(){return kt.valueFromASTUntyped}});Object.defineProperty(k,"version",{enumerable:!0,get:function(){return Tx.version}});Object.defineProperty(k,"versionInfo",{enumerable:!0,get:function(){return Tx.versionInfo}});Object.defineProperty(k,"visit",{enumerable:!0,get:function(){return Ft.visit}});Object.defineProperty(k,"visitInParallel",{enumerable:!0,get:function(){return Ft.visitInParallel}});Object.defineProperty(k,"visitWithTypeInfo",{enumerable:!0,get:function(){return kt.visitWithTypeInfo}});var Tx=Pk(),Ex=sP(),oe=cP(),Ft=pP(),Do=NP(),ot=IP(),lf=bP(),kt=yx()});var Ix=F(il=>{"use strict";d();m();f();Object.defineProperty(il,"__esModule",{value:!0});il.federateSubgraphs=il.FederationFactory=void 0;var SX=(wA(),Te(AA)),ce=(he(),Te(Ie)),Ur=Vp(),Et=eo(),ke=Yo(),Ao=mc(),Un=Sm(),gx=Pm(),Pt=Li(),Je=za(),pf=Tv(),rl=Jh(),DX=u_(),vx=gv(),wo=Nx(),TT=class{constructor(t,n,r,i,o){S(this,"authorizationDataByParentTypeName");S(this,"abstractToConcreteTypeNames",new Map);S(this,"areFieldsExternal",!1);S(this,"areFieldsShareable",!1);S(this,"argumentTypeNameSet",new Set);S(this,"fieldConfigurationByFieldPath",new Map);S(this,"entityInterfaceFederationDataByTypeName");S(this,"executableDirectives",new Set);S(this,"parentTypeName","");S(this,"persistedDirectives",new Set([Pt.DEPRECATED,Pt.INACCESSIBLE,Pt.TAG]));S(this,"persistedDirectiveDefinitions",new Set([Pt.AUTHENTICATED,Pt.DEPRECATED,Pt.INACCESSIBLE,Pt.TAG,Pt.REQUIRES_SCOPES]));S(this,"currentSubgraphName","");S(this,"childName","");S(this,"directiveDefinitions",new Map);S(this,"entityContainersByTypeName");S(this,"errors",[]);S(this,"evaluatedObjectLikesBySubgraph",new Map);S(this,"extensions",new Map);S(this,"graph",new SX.MultiGraph);S(this,"graphEdges",new Set);S(this,"graphPaths",new Map);S(this,"inputFieldTypeNameSet",new Set);S(this,"invalidOrScopesHostPaths",new Set);S(this,"isCurrentParentEntity",!1);S(this,"isCurrentParentInterface",!1);S(this,"isCurrentSubgraphVersionTwo",!1);S(this,"isCurrentParentExtensionType",!1);S(this,"isParentRootType",!1);S(this,"isParentInputObject",!1);S(this,"keyFieldNamesByParentTypeName",new Map);S(this,"outputFieldTypeNameSet",new Set);S(this,"parents",new Map);S(this,"rootTypeNames",new Set([Pt.DEFAULT_MUTATION,Pt.DEFAULT_QUERY,Pt.DEFAULT_SUBSCRIPTION]));S(this,"internalSubgraphBySubgraphName");S(this,"shareableErrorTypeNames",new Map);S(this,"renamedTypeNameByOriginalTypeName",new Map);S(this,"warnings");this.authorizationDataByParentTypeName=t,this.entityContainersByTypeName=n,this.entityInterfaceFederationDataByTypeName=r,this.internalSubgraphBySubgraphName=i,this.warnings=o||[]}isObjectRootType(t){return this.rootTypeNames.has(t.name.value)}populateMultiGraphAndRenameOperations(t){for(let n of t.values())this.currentSubgraphName=n.name,(0,gx.walkSubgraphToCollectObjectLikesAndDirectiveDefinitions)(this,n)}getEnumMergeMethod(t){return this.inputFieldTypeNameSet.has(t)||this.argumentTypeNameSet.has(t)?this.outputFieldTypeNameSet.has(t)?Un.MergeMethod.CONSISTENT:Un.MergeMethod.INTERSECTION:Un.MergeMethod.UNION}validateArgumentDefaultValues(t,n,r){n.kind!==r.kind&&this.errors.push((0,ke.incompatibleArgumentDefaultValueTypeError)(t,this.parentTypeName,this.childName,n.kind,r.kind)),"value"in r&&n.value!==r.value&&this.errors.push((0,ke.incompatibleArgumentDefaultValueError)(t,this.parentTypeName,this.childName,n.value,r.value))}compareAndValidateArgumentDefaultValues(t,n){let r=n.defaultValue;if(t.node.defaultValue=t.node.defaultValue||r,!t.node.defaultValue||!r){t.includeDefaultValue=!1;return}let i=t.node.name.value,o=t.node.defaultValue;switch(o.kind){case ce.Kind.LIST:break;case ce.Kind.NULL:break;case ce.Kind.OBJECT:break;case ce.Kind.BOOLEAN:case ce.Kind.ENUM:case ce.Kind.FLOAT:case ce.Kind.INT:case ce.Kind.STRING:this.validateArgumentDefaultValues(i,o,r);break;default:throw(0,ke.unexpectedArgumentKindFatalError)(i,this.childName)}}upsertRequiredSubgraph(t,n){return n&&t.add(this.currentSubgraphName),t}upsertExtensionPersistedDirectives(t,n){for(let[o,s]of t.tags)n.tags.set(o,s);for(let[o,s]of t.directives){let a=n.directives.get(o);if(!a){n.directives.set(o,s);continue}a.push(...s)}let r=t.deprecated.directive,i=t.deprecated.reason;!r||!i||n.deprecated.directive&&n.deprecated.reason&&i.length0&&(0,Je.addIterableValuesToSet)(i.requiredSubgraphs,o.requiredSubgraphs),(0,Je.addIterableValuesToSet)(i.subgraphs,o.subgraphs);let{typeErrors:s,typeNode:a}=(0,Ao.getMostRestrictiveMergedTypeNode)(o.node.type,i.node.type,this.childName,r);if(a)o.node.type=a;else{if(!s||s.length<2)throw(0,ke.argumentTypeMergeFatalError)(r,this.childName);this.errors.push((0,ke.incompatibleArgumentTypesError)(r,this.parentTypeName,this.childName,s[0],s[1]))}this.compareAndValidateArgumentDefaultValues(o,i.node),this.upsertExtensionPersistedDirectives(i.directives,o.directives)}}upsertArguments(t,n){if(!t.arguments)return n;for(let r of t.arguments){let i=r.name.value,o=`${t.name.value}(${i}...)`;this.argumentTypeNameSet.add((0,Ao.getNamedTypeForChild)(o,r.type));let s=(0,Ao.isTypeRequired)(r.type),a=n.get(i);if(!a){n.set(i,{directives:this.extractPersistedDirectives(r.directives||[],(0,Un.newPersistedDirectivesContainer)()),includeDefaultValue:!!r.defaultValue,node:(0,Ur.inputValueDefinitionNodeToMutable)(r,this.childName),requiredSubgraphs:this.upsertRequiredSubgraph(new Set,s),subgraphs:new Set([this.currentSubgraphName])});continue}this.extractPersistedDirectives(r.directives||[],a.directives),(0,Et.setLongestDescriptionForNode)(a.node,r.description),this.upsertRequiredSubgraph(a.requiredSubgraphs,s),a.subgraphs.add(this.currentSubgraphName);let{typeErrors:c,typeNode:u}=(0,Ao.getMostRestrictiveMergedTypeNode)(a.node.type,r.type,this.childName,i);if(u)a.node.type=u;else{if(!c||c.length<2)throw(0,ke.argumentTypeMergeFatalError)(i,this.childName);this.errors.push((0,ke.incompatibleArgumentTypesError)(i,this.parentTypeName,this.childName,c[0],c[1]))}this.compareAndValidateArgumentDefaultValues(a,r)}return n}isFieldEntityKey(){let t=this.keyFieldNamesByParentTypeName.get(this.parentTypeName);return t?t.has(this.childName):!1}isFieldExternal(t){return this.areFieldsExternal||(0,Et.isNodeExternal)(t)}isFieldShareable(t){return!this.isCurrentSubgraphVersionTwo||this.areFieldsShareable||this.isFieldEntityKey()||(0,Et.isNodeShareable)(t)}upsertDirectiveNode(t){let n=t.name.value,r=this.directiveDefinitions.get(n);if(r){if(!this.executableDirectives.has(n))return;if((0,Et.mergeExecutableDirectiveLocations)(t.locations,r).size<1){this.executableDirectives.delete(n);return}this.upsertArguments(t,r.arguments),(0,Et.setLongestDescriptionForNode)(r.node,t.description),r.node.repeatable=r.node.repeatable&&t.repeatable,r.subgraphNames.add(this.currentSubgraphName);return}let i=(0,Et.extractExecutableDirectiveLocations)(t.locations,new Set);this.directiveDefinitions.set(n,{arguments:this.upsertArguments(t,new Map),executableLocations:i,node:(0,Ur.directiveDefinitionNodeToMutable)(t),subgraphNames:new Set([this.currentSubgraphName])}),i.size>0&&this.executableDirectives.add(n)}isShareabilityOfAllFieldInstancesValid(t){let n=0,r=0;for(let[i,o]of t.subgraphsByShareable)if(!t.subgraphsByExternal.get(i)){if(o){if(r)return!1;n+=1;continue}if(r+=1,n||r>1)return!1}return!0}upsertFieldNode(t){let n=this.isCurrentParentExtensionType?(0,Je.getOrThrowError)(this.extensions,this.parentTypeName,Pt.EXTENSIONS):(0,Je.getOrThrowError)(this.parents,this.parentTypeName,Pt.PARENTS);if(n.kind!==ce.Kind.OBJECT_TYPE_DEFINITION&&n.kind!==ce.Kind.INTERFACE_TYPE_DEFINITION&&n.kind!==ce.Kind.OBJECT_TYPE_EXTENSION)throw(0,ke.unexpectedKindFatalError)(this.parentTypeName);let r=n.fields,i=this.isFieldExternal(t),o=this.isFieldShareable(t),s=`${this.parentTypeName}.${this.childName}`,a=(0,Ao.getNamedTypeForChild)(s,t.type),c=r.get(this.childName);if(c){this.extractPersistedDirectives(t.directives||[],c.directives),(0,Et.setLongestDescriptionForNode)(c.node,t.description),c.subgraphNames.add(this.currentSubgraphName),c.subgraphsByShareable.set(this.currentSubgraphName,o),c.subgraphsByExternal.set(this.currentSubgraphName,i);let{typeErrors:u,typeNode:l}=(0,Ao.getLeastRestrictiveMergedTypeNode)(c.node.type,t.type,this.parentTypeName,this.childName);if(l)c.node.type=l;else{if(!u||u.length<2)throw(0,ke.fieldTypeMergeFatalError)(this.childName);this.errors.push((0,ke.incompatibleChildTypesError)(this.parentTypeName,this.childName,u[0],u[1]))}if(this.upsertArguments(t,c.arguments),this.isCurrentParentInterface||i||c.isShareable&&o||this.isShareabilityOfAllFieldInstancesValid(c)||this.entityInterfaceFederationDataByTypeName.has(this.parentTypeName))return;let p=this.shareableErrorTypeNames.get(this.parentTypeName);p?p.add(this.childName):this.shareableErrorTypeNames.set(this.parentTypeName,new Set([this.childName]));return}this.outputFieldTypeNameSet.add(a),r.set(this.childName,{arguments:this.upsertArguments(t,new Map),directives:this.extractPersistedDirectives(t.directives||[],(0,Un.newPersistedDirectivesContainer)()),isShareable:o,node:(0,Ur.fieldDefinitionNodeToMutable)(t,this.parentTypeName),namedTypeName:a,subgraphNames:new Set([this.currentSubgraphName]),subgraphsByShareable:new Map([[this.currentSubgraphName,o]]),subgraphsByExternal:new Map([[this.currentSubgraphName,i]])})}upsertValueNode(t){let n=this.parents.get(this.parentTypeName);switch(t.kind){case ce.Kind.ENUM_VALUE_DEFINITION:if(!n)throw(0,ke.federationInvalidParentTypeError)(this.parentTypeName,this.childName);if(n.kind!==ce.Kind.ENUM_TYPE_DEFINITION)throw(0,ke.incompatibleParentKindFatalError)(this.parentTypeName,ce.Kind.ENUM_TYPE_DEFINITION,n.kind);let r=n.values,i=r.get(this.childName);if(i){this.extractPersistedDirectives(t.directives||[],i.directives),(0,Et.setLongestDescriptionForNode)(i.node,t.description),i.appearances+=1;return}r.set(this.childName,{appearances:1,directives:this.extractPersistedDirectives(t.directives||[],(0,Un.newPersistedDirectivesContainer)()),node:(0,Ur.enumValueDefinitionNodeToMutable)(t)});return;case ce.Kind.INPUT_VALUE_DEFINITION:if(!n||!this.isParentInputObject)return;if(n.kind!==ce.Kind.INPUT_OBJECT_TYPE_DEFINITION)throw(0,ke.incompatibleParentKindFatalError)(this.parentTypeName,ce.Kind.INPUT_OBJECT_TYPE_DEFINITION,n.kind);let o=n.fields,s=o.get(this.childName);if(s){this.extractPersistedDirectives(t.directives||[],s.directives),s.appearances+=1,(0,Et.setLongestDescriptionForNode)(s.node,t.description);let{typeErrors:u,typeNode:l}=(0,Ao.getMostRestrictiveMergedTypeNode)(s.node.type,t.type,this.parentTypeName,this.childName);if(l)s.node.type=l;else{if(!u||u.length<2)throw(0,ke.fieldTypeMergeFatalError)(this.childName);this.errors.push((0,ke.incompatibleChildTypesError)(this.parentTypeName,this.childName,u[0],u[1]))}return}let a=`${this.parentTypeName}.${this.childName}`,c=(0,Ao.getNamedTypeForChild)(a,t.type);this.inputFieldTypeNameSet.add(c),o.set(this.childName,{appearances:1,directives:this.extractPersistedDirectives(t.directives||[],(0,Un.newPersistedDirectivesContainer)()),includeDefaultValue:!!t.defaultValue,node:(0,Ur.inputValueDefinitionNodeToMutable)(t,this.parentTypeName)});return;default:throw(0,ke.unexpectedKindFatalError)(this.childName)}}upsertInterfaceObjectParentNode(t){let n=t.name.value,r=this.parents.get(n);if(r){if(r.kind!==ce.Kind.INTERFACE_TYPE_DEFINITION)throw(0,ke.incompatibleParentKindFatalError)(n,t.kind,r.kind);(0,Et.setLongestDescriptionForNode)(r.node,t.description),this.extractPersistedDirectives(t.directives||[],r.directives),(0,Et.extractInterfaces)(t,r.interfaces),r.subgraphNames.add(this.currentSubgraphName);return}this.parents.set(n,{directives:this.extractPersistedDirectives(t.directives||[],(0,Un.newPersistedDirectivesContainer)()),fields:new Map,interfaces:(0,Et.extractInterfaces)(t,new Set),kind:ce.Kind.INTERFACE_TYPE_DEFINITION,node:(0,Ur.interfaceTypeDefinitionNodeToMutable)(x(D({},t),{kind:ce.Kind.INTERFACE_TYPE_DEFINITION})),subgraphNames:new Set([this.currentSubgraphName])})}upsertParentNode(t){var i,o;let n=t.name.value,r=this.parents.get(n);switch(r&&((0,Et.setLongestDescriptionForNode)(r.node,t.description),this.extractPersistedDirectives(t.directives||[],r.directives)),t.kind){case ce.Kind.ENUM_TYPE_DEFINITION:if(r){if(r.kind!==t.kind)throw(0,ke.incompatibleParentKindFatalError)(n,t.kind,r.kind);r.appearances+=1;return}this.parents.set(n,{appearances:1,directives:this.extractPersistedDirectives(t.directives||[],(0,Un.newPersistedDirectivesContainer)()),values:new Map,kind:t.kind,node:(0,Ur.enumTypeDefinitionNodeToMutable)(t)});return;case ce.Kind.INPUT_OBJECT_TYPE_DEFINITION:if(r){if(r.kind!==t.kind)throw(0,ke.incompatibleParentKindFatalError)(n,t.kind,r.kind);r.appearances+=1;return}this.parents.set(n,{appearances:1,directives:this.extractPersistedDirectives(t.directives||[],(0,Un.newPersistedDirectivesContainer)()),fields:new Map,kind:t.kind,node:(0,Ur.inputObjectTypeDefinitionNodeToMutable)(t)});return;case ce.Kind.INTERFACE_TYPE_DEFINITION:if(r){if(r.kind!==t.kind)throw(0,ke.incompatibleParentKindFatalError)(n,t.kind,r.kind);(0,Et.extractInterfaces)(t,r.interfaces),r.subgraphNames.add(this.currentSubgraphName);return}this.parents.set(n,{directives:this.extractPersistedDirectives(t.directives||[],(0,Un.newPersistedDirectivesContainer)()),fields:new Map,interfaces:(0,Et.extractInterfaces)(t,new Set),kind:t.kind,node:(0,Ur.interfaceTypeDefinitionNodeToMutable)(t),subgraphNames:new Set([this.currentSubgraphName])});return;case ce.Kind.SCALAR_TYPE_DEFINITION:if(r){if(r.kind!==t.kind)throw(0,ke.incompatibleParentKindFatalError)(n,t.kind,r.kind);return}this.parents.set(n,{directives:this.extractPersistedDirectives(t.directives||[],(0,Un.newPersistedDirectivesContainer)()),kind:t.kind,node:(0,Ur.scalarTypeDefinitionNodeToMutable)(t)});return;case ce.Kind.OBJECT_TYPE_DEFINITION:if(r){if(r.kind!==t.kind)throw(0,ke.incompatibleParentKindFatalError)(n,t.kind,r.kind);(0,Et.extractInterfaces)(t,r.interfaces),r.subgraphNames.add(this.currentSubgraphName);return}this.parents.set(n,{directives:this.extractPersistedDirectives(t.directives||[],(0,Un.newPersistedDirectivesContainer)()),fields:new Map,interfaces:(0,Et.extractInterfaces)(t,new Set),isRootType:this.isParentRootType,kind:t.kind,node:(0,Ur.objectTypeDefinitionNodeToMutable)(t),subgraphNames:new Set([this.currentSubgraphName])});return;case ce.Kind.UNION_TYPE_DEFINITION:if(r){if(r.kind!==t.kind)throw(0,ke.incompatibleParentKindFatalError)(n,t.kind,r.kind);if(!t.types||t.types.length<1){this.errors.push((0,ke.invalidUnionError)(r.node.name.value));return}(i=t.types)==null||i.forEach(s=>r.members.add(s.name.value));return}this.parents.set(n,{directives:this.extractPersistedDirectives(t.directives||[],(0,Un.newPersistedDirectivesContainer)()),kind:t.kind,members:new Set((o=t.types)==null?void 0:o.map(s=>s.name.value)),node:(0,Ur.unionTypeDefinitionNodeToMutable)(t)});return}}upsertExtensionNode(t){let n=this.extensions.get(this.parentTypeName);if(n){if(n.kind!==ce.Kind.OBJECT_TYPE_EXTENSION)throw(0,ke.incompatibleParentKindFatalError)(this.parentTypeName,ce.Kind.OBJECT_TYPE_EXTENSION,n.kind);n.subgraphNames.add(this.currentSubgraphName),(0,Et.extractInterfaces)(t,n.interfaces),this.extractPersistedDirectives(t.directives||[],n.directives);return}let r=(0,Et.extractInterfaces)(t,new Set);this.extensions.set(this.parentTypeName,{directives:this.extractPersistedDirectives(t.directives||[],(0,Un.newPersistedDirectivesContainer)()),fields:new Map,interfaces:r,isRootType:this.isParentRootType,kind:ce.Kind.OBJECT_TYPE_EXTENSION,node:(0,Ur.objectTypeExtensionNodeToMutable)(t),subgraphNames:new Set([this.currentSubgraphName])})}isTypeValidImplementation(t,n){if(t.kind===ce.Kind.NON_NULL_TYPE)return n.kind!==ce.Kind.NON_NULL_TYPE?!1:this.isTypeValidImplementation(t.type,n.type);if(n.kind===ce.Kind.NON_NULL_TYPE)return this.isTypeValidImplementation(t,n.type);switch(t.kind){case ce.Kind.NAMED_TYPE:if(n.kind===ce.Kind.NAMED_TYPE){let r=t.name.value,i=n.name.value;if(r===i)return!0;let o=this.abstractToConcreteTypeNames.get(r);return o?o.has(i):!1}return!1;default:return n.kind===ce.Kind.LIST_TYPE?this.isTypeValidImplementation(t.type,n.type):!1}}getAndValidateImplementedInterfaces(t){var i;let n=[];if(t.interfaces.size<1)return n;let r=new Map;for(let o of t.interfaces){n.push((0,Et.stringToNamedTypeNode)(o));let s=this.parents.get(o);if(!s){this.errors.push((0,ke.undefinedTypeError)(o));continue}if(s.kind!==ce.Kind.INTERFACE_TYPE_DEFINITION)throw(0,ke.incompatibleParentKindFatalError)(o,ce.Kind.INTERFACE_TYPE_DEFINITION,s.kind);let a={invalidFieldImplementations:new Map,unimplementedFields:[]},c=!1;for(let[u,l]of s.fields){let p=!1,h=t.fields.get(u);if(!h){c=!0,a.unimplementedFields.push(u);continue}let y={invalidAdditionalArguments:new Set,invalidImplementedArguments:[],originalResponseType:(0,pf.printTypeNode)(l.node.type),unimplementedArguments:new Set};this.isTypeValidImplementation(l.node.type,h.node.type)||(c=!0,p=!0,y.implementedResponseType=(0,pf.printTypeNode)(h.node.type));let N=new Set;for(let[O,w]of l.arguments){let M=w.node;N.add(O);let W=(i=h.arguments.get(O))==null?void 0:i.node;if(!W){c=!0,p=!0,y.unimplementedArguments.add(O);continue}let K=(0,pf.printTypeNode)(W.type),te=(0,pf.printTypeNode)(M.type);te!==K&&(c=!0,p=!0,y.invalidImplementedArguments.push({actualType:K,argumentName:O,expectedType:te}))}for(let[O,w]of h.arguments){let M=w.node;N.has(O)||M.type.kind===ce.Kind.NON_NULL_TYPE&&(c=!0,p=!0,y.invalidAdditionalArguments.add(O))}p&&a.invalidFieldImplementations.set(u,y)}c&&r.set(o,a)}return r.size&&this.errors.push((0,ke.unimplementedInterfaceFieldsError)(t.node.name.value,(0,Je.kindToTypeString)(t.kind),r)),n}mergeArguments(t,n,r,i){for(let o of t.arguments.values()){let s=(0,Je.getEntriesNotInHashSet)(t.subgraphNames,o.subgraphs),a=o.node.name.value;if(s.length>0){o.requiredSubgraphs.size>0&&r.push({argumentName:a,missingSubgraphs:s,requiredSubgraphs:[...o.requiredSubgraphs]});continue}o.node.defaultValue=o.includeDefaultValue?o.node.defaultValue:void 0,n.push((0,Et.pushPersistedDirectivesAndGetNode)(o)),i&&i.push(a)}}addValidExecutableDirectiveDefinition(t,n,r){if(!this.executableDirectives.has(t)||this.internalSubgraphBySubgraphName.size!==n.subgraphNames.size)return;if(n.node.locations=(0,Et.setToNameNodeArray)(n.executableLocations),!n.arguments){r.push(n.node);return}let i=[],o=[];if(this.mergeArguments(n,i,o),o.length>0){this.errors.push((0,ke.invalidRequiredArgumentsError)(Pt.DIRECTIVE_DEFINITION,t,o));return}n.node.arguments=i,r.push(n.node)}pushAuthorizationDirectives(t,n){let r=this.authorizationDataByParentTypeName.get(n);if(!r)return;let i=r.fieldAuthorizationDataByFieldName.get(t.node.name.value);i&&(i.requiresAuthentication&&t.directives.directives.set(Pt.AUTHENTICATED,[(0,Je.generateAuthenticatedDirective)()]),i.requiredScopes.length>0&&t.directives.directives.set(Pt.REQUIRES_SCOPES,[(0,Je.generateRequiresScopesDirective)(i.requiredScopes)]))}getMergedFieldDefinitionNode(t,n){if(this.pushAuthorizationDirectives(t,n),(0,Et.pushPersistedDirectivesAndGetNode)(t),t.arguments.size<1)return t.node;let r=t.node.name.value,i=`${n}.${r}`,o=[],s=[],a=[];return this.mergeArguments(t,o,s,a),s.length>0?this.errors.push((0,ke.invalidRequiredArgumentsError)(Pt.FIELD,i,s)):a.length>0&&this.fieldConfigurationByFieldPath.set(`${n}.${r}`,{argumentNames:a,fieldName:r,typeName:n}),t.node.arguments=o,t.node}upsertDeprecatedDirective(t,n){if(!t.arguments||t.arguments.length<1){n.directive=t;return}if(t.arguments.length!==1){this.errors.push(ke.invalidDeprecatedDirectiveError);return}let r=t.arguments[0].value;if(r.kind!==ce.Kind.STRING){this.errors.push(ke.invalidDeprecatedDirectiveError);return}n.reason&&r.value.length0)for(let s of o){let a=this.evaluatedObjectLikesBySubgraph.get(s);a?a.add(i):this.evaluatedObjectLikesBySubgraph.set(s,new Set([i]))}for(let s of r){let a=(0,Je.getOrThrowError)(this.parents,s,Pt.PARENTS),c=(0,Je.getAllMutualEntries)(t,a.subgraphNames),u=(0,Je.getAllMutualEntries)(c,n);for(let l of u){let p=this.evaluatedObjectLikesBySubgraph.get(l);p?p.add(i):this.evaluatedObjectLikesBySubgraph.set(l,new Set([i]))}}}evaluateResolvabilityOfObject(t,n,r,i,o,s=!1){let a=t.node.name.value;if(!i.has(a)){if(!this.shouldEvaluateObjectLike(n.subgraphs,a)){i.add(a);return}for(let[c,u]of t.fields){let l=u.namedTypeName;if(Pt.ROOT_TYPES.has(l)||i.has(l)||this.isFieldExternalInAllMutualSubgraphs(n.subgraphs,u))continue;this.updateEvaluatedSubgraphOccurrences(n.subgraphs,t.subgraphNames,o,a),i.add(a);let p=(0,Je.doSetsHaveAnyOverlap)(n.subgraphs,u.subgraphNames)||this.isFieldResolvableByEntityAncestor(o,u.subgraphNames,a),h=r+(s?" ":".")+c,y=this.entityContainersByTypeName.get(l);if(p){if(rl.BASE_SCALARS.has(l))continue;let O=(0,Je.getOrThrowError)(this.parents,l,Pt.PARENTS);switch(O.kind){case ce.Kind.ENUM_TYPE_DEFINITION:case ce.Kind.SCALAR_TYPE_DEFINITION:continue;case ce.Kind.OBJECT_TYPE_DEFINITION:this.evaluateResolvabilityOfObject(O,n,h,i,y?[...o,l]:[...o]);continue;case ce.Kind.INTERFACE_TYPE_DEFINITION:case ce.Kind.UNION_TYPE_DEFINITION:this.evaluateResolvabilityOfAbstractType(l,O.kind,n,h,i,y?[...o,l]:[...o]);continue;default:this.errors.push((0,ke.unexpectedObjectResponseType)(h,(0,Je.kindToTypeString)(O.kind)));continue}}if(rl.BASE_SCALARS.has(l)){this.errors.push((0,ke.unresolvableFieldError)(n,c,[...u.subgraphNames],h,a));continue}let N=(0,Je.getOrThrowError)(this.parents,l,Pt.PARENTS);switch(N.kind){case ce.Kind.ENUM_TYPE_DEFINITION:case ce.Kind.SCALAR_TYPE_DEFINITION:this.errors.push((0,ke.unresolvableFieldError)(n,c,[...u.subgraphNames],h,a));continue;case ce.Kind.INTERFACE_TYPE_DEFINITION:case ce.Kind.UNION_TYPE_DEFINITION:case ce.Kind.OBJECT_TYPE_DEFINITION:this.errors.push((0,ke.unresolvableFieldError)(n,c,[...u.subgraphNames],h+Pt.SELECTION_REPRESENTATION,a));continue;default:this.errors.push((0,ke.unexpectedObjectResponseType)(h,(0,Je.kindToTypeString)(N.kind)))}}}}evaluateResolvabilityOfAbstractType(t,n,r,i,o,s){if(o.has(t))return;o.add(t);let a=this.abstractToConcreteTypeNames.get(t);if(!a){(0,ke.noConcreteTypesForAbstractTypeError)((0,Je.kindToTypeString)(n),t);return}for(let c of a){if(o.has(c))continue;let u=(0,Je.getOrThrowError)(this.parents,c,Pt.PARENTS);if(u.kind!==ce.Kind.OBJECT_TYPE_DEFINITION)throw(0,ke.unexpectedParentKindErrorMessage)(c,"Object",(0,Je.kindToTypeString)(u.kind));if(!(0,Je.doSetsHaveAnyOverlap)(u.subgraphNames,r.subgraphs))continue;let l=this.entityContainersByTypeName.get(c);this.evaluateResolvabilityOfObject(u,r,i+" ... on "+c,o,l?[...s,c]:[...s],!0)}}validateKeyFieldSetsForImplicitEntity(t){let n=(0,Je.getOrThrowError)(this.internalSubgraphBySubgraphName,this.currentSubgraphName,"internalSubgraphBySubgraphName"),r=n.parentContainerByTypeName,i=n.extensionContainerByTypeName,o=r.get(t.typeName)||i.get(t.typeName);if(!o||o.kind!==ce.Kind.OBJECT_TYPE_DEFINITION&&o.kind!==ce.Kind.OBJECT_TYPE_EXTENSION)throw(0,ke.incompatibleParentKindFatalError)(t.typeName,ce.Kind.OBJECT_TYPE_DEFINITION,(o==null?void 0:o.kind)||ce.Kind.NULL);let s=(0,Je.getOrThrowError)(n.configurationDataMap,t.typeName,"internalSubgraph.configurationDataMap"),a=new Set,c=[];for(let u of t.keyFieldSets){let{error:l,documentNode:p}=(0,Et.safeParse)("{"+u+"}");if(l||!p)continue;let h=[o],y=[],N=-1,O=!0,w=!0;(0,wo.visit)(p,{Argument:{enter(){return w=!1,wo.BREAK}},Field:{enter(M){let W=h[N],K=W.name.value;if(O)return w=!1,wo.BREAK;let te=M.name.value,pe=`${K}.${te}`,qe=W.fields.get(te);if(!qe||qe.arguments.size||y[N].has(te))return w=!1,wo.BREAK;y[N].add(te),N===0&&a.add(te);let st=(0,Ao.getNamedTypeForChild)(pe,qe.node.type);if(rl.BASE_SCALARS.has(st))return;let ft=r.get(st)||i.get(st);if(!ft)return w=!1,wo.BREAK;if(ft.kind===ce.Kind.OBJECT_TYPE_DEFINITION||ft.kind===ce.Kind.OBJECT_TYPE_EXTENSION){O=!0,h.push(ft);return}if((0,Et.isKindAbstract)(ft.kind))return w=!1,wo.BREAK}},InlineFragment:{enter(){return w=!1,wo.BREAK}},SelectionSet:{enter(){if(!O||(N+=1,O=!1,N<0||N>=h.length))return w=!1,wo.BREAK;y.push(new Set)},leave(){if(O)return w=!1,wo.BREAK;N-=1,h.pop(),y.pop()}}}),w&&((0,Je.addIterableValuesToSet)(a,s.fieldNames),c.push({fieldName:"",selectionSet:(0,vx.getNormalizedFieldSet)(p),disableEntityResolver:!0}))}c.length>0&&(s.isRootNode=!0,s.keys=c)}handleAuthorizationDataForRenamedTypes(){for(let[t,n]of this.renamedTypeNameByOriginalTypeName){let r=this.authorizationDataByParentTypeName.get(t);if(!r)continue;r.typeName=n;let i=this.authorizationDataByParentTypeName.get(n);if(!i)this.authorizationDataByParentTypeName.set(n,r);else for(let[o,s]of i.fieldAuthorizationDataByFieldName)(0,Je.upsertFieldAuthorizationData)(r.fieldAuthorizationDataByFieldName,s)||this.invalidOrScopesHostPaths.add(`${n}.${o}`);this.authorizationDataByParentTypeName.delete(t)}}federate(){this.populateMultiGraphAndRenameOperations(this.internalSubgraphBySubgraphName);let t=this;for(let c of this.internalSubgraphBySubgraphName.values())this.isCurrentSubgraphVersionTwo=c.isVersionTwo,this.currentSubgraphName=c.name,this.keyFieldNamesByParentTypeName=c.keyFieldNamesByParentTypeName,(0,gx.walkSubgraphToFederate)(c.definitions,c.overriddenFieldNamesByParentTypeName,t);this.handleAuthorizationDataForRenamedTypes();for(let[c,u]of this.entityInterfaceFederationDataByTypeName){(0,Je.subtractSourceSetFromTargetSet)(u.interfaceFieldNames,u.interfaceObjectFieldNames);let l=(0,Je.getOrThrowError)(this.parents,c,"parents");if(l.kind===ce.Kind.INTERFACE_TYPE_DEFINITION)for(let p of u.interfaceObjectSubgraphs){let h=(0,Je.getOrThrowError)(this.internalSubgraphBySubgraphName,p,"internalSubgraphBySubgraphName").configurationDataMap,y=this.abstractToConcreteTypeNames.get(c);if(!y)continue;let N=(0,Je.getOrThrowError)(h,c,"configurationDataMap"),O=N.keys;if(!O)continue;N.entityInterfaceConcreteTypeNames=u.concreteTypeNames;let w=N.fieldNames,M=this.authorizationDataByParentTypeName.get(u.typeName);for(let W of y){if(h.has(W))continue;if(M){let qe=(0,Je.getValueOrDefault)(this.authorizationDataByParentTypeName,W,()=>(0,Je.newAuthorizationData)(W));for(let st of M.fieldAuthorizationDataByFieldName.values())(0,Je.upsertFieldAuthorizationData)(qe.fieldAuthorizationDataByFieldName,st)||this.invalidOrScopesHostPaths.add(`${W}.${st.fieldName}`)}let K=(0,Je.getOrThrowError)(this.parents,W,"parents");if(K.kind!==ce.Kind.OBJECT_TYPE_DEFINITION)continue;let te=this.entityContainersByTypeName.get(W);te&&te.subgraphNames.add(p);let pe={fieldNames:w,isRootNode:!0,keys:O,typeName:W};for(let qe of u.interfaceObjectFieldNames){if(K.fields.get(qe))continue;let ft=(0,Je.getOrThrowError)(l.fields,qe,"entityInterface.fields");K.fields.set(qe,D({},ft))}h.set(W,pe)}}}this.invalidOrScopesHostPaths.size>0&&this.errors.push((0,ke.orScopesLimitError)(Je.maxOrScopes,[...this.invalidOrScopesHostPaths]));let n=[];for(let[c,u]of this.directiveDefinitions){if(this.persistedDirectiveDefinitions.has(c)){n.push(u.node);continue}this.addValidExecutableDirectiveDefinition(c,u,n)}this.directiveDefinitions.has(Pt.REQUIRES_SCOPES)&&n.push(rl.SCOPE_SCALAR_DEFINITION);for(let[c,u]of this.extensions){this.parentTypeName=c,u.isRootType&&!this.parents.has(c)&&this.upsertParentNode((0,Ur.objectTypeExtensionNodeToMutableDefinitionNode)(u.node));let l=this.parents.get(c);if(!l){this.errors.push((0,ke.noBaseTypeExtensionError)(c));continue}if(l.kind!==ce.Kind.OBJECT_TYPE_DEFINITION)throw(0,ke.incompatibleParentKindFatalError)(c,ce.Kind.OBJECT_TYPE_DEFINITION,l.kind);this.upsertExtensionPersistedDirectives(u.directives,l.directives);for(let[p,h]of u.fields){let y=l.fields.get(p);if(!y){l.fields.set(p,h);continue}if(y.isShareable&&h.isShareable){this.childName=p,this.upsertExtensionFieldArguments(h.arguments,y.arguments),(0,Et.setLongestDescriptionForNode)(y.node,h.node.description),(0,Je.addIterableValuesToSet)(h.subgraphNames,y.subgraphNames);continue}let N=this.shareableErrorTypeNames.get(c);if(N){N.add(p);continue}this.shareableErrorTypeNames.set(c,new Set([p]))}for(let p of u.interfaces)l.interfaces.add(p)}for(let[c,u]of this.shareableErrorTypeNames){let l=(0,Je.getOrThrowError)(this.parents,c,Pt.PARENTS);if(l.kind!==ce.Kind.OBJECT_TYPE_DEFINITION)throw(0,ke.incompatibleParentKindFatalError)(c,ce.Kind.OBJECT_TYPE_DEFINITION,l.kind);this.errors.push((0,ke.shareableFieldDefinitionsError)(l,u))}let r=[];for(let[c,u]of this.parents)switch(u.kind){case ce.Kind.ENUM_TYPE_DEFINITION:let l=[],p=this.getEnumMergeMethod(c);for(let w of u.values.values())switch((0,Et.pushPersistedDirectivesAndGetNode)(w),p){case Un.MergeMethod.CONSISTENT:w.appearances0?r.push(u):n.push(u.node),y.length<1&&this.errors.push((0,ke.allFieldDefinitionsAreInaccessibleError)("interface",c));break;case ce.Kind.OBJECT_TYPE_DEFINITION:let N=[];for(let w of u.fields.values())(0,Un.isFieldInaccessible)(w)||N.push(this.getMergedFieldDefinitionNode(w,c));u.node.fields=N,(0,Et.pushPersistedDirectivesAndGetNode)(u),u.interfaces.size>0?r.push(u):n.push(u.node),N.length<1&&((0,vx.isNodeQuery)(c)?this.errors.push(ke.noQueryRootTypeError):this.errors.push((0,ke.allFieldDefinitionsAreInaccessibleError)("object",c)));break;case ce.Kind.SCALAR_TYPE_DEFINITION:rl.BASE_SCALARS.has(c)||n.push((0,Et.pushPersistedDirectivesAndGetNode)(u));break;case ce.Kind.UNION_TYPE_DEFINITION:let O=[];for(let w of u.members)O.push((0,Et.stringToNamedTypeNode)(w));u.node.types=O,n.push((0,Et.pushPersistedDirectivesAndGetNode)(u));break}for(let c of r)c.node.interfaces=this.getAndValidateImplementedInterfaces(c),n.push(c.node);let i=this.parents.get(Pt.QUERY);if((!i||i.kind!==ce.Kind.OBJECT_TYPE_DEFINITION||i.fields.size<1)&&this.errors.push(ke.noQueryRootTypeError),this.errors.length>0)return{errors:this.errors};for(let c of Pt.ROOT_TYPES){let u=this.parents.get(c);if(!u||u.kind!==ce.Kind.OBJECT_TYPE_DEFINITION)continue;if(this.errors.length>0)break;let l=new Set(rl.BASE_SCALARS);for(let[p,h]of u.fields){let y=h.namedTypeName;if(l.has(y)||!this.shouldEvaluateObjectLike(h.subgraphNames,y))continue;let N=(0,Je.getOrThrowError)(this.parents,y,Pt.PARENTS),O=`${c}.${p}`,w={fieldName:p,fieldTypeNodeString:(0,pf.printTypeNode)(h.node.type),path:O,typeName:c,subgraphs:h.subgraphNames};switch(N.kind){case ce.Kind.ENUM_TYPE_DEFINITION:case ce.Kind.SCALAR_TYPE_DEFINITION:l.add(y);continue;case ce.Kind.OBJECT_TYPE_DEFINITION:this.evaluateResolvabilityOfObject(N,w,O,new Set,this.entityContainersByTypeName.has(y)?[y]:[]);continue;case ce.Kind.INTERFACE_TYPE_DEFINITION:case ce.Kind.UNION_TYPE_DEFINITION:this.evaluateResolvabilityOfAbstractType(y,N.kind,w,O,new Set,this.entityContainersByTypeName.has(y)?[y]:[]);continue;default:this.errors.push((0,ke.unexpectedObjectResponseType)(O,(0,Je.kindToTypeString)(N.kind)))}}}let o=this.warnings.length>0?this.warnings:void 0;if(this.errors.length>0)return{errors:this.errors,warnings:o};let s={kind:ce.Kind.DOCUMENT,definitions:n},a=new Map;for(let c of this.internalSubgraphBySubgraphName.values())a.set(c.name,{configurationDataMap:c.configurationDataMap,schema:c.schema});for(let c of this.authorizationDataByParentTypeName.values())(0,Je.upsertAuthorizationConfiguration)(this.fieldConfigurationByFieldPath,c);return{federationResult:{fieldConfigurations:Array.from(this.fieldConfigurationByFieldPath.values()),subgraphConfigBySubgraphName:a,federatedGraphAST:s,federatedGraphSchema:(0,ce.buildASTSchema)(s)},warnings:o}}};il.FederationFactory=TT;function AX(e){if(e.length<1)return{errors:[ke.minimumSubgraphRequirementError]};let{authorizationDataByParentTypeName:t,entityContainerByTypeName:n,errors:r,internalSubgraphBySubgraphName:i,warnings:o}=(0,DX.batchNormalize)(e);if(r)return{errors:r};let s=new Map,a=new Map,c=new Set;for(let[u,l]of i)for(let[p,h]of l.entityInterfaces){(0,Je.getValueOrDefault)(a,p,()=>[]).push({subgraphName:u,concreteTypeNames:h.concreteTypeNames||new Set});let N=s.get(p);if(!N){c.add(p),s.set(p,(0,Je.newEntityInterfaceFederationData)(h,u));continue}(0,Je.upsertEntityInterfaceFederationData)(N,h,u)&&c.delete(p)}for(let u of c)a.delete(u);return a.size>0?{errors:[(0,ke.undefinedEntityInterfaceImplementationsError)(a,s)]}:new TT(t,n,s,i,o).federate()}il.federateSubgraphs=AX});var _x=F(bx=>{"use strict";d();m();f();Object.defineProperty(bx,"__esModule",{value:!0})});var Ox=F(fr=>{"use strict";d();m();f();var wX=fr&&fr.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Ro=fr&&fr.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&wX(t,e,n)};Object.defineProperty(fr,"__esModule",{value:!0});Ro(Vp(),fr);Ro(eo(),fr);Ro(Yo(),fr);Ro(Ix(),fr);Ro(Sm(),fr);Ro(u_(),fr);Ro(_x(),fr);Ro(Pm(),fr);Ro(mc(),fr);Ro(za(),fr)});var EH={};ml(EH,{buildRouterConfiguration:()=>TH,federateSubgraphs:()=>yH});d();m();f();var FO=Lf(Ox());d();m();f();d();m();f();function rO(e){if(!e)return e;let t=new URL(e),n=t.pathname;n.endsWith("/")&&(n=n.slice(0,-1));let r=t.port?`:${t.port}`:"";return`${t.protocol}//${t.hostname}${r}${n}`}d();m();f();d();m();f();var Sx={};d();m();f();function Dx(e){return e!=null}d();m();f();d();m();f();he();d();m();f();var Ax;if(typeof AggregateError=="undefined"){class e extends Error{constructor(n,r=""){super(r),this.errors=n,this.name="AggregateError",Error.captureStackTrace(this,e)}}Ax=function(t,n){return new e(t,n)}}else Ax=AggregateError;function wx(e){return"errors"in e&&Array.isArray(e.errors)}var Fx=3;function kx(e){return ET(e,[])}function ET(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return RX(e,t);default:return String(e)}}function Rx(e){return e instanceof j?e.toString():`${e.name}: ${e.message}; - ${e.stack}`}function RX(e,t){if(e===null)return"null";if(e instanceof Error)return wx(e)?Rx(e)+` -`+Lx(e.errors,t):Rx(e);if(t.includes(e))return"[Circular]";let n=[...t,e];if(LX(e)){let r=e.toJSON();if(r!==e)return typeof r=="string"?r:ET(r,n)}else if(Array.isArray(e))return Lx(e,n);return FX(e,n)}function LX(e){return typeof e.toJSON=="function"}function FX(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>Fx?"["+kX(e)+"]":"{ "+n.map(([i,o])=>i+": "+ET(o,t)).join(", ")+" }"}function Lx(e,t){if(e.length===0)return"[]";if(t.length>Fx)return"[Array]";let n=e.length,r=[];for(let i=0;in==null?n:n[r],e==null?void 0:e.extensions)}d();m();f();he();d();m();f();he();function Lo(e){if(Oe(e)){let t=Lo(e.ofType);if(t.kind===b.NON_NULL_TYPE)throw new Error(`Invalid type node ${kx(e)}. Inner type of non-null type cannot be a non-null type.`);return{kind:b.NON_NULL_TYPE,type:t}}else if(tt(e))return{kind:b.LIST_TYPE,type:Lo(e.ofType)};return{kind:b.NAMED_TYPE,name:{kind:b.NAME,value:e.name}}}d();m();f();he();function gT(e){if(e===null)return{kind:b.NULL};if(e===void 0)return null;if(Array.isArray(e)){let t=[];for(let n of e){let r=gT(n);r!=null&&t.push(r)}return{kind:b.LIST,values:t}}if(typeof e=="object"){let t=[];for(let n in e){let r=e[n],i=gT(r);i&&t.push({kind:b.OBJECT_FIELD,name:{kind:b.NAME,value:n},value:i})}return{kind:b.OBJECT,fields:t}}if(typeof e=="boolean")return{kind:b.BOOLEAN,value:e};if(typeof e=="number"&&isFinite(e)){let t=String(e);return PX.test(t)?{kind:b.INT,value:t}:{kind:b.FLOAT,value:t}}if(typeof e=="string")return{kind:b.STRING,value:e};throw new TypeError(`Cannot convert value to AST: ${e}.`)}var PX=/^-?(?:0|[1-9][0-9]*)$/;d();m();f();d();m();f();function vT(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}}var qRe=vT(function(t){let n=xX(t);return new Set([...n].map(r=>r.name))}),xX=vT(function(t){let n=iO(t);return new Set(n.values())}),iO=vT(function(t){let n=new Map,r=t.getQueryType();r&&n.set("query",r);let i=t.getMutationType();i&&n.set("mutation",i);let o=t.getSubscriptionType();return o&&n.set("subscription",o),n});function CX(e,t={}){let n=t.pathToDirectivesInExtensions,r=e.getTypeMap(),i=MX(e,n),o=i!=null?[i]:[],s=e.getDirectives();for(let a of s)ta(a)||o.push(UX(a,e,n));for(let a in r){let c=r[a],u=wi(c),l=sr(c);if(!(u||l))if(Ue(c))o.push(jX(c,e,n));else if(ze(c))o.push(VX(c,e,n));else if(At(c))o.push($X(c,e,n));else if(He(c))o.push(GX(c,e,n));else if(gt(c))o.push(qX(c,e,n));else if(sn(c))o.push(BX(c,e,n));else throw new Error(`Unknown type ${c}.`)}return{kind:b.DOCUMENT,definitions:o}}function Px(e,t={}){let n=CX(e,t);return Ze(n)}function MX(e,t){var n,r;let i=new Map([["query",void 0],["mutation",void 0],["subscription",void 0]]),o=[];if(e.astNode!=null&&o.push(e.astNode),e.extensionASTNodes!=null)for(let l of e.extensionASTNodes)o.push(l);for(let l of o)if(l.operationTypes)for(let p of l.operationTypes)i.set(p.operation,p);let s=iO(e);for(let[l,p]of i){let h=s.get(l);if(h!=null){let y=Lo(h);p!=null?p.type=y:i.set(l,{kind:b.OPERATION_TYPE_DEFINITION,operation:l,type:y})}}let a=[...i.values()].filter(Dx),c=ol(e,e,t);if(!a.length&&!c.length)return null;let u={kind:a!=null?b.SCHEMA_DEFINITION:b.SCHEMA_EXTENSION,operationTypes:a,directives:c};return u.description=((r=(n=e.astNode)===null||n===void 0?void 0:n.description)!==null&&r!==void 0?r:e.description!=null)?{kind:b.STRING,value:e.description,block:!0}:void 0,u}function UX(e,t,n){var r,i,o,s;return{kind:b.DIRECTIVE_DEFINITION,description:(i=(r=e.astNode)===null||r===void 0?void 0:r.description)!==null&&i!==void 0?i:e.description?{kind:b.STRING,value:e.description}:void 0,name:{kind:b.NAME,value:e.name},arguments:(o=e.args)===null||o===void 0?void 0:o.map(a=>xx(a,t,n)),repeatable:e.isRepeatable,locations:((s=e.locations)===null||s===void 0?void 0:s.map(a=>({kind:b.NAME,value:a})))||[]}}function ol(e,t,n){let r=NT(e,n),i=[];e.astNode!=null&&i.push(e.astNode),"extensionASTNodes"in e&&e.extensionASTNodes!=null&&(i=i.concat(e.extensionASTNodes));let o;if(r!=null)o=oO(t,r);else{o=[];for(let s of i)s.directives&&o.push(...s.directives)}return o}function bT(e,t,n){var r,i;let o=[],s=null,a=NT(e,n),c;return a!=null?c=oO(t,a):c=(r=e.astNode)===null||r===void 0?void 0:r.directives,c!=null&&(o=c.filter(u=>u.name.value!=="deprecated"),e.deprecationReason!=null&&(s=(i=c.filter(u=>u.name.value==="deprecated"))===null||i===void 0?void 0:i[0])),e.deprecationReason!=null&&s==null&&(s=YX(e.deprecationReason)),s==null?o:[s].concat(o)}function xx(e,t,n){var r,i,o;return{kind:b.INPUT_VALUE_DEFINITION,description:(i=(r=e.astNode)===null||r===void 0?void 0:r.description)!==null&&i!==void 0?i:e.description?{kind:b.STRING,value:e.description,block:!0}:void 0,name:{kind:b.NAME,value:e.name},type:Lo(e.type),defaultValue:e.defaultValue!==void 0&&(o=Xn(e.defaultValue,e.type))!==null&&o!==void 0?o:void 0,directives:bT(e,t,n)}}function jX(e,t,n){var r,i;return{kind:b.OBJECT_TYPE_DEFINITION,description:(i=(r=e.astNode)===null||r===void 0?void 0:r.description)!==null&&i!==void 0?i:e.description?{kind:b.STRING,value:e.description,block:!0}:void 0,name:{kind:b.NAME,value:e.name},fields:Object.values(e.getFields()).map(o=>Cx(o,t,n)),interfaces:Object.values(e.getInterfaces()).map(o=>Lo(o)),directives:ol(e,t,n)}}function VX(e,t,n){var r,i;let o={kind:b.INTERFACE_TYPE_DEFINITION,description:(i=(r=e.astNode)===null||r===void 0?void 0:r.description)!==null&&i!==void 0?i:e.description?{kind:b.STRING,value:e.description,block:!0}:void 0,name:{kind:b.NAME,value:e.name},fields:Object.values(e.getFields()).map(s=>Cx(s,t,n)),directives:ol(e,t,n)};return"getInterfaces"in e&&(o.interfaces=Object.values(e.getInterfaces()).map(s=>Lo(s))),o}function $X(e,t,n){var r,i;return{kind:b.UNION_TYPE_DEFINITION,description:(i=(r=e.astNode)===null||r===void 0?void 0:r.description)!==null&&i!==void 0?i:e.description?{kind:b.STRING,value:e.description,block:!0}:void 0,name:{kind:b.NAME,value:e.name},directives:ol(e,t,n),types:e.getTypes().map(o=>Lo(o))}}function GX(e,t,n){var r,i;return{kind:b.INPUT_OBJECT_TYPE_DEFINITION,description:(i=(r=e.astNode)===null||r===void 0?void 0:r.description)!==null&&i!==void 0?i:e.description?{kind:b.STRING,value:e.description,block:!0}:void 0,name:{kind:b.NAME,value:e.name},fields:Object.values(e.getFields()).map(o=>KX(o,t,n)),directives:ol(e,t,n)}}function qX(e,t,n){var r,i;return{kind:b.ENUM_TYPE_DEFINITION,description:(i=(r=e.astNode)===null||r===void 0?void 0:r.description)!==null&&i!==void 0?i:e.description?{kind:b.STRING,value:e.description,block:!0}:void 0,name:{kind:b.NAME,value:e.name},values:Object.values(e.getValues()).map(o=>QX(o,t,n)),directives:ol(e,t,n)}}function BX(e,t,n){var r,i,o;let s=NT(e,n),a=s?oO(t,s):((r=e.astNode)===null||r===void 0?void 0:r.directives)||[],c=e.specifiedByUrl||e.specifiedByURL;if(c&&!a.some(u=>u.name.value==="specifiedBy")){let u={url:c};a.push(IT("specifiedBy",u))}return{kind:b.SCALAR_TYPE_DEFINITION,description:(o=(i=e.astNode)===null||i===void 0?void 0:i.description)!==null&&o!==void 0?o:e.description?{kind:b.STRING,value:e.description,block:!0}:void 0,name:{kind:b.NAME,value:e.name},directives:a}}function Cx(e,t,n){var r,i;return{kind:b.FIELD_DEFINITION,description:(i=(r=e.astNode)===null||r===void 0?void 0:r.description)!==null&&i!==void 0?i:e.description?{kind:b.STRING,value:e.description,block:!0}:void 0,name:{kind:b.NAME,value:e.name},arguments:e.args.map(o=>xx(o,t,n)),type:Lo(e.type),directives:bT(e,t,n)}}function KX(e,t,n){var r,i,o;return{kind:b.INPUT_VALUE_DEFINITION,description:(i=(r=e.astNode)===null||r===void 0?void 0:r.description)!==null&&i!==void 0?i:e.description?{kind:b.STRING,value:e.description,block:!0}:void 0,name:{kind:b.NAME,value:e.name},type:Lo(e.type),directives:bT(e,t,n),defaultValue:(o=Xn(e.defaultValue,e.type))!==null&&o!==void 0?o:void 0}}function QX(e,t,n){var r,i;return{kind:b.ENUM_VALUE_DEFINITION,description:(i=(r=e.astNode)===null||r===void 0?void 0:r.description)!==null&&i!==void 0?i:e.description?{kind:b.STRING,value:e.description,block:!0}:void 0,name:{kind:b.NAME,value:e.name},directives:bT(e,t,n)}}function YX(e){return IT("deprecated",{reason:e},zi)}function IT(e,t,n){let r=[];if(n!=null)for(let i of n.args){let o=i.name,s=t[o];if(s!==void 0){let a=Xn(s,i.type);a&&r.push({kind:b.ARGUMENT,name:{kind:b.NAME,value:o},value:a})}}else for(let i in t){let o=t[i],s=gT(o);s&&r.push({kind:b.ARGUMENT,name:{kind:b.NAME,value:i},value:s})}return{kind:b.DIRECTIVE,name:{kind:b.NAME,value:e},arguments:r}}function oO(e,t){let n=[];for(let r in t){let i=t[r],o=e==null?void 0:e.getDirective(r);if(Array.isArray(i))for(let s of i)n.push(IT(r,s,o));else n.push(IT(r,i,o))}return n}he();d();m();f();d();m();f();d();m();f();d();m();f();d();m();f();d();m();f();function An(e,t){if(!e)throw new Error(t)}var JX=34028234663852886e22,zX=-34028234663852886e22,XX=4294967295,HX=2147483647,WX=-2147483648;function sl(e){if(typeof e!="number")throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>HX||eXX||e<0)throw new Error("invalid uint 32: "+e)}function _T(e){if(typeof e!="number")throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>JX||e({no:i.no,name:i.name,localName:e[i.no]})),r)}function aO(e,t,n){let r=Object.create(null),i=Object.create(null),o=[];for(let s of t){let a=Vx(s);o.push(a),r[s.name]=a,i[s.no]=a}return{typeName:e,values:o,findName(s){return r[s]},findNumber(s){return i[s]}}}function jx(e,t,n){let r={};for(let i of t){let o=Vx(i);r[o.localName]=o.no,r[o.no]=o.localName}return sO(r,e,t,n),r}function Vx(e){return"localName"in e?e:Object.assign(Object.assign({},e),{localName:e.name})}d();m();f();d();m();f();var Be=class{equals(t){return this.getType().runtime.util.equals(this.getType(),this,t)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(t,n){let r=this.getType(),i=r.runtime.bin,o=i.makeReadOptions(n);return i.readMessage(this,o.readerFactory(t),t.byteLength,o),this}fromJson(t,n){let r=this.getType(),i=r.runtime.json,o=i.makeReadOptions(n);return i.readMessage(r,t,o,this),this}fromJsonString(t,n){let r;try{r=JSON.parse(t)}catch(i){throw new Error(`cannot decode ${this.getType().typeName} from JSON: ${i instanceof Error?i.message:String(i)}`)}return this.fromJson(r,n)}toBinary(t){let n=this.getType(),r=n.runtime.bin,i=r.makeWriteOptions(t),o=i.writerFactory();return r.writeMessage(this,o,i),o.finish()}toJson(t){let n=this.getType(),r=n.runtime.json,i=r.makeWriteOptions(t);return r.writeMessage(this,i)}toJsonString(t){var n;let r=this.toJson(t);return JSON.stringify(r,null,(n=t==null?void 0:t.prettySpaces)!==null&&n!==void 0?n:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}};function $x(e,t,n,r){var i;let o=(i=r==null?void 0:r.localName)!==null&&i!==void 0?i:t.substring(t.lastIndexOf(".")+1),s={[o]:function(a){e.util.initFields(this),e.util.initPartial(a,this)}}[o];return Object.setPrototypeOf(s.prototype,new Be),Object.assign(s,{runtime:e,typeName:t,fields:e.util.newFieldList(n),fromBinary(a,c){return new s().fromBinary(a,c)},fromJson(a,c){return new s().fromJson(a,c)},fromJsonString(a,c){return new s().fromJsonString(a,c)},equals(a,c){return e.util.equals(s,a,c)}}),s}function Gx(e,t,n,r){return{syntax:e,json:t,bin:n,util:r,makeMessageType(i,o,s){return $x(this,i,o,s)},makeEnum:jx,makeEnumType:aO,getEnumType:Ux}}d();m();f();d();m();f();var Z;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(Z||(Z={}));var Fo;(function(e){e[e.BIGINT=0]="BIGINT",e[e.STRING=1]="STRING"})(Fo||(Fo={}));d();m();f();d();m();f();d();m();f();function Bx(){let e=0,t=0;for(let r=0;r<28;r+=7){let i=this.buf[this.pos++];if(e|=(i&127)<>4,!(n&128))return this.assertBounds(),[e,t];for(let r=3;r<=31;r+=7){let i=this.buf[this.pos++];if(t|=(i&127)<>>o,a=!(!(s>>>7)&&t==0),c=(a?s|128:s)&255;if(n.push(c),!a)return}let r=e>>>28&15|(t&7)<<4,i=!!(t>>3);if(n.push((i?r|128:r)&255),!!i){for(let o=3;o<31;o=o+7){let s=t>>>o,a=!!(s>>>7),c=(a?s|128:s)&255;if(n.push(c),!a)return}n.push(t>>>31&1)}}var OT=4294967296;function uO(e){let t=e[0]==="-";t&&(e=e.slice(1));let n=1e6,r=0,i=0;function o(s,a){let c=Number(e.slice(s,a));i*=n,r=r*n+c,r>=OT&&(i=i+(r/OT|0),r=r%OT)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),t?Qx(r,i):lO(r,i)}function Kx(e,t){let n=lO(e,t),r=n.hi&2147483648;r&&(n=Qx(n.lo,n.hi));let i=cO(n.lo,n.hi);return r?"-"+i:i}function cO(e,t){if({lo:e,hi:t}=ZX(e,t),t<=2097151)return String(OT*t+e);let n=e&16777215,r=(e>>>24|t<<8)&16777215,i=t>>16&65535,o=n+r*6777216+i*6710656,s=r+i*8147497,a=i*2,c=1e7;return o>=c&&(s+=Math.floor(o/c),o%=c),s>=c&&(a+=Math.floor(s/c),s%=c),a.toString()+qx(s)+qx(o)}function ZX(e,t){return{lo:e>>>0,hi:t>>>0}}function lO(e,t){return{lo:e|0,hi:t|0}}function Qx(e,t){return t=~t,e?e=~e+1:t+=1,lO(e,t)}var qx=e=>{let t=String(e);return"0000000".slice(t.length)+t};function pO(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e=e>>7;t.push(1)}}function Yx(){let e=this.buf[this.pos++],t=e&127;if(!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let n=5;e&128&&n<10;n++)e=this.buf[this.pos++];if(e&128)throw new Error("invalid varint");return this.assertBounds(),t>>>0}d();m();f();function eH(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(typeof g!="object"||typeof g.env!="object"||g.env.BUF_BIGINT_DISABLE!=="1")){let i=BigInt("-9223372036854775808"),o=BigInt("9223372036854775807"),s=BigInt("0"),a=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(c){let u=typeof c=="bigint"?c:BigInt(c);if(u>o||ua||uAn(/^-?[0-9]+$/.test(i),`int64 invalid: ${i}`),r=i=>An(/^[0-9]+$/.test(i),`uint64 invalid: ${i}`);return{zero:"0",supported:!1,parse(i){return typeof i!="string"&&(i=i.toString()),n(i),i},uParse(i){return typeof i!="string"&&(i=i.toString()),r(i),i},enc(i){return typeof i!="string"&&(i=i.toString()),n(i),uO(i)},uEnc(i){return typeof i!="string"&&(i=i.toString()),r(i),uO(i)},dec(i,o){return Kx(i,o)},uDec(i,o){return cO(i,o)}}}var ln=eH();var pn;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(pn||(pn={}));var DT=class{constructor(t){this.stack=[],this.textEncoder=t!=null?t:new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let t=0;for(let i=0;i>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(df(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return sl(t),pO(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let n=this.textEncoder.encode(t);return this.uint32(n.byteLength),this.raw(n)}float(t){_T(t);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,t,!0),this.raw(n)}double(t){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,t,!0),this.raw(n)}fixed32(t){df(t);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t,!0),this.raw(n)}sfixed32(t){sl(t);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,t,!0),this.raw(n)}sint32(t){return sl(t),t=(t<<1^t>>31)>>>0,pO(t,this.buf),this}sfixed64(t){let n=new Uint8Array(8),r=new DataView(n.buffer),i=ln.enc(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}fixed64(t){let n=new Uint8Array(8),r=new DataView(n.buffer),i=ln.uEnc(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}int64(t){let n=ln.enc(t);return ST(n.lo,n.hi,this.buf),this}sint64(t){let n=ln.enc(t),r=n.hi>>31,i=n.lo<<1^r,o=(n.hi<<1|n.lo>>>31)^r;return ST(i,o,this.buf),this}uint64(t){let n=ln.uEnc(t);return ST(n.lo,n.hi,this.buf),this}},AT=class{constructor(t,n){this.varint64=Bx,this.uint32=Yx,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.textDecoder=n!=null?n:new TextDecoder}tag(){let t=this.uint32(),n=t>>>3,r=t&7;if(n<=0||r<0||r>5)throw new Error("illegal tag: field no "+n+" wire type "+r);return[n,r]}skip(t){let n=this.pos;switch(t){case pn.Varint:for(;this.buf[this.pos++]&128;);break;case pn.Bit64:this.pos+=4;case pn.Bit32:this.pos+=4;break;case pn.LengthDelimited:let r=this.uint32();this.pos+=r;break;case pn.StartGroup:let i;for(;(i=this.tag()[1])!==pn.EndGroup;)this.skip(i);break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return ln.dec(...this.varint64())}uint64(){return ln.uDec(...this.varint64())}sint64(){let[t,n]=this.varint64(),r=-(t&1);return t=(t>>>1|(n&1)<<31)^r,n=n>>>1^r,ln.dec(t,n)}bool(){let[t,n]=this.varint64();return t!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return ln.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return ln.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),n=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(n,n+t)}string(){return this.textDecoder.decode(this.bytes())}};d();m();f();function ff(e,t){return t instanceof Be||!e.fieldWrapper?t:e.fieldWrapper.wrapField(t)}var HLe={"google.protobuf.DoubleValue":Z.DOUBLE,"google.protobuf.FloatValue":Z.FLOAT,"google.protobuf.Int64Value":Z.INT64,"google.protobuf.UInt64Value":Z.UINT64,"google.protobuf.Int32Value":Z.INT32,"google.protobuf.UInt32Value":Z.UINT32,"google.protobuf.BoolValue":Z.BOOL,"google.protobuf.StringValue":Z.STRING,"google.protobuf.BytesValue":Z.BYTES};d();m();f();function ss(e,t,n){if(t===n)return!0;if(e==Z.BYTES){if(!(t instanceof Uint8Array)||!(n instanceof Uint8Array)||t.length!==n.length)return!1;for(let r=0;rnew AT(e)},zx={writeUnknownFields:!0,writerFactory:()=>new DT};function tH(e){return e?Object.assign(Object.assign({},Jx),e):Jx}function nH(e){return e?Object.assign(Object.assign({},zx),e):zx}function Xx(){return{makeReadOptions:tH,makeWriteOptions:nH,listUnknownFields(e){var t;return(t=e[al])!==null&&t!==void 0?t:[]},discardUnknownFields(e){delete e[al]},writeUnknownFields(e,t){let r=e[al];if(r)for(let i of r)t.tag(i.no,i.wireType).raw(i.data)},onUnknownField(e,t,n,r){let i=e;Array.isArray(i[al])||(i[al]=[]),i[al].push({no:t,wireType:n,data:r})},readMessage(e,t,n,r){let i=e.getType(),o=n===void 0?t.len:t.pos+n;for(;t.pos0&&(y=iH),l){let M=u[p];if(a==pn.LengthDelimited&&h!=Z.STRING&&h!=Z.BYTES){let W=t.uint32()+t.pos;for(;t.pos>4,s=o,i=2;break;case 2:n[r++]=(s&15)<<4|(o&60)>>2,s=o,i=3;break;case 3:n[r++]=(s&3)<<6|o,i=0;break}}if(i==1)throw Error("invalid base64 string.");return n.subarray(0,r)},enc(e){let t="",n=0,r,i=0;for(let o=0;o>2],i=(r&3)<<4,n=1;break;case 1:t+=as[i|r>>4],i=(r&15)<<2,n=2;break;case 2:t+=as[i|r>>6],t+=as[r&63],n=0;break}return n&&(t+=as[i],t+="=",n==1&&(t+="=")),t}};var eC={ignoreUnknownFields:!1},tC={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function oH(e){return e?Object.assign(Object.assign({},eC),e):eC}function sH(e){return e?Object.assign(Object.assign({},tC),e):tC}function rC(e){let t=e(aH,nC);return{makeReadOptions:oH,makeWriteOptions:sH,readMessage(n,r,i,o){if(r==null||Array.isArray(r)||typeof r!="object")throw new Error(`cannot decode message ${n.typeName} from JSON: ${this.debug(r)}`);o=o!=null?o:new n;let s={};for(let[a,c]of Object.entries(r)){let u=n.fields.findJsonName(a);if(!u){if(!i.ignoreUnknownFields)throw new Error(`cannot decode message ${n.typeName} from JSON: key "${a}" is unknown`);continue}let l=u.localName,p=o;if(u.oneof){if(c===null&&u.kind=="scalar")continue;let h=s[u.oneof.localName];if(h)throw new Error(`cannot decode message ${n.typeName} from JSON: multiple keys for oneof "${u.oneof.name}" present: "${h}", "${a}"`);s[u.oneof.localName]=a,p=p[u.oneof.localName]={case:l},l="value"}if(u.repeated){if(c===null)continue;if(!Array.isArray(c))throw new Error(`cannot decode field ${n.typeName}.${u.name} from JSON: ${this.debug(c)}`);let h=p[l];for(let y of c){if(y===null)throw new Error(`cannot decode field ${n.typeName}.${u.name} from JSON: ${this.debug(y)}`);let N;switch(u.kind){case"message":N=u.T.fromJson(y,i);break;case"enum":if(N=mO(u.T,y,i.ignoreUnknownFields),N===void 0)continue;break;case"scalar":try{N=hf(u.T,y,u.L)}catch(O){let w=`cannot decode field ${n.typeName}.${u.name} from JSON: ${this.debug(y)}`;throw O instanceof Error&&O.message.length>0&&(w+=`: ${O.message}`),new Error(w)}break}h.push(N)}}else if(u.kind=="map"){if(c===null)continue;if(Array.isArray(c)||typeof c!="object")throw new Error(`cannot decode field ${n.typeName}.${u.name} from JSON: ${this.debug(c)}`);let h=p[l];for(let[y,N]of Object.entries(c)){if(N===null)throw new Error(`cannot decode field ${n.typeName}.${u.name} from JSON: map value null`);let O;switch(u.V.kind){case"message":O=u.V.T.fromJson(N,i);break;case"enum":if(O=mO(u.V.T,N,i.ignoreUnknownFields),O===void 0)continue;break;case"scalar":try{O=hf(u.V.T,N,Fo.BIGINT)}catch(w){let M=`cannot decode map value for field ${n.typeName}.${u.name} from JSON: ${this.debug(c)}`;throw w instanceof Error&&w.message.length>0&&(M+=`: ${w.message}`),new Error(M)}break}try{h[hf(u.K,u.K==Z.BOOL?y=="true"?!0:y=="false"?!1:y:y,Fo.BIGINT).toString()]=O}catch(w){let M=`cannot decode map key for field ${n.typeName}.${u.name} from JSON: ${this.debug(c)}`;throw w instanceof Error&&w.message.length>0&&(M+=`: ${w.message}`),new Error(M)}}}else switch(u.kind){case"message":let h=u.T;if(c===null&&h.typeName!="google.protobuf.Value"){if(u.oneof)throw new Error(`cannot decode field ${n.typeName}.${u.name} from JSON: null is invalid for oneof field "${a}"`);continue}p[l]instanceof Be?p[l].fromJson(c,i):(p[l]=h.fromJson(c,i),h.fieldWrapper&&!u.oneof&&(p[l]=h.fieldWrapper.unwrapField(p[l])));break;case"enum":let y=mO(u.T,c,i.ignoreUnknownFields);y!==void 0&&(p[l]=y);break;case"scalar":try{p[l]=hf(u.T,c,u.L)}catch(N){let O=`cannot decode field ${n.typeName}.${u.name} from JSON: ${this.debug(c)}`;throw N instanceof Error&&N.message.length>0&&(O+=`: ${N.message}`),new Error(O)}break}}return o},writeMessage(n,r){let i=n.getType(),o={},s;try{for(let a of i.fields.byMember()){let c;if(a.kind=="oneof"){let u=n[a.localName];if(u.value===void 0)continue;if(s=a.findField(u.case),!s)throw"oneof case not found: "+u.case;c=t(s,u.value,r)}else s=a,c=t(s,n[s.localName],r);c!==void 0&&(o[r.useProtoFieldName?s.name:s.jsonName]=c)}}catch(a){let c=s?`cannot encode field ${i.typeName}.${s.name} to JSON`:`cannot encode message ${i.typeName} to JSON`,u=a instanceof Error?a.message:String(a);throw new Error(c+(u.length>0?`: ${u}`:""))}return o},readScalar:hf,writeScalar:nC,debug:iC}}function iC(e){if(e===null)return"null";switch(typeof e){case"object":return Array.isArray(e)?"array":"object";case"string":return e.length>100?"string":`"${e.split('"').join('\\"')}"`;default:return String(e)}}function hf(e,t,n){switch(e){case Z.DOUBLE:case Z.FLOAT:if(t===null)return 0;if(t==="NaN")return Number.NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(t===""||typeof t=="string"&&t.trim().length!==t.length||typeof t!="string"&&typeof t!="number")break;let r=Number(t);if(Number.isNaN(r)||!Number.isFinite(r))break;return e==Z.FLOAT&&_T(r),r;case Z.INT32:case Z.FIXED32:case Z.SFIXED32:case Z.SINT32:case Z.UINT32:if(t===null)return 0;let i;if(typeof t=="number"?i=t:typeof t=="string"&&t.length>0&&t.trim().length===t.length&&(i=Number(t)),i===void 0)break;return e==Z.UINT32?df(i):sl(i),i;case Z.INT64:case Z.SFIXED64:case Z.SINT64:if(t===null)return ln.zero;if(typeof t!="number"&&typeof t!="string")break;let o=ln.parse(t);return n?o.toString():o;case Z.FIXED64:case Z.UINT64:if(t===null)return ln.zero;if(typeof t!="number"&&typeof t!="string")break;let s=ln.uParse(t);return n?s.toString():s;case Z.BOOL:if(t===null)return!1;if(typeof t!="boolean")break;return t;case Z.STRING:if(t===null)return"";if(typeof t!="string")break;try{encodeURIComponent(t)}catch(a){throw new Error("invalid UTF8")}return t;case Z.BYTES:if(t===null||t==="")return new Uint8Array(0);if(typeof t!="string")break;return fO.dec(t)}throw new Error}function mO(e,t,n){if(t===null)return 0;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":let r=e.findName(t);if(r||n)return r==null?void 0:r.no;break}throw new Error(`cannot decode enum ${e.typeName} from JSON: ${iC(t)}`)}function aH(e,t,n,r){var i;if(t===void 0)return t;if(t===0&&!n)return;if(r)return t;if(e.typeName=="google.protobuf.NullValue")return null;let o=e.findNumber(t);return(i=o==null?void 0:o.name)!==null&&i!==void 0?i:t}function nC(e,t,n){if(t!==void 0)switch(e){case Z.INT32:case Z.SFIXED32:case Z.SINT32:case Z.FIXED32:case Z.UINT32:return An(typeof t=="number"),t!=0||n?t:void 0;case Z.FLOAT:case Z.DOUBLE:return An(typeof t=="number"),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t!==0||n?t:void 0;case Z.STRING:return An(typeof t=="string"),t.length>0||n?t:void 0;case Z.BOOL:return An(typeof t=="boolean"),t||n?t:void 0;case Z.UINT64:case Z.FIXED64:case Z.INT64:case Z.SFIXED64:case Z.SINT64:return An(typeof t=="bigint"||typeof t=="string"||typeof t=="number"),n||t!=0?t.toString(10):void 0;case Z.BYTES:return An(t instanceof Uint8Array),n||t.byteLength>0?fO.enc(t):void 0}}function oC(){return rC((e,t)=>function(r,i,o){if(r.kind=="map"){let s={};switch(r.V.kind){case"scalar":for(let[c,u]of Object.entries(i)){let l=t(r.V.T,u,!0);An(l!==void 0),s[c.toString()]=l}break;case"message":for(let[c,u]of Object.entries(i))s[c.toString()]=u.toJson(o);break;case"enum":let a=r.V.T;for(let[c,u]of Object.entries(i)){An(u===void 0||typeof u=="number");let l=e(a,u,!0,o.enumAsInteger);An(l!==void 0),s[c.toString()]=l}break}return o.emitDefaultValues||Object.keys(s).length>0?s:void 0}else if(r.repeated){let s=[];switch(r.kind){case"scalar":for(let a=0;a0?s:void 0}else switch(r.kind){case"scalar":return t(r.T,i,!!r.oneof||r.opt||o.emitDefaultValues);case"enum":return e(r.T,i,!!r.oneof||r.opt||o.emitDefaultValues,o.enumAsInteger);case"message":return i!==void 0?ff(r.T,i).toJson(o):void 0}})}d();m();f();function sC(){return{setEnumType:sO,initPartial(e,t){if(e===void 0)return;let n=t.getType();for(let r of n.fields.byMember()){let i=r.localName,o=t,s=e;if(s[i]!==void 0)switch(r.kind){case"oneof":let a=s[i].case;if(a===void 0)continue;let c=r.findField(a),u=s[i].value;c&&c.kind=="message"&&!(u instanceof c.T)?u=new c.T(u):c&&c.kind==="scalar"&&c.T===Z.BYTES&&(u=yf(u)),o[i]={case:a,value:u};break;case"scalar":case"enum":let l=s[i];r.T===Z.BYTES&&(l=r.repeated?l.map(yf):yf(l)),o[i]=l;break;case"map":switch(r.V.kind){case"scalar":case"enum":if(r.V.T===Z.BYTES)for(let[y,N]of Object.entries(s[i]))o[i][y]=yf(N);else Object.assign(o[i],s[i]);break;case"message":let h=r.V.T;for(let y of Object.keys(s[i])){let N=s[i][y];h.fieldWrapper||(N=new h(N)),o[i][y]=N}break}break;case"message":let p=r.T;if(r.repeated)o[i]=s[i].map(h=>h instanceof p?h:new p(h));else if(s[i]!==void 0){let h=s[i];p.fieldWrapper?p.typeName==="google.protobuf.BytesValue"?o[i]=yf(h):o[i]=h:o[i]=h instanceof p?h:new p(h)}break}}},equals(e,t,n){return t===n?!0:!t||!n?!1:e.fields.byMember().every(r=>{let i=t[r.localName],o=n[r.localName];if(r.repeated){if(i.length!==o.length)return!1;switch(r.kind){case"message":return i.every((s,a)=>r.T.equals(s,o[a]));case"scalar":return i.every((s,a)=>ss(r.T,s,o[a]));case"enum":return i.every((s,a)=>ss(Z.INT32,s,o[a]))}throw new Error(`repeated cannot contain ${r.kind}`)}switch(r.kind){case"message":return r.T.equals(i,o);case"enum":return ss(Z.INT32,i,o);case"scalar":return ss(r.T,i,o);case"oneof":if(i.case!==o.case)return!1;let s=r.findField(i.case);if(s===void 0)return!0;switch(s.kind){case"message":return s.T.equals(i.value,o.value);case"enum":return ss(Z.INT32,i.value,o.value);case"scalar":return ss(s.T,i.value,o.value)}throw new Error(`oneof cannot contain ${s.kind}`);case"map":let a=Object.keys(i).concat(Object.keys(o));switch(r.V.kind){case"message":let c=r.V.T;return a.every(l=>c.equals(i[l],o[l]));case"enum":return a.every(l=>ss(Z.INT32,i[l],o[l]));case"scalar":let u=r.V.T;return a.every(l=>ss(u,i[l],o[l]))}break}})},clone(e){let t=e.getType(),n=new t,r=n;for(let i of t.fields.byMember()){let o=e[i.localName],s;if(i.repeated)s=o.map(kT);else if(i.kind=="map"){s=r[i.localName];for(let[a,c]of Object.entries(o))s[a]=kT(c)}else i.kind=="oneof"?s=i.findField(o.case)?{case:o.case,value:kT(o.value)}:{case:void 0}:s=kT(o);r[i.localName]=s}return n}}}function kT(e){if(e===void 0)return e;if(e instanceof Be)return e.clone();if(e instanceof Uint8Array){let t=new Uint8Array(e.byteLength);return t.set(e),t}return e}function yf(e){return e instanceof Uint8Array?e:new Uint8Array(e)}d();m();f();var PT=class{constructor(t,n){this._fields=t,this._normalizer=n}findJsonName(t){if(!this.jsonNames){let n={};for(let r of this.list())n[r.jsonName]=n[r.name]=r;this.jsonNames=n}return this.jsonNames[t]}find(t){if(!this.numbers){let n={};for(let r of this.list())n[r.no]=r;this.numbers=n}return this.numbers[t]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((t,n)=>t.no-n.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];let t=this.members,n;for(let r of this.list())r.oneof?r.oneof!==n&&(n=r.oneof,t.push(n)):t.push(r)}return this.members}};d();m();f();d();m();f();function hO(e,t){let n=cC(e);return t?n:pH(lH(n))}function aC(e){return hO(e,!1)}var uC=cC;function cC(e){let t=!1,n=[];for(let r=0;r`${e}$`,lH=e=>cH.has(e)?lC(e):e,pH=e=>uH.has(e)?lC(e):e;var xT=class{constructor(t){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.default=void 0,this.fields=[],this.name=t,this.localName=aC(t)}addField(t){An(t.oneof===this,`field ${t.name} not one of ${this.name}`),this.fields.push(t)}findField(t){if(!this._lookup){this._lookup=Object.create(null);for(let n=0;n[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"routing_url",kind:"scalar",T:9}]));var TO=cs,ls=class ls extends Be{constructor(n){super();S(this,"engineConfig");S(this,"version","");S(this,"subgraphs",[]);V.util.initPartial(n,this)}static fromBinary(n,r){return new ls().fromBinary(n,r)}static fromJson(n,r){return new ls().fromJson(n,r)}static fromJsonString(n,r){return new ls().fromJsonString(n,r)}static equals(n,r){return V.util.equals(ls,n,r)}};S(ls,"runtime",V),S(ls,"typeName","wg.cosmo.node.v1.RouterConfig"),S(ls,"fields",V.util.newFieldList(()=>[{no:1,name:"engine_config",kind:"message",T:Ef},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"subgraphs",kind:"message",T:TO,repeated:!0}]));var Tf=ls,ps=class ps extends Be{constructor(n){super();S(this,"code",cl.OK);S(this,"details");V.util.initPartial(n,this)}static fromBinary(n,r){return new ps().fromBinary(n,r)}static fromJson(n,r){return new ps().fromJson(n,r)}static fromJsonString(n,r){return new ps().fromJsonString(n,r)}static equals(n,r){return V.util.equals(ps,n,r)}};S(ps,"runtime",V),S(ps,"typeName","wg.cosmo.node.v1.Response"),S(ps,"fields",V.util.newFieldList(()=>[{no:1,name:"code",kind:"enum",T:V.getEnumType(cl)},{no:2,name:"details",kind:"scalar",T:9,opt:!0}]));var CT=ps,ds=class ds extends Be{constructor(n){super();S(this,"code",0);S(this,"message","");V.util.initPartial(n,this)}static fromBinary(n,r){return new ds().fromBinary(n,r)}static fromJson(n,r){return new ds().fromJson(n,r)}static fromJsonString(n,r){return new ds().fromJsonString(n,r)}static equals(n,r){return V.util.equals(ds,n,r)}};S(ds,"runtime",V),S(ds,"typeName","wg.cosmo.node.v1.ResponseStatus"),S(ds,"fields",V.util.newFieldList(()=>[{no:1,name:"code",kind:"scalar",T:5},{no:2,name:"message",kind:"scalar",T:9}]));var pC=ds,fs=class fs extends Be{constructor(n){super();S(this,"graphName","");S(this,"version");V.util.initPartial(n,this)}static fromBinary(n,r){return new fs().fromBinary(n,r)}static fromJson(n,r){return new fs().fromJson(n,r)}static fromJsonString(n,r){return new fs().fromJsonString(n,r)}static equals(n,r){return V.util.equals(fs,n,r)}};S(fs,"runtime",V),S(fs,"typeName","wg.cosmo.node.v1.GetConfigRequest"),S(fs,"fields",V.util.newFieldList(()=>[{no:1,name:"graph_name",kind:"scalar",T:9},{no:2,name:"version",kind:"scalar",T:9,opt:!0}]));var dC=fs,ms=class ms extends Be{constructor(n){super();S(this,"response");S(this,"config");V.util.initPartial(n,this)}static fromBinary(n,r){return new ms().fromBinary(n,r)}static fromJson(n,r){return new ms().fromJson(n,r)}static fromJsonString(n,r){return new ms().fromJsonString(n,r)}static equals(n,r){return V.util.equals(ms,n,r)}};S(ms,"runtime",V),S(ms,"typeName","wg.cosmo.node.v1.GetConfigResponse"),S(ms,"fields",V.util.newFieldList(()=>[{no:1,name:"response",kind:"message",T:CT},{no:2,name:"config",kind:"message",T:Tf,opt:!0}]));var fC=ms,hs=class hs extends Be{constructor(n){super();S(this,"accountLimits");S(this,"graphPublicKey","");V.util.initPartial(n,this)}static fromBinary(n,r){return new hs().fromBinary(n,r)}static fromJson(n,r){return new hs().fromJson(n,r)}static fromJsonString(n,r){return new hs().fromJsonString(n,r)}static equals(n,r){return V.util.equals(hs,n,r)}};S(hs,"runtime",V),S(hs,"typeName","wg.cosmo.node.v1.RegistrationInfo"),S(hs,"fields",V.util.newFieldList(()=>[{no:1,name:"account_limits",kind:"message",T:NO},{no:2,name:"graph_public_key",kind:"scalar",T:9}]));var EO=hs,ys=class ys extends Be{constructor(n){super();S(this,"traceSamplingRate",0);V.util.initPartial(n,this)}static fromBinary(n,r){return new ys().fromBinary(n,r)}static fromJson(n,r){return new ys().fromJson(n,r)}static fromJsonString(n,r){return new ys().fromJsonString(n,r)}static equals(n,r){return V.util.equals(ys,n,r)}};S(ys,"runtime",V),S(ys,"typeName","wg.cosmo.node.v1.AccountLimits"),S(ys,"fields",V.util.newFieldList(()=>[{no:1,name:"trace_sampling_rate",kind:"scalar",T:2}]));var NO=ys,Ts=class Ts extends Be{constructor(t){super(),V.util.initPartial(t,this)}static fromBinary(t,n){return new Ts().fromBinary(t,n)}static fromJson(t,n){return new Ts().fromJson(t,n)}static fromJsonString(t,n){return new Ts().fromJsonString(t,n)}static equals(t,n){return V.util.equals(Ts,t,n)}};S(Ts,"runtime",V),S(Ts,"typeName","wg.cosmo.node.v1.SelfRegisterRequest"),S(Ts,"fields",V.util.newFieldList(()=>[]));var mC=Ts,Es=class Es extends Be{constructor(n){super();S(this,"response");S(this,"registrationInfo");V.util.initPartial(n,this)}static fromBinary(n,r){return new Es().fromBinary(n,r)}static fromJson(n,r){return new Es().fromJson(n,r)}static fromJsonString(n,r){return new Es().fromJsonString(n,r)}static equals(n,r){return V.util.equals(Es,n,r)}};S(Es,"runtime",V),S(Es,"typeName","wg.cosmo.node.v1.SelfRegisterResponse"),S(Es,"fields",V.util.newFieldList(()=>[{no:1,name:"response",kind:"message",T:CT},{no:2,name:"registrationInfo",kind:"message",T:EO,opt:!0}]));var hC=Es,Ns=class Ns extends Be{constructor(n){super();S(this,"defaultFlushInterval",ln.zero);S(this,"datasourceConfigurations",[]);S(this,"fieldConfigurations",[]);S(this,"graphqlSchema","");S(this,"typeConfigurations",[]);S(this,"stringStorage",{});V.util.initPartial(n,this)}static fromBinary(n,r){return new Ns().fromBinary(n,r)}static fromJson(n,r){return new Ns().fromJson(n,r)}static fromJsonString(n,r){return new Ns().fromJsonString(n,r)}static equals(n,r){return V.util.equals(Ns,n,r)}};S(Ns,"runtime",V),S(Ns,"typeName","wg.cosmo.node.v1.EngineConfiguration"),S(Ns,"fields",V.util.newFieldList(()=>[{no:1,name:"defaultFlushInterval",kind:"scalar",T:3},{no:2,name:"datasource_configurations",kind:"message",T:Nf,repeated:!0},{no:3,name:"field_configurations",kind:"message",T:bf,repeated:!0},{no:4,name:"graphqlSchema",kind:"scalar",T:9},{no:5,name:"type_configurations",kind:"message",T:gO,repeated:!0},{no:6,name:"string_storage",kind:"map",K:9,V:{kind:"scalar",T:9}}]));var Ef=Ns,gs=class gs extends Be{constructor(n){super();S(this,"kind",_a.STATIC);S(this,"rootNodes",[]);S(this,"childNodes",[]);S(this,"overrideFieldPathFromAlias",!1);S(this,"customGraphql");S(this,"customStatic");S(this,"directives",[]);S(this,"requestTimeoutSeconds",ln.zero);S(this,"id","");S(this,"keys",[]);S(this,"provides",[]);S(this,"requires",[]);S(this,"customEvents");S(this,"entityInterfaces",[]);S(this,"interfaceObjects",[]);V.util.initPartial(n,this)}static fromBinary(n,r){return new gs().fromBinary(n,r)}static fromJson(n,r){return new gs().fromJson(n,r)}static fromJsonString(n,r){return new gs().fromJsonString(n,r)}static equals(n,r){return V.util.equals(gs,n,r)}};S(gs,"runtime",V),S(gs,"typeName","wg.cosmo.node.v1.DataSourceConfiguration"),S(gs,"fields",V.util.newFieldList(()=>[{no:1,name:"kind",kind:"enum",T:V.getEnumType(_a)},{no:2,name:"root_nodes",kind:"message",T:ll,repeated:!0},{no:3,name:"child_nodes",kind:"message",T:ll,repeated:!0},{no:4,name:"override_field_path_from_alias",kind:"scalar",T:8},{no:5,name:"custom_graphql",kind:"message",T:_f},{no:6,name:"custom_static",kind:"message",T:IO},{no:7,name:"directives",kind:"message",T:bO,repeated:!0},{no:8,name:"request_timeout_seconds",kind:"scalar",T:3},{no:9,name:"id",kind:"scalar",T:9},{no:10,name:"keys",kind:"message",T:wu,repeated:!0},{no:11,name:"provides",kind:"message",T:wu,repeated:!0},{no:12,name:"requires",kind:"message",T:wu,repeated:!0},{no:13,name:"custom_events",kind:"message",T:Sf},{no:14,name:"entity_interfaces",kind:"message",T:pl,repeated:!0},{no:15,name:"interface_objects",kind:"message",T:pl,repeated:!0}]));var Nf=gs,vs=class vs extends Be{constructor(n){super();S(this,"name","");S(this,"sourceType",Ru.OBJECT_FIELD);V.util.initPartial(n,this)}static fromBinary(n,r){return new vs().fromBinary(n,r)}static fromJson(n,r){return new vs().fromJson(n,r)}static fromJsonString(n,r){return new vs().fromJsonString(n,r)}static equals(n,r){return V.util.equals(vs,n,r)}};S(vs,"runtime",V),S(vs,"typeName","wg.cosmo.node.v1.ArgumentConfiguration"),S(vs,"fields",V.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"source_type",kind:"enum",T:V.getEnumType(Ru)}]));var gf=vs,Is=class Is extends Be{constructor(n){super();S(this,"requiredAndScopes",[]);V.util.initPartial(n,this)}static fromBinary(n,r){return new Is().fromBinary(n,r)}static fromJson(n,r){return new Is().fromJson(n,r)}static fromJsonString(n,r){return new Is().fromJsonString(n,r)}static equals(n,r){return V.util.equals(Is,n,r)}};S(Is,"runtime",V),S(Is,"typeName","wg.cosmo.node.v1.Scopes"),S(Is,"fields",V.util.newFieldList(()=>[{no:1,name:"required_and_scopes",kind:"scalar",T:9,repeated:!0}]));var vf=Is,bs=class bs extends Be{constructor(n){super();S(this,"requiresAuthentication",!1);S(this,"requiredOrScopes",[]);V.util.initPartial(n,this)}static fromBinary(n,r){return new bs().fromBinary(n,r)}static fromJson(n,r){return new bs().fromJson(n,r)}static fromJsonString(n,r){return new bs().fromJsonString(n,r)}static equals(n,r){return V.util.equals(bs,n,r)}};S(bs,"runtime",V),S(bs,"typeName","wg.cosmo.node.v1.AuthorizationConfiguration"),S(bs,"fields",V.util.newFieldList(()=>[{no:1,name:"requires_authentication",kind:"scalar",T:8},{no:2,name:"required_or_scopes",kind:"message",T:vf,repeated:!0}]));var If=bs,_s=class _s extends Be{constructor(n){super();S(this,"typeName","");S(this,"fieldName","");S(this,"argumentsConfiguration",[]);S(this,"authorizationConfiguration");V.util.initPartial(n,this)}static fromBinary(n,r){return new _s().fromBinary(n,r)}static fromJson(n,r){return new _s().fromJson(n,r)}static fromJsonString(n,r){return new _s().fromJsonString(n,r)}static equals(n,r){return V.util.equals(_s,n,r)}};S(_s,"runtime",V),S(_s,"typeName","wg.cosmo.node.v1.FieldConfiguration"),S(_s,"fields",V.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"field_name",kind:"scalar",T:9},{no:3,name:"arguments_configuration",kind:"message",T:gf,repeated:!0},{no:4,name:"authorization_configuration",kind:"message",T:If}]));var bf=_s,Os=class Os extends Be{constructor(n){super();S(this,"typeName","");S(this,"renameTo","");V.util.initPartial(n,this)}static fromBinary(n,r){return new Os().fromBinary(n,r)}static fromJson(n,r){return new Os().fromJson(n,r)}static fromJsonString(n,r){return new Os().fromJsonString(n,r)}static equals(n,r){return V.util.equals(Os,n,r)}};S(Os,"runtime",V),S(Os,"typeName","wg.cosmo.node.v1.TypeConfiguration"),S(Os,"fields",V.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"rename_to",kind:"scalar",T:9}]));var gO=Os,Ss=class Ss extends Be{constructor(n){super();S(this,"typeName","");S(this,"fieldNames",[]);V.util.initPartial(n,this)}static fromBinary(n,r){return new Ss().fromBinary(n,r)}static fromJson(n,r){return new Ss().fromJson(n,r)}static fromJsonString(n,r){return new Ss().fromJsonString(n,r)}static equals(n,r){return V.util.equals(Ss,n,r)}};S(Ss,"runtime",V),S(Ss,"typeName","wg.cosmo.node.v1.TypeField"),S(Ss,"fields",V.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"field_names",kind:"scalar",T:9,repeated:!0}]));var ll=Ss,Ds=class Ds extends Be{constructor(n){super();S(this,"typeName","");S(this,"fieldName","");S(this,"selectionSet","");S(this,"disableEntityResolver",!1);V.util.initPartial(n,this)}static fromBinary(n,r){return new Ds().fromBinary(n,r)}static fromJson(n,r){return new Ds().fromJson(n,r)}static fromJsonString(n,r){return new Ds().fromJsonString(n,r)}static equals(n,r){return V.util.equals(Ds,n,r)}};S(Ds,"runtime",V),S(Ds,"typeName","wg.cosmo.node.v1.RequiredField"),S(Ds,"fields",V.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"field_name",kind:"scalar",T:9},{no:3,name:"selection_set",kind:"scalar",T:9},{no:4,name:"disable_entity_resolver",kind:"scalar",T:8}]));var wu=Ds,As=class As extends Be{constructor(n){super();S(this,"interfaceTypeName","");S(this,"concreteTypeNames",[]);V.util.initPartial(n,this)}static fromBinary(n,r){return new As().fromBinary(n,r)}static fromJson(n,r){return new As().fromJson(n,r)}static fromJsonString(n,r){return new As().fromJsonString(n,r)}static equals(n,r){return V.util.equals(As,n,r)}};S(As,"runtime",V),S(As,"typeName","wg.cosmo.node.v1.EntityInterfaceConfiguration"),S(As,"fields",V.util.newFieldList(()=>[{no:1,name:"interface_type_name",kind:"scalar",T:9},{no:2,name:"concrete_type_names",kind:"scalar",T:9,repeated:!0}]));var pl=As,ws=class ws extends Be{constructor(n){super();S(this,"url");S(this,"method",Lu.GET);S(this,"header",{});S(this,"body");S(this,"query",[]);S(this,"urlEncodeBody",!1);S(this,"mtls");S(this,"baseUrl");S(this,"path");S(this,"httpProxyUrl");V.util.initPartial(n,this)}static fromBinary(n,r){return new ws().fromBinary(n,r)}static fromJson(n,r){return new ws().fromJson(n,r)}static fromJsonString(n,r){return new ws().fromJsonString(n,r)}static equals(n,r){return V.util.equals(ws,n,r)}};S(ws,"runtime",V),S(ws,"typeName","wg.cosmo.node.v1.FetchConfiguration"),S(ws,"fields",V.util.newFieldList(()=>[{no:1,name:"url",kind:"message",T:Or},{no:2,name:"method",kind:"enum",T:V.getEnumType(Lu)},{no:3,name:"header",kind:"map",K:9,V:{kind:"message",T:OO}},{no:4,name:"body",kind:"message",T:Or},{no:5,name:"query",kind:"message",T:_O,repeated:!0},{no:7,name:"url_encode_body",kind:"scalar",T:8},{no:8,name:"mtls",kind:"message",T:SO},{no:9,name:"base_url",kind:"message",T:Or},{no:10,name:"path",kind:"message",T:Or},{no:11,name:"http_proxy_url",kind:"message",T:Or,opt:!0}]));var vO=ws,Rs=class Rs extends Be{constructor(n){super();S(this,"statusCode",ln.zero);S(this,"typeName","");S(this,"injectStatusCodeIntoBody",!1);V.util.initPartial(n,this)}static fromBinary(n,r){return new Rs().fromBinary(n,r)}static fromJson(n,r){return new Rs().fromJson(n,r)}static fromJsonString(n,r){return new Rs().fromJsonString(n,r)}static equals(n,r){return V.util.equals(Rs,n,r)}};S(Rs,"runtime",V),S(Rs,"typeName","wg.cosmo.node.v1.StatusCodeTypeMapping"),S(Rs,"fields",V.util.newFieldList(()=>[{no:1,name:"status_code",kind:"scalar",T:3},{no:2,name:"type_name",kind:"scalar",T:9},{no:3,name:"inject_status_code_into_body",kind:"scalar",T:8}]));var yC=Rs,Ls=class Ls extends Be{constructor(n){super();S(this,"fetch");S(this,"subscription");S(this,"federation");S(this,"upstreamSchema");S(this,"customScalarTypeFields",[]);V.util.initPartial(n,this)}static fromBinary(n,r){return new Ls().fromBinary(n,r)}static fromJson(n,r){return new Ls().fromJson(n,r)}static fromJsonString(n,r){return new Ls().fromJsonString(n,r)}static equals(n,r){return V.util.equals(Ls,n,r)}};S(Ls,"runtime",V),S(Ls,"typeName","wg.cosmo.node.v1.DataSourceCustom_GraphQL"),S(Ls,"fields",V.util.newFieldList(()=>[{no:1,name:"fetch",kind:"message",T:vO},{no:2,name:"subscription",kind:"message",T:DO},{no:3,name:"federation",kind:"message",T:AO},{no:4,name:"upstream_schema",kind:"message",T:Df},{no:6,name:"custom_scalar_type_fields",kind:"message",T:wO,repeated:!0}]));var _f=Ls,Fs=class Fs extends Be{constructor(n){super();S(this,"type",Bs.PUBLISH);S(this,"typeName","");S(this,"fieldName","");S(this,"topic","");S(this,"sourceId","");V.util.initPartial(n,this)}static fromBinary(n,r){return new Fs().fromBinary(n,r)}static fromJson(n,r){return new Fs().fromJson(n,r)}static fromJsonString(n,r){return new Fs().fromJsonString(n,r)}static equals(n,r){return V.util.equals(Fs,n,r)}};S(Fs,"runtime",V),S(Fs,"typeName","wg.cosmo.node.v1.EventConfiguration"),S(Fs,"fields",V.util.newFieldList(()=>[{no:1,name:"type",kind:"enum",T:V.getEnumType(Bs)},{no:2,name:"type_name",kind:"scalar",T:9},{no:3,name:"field_name",kind:"scalar",T:9},{no:4,name:"topic",kind:"scalar",T:9},{no:5,name:"source_id",kind:"scalar",T:9}]));var Of=Fs,ks=class ks extends Be{constructor(n){super();S(this,"events",[]);V.util.initPartial(n,this)}static fromBinary(n,r){return new ks().fromBinary(n,r)}static fromJson(n,r){return new ks().fromJson(n,r)}static fromJsonString(n,r){return new ks().fromJsonString(n,r)}static equals(n,r){return V.util.equals(ks,n,r)}};S(ks,"runtime",V),S(ks,"typeName","wg.cosmo.node.v1.DataSourceCustom_Events"),S(ks,"fields",V.util.newFieldList(()=>[{no:1,name:"events",kind:"message",T:Of,repeated:!0}]));var Sf=ks,Ps=class Ps extends Be{constructor(n){super();S(this,"data");V.util.initPartial(n,this)}static fromBinary(n,r){return new Ps().fromBinary(n,r)}static fromJson(n,r){return new Ps().fromJson(n,r)}static fromJsonString(n,r){return new Ps().fromJsonString(n,r)}static equals(n,r){return V.util.equals(Ps,n,r)}};S(Ps,"runtime",V),S(Ps,"typeName","wg.cosmo.node.v1.DataSourceCustom_Static"),S(Ps,"fields",V.util.newFieldList(()=>[{no:1,name:"data",kind:"message",T:Or}]));var IO=Ps,xs=class xs extends Be{constructor(n){super();S(this,"kind",Oa.STATIC_CONFIGURATION_VARIABLE);S(this,"staticVariableContent","");S(this,"environmentVariableName","");S(this,"environmentVariableDefaultValue","");S(this,"placeholderVariableName","");V.util.initPartial(n,this)}static fromBinary(n,r){return new xs().fromBinary(n,r)}static fromJson(n,r){return new xs().fromJson(n,r)}static fromJsonString(n,r){return new xs().fromJsonString(n,r)}static equals(n,r){return V.util.equals(xs,n,r)}};S(xs,"runtime",V),S(xs,"typeName","wg.cosmo.node.v1.ConfigurationVariable"),S(xs,"fields",V.util.newFieldList(()=>[{no:1,name:"kind",kind:"enum",T:V.getEnumType(Oa)},{no:2,name:"static_variable_content",kind:"scalar",T:9},{no:3,name:"environment_variable_name",kind:"scalar",T:9},{no:4,name:"environment_variable_default_value",kind:"scalar",T:9},{no:5,name:"placeholder_variable_name",kind:"scalar",T:9}]));var Or=xs,Cs=class Cs extends Be{constructor(n){super();S(this,"directiveName","");S(this,"renameTo","");V.util.initPartial(n,this)}static fromBinary(n,r){return new Cs().fromBinary(n,r)}static fromJson(n,r){return new Cs().fromJson(n,r)}static fromJsonString(n,r){return new Cs().fromJsonString(n,r)}static equals(n,r){return V.util.equals(Cs,n,r)}};S(Cs,"runtime",V),S(Cs,"typeName","wg.cosmo.node.v1.DirectiveConfiguration"),S(Cs,"fields",V.util.newFieldList(()=>[{no:1,name:"directive_name",kind:"scalar",T:9},{no:2,name:"rename_to",kind:"scalar",T:9}]));var bO=Cs,Ms=class Ms extends Be{constructor(n){super();S(this,"name","");S(this,"value","");V.util.initPartial(n,this)}static fromBinary(n,r){return new Ms().fromBinary(n,r)}static fromJson(n,r){return new Ms().fromJson(n,r)}static fromJsonString(n,r){return new Ms().fromJsonString(n,r)}static equals(n,r){return V.util.equals(Ms,n,r)}};S(Ms,"runtime",V),S(Ms,"typeName","wg.cosmo.node.v1.URLQueryConfiguration"),S(Ms,"fields",V.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:9}]));var _O=Ms,Us=class Us extends Be{constructor(n){super();S(this,"values",[]);V.util.initPartial(n,this)}static fromBinary(n,r){return new Us().fromBinary(n,r)}static fromJson(n,r){return new Us().fromJson(n,r)}static fromJsonString(n,r){return new Us().fromJsonString(n,r)}static equals(n,r){return V.util.equals(Us,n,r)}};S(Us,"runtime",V),S(Us,"typeName","wg.cosmo.node.v1.HTTPHeader"),S(Us,"fields",V.util.newFieldList(()=>[{no:1,name:"values",kind:"message",T:Or,repeated:!0}]));var OO=Us,js=class js extends Be{constructor(n){super();S(this,"key");S(this,"cert");S(this,"insecureSkipVerify",!1);V.util.initPartial(n,this)}static fromBinary(n,r){return new js().fromBinary(n,r)}static fromJson(n,r){return new js().fromJson(n,r)}static fromJsonString(n,r){return new js().fromJsonString(n,r)}static equals(n,r){return V.util.equals(js,n,r)}};S(js,"runtime",V),S(js,"typeName","wg.cosmo.node.v1.MTLSConfiguration"),S(js,"fields",V.util.newFieldList(()=>[{no:1,name:"key",kind:"message",T:Or},{no:2,name:"cert",kind:"message",T:Or},{no:3,name:"insecureSkipVerify",kind:"scalar",T:8}]));var SO=js,Vs=class Vs extends Be{constructor(n){super();S(this,"enabled",!1);S(this,"url");S(this,"useSSE");S(this,"protocol");V.util.initPartial(n,this)}static fromBinary(n,r){return new Vs().fromBinary(n,r)}static fromJson(n,r){return new Vs().fromJson(n,r)}static fromJsonString(n,r){return new Vs().fromJsonString(n,r)}static equals(n,r){return V.util.equals(Vs,n,r)}};S(Vs,"runtime",V),S(Vs,"typeName","wg.cosmo.node.v1.GraphQLSubscriptionConfiguration"),S(Vs,"fields",V.util.newFieldList(()=>[{no:1,name:"enabled",kind:"scalar",T:8},{no:2,name:"url",kind:"message",T:Or},{no:3,name:"useSSE",kind:"scalar",T:8,opt:!0},{no:4,name:"protocol",kind:"enum",T:V.getEnumType(us),opt:!0}]));var DO=Vs,$s=class $s extends Be{constructor(n){super();S(this,"enabled",!1);S(this,"serviceSdl","");V.util.initPartial(n,this)}static fromBinary(n,r){return new $s().fromBinary(n,r)}static fromJson(n,r){return new $s().fromJson(n,r)}static fromJsonString(n,r){return new $s().fromJsonString(n,r)}static equals(n,r){return V.util.equals($s,n,r)}};S($s,"runtime",V),S($s,"typeName","wg.cosmo.node.v1.GraphQLFederationConfiguration"),S($s,"fields",V.util.newFieldList(()=>[{no:1,name:"enabled",kind:"scalar",T:8},{no:2,name:"serviceSdl",kind:"scalar",T:9}]));var AO=$s,Gs=class Gs extends Be{constructor(n){super();S(this,"key","");V.util.initPartial(n,this)}static fromBinary(n,r){return new Gs().fromBinary(n,r)}static fromJson(n,r){return new Gs().fromJson(n,r)}static fromJsonString(n,r){return new Gs().fromJsonString(n,r)}static equals(n,r){return V.util.equals(Gs,n,r)}};S(Gs,"runtime",V),S(Gs,"typeName","wg.cosmo.node.v1.InternedString"),S(Gs,"fields",V.util.newFieldList(()=>[{no:1,name:"key",kind:"scalar",T:9}]));var Df=Gs,qs=class qs extends Be{constructor(n){super();S(this,"typeName","");S(this,"fieldName","");V.util.initPartial(n,this)}static fromBinary(n,r){return new qs().fromBinary(n,r)}static fromJson(n,r){return new qs().fromJson(n,r)}static fromJsonString(n,r){return new qs().fromJsonString(n,r)}static equals(n,r){return V.util.equals(qs,n,r)}};S(qs,"runtime",V),S(qs,"typeName","wg.cosmo.node.v1.SingleTypeField"),S(qs,"fields",V.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"field_name",kind:"scalar",T:9}]));var wO=qs;d();m();f();function RO(e,t,n){if(e)for(let r of e)t.push(new wu(D({typeName:n,fieldName:r.fieldName,selectionSet:r.selectionSet},r.disableEntityResolver?{disableEntityResolver:!0}:{})))}function fH(e){switch(e){case"publish":return Bs.PUBLISH;case"request":return Bs.REQUEST;case"subscribe":return Bs.SUBSCRIBE}throw new Error(`Unknown event type ${e}`)}function TC(e){var n;let t={rootNodes:[],childNodes:[],keys:[],provides:[],events:[],requires:[],entityInterfaces:[],interfaceObjects:[]};for(let r of e.values()){let i=r.typeName,o=[...r.fieldNames],s=new ll({typeName:i,fieldNames:o});if(r.isRootNode?t.rootNodes.push(s):t.childNodes.push(s),r.entityInterfaceConcreteTypeNames){let a=new pl({interfaceTypeName:i,concreteTypeNames:[...r.entityInterfaceConcreteTypeNames]});r.isInterfaceObject?t.interfaceObjects.push(a):t.entityInterfaces.push(a)}RO(r.keys,t.keys,i),RO(r.provides,t.provides,i),RO(r.requires,t.requires,i);for(let a of(n=r.events)!=null?n:[])t.events.push(new Of({type:fH(a.type),typeName:i,fieldName:a.fieldName,topic:a.topic}))}return t}function EC(e){var n;let t=[];for(let r of e){let i=r.argumentNames.map(c=>new gf({name:c,sourceType:Ru.FIELD_ARGUMENT})),o=new bf({argumentsConfiguration:i,fieldName:r.fieldName,typeName:r.typeName}),s=((n=r.requiredScopes)==null?void 0:n.map(c=>new vf({requiredAndScopes:c})))||[],a=s.length>0;(r.requiresAuthentication||a)&&(o.authorizationConfiguration=new If({requiresAuthentication:r.requiresAuthentication||a,requiredOrScopes:s})),t.push(o)}return t}d();m();f();function LO(e){return new Error(`Normalization failed to return a ${e}.`)}var mH=(e,t)=>{let n=stringHash(t);return e.stringStorage[n]=t,new Df({key:n})},hH=e=>{switch(e){case"ws":return us.GRAPHQL_SUBSCRIPTION_PROTOCOL_WS;case"sse":return us.GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE;case"sse_post":return us.GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE_POST}throw new Error(`Unsupported subscription protocol '${e}'`)},NC=function(e){var n;let t=new Ef({defaultFlushInterval:BigInt(500),datasourceConfigurations:[],fieldConfigurations:[],graphqlSchema:"",stringStorage:{},typeConfigurations:[]});for(let r of e.subgraphs){if(!r.configurationDataMap)throw LO("ConfigurationDataMap");if(!r.schema)throw LO("GraphQLSchema");let i=mH(t,Px(kp(r.schema))),{childNodes:o,entityInterfaces:s,events:a,interfaceObjects:c,keys:u,provides:l,requires:p,rootNodes:h}=TC(r.configurationDataMap),y=hH(r.subscriptionProtocol),N,O,w;if(a.length>0){N=_a.PUBSUB,w=new Sf({events:a});let W=pe=>["Query","Mutation","Subscription"].includes(pe.typeName),K=0,te=0;for(;K({id:r.id,name:r.name,routingUrl:r.url}))})};he();function gC(e){let t;try{t=Oi(e.schema)}catch(n){throw new Error(`could not parse schema for Graph ${e.name}: ${n}`)}return{definitions:t,name:e.name,url:e.url}}function yH(e){let{federationResult:t,errors:n}=(0,FO.federateSubgraphs)(e.map(gC));if(n&&n.length>0)throw new Error(`could not federate schema: ${n.map(r=>r.message).join(", ")}`);return{fieldConfigurations:t.fieldConfigurations,sdl:Ze(t.federatedGraphAST)}}function TH(e){let t=(0,FO.federateSubgraphs)(e.map(gC));if(t.errors&&t.errors.length>0)throw new Error(`could not federate schema: ${t.errors.map(r=>r.message).join(", ")}`);if(t.federationResult===void 0)throw new Error("could not federate subgraphs");return NC({fieldConfigurations:t.federationResult.fieldConfigurations,federatedSDL:Pp(t.federationResult.federatedGraphSchema),schemaVersionId:"",subgraphs:e.map((r,i)=>{var c,u;let o=t.federationResult.subgraphConfigBySubgraphName.get(r.name),s=o==null?void 0:o.schema,a=o==null?void 0:o.configurationDataMap;return{id:`${i}`,name:r.name,url:rO(r.url),sdl:r.schema,subscriptionUrl:rO((c=r.subscription_url)!=null?c:r.url),subscriptionProtocol:(u=r.subscription_protocol)!=null?u:"ws",schema:s,configurationDataMap:a}})}).toJsonString()}return Te(EH);})(); +If this subgraph has been recently deleted, remember to clean up unused @override directives that reference this subgraph.`}Vh.invalidOverrideTargetSubgraphNameWarning=f2});var jh=L(de=>{"use strict";d();f();p();Object.defineProperty(de,"__esModule",{value:!0});de.removeInheritableDirectivesFromParentWithFieldsData=de.getUnionNodeByData=de.getSchemaNodeByData=de.getScalarNodeByData=de.getParentWithFieldsNodeByData=de.getInputObjectNodeByData=de.getEnumNodeByData=de.extractImplementedInterfaceTypeNames=de.convertKindForExtension=de.isTypeNameRootType=de.upsertUnionExtensionDataByNode=de.upsertUnionDefinitionDataByNode=de.extractUniqueUnionMembers=de.upsertScalarExtensionDataByNode=de.upsertScalarDefinitionDataByNode=de.upsertObjectDefinitionDataByNode=de.upsertInterfaceDefinitionDataByNode=de.upsertInputValueDataByNode=de.upsertInputObjectExtensionDataByNode=de.upsertInputObjectDefinitionDataByNode=de.upsertExtensionWithFieldsDataByNode=de.upsertFieldDataByNode=de.addInheritedDirectivesToFieldData=de.upsertEnumValueDataByNode=de.upsertEnumExtensionDataByNode=de.upsertEnumDefinitionDataByNode=de.upsertArgumentDataByNode=de.extractArguments=de.extractDirectives=de.getDirectiveValidationErrors=de.getDefinedArgumentsForDirective=de.isNodeExternalOrShareable=void 0;var Yo=(ne(),se(ce)),Hr=ed(),yi=Ar(),kn=ai(),Ti=Or(),m2=wo(),HL=Zu(),qa=ds(),np=Oo();function WL(e,t,n){var i;let r={isExternal:n.has(Ti.EXTERNAL),isShareable:t||n.has(Ti.SHAREABLE)};if(!((i=e.directives)!=null&&i.length))return r;for(let s of e.directives){let o=s.name.value;if(o===Ti.EXTERNAL){r.isExternal=!0;continue}o===Ti.SHAREABLE&&(r.isShareable=!0)}return r}de.isNodeExternalOrShareable=WL;function ZL(e,t,n,r,i){let s=e.arguments||[],o=e.name.value,a=new Set,u=new Set;for(let c of s){let l=c.name.value;if(a.has(l)){u.has(l)||(u.add(l),i.push((0,kn.duplicateDirectiveArgumentDefinitionErrorMessage)(o,r,l)));continue}if(!t.get(l)){i.push((0,kn.unexpectedDirectiveArgumentErrorMessage)(o,l));continue}a.add(l)}return a}de.getDefinedArgumentsForDirective=ZL;function eR(e,t,n,r,i,s,o=!1){var N,D,w;let a=e.name.value,u=r.get(a)||np.V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME.get(a),c=[];if(!u)return c.push((0,kn.undefinedDirectiveErrorMessage)(a,s)),c;let l=new Map,m=new Set;if((0,HL.getDirectiveDefinitionArgumentSets)(u.arguments||[],l,m),(0,HL.areNodeKindAndDirectiveLocationCompatible)(t,u,o)||c.push((0,kn.invalidDirectiveLocationErrorMessage)(s,o?Yo.Kind.ARGUMENT:t,a)),!u.repeatable&&n.get(a)){let x=i.get(s);x?x.has(a)||(x.add(a),c.push((0,kn.invalidRepeatedDirectiveErrorMessage)(a,s))):i.set(s,new Set([a]))}if(!((N=u.arguments)!=null&&N.length))return(D=e.arguments)!=null&&D.length&&c.push((0,kn.unexpectedDirectiveArgumentsErrorMessage)(e,s)),c;if(!((w=e.arguments)!=null&&w.length))return m.size>0&&c.push((0,kn.undefinedRequiredArgumentsErrorMessage)(a,s,[...m])),c;let h=ZL(e,l,m,s,c),E=(0,qa.getEntriesNotInHashSet)(m,h);return E.length>0&&c.push((0,kn.undefinedRequiredArgumentsErrorMessage)(a,s,[...m],E)),c}de.getDirectiveValidationErrors=eR;function Wr(e,t,n,r,i,s,o=!1){if(!e.directives)return t;let a=new Set;for(let u of e.directives){let c=eR(u,e.kind,t,r,i,s,o),l=u.name.value;if(c.length>0){n.push((0,kn.invalidDirectiveError)(l,s,c));continue}if(Ti.IGNORED_PARENT_DIRECTIVES.has(l))continue;if(l===Ti.KEY){let h=u.arguments[0].value.value;if(a.has(h))continue;a.add(h)}let m=t.get(l);m?m.push(u):t.set(l,[u])}return t}de.extractDirectives=Wr;function h2(e,t,n,r,i,s,o,a){var m;if(!((m=t.arguments)!=null&&m.length))return e;let u=t.name.value,c=`${o}.${u}`;s.add(o);let l=new Set;for(let h of t.arguments){let E=h.name.value;if(e.has(E)){l.add(E);continue}tR(e,h,n,r,i,o,u,a)}return l.size>0&&n.push((0,kn.duplicateArgumentsError)(c,[...l])),e}de.extractArguments=h2;function tR(e,t,n,r,i,s,o,a){let u=t.name.value,c=`${s}.${o}`;e.set(u,{directivesByDirectiveName:Wr(t,new Map,n,r,i,`${c}(${u}: ...)`,!0),name:u,node:(0,Hr.getMutableInputValueNode)(t,s,o),requiredSubgraphNames:new Set([a]),subgraphNames:new Set([a]),type:(0,Hr.getMutableTypeNode)(t.type,c),defaultValue:t.defaultValue,description:(0,yi.formatDescription)(t.description)})}de.upsertArgumentDataByNode=tR;function T2(e,t,n){let r=t.name.value;e.set(r,{appearances:1,directivesByDirectiveName:n,kind:t.kind,node:(0,Hr.getMutableEnumNode)(t),typeName:r,enumValueDataByValueName:new Map,description:(0,yi.formatDescription)(t.description)})}de.upsertEnumDefinitionDataByNode=T2;function y2(e,t,n){let r=t.name.value;e.set(r,{directivesByDirectiveName:n,enumValueDataByValueName:new Map,kind:t.kind,typeName:r})}de.upsertEnumExtensionDataByNode=y2;function E2(e,t,n,r,i,s){let o=t.name.value;e.set(o,{appearances:1,directivesByDirectiveName:Wr(t,new Map,n,r,i,`${s}.${o}`),name:o,node:(0,Hr.getMutableEnumValueNode)(t),parentTypeName:s,description:(0,yi.formatDescription)(t.description)})}de.upsertEnumValueDataByNode=E2;function N2(e,t){for(let n of np.INHERITABLE_DIRECTIVE_NAMES)e.get(n)&&(0,qa.getValueOrDefault)(t,n,()=>[(0,qa.generateSimpleDirective)(n)]);return t}de.addInheritedDirectivesToFieldData=N2;function g2(e,t,n,r,i,s,o,a){let u=t.name.value,c=`${s}.${u}`,l=WL(t,!a,i),m={argumentDataByArgumentName:r,isExternalBySubgraphName:new Map([[o,l.isExternal]]),isShareableBySubgraphName:new Map([[o,l.isShareable]]),node:(0,Hr.getMutableFieldNode)(t,s),name:u,namedTypeName:(0,m2.getNamedTypeForChild)(c,t.type),parentTypeName:s,subgraphNames:new Set([o]),directivesByDirectiveName:i,description:(0,yi.formatDescription)(t.description)};return e.set(u,m),m}de.upsertFieldDataByNode=g2;function I2(e,t,n,r,i,s){let o=t.name.value,a=nR(t);switch(a){case Yo.Kind.INTERFACE_TYPE_EXTENSION:e.set(o,{directivesByDirectiveName:Wr(t,new Map,n,r,i,o),fieldDataByFieldName:new Map,implementedInterfaceTypeNames:tp(t,new Set,n),isEntity:s,kind:a,typeName:o});return;default:e.set(o,{directivesByDirectiveName:Wr(t,new Map,n,r,i,o),fieldDataByFieldName:new Map,implementedInterfaceTypeNames:tp(t,new Set,n),isEntity:s,kind:a,node:(0,Hr.getMutableObjectExtensionNode)(t),typeName:o})}}de.upsertExtensionWithFieldsDataByNode=I2;function v2(e,t,n,r,i){let s=t.name.value;e.set(s,{appearances:1,directivesByDirectiveName:Wr(t,new Map,n,r,i,s),inputValueDataByValueName:new Map,kind:t.kind,node:(0,Hr.getMutableInputObjectNode)(t),typeName:s,description:(0,yi.formatDescription)(t.description)})}de.upsertInputObjectDefinitionDataByNode=v2;function _2(e,t,n,r,i){let s=t.name.value;e.set(s,{directivesByDirectiveName:Wr(t,new Map,n,r,i,s),inputValueDataByValueName:new Map,kind:t.kind,typeName:s})}de.upsertInputObjectExtensionDataByNode=_2;function b2(e,t,n,r,i,s){let o=t.name.value;e.set(o,{appearances:1,directivesByDirectiveName:Wr(t,new Map,n,r,i,`${s}.${o}`),name:o,node:(0,Hr.getMutableInputValueNode)(t,s,o),parentTypeName:s,description:(0,yi.formatDescription)(t.description)})}de.upsertInputValueDataByNode=b2;function S2(e,t,n,r,i,s,o){let a=t.name.value;e.set(a,{directivesByDirectiveName:Wr(t,new Map,n,r,i,a),fieldDataByFieldName:new Map,isEntity:s,implementedInterfaceTypeNames:tp(t,new Set,n),kind:t.kind,node:(0,Hr.getMutableInterfaceNode)(t),subgraphNames:new Set([o]),typeName:a,description:(0,yi.formatDescription)(t.description)})}de.upsertInterfaceDefinitionDataByNode=S2;function D2(e,t,n,r,i,s,o,a){let u=t.name.value;e.set(u,{directivesByDirectiveName:Wr(t,new Map,n,r,i,u),fieldDataByFieldName:new Map,isEntity:s,isRootType:o,implementedInterfaceTypeNames:tp(t,new Set,n),kind:t.kind,node:(0,Hr.getMutableObjectNode)(t),subgraphNames:new Set([a]),typeName:u,description:(0,yi.formatDescription)(t.description)})}de.upsertObjectDefinitionDataByNode=D2;function O2(e,t,n){let r=t.name.value;e.set(r,{directivesByDirectiveName:n,kind:t.kind,node:(0,Hr.getMutableScalarNode)(t),typeName:r,description:(0,yi.formatDescription)(t.description)})}de.upsertScalarDefinitionDataByNode=O2;function A2(e,t,n){let r=t.name.value;e.set(r,{directivesByDirectiveName:n,kind:t.kind,typeName:r})}de.upsertScalarExtensionDataByNode=A2;function XI(e,t,n,r,i,s){for(let o of e){let a=o.name.value;if(t.has(a)){n.push((0,kn.duplicateUnionMemberError)(a,r));continue}let u=i.get(r);u?u.add(a):i.set(r,new Set([a])),np.BASE_SCALARS.has(a)||s.add(a),t.set(a,o)}return t}de.extractUniqueUnionMembers=XI;function w2(e,t,n,r,i,s,o){var u;let a=t.name.value;if(!((u=t.types)!=null&&u.length)){n.push((0,kn.noDefinedUnionMembersError)(a));return}e.set(a,{directivesByDirectiveName:Wr(t,new Map,n,r,i,a),kind:t.kind,memberByMemberTypeName:XI(t.types,new Map,n,a,s,o),node:(0,Hr.getMutableUnionNode)(t),typeName:a,description:(0,yi.formatDescription)(t.description)})}de.upsertUnionDefinitionDataByNode=w2;function F2(e,t,n,r,i,s,o){let a=t.name.value;e.set(a,{directivesByDirectiveName:Wr(t,new Map,n,r,i,a),kind:t.kind,memberByMemberTypeName:XI(t.types,new Map,n,a,s,o),typeName:a})}de.upsertUnionExtensionDataByNode=F2;function L2(e,t){return Ti.ROOT_TYPES.has(e)||t.has(e)}de.isTypeNameRootType=L2;function nR(e){switch(e.kind){case Yo.Kind.INTERFACE_TYPE_DEFINITION:return Yo.Kind.INTERFACE_TYPE_EXTENSION;case Yo.Kind.OBJECT_TYPE_DEFINITION:return Yo.Kind.OBJECT_TYPE_EXTENSION;default:return e.kind}}de.convertKindForExtension=nR;function tp(e,t,n){if(!e.interfaces)return t;let r=e.name.value;for(let i of e.interfaces){let s=i.name.value;if(n&&t.has(s)){n.push((0,kn.duplicateInterfaceError)(s,r));continue}t.add(s)}return t}de.extractImplementedInterfaceTypeNames=tp;function rp(e,t){if(t)for(let[n,r]of t.directivesByDirectiveName){let i=e.get(n);if(i){i.push(...r);continue}e.set(n,[...r])}}function R2(e,t){let n=e.get(t.parentTypeName);if(!n)return;let r=n.fieldAuthorizationDataByFieldName.get(t.name);if(r){if(r.requiresAuthentication){let i=(0,qa.generateSimpleDirective)(Ti.AUTHENTICATED);t.directivesByDirectiveName.set(Ti.AUTHENTICATED,[i])}if(r.requiredScopes.length>0){let i=(0,qa.generateRequiresScopesDirective)(r.requiredScopes);t.directivesByDirectiveName.set(Ti.REQUIRES_SCOPES,[i])}}}function k2(e){for(let t of e.argumentDataByArgumentName.values()){for(let n of t.directivesByDirectiveName.values())t.node.directives.push(...n);e.node.arguments.push(t.node)}}function HI(e,t){let n=[];for(let r of e.values()){if(r.node.kind===Yo.Kind.FIELD_DEFINITION){let i=r;R2(t,i),k2(i)}for(let i of r.directivesByDirectiveName.values())r.node.directives.push(...i);n.push(r.node)}return n}function hc(e,t,n,r){let i=[];for(let[s,o]of e){let a=n.get(s)||np.V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME.get(s);if(!a)continue;if(!a.repeatable&&o.length>1){t.push((0,kn.invalidDirectiveError)(s,r,[(0,kn.invalidRepeatedDirectiveErrorMessage)(s,r)]));continue}if(s!==Ti.KEY){i.push(...o);continue}let u=[],c=new Set,l=[];for(let m of o){let h=m.arguments[0].value;if(h.kind!==Yo.Kind.STRING){l.push((0,kn.invalidKeyDirectiveArgumentErrorMessage)(h.kind));continue}let E=h.value;c.has(E)||(c.add(E),i.push(m),u.push(m))}e.set(s,u),l.length>0&&t.push((0,kn.invalidDirectiveError)(s,r,l))}return i}function x2(e,t,n){if(!n)return;let r=e.memberByMemberTypeName,i=n.memberByMemberTypeName,s=e.typeName;for(let[o,a]of i){if(!r.has(o)){r.set(o,a);continue}t.push((0,kn.duplicateUnionMemberExtensionError)(o,s))}}function P2(e,t,n,r,i){return rp(e.directivesByDirectiveName,i),e.node.directives=hc(e.directivesByDirectiveName,t,n,e.typeName),e.node.values=HI(e.enumValueDataByValueName,r),e.node}de.getEnumNodeByData=P2;function M2(e,t,n,r,i){return rp(e.directivesByDirectiveName,i),e.node.directives=hc(e.directivesByDirectiveName,t,n,e.typeName),e.node.fields=HI(e.inputValueDataByValueName,r),e.node}de.getInputObjectNodeByData=M2;function U2(e,t,n,r,i){return rp(e.directivesByDirectiveName,i),e.node.directives=hc(e.directivesByDirectiveName,t,n,e.typeName),e.node.fields=HI(e.fieldDataByFieldName,r),e.node.interfaces=(0,yi.setToNamedTypeNodeArray)(e.implementedInterfaceTypeNames),e.node}de.getParentWithFieldsNodeByData=U2;function C2(e,t,n,r){return rp(e.directivesByDirectiveName,r),e.node.directives=hc(e.directivesByDirectiveName,t,n,e.typeName),e.node}de.getScalarNodeByData=C2;function B2(e,t,n){return{description:e.description,directives:hc(e.directivesByDirectiveName,t,n,e.typeName),kind:e.kind,operationTypes:(0,qa.mapToArrayOfValues)(e.operationTypes)}}de.getSchemaNodeByData=B2;function $2(e,t,n,r){return x2(e,t,r),rp(e.directivesByDirectiveName,r),e.node.directives=hc(e.directivesByDirectiveName,t,n,e.typeName),e.node.types=(0,qa.mapToArrayOfValues)(e.memberByMemberTypeName),e.node}de.getUnionNodeByData=$2;function V2(e){for(let t of np.INHERITABLE_DIRECTIVE_NAMES)e.directivesByDirectiveName.delete(t)}de.removeInheritableDirectivesFromParentWithFieldsData=V2});var WI=L(Jo=>{"use strict";d();f();p();Object.defineProperty(Jo,"__esModule",{value:!0});Jo.consolidateAuthorizationDirectives=Jo.upsertParentsAndChildren=Jo.upsertDirectiveAndSchemaDefinitions=void 0;var ut=(ne(),se(ce)),ip=wo(),ln=ai(),yc=Oo(),Tt=ds(),Ka=Ar(),Tc=Zu(),It=Or(),xt=jh();function j2(e,t){let n=new Set;(0,ut.visit)(t,{DirectiveDefinition:{enter(r){let i=r.name.value;return n.has(i)?(e.errors.push((0,ln.duplicateDirectiveDefinitionError)(i)),!1):(n.add(i),yc.V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME.has(i)?(e.isSubgraphVersionTwo=!0,!1):(yc.BASE_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME.has(i)||(e.directiveDefinitionByDirectiveName.set(i,r),e.customDirectiveDefinitions.set(i,r)),!1))}},OperationTypeDefinition:{enter(r){let i=r.operation,s=`${e.parentTypeName}.${i}`,o=e.schemaDefinition.operationTypes.get(i),a=(0,ip.getNamedTypeForChild)(s,r.type);if(o)return(0,ln.duplicateOperationTypeDefinitionError)(i,a,(0,ip.getNamedTypeForChild)(s,o.type)),!1;let u=e.operationTypeNames.get(a);return u?(e.errors.push((0,ln.invalidOperationTypeDefinitionError)(u,a,i)),!1):(e.operationTypeNames.set(a,i),e.schemaDefinition.operationTypes.set(i,r),!1)}},SchemaDefinition:{enter(r){(0,xt.extractDirectives)(r,e.schemaDefinition.directivesByDirectiveName,e.errors,e.directiveDefinitionByDirectiveName,e.handledRepeatedDirectivesByHostPath,It.SCHEMA),e.schemaDefinition.description=r.description}},SchemaExtension:{enter(r){(0,xt.extractDirectives)(r,e.schemaDefinition.directivesByDirectiveName,e.errors,e.directiveDefinitionByDirectiveName,e.handledRepeatedDirectivesByHostPath,It.SCHEMA)}}})}Jo.upsertDirectiveAndSchemaDefinitions=j2;function G2(e,t){let n=!1;(0,ut.visit)(t,{Directive:{enter(r){let i=r.name.value;if(yc.V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME.has(i))return e.isSubgraphVersionTwo=!0,!1;if(yc.BASE_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME.has(i))return!1;e.referencedDirectiveNames.add(i)}},EnumTypeDefinition:{enter(r){if(e.parentTypeName=r.name.value,e.parentDefinitionDataByTypeName.has(e.parentTypeName))return e.errors.push((0,ln.duplicateTypeDefinitionError)((0,Tt.kindToTypeString)(r.kind),e.parentTypeName)),!1;e.lastParentNodeKind=r.kind;let i=e.extractDirectivesAndAuthorization(r,new Map);(0,xt.upsertEnumDefinitionDataByNode)(e.parentDefinitionDataByTypeName,r,i)},leave(){e.parentTypeName="",e.lastParentNodeKind=ut.Kind.NULL}},EnumTypeExtension:{enter(r){e.parentTypeName=r.name.value,e.lastParentNodeKind=r.kind,e.isCurrentParentExtension=!0;let i=e.parentExtensionDataByTypeName.get(e.parentTypeName);if(i){if(i.kind!==ut.Kind.ENUM_TYPE_EXTENSION)return e.errors.push((0,ln.incompatibleExtensionKindsError)(r,i.kind)),!1;e.extractDirectivesAndAuthorization(r,i.directivesByDirectiveName);return}let s=e.extractDirectivesAndAuthorization(r,new Map);(0,xt.upsertEnumExtensionDataByNode)(e.parentExtensionDataByTypeName,r,s)},leave(){e.parentTypeName="",e.lastParentNodeKind=ut.Kind.NULL,e.isCurrentParentExtension=!1}},EnumValueDefinition:{enter(r){e.childName=r.name.value,e.lastChildNodeKind=r.kind;let i=e.isCurrentParentExtension?(0,Tt.getOrThrowError)(e.parentExtensionDataByTypeName,e.parentTypeName,It.EXTENSIONS):(0,Tt.getOrThrowError)(e.parentDefinitionDataByTypeName,e.parentTypeName,It.PARENTS);if(i.kind!==ut.Kind.ENUM_TYPE_DEFINITION&&i.kind!==ut.Kind.ENUM_TYPE_EXTENSION)throw(0,ln.unexpectedKindFatalError)(e.childName);if(i.enumValueDataByValueName.has(e.childName)){let s=e.isCurrentParentExtension?(0,ln.duplicateValueExtensionError)("enum",e.parentTypeName,e.childName):(0,ln.duplicateEnumValueDefinitionError)(e.childName,e.parentTypeName);e.errors.push(s);return}(0,xt.upsertEnumValueDataByNode)(i.enumValueDataByValueName,r,e.errors,e.directiveDefinitionByDirectiveName,e.handledRepeatedDirectivesByHostPath,e.parentTypeName)},leave(){e.childName="",e.lastChildNodeKind=ut.Kind.NULL}},FieldDefinition:{enter(r){if(e.childName=r.name.value,n&&(e.extractEventDirectivesToConfiguration(r),e.childName===It.SERVICE_FIELD||e.childName===It.ENTITIES_FIELD))return!1;e.lastChildNodeKind=r.kind;let i=`${e.parentTypeName}.${e.childName}`;e.lastChildNodeKind=r.kind;let s=(0,ip.getNamedTypeForChild)(i,r.type);yc.BASE_SCALARS.has(s)||e.referencedTypeNames.add(s);let o=e.isCurrentParentExtension?(0,Tt.getOrThrowError)(e.parentExtensionDataByTypeName,e.parentTypeName,It.EXTENSIONS):(0,Tt.getOrThrowError)(e.parentDefinitionDataByTypeName,e.parentTypeName,It.PARENTS);if(o.kind!==ut.Kind.OBJECT_TYPE_DEFINITION&&o.kind!==ut.Kind.OBJECT_TYPE_EXTENSION&&o.kind!==ut.Kind.INTERFACE_TYPE_DEFINITION&&o.kind!==ut.Kind.INTERFACE_TYPE_EXTENSION)throw(0,ln.unexpectedKindFatalError)(e.parentTypeName);if(o.fieldDataByFieldName.has(e.childName)){e.errors.push((0,ln.duplicateFieldDefinitionError)(e.childName,e.parentTypeName));return}let a=(0,xt.extractArguments)(new Map,r,e.errors,e.directiveDefinitionByDirectiveName,e.handledRepeatedDirectivesByHostPath,e.parentsWithChildArguments,e.parentTypeName,e.subgraphName||It.N_A),u=e.extractDirectivesAndAuthorization(r,(0,xt.addInheritedDirectivesToFieldData)(o.directivesByDirectiveName,new Map)),c=(0,xt.upsertFieldDataByNode)(o.fieldDataByFieldName,r,e.errors,a,u,e.parentTypeName,e.subgraphName||It.N_A,e.isSubgraphVersionTwo),l=e.entityContainerByTypeName.get(e.parentTypeName);if(l){l.fieldNames.add(e.childName);let E=e.fieldSetContainerByTypeName.get(e.parentTypeName);if(E){(0,Tc.extractFieldSetValue)(e.childName,E.requires,c.directivesByDirectiveName.get(It.REQUIRES)),(0,Tc.extractFieldSetValue)(e.childName,E.provides,c.directivesByDirectiveName.get(It.PROVIDES));return}}let m=c.directivesByDirectiveName.get(It.PROVIDES);if(!m)return;let h=(0,Tt.getValueOrDefault)(e.fieldSetContainerByTypeName,e.parentTypeName,Tc.newFieldSetContainer);(0,Tc.extractFieldSetValue)(e.childName,h.provides,m)},leave(){e.childName="",e.lastChildNodeKind=ut.Kind.NULL}},InputObjectTypeDefinition:{enter(r){if(e.parentTypeName=r.name.value,e.parentDefinitionDataByTypeName.has(e.parentTypeName))return e.errors.push((0,ln.duplicateTypeDefinitionError)((0,Tt.kindToTypeString)(r.kind),e.parentTypeName)),!1;e.lastParentNodeKind=r.kind,(0,xt.upsertInputObjectDefinitionDataByNode)(e.parentDefinitionDataByTypeName,r,e.errors,e.directiveDefinitionByDirectiveName,e.handledRepeatedDirectivesByHostPath)},leave(){e.lastParentNodeKind=ut.Kind.NULL,e.parentTypeName=""}},InputObjectTypeExtension:{enter(r){e.parentTypeName=r.name.value,e.lastParentNodeKind=r.kind,e.isCurrentParentExtension=!0;let i=e.parentExtensionDataByTypeName.get(e.parentTypeName);if(i){if(i.kind!==ut.Kind.INPUT_OBJECT_TYPE_EXTENSION)return e.errors.push((0,ln.incompatibleExtensionKindsError)(r,i.kind)),!1;(0,xt.extractDirectives)(r,i.directivesByDirectiveName,e.errors,e.directiveDefinitionByDirectiveName,e.handledRepeatedDirectivesByHostPath,e.parentTypeName);return}(0,xt.upsertInputObjectExtensionDataByNode)(e.parentExtensionDataByTypeName,r,e.errors,e.directiveDefinitionByDirectiveName,e.handledRepeatedDirectivesByHostPath)},leave(){e.parentTypeName="",e.lastParentNodeKind=ut.Kind.NULL,e.isCurrentParentExtension=!1}},InputValueDefinition:{enter(r){let i=r.name.value;if(e.lastParentNodeKind!==ut.Kind.INPUT_OBJECT_TYPE_DEFINITION&&e.lastParentNodeKind!==ut.Kind.INPUT_OBJECT_TYPE_EXTENSION){e.argumentName=i;return}e.childName=i,e.lastChildNodeKind=r.kind;let s=(0,ip.getNamedTypeForChild)(`${e.parentTypeName}.${i}`,r.type);yc.BASE_SCALARS.has(s)||e.referencedTypeNames.add(s);let o=e.isCurrentParentExtension?(0,Tt.getOrThrowError)(e.parentExtensionDataByTypeName,e.parentTypeName,It.EXTENSIONS):(0,Tt.getOrThrowError)(e.parentDefinitionDataByTypeName,e.parentTypeName,It.PARENTS);if(o.kind!==ut.Kind.INPUT_OBJECT_TYPE_DEFINITION&&o.kind!==ut.Kind.INPUT_OBJECT_TYPE_EXTENSION)throw(0,ln.unexpectedKindFatalError)(e.parentTypeName);if(o.inputValueDataByValueName.has(i)){e.errors.push((0,ln.duplicateValueExtensionError)("input",e.parentTypeName,i));return}(0,xt.upsertInputValueDataByNode)(o.inputValueDataByValueName,r,e.errors,e.directiveDefinitionByDirectiveName,e.handledRepeatedDirectivesByHostPath,e.parentTypeName)},leave(){e.argumentName="",e.lastChildNodeKind===ut.Kind.INPUT_VALUE_DEFINITION&&(e.childName="",e.lastChildNodeKind=ut.Kind.NULL)}},InterfaceTypeDefinition:{enter(r){var a;let i=r.name.value;if(e.parentTypeName=i,e.lastParentNodeKind=r.kind,(0,Ka.isNodeExtension)(r))return e.handleExtensionWithFields(r);if(e.parentDefinitionDataByTypeName.has(i))return e.errors.push((0,ln.duplicateTypeDefinitionError)((0,Tt.kindToTypeString)(r.kind),i)),!1;let s=(0,Ka.isObjectLikeNodeEntity)(r);if((0,xt.upsertInterfaceDefinitionDataByNode)(e.parentDefinitionDataByTypeName,r,e.errors,e.directiveDefinitionByDirectiveName,e.handledRepeatedDirectivesByHostPath,s,e.subgraphName||It.N_A),!s)return;e.entityInterfaces.set(i,{concreteTypeNames:new Set,interfaceFieldNames:new Set((a=r.fields)==null?void 0:a.map(u=>u.name.value)),interfaceObjectFieldNames:new Set,isInterfaceObject:!1,typeName:i}),(0,Tt.upsertEntityContainerProperties)(e.entityContainerByTypeName,A({typeName:e.parentTypeName},e.subgraphName?{subgraphNames:[e.subgraphName]}:{}));let o=(0,Tt.getValueOrDefault)(e.fieldSetContainerByTypeName,i,Tc.newFieldSetContainer);e.extractKeyFieldSets(r,o)},leave(){let r=e.isCurrentParentExtension?(0,Tt.getOrThrowError)(e.parentExtensionDataByTypeName,e.parentTypeName,It.PARENT_EXTENSION_DATA_MAP):(0,Tt.getOrThrowError)(e.parentDefinitionDataByTypeName,e.parentTypeName,It.PARENT_DEFINITION_DATA_MAP);(0,xt.removeInheritableDirectivesFromParentWithFieldsData)(r),e.isCurrentParentExtension=!1,e.parentTypeName="",e.lastParentNodeKind=ut.Kind.NULL}},InterfaceTypeExtension:{enter(r){return e.parentTypeName=r.name.value,e.lastParentNodeKind=r.kind,e.handleExtensionWithFields(r)},leave(){(0,xt.removeInheritableDirectivesFromParentWithFieldsData)((0,Tt.getOrThrowError)(e.parentExtensionDataByTypeName,e.parentTypeName,It.PARENT_EXTENSION_DATA_MAP)),e.isCurrentParentExtension=!1,e.parentTypeName="",e.lastParentNodeKind=ut.Kind.NULL}},ObjectTypeDefinition:{enter(r){let i=r.name.value;if(i===It.SERVICE_OBJECT)return!1;if(n=(0,xt.isTypeNameRootType)(i,e.operationTypeNames),e.parentTypeName=i,e.lastParentNodeKind=r.kind,(0,Ka.addConcreteTypesForImplementedInterfaces)(r,e.abstractToConcreteTypeNames),e.handleInterfaceObject(r),(0,Ka.isNodeExtension)(r))return e.handleExtensionWithFields(r);if(e.parentDefinitionDataByTypeName.has(i))return e.errors.push((0,ln.duplicateTypeDefinitionError)((0,Tt.kindToTypeString)(r.kind),i)),!1;let s=(0,Ka.isObjectLikeNodeEntity)(r);if((0,xt.upsertObjectDefinitionDataByNode)(e.parentDefinitionDataByTypeName,r,e.errors,e.directiveDefinitionByDirectiveName,e.handledRepeatedDirectivesByHostPath,s,n,e.subgraphName||"N/A"),!s)return;let o=(0,Tt.getValueOrDefault)(e.fieldSetContainerByTypeName,i,Tc.newFieldSetContainer);e.extractKeyFieldSets(r,o),(0,Tt.upsertEntityContainerProperties)(e.entityContainerByTypeName,A({typeName:e.parentTypeName,keyFieldSets:o.keys},e.subgraphName?{subgraphNames:[e.subgraphName]}:{}))},leave(){let r=e.isCurrentParentExtension?(0,Tt.getOrThrowError)(e.parentExtensionDataByTypeName,e.parentTypeName,It.PARENT_EXTENSION_DATA_MAP):(0,Tt.getOrThrowError)(e.parentDefinitionDataByTypeName,e.parentTypeName,It.PARENT_DEFINITION_DATA_MAP);(0,xt.removeInheritableDirectivesFromParentWithFieldsData)(r),n=!1,e.isCurrentParentExtension=!1,e.parentTypeName="",e.lastParentNodeKind=ut.Kind.NULL}},ObjectTypeExtension:{enter(r){return e.parentTypeName=r.name.value,e.parentTypeName===It.SERVICE_OBJECT?!1:(n=(0,xt.isTypeNameRootType)(e.parentTypeName,e.operationTypeNames),e.lastParentNodeKind=r.kind,(0,Ka.addConcreteTypesForImplementedInterfaces)(r,e.abstractToConcreteTypeNames),e.handleExtensionWithFields(r))},leave(){(0,xt.removeInheritableDirectivesFromParentWithFieldsData)((0,Tt.getOrThrowError)(e.parentExtensionDataByTypeName,e.parentTypeName,It.PARENT_EXTENSION_DATA_MAP)),n=!1,e.isCurrentParentExtension=!1,e.parentTypeName="",e.lastParentNodeKind=ut.Kind.NULL}},ScalarTypeDefinition:{enter(r){let i=r.name.value;if(i===It.ANY_SCALAR)return!1;if(e.parentDefinitionDataByTypeName.get(i))return e.errors.push((0,ln.duplicateTypeDefinitionError)((0,Tt.kindToTypeString)(r.kind),i)),!1;e.parentTypeName=i,e.lastParentNodeKind=r.kind;let o=e.extractDirectivesAndAuthorization(r,new Map);(0,xt.upsertScalarDefinitionDataByNode)(e.parentDefinitionDataByTypeName,r,o)},leave(){e.parentTypeName="",e.lastParentNodeKind=ut.Kind.NULL}},ScalarTypeExtension:{enter(r){if(e.parentTypeName=r.name.value,e.parentTypeName===It.ANY_SCALAR)return!1;e.lastParentNodeKind=r.kind;let i=e.parentExtensionDataByTypeName.get(e.parentTypeName);if(i)return i.kind!==ut.Kind.SCALAR_TYPE_EXTENSION?(e.errors.push((0,ln.incompatibleExtensionKindsError)(r,i.kind)),!1):(e.extractDirectivesAndAuthorization(r,i.directivesByDirectiveName),!1);let s=e.extractDirectivesAndAuthorization(r,new Map);return(0,xt.upsertScalarExtensionDataByNode)(e.parentExtensionDataByTypeName,r,s),!1},leave(){e.parentTypeName="",e.lastParentNodeKind=ut.Kind.NULL}},UnionTypeDefinition:{enter(r){if(e.parentTypeName=r.name.value,e.parentTypeName===It.ENTITY_UNION)return!1;if(e.parentDefinitionDataByTypeName.get(e.parentTypeName))return e.errors.push((0,ln.duplicateTypeDefinitionError)((0,Tt.kindToTypeString)(r.kind),e.parentTypeName)),!1;e.lastParentNodeKind=r.kind,(0,xt.upsertUnionDefinitionDataByNode)(e.parentDefinitionDataByTypeName,r,e.errors,e.directiveDefinitionByDirectiveName,e.handledRepeatedDirectivesByHostPath,e.abstractToConcreteTypeNames,e.referencedTypeNames)},leave(){e.parentTypeName="",e.lastParentNodeKind=ut.Kind.NULL}},UnionTypeExtension:{enter(r){var s;if(e.parentTypeName=r.name.value,e.parentTypeName===It.ENTITY_UNION)return!1;let i=e.parentExtensionDataByTypeName.get(e.parentTypeName);return(s=r.types)!=null&&s.length?(e.lastParentNodeKind=r.kind,(0,Ka.addConcreteTypesForUnion)(r,e.abstractToConcreteTypeNames),i?i.kind!==ut.Kind.UNION_TYPE_EXTENSION?(e.errors.push((0,ln.incompatibleExtensionKindsError)(r,i.kind)),!1):((0,xt.extractDirectives)(r,i.directivesByDirectiveName,e.errors,e.directiveDefinitionByDirectiveName,e.handledRepeatedDirectivesByHostPath,e.parentTypeName),(0,xt.extractUniqueUnionMembers)(r.types,i.memberByMemberTypeName,e.errors,e.parentTypeName,e.abstractToConcreteTypeNames,e.referencedTypeNames),!1):((0,xt.upsertUnionExtensionDataByNode)(e.parentExtensionDataByTypeName,r,e.errors,e.directiveDefinitionByDirectiveName,e.handledRepeatedDirectivesByHostPath,e.abstractToConcreteTypeNames,e.referencedTypeNames),!1)):(e.errors.push((0,ln.noDefinedUnionMembersError)(e.parentTypeName,!0)),!1)},leave(){e.parentTypeName="",e.lastParentNodeKind=ut.Kind.NULL}}})}Jo.upsertParentsAndChildren=G2;function q2(e,t){let n,r=!1;(0,ut.visit)(t,{FieldDefinition:{enter(i){e.childName=i.name.value;let s=(0,ip.getNamedTypeForChild)(`${e.parentTypeName}.${e.childName}`,i.type),o=e.leafTypeNamesWithAuthorizationDirectives.has(s);if((!n||!n.hasParentLevelAuthorization)&&!o)return!1;n||(n=(0,Tt.setAndGetValue)(e.authorizationDataByParentTypeName,e.parentTypeName,(0,Tt.newAuthorizationData)(e.parentTypeName)));let a=(0,Tt.getValueOrDefault)(n.fieldAuthorizationDataByFieldName,e.childName,()=>(0,Tt.newFieldAuthorizationData)(e.childName));if(!(0,Tt.mergeAuthorizationDataByAND)(n,a))return e.invalidOrScopesHostPaths.add(`${e.parentTypeName}.${e.childName}`),!1;if(!o)return!1;if(r)return(0,Tt.getValueOrDefault)(e.heirFieldAuthorizationDataByTypeName,s,()=>[]).push(a),!1;let u=e.authorizationDataByParentTypeName.get(s);return u&&u.hasParentLevelAuthorization&&!(0,Tt.mergeAuthorizationDataByAND)(u,a)&&e.invalidOrScopesHostPaths.add(`${e.parentTypeName}.${e.childName}`),!1},leave(){e.childName=""}},InterfaceTypeDefinition:{enter(i){e.parentTypeName=i.name.value,n=e.getAuthorizationData(i),r=!0},leave(){e.parentTypeName="",n=void 0,r=!1}},InterfaceTypeExtension:{enter(i){e.parentTypeName=i.name.value,n=e.getAuthorizationData(i),r=!0},leave(){e.parentTypeName="",n=void 0,r=!1}},ObjectTypeDefinition:{enter(i){e.parentTypeName=i.name.value,n=e.getAuthorizationData(i)},leave(){e.parentTypeName="",n=void 0}},ObjectTypeExtension:{enter(i){e.parentTypeName=i.name.value,n=e.getAuthorizationData(i)},leave(){e.parentTypeName="",n=void 0}}})}Jo.consolidateAuthorizationDirectives=q2});var tv=L(Yi=>{"use strict";d();f();p();Object.defineProperty(Yi,"__esModule",{value:!0});Yi.batchNormalize=Yi.NormalizationFactory=Yi.normalizeSubgraph=Yi.normalizeSubgraphFromString=void 0;var Le=(ne(),se(ce)),Ec=Ar(),Qa=Zu(),Ya=Oo(),ZI=wo(),ot=ds(),Ke=ai(),yt=Or(),K2=XL(),sp=VN(),Q2=Af(),Y2=xf(),J2=zI(),ev=WI(),er=jh();function z2(e){let{error:t,documentNode:n}=(0,Ec.safeParse)(e);return t||!n?{errors:[(0,Ke.subgraphInvalidSyntaxError)(t)]}:new op().normalize(n)}Yi.normalizeSubgraphFromString=z2;function rR(e,t){return new op(t).normalize(e)}Yi.normalizeSubgraph=rR;var op=class{constructor(t){S(this,"abstractToConcreteTypeNames",new Map);S(this,"directiveDefinitionByDirectiveName",new Map);S(this,"argumentName","");S(this,"authorizationDataByParentTypeName",new Map);S(this,"childName","");S(this,"configurationDataMap",new Map);S(this,"customDirectiveDefinitions",new Map);S(this,"errors",[]);S(this,"entityContainerByTypeName",new Map);S(this,"entityInterfaces",new Map);S(this,"parentExtensionDataByTypeName",new Map);S(this,"interfaceTypeNamesWithAuthorizationDirectives",new Set);S(this,"isCurrentParentExtension",!1);S(this,"isSubgraphVersionTwo",!1);S(this,"fieldSetContainerByTypeName",new Map);S(this,"heirFieldAuthorizationDataByTypeName",new Map);S(this,"handledRepeatedDirectivesByHostPath",new Map);S(this,"lastParentNodeKind",Le.Kind.NULL);S(this,"lastChildNodeKind",Le.Kind.NULL);S(this,"leafTypeNamesWithAuthorizationDirectives",new Set);S(this,"keyFieldNamesByParentTypeName",new Map);S(this,"operationTypeNames",new Map);S(this,"parentDefinitionDataByTypeName",new Map);S(this,"parentTypeName","");S(this,"parentsWithChildArguments",new Set);S(this,"eventsConfigurations",new Map);S(this,"overridesByTargetSubgraphName",new Map);S(this,"invalidOrScopesHostPaths",new Set);S(this,"schemaDefinition");S(this,"referencedDirectiveNames",new Set);S(this,"referencedTypeNames",new Set);S(this,"warnings",[]);S(this,"subgraphName");for(let[n,r]of Ya.BASE_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME)this.directiveDefinitionByDirectiveName.set(n,r);this.subgraphName=t,this.schemaDefinition={directivesByDirectiveName:new Map,kind:Le.Kind.SCHEMA_DEFINITION,typeName:yt.SCHEMA,operationTypes:new Map}}validateInputNamedType(t){if(Ya.BASE_SCALARS.has(t))return{hasUnhandledError:!1,typeString:""};let n=this.parentDefinitionDataByTypeName.get(t);if(!n)return this.errors.push((0,Ke.undefinedTypeError)(t)),{hasUnhandledError:!1,typeString:""};switch(n.kind){case Le.Kind.ENUM_TYPE_DEFINITION:case Le.Kind.INPUT_OBJECT_TYPE_DEFINITION:case Le.Kind.SCALAR_TYPE_DEFINITION:return{hasUnhandledError:!1,typeString:""};default:return{hasUnhandledError:!0,typeString:(0,ot.kindToTypeString)(n.kind)}}}extractArguments(t,n,r){if(!t.arguments)return n;this.parentsWithChildArguments.add(this.parentTypeName);let i=new Set;for(let s of t.arguments){let o=s.name.value;if(n.has(o)){i.add(o);continue}n.set(o,(0,Q2.inputValueDefinitionNodeToMutable)(s,this.parentTypeName))}return i.size>0&&this.errors.push((0,Ke.duplicateArgumentsError)(r,[...i])),n}validateArguments(t,n){let r=[];for(let[i,s]of t.argumentDataByArgumentName){let o=(0,ZI.getNamedTypeForChild)(n+`(${i}...)`,s.type),{hasUnhandledError:a,typeString:u}=this.validateInputNamedType(o);a&&r.push({argumentName:i,namedType:o,typeString:u,typeName:(0,sp.printTypeNode)(s.type)})}r.length>0&&this.errors.push((0,Ke.invalidArgumentsError)(n,r))}getAuthorizationData(t){let n=this.authorizationDataByParentTypeName.get(this.parentTypeName);if((0,ot.resetAuthorizationData)(n),!t.directives)return n;let r=!1,i=[];for(let u of t.directives){let c=u.name.value;if(c===yt.AUTHENTICATED){if(r)return;r=!0;continue}if(c===yt.REQUIRES_SCOPES){if(i.length>0)return;i.push(u)}}if(!r&&i.length<1||((0,ot.isNodeKindInterface)(t.kind)&&this.interfaceTypeNamesWithAuthorizationDirectives.add(this.parentTypeName),n||(n=(0,ot.setAndGetValue)(this.authorizationDataByParentTypeName,this.parentTypeName,(0,ot.newAuthorizationData)(this.parentTypeName))),n.hasParentLevelAuthorization=!0,n.requiresAuthentication=r,i.length!==1))return n;let s=i[0];if(!s.arguments||s.arguments.length!==1)return;let o=s.arguments[0];if(o.name.value!==yt.SCOPES||o.value.kind!==Le.Kind.LIST)return;let a=o.value.values;if(a.length<1)return n;if(a.length>ot.maxOrScopes){this.invalidOrScopesHostPaths.add(this.parentTypeName);return}for(let u of a){if(u.kind!==Le.Kind.LIST)return;let c=new Set;for(let l of u.values){if(l.kind!==Le.Kind.STRING)return;c.add(l.value)}c.size&&n.requiredScopes.push(c)}return n}extractDirectivesAndAuthorization(t,n){if(!t.directives)return n;let r=this.childName?`${this.parentTypeName}.${this.childName}`:this.parentTypeName,i=[];for(let a of t.directives){let u=(0,er.getDirectiveValidationErrors)(a,t.kind,n,this.directiveDefinitionByDirectiveName,this.handledRepeatedDirectivesByHostPath,r),c=a.name.value;if(u.length>0){this.errors.push((0,Ke.invalidDirectiveError)(c,r,u));continue}if(c===yt.EXTENDS)continue;if(c===yt.OVERRIDE){this.handleOverrideDeclaration(a,r,u),u.length>0&&this.errors.push((0,Ke.invalidDirectiveError)(c,r,u));continue}if(c===yt.AUTHENTICATED||c===yt.REQUIRES_SCOPES){i.push(a);continue}let l=n.get(c);l&&l.push(a),n.set(c,[a])}if(i.length<1)return n;t.kind!==Le.Kind.FIELD_DEFINITION&&this.leafTypeNamesWithAuthorizationDirectives.add(this.parentTypeName);let s=(0,ot.getValueOrDefault)(this.authorizationDataByParentTypeName,this.parentTypeName,()=>(0,ot.newAuthorizationData)(this.parentTypeName)),o=(0,ot.getAuthorizationDataToUpdate)(s,t,this.childName);for(let a of i){if(a.name.value===yt.AUTHENTICATED){o.requiresAuthentication=!0;continue}let c=a.arguments[0].value.values;if(c.length>ot.maxOrScopes){this.invalidOrScopesHostPaths.add(r);continue}for(let l of c){let m=new Set;for(let h of l.values)m.add(h.value);m.size&&o.requiredScopes.push(m)}}return n}mergeUniqueInterfaces(t,n,r){for(let i of t){if(!n.has(i)){n.add(i);continue}this.errors.push((0,Ke.duplicateInterfaceExtensionError)(i,r))}}handleInterfaceObject(t){var r;if(!(0,Ec.isNodeInterfaceObject)(t))return;let n=t.name.value;this.entityInterfaces.has(n)||this.entityInterfaces.set(n,{interfaceObjectFieldNames:new Set((r=t.fields)==null?void 0:r.map(i=>i.name.value)),interfaceFieldNames:new Set,isInterfaceObject:!0,typeName:n})}handleExtensionWithFields(t){this.isCurrentParentExtension=!0;let n=this.parentExtensionDataByTypeName.get(this.parentTypeName),r=(0,er.convertKindForExtension)(t);if(n){if(n.kind!==r)return this.errors.push((0,Ke.incompatibleExtensionKindsError)(t,n.kind)),!1;(0,er.extractDirectives)(t,n.directivesByDirectiveName,this.errors,this.directiveDefinitionByDirectiveName,this.handledRepeatedDirectivesByHostPath,this.parentTypeName),(0,Ec.extractInterfaces)(t,n.implementedInterfaceTypeNames,this.errors);return}let i=(0,Ec.isObjectLikeNodeEntity)(t);if((0,er.upsertExtensionWithFieldsDataByNode)(this.parentExtensionDataByTypeName,t,this.errors,this.directiveDefinitionByDirectiveName,this.handledRepeatedDirectivesByHostPath,i),t.kind===Le.Kind.INTERFACE_TYPE_DEFINITION||t.kind===Le.Kind.INTERFACE_TYPE_EXTENSION||!i)return;let s=(0,ot.getValueOrDefault)(this.fieldSetContainerByTypeName,this.parentTypeName,Qa.newFieldSetContainer);this.extractKeyFieldSets(t,s),(0,ot.upsertEntityContainerProperties)(this.entityContainerByTypeName,A({typeName:this.parentTypeName,keyFieldSets:s.keys},this.subgraphName?{subgraphNames:[this.subgraphName]}:{}))}isTypeValidImplementation(t,n){if(t.kind===Le.Kind.NON_NULL_TYPE)return n.kind!==Le.Kind.NON_NULL_TYPE?!1:this.isTypeValidImplementation(t.type,n.type);if(n.kind===Le.Kind.NON_NULL_TYPE)return this.isTypeValidImplementation(t,n.type);switch(t.kind){case Le.Kind.NAMED_TYPE:if(n.kind===Le.Kind.NAMED_TYPE){let r=t.name.value,i=n.name.value;if(r===i)return!0;let s=this.abstractToConcreteTypeNames.get(r);return s?s.has(i):!1}return!1;default:return n.kind===Le.Kind.LIST_TYPE?this.isTypeValidImplementation(t.type,n.type):!1}}extractKeyFieldSets(t,n){var o;let r=n.keys,i=t.name.value;if(!((o=t.directives)!=null&&o.length)){this.errors.push((0,Ke.expectedEntityError)(i));return}let s=[];for(let a of t.directives)if(a.name.value===yt.KEY){if(!a.arguments||a.arguments.length<1){s.push((0,Ke.undefinedRequiredArgumentsErrorMessage)(yt.KEY,i,[yt.FIELDS]));continue}for(let u of a.arguments){let c=u.name.value;if(u.name.value===yt.RESOLVABLE){u.value.kind===Le.Kind.BOOLEAN&&!u.value.value&&(n.disableEntityResolver=!0);continue}if(u.name.value!==yt.FIELDS){s.push((0,Ke.unexpectedDirectiveArgumentErrorMessage)(yt.KEY,c));break}if(u.value.kind!==Le.Kind.STRING){s.push((0,Ke.invalidKeyDirectiveArgumentErrorMessage)(u.value.kind));break}r.add(u.value.value)}}s.length&&this.errors.push((0,Ke.invalidKeyDirectivesError)(i,s))}validateInterfaceImplementations(t){if(t.implementedInterfaceTypeNames.size<1)return;let n=new Map;for(let r of t.implementedInterfaceTypeNames){let i=(0,ot.getOrThrowError)(this.parentDefinitionDataByTypeName,r,yt.PARENTS);if(i.kind!==Le.Kind.INTERFACE_TYPE_DEFINITION)throw(0,Ke.incompatibleParentKindFatalError)(r,Le.Kind.INTERFACE_TYPE_DEFINITION,i.kind);let s={invalidFieldImplementations:new Map,unimplementedFields:[]},o=!1;for(let[a,u]of i.fieldDataByFieldName){let c=!1,l=t.fieldDataByFieldName.get(a);if(!l){o=!0,s.unimplementedFields.push(a);continue}let m={invalidAdditionalArguments:new Set,invalidImplementedArguments:[],originalResponseType:(0,sp.printTypeNode)(u.node.type),unimplementedArguments:new Set};this.isTypeValidImplementation(u.node.type,l.node.type)||(o=!0,c=!0,m.implementedResponseType=(0,sp.printTypeNode)(l.node.type));let h=new Set;for(let[E,N]of u.argumentDataByArgumentName){h.add(E);let D=l.argumentDataByArgumentName.get(E);if(!D){o=!0,c=!0,m.unimplementedArguments.add(E);continue}let w=(0,sp.printTypeNode)(D.type),x=(0,sp.printTypeNode)(N.type);x!==w&&(o=!0,c=!0,m.invalidImplementedArguments.push({actualType:w,argumentName:E,expectedType:x}))}for(let[E,N]of l.argumentDataByArgumentName)h.has(E)||N.type.kind===Le.Kind.NON_NULL_TYPE&&(o=!0,c=!0,m.invalidAdditionalArguments.add(E));c&&s.invalidFieldImplementations.set(a,m)}o&&n.set(r,s)}n.size&&this.errors.push((0,Ke.unimplementedInterfaceFieldsError)(t.typeName,(0,ot.kindToTypeString)(t.kind),n))}handleOverrideDeclaration(t,n,r){let i=t.arguments[0];if(i.value.kind!==Le.Kind.STRING){r.push((0,Ke.invalidDirectiveArgumentTypeErrorMessage)(!0,yt.FROM,Le.Kind.STRING,i.value.kind));return}let s=i.value.value;if(s===this.subgraphName){r.push((0,Ke.equivalentSourceAndTargetOverrideErrorMessage)(s,n));return}let o=(0,ot.getValueOrDefault)(this.overridesByTargetSubgraphName,s,()=>new Map);(0,ot.getValueOrDefault)(o,this.parentTypeName,()=>new Set).add(this.childName)}extractEventDirectivesToConfiguration(t){if(t.directives)for(let n of t.directives){let r;switch(n.name.value){case yt.EVENTS_PUBLISH:{r="publish";break}case yt.EVENTS_REQUEST:{r="request";break}case yt.EVENTS_SUBSCRIBE:{r="subscribe";break}default:continue}let i,s;for(let a of n.arguments||[]){if(a.value.kind!==Le.Kind.STRING)throw new Error(`Event directive arguments must be strings, ${a.value.kind} found in argument ${a.name}`);switch(a.name.value){case yt.TOPIC:{if(i!==void 0)throw new Error("Event directives must have exactly one topic argument, found multiple");if(!a.value.value)throw new Error("Event directives must have a non-empty topic argument");i=a.value.value;break}case yt.SOURCE_ID:{if(s!==void 0)throw new Error("Event directives must have exactly one sourceID argument, found multiple");if(!a.value.value)throw new Error("Event directives must have a non-empty sourceID argument");s=a.value.value;break}default:throw new Error(`Unknown argument ${a.name.value} found in event directive`)}}if(!i)throw new Error("Event directives must have a topic argument");(0,ot.getValueOrDefault)(this.eventsConfigurations,this.parentTypeName,()=>[]).push({type:r,fieldName:this.childName,topic:i,sourceId:s})}}normalize(t){(0,ev.upsertDirectiveAndSchemaDefinitions)(this,t),(0,ev.upsertParentsAndChildren)(this,t),(0,ev.consolidateAuthorizationDirectives)(this,t);for(let o of this.interfaceTypeNamesWithAuthorizationDirectives){let a=this.authorizationDataByParentTypeName.get(o);if(!a)continue;let u=this.abstractToConcreteTypeNames.get(o);for(let c of u||[]){let l=(0,ot.getValueOrDefault)(this.authorizationDataByParentTypeName,c,()=>(0,ot.newAuthorizationData)(c));for(let[m,h]of a.fieldAuthorizationDataByFieldName)(0,ot.upsertFieldAuthorizationData)(l.fieldAuthorizationDataByFieldName,h)||this.invalidOrScopesHostPaths.add(`${c}.${m}`)}}for(let[o,a]of this.heirFieldAuthorizationDataByTypeName){let u=this.authorizationDataByParentTypeName.get(o);if(u)for(let c of a)(0,ot.mergeAuthorizationDataByAND)(u,c)||this.invalidOrScopesHostPaths.add(`${o}.${c.fieldName}`)}this.invalidOrScopesHostPaths.size>0&&this.errors.push((0,Ke.orScopesLimitError)(ot.maxOrScopes,[...this.invalidOrScopesHostPaths]));let n=[];for(let o of Ya.BASE_DIRECTIVE_DEFINITIONS)n.push(o);if(n.push(Ya.FIELD_SET_SCALAR_DEFINITION),this.isSubgraphVersionTwo){for(let o of Ya.VERSION_TWO_DIRECTIVE_DEFINITIONS)n.push(o),this.directiveDefinitionByDirectiveName.set(o.name.value,o);n.push(Ya.SCOPE_SCALAR_DEFINITION)}for(let o of this.customDirectiveDefinitions.values())n.push(o);this.schemaDefinition.operationTypes.size>0&&n.push((0,er.getSchemaNodeByData)(this.schemaDefinition,this.errors,this.directiveDefinitionByDirectiveName));let r=new Set,i=new Set;for(let[o,a]of this.parentExtensionDataByTypeName){let u=this.entityContainerByTypeName.has(o),c={fieldNames:new Set,isRootNode:u,typeName:o};this.configurationDataMap.set(o,c),a.kind===Le.Kind.OBJECT_TYPE_EXTENSION&&(this.operationTypeNames.has(o)&&(a.fieldDataByFieldName.delete(yt.SERVICE_FIELD),a.fieldDataByFieldName.delete(yt.ENTITIES_FIELD)),(0,Qa.addNonExternalFieldsToSet)(a.fieldDataByFieldName,c.fieldNames));let l=this.parentDefinitionDataByTypeName.get(o);if(!l){a.kind!==Le.Kind.OBJECT_TYPE_EXTENSION?this.errors.push((0,Ke.noBaseTypeExtensionError)(o)):(this.validateInterfaceImplementations(a),r.add(o),n.push((0,er.getParentWithFieldsNodeByData)(a,this.errors,this.directiveDefinitionByDirectiveName,this.authorizationDataByParentTypeName)));continue}if(!(0,Ec.areBaseAndExtensionKindsCompatible)(l.kind,a.kind,o)){this.errors.push((0,Ke.incompatibleExtensionError)(o,l.kind,a.kind));continue}switch(l.kind){case Le.Kind.ENUM_TYPE_DEFINITION:let m=a;for(let[D,w]of m.enumValueDataByValueName){if(!l.enumValueDataByValueName.has(D)){l.enumValueDataByValueName.set(D,w);continue}this.errors.push((0,Ke.duplicateEnumValueDefinitionError)(D,o))}n.push((0,er.getEnumNodeByData)(l,this.errors,this.directiveDefinitionByDirectiveName,this.authorizationDataByParentTypeName,m));break;case Le.Kind.INPUT_OBJECT_TYPE_DEFINITION:let h=a;for(let[D,w]of h.inputValueDataByValueName){if(!l.inputValueDataByValueName.has(D)){l.inputValueDataByValueName.set(D,w);continue}this.errors.push((0,Ke.duplicateFieldDefinitionError)(D,o))}n.push((0,er.getInputObjectNodeByData)(l,this.errors,this.directiveDefinitionByDirectiveName,this.authorizationDataByParentTypeName,h));break;case Le.Kind.INTERFACE_TYPE_DEFINITION:case Le.Kind.OBJECT_TYPE_DEFINITION:let E=a,N=this.operationTypeNames.get(o);N&&(E.fieldDataByFieldName.delete(yt.SERVICE_FIELD),E.fieldDataByFieldName.delete(yt.ENTITIES_FIELD));for(let[D,w]of E.fieldDataByFieldName){if(w.argumentDataByArgumentName.size>0&&this.validateArguments(w,`${o}.${D}`),l.fieldDataByFieldName.has(D)){this.errors.push((0,Ke.duplicateFieldDefinitionError)(D,o));continue}l.fieldDataByFieldName.set(D,w),w.argumentDataByArgumentName.has(yt.EXTERNAL)||c.fieldNames.add(D)}this.mergeUniqueInterfaces(E.implementedInterfaceTypeNames,l.implementedInterfaceTypeNames,o),this.validateInterfaceImplementations(l),n.push((0,er.getParentWithFieldsNodeByData)(l,this.errors,this.directiveDefinitionByDirectiveName,this.authorizationDataByParentTypeName,E)),l.fieldDataByFieldName.size<1&&!(0,Qa.isNodeQuery)(o,N)&&this.errors.push((0,Ke.noFieldDefinitionsError)((0,ot.kindToTypeString)(l.kind),o)),(0,Qa.addNonExternalFieldsToSet)(l.fieldDataByFieldName,c.fieldNames);break;case Le.Kind.SCALAR_TYPE_DEFINITION:n.push((0,er.getScalarNodeByData)(l,this.errors,this.directiveDefinitionByDirectiveName,a));break;case Le.Kind.UNION_TYPE_DEFINITION:n.push((0,er.getUnionNodeByData)(l,this.errors,this.directiveDefinitionByDirectiveName,a));break;default:throw(0,Ke.unexpectedKindFatalError)(o)}i.add(o)}for(let[o,a]of this.parentDefinitionDataByTypeName)if(!i.has(o))switch(a.kind){case Le.Kind.ENUM_TYPE_DEFINITION:n.push((0,er.getEnumNodeByData)(a,this.errors,this.directiveDefinitionByDirectiveName,this.authorizationDataByParentTypeName));break;case Le.Kind.INPUT_OBJECT_TYPE_DEFINITION:n.push((0,er.getInputObjectNodeByData)(a,this.errors,this.directiveDefinitionByDirectiveName,this.authorizationDataByParentTypeName));break;case Le.Kind.INTERFACE_TYPE_DEFINITION:case Le.Kind.OBJECT_TYPE_DEFINITION:let u=this.entityContainerByTypeName.has(o),c=this.operationTypeNames.get(o);if(c&&(a.fieldDataByFieldName.delete(yt.SERVICE_FIELD),a.fieldDataByFieldName.delete(yt.ENTITIES_FIELD)),this.parentsWithChildArguments.has(o)){if(a.kind!==Le.Kind.OBJECT_TYPE_DEFINITION&&a.kind!==Le.Kind.INTERFACE_TYPE_DEFINITION)continue;for(let[E,N]of a.fieldDataByFieldName)this.validateArguments(N,`${o}.${E}`)}let l={fieldNames:new Set,isRootNode:u,typeName:o},m=this.entityInterfaces.get(o);m&&(m.concreteTypeNames=this.abstractToConcreteTypeNames.get(o)||new Set,l.isInterfaceObject=m.isInterfaceObject,l.entityInterfaceConcreteTypeNames=m.concreteTypeNames);let h=this.eventsConfigurations.get(o);h&&(l.events=h),this.configurationDataMap.set(o,l),(0,Qa.addNonExternalFieldsToSet)(a.fieldDataByFieldName,l.fieldNames),this.validateInterfaceImplementations(a),n.push((0,er.getParentWithFieldsNodeByData)(a,this.errors,this.directiveDefinitionByDirectiveName,this.authorizationDataByParentTypeName)),a.fieldDataByFieldName.size<1&&!(0,Qa.isNodeQuery)(o,c)&&this.errors.push((0,Ke.noFieldDefinitionsError)((0,ot.kindToTypeString)(a.kind),o));break;case Le.Kind.SCALAR_TYPE_DEFINITION:n.push((0,er.getScalarNodeByData)(a,this.errors,this.directiveDefinitionByDirectiveName));break;case Le.Kind.UNION_TYPE_DEFINITION:n.push((0,er.getUnionNodeByData)(a,this.errors,this.directiveDefinitionByDirectiveName));break;default:throw(0,Ke.unexpectedKindFatalError)(o)}for(let o of Object.values(Le.OperationTypeNode)){let a=this.schemaDefinition.operationTypes.get(o),u=(0,ot.getOrThrowError)(Ec.operationTypeNodeToDefaultType,o,yt.OPERATION_TO_DEFAULT),c=a?(0,ZI.getNamedTypeForChild)(`schema.${o}`,a.type):u;if(c!==u&&(this.parentDefinitionDataByTypeName.has(u)||this.parentExtensionDataByTypeName.has(u))){this.errors.push((0,Ke.invalidRootTypeDefinitionError)(o,c,u));continue}let l=this.parentDefinitionDataByTypeName.get(c),m=this.parentExtensionDataByTypeName.get(c);if(a){if(!l&&!m){this.errors.push((0,Ke.undefinedTypeError)(c));continue}this.operationTypeNames.set(c,o)}if(!l&&!m)continue;let h=this.configurationDataMap.get(c);h&&(h.isRootNode=!0,h.typeName=u);let E=[l,m];for(let N of E)if(N){if(N.kind!==Le.Kind.OBJECT_TYPE_DEFINITION&&N.kind!==Le.Kind.OBJECT_TYPE_EXTENSION){this.errors.push((0,Ke.operationDefinitionError)(c,o,N.kind));continue}for(let[D,w]of N.fieldDataByFieldName){let x=`${c}.${D}`,Y=(0,ZI.getNamedTypeForChild)(x,w.node.type);!Ya.BASE_SCALARS.has(Y)&&!this.parentDefinitionDataByTypeName.has(Y)&&!r.has(Y)&&this.errors.push((0,Ke.undefinedTypeError)(Y))}}}for(let o of this.referencedTypeNames){if(this.parentDefinitionDataByTypeName.has(o)||this.entityContainerByTypeName.has(o))continue;let a=this.parentExtensionDataByTypeName.get(o);(!a||a.kind!==Le.Kind.OBJECT_TYPE_EXTENSION)&&this.errors.push((0,Ke.undefinedTypeError)(o))}for(let[o,a]of this.fieldSetContainerByTypeName){let u=this.parentDefinitionDataByTypeName.get(o)||this.parentExtensionDataByTypeName.get(o);if(!u||u.kind!==Le.Kind.OBJECT_TYPE_DEFINITION&&u.kind!=Le.Kind.OBJECT_TYPE_EXTENSION&&u.kind!==Le.Kind.INTERFACE_TYPE_DEFINITION&&u.kind!==Le.Kind.INTERFACE_TYPE_EXTENSION){this.errors.push((0,Ke.undefinedObjectLikeParentError)(o));continue}(0,Qa.validateAndAddDirectivesWithFieldSetToConfigurationData)(this,u,a)}if(this.errors.length>0)return{errors:this.errors};let s={kind:Le.Kind.DOCUMENT,definitions:n};return{normalizationResult:{authorizationDataByParentTypeName:this.authorizationDataByParentTypeName,configurationDataMap:this.configurationDataMap,entityContainerByTypeName:this.entityContainerByTypeName,entityInterfaces:this.entityInterfaces,parentExtensionDataByTypeName:this.parentExtensionDataByTypeName,isVersionTwo:this.isSubgraphVersionTwo,keyFieldNamesByParentTypeName:this.keyFieldNamesByParentTypeName,operationTypes:this.operationTypeNames,overridesByTargetSubgraphName:this.overridesByTargetSubgraphName,parentDataByTypeName:this.parentDefinitionDataByTypeName,subgraphAST:s,subgraphString:(0,Le.print)(s),schema:(0,K2.buildASTSchema)(s,{assumeValid:!0})}}}};Yi.NormalizationFactory=op;function X2(e){let t=new Map,n=new Map,r=new Map,i=new Map,s=new Map,o=new Set,a=new Map,u=new Set,c=new Set,l=[],m=new Set,h=[],E=[];for(let D of e)D.name&&(0,Y2.recordSubgraphName)(D.name,u,c);for(let D=0;Dnew Map),De=(0,ot.getValueOrDefault)(X,et,()=>new Set(Pt));(0,ot.addIterableValuesToSet)(Pt,De)}for(let X of Pt){let De=`${et}.${X}`,sn=s.get(De);if(!sn){s.set(De,[x]);continue}sn.push(x),o.add(De)}}}}let N=[];if(m.size>0&&N.push((0,Ke.orScopesLimitError)(ot.maxOrScopes,[...m])),(l.length>0||c.size>0)&&N.push((0,Ke.invalidSubgraphNamesError)([...c],l)),o.size>0){let D=[];for(let w of o){let x=(0,ot.getOrThrowError)(s,w,"overrideSourceSubgraphNamesByFieldPath");D.push((0,Ke.duplicateOverriddenFieldErrorMessage)(w,x))}N.push((0,Ke.duplicateOverriddenFieldsError)(D))}if(N.push(...E),N.length>0)return A({authorizationDataByParentTypeName:t,entityContainerByTypeName:n,errors:N,internalSubgraphBySubgraphName:r},h.length>0?{warnings:h}:{});for(let[D,w]of i){let x=(0,ot.getOrThrowError)(r,D,"internalSubgraphBySubgraphName");x.overriddenFieldNamesByParentTypeName=w;for(let[Y,Q]of w){let W=x.configurationDataMap.get(Y);W&&((0,ot.subtractSourceSetFromTargetSet)(Q,W.fieldNames),W.fieldNames.size<1&&x.configurationDataMap.delete(Y))}}return A({authorizationDataByParentTypeName:t,entityContainerByTypeName:n,internalSubgraphBySubgraphName:r},h.length>0?{warnings:h}:{})}Yi.batchNormalize=X2});var oR=L(gc=>{"use strict";d();f();p();Object.defineProperty(gc,"__esModule",{value:!0});gc.federateSubgraphs=gc.FederationFactory=void 0;var H2=(H0(),se(X0)),H=(ne(),se(ce)),Er=Af(),rt=Ar(),Se=ai(),Ji=wo(),Sn=bf(),iR=xf(),ct=Or(),Ue=ds(),ap=VN(),Nc=Oo(),W2=tv(),sR=Zu(),Gh=class{constructor(t,n,r,i,s){S(this,"authorizationDataByParentTypeName");S(this,"abstractToConcreteTypeNames",new Map);S(this,"areFieldsExternal",!1);S(this,"areFieldsShareable",!1);S(this,"argumentTypeNameSet",new Set);S(this,"fieldConfigurationByFieldPath",new Map);S(this,"entityInterfaceFederationDataByTypeName");S(this,"executableDirectives",new Set);S(this,"parentTypeName","");S(this,"persistedDirectives",new Set([ct.DEPRECATED,ct.INACCESSIBLE,ct.TAG]));S(this,"persistedDirectiveDefinitions",new Set([ct.AUTHENTICATED,ct.DEPRECATED,ct.INACCESSIBLE,ct.TAG,ct.REQUIRES_SCOPES]));S(this,"currentSubgraphName","");S(this,"childName","");S(this,"directiveDefinitions",new Map);S(this,"entityContainersByTypeName");S(this,"errors",[]);S(this,"evaluatedObjectLikesBySubgraph",new Map);S(this,"extensions",new Map);S(this,"graph",new H2.MultiGraph);S(this,"graphEdges",new Set);S(this,"graphPaths",new Map);S(this,"inputFieldTypeNameSet",new Set);S(this,"invalidOrScopesHostPaths",new Set);S(this,"isCurrentParentEntity",!1);S(this,"isCurrentParentInterface",!1);S(this,"isCurrentSubgraphVersionTwo",!1);S(this,"isCurrentParentExtensionType",!1);S(this,"isParentRootType",!1);S(this,"isParentInputObject",!1);S(this,"keyFieldNamesByParentTypeName",new Map);S(this,"outputFieldTypeNameSet",new Set);S(this,"parents",new Map);S(this,"rootTypeNames",new Set([ct.DEFAULT_MUTATION,ct.DEFAULT_QUERY,ct.DEFAULT_SUBSCRIPTION]));S(this,"internalSubgraphBySubgraphName");S(this,"shareableErrorTypeNames",new Map);S(this,"renamedTypeNameByOriginalTypeName",new Map);S(this,"warnings");this.authorizationDataByParentTypeName=t,this.entityContainersByTypeName=n,this.entityInterfaceFederationDataByTypeName=r,this.internalSubgraphBySubgraphName=i,this.warnings=s||[]}isObjectRootType(t){return this.rootTypeNames.has(t.name.value)}populateMultiGraphAndRenameOperations(t){for(let n of t.values())this.currentSubgraphName=n.name,(0,iR.walkSubgraphToCollectObjectLikesAndDirectiveDefinitions)(this,n)}getEnumMergeMethod(t){return this.inputFieldTypeNameSet.has(t)||this.argumentTypeNameSet.has(t)?this.outputFieldTypeNameSet.has(t)?Sn.MergeMethod.CONSISTENT:Sn.MergeMethod.INTERSECTION:Sn.MergeMethod.UNION}validateArgumentDefaultValues(t,n,r){n.kind!==r.kind&&this.errors.push((0,Se.incompatibleArgumentDefaultValueTypeError)(t,this.parentTypeName,this.childName,n.kind,r.kind)),"value"in r&&n.value!==r.value&&this.errors.push((0,Se.incompatibleArgumentDefaultValueError)(t,this.parentTypeName,this.childName,n.value,r.value))}compareAndValidateArgumentDefaultValues(t,n){let r=n.defaultValue;if(t.node.defaultValue=t.node.defaultValue||r,!t.node.defaultValue||!r){t.includeDefaultValue=!1;return}let i=t.node.name.value,s=t.node.defaultValue;switch(s.kind){case H.Kind.LIST:break;case H.Kind.NULL:break;case H.Kind.OBJECT:break;case H.Kind.BOOLEAN:case H.Kind.ENUM:case H.Kind.FLOAT:case H.Kind.INT:case H.Kind.STRING:this.validateArgumentDefaultValues(i,s,r);break;default:throw(0,Se.unexpectedArgumentKindFatalError)(i,this.childName)}}upsertRequiredSubgraph(t,n){return n&&t.add(this.currentSubgraphName),t}upsertExtensionPersistedDirectives(t,n){for(let[s,o]of t.tags)n.tags.set(s,o);for(let[s,o]of t.directives){let a=n.directives.get(s);if(!a){n.directives.set(s,o);continue}a.push(...o)}let r=t.deprecated.directive,i=t.deprecated.reason;!r||!i||n.deprecated.directive&&n.deprecated.reason&&i.length0&&(0,Ue.addIterableValuesToSet)(i.requiredSubgraphs,s.requiredSubgraphs),(0,Ue.addIterableValuesToSet)(i.subgraphs,s.subgraphs);let{typeErrors:o,typeNode:a}=(0,Ji.getMostRestrictiveMergedTypeNode)(s.node.type,i.node.type,this.childName,r);if(a)s.node.type=a;else{if(!o||o.length<2)throw(0,Se.argumentTypeMergeFatalError)(r,this.childName);this.errors.push((0,Se.incompatibleArgumentTypesError)(r,this.parentTypeName,this.childName,o[0],o[1]))}this.compareAndValidateArgumentDefaultValues(s,i.node),this.upsertExtensionPersistedDirectives(i.directives,s.directives)}}upsertArguments(t,n){if(!t.arguments)return n;for(let r of t.arguments){let i=r.name.value,s=`${t.name.value}(${i}...)`;this.argumentTypeNameSet.add((0,Ji.getNamedTypeForChild)(s,r.type));let o=(0,Ji.isTypeRequired)(r.type),a=n.get(i);if(!a){n.set(i,{directives:this.extractPersistedDirectives(r.directives||[],(0,Sn.newPersistedDirectivesContainer)()),includeDefaultValue:!!r.defaultValue,node:(0,Er.inputValueDefinitionNodeToMutable)(r,this.childName),requiredSubgraphs:this.upsertRequiredSubgraph(new Set,o),subgraphs:new Set([this.currentSubgraphName])});continue}this.extractPersistedDirectives(r.directives||[],a.directives),(0,rt.setLongestDescriptionForNode)(a.node,r.description),this.upsertRequiredSubgraph(a.requiredSubgraphs,o),a.subgraphs.add(this.currentSubgraphName);let{typeErrors:u,typeNode:c}=(0,Ji.getMostRestrictiveMergedTypeNode)(a.node.type,r.type,this.childName,i);if(c)a.node.type=c;else{if(!u||u.length<2)throw(0,Se.argumentTypeMergeFatalError)(i,this.childName);this.errors.push((0,Se.incompatibleArgumentTypesError)(i,this.parentTypeName,this.childName,u[0],u[1]))}this.compareAndValidateArgumentDefaultValues(a,r)}return n}isFieldEntityKey(){let t=this.keyFieldNamesByParentTypeName.get(this.parentTypeName);return t?t.has(this.childName):!1}isFieldExternal(t){return this.areFieldsExternal||(0,rt.isNodeExternal)(t)}isFieldShareable(t){return!this.isCurrentSubgraphVersionTwo||this.areFieldsShareable||this.isFieldEntityKey()||(0,rt.isNodeShareable)(t)}upsertDirectiveNode(t){let n=t.name.value,r=this.directiveDefinitions.get(n);if(r){if(!this.executableDirectives.has(n))return;if((0,rt.mergeExecutableDirectiveLocations)(t.locations,r).size<1){this.executableDirectives.delete(n);return}this.upsertArguments(t,r.arguments),(0,rt.setLongestDescriptionForNode)(r.node,t.description),r.node.repeatable=r.node.repeatable&&t.repeatable,r.subgraphNames.add(this.currentSubgraphName);return}let i=(0,rt.extractExecutableDirectiveLocations)(t.locations,new Set);this.directiveDefinitions.set(n,{arguments:this.upsertArguments(t,new Map),executableLocations:i,node:(0,Er.directiveDefinitionNodeToMutable)(t),subgraphNames:new Set([this.currentSubgraphName])}),i.size>0&&this.executableDirectives.add(n)}isShareabilityOfAllFieldInstancesValid(t){let n=0,r=0;for(let[i,s]of t.subgraphsByShareable)if(!t.subgraphsByExternal.get(i)){if(s){if(r)return!1;n+=1;continue}if(r+=1,n||r>1)return!1}return!0}upsertFieldNode(t){let n=this.isCurrentParentExtensionType?(0,Ue.getOrThrowError)(this.extensions,this.parentTypeName,ct.EXTENSIONS):(0,Ue.getOrThrowError)(this.parents,this.parentTypeName,ct.PARENTS);if(n.kind!==H.Kind.OBJECT_TYPE_DEFINITION&&n.kind!==H.Kind.INTERFACE_TYPE_DEFINITION&&n.kind!==H.Kind.OBJECT_TYPE_EXTENSION)throw(0,Se.unexpectedKindFatalError)(this.parentTypeName);let r=n.fields,i=this.isFieldExternal(t),s=this.isFieldShareable(t),o=`${this.parentTypeName}.${this.childName}`,a=(0,Ji.getNamedTypeForChild)(o,t.type),u=r.get(this.childName);if(u){this.extractPersistedDirectives(t.directives||[],u.directives),(0,rt.setLongestDescriptionForNode)(u.node,t.description),u.subgraphNames.add(this.currentSubgraphName),u.subgraphsByShareable.set(this.currentSubgraphName,s),u.subgraphsByExternal.set(this.currentSubgraphName,i);let{typeErrors:c,typeNode:l}=(0,Ji.getLeastRestrictiveMergedTypeNode)(u.node.type,t.type,this.parentTypeName,this.childName);if(l)u.node.type=l;else{if(!c||c.length<2)throw(0,Se.fieldTypeMergeFatalError)(this.childName);this.errors.push((0,Se.incompatibleChildTypesError)(this.parentTypeName,this.childName,c[0],c[1]))}if(this.upsertArguments(t,u.arguments),this.isCurrentParentInterface||i||u.isShareable&&s||this.isShareabilityOfAllFieldInstancesValid(u)||this.entityInterfaceFederationDataByTypeName.has(this.parentTypeName))return;let m=this.shareableErrorTypeNames.get(this.parentTypeName);m?m.add(this.childName):this.shareableErrorTypeNames.set(this.parentTypeName,new Set([this.childName]));return}this.outputFieldTypeNameSet.add(a),r.set(this.childName,{arguments:this.upsertArguments(t,new Map),directives:this.extractPersistedDirectives(t.directives||[],(0,Sn.newPersistedDirectivesContainer)()),isShareable:s,node:(0,Er.fieldDefinitionNodeToMutable)(t,this.parentTypeName),namedTypeName:a,subgraphNames:new Set([this.currentSubgraphName]),subgraphsByShareable:new Map([[this.currentSubgraphName,s]]),subgraphsByExternal:new Map([[this.currentSubgraphName,i]])})}upsertValueNode(t){let n=this.parents.get(this.parentTypeName);switch(t.kind){case H.Kind.ENUM_VALUE_DEFINITION:if(!n)throw(0,Se.federationInvalidParentTypeError)(this.parentTypeName,this.childName);if(n.kind!==H.Kind.ENUM_TYPE_DEFINITION)throw(0,Se.incompatibleParentKindFatalError)(this.parentTypeName,H.Kind.ENUM_TYPE_DEFINITION,n.kind);let r=n.values,i=r.get(this.childName);if(i){this.extractPersistedDirectives(t.directives||[],i.directives),(0,rt.setLongestDescriptionForNode)(i.node,t.description),i.appearances+=1;return}r.set(this.childName,{appearances:1,directives:this.extractPersistedDirectives(t.directives||[],(0,Sn.newPersistedDirectivesContainer)()),node:(0,Er.enumValueDefinitionNodeToMutable)(t)});return;case H.Kind.INPUT_VALUE_DEFINITION:if(!n||!this.isParentInputObject)return;if(n.kind!==H.Kind.INPUT_OBJECT_TYPE_DEFINITION)throw(0,Se.incompatibleParentKindFatalError)(this.parentTypeName,H.Kind.INPUT_OBJECT_TYPE_DEFINITION,n.kind);let s=n.fields,o=s.get(this.childName);if(o){this.extractPersistedDirectives(t.directives||[],o.directives),o.appearances+=1,(0,rt.setLongestDescriptionForNode)(o.node,t.description);let{typeErrors:c,typeNode:l}=(0,Ji.getMostRestrictiveMergedTypeNode)(o.node.type,t.type,this.parentTypeName,this.childName);if(l)o.node.type=l;else{if(!c||c.length<2)throw(0,Se.fieldTypeMergeFatalError)(this.childName);this.errors.push((0,Se.incompatibleChildTypesError)(this.parentTypeName,this.childName,c[0],c[1]))}return}let a=`${this.parentTypeName}.${this.childName}`,u=(0,Ji.getNamedTypeForChild)(a,t.type);this.inputFieldTypeNameSet.add(u),s.set(this.childName,{appearances:1,directives:this.extractPersistedDirectives(t.directives||[],(0,Sn.newPersistedDirectivesContainer)()),includeDefaultValue:!!t.defaultValue,node:(0,Er.inputValueDefinitionNodeToMutable)(t,this.parentTypeName)});return;default:throw(0,Se.unexpectedKindFatalError)(this.childName)}}upsertInterfaceObjectParentNode(t){let n=t.name.value,r=this.parents.get(n);if(r){if(r.kind!==H.Kind.INTERFACE_TYPE_DEFINITION)throw(0,Se.incompatibleParentKindFatalError)(n,t.kind,r.kind);(0,rt.setLongestDescriptionForNode)(r.node,t.description),this.extractPersistedDirectives(t.directives||[],r.directives),(0,rt.extractInterfaces)(t,r.interfaces),r.subgraphNames.add(this.currentSubgraphName);return}this.parents.set(n,{directives:this.extractPersistedDirectives(t.directives||[],(0,Sn.newPersistedDirectivesContainer)()),fields:new Map,interfaces:(0,rt.extractInterfaces)(t,new Set),kind:H.Kind.INTERFACE_TYPE_DEFINITION,node:(0,Er.interfaceTypeDefinitionNodeToMutable)(M(A({},t),{kind:H.Kind.INTERFACE_TYPE_DEFINITION})),subgraphNames:new Set([this.currentSubgraphName])})}upsertParentNode(t){var i,s;let n=t.name.value,r=this.parents.get(n);switch(r&&((0,rt.setLongestDescriptionForNode)(r.node,t.description),this.extractPersistedDirectives(t.directives||[],r.directives)),t.kind){case H.Kind.ENUM_TYPE_DEFINITION:if(r){if(r.kind!==t.kind)throw(0,Se.incompatibleParentKindFatalError)(n,t.kind,r.kind);r.appearances+=1;return}this.parents.set(n,{appearances:1,directives:this.extractPersistedDirectives(t.directives||[],(0,Sn.newPersistedDirectivesContainer)()),values:new Map,kind:t.kind,node:(0,Er.enumTypeDefinitionNodeToMutable)(t)});return;case H.Kind.INPUT_OBJECT_TYPE_DEFINITION:if(r){if(r.kind!==t.kind)throw(0,Se.incompatibleParentKindFatalError)(n,t.kind,r.kind);r.appearances+=1;return}this.parents.set(n,{appearances:1,directives:this.extractPersistedDirectives(t.directives||[],(0,Sn.newPersistedDirectivesContainer)()),fields:new Map,kind:t.kind,node:(0,Er.inputObjectTypeDefinitionNodeToMutable)(t)});return;case H.Kind.INTERFACE_TYPE_DEFINITION:if(r){if(r.kind!==t.kind)throw(0,Se.incompatibleParentKindFatalError)(n,t.kind,r.kind);(0,rt.extractInterfaces)(t,r.interfaces),r.subgraphNames.add(this.currentSubgraphName);return}this.parents.set(n,{directives:this.extractPersistedDirectives(t.directives||[],(0,Sn.newPersistedDirectivesContainer)()),fields:new Map,interfaces:(0,rt.extractInterfaces)(t,new Set),kind:t.kind,node:(0,Er.interfaceTypeDefinitionNodeToMutable)(t),subgraphNames:new Set([this.currentSubgraphName])});return;case H.Kind.SCALAR_TYPE_DEFINITION:if(r){if(r.kind!==t.kind)throw(0,Se.incompatibleParentKindFatalError)(n,t.kind,r.kind);return}this.parents.set(n,{directives:this.extractPersistedDirectives(t.directives||[],(0,Sn.newPersistedDirectivesContainer)()),kind:t.kind,node:(0,Er.scalarTypeDefinitionNodeToMutable)(t)});return;case H.Kind.OBJECT_TYPE_DEFINITION:if(r){if(r.kind!==t.kind)throw(0,Se.incompatibleParentKindFatalError)(n,t.kind,r.kind);(0,rt.extractInterfaces)(t,r.interfaces),r.subgraphNames.add(this.currentSubgraphName);return}this.parents.set(n,{directives:this.extractPersistedDirectives(t.directives||[],(0,Sn.newPersistedDirectivesContainer)()),fields:new Map,interfaces:(0,rt.extractInterfaces)(t,new Set),isRootType:this.isParentRootType,kind:t.kind,node:(0,Er.objectTypeDefinitionNodeToMutable)(t),subgraphNames:new Set([this.currentSubgraphName])});return;case H.Kind.UNION_TYPE_DEFINITION:if(r){if(r.kind!==t.kind)throw(0,Se.incompatibleParentKindFatalError)(n,t.kind,r.kind);if(!t.types||t.types.length<1){this.errors.push((0,Se.invalidUnionError)(r.node.name.value));return}(i=t.types)==null||i.forEach(o=>r.members.add(o.name.value));return}this.parents.set(n,{directives:this.extractPersistedDirectives(t.directives||[],(0,Sn.newPersistedDirectivesContainer)()),kind:t.kind,members:new Set((s=t.types)==null?void 0:s.map(o=>o.name.value)),node:(0,Er.unionTypeDefinitionNodeToMutable)(t)});return}}upsertExtensionNode(t){let n=this.extensions.get(this.parentTypeName);if(n){if(n.kind!==H.Kind.OBJECT_TYPE_EXTENSION)throw(0,Se.incompatibleParentKindFatalError)(this.parentTypeName,H.Kind.OBJECT_TYPE_EXTENSION,n.kind);n.subgraphNames.add(this.currentSubgraphName),(0,rt.extractInterfaces)(t,n.interfaces),this.extractPersistedDirectives(t.directives||[],n.directives);return}let r=(0,rt.extractInterfaces)(t,new Set);this.extensions.set(this.parentTypeName,{directives:this.extractPersistedDirectives(t.directives||[],(0,Sn.newPersistedDirectivesContainer)()),fields:new Map,interfaces:r,isRootType:this.isParentRootType,kind:H.Kind.OBJECT_TYPE_EXTENSION,node:(0,Er.objectTypeExtensionNodeToMutable)(t),subgraphNames:new Set([this.currentSubgraphName])})}isTypeValidImplementation(t,n){if(t.kind===H.Kind.NON_NULL_TYPE)return n.kind!==H.Kind.NON_NULL_TYPE?!1:this.isTypeValidImplementation(t.type,n.type);if(n.kind===H.Kind.NON_NULL_TYPE)return this.isTypeValidImplementation(t,n.type);switch(t.kind){case H.Kind.NAMED_TYPE:if(n.kind===H.Kind.NAMED_TYPE){let r=t.name.value,i=n.name.value;if(r===i)return!0;let s=this.abstractToConcreteTypeNames.get(r);return s?s.has(i):!1}return!1;default:return n.kind===H.Kind.LIST_TYPE?this.isTypeValidImplementation(t.type,n.type):!1}}getAndValidateImplementedInterfaces(t){var i;let n=[];if(t.interfaces.size<1)return n;let r=new Map;for(let s of t.interfaces){n.push((0,rt.stringToNamedTypeNode)(s));let o=this.parents.get(s);if(!o){this.errors.push((0,Se.undefinedTypeError)(s));continue}if(o.kind!==H.Kind.INTERFACE_TYPE_DEFINITION)throw(0,Se.incompatibleParentKindFatalError)(s,H.Kind.INTERFACE_TYPE_DEFINITION,o.kind);let a={invalidFieldImplementations:new Map,unimplementedFields:[]},u=!1;for(let[c,l]of o.fields){let m=!1,h=t.fields.get(c);if(!h){u=!0,a.unimplementedFields.push(c);continue}let E={invalidAdditionalArguments:new Set,invalidImplementedArguments:[],originalResponseType:(0,ap.printTypeNode)(l.node.type),unimplementedArguments:new Set};this.isTypeValidImplementation(l.node.type,h.node.type)||(u=!0,m=!0,E.implementedResponseType=(0,ap.printTypeNode)(h.node.type));let N=new Set;for(let[D,w]of l.arguments){let x=w.node;N.add(D);let Y=(i=h.arguments.get(D))==null?void 0:i.node;if(!Y){u=!0,m=!0,E.unimplementedArguments.add(D);continue}let Q=(0,ap.printTypeNode)(Y.type),W=(0,ap.printTypeNode)(x.type);W!==Q&&(u=!0,m=!0,E.invalidImplementedArguments.push({actualType:Q,argumentName:D,expectedType:W}))}for(let[D,w]of h.arguments){let x=w.node;N.has(D)||x.type.kind===H.Kind.NON_NULL_TYPE&&(u=!0,m=!0,E.invalidAdditionalArguments.add(D))}m&&a.invalidFieldImplementations.set(c,E)}u&&r.set(s,a)}return r.size&&this.errors.push((0,Se.unimplementedInterfaceFieldsError)(t.node.name.value,(0,Ue.kindToTypeString)(t.kind),r)),n}mergeArguments(t,n,r,i){for(let s of t.arguments.values()){let o=(0,Ue.getEntriesNotInHashSet)(t.subgraphNames,s.subgraphs),a=s.node.name.value;if(o.length>0){s.requiredSubgraphs.size>0&&r.push({argumentName:a,missingSubgraphs:o,requiredSubgraphs:[...s.requiredSubgraphs]});continue}s.node.defaultValue=s.includeDefaultValue?s.node.defaultValue:void 0,n.push((0,rt.pushPersistedDirectivesAndGetNode)(s)),i&&i.push(a)}}addValidExecutableDirectiveDefinition(t,n,r){if(!this.executableDirectives.has(t)||this.internalSubgraphBySubgraphName.size!==n.subgraphNames.size)return;if(n.node.locations=(0,rt.setToNameNodeArray)(n.executableLocations),!n.arguments){r.push(n.node);return}let i=[],s=[];if(this.mergeArguments(n,i,s),s.length>0){this.errors.push((0,Se.invalidRequiredArgumentsError)(ct.DIRECTIVE_DEFINITION,t,s));return}n.node.arguments=i,r.push(n.node)}pushAuthorizationDirectives(t,n){let r=this.authorizationDataByParentTypeName.get(n);if(!r)return;let i=r.fieldAuthorizationDataByFieldName.get(t.node.name.value);i&&(i.requiresAuthentication&&t.directives.directives.set(ct.AUTHENTICATED,[(0,Ue.generateSimpleDirective)(ct.AUTHENTICATED)]),i.requiredScopes.length>0&&t.directives.directives.set(ct.REQUIRES_SCOPES,[(0,Ue.generateRequiresScopesDirective)(i.requiredScopes)]))}getMergedFieldDefinitionNode(t,n){if(this.pushAuthorizationDirectives(t,n),(0,rt.pushPersistedDirectivesAndGetNode)(t),t.arguments.size<1)return t.node;let r=t.node.name.value,i=`${n}.${r}`,s=[],o=[],a=[];return this.mergeArguments(t,s,o,a),o.length>0?this.errors.push((0,Se.invalidRequiredArgumentsError)(ct.FIELD,i,o)):a.length>0&&this.fieldConfigurationByFieldPath.set(`${n}.${r}`,{argumentNames:a,fieldName:r,typeName:n}),t.node.arguments=s,t.node}upsertDeprecatedDirective(t,n){if(!t.arguments||t.arguments.length<1){n.directive=t;return}if(t.arguments.length!==1){this.errors.push(Se.invalidDeprecatedDirectiveError);return}let r=t.arguments[0].value;if(r.kind!==H.Kind.STRING){this.errors.push(Se.invalidDeprecatedDirectiveError);return}n.reason&&r.value.length0)for(let o of s){let a=this.evaluatedObjectLikesBySubgraph.get(o);a?a.add(i):this.evaluatedObjectLikesBySubgraph.set(o,new Set([i]))}for(let o of r){let a=(0,Ue.getOrThrowError)(this.parents,o,ct.PARENTS),u=(0,Ue.getAllMutualEntries)(t,a.subgraphNames),c=(0,Ue.getAllMutualEntries)(u,n);for(let l of c){let m=this.evaluatedObjectLikesBySubgraph.get(l);m?m.add(i):this.evaluatedObjectLikesBySubgraph.set(l,new Set([i]))}}}evaluateResolvabilityOfObject(t,n,r,i,s,o=!1){let a=t.node.name.value;if(!i.has(a)){if(!this.shouldEvaluateObjectLike(n.subgraphs,a)){i.add(a);return}for(let[u,c]of t.fields){let l=c.namedTypeName;if(ct.ROOT_TYPES.has(l)||i.has(l)||this.isFieldExternalInAllMutualSubgraphs(n.subgraphs,c))continue;this.updateEvaluatedSubgraphOccurrences(n.subgraphs,t.subgraphNames,s,a),i.add(a);let m=(0,Ue.doSetsHaveAnyOverlap)(n.subgraphs,c.subgraphNames)||this.isFieldResolvableByEntityAncestor(s,c.subgraphNames,a),h=r+(o?" ":".")+u,E=this.entityContainersByTypeName.get(l);if(m){if(Nc.BASE_SCALARS.has(l))continue;let D=(0,Ue.getOrThrowError)(this.parents,l,ct.PARENTS);switch(D.kind){case H.Kind.ENUM_TYPE_DEFINITION:case H.Kind.SCALAR_TYPE_DEFINITION:continue;case H.Kind.OBJECT_TYPE_DEFINITION:this.evaluateResolvabilityOfObject(D,n,h,i,E?[...s,l]:[...s]);continue;case H.Kind.INTERFACE_TYPE_DEFINITION:case H.Kind.UNION_TYPE_DEFINITION:this.evaluateResolvabilityOfAbstractType(l,D.kind,n,h,i,E?[...s,l]:[...s]);continue;default:this.errors.push((0,Se.unexpectedObjectResponseType)(h,(0,Ue.kindToTypeString)(D.kind)));continue}}if(Nc.BASE_SCALARS.has(l)){this.errors.push((0,Se.unresolvableFieldError)(n,u,[...c.subgraphNames],h,a));continue}let N=(0,Ue.getOrThrowError)(this.parents,l,ct.PARENTS);switch(N.kind){case H.Kind.ENUM_TYPE_DEFINITION:case H.Kind.SCALAR_TYPE_DEFINITION:this.errors.push((0,Se.unresolvableFieldError)(n,u,[...c.subgraphNames],h,a));continue;case H.Kind.INTERFACE_TYPE_DEFINITION:case H.Kind.UNION_TYPE_DEFINITION:case H.Kind.OBJECT_TYPE_DEFINITION:this.errors.push((0,Se.unresolvableFieldError)(n,u,[...c.subgraphNames],h+ct.SELECTION_REPRESENTATION,a));continue;default:this.errors.push((0,Se.unexpectedObjectResponseType)(h,(0,Ue.kindToTypeString)(N.kind)))}}}}evaluateResolvabilityOfAbstractType(t,n,r,i,s,o){if(s.has(t))return;s.add(t);let a=this.abstractToConcreteTypeNames.get(t);if(!a){(0,Se.noConcreteTypesForAbstractTypeError)((0,Ue.kindToTypeString)(n),t);return}for(let u of a){if(s.has(u))continue;let c=(0,Ue.getOrThrowError)(this.parents,u,ct.PARENTS);if(c.kind!==H.Kind.OBJECT_TYPE_DEFINITION)throw(0,Se.unexpectedParentKindErrorMessage)(u,"Object",(0,Ue.kindToTypeString)(c.kind));if(!(0,Ue.doSetsHaveAnyOverlap)(c.subgraphNames,r.subgraphs))continue;let l=this.entityContainersByTypeName.get(u);this.evaluateResolvabilityOfObject(c,r,i+" ... on "+u,s,l?[...o,u]:[...o],!0)}}validateKeyFieldSetsForImplicitEntity(t){let n=(0,Ue.getOrThrowError)(this.internalSubgraphBySubgraphName,this.currentSubgraphName,"internalSubgraphBySubgraphName"),r=n.parentDataByTypeName,i=n.parentExtensionDataByTypeName,s=r.get(t.typeName)||i.get(t.typeName);if(!s||s.kind!==H.Kind.OBJECT_TYPE_DEFINITION&&s.kind!==H.Kind.OBJECT_TYPE_EXTENSION)throw(0,Se.incompatibleParentKindFatalError)(t.typeName,H.Kind.OBJECT_TYPE_DEFINITION,(s==null?void 0:s.kind)||H.Kind.NULL);let o=(0,Ue.getOrThrowError)(n.configurationDataMap,t.typeName,"internalSubgraph.configurationDataMap"),a=new Set,u=[];for(let c of t.keyFieldSets){let{error:l,documentNode:m}=(0,rt.safeParse)("{"+c+"}");if(l||!m)continue;let h=[s],E=[],N=-1,D=!0,w=!0;(0,H.visit)(m,{Argument:{enter(){return w=!1,H.BREAK}},Field:{enter(x){let Y=h[N],Q=Y.typeName;if(D)return w=!1,H.BREAK;let W=x.name.value,Ie=`${Q}.${W}`,Qe=Y.fieldDataByFieldName.get(W);if(!Qe||Qe.argumentDataByArgumentName.size||E[N].has(W))return w=!1,H.BREAK;E[N].add(W),N===0&&a.add(W);let et=(0,Ji.getNamedTypeForChild)(Ie,Qe.node.type);if(Nc.BASE_SCALARS.has(et))return;let Pt=r.get(et)||i.get(et);if(!Pt)return w=!1,H.BREAK;if(Pt.kind===H.Kind.OBJECT_TYPE_DEFINITION||Pt.kind===H.Kind.OBJECT_TYPE_EXTENSION){D=!0,h.push(Pt);return}if((0,rt.isKindAbstract)(Pt.kind))return w=!1,H.BREAK}},InlineFragment:{enter(){return w=!1,H.BREAK}},SelectionSet:{enter(){if(!D||(N+=1,D=!1,N<0||N>=h.length))return w=!1,H.BREAK;E.push(new Set)},leave(){if(D)return w=!1,H.BREAK;N-=1,h.pop(),E.pop()}}}),w&&((0,Ue.addIterableValuesToSet)(a,o.fieldNames),u.push({fieldName:"",selectionSet:(0,sR.getNormalizedFieldSet)(m),disableEntityResolver:!0}))}u.length>0&&(o.isRootNode=!0,o.keys=u)}handleAuthorizationDataForRenamedTypes(){for(let[t,n]of this.renamedTypeNameByOriginalTypeName){let r=this.authorizationDataByParentTypeName.get(t);if(!r)continue;r.typeName=n;let i=this.authorizationDataByParentTypeName.get(n);if(!i)this.authorizationDataByParentTypeName.set(n,r);else for(let[s,o]of i.fieldAuthorizationDataByFieldName)(0,Ue.upsertFieldAuthorizationData)(r.fieldAuthorizationDataByFieldName,o)||this.invalidOrScopesHostPaths.add(`${n}.${s}`);this.authorizationDataByParentTypeName.delete(t)}}federate(){this.populateMultiGraphAndRenameOperations(this.internalSubgraphBySubgraphName);let t=this;for(let u of this.internalSubgraphBySubgraphName.values())this.isCurrentSubgraphVersionTwo=u.isVersionTwo,this.currentSubgraphName=u.name,this.keyFieldNamesByParentTypeName=u.keyFieldNamesByParentTypeName,(0,iR.walkSubgraphToFederate)(u.definitions,u.overriddenFieldNamesByParentTypeName,t);this.handleAuthorizationDataForRenamedTypes();for(let[u,c]of this.entityInterfaceFederationDataByTypeName){(0,Ue.subtractSourceSetFromTargetSet)(c.interfaceFieldNames,c.interfaceObjectFieldNames);let l=(0,Ue.getOrThrowError)(this.parents,u,"parents");if(l.kind===H.Kind.INTERFACE_TYPE_DEFINITION)for(let m of c.interfaceObjectSubgraphs){let h=(0,Ue.getOrThrowError)(this.internalSubgraphBySubgraphName,m,"internalSubgraphBySubgraphName").configurationDataMap,E=this.abstractToConcreteTypeNames.get(u);if(!E)continue;let N=(0,Ue.getOrThrowError)(h,u,"configurationDataMap"),D=N.keys;if(!D)continue;N.entityInterfaceConcreteTypeNames=c.concreteTypeNames;let w=N.fieldNames,x=this.authorizationDataByParentTypeName.get(c.typeName);for(let Y of E){if(h.has(Y))continue;if(x){let Qe=(0,Ue.getValueOrDefault)(this.authorizationDataByParentTypeName,Y,()=>(0,Ue.newAuthorizationData)(Y));for(let et of x.fieldAuthorizationDataByFieldName.values())(0,Ue.upsertFieldAuthorizationData)(Qe.fieldAuthorizationDataByFieldName,et)||this.invalidOrScopesHostPaths.add(`${Y}.${et.fieldName}`)}let Q=(0,Ue.getOrThrowError)(this.parents,Y,"parents");if(Q.kind!==H.Kind.OBJECT_TYPE_DEFINITION)continue;let W=this.entityContainersByTypeName.get(Y);W&&W.subgraphNames.add(m);let Ie={fieldNames:w,isRootNode:!0,keys:D,typeName:Y};for(let Qe of c.interfaceObjectFieldNames){if(Q.fields.get(Qe))continue;let Pt=(0,Ue.getOrThrowError)(l.fields,Qe,"entityInterface.fields");Q.fields.set(Qe,A({},Pt))}h.set(Y,Ie)}}}this.invalidOrScopesHostPaths.size>0&&this.errors.push((0,Se.orScopesLimitError)(Ue.maxOrScopes,[...this.invalidOrScopesHostPaths]));let n=[];for(let[u,c]of this.directiveDefinitions){if(this.persistedDirectiveDefinitions.has(u)){n.push(c.node);continue}this.addValidExecutableDirectiveDefinition(u,c,n)}this.directiveDefinitions.has(ct.REQUIRES_SCOPES)&&n.push(Nc.SCOPE_SCALAR_DEFINITION);for(let[u,c]of this.extensions){this.parentTypeName=u,c.isRootType&&!this.parents.has(u)&&this.upsertParentNode((0,Er.objectTypeExtensionNodeToMutableDefinitionNode)(c.node));let l=this.parents.get(u);if(!l){this.errors.push((0,Se.noBaseTypeExtensionError)(u));continue}if(l.kind!==H.Kind.OBJECT_TYPE_DEFINITION)throw(0,Se.incompatibleParentKindFatalError)(u,H.Kind.OBJECT_TYPE_DEFINITION,l.kind);this.upsertExtensionPersistedDirectives(c.directives,l.directives);for(let[m,h]of c.fields){let E=l.fields.get(m);if(!E){l.fields.set(m,h);continue}if(E.isShareable&&h.isShareable){this.childName=m,this.upsertExtensionFieldArguments(h.arguments,E.arguments),(0,rt.setLongestDescriptionForNode)(E.node,h.node.description),(0,Ue.addIterableValuesToSet)(h.subgraphNames,E.subgraphNames);continue}let N=this.shareableErrorTypeNames.get(u);if(N){N.add(m);continue}this.shareableErrorTypeNames.set(u,new Set([m]))}for(let m of c.interfaces)l.interfaces.add(m)}for(let[u,c]of this.shareableErrorTypeNames){let l=(0,Ue.getOrThrowError)(this.parents,u,ct.PARENTS);if(l.kind!==H.Kind.OBJECT_TYPE_DEFINITION)throw(0,Se.incompatibleParentKindFatalError)(u,H.Kind.OBJECT_TYPE_DEFINITION,l.kind);this.errors.push((0,Se.shareableFieldDefinitionsError)(l,c))}let r=[];for(let[u,c]of this.parents)switch(c.kind){case H.Kind.ENUM_TYPE_DEFINITION:let l=[],m=this.getEnumMergeMethod(u);for(let w of c.values.values())switch((0,rt.pushPersistedDirectivesAndGetNode)(w),m){case Sn.MergeMethod.CONSISTENT:w.appearances0?r.push(c):n.push(c.node),E.length<1&&this.errors.push((0,Se.allFieldDefinitionsAreInaccessibleError)("interface",u));break;case H.Kind.OBJECT_TYPE_DEFINITION:let N=[];for(let w of c.fields.values())(0,Sn.isFieldInaccessible)(w)||N.push(this.getMergedFieldDefinitionNode(w,u));c.node.fields=N,(0,rt.pushPersistedDirectivesAndGetNode)(c),c.interfaces.size>0?r.push(c):n.push(c.node),N.length<1&&((0,sR.isNodeQuery)(u)?this.errors.push(Se.noQueryRootTypeError):this.errors.push((0,Se.allFieldDefinitionsAreInaccessibleError)("object",u)));break;case H.Kind.SCALAR_TYPE_DEFINITION:Nc.BASE_SCALARS.has(u)||n.push((0,rt.pushPersistedDirectivesAndGetNode)(c));break;case H.Kind.UNION_TYPE_DEFINITION:let D=[];for(let w of c.members)D.push((0,rt.stringToNamedTypeNode)(w));c.node.types=D,n.push((0,rt.pushPersistedDirectivesAndGetNode)(c));break}for(let u of r)u.node.interfaces=this.getAndValidateImplementedInterfaces(u),n.push(u.node);let i=this.parents.get(ct.QUERY);if((!i||i.kind!==H.Kind.OBJECT_TYPE_DEFINITION||i.fields.size<1)&&this.errors.push(Se.noQueryRootTypeError),this.errors.length>0)return{errors:this.errors};for(let u of ct.ROOT_TYPES){let c=this.parents.get(u);if(!c||c.kind!==H.Kind.OBJECT_TYPE_DEFINITION)continue;if(this.errors.length>0)break;let l=new Set(Nc.BASE_SCALARS);for(let[m,h]of c.fields){let E=h.namedTypeName;if(l.has(E)||!this.shouldEvaluateObjectLike(h.subgraphNames,E))continue;let N=(0,Ue.getOrThrowError)(this.parents,E,ct.PARENTS),D=`${u}.${m}`,w={fieldName:m,fieldTypeNodeString:(0,ap.printTypeNode)(h.node.type),path:D,typeName:u,subgraphs:h.subgraphNames};switch(N.kind){case H.Kind.ENUM_TYPE_DEFINITION:case H.Kind.SCALAR_TYPE_DEFINITION:l.add(E);continue;case H.Kind.OBJECT_TYPE_DEFINITION:this.evaluateResolvabilityOfObject(N,w,D,new Set,this.entityContainersByTypeName.has(E)?[E]:[]);continue;case H.Kind.INTERFACE_TYPE_DEFINITION:case H.Kind.UNION_TYPE_DEFINITION:this.evaluateResolvabilityOfAbstractType(E,N.kind,w,D,new Set,this.entityContainersByTypeName.has(E)?[E]:[]);continue;default:this.errors.push((0,Se.unexpectedObjectResponseType)(D,(0,Ue.kindToTypeString)(N.kind)))}}}let s=this.warnings.length>0?this.warnings:void 0;if(this.errors.length>0)return{errors:this.errors,warnings:s};let o={kind:H.Kind.DOCUMENT,definitions:n},a=new Map;for(let u of this.internalSubgraphBySubgraphName.values())a.set(u.name,{configurationDataMap:u.configurationDataMap,schema:u.schema});for(let u of this.authorizationDataByParentTypeName.values())(0,Ue.upsertAuthorizationConfiguration)(this.fieldConfigurationByFieldPath,u);return{federationResult:{fieldConfigurations:Array.from(this.fieldConfigurationByFieldPath.values()),subgraphConfigBySubgraphName:a,federatedGraphAST:o,federatedGraphSchema:(0,H.buildASTSchema)(o)},warnings:s}}};gc.FederationFactory=Gh;function Z2(e){if(e.length<1)return{errors:[Se.minimumSubgraphRequirementError]};let{authorizationDataByParentTypeName:t,entityContainerByTypeName:n,errors:r,internalSubgraphBySubgraphName:i,warnings:s}=(0,W2.batchNormalize)(e);if(r)return{errors:r};let o=new Map,a=new Map,u=new Set;for(let[c,l]of i)for(let[m,h]of l.entityInterfaces){(0,Ue.getValueOrDefault)(a,m,()=>[]).push({subgraphName:c,concreteTypeNames:h.concreteTypeNames||new Set});let N=o.get(m);if(!N){u.add(m),o.set(m,(0,Ue.newEntityInterfaceFederationData)(h,c));continue}(0,Ue.upsertEntityInterfaceFederationData)(N,h,c)&&u.delete(m)}for(let c of u)a.delete(c);return a.size>0?{errors:[(0,Se.undefinedEntityInterfaceImplementationsError)(a,o)]}:new Gh(t,n,o,i,s).federate()}gc.federateSubgraphs=Z2});var uR=L(aR=>{"use strict";d();f();p();Object.defineProperty(aR,"__esModule",{value:!0})});var lR=L(cR=>{"use strict";d();f();p();Object.defineProperty(cR,"__esModule",{value:!0})});var pR=L(dR=>{"use strict";d();f();p();Object.defineProperty(dR,"__esModule",{value:!0})});var fR=L(Jt=>{"use strict";d();f();p();var eJ=Jt&&Jt.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Vn=Jt&&Jt.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&eJ(t,e,n)};Object.defineProperty(Jt,"__esModule",{value:!0});Vn(Af(),Jt);Vn(Ar(),Jt);Vn(ai(),Jt);Vn(oR(),Jt);Vn(bf(),Jt);Vn(tv(),Jt);Vn(Zu(),Jt);Vn(WI(),Jt);Vn(uR(),Jt);Vn(ed(),Jt);Vn(lR(),Jt);Vn(pR(),Jt);Vn(wo(),Jt);Vn(jh(),Jt);Vn(xf(),Jt);Vn(ds(),Jt);Vn(zI(),Jt)});var GJ={};Fc(GJ,{buildRouterConfiguration:()=>jJ,federateSubgraphs:()=>VJ});d();f();p();var Lv=Op(fR());d();f();p();d();f();p();function nv(e){if(!e)return e;let t=new URL(e),n=t.pathname;n.endsWith("/")&&(n=n.slice(0,-1));let r=t.port?`:${t.port}`:"";return`${t.protocol}//${t.hostname}${r}${n}`}d();f();p();d();f();p();var mR={};d();f();p();function hR(e){return e!=null}d();f();p();d();f();p();ne();d();f();p();var TR;if(typeof AggregateError=="undefined"){class e extends Error{constructor(n,r=""){super(r),this.errors=n,this.name="AggregateError",Error.captureStackTrace(this,e)}}TR=function(t,n){return new e(t,n)}}else TR=AggregateError;function yR(e){return"errors"in e&&Array.isArray(e.errors)}var gR=3;function IR(e){return qh(e,[])}function qh(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return tJ(e,t);default:return String(e)}}function ER(e){return e instanceof k?e.toString():`${e.name}: ${e.message}; + ${e.stack}`}function tJ(e,t){if(e===null)return"null";if(e instanceof Error)return yR(e)?ER(e)+` +`+NR(e.errors,t):ER(e);if(t.includes(e))return"[Circular]";let n=[...t,e];if(nJ(e)){let r=e.toJSON();if(r!==e)return typeof r=="string"?r:qh(r,n)}else if(Array.isArray(e))return NR(e,n);return rJ(e,n)}function nJ(e){return typeof e.toJSON=="function"}function rJ(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>gR?"["+iJ(e)+"]":"{ "+n.map(([i,s])=>i+": "+qh(s,t)).join(", ")+" }"}function NR(e,t){if(e.length===0)return"[]";if(t.length>gR)return"[Array]";let n=e.length,r=[];for(let i=0;in==null?n:n[r],e==null?void 0:e.extensions)}d();f();p();ne();d();f();p();ne();function zi(e){if(Te(e)){let t=zi(e.ofType);if(t.kind===_.NON_NULL_TYPE)throw new Error(`Invalid type node ${IR(e)}. Inner type of non-null type cannot be a non-null type.`);return{kind:_.NON_NULL_TYPE,type:t}}else if(qe(e))return{kind:_.LIST_TYPE,type:zi(e.ofType)};return{kind:_.NAMED_TYPE,name:{kind:_.NAME,value:e.name}}}d();f();p();ne();function Qh(e){if(e===null)return{kind:_.NULL};if(e===void 0)return null;if(Array.isArray(e)){let t=[];for(let n of e){let r=Qh(n);r!=null&&t.push(r)}return{kind:_.LIST,values:t}}if(typeof e=="object"){let t=[];for(let n in e){let r=e[n],i=Qh(r);i&&t.push({kind:_.OBJECT_FIELD,name:{kind:_.NAME,value:n},value:i})}return{kind:_.OBJECT,fields:t}}if(typeof e=="boolean")return{kind:_.BOOLEAN,value:e};if(typeof e=="number"&&isFinite(e)){let t=String(e);return sJ.test(t)?{kind:_.INT,value:t}:{kind:_.FLOAT,value:t}}if(typeof e=="string")return{kind:_.STRING,value:e};throw new TypeError(`Cannot convert value to AST: ${e}.`)}var sJ=/^-?(?:0|[1-9][0-9]*)$/;d();f();p();d();f();p();function Yh(e){let t=new WeakMap;return function(r){let i=t.get(r);if(i===void 0){let s=e(r);return t.set(r,s),s}return i}}var Lve=Yh(function(t){let n=oJ(t);return new Set([...n].map(r=>r.name))}),oJ=Yh(function(t){let n=rv(t);return new Set(n.values())}),rv=Yh(function(t){let n=new Map,r=t.getQueryType();r&&n.set("query",r);let i=t.getMutationType();i&&n.set("mutation",i);let s=t.getSubscriptionType();return s&&n.set("subscription",s),n});function aJ(e,t={}){let n=t.pathToDirectivesInExtensions,r=e.getTypeMap(),i=uJ(e,n),s=i!=null?[i]:[],o=e.getDirectives();for(let a of o)Io(a)||s.push(cJ(a,e,n));for(let a in r){let u=r[a],c=si(u),l=zn(u);if(!(c||l))if(we(u))s.push(lJ(u,e,n));else if(Ce(u))s.push(dJ(u,e,n));else if(dt(u))s.push(pJ(u,e,n));else if(Be(u))s.push(fJ(u,e,n));else if(it(u))s.push(mJ(u,e,n));else if(qt(u))s.push(hJ(u,e,n));else throw new Error(`Unknown type ${u}.`)}return{kind:_.DOCUMENT,definitions:s}}function vR(e,t={}){let n=aJ(e,t);return Ve(n)}function uJ(e,t){var n,r;let i=new Map([["query",void 0],["mutation",void 0],["subscription",void 0]]),s=[];if(e.astNode!=null&&s.push(e.astNode),e.extensionASTNodes!=null)for(let l of e.extensionASTNodes)s.push(l);for(let l of s)if(l.operationTypes)for(let m of l.operationTypes)i.set(m.operation,m);let o=rv(e);for(let[l,m]of i){let h=o.get(l);if(h!=null){let E=zi(h);m!=null?m.type=E:i.set(l,{kind:_.OPERATION_TYPE_DEFINITION,operation:l,type:E})}}let a=[...i.values()].filter(hR),u=Ic(e,e,t);if(!a.length&&!u.length)return null;let c={kind:a!=null?_.SCHEMA_DEFINITION:_.SCHEMA_EXTENSION,operationTypes:a,directives:u};return c.description=((r=(n=e.astNode)===null||n===void 0?void 0:n.description)!==null&&r!==void 0?r:e.description!=null)?{kind:_.STRING,value:e.description,block:!0}:void 0,c}function cJ(e,t,n){var r,i,s,o;return{kind:_.DIRECTIVE_DEFINITION,description:(i=(r=e.astNode)===null||r===void 0?void 0:r.description)!==null&&i!==void 0?i:e.description?{kind:_.STRING,value:e.description}:void 0,name:{kind:_.NAME,value:e.name},arguments:(s=e.args)===null||s===void 0?void 0:s.map(a=>_R(a,t,n)),repeatable:e.isRepeatable,locations:((o=e.locations)===null||o===void 0?void 0:o.map(a=>({kind:_.NAME,value:a})))||[]}}function Ic(e,t,n){let r=Kh(e,n),i=[];e.astNode!=null&&i.push(e.astNode),"extensionASTNodes"in e&&e.extensionASTNodes!=null&&(i=i.concat(e.extensionASTNodes));let s;if(r!=null)s=iv(t,r);else{s=[];for(let o of i)o.directives&&s.push(...o.directives)}return s}function zh(e,t,n){var r,i;let s=[],o=null,a=Kh(e,n),u;return a!=null?u=iv(t,a):u=(r=e.astNode)===null||r===void 0?void 0:r.directives,u!=null&&(s=u.filter(c=>c.name.value!=="deprecated"),e.deprecationReason!=null&&(o=(i=u.filter(c=>c.name.value==="deprecated"))===null||i===void 0?void 0:i[0])),e.deprecationReason!=null&&o==null&&(o=EJ(e.deprecationReason)),o==null?s:[o].concat(s)}function _R(e,t,n){var r,i,s;return{kind:_.INPUT_VALUE_DEFINITION,description:(i=(r=e.astNode)===null||r===void 0?void 0:r.description)!==null&&i!==void 0?i:e.description?{kind:_.STRING,value:e.description,block:!0}:void 0,name:{kind:_.NAME,value:e.name},type:zi(e.type),defaultValue:e.defaultValue!==void 0&&(s=Cn(e.defaultValue,e.type))!==null&&s!==void 0?s:void 0,directives:zh(e,t,n)}}function lJ(e,t,n){var r,i;return{kind:_.OBJECT_TYPE_DEFINITION,description:(i=(r=e.astNode)===null||r===void 0?void 0:r.description)!==null&&i!==void 0?i:e.description?{kind:_.STRING,value:e.description,block:!0}:void 0,name:{kind:_.NAME,value:e.name},fields:Object.values(e.getFields()).map(s=>bR(s,t,n)),interfaces:Object.values(e.getInterfaces()).map(s=>zi(s)),directives:Ic(e,t,n)}}function dJ(e,t,n){var r,i;let s={kind:_.INTERFACE_TYPE_DEFINITION,description:(i=(r=e.astNode)===null||r===void 0?void 0:r.description)!==null&&i!==void 0?i:e.description?{kind:_.STRING,value:e.description,block:!0}:void 0,name:{kind:_.NAME,value:e.name},fields:Object.values(e.getFields()).map(o=>bR(o,t,n)),directives:Ic(e,t,n)};return"getInterfaces"in e&&(s.interfaces=Object.values(e.getInterfaces()).map(o=>zi(o))),s}function pJ(e,t,n){var r,i;return{kind:_.UNION_TYPE_DEFINITION,description:(i=(r=e.astNode)===null||r===void 0?void 0:r.description)!==null&&i!==void 0?i:e.description?{kind:_.STRING,value:e.description,block:!0}:void 0,name:{kind:_.NAME,value:e.name},directives:Ic(e,t,n),types:e.getTypes().map(s=>zi(s))}}function fJ(e,t,n){var r,i;return{kind:_.INPUT_OBJECT_TYPE_DEFINITION,description:(i=(r=e.astNode)===null||r===void 0?void 0:r.description)!==null&&i!==void 0?i:e.description?{kind:_.STRING,value:e.description,block:!0}:void 0,name:{kind:_.NAME,value:e.name},fields:Object.values(e.getFields()).map(s=>TJ(s,t,n)),directives:Ic(e,t,n)}}function mJ(e,t,n){var r,i;return{kind:_.ENUM_TYPE_DEFINITION,description:(i=(r=e.astNode)===null||r===void 0?void 0:r.description)!==null&&i!==void 0?i:e.description?{kind:_.STRING,value:e.description,block:!0}:void 0,name:{kind:_.NAME,value:e.name},values:Object.values(e.getValues()).map(s=>yJ(s,t,n)),directives:Ic(e,t,n)}}function hJ(e,t,n){var r,i,s;let o=Kh(e,n),a=o?iv(t,o):((r=e.astNode)===null||r===void 0?void 0:r.directives)||[],u=e.specifiedByUrl||e.specifiedByURL;if(u&&!a.some(c=>c.name.value==="specifiedBy")){let c={url:u};a.push(Jh("specifiedBy",c))}return{kind:_.SCALAR_TYPE_DEFINITION,description:(s=(i=e.astNode)===null||i===void 0?void 0:i.description)!==null&&s!==void 0?s:e.description?{kind:_.STRING,value:e.description,block:!0}:void 0,name:{kind:_.NAME,value:e.name},directives:a}}function bR(e,t,n){var r,i;return{kind:_.FIELD_DEFINITION,description:(i=(r=e.astNode)===null||r===void 0?void 0:r.description)!==null&&i!==void 0?i:e.description?{kind:_.STRING,value:e.description,block:!0}:void 0,name:{kind:_.NAME,value:e.name},arguments:e.args.map(s=>_R(s,t,n)),type:zi(e.type),directives:zh(e,t,n)}}function TJ(e,t,n){var r,i,s;return{kind:_.INPUT_VALUE_DEFINITION,description:(i=(r=e.astNode)===null||r===void 0?void 0:r.description)!==null&&i!==void 0?i:e.description?{kind:_.STRING,value:e.description,block:!0}:void 0,name:{kind:_.NAME,value:e.name},type:zi(e.type),directives:zh(e,t,n),defaultValue:(s=Cn(e.defaultValue,e.type))!==null&&s!==void 0?s:void 0}}function yJ(e,t,n){var r,i;return{kind:_.ENUM_VALUE_DEFINITION,description:(i=(r=e.astNode)===null||r===void 0?void 0:r.description)!==null&&i!==void 0?i:e.description?{kind:_.STRING,value:e.description,block:!0}:void 0,name:{kind:_.NAME,value:e.name},directives:zh(e,t,n)}}function EJ(e){return Jh("deprecated",{reason:e},Si)}function Jh(e,t,n){let r=[];if(n!=null)for(let i of n.args){let s=i.name,o=t[s];if(o!==void 0){let a=Cn(o,i.type);a&&r.push({kind:_.ARGUMENT,name:{kind:_.NAME,value:s},value:a})}}else for(let i in t){let s=t[i],o=Qh(s);o&&r.push({kind:_.ARGUMENT,name:{kind:_.NAME,value:i},value:o})}return{kind:_.DIRECTIVE,name:{kind:_.NAME,value:e},arguments:r}}function iv(e,t){let n=[];for(let r in t){let i=t[r],s=e==null?void 0:e.getDirective(r);if(Array.isArray(i))for(let o of i)n.push(Jh(r,o,s));else n.push(Jh(r,i,s))}return n}ne();d();f();p();d();f();p();d();f();p();d();f();p();d();f();p();d();f();p();function Tn(e,t){if(!e)throw new Error(t)}var NJ=34028234663852886e22,gJ=-34028234663852886e22,IJ=4294967295,vJ=2147483647,_J=-2147483648;function vc(e){if(typeof e!="number")throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>vJ||e<_J)throw new Error("invalid int 32: "+e)}function up(e){if(typeof e!="number")throw new Error("invalid uint 32: "+typeof e);if(!Number.isInteger(e)||e>IJ||e<0)throw new Error("invalid uint 32: "+e)}function Xh(e){if(typeof e!="number")throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>NJ||e({no:i.no,name:i.name,localName:e[i.no]})),r)}function ov(e,t,n){let r=Object.create(null),i=Object.create(null),s=[];for(let o of t){let a=AR(o);s.push(a),r[o.name]=a,i[o.no]=a}return{typeName:e,values:s,findName(o){return r[o]},findNumber(o){return i[o]}}}function OR(e,t,n){let r={};for(let i of t){let s=AR(i);r[s.localName]=s.no,r[s.no]=s.localName}return sv(r,e,t,n),r}function AR(e){return"localName"in e?e:Object.assign(Object.assign({},e),{localName:e.name})}d();f();p();d();f();p();var Pe=class{equals(t){return this.getType().runtime.util.equals(this.getType(),this,t)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(t,n){let r=this.getType(),i=r.runtime.bin,s=i.makeReadOptions(n);return i.readMessage(this,s.readerFactory(t),t.byteLength,s),this}fromJson(t,n){let r=this.getType(),i=r.runtime.json,s=i.makeReadOptions(n);return i.readMessage(r,t,s,this),this}fromJsonString(t,n){let r;try{r=JSON.parse(t)}catch(i){throw new Error(`cannot decode ${this.getType().typeName} from JSON: ${i instanceof Error?i.message:String(i)}`)}return this.fromJson(r,n)}toBinary(t){let n=this.getType(),r=n.runtime.bin,i=r.makeWriteOptions(t),s=i.writerFactory();return r.writeMessage(this,s,i),s.finish()}toJson(t){let n=this.getType(),r=n.runtime.json,i=r.makeWriteOptions(t);return r.writeMessage(this,i)}toJsonString(t){var n;let r=this.toJson(t);return JSON.stringify(r,null,(n=t==null?void 0:t.prettySpaces)!==null&&n!==void 0?n:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}};function wR(e,t,n,r){var i;let s=(i=r==null?void 0:r.localName)!==null&&i!==void 0?i:t.substring(t.lastIndexOf(".")+1),o={[s]:function(a){e.util.initFields(this),e.util.initPartial(a,this)}}[s];return Object.setPrototypeOf(o.prototype,new Pe),Object.assign(o,{runtime:e,typeName:t,fields:e.util.newFieldList(n),fromBinary(a,u){return new o().fromBinary(a,u)},fromJson(a,u){return new o().fromJson(a,u)},fromJsonString(a,u){return new o().fromJsonString(a,u)},equals(a,u){return e.util.equals(o,a,u)}}),o}function FR(e,t,n,r){return{syntax:e,json:t,bin:n,util:r,makeMessageType(i,s,o){return wR(this,i,s,o)},makeEnum:OR,makeEnumType:ov,getEnumType:DR}}d();f();p();d();f();p();var J;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(J||(J={}));var Xi;(function(e){e[e.BIGINT=0]="BIGINT",e[e.STRING=1]="STRING"})(Xi||(Xi={}));d();f();p();d();f();p();d();f();p();function RR(){let e=0,t=0;for(let r=0;r<28;r+=7){let i=this.buf[this.pos++];if(e|=(i&127)<>4,!(n&128))return this.assertBounds(),[e,t];for(let r=3;r<=31;r+=7){let i=this.buf[this.pos++];if(t|=(i&127)<>>s,a=!(!(o>>>7)&&t==0),u=(a?o|128:o)&255;if(n.push(u),!a)return}let r=e>>>28&15|(t&7)<<4,i=!!(t>>3);if(n.push((i?r|128:r)&255),!!i){for(let s=3;s<31;s=s+7){let o=t>>>s,a=!!(o>>>7),u=(a?o|128:o)&255;if(n.push(u),!a)return}n.push(t>>>31&1)}}var Hh=4294967296;function av(e){let t=e[0]==="-";t&&(e=e.slice(1));let n=1e6,r=0,i=0;function s(o,a){let u=Number(e.slice(o,a));i*=n,r=r*n+u,r>=Hh&&(i=i+(r/Hh|0),r=r%Hh)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),t?xR(r,i):cv(r,i)}function kR(e,t){let n=cv(e,t),r=n.hi&2147483648;r&&(n=xR(n.lo,n.hi));let i=uv(n.lo,n.hi);return r?"-"+i:i}function uv(e,t){if({lo:e,hi:t}=bJ(e,t),t<=2097151)return String(Hh*t+e);let n=e&16777215,r=(e>>>24|t<<8)&16777215,i=t>>16&65535,s=n+r*6777216+i*6710656,o=r+i*8147497,a=i*2,u=1e7;return s>=u&&(o+=Math.floor(s/u),s%=u),o>=u&&(a+=Math.floor(o/u),o%=u),a.toString()+LR(o)+LR(s)}function bJ(e,t){return{lo:e>>>0,hi:t>>>0}}function cv(e,t){return{lo:e|0,hi:t|0}}function xR(e,t){return t=~t,e?e=~e+1:t+=1,cv(e,t)}var LR=e=>{let t=String(e);return"0000000".slice(t.length)+t};function lv(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e=e>>7;t.push(1)}}function PR(){let e=this.buf[this.pos++],t=e&127;if(!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let n=5;e&128&&n<10;n++)e=this.buf[this.pos++];if(e&128)throw new Error("invalid varint");return this.assertBounds(),t>>>0}d();f();p();function SJ(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(typeof g!="object"||typeof g.env!="object"||g.env.BUF_BIGINT_DISABLE!=="1")){let i=BigInt("-9223372036854775808"),s=BigInt("9223372036854775807"),o=BigInt("0"),a=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(u){let c=typeof u=="bigint"?u:BigInt(u);if(c>s||ca||cTn(/^-?[0-9]+$/.test(i),`int64 invalid: ${i}`),r=i=>Tn(/^[0-9]+$/.test(i),`uint64 invalid: ${i}`);return{zero:"0",supported:!1,parse(i){return typeof i!="string"&&(i=i.toString()),n(i),i},uParse(i){return typeof i!="string"&&(i=i.toString()),r(i),i},enc(i){return typeof i!="string"&&(i=i.toString()),n(i),av(i)},uEnc(i){return typeof i!="string"&&(i=i.toString()),r(i),av(i)},dec(i,s){return kR(i,s)},uDec(i,s){return uv(i,s)}}}var zt=SJ();var Xt;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(Xt||(Xt={}));var Zh=class{constructor(t){this.stack=[],this.textEncoder=t!=null?t:new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let t=0;for(let i=0;i>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(up(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return vc(t),lv(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let n=this.textEncoder.encode(t);return this.uint32(n.byteLength),this.raw(n)}float(t){Xh(t);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,t,!0),this.raw(n)}double(t){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,t,!0),this.raw(n)}fixed32(t){up(t);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t,!0),this.raw(n)}sfixed32(t){vc(t);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,t,!0),this.raw(n)}sint32(t){return vc(t),t=(t<<1^t>>31)>>>0,lv(t,this.buf),this}sfixed64(t){let n=new Uint8Array(8),r=new DataView(n.buffer),i=zt.enc(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}fixed64(t){let n=new Uint8Array(8),r=new DataView(n.buffer),i=zt.uEnc(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}int64(t){let n=zt.enc(t);return Wh(n.lo,n.hi,this.buf),this}sint64(t){let n=zt.enc(t),r=n.hi>>31,i=n.lo<<1^r,s=(n.hi<<1|n.lo>>>31)^r;return Wh(i,s,this.buf),this}uint64(t){let n=zt.uEnc(t);return Wh(n.lo,n.hi,this.buf),this}},eT=class{constructor(t,n){this.varint64=RR,this.uint32=PR,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.textDecoder=n!=null?n:new TextDecoder}tag(){let t=this.uint32(),n=t>>>3,r=t&7;if(n<=0||r<0||r>5)throw new Error("illegal tag: field no "+n+" wire type "+r);return[n,r]}skip(t){let n=this.pos;switch(t){case Xt.Varint:for(;this.buf[this.pos++]&128;);break;case Xt.Bit64:this.pos+=4;case Xt.Bit32:this.pos+=4;break;case Xt.LengthDelimited:let r=this.uint32();this.pos+=r;break;case Xt.StartGroup:let i;for(;(i=this.tag()[1])!==Xt.EndGroup;)this.skip(i);break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return zt.dec(...this.varint64())}uint64(){return zt.uDec(...this.varint64())}sint64(){let[t,n]=this.varint64(),r=-(t&1);return t=(t>>>1|(n&1)<<31)^r,n=n>>>1^r,zt.dec(t,n)}bool(){let[t,n]=this.varint64();return t!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return zt.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return zt.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),n=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(n,n+t)}string(){return this.textDecoder.decode(this.bytes())}};d();f();p();function cp(e,t){return t instanceof Pe||!e.fieldWrapper?t:e.fieldWrapper.wrapField(t)}var B_e={"google.protobuf.DoubleValue":J.DOUBLE,"google.protobuf.FloatValue":J.FLOAT,"google.protobuf.Int64Value":J.INT64,"google.protobuf.UInt64Value":J.UINT64,"google.protobuf.Int32Value":J.INT32,"google.protobuf.UInt32Value":J.UINT32,"google.protobuf.BoolValue":J.BOOL,"google.protobuf.StringValue":J.STRING,"google.protobuf.BytesValue":J.BYTES};d();f();p();function _s(e,t,n){if(t===n)return!0;if(e==J.BYTES){if(!(t instanceof Uint8Array)||!(n instanceof Uint8Array)||t.length!==n.length)return!1;for(let r=0;rnew eT(e)},UR={writeUnknownFields:!0,writerFactory:()=>new Zh};function DJ(e){return e?Object.assign(Object.assign({},MR),e):MR}function OJ(e){return e?Object.assign(Object.assign({},UR),e):UR}function CR(){return{makeReadOptions:DJ,makeWriteOptions:OJ,listUnknownFields(e){var t;return(t=e[_c])!==null&&t!==void 0?t:[]},discardUnknownFields(e){delete e[_c]},writeUnknownFields(e,t){let r=e[_c];if(r)for(let i of r)t.tag(i.no,i.wireType).raw(i.data)},onUnknownField(e,t,n,r){let i=e;Array.isArray(i[_c])||(i[_c]=[]),i[_c].push({no:t,wireType:n,data:r})},readMessage(e,t,n,r){let i=e.getType(),s=n===void 0?t.len:t.pos+n;for(;t.pos0&&(E=wJ),l){let x=c[m];if(a==Xt.LengthDelimited&&h!=J.STRING&&h!=J.BYTES){let Y=t.uint32()+t.pos;for(;t.pos>4,o=s,i=2;break;case 2:n[r++]=(o&15)<<4|(s&60)>>2,o=s,i=3;break;case 3:n[r++]=(o&3)<<6|s,i=0;break}}if(i==1)throw Error("invalid base64 string.");return n.subarray(0,r)},enc(e){let t="",n=0,r,i=0;for(let s=0;s>2],i=(r&3)<<4,n=1;break;case 1:t+=bs[i|r>>4],i=(r&15)<<2,n=2;break;case 2:t+=bs[i|r>>6],t+=bs[r&63],n=0;break}return n&&(t+=bs[i],t+="=",n==1&&(t+="=")),t}};var jR={ignoreUnknownFields:!1},GR={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function FJ(e){return e?Object.assign(Object.assign({},jR),e):jR}function LJ(e){return e?Object.assign(Object.assign({},GR),e):GR}function KR(e){let t=e(RJ,qR);return{makeReadOptions:FJ,makeWriteOptions:LJ,readMessage(n,r,i,s){if(r==null||Array.isArray(r)||typeof r!="object")throw new Error(`cannot decode message ${n.typeName} from JSON: ${this.debug(r)}`);s=s!=null?s:new n;let o={};for(let[a,u]of Object.entries(r)){let c=n.fields.findJsonName(a);if(!c){if(!i.ignoreUnknownFields)throw new Error(`cannot decode message ${n.typeName} from JSON: key "${a}" is unknown`);continue}let l=c.localName,m=s;if(c.oneof){if(u===null&&c.kind=="scalar")continue;let h=o[c.oneof.localName];if(h)throw new Error(`cannot decode message ${n.typeName} from JSON: multiple keys for oneof "${c.oneof.name}" present: "${h}", "${a}"`);o[c.oneof.localName]=a,m=m[c.oneof.localName]={case:l},l="value"}if(c.repeated){if(u===null)continue;if(!Array.isArray(u))throw new Error(`cannot decode field ${n.typeName}.${c.name} from JSON: ${this.debug(u)}`);let h=m[l];for(let E of u){if(E===null)throw new Error(`cannot decode field ${n.typeName}.${c.name} from JSON: ${this.debug(E)}`);let N;switch(c.kind){case"message":N=c.T.fromJson(E,i);break;case"enum":if(N=fv(c.T,E,i.ignoreUnknownFields),N===void 0)continue;break;case"scalar":try{N=dp(c.T,E,c.L)}catch(D){let w=`cannot decode field ${n.typeName}.${c.name} from JSON: ${this.debug(E)}`;throw D instanceof Error&&D.message.length>0&&(w+=`: ${D.message}`),new Error(w)}break}h.push(N)}}else if(c.kind=="map"){if(u===null)continue;if(Array.isArray(u)||typeof u!="object")throw new Error(`cannot decode field ${n.typeName}.${c.name} from JSON: ${this.debug(u)}`);let h=m[l];for(let[E,N]of Object.entries(u)){if(N===null)throw new Error(`cannot decode field ${n.typeName}.${c.name} from JSON: map value null`);let D;switch(c.V.kind){case"message":D=c.V.T.fromJson(N,i);break;case"enum":if(D=fv(c.V.T,N,i.ignoreUnknownFields),D===void 0)continue;break;case"scalar":try{D=dp(c.V.T,N,Xi.BIGINT)}catch(w){let x=`cannot decode map value for field ${n.typeName}.${c.name} from JSON: ${this.debug(u)}`;throw w instanceof Error&&w.message.length>0&&(x+=`: ${w.message}`),new Error(x)}break}try{h[dp(c.K,c.K==J.BOOL?E=="true"?!0:E=="false"?!1:E:E,Xi.BIGINT).toString()]=D}catch(w){let x=`cannot decode map key for field ${n.typeName}.${c.name} from JSON: ${this.debug(u)}`;throw w instanceof Error&&w.message.length>0&&(x+=`: ${w.message}`),new Error(x)}}}else switch(c.kind){case"message":let h=c.T;if(u===null&&h.typeName!="google.protobuf.Value"){if(c.oneof)throw new Error(`cannot decode field ${n.typeName}.${c.name} from JSON: null is invalid for oneof field "${a}"`);continue}m[l]instanceof Pe?m[l].fromJson(u,i):(m[l]=h.fromJson(u,i),h.fieldWrapper&&!c.oneof&&(m[l]=h.fieldWrapper.unwrapField(m[l])));break;case"enum":let E=fv(c.T,u,i.ignoreUnknownFields);E!==void 0&&(m[l]=E);break;case"scalar":try{m[l]=dp(c.T,u,c.L)}catch(N){let D=`cannot decode field ${n.typeName}.${c.name} from JSON: ${this.debug(u)}`;throw N instanceof Error&&N.message.length>0&&(D+=`: ${N.message}`),new Error(D)}break}}return s},writeMessage(n,r){let i=n.getType(),s={},o;try{for(let a of i.fields.byMember()){let u;if(a.kind=="oneof"){let c=n[a.localName];if(c.value===void 0)continue;if(o=a.findField(c.case),!o)throw"oneof case not found: "+c.case;u=t(o,c.value,r)}else o=a,u=t(o,n[o.localName],r);u!==void 0&&(s[r.useProtoFieldName?o.name:o.jsonName]=u)}}catch(a){let u=o?`cannot encode field ${i.typeName}.${o.name} to JSON`:`cannot encode message ${i.typeName} to JSON`,c=a instanceof Error?a.message:String(a);throw new Error(u+(c.length>0?`: ${c}`:""))}return s},readScalar:dp,writeScalar:qR,debug:QR}}function QR(e){if(e===null)return"null";switch(typeof e){case"object":return Array.isArray(e)?"array":"object";case"string":return e.length>100?"string":`"${e.split('"').join('\\"')}"`;default:return String(e)}}function dp(e,t,n){switch(e){case J.DOUBLE:case J.FLOAT:if(t===null)return 0;if(t==="NaN")return Number.NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(t===""||typeof t=="string"&&t.trim().length!==t.length||typeof t!="string"&&typeof t!="number")break;let r=Number(t);if(Number.isNaN(r)||!Number.isFinite(r))break;return e==J.FLOAT&&Xh(r),r;case J.INT32:case J.FIXED32:case J.SFIXED32:case J.SINT32:case J.UINT32:if(t===null)return 0;let i;if(typeof t=="number"?i=t:typeof t=="string"&&t.length>0&&t.trim().length===t.length&&(i=Number(t)),i===void 0)break;return e==J.UINT32?up(i):vc(i),i;case J.INT64:case J.SFIXED64:case J.SINT64:if(t===null)return zt.zero;if(typeof t!="number"&&typeof t!="string")break;let s=zt.parse(t);return n?s.toString():s;case J.FIXED64:case J.UINT64:if(t===null)return zt.zero;if(typeof t!="number"&&typeof t!="string")break;let o=zt.uParse(t);return n?o.toString():o;case J.BOOL:if(t===null)return!1;if(typeof t!="boolean")break;return t;case J.STRING:if(t===null)return"";if(typeof t!="string")break;try{encodeURIComponent(t)}catch(a){throw new Error("invalid UTF8")}return t;case J.BYTES:if(t===null||t==="")return new Uint8Array(0);if(typeof t!="string")break;return pv.dec(t)}throw new Error}function fv(e,t,n){if(t===null)return 0;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":let r=e.findName(t);if(r||n)return r==null?void 0:r.no;break}throw new Error(`cannot decode enum ${e.typeName} from JSON: ${QR(t)}`)}function RJ(e,t,n,r){var i;if(t===void 0)return t;if(t===0&&!n)return;if(r)return t;if(e.typeName=="google.protobuf.NullValue")return null;let s=e.findNumber(t);return(i=s==null?void 0:s.name)!==null&&i!==void 0?i:t}function qR(e,t,n){if(t!==void 0)switch(e){case J.INT32:case J.SFIXED32:case J.SINT32:case J.FIXED32:case J.UINT32:return Tn(typeof t=="number"),t!=0||n?t:void 0;case J.FLOAT:case J.DOUBLE:return Tn(typeof t=="number"),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t!==0||n?t:void 0;case J.STRING:return Tn(typeof t=="string"),t.length>0||n?t:void 0;case J.BOOL:return Tn(typeof t=="boolean"),t||n?t:void 0;case J.UINT64:case J.FIXED64:case J.INT64:case J.SFIXED64:case J.SINT64:return Tn(typeof t=="bigint"||typeof t=="string"||typeof t=="number"),n||t!=0?t.toString(10):void 0;case J.BYTES:return Tn(t instanceof Uint8Array),n||t.byteLength>0?pv.enc(t):void 0}}function YR(){return KR((e,t)=>function(r,i,s){if(r.kind=="map"){let o={};switch(r.V.kind){case"scalar":for(let[u,c]of Object.entries(i)){let l=t(r.V.T,c,!0);Tn(l!==void 0),o[u.toString()]=l}break;case"message":for(let[u,c]of Object.entries(i))o[u.toString()]=c.toJson(s);break;case"enum":let a=r.V.T;for(let[u,c]of Object.entries(i)){Tn(c===void 0||typeof c=="number");let l=e(a,c,!0,s.enumAsInteger);Tn(l!==void 0),o[u.toString()]=l}break}return s.emitDefaultValues||Object.keys(o).length>0?o:void 0}else if(r.repeated){let o=[];switch(r.kind){case"scalar":for(let a=0;a0?o:void 0}else switch(r.kind){case"scalar":return t(r.T,i,!!r.oneof||r.opt||s.emitDefaultValues);case"enum":return e(r.T,i,!!r.oneof||r.opt||s.emitDefaultValues,s.enumAsInteger);case"message":return i!==void 0?cp(r.T,i).toJson(s):void 0}})}d();f();p();function JR(){return{setEnumType:sv,initPartial(e,t){if(e===void 0)return;let n=t.getType();for(let r of n.fields.byMember()){let i=r.localName,s=t,o=e;if(o[i]!==void 0)switch(r.kind){case"oneof":let a=o[i].case;if(a===void 0)continue;let u=r.findField(a),c=o[i].value;u&&u.kind=="message"&&!(c instanceof u.T)?c=new u.T(c):u&&u.kind==="scalar"&&u.T===J.BYTES&&(c=pp(c)),s[i]={case:a,value:c};break;case"scalar":case"enum":let l=o[i];r.T===J.BYTES&&(l=r.repeated?l.map(pp):pp(l)),s[i]=l;break;case"map":switch(r.V.kind){case"scalar":case"enum":if(r.V.T===J.BYTES)for(let[E,N]of Object.entries(o[i]))s[i][E]=pp(N);else Object.assign(s[i],o[i]);break;case"message":let h=r.V.T;for(let E of Object.keys(o[i])){let N=o[i][E];h.fieldWrapper||(N=new h(N)),s[i][E]=N}break}break;case"message":let m=r.T;if(r.repeated)s[i]=o[i].map(h=>h instanceof m?h:new m(h));else if(o[i]!==void 0){let h=o[i];m.fieldWrapper?m.typeName==="google.protobuf.BytesValue"?s[i]=pp(h):s[i]=h:s[i]=h instanceof m?h:new m(h)}break}}},equals(e,t,n){return t===n?!0:!t||!n?!1:e.fields.byMember().every(r=>{let i=t[r.localName],s=n[r.localName];if(r.repeated){if(i.length!==s.length)return!1;switch(r.kind){case"message":return i.every((o,a)=>r.T.equals(o,s[a]));case"scalar":return i.every((o,a)=>_s(r.T,o,s[a]));case"enum":return i.every((o,a)=>_s(J.INT32,o,s[a]))}throw new Error(`repeated cannot contain ${r.kind}`)}switch(r.kind){case"message":return r.T.equals(i,s);case"enum":return _s(J.INT32,i,s);case"scalar":return _s(r.T,i,s);case"oneof":if(i.case!==s.case)return!1;let o=r.findField(i.case);if(o===void 0)return!0;switch(o.kind){case"message":return o.T.equals(i.value,s.value);case"enum":return _s(J.INT32,i.value,s.value);case"scalar":return _s(o.T,i.value,s.value)}throw new Error(`oneof cannot contain ${o.kind}`);case"map":let a=Object.keys(i).concat(Object.keys(s));switch(r.V.kind){case"message":let u=r.V.T;return a.every(l=>u.equals(i[l],s[l]));case"enum":return a.every(l=>_s(J.INT32,i[l],s[l]));case"scalar":let c=r.V.T;return a.every(l=>_s(c,i[l],s[l]))}break}})},clone(e){let t=e.getType(),n=new t,r=n;for(let i of t.fields.byMember()){let s=e[i.localName],o;if(i.repeated)o=s.map(sT);else if(i.kind=="map"){o=r[i.localName];for(let[a,u]of Object.entries(s))o[a]=sT(u)}else i.kind=="oneof"?o=i.findField(s.case)?{case:s.case,value:sT(s.value)}:{case:void 0}:o=sT(s);r[i.localName]=o}return n}}}function sT(e){if(e===void 0)return e;if(e instanceof Pe)return e.clone();if(e instanceof Uint8Array){let t=new Uint8Array(e.byteLength);return t.set(e),t}return e}function pp(e){return e instanceof Uint8Array?e:new Uint8Array(e)}d();f();p();var oT=class{constructor(t,n){this._fields=t,this._normalizer=n}findJsonName(t){if(!this.jsonNames){let n={};for(let r of this.list())n[r.jsonName]=n[r.name]=r;this.jsonNames=n}return this.jsonNames[t]}find(t){if(!this.numbers){let n={};for(let r of this.list())n[r.no]=r;this.numbers=n}return this.numbers[t]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((t,n)=>t.no-n.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];let t=this.members,n;for(let r of this.list())r.oneof?r.oneof!==n&&(n=r.oneof,t.push(n)):t.push(r)}return this.members}};d();f();p();d();f();p();function mv(e,t){let n=HR(e);return t?n:MJ(PJ(n))}function zR(e){return mv(e,!1)}var XR=HR;function HR(e){let t=!1,n=[];for(let r=0;r`${e}$`,PJ=e=>xJ.has(e)?WR(e):e,MJ=e=>kJ.has(e)?WR(e):e;var aT=class{constructor(t){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.default=void 0,this.fields=[],this.name=t,this.localName=zR(t)}addField(t){Tn(t.oneof===this,`field ${t.name} not one of ${this.name}`),this.fields.push(t)}findField(t){if(!this._lookup){this._lookup=Object.create(null);for(let n=0;n[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"routing_url",kind:"scalar",T:9}]));var Tv=Ds,Os=class Os extends Pe{constructor(n){super();S(this,"engineConfig");S(this,"version","");S(this,"subgraphs",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new Os().fromBinary(n,r)}static fromJson(n,r){return new Os().fromJson(n,r)}static fromJsonString(n,r){return new Os().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Os,n,r)}};S(Os,"runtime",C),S(Os,"typeName","wg.cosmo.node.v1.RouterConfig"),S(Os,"fields",C.util.newFieldList(()=>[{no:1,name:"engine_config",kind:"message",T:mp},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"subgraphs",kind:"message",T:Tv,repeated:!0}]));var fp=Os,As=class As extends Pe{constructor(n){super();S(this,"code",Sc.OK);S(this,"details");C.util.initPartial(n,this)}static fromBinary(n,r){return new As().fromBinary(n,r)}static fromJson(n,r){return new As().fromJson(n,r)}static fromJsonString(n,r){return new As().fromJsonString(n,r)}static equals(n,r){return C.util.equals(As,n,r)}};S(As,"runtime",C),S(As,"typeName","wg.cosmo.node.v1.Response"),S(As,"fields",C.util.newFieldList(()=>[{no:1,name:"code",kind:"enum",T:C.getEnumType(Sc)},{no:2,name:"details",kind:"scalar",T:9,opt:!0}]));var uT=As,ws=class ws extends Pe{constructor(n){super();S(this,"code",0);S(this,"message","");C.util.initPartial(n,this)}static fromBinary(n,r){return new ws().fromBinary(n,r)}static fromJson(n,r){return new ws().fromJson(n,r)}static fromJsonString(n,r){return new ws().fromJsonString(n,r)}static equals(n,r){return C.util.equals(ws,n,r)}};S(ws,"runtime",C),S(ws,"typeName","wg.cosmo.node.v1.ResponseStatus"),S(ws,"fields",C.util.newFieldList(()=>[{no:1,name:"code",kind:"scalar",T:5},{no:2,name:"message",kind:"scalar",T:9}]));var ZR=ws,Fs=class Fs extends Pe{constructor(n){super();S(this,"graphName","");S(this,"version");C.util.initPartial(n,this)}static fromBinary(n,r){return new Fs().fromBinary(n,r)}static fromJson(n,r){return new Fs().fromJson(n,r)}static fromJsonString(n,r){return new Fs().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Fs,n,r)}};S(Fs,"runtime",C),S(Fs,"typeName","wg.cosmo.node.v1.GetConfigRequest"),S(Fs,"fields",C.util.newFieldList(()=>[{no:1,name:"graph_name",kind:"scalar",T:9},{no:2,name:"version",kind:"scalar",T:9,opt:!0}]));var ek=Fs,Ls=class Ls extends Pe{constructor(n){super();S(this,"response");S(this,"config");C.util.initPartial(n,this)}static fromBinary(n,r){return new Ls().fromBinary(n,r)}static fromJson(n,r){return new Ls().fromJson(n,r)}static fromJsonString(n,r){return new Ls().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Ls,n,r)}};S(Ls,"runtime",C),S(Ls,"typeName","wg.cosmo.node.v1.GetConfigResponse"),S(Ls,"fields",C.util.newFieldList(()=>[{no:1,name:"response",kind:"message",T:uT},{no:2,name:"config",kind:"message",T:fp,opt:!0}]));var tk=Ls,Rs=class Rs extends Pe{constructor(n){super();S(this,"accountLimits");S(this,"graphPublicKey","");C.util.initPartial(n,this)}static fromBinary(n,r){return new Rs().fromBinary(n,r)}static fromJson(n,r){return new Rs().fromJson(n,r)}static fromJsonString(n,r){return new Rs().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Rs,n,r)}};S(Rs,"runtime",C),S(Rs,"typeName","wg.cosmo.node.v1.RegistrationInfo"),S(Rs,"fields",C.util.newFieldList(()=>[{no:1,name:"account_limits",kind:"message",T:Ev},{no:2,name:"graph_public_key",kind:"scalar",T:9}]));var yv=Rs,ks=class ks extends Pe{constructor(n){super();S(this,"traceSamplingRate",0);C.util.initPartial(n,this)}static fromBinary(n,r){return new ks().fromBinary(n,r)}static fromJson(n,r){return new ks().fromJson(n,r)}static fromJsonString(n,r){return new ks().fromJsonString(n,r)}static equals(n,r){return C.util.equals(ks,n,r)}};S(ks,"runtime",C),S(ks,"typeName","wg.cosmo.node.v1.AccountLimits"),S(ks,"fields",C.util.newFieldList(()=>[{no:1,name:"trace_sampling_rate",kind:"scalar",T:2}]));var Ev=ks,xs=class xs extends Pe{constructor(t){super(),C.util.initPartial(t,this)}static fromBinary(t,n){return new xs().fromBinary(t,n)}static fromJson(t,n){return new xs().fromJson(t,n)}static fromJsonString(t,n){return new xs().fromJsonString(t,n)}static equals(t,n){return C.util.equals(xs,t,n)}};S(xs,"runtime",C),S(xs,"typeName","wg.cosmo.node.v1.SelfRegisterRequest"),S(xs,"fields",C.util.newFieldList(()=>[]));var nk=xs,Ps=class Ps extends Pe{constructor(n){super();S(this,"response");S(this,"registrationInfo");C.util.initPartial(n,this)}static fromBinary(n,r){return new Ps().fromBinary(n,r)}static fromJson(n,r){return new Ps().fromJson(n,r)}static fromJsonString(n,r){return new Ps().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Ps,n,r)}};S(Ps,"runtime",C),S(Ps,"typeName","wg.cosmo.node.v1.SelfRegisterResponse"),S(Ps,"fields",C.util.newFieldList(()=>[{no:1,name:"response",kind:"message",T:uT},{no:2,name:"registrationInfo",kind:"message",T:yv,opt:!0}]));var rk=Ps,Ms=class Ms extends Pe{constructor(n){super();S(this,"defaultFlushInterval",zt.zero);S(this,"datasourceConfigurations",[]);S(this,"fieldConfigurations",[]);S(this,"graphqlSchema","");S(this,"typeConfigurations",[]);S(this,"stringStorage",{});C.util.initPartial(n,this)}static fromBinary(n,r){return new Ms().fromBinary(n,r)}static fromJson(n,r){return new Ms().fromJson(n,r)}static fromJsonString(n,r){return new Ms().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Ms,n,r)}};S(Ms,"runtime",C),S(Ms,"typeName","wg.cosmo.node.v1.EngineConfiguration"),S(Ms,"fields",C.util.newFieldList(()=>[{no:1,name:"defaultFlushInterval",kind:"scalar",T:3},{no:2,name:"datasource_configurations",kind:"message",T:hp,repeated:!0},{no:3,name:"field_configurations",kind:"message",T:Np,repeated:!0},{no:4,name:"graphqlSchema",kind:"scalar",T:9},{no:5,name:"type_configurations",kind:"message",T:Nv,repeated:!0},{no:6,name:"string_storage",kind:"map",K:9,V:{kind:"scalar",T:9}}]));var mp=Ms,Us=class Us extends Pe{constructor(n){super();S(this,"kind",zo.STATIC);S(this,"rootNodes",[]);S(this,"childNodes",[]);S(this,"overrideFieldPathFromAlias",!1);S(this,"customGraphql");S(this,"customStatic");S(this,"directives",[]);S(this,"requestTimeoutSeconds",zt.zero);S(this,"id","");S(this,"keys",[]);S(this,"provides",[]);S(this,"requires",[]);S(this,"customEvents");S(this,"entityInterfaces",[]);S(this,"interfaceObjects",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new Us().fromBinary(n,r)}static fromJson(n,r){return new Us().fromJson(n,r)}static fromJsonString(n,r){return new Us().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Us,n,r)}};S(Us,"runtime",C),S(Us,"typeName","wg.cosmo.node.v1.DataSourceConfiguration"),S(Us,"fields",C.util.newFieldList(()=>[{no:1,name:"kind",kind:"enum",T:C.getEnumType(zo)},{no:2,name:"root_nodes",kind:"message",T:Dc,repeated:!0},{no:3,name:"child_nodes",kind:"message",T:Dc,repeated:!0},{no:4,name:"override_field_path_from_alias",kind:"scalar",T:8},{no:5,name:"custom_graphql",kind:"message",T:gp},{no:6,name:"custom_static",kind:"message",T:Iv},{no:7,name:"directives",kind:"message",T:vv,repeated:!0},{no:8,name:"request_timeout_seconds",kind:"scalar",T:3},{no:9,name:"id",kind:"scalar",T:9},{no:10,name:"keys",kind:"message",T:Ja,repeated:!0},{no:11,name:"provides",kind:"message",T:Ja,repeated:!0},{no:12,name:"requires",kind:"message",T:Ja,repeated:!0},{no:13,name:"custom_events",kind:"message",T:vp},{no:14,name:"entity_interfaces",kind:"message",T:Oc,repeated:!0},{no:15,name:"interface_objects",kind:"message",T:Oc,repeated:!0}]));var hp=Us,Cs=class Cs extends Pe{constructor(n){super();S(this,"name","");S(this,"sourceType",za.OBJECT_FIELD);C.util.initPartial(n,this)}static fromBinary(n,r){return new Cs().fromBinary(n,r)}static fromJson(n,r){return new Cs().fromJson(n,r)}static fromJsonString(n,r){return new Cs().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Cs,n,r)}};S(Cs,"runtime",C),S(Cs,"typeName","wg.cosmo.node.v1.ArgumentConfiguration"),S(Cs,"fields",C.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"source_type",kind:"enum",T:C.getEnumType(za)}]));var Tp=Cs,Bs=class Bs extends Pe{constructor(n){super();S(this,"requiredAndScopes",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new Bs().fromBinary(n,r)}static fromJson(n,r){return new Bs().fromJson(n,r)}static fromJsonString(n,r){return new Bs().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Bs,n,r)}};S(Bs,"runtime",C),S(Bs,"typeName","wg.cosmo.node.v1.Scopes"),S(Bs,"fields",C.util.newFieldList(()=>[{no:1,name:"required_and_scopes",kind:"scalar",T:9,repeated:!0}]));var yp=Bs,$s=class $s extends Pe{constructor(n){super();S(this,"requiresAuthentication",!1);S(this,"requiredOrScopes",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new $s().fromBinary(n,r)}static fromJson(n,r){return new $s().fromJson(n,r)}static fromJsonString(n,r){return new $s().fromJsonString(n,r)}static equals(n,r){return C.util.equals($s,n,r)}};S($s,"runtime",C),S($s,"typeName","wg.cosmo.node.v1.AuthorizationConfiguration"),S($s,"fields",C.util.newFieldList(()=>[{no:1,name:"requires_authentication",kind:"scalar",T:8},{no:2,name:"required_or_scopes",kind:"message",T:yp,repeated:!0}]));var Ep=$s,Vs=class Vs extends Pe{constructor(n){super();S(this,"typeName","");S(this,"fieldName","");S(this,"argumentsConfiguration",[]);S(this,"authorizationConfiguration");C.util.initPartial(n,this)}static fromBinary(n,r){return new Vs().fromBinary(n,r)}static fromJson(n,r){return new Vs().fromJson(n,r)}static fromJsonString(n,r){return new Vs().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Vs,n,r)}};S(Vs,"runtime",C),S(Vs,"typeName","wg.cosmo.node.v1.FieldConfiguration"),S(Vs,"fields",C.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"field_name",kind:"scalar",T:9},{no:3,name:"arguments_configuration",kind:"message",T:Tp,repeated:!0},{no:4,name:"authorization_configuration",kind:"message",T:Ep}]));var Np=Vs,js=class js extends Pe{constructor(n){super();S(this,"typeName","");S(this,"renameTo","");C.util.initPartial(n,this)}static fromBinary(n,r){return new js().fromBinary(n,r)}static fromJson(n,r){return new js().fromJson(n,r)}static fromJsonString(n,r){return new js().fromJsonString(n,r)}static equals(n,r){return C.util.equals(js,n,r)}};S(js,"runtime",C),S(js,"typeName","wg.cosmo.node.v1.TypeConfiguration"),S(js,"fields",C.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"rename_to",kind:"scalar",T:9}]));var Nv=js,Gs=class Gs extends Pe{constructor(n){super();S(this,"typeName","");S(this,"fieldNames",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new Gs().fromBinary(n,r)}static fromJson(n,r){return new Gs().fromJson(n,r)}static fromJsonString(n,r){return new Gs().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Gs,n,r)}};S(Gs,"runtime",C),S(Gs,"typeName","wg.cosmo.node.v1.TypeField"),S(Gs,"fields",C.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"field_names",kind:"scalar",T:9,repeated:!0}]));var Dc=Gs,qs=class qs extends Pe{constructor(n){super();S(this,"typeName","");S(this,"fieldName","");S(this,"selectionSet","");S(this,"disableEntityResolver",!1);C.util.initPartial(n,this)}static fromBinary(n,r){return new qs().fromBinary(n,r)}static fromJson(n,r){return new qs().fromJson(n,r)}static fromJsonString(n,r){return new qs().fromJsonString(n,r)}static equals(n,r){return C.util.equals(qs,n,r)}};S(qs,"runtime",C),S(qs,"typeName","wg.cosmo.node.v1.RequiredField"),S(qs,"fields",C.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"field_name",kind:"scalar",T:9},{no:3,name:"selection_set",kind:"scalar",T:9},{no:4,name:"disable_entity_resolver",kind:"scalar",T:8}]));var Ja=qs,Ks=class Ks extends Pe{constructor(n){super();S(this,"interfaceTypeName","");S(this,"concreteTypeNames",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new Ks().fromBinary(n,r)}static fromJson(n,r){return new Ks().fromJson(n,r)}static fromJsonString(n,r){return new Ks().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Ks,n,r)}};S(Ks,"runtime",C),S(Ks,"typeName","wg.cosmo.node.v1.EntityInterfaceConfiguration"),S(Ks,"fields",C.util.newFieldList(()=>[{no:1,name:"interface_type_name",kind:"scalar",T:9},{no:2,name:"concrete_type_names",kind:"scalar",T:9,repeated:!0}]));var Oc=Ks,Qs=class Qs extends Pe{constructor(n){super();S(this,"url");S(this,"method",Xa.GET);S(this,"header",{});S(this,"body");S(this,"query",[]);S(this,"urlEncodeBody",!1);S(this,"mtls");S(this,"baseUrl");S(this,"path");S(this,"httpProxyUrl");C.util.initPartial(n,this)}static fromBinary(n,r){return new Qs().fromBinary(n,r)}static fromJson(n,r){return new Qs().fromJson(n,r)}static fromJsonString(n,r){return new Qs().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Qs,n,r)}};S(Qs,"runtime",C),S(Qs,"typeName","wg.cosmo.node.v1.FetchConfiguration"),S(Qs,"fields",C.util.newFieldList(()=>[{no:1,name:"url",kind:"message",T:lr},{no:2,name:"method",kind:"enum",T:C.getEnumType(Xa)},{no:3,name:"header",kind:"map",K:9,V:{kind:"message",T:bv}},{no:4,name:"body",kind:"message",T:lr},{no:5,name:"query",kind:"message",T:_v,repeated:!0},{no:7,name:"url_encode_body",kind:"scalar",T:8},{no:8,name:"mtls",kind:"message",T:Sv},{no:9,name:"base_url",kind:"message",T:lr},{no:10,name:"path",kind:"message",T:lr},{no:11,name:"http_proxy_url",kind:"message",T:lr,opt:!0}]));var gv=Qs,Ys=class Ys extends Pe{constructor(n){super();S(this,"statusCode",zt.zero);S(this,"typeName","");S(this,"injectStatusCodeIntoBody",!1);C.util.initPartial(n,this)}static fromBinary(n,r){return new Ys().fromBinary(n,r)}static fromJson(n,r){return new Ys().fromJson(n,r)}static fromJsonString(n,r){return new Ys().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Ys,n,r)}};S(Ys,"runtime",C),S(Ys,"typeName","wg.cosmo.node.v1.StatusCodeTypeMapping"),S(Ys,"fields",C.util.newFieldList(()=>[{no:1,name:"status_code",kind:"scalar",T:3},{no:2,name:"type_name",kind:"scalar",T:9},{no:3,name:"inject_status_code_into_body",kind:"scalar",T:8}]));var ik=Ys,Js=class Js extends Pe{constructor(n){super();S(this,"fetch");S(this,"subscription");S(this,"federation");S(this,"upstreamSchema");S(this,"customScalarTypeFields",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new Js().fromBinary(n,r)}static fromJson(n,r){return new Js().fromJson(n,r)}static fromJsonString(n,r){return new Js().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Js,n,r)}};S(Js,"runtime",C),S(Js,"typeName","wg.cosmo.node.v1.DataSourceCustom_GraphQL"),S(Js,"fields",C.util.newFieldList(()=>[{no:1,name:"fetch",kind:"message",T:gv},{no:2,name:"subscription",kind:"message",T:Dv},{no:3,name:"federation",kind:"message",T:Ov},{no:4,name:"upstream_schema",kind:"message",T:_p},{no:6,name:"custom_scalar_type_fields",kind:"message",T:Av,repeated:!0}]));var gp=Js,zs=class zs extends Pe{constructor(n){super();S(this,"type",ao.PUBLISH);S(this,"typeName","");S(this,"fieldName","");S(this,"topic","");S(this,"sourceId","");C.util.initPartial(n,this)}static fromBinary(n,r){return new zs().fromBinary(n,r)}static fromJson(n,r){return new zs().fromJson(n,r)}static fromJsonString(n,r){return new zs().fromJsonString(n,r)}static equals(n,r){return C.util.equals(zs,n,r)}};S(zs,"runtime",C),S(zs,"typeName","wg.cosmo.node.v1.EventConfiguration"),S(zs,"fields",C.util.newFieldList(()=>[{no:1,name:"type",kind:"enum",T:C.getEnumType(ao)},{no:2,name:"type_name",kind:"scalar",T:9},{no:3,name:"field_name",kind:"scalar",T:9},{no:4,name:"topic",kind:"scalar",T:9},{no:5,name:"source_id",kind:"scalar",T:9}]));var Ip=zs,Xs=class Xs extends Pe{constructor(n){super();S(this,"events",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new Xs().fromBinary(n,r)}static fromJson(n,r){return new Xs().fromJson(n,r)}static fromJsonString(n,r){return new Xs().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Xs,n,r)}};S(Xs,"runtime",C),S(Xs,"typeName","wg.cosmo.node.v1.DataSourceCustom_Events"),S(Xs,"fields",C.util.newFieldList(()=>[{no:1,name:"events",kind:"message",T:Ip,repeated:!0}]));var vp=Xs,Hs=class Hs extends Pe{constructor(n){super();S(this,"data");C.util.initPartial(n,this)}static fromBinary(n,r){return new Hs().fromBinary(n,r)}static fromJson(n,r){return new Hs().fromJson(n,r)}static fromJsonString(n,r){return new Hs().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Hs,n,r)}};S(Hs,"runtime",C),S(Hs,"typeName","wg.cosmo.node.v1.DataSourceCustom_Static"),S(Hs,"fields",C.util.newFieldList(()=>[{no:1,name:"data",kind:"message",T:lr}]));var Iv=Hs,Ws=class Ws extends Pe{constructor(n){super();S(this,"kind",Xo.STATIC_CONFIGURATION_VARIABLE);S(this,"staticVariableContent","");S(this,"environmentVariableName","");S(this,"environmentVariableDefaultValue","");S(this,"placeholderVariableName","");C.util.initPartial(n,this)}static fromBinary(n,r){return new Ws().fromBinary(n,r)}static fromJson(n,r){return new Ws().fromJson(n,r)}static fromJsonString(n,r){return new Ws().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Ws,n,r)}};S(Ws,"runtime",C),S(Ws,"typeName","wg.cosmo.node.v1.ConfigurationVariable"),S(Ws,"fields",C.util.newFieldList(()=>[{no:1,name:"kind",kind:"enum",T:C.getEnumType(Xo)},{no:2,name:"static_variable_content",kind:"scalar",T:9},{no:3,name:"environment_variable_name",kind:"scalar",T:9},{no:4,name:"environment_variable_default_value",kind:"scalar",T:9},{no:5,name:"placeholder_variable_name",kind:"scalar",T:9}]));var lr=Ws,Zs=class Zs extends Pe{constructor(n){super();S(this,"directiveName","");S(this,"renameTo","");C.util.initPartial(n,this)}static fromBinary(n,r){return new Zs().fromBinary(n,r)}static fromJson(n,r){return new Zs().fromJson(n,r)}static fromJsonString(n,r){return new Zs().fromJsonString(n,r)}static equals(n,r){return C.util.equals(Zs,n,r)}};S(Zs,"runtime",C),S(Zs,"typeName","wg.cosmo.node.v1.DirectiveConfiguration"),S(Zs,"fields",C.util.newFieldList(()=>[{no:1,name:"directive_name",kind:"scalar",T:9},{no:2,name:"rename_to",kind:"scalar",T:9}]));var vv=Zs,eo=class eo extends Pe{constructor(n){super();S(this,"name","");S(this,"value","");C.util.initPartial(n,this)}static fromBinary(n,r){return new eo().fromBinary(n,r)}static fromJson(n,r){return new eo().fromJson(n,r)}static fromJsonString(n,r){return new eo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(eo,n,r)}};S(eo,"runtime",C),S(eo,"typeName","wg.cosmo.node.v1.URLQueryConfiguration"),S(eo,"fields",C.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:9}]));var _v=eo,to=class to extends Pe{constructor(n){super();S(this,"values",[]);C.util.initPartial(n,this)}static fromBinary(n,r){return new to().fromBinary(n,r)}static fromJson(n,r){return new to().fromJson(n,r)}static fromJsonString(n,r){return new to().fromJsonString(n,r)}static equals(n,r){return C.util.equals(to,n,r)}};S(to,"runtime",C),S(to,"typeName","wg.cosmo.node.v1.HTTPHeader"),S(to,"fields",C.util.newFieldList(()=>[{no:1,name:"values",kind:"message",T:lr,repeated:!0}]));var bv=to,no=class no extends Pe{constructor(n){super();S(this,"key");S(this,"cert");S(this,"insecureSkipVerify",!1);C.util.initPartial(n,this)}static fromBinary(n,r){return new no().fromBinary(n,r)}static fromJson(n,r){return new no().fromJson(n,r)}static fromJsonString(n,r){return new no().fromJsonString(n,r)}static equals(n,r){return C.util.equals(no,n,r)}};S(no,"runtime",C),S(no,"typeName","wg.cosmo.node.v1.MTLSConfiguration"),S(no,"fields",C.util.newFieldList(()=>[{no:1,name:"key",kind:"message",T:lr},{no:2,name:"cert",kind:"message",T:lr},{no:3,name:"insecureSkipVerify",kind:"scalar",T:8}]));var Sv=no,ro=class ro extends Pe{constructor(n){super();S(this,"enabled",!1);S(this,"url");S(this,"useSSE");S(this,"protocol");C.util.initPartial(n,this)}static fromBinary(n,r){return new ro().fromBinary(n,r)}static fromJson(n,r){return new ro().fromJson(n,r)}static fromJsonString(n,r){return new ro().fromJsonString(n,r)}static equals(n,r){return C.util.equals(ro,n,r)}};S(ro,"runtime",C),S(ro,"typeName","wg.cosmo.node.v1.GraphQLSubscriptionConfiguration"),S(ro,"fields",C.util.newFieldList(()=>[{no:1,name:"enabled",kind:"scalar",T:8},{no:2,name:"url",kind:"message",T:lr},{no:3,name:"useSSE",kind:"scalar",T:8,opt:!0},{no:4,name:"protocol",kind:"enum",T:C.getEnumType(Ss),opt:!0}]));var Dv=ro,io=class io extends Pe{constructor(n){super();S(this,"enabled",!1);S(this,"serviceSdl","");C.util.initPartial(n,this)}static fromBinary(n,r){return new io().fromBinary(n,r)}static fromJson(n,r){return new io().fromJson(n,r)}static fromJsonString(n,r){return new io().fromJsonString(n,r)}static equals(n,r){return C.util.equals(io,n,r)}};S(io,"runtime",C),S(io,"typeName","wg.cosmo.node.v1.GraphQLFederationConfiguration"),S(io,"fields",C.util.newFieldList(()=>[{no:1,name:"enabled",kind:"scalar",T:8},{no:2,name:"serviceSdl",kind:"scalar",T:9}]));var Ov=io,so=class so extends Pe{constructor(n){super();S(this,"key","");C.util.initPartial(n,this)}static fromBinary(n,r){return new so().fromBinary(n,r)}static fromJson(n,r){return new so().fromJson(n,r)}static fromJsonString(n,r){return new so().fromJsonString(n,r)}static equals(n,r){return C.util.equals(so,n,r)}};S(so,"runtime",C),S(so,"typeName","wg.cosmo.node.v1.InternedString"),S(so,"fields",C.util.newFieldList(()=>[{no:1,name:"key",kind:"scalar",T:9}]));var _p=so,oo=class oo extends Pe{constructor(n){super();S(this,"typeName","");S(this,"fieldName","");C.util.initPartial(n,this)}static fromBinary(n,r){return new oo().fromBinary(n,r)}static fromJson(n,r){return new oo().fromJson(n,r)}static fromJsonString(n,r){return new oo().fromJsonString(n,r)}static equals(n,r){return C.util.equals(oo,n,r)}};S(oo,"runtime",C),S(oo,"typeName","wg.cosmo.node.v1.SingleTypeField"),S(oo,"fields",C.util.newFieldList(()=>[{no:1,name:"type_name",kind:"scalar",T:9},{no:2,name:"field_name",kind:"scalar",T:9}]));var Av=oo;d();f();p();function wv(e,t,n){if(e)for(let r of e)t.push(new Ja(A({typeName:n,fieldName:r.fieldName,selectionSet:r.selectionSet},r.disableEntityResolver?{disableEntityResolver:!0}:{})))}function CJ(e){switch(e){case"publish":return ao.PUBLISH;case"request":return ao.REQUEST;case"subscribe":return ao.SUBSCRIBE}throw new Error(`Unknown event type ${e}`)}function sk(e){var n;let t={rootNodes:[],childNodes:[],keys:[],provides:[],events:[],requires:[],entityInterfaces:[],interfaceObjects:[]};for(let r of e.values()){let i=r.typeName,s=[...r.fieldNames],o=new Dc({typeName:i,fieldNames:s});if(r.isRootNode?t.rootNodes.push(o):t.childNodes.push(o),r.entityInterfaceConcreteTypeNames){let a=new Oc({interfaceTypeName:i,concreteTypeNames:[...r.entityInterfaceConcreteTypeNames]});r.isInterfaceObject?t.interfaceObjects.push(a):t.entityInterfaces.push(a)}wv(r.keys,t.keys,i),wv(r.provides,t.provides,i),wv(r.requires,t.requires,i);for(let a of(n=r.events)!=null?n:[])t.events.push(new Ip({type:CJ(a.type),typeName:i,fieldName:a.fieldName,topic:a.topic}))}return t}function ok(e){var n;let t=[];for(let r of e){let i=r.argumentNames.map(u=>new Tp({name:u,sourceType:za.FIELD_ARGUMENT})),s=new Np({argumentsConfiguration:i,fieldName:r.fieldName,typeName:r.typeName}),o=((n=r.requiredScopes)==null?void 0:n.map(u=>new yp({requiredAndScopes:u})))||[],a=o.length>0;(r.requiresAuthentication||a)&&(s.authorizationConfiguration=new Ep({requiresAuthentication:r.requiresAuthentication||a,requiredOrScopes:o})),t.push(s)}return t}d();f();p();function Fv(e){return new Error(`Normalization failed to return a ${e}.`)}var BJ=(e,t)=>{let n=stringHash(t);return e.stringStorage[n]=t,new _p({key:n})},$J=e=>{switch(e){case"ws":return Ss.GRAPHQL_SUBSCRIPTION_PROTOCOL_WS;case"sse":return Ss.GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE;case"sse_post":return Ss.GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE_POST}throw new Error(`Unsupported subscription protocol '${e}'`)},ak=function(e){var n;let t=new mp({defaultFlushInterval:BigInt(500),datasourceConfigurations:[],fieldConfigurations:[],graphqlSchema:"",stringStorage:{},typeConfigurations:[]});for(let r of e.subgraphs){if(!r.configurationDataMap)throw Fv("ConfigurationDataMap");if(!r.schema)throw Fv("GraphQLSchema");let i=BJ(t,vR(zl(r.schema))),{childNodes:s,entityInterfaces:o,events:a,interfaceObjects:u,keys:c,provides:l,requires:m,rootNodes:h}=sk(r.configurationDataMap),E=$J(r.subscriptionProtocol),N,D,w;if(a.length>0){N=zo.PUBSUB,w=new vp({events:a});let Y=Ie=>["Query","Mutation","Subscription"].includes(Ie.typeName),Q=0,W=0;for(;Q({id:r.id,name:r.name,routingUrl:r.url}))})};ne();function uk(e){let t;try{t=ti(e.schema)}catch(n){throw new Error(`could not parse schema for Graph ${e.name}: ${n}`)}return{definitions:t,name:e.name,url:e.url}}function VJ(e){let{federationResult:t,errors:n}=(0,Lv.federateSubgraphs)(e.map(uk));if(n&&n.length>0)throw new Error(`could not federate schema: ${n.map(r=>r.message).join(", ")}`);return{fieldConfigurations:t.fieldConfigurations,sdl:Ve(t.federatedGraphAST)}}function jJ(e){let t=(0,Lv.federateSubgraphs)(e.map(uk));if(t.errors&&t.errors.length>0)throw new Error(`could not federate schema: ${t.errors.map(r=>r.message).join(", ")}`);if(t.federationResult===void 0)throw new Error("could not federate subgraphs");return ak({fieldConfigurations:t.federationResult.fieldConfigurations,federatedSDL:Xl(t.federationResult.federatedGraphSchema),schemaVersionId:"",subgraphs:e.map((r,i)=>{var u,c;let s=t.federationResult.subgraphConfigBySubgraphName.get(r.name),o=s==null?void 0:s.schema,a=s==null?void 0:s.configurationDataMap;return{id:`${i}`,name:r.name,url:nv(r.url),sdl:r.schema,subscriptionUrl:nv((u=r.subscription_url)!=null?u:r.url),subscriptionProtocol:(c=r.subscription_protocol)!=null?c:"ws",schema:o,configurationDataMap:a}})}).toJsonString()}return se(GJ);})(); /*! Bundled license information: @jspm/core/nodelibs/browser/buffer.js: diff --git a/composition/src/ast/ast.ts b/composition/src/ast/ast.ts index 0a716abded..a8cb3666f4 100644 --- a/composition/src/ast/ast.ts +++ b/composition/src/ast/ast.ts @@ -23,8 +23,8 @@ import { TypeNode, UnionTypeDefinitionNode, } from 'graphql'; -import { federationUnexpectedNodeKindError } from '../errors/errors'; import { formatDescription } from './utils'; +import { deepCopyTypeNode } from '../schema-building/ast'; function deepCopyFieldsAndInterfaces( node: InterfaceTypeDefinitionNode | ObjectTypeDefinitionNode | ObjectTypeExtensionNode, @@ -50,33 +50,6 @@ export type ConstValueNodeWithValue = | BooleanValueNode | EnumValueNode; -export function deepCopyTypeNode(node: TypeNode, parentName: string, fieldName: string): TypeNode { - const deepCopy: MutableTypeNode = { kind: node.kind }; - let lastTypeNode = deepCopy; - for (let i = 0; i < maximumTypeNesting; i++) { - switch (node.kind) { - case Kind.NAMED_TYPE: - lastTypeNode.name = { ...node.name }; - return deepCopy as TypeNode; - case Kind.LIST_TYPE: - lastTypeNode.kind = node.kind; - lastTypeNode.type = { kind: node.type.kind }; - lastTypeNode = lastTypeNode.type; - node = node.type; - continue; - case Kind.NON_NULL_TYPE: - lastTypeNode.kind = node.kind; - lastTypeNode.type = { kind: node.type.kind }; - lastTypeNode = lastTypeNode.type; - node = node.type; - continue; - default: - throw federationUnexpectedNodeKindError(parentName, fieldName); - } - } - throw new Error(`Field ${parentName}.${fieldName} has more than 30 layers of nesting, or there is a cyclical error.`); -} - export type MutableDirectiveDefinitionNode = { arguments?: InputValueDefinitionNode[]; description?: StringValueNode; @@ -258,12 +231,12 @@ export function objectTypeDefinitionNodeToMutable(node: ObjectTypeDefinitionNode } export type MutableObjectTypeExtensionNode = { - description?: StringValueNode; - directives?: ConstDirectiveNode[]; fields: FieldDefinitionNode[]; interfaces: NamedTypeNode[]; kind: Kind.OBJECT_TYPE_EXTENSION; name: NameNode; + description?: StringValueNode; + directives?: ConstDirectiveNode[]; }; export function objectTypeExtensionNodeToMutable(node: ObjectTypeExtensionNode): MutableObjectTypeExtensionNode { @@ -307,14 +280,6 @@ export function scalarTypeDefinitionNodeToMutable(node: ScalarTypeDefinitionNode }; } -export type MutableTypeNode = { - kind: Kind.NAMED_TYPE | Kind.LIST_TYPE | Kind.NON_NULL_TYPE; - name?: NameNode; - type?: MutableTypeNode; -}; - -export const maximumTypeNesting = 30; - export type MutableUnionTypeDefinitionNode = { description?: StringValueNode; directives?: ConstDirectiveNode[]; diff --git a/composition/src/ast/utils.ts b/composition/src/ast/utils.ts index 45e09a9932..5cd3cc0521 100644 --- a/composition/src/ast/utils.ts +++ b/composition/src/ast/utils.ts @@ -2,6 +2,8 @@ import { ArgumentNode, ConstDirectiveNode, DocumentNode, + EnumTypeDefinitionNode, + EnumTypeExtensionNode, FieldDefinitionNode, FieldNode, InputObjectTypeDefinitionNode, @@ -15,10 +17,13 @@ import { ObjectTypeExtensionNode, OperationTypeNode, parse, + ScalarTypeDefinitionNode, + ScalarTypeExtensionNode, SchemaDefinitionNode, SchemaExtensionNode, SelectionSetNode, StringValueNode, + UnionTypeDefinitionNode, UnionTypeExtensionNode, } from 'graphql'; import { @@ -54,13 +59,6 @@ import { UNION_UPPER, } from '../utils/string-constants'; import { duplicateInterfaceError, unexpectedKindFatalError } from '../errors/errors'; -import { - EnumTypeDefinitionNode, - EnumTypeExtensionNode, - ScalarTypeDefinitionNode, - ScalarTypeExtensionNode, - UnionTypeDefinitionNode, -} from 'graphql/index'; import { DirectiveContainer, EXECUTABLE_DIRECTIVE_LOCATIONS, NodeContainer } from '../federation/utils'; export function isObjectLikeNodeEntity(node: ObjectLikeTypeNode): boolean { diff --git a/composition/src/errors/errors.ts b/composition/src/errors/errors.ts index 1628bd517b..daa182b491 100644 --- a/composition/src/errors/errors.ts +++ b/composition/src/errors/errors.ts @@ -134,7 +134,7 @@ export function duplicateInterfaceError(interfaceName: string, typeName: string) return new Error(`Interface "${interfaceName}" can only be defined on type "${typeName}" once.`); } -export function duplicateUnionMemberError(memberName: string, typeName: string): Error { +export function duplicateUnionMemberExtensionError(memberName: string, typeName: string): Error { return new Error(`Extension error:\n Member "${memberName}" already exists on union "${typeName}".`); } @@ -163,8 +163,10 @@ export function noBaseTypeExtensionError(typeName: string): Error { return new Error(`Extension error:\n Could not extend the type "${typeName}" because no base definition exists.`); } -export function noDefinedUnionMembersError(unionName: string): Error { - return new Error(`The union "${unionName}" must define at least one union member.`); +export function noDefinedUnionMembersError(unionTypeName: string, extension = false): Error { + return new Error( + `The union ` + (extension ? 'extension' : '') + ` "${unionTypeName}" must define at least one union member.`, + ); } export function operationDefinitionError(typeName: string, operationType: OperationTypeNode, actualType: Kind): Error { @@ -211,10 +213,10 @@ export function shareableFieldDefinitionsError(parent: ObjectContainer, children ); } -export function undefinedDirectiveError(directiveName: string, hostPath: string): Error { - return new Error( +export function undefinedDirectiveErrorMessage(directiveName: string, hostPath: string): string { + return ( `The directive "${directiveName}" is declared on "${hostPath}",` + - ` but the directive is not defined in the schema.`, + ` but the directive is not defined in the schema.` ); } @@ -288,6 +290,10 @@ export function invalidUnionError(unionName: string): Error { return new Error(`Union "${unionName}" must have at least one member.`); } +export function duplicateUnionMemberError(memberTypeName: string, unionTypeName: string): Error { + return new Error(`Member "${memberTypeName}" must only be defined on union "${unionTypeName}" once.`); +} + export const invalidDeprecatedDirectiveError = new Error(` Expected the @deprecated directive to have a single optional argument "reason" of the type "String!" `); @@ -373,29 +379,6 @@ export function invalidKeyDirectiveArgumentErrorMessage(directiveKind: Kind): st return ` The required argument named "fields" must be type "String" and not type "${directiveKind}".`; } -export function invalidGraphQLNameErrorMessage(type: string, name: string): string { - return ( - ` The ${type} "${name}" is an invalid GraphQL name:\n` + - ` GraphQL names must match the following regex: /[_a-zA-Z][_a-zA-Z0-9]*/` - ); -} - -export const invalidOpeningBraceErrorMessage: string = ` Unexpected brace opening:\n Received an opening brace "{" before the parent value was defined.`; - -export const invalidClosingBraceErrorMessage: string = ` Unexpected brace closure:\n Received a closing brace "}" before any nested values were defined.`; - -export const invalidNestingClosureErrorMessage: string = ` Unexpected brace closure:\n Received a closing brace "}" before its corresponding opening brace "{" was defined.`; - -export const invalidNestingErrorMessage: string = ` Invalid nesting:\n A nested key was terminated without a closing brace "}".`; - -export function invalidEntityKeyError(parentTypeName: string, entityKey: string, errorMessage: string): Error { - return new Error( - `The directive "key" declared on the object "${parentTypeName}"` + - ` with the "fields" argument value of "${entityKey}" is invalid for the following reason:\n` + - errorMessage, - ); -} - export function invalidKeyDirectivesError(parentTypeName: string, errorMessages: string[]): Error { return new Error( `The entity "${parentTypeName}" defines the following invalid "key" directive` + @@ -438,7 +421,7 @@ export function unexpectedDirectiveLocationError(locationName: string): Error { return new Error(`Fatal: Unknown directive location "${locationName}".`); } -export function unexpectedTypeNodeKindError(childPath: string): Error { +export function unexpectedTypeNodeKindFatalError(childPath: string): Error { return new Error( `Fatal: Expected all constituent types of "${childPath}" to be one of the following: ` + `"LIST_TYPE", "NAMED_TYPE", or "NON_NULL_TYPE".`, @@ -881,10 +864,8 @@ export function allFieldDefinitionsAreInaccessibleError(typeString: string, type ); } -export function equivalentSourceAndTargetOverrideError(subgraphName: string, hostPath: string): Error { - return new Error( - `Cannot override field "${hostPath}" because the source and target subgraph names are both "${subgraphName}"`, - ); +export function equivalentSourceAndTargetOverrideErrorMessage(subgraphName: string, hostPath: string): string { + return `Cannot override field "${hostPath}" because the source and target subgraph names are both "${subgraphName}"`; } export function undefinedEntityInterfaceImplementationsError( diff --git a/composition/src/federation/federation-factory.ts b/composition/src/federation/federation-factory.ts index 345f7a1586..6a112abd79 100644 --- a/composition/src/federation/federation-factory.ts +++ b/composition/src/federation/federation-factory.ts @@ -1,5 +1,6 @@ import { MultiGraph } from 'graphology'; import { + BREAK, buildASTSchema, ConstDirectiveNode, ConstValueNode, @@ -14,6 +15,7 @@ import { ObjectTypeExtensionNode, TypeDefinitionNode, TypeNode, + visit, } from 'graphql'; import { ConstValueNodeWithValue, @@ -83,7 +85,7 @@ import { getMostRestrictiveMergedTypeNode, getNamedTypeForChild, isTypeRequired, -} from '../type-merging/type-merging'; +} from '../schema-building/type-merging'; import { ArgumentContainer, ArgumentMap, @@ -92,8 +94,8 @@ import { DirectiveMap, EnumValueContainer, ExtensionContainer, + FederationFieldData, FederationResultContainer, - FieldContainer, InputValueContainer, InterfaceContainer, isFieldInaccessible, @@ -138,8 +140,8 @@ import { EntityContainer, EntityContainerByTypeName, EntityInterfaceFederationData, - generateAuthenticatedDirective, generateRequiresScopesDirective, + generateSimpleDirective, getAllMutualEntries, getEntriesNotInHashSet, getOrThrowError, @@ -166,12 +168,8 @@ import { } from '../router-configuration/router-configuration'; import { BASE_SCALARS, SCOPE_SCALAR_DEFINITION } from '../utils/constants'; import { batchNormalize } from '../normalization/normalization-factory'; -import { - getNormalizedFieldSet, - isNodeQuery, - ObjectLikeContainer as NormalizationObjectLikeContainer, -} from '../normalization/utils'; -import { BREAK, visit } from 'graphql/index'; +import { getNormalizedFieldSet, isNodeQuery } from '../normalization/utils'; +import { ParentWithFieldsData as NormalizationObjectLikeData } from '../schema-building/type-definition-data'; export class FederationFactory { authorizationDataByParentTypeName: Map; @@ -490,7 +488,7 @@ export class FederationFactory { } } - isShareabilityOfAllFieldInstancesValid(fieldContainer: FieldContainer) { + isShareabilityOfAllFieldInstancesValid(fieldContainer: FederationFieldData) { let shareableFields = 0; let unshareableFields = 0; for (const [subgraphName, isShareable] of fieldContainer.subgraphsByShareable) { @@ -680,7 +678,7 @@ export class FederationFactory { } this.parents.set(parentTypeName, { directives: this.extractPersistedDirectives(node.directives || [], newPersistedDirectivesContainer()), - fields: new Map(), + fields: new Map(), interfaces: extractInterfaces(node, new Set()), kind: Kind.INTERFACE_TYPE_DEFINITION, node: interfaceTypeDefinitionNodeToMutable({ @@ -742,7 +740,7 @@ export class FederationFactory { } this.parents.set(parentTypeName, { directives: this.extractPersistedDirectives(node.directives || [], newPersistedDirectivesContainer()), - fields: new Map(), + fields: new Map(), interfaces: extractInterfaces(node, new Set()), kind: node.kind, node: interfaceTypeDefinitionNodeToMutable(node), @@ -773,7 +771,7 @@ export class FederationFactory { } this.parents.set(parentTypeName, { directives: this.extractPersistedDirectives(node.directives || [], newPersistedDirectivesContainer()), - fields: new Map(), + fields: new Map(), interfaces: extractInterfaces(node, new Set()), isRootType: this.isParentRootType, kind: node.kind, @@ -818,7 +816,7 @@ export class FederationFactory { const interfaces = extractInterfaces(node, new Set()); this.extensions.set(this.parentTypeName, { directives: this.extractPersistedDirectives(node.directives || [], newPersistedDirectivesContainer()), - fields: new Map(), + fields: new Map(), interfaces, isRootType: this.isParentRootType, kind: Kind.OBJECT_TYPE_EXTENSION, @@ -956,7 +954,7 @@ export class FederationFactory { } mergeArguments( - container: FieldContainer | DirectiveContainer, + container: FederationFieldData | DirectiveContainer, args: MutableInputValueDefinitionNode[], errors: InvalidRequiredArgument[], argumentNames?: string[], @@ -1014,7 +1012,7 @@ export class FederationFactory { definitions.push(directiveContainer.node); } - pushAuthorizationDirectives(fieldContainer: FieldContainer, parentTypeName: string) { + pushAuthorizationDirectives(fieldContainer: FederationFieldData, parentTypeName: string) { const authorizationData = this.authorizationDataByParentTypeName.get(parentTypeName); if (!authorizationData) { return; @@ -1026,7 +1024,7 @@ export class FederationFactory { return; } if (fieldAuthorizationData.requiresAuthentication) { - fieldContainer.directives.directives.set(AUTHENTICATED, [generateAuthenticatedDirective()]); + fieldContainer.directives.directives.set(AUTHENTICATED, [generateSimpleDirective(AUTHENTICATED)]); } if (fieldAuthorizationData.requiredScopes.length > 0) { fieldContainer.directives.directives.set(REQUIRES_SCOPES, [ @@ -1035,7 +1033,7 @@ export class FederationFactory { } } - getMergedFieldDefinitionNode(fieldContainer: FieldContainer, parentTypeName: string): FieldDefinitionNode { + getMergedFieldDefinitionNode(fieldContainer: FederationFieldData, parentTypeName: string): FieldDefinitionNode { this.pushAuthorizationDirectives(fieldContainer, parentTypeName); pushPersistedDirectivesAndGetNode(fieldContainer); if (fieldContainer.arguments.size < 1) { @@ -1176,7 +1174,7 @@ export class FederationFactory { return false; } - isFieldExternalInAllMutualSubgraphs(subgraphs: Set, fieldContainer: FieldContainer): boolean { + isFieldExternalInAllMutualSubgraphs(subgraphs: Set, fieldContainer: FederationFieldData): boolean { const mutualSubgraphs = getAllMutualEntries(subgraphs, fieldContainer.subgraphNames); if (mutualSubgraphs.size < 1) { return false; @@ -1407,8 +1405,8 @@ export class FederationFactory { this.currentSubgraphName, 'internalSubgraphBySubgraphName', ); - const parentContainerByTypeName = internalSubgraph.parentContainerByTypeName; - const extensionContainerByTypeName = internalSubgraph.extensionContainerByTypeName; + const parentContainerByTypeName = internalSubgraph.parentDataByTypeName; + const extensionContainerByTypeName = internalSubgraph.parentExtensionDataByTypeName; const implicitEntityContainer = parentContainerByTypeName.get(entityContainer.typeName) || extensionContainerByTypeName.get(entityContainer.typeName); @@ -1438,7 +1436,7 @@ export class FederationFactory { // This would be caught as an error elsewhere continue; } - const parentContainers: NormalizationObjectLikeContainer[] = [implicitEntityContainer]; + const parentContainers: NormalizationObjectLikeData[] = [implicitEntityContainer]; const definedFields: Set[] = []; let currentDepth = -1; let shouldDefineSelectionSet = true; @@ -1455,7 +1453,7 @@ export class FederationFactory { Field: { enter(node) { const parentContainer = parentContainers[currentDepth]; - const parentTypeName = parentContainer.name.value; + const parentTypeName = parentContainer.typeName; // If an object-like was just visited, a selection set should have been entered if (shouldDefineSelectionSet) { shouldAddKeyFieldSet = false; @@ -1463,9 +1461,13 @@ export class FederationFactory { } const fieldName = node.name.value; const fieldPath = `${parentTypeName}.${fieldName}`; - const fieldContainer = parentContainer.fields.get(fieldName); + const fieldContainer = parentContainer.fieldDataByFieldName.get(fieldName); // undefined if the field does not exist on the parent - if (!fieldContainer || fieldContainer.arguments.size || definedFields[currentDepth].has(fieldName)) { + if ( + !fieldContainer || + fieldContainer.argumentDataByArgumentName.size || + definedFields[currentDepth].has(fieldName) + ) { shouldAddKeyFieldSet = false; return BREAK; } diff --git a/composition/src/federation/utils.ts b/composition/src/federation/utils.ts index 3820d953a9..54fe6f7a9f 100644 --- a/composition/src/federation/utils.ts +++ b/composition/src/federation/utils.ts @@ -24,7 +24,6 @@ import { SUBSCRIPTION_UPPER, } from '../utils/string-constants'; import { SubgraphConfig } from '../subgraph/subgraph'; -import { AuthorizationData } from '../utils/utils'; export type FederationResultContainer = { errors?: Error[]; @@ -117,7 +116,7 @@ export type EnumValueContainer = { export type EnumValueMap = Map; -export type FieldContainer = { +export type FederationFieldData = { arguments: ArgumentMap; directives: PersistedDirectivesContainer; isShareable: boolean; @@ -128,7 +127,7 @@ export type FieldContainer = { subgraphsByShareable: Map; }; -export type FieldMap = Map; +export type FieldMap = Map; export type InputValueContainer = { appearances: number; @@ -189,7 +188,7 @@ export type UnionContainer = { node: MutableUnionTypeDefinitionNode; }; -export type ChildContainer = FieldContainer | InputValueContainer | EnumValueContainer; +export type ChildContainer = FederationFieldData | InputValueContainer | EnumValueContainer; export type ParentContainer = | EnumContainer @@ -204,6 +203,6 @@ export type ExtensionContainer = ObjectExtensionContainer; export type ParentMap = Map; export type ObjectLikeContainer = ObjectContainer | InterfaceContainer; -export function isFieldInaccessible(fieldContainer: FieldContainer): boolean { - return fieldContainer.directives.directives.has(INACCESSIBLE); +export function isFieldInaccessible(fieldData: FederationFieldData): boolean { + return fieldData.directives.directives.has(INACCESSIBLE); } diff --git a/composition/src/index.ts b/composition/src/index.ts index ec93628b1c..213f5072ca 100644 --- a/composition/src/index.ts +++ b/composition/src/index.ts @@ -4,7 +4,14 @@ export * from './errors/errors'; export * from './federation/federation-factory'; export * from './federation/utils'; export * from './normalization/normalization-factory'; +export * from './normalization/utils'; +export * from './normalization/walkers'; export * from './router-configuration/router-configuration'; +export * from './schema-building/ast'; +export * from './schema-building/type-definition-data'; +export * from './schema-building/type-extension-data'; +export * from './schema-building/type-merging'; +export * from './schema-building/utils'; export * from './subgraph/subgraph'; -export * from './type-merging/type-merging'; export * from './utils/utils'; +export * from './warnings/warnings'; diff --git a/composition/src/normalization/normalization-factory.ts b/composition/src/normalization/normalization-factory.ts index d7297c4d43..d36bed7095 100644 --- a/composition/src/normalization/normalization-factory.ts +++ b/composition/src/normalization/normalization-factory.ts @@ -4,87 +4,49 @@ import { DirectiveDefinitionNode, DirectiveNode, DocumentNode, - EnumValueDefinitionNode, FieldDefinitionNode, GraphQLSchema, - InputValueDefinitionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, Kind, - NamedTypeNode, + ListValueNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, OperationTypeDefinitionNode, OperationTypeNode, print, + StringValueNode, TypeNode, - visit, } from 'graphql'; import { - addConcreteTypesForImplementedInterfaces, - addConcreteTypesForUnion, areBaseAndExtensionKindsCompatible, EnumTypeNode, extractInterfaces, - formatDescription, - InputObjectTypeNode, InterfaceTypeNode, - isNodeExtension, isNodeInterfaceObject, isObjectLikeNodeEntity, ObjectTypeNode, operationTypeNodeToDefaultType, safeParse, ScalarTypeNode, - SchemaNode, - stringToNameNode, - UnionTypeNode, } from '../ast/utils'; import { addNonExternalFieldsToSet, - areNodeKindAndDirectiveLocationCompatible, - ChildContainer, - enumContainerToNode, - EnumExtensionContainer, - EnumValueContainer, - ExtensionContainer, - ExtensionContainerByTypeName, - extractFieldSetValue, - FieldContainer, FieldSetContainer, - getDefinedArgumentsForDirective, - getDirectiveDefinitionArgumentSets, - inputObjectContainerToNode, - InputObjectExtensionContainer, InputValidationContainer, - InputValueContainer, isNodeQuery, newFieldSetContainer, - ObjectExtensionContainer, - ObjectLikeContainer, - objectLikeContainerToNode, - ObjectLikeExtensionContainer, - ParentContainer, - ParentContainerByTypeName, - scalarContainerToNode, - ScalarExtensionContainer, - SchemaContainer, - schemaContainerToNode, - UnionContainer, - unionContainerToNode, - UnionExtensionContainer, validateAndAddDirectivesWithFieldSetToConfigurationData, } from './utils'; import { + BASE_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME, BASE_DIRECTIVE_DEFINITIONS, BASE_SCALARS, FIELD_SET_SCALAR_DEFINITION, SCOPE_SCALAR_DEFINITION, - VERSION_ONE_DIRECTIVES, VERSION_TWO_DIRECTIVE_DEFINITIONS, - VERSION_TWO_DIRECTIVES, } from '../utils/constants'; -import { getNamedTypeForChild } from '../type-merging/type-merging'; +import { getNamedTypeForChild } from '../schema-building/type-merging'; import { addIterableValuesToSet, AuthorizationData, @@ -93,7 +55,6 @@ import { EntityInterfaceSubgraphData, FieldAuthorizationData, getAuthorizationDataToUpdate, - getEntriesNotInHashSet, getOrThrowError, getValueOrDefault, ImplementationErrors, @@ -114,18 +75,12 @@ import { } from '../utils/utils'; import { duplicateArgumentsError, - duplicateDirectiveArgumentDefinitionErrorMessage, - duplicateDirectiveDefinitionError, duplicateEnumValueDefinitionError, duplicateFieldDefinitionError, duplicateInterfaceExtensionError, - duplicateOperationTypeDefinitionError, duplicateOverriddenFieldErrorMessage, duplicateOverriddenFieldsError, - duplicateTypeDefinitionError, - duplicateUnionMemberError, - duplicateValueExtensionError, - equivalentSourceAndTargetOverrideError, + equivalentSourceAndTargetOverrideErrorMessage, expectedEntityError, incompatibleExtensionError, incompatibleExtensionKindsError, @@ -133,41 +88,32 @@ import { invalidArgumentsError, invalidDirectiveArgumentTypeErrorMessage, invalidDirectiveError, - invalidDirectiveLocationErrorMessage, invalidKeyDirectiveArgumentErrorMessage, invalidKeyDirectivesError, - invalidOperationTypeDefinitionError, - invalidRepeatedDirectiveErrorMessage, invalidRootTypeDefinitionError, invalidSubgraphNameErrorMessage, invalidSubgraphNamesError, noBaseTypeExtensionError, - noDefinedUnionMembersError, noFieldDefinitionsError, operationDefinitionError, orScopesLimitError, subgraphInvalidSyntaxError, subgraphValidationError, subgraphValidationFailureError, - undefinedDirectiveError, undefinedObjectLikeParentError, undefinedRequiredArgumentsErrorMessage, undefinedTypeError, unexpectedDirectiveArgumentErrorMessage, - unexpectedDirectiveArgumentsErrorMessage, unexpectedKindFatalError, unimplementedInterfaceFieldsError, } from '../errors/errors'; import { - ANY_SCALAR, AUTHENTICATED, ENTITIES_FIELD, - ENTITY_UNION, EVENTS_PUBLISH, EVENTS_REQUEST, EVENTS_SUBSCRIBE, EXTENDS, - EXTENSIONS, EXTERNAL, FIELDS, FROM, @@ -175,15 +121,11 @@ import { OPERATION_TO_DEFAULT, OVERRIDE, PARENTS, - PROVIDES, - REQUIRES, REQUIRES_SCOPES, RESOLVABLE, - ROOT_TYPES, SCHEMA, SCOPES, SERVICE_FIELD, - SERVICE_OBJECT, SOURCE_ID, TOPIC, } from '../utils/string-constants'; @@ -196,25 +138,51 @@ import { } from '../router-configuration/router-configuration'; import { printTypeNode } from '@graphql-tools/merge'; import { inputValueDefinitionNodeToMutable, MutableInputValueDefinitionNode, ObjectLikeTypeNode } from '../ast/ast'; -import { - InternalSubgraph, - recordSubgraphName, - Subgraph, - walkSubgraphToApplyFieldAuthorization, -} from '../subgraph/subgraph'; +import { InternalSubgraph, recordSubgraphName, Subgraph } from '../subgraph/subgraph'; import { invalidOverrideTargetSubgraphNameWarning } from '../warnings/warnings'; +import { + consolidateAuthorizationDirectives, + upsertDirectiveAndSchemaDefinitions, + upsertParentsAndChildren, +} from './walkers'; +import { + FieldData, + ParentDefinitionData, + ParentWithFieldsData, + SchemaData, +} from '../schema-building/type-definition-data'; +import { + EnumExtensionData, + ExtensionWithFieldsData, + InputObjectExtensionData, + ParentExtensionData, + ScalarExtensionData, + UnionExtensionData, +} from '../schema-building/type-extension-data'; +import { + convertKindForExtension, + extractDirectives, + getDirectiveValidationErrors, + getEnumNodeByData, + getInputObjectNodeByData, + getParentWithFieldsNodeByData, + getScalarNodeByData, + getSchemaNodeByData, + getUnionNodeByData, + upsertExtensionWithFieldsDataByNode, +} from '../schema-building/utils'; export type NormalizationResult = { authorizationDataByParentTypeName: Map; configurationDataMap: ConfigurationDataByTypeName; entityInterfaces: Map; entityContainerByTypeName: EntityContainerByTypeName; - extensionContainerByTypeName: ExtensionContainerByTypeName; + parentExtensionDataByTypeName: Map; isVersionTwo: boolean; keyFieldNamesByParentTypeName: Map>; operationTypes: Map; overridesByTargetSubgraphName: Map>>; - parentContainerByTypeName: ParentContainerByTypeName; + parentDataByTypeName: Map; schema: GraphQLSchema; subgraphAST: DocumentNode; subgraphString: string; @@ -249,7 +217,7 @@ export function normalizeSubgraph(document: DocumentNode, subgraphName?: string) export class NormalizationFactory { abstractToConcreteTypeNames = new Map>(); - allDirectiveDefinitions = new Map(); + directiveDefinitionByDirectiveName = new Map(); argumentName = ''; authorizationDataByParentTypeName = new Map(); childName = ''; @@ -258,10 +226,9 @@ export class NormalizationFactory { errors: Error[] = []; entityContainerByTypeName: EntityContainerByTypeName = new Map(); entityInterfaces = new Map(); - extensionContainerByTypeName: ExtensionContainerByTypeName = new Map(); + parentExtensionDataByTypeName = new Map(); interfaceTypeNamesWithAuthorizationDirectives = new Set(); isCurrentParentExtension = false; - isCurrentParentRootType = false; isSubgraphVersionTwo = false; fieldSetContainerByTypeName = new Map(); heirFieldAuthorizationDataByTypeName = new Map(); @@ -271,27 +238,27 @@ export class NormalizationFactory { leafTypeNamesWithAuthorizationDirectives = new Set(); keyFieldNamesByParentTypeName = new Map>(); operationTypeNames = new Map(); - parentContainerByTypeName: ParentContainerByTypeName = new Map(); + parentDefinitionDataByTypeName = new Map(); parentTypeName = ''; parentsWithChildArguments = new Set(); eventsConfigurations = new Map(); overridesByTargetSubgraphName = new Map>>(); invalidOrScopesHostPaths = new Set(); - schemaDefinition: SchemaContainer; - referencedDirectives = new Set(); + schemaDefinition: SchemaData; + referencedDirectiveNames = new Set(); referencedTypeNames = new Set(); warnings: string[] = []; subgraphName?: string; constructor(subgraphName?: string) { - for (const baseDirectiveDefinition of BASE_DIRECTIVE_DEFINITIONS) { - this.allDirectiveDefinitions.set(baseDirectiveDefinition.name.value, baseDirectiveDefinition); + for (const [baseDirectiveName, baseDirectiveDefinition] of BASE_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME) { + this.directiveDefinitionByDirectiveName.set(baseDirectiveName, baseDirectiveDefinition); } this.subgraphName = subgraphName; this.schemaDefinition = { - directives: new Map(), + directivesByDirectiveName: new Map(), kind: Kind.SCHEMA_DEFINITION, - name: stringToNameNode(SCHEMA), + typeName: SCHEMA, operationTypes: new Map(), }; } @@ -300,7 +267,7 @@ export class NormalizationFactory { if (BASE_SCALARS.has(namedType)) { return { hasUnhandledError: false, typeString: '' }; } - const parentContainer = this.parentContainerByTypeName.get(namedType); + const parentContainer = this.parentDefinitionDataByTypeName.get(namedType); if (!parentContainer) { this.errors.push(undefinedTypeError(namedType)); return { hasUnhandledError: false, typeString: '' }; @@ -317,31 +284,34 @@ export class NormalizationFactory { extractArguments( node: FieldDefinitionNode, - argumentByName: Map, + argumentDataByArgumentName: Map, fieldPath: string, ): Map { if (!node.arguments) { - return argumentByName; + return argumentDataByArgumentName; } this.parentsWithChildArguments.add(this.parentTypeName); const duplicatedArguments = new Set(); for (const argumentNode of node.arguments) { const argumentName = argumentNode.name.value; - if (argumentByName.has(argumentName)) { + if (argumentDataByArgumentName.has(argumentName)) { duplicatedArguments.add(argumentName); continue; } - argumentByName.set(argumentName, inputValueDefinitionNodeToMutable(argumentNode, this.parentTypeName)); + argumentDataByArgumentName.set( + argumentName, + inputValueDefinitionNodeToMutable(argumentNode, this.parentTypeName), + ); } if (duplicatedArguments.size > 0) { this.errors.push(duplicateArgumentsError(fieldPath, [...duplicatedArguments])); } - return argumentByName; + return argumentDataByArgumentName; } - validateArguments(fieldContainer: FieldContainer, fieldPath: string) { + validateArguments(fieldData: FieldData, fieldPath: string) { const invalidArguments: InvalidArgument[] = []; - for (const [argumentName, argumentNode] of fieldContainer.arguments) { + for (const [argumentName, argumentNode] of fieldData.argumentDataByArgumentName) { const namedType = getNamedTypeForChild(fieldPath + `(${argumentName}...)`, argumentNode.type); const { hasUnhandledError, typeString } = this.validateInputNamedType(namedType); if (hasUnhandledError) { @@ -353,35 +323,6 @@ export class NormalizationFactory { } } - extractDirectives( - node: - | EnumValueDefinitionNode - | InputObjectTypeNode - | InputValueDefinitionNode - | InterfaceTypeNode - | ObjectTypeNode - | SchemaNode - | UnionTypeNode, - map: Map, - ): Map { - if (!node.directives) { - return map; - } - for (const directive of node.directives) { - const directiveName = directive.name.value; - if (directiveName === EXTENDS) { - continue; - } - const existingDirectives = map.get(directiveName); - if (existingDirectives) { - existingDirectives.push(directive); - continue; - } - map.set(directiveName, [directive]); - } - return map; - } - // Note that directive validation errors are handled elsewhere getAuthorizationData(node: InterfaceTypeNode | ObjectTypeNode): AuthorizationData | undefined { let authorizationData = this.authorizationDataByParentTypeName.get(this.parentTypeName); @@ -464,29 +405,49 @@ export class NormalizationFactory { extractDirectivesAndAuthorization( node: EnumTypeNode | FieldDefinitionNode | ScalarTypeNode, - map: Map, + directivesByDirectiveName: Map, ): Map { if (!node.directives) { - return map; + return directivesByDirectiveName; } + const hostPath = this.childName ? `${this.parentTypeName}.${this.childName}` : this.parentTypeName; const authorizationDirectives: ConstDirectiveNode[] = []; - for (const directive of node.directives) { - const directiveName = directive.name.value; + for (const directiveNode of node.directives) { + const errorMessages = getDirectiveValidationErrors( + directiveNode, + node.kind, + directivesByDirectiveName, + this.directiveDefinitionByDirectiveName, + this.handledRepeatedDirectivesByHostPath, + hostPath, + ); + const directiveName = directiveNode.name.value; + if (errorMessages.length > 0) { + this.errors.push(invalidDirectiveError(directiveName, hostPath, errorMessages)); + continue; + } if (directiveName === EXTENDS) { continue; } + if (directiveName === OVERRIDE) { + this.handleOverrideDeclaration(directiveNode, hostPath, errorMessages); + if (errorMessages.length > 0) { + this.errors.push(invalidDirectiveError(directiveName, hostPath, errorMessages)); + } + continue; + } if (directiveName === AUTHENTICATED || directiveName === REQUIRES_SCOPES) { - authorizationDirectives.push(directive); + authorizationDirectives.push(directiveNode); + continue; } - const existingDirectives = map.get(directiveName); + const existingDirectives = directivesByDirectiveName.get(directiveName); if (existingDirectives) { - existingDirectives.push(directive); - continue; + existingDirectives.push(directiveNode); } - map.set(directiveName, [directive]); + directivesByDirectiveName.set(directiveName, [directiveNode]); } if (authorizationDirectives.length < 1) { - return map; + return directivesByDirectiveName; } if (node.kind !== Kind.FIELD_DEFINITION) { this.leafTypeNamesWithAuthorizationDirectives.add(this.parentTypeName); @@ -501,53 +462,22 @@ export class NormalizationFactory { authorizationData.requiresAuthentication = true; continue; } - if (!directiveNode.arguments || directiveNode.arguments.length !== 1) { - break; - } - const scopesArgument = directiveNode.arguments[0]; - if (scopesArgument.name.value !== SCOPES || scopesArgument.value.kind !== Kind.LIST) { - break; - } - const orScopes = scopesArgument.value.values; - if (orScopes.length < 1) { - continue; - } + const orScopes = (directiveNode.arguments![0].value as ListValueNode).values; if (orScopes.length > maxOrScopes) { - this.invalidOrScopesHostPaths.add(this.parentTypeName); + this.invalidOrScopesHostPaths.add(hostPath); continue; } for (const scopes of orScopes) { - if (scopes.kind !== Kind.LIST) { - return map; - } const andScopes = new Set(); - for (const scope of scopes.values) { - if (scope.kind !== Kind.STRING) { - return map; - } - andScopes.add(scope.value); + for (const scope of (scopes as ListValueNode).values) { + andScopes.add((scope as StringValueNode).value); } if (andScopes.size) { authorizationData.requiredScopes.push(andScopes); } } } - return map; - } - - extractUniqueUnionMembers(members: NamedTypeNode[], map: Map): Map { - for (const member of members) { - const name = member.name.value; - if (map.has(name)) { - this.errors.push(new Error(`Member "${name} can only be defined on union "${this.parentTypeName}" once.`)); - continue; - } - if (!BASE_SCALARS.has(name)) { - this.referencedTypeNames.add(name); - } - map.set(name, member); - } - return map; + return directivesByDirectiveName; } mergeUniqueInterfaces(extensionInterfaces: Set, interfaces: Set, typeName: string) { @@ -560,131 +490,6 @@ export class NormalizationFactory { } } - mergeUniqueUnionMembers(baseUnion: UnionContainer, extensionUnion?: UnionExtensionContainer) { - if (!extensionUnion) { - return; - } - const extensionMembers = extensionUnion.types; - const members = baseUnion.types; - const typeName = baseUnion.name.value; - for (const [memberName, namedTypeNode] of extensionMembers) { - if (!members.has(memberName)) { - members.set(memberName, namedTypeNode); - continue; - } - this.errors.push(duplicateUnionMemberError(memberName, typeName)); - } - } - - mergeDirectives(baseTypeDirectives: Map, extension?: ExtensionContainer) { - if (!extension) { - return; - } - for (const [directiveName, directives] of extension.directives) { - const existingDirectives = baseTypeDirectives.get(directiveName); - if (existingDirectives) { - existingDirectives.push(...directives); - continue; - } - baseTypeDirectives.set(directiveName, [...directives]); - } - } - - getValidatedAndNormalizedParentDirectives( - parent: ParentContainer | SchemaContainer | ObjectExtensionContainer, - ): ConstDirectiveNode[] { - const parentTypeName = parent.name.value; - const normalizedDirectives: ConstDirectiveNode[] = []; - for (const [directiveName, directives] of parent.directives) { - const definition = this.allDirectiveDefinitions.get(directiveName); - if (!definition) { - this.errors.push(undefinedDirectiveError(directiveName, parentTypeName)); - continue; - } - const allArguments = new Set(); - const requiredArguments = new Set(); - getDirectiveDefinitionArgumentSets(definition.arguments || [], allArguments, requiredArguments); - const entityKeys = new Set(); - const errorMessages: string[] = []; - for (const directive of directives) { - if (!areNodeKindAndDirectiveLocationCompatible(parent.kind, definition)) { - errorMessages.push(invalidDirectiveLocationErrorMessage(parentTypeName, parent.kind, directiveName)); - } - if (!definition.repeatable && directives.length > 1) { - errorMessages.push(invalidRepeatedDirectiveErrorMessage(directiveName, parentTypeName)); - } - if (!definition.arguments || definition.arguments.length < 1) { - if (directive.arguments && directive.arguments.length > 0) { - errorMessages.push(unexpectedDirectiveArgumentsErrorMessage(directive, parentTypeName)); - } else { - normalizedDirectives.push(directive); - } - continue; - } - if (!directive.arguments || directive.arguments.length < 1) { - if (requiredArguments.size > 0) { - errorMessages.push( - undefinedRequiredArgumentsErrorMessage(directiveName, parentTypeName, [...requiredArguments]), - ); - } else { - normalizedDirectives.push(directive); - } - continue; - } - const definedArguments = getDefinedArgumentsForDirective( - directive.arguments, - allArguments, - directiveName, - parentTypeName, - errorMessages, - ); - const missingRequiredArguments = getEntriesNotInHashSet(requiredArguments, definedArguments); - if (missingRequiredArguments.length > 0) { - errorMessages.push( - undefinedRequiredArgumentsErrorMessage( - directiveName, - parentTypeName, - [...requiredArguments], - missingRequiredArguments, - ), - ); - } - - // Only add unique entity keys - if (directiveName === KEY) { - const directiveKind = directive.arguments[0].value.kind; - if (directiveKind !== Kind.STRING) { - errorMessages.push(invalidKeyDirectiveArgumentErrorMessage(directiveKind)); - continue; - } - const entityKey = directive.arguments[0].value.value; - if (entityKeys.has(entityKey)) { - continue; - } - entityKeys.add(entityKey); - } - normalizedDirectives.push(directive); - } - if (errorMessages.length > 0) { - this.errors.push(invalidDirectiveError(directiveName, parentTypeName, errorMessages)); - } - } - return normalizedDirectives; - } - - convertKindForExtension( - node: InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode | ObjectTypeDefinitionNode | ObjectTypeExtensionNode, - ): Kind.INTERFACE_TYPE_EXTENSION | Kind.OBJECT_TYPE_EXTENSION { - switch (node.kind) { - case Kind.INTERFACE_TYPE_DEFINITION: - return Kind.INTERFACE_TYPE_EXTENSION; - case Kind.OBJECT_TYPE_DEFINITION: - return Kind.OBJECT_TYPE_EXTENSION; - default: - return node.kind; - } - } - handleInterfaceObject(node: ObjectTypeDefinitionNode) { if (!isNodeInterfaceObject(node)) { return; @@ -702,30 +507,38 @@ export class NormalizationFactory { }); } - handleObjectLikeExtension( + handleExtensionWithFields( node: InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode | ObjectTypeDefinitionNode | ObjectTypeExtensionNode, - ): false | undefined { + ): false | void { this.isCurrentParentExtension = true; - const extension = this.extensionContainerByTypeName.get(this.parentTypeName); - const convertedKind = this.convertKindForExtension(node); + const extension = this.parentExtensionDataByTypeName.get(this.parentTypeName); + const convertedKind = convertKindForExtension(node); if (extension) { if (extension.kind !== convertedKind) { this.errors.push(incompatibleExtensionKindsError(node, extension.kind)); return false; } - this.extractDirectives(node, extension.directives); - extractInterfaces(node, extension.interfaces, this.errors); + extractDirectives( + node, + extension.directivesByDirectiveName, + this.errors, + this.directiveDefinitionByDirectiveName, + this.handledRepeatedDirectivesByHostPath, + this.parentTypeName, + ); + extractInterfaces(node, extension.implementedInterfaceTypeNames, this.errors); return; } const isEntity = isObjectLikeNodeEntity(node); - this.extensionContainerByTypeName.set(this.parentTypeName, { - directives: this.extractDirectives(node, new Map()), - fields: new Map(), - interfaces: extractInterfaces(node, new Set(), this.errors), + upsertExtensionWithFieldsDataByNode( + this.parentExtensionDataByTypeName, + node, + this.errors, + this.directiveDefinitionByDirectiveName, + this.handledRepeatedDirectivesByHostPath, isEntity, - kind: convertedKind, - name: node.name, - }); + ); + // TODO re-assess this line if (node.kind === Kind.INTERFACE_TYPE_DEFINITION || node.kind === Kind.INTERFACE_TYPE_EXTENSION || !isEntity) { return; } @@ -742,62 +555,6 @@ export class NormalizationFactory { }); } - validateChildDirectives(child: ChildContainer, hostPath: string) { - const childKind = child.node.kind; - for (const [directiveName, directives] of child.directives) { - const definition = this.allDirectiveDefinitions.get(directiveName); - if (!definition) { - this.errors.push(undefinedDirectiveError(directiveName, hostPath)); - continue; - } - const allArguments = new Set(); - const requiredArguments = new Set(); - getDirectiveDefinitionArgumentSets(definition.arguments || [], allArguments, requiredArguments); - const errorMessages: string[] = []; - for (const directive of directives) { - if (!areNodeKindAndDirectiveLocationCompatible(childKind, definition)) { - errorMessages.push(invalidDirectiveLocationErrorMessage(hostPath, childKind, directiveName)); - } - if (!definition.repeatable && directives.length > 1) { - errorMessages.push(invalidRepeatedDirectiveErrorMessage(directiveName, hostPath)); - } - if (!definition.arguments || definition.arguments.length < 1) { - if (directive.arguments && directive.arguments.length > 0) { - errorMessages.push(unexpectedDirectiveArgumentsErrorMessage(directive, hostPath)); - } - continue; - } - if (!directive.arguments || directive.arguments.length < 1) { - if (requiredArguments.size > 0) { - errorMessages.push(undefinedRequiredArgumentsErrorMessage(directiveName, hostPath, [...requiredArguments])); - } - continue; - } - const definedArguments = getDefinedArgumentsForDirective( - directive.arguments, - allArguments, - directiveName, - hostPath, - errorMessages, - ); - const missingRequiredArguments = getEntriesNotInHashSet(requiredArguments, definedArguments); - if (missingRequiredArguments.length > 0) { - errorMessages.push( - undefinedRequiredArgumentsErrorMessage( - directiveName, - hostPath, - [...requiredArguments], - missingRequiredArguments, - ), - ); - } - } - if (errorMessages.length > 0) { - this.errors.push(invalidDirectiveError(directiveName, hostPath, errorMessages)); - } - } - } - isTypeValidImplementation(originalType: TypeNode, implementationType: TypeNode): boolean { if (originalType.kind === Kind.NON_NULL_TYPE) { if (implementationType.kind !== Kind.NON_NULL_TYPE) { @@ -831,21 +588,6 @@ export class NormalizationFactory { } } - canContainEventDirectives(): boolean { - if (!this.isCurrentParentRootType) { - return false; - } - const operationTypeNode = this.operationTypeNames.get(this.parentTypeName); - if (!operationTypeNode) { - return ROOT_TYPES.has(this.parentTypeName); - } - return ( - operationTypeNode === OperationTypeNode.QUERY || - operationTypeNode === OperationTypeNode.MUTATION || - operationTypeNode === OperationTypeNode.SUBSCRIPTION - ); - } - extractKeyFieldSets(node: ObjectLikeTypeNode, fieldSetContainer: FieldSetContainer) { const rawFieldSets = fieldSetContainer.keys; const parentTypeName = node.name.value; @@ -887,13 +629,13 @@ export class NormalizationFactory { } } - validateInterfaceImplementations(container: ObjectLikeContainer) { - if (container.interfaces.size < 1) { + validateInterfaceImplementations(container: ParentWithFieldsData) { + if (container.implementedInterfaceTypeNames.size < 1) { return; } const implementationErrorsMap = new Map(); - for (const interfaceName of container.interfaces) { - const interfaceContainer = getOrThrowError(this.parentContainerByTypeName, interfaceName, PARENTS); + for (const interfaceName of container.implementedInterfaceTypeNames) { + const interfaceContainer = getOrThrowError(this.parentDefinitionDataByTypeName, interfaceName, PARENTS); if (interfaceContainer.kind !== Kind.INTERFACE_TYPE_DEFINITION) { throw incompatibleParentKindFatalError(interfaceName, Kind.INTERFACE_TYPE_DEFINITION, interfaceContainer.kind); } @@ -902,9 +644,9 @@ export class NormalizationFactory { unimplementedFields: [], }; let hasErrors = false; - for (const [fieldName, interfaceField] of interfaceContainer.fields) { + for (const [fieldName, interfaceField] of interfaceContainer.fieldDataByFieldName) { let hasNestedErrors = false; - const containerField = container.fields.get(fieldName); + const containerField = container.fieldDataByFieldName.get(fieldName); if (!containerField) { hasErrors = true; implementationErrors.unimplementedFields.push(fieldName); @@ -923,9 +665,9 @@ export class NormalizationFactory { invalidFieldImplementation.implementedResponseType = printTypeNode(containerField.node.type); } const handledArguments = new Set(); - for (const [argumentName, interfaceArgument] of interfaceField.arguments) { + for (const [argumentName, interfaceArgument] of interfaceField.argumentDataByArgumentName) { handledArguments.add(argumentName); - const containerArgument = containerField.arguments.get(argumentName); + const containerArgument = containerField.argumentDataByArgumentName.get(argumentName); // The type implementing the interface must include all arguments with no variation for that argument if (!containerArgument) { hasErrors = true; @@ -934,8 +676,8 @@ export class NormalizationFactory { continue; } // Implemented arguments should be the exact same type - const actualType = printTypeNode(containerArgument.type); - const expectedType = printTypeNode(interfaceArgument.type); + const actualType = printTypeNode(containerArgument.type as TypeNode); + const expectedType = printTypeNode(interfaceArgument.type as TypeNode); if (expectedType !== actualType) { hasErrors = true; hasNestedErrors = true; @@ -943,11 +685,11 @@ export class NormalizationFactory { } } // Additional arguments must be optional (nullable) - for (const [argumentName, argumentNode] of containerField.arguments) { + for (const [argumentName, argumentData] of containerField.argumentDataByArgumentName) { if (handledArguments.has(argumentName)) { continue; } - if (argumentNode.type.kind !== Kind.NON_NULL_TYPE) { + if (argumentData.type.kind !== Kind.NON_NULL_TYPE) { continue; } hasErrors = true; @@ -965,7 +707,7 @@ export class NormalizationFactory { if (implementationErrorsMap.size) { this.errors.push( unimplementedInterfaceFieldsError( - container.name.value, + container.typeName, kindToTypeString(container.kind), implementationErrorsMap, ), @@ -973,59 +715,15 @@ export class NormalizationFactory { } } - handleOverride(node: DirectiveNode) { - if (node.name.value !== OVERRIDE) { + handleOverrideDeclaration(node: DirectiveNode, hostPath: string, errorMessages: string[]) { + const argumentNode = node.arguments![0]; + if (argumentNode.value.kind !== Kind.STRING) { + errorMessages.push(invalidDirectiveArgumentTypeErrorMessage(true, FROM, Kind.STRING, argumentNode.value.kind)); return; } - const errorMessages: string[] = []; - let hostPath = `${this.parentTypeName}.${this.childName}`; - let kind = this.lastChildNodeKind === Kind.NULL ? this.lastParentNodeKind : this.lastChildNodeKind; - if (this.argumentName) { - hostPath += `(${this.argumentName}: ...)`; - kind = Kind.ARGUMENT; - } - if (kind !== Kind.FIELD_DEFINITION) { - errorMessages.push(invalidDirectiveLocationErrorMessage(hostPath, kind, OVERRIDE)); - } - let targetSubgraphName = ''; - if (node.arguments && node.arguments.length > 0) { - const observedArguments = new Set(); - const handledDuplicateArguments = new Set(); - for (const argumentNode of node.arguments) { - const argumentName = argumentNode.name.value; - if (argumentName !== FROM && !observedArguments.has(argumentName)) { - observedArguments.add(argumentName); - errorMessages.push(unexpectedDirectiveArgumentErrorMessage(OVERRIDE, argumentName)); - continue; - } - // If an argument is observed more than once, it is a duplication error. - // However, the error should only propagate once. - if (observedArguments.has(argumentName)) { - if (!handledDuplicateArguments.has(argumentName)) { - errorMessages.push(duplicateDirectiveArgumentDefinitionErrorMessage(OVERRIDE, hostPath, argumentName)); - } - continue; - } - if (argumentNode.value.kind !== Kind.STRING) { - errorMessages.push( - invalidDirectiveArgumentTypeErrorMessage(true, FROM, Kind.STRING, argumentNode.value.kind), - ); - } else { - observedArguments.add(FROM); - targetSubgraphName = argumentNode.value.value; - if (targetSubgraphName === this.subgraphName) { - this.errors.push(equivalentSourceAndTargetOverrideError(targetSubgraphName, hostPath)); - } - } - } - if (!observedArguments.has(FROM)) { - errorMessages.push(undefinedRequiredArgumentsErrorMessage(OVERRIDE, hostPath, [FROM], [FROM])); - } - } else { - errorMessages.push(undefinedRequiredArgumentsErrorMessage(OVERRIDE, hostPath, [FROM], [])); - } - if (errorMessages.length > 0) { - this.errors.push(invalidDirectiveError(OVERRIDE, hostPath, errorMessages)); + const targetSubgraphName = argumentNode.value.value; + if (targetSubgraphName === this.subgraphName) { + errorMessages.push(equivalentSourceAndTargetOverrideErrorMessage(targetSubgraphName, hostPath)); return; } const overrideDataForSubgraph = getValueOrDefault( @@ -1038,24 +736,10 @@ export class NormalizationFactory { this.parentTypeName, () => new Set(), ); - if (overriddenFieldNamesForParent.has(this.childName)) { - const handledRepeatedDirectives = this.handledRepeatedDirectivesByHostPath.get(hostPath); - // If the directive name exists as a value on the host path key, the repeatable error has been handled - if (handledRepeatedDirectives && handledRepeatedDirectives.has(OVERRIDE)) { - return; - } - // Add the directive name to the existing set (if other invalid repeated directives exist) or a new set - getValueOrDefault(this.handledRepeatedDirectivesByHostPath, hostPath, () => new Set()).add(OVERRIDE); - // The invalid repeated directive error should propagate only once per directive per host path - this.errors.push( - invalidDirectiveError(OVERRIDE, hostPath, [invalidRepeatedDirectiveErrorMessage(OVERRIDE, hostPath)]), - ); - return; - } overriddenFieldNamesForParent.add(this.childName); } - extractEventDirectives(node: FieldDefinitionNode) { + extractEventDirectivesToConfiguration(node: FieldDefinitionNode) { if (!node.directives) { return; } @@ -1124,596 +808,65 @@ export class NormalizationFactory { } normalize(document: DocumentNode): NormalizationResultContainer { - const factory = this; /* factory.allDirectiveDefinitions is initialized with v1 directive definitions, and v2 definitions are only added after the visitor has visited the entire schema and the subgraph is known to be a V2 graph. Consequently, allDirectiveDefinitions cannot be used to check for duplicate definitions, and another set (below) is required */ - const definedDirectives = new Set(); - const handledRootTypes = new Set(); + // Collect any renamed root types - visit(document, { - OperationTypeDefinition: { - enter(node) { - const operationType = node.operation; - const operationPath = `${factory.parentTypeName}.${operationType}`; - const definitionNode = factory.schemaDefinition.operationTypes.get(operationType); - const newTypeName = getNamedTypeForChild(operationPath, node.type); - if (definitionNode) { - duplicateOperationTypeDefinitionError( - operationType, - newTypeName, - getNamedTypeForChild(operationPath, definitionNode.type), - ); - return false; - } - const existingOperationType = factory.operationTypeNames.get(newTypeName); - if (existingOperationType) { - factory.errors.push(invalidOperationTypeDefinitionError(existingOperationType, newTypeName, operationType)); - } else { - handledRootTypes.add(operationType); - factory.operationTypeNames.set(newTypeName, operationType); - factory.schemaDefinition.operationTypes.set(operationType, node); - } - return false; - }, - }, - SchemaDefinition: { - enter(node) { - factory.extractDirectives(node, factory.schemaDefinition.directives); - factory.schemaDefinition.description = node.description; - }, - }, - SchemaExtension: { - enter(node) { - factory.extractDirectives(node, factory.schemaDefinition.directives); - }, - }, - }); - visit(document, { - DirectiveDefinition: { - enter(node) { - const name = node.name.value; - if (definedDirectives.has(name)) { - factory.errors.push(duplicateDirectiveDefinitionError(name)); - return false; - } else { - definedDirectives.add(name); - } - // Normalize federation directives by replacing them with predefined definitions - if (VERSION_TWO_DIRECTIVES.has(name)) { - factory.isSubgraphVersionTwo = true; - return false; - } - // The V1 directives are always injected - if (VERSION_ONE_DIRECTIVES.has(name)) { - return false; - } - factory.allDirectiveDefinitions.set(name, node); - factory.customDirectiveDefinitions.set(name, node); - return false; - }, - }, - Directive: { - enter(node) { - const name = node.name.value; - factory.handleOverride(node); - if (VERSION_TWO_DIRECTIVES.has(name)) { - factory.isSubgraphVersionTwo = true; - return false; - } - if (VERSION_ONE_DIRECTIVES.has(name)) { - return false; - } - factory.referencedDirectives.add(name); - }, - }, - EnumTypeDefinition: { - enter(node) { - const typeName = node.name.value; - if (factory.parentContainerByTypeName.has(typeName)) { - factory.errors.push(duplicateTypeDefinitionError(kindToTypeString(node.kind), typeName)); - return false; - } - factory.parentTypeName = typeName; - factory.lastParentNodeKind = node.kind; - const directives = factory.extractDirectivesAndAuthorization(node, new Map()); - factory.parentContainerByTypeName.set(typeName, { - description: formatDescription(node.description), - directives, - kind: node.kind, - name: node.name, - values: new Map(), - }); - }, - leave() { - factory.parentTypeName = ''; - factory.lastParentNodeKind = Kind.NULL; - }, - }, - EnumTypeExtension: { - enter(node) { - const name = node.name.value; - factory.parentTypeName = name; - factory.lastParentNodeKind = node.kind; - factory.isCurrentParentExtension = true; - const extension = factory.extensionContainerByTypeName.get(factory.parentTypeName); - if (extension) { - if (extension.kind !== Kind.ENUM_TYPE_EXTENSION) { - factory.errors.push(incompatibleExtensionKindsError(node, extension.kind)); - return false; - } - factory.extractDirectivesAndAuthorization(node, extension.directives); - return; - } - factory.extensionContainerByTypeName.set(name, { - directives: factory.extractDirectivesAndAuthorization(node, new Map()), - kind: node.kind, - name: node.name, - values: new Map(), - }); - }, - leave() { - factory.parentTypeName = ''; - factory.lastParentNodeKind = Kind.NULL; - factory.isCurrentParentExtension = false; - }, - }, - EnumValueDefinition: { - enter(node) { - const name = node.name.value; - factory.childName = name; - factory.lastChildNodeKind = node.kind; - const parent = factory.isCurrentParentExtension - ? getOrThrowError(factory.extensionContainerByTypeName, factory.parentTypeName, EXTENSIONS) - : getOrThrowError(factory.parentContainerByTypeName, factory.parentTypeName, PARENTS); - if (parent.kind !== Kind.ENUM_TYPE_DEFINITION && parent.kind !== Kind.ENUM_TYPE_EXTENSION) { - throw unexpectedKindFatalError(name); - } - if (parent.values.has(name)) { - const error = factory.isCurrentParentExtension - ? duplicateValueExtensionError('enum', factory.parentTypeName, name) - : duplicateEnumValueDefinitionError(name, factory.parentTypeName); - factory.errors.push(error); - return; - } - parent.values.set(name, { - directives: factory.extractDirectives(node, new Map()), - name, - node: { ...node, description: formatDescription(node.description) }, - }); - }, - leave() { - factory.childName = ''; - factory.lastChildNodeKind = Kind.NULL; - }, - }, - FieldDefinition: { - enter(node) { - const fieldName = node.name.value; - if (factory.isCurrentParentRootType && (fieldName === SERVICE_FIELD || fieldName === ENTITIES_FIELD)) { - return false; - } - factory.childName = fieldName; - factory.lastChildNodeKind = node.kind; - if (factory.canContainEventDirectives()) { - factory.extractEventDirectives(node); - } - const fieldPath = `${factory.parentTypeName}.${fieldName}`; - factory.lastChildNodeKind = node.kind; - const fieldNamedTypeName = getNamedTypeForChild(fieldPath, node.type); - if (!BASE_SCALARS.has(fieldNamedTypeName)) { - factory.referencedTypeNames.add(fieldNamedTypeName); - } - const parent = factory.isCurrentParentExtension - ? getOrThrowError(factory.extensionContainerByTypeName, factory.parentTypeName, EXTENSIONS) - : getOrThrowError(factory.parentContainerByTypeName, factory.parentTypeName, PARENTS); - if ( - parent.kind !== Kind.OBJECT_TYPE_DEFINITION && - parent.kind !== Kind.OBJECT_TYPE_EXTENSION && - parent.kind !== Kind.INTERFACE_TYPE_DEFINITION && - parent.kind !== Kind.INTERFACE_TYPE_EXTENSION - ) { - throw unexpectedKindFatalError(factory.parentTypeName); - } - if (parent.fields.has(fieldName)) { - factory.errors.push(duplicateFieldDefinitionError(fieldName, factory.parentTypeName)); - return; - } - // recreate the node so the argument descriptions are updated - const fieldContainer: FieldContainer = { - arguments: factory.extractArguments(node, new Map(), fieldPath), - directives: factory.extractDirectivesAndAuthorization(node, new Map()), - name: fieldName, - node: { - ...node, - arguments: node.arguments?.map((arg) => ({ - ...arg, - description: formatDescription(arg.description), - })), - }, - }; - parent.fields.set(fieldName, fieldContainer); - const entityContainer = factory.entityContainerByTypeName.get(factory.parentTypeName); - if (entityContainer) { - entityContainer.fieldNames.add(fieldName); - // Only entities will have an existing FieldSet - const existingFieldSet = factory.fieldSetContainerByTypeName.get(factory.parentTypeName); - if (existingFieldSet) { - // @requires should only be defined on a field whose parent is an entity - // If there is existingFieldSet, it's an entity - extractFieldSetValue(fieldName, existingFieldSet.requires, fieldContainer.directives.get(REQUIRES)); - // @provides only makes sense on entities, but the field can be encountered before the type definition - // When the FieldSet is evaluated, it will be checked whether the field is an entity. - extractFieldSetValue(fieldName, existingFieldSet.provides, fieldContainer.directives.get(PROVIDES)); - return; - } - } - const providesDirectives = fieldContainer.directives.get(PROVIDES); - // Check whether the directive exists to avoid creating unnecessary fieldSet configurations - if (!providesDirectives) { - return; - } - const fieldSetContainer = getValueOrDefault( - factory.fieldSetContainerByTypeName, - factory.parentTypeName, - newFieldSetContainer, - ); - // @provides only makes sense on entities, but the field can be encountered before the type definition - // When the FieldSet is evaluated, it will be checked whether the field is an entity. - extractFieldSetValue(fieldName, fieldSetContainer.provides, providesDirectives); - }, - leave() { - factory.childName = ''; - factory.lastChildNodeKind = Kind.NULL; - }, - }, - InputObjectTypeDefinition: { - enter(node) { - const name = node.name.value; - if (factory.parentContainerByTypeName.has(name)) { - factory.errors.push(duplicateTypeDefinitionError(kindToTypeString(node.kind), name)); - return false; - } - factory.lastParentNodeKind = node.kind; - factory.parentTypeName = name; - factory.parentContainerByTypeName.set(name, { - description: formatDescription(node.description), - directives: factory.extractDirectives(node, new Map()), - fields: new Map(), - kind: node.kind, - name: node.name, - }); - }, - leave() { - factory.lastParentNodeKind = Kind.NULL; - factory.parentTypeName = ''; - }, - }, - InputObjectTypeExtension: { - enter(node) { - const name = node.name.value; - factory.parentTypeName = name; - factory.lastParentNodeKind = node.kind; - factory.isCurrentParentExtension = true; - const extension = factory.extensionContainerByTypeName.get(factory.parentTypeName); - if (extension) { - if (extension.kind !== Kind.INPUT_OBJECT_TYPE_EXTENSION) { - factory.errors.push(incompatibleExtensionKindsError(node, extension.kind)); - return false; - } - factory.extractDirectives(node, extension.directives); - return; - } - factory.extensionContainerByTypeName.set(name, { - directives: factory.extractDirectives(node, new Map()), - fields: new Map(), - kind: node.kind, - name: node.name, - }); - }, - leave() { - factory.parentTypeName = ''; - factory.lastParentNodeKind = Kind.NULL; - factory.isCurrentParentExtension = false; - }, - }, - InputValueDefinition: { - enter(node) { - const name = node.name.value; - // If the parent is not an object type definition/extension, this node is an argument + upsertDirectiveAndSchemaDefinitions(this, document); + upsertParentsAndChildren(this, document); + consolidateAuthorizationDirectives(this, document); + for (const interfaceTypeName of this.interfaceTypeNamesWithAuthorizationDirectives) { + const interfaceAuthorizationData = this.authorizationDataByParentTypeName.get(interfaceTypeName); + if (!interfaceAuthorizationData) { + continue; + } + const concreteTypeNames = this.abstractToConcreteTypeNames.get(interfaceTypeName); + for (const concreteTypeName of concreteTypeNames || []) { + const concreteAuthorizationData = getValueOrDefault( + this.authorizationDataByParentTypeName, + concreteTypeName, + () => newAuthorizationData(concreteTypeName), + ); + for (const [ + fieldName, + interfaceFieldAuthorizationData, + ] of interfaceAuthorizationData.fieldAuthorizationDataByFieldName) { if ( - factory.lastParentNodeKind !== Kind.INPUT_OBJECT_TYPE_DEFINITION && - factory.lastParentNodeKind !== Kind.INPUT_OBJECT_TYPE_EXTENSION + !upsertFieldAuthorizationData( + concreteAuthorizationData.fieldAuthorizationDataByFieldName, + interfaceFieldAuthorizationData, + ) ) { - factory.argumentName = name; - return; - } - factory.childName = name; - factory.lastChildNodeKind = node.kind; - const valueRootTypeName = getNamedTypeForChild(`${factory.parentTypeName}.${name}`, node.type); - if (!BASE_SCALARS.has(valueRootTypeName)) { - factory.referencedTypeNames.add(valueRootTypeName); - } - const parent = factory.isCurrentParentExtension - ? getOrThrowError(factory.extensionContainerByTypeName, factory.parentTypeName, EXTENSIONS) - : getOrThrowError(factory.parentContainerByTypeName, factory.parentTypeName, PARENTS); - if (parent.kind !== Kind.INPUT_OBJECT_TYPE_DEFINITION && parent.kind !== Kind.INPUT_OBJECT_TYPE_EXTENSION) { - throw unexpectedKindFatalError(factory.parentTypeName); - } - if (parent.fields.has(name)) { - factory.errors.push(duplicateValueExtensionError('input', factory.parentTypeName, name)); - return; - } - parent.fields.set(name, { - directives: factory.extractDirectives(node, new Map()), - name, - node: { ...node, description: formatDescription(node.description) }, - }); - }, - leave() { - factory.argumentName = ''; - // Only reset childName and lastNodeKind if this input value was NOT an argument - if (factory.lastChildNodeKind === Kind.INPUT_VALUE_DEFINITION) { - factory.childName = ''; - factory.lastChildNodeKind = Kind.NULL; - } - }, - }, - InterfaceTypeDefinition: { - enter(node) { - const name = node.name.value; - factory.parentTypeName = name; - factory.lastParentNodeKind = node.kind; - if (isNodeExtension(node)) { - return factory.handleObjectLikeExtension(node); - } - if (factory.parentContainerByTypeName.has(name)) { - factory.errors.push(duplicateTypeDefinitionError(kindToTypeString(node.kind), name)); - return false; - } - const isEntity = isObjectLikeNodeEntity(node); - factory.parentContainerByTypeName.set(name, { - description: formatDescription(node.description), - directives: factory.extractDirectives(node, new Map()), - fields: new Map(), - interfaces: extractInterfaces(node, new Set(), factory.errors), - isEntity, - kind: node.kind, - name: node.name, - }); - if (!isEntity) { - return; - } - factory.entityInterfaces.set(name, { - concreteTypeNames: new Set(), - interfaceFieldNames: new Set(node.fields?.map((field) => field.name.value)), - interfaceObjectFieldNames: new Set(), - isInterfaceObject: false, - typeName: name, - }); - upsertEntityContainerProperties(factory.entityContainerByTypeName, { - typeName: factory.parentTypeName, - ...(factory.subgraphName ? { subgraphNames: [factory.subgraphName] } : {}), - }); - const fieldSetContainer = getValueOrDefault(factory.fieldSetContainerByTypeName, name, newFieldSetContainer); - factory.extractKeyFieldSets(node, fieldSetContainer); - }, - leave() { - factory.parentTypeName = ''; - factory.lastParentNodeKind = Kind.NULL; - factory.isCurrentParentExtension = false; - }, - }, - InterfaceTypeExtension: { - enter(node) { - factory.parentTypeName = node.name.value; - factory.lastParentNodeKind = node.kind; - return factory.handleObjectLikeExtension(node); - }, - leave() { - factory.isCurrentParentExtension = false; - factory.parentTypeName = ''; - factory.lastParentNodeKind = Kind.NULL; - }, - }, - ObjectTypeDefinition: { - enter(node) { - const typeName = node.name.value; - if (typeName === SERVICE_OBJECT) { - return false; - } - factory.isCurrentParentRootType = ROOT_TYPES.has(typeName) || factory.operationTypeNames.has(typeName); - factory.parentTypeName = typeName; - factory.lastParentNodeKind = node.kind; - addConcreteTypesForImplementedInterfaces(node, factory.abstractToConcreteTypeNames); - factory.handleInterfaceObject(node); - // handling for @extends directive - if (isNodeExtension(node)) { - return factory.handleObjectLikeExtension(node); - } - if (factory.parentContainerByTypeName.has(typeName)) { - factory.errors.push(duplicateTypeDefinitionError(kindToTypeString(node.kind), typeName)); - return false; - } - const isEntity = isObjectLikeNodeEntity(node); - factory.parentContainerByTypeName.set(typeName, { - description: formatDescription(node.description), - directives: factory.extractDirectives(node, new Map()), - fields: new Map(), - interfaces: extractInterfaces(node, new Set(), factory.errors), - isEntity, - kind: node.kind, - name: node.name, - }); - if (!isEntity) { - return; - } - const fieldSetContainer = getValueOrDefault( - factory.fieldSetContainerByTypeName, - typeName, - newFieldSetContainer, - ); - factory.extractKeyFieldSets(node, fieldSetContainer); - upsertEntityContainerProperties(factory.entityContainerByTypeName, { - typeName: factory.parentTypeName, - keyFieldSets: fieldSetContainer.keys, - ...(factory.subgraphName ? { subgraphNames: [factory.subgraphName] } : {}), - }); - }, - leave() { - factory.isCurrentParentRootType = false; - factory.isCurrentParentExtension = false; - factory.parentTypeName = ''; - factory.lastParentNodeKind = Kind.NULL; - }, - }, - ObjectTypeExtension: { - enter(node) { - const name = node.name.value; - if (name === SERVICE_OBJECT) { - return false; - } - factory.isCurrentParentRootType = ROOT_TYPES.has(name) || factory.operationTypeNames.has(name); - factory.parentTypeName = name; - factory.lastParentNodeKind = node.kind; - addConcreteTypesForImplementedInterfaces(node, factory.abstractToConcreteTypeNames); - return factory.handleObjectLikeExtension(node); - }, - leave() { - factory.isCurrentParentRootType = false; - factory.isCurrentParentExtension = false; - factory.parentTypeName = ''; - factory.lastParentNodeKind = Kind.NULL; - }, - }, - ScalarTypeDefinition: { - enter(node) { - const name = node.name.value; - if (name === ANY_SCALAR) { - return false; - } - const parent = factory.parentContainerByTypeName.get(name); - if (parent) { - factory.errors.push(duplicateTypeDefinitionError(kindToTypeString(node.kind), name)); - return false; - } - factory.parentTypeName = name; - factory.lastParentNodeKind = node.kind; - factory.parentContainerByTypeName.set(name, { - description: formatDescription(node.description), - directives: factory.extractDirectivesAndAuthorization(node, new Map()), - kind: Kind.SCALAR_TYPE_DEFINITION, - name: node.name, - }); - }, - leave() { - factory.parentTypeName = ''; - factory.lastParentNodeKind = Kind.NULL; - }, - }, - ScalarTypeExtension: { - enter(node) { - const name = node.name.value; - if (name === ANY_SCALAR) { - return false; - } - const extension = factory.extensionContainerByTypeName.get(name); - if (extension) { - if (extension.kind !== Kind.SCALAR_TYPE_EXTENSION) { - factory.errors.push(incompatibleExtensionKindsError(node, extension.kind)); - return false; - } - factory.extractDirectivesAndAuthorization(node, extension.directives); - } else { - factory.parentTypeName = name; - factory.lastParentNodeKind = node.kind; - factory.extensionContainerByTypeName.set(name, { - directives: factory.extractDirectivesAndAuthorization(node, new Map()), - kind: node.kind, - name: node.name, - }); - } - return false; - }, - leave() { - factory.parentTypeName = ''; - factory.lastParentNodeKind = Kind.NULL; - }, - }, - UnionTypeDefinition: { - enter(node) { - const name = node.name.value; - if (name === ENTITY_UNION) { - return false; - } - factory.parentTypeName = name; - const parent = factory.parentContainerByTypeName.get(name); - if (parent) { - factory.errors.push(duplicateTypeDefinitionError(kindToTypeString(node.kind), name)); - return false; - } - if (!node.types) { - factory.errors.push(noDefinedUnionMembersError(name)); - return false; - } - factory.lastParentNodeKind = node.kind; - addConcreteTypesForUnion(node, factory.abstractToConcreteTypeNames); - factory.parentContainerByTypeName.set(name, { - description: formatDescription(node.description), - directives: factory.extractDirectives(node, new Map()), - kind: node.kind, - name: node.name, - types: factory.extractUniqueUnionMembers([...node.types], new Map()), - }); - }, - leave() { - factory.parentTypeName = ''; - factory.lastParentNodeKind = Kind.NULL; - }, - }, - UnionTypeExtension: { - enter(node) { - const name = node.name.value; - if (name === ENTITY_UNION) { - return false; - } - const extension = factory.extensionContainerByTypeName.get(name); - if (!node.types) { - factory.errors.push(); - return false; - } - factory.lastParentNodeKind = node.kind; - addConcreteTypesForUnion(node, factory.abstractToConcreteTypeNames); - if (extension) { - if (extension.kind !== Kind.UNION_TYPE_EXTENSION) { - factory.errors.push(incompatibleExtensionKindsError(node, extension.kind)); - return false; - } - factory.extractDirectives(node, extension.directives); - } else { - factory.extensionContainerByTypeName.set(name, { - directives: factory.extractDirectives(node, new Map()), - kind: node.kind, - name: node.name, - types: factory.extractUniqueUnionMembers([...node.types], new Map()), - }); + this.invalidOrScopesHostPaths.add(`${concreteTypeName}.${fieldName}`); } - return false; - }, - leave() { - factory.lastParentNodeKind = Kind.NULL; - }, - }, - }); + } + } + } + // Apply inherited leaf authorization that was not applied to interface fields of that type earlier + for (const [typeName, fieldAuthorizationDatas] of this.heirFieldAuthorizationDataByTypeName) { + const authorizationData = this.authorizationDataByParentTypeName.get(typeName); + if (!authorizationData) { + continue; + } + for (const fieldAuthorizationData of fieldAuthorizationDatas) { + if (!mergeAuthorizationDataByAND(authorizationData, fieldAuthorizationData)) { + this.invalidOrScopesHostPaths.add(`${typeName}.${fieldAuthorizationData.fieldName}`); + } + } + } + if (this.invalidOrScopesHostPaths.size > 0) { + this.errors.push(orScopesLimitError(maxOrScopes, [...this.invalidOrScopesHostPaths])); + } const definitions: DefinitionNode[] = []; for (const directiveDefinition of BASE_DIRECTIVE_DEFINITIONS) { definitions.push(directiveDefinition); } definitions.push(FIELD_SET_SCALAR_DEFINITION); - if (factory.isSubgraphVersionTwo) { + if (this.isSubgraphVersionTwo) { for (const directiveDefinition of VERSION_TWO_DIRECTIVE_DEFINITIONS) { definitions.push(directiveDefinition); - this.allDirectiveDefinitions.set(directiveDefinition.name.value, directiveDefinition); + this.directiveDefinitionByDirectiveName.set(directiveDefinition.name.value, directiveDefinition); } definitions.push(SCOPE_SCALAR_DEFINITION); } @@ -1721,12 +874,14 @@ export class NormalizationFactory { definitions.push(directiveDefinition); } if (this.schemaDefinition.operationTypes.size > 0) { - definitions.push(schemaContainerToNode(this, this.schemaDefinition)); + definitions.push( + getSchemaNodeByData(this.schemaDefinition, this.errors, this.directiveDefinitionByDirectiveName), + ); } const validExtensionOrphans = new Set(); const parentsToIgnore = new Set(); - for (const [extensionTypeName, extensionContainer] of this.extensionContainerByTypeName) { + for (const [extensionTypeName, parentExtensionData] of this.parentExtensionDataByTypeName) { const isEntity = this.entityContainerByTypeName.has(extensionTypeName); const configurationData: ConfigurationData = { fieldNames: new Set(), @@ -1734,90 +889,143 @@ export class NormalizationFactory { typeName: extensionTypeName, }; this.configurationDataMap.set(extensionTypeName, configurationData); - if (extensionContainer.kind === Kind.OBJECT_TYPE_EXTENSION) { + if (parentExtensionData.kind === Kind.OBJECT_TYPE_EXTENSION) { if (this.operationTypeNames.has(extensionTypeName)) { - extensionContainer.fields.delete(SERVICE_FIELD); - extensionContainer.fields.delete(ENTITIES_FIELD); + parentExtensionData.fieldDataByFieldName.delete(SERVICE_FIELD); + parentExtensionData.fieldDataByFieldName.delete(ENTITIES_FIELD); } - addNonExternalFieldsToSet(extensionContainer.fields, configurationData.fieldNames); + addNonExternalFieldsToSet(parentExtensionData.fieldDataByFieldName, configurationData.fieldNames); } - const baseType = this.parentContainerByTypeName.get(extensionTypeName); - if (!baseType) { - if (extensionContainer.kind !== Kind.OBJECT_TYPE_EXTENSION) { + const parentDefinitionData = this.parentDefinitionDataByTypeName.get(extensionTypeName); + if (!parentDefinitionData) { + if (parentExtensionData.kind !== Kind.OBJECT_TYPE_EXTENSION) { this.errors.push(noBaseTypeExtensionError(extensionTypeName)); } else { - this.validateInterfaceImplementations(extensionContainer); + this.validateInterfaceImplementations(parentExtensionData); validExtensionOrphans.add(extensionTypeName); - definitions.push(objectLikeContainerToNode(this, extensionContainer)); + definitions.push( + getParentWithFieldsNodeByData( + parentExtensionData, + this.errors, + this.directiveDefinitionByDirectiveName, + this.authorizationDataByParentTypeName, + ), + ); } continue; } - if (!areBaseAndExtensionKindsCompatible(baseType.kind, extensionContainer.kind, extensionTypeName)) { - this.errors.push(incompatibleExtensionError(extensionTypeName, baseType.kind, extensionContainer.kind)); + if (!areBaseAndExtensionKindsCompatible(parentDefinitionData.kind, parentExtensionData.kind, extensionTypeName)) { + this.errors.push( + incompatibleExtensionError(extensionTypeName, parentDefinitionData.kind, parentExtensionData.kind), + ); continue; } - switch (baseType.kind) { + switch (parentDefinitionData.kind) { case Kind.ENUM_TYPE_DEFINITION: - const enumExtension = extensionContainer as EnumExtensionContainer; - for (const [valueName, enumValueDefinitionNode] of enumExtension.values) { - if (!baseType.values.has(valueName)) { - baseType.values.set(valueName, enumValueDefinitionNode); + const enumExtensionData = parentExtensionData as EnumExtensionData; + for (const [valueName, enumValueDefinitionNode] of enumExtensionData.enumValueDataByValueName) { + if (!parentDefinitionData.enumValueDataByValueName.has(valueName)) { + parentDefinitionData.enumValueDataByValueName.set(valueName, enumValueDefinitionNode); continue; } this.errors.push(duplicateEnumValueDefinitionError(valueName, extensionTypeName)); } - definitions.push(enumContainerToNode(this, baseType, enumExtension)); + definitions.push( + getEnumNodeByData( + parentDefinitionData, + this.errors, + this.directiveDefinitionByDirectiveName, + this.authorizationDataByParentTypeName, + enumExtensionData, + ), + ); break; case Kind.INPUT_OBJECT_TYPE_DEFINITION: - const inputExtension = extensionContainer as InputObjectExtensionContainer; - for (const [fieldName, inputValueDefinitionNode] of inputExtension.fields) { - if (!baseType.fields.has(fieldName)) { - baseType.fields.set(fieldName, inputValueDefinitionNode); + const inputObjectExtensionData = parentExtensionData as InputObjectExtensionData; + for (const [fieldName, inputValueDefinitionNode] of inputObjectExtensionData.inputValueDataByValueName) { + if (!parentDefinitionData.inputValueDataByValueName.has(fieldName)) { + parentDefinitionData.inputValueDataByValueName.set(fieldName, inputValueDefinitionNode); continue; } this.errors.push(duplicateFieldDefinitionError(fieldName, extensionTypeName)); } - definitions.push(inputObjectContainerToNode(this, baseType, inputExtension)); + definitions.push( + getInputObjectNodeByData( + parentDefinitionData, + this.errors, + this.directiveDefinitionByDirectiveName, + this.authorizationDataByParentTypeName, + inputObjectExtensionData, + ), + ); break; case Kind.INTERFACE_TYPE_DEFINITION: // intentional fallthrough case Kind.OBJECT_TYPE_DEFINITION: - const objectLikeExtension = extensionContainer as ObjectLikeExtensionContainer; + const extensionWithFieldsData = parentExtensionData as ExtensionWithFieldsData; const operationTypeNode = this.operationTypeNames.get(extensionTypeName); if (operationTypeNode) { - objectLikeExtension.fields.delete(SERVICE_FIELD); - objectLikeExtension.fields.delete(ENTITIES_FIELD); + extensionWithFieldsData.fieldDataByFieldName.delete(SERVICE_FIELD); + extensionWithFieldsData.fieldDataByFieldName.delete(ENTITIES_FIELD); } - for (const [fieldName, fieldContainer] of objectLikeExtension.fields) { - if (fieldContainer.arguments.size > 0) { + for (const [fieldName, fieldData] of extensionWithFieldsData.fieldDataByFieldName) { + if (fieldData.argumentDataByArgumentName.size > 0) { // Arguments can only be fully validated once all parents types are known - this.validateArguments(fieldContainer, `${extensionTypeName}.${fieldName}`); + this.validateArguments(fieldData, `${extensionTypeName}.${fieldName}`); } - if (baseType.fields.has(fieldName)) { + if (parentDefinitionData.fieldDataByFieldName.has(fieldName)) { this.errors.push(duplicateFieldDefinitionError(fieldName, extensionTypeName)); continue; } - baseType.fields.set(fieldName, fieldContainer); - if (!fieldContainer.arguments.has(EXTERNAL)) { + parentDefinitionData.fieldDataByFieldName.set(fieldName, fieldData); + if (!fieldData.argumentDataByArgumentName.has(EXTERNAL)) { configurationData.fieldNames.add(fieldName); } } - this.mergeUniqueInterfaces(objectLikeExtension.interfaces, baseType.interfaces, extensionTypeName); - this.validateInterfaceImplementations(baseType); - definitions.push(objectLikeContainerToNode(this, baseType, objectLikeExtension)); + this.mergeUniqueInterfaces( + extensionWithFieldsData.implementedInterfaceTypeNames, + parentDefinitionData.implementedInterfaceTypeNames, + extensionTypeName, + ); + this.validateInterfaceImplementations(parentDefinitionData); + definitions.push( + getParentWithFieldsNodeByData( + parentDefinitionData, + this.errors, + this.directiveDefinitionByDirectiveName, + this.authorizationDataByParentTypeName, + extensionWithFieldsData, + ), + ); // Interfaces and objects must define at least one field - if (baseType.fields.size < 1 && !isNodeQuery(extensionTypeName, operationTypeNode)) { - this.errors.push(noFieldDefinitionsError(kindToTypeString(baseType.kind), extensionTypeName)); + if ( + parentDefinitionData.fieldDataByFieldName.size < 1 && + !isNodeQuery(extensionTypeName, operationTypeNode) + ) { + this.errors.push(noFieldDefinitionsError(kindToTypeString(parentDefinitionData.kind), extensionTypeName)); } // Add the non-external base type field names to the configuration data - addNonExternalFieldsToSet(baseType.fields, configurationData.fieldNames); + addNonExternalFieldsToSet(parentDefinitionData.fieldDataByFieldName, configurationData.fieldNames); break; case Kind.SCALAR_TYPE_DEFINITION: - definitions.push(scalarContainerToNode(this, baseType, extensionContainer as ScalarExtensionContainer)); + definitions.push( + getScalarNodeByData( + parentDefinitionData, + this.errors, + this.directiveDefinitionByDirectiveName, + parentExtensionData as ScalarExtensionData, + ), + ); break; case Kind.UNION_TYPE_DEFINITION: - const unionExtension = extensionContainer as UnionExtensionContainer; - definitions.push(unionContainerToNode(this, baseType, unionExtension)); + definitions.push( + getUnionNodeByData( + parentDefinitionData, + this.errors, + this.directiveDefinitionByDirectiveName, + parentExtensionData as UnionExtensionData, + ), + ); break; default: throw unexpectedKindFatalError(extensionTypeName); @@ -1825,16 +1033,30 @@ export class NormalizationFactory { // At this point, the base type has been dealt with, so it doesn't need to be dealt with again parentsToIgnore.add(extensionTypeName); } - for (const [parentTypeName, parentContainer] of this.parentContainerByTypeName) { + for (const [parentTypeName, parentDefinitionData] of this.parentDefinitionDataByTypeName) { if (parentsToIgnore.has(parentTypeName)) { continue; } - switch (parentContainer.kind) { + switch (parentDefinitionData.kind) { case Kind.ENUM_TYPE_DEFINITION: - definitions.push(enumContainerToNode(this, parentContainer)); + definitions.push( + getEnumNodeByData( + parentDefinitionData, + this.errors, + this.directiveDefinitionByDirectiveName, + this.authorizationDataByParentTypeName, + ), + ); break; case Kind.INPUT_OBJECT_TYPE_DEFINITION: - definitions.push(inputObjectContainerToNode(this, parentContainer)); + definitions.push( + getInputObjectNodeByData( + parentDefinitionData, + this.errors, + this.directiveDefinitionByDirectiveName, + this.authorizationDataByParentTypeName, + ), + ); break; case Kind.INTERFACE_TYPE_DEFINITION: // intentional fallthrough @@ -1842,17 +1064,17 @@ export class NormalizationFactory { const isEntity = this.entityContainerByTypeName.has(parentTypeName); const operationTypeNode = this.operationTypeNames.get(parentTypeName); if (operationTypeNode) { - parentContainer.fields.delete(SERVICE_FIELD); - parentContainer.fields.delete(ENTITIES_FIELD); + parentDefinitionData.fieldDataByFieldName.delete(SERVICE_FIELD); + parentDefinitionData.fieldDataByFieldName.delete(ENTITIES_FIELD); } if (this.parentsWithChildArguments.has(parentTypeName)) { if ( - parentContainer.kind !== Kind.OBJECT_TYPE_DEFINITION && - parentContainer.kind !== Kind.INTERFACE_TYPE_DEFINITION + parentDefinitionData.kind !== Kind.OBJECT_TYPE_DEFINITION && + parentDefinitionData.kind !== Kind.INTERFACE_TYPE_DEFINITION ) { continue; } - for (const [fieldName, fieldContainer] of parentContainer.fields) { + for (const [fieldName, fieldContainer] of parentDefinitionData.fieldDataByFieldName) { // Arguments can only be fully validated once all parents types are known this.validateArguments(fieldContainer, `${parentTypeName}.${fieldName}`); } @@ -1874,19 +1096,30 @@ export class NormalizationFactory { configurationData.events = events; } this.configurationDataMap.set(parentTypeName, configurationData); - addNonExternalFieldsToSet(parentContainer.fields, configurationData.fieldNames); - this.validateInterfaceImplementations(parentContainer); - definitions.push(objectLikeContainerToNode(this, parentContainer)); + addNonExternalFieldsToSet(parentDefinitionData.fieldDataByFieldName, configurationData.fieldNames); + this.validateInterfaceImplementations(parentDefinitionData); + definitions.push( + getParentWithFieldsNodeByData( + parentDefinitionData, + this.errors, + this.directiveDefinitionByDirectiveName, + this.authorizationDataByParentTypeName, + ), + ); // interfaces and objects must define at least one field - if (parentContainer.fields.size < 1 && !isNodeQuery(parentTypeName, operationTypeNode)) { - this.errors.push(noFieldDefinitionsError(kindToTypeString(parentContainer.kind), parentTypeName)); + if (parentDefinitionData.fieldDataByFieldName.size < 1 && !isNodeQuery(parentTypeName, operationTypeNode)) { + this.errors.push(noFieldDefinitionsError(kindToTypeString(parentDefinitionData.kind), parentTypeName)); } break; case Kind.SCALAR_TYPE_DEFINITION: - definitions.push(scalarContainerToNode(this, parentContainer)); + definitions.push( + getScalarNodeByData(parentDefinitionData, this.errors, this.directiveDefinitionByDirectiveName), + ); break; case Kind.UNION_TYPE_DEFINITION: - definitions.push(unionContainerToNode(this, parentContainer)); + definitions.push( + getUnionNodeByData(parentDefinitionData, this.errors, this.directiveDefinitionByDirectiveName), + ); break; default: throw unexpectedKindFatalError(parentTypeName); @@ -1901,13 +1134,14 @@ export class NormalizationFactory { // If a custom type is used, the default type should not be defined if ( operationTypeName !== defaultTypeName && - (this.parentContainerByTypeName.has(defaultTypeName) || this.extensionContainerByTypeName.has(defaultTypeName)) + (this.parentDefinitionDataByTypeName.has(defaultTypeName) || + this.parentExtensionDataByTypeName.has(defaultTypeName)) ) { this.errors.push(invalidRootTypeDefinitionError(operationType, operationTypeName, defaultTypeName)); continue; } - const object = this.parentContainerByTypeName.get(operationTypeName); - const extension = this.extensionContainerByTypeName.get(operationTypeName); + const object = this.parentDefinitionDataByTypeName.get(operationTypeName); + const extension = this.parentExtensionDataByTypeName.get(operationTypeName); // Node is truthy if an operation type was explicitly declared if (node) { // If the type is not defined in the schema, it's always an error @@ -1937,13 +1171,12 @@ export class NormalizationFactory { } // Root types fields whose response type is an extension orphan could be valid through a federated graph // However, the field would have to be shareable to ever be valid TODO - for (const fieldContainer of container.fields.values()) { - const fieldName = fieldContainer.name; + for (const [fieldName, fieldData] of container.fieldDataByFieldName) { const fieldPath = `${operationTypeName}.${fieldName}`; - const fieldTypeName = getNamedTypeForChild(fieldPath, fieldContainer.node.type); + const fieldTypeName = getNamedTypeForChild(fieldPath, fieldData.node.type); if ( !BASE_SCALARS.has(fieldTypeName) && - !this.parentContainerByTypeName.has(fieldTypeName) && + !this.parentDefinitionDataByTypeName.has(fieldTypeName) && !validExtensionOrphans.has(fieldTypeName) ) { this.errors.push(undefinedTypeError(fieldTypeName)); @@ -1953,19 +1186,20 @@ export class NormalizationFactory { } for (const referencedTypeName of this.referencedTypeNames) { if ( - this.parentContainerByTypeName.has(referencedTypeName) || + this.parentDefinitionDataByTypeName.has(referencedTypeName) || this.entityContainerByTypeName.has(referencedTypeName) ) { continue; } - const extension = this.extensionContainerByTypeName.get(referencedTypeName); + const extension = this.parentExtensionDataByTypeName.get(referencedTypeName); if (!extension || extension.kind !== Kind.OBJECT_TYPE_EXTENSION) { this.errors.push(undefinedTypeError(referencedTypeName)); } } for (const [parentTypeName, fieldSetContainers] of this.fieldSetContainerByTypeName) { const parentContainer = - this.parentContainerByTypeName.get(parentTypeName) || this.extensionContainerByTypeName.get(parentTypeName); + this.parentDefinitionDataByTypeName.get(parentTypeName) || + this.parentExtensionDataByTypeName.get(parentTypeName); if ( !parentContainer || (parentContainer.kind !== Kind.OBJECT_TYPE_DEFINITION && @@ -1979,49 +1213,6 @@ export class NormalizationFactory { // this is where keys, provides, and requires are added to the ConfigurationData validateAndAddDirectivesWithFieldSetToConfigurationData(this, parentContainer, fieldSetContainers); } - walkSubgraphToApplyFieldAuthorization(factory, document); - for (const interfaceTypeName of this.interfaceTypeNamesWithAuthorizationDirectives) { - const interfaceAuthorizationData = factory.authorizationDataByParentTypeName.get(interfaceTypeName); - if (!interfaceAuthorizationData) { - continue; - } - const concreteTypeNames = factory.abstractToConcreteTypeNames.get(interfaceTypeName); - for (const concreteTypeName of concreteTypeNames || []) { - const concreteAuthorizationData = getValueOrDefault( - factory.authorizationDataByParentTypeName, - concreteTypeName, - () => newAuthorizationData(concreteTypeName), - ); - for (const [ - fieldName, - interfaceFieldAuthorizationData, - ] of interfaceAuthorizationData.fieldAuthorizationDataByFieldName) { - if ( - !upsertFieldAuthorizationData( - concreteAuthorizationData.fieldAuthorizationDataByFieldName, - interfaceFieldAuthorizationData, - ) - ) { - this.invalidOrScopesHostPaths.add(`${concreteTypeName}.${fieldName}`); - } - } - } - } - // Apply inherited leaf authorization that was not applied to interface fields of that type earlier - for (const [typeName, fieldAuthorizationDatas] of this.heirFieldAuthorizationDataByTypeName) { - const authorizationData = this.authorizationDataByParentTypeName.get(typeName); - if (!authorizationData) { - continue; - } - for (const fieldAuthorizationData of fieldAuthorizationDatas) { - if (!mergeAuthorizationDataByAND(authorizationData, fieldAuthorizationData)) { - this.invalidOrScopesHostPaths.add(`${typeName}.${fieldAuthorizationData.fieldName}`); - } - } - } - if (this.invalidOrScopesHostPaths.size > 0) { - this.errors.push(orScopesLimitError(maxOrScopes, [...this.invalidOrScopesHostPaths])); - } if (this.errors.length > 0) { return { errors: this.errors }; } @@ -2037,12 +1228,12 @@ export class NormalizationFactory { configurationDataMap: this.configurationDataMap, entityContainerByTypeName: this.entityContainerByTypeName, entityInterfaces: this.entityInterfaces, - extensionContainerByTypeName: this.extensionContainerByTypeName, + parentExtensionDataByTypeName: this.parentExtensionDataByTypeName, isVersionTwo: this.isSubgraphVersionTwo, keyFieldNamesByParentTypeName: this.keyFieldNamesByParentTypeName, operationTypes: this.operationTypeNames, overridesByTargetSubgraphName: this.overridesByTargetSubgraphName, - parentContainerByTypeName: this.parentContainerByTypeName, + parentDataByTypeName: this.parentDefinitionDataByTypeName, subgraphAST: newAST, subgraphString: print(newAST), schema: buildASTSchema(newAST, { assumeValid: true }), @@ -2058,7 +1249,7 @@ export function batchNormalize(subgraphs: Subgraph[]): BatchNormalizationContain const allOverridesByTargetSubgraphName = new Map>>(); const overrideSourceSubgraphNamesByFieldPath = new Map(); const duplicateOverriddenFieldPaths = new Set(); - const parentContainerMapsBySubgraphName = new Map(); + const parentDefinitionDataMapsBySubgraphName = new Map>(); const subgraphNames = new Set(); const nonUniqueSubgraphNames = new Set(); const invalidNameErrorMessages: string[] = []; @@ -2087,7 +1278,7 @@ export function batchNormalize(subgraphs: Subgraph[]): BatchNormalizationContain continue; } - parentContainerMapsBySubgraphName.set(subgraphName, normalizationResult.parentContainerByTypeName); + parentDefinitionDataMapsBySubgraphName.set(subgraphName, normalizationResult.parentDataByTypeName); for (const authorizationData of normalizationResult.authorizationDataByParentTypeName.values()) { upsertAuthorizationData(authorizationDataByParentTypeName, authorizationData, invalidOrScopesHostPaths); @@ -2100,13 +1291,13 @@ export function batchNormalize(subgraphs: Subgraph[]): BatchNormalizationContain configurationDataMap: normalizationResult.configurationDataMap, definitions: normalizationResult.subgraphAST, entityInterfaces: normalizationResult.entityInterfaces, - extensionContainerByTypeName: normalizationResult.extensionContainerByTypeName, + parentExtensionDataByTypeName: normalizationResult.parentExtensionDataByTypeName, keyFieldNamesByParentTypeName: normalizationResult.keyFieldNamesByParentTypeName, isVersionTwo: normalizationResult.isVersionTwo, name: subgraphName, operationTypes: normalizationResult.operationTypes, overriddenFieldNamesByParentTypeName: new Map>(), - parentContainerByTypeName: normalizationResult.parentContainerByTypeName, + parentDataByTypeName: normalizationResult.parentDataByTypeName, schema: normalizationResult.schema, url: subgraph.url, }); diff --git a/composition/src/normalization/utils.ts b/composition/src/normalization/utils.ts index 94d1608ceb..4a5cf0b1d8 100644 --- a/composition/src/normalization/utils.ts +++ b/composition/src/normalization/utils.ts @@ -1,31 +1,17 @@ import { BREAK, - ConstArgumentNode, ConstDirectiveNode, DirectiveDefinitionNode, DocumentNode, - EnumTypeDefinitionNode, - EnumValueDefinitionNode, - FieldDefinitionNode, - InputObjectTypeDefinitionNode, InputValueDefinitionNode, - InterfaceTypeDefinitionNode, Kind, - NamedTypeNode, - NameNode, - ObjectTypeDefinitionNode, - ObjectTypeExtensionNode, - OperationTypeDefinitionNode, OperationTypeNode, print, - ScalarTypeDefinitionNode, - SchemaDefinitionNode, - StringValueNode, - UnionTypeDefinitionNode, + TypeNode, visit, } from 'graphql'; -import { getOrThrowError, getValueOrDefault, kindToTypeString, mapToArrayOfValues } from '../utils/utils'; -import { isKindAbstract, lexicographicallySortDocumentNode, safeParse, setToNamedTypeNodeArray } from '../ast/utils'; +import { getOrThrowError, getValueOrDefault, kindToTypeString } from '../utils/utils'; +import { isKindAbstract, lexicographicallySortDocumentNode, safeParse } from '../ast/utils'; import { ARGUMENT_DEFINITION_UPPER, ENUM_UPPER, @@ -51,11 +37,10 @@ import { VARIABLE_DEFINITION_UPPER, } from '../utils/string-constants'; import { NormalizationFactory } from './normalization-factory'; -import { getNamedTypeForChild } from '../type-merging/type-merging'; +import { getNamedTypeForChild } from '../schema-building/type-merging'; import { abstractTypeInKeyFieldSetErrorMessage, argumentsInKeyFieldSetErrorMessage, - duplicateDirectiveArgumentDefinitionErrorMessage, duplicateFieldInFieldSetErrorMessage, inlineFragmentInFieldSetErrorMessage, inlineFragmentWithoutTypeConditionErrorMessage, @@ -70,7 +55,6 @@ import { invalidSelectionSetErrorMessage, undefinedFieldInFieldSetErrorMessage, unexpectedArgumentErrorMessage, - unexpectedDirectiveArgumentErrorMessage, unexpectedDirectiveLocationError, unknownInlineFragmentTypeConditionErrorMessage, unknownProvidesEntityErrorMessage, @@ -80,105 +64,7 @@ import { } from '../errors/errors'; import { BASE_SCALARS } from '../utils/constants'; import { RequiredFieldConfiguration } from '../router-configuration/router-configuration'; - -export type EnumContainer = { - description?: StringValueNode; - directives: Map; - kind: Kind.ENUM_TYPE_DEFINITION; - name: NameNode; - values: Map; -}; - -export type EnumValueContainer = { - directives: Map; - name: string; - node: EnumValueDefinitionNode; -}; - -export type FieldContainer = { - arguments: Map; - directives: Map; - name: string; - node: FieldDefinitionNode; -}; - -export type InputObjectContainer = { - description?: StringValueNode; - directives: Map; - fields: Map; - kind: Kind.INPUT_OBJECT_TYPE_DEFINITION; - name: NameNode; -}; - -export type InputValueContainer = { - directives: Map; - name: string; - node: InputValueDefinitionNode; -}; - -export type InterfaceContainer = { - description?: StringValueNode; - directives: Map; - fields: Map; - interfaces: Set; - isEntity: boolean; - kind: Kind.INTERFACE_TYPE_DEFINITION; - name: NameNode; -}; - -export type ObjectContainer = { - description?: StringValueNode; - directives: Map; - fields: Map; - interfaces: Set; - isEntity: boolean; - kind: Kind.OBJECT_TYPE_DEFINITION; - name: NameNode; -}; - -export type ScalarContainer = { - description?: StringValueNode; - directives: Map; - kind: Kind.SCALAR_TYPE_DEFINITION; - name: NameNode; -}; - -export type SchemaContainer = { - description?: StringValueNode; - directives: Map; - kind: Kind.SCHEMA_DEFINITION; - name: NameNode; - operationTypes: Map; -}; - -export type UnionContainer = { - description?: StringValueNode; - directives: Map; - kind: Kind.UNION_TYPE_DEFINITION; - name: NameNode; - types: Map; -}; - -export type ObjectLikeTypeContainer = InterfaceContainer | ObjectContainer; - -export type ParentContainer = - | EnumContainer - | InputObjectContainer - | InterfaceContainer - | ObjectContainer - | ScalarContainer - | UnionContainer; - -export type ChildContainer = EnumValueContainer | FieldContainer | InputValueContainer; - -export type ParentContainerByTypeName = Map; - -export type EnumExtensionContainer = { - directives: Map; - kind: Kind.ENUM_TYPE_EXTENSION; - name: NameNode; - values: Map; -}; +import { FieldData, ParentWithFieldsData, UnionDefinitionData } from '../schema-building/type-definition-data'; export type FieldSetContainer = { keys: Set; @@ -195,170 +81,18 @@ export function newFieldSetContainer(): FieldSetContainer { }; } -export type InputObjectExtensionContainer = { - directives: Map; - fields: Map; - kind: Kind.INPUT_OBJECT_TYPE_EXTENSION; - name: NameNode; -}; - -export type InterfaceExtensionContainer = { - directives: Map; - fields: Map; - interfaces: Set; - kind: Kind.INTERFACE_TYPE_EXTENSION; - name: NameNode; -}; - -export type ObjectExtensionContainer = { - directives: Map; - fields: Map; - interfaces: Set; - isEntity: boolean; - kind: Kind.OBJECT_TYPE_EXTENSION; - name: NameNode; -}; - -export type ScalarExtensionContainer = { - directives: Map; - kind: Kind.SCALAR_TYPE_EXTENSION; - name: NameNode; -}; - -export type UnionExtensionContainer = { - directives: Map; - kind: Kind.UNION_TYPE_EXTENSION; - name: NameNode; - types: Map; -}; - -export type ObjectLikeExtensionContainer = InterfaceExtensionContainer | ObjectExtensionContainer; - -export type ObjectLikeContainer = ObjectLikeTypeContainer | ObjectLikeExtensionContainer; - -export type ExtensionContainer = - | EnumExtensionContainer - | InputObjectExtensionContainer - | InterfaceExtensionContainer - | ObjectExtensionContainer - | ScalarExtensionContainer - | UnionExtensionContainer; - -export type ExtensionContainerByTypeName = Map; - -type ChildDefinitionNode = EnumValueDefinitionNode | InputValueDefinitionNode | FieldDefinitionNode; - -function childMapToValueArray( - factory: NormalizationFactory, - map: Map, - parentTypeName: string, -): N[] { - const valueArray: ChildDefinitionNode[] = []; - for (const childContainer of map.values()) { - const childPath = `${parentTypeName}.${childContainer.name}`; - factory.validateChildDirectives(childContainer, childPath); - valueArray.push(childContainer.node); - } - return valueArray as N[]; -} - -export function enumContainerToNode( - factory: NormalizationFactory, - baseEnum: EnumContainer, - enumExtension?: ExtensionContainer, -): EnumTypeDefinitionNode { - factory.mergeDirectives(baseEnum.directives, enumExtension); - return { - description: baseEnum.description, - directives: factory.getValidatedAndNormalizedParentDirectives(baseEnum), - kind: baseEnum.kind, - name: baseEnum.name, - values: childMapToValueArray(factory, baseEnum.values, baseEnum.name.value), - }; -} - -export function inputObjectContainerToNode( - factory: NormalizationFactory, - baseInputObject: InputObjectContainer, - inputObjectExtension?: InputObjectExtensionContainer, -): InputObjectTypeDefinitionNode { - factory.mergeDirectives(baseInputObject.directives, inputObjectExtension); - return { - description: baseInputObject.description, - directives: factory.getValidatedAndNormalizedParentDirectives(baseInputObject), - fields: childMapToValueArray(factory, baseInputObject.fields, baseInputObject.name.value), - kind: baseInputObject.kind, - name: baseInputObject.name, - }; -} - -export function objectLikeContainerToNode( - factory: NormalizationFactory, - baseObjectLike: ObjectLikeTypeContainer | ObjectExtensionContainer, - objectLikeExtension?: ObjectLikeExtensionContainer, -): ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode | ObjectTypeExtensionNode { - factory.mergeDirectives(baseObjectLike.directives, objectLikeExtension); - const description = baseObjectLike.kind === Kind.OBJECT_TYPE_EXTENSION ? undefined : baseObjectLike.description; - return { - description, - directives: factory.getValidatedAndNormalizedParentDirectives(baseObjectLike), - fields: childMapToValueArray(factory, baseObjectLike.fields, baseObjectLike.name.value), - interfaces: setToNamedTypeNodeArray(baseObjectLike.interfaces), - kind: baseObjectLike.kind, - name: baseObjectLike.name, - }; -} - -export function scalarContainerToNode( - factory: NormalizationFactory, - baseScalar: ScalarContainer, - scalarExtension?: ScalarExtensionContainer, -): ScalarTypeDefinitionNode { - factory.mergeDirectives(baseScalar.directives, scalarExtension); - return { - description: baseScalar.description, - directives: factory.getValidatedAndNormalizedParentDirectives(baseScalar), - kind: baseScalar.kind, - name: baseScalar.name, - }; -} - -export function schemaContainerToNode( - factory: NormalizationFactory, - baseSchema: SchemaContainer, -): SchemaDefinitionNode { - return { - description: baseSchema.description, - directives: factory.getValidatedAndNormalizedParentDirectives(baseSchema), - kind: baseSchema.kind, - operationTypes: mapToArrayOfValues(baseSchema.operationTypes), - }; -} - -export function unionContainerToNode( - factory: NormalizationFactory, - baseUnion: UnionContainer, - unionExtension?: UnionExtensionContainer, -): UnionTypeDefinitionNode { - factory.mergeUniqueUnionMembers(baseUnion, unionExtension); - factory.mergeDirectives(baseUnion.directives, unionExtension); - return { - description: baseUnion.description, - directives: factory.getValidatedAndNormalizedParentDirectives(baseUnion), - kind: baseUnion.kind, - name: baseUnion.name, - types: mapToArrayOfValues(baseUnion.types), - }; -} - export function areNodeKindAndDirectiveLocationCompatible( kind: Kind, directiveDefinitionNode: DirectiveDefinitionNode, + isArgument = false, ): boolean { for (const location of directiveDefinitionNode.locations) { const locationName = location.value.toUpperCase(); switch (locationName) { case ARGUMENT_DEFINITION_UPPER: + if (!isArgument) { + break; + } if (kind === Kind.INPUT_VALUE_DEFINITION) { return true; } @@ -456,12 +190,12 @@ export function areNodeKindAndDirectiveLocationCompatible( export function getDirectiveDefinitionArgumentSets( args: readonly InputValueDefinitionNode[], - allArguments: Set, + argumentKindByArgumentName: Map, requiredArguments: Set, ) { for (const argument of args) { const argumentName = argument.name.value; - allArguments.add(argumentName); + argumentKindByArgumentName.set(argumentName, argument.type); // If the definition defines a default argument, it's not necessary to include it if (argument.type.kind === Kind.NON_NULL_TYPE && !argument.defaultValue) { requiredArguments.add(argumentName); @@ -469,37 +203,14 @@ export function getDirectiveDefinitionArgumentSets( } } -export function getDefinedArgumentsForDirective( - args: readonly ConstArgumentNode[], - allArguments: Set, - directiveName: string, - hostPath: string, - errorMessages: string[], -): Set { - const definedArguments = new Set(); - for (const argument of args) { - const argumentName = argument.name.value; - if (!allArguments.has(argumentName)) { - errorMessages.push(unexpectedDirectiveArgumentErrorMessage(directiveName, argumentName)); - continue; - } - if (definedArguments.has(argumentName)) { - errorMessages.push(duplicateDirectiveArgumentDefinitionErrorMessage(directiveName, hostPath, argumentName)); - continue; - } - definedArguments.add(argumentName); - } - return definedArguments; -} - export type InputValidationContainer = { hasUnhandledError: boolean; typeString: string; }; -export function addNonExternalFieldsToSet(fields: Map, fieldNames: Set) { - for (const [fieldName, fieldContainer] of fields) { - if (fieldContainer.directives.has(EXTERNAL)) { +export function addNonExternalFieldsToSet(fieldDataByFieldName: Map, fieldNames: Set) { + for (const [fieldName, fieldContainer] of fieldDataByFieldName) { + if (fieldContainer.directivesByDirectiveName.has(EXTERNAL)) { continue; } fieldNames.add(fieldName); @@ -542,7 +253,7 @@ export function getNormalizedFieldSet(documentNode: DocumentNode): string { function validateNonRepeatableFieldSet( factory: NormalizationFactory, - parentContainer: ObjectLikeContainer, + parentData: ParentWithFieldsData, fieldSet: string, directiveFieldName: string, ): NonRepeatableFieldSetValidationResult { @@ -552,23 +263,23 @@ function validateNonRepeatableFieldSet( return { errorMessage: unparsableFieldSetErrorMessage(fieldSet, error) }; } let errorMessage; - const parentContainers: (ObjectLikeContainer | UnionContainer)[] = [parentContainer]; + const parentDatas: (ParentWithFieldsData | UnionDefinitionData)[] = [parentData]; const definedFields: Set[] = []; let currentDepth = -1; let shouldDefineSelectionSet = true; let lastFieldName = directiveFieldName; - let fieldPath = parentContainer.name.value; + let fieldPath = parentData.typeName; visit(documentNode, { Argument: { - enter(node) { + enter() { return false; }, }, Field: { enter(node) { - const parentContainer = parentContainers[currentDepth]; - const parentTypeName = parentContainer.name.value; - if (parentContainer.kind === Kind.UNION_TYPE_DEFINITION) { + const parentData = parentDatas[currentDepth]; + const parentTypeName = parentData.typeName; + if (parentData.kind === Kind.UNION_TYPE_DEFINITION) { errorMessage = invalidSelectionOnUnionErrorMessage(fieldSet, fieldPath, parentTypeName); return BREAK; } @@ -578,14 +289,14 @@ function validateNonRepeatableFieldSet( fieldSet, fieldPath, parentTypeName, - kindToTypeString(parentContainer.kind), + kindToTypeString(parentData.kind), ); return BREAK; } const fieldName = node.name.value; fieldPath = `${parentTypeName}.${fieldName}`; lastFieldName = fieldName; - const fieldContainer = parentContainer.fields.get(fieldName); + const fieldContainer = parentData.fieldDataByFieldName.get(fieldName); // undefined if the field does not exist on the parent if (!fieldContainer) { errorMessage = undefinedFieldInFieldSetErrorMessage(fieldSet, parentTypeName, fieldName); @@ -603,8 +314,8 @@ function validateNonRepeatableFieldSet( } // The child could itself be a parent and could exist as an object extension const childContainer = - factory.parentContainerByTypeName.get(namedTypeName) || - factory.extensionContainerByTypeName.get(namedTypeName); + factory.parentDefinitionDataByTypeName.get(namedTypeName) || + factory.parentExtensionDataByTypeName.get(namedTypeName); if (!childContainer) { // Should not be possible to receive this error errorMessage = unknownTypeInFieldSetErrorMessage(fieldSet, fieldPath, namedTypeName); @@ -617,15 +328,15 @@ function validateNonRepeatableFieldSet( childContainer.kind === Kind.UNION_TYPE_DEFINITION ) { shouldDefineSelectionSet = true; - parentContainers.push(childContainer); + parentDatas.push(childContainer); return; } }, }, InlineFragment: { enter(node) { - const parentContainer = parentContainers[currentDepth]; - const parentTypeName = parentContainer.name.value; + const parentData = parentDatas[currentDepth]; + const parentTypeName = parentData.typeName; if (!node.typeCondition) { errorMessage = inlineFragmentWithoutTypeConditionErrorMessage(fieldSet, fieldPath); return BREAK; @@ -633,17 +344,17 @@ function validateNonRepeatableFieldSet( const typeConditionName = node.typeCondition.name.value; // It's possible to infinitely define fragments if (typeConditionName === parentTypeName) { - parentContainers.push(parentContainer); + parentDatas.push(parentData); shouldDefineSelectionSet = true; return; } - if (!isKindAbstract(parentContainer.kind)) { + if (!isKindAbstract(parentData.kind)) { errorMessage = invalidInlineFragmentTypeErrorMessage(fieldSet, fieldPath, typeConditionName, parentTypeName); return BREAK; } const fragmentTypeContainer = - factory.parentContainerByTypeName.get(typeConditionName) || - factory.extensionContainerByTypeName.get(typeConditionName); + factory.parentDefinitionDataByTypeName.get(typeConditionName) || + factory.parentExtensionDataByTypeName.get(typeConditionName); if (!fragmentTypeContainer) { errorMessage = unknownInlineFragmentTypeConditionErrorMessage(fieldSet, fieldPath, typeConditionName); return BREAK; @@ -668,35 +379,35 @@ function validateNonRepeatableFieldSet( fieldSet, fieldPath, typeConditionName, - kindToTypeString(parentContainer.kind), + kindToTypeString(parentData.kind), parentTypeName, ); return BREAK; } shouldDefineSelectionSet = true; - parentContainers.push(fragmentTypeContainer); + parentDatas.push(fragmentTypeContainer); }, leave() { - parentContainers.pop(); + parentDatas.pop(); }, }, SelectionSet: { enter() { if (!shouldDefineSelectionSet) { - const parentContainer = parentContainers[currentDepth]; + const parentContainer = parentDatas[currentDepth]; if (parentContainer.kind === Kind.UNION_TYPE_DEFINITION) { // Should never happen errorMessage = unparsableFieldSetSelectionErrorMessage(fieldSet, lastFieldName); return BREAK; } - const fieldContainer = parentContainer.fields.get(lastFieldName); + const fieldContainer = parentContainer.fieldDataByFieldName.get(lastFieldName); if (!fieldContainer) { errorMessage = undefinedFieldInFieldSetErrorMessage(fieldSet, fieldPath, lastFieldName); return BREAK; } const fieldNamedTypeName = getNamedTypeForChild(fieldPath, fieldContainer.node.type); // If the child is not found, it's a base scalar. Undefined types would have already been handled. - const childContainer = factory.parentContainerByTypeName.get(fieldNamedTypeName); + const childContainer = factory.parentDefinitionDataByTypeName.get(fieldNamedTypeName); const childKind = childContainer ? childContainer.kind : Kind.SCALAR_TYPE_DEFINITION; errorMessage = invalidSelectionSetDefinitionErrorMessage( fieldSet, @@ -708,7 +419,7 @@ function validateNonRepeatableFieldSet( } currentDepth += 1; shouldDefineSelectionSet = false; - if (currentDepth < 0 || currentDepth >= parentContainers.length) { + if (currentDepth < 0 || currentDepth >= parentDatas.length) { errorMessage = unparsableFieldSetSelectionErrorMessage(fieldSet, lastFieldName); return BREAK; } @@ -716,18 +427,18 @@ function validateNonRepeatableFieldSet( }, leave() { if (shouldDefineSelectionSet) { - const parentContainer = parentContainers[currentDepth + 1]; + const parentContainer = parentDatas[currentDepth + 1]; errorMessage = invalidSelectionSetErrorMessage( fieldSet, fieldPath, - parentContainer.name.value, + parentContainer.typeName, kindToTypeString(parentContainer.kind), ); shouldDefineSelectionSet = false; } // Empty selection sets would be a parse error, so it is unnecessary to handle them currentDepth -= 1; - parentContainers.pop(); + parentDatas.pop(); definedFields.pop(); }, }, @@ -740,15 +451,14 @@ function validateNonRepeatableFieldSet( function validateKeyFieldSets( factory: NormalizationFactory, - entityContainer: ObjectLikeContainer, + entityParentData: ParentWithFieldsData, fieldSets: Set, - fieldNames: Set, disableEntityResolver?: boolean, ): RequiredFieldConfiguration[] | undefined { - const entityTypeName = entityContainer.name.value; + const entityTypeName = entityParentData.typeName; const errorMessages: string[] = []; const configurations: RequiredFieldConfiguration[] = []; - const keyFieldNames = new Set(); + // const keyFieldNames = new Set(); for (const fieldSet of fieldSets) { // Create a new selection set so that the value can be parsed as a new DocumentNode const { error, documentNode } = safeParse('{' + fieldSet + '}'); @@ -756,7 +466,7 @@ function validateKeyFieldSets( errorMessages.push(unparsableFieldSetErrorMessage(fieldSet, error)); continue; } - const parentContainers: ObjectLikeContainer[] = [entityContainer]; + const parentWithFieldsDatas: ParentWithFieldsData[] = [entityParentData]; const definedFields: Set[] = []; let currentDepth = -1; let shouldDefineSelectionSet = true; @@ -769,7 +479,7 @@ function validateKeyFieldSets( errorMessages.push( unexpectedArgumentErrorMessage( fieldSet, - `${parentContainers[currentDepth].name.value}.${lastFieldName}`, + `${parentWithFieldsDatas[currentDepth].typeName}.${lastFieldName}`, node.name.value, ), ); @@ -778,17 +488,17 @@ function validateKeyFieldSets( }, Field: { enter(node) { - const grandparentContainer = parentContainers[currentDepth - 1]; - const parentContainer = parentContainers[currentDepth]; - const parentTypeName = parentContainer.name.value; + const grandparentContainer = parentWithFieldsDatas[currentDepth - 1]; + const parentData = parentWithFieldsDatas[currentDepth]; + const parentTypeName = parentData.typeName; // If an object-like was just visited, a selection set should have been entered if (shouldDefineSelectionSet) { errorMessages.push( invalidSelectionSetErrorMessage( fieldSet, - `${grandparentContainer.name.value}.${lastFieldName}`, + `${grandparentContainer.typeName}.${lastFieldName}`, parentTypeName, - kindToTypeString(parentContainer.kind), + kindToTypeString(parentData.kind), ), ); return BREAK; @@ -796,13 +506,13 @@ function validateKeyFieldSets( const fieldName = node.name.value; const fieldPath = `${parentTypeName}.${fieldName}`; lastFieldName = fieldName; - const fieldContainer = parentContainer.fields.get(fieldName); + const fieldData = parentData.fieldDataByFieldName.get(fieldName); // undefined if the field does not exist on the parent - if (!fieldContainer) { + if (!fieldData) { errorMessages.push(undefinedFieldInFieldSetErrorMessage(fieldSet, parentTypeName, fieldName)); return BREAK; } - if (fieldContainer.arguments.size) { + if (fieldData.argumentDataByArgumentName.size) { errorMessages.push(argumentsInKeyFieldSetErrorMessage(fieldSet, fieldPath)); return BREAK; } @@ -811,24 +521,18 @@ function validateKeyFieldSets( return BREAK; } definedFields[currentDepth].add(fieldName); - // Depth 0 is the original parent type - // If a field is external, but it's part of a key FieldSet, it will be included in the root configuration - if (currentDepth === 0) { - keyFieldNames.add(fieldName); - fieldNames.add(fieldName); - } getValueOrDefault(factory.keyFieldNamesByParentTypeName, parentTypeName, () => new Set()).add( fieldName, ); - const namedTypeName = getNamedTypeForChild(fieldPath, fieldContainer.node.type); + const namedTypeName = getNamedTypeForChild(fieldPath, fieldData.node.type); // The base scalars are not in the parents map if (BASE_SCALARS.has(namedTypeName)) { return; } // The child could itself be a parent and could exist as an object extension const childContainer = - factory.parentContainerByTypeName.get(namedTypeName) || - factory.extensionContainerByTypeName.get(namedTypeName); + factory.parentDefinitionDataByTypeName.get(namedTypeName) || + factory.parentExtensionDataByTypeName.get(namedTypeName); if (!childContainer) { // Should not be possible to receive this error errorMessages.push(unknownTypeInFieldSetErrorMessage(fieldSet, fieldPath, namedTypeName)); @@ -839,7 +543,7 @@ function validateKeyFieldSets( childContainer.kind === Kind.OBJECT_TYPE_EXTENSION ) { shouldDefineSelectionSet = true; - parentContainers.push(childContainer); + parentWithFieldsDatas.push(childContainer); return; } // interfaces and unions are invalid in a key directive @@ -865,18 +569,18 @@ function validateKeyFieldSets( SelectionSet: { enter() { if (!shouldDefineSelectionSet) { - const parentContainer = parentContainers[currentDepth]; - const parentTypeName = parentContainer.name.value; + const parentData = parentWithFieldsDatas[currentDepth]; + const parentTypeName = parentData.typeName; const fieldPath = `${parentTypeName}.${lastFieldName}`; // If the last field is not an object-like - const fieldContainer = parentContainer.fields.get(lastFieldName); + const fieldContainer = parentData.fieldDataByFieldName.get(lastFieldName); if (!fieldContainer) { errorMessages.push(undefinedFieldInFieldSetErrorMessage(fieldSet, fieldPath, lastFieldName)); return BREAK; } const fieldNamedTypeName = getNamedTypeForChild(fieldPath, fieldContainer.node.type); // If the child is not found, it's a base scalar. Undefined types would have already been handled. - const childContainer = factory.parentContainerByTypeName.get(fieldNamedTypeName); + const childContainer = factory.parentDefinitionDataByTypeName.get(fieldNamedTypeName); const childKind = childContainer ? childContainer.kind : Kind.SCALAR_TYPE_DEFINITION; errorMessages.push( invalidSelectionSetDefinitionErrorMessage( @@ -890,7 +594,7 @@ function validateKeyFieldSets( } currentDepth += 1; shouldDefineSelectionSet = false; - if (currentDepth < 0 || currentDepth >= parentContainers.length) { + if (currentDepth < 0 || currentDepth >= parentWithFieldsDatas.length) { errorMessages.push(unparsableFieldSetSelectionErrorMessage(fieldSet, lastFieldName)); return BREAK; } @@ -898,23 +602,23 @@ function validateKeyFieldSets( }, leave() { if (shouldDefineSelectionSet) { - const grandparentContainer = parentContainers[currentDepth]; - const grandparentTypeName = grandparentContainer.name.value; - const parentContainer = parentContainers[currentDepth + 1]; + const grandparentContainer = parentWithFieldsDatas[currentDepth]; + const grandparentTypeName = grandparentContainer.typeName; + const parentData = parentWithFieldsDatas[currentDepth + 1]; const fieldPath = `${grandparentTypeName}.${lastFieldName}`; errorMessages.push( invalidSelectionSetErrorMessage( fieldSet, fieldPath, - parentContainer.name.value, - kindToTypeString(parentContainer.kind), + parentData.typeName, + kindToTypeString(parentData.kind), ), ); shouldDefineSelectionSet = false; } // Empty selection sets would be a parse error, so it is unnecessary to handle them currentDepth -= 1; - parentContainers.pop(); + parentWithFieldsDatas.pop(); definedFields.pop(); }, }, @@ -943,28 +647,28 @@ enum FieldSetDirective { type FieldSetParentResult = { errorString?: string; - fieldSetParentContainer?: ObjectLikeContainer; + fieldSetParentContainer?: ParentWithFieldsData; }; function getFieldSetParent( factory: NormalizationFactory, fieldSetDirective: FieldSetDirective, - parentContainer: ObjectLikeContainer, + parentContainer: ParentWithFieldsData, fieldName: string, parentTypeName: string, ): FieldSetParentResult { if (fieldSetDirective !== FieldSetDirective.PROVIDES) { return factory.entityContainerByTypeName.has(parentTypeName) ? { fieldSetParentContainer: parentContainer } : {}; } - const fieldContainer = getOrThrowError(parentContainer.fields, fieldName, `${parentTypeName}.fields`); + const fieldContainer = getOrThrowError(parentContainer.fieldDataByFieldName, fieldName, `${parentTypeName}.fields`); const fieldNamedTypeName = getNamedTypeForChild(`${parentTypeName}.${fieldName}`, fieldContainer.node.type); if (!factory.entityContainerByTypeName.has(fieldNamedTypeName)) { return {}; } const childContainer = - factory.parentContainerByTypeName.get(fieldNamedTypeName) || - factory.extensionContainerByTypeName.get(fieldNamedTypeName); + factory.parentDefinitionDataByTypeName.get(fieldNamedTypeName) || + factory.parentExtensionDataByTypeName.get(fieldNamedTypeName); if ( !childContainer || (childContainer.kind !== Kind.OBJECT_TYPE_DEFINITION && childContainer.kind !== Kind.OBJECT_TYPE_EXTENSION) @@ -978,13 +682,13 @@ function getFieldSetParent( function validateProvidesOrRequires( factory: NormalizationFactory, - parentContainer: ObjectLikeContainer, + parentContainer: ParentWithFieldsData, fieldSetByFieldName: Map, fieldSetDirective: FieldSetDirective, ): RequiredFieldConfiguration[] | undefined { const errorMessages: string[] = []; const configurations: RequiredFieldConfiguration[] = []; - const parentTypeName = parentContainer.name.value; + const parentTypeName = parentContainer.typeName; for (const [fieldName, fieldSet] of fieldSetByFieldName) { /* It is possible to encounter a field before encountering the type definition. Consequently, at that time, it is unknown whether the named type is an entity. @@ -1033,19 +737,18 @@ function validateProvidesOrRequires( export function validateAndAddDirectivesWithFieldSetToConfigurationData( factory: NormalizationFactory, - parentContainer: ObjectLikeContainer, + parentContainer: ParentWithFieldsData, fieldSetContainer: FieldSetContainer, ) { const configurationData = getOrThrowError( factory.configurationDataMap, - parentContainer.name.value, + parentContainer.typeName, 'configurationDataMap', ); const keys = validateKeyFieldSets( factory, parentContainer, fieldSetContainer.keys, - configurationData.fieldNames, fieldSetContainer.disableEntityResolver, ); if (keys) { diff --git a/composition/src/normalization/walkers.ts b/composition/src/normalization/walkers.ts new file mode 100644 index 0000000000..80e26bf59e --- /dev/null +++ b/composition/src/normalization/walkers.ts @@ -0,0 +1,822 @@ +import { ConstDirectiveNode, DocumentNode, Kind, visit } from 'graphql'; +import { getNamedTypeForChild } from '../schema-building/type-merging'; +import { + duplicateDirectiveDefinitionError, + duplicateEnumValueDefinitionError, + duplicateFieldDefinitionError, + duplicateOperationTypeDefinitionError, + duplicateTypeDefinitionError, + duplicateValueExtensionError, + incompatibleExtensionKindsError, + invalidOperationTypeDefinitionError, + noDefinedUnionMembersError, + unexpectedKindFatalError, +} from '../errors/errors'; +import { NormalizationFactory } from './normalization-factory'; +import { + BASE_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME, + BASE_SCALARS, + V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME, +} from '../utils/constants'; +import { + AuthorizationData, + getOrThrowError, + getValueOrDefault, + kindToTypeString, + mergeAuthorizationDataByAND, + newAuthorizationData, + newFieldAuthorizationData, + setAndGetValue, + upsertEntityContainerProperties, +} from '../utils/utils'; +import { + addConcreteTypesForImplementedInterfaces, + addConcreteTypesForUnion, + isNodeExtension, + isObjectLikeNodeEntity, +} from '../ast/utils'; +import { extractFieldSetValue, newFieldSetContainer } from './utils'; +import { + ANY_SCALAR, + ENTITIES_FIELD, + ENTITY_UNION, + EXTENSIONS, + N_A, + PARENT_DEFINITION_DATA_MAP, + PARENT_EXTENSION_DATA_MAP, + PARENTS, + PROVIDES, + REQUIRES, + SCHEMA, + SERVICE_FIELD, + SERVICE_OBJECT, +} from '../utils/string-constants'; +import { + addInheritedDirectivesToFieldData, + extractArguments, + extractDirectives, + extractUniqueUnionMembers, + isTypeNameRootType, + removeInheritableDirectivesFromParentWithFieldsData, + upsertEnumDefinitionDataByNode, + upsertEnumExtensionDataByNode, + upsertEnumValueDataByNode, + upsertFieldDataByNode, + upsertInputObjectDefinitionDataByNode, + upsertInputObjectExtensionDataByNode, + upsertInputValueDataByNode, + upsertInterfaceDefinitionDataByNode, + upsertObjectDefinitionDataByNode, + upsertScalarDefinitionDataByNode, + upsertScalarExtensionDataByNode, + upsertUnionDefinitionDataByNode, + upsertUnionExtensionDataByNode, +} from '../schema-building/utils'; +import { ArgumentData } from '../schema-building/type-definition-data'; + +// Walker to collect schema definition and directive definitions +export function upsertDirectiveAndSchemaDefinitions(nf: NormalizationFactory, document: DocumentNode) { + const definedDirectives = new Set(); + visit(document, { + DirectiveDefinition: { + enter(node) { + const name = node.name.value; + if (definedDirectives.has(name)) { + nf.errors.push(duplicateDirectiveDefinitionError(name)); + return false; + } + definedDirectives.add(name); + // Normalize federation directives by replacing them with predefined definitions + if (V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME.has(name)) { + nf.isSubgraphVersionTwo = true; + return false; + } + // The V1 directives are always injected + if (BASE_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME.has(name)) { + return false; + } + nf.directiveDefinitionByDirectiveName.set(name, node); + nf.customDirectiveDefinitions.set(name, node); + return false; + }, + }, + OperationTypeDefinition: { + enter(node) { + const operationType = node.operation; + const operationPath = `${nf.parentTypeName}.${operationType}`; + const definitionNode = nf.schemaDefinition.operationTypes.get(operationType); + const newTypeName = getNamedTypeForChild(operationPath, node.type); + if (definitionNode) { + duplicateOperationTypeDefinitionError( + operationType, + newTypeName, + getNamedTypeForChild(operationPath, definitionNode.type), + ); + return false; + } + const existingOperationType = nf.operationTypeNames.get(newTypeName); + if (existingOperationType) { + nf.errors.push(invalidOperationTypeDefinitionError(existingOperationType, newTypeName, operationType)); + return false; + } + nf.operationTypeNames.set(newTypeName, operationType); + nf.schemaDefinition.operationTypes.set(operationType, node); + return false; + }, + }, + SchemaDefinition: { + enter(node) { + extractDirectives( + node, + nf.schemaDefinition.directivesByDirectiveName, + nf.errors, + nf.directiveDefinitionByDirectiveName, + nf.handledRepeatedDirectivesByHostPath, + SCHEMA, + ); + nf.schemaDefinition.description = node.description; + }, + }, + SchemaExtension: { + enter(node) { + extractDirectives( + node, + nf.schemaDefinition.directivesByDirectiveName, + nf.errors, + nf.directiveDefinitionByDirectiveName, + nf.handledRepeatedDirectivesByHostPath, + SCHEMA, + ); + }, + }, + }); +} + +export function upsertParentsAndChildren(nf: NormalizationFactory, document: DocumentNode) { + let isParentRootType = false; + visit(document, { + Directive: { + enter(node) { + const name = node.name.value; + if (V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME.has(name)) { + nf.isSubgraphVersionTwo = true; + return false; + } + if (BASE_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME.has(name)) { + return false; + } + nf.referencedDirectiveNames.add(name); + }, + }, + EnumTypeDefinition: { + enter(node) { + nf.parentTypeName = node.name.value; + if (nf.parentDefinitionDataByTypeName.has(nf.parentTypeName)) { + nf.errors.push(duplicateTypeDefinitionError(kindToTypeString(node.kind), nf.parentTypeName)); + return false; + } + nf.lastParentNodeKind = node.kind; + const directivesByDirectiveName = nf.extractDirectivesAndAuthorization( + node, + new Map(), + ); + upsertEnumDefinitionDataByNode(nf.parentDefinitionDataByTypeName, node, directivesByDirectiveName); + }, + leave() { + nf.parentTypeName = ''; + nf.lastParentNodeKind = Kind.NULL; + }, + }, + EnumTypeExtension: { + enter(node) { + nf.parentTypeName = node.name.value; + nf.lastParentNodeKind = node.kind; + nf.isCurrentParentExtension = true; + const extension = nf.parentExtensionDataByTypeName.get(nf.parentTypeName); + if (extension) { + if (extension.kind !== Kind.ENUM_TYPE_EXTENSION) { + nf.errors.push(incompatibleExtensionKindsError(node, extension.kind)); + return false; + } + nf.extractDirectivesAndAuthorization(node, extension.directivesByDirectiveName); + return; + } + const directivesByDirectiveName = nf.extractDirectivesAndAuthorization( + node, + new Map(), + ); + upsertEnumExtensionDataByNode(nf.parentExtensionDataByTypeName, node, directivesByDirectiveName); + }, + leave() { + nf.parentTypeName = ''; + nf.lastParentNodeKind = Kind.NULL; + nf.isCurrentParentExtension = false; + }, + }, + EnumValueDefinition: { + enter(node) { + nf.childName = node.name.value; + nf.lastChildNodeKind = node.kind; + const parent = nf.isCurrentParentExtension + ? getOrThrowError(nf.parentExtensionDataByTypeName, nf.parentTypeName, EXTENSIONS) + : getOrThrowError(nf.parentDefinitionDataByTypeName, nf.parentTypeName, PARENTS); + if (parent.kind !== Kind.ENUM_TYPE_DEFINITION && parent.kind !== Kind.ENUM_TYPE_EXTENSION) { + throw unexpectedKindFatalError(nf.childName); + } + if (parent.enumValueDataByValueName.has(nf.childName)) { + const error = nf.isCurrentParentExtension + ? duplicateValueExtensionError('enum', nf.parentTypeName, nf.childName) + : duplicateEnumValueDefinitionError(nf.childName, nf.parentTypeName); + nf.errors.push(error); + return; + } + upsertEnumValueDataByNode( + parent.enumValueDataByValueName, + node, + nf.errors, + nf.directiveDefinitionByDirectiveName, + nf.handledRepeatedDirectivesByHostPath, + nf.parentTypeName, + ); + }, + leave() { + nf.childName = ''; + nf.lastChildNodeKind = Kind.NULL; + }, + }, + FieldDefinition: { + enter(node) { + nf.childName = node.name.value; + if (isParentRootType) { + nf.extractEventDirectivesToConfiguration(node); + if (nf.childName === SERVICE_FIELD || nf.childName === ENTITIES_FIELD) { + return false; + } + } + nf.lastChildNodeKind = node.kind; + const fieldPath = `${nf.parentTypeName}.${nf.childName}`; + nf.lastChildNodeKind = node.kind; + const fieldNamedTypeName = getNamedTypeForChild(fieldPath, node.type); + if (!BASE_SCALARS.has(fieldNamedTypeName)) { + nf.referencedTypeNames.add(fieldNamedTypeName); + } + const parentData = nf.isCurrentParentExtension + ? getOrThrowError(nf.parentExtensionDataByTypeName, nf.parentTypeName, EXTENSIONS) + : getOrThrowError(nf.parentDefinitionDataByTypeName, nf.parentTypeName, PARENTS); + if ( + parentData.kind !== Kind.OBJECT_TYPE_DEFINITION && + parentData.kind !== Kind.OBJECT_TYPE_EXTENSION && + parentData.kind !== Kind.INTERFACE_TYPE_DEFINITION && + parentData.kind !== Kind.INTERFACE_TYPE_EXTENSION + ) { + throw unexpectedKindFatalError(nf.parentTypeName); + } + if (parentData.fieldDataByFieldName.has(nf.childName)) { + nf.errors.push(duplicateFieldDefinitionError(nf.childName, nf.parentTypeName)); + return; + } + const argumentDataByArgumentName = extractArguments( + new Map(), + node, + nf.errors, + nf.directiveDefinitionByDirectiveName, + nf.handledRepeatedDirectivesByHostPath, + nf.parentsWithChildArguments, + nf.parentTypeName, + nf.subgraphName || N_A, + ); + const directivesByDirectiveName = nf.extractDirectivesAndAuthorization( + node, + addInheritedDirectivesToFieldData( + parentData.directivesByDirectiveName, + new Map(), + ), + ); + const fieldData = upsertFieldDataByNode( + parentData.fieldDataByFieldName, + node, + nf.errors, + argumentDataByArgumentName, + directivesByDirectiveName, + nf.parentTypeName, + nf.subgraphName || N_A, + nf.isSubgraphVersionTwo, + ); + const entityContainer = nf.entityContainerByTypeName.get(nf.parentTypeName); + if (entityContainer) { + entityContainer.fieldNames.add(nf.childName); + // Only entities will have an existing FieldSet + const existingFieldSet = nf.fieldSetContainerByTypeName.get(nf.parentTypeName); + if (existingFieldSet) { + // @requires should only be defined on a field whose parent is an entity + // If there is existingFieldSet, it's an entity + extractFieldSetValue( + nf.childName, + existingFieldSet.requires, + fieldData.directivesByDirectiveName.get(REQUIRES), + ); + // @provides only makes sense on entities, but the field can be encountered before the type definition + // When the FieldSet is evaluated, it will be checked whether the field is an entity. + extractFieldSetValue( + nf.childName, + existingFieldSet.provides, + fieldData.directivesByDirectiveName.get(PROVIDES), + ); + return; + } + } + const providesDirectives = fieldData.directivesByDirectiveName.get(PROVIDES); + // Check whether the directive exists to avoid creating unnecessary fieldSet configurations + if (!providesDirectives) { + return; + } + const fieldSetContainer = getValueOrDefault( + nf.fieldSetContainerByTypeName, + nf.parentTypeName, + newFieldSetContainer, + ); + // @provides only makes sense on entities, but the field can be encountered before the type definition + // When the FieldSet is evaluated, it will be checked whether the field is an entity. + extractFieldSetValue(nf.childName, fieldSetContainer.provides, providesDirectives); + }, + leave() { + nf.childName = ''; + nf.lastChildNodeKind = Kind.NULL; + }, + }, + InputObjectTypeDefinition: { + enter(node) { + nf.parentTypeName = node.name.value; + if (nf.parentDefinitionDataByTypeName.has(nf.parentTypeName)) { + nf.errors.push(duplicateTypeDefinitionError(kindToTypeString(node.kind), nf.parentTypeName)); + return false; + } + nf.lastParentNodeKind = node.kind; + upsertInputObjectDefinitionDataByNode( + nf.parentDefinitionDataByTypeName, + node, + nf.errors, + nf.directiveDefinitionByDirectiveName, + nf.handledRepeatedDirectivesByHostPath, + ); + }, + leave() { + nf.lastParentNodeKind = Kind.NULL; + nf.parentTypeName = ''; + }, + }, + InputObjectTypeExtension: { + enter(node) { + nf.parentTypeName = node.name.value; + nf.lastParentNodeKind = node.kind; + nf.isCurrentParentExtension = true; + const extension = nf.parentExtensionDataByTypeName.get(nf.parentTypeName); + if (extension) { + if (extension.kind !== Kind.INPUT_OBJECT_TYPE_EXTENSION) { + nf.errors.push(incompatibleExtensionKindsError(node, extension.kind)); + return false; + } + extractDirectives( + node, + extension.directivesByDirectiveName, + nf.errors, + nf.directiveDefinitionByDirectiveName, + nf.handledRepeatedDirectivesByHostPath, + nf.parentTypeName, + ); + return; + } + upsertInputObjectExtensionDataByNode( + nf.parentExtensionDataByTypeName, + node, + nf.errors, + nf.directiveDefinitionByDirectiveName, + nf.handledRepeatedDirectivesByHostPath, + ); + }, + leave() { + nf.parentTypeName = ''; + nf.lastParentNodeKind = Kind.NULL; + nf.isCurrentParentExtension = false; + }, + }, + InputValueDefinition: { + enter(node) { + const name = node.name.value; + // If the parent is not an object type definition/extension, this node is an argument + if ( + nf.lastParentNodeKind !== Kind.INPUT_OBJECT_TYPE_DEFINITION && + nf.lastParentNodeKind !== Kind.INPUT_OBJECT_TYPE_EXTENSION + ) { + nf.argumentName = name; + return; + } + nf.childName = name; + nf.lastChildNodeKind = node.kind; + const valueRootTypeName = getNamedTypeForChild(`${nf.parentTypeName}.${name}`, node.type); + if (!BASE_SCALARS.has(valueRootTypeName)) { + nf.referencedTypeNames.add(valueRootTypeName); + } + const parent = nf.isCurrentParentExtension + ? getOrThrowError(nf.parentExtensionDataByTypeName, nf.parentTypeName, EXTENSIONS) + : getOrThrowError(nf.parentDefinitionDataByTypeName, nf.parentTypeName, PARENTS); + if (parent.kind !== Kind.INPUT_OBJECT_TYPE_DEFINITION && parent.kind !== Kind.INPUT_OBJECT_TYPE_EXTENSION) { + throw unexpectedKindFatalError(nf.parentTypeName); + } + if (parent.inputValueDataByValueName.has(name)) { + nf.errors.push(duplicateValueExtensionError('input', nf.parentTypeName, name)); + return; + } + upsertInputValueDataByNode( + parent.inputValueDataByValueName, + node, + nf.errors, + nf.directiveDefinitionByDirectiveName, + nf.handledRepeatedDirectivesByHostPath, + nf.parentTypeName, + ); + }, + leave() { + nf.argumentName = ''; + // Only reset childName and lastNodeKind if this input value was NOT an argument + if (nf.lastChildNodeKind === Kind.INPUT_VALUE_DEFINITION) { + nf.childName = ''; + nf.lastChildNodeKind = Kind.NULL; + } + }, + }, + InterfaceTypeDefinition: { + enter(node) { + const typeName = node.name.value; + nf.parentTypeName = typeName; + nf.lastParentNodeKind = node.kind; + if (isNodeExtension(node)) { + return nf.handleExtensionWithFields(node); + } + if (nf.parentDefinitionDataByTypeName.has(typeName)) { + nf.errors.push(duplicateTypeDefinitionError(kindToTypeString(node.kind), typeName)); + return false; + } + const isEntity = isObjectLikeNodeEntity(node); + upsertInterfaceDefinitionDataByNode( + nf.parentDefinitionDataByTypeName, + node, + nf.errors, + nf.directiveDefinitionByDirectiveName, + nf.handledRepeatedDirectivesByHostPath, + isEntity, + nf.subgraphName || N_A, + ); + if (!isEntity) { + return; + } + nf.entityInterfaces.set(typeName, { + concreteTypeNames: new Set(), + interfaceFieldNames: new Set(node.fields?.map((field) => field.name.value)), + interfaceObjectFieldNames: new Set(), + isInterfaceObject: false, + typeName: typeName, + }); + upsertEntityContainerProperties(nf.entityContainerByTypeName, { + typeName: nf.parentTypeName, + ...(nf.subgraphName ? { subgraphNames: [nf.subgraphName] } : {}), + }); + const fieldSetContainer = getValueOrDefault(nf.fieldSetContainerByTypeName, typeName, newFieldSetContainer); + nf.extractKeyFieldSets(node, fieldSetContainer); + }, + leave() { + // @extends treats the node as an extension, so fetch the correct data + const parentData = nf.isCurrentParentExtension + ? getOrThrowError(nf.parentExtensionDataByTypeName, nf.parentTypeName, PARENT_EXTENSION_DATA_MAP) + : getOrThrowError(nf.parentDefinitionDataByTypeName, nf.parentTypeName, PARENT_DEFINITION_DATA_MAP); + removeInheritableDirectivesFromParentWithFieldsData(parentData); + nf.isCurrentParentExtension = false; + nf.parentTypeName = ''; + nf.lastParentNodeKind = Kind.NULL; + }, + }, + InterfaceTypeExtension: { + enter(node) { + nf.parentTypeName = node.name.value; + nf.lastParentNodeKind = node.kind; + return nf.handleExtensionWithFields(node); + }, + leave() { + removeInheritableDirectivesFromParentWithFieldsData( + getOrThrowError(nf.parentExtensionDataByTypeName, nf.parentTypeName, PARENT_EXTENSION_DATA_MAP), + ); + nf.isCurrentParentExtension = false; + nf.parentTypeName = ''; + nf.lastParentNodeKind = Kind.NULL; + }, + }, + ObjectTypeDefinition: { + enter(node) { + const typeName = node.name.value; + if (typeName === SERVICE_OBJECT) { + return false; + } + isParentRootType = isTypeNameRootType(typeName, nf.operationTypeNames); + nf.parentTypeName = typeName; + nf.lastParentNodeKind = node.kind; + addConcreteTypesForImplementedInterfaces(node, nf.abstractToConcreteTypeNames); + nf.handleInterfaceObject(node); + // handling for @extends directive + if (isNodeExtension(node)) { + return nf.handleExtensionWithFields(node); + } + if (nf.parentDefinitionDataByTypeName.has(typeName)) { + nf.errors.push(duplicateTypeDefinitionError(kindToTypeString(node.kind), typeName)); + return false; + } + const isEntity = isObjectLikeNodeEntity(node); + upsertObjectDefinitionDataByNode( + nf.parentDefinitionDataByTypeName, + node, + nf.errors, + nf.directiveDefinitionByDirectiveName, + nf.handledRepeatedDirectivesByHostPath, + isEntity, + isParentRootType, + nf.subgraphName || 'N/A', + ); + if (!isEntity) { + return; + } + const fieldSetContainer = getValueOrDefault(nf.fieldSetContainerByTypeName, typeName, newFieldSetContainer); + nf.extractKeyFieldSets(node, fieldSetContainer); + upsertEntityContainerProperties(nf.entityContainerByTypeName, { + typeName: nf.parentTypeName, + keyFieldSets: fieldSetContainer.keys, + ...(nf.subgraphName ? { subgraphNames: [nf.subgraphName] } : {}), + }); + }, + leave() { + // @extends treats the node as an extension, so fetch the correct data + const parentData = nf.isCurrentParentExtension + ? getOrThrowError(nf.parentExtensionDataByTypeName, nf.parentTypeName, PARENT_EXTENSION_DATA_MAP) + : getOrThrowError(nf.parentDefinitionDataByTypeName, nf.parentTypeName, PARENT_DEFINITION_DATA_MAP); + removeInheritableDirectivesFromParentWithFieldsData(parentData); + isParentRootType = false; + nf.isCurrentParentExtension = false; + nf.parentTypeName = ''; + nf.lastParentNodeKind = Kind.NULL; + }, + }, + ObjectTypeExtension: { + enter(node) { + nf.parentTypeName = node.name.value; + if (nf.parentTypeName === SERVICE_OBJECT) { + return false; + } + isParentRootType = isTypeNameRootType(nf.parentTypeName, nf.operationTypeNames); + nf.lastParentNodeKind = node.kind; + addConcreteTypesForImplementedInterfaces(node, nf.abstractToConcreteTypeNames); + return nf.handleExtensionWithFields(node); + }, + leave() { + removeInheritableDirectivesFromParentWithFieldsData( + getOrThrowError(nf.parentExtensionDataByTypeName, nf.parentTypeName, PARENT_EXTENSION_DATA_MAP), + ); + isParentRootType = false; + nf.isCurrentParentExtension = false; + nf.parentTypeName = ''; + nf.lastParentNodeKind = Kind.NULL; + }, + }, + ScalarTypeDefinition: { + enter(node) { + const name = node.name.value; + if (name === ANY_SCALAR) { + return false; + } + const parent = nf.parentDefinitionDataByTypeName.get(name); + if (parent) { + nf.errors.push(duplicateTypeDefinitionError(kindToTypeString(node.kind), name)); + return false; + } + nf.parentTypeName = name; + nf.lastParentNodeKind = node.kind; + const directivesByDirectiveName = nf.extractDirectivesAndAuthorization( + node, + new Map(), + ); + upsertScalarDefinitionDataByNode(nf.parentDefinitionDataByTypeName, node, directivesByDirectiveName); + }, + leave() { + nf.parentTypeName = ''; + nf.lastParentNodeKind = Kind.NULL; + }, + }, + ScalarTypeExtension: { + enter(node) { + nf.parentTypeName = node.name.value; + if (nf.parentTypeName === ANY_SCALAR) { + return false; + } + nf.lastParentNodeKind = node.kind; + const extension = nf.parentExtensionDataByTypeName.get(nf.parentTypeName); + if (extension) { + if (extension.kind !== Kind.SCALAR_TYPE_EXTENSION) { + nf.errors.push(incompatibleExtensionKindsError(node, extension.kind)); + return false; + } + nf.extractDirectivesAndAuthorization(node, extension.directivesByDirectiveName); + return false; + } + const directivesByDirectiveName = nf.extractDirectivesAndAuthorization( + node, + new Map(), + ); + upsertScalarExtensionDataByNode(nf.parentExtensionDataByTypeName, node, directivesByDirectiveName); + return false; + }, + leave() { + nf.parentTypeName = ''; + nf.lastParentNodeKind = Kind.NULL; + }, + }, + UnionTypeDefinition: { + enter(node) { + nf.parentTypeName = node.name.value; + if (nf.parentTypeName === ENTITY_UNION) { + return false; + } + const parent = nf.parentDefinitionDataByTypeName.get(nf.parentTypeName); + if (parent) { + nf.errors.push(duplicateTypeDefinitionError(kindToTypeString(node.kind), nf.parentTypeName)); + return false; + } + + nf.lastParentNodeKind = node.kind; + upsertUnionDefinitionDataByNode( + nf.parentDefinitionDataByTypeName, + node, + nf.errors, + nf.directiveDefinitionByDirectiveName, + nf.handledRepeatedDirectivesByHostPath, + nf.abstractToConcreteTypeNames, + nf.referencedTypeNames, + ); + }, + leave() { + nf.parentTypeName = ''; + nf.lastParentNodeKind = Kind.NULL; + }, + }, + UnionTypeExtension: { + enter(node) { + nf.parentTypeName = node.name.value; + if (nf.parentTypeName === ENTITY_UNION) { + return false; + } + const extension = nf.parentExtensionDataByTypeName.get(nf.parentTypeName); + if (!node.types?.length) { + nf.errors.push(noDefinedUnionMembersError(nf.parentTypeName, true)); + return false; + } + nf.lastParentNodeKind = node.kind; + addConcreteTypesForUnion(node, nf.abstractToConcreteTypeNames); + if (extension) { + if (extension.kind !== Kind.UNION_TYPE_EXTENSION) { + nf.errors.push(incompatibleExtensionKindsError(node, extension.kind)); + return false; + } + extractDirectives( + node, + extension.directivesByDirectiveName, + nf.errors, + nf.directiveDefinitionByDirectiveName, + nf.handledRepeatedDirectivesByHostPath, + nf.parentTypeName, + ); + extractUniqueUnionMembers( + node.types, + extension.memberByMemberTypeName, + nf.errors, + nf.parentTypeName, + nf.abstractToConcreteTypeNames, + nf.referencedTypeNames, + ); + return false; + } + upsertUnionExtensionDataByNode( + nf.parentExtensionDataByTypeName, + node, + nf.errors, + nf.directiveDefinitionByDirectiveName, + nf.handledRepeatedDirectivesByHostPath, + nf.abstractToConcreteTypeNames, + nf.referencedTypeNames, + ); + return false; + }, + leave() { + nf.parentTypeName = ''; + nf.lastParentNodeKind = Kind.NULL; + }, + }, + }); +} + +// Walker to handle the consolidation of the @authenticated and @requiresScopes directives +export function consolidateAuthorizationDirectives(nf: NormalizationFactory, definitions: DocumentNode) { + let parentAuthorizationData: AuthorizationData | undefined; + let isInterfaceKind = false; + visit(definitions, { + FieldDefinition: { + enter(node) { + nf.childName = node.name.value; + const typeName = getNamedTypeForChild(`${nf.parentTypeName}.${nf.childName}`, node.type); + const inheritsAuthorization = nf.leafTypeNamesWithAuthorizationDirectives.has(typeName); + if ( + (!parentAuthorizationData || !parentAuthorizationData.hasParentLevelAuthorization) && + !inheritsAuthorization + ) { + return false; + } + if (!parentAuthorizationData) { + parentAuthorizationData = setAndGetValue( + nf.authorizationDataByParentTypeName, + nf.parentTypeName, + newAuthorizationData(nf.parentTypeName), + ); + } + const fieldAuthorizationData = getValueOrDefault( + parentAuthorizationData.fieldAuthorizationDataByFieldName, + nf.childName, + () => newFieldAuthorizationData(nf.childName), + ); + if (!mergeAuthorizationDataByAND(parentAuthorizationData, fieldAuthorizationData)) { + nf.invalidOrScopesHostPaths.add(`${nf.parentTypeName}.${nf.childName}`); + return false; + } + if (!inheritsAuthorization) { + return false; + } + if (isInterfaceKind) { + /* Collect the inherited leaf authorization to apply later. This is to avoid duplication of inherited + authorization applied to interface and concrete types. */ + getValueOrDefault(nf.heirFieldAuthorizationDataByTypeName, typeName, () => []).push(fieldAuthorizationData); + return false; + } + const definitionAuthorizationData = nf.authorizationDataByParentTypeName.get(typeName); + if ( + definitionAuthorizationData && + definitionAuthorizationData.hasParentLevelAuthorization && + !mergeAuthorizationDataByAND(definitionAuthorizationData, fieldAuthorizationData) + ) { + nf.invalidOrScopesHostPaths.add(`${nf.parentTypeName}.${nf.childName}`); + } + return false; + }, + leave() { + nf.childName = ''; + }, + }, + InterfaceTypeDefinition: { + enter(node) { + nf.parentTypeName = node.name.value; + parentAuthorizationData = nf.getAuthorizationData(node); + isInterfaceKind = true; + }, + leave() { + nf.parentTypeName = ''; + parentAuthorizationData = undefined; + isInterfaceKind = false; + }, + }, + InterfaceTypeExtension: { + enter(node) { + nf.parentTypeName = node.name.value; + parentAuthorizationData = nf.getAuthorizationData(node); + isInterfaceKind = true; + }, + leave() { + nf.parentTypeName = ''; + parentAuthorizationData = undefined; + isInterfaceKind = false; + }, + }, + ObjectTypeDefinition: { + enter(node) { + nf.parentTypeName = node.name.value; + parentAuthorizationData = nf.getAuthorizationData(node); + }, + leave() { + nf.parentTypeName = ''; + parentAuthorizationData = undefined; + }, + }, + ObjectTypeExtension: { + enter(node) { + nf.parentTypeName = node.name.value; + parentAuthorizationData = nf.getAuthorizationData(node); + }, + leave() { + nf.parentTypeName = ''; + parentAuthorizationData = undefined; + }, + }, + }); +} diff --git a/composition/src/schema-building/ast.ts b/composition/src/schema-building/ast.ts new file mode 100644 index 0000000000..ba140b3421 --- /dev/null +++ b/composition/src/schema-building/ast.ts @@ -0,0 +1,293 @@ +import { + ConstDirectiveNode, + ConstValueNode, + EnumTypeDefinitionNode, + EnumValueDefinitionNode, + FieldDefinitionNode, + InputObjectTypeDefinitionNode, + InputValueDefinitionNode, + InterfaceTypeDefinitionNode, + Kind, + NamedTypeNode, + NameNode, + ObjectTypeDefinitionNode, + ObjectTypeExtensionNode, + ScalarTypeDefinitionNode, + StringValueNode, + TypeNode, + UnionTypeDefinitionNode, +} from 'graphql'; +import { formatDescription } from '../ast/utils'; +import { federationUnexpectedNodeKindError, unexpectedTypeNodeKindFatalError } from '../errors/errors'; +import { MAXIMUM_TYPE_NESTING } from '../utils/constants'; + +export type MutableEnumNode = { + kind: Kind.ENUM_TYPE_DEFINITION; + name: NameNode; + description?: StringValueNode; + directives?: ConstDirectiveNode[]; + values?: MutableEnumValueNode[]; +}; + +export function getMutableEnumNode(node: EnumTypeDefinitionNode): MutableEnumNode { + return { + kind: node.kind, + name: { ...node.name }, + description: formatDescription(node.description), + values: node.values?.map((value) => getMutableEnumValueNode(value)), + }; +} + +export type MutableEnumValueNode = { + directives: ConstDirectiveNode[]; // always initialise for ease + kind: Kind.ENUM_VALUE_DEFINITION; + name: NameNode; + description?: StringValueNode; +}; + +export function getMutableEnumValueNode(node: EnumValueDefinitionNode): MutableEnumValueNode { + return { + directives: [], + kind: node.kind, + name: { ...node.name }, + description: formatDescription(node.description), + }; +} + +export type MutableFieldNode = { + arguments: MutableInputValueNode[]; // always initialise for ease + directives: ConstDirectiveNode[]; // always initialise for ease + kind: Kind.FIELD_DEFINITION; + name: NameNode; + type: MutableTypeNode; + description?: StringValueNode; +}; + +export function getMutableFieldNode(node: FieldDefinitionNode, parentTypeName: string): MutableFieldNode { + return { + arguments: [], + directives: [], + kind: node.kind, + name: { ...node.name }, + type: deepCopyTypeNode(node.type, parentTypeName, node.name.value), + // arguments: node.arguments?.map( + // argumentNode => getMutableInputValueNode(argumentNode, parentTypeName, node.name.value), + // ), + description: formatDescription(node.description), + }; +} + +export type MutableInputObjectNode = { + kind: Kind.INPUT_OBJECT_TYPE_DEFINITION; + name: NameNode; + description?: StringValueNode; + directives?: ConstDirectiveNode[]; + fields?: InputValueDefinitionNode[]; +}; + +export function getMutableInputObjectNode(node: InputObjectTypeDefinitionNode): MutableInputObjectNode { + return { + kind: node.kind, + name: { ...node.name }, + description: formatDescription(node.description), + }; +} + +export type MutableInputValueNode = { + directives: ConstDirectiveNode[]; // always initialise for ease + kind: Kind.INPUT_VALUE_DEFINITION; + name: NameNode; + type: MutableTypeNode; + defaultValue?: ConstValueNode; + description?: StringValueNode; +}; + +export function getMutableInputValueNode( + node: InputValueDefinitionNode, + parentTypeName: string, + fieldName: string, +): MutableInputValueNode { + return { + directives: [], + kind: node.kind, + name: { ...node.name }, + type: deepCopyTypeNode(node.type, parentTypeName, fieldName), + defaultValue: node.defaultValue, + description: formatDescription(node.description), + }; +} + +export type MutableInterfaceNode = { + kind: Kind.INTERFACE_TYPE_DEFINITION; + name: NameNode; + description?: StringValueNode; + directives?: ConstDirectiveNode[]; + fields?: FieldDefinitionNode[]; + interfaces?: NamedTypeNode[]; +}; + +export function getMutableInterfaceNode(node: InterfaceTypeDefinitionNode): MutableInterfaceNode { + return { + kind: node.kind, + name: { ...node.name }, + description: formatDescription(node.description), + }; +} + +export type MutableObjectNode = { + kind: Kind.OBJECT_TYPE_DEFINITION; + name: NameNode; + description?: StringValueNode; + directives?: ConstDirectiveNode[]; + fields?: FieldDefinitionNode[]; + interfaces?: NamedTypeNode[]; +}; + +export function getMutableObjectNode(node: ObjectTypeDefinitionNode): MutableObjectNode { + return { + kind: node.kind, + name: { ...node.name }, + description: formatDescription(node.description), + }; +} + +export type MutableObjectExtensionNode = { + kind: Kind.OBJECT_TYPE_EXTENSION; + name: NameNode; + description?: StringValueNode; // @extends directive would allow for a description + directives?: ConstDirectiveNode[]; + fields?: FieldDefinitionNode[]; + interfaces?: NamedTypeNode[]; +}; + +export function getMutableObjectExtensionNode( + node: ObjectTypeDefinitionNode | ObjectTypeExtensionNode, +): MutableObjectExtensionNode { + const description = node.kind === Kind.OBJECT_TYPE_DEFINITION ? node.description : undefined; + return { + kind: Kind.OBJECT_TYPE_EXTENSION, + name: { ...node.name }, + description: formatDescription(description), + }; +} + +export type MutableScalarNode = { + kind: Kind.SCALAR_TYPE_DEFINITION; + name: NameNode; + description?: StringValueNode; + directives?: ConstDirectiveNode[]; +}; + +export function getMutableScalarNode(node: ScalarTypeDefinitionNode): MutableScalarNode { + return { + kind: node.kind, + name: { ...node.name }, + description: formatDescription(node.description), + }; +} + +// export type MutableTypeNode = { +// kind: Kind.NAMED_TYPE | Kind.LIST_TYPE | Kind.NON_NULL_TYPE; +// name?: NameNode; +// type?: MutableTypeNode; +// }; + +// This type allows the building of a MutableTypeNode +export type MutableIntermediateTypeNode = { + kind: Kind.NAMED_TYPE | Kind.LIST_TYPE | Kind.NON_NULL_TYPE; + name?: NameNode; + type?: MutableIntermediateTypeNode; +}; + +export type MutableTypeNode = MutableNamedTypeNode | MutableListTypeNode | MutableNonNullTypeNode; + +export type MutableNamedTypeNode = { + kind: Kind.NAMED_TYPE; + name: NameNode; +}; + +export type MutableListTypeNode = { + kind: Kind.LIST_TYPE; + type: MutableTypeNode; +}; + +export type MutableNonNullTypeNode = { + kind: Kind.NON_NULL_TYPE; + type: MutableNamedTypeNode | MutableListTypeNode; +}; + +// TODO errors +export function getMutableTypeNode(node: TypeNode, childPath: string): MutableTypeNode { + const deepCopy: MutableIntermediateTypeNode = { kind: node.kind }; + let lastTypeNode = deepCopy; + for (let i = 0; i < MAXIMUM_TYPE_NESTING; i++) { + switch (node.kind) { + case Kind.NAMED_TYPE: + lastTypeNode.name = { ...node.name }; + return deepCopy as MutableTypeNode; + case Kind.LIST_TYPE: + lastTypeNode.kind = node.kind; + lastTypeNode.type = { kind: node.type.kind }; + lastTypeNode = lastTypeNode.type; + node = node.type; + continue; + case Kind.NON_NULL_TYPE: + lastTypeNode.kind = node.kind; + lastTypeNode.type = { kind: node.type.kind }; + lastTypeNode = lastTypeNode.type; + node = node.type; + continue; + default: + throw unexpectedTypeNodeKindFatalError(childPath); + } + } + throw new Error( + `Field ${childPath} has more than ${MAXIMUM_TYPE_NESTING} layers of nesting, or there is a cyclical error.`, + ); +} + +export type MutableUnionNode = { + kind: Kind.UNION_TYPE_DEFINITION; + name: NameNode; + description?: StringValueNode; + directives?: ConstDirectiveNode[]; + types?: NamedTypeNode[]; +}; + +export function getMutableUnionNode(node: UnionTypeDefinitionNode): MutableUnionNode { + return { + kind: node.kind, + name: { ...node.name }, + description: formatDescription(node.description), + }; +} + +// TODO reduce arguments and refactor errors +export function deepCopyTypeNode(node: TypeNode, parentTypeName: string, fieldName: string): TypeNode { + const deepCopy: MutableIntermediateTypeNode = { kind: node.kind }; + let lastTypeNode = deepCopy; + for (let i = 0; i < MAXIMUM_TYPE_NESTING; i++) { + switch (node.kind) { + case Kind.NAMED_TYPE: + lastTypeNode.name = { ...node.name }; + return deepCopy as TypeNode; + case Kind.LIST_TYPE: + lastTypeNode.kind = node.kind; + lastTypeNode.type = { kind: node.type.kind }; + lastTypeNode = lastTypeNode.type; + node = node.type; + continue; + case Kind.NON_NULL_TYPE: + lastTypeNode.kind = node.kind; + lastTypeNode.type = { kind: node.type.kind }; + lastTypeNode = lastTypeNode.type; + node = node.type; + continue; + default: + throw federationUnexpectedNodeKindError(parentTypeName, fieldName); + } + } + throw new Error( + `Field ${parentTypeName}.${fieldName} has more than ${MAXIMUM_TYPE_NESTING} layers of nesting, or there is a cyclical error.`, + ); +} diff --git a/composition/src/schema-building/type-definition-data.ts b/composition/src/schema-building/type-definition-data.ts new file mode 100644 index 0000000000..fd0054ddf0 --- /dev/null +++ b/composition/src/schema-building/type-definition-data.ts @@ -0,0 +1,148 @@ +import { + ConstDirectiveNode, + ConstValueNode, + Kind, + NamedTypeNode, + OperationTypeDefinitionNode, + OperationTypeNode, + StringValueNode, +} from 'graphql'; +import { + MutableEnumNode, + MutableEnumValueNode, + MutableFieldNode, + MutableInputObjectNode, + MutableInputValueNode, + MutableInterfaceNode, + MutableObjectNode, + MutableScalarNode, + MutableTypeNode, + MutableUnionNode, +} from './ast'; +import { ExtensionWithFieldsData } from './type-extension-data'; + +export type ArgumentData = { + directivesByDirectiveName: Map; + name: string; + node: MutableInputValueNode; + requiredSubgraphNames: Set; + subgraphNames: Set; + type: MutableTypeNode; + defaultValue?: ConstValueNode; + description?: StringValueNode; +}; + +export type EnumDefinitionData = { + appearances: number; + directivesByDirectiveName: Map; + enumValueDataByValueName: Map; + kind: Kind.ENUM_TYPE_DEFINITION; + typeName: string; + node: MutableEnumNode; + description?: StringValueNode; +}; + +export type EnumValueData = { + appearances: number; + directivesByDirectiveName: Map; + name: string; + node: MutableEnumValueNode; + parentTypeName: string; + description?: StringValueNode; +}; + +export type FieldData = { + argumentDataByArgumentName: Map; + directivesByDirectiveName: Map; + isExternalBySubgraphName: Map; + isShareableBySubgraphName: Map; + name: string; + namedTypeName: string; + node: MutableFieldNode; + parentTypeName: string; + subgraphNames: Set; + description?: StringValueNode; +}; + +export type InputObjectDefinitionData = { + appearances: number; + directivesByDirectiveName: Map; + inputValueDataByValueName: Map; + kind: Kind.INPUT_OBJECT_TYPE_DEFINITION; + typeName: string; + node: MutableInputObjectNode; + description?: StringValueNode; +}; + +export type InputValueData = { + appearances: number; + directivesByDirectiveName: Map; + name: string; + node: MutableInputValueNode; + parentTypeName: string; + description?: StringValueNode; +}; + +export type InterfaceData = { + directivesByDirectiveName: Map; + fieldDataByFieldName: Map; + implementedInterfaceTypeNames: Set; + isEntity: boolean; + kind: Kind.INTERFACE_TYPE_DEFINITION; + typeName: string; + node: MutableInterfaceNode; + subgraphNames: Set; + description?: StringValueNode; +}; + +export type ObjectData = { + directivesByDirectiveName: Map; + fieldDataByFieldName: Map; + implementedInterfaceTypeNames: Set; + isEntity: boolean; + isRootType: boolean; + kind: Kind.OBJECT_TYPE_DEFINITION; + typeName: string; + node: MutableObjectNode; + subgraphNames: Set; + description?: StringValueNode; +}; + +export type ScalarDefinitionData = { + directivesByDirectiveName: Map; + kind: Kind.SCALAR_TYPE_DEFINITION; + typeName: string; + node: MutableScalarNode; + description?: StringValueNode; +}; + +export type SchemaData = { + directivesByDirectiveName: Map; + kind: Kind.SCHEMA_DEFINITION; + typeName: string; + operationTypes: Map; + description?: StringValueNode; +}; + +export type UnionDefinitionData = { + directivesByDirectiveName: Map; + kind: Kind.UNION_TYPE_DEFINITION; + typeName: string; + memberByMemberTypeName: Map; + node: MutableUnionNode; + description?: StringValueNode; +}; + +export type ParentDefinitionData = + | EnumDefinitionData + | InputObjectDefinitionData + | InterfaceData + | ObjectData + | ScalarDefinitionData + | UnionDefinitionData; + +export type ParentWithFieldsData = DefinitionWithFieldsData | ExtensionWithFieldsData; + +export type ChildData = EnumValueData | FieldData | InputValueData; + +export type DefinitionWithFieldsData = InterfaceData | ObjectData; diff --git a/composition/src/schema-building/type-extension-data.ts b/composition/src/schema-building/type-extension-data.ts new file mode 100644 index 0000000000..162fcf0bf5 --- /dev/null +++ b/composition/src/schema-building/type-extension-data.ts @@ -0,0 +1,59 @@ +import { ConstDirectiveNode, Kind, NamedTypeNode } from 'graphql'; +import { EnumValueData, FieldData, InputValueData } from './type-definition-data'; +import { MutableObjectExtensionNode } from './ast'; + +export type EnumExtensionData = { + directivesByDirectiveName: Map; + enumValueDataByValueName: Map; + kind: Kind.ENUM_TYPE_EXTENSION; + typeName: string; +}; + +export type ObjectExtensionData = { + directivesByDirectiveName: Map; + fieldDataByFieldName: Map; + implementedInterfaceTypeNames: Set; + isEntity: boolean; + kind: Kind.OBJECT_TYPE_EXTENSION; + node: MutableObjectExtensionNode; + typeName: string; +}; + +export type InputObjectExtensionData = { + directivesByDirectiveName: Map; + inputValueDataByValueName: Map; + kind: Kind.INPUT_OBJECT_TYPE_EXTENSION; + typeName: String; +}; + +export type InterfaceExtensionData = { + directivesByDirectiveName: Map; + fieldDataByFieldName: Map; + implementedInterfaceTypeNames: Set; + isEntity: boolean; + kind: Kind.INTERFACE_TYPE_EXTENSION; + typeName: string; +}; + +export type ScalarExtensionData = { + directivesByDirectiveName: Map; + kind: Kind.SCALAR_TYPE_EXTENSION; + typeName: string; +}; + +export type UnionExtensionData = { + directivesByDirectiveName: Map; + kind: Kind.UNION_TYPE_EXTENSION; + memberByMemberTypeName: Map; + typeName: string; +}; + +export type ParentExtensionData = + | EnumExtensionData + | InputObjectExtensionData + | InterfaceExtensionData + | ObjectExtensionData + | ScalarExtensionData + | UnionExtensionData; + +export type ExtensionWithFieldsData = InterfaceExtensionData | ObjectExtensionData; diff --git a/composition/src/type-merging/type-merging.ts b/composition/src/schema-building/type-merging.ts similarity index 87% rename from composition/src/type-merging/type-merging.ts rename to composition/src/schema-building/type-merging.ts index 409b997e90..7727a0f29d 100644 --- a/composition/src/type-merging/type-merging.ts +++ b/composition/src/schema-building/type-merging.ts @@ -1,6 +1,7 @@ import { Kind, ListTypeNode, NamedTypeNode, NonNullTypeNode, TypeNode } from 'graphql'; -import { federationUnexpectedNodeKindError, unexpectedTypeNodeKindError } from '../errors/errors'; -import { deepCopyTypeNode, maximumTypeNesting, MutableTypeNode } from '../ast/ast'; +import { federationUnexpectedNodeKindError, unexpectedTypeNodeKindFatalError } from '../errors/errors'; +import { deepCopyTypeNode, MutableIntermediateTypeNode } from './ast'; +import { MAXIMUM_TYPE_NESTING } from '../utils/constants'; enum DivergentType { NONE, @@ -24,10 +25,10 @@ function getMergedTypeNode( // The first type of the pair to diverge in restriction takes precedence in all future differences. // If the other type of the pair also diverges, it's a src error. // To keep the output link intact, it is not possible to spread assign "lastTypeNode". - const mergedTypeNode: MutableTypeNode = { kind: current.kind }; + const mergedTypeNode: MutableIntermediateTypeNode = { kind: current.kind }; let divergentType = DivergentType.NONE; - let lastTypeNode: MutableTypeNode = mergedTypeNode; - for (let i = 0; i < maximumTypeNesting; i++) { + let lastTypeNode: MutableIntermediateTypeNode = mergedTypeNode; + for (let i = 0; i < MAXIMUM_TYPE_NESTING; i++) { if (current.kind === other.kind) { switch (current.kind) { case Kind.NAMED_TYPE: @@ -90,7 +91,7 @@ function getMergedTypeNode( return { typeErrors: [current.kind, other.kind] }; } throw new Error( - `Field ${parentName}.${childName} has more than ${maximumTypeNesting} layers of nesting, or there is a cyclical error.`, + `Field ${parentName}.${childName} has more than ${MAXIMUM_TYPE_NESTING} layers of nesting, or there is a cyclical error.`, ); } @@ -125,6 +126,6 @@ export function getNamedTypeForChild(childPath: string, typeNode: TypeNode): str case Kind.NON_NULL_TYPE: return getNamedTypeForChild(childPath, typeNode.type); default: - throw unexpectedTypeNodeKindError(childPath); + throw unexpectedTypeNodeKindFatalError(childPath); } } diff --git a/composition/src/schema-building/utils.ts b/composition/src/schema-building/utils.ts new file mode 100644 index 0000000000..247ae7780e --- /dev/null +++ b/composition/src/schema-building/utils.ts @@ -0,0 +1,1087 @@ +import { + ConstDirectiveNode, + DirectiveDefinitionNode, + EnumTypeDefinitionNode, + EnumTypeExtensionNode, + EnumValueDefinitionNode, + FieldDefinitionNode, + InputObjectTypeDefinitionNode, + InputObjectTypeExtensionNode, + InputValueDefinitionNode, + InterfaceTypeDefinitionNode, + InterfaceTypeExtensionNode, + Kind, + NamedTypeNode, + ObjectTypeDefinitionNode, + ObjectTypeExtensionNode, + OperationTypeNode, + ScalarTypeDefinitionNode, + ScalarTypeExtensionNode, + SchemaDefinitionNode, + StringValueNode, + TypeNode, + UnionTypeDefinitionNode, + UnionTypeExtensionNode, +} from 'graphql'; +import { + ArgumentData, + ChildData, + DefinitionWithFieldsData, + EnumDefinitionData, + EnumValueData, + FieldData, + InputObjectDefinitionData, + InputValueData, + ParentDefinitionData, + ScalarDefinitionData, + SchemaData, + UnionDefinitionData, +} from './type-definition-data'; +import { + getMutableEnumNode, + getMutableEnumValueNode, + getMutableFieldNode, + getMutableInputObjectNode, + getMutableInputValueNode, + getMutableInterfaceNode, + getMutableObjectExtensionNode, + getMutableObjectNode, + getMutableScalarNode, + getMutableTypeNode, + getMutableUnionNode, +} from './ast'; +import { + formatDescription, + InputObjectTypeNode, + InterfaceTypeNode, + ObjectTypeNode, + SchemaNode, + setToNamedTypeNodeArray, + UnionTypeNode, +} from '../ast/utils'; +import { + duplicateArgumentsError, + duplicateDirectiveArgumentDefinitionErrorMessage, + duplicateInterfaceError, + duplicateUnionMemberError, + duplicateUnionMemberExtensionError, + invalidDirectiveError, + invalidDirectiveLocationErrorMessage, + invalidKeyDirectiveArgumentErrorMessage, + invalidRepeatedDirectiveErrorMessage, + noDefinedUnionMembersError, + undefinedDirectiveErrorMessage, + undefinedRequiredArgumentsErrorMessage, + unexpectedDirectiveArgumentErrorMessage, + unexpectedDirectiveArgumentsErrorMessage, +} from '../errors/errors'; +import { + AUTHENTICATED, + EXTERNAL, + IGNORED_PARENT_DIRECTIVES, + KEY, + REQUIRES_SCOPES, + ROOT_TYPES, + SHAREABLE, +} from '../utils/string-constants'; +import { + EnumExtensionData, + ExtensionWithFieldsData, + InputObjectExtensionData, + ObjectExtensionData, + ParentExtensionData, + ScalarExtensionData, + UnionExtensionData, +} from './type-extension-data'; +import { getNamedTypeForChild } from './type-merging'; +import { areNodeKindAndDirectiveLocationCompatible, getDirectiveDefinitionArgumentSets } from '../normalization/utils'; +import { + AuthorizationData, + generateRequiresScopesDirective, + generateSimpleDirective, + getEntriesNotInHashSet, + getValueOrDefault, + mapToArrayOfValues, +} from '../utils/utils'; +import { + BASE_SCALARS, + INHERITABLE_DIRECTIVE_NAMES, + V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME, +} from '../utils/constants'; + +type IsNodeExternalOrShareableResult = { + isExternal: boolean; + isShareable: boolean; +}; + +export function isNodeExternalOrShareable( + node: ObjectTypeNode | FieldDefinitionNode, + areAllFieldsShareable: boolean, + directivesByDirectiveName: Map, +): IsNodeExternalOrShareableResult { + const result: IsNodeExternalOrShareableResult = { + isExternal: directivesByDirectiveName.has(EXTERNAL), + isShareable: areAllFieldsShareable || directivesByDirectiveName.has(SHAREABLE), + }; + if (!node.directives?.length) { + return result; + } + for (const directiveNode of node.directives) { + const directiveName = directiveNode.name.value; + if (directiveName === EXTERNAL) { + result.isExternal = true; + continue; + } + if (directiveName === SHAREABLE) { + result.isShareable = true; + } + } + return result; +} + +export function getDefinedArgumentsForDirective( + directiveNode: ConstDirectiveNode, + argumentTypeNodeByArgumentName: Map, + requiredArguments: Set, + hostPath: string, + errorMessages: string[], +): Set { + const directiveArguments = directiveNode.arguments || []; + const directiveName = directiveNode.name.value; + const definedArguments = new Set(); + const handledDuplicateArguments = new Set(); + for (const argument of directiveArguments) { + const argumentName = argument.name.value; + // If an argument is observed more than once, it is a duplication error. + // However, the error should only propagate once. + if (definedArguments.has(argumentName)) { + if (!handledDuplicateArguments.has(argumentName)) { + handledDuplicateArguments.add(argumentName); + errorMessages.push(duplicateDirectiveArgumentDefinitionErrorMessage(directiveName, hostPath, argumentName)); + } + continue; + } + const argumentTypeNode = argumentTypeNodeByArgumentName.get(argumentName); + if (!argumentTypeNode) { + errorMessages.push(unexpectedDirectiveArgumentErrorMessage(directiveName, argumentName)); + continue; + } + // TODO validate argument values + // if (argumentTypeNode) { + // errorMessages.push(invalidDirectiveArgumentTypeErrorMessage( + // requiredArguments.has(directiveName), argumentName, argumentTypeNode, argument.value.kind), + // ); + // } + definedArguments.add(argumentName); + } + return definedArguments; +} + +export function getDirectiveValidationErrors( + directiveNode: ConstDirectiveNode, + hostKind: Kind, + directivesByDirectiveName: Map, + directiveDefinitionByDirectiveName: Map, + handledRepeatedDirectivesByHostPath: Map>, + hostPath: string, + isArgument = false, +): string[] { + const directiveName = directiveNode.name.value; + const directiveDefinition = + directiveDefinitionByDirectiveName.get(directiveName) || + V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME.get(directiveName); + const errorMessages: string[] = []; + if (!directiveDefinition) { + errorMessages.push(undefinedDirectiveErrorMessage(directiveName, hostPath)); + return errorMessages; + } + const argumentTypeNodeByArgumentName = new Map(); + const requiredArguments = new Set(); + getDirectiveDefinitionArgumentSets( + directiveDefinition.arguments || [], + argumentTypeNodeByArgumentName, + requiredArguments, + ); + if (!areNodeKindAndDirectiveLocationCompatible(hostKind, directiveDefinition, isArgument)) { + errorMessages.push( + invalidDirectiveLocationErrorMessage(hostPath, isArgument ? Kind.ARGUMENT : hostKind, directiveName), + ); + } + if (!directiveDefinition.repeatable && directivesByDirectiveName.get(directiveName)) { + const handledRepeatedDirectives = handledRepeatedDirectivesByHostPath.get(hostPath); + // Add the directive name to the existing set (if other invalid repeated directives exist) or a new set + // If the directive name exists as a value on the host path key, the repeatable error has been handled + if (!handledRepeatedDirectives) { + handledRepeatedDirectivesByHostPath.set(hostPath, new Set([directiveName])); + } else if (!handledRepeatedDirectives.has(directiveName)) { + handledRepeatedDirectives.add(directiveName); + errorMessages.push(invalidRepeatedDirectiveErrorMessage(directiveName, hostPath)); + } + } + if (!directiveDefinition.arguments?.length) { + if (directiveNode.arguments?.length) { + errorMessages.push(unexpectedDirectiveArgumentsErrorMessage(directiveNode, hostPath)); + } + return errorMessages; + } + if (!directiveNode.arguments?.length) { + if (requiredArguments.size > 0) { + errorMessages.push(undefinedRequiredArgumentsErrorMessage(directiveName, hostPath, [...requiredArguments])); + } + return errorMessages; + } + const definedArguments = getDefinedArgumentsForDirective( + directiveNode, + argumentTypeNodeByArgumentName, + requiredArguments, + hostPath, + errorMessages, + ); + const missingRequiredArguments = getEntriesNotInHashSet(requiredArguments, definedArguments); + if (missingRequiredArguments.length > 0) { + errorMessages.push( + undefinedRequiredArgumentsErrorMessage(directiveName, hostPath, [...requiredArguments], missingRequiredArguments), + ); + } + return errorMessages; +} + +export function extractDirectives( + node: + | EnumValueDefinitionNode + | InputObjectTypeNode + | InputValueDefinitionNode + | InterfaceTypeNode + | ObjectTypeNode + | SchemaNode + | UnionTypeNode, + directivesByDirectiveName: Map, + errors: Error[], + directiveDefinitionByDirectiveName: Map, + handledRepeatedDirectivesByHostPath: Map>, + hostPath: string, + isArgument = false, +): Map { + if (!node.directives) { + return directivesByDirectiveName; + } + const entityKeys = new Set(); + for (const directiveNode of node.directives) { + const errorMessages = getDirectiveValidationErrors( + directiveNode, + node.kind, + directivesByDirectiveName, + directiveDefinitionByDirectiveName, + handledRepeatedDirectivesByHostPath, + hostPath, + isArgument, + ); + const directiveName = directiveNode.name.value; + if (errorMessages.length > 0) { + errors.push(invalidDirectiveError(directiveName, hostPath, errorMessages)); + continue; + } + if (IGNORED_PARENT_DIRECTIVES.has(directiveName)) { + continue; + } + if (directiveName === KEY) { + // The argument was validated earlier + const entityKey = (directiveNode.arguments![0].value as StringValueNode).value; + if (entityKeys.has(entityKey)) { + continue; + } + entityKeys.add(entityKey); + } + const existingDirectives = directivesByDirectiveName.get(directiveName); + existingDirectives + ? existingDirectives.push(directiveNode) + : directivesByDirectiveName.set(directiveName, [directiveNode]); + } + return directivesByDirectiveName; +} + +export function extractArguments( + argumentDataByArgumentName: Map, + node: FieldDefinitionNode, + errors: Error[], + directiveDefinitionByDirectiveName: Map, + handledRepeatedDirectivesByHostPath: Map>, + parentsWithChildArguments: Set, + parentTypeName: string, + subgraphName: string, +): Map { + if (!node.arguments?.length) { + return argumentDataByArgumentName; + } + const fieldName = node.name.value; + const fieldPath = `${parentTypeName}.${fieldName}`; + parentsWithChildArguments.add(parentTypeName); + const duplicatedArguments = new Set(); + for (const argumentNode of node.arguments) { + const argumentName = argumentNode.name.value; + if (argumentDataByArgumentName.has(argumentName)) { + duplicatedArguments.add(argumentName); + continue; + } + upsertArgumentDataByNode( + argumentDataByArgumentName, + argumentNode, + errors, + directiveDefinitionByDirectiveName, + handledRepeatedDirectivesByHostPath, + parentTypeName, + fieldName, + subgraphName, + ); + } + if (duplicatedArguments.size > 0) { + errors.push(duplicateArgumentsError(fieldPath, [...duplicatedArguments])); + } + return argumentDataByArgumentName; +} + +export function upsertArgumentDataByNode( + argumentDataByArgumentName: Map, + node: InputValueDefinitionNode, + errors: Error[], + directiveDefinitionByDirectiveName: Map, + handledRepeatedDirectivesByHostPath: Map>, + parentTypeName: string, + fieldName: string, + subgraphName: string, +) { + const name = node.name.value; + const hostPath = `${parentTypeName}.${fieldName}`; + argumentDataByArgumentName.set(name, { + directivesByDirectiveName: extractDirectives( + node, + new Map(), + errors, + directiveDefinitionByDirectiveName, + handledRepeatedDirectivesByHostPath, + `${hostPath}(${name}: ...)`, + true, + ), + name, + node: getMutableInputValueNode(node, parentTypeName, fieldName), + requiredSubgraphNames: new Set([subgraphName]), + subgraphNames: new Set([subgraphName]), + type: getMutableTypeNode(node.type, hostPath), + defaultValue: node.defaultValue, + description: formatDescription(node.description), + }); +} + +export function upsertEnumDefinitionDataByNode( + parentDefinitionDataByTypeName: Map, + node: EnumTypeDefinitionNode, + directivesByDirectiveName: Map, +) { + const typeName = node.name.value; + parentDefinitionDataByTypeName.set(typeName, { + appearances: 1, + directivesByDirectiveName, + kind: node.kind, + node: getMutableEnumNode(node), + typeName, + enumValueDataByValueName: new Map(), + description: formatDescription(node.description), + }); +} + +export function upsertEnumExtensionDataByNode( + parentExtensionDataByTypeName: Map, + node: EnumTypeExtensionNode, + directivesByDirectiveName: Map, +) { + const typeName = node.name.value; + parentExtensionDataByTypeName.set(typeName, { + directivesByDirectiveName, + enumValueDataByValueName: new Map(), + kind: node.kind, + typeName, + }); +} + +export function upsertEnumValueDataByNode( + enumValueDataByValueName: Map, + node: EnumValueDefinitionNode, + errors: Error[], + directiveDefinitionByDirectiveName: Map, + handledRepeatedDirectivesByHostPath: Map>, + parentTypeName: string, +) { + const name = node.name.value; + enumValueDataByValueName.set(name, { + appearances: 1, + directivesByDirectiveName: extractDirectives( + node, + new Map(), + errors, + directiveDefinitionByDirectiveName, + handledRepeatedDirectivesByHostPath, + `${parentTypeName}.${name}`, + ), + name, + node: getMutableEnumValueNode(node), + parentTypeName, + description: formatDescription(node.description), + }); +} + +export function addInheritedDirectivesToFieldData( + parentDirectivesByDirectiveName: Map, + fieldDirectivesByDirectiveName: Map, +) { + for (const directiveName of INHERITABLE_DIRECTIVE_NAMES) { + if (parentDirectivesByDirectiveName.get(directiveName)) { + getValueOrDefault(fieldDirectivesByDirectiveName, directiveName, () => [generateSimpleDirective(directiveName)]); + } + } + return fieldDirectivesByDirectiveName; +} + +export function upsertFieldDataByNode( + fieldDataByFieldName: Map, + node: FieldDefinitionNode, + errors: Error[], + argumentDataByArgumentName: Map, + directivesByDirectiveName: Map, + parentTypeName: string, + subgraphName: string, + isSubgraphVersionTwo: boolean, +): FieldData { + const name = node.name.value; + const fieldPath = `${parentTypeName}.${name}`; + const isNodeExternalOrShareableResult = isNodeExternalOrShareable( + node, + !isSubgraphVersionTwo, + directivesByDirectiveName, + ); + const fieldData: FieldData = { + argumentDataByArgumentName: argumentDataByArgumentName, + isExternalBySubgraphName: new Map([[subgraphName, isNodeExternalOrShareableResult.isExternal]]), + isShareableBySubgraphName: new Map([[subgraphName, isNodeExternalOrShareableResult.isShareable]]), + node: getMutableFieldNode(node, parentTypeName), + name, + namedTypeName: getNamedTypeForChild(fieldPath, node.type), + parentTypeName, + subgraphNames: new Set([subgraphName]), + directivesByDirectiveName, + description: formatDescription(node.description), + }; + fieldDataByFieldName.set(name, fieldData); + return fieldData; +} + +export function upsertExtensionWithFieldsDataByNode( + parentExtensionDataByTypeName: Map, + node: InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode | ObjectTypeDefinitionNode | ObjectTypeExtensionNode, + errors: Error[], + directiveDefinitionByDirectiveName: Map, + handledRepeatedDirectivesByHostPath: Map>, + isEntity: boolean, +) { + const typeName = node.name.value; + const kind = convertKindForExtension(node); + switch (kind) { + case Kind.INTERFACE_TYPE_EXTENSION: + parentExtensionDataByTypeName.set(typeName, { + directivesByDirectiveName: extractDirectives( + node, + new Map(), + errors, + directiveDefinitionByDirectiveName, + handledRepeatedDirectivesByHostPath, + typeName, + ), + fieldDataByFieldName: new Map(), + implementedInterfaceTypeNames: extractImplementedInterfaceTypeNames(node, new Set(), errors), + isEntity, + kind, + typeName, + }); + return; + default: + parentExtensionDataByTypeName.set(typeName, { + directivesByDirectiveName: extractDirectives( + node, + new Map(), + errors, + directiveDefinitionByDirectiveName, + handledRepeatedDirectivesByHostPath, + typeName, + ), + fieldDataByFieldName: new Map(), + implementedInterfaceTypeNames: extractImplementedInterfaceTypeNames(node, new Set(), errors), + isEntity, + kind, + node: getMutableObjectExtensionNode(node as ObjectTypeExtensionNode), + typeName, + }); + } +} + +export function upsertInputObjectDefinitionDataByNode( + parentDefinitionDataByTypeName: Map, + node: InputObjectTypeDefinitionNode, + errors: Error[], + directiveDefinitionByDirectiveName: Map, + handledRepeatedDirectivesByHostPath: Map>, +) { + const typeName = node.name.value; + parentDefinitionDataByTypeName.set(typeName, { + appearances: 1, + directivesByDirectiveName: extractDirectives( + node, + new Map(), + errors, + directiveDefinitionByDirectiveName, + handledRepeatedDirectivesByHostPath, + typeName, + ), + inputValueDataByValueName: new Map(), + kind: node.kind, + node: getMutableInputObjectNode(node), + typeName, + description: formatDescription(node.description), + }); +} + +export function upsertInputObjectExtensionDataByNode( + parentExtensionDataByTypeName: Map, + node: InputObjectTypeExtensionNode, + errors: Error[], + directiveDefinitionByDirectiveName: Map, + handledRepeatedDirectivesByHostPath: Map>, +) { + const typeName = node.name.value; + parentExtensionDataByTypeName.set(typeName, { + directivesByDirectiveName: extractDirectives( + node, + new Map(), + errors, + directiveDefinitionByDirectiveName, + handledRepeatedDirectivesByHostPath, + typeName, + ), + inputValueDataByValueName: new Map(), + kind: node.kind, + typeName, + }); +} + +export function upsertInputValueDataByNode( + inputValueDataByValueName: Map, + node: InputValueDefinitionNode, + errors: Error[], + directiveDefinitionByDirectiveName: Map, + handledRepeatedDirectivesByHostPath: Map>, + parentTypeName: string, +) { + const name = node.name.value; + inputValueDataByValueName.set(name, { + appearances: 1, + directivesByDirectiveName: extractDirectives( + node, + new Map(), + errors, + directiveDefinitionByDirectiveName, + handledRepeatedDirectivesByHostPath, + `${parentTypeName}.${name}`, + ), + name, + node: getMutableInputValueNode(node, parentTypeName, name), + parentTypeName, + description: formatDescription(node.description), + }); +} + +export function upsertInterfaceDefinitionDataByNode( + parentDefinitionDataByTypeName: Map, + node: InterfaceTypeDefinitionNode, + errors: Error[], + directiveDefinitionByDirectiveName: Map, + handledRepeatedDirectivesByHostPath: Map>, + isEntity: boolean, + subgraphName: string, +) { + const typeName = node.name.value; + parentDefinitionDataByTypeName.set(typeName, { + directivesByDirectiveName: extractDirectives( + node, + new Map(), + errors, + directiveDefinitionByDirectiveName, + handledRepeatedDirectivesByHostPath, + typeName, + ), + fieldDataByFieldName: new Map(), + isEntity, + implementedInterfaceTypeNames: extractImplementedInterfaceTypeNames(node, new Set(), errors), + kind: node.kind, + node: getMutableInterfaceNode(node), + subgraphNames: new Set([subgraphName]), + typeName, + description: formatDescription(node.description), + }); +} + +export function upsertObjectDefinitionDataByNode( + parentDefinitionDataByTypeName: Map, + node: ObjectTypeDefinitionNode, + errors: Error[], + directiveDefinitionByDirectiveName: Map, + handledRepeatedDirectivesByHostPath: Map>, + isEntity: boolean, + isRootType: boolean, + subgraphName: string, +) { + const typeName = node.name.value; + parentDefinitionDataByTypeName.set(typeName, { + directivesByDirectiveName: extractDirectives( + node, + new Map(), + errors, + directiveDefinitionByDirectiveName, + handledRepeatedDirectivesByHostPath, + typeName, + ), + fieldDataByFieldName: new Map(), + isEntity, + isRootType, + implementedInterfaceTypeNames: extractImplementedInterfaceTypeNames(node, new Set(), errors), + kind: node.kind, + node: getMutableObjectNode(node), + subgraphNames: new Set([subgraphName]), + typeName, + description: formatDescription(node.description), + }); +} + +export function upsertScalarDefinitionDataByNode( + parentDefinitionDataByTypeName: Map, + node: ScalarTypeDefinitionNode, + directivesByDirectiveName: Map, +) { + const typeName = node.name.value; + parentDefinitionDataByTypeName.set(typeName, { + directivesByDirectiveName, + kind: node.kind, + node: getMutableScalarNode(node), + typeName, + description: formatDescription(node.description), + }); +} + +export function upsertScalarExtensionDataByNode( + parentExtensionDataByTypeName: Map, + node: ScalarTypeExtensionNode, + directivesByDirectiveName: Map, +) { + const typeName = node.name.value; + parentExtensionDataByTypeName.set(typeName, { + directivesByDirectiveName, + kind: node.kind, + typeName, + }); +} + +export function extractUniqueUnionMembers( + members: readonly NamedTypeNode[], + membersByMemberTypeName: Map, + errors: Error[], + unionTypeName: string, + abstractToConcreteTypeNames: Map>, + referencedTypeNames: Set, +): Map { + for (const member of members) { + const memberTypeName = member.name.value; + if (membersByMemberTypeName.has(memberTypeName)) { + errors.push(duplicateUnionMemberError(memberTypeName, unionTypeName)); + continue; + } + const concreteTypes = abstractToConcreteTypeNames.get(unionTypeName); + if (concreteTypes) { + concreteTypes.add(memberTypeName); + } else { + abstractToConcreteTypeNames.set(unionTypeName, new Set([memberTypeName])); + } + if (!BASE_SCALARS.has(memberTypeName)) { + referencedTypeNames.add(memberTypeName); + } + membersByMemberTypeName.set(memberTypeName, member); + } + return membersByMemberTypeName; +} + +export function upsertUnionDefinitionDataByNode( + parentDefinitionDataByTypeName: Map, + node: UnionTypeDefinitionNode, + errors: Error[], + directiveDefinitionByDirectiveName: Map, + handledRepeatedDirectivesByHostPath: Map>, + abstractToConcreteTypeNames: Map>, + referencedTypeNames: Set, +) { + const typeName = node.name.value; + if (!node.types?.length) { + errors.push(noDefinedUnionMembersError(typeName)); + return; + } + parentDefinitionDataByTypeName.set(typeName, { + directivesByDirectiveName: extractDirectives( + node, + new Map(), + errors, + directiveDefinitionByDirectiveName, + handledRepeatedDirectivesByHostPath, + typeName, + ), + kind: node.kind, + memberByMemberTypeName: extractUniqueUnionMembers( + node.types, + new Map(), + errors, + typeName, + abstractToConcreteTypeNames, + referencedTypeNames, + ), + node: getMutableUnionNode(node), + typeName, + description: formatDescription(node.description), + }); +} + +export function upsertUnionExtensionDataByNode( + parentExtensionDataByTypeName: Map, + node: UnionTypeExtensionNode, + errors: Error[], + directiveDefinitionByDirectiveName: Map, + handledRepeatedDirectivesByHostPath: Map>, + abstractToConcreteTypeNames: Map>, + referencedTypeNames: Set, +) { + const typeName = node.name.value; + parentExtensionDataByTypeName.set(typeName, { + directivesByDirectiveName: extractDirectives( + node, + new Map(), + errors, + directiveDefinitionByDirectiveName, + handledRepeatedDirectivesByHostPath, + typeName, + ), + kind: node.kind, + memberByMemberTypeName: extractUniqueUnionMembers( + // Undefined or empty node.types is handled earlier + node.types!, + new Map(), + errors, + typeName, + abstractToConcreteTypeNames, + referencedTypeNames, + ), + typeName, + }); +} + +export function isTypeNameRootType(typeName: string, operationByTypeName: Map) { + return ROOT_TYPES.has(typeName) || operationByTypeName.has(typeName); +} + +export function convertKindForExtension( + node: InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode | ObjectTypeDefinitionNode | ObjectTypeExtensionNode, +): Kind.INTERFACE_TYPE_EXTENSION | Kind.OBJECT_TYPE_EXTENSION { + switch (node.kind) { + case Kind.INTERFACE_TYPE_DEFINITION: + return Kind.INTERFACE_TYPE_EXTENSION; + case Kind.OBJECT_TYPE_DEFINITION: + return Kind.OBJECT_TYPE_EXTENSION; + default: + return node.kind; + } +} + +export function extractImplementedInterfaceTypeNames( + node: InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode | ObjectTypeDefinitionNode | ObjectTypeExtensionNode, + implementedInterfaceTypeNames: Set, + errors?: Error[], +): Set { + if (!node.interfaces) { + return implementedInterfaceTypeNames; + } + const parentTypeName = node.name.value; + for (const implementedInterface of node.interfaces) { + const interfaceTypeName = implementedInterface.name.value; + if (errors && implementedInterfaceTypeNames.has(interfaceTypeName)) { + errors.push(duplicateInterfaceError(interfaceTypeName, parentTypeName)); + continue; + } + implementedInterfaceTypeNames.add(interfaceTypeName); + } + return implementedInterfaceTypeNames; +} + +function addExtensionDirectivesToDefinition( + directivesByDirectiveName: Map, + parentExtensionData?: ParentExtensionData, +) { + if (!parentExtensionData) { + return; + } + for (const [directiveName, directives] of parentExtensionData.directivesByDirectiveName) { + const existingDirectives = directivesByDirectiveName.get(directiveName); + if (existingDirectives) { + existingDirectives.push(...directives); + continue; + } + directivesByDirectiveName.set(directiveName, [...directives]); + } +} + +type ChildDefinitionNode = EnumValueDefinitionNode | FieldDefinitionNode | InputValueDefinitionNode; + +function addAuthorizationDirectivesToFieldData( + authorizationDataByParentTypeName: Map, + fieldData: FieldData, +) { + const authorizationData = authorizationDataByParentTypeName.get(fieldData.parentTypeName); + if (!authorizationData) { + return; + } + const fieldAuthorizationData = authorizationData.fieldAuthorizationDataByFieldName.get(fieldData.name); + if (!fieldAuthorizationData) { + return; + } + if (fieldAuthorizationData.requiresAuthentication) { + const authenticatedDirective = generateSimpleDirective(AUTHENTICATED); + fieldData.directivesByDirectiveName.set(AUTHENTICATED, [authenticatedDirective]); + } + if (fieldAuthorizationData.requiredScopes.length > 0) { + const requiresScopesDirective = generateRequiresScopesDirective(fieldAuthorizationData.requiredScopes); + fieldData.directivesByDirectiveName.set(REQUIRES_SCOPES, [requiresScopesDirective]); + } +} + +function propagateFieldDataArguments(fieldData: FieldData) { + for (const argumentData of fieldData.argumentDataByArgumentName.values()) { + // First propagate the argument's directives + for (const directiveNodes of argumentData.directivesByDirectiveName.values()) { + argumentData.node.directives.push(...directiveNodes); + } + fieldData.node.arguments.push(argumentData.node); + } +} + +function childMapToValueArray( + map: Map, + authorizationDataByParentTypeName: Map, +): N[] { + const valueArray: ChildDefinitionNode[] = []; + for (const childData of map.values()) { + if (childData.node.kind === Kind.FIELD_DEFINITION) { + const fieldData = childData as FieldData; + addAuthorizationDirectivesToFieldData(authorizationDataByParentTypeName, fieldData); + propagateFieldDataArguments(fieldData); + } + for (const directiveNodes of childData.directivesByDirectiveName.values()) { + childData.node.directives.push(...directiveNodes); + } + valueArray.push(childData.node); + } + return valueArray as N[]; +} + +function getValidFlattenedDirectiveArray( + directivesByDirectiveName: Map, + errors: Error[], + directiveDefinitionByDirectiveName: Map, + hostPath: string, +): ConstDirectiveNode[] { + const flattenedArray: ConstDirectiveNode[] = []; + for (const [directiveName, directiveNodes] of directivesByDirectiveName) { + const directiveDefinition = + directiveDefinitionByDirectiveName.get(directiveName) || + V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME.get(directiveName); + if (!directiveDefinition) { + continue; + } + if (!directiveDefinition.repeatable && directiveNodes.length > 1) { + errors.push( + invalidDirectiveError(directiveName, hostPath, [invalidRepeatedDirectiveErrorMessage(directiveName, hostPath)]), + ); + continue; + } + if (directiveName !== KEY) { + flattenedArray.push(...directiveNodes); + continue; + } + const normalizedDirectiveNodes: ConstDirectiveNode[] = []; + const entityKeys = new Set(); + const errorMessages: string[] = []; + for (const keyDirectiveNode of directiveNodes) { + const directiveValue = keyDirectiveNode.arguments![0].value; + if (directiveValue.kind !== Kind.STRING) { + errorMessages.push(invalidKeyDirectiveArgumentErrorMessage(directiveValue.kind)); + continue; + } + const entityKey = directiveValue.value; + if (entityKeys.has(entityKey)) { + continue; + } + entityKeys.add(entityKey); + flattenedArray.push(keyDirectiveNode); + normalizedDirectiveNodes.push(keyDirectiveNode); + } + directivesByDirectiveName.set(directiveName, normalizedDirectiveNodes); + if (errorMessages.length > 0) { + errors.push(invalidDirectiveError(directiveName, hostPath, errorMessages)); + } + } + return flattenedArray; +} + +function mergeUniqueUnionMembers( + unionDefinitionData: UnionDefinitionData, + errors: Error[], + unionExtensionData?: UnionExtensionData, +) { + if (!unionExtensionData) { + return; + } + const definitionMembers = unionDefinitionData.memberByMemberTypeName; + const extensionMembers = unionExtensionData.memberByMemberTypeName; + const typeName = unionDefinitionData.typeName; + for (const [memberName, namedTypeNode] of extensionMembers) { + if (!definitionMembers.has(memberName)) { + definitionMembers.set(memberName, namedTypeNode); + continue; + } + errors.push(duplicateUnionMemberExtensionError(memberName, typeName)); + } +} + +export function getEnumNodeByData( + enumDefinitionData: EnumDefinitionData, + errors: Error[], + directiveDefinitionByDirectiveName: Map, + authorizationDataByParentTypeName: Map, + enumExtensionData?: EnumExtensionData, +) { + addExtensionDirectivesToDefinition(enumDefinitionData.directivesByDirectiveName, enumExtensionData); + enumDefinitionData.node.directives = getValidFlattenedDirectiveArray( + enumDefinitionData.directivesByDirectiveName, + errors, + directiveDefinitionByDirectiveName, + enumDefinitionData.typeName, + ); + enumDefinitionData.node.values = childMapToValueArray( + enumDefinitionData.enumValueDataByValueName, + authorizationDataByParentTypeName, + ); + return enumDefinitionData.node; +} + +export function getInputObjectNodeByData( + inputObjectDefinitionData: InputObjectDefinitionData, + errors: Error[], + directiveDefinitionByDirectiveName: Map, + authorizationDataByParentTypeName: Map, + inputObjectExtensionData?: InputObjectExtensionData, +) { + addExtensionDirectivesToDefinition(inputObjectDefinitionData.directivesByDirectiveName, inputObjectExtensionData); + inputObjectDefinitionData.node.directives = getValidFlattenedDirectiveArray( + inputObjectDefinitionData.directivesByDirectiveName, + errors, + directiveDefinitionByDirectiveName, + inputObjectDefinitionData.typeName, + ); + inputObjectDefinitionData.node.fields = childMapToValueArray( + inputObjectDefinitionData.inputValueDataByValueName, + authorizationDataByParentTypeName, + ); + return inputObjectDefinitionData.node; +} + +export function getParentWithFieldsNodeByData( + parentWithFieldsData: DefinitionWithFieldsData | ObjectExtensionData, + errors: Error[], + directiveDefinitionByDirectiveName: Map, + authorizationDataByParentTypeName: Map, + parentExtensionWithFieldsData?: ExtensionWithFieldsData, +): ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode | ObjectTypeExtensionNode { + addExtensionDirectivesToDefinition(parentWithFieldsData.directivesByDirectiveName, parentExtensionWithFieldsData); + parentWithFieldsData.node.directives = getValidFlattenedDirectiveArray( + parentWithFieldsData.directivesByDirectiveName, + errors, + directiveDefinitionByDirectiveName, + parentWithFieldsData.typeName, + ); + parentWithFieldsData.node.fields = childMapToValueArray( + parentWithFieldsData.fieldDataByFieldName, + authorizationDataByParentTypeName, + ); + parentWithFieldsData.node.interfaces = setToNamedTypeNodeArray(parentWithFieldsData.implementedInterfaceTypeNames); + return parentWithFieldsData.node; +} + +export function getScalarNodeByData( + scalarDefinitionData: ScalarDefinitionData, + errors: Error[], + directiveDefinitionByDirectiveName: Map, + scalarExtensionData?: ScalarExtensionData, +) { + addExtensionDirectivesToDefinition(scalarDefinitionData.directivesByDirectiveName, scalarExtensionData); + scalarDefinitionData.node.directives = getValidFlattenedDirectiveArray( + scalarDefinitionData.directivesByDirectiveName, + errors, + directiveDefinitionByDirectiveName, + scalarDefinitionData.typeName, + ); + return scalarDefinitionData.node; +} + +export function getSchemaNodeByData( + schemaData: SchemaData, + errors: Error[], + directiveDefinitionByDirectiveName: Map, +): SchemaDefinitionNode { + return { + description: schemaData.description, + directives: getValidFlattenedDirectiveArray( + schemaData.directivesByDirectiveName, + errors, + directiveDefinitionByDirectiveName, + schemaData.typeName, + ), + kind: schemaData.kind, + operationTypes: mapToArrayOfValues(schemaData.operationTypes), + }; +} + +export function getUnionNodeByData( + unionDefinitionData: UnionDefinitionData, + errors: Error[], + directiveDefinitionByDirectiveName: Map, + unionExtensionData?: UnionExtensionData, +) { + mergeUniqueUnionMembers(unionDefinitionData, errors, unionExtensionData); + addExtensionDirectivesToDefinition(unionDefinitionData.directivesByDirectiveName, unionExtensionData); + unionDefinitionData.node.directives = getValidFlattenedDirectiveArray( + unionDefinitionData.directivesByDirectiveName, + errors, + directiveDefinitionByDirectiveName, + unionDefinitionData.typeName, + ); + unionDefinitionData.node.types = mapToArrayOfValues(unionDefinitionData.memberByMemberTypeName); + return unionDefinitionData.node; +} + +export function removeInheritableDirectivesFromParentWithFieldsData( + parentData: ParentDefinitionData | ParentExtensionData, +) { + for (const directiveName of INHERITABLE_DIRECTIVE_NAMES) { + parentData.directivesByDirectiveName.delete(directiveName); + } +} diff --git a/composition/src/subgraph/subgraph.ts b/composition/src/subgraph/subgraph.ts index a42215085c..73a88e70c3 100644 --- a/composition/src/subgraph/subgraph.ts +++ b/composition/src/subgraph/subgraph.ts @@ -10,21 +10,12 @@ import { operationTypeNodeToDefaultType, stringToNameNode, } from '../ast/utils'; -import { getNamedTypeForChild } from '../type-merging/type-merging'; -import { - AuthorizationData, - EntityInterfaceSubgraphData, - getOrThrowError, - getValueOrDefault, - mergeAuthorizationDataByAND, - newAuthorizationData, - newFieldAuthorizationData, - setAndGetValue, -} from '../utils/utils'; +import { getNamedTypeForChild } from '../schema-building/type-merging'; +import { EntityInterfaceSubgraphData, getOrThrowError } from '../utils/utils'; import { ENTITIES_FIELD, OPERATION_TO_DEFAULT, SERVICE_FIELD } from '../utils/string-constants'; import { ConfigurationDataByTypeName } from '../router-configuration/router-configuration'; -import { ExtensionContainerByTypeName, ParentContainerByTypeName } from '../normalization/utils'; -import { NormalizationFactory } from '../normalization/normalization-factory'; +import { ParentDefinitionData } from '../schema-building/type-definition-data'; +import { ParentExtensionData } from '../schema-building/type-extension-data'; export type Subgraph = { definitions: DocumentNode; @@ -36,13 +27,13 @@ export type InternalSubgraph = { configurationDataMap: ConfigurationDataByTypeName; definitions: DocumentNode; entityInterfaces: Map; - extensionContainerByTypeName: ExtensionContainerByTypeName; isVersionTwo: boolean; keyFieldNamesByParentTypeName: Map>; name: string; operationTypes: Map; overriddenFieldNamesByParentTypeName: Map>; - parentContainerByTypeName: ParentContainerByTypeName; + parentDataByTypeName: Map; + parentExtensionDataByTypeName: Map; schema: GraphQLSchema; url: string; }; @@ -64,109 +55,6 @@ export function recordSubgraphName( nonUniqueSubgraphNames.add(subgraphName); } -export function walkSubgraphToApplyFieldAuthorization(factory: NormalizationFactory, definitions: DocumentNode) { - let parentAuthorizationData: AuthorizationData | undefined; - let isInterfaceKind = false; - visit(definitions, { - FieldDefinition: { - enter(node) { - factory.childName = node.name.value; - const typeName = getNamedTypeForChild(`${factory.parentTypeName}.${factory.childName}`, node.type); - const inheritsAuthorization = factory.leafTypeNamesWithAuthorizationDirectives.has(typeName); - if ( - (!parentAuthorizationData || !parentAuthorizationData.hasParentLevelAuthorization) && - !inheritsAuthorization - ) { - return false; - } - if (!parentAuthorizationData) { - parentAuthorizationData = setAndGetValue( - factory.authorizationDataByParentTypeName, - factory.parentTypeName, - newAuthorizationData(factory.parentTypeName), - ); - } - const fieldAuthorizationData = getValueOrDefault( - parentAuthorizationData.fieldAuthorizationDataByFieldName, - factory.childName, - () => newFieldAuthorizationData(factory.childName), - ); - if (!mergeAuthorizationDataByAND(parentAuthorizationData, fieldAuthorizationData)) { - factory.invalidOrScopesHostPaths.add(`${factory.parentTypeName}.${factory.childName}`); - return false; - } - if (!inheritsAuthorization) { - return false; - } - if (isInterfaceKind) { - /* Collect the inherited leaf authorization to apply later. This is to avoid duplication of inherited - authorization applied to interface and concrete types. */ - getValueOrDefault(factory.heirFieldAuthorizationDataByTypeName, typeName, () => []).push( - fieldAuthorizationData, - ); - return false; - } - const definitionAuthorizationData = factory.authorizationDataByParentTypeName.get(typeName); - if ( - definitionAuthorizationData && - definitionAuthorizationData.hasParentLevelAuthorization && - !mergeAuthorizationDataByAND(definitionAuthorizationData, fieldAuthorizationData) - ) { - factory.invalidOrScopesHostPaths.add(`${factory.parentTypeName}.${factory.childName}`); - } - return false; - }, - leave() { - factory.childName = ''; - }, - }, - InterfaceTypeDefinition: { - enter(node) { - factory.parentTypeName = node.name.value; - parentAuthorizationData = factory.getAuthorizationData(node); - isInterfaceKind = true; - }, - leave() { - factory.parentTypeName = ''; - parentAuthorizationData = undefined; - isInterfaceKind = false; - }, - }, - InterfaceTypeExtension: { - enter(node) { - factory.parentTypeName = node.name.value; - parentAuthorizationData = factory.getAuthorizationData(node); - isInterfaceKind = true; - }, - leave() { - factory.parentTypeName = ''; - parentAuthorizationData = undefined; - isInterfaceKind = false; - }, - }, - ObjectTypeDefinition: { - enter(node) { - factory.parentTypeName = node.name.value; - parentAuthorizationData = factory.getAuthorizationData(node); - }, - leave() { - factory.parentTypeName = ''; - parentAuthorizationData = undefined; - }, - }, - ObjectTypeExtension: { - enter(node) { - factory.parentTypeName = node.name.value; - parentAuthorizationData = factory.getAuthorizationData(node); - }, - leave() { - factory.parentTypeName = ''; - parentAuthorizationData = undefined; - }, - }, - }); -} - // Places the object-like nodes into the multigraph including the concrete types for abstract types export function walkSubgraphToCollectObjectLikesAndDirectiveDefinitions( factory: FederationFactory, diff --git a/composition/src/utils/constants.ts b/composition/src/utils/constants.ts index 181518ba98..d198d4e067 100644 --- a/composition/src/utils/constants.ts +++ b/composition/src/utils/constants.ts @@ -34,8 +34,8 @@ import { RESOLVABLE, SCALAR_UPPER, SCHEMA_UPPER, - SCOPES, SCOPE_SCALAR, + SCOPES, SHAREABLE, SOURCE_ID, SPECIFIED_BY, @@ -58,395 +58,437 @@ export const BASE_SCALARS = new Set([ STRING_SCALAR, ]); -export const VERSION_ONE_DIRECTIVES = new Set([ - DEPRECATED, - EXTENDS, - EXTERNAL, - KEY, - PROVIDES, - REQUIRES, - SPECIFIED_BY, - TAG, -]); -export const VERSION_TWO_DIRECTIVES = new Set([ - AUTHENTICATED, - COMPOSE_DIRECTIVE, - LINK, - OVERRIDE, - INACCESSIBLE, - INTERFACE_OBJECT, - REQUIRES_SCOPES, - SHAREABLE, -]); - -export const BASE_DIRECTIVE_DEFINITIONS: DirectiveDefinitionNode[] = [ - /* directive @deprecated(reason: String = "No longer supported") on ARGUMENT_DEFINITION | ENUM_VALUE | - FIELD_DEFINITION | INPUT_FIELD_DEFINITION - */ - { - arguments: [ - { - kind: Kind.INPUT_VALUE_DEFINITION, - name: stringToNameNode(REASON), - type: stringToNamedTypeNode(STRING_SCALAR), - defaultValue: { - kind: Kind.STRING, - value: 'No longer supported', - }, - }, - ], - kind: Kind.DIRECTIVE_DEFINITION, - locations: stringArrayToNameNodeArray([ - ARGUMENT_DEFINITION_UPPER, - ENUM_VALUE_UPPER, - FIELD_DEFINITION_UPPER, - INPUT_FIELD_DEFINITION_UPPER, - ]), - name: stringToNameNode(DEPRECATED), - repeatable: false, - }, - // directive @extends on INTERFACE | OBJECT - { - kind: Kind.DIRECTIVE_DEFINITION, - locations: stringArrayToNameNodeArray([INTERFACE_UPPER, OBJECT_UPPER]), - name: stringToNameNode(EXTENDS), - repeatable: false, - }, - // directive @external on FIELD_DEFINITION | OBJECT - { - kind: Kind.DIRECTIVE_DEFINITION, - locations: stringArrayToNameNodeArray([FIELD_DEFINITION_UPPER, OBJECT_UPPER]), - name: stringToNameNode(EXTERNAL), - repeatable: false, - }, - // directive @eventsPublish(topic: String!, sourceID: String) on FIELD_DEFINITION - { - arguments: [ - { - kind: Kind.INPUT_VALUE_DEFINITION, - name: stringToNameNode(TOPIC), - type: { - kind: Kind.NON_NULL_TYPE, - type: stringToNamedTypeNode(STRING_SCALAR), - }, +/* directive @deprecated(reason: String = "No longer supported") on ARGUMENT_DEFINITION | ENUM_VALUE | + FIELD_DEFINITION | INPUT_FIELD_DEFINITION +*/ +const DEPRECATED_DEFINITION: DirectiveDefinitionNode = { + arguments: [ + { + kind: Kind.INPUT_VALUE_DEFINITION, + name: stringToNameNode(REASON), + type: stringToNamedTypeNode(STRING_SCALAR), + defaultValue: { + kind: Kind.STRING, + value: 'No longer supported', }, - { - kind: Kind.INPUT_VALUE_DEFINITION, - name: stringToNameNode(SOURCE_ID), + }, + ], + kind: Kind.DIRECTIVE_DEFINITION, + locations: stringArrayToNameNodeArray([ + ARGUMENT_DEFINITION_UPPER, + ENUM_VALUE_UPPER, + FIELD_DEFINITION_UPPER, + INPUT_FIELD_DEFINITION_UPPER, + ]), + name: stringToNameNode(DEPRECATED), + repeatable: false, +}; + +// directive @extends on INTERFACE | OBJECT +const EXTENDS_DEFINITION: DirectiveDefinitionNode = { + kind: Kind.DIRECTIVE_DEFINITION, + locations: stringArrayToNameNodeArray([INTERFACE_UPPER, OBJECT_UPPER]), + name: stringToNameNode(EXTENDS), + repeatable: false, +}; + +// directive @external on FIELD_DEFINITION | OBJECT +const EXTERNAL_DEFINITION: DirectiveDefinitionNode = { + kind: Kind.DIRECTIVE_DEFINITION, + locations: stringArrayToNameNodeArray([FIELD_DEFINITION_UPPER, OBJECT_UPPER]), + name: stringToNameNode(EXTERNAL), + repeatable: false, +}; + +// directive @eventsPublish(topic: String!, sourceID: String) on FIELD_DEFINITION +const EVENTS_PUBLISH_DEFINITION: DirectiveDefinitionNode = { + arguments: [ + { + kind: Kind.INPUT_VALUE_DEFINITION, + name: stringToNameNode(TOPIC), + type: { + kind: Kind.NON_NULL_TYPE, type: stringToNamedTypeNode(STRING_SCALAR), }, - ], - kind: Kind.DIRECTIVE_DEFINITION, - locations: [stringToNameNode(FIELD_DEFINITION_UPPER)], - name: stringToNameNode(EVENTS_PUBLISH), - repeatable: false, - }, - // directive @eventsRequest(topic: String!, sourceID: String) on FIELD_DEFINITION - { - arguments: [ - { - kind: Kind.INPUT_VALUE_DEFINITION, - name: stringToNameNode(TOPIC), - type: { - kind: Kind.NON_NULL_TYPE, - type: stringToNamedTypeNode(STRING_SCALAR), - }, - }, - { - kind: Kind.INPUT_VALUE_DEFINITION, - name: stringToNameNode(SOURCE_ID), + }, + { + kind: Kind.INPUT_VALUE_DEFINITION, + name: stringToNameNode(SOURCE_ID), + type: stringToNamedTypeNode(STRING_SCALAR), + }, + ], + kind: Kind.DIRECTIVE_DEFINITION, + locations: [stringToNameNode(FIELD_DEFINITION_UPPER)], + name: stringToNameNode(EVENTS_PUBLISH), + repeatable: false, +}; + +// directive @eventsRequest(topic: String!, sourceID: String) on FIELD_DEFINITION +const EVENTS_REQUEST_DEFINITION: DirectiveDefinitionNode = { + arguments: [ + { + kind: Kind.INPUT_VALUE_DEFINITION, + name: stringToNameNode(TOPIC), + type: { + kind: Kind.NON_NULL_TYPE, type: stringToNamedTypeNode(STRING_SCALAR), }, - ], - kind: Kind.DIRECTIVE_DEFINITION, - locations: [stringToNameNode(FIELD_DEFINITION_UPPER)], - name: stringToNameNode(EVENTS_REQUEST), - repeatable: false, - }, - // directive @eventsSubscribe(topic: String!, sourceID: String) on FIELD_DEFINITION - { - arguments: [ - { - kind: Kind.INPUT_VALUE_DEFINITION, - name: stringToNameNode(TOPIC), - type: { - kind: Kind.NON_NULL_TYPE, - type: stringToNamedTypeNode(STRING_SCALAR), - }, - }, - { - kind: Kind.INPUT_VALUE_DEFINITION, - name: stringToNameNode(SOURCE_ID), + }, + { + kind: Kind.INPUT_VALUE_DEFINITION, + name: stringToNameNode(SOURCE_ID), + type: stringToNamedTypeNode(STRING_SCALAR), + }, + ], + kind: Kind.DIRECTIVE_DEFINITION, + locations: [stringToNameNode(FIELD_DEFINITION_UPPER)], + name: stringToNameNode(EVENTS_REQUEST), + repeatable: false, +}; + +// directive @eventsSubscribe(topic: String!, sourceID: String) on FIELD_DEFINITION +const EVENTS_SUBSCRIBE_DEFINITION: DirectiveDefinitionNode = { + arguments: [ + { + kind: Kind.INPUT_VALUE_DEFINITION, + name: stringToNameNode(TOPIC), + type: { + kind: Kind.NON_NULL_TYPE, type: stringToNamedTypeNode(STRING_SCALAR), }, - ], - kind: Kind.DIRECTIVE_DEFINITION, - locations: [stringToNameNode(FIELD_DEFINITION_UPPER)], - name: stringToNameNode(EVENTS_SUBSCRIBE), - repeatable: false, - }, - // directive @key(fields: openfed__FieldSet!) on INTERFACE | OBJECT - { - arguments: [ - { - kind: Kind.INPUT_VALUE_DEFINITION, - name: stringToNameNode(FIELDS), - type: { - kind: Kind.NON_NULL_TYPE, - type: stringToNamedTypeNode(FIELD_SET_SCALAR), - }, + }, + { + kind: Kind.INPUT_VALUE_DEFINITION, + name: stringToNameNode(SOURCE_ID), + type: stringToNamedTypeNode(STRING_SCALAR), + }, + ], + kind: Kind.DIRECTIVE_DEFINITION, + locations: [stringToNameNode(FIELD_DEFINITION_UPPER)], + name: stringToNameNode(EVENTS_SUBSCRIBE), + repeatable: false, +}; + +// directive @key(fields: openfed__FieldSet!) on INTERFACE | OBJECT +const KEY_DEFINITION: DirectiveDefinitionNode = { + arguments: [ + { + kind: Kind.INPUT_VALUE_DEFINITION, + name: stringToNameNode(FIELDS), + type: { + kind: Kind.NON_NULL_TYPE, + type: stringToNamedTypeNode(FIELD_SET_SCALAR), }, - { - kind: Kind.INPUT_VALUE_DEFINITION, - name: stringToNameNode(RESOLVABLE), - type: stringToNamedTypeNode(BOOLEAN_TYPE), - defaultValue: { - kind: Kind.BOOLEAN, - value: true, - }, + }, + { + kind: Kind.INPUT_VALUE_DEFINITION, + name: stringToNameNode(RESOLVABLE), + type: stringToNamedTypeNode(BOOLEAN_TYPE), + defaultValue: { + kind: Kind.BOOLEAN, + value: true, }, - ], - kind: Kind.DIRECTIVE_DEFINITION, - locations: stringArrayToNameNodeArray([INTERFACE_UPPER, OBJECT_UPPER]), - name: stringToNameNode(KEY), - repeatable: true, - }, - // directive @provides(fields: openfed__FieldSet!) on FIELD_DEFINITION - { - arguments: [ - { - kind: Kind.INPUT_VALUE_DEFINITION, - name: stringToNameNode(FIELDS), - type: { - kind: Kind.NON_NULL_TYPE, - type: stringToNamedTypeNode(FIELD_SET_SCALAR), - }, + }, + ], + kind: Kind.DIRECTIVE_DEFINITION, + locations: stringArrayToNameNodeArray([INTERFACE_UPPER, OBJECT_UPPER]), + name: stringToNameNode(KEY), + repeatable: true, +}; + +// directive @provides(fields: openfed__FieldSet!) on FIELD_DEFINITION +const PROVIDES_DEFINITION: DirectiveDefinitionNode = { + arguments: [ + { + kind: Kind.INPUT_VALUE_DEFINITION, + name: stringToNameNode(FIELDS), + type: { + kind: Kind.NON_NULL_TYPE, + type: stringToNamedTypeNode(FIELD_SET_SCALAR), }, - ], - kind: Kind.DIRECTIVE_DEFINITION, - locations: [stringToNameNode(FIELD_DEFINITION_UPPER)], - name: stringToNameNode(PROVIDES), - repeatable: false, - }, - // directive @requires(fields: openfed__FieldSet!) on FIELD_DEFINITION - { - arguments: [ - { - kind: Kind.INPUT_VALUE_DEFINITION, - name: stringToNameNode(FIELDS), - type: { - kind: Kind.NON_NULL_TYPE, - type: stringToNamedTypeNode(FIELD_SET_SCALAR), - }, + }, + ], + kind: Kind.DIRECTIVE_DEFINITION, + locations: [stringToNameNode(FIELD_DEFINITION_UPPER)], + name: stringToNameNode(PROVIDES), + repeatable: false, +}; + +// directive @requires(fields: openfed__FieldSet!) on FIELD_DEFINITION +const REQUIRES_DEFINITION: DirectiveDefinitionNode = { + arguments: [ + { + kind: Kind.INPUT_VALUE_DEFINITION, + name: stringToNameNode(FIELDS), + type: { + kind: Kind.NON_NULL_TYPE, + type: stringToNamedTypeNode(FIELD_SET_SCALAR), }, - ], - kind: Kind.DIRECTIVE_DEFINITION, - locations: [stringToNameNode(FIELD_DEFINITION_UPPER)], - name: stringToNameNode(REQUIRES), - repeatable: false, - }, - // directive @specifiedBy(url: String!) on SCALAR - { - arguments: [ - { - kind: Kind.INPUT_VALUE_DEFINITION, - name: stringToNameNode(URL_LOWER), - type: { - kind: Kind.NON_NULL_TYPE, - type: stringToNamedTypeNode(STRING_SCALAR), - }, + }, + ], + kind: Kind.DIRECTIVE_DEFINITION, + locations: [stringToNameNode(FIELD_DEFINITION_UPPER)], + name: stringToNameNode(REQUIRES), + repeatable: false, +}; + +// directive @specifiedBy(url: String!) on SCALAR +const SPECIFIED_BY_DEFINITION: DirectiveDefinitionNode = { + arguments: [ + { + kind: Kind.INPUT_VALUE_DEFINITION, + name: stringToNameNode(URL_LOWER), + type: { + kind: Kind.NON_NULL_TYPE, + type: stringToNamedTypeNode(STRING_SCALAR), }, - ], - kind: Kind.DIRECTIVE_DEFINITION, - locations: stringArrayToNameNodeArray([SCALAR_UPPER]), - name: stringToNameNode(SPECIFIED_BY), - repeatable: false, - }, - /* directive @tag(name: String!) on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_OBJECT | - INPUT_FIELD_DEFINITION | INTERFACE | OBJECT | SCALAR | UNION - */ - { - arguments: [ - { - kind: Kind.INPUT_VALUE_DEFINITION, - name: stringToNameNode(NAME), - type: { - kind: Kind.NON_NULL_TYPE, - type: stringToNamedTypeNode(STRING_SCALAR), - }, + }, + ], + kind: Kind.DIRECTIVE_DEFINITION, + locations: stringArrayToNameNodeArray([SCALAR_UPPER]), + name: stringToNameNode(SPECIFIED_BY), + repeatable: false, +}; + +/* directive @tag(name: String!) on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_OBJECT | + INPUT_FIELD_DEFINITION | INTERFACE | OBJECT | SCALAR | UNION +*/ +const TAG_DEFINITION: DirectiveDefinitionNode = { + arguments: [ + { + kind: Kind.INPUT_VALUE_DEFINITION, + name: stringToNameNode(NAME), + type: { + kind: Kind.NON_NULL_TYPE, + type: stringToNamedTypeNode(STRING_SCALAR), }, - ], - kind: Kind.DIRECTIVE_DEFINITION, - locations: stringArrayToNameNodeArray([ - ARGUMENT_DEFINITION_UPPER, - ENUM_UPPER, - ENUM_VALUE_UPPER, - FIELD_DEFINITION_UPPER, - INPUT_FIELD_DEFINITION_UPPER, - INPUT_OBJECT_UPPER, - INTERFACE_UPPER, - OBJECT_UPPER, - SCALAR_UPPER, - UNION_UPPER, - ]), - name: stringToNameNode(TAG), - repeatable: true, - }, -]; + }, + ], + kind: Kind.DIRECTIVE_DEFINITION, + locations: stringArrayToNameNodeArray([ + ARGUMENT_DEFINITION_UPPER, + ENUM_UPPER, + ENUM_VALUE_UPPER, + FIELD_DEFINITION_UPPER, + INPUT_FIELD_DEFINITION_UPPER, + INPUT_OBJECT_UPPER, + INTERFACE_UPPER, + OBJECT_UPPER, + SCALAR_UPPER, + UNION_UPPER, + ]), + name: stringToNameNode(TAG), + repeatable: true, +}; -export const VERSION_TWO_DIRECTIVE_DEFINITIONS: DirectiveDefinitionNode[] = [ - // @authenticated on ENUM | FIELD_DEFINITION | INTERFACE | OBJECT | SCALAR - { - kind: Kind.DIRECTIVE_DEFINITION, - locations: stringArrayToNameNodeArray([ - ENUM_UPPER, - FIELD_DEFINITION_UPPER, - INTERFACE_UPPER, - OBJECT_UPPER, - SCALAR_UPPER, - ]), - name: stringToNameNode(AUTHENTICATED), - repeatable: false, - }, - // @composeDirective is currently unimplemented - /* directive @composeDirective(name: String!) repeatable on SCHEMA */ - { - arguments: [ - { - kind: Kind.INPUT_VALUE_DEFINITION, - name: stringToNameNode(NAME), - type: { - kind: Kind.NON_NULL_TYPE, - type: stringToNamedTypeNode(STRING_SCALAR), - }, +export const BASE_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME = new Map([ + [DEPRECATED, DEPRECATED_DEFINITION], + [EXTENDS, EXTENDS_DEFINITION], + [EXTERNAL, EXTERNAL_DEFINITION], + [EVENTS_PUBLISH, EVENTS_PUBLISH_DEFINITION], + [EVENTS_REQUEST, EVENTS_REQUEST_DEFINITION], + [EVENTS_SUBSCRIBE, EVENTS_SUBSCRIBE_DEFINITION], + [KEY, KEY_DEFINITION], + [PROVIDES, PROVIDES_DEFINITION], + [REQUIRES, REQUIRES_DEFINITION], + [SPECIFIED_BY, SPECIFIED_BY_DEFINITION], + [TAG, TAG_DEFINITION], +]); + +// @authenticated on ENUM | FIELD_DEFINITION | INTERFACE | OBJECT | SCALAR +const AUTHENTICATED_DEFINITION: DirectiveDefinitionNode = { + kind: Kind.DIRECTIVE_DEFINITION, + locations: stringArrayToNameNodeArray([ + ENUM_UPPER, + FIELD_DEFINITION_UPPER, + INTERFACE_UPPER, + OBJECT_UPPER, + SCALAR_UPPER, + ]), + name: stringToNameNode(AUTHENTICATED), + repeatable: false, +}; + +// @composeDirective is currently unimplemented +/* directive @composeDirective(name: String!) repeatable on SCHEMA */ +const COMPOSE_DIRECTIVE_DEFINITION: DirectiveDefinitionNode = { + arguments: [ + { + kind: Kind.INPUT_VALUE_DEFINITION, + name: stringToNameNode(NAME), + type: { + kind: Kind.NON_NULL_TYPE, + type: stringToNamedTypeNode(STRING_SCALAR), }, - ], - kind: Kind.DIRECTIVE_DEFINITION, - locations: stringArrayToNameNodeArray([SCHEMA_UPPER]), - name: stringToNameNode(COMPOSE_DIRECTIVE), - repeatable: true, - }, - /* directive @inaccessible on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_OBJECT | - INPUT_FIELD_DEFINITION | INTERFACE | OBJECT | SCALAR | UNION - */ - { - kind: Kind.DIRECTIVE_DEFINITION, - locations: stringArrayToNameNodeArray([ - ARGUMENT_DEFINITION_UPPER, - ENUM_UPPER, - ENUM_VALUE_UPPER, - FIELD_DEFINITION_UPPER, - INPUT_FIELD_DEFINITION_UPPER, - INPUT_OBJECT_UPPER, - INTERFACE_UPPER, - OBJECT_UPPER, - SCALAR_UPPER, - UNION_UPPER, - ]), - name: stringToNameNode(INACCESSIBLE), - repeatable: false, - }, - // directive @interfaceObject on OBJECT - { - kind: Kind.DIRECTIVE_DEFINITION, - locations: stringArrayToNameNodeArray([OBJECT_UPPER]), - name: stringToNameNode(INTERFACE_OBJECT), - repeatable: false, - }, - // directive @link(url: String!, as: String!, for: String, import: [String]) repeatable on SCHEMA - { - arguments: [ - { - kind: Kind.INPUT_VALUE_DEFINITION, - name: stringToNameNode(URL_LOWER), - type: { - kind: Kind.NON_NULL_TYPE, - type: stringToNamedTypeNode(STRING_SCALAR), - }, + }, + ], + kind: Kind.DIRECTIVE_DEFINITION, + locations: stringArrayToNameNodeArray([SCHEMA_UPPER]), + name: stringToNameNode(COMPOSE_DIRECTIVE), + repeatable: true, +}; + +/* directive @inaccessible on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_OBJECT | + INPUT_FIELD_DEFINITION | INTERFACE | OBJECT | SCALAR | UNION +*/ +const INACCESSIBLE_DEFINITION: DirectiveDefinitionNode = { + kind: Kind.DIRECTIVE_DEFINITION, + locations: stringArrayToNameNodeArray([ + ARGUMENT_DEFINITION_UPPER, + ENUM_UPPER, + ENUM_VALUE_UPPER, + FIELD_DEFINITION_UPPER, + INPUT_FIELD_DEFINITION_UPPER, + INPUT_OBJECT_UPPER, + INTERFACE_UPPER, + OBJECT_UPPER, + SCALAR_UPPER, + UNION_UPPER, + ]), + name: stringToNameNode(INACCESSIBLE), + repeatable: false, +}; + +// directive @interfaceObject on OBJECT +const INTERFACE_OBJECT_DEFINITION: DirectiveDefinitionNode = { + kind: Kind.DIRECTIVE_DEFINITION, + locations: stringArrayToNameNodeArray([OBJECT_UPPER]), + name: stringToNameNode(INTERFACE_OBJECT), + repeatable: false, +}; + +// directive @link(url: String!, as: String!, for: String, import: [String]) repeatable on SCHEMA +const LINK_DEFINITION: DirectiveDefinitionNode = { + arguments: [ + { + kind: Kind.INPUT_VALUE_DEFINITION, + name: stringToNameNode(URL_LOWER), + type: { + kind: Kind.NON_NULL_TYPE, + type: stringToNamedTypeNode(STRING_SCALAR), }, - { - kind: Kind.INPUT_VALUE_DEFINITION, - name: stringToNameNode('as'), + }, + { + kind: Kind.INPUT_VALUE_DEFINITION, + name: stringToNameNode('as'), + type: stringToNamedTypeNode(STRING_SCALAR), + }, + { + kind: Kind.INPUT_VALUE_DEFINITION, + name: stringToNameNode('for'), + type: stringToNamedTypeNode(STRING_SCALAR), + }, + { + kind: Kind.INPUT_VALUE_DEFINITION, + name: stringToNameNode('import'), + type: { + kind: Kind.LIST_TYPE, type: stringToNamedTypeNode(STRING_SCALAR), }, - { - kind: Kind.INPUT_VALUE_DEFINITION, - name: stringToNameNode('for'), + }, + ], + kind: Kind.DIRECTIVE_DEFINITION, + locations: stringArrayToNameNodeArray([SCHEMA_UPPER]), + name: stringToNameNode(LINK), + repeatable: true, +}; + +// directive @override(from: String!) on FIELD_DEFINITION +const OVERRIDE_DEFINITION: DirectiveDefinitionNode = { + arguments: [ + { + kind: Kind.INPUT_VALUE_DEFINITION, + name: stringToNameNode(FROM), + type: { + kind: Kind.NON_NULL_TYPE, type: stringToNamedTypeNode(STRING_SCALAR), }, - { - kind: Kind.INPUT_VALUE_DEFINITION, - name: stringToNameNode('import'), + }, + ], + kind: Kind.DIRECTIVE_DEFINITION, + locations: stringArrayToNameNodeArray([FIELD_DEFINITION_UPPER]), + name: stringToNameNode(OVERRIDE), + repeatable: false, +}; + +// @requiresScopes(scopes: [[openfed__Scope!]!]!) on ENUM | FIELD_DEFINITION | INTERFACE | OBJECT | SCALAR +const REQUIRES_SCOPES_DEFINITION: DirectiveDefinitionNode = { + arguments: [ + { + kind: Kind.INPUT_VALUE_DEFINITION, + name: stringToNameNode(SCOPES), + type: { + kind: Kind.NON_NULL_TYPE, type: { kind: Kind.LIST_TYPE, - type: stringToNamedTypeNode(STRING_SCALAR), - }, - }, - ], - kind: Kind.DIRECTIVE_DEFINITION, - locations: stringArrayToNameNodeArray([SCHEMA_UPPER]), - name: stringToNameNode(LINK), - repeatable: true, - }, - // directive @override(from: String!) on FIELD_DEFINITION - { - arguments: [ - { - kind: Kind.INPUT_VALUE_DEFINITION, - name: stringToNameNode(FROM), - type: { - kind: Kind.NON_NULL_TYPE, - type: stringToNamedTypeNode(STRING_SCALAR), - }, - }, - ], - kind: Kind.DIRECTIVE_DEFINITION, - locations: stringArrayToNameNodeArray([FIELD_DEFINITION_UPPER]), - name: stringToNameNode(OVERRIDE), - repeatable: false, - }, - // @requiresScopes(scopes: [[openfed__Scope!]!]!) on ENUM | FIELD_DEFINITION | INTERFACE | OBJECT | SCALAR - { - arguments: [ - { - kind: Kind.INPUT_VALUE_DEFINITION, - name: stringToNameNode(SCOPES), - type: { - kind: Kind.NON_NULL_TYPE, type: { - kind: Kind.LIST_TYPE, + kind: Kind.NON_NULL_TYPE, type: { - kind: Kind.NON_NULL_TYPE, + kind: Kind.LIST_TYPE, type: { - kind: Kind.LIST_TYPE, - type: { - kind: Kind.NON_NULL_TYPE, - type: stringToNamedTypeNode(SCOPE_SCALAR), - }, + kind: Kind.NON_NULL_TYPE, + type: stringToNamedTypeNode(SCOPE_SCALAR), }, }, }, }, }, - ], - kind: Kind.DIRECTIVE_DEFINITION, - locations: stringArrayToNameNodeArray([ - ENUM_UPPER, - FIELD_DEFINITION_UPPER, - INTERFACE_UPPER, - OBJECT_UPPER, - SCALAR_UPPER, - ]), - name: stringToNameNode(REQUIRES_SCOPES), - repeatable: false, - }, - // directive @shareable on FIELD_DEFINITION | OBJECT - { - kind: Kind.DIRECTIVE_DEFINITION, - locations: stringArrayToNameNodeArray([FIELD_DEFINITION_UPPER, OBJECT_UPPER]), - name: stringToNameNode(SHAREABLE), - repeatable: false, - }, + }, + ], + kind: Kind.DIRECTIVE_DEFINITION, + locations: stringArrayToNameNodeArray([ + ENUM_UPPER, + FIELD_DEFINITION_UPPER, + INTERFACE_UPPER, + OBJECT_UPPER, + SCALAR_UPPER, + ]), + name: stringToNameNode(REQUIRES_SCOPES), + repeatable: false, +}; + +// directive @shareable on FIELD_DEFINITION | OBJECT +const SHAREABLE_DEFINITION: DirectiveDefinitionNode = { + kind: Kind.DIRECTIVE_DEFINITION, + locations: stringArrayToNameNodeArray([FIELD_DEFINITION_UPPER, OBJECT_UPPER]), + name: stringToNameNode(SHAREABLE), + repeatable: false, +}; + +export const V2_DIRECTIVE_DEFINITION_BY_DIRECTIVE_NAME = new Map([ + [AUTHENTICATED, AUTHENTICATED_DEFINITION], + [COMPOSE_DIRECTIVE, COMPOSE_DIRECTIVE_DEFINITION], + [INACCESSIBLE, INACCESSIBLE_DEFINITION], + [INTERFACE_OBJECT, INTERFACE_OBJECT_DEFINITION], + [LINK, LINK_DEFINITION], + [OVERRIDE, OVERRIDE_DEFINITION], + [REQUIRES_SCOPES, REQUIRES_SCOPES_DEFINITION], + [SHAREABLE, SHAREABLE_DEFINITION], +]); + +export const BASE_DIRECTIVE_DEFINITIONS: DirectiveDefinitionNode[] = [ + DEPRECATED_DEFINITION, + EXTENDS_DEFINITION, + EXTERNAL_DEFINITION, + EVENTS_PUBLISH_DEFINITION, + EVENTS_REQUEST_DEFINITION, + EVENTS_SUBSCRIBE_DEFINITION, + KEY_DEFINITION, + PROVIDES_DEFINITION, + REQUIRES_DEFINITION, + SPECIFIED_BY_DEFINITION, + TAG_DEFINITION, +]; + +export const VERSION_TWO_DIRECTIVE_DEFINITIONS: DirectiveDefinitionNode[] = [ + AUTHENTICATED_DEFINITION, + COMPOSE_DIRECTIVE_DEFINITION, + INACCESSIBLE_DEFINITION, + INTERFACE_OBJECT_DEFINITION, + LINK_DEFINITION, + OVERRIDE_DEFINITION, + REQUIRES_SCOPES_DEFINITION, + SHAREABLE_DEFINITION, ]; export const FIELD_SET_SCALAR_DEFINITION: ScalarTypeDefinitionNode = { @@ -458,3 +500,7 @@ export const SCOPE_SCALAR_DEFINITION: ScalarTypeDefinitionNode = { kind: Kind.SCALAR_TYPE_DEFINITION, name: stringToNameNode(SCOPE_SCALAR), }; + +export const MAXIMUM_TYPE_NESTING = 30; + +export const INHERITABLE_DIRECTIVE_NAMES = [EXTERNAL, SHAREABLE]; diff --git a/composition/src/utils/string-constants.ts b/composition/src/utils/string-constants.ts index 3a9cff891d..0c2f5f6efb 100644 --- a/composition/src/utils/string-constants.ts +++ b/composition/src/utils/string-constants.ts @@ -39,11 +39,14 @@ export const LINK = 'link'; export const KEY = 'key'; export const MUTATION = 'Mutation'; export const MUTATION_UPPER = 'MUTATION'; +export const N_A = 'N/A'; export const NAME = 'name'; export const OPERATION_TO_DEFAULT = 'operationTypeNodeToDefaultType'; export const OBJECT_UPPER = 'OBJECT'; export const OVERRIDE = 'override'; export const PARENTS = 'parents'; +export const PARENT_DEFINITION_DATA_MAP = 'parentDefinitionDataByParentTypeName'; +export const PARENT_EXTENSION_DATA_MAP = 'parentExtensionDataByParentTypeName'; export const PROVIDES = 'provides'; export const QUERY = 'Query'; export const QUERY_UPPER = 'QUERY'; @@ -74,3 +77,4 @@ export const URL_LOWER = 'url'; export const VARIABLE_DEFINITION_UPPER = 'VARIABLE_DEFINITION'; export const ROOT_TYPES = new Set([MUTATION, QUERY, SUBSCRIPTION]); +export const IGNORED_PARENT_DIRECTIVES = new Set([AUTHENTICATED, EXTENDS, REQUIRES_SCOPES]); diff --git a/composition/src/utils/utils.ts b/composition/src/utils/utils.ts index 246127021f..d759b9c505 100644 --- a/composition/src/utils/utils.ts +++ b/composition/src/utils/utils.ts @@ -1,11 +1,9 @@ -import { ConstDirectiveNode, Kind, StringValueNode } from 'graphql'; -import { AUTHENTICATED, FIELD, REQUIRES_SCOPES, SCOPES, UNION } from './string-constants'; +import { ConstDirectiveNode, ConstValueNode, FieldDefinitionNode, Kind, StringValueNode } from 'graphql'; +import { FIELD, REQUIRES_SCOPES, SCOPES, UNION } from './string-constants'; import { MultiGraph } from 'graphology'; import { invalidKeyFatalError } from '../errors/errors'; import { EnumTypeNode, InterfaceTypeNode, ObjectTypeNode, ScalarTypeNode, stringToNameNode } from '../ast/utils'; -import { FieldDefinitionNode } from 'graphql/index'; import { FieldConfiguration } from '../router-configuration/router-configuration'; -import { ConstValueNode } from 'graphql/language/ast'; export function areSetsEqual(set: Set, other: Set): boolean { if (set.size !== other.size) { @@ -463,8 +461,6 @@ export function mergeAuthorizationDataByAND( return true; } -export function addAuthorizationDataProperties(source: AuthorizationData, target: AuthorizationData) {} - export function upsertFieldAuthorizationData( fieldAuthorizationDataByFieldName: Map, incomingFieldAuthorizationData: FieldAuthorizationData, @@ -536,10 +532,10 @@ export function setAndGetValue(map: Map, key: K, value: V) { return value; } -export function generateAuthenticatedDirective(): ConstDirectiveNode { +export function generateSimpleDirective(name: string): ConstDirectiveNode { return { kind: Kind.DIRECTIVE, - name: stringToNameNode(AUTHENTICATED), + name: stringToNameNode(name), }; } diff --git a/composition/tests/entities.test.ts b/composition/tests/entities.test.ts index 87159a6be6..bc23576955 100644 --- a/composition/tests/entities.test.ts +++ b/composition/tests/entities.test.ts @@ -1,7 +1,7 @@ import { ConfigurationData, federateSubgraphs, - FieldContainer, + FederationFieldData, ObjectContainer, RootTypeFieldData, shareableFieldDefinitionsError, @@ -235,7 +235,7 @@ describe('Entity Tests', () => { shareableFieldDefinitionsError( { node: { name: { value: 'Entity' } }, - fields: new Map([ + fields: new Map([ [ 'id', { @@ -244,7 +244,7 @@ describe('Entity Tests', () => { ['subgraph-l', true], ['subgraph-m', false], ]), - } as FieldContainer, + } as FederationFieldData, ], [ 'object', @@ -254,7 +254,7 @@ describe('Entity Tests', () => { ['subgraph-l', true], ['subgraph-m', false], ]), - } as FieldContainer, + } as FederationFieldData, ], [ 'age', @@ -264,7 +264,7 @@ describe('Entity Tests', () => { ['subgraph-l', true], ['subgraph-m', false], ]), - } as FieldContainer, + } as FederationFieldData, ], ]), } as ObjectContainer, @@ -275,7 +275,7 @@ describe('Entity Tests', () => { shareableFieldDefinitionsError( { node: { name: { value: 'Object' } }, - fields: new Map([ + fields: new Map([ [ 'id', { @@ -284,7 +284,7 @@ describe('Entity Tests', () => { ['subgraph-l', true], ['subgraph-m', false], ]), - } as FieldContainer, + } as FederationFieldData, ], [ 'name', @@ -294,7 +294,7 @@ describe('Entity Tests', () => { ['subgraph-l', true], ['subgraph-m', false], ]), - } as FieldContainer, + } as FederationFieldData, ], ]), } as ObjectContainer, diff --git a/composition/tests/external.test.ts b/composition/tests/external.test.ts index 0fa16434de..6934e5036a 100644 --- a/composition/tests/external.test.ts +++ b/composition/tests/external.test.ts @@ -1,20 +1,121 @@ import { describe, expect, test } from 'vitest'; -import { federateSubgraphs, Subgraph } from '../src'; +import { federateSubgraphs, normalizeSubgraphFromString, Subgraph } from '../src'; import { parse } from 'graphql'; import { + baseDirectiveDefinitions, normalizeString, schemaToSortedNormalizedString, versionTwoSchemaQueryAndPersistedDirectiveDefinitions, } from './utils/utils'; -describe('External tests', () => { - test('that @external does not contribute to shareability checks #1.1', () => { - const { errors, federationResult } = federateSubgraphs([subgraphA, subgraphB]); - expect(errors).toBeUndefined(); - expect(schemaToSortedNormalizedString(federationResult!.federatedGraphSchema)).toBe( - normalizeString( - versionTwoSchemaQueryAndPersistedDirectiveDefinitions + - ` +describe('@external directive tests', () => { + describe('Normalization tests', () => { + // TODO external validation (fieldset/interfaces) + test('that @external declared on the object level applies to its defined fields #1.1', () => { + const { errors, normalizationResult } = normalizeSubgraphFromString(` + type Object { + externalFieldOne(argOne: String!, argTwo: Boolean!): String @external + nonExternalFieldOne: Boolean! + } + + extend type Object @external { + externalFieldTwo: Int! + externalFieldThree: Float + } + + type Object @external @extends { + """ + This is the description for Object.externalFieldFour + """ + externalFieldFour: String! + } + + extend type Object { + nonExternalFieldTwo(argOne: Int, """This is a description for Object.nonExternalFieldTwo.argTwo""" argTwo: Boolean!): Float! + nonExternalFieldThree: Boolean + } + `); + expect(errors).toBeUndefined(); + expect(schemaToSortedNormalizedString(normalizationResult!.schema)).toBe( + normalizeString( + baseDirectiveDefinitions + + ` + type Object { + """ + This is the description for Object.externalFieldFour + """ + externalFieldFour: String! @external + externalFieldOne(argOne: String!, argTwo: Boolean!): String @external + externalFieldThree: Float @external + externalFieldTwo: Int! @external + nonExternalFieldOne: Boolean! + nonExternalFieldThree: Boolean + nonExternalFieldTwo(argOne: Int"""This is a description for Object.nonExternalFieldTwo.argTwo"""argTwo: Boolean!): Float! + } + + scalar openfed__FieldSet + `, + ), + ); + }); + + test('that @external declared on the object level applies to all its defined fields #1.2', () => { + const { errors, normalizationResult } = normalizeSubgraphFromString(` + type Object @external @extends { + """ + This is the description for Object.externalFieldFour + """ + externalFieldFour: String! + } + + extend type Object { + nonExternalFieldTwo(argOne: Int, """This is a description for Object.nonExternalFieldTwo.argTwo""" argTwo: Boolean!): Float! + nonExternalFieldThree: Boolean + } + + extend type Object @external { + externalFieldTwo: Int! + externalFieldThree: Float + } + + type Object { + externalFieldOne(argOne: String!, argTwo: Boolean!): String @external + nonExternalFieldOne: Boolean! + } + `); + expect(errors).toBeUndefined(); + expect(schemaToSortedNormalizedString(normalizationResult!.schema)).toBe( + normalizeString( + baseDirectiveDefinitions + + ` + type Object { + """ + This is the description for Object.externalFieldFour + """ + externalFieldFour: String! @external + externalFieldOne(argOne: String!, argTwo: Boolean!): String @external + externalFieldThree: Float @external + externalFieldTwo: Int! @external + nonExternalFieldOne: Boolean! + nonExternalFieldThree: Boolean + nonExternalFieldTwo(argOne: Int"""This is a description for Object.nonExternalFieldTwo.argTwo"""argTwo: Boolean!): Float! + } + + scalar openfed__FieldSet + `, + ), + ); + }); + }); + + describe('Federation tests', () => { + test('that @external does not contribute to shareability checks #1.1', () => { + const { errors, federationResult } = federateSubgraphs([subgraphA, subgraphB]); + expect(errors).toBeUndefined(); + expect(schemaToSortedNormalizedString(federationResult!.federatedGraphSchema)).toBe( + normalizeString( + versionTwoSchemaQueryAndPersistedDirectiveDefinitions + + ` type Entity implements Interface { age: Int! id: ID! @@ -41,17 +142,17 @@ describe('External tests', () => { scalar openfed__Scope `, - ), - ); - }); + ), + ); + }); - test('that @external does not contribute to shareability checks #1.2', () => { - const { errors, federationResult } = federateSubgraphs([subgraphB, subgraphA]); - expect(errors).toBeUndefined(); - expect(schemaToSortedNormalizedString(federationResult!.federatedGraphSchema)).toBe( - normalizeString( - versionTwoSchemaQueryAndPersistedDirectiveDefinitions + - ` + test('that @external does not contribute to shareability checks #1.2', () => { + const { errors, federationResult } = federateSubgraphs([subgraphB, subgraphA]); + expect(errors).toBeUndefined(); + expect(schemaToSortedNormalizedString(federationResult!.federatedGraphSchema)).toBe( + normalizeString( + versionTwoSchemaQueryAndPersistedDirectiveDefinitions + + ` type Entity implements Interface { age: Int! id: ID! @@ -78,17 +179,17 @@ describe('External tests', () => { scalar openfed__Scope `, - ), - ); - }); + ), + ); + }); - test('that @external does not contribute to shareability checks #2.1', () => { - const { errors, federationResult } = federateSubgraphs([subgraphA, subgraphB, subgraphC]); - expect(errors).toBeUndefined(); - expect(schemaToSortedNormalizedString(federationResult!.federatedGraphSchema)).toBe( - normalizeString( - versionTwoSchemaQueryAndPersistedDirectiveDefinitions + - ` + test('that @external does not contribute to shareability checks #2.1', () => { + const { errors, federationResult } = federateSubgraphs([subgraphA, subgraphB, subgraphC]); + expect(errors).toBeUndefined(); + expect(schemaToSortedNormalizedString(federationResult!.federatedGraphSchema)).toBe( + normalizeString( + versionTwoSchemaQueryAndPersistedDirectiveDefinitions + + ` type Entity implements Interface { age: Int! field: String! @@ -117,17 +218,17 @@ describe('External tests', () => { scalar openfed__Scope `, - ), - ); - }); + ), + ); + }); - test('that @external does not contribute to shareability checks #2.2', () => { - const { errors, federationResult } = federateSubgraphs([subgraphA, subgraphC, subgraphB]); - expect(errors).toBeUndefined(); - expect(schemaToSortedNormalizedString(federationResult!.federatedGraphSchema)).toBe( - normalizeString( - versionTwoSchemaQueryAndPersistedDirectiveDefinitions + - ` + test('that @external does not contribute to shareability checks #2.2', () => { + const { errors, federationResult } = federateSubgraphs([subgraphA, subgraphC, subgraphB]); + expect(errors).toBeUndefined(); + expect(schemaToSortedNormalizedString(federationResult!.federatedGraphSchema)).toBe( + normalizeString( + versionTwoSchemaQueryAndPersistedDirectiveDefinitions + + ` type Entity implements Interface { age: Int! field: String! @@ -156,17 +257,17 @@ describe('External tests', () => { scalar openfed__Scope `, - ), - ); - }); + ), + ); + }); - test('that @external does not contribute to shareability checks #2.3', () => { - const { errors, federationResult } = federateSubgraphs([subgraphB, subgraphA, subgraphC]); - expect(errors).toBeUndefined(); - expect(schemaToSortedNormalizedString(federationResult!.federatedGraphSchema)).toBe( - normalizeString( - versionTwoSchemaQueryAndPersistedDirectiveDefinitions + - ` + test('that @external does not contribute to shareability checks #2.3', () => { + const { errors, federationResult } = federateSubgraphs([subgraphB, subgraphA, subgraphC]); + expect(errors).toBeUndefined(); + expect(schemaToSortedNormalizedString(federationResult!.federatedGraphSchema)).toBe( + normalizeString( + versionTwoSchemaQueryAndPersistedDirectiveDefinitions + + ` type Entity implements Interface { age: Int! field: String! @@ -195,17 +296,17 @@ describe('External tests', () => { scalar openfed__Scope `, - ), - ); - }); + ), + ); + }); - test('that @external does not contribute to shareability checks #2.4', () => { - const { errors, federationResult } = federateSubgraphs([subgraphB, subgraphC, subgraphA]); - expect(errors).toBeUndefined(); - expect(schemaToSortedNormalizedString(federationResult!.federatedGraphSchema)).toBe( - normalizeString( - versionTwoSchemaQueryAndPersistedDirectiveDefinitions + - ` + test('that @external does not contribute to shareability checks #2.4', () => { + const { errors, federationResult } = federateSubgraphs([subgraphB, subgraphC, subgraphA]); + expect(errors).toBeUndefined(); + expect(schemaToSortedNormalizedString(federationResult!.federatedGraphSchema)).toBe( + normalizeString( + versionTwoSchemaQueryAndPersistedDirectiveDefinitions + + ` type Entity implements Interface { age: Int! field: String! @@ -234,17 +335,17 @@ describe('External tests', () => { scalar openfed__Scope `, - ), - ); - }); + ), + ); + }); - test('that @external does not contribute to shareability checks #2.5', () => { - const { errors, federationResult } = federateSubgraphs([subgraphC, subgraphA, subgraphB]); - expect(errors).toBeUndefined(); - expect(schemaToSortedNormalizedString(federationResult!.federatedGraphSchema)).toBe( - normalizeString( - versionTwoSchemaQueryAndPersistedDirectiveDefinitions + - ` + test('that @external does not contribute to shareability checks #2.5', () => { + const { errors, federationResult } = federateSubgraphs([subgraphC, subgraphA, subgraphB]); + expect(errors).toBeUndefined(); + expect(schemaToSortedNormalizedString(federationResult!.federatedGraphSchema)).toBe( + normalizeString( + versionTwoSchemaQueryAndPersistedDirectiveDefinitions + + ` type Entity implements Interface { age: Int! field: String! @@ -273,17 +374,17 @@ describe('External tests', () => { scalar openfed__Scope `, - ), - ); - }); + ), + ); + }); - test('that @external does not contribute to shareability checks #2.6', () => { - const { errors, federationResult } = federateSubgraphs([subgraphC, subgraphB, subgraphA]); - expect(errors).toBeUndefined(); - expect(schemaToSortedNormalizedString(federationResult!.federatedGraphSchema)).toBe( - normalizeString( - versionTwoSchemaQueryAndPersistedDirectiveDefinitions + - ` + test('that @external does not contribute to shareability checks #2.6', () => { + const { errors, federationResult } = federateSubgraphs([subgraphC, subgraphB, subgraphA]); + expect(errors).toBeUndefined(); + expect(schemaToSortedNormalizedString(federationResult!.federatedGraphSchema)).toBe( + normalizeString( + versionTwoSchemaQueryAndPersistedDirectiveDefinitions + + ` type Entity implements Interface { age: Int! field: String! @@ -312,8 +413,9 @@ describe('External tests', () => { scalar openfed__Scope `, - ), - ); + ), + ); + }); }); }); diff --git a/composition/tests/inaccessible.test.ts b/composition/tests/inaccessible.test.ts index f8007edc3c..da12d059d7 100644 --- a/composition/tests/inaccessible.test.ts +++ b/composition/tests/inaccessible.test.ts @@ -2,7 +2,7 @@ import { describe, expect, test } from 'vitest'; import { allFieldDefinitionsAreInaccessibleError, federateSubgraphs, - FieldContainer, + FederationFieldData, ImplementationErrors, InvalidFieldImplementation, normalizeSubgraph, @@ -42,7 +42,7 @@ describe('@inaccessible tests', () => { shareableFieldDefinitionsError( { node: { name: { value: 'Entity' } }, - fields: new Map([ + fields: new Map([ [ 'name', { @@ -51,7 +51,7 @@ describe('@inaccessible tests', () => { ['subgraph-a', true], ['subgraph-c', false], ]), - } as FieldContainer, + } as FederationFieldData, ], ]), } as ObjectContainer, diff --git a/composition/tests/normalization.test.ts b/composition/tests/normalization.test.ts index 82d99f633f..ca100b4aaa 100644 --- a/composition/tests/normalization.test.ts +++ b/composition/tests/normalization.test.ts @@ -3,14 +3,14 @@ import { duplicateEnumValueDefinitionError, duplicateFieldDefinitionError, duplicateTypeDefinitionError, - duplicateUnionMemberError, + duplicateUnionMemberExtensionError, invalidDirectiveError, invalidKeyDirectivesError, invalidProvidesOrRequiresDirectivesError, invalidSelectionSetErrorMessage, noBaseTypeExtensionError, normalizeSubgraphFromString, - undefinedDirectiveError, + undefinedDirectiveErrorMessage, undefinedFieldInFieldSetErrorMessage, undefinedTypeError, unparsableFieldSetErrorMessage, @@ -18,7 +18,12 @@ import { import { readFileSync } from 'fs'; import { join } from 'node:path'; import { describe, expect, test } from 'vitest'; -import { normalizeString, versionOneBaseSchema, versionTwoBaseSchema } from './utils/utils'; +import { + normalizeString, + schemaToSortedNormalizedString, + versionOneBaseSchema, + versionTwoBaseSchema, +} from './utils/utils'; describe('Normalization tests', () => { test('that an unparsable graph returns an error', () => { @@ -76,7 +81,11 @@ describe('Normalization tests', () => { `); expect(errors).toBeDefined(); expect(errors).toHaveLength(1); - expect(errors![0]).toStrictEqual(undefinedDirectiveError('UnknownDirective', 'Example.string')); + expect(errors![0]).toStrictEqual( + invalidDirectiveError('UnknownDirective', 'Example.string', [ + undefinedDirectiveErrorMessage('UnknownDirective', 'Example.string'), + ]), + ); }); test('that duplicate directive definitions return an error', () => { @@ -651,7 +660,7 @@ describe('Normalization tests', () => { `); expect(errors).toBeDefined(); expect(errors).toHaveLength(1); - expect(errors![0]).toStrictEqual(duplicateUnionMemberError('Muffin', 'Cats')); + expect(errors![0]).toStrictEqual(duplicateUnionMemberExtensionError('Muffin', 'Cats')); }); test('that redefining a union returns an error', () => { @@ -943,9 +952,9 @@ describe('Normalization tests', () => { name: String } - type ProductDimension @shareable { - size: String - weight: Float + type ProductDimension { + size: String @shareable + weight: Float @shareable } type User @key(fields: "email") { @@ -1757,4 +1766,85 @@ describe('Normalization tests', () => { ), ); }); + + test('that a subgraph is normalized correctly', () => { + const { errors, normalizationResult } = normalizeSubgraphFromString(` + enum Enum @requiresScopes(scopes: [["read:enum"]]) { + VALUE + } + + """ + This is the description for Interface + """ + interface Interface @requiresScopes(scopes: [["read:private"]]) { + field(argumentOne: String!): Enum! @authenticated + } + + """ + This is the description for Object + """ + type Object implements Interface @requiresScopes(scopes: [["read:object"]]) { + """ + This is the description for Object.field + """ + field( + """ + This is the description for the argumentOne argument of Object.field + """ + argumentOne: String! + ): Enum! + } + `); + expect(errors).toBeUndefined(); + expect(schemaToSortedNormalizedString(normalizationResult!.schema)).toBe( + normalizeString(` + directive @authenticated on ENUM | FIELD_DEFINITION | INTERFACE | OBJECT | SCALAR + directive @composeDirective(name: String!) repeatable on SCHEMA + directive @eventsPublish(sourceID: String, topic: String!) on FIELD_DEFINITION + directive @eventsRequest(sourceID: String, topic: String!) on FIELD_DEFINITION + directive @eventsSubscribe(sourceID: String, topic: String!) on FIELD_DEFINITION + directive @extends on INTERFACE | OBJECTdirective @external on FIELD_DEFINITION | OBJECT + directive @inaccessible on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION + directive @interfaceObject on OBJECT + directive @key(fields: openfed__FieldSet!, resolvable: Boolean = true) repeatable on INTERFACE | OBJECT + directive @link(as: String, for: String, import: [String], url: String!) repeatable on SCHEMA + directive @override(from: String!) on FIELD_DEFINITION + directive @provides(fields: openfed__FieldSet!) on FIELD_DEFINITION + directive @requires(fields: openfed__FieldSet!) on FIELD_DEFINITION + directive @requiresScopes(scopes: [[openfed__Scope!]!]!) on ENUM | FIELD_DEFINITION | INTERFACE | OBJECT | SCALAR + directive @shareable on FIELD_DEFINITION | OBJECT + directive @tag(name: String!) repeatable on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION + + enum Enum { + VALUE + } + + """ + This is the description for Interface + """ + interface Interface { + field(argumentOne: String!): Enum! @authenticated @requiresScopes(scopes: [["read:private", "read:enum"]]) + } + + """ + This is the description for Object + """ + type Object implements Interface { + """ + This is the description for Object.field + """ + field( + """ + This is the description for the argumentOne argument of Object.field + """ + argumentOne: String! + ): Enum! @authenticated @requiresScopes(scopes: [["read:object", "read:enum", "read:private"]]) + } + + scalar openfed__FieldSet + + scalar openfed__Scope + `), + ); + }); }); diff --git a/composition/tests/override.test.ts b/composition/tests/override.test.ts index a17aadbea8..6f05bfe67c 100644 --- a/composition/tests/override.test.ts +++ b/composition/tests/override.test.ts @@ -5,9 +5,9 @@ import { ConfigurationData, duplicateOverriddenFieldErrorMessage, duplicateOverriddenFieldsError, - equivalentSourceAndTargetOverrideError, + equivalentSourceAndTargetOverrideErrorMessage, federateSubgraphs, - FieldContainer, + FederationFieldData, invalidDirectiveError, invalidDirectiveLocationErrorMessage, normalizeSubgraph, @@ -18,11 +18,10 @@ import { } from '../src'; import { documentNodeToNormalizedString, - schemaToSortedNormalizedString, normalizeString, + schemaToSortedNormalizedString, versionTwoPersistedBaseSchema, versionTwoSchemaQueryAndPersistedDirectiveDefinitions, - sortedNormalizedVersionTwoSchemaString, } from './utils/utils'; import { OVERRIDE } from '../src/utils/string-constants'; import { invalidOverrideTargetSubgraphNameWarning } from '../src/warnings/warnings'; @@ -64,7 +63,11 @@ describe('@override directive tests', () => { test('that an error is returned if the source and target subgraph name for @override are equivalent', () => { const { errors } = normalizeSubgraph(subgraphQ.definitions, 'subgraph-q'); expect(errors).toBeDefined(); - expect(errors![0]).toStrictEqual(equivalentSourceAndTargetOverrideError('subgraph-q', 'Entity.name')); + expect(errors![0]).toStrictEqual( + invalidDirectiveError(OVERRIDE, 'Entity.name', [ + equivalentSourceAndTargetOverrideErrorMessage('subgraph-q', 'Entity.name'), + ]), + ); }); test('that an overridden field does not need to be declared shareable #1.1', () => { @@ -442,7 +445,7 @@ describe('@override directive tests', () => { shareableFieldDefinitionsError( { node: { name: { value: 'Entity' } }, - fields: new Map([ + fields: new Map([ [ 'name', { @@ -451,7 +454,7 @@ describe('@override directive tests', () => { ['subgraph-c', false], ['subgraph-e', true], ]), - } as FieldContainer, + } as FederationFieldData, ], ]), } as ObjectContainer, @@ -467,7 +470,7 @@ describe('@override directive tests', () => { shareableFieldDefinitionsError( { node: { name: { value: 'Entity' } }, - fields: new Map([ + fields: new Map([ [ 'name', { @@ -476,7 +479,7 @@ describe('@override directive tests', () => { ['subgraph-a', false], ['subgraph-j', true], ]), - } as FieldContainer, + } as FederationFieldData, ], ]), } as ObjectContainer, diff --git a/composition/tests/router-configuration.test.ts b/composition/tests/router-configuration.test.ts index 1435bd164c..9357ea3887 100644 --- a/composition/tests/router-configuration.test.ts +++ b/composition/tests/router-configuration.test.ts @@ -412,7 +412,7 @@ describe('Router Configuration tests', () => { ); }); - test('that external fields that are part of a key FieldSet are included in the root node', () => { + test('that external fields that are part of a key FieldSet are not included in the root node #1', () => { const { errors, normalizationResult } = normalizeSubgraphFromString(` type Entity @key(fields: "id") { id: ID! @external @@ -425,7 +425,7 @@ describe('Router Configuration tests', () => { [ 'Entity', { - fieldNames: new Set(['id']), + fieldNames: new Set([]), isRootNode: true, keys: [{ fieldName: '', selectionSet: 'id' }], typeName: 'Entity', @@ -435,7 +435,7 @@ describe('Router Configuration tests', () => { ); }); - test('that external fields that are not part of a key FieldSet are not included in the root node', () => { + test('that external fields that are not part of a key FieldSet are not included in the root node #2', () => { const { errors, normalizationResult } = normalizeSubgraphFromString(` type Entity @key(fields: "id") { id: ID! @external @@ -449,7 +449,7 @@ describe('Router Configuration tests', () => { [ 'Entity', { - fieldNames: new Set(['id']), + fieldNames: new Set([]), isRootNode: true, keys: [{ fieldName: '', selectionSet: 'id' }], typeName: 'Entity', @@ -499,7 +499,7 @@ describe('Router Configuration tests', () => { [ 'Entity', { - fieldNames: new Set(['id']), + fieldNames: new Set([]), isRootNode: true, keys: [{ fieldName: '', selectionSet: 'id' }], typeName: 'Entity', diff --git a/composition/tests/shareable.test.ts b/composition/tests/shareable.test.ts new file mode 100644 index 0000000000..c2e3db867d --- /dev/null +++ b/composition/tests/shareable.test.ts @@ -0,0 +1,105 @@ +import { describe, expect, test } from 'vitest'; +import { normalizeSubgraphFromString } from '../src'; +import { normalizeString, schemaToSortedNormalizedString, versionTwoDirectiveDefinitions } from './utils/utils'; + +describe('@shareable directive tests', () => { + describe('Normalization tests', () => { + test('that @shareable declared on the object level applies to all its defined fields #1.1', () => { + const { errors, normalizationResult } = normalizeSubgraphFromString(` + type Object { + shareableFieldOne(argOne: String!, argTwo: Boolean!): String @shareable + nonShareableFieldOne: Boolean! + } + + extend type Object @shareable { + shareableFieldTwo: Int! + shareableFieldThree: Float + } + + type Object @shareable @extends { + """ + This is the description for Object.shareableFieldFour + """ + shareableFieldFour: String! + } + + extend type Object { + nonShareableFieldTwo(argOne: Int, """This is a description for Object.nonShareableFieldTwo.argTwo""" argTwo: Boolean!): Float! + nonShareableFieldThree: Boolean + } + `); + expect(errors).toBeUndefined(); + expect(schemaToSortedNormalizedString(normalizationResult!.schema)).toBe( + normalizeString( + versionTwoDirectiveDefinitions + + ` + type Object { + nonShareableFieldOne: Boolean! + nonShareableFieldThree: Boolean + nonShareableFieldTwo(argOne: Int"""This is a description for Object.nonShareableFieldTwo.argTwo"""argTwo: Boolean!): Float! + """ + This is the description for Object.shareableFieldFour + """ + shareableFieldFour: String! @shareable + shareableFieldOne(argOne: String!, argTwo: Boolean!): String @shareable + shareableFieldThree: Float @shareable + shareableFieldTwo: Int! @shareable + } + + scalar openfed__FieldSet + scalar openfed__Scope + `, + ), + ); + }); + + test('that @shareable declared on the object level applies to all its defined fields #1.2', () => { + const { errors, normalizationResult } = normalizeSubgraphFromString(` + type Object @shareable @extends { + """ + This is the description for Object.shareableFieldFour + """ + shareableFieldFour: String! + } + + extend type Object { + nonShareableFieldTwo(argOne: Int, """This is a description for Object.nonShareableFieldTwo.argTwo""" argTwo: Boolean!): Float! + nonShareableFieldThree: Boolean + } + + extend type Object @shareable { + shareableFieldTwo: Int! + shareableFieldThree: Float + } + + type Object { + shareableFieldOne(argOne: String!, argTwo: Boolean!): String @shareable + nonShareableFieldOne: Boolean! + } + `); + expect(errors).toBeUndefined(); + expect(schemaToSortedNormalizedString(normalizationResult!.schema)).toBe( + normalizeString( + versionTwoDirectiveDefinitions + + ` + type Object { + nonShareableFieldOne: Boolean! + nonShareableFieldThree: Boolean + nonShareableFieldTwo(argOne: Int"""This is a description for Object.nonShareableFieldTwo.argTwo"""argTwo: Boolean!): Float! + """ + This is the description for Object.shareableFieldFour + """ + shareableFieldFour: String! @shareable + shareableFieldOne(argOne: String!, argTwo: Boolean!): String @shareable + shareableFieldThree: Float @shareable + shareableFieldTwo: Int! @shareable + } + + scalar openfed__FieldSet + scalar openfed__Scope + `, + ), + ); + }); + }); +}); diff --git a/composition/tests/type-merging.test.ts b/composition/tests/type-merging.test.ts index ca7fe5caff..a61017017b 100644 --- a/composition/tests/type-merging.test.ts +++ b/composition/tests/type-merging.test.ts @@ -1,4 +1,9 @@ -import { getLeastRestrictiveMergedTypeNode, getMostRestrictiveMergedTypeNode, MutableTypeNode } from '../src'; +import { + getLeastRestrictiveMergedTypeNode, + getMostRestrictiveMergedTypeNode, + MutableIntermediateTypeNode, + MutableTypeNode, +} from '../src'; import { Kind, TypeNode } from 'graphql'; import { describe, expect, test } from 'vitest'; @@ -210,8 +215,8 @@ describe('getMergedTypeNode Tests', () => { const stringToTypeNode = (input: string): TypeNode => { input = input.replaceAll('[', ''); - let typeNode: MutableTypeNode; - let lastNode: MutableTypeNode | undefined; + let typeNode: MutableIntermediateTypeNode; + let lastNode: MutableIntermediateTypeNode | undefined; const lastIndex = input.length - 1; for (let i = lastIndex; i > -1; i--) { const character = input[i]; diff --git a/composition/tests/unions.test.ts b/composition/tests/unions.test.ts index eb12e1e0f9..b172166600 100644 --- a/composition/tests/unions.test.ts +++ b/composition/tests/unions.test.ts @@ -1,28 +1,34 @@ -import { federateSubgraphs, invalidUnionError, Subgraph } from '../src'; +import { federateSubgraphs, noDefinedUnionMembersError, Subgraph, subgraphValidationError } from '../src'; import { parse } from 'graphql'; import { describe, expect, test } from 'vitest'; -import { documentNodeToNormalizedString, normalizeString, versionOnePersistedBaseSchema } from './utils/utils'; +import { + normalizeString, + schemaToSortedNormalizedString, + versionOneSchemaQueryAndPersistedDirectiveDefinitions, +} from './utils/utils'; describe('Union federation tests', () => { - test('that unions merge by union', () => { + test('that unions merge by union #1.1', () => { const { errors, federationResult } = federateSubgraphs([subgraphA, subgraphB]); expect(errors).toBeUndefined(); const federatedGraph = federationResult!.federatedGraphAST; - expect(documentNodeToNormalizedString(federatedGraph)).toBe( + expect(schemaToSortedNormalizedString(federationResult!.federatedGraphSchema)).toBe( normalizeString( - versionOnePersistedBaseSchema + + versionOneSchemaQueryAndPersistedDirectiveDefinitions + ` - union Starters = Bulbasaur | Squirtle | Charmander | Chikorita | Totodile | Cyndaquil - type Bulbasaur { name: String! } - type Squirtle { + type Charmander { + name: String! + } + + type Chikorita { name: String! } - type Charmander { + type Cyndaquil { name: String! } @@ -30,26 +36,232 @@ describe('Union federation tests', () => { starter: Starters } - type Chikorita { + type Squirtle { name: String! } + union Starters = Bulbasaur | Charmander | Chikorita | Cyndaquil | Squirtle | Totodile + type Totodile { name: String! } + `, + ), + ); + }); + + test('that unions merge by union #1.2', () => { + const { errors, federationResult } = federateSubgraphs([subgraphB, subgraphA]); + expect(errors).toBeUndefined(); + const federatedGraph = federationResult!.federatedGraphAST; + expect(schemaToSortedNormalizedString(federationResult!.federatedGraphSchema)).toBe( + normalizeString( + versionOneSchemaQueryAndPersistedDirectiveDefinitions + + ` + type Bulbasaur { + name: String! + } + + type Charmander { + name: String! + } + + type Chikorita { + name: String! + } type Cyndaquil { name: String! } + + type Query { + starter: Starters + } + + type Squirtle { + name: String! + } + + union Starters = Bulbasaur | Charmander | Chikorita | Cyndaquil | Squirtle | Totodile + + type Totodile { + name: String! + } `, ), ); }); - test('that unions with no members throw an error', () => { + test('that an error is returned if a union has no members #1.1', () => { const { errors } = federateSubgraphs([subgraphB, subgraphC]); expect(errors).toBeDefined(); - expect(errors![0].message).equals(invalidUnionError('Starters').message); + expect(errors![0]).toStrictEqual(subgraphValidationError('subgraph-c', [noDefinedUnionMembersError('Starters')])); + }); + + test('that an error is returned if a union has no members #1.1', () => { + const { errors } = federateSubgraphs([subgraphC, subgraphB]); + expect(errors).toBeDefined(); + expect(errors![0]).toStrictEqual(subgraphValidationError('subgraph-c', [noDefinedUnionMembersError('Starters')])); + }); + + test('that union extensions federate correctly #1.1', () => { + const { errors, federationResult } = federateSubgraphs([subgraphD, subgraphE]); + expect(errors).toBeUndefined(); + expect(schemaToSortedNormalizedString(federationResult!.federatedGraphSchema)).toBe( + normalizeString( + versionOneSchemaQueryAndPersistedDirectiveDefinitions + + ` + """ + 001 Kanto + """ + type Bulbasaur { + """ + The Kanto Pokemon's name + """ + name: String! + } + + """ + 004 of 150 + """ + type Charmander { + """ + The Kanto Pokemon's name + """ + name: String! + } + + """ + 152 + """ + type Chikorita { + """ + The Pokemon's name + """ + name: String! + } + + """ + 155 + """ + type Cyndaquil { + """ + The Pokemon's name + """ + name: String! + } + + type Query { + starters: [Starters!]! + } + + """ + 007 Kanto + """ + type Squirtle { + """ + The Pokemon's English name + """ + name: String! + } + + """ + The union of Pokemon starters (English names) + """ + union Starters = Bulbasaur | Charmander | Chikorita | Cyndaquil | Squirtle | Totodile + + """ + 158 + """ + type Totodile { + """ + The Pokemon's name + """ + name: String! + } + `, + ), + ); + }); + + test('that union extensions federate correctly #1.2', () => { + const { errors, federationResult } = federateSubgraphs([subgraphE, subgraphD]); + expect(errors).toBeUndefined(); + expect(schemaToSortedNormalizedString(federationResult!.federatedGraphSchema)).toBe( + normalizeString( + versionOneSchemaQueryAndPersistedDirectiveDefinitions + + ` + """ + 001 Kanto + """ + type Bulbasaur { + """ + The Kanto Pokemon's name + """ + name: String! + } + + """ + 004 of 150 + """ + type Charmander { + """ + The Kanto Pokemon's name + """ + name: String! + } + + """ + 152 + """ + type Chikorita { + """ + The Pokemon's name + """ + name: String! + } + + """ + 155 + """ + type Cyndaquil { + """ + The Pokemon's name + """ + name: String! + } + + type Query { + starters: [Starters!]! + } + + """ + 007 Kanto + """ + type Squirtle { + """ + The Pokemon's English name + """ + name: String! + } + + """ + The union of Pokemon starters (English names) + """ + union Starters = Bulbasaur | Charmander | Chikorita | Cyndaquil | Squirtle | Totodile + + """ + 158 + """ + type Totodile { + """ + The Pokemon's name + """ + name: String! + } + `, + ), + ); }); }); @@ -106,3 +318,131 @@ const subgraphC: Subgraph = { url: '', definitions: parse(`union Starters`), }; + +const subgraphD: Subgraph = { + name: 'subgraph-d', + url: '', + definitions: parse(` + type Query { + starters: [Starters!]! + } + + """ + 001 + """ + type Bulbasaur { + """ + The Pokemon's name + """ + name: String! + } + + """ + 004 of 150 + """ + type Charmander { + """ + The Pokemon's name + """ + name: String! + } + + """ + 007 + """ + type Squirtle { + """ + The Pokemon's English name + """ + name: String! + } + + """ + The union of Pokemon starters (English names) + """ + union Starters = Bulbasaur + + extend union Starters = Squirtle + + extend union Starters = Charmander + `), +}; + +const subgraphE: Subgraph = { + name: 'subgraph-e', + url: '', + definitions: parse(` + type Query { + starters: [Starters!]! + } + + """ + 152 + """ + type Chikorita { + """ + The Pokemon's name + """ + name: String! + } + + """ + 155 + """ + type Cyndaquil { + """ + The Pokemon's name + """ + name: String! + } + + """ + 158 + """ + type Totodile { + """ + The Pokemon's name + """ + name: String! + } + + """ + 001 Kanto + """ + type Bulbasaur { + """ + The Kanto Pokemon's name + """ + name: String! + } + + """ + 004 Kanto + """ + type Charmander { + """ + The Kanto Pokemon's name + """ + name: String! + } + + """ + 007 Kanto + """ + type Squirtle { + """ + The Kanto Pokemon's name + """ + name: String! + } + + """ + The union of Pokemon starters + """ + union Starters = Bulbasaur | Charmander + + extend union Starters = Squirtle | Chikorita + + extend union Starters = Cyndaquil | Totodile + `), +}; diff --git a/composition/tests/utils/utils.ts b/composition/tests/utils/utils.ts index ea130bb21d..6b21b780c6 100644 --- a/composition/tests/utils/utils.ts +++ b/composition/tests/utils/utils.ts @@ -1,4 +1,4 @@ -import { buildSchema, DocumentNode, GraphQLSchema, lexicographicSortSchema, parse, print } from 'graphql'; +import { DocumentNode, GraphQLSchema, lexicographicSortSchema, parse, print } from 'graphql'; import { Subgraph } from '../../src'; import { printSchemaWithDirectives } from '@graphql-tools/utils'; @@ -6,10 +6,6 @@ export function normalizeString(input: string): string { return input.replaceAll(/\n| {2,}/g, ''); } -export function sortedNormalizedVersionTwoSchemaString(input: string): string { - return schemaToSortedNormalizedString(buildSchema(versionTwoPersistedBaseSchema + input)); -} - export function documentNodeToNormalizedString(document: DocumentNode): string { return normalizeString(print(document)); } @@ -35,6 +31,38 @@ export const versionOneBaseSchema = ` scalar openfed__FieldSet `; +export const baseDirectiveDefinitions = ` + directive @eventsPublish(sourceID: String, topic: String!) on FIELD_DEFINITION + directive @eventsRequest(sourceID: String, topic: String!) on FIELD_DEFINITION + directive @eventsSubscribe(sourceID: String, topic: String!) on FIELD_DEFINITION + directive @extends on INTERFACE | OBJECT + directive @external on FIELD_DEFINITION | OBJECT + directive @key(fields: openfed__FieldSet!, resolvable: Boolean = true) repeatable on INTERFACE | OBJECT + directive @provides(fields: openfed__FieldSet!) on FIELD_DEFINITION + directive @requires(fields: openfed__FieldSet!) on FIELD_DEFINITION + directive @tag(name: String!) repeatable on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION +`; + +export const versionTwoDirectiveDefinitions = ` + directive @authenticated on ENUM | FIELD_DEFINITION | INTERFACE | OBJECT | SCALAR + directive @composeDirective(name: String!) repeatable on SCHEMA + directive @eventsPublish(sourceID: String, topic: String!) on FIELD_DEFINITION + directive @eventsRequest(sourceID: String, topic: String!) on FIELD_DEFINITION + directive @eventsSubscribe(sourceID: String, topic: String!) on FIELD_DEFINITION + directive @extends on INTERFACE | OBJECT + directive @external on FIELD_DEFINITION | OBJECT + directive @inaccessible on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION + directive @interfaceObject on OBJECT + directive @key(fields: openfed__FieldSet!, resolvable: Boolean = true) repeatable on INTERFACE | OBJECT + directive @link(as: String, for: String, import: [String], url: String!) repeatable on SCHEMA + directive @override(from: String!) on FIELD_DEFINITION + directive @provides(fields: openfed__FieldSet!) on FIELD_DEFINITION + directive @requires(fields: openfed__FieldSet!) on FIELD_DEFINITION + directive @requiresScopes(scopes: [[openfed__Scope!]!]!) on ENUM | FIELD_DEFINITION | INTERFACE | OBJECT | SCALAR + directive @shareable on FIELD_DEFINITION | OBJECT + directive @tag(name: String!) repeatable on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION +`; + // The V1 definitions that are persisted in the raw federated schema export const versionOnePersistedBaseSchema = ` directive @deprecated(reason: String = "No longer supported") on ARGUMENT_DEFINITION | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION @@ -73,6 +101,13 @@ schema { query: Query }`; +export const versionOnePersistedDirectiveDefinitions = ` + directive @tag(name: String!) repeatable on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION +`; + +export const versionOneSchemaQueryAndPersistedDirectiveDefinitions = + schemaQueryDefinition + versionOnePersistedDirectiveDefinitions; + export const versionTwoPersistedDirectiveDefinitions = ` directive @authenticated on ENUM | FIELD_DEFINITION | INTERFACE | OBJECT | SCALAR directive @inaccessible on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION diff --git a/shared/test/__snapshots__/router.config.test.ts.snap b/shared/test/__snapshots__/router.config.test.ts.snap index 7740268ac3..7456ae7aed 100644 --- a/shared/test/__snapshots__/router.config.test.ts.snap +++ b/shared/test/__snapshots__/router.config.test.ts.snap @@ -126,15 +126,13 @@ exports[`Router Config Builder > Build Subgraph schema > router.config.json 1`] { \\"typeName\\": \\"User\\", \\"fieldNames\\": [ - \\"reviews\\", - \\"id\\" + \\"reviews\\" ] }, { \\"typeName\\": \\"Product\\", \\"fieldNames\\": [ - \\"reviews\\", - \\"upc\\" + \\"reviews\\" ] }, { @@ -202,8 +200,7 @@ exports[`Router Config Builder > Build Subgraph schema > router.config.json 1`] \\"typeName\\": \\"Product\\", \\"fieldNames\\": [ \\"inStock\\", - \\"shippingEstimate\\", - \\"upc\\" + \\"shippingEstimate\\" ] } ],