@fugood/bricks-cli 2.26.0-beta.14 → 2.26.0-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/1010.js +1 -1
- package/lib/1215.js +1 -1
- package/lib/1708.js +2 -2
- package/lib/1975.js +1 -0
- package/lib/2486.js +1 -1
- package/lib/2557.js +1 -1
- package/lib/4456.js +1 -1
- package/lib/4530.js +10 -10
- package/lib/6194.js +1 -1
- package/lib/6632.js +7 -0
- package/lib/6818.js +1 -1
- package/lib/7294.js +1 -1
- package/lib/907.js +15 -13
- package/lib/9320.js +1 -1
- package/lib/9387.js +5 -5
- package/lib/9439.js +274 -226
- package/lib/9663.js +1 -1
- package/lib/index.js +41 -39
- package/lib/lib.js +4 -2
- package/package.json +5 -5
- package/lib/6042.js +0 -1
- package/lib/9590.js +0 -7
package/lib/lib.js
CHANGED
|
@@ -826,6 +826,7 @@ import{createRequire as e}from"node:module";let t=e(import.meta.url);import a fr
|
|
|
826
826
|
$id: ID!
|
|
827
827
|
$config: String
|
|
828
828
|
$name: String
|
|
829
|
+
$validateConfig: Boolean
|
|
829
830
|
$releaseCurrentVersion: String
|
|
830
831
|
$releaseCurrentVersionNote: String
|
|
831
832
|
) {
|
|
@@ -833,6 +834,7 @@ import{createRequire as e}from"node:module";let t=e(import.meta.url);import a fr
|
|
|
833
834
|
id: $id
|
|
834
835
|
config: $config
|
|
835
836
|
name: $name
|
|
837
|
+
validateConfig: $validateConfig
|
|
836
838
|
releaseCurrentVersion: $releaseCurrentVersion
|
|
837
839
|
releaseCurrentVersionNote: $releaseCurrentVersionNote
|
|
838
840
|
) {
|
|
@@ -974,7 +976,7 @@ ${t6}`);return r.cause=e,r},t3=er(function e(t,a){var r,i=this;ea(this,e),this.b
|
|
|
974
976
|
}
|
|
975
977
|
}
|
|
976
978
|
`,r=yield this.apolloClient.mutate({mutation:a,variables:{name:e,description:t},errorPolicy:"all",fetchPolicy:"no-cache"}),i=r.data,n=r.errors;if(n?.length>0)throw Error(n.map(({message:e})=>e).join("\n"));return i.createWorkspace}),function(e){return u.apply(this,arguments)})}]),aa=(e,t)=>new at(e,t),ar=i(68832);let ai=t("node:fs/promises"),an=t("node:path"),ap=t("node:dgram"),ao=t("node:os");var ad=()=>Math.random().toString(36).slice(2,9),as=new Set(["ANNOUNCE","RESPONSE"]),al=(e,t)=>{var a=JSON.parse(e.toString());return t(a)&&as.has(a.t)&&a.d?.info||null},au=()=>{var e=[];for(var t of Object.values(ao.networkInterfaces()))for(var a of t)if(function(){if("IPv4"!==a.family||a.internal)return 1;var t=a.address.split(".").map(Number),r=a.netmask.split(".").map(Number),i=t.map((e,t)=>(e|255&~r[t]).toString()).join(".");e.push({address:a.address,broadcast:i})}())continue;return e},ac=({port:e,timeout:t=3e3,idleTimeout:a=0,buildQuery:r,parseMessage:i})=>new Promise((n,p)=>{var o=new Map,d=ap.createSocket("udp4"),s=null,l=null,u=!1,c=()=>{if(!u){u=!0,clearTimeout(s),clearTimeout(l);try{d.close()}catch{}n([...o.values()])}};d.on("error",e=>{if(!u){u=!0,clearTimeout(s),clearTimeout(l);try{d.close()}catch{}p(e)}}),d.on("message",(e,t)=>{try{var r=i(e,t);if(!r||o.has(r.key))return;o.set(r.key,r.value),a&&!u&&(clearTimeout(l),l=setTimeout(c,a))}catch{}}),d.bind(()=>{d.setBroadcast(!0);var a=r();for(var i of(()=>{var e=new Set(["255.255.255.255","127.0.0.1"]);for(var t of au())e.add(t.broadcast);return[...e]})())d.send(a,0,a.length,e,i);s=setTimeout(c,t)})}),am=(c=et(function*(e,t=3e3){var a;try{var r=new AbortController;a=setTimeout(()=>r.abort(),t);var i=yield fetch(e,{signal:r.signal});if(!i.ok)return null;return yield i.json()}catch{return null}finally{void 0!==a&&clearTimeout(a)}}),function(e){return c.apply(this,arguments)}),af="bricks-devtools",ah=(m=et(function*({port:e=19851,connectTimeout:t=500,concurrency:a=50,timeout:r=0}={}){var i=au();if(0===i.length)return[];var n=[],p=r>0?Date.now()+r:0,o=[],d=new Set;for(var s of i){var l=s.address.split(".").slice(0,3).join(".");if(!d.has(l)){d.add(l);for(var u=1;u<255;u++)o.push(`${l}.${u}`)}}for(var c=0;c<o.length&&!(p&&Date.now()>=p);c+=a){var m=o.slice(c,c+a);yield Promise.allSettled(m.map(function(){var a=et(function*(a){var r=yield av(a,e,t);r&&n.push({...r,address:a,port:e})});return function(e){return a.apply(this,arguments)}}()))}return n}),function(){return m.apply(this,arguments)}),av=(f=et(function*(e,t,a=3e3){return am(`http://${e}:${t}/devtools/info`,a)}),function(e,t){return f.apply(this,arguments)}),ay=(h=et(function*(e,t,a=3e3){var r;try{var i=new AbortController;r=setTimeout(()=>i.abort(),a);var n=yield fetch(`http://${e}:${t}/json/list`,{signal:i.signal});if(!n.ok)return null;return yield n.json()}catch{return null}finally{void 0!==r&&clearTimeout(r)}}),function(e,t){return h.apply(this,arguments)}),ag=(v=et(function*(e,t=1e3){for(var a=[],r=e,i=0;i<10;i++){var n=an.join(r,".bricks","devtools.json");try{var p=yield ai.readFile(n,"utf8"),o=JSON.parse(p),d=yield av(o.address||"localhost",o.port,t);d&&a.push({name:o.name||"BRICKS Simulator",address:o.address||"localhost",port:o.port,protocols:["cdp"],hasPasscode:!1,source:"project",projectPath:r,...d})}catch{}var s=an.dirname(r);if(s===r)break;r=s}return a}),function(e){return v.apply(this,arguments)}),a_=(y=et(function*({timeout:e=3e3,verify:t=!1,udpOnly:a=!1,project:r=!0,port:i=19851,cwd:n=process.cwd(),onStatus:p}={}){var o,d=(({timeout:e=3e3,idleTimeout:t=0}={})=>ac({port:19900,timeout:e,idleTimeout:t,buildQuery:()=>Buffer.from(JSON.stringify({t:"QUERY",v:"1.0",s:af,d:{id:`cli-${ad()}`}})),parseMessage:(e,t)=>{var a=al(e,e=>e?.s===af);if(!a)return null;var r=t.address;return{key:`${r}:${a.port}`,value:{...a,address:r}}}}))({timeout:e,idleTimeout:800}),s=a?Promise.resolve([]):(p?.("Scanning via UDP + HTTP probe..."),ah({port:i,timeout:e})),l=r?ag(n,1e3):Promise.resolve([]),u=ar((yield Promise.all([d,s,l])),3),c=(e=>{var t=new Map;for(var a of e){var r=a.deviceId||`${a.address}:${a.port}`,i=t.get(r);if(!i){t.set(r,{...a,addresses:[a.address],protocols:[...a.protocols||[]]});continue}for(var n of(i.addresses.includes(a.address)||i.addresses.push(a.address),"127.0.0.1"===i.address&&"127.0.0.1"!==a.address&&(i.address=a.address),a.protocols||[]))i.protocols.includes(n)||i.protocols.push(n);for(var p of Object.entries(a)){var o=ar(p,2),d=o[0],s=o[1];null!=s&&"address"!==d&&"addresses"!==d&&"protocols"!==d&&(void 0===i[d]||null===i[d])&&(i[d]=s)}}return[...t.values()]})([...u[0],...u[1],...u[2]]);if(0===c.length)return[];if(t){p?.(`Verifying ${c.length} server(s)...`);var m,f=yield Promise.all(c.map((m=et(function*(e){var t=yield av(e.address,e.port);return{...e,...t||{},address:e.address,port:e.port,verified:!!t,version:t?.version||e.version}}),function(e){return m.apply(this,arguments)})));c.splice(0,c.length,...f)}return p?.("Checking chrome://inspect support..."),yield Promise.all(c.map((o=et(function*(e){var t=yield ay(e.address,e.port);if(t){e.chromeInspect=!0;var a=(e=>{if(!e)return null;var t=e.match(/\/ws\/(.+)$/);return t?decodeURIComponent(t[1]):null})(t[0]?.webSocketDebuggerUrl);a&&(e.passcode=a)}}),function(e){return o.apply(this,arguments)}))),c}),function(){return y.apply(this,arguments)}),ab=i(76982);let aw=t("fs"),aE=t("path");var aT=i(70857),aN=aE.join(aT.homedir(),".bricks-cli"),aS=aE.join(aN,"config.json"),aO=`${aS}.lock`,aD=`${aS}.oauth-refresh.lock`,aI=new Int32Array(new SharedArrayBuffer(4)),aA=e=>new Promise(t=>setTimeout(t,e)),ak=e=>{if(!Number.isInteger(e)||e<=0)return!1;try{return process.kill(e,0),!0}catch(e){return"ESRCH"!==e.code}},ax=e=>{try{var t=aw.readFileSync(e,"utf8"),a=aw.statSync(e),r=null;try{var i=JSON.parse(t);Number.isInteger(i?.pid)&&"string"==typeof i?.nonce&&(r=i)}catch{}return{raw:t,stat:a,owner:r}}catch(e){if("ENOENT"===e.code)return null;throw e}},aC=e=>{var t,a=ax(e);if(!a)return!0;var r=a.owner?!ak(a.owner.pid):Date.now()-a.stat.mtimeMs>1e3;if(!r)return!1;var i=`${e}.recovery`;try{t=aV(i)}catch(e){if("EEXIST"===e.code)return!1;throw e}try{if(!(a=ax(e)))return!0;if(!(r=a.owner?!ak(a.owner.pid):Date.now()-a.stat.mtimeMs>1e3))return!1;return aw.unlinkSync(e),!0}catch(e){if("ENOENT"===e.code)return!0;throw e}finally{aR(i,t)}},aV=e=>{var t,a={pid:process.pid,nonce:ab.randomUUID()},r=`${e}.${a.pid}.${a.nonce}.candidate`;try{t=aw.openSync(r,"wx",384),aw.writeFileSync(t,JSON.stringify(a)),aw.fsyncSync(t),aw.closeSync(t),t=void 0}catch(e){if(void 0!==t)try{aw.closeSync(t)}catch{}try{aw.unlinkSync(r)}catch{}throw e}try{aw.linkSync(r,e)}catch(e){try{aw.unlinkSync(r)}catch{}throw e}try{aw.unlinkSync(r)}catch(e){"ENOENT"!==e.code&&console.error(`Failed to clean up shared BRICKS lock candidate: ${e.message}`)}return{owner:a}},aR=(e,{owner:t})=>{try{var a;(a=ax(e))&&a.owner?.nonce===t.nonce&&aw.unlinkSync(e)}catch(e){"ENOENT"!==e.code&&console.error(`Failed to release shared BRICKS lock: ${e.message}`)}},aF=e=>{aw.mkdirSync(aN,{recursive:!0});for(var t,a=Date.now()+5e3;!t;)try{t=aV(aO)}catch(e){if("EEXIST"!==e.code)throw e;if(aC(aO))continue;if(Date.now()>=a)throw Error(`Timed out waiting for shared BRICKS config lock: ${aO}`);Atomics.wait(aI,0,0,20)}try{return e()}finally{aR(aO,t)}},aP=(g=et(function*(e){aw.mkdirSync(aN,{recursive:!0});for(var t,a=Date.now()+5e3;!t;)try{t=aV(aO)}catch(e){if("EEXIST"!==e.code)throw e;if(aC(aO))continue;if(Date.now()>=a)throw Error(`Timed out waiting for shared BRICKS config lock: ${aO}`);yield aA(20)}try{var r=e();if(r&&"function"==typeof r.then)throw Error("Shared BRICKS config lock callbacks must be synchronous");return r}finally{aR(aO,t)}}),function(e){return g.apply(this,arguments)}),aj=(_=et(function*(e,{timeoutMs:t=3e4}={}){aw.mkdirSync(aN,{recursive:!0});for(var a,r=Date.now()+t;!a;)try{a=aV(aD)}catch(e){if("EEXIST"!==e.code)throw e;if(aC(aD))continue;if(Date.now()>=r)throw Error(`Timed out waiting for OAuth refresh lock: ${aD}`);yield aA(20)}try{return yield e()}finally{aR(aD,a)}}),function(e){return _.apply(this,arguments)}),aL=()=>new a({projectName:"bricks-cli",cwd:aN,configFileMode:384,schema:{oauth:{type:"object",default:{},properties:{accessToken:{type:"string"},refreshToken:{type:["string","null"]},expiresAt:{type:"string"},user:{type:"object"},audience:{type:"string"}}},tokens:{type:"object",default:{},additionalProperties:{type:"object",properties:{type:{type:"string",enum:["oauth"]},oauthSubject:{type:"string"},token:{type:"string"},name:{type:"string"},workspaceId:{type:"string"},workspaceName:{type:"string"},workspaceBilling:{type:"object"},createdAt:{type:"string"},baseUrl:{type:"string"},activityLogBaseUrl:{type:"string"},bank:{type:"object"}}}},currentProfile:{type:"string",default:"default"},baseUrl:{type:"string",default:"https://display.bricks.tools"},activityLogBaseUrl:{type:"string",default:"https://activity-log.bricks.tools"},devtoolsTokens:{type:"object",default:{},additionalProperties:{type:"object",additionalProperties:{type:"object",properties:{token:{type:"string"},expiresAt:{type:"string"},jti:{type:"string"},workspaceId:{type:"string"}}}}}}}),a$=null,aM=null,aU=()=>a$||=aL(),aB=(b=et(function*(){if(a$)return a$;aM||=aP(()=>a$||=aL());try{return yield aM}finally{aM=null}}),function(){return b.apply(this,arguments)}),aq=(w=et(function*(){yield aB()}),function(){return w.apply(this,arguments)}),aQ={get:e=>aU().get(e),set:(e,t)=>{var a=aU();return aF(()=>a.set(e,t))},clear:()=>{var e=aU();return aF(()=>e.clear())},setAsync:(E=et(function*(e,t){var a=yield aB();return aP(()=>a.set(e,t))}),function(e,t){return E.apply(this,arguments)}),update:(e,t)=>{var a=aU();return aF(()=>{var r=t(a.get(e));return a.set(e,r),r})},updateAsync:(T=et(function*(e,t){var a=yield aB();return aP(()=>{var r=t(a.get(e));return a.set(e,r),r})}),function(e,t){return T.apply(this,arguments)}),snapshot:e=>{var t=aU().store;return Object.fromEntries(e.map(e=>[e,t[e]]))},snapshotAsync:(N=et(function*(e){var t=(yield aB()).store;return Object.fromEntries(e.map(e=>[e,t[e]]))}),function(e){return N.apply(this,arguments)}),transaction:(e,t)=>{var a=aU();return aF(()=>{var r=t(Object.fromEntries(e.map(e=>[e,a.get(e)])))||{};return Object.keys(r).length>0&&a.set(r),r})},transactionAsync:(S=et(function*(e,t){var a=yield aB();return aP(()=>{var r=t(Object.fromEntries(e.map(e=>[e,a.get(e)])))||{};return Object.keys(r).length>0&&a.set(r),r})}),function(e,t){return S.apply(this,arguments)})},aY=(e,t,a,r)=>{if(!e)return null;var i=null==e.workspaceId?null:String(e.workspaceId);return"oauth"===e.type?e.oauthSubject&&e.oauthSubject===t?.user?.sub?{kind:"oauth",workspaceId:i,oauthSubject:e.oauthSubject,baseUrl:a,activityLogBaseUrl:r}:null:e.token?{kind:"token",workspaceId:i,token:e.token,baseUrl:a,activityLogBaseUrl:r}:null},aG=(e,t,a)=>({exists:void 0!==e,kind:e?.type==="oauth"?"oauth":e?.token?"token":"incomplete",workspaceId:e?.workspaceId==null?null:String(e.workspaceId),credential:e?.type==="oauth"?e.oauthSubject||null:e?.token||null,baseUrl:t,activityLogBaseUrl:a}),az=(e,{tokens:t={},oauth:a,devtoolsTokens:r={},baseUrl:i,activityLogBaseUrl:n})=>{var p=t[e],o=p?.baseUrl||i,d=p?.activityLogBaseUrl||n,s=aY(p,a,o,d);return{profile:e,tokenInfo:p,oauth:a,fingerprint:s,baseline:aG(p,o,d),bank:s&&p?.bank||null,devtoolsTokens:r[e]||{},baseUrl:o,activityLogBaseUrl:d}},aH=(O=et(function*(e="default"){return az(e,(yield aQ.snapshotAsync(["tokens","oauth","devtoolsTokens","baseUrl","activityLogBaseUrl"])))}),function(){return O.apply(this,arguments)}),aW=(e,t,a)=>{for(var r=aQ.snapshot(["tokens","baseUrl","activityLogBaseUrl"]),i=r.tokens||{},n=e,p=2;;){var o=i[n];if(!o||"oauth"===o.type&&o.oauthSubject===a&&String(o.workspaceId)===String(t))break;n=`${e}-${p}`,p+=1}var d=i[n];return{profile:n,baseline:aG(d,d?.baseUrl||r.baseUrl,d?.activityLogBaseUrl||r.activityLogBaseUrl)}},aK=(e,t,a,r)=>{var i=a[e],n=i?.workspaceId&&t?.workspaceId&&String(i.workspaceId)===String(t.workspaceId),p=i?.type==="oauth"&&t?.type==="oauth"&&!!i.oauthSubject&&i.oauthSubject===t.oauthSubject||i?.type!=="oauth"&&t?.type!=="oauth"&&!!i?.token&&i.token===t?.token,o=n&&p,d={tokens:{...a,[e]:{...i?.baseUrl?{baseUrl:i.baseUrl}:{},...i?.activityLogBaseUrl?{activityLogBaseUrl:i.activityLogBaseUrl}:{},...o&&i?.bank?{bank:i.bank}:{},...t,createdAt:new Date().toISOString()}}};if(!o&&r[e]){var s={...r};delete s[e],d.devtoolsTokens=s}return d},aJ=(e,t)=>{if(e&&t?.user?.sub!==e)throw Error("OAuth account changed. Re-select the workspace for the current account.")},aZ=(e,t,a,r)=>!!e&&JSON.stringify(e)===JSON.stringify(aG(t,t?.baseUrl||a,t?.activityLogBaseUrl||r)),aX=(e,t,a,{expectedOAuthSubject:r,makeCurrent:i=!1}={})=>{var n=!1;return aQ.transaction(["tokens","devtoolsTokens","oauth","currentProfile","baseUrl","activityLogBaseUrl"],({tokens:p={},devtoolsTokens:o={},oauth:d,baseUrl:s,activityLogBaseUrl:l})=>{if(!aZ(a,p[e],s,l))return{};aJ(r,d),n=!0;var u=aK(e,t,p,o);return i?{...u,currentProfile:e}:u}),n},a1=(D=et(function*(e,t,a,{expectedOAuthSubject:r,makeCurrent:i=!1}={}){var n=!1;return yield aQ.transactionAsync(["tokens","devtoolsTokens","oauth","currentProfile","baseUrl","activityLogBaseUrl"],({tokens:p={},devtoolsTokens:o={},oauth:d,baseUrl:s,activityLogBaseUrl:l})=>{if(!aZ(a,p[e],s,l))return{};aJ(r,d),n=!0;var u=aK(e,t,p,o);return i?{...u,currentProfile:e}:u}),n}),function(e,t,a){return D.apply(this,arguments)}),a0=(e,t)=>{var a=!1;return aQ.transaction(["tokens","devtoolsTokens"],({tokens:r={},devtoolsTokens:i={}})=>{if(n=r[e],!n||!t||String(n.workspaceId??"")!==String(t.workspaceId??"")||("oauth"===t.type?"oauth"!==n.type||n.oauthSubject!==t.oauthSubject:t.token?"oauth"===n.type||n.token!==t.token:JSON.stringify(n)!==JSON.stringify(t)))return{};a=!0;var n,p={...r};delete p[e];var o={...i};return delete o[e],{tokens:p,devtoolsTokens:o}}),a},a2=(I=et(function*(e,t,a,r){var i=!1;return yield aQ.transactionAsync(["tokens","oauth","devtoolsTokens","baseUrl","activityLogBaseUrl"],({tokens:n={},oauth:p,devtoolsTokens:o={},baseUrl:d,activityLogBaseUrl:s})=>((e,t,a,r,i)=>{if(!e)return!1;var n=aY(t,a,t?.baseUrl||r,t?.activityLogBaseUrl||i);return!!n&&n.kind===e.kind&&n.workspaceId===e.workspaceId&&n.baseUrl===e.baseUrl&&n.activityLogBaseUrl===e.activityLogBaseUrl&&("oauth"===n.kind?n.oauthSubject===e.oauthSubject:n.token===e.token)})(t,n[e],p,d,s)?(i=!0,{devtoolsTokens:{...o,[e]:{...o[e],[a]:r}}}):{}),i}),function(e,t,a,r){return I.apply(this,arguments)}),a6=(e,t)=>{if(e)return t(["tokens","devtoolsTokens"],({tokens:t={},devtoolsTokens:a={}})=>{var r={...t},i=[];for(var n of Object.entries(t)){var p=ar(n,2),o=p[0],d=p[1];if(d?.type==="oauth"&&(!d.oauthSubject||d.oauthSubject===e)){i.push(o);var s={...d,oauthSubject:d.oauthSubject||e};delete s.bank,r[o]=s}}var l={...a},u=!1;return i.forEach(e=>{l[e]&&(delete l[e],u=!0)}),{tokens:r,...u?{devtoolsTokens:l}:{}}})},a4=e=>a6(e,aQ.transaction),a3=e=>a6(e,aQ.transactionAsync),a9=(e,t,a)=>{if(r=a.oauth,e?.accessToken?!rn(e,r):!!r?.accessToken)return{result:{installed:!1,identityChanged:!1,previous:null},updates:{}};var r,i=a.oauth?.accessToken?a.oauth:null,n=i?.user?.sub,p=!!(n&&t?.user?.sub&&n!==t.user.sub),o={installed:!0,identityChanged:p,previous:i};if(!p)return{result:o,updates:{oauth:t}};var d={...a.tokens||{}},s={...a.devtoolsTokens||{}},l=!1;for(var u of Object.entries(a.tokens||{})){var c=ar(u,2),m=c[0],f=c[1];if(f?.type==="oauth"&&(!f.oauthSubject||f.oauthSubject===n)){var h={...f,oauthSubject:f.oauthSubject||n};delete h.bank,d[m]=h,s[m]&&(delete s[m],l=!0)}}return{result:o,updates:{oauth:t,tokens:d,...l?{devtoolsTokens:s}:{}}}},a5=(e,t)=>{var a;return aQ.transaction(["oauth","tokens","devtoolsTokens"],r=>{var i=a9(e,t,r);return a=i.result,i.updates}),a},a8=(A=et(function*(e,t){var a;return yield aQ.transactionAsync(["oauth","tokens","devtoolsTokens"],r=>{var i=a9(e,t,r);return a=i.result,i.updates}),a}),function(e,t){return A.apply(this,arguments)}),a7=(e="default")=>{var t=((e="default")=>aQ.get("tokens")[e])(e);return t?"oauth"===t.type?"oauth":t.token?"token":null:null},re=()=>{var e=aQ.get("oauth");return e&&Object.keys(e).length>0?e:null},rt=e=>aQ.set("oauth",e),ra=e=>aQ.setAsync("oauth",e),rr=()=>aQ.set("oauth",{}),ri=(k=et(function*(){var e=null;return yield aQ.updateAsync("oauth",t=>(t?.accessToken&&(e=t),{})),e}),function(){return k.apply(this,arguments)}),rn=(e,t)=>!!e&&!!t&&e.accessToken===t.accessToken&&e.refreshToken===t.refreshToken,rp=(x=et(function*(e,t){var a=!1;return yield aQ.updateAsync("oauth",r=>rn(e,r)?(a=!0,t||{}):r||{}),a}),function(e,t){return x.apply(this,arguments)}),ro=e=>rp(e,{}),rd=(C=et(function*({client:e,ttlSeconds:t}={}){if(!e?.issueDevtoolsAccessToken)throw Error("A BRICKS workspace client is required to issue a DevTools access token.");return e.issueDevtoolsAccessToken({ttlSeconds:t})}),function(){return C.apply(this,arguments)}),rs=(V=et(function*({profile:e,client:t,workspaceId:a,ttlSeconds:r,force:i=!1,now:n=Date.now()}={}){var p=e||process.env.BRICKS_PROFILE||aQ.get("currentProfile"),o=yield aH(p),d=o.tokenInfo,s=o.fingerprint,l=o.devtoolsTokens;if(d?.type==="oauth"&&!s)throw Error(`OAuth profile ${p} belongs to a different account.`);if(!s)throw Error(`Profile ${p} is not logged in or has no workspace id.`);var u=d?.workspaceId,c=a||u;if(!c)throw Error(`Profile ${p} is not logged in or has no workspace id.`);var m=l[c];if(!i&&((e,t=Date.now())=>{if(!e?.token||!e?.expiresAt)return!1;var a=new Date(e.expiresAt).getTime();return Number.isFinite(a)&&a-t>6048e5})(m,n))return m;if(String(c)!==String(u))throw Error(`Profile ${p} has no usable DevTools token for workspace ${c}.`);var f=yield rd({client:t,ttlSeconds:r});if(!f?.token||!f?.expiresAt)throw Error("DevTools access token response was incomplete.");if(f.workspaceId&&String(f.workspaceId)!==String(c))throw Error("DevTools access token was issued for a different workspace.");var h={token:f.token,expiresAt:f.expiresAt,jti:f.jti,workspaceId:f.workspaceId||c};if(!(yield a2(p,s,c,h)))throw Error(`Profile ${p} changed while issuing the DevTools token. Retry.`);return h}),function(){return V.apply(this,arguments)});i(67996);let rl=t("node:crypto");i(27549);var ru=8089,rc=(R=et(function*(e,t,a=3e3){return am(`http://${e}:${t}/buttress/info`,a)}),function(e,t){return R.apply(this,arguments)}),rm=an.join(ao.homedir(),".bricks-cli","buttress"),rf=e=>an.join(e||rm,"state.json");et(function*(e,t,a){var r,i,n,p=null,o=!0;try{p=JSON.parse((yield ai.readFile(e,"utf8"))),o=!1}catch(t){if(t instanceof SyntaxError)throw Error(`${e} is not valid JSON; refusing to overwrite it.`)}var d=(n=(i=(r=p)&&"object"==typeof r&&!Array.isArray(r)?r:{}).mcpServers&&"object"==typeof i.mcpServers&&!Array.isArray(i.mcpServers)?i.mcpServers:{},{...i,mcpServers:{...n,[t]:a}});return yield ai.writeFile(e,`${JSON.stringify(d,null,2)}
|
|
977
|
-
`,o?{mode:384}:{}),{file:e,created:o}}),et(function*({client:e,workspaceId:t,serverId:a,name:r}){if(!t)throw Error("A workspace-authenticated client is required to bind Buttress.");var i,n,p,o,d,s,l=yield e.issueDevtoolsAccessToken({});if("string"!=typeof l?.token||!l.token||String(l.workspaceId)!==String(t)||!(Date.parse(l.expiresAt)>Date.now()))throw Error("DevTools token response is incomplete, expired, or belongs to another workspace.");var u=(n=(i=rl.generateKeyPairSync("ed25519")).publicKey,p=i.privateKey,o=n.export({type:"spki",format:"der"}),d=p.export({type:"pkcs8",format:"der"}),s=rl.createHash("sha256").update(o).digest("hex").slice(0,16),{publicKeySpki:o.toString("base64"),privateKeyPkcs8:d.toString("base64"),kid:s}),c=yield e.bindButtressServer({serverId:a,name:r,serverPublicKey:{spkiBase64:u.publicKeySpki,kid:u.kid}});if(String(c.workspaceId)!==String(t))throw Error("Buttress binding response belongs to another workspace.");return{workspace:{id:c.workspaceId,name:c.workspaceName,serverId:c.serverId,issuerPublicKey:c.issuerPublicKey.pem,kid:c.issuerPublicKey.kid,boundAt:new Date().toISOString()},serverKeyPair:u,devtools:{token:l.token,workspaceId:l.workspaceId,expiresAt:l.expiresAt,...l.jti?{jti:l.jti}:{}}}});var rh=(F=et(function*(e){var t=rf(e);try{var a=yield ai.readFile(t,"utf8");return JSON.parse(a)}catch(e){if(e instanceof SyntaxError)throw Error("Buttress state.json contains invalid JSON.");if("ENOENT"===e.code)return null;throw e}}),function(e){return F.apply(this,arguments)});et(function*(e,t){var a=t||rm,r=rf(t);yield ai.mkdir(a,{recursive:!0,mode:448}),yield ai.chmod(a,448);var i=`${r}.tmp-${process.pid}-${rl.randomUUID()}`;try{yield ai.writeFile(i,JSON.stringify(e,null,2),{encoding:"utf8",mode:384}),yield ai.chmod(i,384),yield ai.rename(i,r),yield ai.chmod(r,384)}catch(e){throw yield ai.unlink(i).catch(()=>{}),e}return r});var rv=(P=et(function*(e){var t=rf(e);try{return yield ai.unlink(t),!0}catch(e){if("ENOENT"===e.code)return!1;throw e}}),function(e){return P.apply(this,arguments)});et(function*({client:e,serverId:t,workspaceId:a,stateDir:r,keepLocal:i=!1}){var n=i?null:yield rh(r),p=!i&&((e,t,a)=>{if(e?.workspace?.serverId!==t)return!1;var r=e.workspace.id;if(!r||!a||String(r)!==String(a))throw Error(`Local Buttress state belongs to workspace ${r||"unknown"}, but the current profile targets ${a||"unknown"}. Switch profiles first.`);return!0})(n,t,a);return{removed:yield e.unbindButtressServer({serverId:t}),localRemoved:!!p&&(yield rv(r))}});var ry=(j=et(function*({timeout:e=3e3,verify:t=!0,port:a=ru,onStatus:r}={}){r?.(`Scanning UDP ${a} for ${e}ms...`);var i,n=yield(({timeout:e=3e3,idleTimeout:t=0,port:a=ru}={})=>ac({port:a,timeout:e,idleTimeout:t,buildQuery:()=>Buffer.from(JSON.stringify({t:"QUERY",v:"2.0",d:{id:`cli-${ad()}`}})),parseMessage:(e,t)=>{var a=al(e,e=>e?.v==="2.0");if(!a)return null;var r={...a,address:t.address};return{key:r.id||`${t.address}:${r.port}`,value:r}}}))({timeout:e,port:a});return 0===n.length?[]:t?(r?.(`Verifying ${n.length} server(s)...`),yield Promise.all(n.map((i=et(function*(e){var t=yield rc(e.address,e.port,2e3);return t?{...e,...t,address:e.address,verified:!0}:{...e,verified:!1}}),function(e){return i.apply(this,arguments)})))):n}),function(){return j.apply(this,arguments)});let rg=t("node:fs");var r_=(L=et(function*(e,t,a){var r=yield e.mediaFiles({boxId:t,userTags:[`bricks_screenshot_${a}`],limit:1});return r?.[0]||null}),function(e,t,a){return L.apply(this,arguments)}),rb=($=et(function*(e,t=null){var a=yield tG(e);if(!a.ok)throw Error(`Failed to download screenshot: ${a.statusText}`);var r=yield a.buffer(),i=t||an.join(ao.tmpdir(),`bricks-screenshot-${Date.now()}.png`),n=an.dirname(i);return rg.existsSync(n)||rg.mkdirSync(n,{recursive:!0}),rg.writeFileSync(i,r),i}),function(e){return $.apply(this,arguments)}),rw=(M=et(function*(e,t,a,r=null,i={}){var n=t?.media_resource?.enable_media_workspace!==!0?null:t.media_resource?.system_media_box_id||null;if(!n)return{error:"Media workspace not enabled for this workspace"};var p=yield r_(e,n,a);if(!p)return{error:"No screenshot available for this device"};var o=((e,{preferThumbnail:t=!1}={})=>{if(!e?.meta?.storageEndpoint)return null;var a=e.meta,r=a.storageEndpoint,i=a.originalFileKey,n=(t?(e=>{var t=e?.meta;if(!t)return null;if("Video"===e.fileType&&t.videoThumbOriginalFileKey)return t.videoThumbOriginalFileKey;var a=t.imageVersions||[];if(!Array.isArray(a)||0===a.length)return null;var r=a.filter(e=>e?.strategy==="BOUNDED"&&"number"==typeof e.width).sort((e,t)=>e.width-t.width);return(r[0]||a[0])?.key||null})(e):null)||i;return n?`${r}/${n}`:null})(p,i);return o?{path:yield rb(o,r),file:p,url:o}:{error:"Could not build screenshot URL"}}),function(e,t,a){return M.apply(this,arguments)}),rE=i(35317),rT=i(10750),rN=e=>{try{return(0,rE.execSync)(`which ${e}`,{stdio:"ignore"}),!0}catch{return!1}},rS=(e,t,a)=>new Promise((r,i)=>{var n=[e,...t].join(" "),p=(0,rE.spawn)(n,[],{cwd:a,stdio:"pipe",shell:!0}),o=[];p.stderr.on("data",e=>o.push(e)),p.on("close",e=>{0===e?r():i(Error(Buffer.concat(o).toString().trim()||`Command failed with code ${e}`))}),p.on("error",i)}),rO=(U=et(function*(e,t){try{var a=(yield i.e(7456).then(i.bind(i,79491))).format;return(yield a(t,e,{trailingComma:"all",tabWidth:2,semi:!1,singleQuote:!0,printWidth:100})).code}catch{}return e}),function(e,t){return U.apply(this,arguments)}),rD=(B=et(function*(e,t){var a;return Promise.all(e.map((a=et(function*(e){var a=aE.join(t,e.name),r=e.input;return e.formatable&&(r=yield rO(r,a)),{...e,filePath:a,content:r}}),function(e){return a.apply(this,arguments)})))}),function(e,t){return B.apply(this,arguments)}),rI=(q=et(function*(e,t={}){var a="function"==typeof t.onStatus?t.onStatus:()=>{},r=!1,i=!1;if(!1!==t.install&&rN("bun")){a("Installing dependencies (bun install)...");try{yield rS("bun",["install"],e),r=!0}catch{}}if(!1!==t.git&&rN("git")){a("Initializing git repository...");try{yield rS("git",["init"],e),yield rS("git",["add","."],e),yield rS("git",["-c 'user.name=BRICKS CLI'","-c 'user.email=cli@bricks.tools'","commit","-m 'chore: initialize commit'"],e),i=!0}catch{}}return{bunInstalled:r,gitInitialized:i}}),function(e){return q.apply(this,arguments)}),rA=(Q=et(function*(e,t,a){var r=a.client,i=a.output,n=a.outputAsTarget;if(!r)throw Error("client is required");if(!i)throw Error("output directory is required");var p=(e=>{for(var t=aE.resolve(e);;){if(aw.existsSync(aE.join(t,"application.json"))||aw.existsSync(aE.join(t,"module.json")))return t;var a=aE.dirname(t);if(a===t)return null;t=a}})(n?aE.dirname(aE.resolve(i)):i);if(p)throw Error(`Cannot initialize a new BRICKS project inside an existing project (${p}). Choose a directory outside the project.`);var o="application"===e?r.applicationProject:r.moduleProject,d=yield o({id:t,buildApplicationOnly:!1,setupGitHubActions:!1!==a.githubActions,setupAgents:!1!==a.agents,setupClaudeCode:!1!==a.claude,setupGeminiCLI:!0===a.gemini});if(!d?.files)throw Error(`${e} project not found`);var s=((e=[])=>{var t=e.find(e=>"application.json"===e.name);if(!t)return"bricks-ctor";try{var a=JSON.parse(t.input);return rT(a.name||"bricks-ctor")}catch{return"bricks-ctor"}})(d.files),l=n?aE.resolve(i):aE.resolve(i,s);if(aw.existsSync(l))throw Error(`Directory already exists: ${l}`);aw.mkdirSync(l,{recursive:!0}),(yield rD(d.files,l)).forEach(e=>{aw.mkdirSync(aE.dirname(e.filePath),{recursive:!0}),aw.writeFileSync(e.filePath,e.content)});var u=yield rI(l,a),c=u.bunInstalled,m=u.gitInitialized;return{success:!0,path:l,files:d.files.length,bunInstalled:c,gitInitialized:m}}),function(e,t,a){return Q.apply(this,arguments)}),rk=process.env.BRICKS_OAUTH_DOMAIN||"auth0.bricks.tools",rx=process.env.BRICKS_OAUTH_AUDIENCE||"https://display.bricks.tools",rC="openid profile email offline_access",rV=process.env.BRICKS_OAUTH_CLIENT_ID||"Atyy2gp0suIWE33rj8LtJ0pJpIGHiGaT",rR="/callback",rF="127.0.0.1",rP=()=>!!rV,rj=(e,t,{signal:a}={})=>(()=>{var e=process.env.HTTPS_PROXY||process.env.https_proxy;if(!e)return tG;var t=new tH(e);return(e,a={})=>tG(e,{...a,agent:t})})()(`https://${rk}${e}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString(),signal:a}),rL=(Y=et(function*(e){var t;try{t=yield e.json()}catch(e){if(e?.name==="AbortError")throw e;t={}}if(!e.ok){var a=Error(t.error_description||t.error||`HTTP ${e.status}`);throw a.code=t.error,a}return t}),function(e){return Y.apply(this,arguments)}),r$=(G=et(function*(e,t){var
|
|
979
|
+
`,o?{mode:384}:{}),{file:e,created:o}}),et(function*({client:e,workspaceId:t,serverId:a,name:r}){if(!t)throw Error("A workspace-authenticated client is required to bind Buttress.");var i,n,p,o,d,s,l=yield e.issueDevtoolsAccessToken({});if("string"!=typeof l?.token||!l.token||String(l.workspaceId)!==String(t)||!(Date.parse(l.expiresAt)>Date.now()))throw Error("DevTools token response is incomplete, expired, or belongs to another workspace.");var u=(n=(i=rl.generateKeyPairSync("ed25519")).publicKey,p=i.privateKey,o=n.export({type:"spki",format:"der"}),d=p.export({type:"pkcs8",format:"der"}),s=rl.createHash("sha256").update(o).digest("hex").slice(0,16),{publicKeySpki:o.toString("base64"),privateKeyPkcs8:d.toString("base64"),kid:s}),c=yield e.bindButtressServer({serverId:a,name:r,serverPublicKey:{spkiBase64:u.publicKeySpki,kid:u.kid}});if(String(c.workspaceId)!==String(t))throw Error("Buttress binding response belongs to another workspace.");return{workspace:{id:c.workspaceId,name:c.workspaceName,serverId:c.serverId,issuerPublicKey:c.issuerPublicKey.pem,kid:c.issuerPublicKey.kid,boundAt:new Date().toISOString()},serverKeyPair:u,devtools:{token:l.token,workspaceId:l.workspaceId,expiresAt:l.expiresAt,...l.jti?{jti:l.jti}:{}}}});var rh=(F=et(function*(e){var t=rf(e);try{var a=yield ai.readFile(t,"utf8");return JSON.parse(a)}catch(e){if(e instanceof SyntaxError)throw Error("Buttress state.json contains invalid JSON.");if("ENOENT"===e.code)return null;throw e}}),function(e){return F.apply(this,arguments)});et(function*(e,t){var a=t||rm,r=rf(t);yield ai.mkdir(a,{recursive:!0,mode:448}),yield ai.chmod(a,448);var i=`${r}.tmp-${process.pid}-${rl.randomUUID()}`;try{yield ai.writeFile(i,JSON.stringify(e,null,2),{encoding:"utf8",mode:384}),yield ai.chmod(i,384),yield ai.rename(i,r),yield ai.chmod(r,384)}catch(e){throw yield ai.unlink(i).catch(()=>{}),e}return r});var rv=(P=et(function*(e){var t=rf(e);try{return yield ai.unlink(t),!0}catch(e){if("ENOENT"===e.code)return!1;throw e}}),function(e){return P.apply(this,arguments)});et(function*({client:e,serverId:t,workspaceId:a,stateDir:r,keepLocal:i=!1}){var n=i?null:yield rh(r),p=!i&&((e,t,a)=>{if(e?.workspace?.serverId!==t)return!1;var r=e.workspace.id;if(!r||!a||String(r)!==String(a))throw Error(`Local Buttress state belongs to workspace ${r||"unknown"}, but the current profile targets ${a||"unknown"}. Switch profiles first.`);return!0})(n,t,a);return{removed:yield e.unbindButtressServer({serverId:t}),localRemoved:!!p&&(yield rv(r))}});var ry=(j=et(function*({timeout:e=3e3,verify:t=!0,port:a=ru,onStatus:r}={}){r?.(`Scanning UDP ${a} for ${e}ms...`);var i,n=yield(({timeout:e=3e3,idleTimeout:t=0,port:a=ru}={})=>ac({port:a,timeout:e,idleTimeout:t,buildQuery:()=>Buffer.from(JSON.stringify({t:"QUERY",v:"2.0",d:{id:`cli-${ad()}`}})),parseMessage:(e,t)=>{var a=al(e,e=>e?.v==="2.0");if(!a)return null;var r={...a,address:t.address};return{key:r.id||`${t.address}:${r.port}`,value:r}}}))({timeout:e,port:a});return 0===n.length?[]:t?(r?.(`Verifying ${n.length} server(s)...`),yield Promise.all(n.map((i=et(function*(e){var t=yield rc(e.address,e.port,2e3);return t?{...e,...t,address:e.address,verified:!0}:{...e,verified:!1}}),function(e){return i.apply(this,arguments)})))):n}),function(){return j.apply(this,arguments)});let rg=t("node:fs");var r_=(L=et(function*(e,t,a){var r=yield e.mediaFiles({boxId:t,userTags:[`bricks_screenshot_${a}`],limit:1});return r?.[0]||null}),function(e,t,a){return L.apply(this,arguments)}),rb=($=et(function*(e,t=null){var a=yield tG(e);if(!a.ok)throw Error(`Failed to download screenshot: ${a.statusText}`);var r=yield a.buffer(),i=t||an.join(ao.tmpdir(),`bricks-screenshot-${Date.now()}.png`),n=an.dirname(i);return rg.existsSync(n)||rg.mkdirSync(n,{recursive:!0}),rg.writeFileSync(i,r),i}),function(e){return $.apply(this,arguments)}),rw=(M=et(function*(e,t,a,r=null,i={}){var n=t?.media_resource?.enable_media_workspace!==!0?null:t.media_resource?.system_media_box_id||null;if(!n)return{error:"Media workspace not enabled for this workspace"};var p=yield r_(e,n,a);if(!p)return{error:"No screenshot available for this device"};var o=((e,{preferThumbnail:t=!1}={})=>{if(!e?.meta?.storageEndpoint)return null;var a=e.meta,r=a.storageEndpoint,i=a.originalFileKey,n=(t?(e=>{var t=e?.meta;if(!t)return null;if("Video"===e.fileType&&t.videoThumbOriginalFileKey)return t.videoThumbOriginalFileKey;var a=t.imageVersions||[];if(!Array.isArray(a)||0===a.length)return null;var r=a.filter(e=>e?.strategy==="BOUNDED"&&"number"==typeof e.width).sort((e,t)=>e.width-t.width);return(r[0]||a[0])?.key||null})(e):null)||i;return n?`${r}/${n}`:null})(p,i);return o?{path:yield rb(o,r),file:p,url:o}:{error:"Could not build screenshot URL"}}),function(e,t,a){return M.apply(this,arguments)}),rE=i(35317),rT=i(10750),rN=e=>{try{return(0,rE.execSync)(`which ${e}`,{stdio:"ignore"}),!0}catch{return!1}},rS=(e,t,a)=>new Promise((r,i)=>{var n=[e,...t].join(" "),p=(0,rE.spawn)(n,[],{cwd:a,stdio:["pipe","ignore","pipe"],shell:!0}),o=[];p.stderr.on("data",e=>o.push(e)),p.on("close",e=>{0===e?r():i(Error(Buffer.concat(o).toString().trim()||`Command failed with code ${e}`))}),p.on("error",i)}),rO=(U=et(function*(e,t){try{var a=(yield i.e(7456).then(i.bind(i,79491))).format;return(yield a(t,e,{trailingComma:"all",tabWidth:2,semi:!1,singleQuote:!0,printWidth:100})).code}catch{}return e}),function(e,t){return U.apply(this,arguments)}),rD=(B=et(function*(e,t){var a;return Promise.all(e.map((a=et(function*(e){var a=aE.join(t,e.name),r=e.input;return e.formatable&&(r=yield rO(r,a)),{...e,filePath:a,content:r}}),function(e){return a.apply(this,arguments)})))}),function(e,t){return B.apply(this,arguments)}),rI=(q=et(function*(e,t={}){var a="function"==typeof t.onStatus?t.onStatus:()=>{},r=!1,i=!1;if(!1!==t.install&&rN("bun")){a("Installing dependencies (bun install)...");try{yield rS("bun",["install"],e),r=!0}catch{}}if(!1!==t.git&&rN("git")){a("Initializing git repository...");try{yield rS("git",["init"],e),yield rS("git",["add","."],e),yield rS("git",["-c 'user.name=BRICKS CLI'","-c 'user.email=cli@bricks.tools'","commit","-m 'chore: initialize commit'"],e),i=!0}catch{}}return{bunInstalled:r,gitInitialized:i}}),function(e){return q.apply(this,arguments)}),rA=(Q=et(function*(e,t,a){var r=a.client,i=a.output,n=a.outputAsTarget;if(!r)throw Error("client is required");if(!i)throw Error("output directory is required");var p=(e=>{for(var t=aE.resolve(e);;){if(aw.existsSync(aE.join(t,"application.json"))||aw.existsSync(aE.join(t,"module.json")))return t;var a=aE.dirname(t);if(a===t)return null;t=a}})(n?aE.dirname(aE.resolve(i)):i);if(p)throw Error(`Cannot initialize a new BRICKS project inside an existing project (${p}). Choose a directory outside the project.`);var o="application"===e?r.applicationProject:r.moduleProject,d=yield o({id:t,buildApplicationOnly:!1,setupGitHubActions:!1!==a.githubActions,setupAgents:!1!==a.agents,setupClaudeCode:!1!==a.claude,setupGeminiCLI:!0===a.gemini});if(!d?.files)throw Error(`${e} project not found`);var s=((e=[])=>{var t=e.find(e=>"application.json"===e.name);if(!t)return"bricks-ctor";try{var a=JSON.parse(t.input);return rT(a.name||"bricks-ctor")}catch{return"bricks-ctor"}})(d.files),l=n?aE.resolve(i):aE.resolve(i,s);if(aw.existsSync(l))throw Error(`Directory already exists: ${l}`);aw.mkdirSync(l,{recursive:!0}),(yield rD(d.files,l)).forEach(e=>{aw.mkdirSync(aE.dirname(e.filePath),{recursive:!0}),aw.writeFileSync(e.filePath,e.content)});var u=yield rI(l,a),c=u.bunInstalled,m=u.gitInitialized;return{success:!0,path:l,files:d.files.length,bunInstalled:c,gitInitialized:m}}),function(e,t,a){return Q.apply(this,arguments)}),rk=process.env.BRICKS_OAUTH_DOMAIN||"auth0.bricks.tools",rx=process.env.BRICKS_OAUTH_AUDIENCE||"https://display.bricks.tools",rC="openid profile email offline_access",rV=process.env.BRICKS_OAUTH_CLIENT_ID||"Atyy2gp0suIWE33rj8LtJ0pJpIGHiGaT",rR="/callback",rF="127.0.0.1",rP=()=>!!rV,rj=(e,t,{signal:a}={})=>(()=>{var e=process.env.HTTPS_PROXY||process.env.https_proxy;if(!e)return tG;var t=new tH(e);return(e,a={})=>tG(e,{...a,agent:t})})()(`https://${rk}${e}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString(),signal:a}),rL=(Y=et(function*(e){var t;try{t=yield e.json()}catch(e){if(e?.name==="AbortError")throw e;t={}}if(!e.ok){var a=Error(t.error_description||t.error||`HTTP ${e.status}`);throw a.code=t.error,a}return t}),function(e){return Y.apply(this,arguments)}),r$=(G=et(function*(e,t,{signal:a}={}){var r=new AbortController,i=()=>r.abort();a?.addEventListener("abort",i,{once:!0}),a?.aborted&&i();var n=setTimeout(()=>r.abort(),15e3);try{return yield rL((yield rj(e,t,{signal:r.signal})))}finally{clearTimeout(n),a?.removeEventListener("abort",i)}}),function(e,t){return G.apply(this,arguments)}),rM=e=>{try{return JSON.parse(Buffer.from(e.split(".")[1],"base64url").toString("utf8"))}catch{return{}}},rU=e=>String(e).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'"),rB=({title:e,heading:t,message:a})=>`<!doctype html>
|
|
978
980
|
<html lang="en">
|
|
979
981
|
<head>
|
|
980
982
|
<meta charset="utf-8" />
|
|
@@ -1037,7 +1039,7 @@ ${t6}`);return r.cause=e,r},t3=er(function e(t,a){var r,i=this;ea(this,e),this.b
|
|
|
1037
1039
|
<p>${rU(a)}</p>
|
|
1038
1040
|
</main>
|
|
1039
1041
|
</body>
|
|
1040
|
-
</html>`,rq=rB({title:"Signed in to BRICKS",heading:"Signed in to BRICKS",message:"You can close this tab now."}),rQ=e=>rB({title:"Sign-in failed",heading:"Sign-in failed",message:e}),rY="Sign-in cancelled",rG=(z=et(function*({onAuthorizeUrl:e,signal:t}={}){if(t?.aborted)throw Error(rY);var a,r,i,n,p,o=(a=ab.randomBytes(32).toString("base64url"),r=ab.createHash("sha256").update(a).digest("base64url"),{verifier:a,challenge:r}),d=o.verifier,s=o.challenge,l=ab.randomBytes(16).toString("base64url"),u=process.env.BRICKS_OAUTH_CALLBACK_PORT,c=null!=u&&""!==u?Number(u):8535,m=new Promise((e,t)=>{i=e,n=t}),f=tt.createServer((e,t)=>{var a=new URL(e.url,`http://${rF}`);if(a.pathname!==rR)return void t.writeHead(404).end();var r=a.searchParams.get("error"),p=a.searchParams.get("code");if(a.searchParams.get("state")!==l)return void t.writeHead(400,{"Content-Type":"text/html"}).end(rQ("Invalid state"));if(r){var o=a.searchParams.get("error_description")||r;t.writeHead(200,{"Content-Type":"text/html"}).end(rQ(o)),n(Error(o));return}if(!p){t.writeHead(400,{"Content-Type":"text/html"}).end(rQ("Invalid state")),n(Error("OAuth callback did not include an authorization code"));return}t.writeHead(200,{"Content-Type":"text/html"}).end(rq),i(p)}),h=yield new Promise((e,t)=>{f.once("error",e=>{e?.code==="EADDRINUSE"?t(Error(`Callback port ${c} is already in use — is another sign-in in progress? Close it and retry.`)):t(e)}),f.listen(c,rF,()=>e(f.address().port))}),v=`http://${rF}:${h}${rR}`,y=(({redirectUri:e,state:t,challenge:a})=>{var r=new URL(`https://${rk}/authorize`);return r.searchParams.set("response_type","code"),r.searchParams.set("client_id",rV),r.searchParams.set("redirect_uri",e),r.searchParams.set("scope",rC),r.searchParams.set("audience",rx),r.searchParams.set("state",t),r.searchParams.set("code_challenge",a),r.searchParams.set("code_challenge_method","S256"),r.toString()})({redirectUri:v,state:l,challenge:s}),g=()=>n(Error(rY));t?.addEventListener("abort",g,{once:!0});try{var _=new Promise((e,t)=>{p=setTimeout(()=>t(Error("Timed out waiting for the browser sign-in (5 minutes)")),3e5)}),b=e?Promise.resolve().then(()=>e(y)):Promise.resolve(),w=yield Promise.all([Promise.race([b,_]),Promise.race([m,_])]),E=ar(w,2)[1];return yield r$("/oauth/token",{grant_type:"authorization_code",client_id:rV,code:E,code_verifier:d,redirect_uri:v})}finally{p&&clearTimeout(p),t?.removeEventListener("abort",g),yield new Promise(e=>{f.close(e),f.closeIdleConnections?.()})}}),function(){return z.apply(this,arguments)}),rz=(H=et(function*(){return yield r$("/oauth/device/code",{client_id:rV,scope:rC,audience:rx})}),function(){return H.apply(this,arguments)}),rH=e=>new Promise(t=>setTimeout(t,e)),rW=(W=et(function*({device_code:e,interval:t=5,expires_in:a=900}){for(var r=Date.now()+1e3*a,i=1e3*t;Date.now()<r;){yield rH(i);try{return yield r$("/oauth/token",{grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:rV,device_code:e})}catch(e){if("authorization_pending"===e.code)continue;if("slow_down"===e.code){i+=5e3;continue}throw e}}throw Error("Device authorization expired before the sign-in was confirmed")}),function(e){return W.apply(this,arguments)}),rK=(e,t=null,{preservePrevious:a=!1}={})=>{if(!e?.access_token)throw Error("OAuth token response did not include an access token");if(!a&&!e.id_token)throw Error("OAuth login response did not include an ID token");var r=e.id_token?rM(e.id_token):{};if(!a&&!r.sub)throw Error("OAuth ID token did not include a user subject");if(a&&r.sub&&t?.user?.sub&&r.sub!==t.user.sub)throw Error("OAuth refresh returned a different user identity");var i=a?t?.user:null;return{accessToken:e.access_token,refreshToken:e.refresh_token||(a?t?.refreshToken:null)||null,expiresAt:new Date(Date.now()+1e3*(e.expires_in||0)).toISOString(),user:{sub:r.sub||i?.sub||null,email:r.email||i?.email||null,name:r.name||i?.name||null,nickname:r.nickname||i?.nickname||null,picture:r.picture||i?.picture||null},audience:rx}},rJ=null,rZ=(K=et(function*({forceRefresh:e=!1}={}){var t=re();if(!t?.accessToken)return null;var a=new Date(t.expiresAt||0).getTime()-Date.now();if(!e&&a>3e5)return t;if(!t.refreshToken){if(a>0)return t;if(!(yield ro(t)))return re();throw Error("OAuth session expired. Run `bricks auth login` again.")}var r=`${t.accessToken}\0${t.refreshToken}`;if(rJ){var i=rJ;return i.sessionKey===r?i.promise:(yield i.promise.catch(()=>{}),rZ({forceRefresh:e}))}var n=aj(et(function*(){var a=re();if(!a?.accessToken)return null;if(!t||!a||t.accessToken!==a.accessToken||t.refreshToken!==a.refreshToken)return a;var r=new Date(a.expiresAt||0).getTime()-Date.now();if(!e&&r>3e5)return a;if(!a.refreshToken){if(r>0)return a;if(!(yield ro(a)))return re();throw Error("OAuth session expired. Run `bricks auth login` again.")}try{var i=yield r$("/oauth/token",{grant_type:"refresh_token",client_id:rV,refresh_token:a.refreshToken}),n=rK(i,a,{preservePrevious:!0});if(!(yield rp(a,n)))return re();return n}catch(e){if("invalid_grant"===e.code){if(!(yield ro(a)))return re();throw Error("OAuth session expired. Run `bricks auth login` again.")}throw e}}));rJ={sessionKey:r,promise:n};try{return yield n}finally{rJ?.promise===n&&(rJ=null)}}),function(){return K.apply(this,arguments)}),rX=(J=et(function*(e){if(e){var t=new AbortController,a=setTimeout(()=>t.abort(),5e3);try{yield rj("/oauth/revoke",{client_id:rV,token:e},{signal:t.signal})}catch{}finally{clearTimeout(a)}}}),function(e){return J.apply(this,arguments)}),r1=(Z=et(function*(){var e=yield ri();return!!e?.accessToken&&(yield rX(e.refreshToken),!0)}),function(){return Z.apply(this,arguments)}),r0=e=>new Promise(t=>{var a=ar("darwin"===process.platform?["open",[e]]:"win32"===process.platform?["cmd",["/c","start","",e.replace(/&/g,"^&")]]:["xdg-open",[e]],2),r=a[0],i=a[1];try{var n=(0,rE.spawn)(r,i,{stdio:"ignore",detached:!0});n.once("error",()=>t(!1)),n.once("spawn",()=>{n.unref(),t(!0)})}catch{t(!1)}}),r2=(e,t)=>{if(!e)throw Error("Not logged in. Run `bricks auth login` first.");if(e.user?.sub!==t)throw Error("OAuth account changed. Re-select the workspace for the current account.");return e},r6=e=>{var t=((e="default")=>az(e,aQ.snapshot(["tokens","oauth","devtoolsTokens","baseUrl","activityLogBaseUrl"])))(e);return{...t,auth:(({tokenInfo:e,oauth:t})=>{if(!e)return null;if("oauth"===e.type){if(!t?.accessToken||!e.oauthSubject||e.oauthSubject!==t.user?.sub||!e.workspaceId)return null;var a,r,i,n=e.oauthSubject;return{kind:"oauth",workspaceId:e.workspaceId,workspaceName:e.workspaceName,getHeaders:(r=et(function*(){var t=r2((yield rZ()),n);return{authorization:`Bearer ${t.accessToken}`,"x-bricks-workspace-id":String(e.workspaceId)}}),function(){return r.apply(this,arguments)}),refresh:(i=et(function*(){r2((yield rZ({forceRefresh:!0})),n)}),function(){return i.apply(this,arguments)})}}return e.token?{kind:"token",token:e.token,workspaceId:e.workspaceId,workspaceName:e.workspaceName,getHeaders:(a=et(function*(){return{authorization:`Bearer ${e.token}`}}),function(){return a.apply(this,arguments)})}:null})(t)}},r4=e=>r6(e).auth},48255(e,t,a){a.d(t,{Wk:()=>s,eO:()=>p,yJ:()=>d});var r=a(91070),i=a(73971),n=a(8238);class p extends Error{constructor(e,...t){var a,n,d;let s,{nodes:l,source:u,positions:c,path:m,originalError:f,extensions:h}=null==(s=t[0])||"kind"in s||"length"in s?{nodes:s,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:s;super(e),this.name="GraphQLError",this.path=null!=m?m:void 0,this.originalError=null!=f?f:void 0,this.nodes=o(Array.isArray(l)?l:l?[l]:void 0);let v=o(null==(a=this.nodes)?void 0:a.map(e=>e.loc).filter(e=>null!=e));this.source=null!=u?u:null==v||null==(n=v[0])?void 0:n.source,this.positions=null!=c?c:null==v?void 0:v.map(e=>e.start),this.locations=c&&u?c.map(e=>(0,i.g)(u,e)):null==v?void 0:v.map(e=>(0,i.g)(e.source,e.start));let y=(0,r.Z)(null==f?void 0:f.extensions)?null==f?void 0:f.extensions:void 0;this.extensions=null!=(d=null!=h?h:y)?d: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}}),null!=f&&f.stack?Object.defineProperty(this,"stack",{value:f.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,p):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(let t of this.nodes)t.loc&&(e+="\n\n"+(0,n.V)(t.loc));else if(this.source&&this.locations)for(let t of this.locations)e+="\n\n"+(0,n.C)(this.source,t);return e}toJSON(){let e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function o(e){return void 0===e||0===e.length?void 0:e}function d(e){return e.toString()}function s(e){return e.toJSON()}},59841(e,t,a){a.d(t,{I:()=>i});var r=a(48255);function i(e,t,a){return new r.eO(`Syntax Error: ${a}`,{source:e,positions:[t]})}},36869(e,t,a){let r;a.r(t),a.d(t,{VariablesAreInputTypesRule:()=>a$,SingleFieldSubscriptionsRule:()=>aT,UniqueVariableNamesRule:()=>aP,GraphQLDeprecatedDirective:()=>e7,GraphQLNonNull:()=>ef,__InputValue:()=>tm,createSourceEventStream:()=>rh,execute:()=>aX,isDefinitionNode:()=>tL.MD,isInterfaceType:()=>Y,isRequiredArgument:()=>eV,isValidNameError:()=>r1,parseValue:()=>h.$x,valueFromAST:()=>am,NoUnusedVariablesRule:()=>t1,__DirectiveLocation:()=>tl,findDangerousChanges:()=>r2,__TypeKind:()=>th,isSchema:()=>tw,UniqueTypeNamesRule:()=>aF,NoSchemaIntrospectionCustomRule:()=>rg,defaultTypeResolver:()=>ra,isType:()=>$,syntaxError:()=>r_.I,version:()=>i,UniqueFragmentNamesRule:()=>ax,assertWrappingType:()=>ev,getNullableType:()=>e_,isObjectType:()=>q,visitWithTypeInfo:()=>tj,assertEnumValueName:()=>L,printSchema:()=>rj,validate:()=>az,BREAK:()=>tV.sP,assertNonNullType:()=>ea,assertNullableType:()=>eg,executeSync:()=>a1,isLeafType:()=>eo,resolveSchemaCoordinate:()=>r8,assertOutputType:()=>ep,buildASTSchema:()=>rk,astFromValue:()=>tp,Kind:()=>V.b,ProvidedRequiredArgumentsRule:()=>ai,UniqueDirectiveNamesRule:()=>aD,KnownDirectivesRule:()=>tQ,DEFAULT_DEPRECATION_REASON:()=>e8,TypeKind:()=>l,assertInterfaceType:()=>G,isValueNode:()=>tL.aR,GraphQLSpecifiedByDirective:()=>te,GraphQLFloat:()=>eK,UniqueFieldDefinitionNamesRule:()=>ak,LoneAnonymousOperationRule:()=>tH,VariablesInAllowedPositionRule:()=>aM,assertInputType:()=>ei,formatError:()=>y.Wk,assertInputObjectType:()=>Z,isOutputType:()=>en,isWrappingType:()=>eh,assertLeafType:()=>ed,assertValidSchema:()=>tO,FragmentsOnCompositeTypesRule:()=>tU,graphql:()=>rn,UniqueOperationTypesRule:()=>aR,parseSchemaCoordinate:()=>h.Ng,UniqueEnumValueNamesRule:()=>aA,isNonNullType:()=>et,isSelectionNode:()=>tL.VK,printError:()=>y.yJ,specifiedDirectives:()=>ta,visit:()=>tV.YR,GraphQLScalarType:()=>eS,assertEnumType:()=>K,UniqueDirectivesPerLocationRule:()=>aI,assertName:()=>j,getDirectiveValues:()=>ay,isConstValueNode:()=>tL.TZ,isEqualType:()=>eq,isNamedType:()=>eb,isTypeDefinitionNode:()=>tL.a6,validateSchema:()=>tS,parse:()=>h.qg,__Schema:()=>td,isTypeSystemDefinitionNode:()=>tL.xu,valueFromASTUntyped:()=>F,LoneSchemaDefinitionRule:()=>tW,isTypeSubTypeOf:()=>eQ,UniqueArgumentNamesRule:()=>aO,UniqueInputFieldNamesRule:()=>aC,locatedError:()=>aJ,typeFromAST:()=>tR,printLocation:()=>rl.V,assertUnionType:()=>H,separateOperations:()=>rK,getVariableValues:()=>ah,Location:()=>g.aZ,GraphQLObjectType:()=>eO,UniqueArgumentDefinitionNamesRule:()=>aS,stripIgnoredCharacters:()=>rZ,GRAPHQL_MAX_INT:()=>ez,visitInParallel:()=>tV.oP,parseType:()=>h.Mb,isTypeNode:()=>tL.dI,PossibleTypeExtensionsRule:()=>aa,graphqlSync:()=>rp,isSchemaCoordinateNode:()=>tL.gj,DirectiveLocation:()=>eG.H,TypeNameMetaFieldDef:()=>tg,coerceInputValue:()=>au,GraphQLInt:()=>eW,resolveObjMapThunk:()=>eN,GraphQLInterfaceType:()=>eR,UniqueOperationNamesRule:()=>aV,GraphQLSkipDirective:()=>e5,isEnumType:()=>W,assertValidName:()=>rX,buildClientSchema:()=>rN,KnownArgumentNamesRule:()=>tB,ValuesOfCorrectTypeRule:()=>aj,isInputObjectType:()=>J,GraphQLID:()=>eX,NoUnusedFragmentsRule:()=>tX,isUnionType:()=>z,isSpecifiedScalarType:()=>e0,getArgumentValues:()=>av,printSourceLocation:()=>rl.C,__EnumValue:()=>tf,getOperationAST:()=>rw,isExecutableDefinitionNode:()=>tL._m,isAbstractType:()=>eu,assertAbstractType:()=>ec,isTypeExtensionNode:()=>tL.i7,GraphQLInputObjectType:()=>eM,getNamedType:()=>eE,parseConstValue:()=>h.u8,KnownFragmentNamesRule:()=>tY,isListType:()=>X,Lexer:()=>ru.JG,isSpecifiedDirective:()=>tr,responsePathAsArray:()=>al,isDirective:()=>e6,TypeInfo:()=>tF,assertScalarType:()=>B,extendSchema:()=>rS,isIntrospectionType:()=>tb,print:()=>R.y,getIntrospectionQuery:()=>rb,GraphQLBoolean:()=>eZ,KnownTypeNamesRule:()=>tG,assertListType:()=>ee,concatAST:()=>rW,NoDeprecatedCustomRule:()=>ry,defaultFieldResolver:()=>rr,GraphQLDirective:()=>e3,getLocation:()=>rs.g,TypeMetaFieldDef:()=>ty,GRAPHQL_MIN_INT:()=>eH,GraphQLIncludeDirective:()=>e9,ScalarLeafsRule:()=>ao,assertSchema:()=>tE,lexicographicSortSchema:()=>rC,GraphQLList:()=>em,isTypeSystemExtensionNode:()=>tL.fT,specifiedScalarTypes:()=>e1,BreakingChangeType:()=>u,ExecutableDefinitionsRule:()=>t$,assertDirective:()=>e4,__Field:()=>tc,getVisitFn:()=>tV.UY,recommendedRules:()=>aU,SchemaMetaFieldDef:()=>tv,assertCompositeType:()=>el,isRequiredInputField:()=>eB,Token:()=>g.ou,specifiedRules:()=>aB,DangerousChangeType:()=>c,GraphQLUnionType:()=>eF,isCompositeType:()=>es,versionInfo:()=>n,FieldsOnCorrectTypeRule:()=>tM,GraphQLString:()=>eJ,assertType:()=>M,introspectionFromSchema:()=>rT,doTypesOverlap:()=>eY,GraphQLEnumType:()=>ej,resolveReadonlyArrayThunk:()=>eT,GraphQLOneOfDirective:()=>tt,NoFragmentCyclesRule:()=>tJ,findBreakingChanges:()=>r0,ValidationContext:()=>aG,OverlappingFieldsCanBeMergedRule:()=>t2,isScalarType:()=>U,MaxIntrospectionDepthRule:()=>tK,NoUndefinedVariablesRule:()=>tZ,assertObjectType:()=>Q,getOperationRootType:()=>rE,printType:()=>rU,OperationTypeNode:()=>g.cE,isInputType:()=>er,__Directive:()=>ts,GraphQLSchema:()=>tT,Source:()=>rd.k,resolveASTSchemaCoordinate:()=>r7,GraphQLError:()=>y.eO,assertNamedType:()=>ew,buildSchema:()=>rx,introspectionTypes:()=>t_,PossibleFragmentSpreadsRule:()=>at,__Type:()=>tu,getEnterLeaveForKind:()=>tV.XO,TokenKind:()=>rc.Y,printIntrospectionSchema:()=>rL,isNullableType:()=>ey,subscribe:()=>rf});let i="16.12.0",n=Object.freeze({major:16,minor:12,patch:0,preReleaseTag:null});var p,o,d,s,l,u,c,m=a(93217);function f(e){return"function"==typeof(null==e?void 0:e.then)}var h=a(20186),v=a(35198),y=a(48255),g=a(59762);function _(e,t){let[a,r]=t?[e,t]:[void 0,e],i=" Did you mean ";a&&(i+=a+" ");let n=r.map(e=>`"${e}"`);switch(n.length){case 0:return"";case 1:return i+n[0]+"?";case 2:return i+n[0]+" or "+n[1]+"?"}let p=n.slice(0,5),o=p.pop();return i+p.join(", ")+", or "+o+"?"}function b(e){return e}var w=a(50792),E=a(91070);function T(e,t){let a=Object.create(null);for(let r of e)a[t(r)]=r;return a}function N(e,t,a){let r=Object.create(null);for(let i of e)r[t(i)]=a(i);return r}function S(e,t){let a=Object.create(null);for(let r of Object.keys(e))a[r]=t(e[r],r);return a}function O(e,t){let a=0,r=0;for(;a<e.length&&r<t.length;){let i=e.charCodeAt(a),n=t.charCodeAt(r);if(I(i)&&I(n)){let p=0;do++a,p=10*p+i-D,i=e.charCodeAt(a);while(I(i)&&p>0);let o=0;do++r,o=10*o+n-D,n=t.charCodeAt(r);while(I(n)&&o>0);if(p<o)return -1;if(p>o)return 1}else{if(i<n)return -1;if(i>n)return 1;++a,++r}}return e.length-t.length}let D=48;function I(e){return!isNaN(e)&&D<=e&&e<=57}function A(e,t){let a=Object.create(null),r=new k(e),i=Math.floor(.4*e.length)+1;for(let e of t){let t=r.measure(e,i);void 0!==t&&(a[e]=t)}return Object.keys(a).sort((e,t)=>{let r=a[e]-a[t];return 0!==r?r:O(e,t)})}class k{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=x(this._inputLowerCase),this._rows=[Array(e.length+1).fill(0),Array(e.length+1).fill(0),Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;let a=e.toLowerCase();if(this._inputLowerCase===a)return 1;let r=x(a),i=this._inputArray;if(r.length<i.length){let e=r;r=i,i=e}let n=r.length,p=i.length;if(n-p>t)return;let o=this._rows;for(let e=0;e<=p;e++)o[0][e]=e;for(let e=1;e<=n;e++){let a=o[(e-1)%3],n=o[e%3],d=n[0]=e;for(let t=1;t<=p;t++){let p=+(r[e-1]!==i[t-1]),s=Math.min(a[t]+1,n[t-1]+1,a[t-1]+p);e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]&&(s=Math.min(s,o[(e-2)%3][t-2]+1)),s<d&&(d=s),n[t]=s}if(d>t)return}let d=o[n%3][p];return d<=t?d:void 0}}function x(e){let t=e.length,a=Array(t);for(let r=0;r<t;++r)a[r]=e.charCodeAt(r);return a}function C(e){if(null==e)return Object.create(null);if(null===Object.getPrototypeOf(e))return e;let t=Object.create(null);for(let[a,r]of Object.entries(e))t[a]=r;return t}var V=a(42455),R=a(95818);function F(e,t){switch(e.kind){case V.b.NULL:return null;case V.b.INT:return parseInt(e.value,10);case V.b.FLOAT:return parseFloat(e.value);case V.b.STRING:case V.b.ENUM:case V.b.BOOLEAN:return e.value;case V.b.LIST:return e.values.map(e=>F(e,t));case V.b.OBJECT:return N(e.fields,e=>e.name.value,e=>F(e.value,t));case V.b.VARIABLE:return null==t?void 0:t[e.name.value]}}var P=a(25881);function j(e){if(null!=e||(0,m.U)(!1,"Must provide name."),"string"==typeof e||(0,m.U)(!1,"Expected name to be a string."),0===e.length)throw new y.eO("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!(0,P.xr)(e.charCodeAt(t)))throw new y.eO(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!(0,P.un)(e.charCodeAt(0)))throw new y.eO(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}function L(e){if("true"===e||"false"===e||"null"===e)throw new y.eO(`Enum values cannot be named: ${e}`);return j(e)}function $(e){return U(e)||q(e)||Y(e)||z(e)||W(e)||J(e)||X(e)||et(e)}function M(e){if(!$(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL type.`);return e}function U(e){return(0,w.h)(e,eS)}function B(e){if(!U(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Scalar type.`);return e}function q(e){return(0,w.h)(e,eO)}function Q(e){if(!q(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Object type.`);return e}function Y(e){return(0,w.h)(e,eR)}function G(e){if(!Y(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Interface type.`);return e}function z(e){return(0,w.h)(e,eF)}function H(e){if(!z(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Union type.`);return e}function W(e){return(0,w.h)(e,ej)}function K(e){if(!W(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Enum type.`);return e}function J(e){return(0,w.h)(e,eM)}function Z(e){if(!J(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Input Object type.`);return e}function X(e){return(0,w.h)(e,em)}function ee(e){if(!X(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL List type.`);return e}function et(e){return(0,w.h)(e,ef)}function ea(e){if(!et(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Non-Null type.`);return e}function er(e){return U(e)||W(e)||J(e)||eh(e)&&er(e.ofType)}function ei(e){if(!er(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL input type.`);return e}function en(e){return U(e)||q(e)||Y(e)||z(e)||W(e)||eh(e)&&en(e.ofType)}function ep(e){if(!en(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL output type.`);return e}function eo(e){return U(e)||W(e)}function ed(e){if(!eo(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL leaf type.`);return e}function es(e){return q(e)||Y(e)||z(e)}function el(e){if(!es(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL composite type.`);return e}function eu(e){return Y(e)||z(e)}function ec(e){if(!eu(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL abstract type.`);return e}class em{constructor(e){$(e)||(0,m.U)(!1,`Expected ${(0,v.N)(e)} to be a GraphQL type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class ef{constructor(e){ey(e)||(0,m.U)(!1,`Expected ${(0,v.N)(e)} to be a GraphQL nullable type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function eh(e){return X(e)||et(e)}function ev(e){if(!eh(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL wrapping type.`);return e}function ey(e){return $(e)&&!et(e)}function eg(e){if(!ey(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL nullable type.`);return e}function e_(e){if(e)return et(e)?e.ofType:e}function eb(e){return U(e)||q(e)||Y(e)||z(e)||W(e)||J(e)}function ew(e){if(!eb(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL named type.`);return e}function eE(e){if(e){let t=e;for(;eh(t);)t=t.ofType;return t}}function eT(e){return"function"==typeof e?e():e}function eN(e){return"function"==typeof e?e():e}class eS{constructor(e){var t,a,r,i;let n=null!=(t=e.parseValue)?t:b;this.name=j(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=null!=(a=e.serialize)?a:b,this.parseValue=n,this.parseLiteral=null!=(r=e.parseLiteral)?r:(e,t)=>n(F(e,t)),this.extensions=C(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(i=e.extensionASTNodes)?i:[],null==e.specifiedByURL||"string"==typeof e.specifiedByURL||(0,m.U)(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${(0,v.N)(e.specifiedByURL)}.`),null==e.serialize||"function"==typeof e.serialize||(0,m.U)(!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.`),e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||(0,m.U)(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class eO{constructor(e){var t;this.name=j(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=C(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._fields=()=>eI(e),this._interfaces=()=>eD(e),null==e.isTypeOf||"function"==typeof e.isTypeOf||(0,m.U)(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${(0,v.N)(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:ex(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function eD(e){var t;let a=eT(null!=(t=e.interfaces)?t:[]);return Array.isArray(a)||(0,m.U)(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),a}function eI(e){let t=eN(e.fields);return ek(t)||(0,m.U)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),S(t,(t,a)=>{var r;ek(t)||(0,m.U)(!1,`${e.name}.${a} field config must be an object.`),null==t.resolve||"function"==typeof t.resolve||(0,m.U)(!1,`${e.name}.${a} field resolver must be a function if provided, but got: ${(0,v.N)(t.resolve)}.`);let i=null!=(r=t.args)?r:{};return ek(i)||(0,m.U)(!1,`${e.name}.${a} args must be an object with argument names as keys.`),{name:j(a),description:t.description,type:t.type,args:eA(i),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:C(t.extensions),astNode:t.astNode}})}function eA(e){return Object.entries(e).map(([e,t])=>({name:j(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:C(t.extensions),astNode:t.astNode}))}function ek(e){return(0,E.Z)(e)&&!Array.isArray(e)}function ex(e){return S(e,e=>({description:e.description,type:e.type,args:eC(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function eC(e){return N(e,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function eV(e){return et(e.type)&&void 0===e.defaultValue}class eR{constructor(e){var t;this.name=j(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=C(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._fields=eI.bind(void 0,e),this._interfaces=eD.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,m.U)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,v.N)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:ex(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class eF{constructor(e){var t;this.name=j(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=C(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._types=eP.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,m.U)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,v.N)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function eP(e){let t=eT(e.types);return Array.isArray(t)||(0,m.U)(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}class ej{constructor(e){var t;this.name=j(e.name),this.description=e.description,this.extensions=C(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._values="function"==typeof e.values?e.values:e$(this.name,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return"function"==typeof this._values&&(this._values=e$(this.name,this._values())),this._values}getValue(e){return null===this._nameLookup&&(this._nameLookup=T(this.getValues(),e=>e.name)),this._nameLookup[e]}serialize(e){null===this._valueLookup&&(this._valueLookup=new Map(this.getValues().map(e=>[e.value,e])));let t=this._valueLookup.get(e);if(void 0===t)throw new y.eO(`Enum "${this.name}" cannot represent value: ${(0,v.N)(e)}`);return t.name}parseValue(e){if("string"!=typeof e){let t=(0,v.N)(e);throw new y.eO(`Enum "${this.name}" cannot represent non-string value: ${t}.`+eL(this,t))}let t=this.getValue(e);if(null==t)throw new y.eO(`Value "${e}" does not exist in "${this.name}" enum.`+eL(this,e));return t.value}parseLiteral(e,t){if(e.kind!==V.b.ENUM){let t=(0,R.y)(e);throw new y.eO(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+eL(this,t),{nodes:e})}let a=this.getValue(e.value);if(null==a){let t=(0,R.y)(e);throw new y.eO(`Value "${t}" does not exist in "${this.name}" enum.`+eL(this,t),{nodes:e})}return a.value}toConfig(){let e=N(this.getValues(),e=>e.name,e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function eL(e,t){return _("the enum value",A(t,e.getValues().map(e=>e.name)))}function e$(e,t){return ek(t)||(0,m.U)(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([t,a])=>(ek(a)||(0,m.U)(!1,`${e}.${t} must refer to an object with a "value" key representing an internal value but got: ${(0,v.N)(a)}.`),{name:L(t),description:a.description,value:void 0!==a.value?a.value:t,deprecationReason:a.deprecationReason,extensions:C(a.extensions),astNode:a.astNode}))}class eM{constructor(e){var t,a;this.name=j(e.name),this.description=e.description,this.extensions=C(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this.isOneOf=null!=(a=e.isOneOf)&&a,this._fields=eU.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){let e=S(this.getFields(),e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function eU(e){let t=eN(e.fields);return ek(t)||(0,m.U)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),S(t,(t,a)=>("resolve"in t&&(0,m.U)(!1,`${e.name}.${a} field has a resolve property, but Input Types cannot define resolvers.`),{name:j(a),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:C(t.extensions),astNode:t.astNode}))}function eB(e){return et(e.type)&&void 0===e.defaultValue}function eq(e,t){return e===t||!!(et(e)&&et(t)||X(e)&&X(t))&&eq(e.ofType,t.ofType)}function eQ(e,t,a){return t===a||(et(a)?!!et(t)&&eQ(e,t.ofType,a.ofType):et(t)?eQ(e,t.ofType,a):X(a)?!!X(t)&&eQ(e,t.ofType,a.ofType):!X(t)&&eu(a)&&(Y(t)||q(t))&&e.isSubType(a,t))}function eY(e,t,a){return t===a||(eu(t)?eu(a)?e.getPossibleTypes(t).some(t=>e.isSubType(a,t)):e.isSubType(t,a):!!eu(a)&&e.isSubType(a,t))}var eG=a(42868);let ez=0x7fffffff,eH=-0x80000000,eW=new eS({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=e2(e);if("boolean"==typeof t)return+!!t;let a=t;if("string"==typeof t&&""!==t&&(a=Number(t)),"number"!=typeof a||!Number.isInteger(a))throw new y.eO(`Int cannot represent non-integer value: ${(0,v.N)(t)}`);if(a>ez||a<eH)throw new y.eO("Int cannot represent non 32-bit signed integer value: "+(0,v.N)(t));return a},parseValue(e){if("number"!=typeof e||!Number.isInteger(e))throw new y.eO(`Int cannot represent non-integer value: ${(0,v.N)(e)}`);if(e>ez||e<eH)throw new y.eO(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==V.b.INT)throw new y.eO(`Int cannot represent non-integer value: ${(0,R.y)(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>ez||t<eH)throw new y.eO(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),eK=new eS({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(e){let t=e2(e);if("boolean"==typeof t)return+!!t;let a=t;if("string"==typeof t&&""!==t&&(a=Number(t)),"number"!=typeof a||!Number.isFinite(a))throw new y.eO(`Float cannot represent non numeric value: ${(0,v.N)(t)}`);return a},parseValue(e){if("number"!=typeof e||!Number.isFinite(e))throw new y.eO(`Float cannot represent non numeric value: ${(0,v.N)(e)}`);return e},parseLiteral(e){if(e.kind!==V.b.FLOAT&&e.kind!==V.b.INT)throw new y.eO(`Float cannot represent non numeric value: ${(0,R.y)(e)}`,e);return parseFloat(e.value)}}),eJ=new eS({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(e){let t=e2(e);if("string"==typeof t)return t;if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t&&Number.isFinite(t))return t.toString();throw new y.eO(`String cannot represent value: ${(0,v.N)(e)}`)},parseValue(e){if("string"!=typeof e)throw new y.eO(`String cannot represent a non string value: ${(0,v.N)(e)}`);return e},parseLiteral(e){if(e.kind!==V.b.STRING)throw new y.eO(`String cannot represent a non string value: ${(0,R.y)(e)}`,{nodes:e});return e.value}}),eZ=new eS({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){let t=e2(e);if("boolean"==typeof t)return t;if(Number.isFinite(t))return 0!==t;throw new y.eO(`Boolean cannot represent a non boolean value: ${(0,v.N)(t)}`)},parseValue(e){if("boolean"!=typeof e)throw new y.eO(`Boolean cannot represent a non boolean value: ${(0,v.N)(e)}`);return e},parseLiteral(e){if(e.kind!==V.b.BOOLEAN)throw new y.eO(`Boolean cannot represent a non boolean value: ${(0,R.y)(e)}`,{nodes:e});return e.value}}),eX=new eS({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(e){let t=e2(e);if("string"==typeof t)return t;if(Number.isInteger(t))return String(t);throw new y.eO(`ID cannot represent value: ${(0,v.N)(e)}`)},parseValue(e){if("string"==typeof e)return e;if("number"==typeof e&&Number.isInteger(e))return e.toString();throw new y.eO(`ID cannot represent value: ${(0,v.N)(e)}`)},parseLiteral(e){if(e.kind!==V.b.STRING&&e.kind!==V.b.INT)throw new y.eO("ID cannot represent a non-string and non-integer value: "+(0,R.y)(e),{nodes:e});return e.value}}),e1=Object.freeze([eJ,eW,eK,eZ,eX]);function e0(e){return e1.some(({name:t})=>e.name===t)}function e2(e){if((0,E.Z)(e)){if("function"==typeof e.valueOf){let t=e.valueOf();if(!(0,E.Z)(t))return t}if("function"==typeof e.toJSON)return e.toJSON()}return e}function e6(e){return(0,w.h)(e,e3)}function e4(e){if(!e6(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL directive.`);return e}class e3{constructor(e){var t,a;this.name=j(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=null!=(t=e.isRepeatable)&&t,this.extensions=C(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||(0,m.U)(!1,`@${e.name} locations must be an Array.`);let r=null!=(a=e.args)?a:{};(0,E.Z)(r)&&!Array.isArray(r)||(0,m.U)(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=eA(r)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:eC(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}let e9=new e3({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[eG.H.FIELD,eG.H.FRAGMENT_SPREAD,eG.H.INLINE_FRAGMENT],args:{if:{type:new ef(eZ),description:"Included when true."}}}),e5=new e3({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[eG.H.FIELD,eG.H.FRAGMENT_SPREAD,eG.H.INLINE_FRAGMENT],args:{if:{type:new ef(eZ),description:"Skipped when true."}}}),e8="No longer supported",e7=new e3({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[eG.H.FIELD_DEFINITION,eG.H.ARGUMENT_DEFINITION,eG.H.INPUT_FIELD_DEFINITION,eG.H.ENUM_VALUE],args:{reason:{type:eJ,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:e8}}}),te=new e3({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[eG.H.SCALAR],args:{url:{type:new ef(eJ),description:"The URL that specifies the behavior of this scalar."}}}),tt=new e3({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[eG.H.INPUT_OBJECT],args:{}}),ta=Object.freeze([e9,e5,e7,te,tt]);function tr(e){return ta.some(({name:t})=>t===e.name)}var ti=a(71306);function tn(e){return"object"==typeof e&&"function"==typeof(null==e?void 0:e[Symbol.iterator])}function tp(e,t){if(et(t)){let a=tp(e,t.ofType);return(null==a?void 0:a.kind)===V.b.NULL?null:a}if(null===e)return{kind:V.b.NULL};if(void 0===e)return null;if(X(t)){let a=t.ofType;if(tn(e)){let t=[];for(let r of e){let e=tp(r,a);null!=e&&t.push(e)}return{kind:V.b.LIST,values:t}}return tp(e,a)}if(J(t)){if(!(0,E.Z)(e))return null;let a=[];for(let r of Object.values(t.getFields())){let t=tp(e[r.name],r.type);t&&a.push({kind:V.b.OBJECT_FIELD,name:{kind:V.b.NAME,value:r.name},value:t})}return{kind:V.b.OBJECT,fields:a}}if(eo(t)){let a=t.serialize(e);if(null==a)return null;if("boolean"==typeof a)return{kind:V.b.BOOLEAN,value:a};if("number"==typeof a&&Number.isFinite(a)){let e=String(a);return to.test(e)?{kind:V.b.INT,value:e}:{kind:V.b.FLOAT,value:e}}if("string"==typeof a)return W(t)?{kind:V.b.ENUM,value:a}:t===eX&&to.test(a)?{kind:V.b.INT,value:a}:{kind:V.b.STRING,value:a};throw TypeError(`Cannot convert value to AST: ${(0,v.N)(a)}.`)}(0,ti.V)(!1,"Unexpected input type: "+(0,v.N)(t))}let to=/^-?(?:0|[1-9][0-9]*)$/,td=new eO({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:eJ,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new ef(new em(new ef(tu))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new ef(tu),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:tu,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:tu,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new ef(new em(new ef(ts))),resolve:e=>e.getDirectives()}})}),ts=new eO({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn 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 ef(eJ),resolve:e=>e.name},description:{type:eJ,resolve:e=>e.description},isRepeatable:{type:new ef(eZ),resolve:e=>e.isRepeatable},locations:{type:new ef(new em(new ef(tl))),resolve:e=>e.locations},args:{type:new ef(new em(new ef(tm))),args:{includeDeprecated:{type:eZ,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter(e=>null==e.deprecationReason)}})}),tl=new ej({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:eG.H.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:eG.H.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:eG.H.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:eG.H.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:eG.H.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:eG.H.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:eG.H.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:eG.H.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:eG.H.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:eG.H.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:eG.H.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:eG.H.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:eG.H.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:eG.H.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:eG.H.UNION,description:"Location adjacent to a union definition."},ENUM:{value:eG.H.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:eG.H.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:eG.H.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:eG.H.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),tu=new eO({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 ef(th),resolve:e=>U(e)?l.SCALAR:q(e)?l.OBJECT:Y(e)?l.INTERFACE:z(e)?l.UNION:W(e)?l.ENUM:J(e)?l.INPUT_OBJECT:X(e)?l.LIST:et(e)?l.NON_NULL:void(0,ti.V)(!1,`Unexpected type: "${(0,v.N)(e)}".`)},name:{type:eJ,resolve:e=>"name"in e?e.name:void 0},description:{type:eJ,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:eJ,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new em(new ef(tc)),args:{includeDeprecated:{type:eZ,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(q(e)||Y(e)){let a=Object.values(e.getFields());return t?a:a.filter(e=>null==e.deprecationReason)}}},interfaces:{type:new em(new ef(tu)),resolve(e){if(q(e)||Y(e))return e.getInterfaces()}},possibleTypes:{type:new em(new ef(tu)),resolve(e,t,a,{schema:r}){if(eu(e))return r.getPossibleTypes(e)}},enumValues:{type:new em(new ef(tf)),args:{includeDeprecated:{type:eZ,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(W(e)){let a=e.getValues();return t?a:a.filter(e=>null==e.deprecationReason)}}},inputFields:{type:new em(new ef(tm)),args:{includeDeprecated:{type:eZ,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(J(e)){let a=Object.values(e.getFields());return t?a:a.filter(e=>null==e.deprecationReason)}}},ofType:{type:tu,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:eZ,resolve:e=>{if(J(e))return e.isOneOf}}})}),tc=new eO({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 ef(eJ),resolve:e=>e.name},description:{type:eJ,resolve:e=>e.description},args:{type:new ef(new em(new ef(tm))),args:{includeDeprecated:{type:eZ,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter(e=>null==e.deprecationReason)},type:{type:new ef(tu),resolve:e=>e.type},isDeprecated:{type:new ef(eZ),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:eJ,resolve:e=>e.deprecationReason}})}),tm=new eO({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 ef(eJ),resolve:e=>e.name},description:{type:eJ,resolve:e=>e.description},type:{type:new ef(tu),resolve:e=>e.type},defaultValue:{type:eJ,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:a}=e,r=tp(a,t);return r?(0,R.y)(r):null}},isDeprecated:{type:new ef(eZ),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:eJ,resolve:e=>e.deprecationReason}})}),tf=new eO({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 ef(eJ),resolve:e=>e.name},description:{type:eJ,resolve:e=>e.description},isDeprecated:{type:new ef(eZ),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:eJ,resolve:e=>e.deprecationReason}})});(p=l||(l={})).SCALAR="SCALAR",p.OBJECT="OBJECT",p.INTERFACE="INTERFACE",p.UNION="UNION",p.ENUM="ENUM",p.INPUT_OBJECT="INPUT_OBJECT",p.LIST="LIST",p.NON_NULL="NON_NULL";let th=new ej({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:l.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:l.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:l.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:l.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:l.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:l.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:l.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:l.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),tv={name:"__schema",type:new ef(td),description:"Access the current type schema of this server.",args:[],resolve:(e,t,a,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},ty={name:"__type",type:tu,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new ef(eJ),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},a,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},tg={name:"__typename",type:new ef(eJ),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,a,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},t_=Object.freeze([td,ts,tl,tu,tc,tm,tf,th]);function tb(e){return t_.some(({name:t})=>e.name===t)}function tw(e){return(0,w.h)(e,tT)}function tE(e){if(!tw(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL schema.`);return e}class tT{constructor(e){var t,a;this.__validationErrors=!0===e.assumeValid?[]:void 0,(0,E.Z)(e)||(0,m.U)(!1,"Must provide configuration object."),!e.types||Array.isArray(e.types)||(0,m.U)(!1,`"types" must be Array if provided but got: ${(0,v.N)(e.types)}.`),!e.directives||Array.isArray(e.directives)||(0,m.U)(!1,`"directives" must be Array if provided but got: ${(0,v.N)(e.directives)}.`),this.description=e.description,this.extensions=C(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=null!=(a=e.directives)?a:ta;let r=new Set(e.types);if(null!=e.types)for(let t of e.types)r.delete(t),tN(t,r);for(let e of(null!=this._queryType&&tN(this._queryType,r),null!=this._mutationType&&tN(this._mutationType,r),null!=this._subscriptionType&&tN(this._subscriptionType,r),this._directives))if(e6(e))for(let t of e.args)tN(t.type,r);for(let e of(tN(td,r),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null),r)){if(null==e)continue;let t=e.name;if(t||(0,m.U)(!1,"One of the provided types for building the Schema is missing a name."),void 0!==this._typeMap[t])throw Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,Y(e)){for(let t of e.getInterfaces())if(Y(t)){let a=this._implementationsMap[t.name];void 0===a&&(a=this._implementationsMap[t.name]={objects:[],interfaces:[]}),a.interfaces.push(e)}}else if(q(e)){for(let t of e.getInterfaces())if(Y(t)){let a=this._implementationsMap[t.name];void 0===a&&(a=this._implementationsMap[t.name]={objects:[],interfaces:[]}),a.objects.push(e)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case g.cE.QUERY:return this.getQueryType();case g.cE.MUTATION:return this.getMutationType();case g.cE.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return z(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){let t=this._implementationsMap[e.name];return null!=t?t:{objects:[],interfaces:[]}}isSubType(e,t){let a=this._subTypeMap[e.name];if(void 0===a){if(a=Object.create(null),z(e))for(let t of e.getTypes())a[t.name]=!0;else{let t=this.getImplementations(e);for(let e of t.objects)a[e.name]=!0;for(let e of t.interfaces)a[e.name]=!0}this._subTypeMap[e.name]=a}return void 0!==a[t.name]}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(t=>t.name===e)}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:void 0!==this.__validationErrors}}}function tN(e,t){let a=eE(e);if(!t.has(a)){if(t.add(a),z(a))for(let e of a.getTypes())tN(e,t);else if(q(a)||Y(a)){for(let e of a.getInterfaces())tN(e,t);for(let e of Object.values(a.getFields()))for(let a of(tN(e.type,t),e.args))tN(a.type,t)}else if(J(a))for(let e of Object.values(a.getFields()))tN(e.type,t)}return t}function tS(e){var t,a,r,i;let n,p,o,d;if(tE(e),e.__validationErrors)return e.__validationErrors;let s=new tD(e);(p=(n=(t=s).schema).getQueryType())?q(p)||t.reportError(`Query root type must be Object type, it cannot be ${(0,v.N)(p)}.`,null!=(a=tI(n,g.cE.QUERY))?a:p.astNode):t.reportError("Query root type must be provided.",n.astNode),(o=n.getMutationType())&&!q(o)&&t.reportError(`Mutation root type must be Object type if provided, it cannot be ${(0,v.N)(o)}.`,null!=(r=tI(n,g.cE.MUTATION))?r:o.astNode),(d=n.getSubscriptionType())&&!q(d)&&t.reportError(`Subscription root type must be Object type if provided, it cannot be ${(0,v.N)(d)}.`,null!=(i=tI(n,g.cE.SUBSCRIPTION))?i:d.astNode),function(e){for(let a of e.schema.getDirectives()){if(!e6(a)){e.reportError(`Expected directive but got: ${(0,v.N)(a)}.`,null==a?void 0:a.astNode);continue}for(let r of(tA(e,a),0===a.locations.length&&e.reportError(`Directive @${a.name} must include 1 or more locations.`,a.astNode),a.args))if(tA(e,r),er(r.type)||e.reportError(`The type of @${a.name}(${r.name}:) must be Input Type but got: ${(0,v.N)(r.type)}.`,r.astNode),eV(r)&&null!=r.deprecationReason){var t;e.reportError(`Required argument @${a.name}(${r.name}:) cannot be deprecated.`,[tC(r.astNode),null==(t=r.astNode)?void 0:t.type])}}}(s),function(e){var t;let a,r,i,n=(t=e,a=Object.create(null),r=[],i=Object.create(null),function e(n){if(!a[n.name]){for(let p of(a[n.name]=!0,i[n.name]=r.length,Object.values(n.getFields())))if(et(p.type)&&J(p.type.ofType)){let a=p.type.ofType,n=i[a.name];if(r.push(p),void 0===n)e(a);else{let e=r.slice(n),i=e.map(e=>e.name).join(".");t.reportError(`Cannot reference Input Object "${a.name}" within itself through a series of non-null fields: "${i}".`,e.map(e=>e.astNode))}r.pop()}i[n.name]=void 0}});for(let t of Object.values(e.schema.getTypeMap())){if(!eb(t)){e.reportError(`Expected GraphQL named type but got: ${(0,v.N)(t)}.`,t.astNode);continue}tb(t)||tA(e,t),q(t)||Y(t)?(function(e,t){let a=Object.values(t.getFields());for(let p of(0===a.length&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]),a)){var r,i,n;for(let a of(tA(e,p),en(p.type)||e.reportError(`The type of ${t.name}.${p.name} must be Output Type but got: ${(0,v.N)(p.type)}.`,null==(r=p.astNode)?void 0:r.type),p.args)){let r=a.name;tA(e,a),er(a.type)||e.reportError(`The type of ${t.name}.${p.name}(${r}:) must be Input Type but got: ${(0,v.N)(a.type)}.`,null==(i=a.astNode)?void 0:i.type),eV(a)&&null!=a.deprecationReason&&e.reportError(`Required argument ${t.name}.${p.name}(${r}:) cannot be deprecated.`,[tC(a.astNode),null==(n=a.astNode)?void 0:n.type])}}}(e,t),function(e,t){let a=Object.create(null);for(let r of t.getInterfaces()){if(!Y(r)){e.reportError(`Type ${(0,v.N)(t)} must only implement Interface types, it cannot implement ${(0,v.N)(r)}.`,tk(t,r));continue}if(t===r){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,tk(t,r));continue}if(a[r.name]){e.reportError(`Type ${t.name} can only implement ${r.name} once.`,tk(t,r));continue}a[r.name]=!0,function(e,t,a){let r=t.getInterfaces();for(let i of a.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${a.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${a.name}.`,[...tk(a,i),...tk(t,a)])}(e,t,r),function(e,t,a){let r=t.getFields();for(let d of Object.values(a.getFields())){var i,n,p,o;let s=d.name,l=r[s];if(!l){e.reportError(`Interface field ${a.name}.${s} expected but ${t.name} does not provide it.`,[d.astNode,t.astNode,...t.extensionASTNodes]);continue}for(let r of(eQ(e.schema,l.type,d.type)||e.reportError(`Interface field ${a.name}.${s} expects type ${(0,v.N)(d.type)} but ${t.name}.${s} is type ${(0,v.N)(l.type)}.`,[null==(i=d.astNode)?void 0:i.type,null==(n=l.astNode)?void 0:n.type]),d.args)){let i=r.name,n=l.args.find(e=>e.name===i);if(!n){e.reportError(`Interface field argument ${a.name}.${s}(${i}:) expected but ${t.name}.${s} does not provide it.`,[r.astNode,l.astNode]);continue}eq(r.type,n.type)||e.reportError(`Interface field argument ${a.name}.${s}(${i}:) expects type ${(0,v.N)(r.type)} but ${t.name}.${s}(${i}:) is type ${(0,v.N)(n.type)}.`,[null==(p=r.astNode)?void 0:p.type,null==(o=n.astNode)?void 0:o.type])}for(let r of l.args){let i=r.name;!d.args.find(e=>e.name===i)&&eV(r)&&e.reportError(`Object field ${t.name}.${s} includes required argument ${i} that is missing from the Interface field ${a.name}.${s}.`,[r.astNode,d.astNode])}}}(e,t,r)}}(e,t)):z(t)?function(e,t){let a=t.getTypes();0===a.length&&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 a){if(r[i.name]){e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,tx(t,i.name));continue}r[i.name]=!0,q(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${(0,v.N)(i)}.`,tx(t,String(i)))}}(e,t):W(t)?function(e,t){let a=t.getValues();for(let r of(0===a.length&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]),a))tA(e,r)}(e,t):J(t)&&(function(e,t){let a=Object.values(t.getFields());for(let n of(0===a.length&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]),a)){var r,i;tA(e,n),er(n.type)||e.reportError(`The type of ${t.name}.${n.name} must be Input Type but got: ${(0,v.N)(n.type)}.`,null==(r=n.astNode)?void 0:r.type),eB(n)&&null!=n.deprecationReason&&e.reportError(`Required input field ${t.name}.${n.name} cannot be deprecated.`,[tC(n.astNode),null==(i=n.astNode)?void 0:i.type]),t.isOneOf&&function(e,t,a){if(et(t.type)){var r;a.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,null==(r=t.astNode)?void 0:r.type)}void 0!==t.defaultValue&&a.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode)}(t,n,e)}}(e,t),n(t))}}(s);let l=s.getErrors();return e.__validationErrors=l,l}function tO(e){let t=tS(e);if(0!==t.length)throw Error(t.map(e=>e.message).join("\n\n"))}class tD{constructor(e){this._errors=[],this.schema=e}reportError(e,t){let a=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new y.eO(e,{nodes:a}))}getErrors(){return this._errors}}function tI(e,t){var a;return null==(a=[e.astNode,...e.extensionASTNodes].flatMap(e=>{var t;return null!=(t=null==e?void 0:e.operationTypes)?t:[]}).find(e=>e.operation===t))?void 0:a.type}function tA(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function tk(e,t){let{astNode:a,extensionASTNodes:r}=e;return(null!=a?[a,...r]:r).flatMap(e=>{var t;return null!=(t=e.interfaces)?t:[]}).filter(e=>e.name.value===t.name)}function tx(e,t){let{astNode:a,extensionASTNodes:r}=e;return(null!=a?[a,...r]:r).flatMap(e=>{var t;return null!=(t=e.types)?t:[]}).filter(e=>e.name.value===t)}function tC(e){var t;return null==e||null==(t=e.directives)?void 0:t.find(e=>e.name.value===e7.name)}var tV=a(90424);function tR(e,t){switch(t.kind){case V.b.LIST_TYPE:{let a=tR(e,t.type);return a&&new em(a)}case V.b.NON_NULL_TYPE:{let a=tR(e,t.type);return a&&new ef(a)}case V.b.NAMED_TYPE:return e.getType(t.name.value)}}class tF{constructor(e,t,a){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=null!=a?a:tP,t&&(er(t)&&this._inputTypeStack.push(t),es(t)&&this._parentTypeStack.push(t),en(t)&&this._typeStack.push(t))}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(e){let t=this._schema;switch(e.kind){case V.b.SELECTION_SET:{let e=eE(this.getType());this._parentTypeStack.push(es(e)?e:void 0);break}case V.b.FIELD:{let a,r,i=this.getParentType();i&&(a=this._getFieldDef(t,i,e))&&(r=a.type),this._fieldDefStack.push(a),this._typeStack.push(en(r)?r:void 0);break}case V.b.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case V.b.OPERATION_DEFINITION:{let a=t.getRootType(e.operation);this._typeStack.push(q(a)?a:void 0);break}case V.b.INLINE_FRAGMENT:case V.b.FRAGMENT_DEFINITION:{let a=e.typeCondition,r=a?tR(t,a):eE(this.getType());this._typeStack.push(en(r)?r:void 0);break}case V.b.VARIABLE_DEFINITION:{let a=tR(t,e.type);this._inputTypeStack.push(er(a)?a:void 0);break}case V.b.ARGUMENT:{var a;let t,r,i=null!=(a=this.getDirective())?a:this.getFieldDef();i&&(t=i.args.find(t=>t.name===e.name.value))&&(r=t.type),this._argument=t,this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push(er(r)?r:void 0);break}case V.b.LIST:{let e=e_(this.getInputType()),t=X(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push(er(t)?t:void 0);break}case V.b.OBJECT_FIELD:{let t,a,r=eE(this.getInputType());J(r)&&(a=r.getFields()[e.name.value])&&(t=a.type),this._defaultValueStack.push(a?a.defaultValue:void 0),this._inputTypeStack.push(er(t)?t:void 0);break}case V.b.ENUM:{let t,a=eE(this.getInputType());W(a)&&(t=a.getValue(e.value)),this._enumValue=t}}}leave(e){switch(e.kind){case V.b.SELECTION_SET:this._parentTypeStack.pop();break;case V.b.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case V.b.DIRECTIVE:this._directive=null;break;case V.b.OPERATION_DEFINITION:case V.b.INLINE_FRAGMENT:case V.b.FRAGMENT_DEFINITION:this._typeStack.pop();break;case V.b.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case V.b.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case V.b.LIST:case V.b.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case V.b.ENUM:this._enumValue=null}}}function tP(e,t,a){let r=a.name.value;return r===tv.name&&e.getQueryType()===t?tv:r===ty.name&&e.getQueryType()===t?ty:r===tg.name&&es(t)?tg:q(t)||Y(t)?t.getFields()[r]:void 0}function tj(e,t){return{enter(...a){let r=a[0];e.enter(r);let i=(0,tV.XO)(t,r.kind).enter;if(i){let n=i.apply(t,a);return void 0!==n&&(e.leave(r),(0,g.Ll)(n)&&e.enter(n)),n}},leave(...a){let r,i=a[0],n=(0,tV.XO)(t,i.kind).leave;return n&&(r=n.apply(t,a)),e.leave(i),r}}}var tL=a(3420);function t$(e){return{Document(t){for(let a of t.definitions)if(!(0,tL._m)(a)){let t=a.kind===V.b.SCHEMA_DEFINITION||a.kind===V.b.SCHEMA_EXTENSION?"schema":'"'+a.name.value+'"';e.reportError(new y.eO(`The ${t} definition is not executable.`,{nodes:a}))}return!1}}}function tM(e){return{Field(t){let a=e.getParentType();if(a&&!e.getFieldDef()){var r,i;let n=e.getSchema(),p=t.name.value,o=_("to use an inline fragment on",function(e,t,a){if(!eu(t))return[];let r=new Set,i=Object.create(null);for(let p of e.getPossibleTypes(t))if(p.getFields()[a])for(let e of(r.add(p),i[p.name]=1,p.getInterfaces())){var n;e.getFields()[a]&&(r.add(e),i[e.name]=(null!=(n=i[e.name])?n:0)+1)}return[...r].sort((t,a)=>{let r=i[a.name]-i[t.name];return 0!==r?r:Y(t)&&e.isSubType(t,a)?-1:Y(a)&&e.isSubType(a,t)?1:O(t.name,a.name)}).map(e=>e.name)}(n,a,p));""===o&&(o=_((r=a,i=p,q(r)||Y(r)?A(i,Object.keys(r.getFields())):[]))),e.reportError(new y.eO(`Cannot query field "${p}" on type "${a.name}".`+o,{nodes:t}))}}}}function tU(e){return{InlineFragment(t){let a=t.typeCondition;if(a){let t=tR(e.getSchema(),a);if(t&&!es(t)){let t=(0,R.y)(a);e.reportError(new y.eO(`Fragment cannot condition on non composite type "${t}".`,{nodes:a}))}}},FragmentDefinition(t){let a=tR(e.getSchema(),t.typeCondition);if(a&&!es(a)){let a=(0,R.y)(t.typeCondition);e.reportError(new y.eO(`Fragment "${t.name.value}" cannot condition on non composite type "${a}".`,{nodes:t.typeCondition}))}}}}function tB(e){return{...tq(e),Argument(t){let a=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!a&&r&&i){let a=t.name.value,n=A(a,r.args.map(e=>e.name));e.reportError(new y.eO(`Unknown argument "${a}" on field "${i.name}.${r.name}".`+_(n),{nodes:t}))}}}}function tq(e){let t=Object.create(null),a=e.getSchema();for(let e of a?a.getDirectives():ta)t[e.name]=e.args.map(e=>e.name);for(let a of e.getDocument().definitions)if(a.kind===V.b.DIRECTIVE_DEFINITION){var r;let e=null!=(r=a.arguments)?r:[];t[a.name.value]=e.map(e=>e.name.value)}return{Directive(a){let r=a.name.value,i=t[r];if(a.arguments&&i)for(let t of a.arguments){let a=t.name.value;if(!i.includes(a)){let n=A(a,i);e.reportError(new y.eO(`Unknown argument "${a}" on directive "@${r}".`+_(n),{nodes:t}))}}return!1}}}function tQ(e){let t=Object.create(null),a=e.getSchema();for(let e of a?a.getDirectives():ta)t[e.name]=e.locations;for(let a of e.getDocument().definitions)a.kind===V.b.DIRECTIVE_DEFINITION&&(t[a.name.value]=a.locations.map(e=>e.value));return{Directive(a,r,i,n,p){let o=a.name.value,d=t[o];if(!d)return void e.reportError(new y.eO(`Unknown directive "@${o}".`,{nodes:a}));let s=function(e){let t=e[e.length-1];switch("kind"in t||(0,ti.V)(!1),t.kind){case V.b.OPERATION_DEFINITION:var a=t.operation;switch(a){case g.cE.QUERY:return eG.H.QUERY;case g.cE.MUTATION:return eG.H.MUTATION;case g.cE.SUBSCRIPTION:return eG.H.SUBSCRIPTION}return;case V.b.FIELD:return eG.H.FIELD;case V.b.FRAGMENT_SPREAD:return eG.H.FRAGMENT_SPREAD;case V.b.INLINE_FRAGMENT:return eG.H.INLINE_FRAGMENT;case V.b.FRAGMENT_DEFINITION:return eG.H.FRAGMENT_DEFINITION;case V.b.VARIABLE_DEFINITION:return eG.H.VARIABLE_DEFINITION;case V.b.SCHEMA_DEFINITION:case V.b.SCHEMA_EXTENSION:return eG.H.SCHEMA;case V.b.SCALAR_TYPE_DEFINITION:case V.b.SCALAR_TYPE_EXTENSION:return eG.H.SCALAR;case V.b.OBJECT_TYPE_DEFINITION:case V.b.OBJECT_TYPE_EXTENSION:return eG.H.OBJECT;case V.b.FIELD_DEFINITION:return eG.H.FIELD_DEFINITION;case V.b.INTERFACE_TYPE_DEFINITION:case V.b.INTERFACE_TYPE_EXTENSION:return eG.H.INTERFACE;case V.b.UNION_TYPE_DEFINITION:case V.b.UNION_TYPE_EXTENSION:return eG.H.UNION;case V.b.ENUM_TYPE_DEFINITION:case V.b.ENUM_TYPE_EXTENSION:return eG.H.ENUM;case V.b.ENUM_VALUE_DEFINITION:return eG.H.ENUM_VALUE;case V.b.INPUT_OBJECT_TYPE_DEFINITION:case V.b.INPUT_OBJECT_TYPE_EXTENSION:return eG.H.INPUT_OBJECT;case V.b.INPUT_VALUE_DEFINITION:{let t=e[e.length-3];return"kind"in t||(0,ti.V)(!1),t.kind===V.b.INPUT_OBJECT_TYPE_DEFINITION?eG.H.INPUT_FIELD_DEFINITION:eG.H.ARGUMENT_DEFINITION}default:(0,ti.V)(!1,"Unexpected kind: "+(0,v.N)(t.kind))}}(p);s&&!d.includes(s)&&e.reportError(new y.eO(`Directive "@${o}" may not be used on ${s}.`,{nodes:a}))}}}function tY(e){return{FragmentSpread(t){let a=t.name.value;e.getFragment(a)||e.reportError(new y.eO(`Unknown fragment "${a}".`,{nodes:t.name}))}}}function tG(e){let t=e.getSchema(),a=t?t.getTypeMap():Object.create(null),r=Object.create(null);for(let t of e.getDocument().definitions)(0,tL.a6)(t)&&(r[t.name.value]=!0);let i=[...Object.keys(a),...Object.keys(r)];return{NamedType(t,n,p,o,d){let s=t.name.value;if(!a[s]&&!r[s]){var l,u;let a=null!=(l=d[2])?l:p,r=null!=a&&"kind"in(u=a)&&((0,tL.xu)(u)||(0,tL.fT)(u));if(r&&tz.includes(s))return;let n=A(s,r?tz.concat(i):i);e.reportError(new y.eO(`Unknown type "${s}".`+_(n),{nodes:t}))}}}}let tz=[...e1,...t_].map(e=>e.name);function tH(e){let t=0;return{Document(e){t=e.definitions.filter(e=>e.kind===V.b.OPERATION_DEFINITION).length},OperationDefinition(a){!a.name&&t>1&&e.reportError(new y.eO("This anonymous operation must be the only defined operation.",{nodes:a}))}}}function tW(e){var t,a,r;let i=e.getSchema(),n=null!=(t=null!=(a=null!=(r=null==i?void 0:i.astNode)?r:null==i?void 0:i.getQueryType())?a:null==i?void 0:i.getMutationType())?t:null==i?void 0:i.getSubscriptionType(),p=0;return{SchemaDefinition(t){n?e.reportError(new y.eO("Cannot define a new schema within a schema extension.",{nodes:t})):(p>0&&e.reportError(new y.eO("Must provide only one schema definition.",{nodes:t})),++p)}}}function tK(e){return{Field(t){if(("__schema"===t.name.value||"__type"===t.name.value)&&function t(a,r=Object.create(null),i=0){if(a.kind===V.b.FRAGMENT_SPREAD){let n=a.name.value;if(!0===r[n])return!1;let p=e.getFragment(n);if(!p)return!1;try{return r[n]=!0,t(p,r,i)}finally{r[n]=void 0}}if(a.kind===V.b.FIELD&&("fields"===a.name.value||"interfaces"===a.name.value||"possibleTypes"===a.name.value||"inputFields"===a.name.value)&&++i>=3)return!0;if("selectionSet"in a&&a.selectionSet){for(let e of a.selectionSet.selections)if(t(e,r,i))return!0}return!1}(t))return e.reportError(new y.eO("Maximum introspection depth exceeded",{nodes:[t]})),!1}}}function tJ(e){let t=Object.create(null),a=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:i=>((function i(n){if(t[n.name.value])return;let p=n.name.value;t[p]=!0;let o=e.getFragmentSpreads(n.selectionSet);if(0!==o.length){for(let t of(r[p]=a.length,o)){let n=t.name.value,p=r[n];if(a.push(t),void 0===p){let t=e.getFragment(n);t&&i(t)}else{let t=a.slice(p),r=t.slice(0,-1).map(e=>'"'+e.name.value+'"').join(", ");e.reportError(new y.eO(`Cannot spread fragment "${n}" within itself`+(""!==r?` via ${r}.`:"."),{nodes:t}))}a.pop()}r[p]=void 0}})(i),!1)}}function tZ(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(a){for(let{node:r}of e.getRecursiveVariableUsages(a)){let i=r.name.value;!0!==t[i]&&e.reportError(new y.eO(a.name?`Variable "$${i}" is not defined by operation "${a.name.value}".`:`Variable "$${i}" is not defined.`,{nodes:[r,a]}))}}},VariableDefinition(e){t[e.variable.name.value]=!0}}}function tX(e){let t=[],a=[];return{OperationDefinition:e=>(t.push(e),!1),FragmentDefinition:e=>(a.push(e),!1),Document:{leave(){let r=Object.create(null);for(let a of t)for(let t of e.getRecursivelyReferencedFragments(a))r[t.name.value]=!0;for(let t of a){let a=t.name.value;!0!==r[a]&&e.reportError(new y.eO(`Fragment "${a}" is never used.`,{nodes:t}))}}}}}function t1(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(a){let r=Object.create(null);for(let{node:t}of e.getRecursiveVariableUsages(a))r[t.name.value]=!0;for(let i of t){let t=i.variable.name.value;!0!==r[t]&&e.reportError(new y.eO(a.name?`Variable "$${t}" is never used in operation "${a.name.value}".`:`Variable "$${t}" is never used.`,{nodes:i}))}}},VariableDefinition(e){t.push(e)}}}function t0(e){switch(e.kind){case V.b.OBJECT:return{...e,fields:e.fields.map(e=>({...e,value:t0(e.value)})).sort((e,t)=>O(e.name.value,t.name.value))};case V.b.LIST:return{...e,values:e.values.map(t0)};case V.b.INT:case V.b.FLOAT:case V.b.STRING:case V.b.BOOLEAN:case V.b.NULL:case V.b.ENUM:case V.b.VARIABLE:return e}}function t2(e){let t=new t7,a=new ae,r=new Map;return{SelectionSet(i){for(let[[n,p],o,d]of function(e,t,a,r,i,n){let p=[],[o,d]=t5(e,t,i,n);if(function(e,t,a,r,i,n){for(let[p,o]of Object.entries(n))if(o.length>1)for(let n=0;n<o.length;n++)for(let d=n+1;d<o.length;d++){let s=t9(e,a,r,i,!1,p,o[n],o[d]);s&&t.push(s)}}(e,p,t,a,r,o),0!==d.length)for(let i=0;i<d.length;i++){t6(e,p,t,a,r,!1,o,d[i]);for(let n=i+1;n<d.length;n++)t4(e,p,t,a,r,!1,d[i],d[n])}return p}(e,r,t,a,e.getParentType(),i)){let t=function e(t){return Array.isArray(t)?t.map(([t,a])=>`subfields "${t}" conflict because `+e(a)).join(" and "):t}(p);e.reportError(new y.eO(`Fields "${n}" conflict because ${t}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:o.concat(d)}))}}}}function t6(e,t,a,r,i,n,p,o){if(r.has(p,o,n))return;r.add(p,o,n);let d=e.getFragment(o);if(!d)return;let[s,l]=t8(e,a,d);if(p!==s)for(let o of(t3(e,t,a,r,i,n,p,s),l))t6(e,t,a,r,i,n,p,o)}function t4(e,t,a,r,i,n,p,o){if(p===o||i.has(p,o,n))return;i.add(p,o,n);let d=e.getFragment(p),s=e.getFragment(o);if(!d||!s)return;let[l,u]=t8(e,a,d),[c,m]=t8(e,a,s);for(let o of(t3(e,t,a,r,i,n,l,c),m))t4(e,t,a,r,i,n,p,o);for(let p of u)t4(e,t,a,r,i,n,p,o)}function t3(e,t,a,r,i,n,p,o){for(let[d,s]of Object.entries(p)){let p=o[d];if(p)for(let o of s)for(let s of p){let p=t9(e,a,r,i,n,d,o,s);p&&t.push(p)}}}function t9(e,t,a,r,i,n,p,o){let[d,s,l]=p,[u,c,m]=o,f=i||d!==u&&q(d)&&q(u);if(!f){let e=s.name.value,t=c.name.value;if(e!==t)return[[n,`"${e}" and "${t}" are different fields`],[s],[c]];if(!function(e,t){let a=e.arguments,r=t.arguments;if(void 0===a||0===a.length)return void 0===r||0===r.length;if(void 0===r||0===r.length||a.length!==r.length)return!1;let i=new Map(r.map(({name:e,value:t})=>[e.value,t]));return a.every(e=>{let t=e.value,a=i.get(e.name.value);return void 0!==a&&function(e){return(0,R.y)(t0(e))}(t)===function(e){return(0,R.y)(t0(e))}(a)})}(s,c))return[[n,"they have differing arguments"],[s],[c]]}let h=null==l?void 0:l.type,y=null==m?void 0:m.type;if(h&&y&&function e(t,a){return X(t)?!X(a)||e(t.ofType,a.ofType):!!X(a)||(et(t)?!et(a)||e(t.ofType,a.ofType):!!et(a)||!!(eo(t)||eo(a))&&t!==a)}(h,y))return[[n,`they return conflicting types "${(0,v.N)(h)}" and "${(0,v.N)(y)}"`],[s],[c]];let g=s.selectionSet,_=c.selectionSet;if(g&&_){var b=function(e,t,a,r,i,n,p,o,d){let s=[],[l,u]=t5(e,t,n,p),[c,m]=t5(e,t,o,d);for(let n of(t3(e,s,t,a,r,i,l,c),m))t6(e,s,t,a,r,i,l,n);for(let n of u)t6(e,s,t,a,r,i,c,n);for(let n of u)for(let p of m)t4(e,s,t,a,r,i,n,p);return s}(e,t,a,r,f,eE(h),g,eE(y),_),w=n,E=s,T=c;return b.length>0?[[w,b.map(([e])=>e)],[E,...b.map(([,e])=>e).flat()],[T,...b.map(([,,e])=>e).flat()]]:void 0}}function t5(e,t,a,r){let i=t.get(r);if(i)return i;let n=Object.create(null),p=Object.create(null);!function e(t,a,r,i,n){for(let p of r.selections)switch(p.kind){case V.b.FIELD:{let e,t=p.name.value;(q(a)||Y(a))&&(e=a.getFields()[t]);let r=p.alias?p.alias.value:t;i[r]||(i[r]=[]),i[r].push([a,p,e]);break}case V.b.FRAGMENT_SPREAD:n[p.name.value]=!0;break;case V.b.INLINE_FRAGMENT:{let r=p.typeCondition,o=r?tR(t.getSchema(),r):a;e(t,o,p.selectionSet,i,n)}}}(e,a,r,n,p);let o=[n,Object.keys(p)];return t.set(r,o),o}function t8(e,t,a){let r=t.get(a.selectionSet);if(r)return r;let i=tR(e.getSchema(),a.typeCondition);return t5(e,t,i,a.selectionSet)}class t7{constructor(){this._data=new Map}has(e,t,a){var r;let i=null==(r=this._data.get(e))?void 0:r.get(t);return void 0!==i&&(!!a||a===i)}add(e,t,a){let r=this._data.get(e);void 0===r?this._data.set(e,new Map([[t,a]])):r.set(t,a)}}class ae{constructor(){this._orderedPairSet=new t7}has(e,t,a){return e<t?this._orderedPairSet.has(e,t,a):this._orderedPairSet.has(t,e,a)}add(e,t,a){e<t?this._orderedPairSet.add(e,t,a):this._orderedPairSet.add(t,e,a)}}function at(e){return{InlineFragment(t){let a=e.getType(),r=e.getParentType();if(es(a)&&es(r)&&!eY(e.getSchema(),a,r)){let i=(0,v.N)(r),n=(0,v.N)(a);e.reportError(new y.eO(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${n}".`,{nodes:t}))}},FragmentSpread(t){let a=t.name.value,r=function(e,t){let a=e.getFragment(t);if(a){let t=tR(e.getSchema(),a.typeCondition);if(es(t))return t}}(e,a),i=e.getParentType();if(r&&i&&!eY(e.getSchema(),r,i)){let n=(0,v.N)(i),p=(0,v.N)(r);e.reportError(new y.eO(`Fragment "${a}" cannot be spread here as objects of type "${n}" can never be of type "${p}".`,{nodes:t}))}}}}function aa(e){let t=e.getSchema(),a=Object.create(null);for(let t of e.getDocument().definitions)(0,tL.a6)(t)&&(a[t.name.value]=t);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(r){var i;let n,p=r.name.value,o=a[p],d=null==t?void 0:t.getType(p);if(o?n=ar[o.kind]:d&&(n=U(i=d)?V.b.SCALAR_TYPE_EXTENSION:q(i)?V.b.OBJECT_TYPE_EXTENSION:Y(i)?V.b.INTERFACE_TYPE_EXTENSION:z(i)?V.b.UNION_TYPE_EXTENSION:W(i)?V.b.ENUM_TYPE_EXTENSION:J(i)?V.b.INPUT_OBJECT_TYPE_EXTENSION:void(0,ti.V)(!1,"Unexpected type: "+(0,v.N)(i))),n){if(n!==r.kind){let t=function(e){switch(e){case V.b.SCALAR_TYPE_EXTENSION:return"scalar";case V.b.OBJECT_TYPE_EXTENSION:return"object";case V.b.INTERFACE_TYPE_EXTENSION:return"interface";case V.b.UNION_TYPE_EXTENSION:return"union";case V.b.ENUM_TYPE_EXTENSION:return"enum";case V.b.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:(0,ti.V)(!1,"Unexpected kind: "+(0,v.N)(e))}}(r.kind);e.reportError(new y.eO(`Cannot extend non-${t} type "${p}".`,{nodes:o?[o,r]:r}))}}else{let i=A(p,Object.keys({...a,...null==t?void 0:t.getTypeMap()}));e.reportError(new y.eO(`Cannot extend type "${p}" because it is not defined.`+_(i),{nodes:r.name}))}}}let ar={[V.b.SCALAR_TYPE_DEFINITION]:V.b.SCALAR_TYPE_EXTENSION,[V.b.OBJECT_TYPE_DEFINITION]:V.b.OBJECT_TYPE_EXTENSION,[V.b.INTERFACE_TYPE_DEFINITION]:V.b.INTERFACE_TYPE_EXTENSION,[V.b.UNION_TYPE_DEFINITION]:V.b.UNION_TYPE_EXTENSION,[V.b.ENUM_TYPE_DEFINITION]:V.b.ENUM_TYPE_EXTENSION,[V.b.INPUT_OBJECT_TYPE_DEFINITION]:V.b.INPUT_OBJECT_TYPE_EXTENSION};function ai(e){return{...an(e),Field:{leave(t){var a;let r=e.getFieldDef();if(!r)return!1;let i=new Set(null==(a=t.arguments)?void 0:a.map(e=>e.name.value));for(let a of r.args)if(!i.has(a.name)&&eV(a)){let i=(0,v.N)(a.type);e.reportError(new y.eO(`Field "${r.name}" argument "${a.name}" of type "${i}" is required, but it was not provided.`,{nodes:t}))}}}}}function an(e){var t,a;let r=Object.create(null),i=e.getSchema();for(let e of null!=(t=null==i?void 0:i.getDirectives())?t:ta)r[e.name]=T(e.args.filter(eV),e=>e.name);for(let t of e.getDocument().definitions)if(t.kind===V.b.DIRECTIVE_DEFINITION){let e=null!=(a=t.arguments)?a:[];r[t.name.value]=T(e.filter(ap),e=>e.name.value)}return{Directive:{leave(t){let a=t.name.value,i=r[a];if(i){var n;let r=new Set((null!=(n=t.arguments)?n:[]).map(e=>e.name.value));for(let[n,p]of Object.entries(i))if(!r.has(n)){let r=$(p.type)?(0,v.N)(p.type):(0,R.y)(p.type);e.reportError(new y.eO(`Directive "@${a}" argument "${n}" of type "${r}" is required, but it was not provided.`,{nodes:t}))}}}}}}function ap(e){return e.type.kind===V.b.NON_NULL_TYPE&&null==e.defaultValue}function ao(e){return{Field(t){let a=e.getType(),r=t.selectionSet;if(a)if(eo(eE(a))){if(r){let i=t.name.value,n=(0,v.N)(a);e.reportError(new y.eO(`Field "${i}" must not have a selection since type "${n}" has no subfields.`,{nodes:r}))}}else if(r){if(0===r.selections.length){let r=t.name.value,i=(0,v.N)(a);e.reportError(new y.eO(`Field "${r}" of type "${i}" must have at least one field selected.`,{nodes:t}))}}else{let r=t.name.value,i=(0,v.N)(a);e.reportError(new y.eO(`Field "${r}" of type "${i}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}}}}function ad(e){return e.map(e=>"number"==typeof e?"["+e.toString()+"]":"."+e).join("")}function as(e,t,a){return{prev:e,key:t,typename:a}}function al(e){let t=[],a=e;for(;a;)t.push(a.key),a=a.prev;return t.reverse()}function au(e,t,a=ac){return function e(t,a,r,i){if(et(a))return null!=t?e(t,a.ofType,r,i):void r(al(i),t,new y.eO(`Expected non-nullable type "${(0,v.N)(a)}" not to be null.`));if(null==t)return null;if(X(a)){let n=a.ofType;return tn(t)?Array.from(t,(t,a)=>e(t,n,r,as(i,a,void 0))):[e(t,n,r,i)]}if(J(a)){if(!(0,E.Z)(t)||Array.isArray(t))return void r(al(i),t,new y.eO(`Expected type "${a.name}" to be an object.`));let n={},p=a.getFields();for(let o of Object.values(p)){let p=t[o.name];if(void 0===p){if(void 0!==o.defaultValue)n[o.name]=o.defaultValue;else if(et(o.type)){let e=(0,v.N)(o.type);r(al(i),t,new y.eO(`Field "${o.name}" of required type "${e}" was not provided.`))}continue}n[o.name]=e(p,o.type,r,as(i,o.name,a.name))}for(let e of Object.keys(t))if(!p[e]){let n=A(e,Object.keys(a.getFields()));r(al(i),t,new y.eO(`Field "${e}" is not defined by type "${a.name}".`+_(n)))}if(a.isOneOf){let e=Object.keys(n);1!==e.length&&r(al(i),t,new y.eO(`Exactly one key must be specified for OneOf type "${a.name}".`));let p=e[0],o=n[p];null===o&&r(al(i).concat(p),o,new y.eO(`Field "${p}" must be non-null.`))}return n}if(eo(a)){let e;try{e=a.parseValue(t)}catch(e){e instanceof y.eO?r(al(i),t,e):r(al(i),t,new y.eO(`Expected type "${a.name}". `+e.message,{originalError:e}));return}return void 0===e&&r(al(i),t,new y.eO(`Expected type "${a.name}".`)),e}(0,ti.V)(!1,"Unexpected input type: "+(0,v.N)(a))}(e,t,a,void 0)}function ac(e,t,a){let r="Invalid value "+(0,v.N)(t);throw e.length>0&&(r+=` at "value${ad(e)}"`),a.message=r+": "+a.message,a}function am(e,t,a){if(e){if(e.kind===V.b.VARIABLE){let r=e.name.value;if(null==a||void 0===a[r])return;let i=a[r];if(null===i&&et(t))return;return i}if(et(t)){if(e.kind===V.b.NULL)return;return am(e,t.ofType,a)}if(e.kind===V.b.NULL)return null;if(X(t)){let r=t.ofType;if(e.kind===V.b.LIST){let t=[];for(let i of e.values)if(af(i,a)){if(et(r))return;t.push(null)}else{let e=am(i,r,a);if(void 0===e)return;t.push(e)}return t}let i=am(e,r,a);if(void 0===i)return;return[i]}if(J(t)){if(e.kind!==V.b.OBJECT)return;let r=Object.create(null),i=T(e.fields,e=>e.name.value);for(let e of Object.values(t.getFields())){let t=i[e.name];if(!t||af(t.value,a)){if(void 0!==e.defaultValue)r[e.name]=e.defaultValue;else if(et(e.type))return;continue}let n=am(t.value,e.type,a);if(void 0===n)return;r[e.name]=n}if(t.isOneOf){let e=Object.keys(r);if(1!==e.length||null===r[e[0]])return}return r}if(eo(t)){let r;try{r=t.parseLiteral(e,a)}catch(e){return}if(void 0===r)return;return r}(0,ti.V)(!1,"Unexpected input type: "+(0,v.N)(t))}}function af(e,t){return e.kind===V.b.VARIABLE&&(null==t||void 0===t[e.name.value])}function ah(e,t,a,r){let i=[],n=null==r?void 0:r.maxErrors;try{let r=function(e,t,a,r){let i={};for(let n of t){let t=n.variable.name.value,p=tR(e,n.type);if(!er(p)){let e=(0,R.y)(n.type);r(new y.eO(`Variable "$${t}" expected value of type "${e}" which cannot be used as an input type.`,{nodes:n.type}));continue}if(!ag(a,t)){if(n.defaultValue)i[t]=am(n.defaultValue,p);else if(et(p)){let e=(0,v.N)(p);r(new y.eO(`Variable "$${t}" of required type "${e}" was not provided.`,{nodes:n}))}continue}let o=a[t];if(null===o&&et(p)){let e=(0,v.N)(p);r(new y.eO(`Variable "$${t}" of non-null type "${e}" must not be null.`,{nodes:n}));continue}i[t]=au(o,p,(e,a,i)=>{let p=`Variable "$${t}" got invalid value `+(0,v.N)(a);e.length>0&&(p+=` at "${t}${ad(e)}"`),r(new y.eO(p+"; "+i.message,{nodes:n,originalError:i}))})}return i}(e,t,a,e=>{if(null!=n&&i.length>=n)throw new y.eO("Too many errors processing variables, error limit reached. Execution aborted.");i.push(e)});if(0===i.length)return{coerced:r}}catch(e){i.push(e)}return{errors:i}}function av(e,t,a){var r;let i={},n=T(null!=(r=t.arguments)?r:[],e=>e.name.value);for(let r of e.args){let e=r.name,p=r.type,o=n[e];if(!o){if(void 0!==r.defaultValue)i[e]=r.defaultValue;else if(et(p))throw new y.eO(`Argument "${e}" of required type "${(0,v.N)(p)}" was not provided.`,{nodes:t});continue}let d=o.value,s=d.kind===V.b.NULL;if(d.kind===V.b.VARIABLE){let t=d.name.value;if(null==a||!ag(a,t)){if(void 0!==r.defaultValue)i[e]=r.defaultValue;else if(et(p))throw new y.eO(`Argument "${e}" of required type "${(0,v.N)(p)}" was provided the variable "$${t}" which was not provided a runtime value.`,{nodes:d});continue}s=null==a[t]}if(s&&et(p))throw new y.eO(`Argument "${e}" of non-null type "${(0,v.N)(p)}" must not be null.`,{nodes:d});let l=am(d,p,a);if(void 0===l)throw new y.eO(`Argument "${e}" has invalid value ${(0,R.y)(d)}.`,{nodes:d});i[e]=l}return i}function ay(e,t,a){var r;let i=null==(r=t.directives)?void 0:r.find(t=>t.name.value===e.name);if(i)return av(e,i,a)}function ag(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function a_(e,t,a,r,i){let n=new Map;return ab(e,t,a,r,i,n,new Set),n}function ab(e,t,a,r,i,n,p){for(let d of i.selections)switch(d.kind){case V.b.FIELD:{var o;if(!aw(a,d))continue;let e=(o=d).alias?o.alias.value:o.name.value,t=n.get(e);void 0!==t?t.push(d):n.set(e,[d]);break}case V.b.INLINE_FRAGMENT:if(!aw(a,d)||!aE(e,d,r))continue;ab(e,t,a,r,d.selectionSet,n,p);break;case V.b.FRAGMENT_SPREAD:{let i=d.name.value;if(p.has(i)||!aw(a,d))continue;p.add(i);let o=t[i];if(!o||!aE(e,o,r))continue;ab(e,t,a,r,o.selectionSet,n,p)}}}function aw(e,t){let a=ay(e5,t,e);if((null==a?void 0:a.if)===!0)return!1;let r=ay(e9,t,e);return(null==r?void 0:r.if)!==!1}function aE(e,t,a){let r=t.typeCondition;if(!r)return!0;let i=tR(e,r);return i===a||!!eu(i)&&e.isSubType(i,a)}function aT(e){return{OperationDefinition(t){if("subscription"===t.operation){let a=e.getSchema(),r=a.getSubscriptionType();if(r){let i=t.name?t.name.value:null,n=Object.create(null),p=e.getDocument(),o=Object.create(null);for(let e of p.definitions)e.kind===V.b.FRAGMENT_DEFINITION&&(o[e.name.value]=e);let d=a_(a,o,n,r,t.selectionSet);if(d.size>1){let t=[...d.values()].slice(1).flat();e.reportError(new y.eO(null!=i?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(let t of d.values())t[0].name.value.startsWith("__")&&e.reportError(new y.eO(null!=i?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:t}))}}}}}function aN(e,t){let a=new Map;for(let r of e){let e=t(r),i=a.get(e);void 0===i?a.set(e,[r]):i.push(r)}return a}function aS(e){return{DirectiveDefinition(e){var t;let r=null!=(t=e.arguments)?t:[];return a(`@${e.name.value}`,r)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){var t,r;let i=e.name.value;for(let n of null!=(t=e.fields)?t:[]){let e=n.name.value;a(`${i}.${e}`,null!=(r=n.arguments)?r:[])}return!1}function a(t,a){for(let[r,i]of aN(a,e=>e.name.value))i.length>1&&e.reportError(new y.eO(`Argument "${t}(${r}:)" can only be defined once.`,{nodes:i.map(e=>e.name)}));return!1}}function aO(e){return{Field:t,Directive:t};function t(t){var a;for(let[r,i]of aN(null!=(a=t.arguments)?a:[],e=>e.name.value))i.length>1&&e.reportError(new y.eO(`There can be only one argument named "${r}".`,{nodes:i.map(e=>e.name)}))}}function aD(e){let t=Object.create(null),a=e.getSchema();return{DirectiveDefinition(r){let i=r.name.value;return null!=a&&a.getDirective(i)?void e.reportError(new y.eO(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name})):(t[i]?e.reportError(new y.eO(`There can be only one directive named "@${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1)}}}function aI(e){let t=Object.create(null),a=e.getSchema();for(let e of a?a.getDirectives():ta)t[e.name]=!e.isRepeatable;for(let a of e.getDocument().definitions)a.kind===V.b.DIRECTIVE_DEFINITION&&(t[a.name.value]=!a.repeatable);let r=Object.create(null),i=Object.create(null);return{enter(a){let n;if("directives"in a&&a.directives){if(a.kind===V.b.SCHEMA_DEFINITION||a.kind===V.b.SCHEMA_EXTENSION)n=r;else if((0,tL.a6)(a)||(0,tL.i7)(a)){let e=a.name.value;void 0===(n=i[e])&&(i[e]=n=Object.create(null))}else n=Object.create(null);for(let r of a.directives){let a=r.name.value;t[a]&&(n[a]?e.reportError(new y.eO(`The directive "@${a}" can only be used once at this location.`,{nodes:[n[a],r]})):n[a]=r)}}}}}function aA(e){let t=e.getSchema(),a=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){var i;let n=t.name.value;r[n]||(r[n]=Object.create(null));let p=null!=(i=t.values)?i:[],o=r[n];for(let t of p){let r=t.name.value,i=a[n];W(i)&&i.getValue(r)?e.reportError(new y.eO(`Enum value "${n}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):o[r]?e.reportError(new y.eO(`Enum value "${n}.${r}" can only be defined once.`,{nodes:[o[r],t.name]})):o[r]=t.name}return!1}}function ak(e){let t=e.getSchema(),a=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(t){var i,n,p;let o=t.name.value;r[o]||(r[o]=Object.create(null));let d=null!=(i=t.fields)?i:[],s=r[o];for(let t of d){let r=t.name.value;(n=a[o],p=r,(q(n)||Y(n)||J(n))&&null!=n.getFields()[p])?e.reportError(new y.eO(`Field "${o}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):s[r]?e.reportError(new y.eO(`Field "${o}.${r}" can only be defined once.`,{nodes:[s[r],t.name]})):s[r]=t.name}return!1}}function ax(e){let t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(a){let r=a.name.value;return t[r]?e.reportError(new y.eO(`There can be only one fragment named "${r}".`,{nodes:[t[r],a.name]})):t[r]=a.name,!1}}}function aC(e){let t=[],a=Object.create(null);return{ObjectValue:{enter(){t.push(a),a=Object.create(null)},leave(){let e=t.pop();e||(0,ti.V)(!1),a=e}},ObjectField(t){let r=t.name.value;a[r]?e.reportError(new y.eO(`There can be only one input field named "${r}".`,{nodes:[a[r],t.name]})):a[r]=t.name}}}function aV(e){let t=Object.create(null);return{OperationDefinition(a){let r=a.name;return r&&(t[r.value]?e.reportError(new y.eO(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),!1},FragmentDefinition:()=>!1}}function aR(e){let t=e.getSchema(),a=Object.create(null),r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){var i;for(let n of null!=(i=t.operationTypes)?i:[]){let t=n.operation,i=a[t];r[t]?e.reportError(new y.eO(`Type for ${t} already defined in the schema. It cannot be redefined.`,{nodes:n})):i?e.reportError(new y.eO(`There can be only one ${t} type in schema.`,{nodes:[i,n]})):a[t]=n}return!1}}function aF(e){let t=Object.create(null),a=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){let i=r.name.value;return null!=a&&a.getType(i)?void e.reportError(new y.eO(`Type "${i}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name})):(t[i]?e.reportError(new y.eO(`There can be only one type named "${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1)}}function aP(e){return{OperationDefinition(t){var a;for(let[r,i]of aN(null!=(a=t.variableDefinitions)?a:[],e=>e.variable.name.value))i.length>1&&e.reportError(new y.eO(`There can be only one variable named "$${r}".`,{nodes:i.map(e=>e.variable.name)}))}}}function aj(e){let t={};return{OperationDefinition:{enter(){t={}}},VariableDefinition(e){t[e.variable.name.value]=e},ListValue(t){if(!X(e_(e.getParentInputType())))return aL(e,t),!1},ObjectValue(t){let a=eE(e.getInputType());if(!J(a))return aL(e,t),!1;let r=T(t.fields,e=>e.name.value);for(let i of Object.values(a.getFields()))if(!r[i.name]&&eB(i)){let r=(0,v.N)(i.type);e.reportError(new y.eO(`Field "${a.name}.${i.name}" of required type "${r}" was not provided.`,{nodes:t}))}a.isOneOf&&function(e,t,a,r){var i;let n=Object.keys(r);if(1!==n.length)return e.reportError(new y.eO(`OneOf Input Object "${a.name}" must specify exactly one key.`,{nodes:[t]}));let p=null==(i=r[n[0]])?void 0:i.value;p&&p.kind!==V.b.NULL||e.reportError(new y.eO(`Field "${a.name}.${n[0]}" must be non-null.`,{nodes:[t]}))}(e,t,a,r)},ObjectField(t){let a=eE(e.getParentInputType());if(!e.getInputType()&&J(a)){let r=A(t.name.value,Object.keys(a.getFields()));e.reportError(new y.eO(`Field "${t.name.value}" is not defined by type "${a.name}".`+_(r),{nodes:t}))}},NullValue(t){let a=e.getInputType();et(a)&&e.reportError(new y.eO(`Expected value of type "${(0,v.N)(a)}", found ${(0,R.y)(t)}.`,{nodes:t}))},EnumValue:t=>aL(e,t),IntValue:t=>aL(e,t),FloatValue:t=>aL(e,t),StringValue:t=>aL(e,t),BooleanValue:t=>aL(e,t)}}function aL(e,t){let a=e.getInputType();if(!a)return;let r=eE(a);if(!eo(r)){let r=(0,v.N)(a);e.reportError(new y.eO(`Expected value of type "${r}", found ${(0,R.y)(t)}.`,{nodes:t}));return}try{let i=r.parseLiteral(t,void 0);if(void 0===i){let r=(0,v.N)(a);e.reportError(new y.eO(`Expected value of type "${r}", found ${(0,R.y)(t)}.`,{nodes:t}))}}catch(i){let r=(0,v.N)(a);i instanceof y.eO?e.reportError(i):e.reportError(new y.eO(`Expected value of type "${r}", found ${(0,R.y)(t)}; `+i.message,{nodes:t,originalError:i}))}}function a$(e){return{VariableDefinition(t){let a=tR(e.getSchema(),t.type);if(void 0!==a&&!er(a)){let a=t.variable.name.value,r=(0,R.y)(t.type);e.reportError(new y.eO(`Variable "$${a}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}}function aM(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(a){for(let{node:d,type:s,defaultValue:l,parentType:u}of e.getRecursiveVariableUsages(a)){let a=d.name.value,c=t[a];if(c&&s){var r,i,n,p,o;let t=e.getSchema(),m=tR(t,c.type);if(m&&(r=t,i=m,n=c.defaultValue,p=s,o=l,et(p)&&!et(i)?!((null!=n&&n.kind!==V.b.NULL||void 0!==o)&&eQ(r,i,p.ofType)):!eQ(r,i,p))){let t=(0,v.N)(m),r=(0,v.N)(s);e.reportError(new y.eO(`Variable "$${a}" of type "${t}" used in position expecting type "${r}".`,{nodes:[c,d]}))}J(u)&&u.isOneOf&&ey(m)&&e.reportError(new y.eO(`Variable "$${a}" is of type "${m}" but must be non-nullable to be used for OneOf Input Object "${u}".`,{nodes:[c,d]}))}}}},VariableDefinition(e){t[e.variable.name.value]=e}}}let aU=Object.freeze([tK]),aB=Object.freeze([t$,aV,tH,aT,tG,tU,a$,ao,tM,ax,tY,tX,at,tJ,aP,tZ,t1,tQ,aI,tB,aO,aj,ai,aM,t2,aC,...aU]),aq=Object.freeze([tW,aR,aF,aA,ak,aS,aD,tG,tQ,aI,aa,tq,aO,aC,an]);class aQ{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{for(let e of(t=Object.create(null),this.getDocument().definitions))e.kind===V.b.FRAGMENT_DEFINITION&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){let a;t=[];let r=[e];for(;a=r.pop();)for(let e of a.selections)e.kind===V.b.FRAGMENT_SPREAD?t.push(e):e.selectionSet&&r.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){let a;t=[];let r=Object.create(null),i=[e.selectionSet];for(;a=i.pop();)for(let e of this.getFragmentSpreads(a)){let a=e.name.value;if(!0!==r[a]){r[a]=!0;let e=this.getFragment(a);e&&(t.push(e),i.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}class aY extends aQ{constructor(e,t,a){super(e,a),this._schema=t}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class aG extends aQ{constructor(e,t,a,r){super(t,r),this._schema=e,this._typeInfo=a,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){let a=[],r=new tF(this._schema);(0,tV.YR)(e,tj(r,{VariableDefinition:()=>!1,Variable(e){a.push({node:e,type:r.getInputType(),defaultValue:r.getDefaultValue(),parentType:r.getParentInputType()})}})),t=a,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){for(let a of(t=this.getVariableUsages(e),this.getRecursivelyReferencedFragments(e)))t=t.concat(this.getVariableUsages(a));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}function az(e,t,a=aB,r,i=new tF(e)){var n;let p=null!=(n=null==r?void 0:r.maxErrors)?n:100;t||(0,m.U)(!1,"Must provide document."),tO(e);let o=Object.freeze({}),d=[],s=new aG(e,t,i,e=>{if(d.length>=p)throw d.push(new y.eO("Too many validation errors, error limit reached. Validation aborted.")),o;d.push(e)}),l=(0,tV.oP)(a.map(e=>e(s)));try{(0,tV.YR)(t,tj(i,l))}catch(e){if(e!==o)throw e}return d}function aH(e,t,a=aq){let r=[],i=new aY(e,t,e=>{r.push(e)}),n=a.map(e=>e(i));return(0,tV.YR)(e,(0,tV.oP)(n)),r}function aW(e){return Promise.all(Object.values(e)).then(t=>{let a=Object.create(null);for(let[r,i]of Object.keys(e).entries())a[i]=t[r];return a})}class aK extends Error{constructor(e){super("Unexpected error value: "+(0,v.N)(e)),this.name="NonErrorThrown",this.thrownValue=e}}function aJ(e,t,a){var r;let i=e instanceof Error?e:new aK(e);return Array.isArray(i.path)?i:new y.eO(i.message,{nodes:null!=(r=i.nodes)?r:t,source:i.source,positions:i.positions,path:a,originalError:i})}let aZ=(o=(e,t,a)=>(function(e,t,a,r,i){let n=new Map,p=new Set;for(let o of i)o.selectionSet&&ab(e,t,a,r,o.selectionSet,n,p);return n})(e.schema,e.fragments,e.variableValues,t,a),function(e,t,a){void 0===r&&(r=new WeakMap);let i=r.get(e);void 0===i&&(i=new WeakMap,r.set(e,i));let n=i.get(t);void 0===n&&(n=new WeakMap,i.set(t,n));let p=n.get(a);return void 0===p&&(p=o(e,t,a),n.set(a,p)),p});function aX(e){arguments.length<2||(0,m.U)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:t,document:a,variableValues:r,rootValue:i}=e;a2(t,a,r);let n=a6(e);if(!("schema"in n))return{errors:n};try{let{operation:e}=n,t=function(e,t,a){let r=e.schema.getRootType(t.operation);if(null==r)throw new y.eO(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});let i=a_(e.schema,e.fragments,e.variableValues,r,t.selectionSet),n;switch(t.operation){case g.cE.QUERY:return a4(e,r,a,n,i);case g.cE.MUTATION:var p,o,d,s,l;return p=e,o=r,d=a,s=n,l=i,function(e,t,a){let r=a;for(let a of e)r=f(r)?r.then(e=>t(e,a)):t(r,a);return r}(l.entries(),(e,[t,a])=>{let r=as(s,t,o.name),i=a3(p,o,d,a,r);return void 0===i?e:f(i)?i.then(a=>(e[t]=a,e)):(e[t]=i,e)},Object.create(null));case g.cE.SUBSCRIPTION:return a4(e,r,a,n,i)}}(n,e,i);if(f(t))return t.then(e=>a0(e,n.errors),e=>(n.errors.push(e),a0(null,n.errors)));return a0(t,n.errors)}catch(e){return n.errors.push(e),a0(null,n.errors)}}function a1(e){let t=aX(e);if(f(t))throw Error("GraphQL execution failed to complete synchronously.");return t}function a0(e,t){return 0===t.length?{data:e}:{errors:t,data:e}}function a2(e,t,a){t||(0,m.U)(!1,"Must provide document."),tO(e),null==a||(0,E.Z)(a)||(0,m.U)(!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 a6(e){var t,a,r;let i,{schema:n,document:p,rootValue:o,contextValue:d,variableValues:s,operationName:l,fieldResolver:u,typeResolver:c,subscribeFieldResolver:m,options:f}=e,h=Object.create(null);for(let e of p.definitions)switch(e.kind){case V.b.OPERATION_DEFINITION:if(null==l){if(void 0!==i)return[new y.eO("Must provide operation name if query contains multiple operations.")];i=e}else(null==(t=e.name)?void 0:t.value)===l&&(i=e);break;case V.b.FRAGMENT_DEFINITION:h[e.name.value]=e}if(!i)return null!=l?[new y.eO(`Unknown operation named "${l}".`)]:[new y.eO("Must provide an operation.")];let v=ah(n,null!=(a=i.variableDefinitions)?a:[],null!=s?s:{},{maxErrors:null!=(r=null==f?void 0:f.maxCoercionErrors)?r:50});return v.errors?v.errors:{schema:n,fragments:h,rootValue:o,contextValue:d,operation:i,variableValues:v.coerced,fieldResolver:null!=u?u:rr,typeResolver:null!=c?c:ra,subscribeFieldResolver:null!=m?m:rr,errors:[]}}function a4(e,t,a,r,i){let n=Object.create(null),p=!1;try{for(let[o,d]of i.entries()){let i=as(r,o,t.name),s=a3(e,t,a,d,i);void 0!==s&&(n[o]=s,f(s)&&(p=!0))}}catch(e){if(p)return aW(n).finally(()=>{throw e});throw e}return p?aW(n):n}function a3(e,t,a,r,i){var n;let p=ri(e.schema,t,r[0]);if(!p)return;let o=p.type,d=null!=(n=p.resolve)?n:e.fieldResolver,s=a9(e,p,r,t,i);try{let t,n=av(p,r[0],e.variableValues),l=e.contextValue,u=d(a,n,l,s);if(t=f(u)?u.then(t=>a8(e,o,r,s,i,t)):a8(e,o,r,s,i,u),f(t))return t.then(void 0,t=>{let a=aJ(t,r,al(i));return a5(a,o,e)});return t}catch(t){return a5(aJ(t,r,al(i)),o,e)}}function a9(e,t,a,r,i){return{fieldName:t.name,fieldNodes:a,returnType:t.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function a5(e,t,a){if(et(t))throw e;return a.errors.push(e),null}function a8(e,t,a,r,i,n){var p,o,d,s,l,u,c;let m;if(n instanceof Error)throw n;if(et(t)){let p=a8(e,t.ofType,a,r,i,n);if(null===p)throw Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return p}return null==n?null:X(t)?function(e,t,a,r,i,n){if(!tn(n))throw new y.eO(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);let p=t.ofType,o=!1,d=Array.from(n,(t,n)=>{let d=as(i,n,void 0);try{let i;if(i=f(t)?t.then(t=>a8(e,p,a,r,d,t)):a8(e,p,a,r,d,t),f(i))return o=!0,i.then(void 0,t=>{let r=aJ(t,a,al(d));return a5(r,p,e)});return i}catch(t){return a5(aJ(t,a,al(d)),p,e)}});return o?Promise.all(d):d}(e,t,a,r,i,n):eo(t)?function(e,t){let a=e.serialize(t);if(null==a)throw Error(`Expected \`${(0,v.N)(e)}.serialize(${(0,v.N)(t)})\` to return non-nullable value, returned: ${(0,v.N)(a)}`);return a}(t,n):eu(t)?(p=e,o=t,d=a,s=r,l=i,u=n,f(m=(null!=(c=o.resolveType)?c:p.typeResolver)(u,p.contextValue,s,o))?m.then(e=>re(p,a7(e,p,o,d,s,u),d,s,l,u)):re(p,a7(m,p,o,d,s,u),d,s,l,u)):q(t)?re(e,t,a,r,i,n):void(0,ti.V)(!1,"Cannot complete value of unexpected output type: "+(0,v.N)(t))}function a7(e,t,a,r,i,n){if(null==e)throw new y.eO(`Abstract type "${a.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${a.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if(q(e))throw new y.eO("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if("string"!=typeof e)throw new y.eO(`Abstract type "${a.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${(0,v.N)(n)}, received "${(0,v.N)(e)}".`);let p=t.schema.getType(e);if(null==p)throw new y.eO(`Abstract type "${a.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!q(p))throw new y.eO(`Abstract type "${a.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(!t.schema.isSubType(a,p))throw new y.eO(`Runtime Object type "${p.name}" is not a possible type for "${a.name}".`,{nodes:r});return p}function re(e,t,a,r,i,n){let p=aZ(e,t,a);if(t.isTypeOf){let o=t.isTypeOf(n,e.contextValue,r);if(f(o))return o.then(r=>{if(!r)throw rt(t,n,a);return a4(e,t,n,i,p)});if(!o)throw rt(t,n,a)}return a4(e,t,n,i,p)}function rt(e,t,a){return new y.eO(`Expected value of type "${e.name}" but got: ${(0,v.N)(t)}.`,{nodes:a})}let ra=function(e,t,a,r){if((0,E.Z)(e)&&"string"==typeof e.__typename)return e.__typename;let i=a.schema.getPossibleTypes(r),n=[];for(let r=0;r<i.length;r++){let p=i[r];if(p.isTypeOf){let i=p.isTypeOf(e,t,a);if(f(i))n[r]=i;else if(i)return n.length&&Promise.allSettled(n).catch(()=>{}),p.name}}if(n.length)return Promise.all(n).then(e=>{for(let t=0;t<e.length;t++)if(e[t])return i[t].name})},rr=function(e,t,a,r){if((0,E.Z)(e)||"function"==typeof e){let i=e[r.fieldName];return"function"==typeof i?e[r.fieldName](t,a,r):i}};function ri(e,t,a){let r=a.name.value;return r===tv.name&&e.getQueryType()===t?tv:r===ty.name&&e.getQueryType()===t?ty:r===tg.name?tg:t.getFields()[r]}function rn(e){return new Promise(t=>t(ro(e)))}function rp(e){let t=ro(e);if(f(t))throw Error("GraphQL execution failed to complete synchronously.");return t}function ro(e){let t;arguments.length<2||(0,m.U)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:a,source:r,rootValue:i,contextValue:n,variableValues:p,operationName:o,fieldResolver:d,typeResolver:s}=e,l=tS(a);if(l.length>0)return{errors:l};try{t=(0,h.qg)(r)}catch(e){return{errors:[e]}}let u=az(a,t);return u.length>0?{errors:u}:aX({schema:a,document:t,rootValue:i,contextValue:n,variableValues:p,operationName:o,fieldResolver:d,typeResolver:s})}var rd=a(39537),rs=a(73971),rl=a(8238),ru=a(98472),rc=a(12039);function rm(e){return"function"==typeof(null==e?void 0:e[Symbol.asyncIterator])}async function rf(e){arguments.length<2||(0,m.U)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let t=await rh(e);if(!rm(t))return t;let a=t[Symbol.asyncIterator]();async function r(t){if(t.done)return t;try{let a;return{value:await (a=t.value,aX({...e,rootValue:a})),done:!1}}catch(e){if("function"==typeof a.return)try{await a.return()}catch(e){}throw e}}return{next:async()=>r(await a.next()),return:async()=>"function"==typeof a.return?r(await a.return()):{value:void 0,done:!0},async throw(e){if("function"==typeof a.throw)return r(await a.throw(e));throw e},[Symbol.asyncIterator](){return this}}}async function rh(...e){let t,a=(t=e[0])&&"document"in t?t:{schema:t,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]},{schema:r,document:i,variableValues:n}=a;a2(r,i,n);let p=a6(a);if(!("schema"in p))return{errors:p};try{let e=await rv(p);if(!rm(e))throw Error(`Subscription field must return Async Iterable. Received: ${(0,v.N)(e)}.`);return e}catch(e){if(e instanceof y.eO)return{errors:[e]};throw e}}async function rv(e){let{schema:t,fragments:a,operation:r,variableValues:i,rootValue:n}=e,p=t.getSubscriptionType();if(null==p)throw new y.eO("Schema is not configured to execute subscription operation.",{nodes:r});let[o,d]=[...a_(t,a,i,p,r.selectionSet).entries()][0],s=ri(t,p,d[0]);if(!s){let e=d[0].name.value;throw new y.eO(`The subscription field "${e}" is not defined.`,{nodes:d})}let l=as(void 0,o,p.name),u=a9(e,s,d,p,l);try{var c;let t=av(s,d[0],i),a=e.contextValue,r=null!=(c=s.subscribe)?c:e.subscribeFieldResolver,p=await r(n,t,a,u);if(p instanceof Error)throw p;return p}catch(e){throw aJ(e,d,al(l))}}function ry(e){return{Field(t){let a=e.getFieldDef(),r=null==a?void 0:a.deprecationReason;if(a&&null!=r){let i=e.getParentType();null!=i||(0,ti.V)(!1),e.reportError(new y.eO(`The field ${i.name}.${a.name} is deprecated. ${r}`,{nodes:t}))}},Argument(t){let a=e.getArgument(),r=null==a?void 0:a.deprecationReason;if(a&&null!=r){let i=e.getDirective();if(null!=i)e.reportError(new y.eO(`Directive "@${i.name}" argument "${a.name}" is deprecated. ${r}`,{nodes:t}));else{let i=e.getParentType(),n=e.getFieldDef();null!=i&&null!=n||(0,ti.V)(!1),e.reportError(new y.eO(`Field "${i.name}.${n.name}" argument "${a.name}" is deprecated. ${r}`,{nodes:t}))}}},ObjectField(t){let a=eE(e.getParentInputType());if(J(a)){let r=a.getFields()[t.name.value],i=null==r?void 0:r.deprecationReason;null!=i&&e.reportError(new y.eO(`The input field ${a.name}.${r.name} is deprecated. ${i}`,{nodes:t}))}},EnumValue(t){let a=e.getEnumValue(),r=null==a?void 0:a.deprecationReason;if(a&&null!=r){let i=eE(e.getInputType());null!=i||(0,ti.V)(!1),e.reportError(new y.eO(`The enum value "${i.name}.${a.name}" is deprecated. ${r}`,{nodes:t}))}}}}function rg(e){return{Field(t){let a=eE(e.getType());a&&tb(a)&&e.reportError(new y.eO(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}}var r_=a(59841);function rb(e){let t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,oneOf:!1,...e},a=t.descriptions?"description":"",r=t.specifiedByUrl?"specifiedByURL":"",i=t.directiveIsRepeatable?"isRepeatable":"",n=t.schemaDescription?a:"";function p(e){return t.inputValueDeprecation?e:""}let o=t.oneOf?"isOneOf":"";return`
|
|
1042
|
+
</html>`,rq=rB({title:"Signed in to BRICKS",heading:"Signed in to BRICKS",message:"You can close this tab now."}),rQ=e=>rB({title:"Sign-in failed",heading:"Sign-in failed",message:e}),rY="Sign-in cancelled",rG=(z=et(function*({onAuthorizeUrl:e,signal:t}={}){if(t?.aborted)throw Error(rY);var a,r,i,n,p,o,d,s=(a=ab.randomBytes(32).toString("base64url"),r=ab.createHash("sha256").update(a).digest("base64url"),{verifier:a,challenge:r}),l=s.verifier,u=s.challenge,c=ab.randomBytes(16).toString("base64url"),m=process.env.BRICKS_OAUTH_CALLBACK_PORT,f=null!=m&&""!==m?Number(m):8535,h=new Promise((e,t)=>{i=e,n=t}),v=tt.createServer((e,t)=>{var a=new URL(e.url,`http://${rF}`);if(a.pathname!==rR)return void t.writeHead(404).end();var r=a.searchParams.get("error"),p=a.searchParams.get("code");if(a.searchParams.get("state")!==c)return void t.writeHead(400,{"Content-Type":"text/html"}).end(rQ("Invalid state"));if(r){var o=a.searchParams.get("error_description")||r;t.writeHead(200,{"Content-Type":"text/html"}).end(rQ(o)),n(Error(o));return}if(!p){t.writeHead(400,{"Content-Type":"text/html"}).end(rQ("Invalid state")),n(Error("OAuth callback did not include an authorization code"));return}t.writeHead(200,{"Content-Type":"text/html"}).end(rq),i(p)}),y=yield new Promise((e,t)=>{v.once("error",e=>{e?.code==="EADDRINUSE"?t(Error(`Callback port ${f} is already in use — is another sign-in in progress? Close it and retry.`)):t(e)}),v.listen(f,rF,()=>e(v.address().port))}),g=`http://${rF}:${y}${rR}`,_=(({redirectUri:e,state:t,challenge:a})=>{var r=new URL(`https://${rk}/authorize`);return r.searchParams.set("response_type","code"),r.searchParams.set("client_id",rV),r.searchParams.set("redirect_uri",e),r.searchParams.set("scope",rC),r.searchParams.set("audience",rx),r.searchParams.set("state",t),r.searchParams.set("code_challenge",a),r.searchParams.set("code_challenge_method","S256"),r.toString()})({redirectUri:g,state:c,challenge:u}),b=new Promise((e,t)=>{d=t}),w=()=>d(Error(rY));t?.addEventListener("abort",w,{once:!0});try{if(t?.aborted)throw Error(rY);var E=new Promise((e,t)=>{p=setTimeout(()=>t(Error("Timed out waiting for the browser sign-in (5 minutes)")),3e5)}),T=e?Promise.resolve().then(()=>e(_)):Promise.resolve(),N=yield Promise.race([Promise.all([T,h]),E,b]),S=ar(N,2)[1];o=yield r$("/oauth/token",{grant_type:"authorization_code",client_id:rV,code:S,code_verifier:l,redirect_uri:g},{signal:t})}catch(e){if(t?.aborted)throw Error(rY);throw e}finally{p&&clearTimeout(p),t?.removeEventListener("abort",w),yield new Promise(e=>{v.close(e),v.closeIdleConnections?.()})}if(t?.aborted)throw Error(rY);return o}),function(){return z.apply(this,arguments)}),rz=(H=et(function*(){return yield r$("/oauth/device/code",{client_id:rV,scope:rC,audience:rx})}),function(){return H.apply(this,arguments)}),rH=e=>new Promise(t=>setTimeout(t,e)),rW=(W=et(function*({device_code:e,interval:t=5,expires_in:a=900}){for(var r=Date.now()+1e3*a,i=1e3*t;Date.now()<r;){yield rH(i);try{return yield r$("/oauth/token",{grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:rV,device_code:e})}catch(e){if("authorization_pending"===e.code)continue;if("slow_down"===e.code){i+=5e3;continue}throw e}}throw Error("Device authorization expired before the sign-in was confirmed")}),function(e){return W.apply(this,arguments)}),rK=(e,t=null,{preservePrevious:a=!1}={})=>{if(!e?.access_token)throw Error("OAuth token response did not include an access token");if(!a&&!e.id_token)throw Error("OAuth login response did not include an ID token");var r=e.id_token?rM(e.id_token):{};if(!a&&!r.sub)throw Error("OAuth ID token did not include a user subject");if(a&&r.sub&&t?.user?.sub&&r.sub!==t.user.sub)throw Error("OAuth refresh returned a different user identity");var i=a?t?.user:null;return{accessToken:e.access_token,refreshToken:e.refresh_token||(a?t?.refreshToken:null)||null,expiresAt:new Date(Date.now()+1e3*(e.expires_in||0)).toISOString(),user:{sub:r.sub||i?.sub||null,email:r.email||i?.email||null,name:r.name||i?.name||null,nickname:r.nickname||i?.nickname||null,picture:r.picture||i?.picture||null},audience:rx}},rJ=null,rZ=(K=et(function*({forceRefresh:e=!1}={}){var t=re();if(!t?.accessToken)return null;var a=new Date(t.expiresAt||0).getTime()-Date.now();if(!e&&a>3e5)return t;if(!t.refreshToken){if(a>0)return t;if(!(yield ro(t)))return re();throw Error("OAuth session expired. Run `bricks auth login` again.")}var r=`${t.accessToken}\0${t.refreshToken}`;if(rJ){var i=rJ;return i.sessionKey===r?i.promise:(yield i.promise.catch(()=>{}),rZ({forceRefresh:e}))}var n=aj(et(function*(){var a=re();if(!a?.accessToken)return null;if(!t||!a||t.accessToken!==a.accessToken||t.refreshToken!==a.refreshToken)return a;var r=new Date(a.expiresAt||0).getTime()-Date.now();if(!e&&r>3e5)return a;if(!a.refreshToken){if(r>0)return a;if(!(yield ro(a)))return re();throw Error("OAuth session expired. Run `bricks auth login` again.")}try{var i=yield r$("/oauth/token",{grant_type:"refresh_token",client_id:rV,refresh_token:a.refreshToken}),n=rK(i,a,{preservePrevious:!0});if(!(yield rp(a,n)))return re();return n}catch(e){if("invalid_grant"===e.code){if(!(yield ro(a)))return re();throw Error("OAuth session expired. Run `bricks auth login` again.")}throw e}}));rJ={sessionKey:r,promise:n};try{return yield n}finally{rJ?.promise===n&&(rJ=null)}}),function(){return K.apply(this,arguments)}),rX=(J=et(function*(e){if(e){var t=new AbortController,a=setTimeout(()=>t.abort(),5e3);try{yield rj("/oauth/revoke",{client_id:rV,token:e},{signal:t.signal})}catch{}finally{clearTimeout(a)}}}),function(e){return J.apply(this,arguments)}),r1=(Z=et(function*(){var e=yield ri();return!!e?.accessToken&&(yield rX(e.refreshToken),!0)}),function(){return Z.apply(this,arguments)}),r0=e=>new Promise(t=>{var a=ar("darwin"===process.platform?["open",[e]]:"win32"===process.platform?["cmd",["/c","start","",e.replace(/&/g,"^&")]]:["xdg-open",[e]],2),r=a[0],i=a[1];try{var n=(0,rE.spawn)(r,i,{stdio:"ignore",detached:!0});n.once("error",()=>t(!1)),n.once("spawn",()=>{n.unref(),t(!0)})}catch{t(!1)}}),r2=(e,t)=>{if(!e)throw Error("Not logged in. Run `bricks auth login` first.");if(e.user?.sub!==t)throw Error("OAuth account changed. Re-select the workspace for the current account.");return e},r6=e=>{var t=((e="default")=>az(e,aQ.snapshot(["tokens","oauth","devtoolsTokens","baseUrl","activityLogBaseUrl"])))(e);return{...t,auth:(({tokenInfo:e,oauth:t})=>{if(!e)return null;if("oauth"===e.type){if(!t?.accessToken||!e.oauthSubject||e.oauthSubject!==t.user?.sub||!e.workspaceId)return null;var a,r,i,n=e.oauthSubject;return{kind:"oauth",workspaceId:e.workspaceId,workspaceName:e.workspaceName,getHeaders:(r=et(function*(){var t=r2((yield rZ()),n);return{authorization:`Bearer ${t.accessToken}`,"x-bricks-workspace-id":String(e.workspaceId)}}),function(){return r.apply(this,arguments)}),refresh:(i=et(function*(){r2((yield rZ({forceRefresh:!0})),n)}),function(){return i.apply(this,arguments)})}}return e.token?{kind:"token",token:e.token,workspaceId:e.workspaceId,workspaceName:e.workspaceName,getHeaders:(a=et(function*(){return{authorization:`Bearer ${e.token}`}}),function(){return a.apply(this,arguments)})}:null})(t)}},r4=e=>r6(e).auth},48255(e,t,a){a.d(t,{Wk:()=>s,eO:()=>p,yJ:()=>d});var r=a(91070),i=a(73971),n=a(8238);class p extends Error{constructor(e,...t){var a,n,d;let s,{nodes:l,source:u,positions:c,path:m,originalError:f,extensions:h}=null==(s=t[0])||"kind"in s||"length"in s?{nodes:s,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:s;super(e),this.name="GraphQLError",this.path=null!=m?m:void 0,this.originalError=null!=f?f:void 0,this.nodes=o(Array.isArray(l)?l:l?[l]:void 0);let v=o(null==(a=this.nodes)?void 0:a.map(e=>e.loc).filter(e=>null!=e));this.source=null!=u?u:null==v||null==(n=v[0])?void 0:n.source,this.positions=null!=c?c:null==v?void 0:v.map(e=>e.start),this.locations=c&&u?c.map(e=>(0,i.g)(u,e)):null==v?void 0:v.map(e=>(0,i.g)(e.source,e.start));let y=(0,r.Z)(null==f?void 0:f.extensions)?null==f?void 0:f.extensions:void 0;this.extensions=null!=(d=null!=h?h:y)?d: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}}),null!=f&&f.stack?Object.defineProperty(this,"stack",{value:f.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,p):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(let t of this.nodes)t.loc&&(e+="\n\n"+(0,n.V)(t.loc));else if(this.source&&this.locations)for(let t of this.locations)e+="\n\n"+(0,n.C)(this.source,t);return e}toJSON(){let e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function o(e){return void 0===e||0===e.length?void 0:e}function d(e){return e.toString()}function s(e){return e.toJSON()}},59841(e,t,a){a.d(t,{I:()=>i});var r=a(48255);function i(e,t,a){return new r.eO(`Syntax Error: ${a}`,{source:e,positions:[t]})}},36869(e,t,a){let r;a.r(t),a.d(t,{VariablesAreInputTypesRule:()=>a$,SingleFieldSubscriptionsRule:()=>aT,UniqueVariableNamesRule:()=>aP,GraphQLDeprecatedDirective:()=>e7,GraphQLNonNull:()=>ef,__InputValue:()=>tm,createSourceEventStream:()=>rh,execute:()=>aX,isDefinitionNode:()=>tL.MD,isInterfaceType:()=>Y,isRequiredArgument:()=>eV,isValidNameError:()=>r1,parseValue:()=>h.$x,valueFromAST:()=>am,NoUnusedVariablesRule:()=>t1,__DirectiveLocation:()=>tl,findDangerousChanges:()=>r2,__TypeKind:()=>th,isSchema:()=>tw,UniqueTypeNamesRule:()=>aF,NoSchemaIntrospectionCustomRule:()=>rg,defaultTypeResolver:()=>ra,isType:()=>$,syntaxError:()=>r_.I,version:()=>i,UniqueFragmentNamesRule:()=>ax,assertWrappingType:()=>ev,getNullableType:()=>e_,isObjectType:()=>q,visitWithTypeInfo:()=>tj,assertEnumValueName:()=>L,printSchema:()=>rj,validate:()=>az,BREAK:()=>tV.sP,assertNonNullType:()=>ea,assertNullableType:()=>eg,executeSync:()=>a1,isLeafType:()=>eo,resolveSchemaCoordinate:()=>r8,assertOutputType:()=>ep,buildASTSchema:()=>rk,astFromValue:()=>tp,Kind:()=>V.b,ProvidedRequiredArgumentsRule:()=>ai,UniqueDirectiveNamesRule:()=>aD,KnownDirectivesRule:()=>tQ,DEFAULT_DEPRECATION_REASON:()=>e8,TypeKind:()=>l,assertInterfaceType:()=>G,isValueNode:()=>tL.aR,GraphQLSpecifiedByDirective:()=>te,GraphQLFloat:()=>eK,UniqueFieldDefinitionNamesRule:()=>ak,LoneAnonymousOperationRule:()=>tH,VariablesInAllowedPositionRule:()=>aM,assertInputType:()=>ei,formatError:()=>y.Wk,assertInputObjectType:()=>Z,isOutputType:()=>en,isWrappingType:()=>eh,assertLeafType:()=>ed,assertValidSchema:()=>tO,FragmentsOnCompositeTypesRule:()=>tU,graphql:()=>rn,UniqueOperationTypesRule:()=>aR,parseSchemaCoordinate:()=>h.Ng,UniqueEnumValueNamesRule:()=>aA,isNonNullType:()=>et,isSelectionNode:()=>tL.VK,printError:()=>y.yJ,specifiedDirectives:()=>ta,visit:()=>tV.YR,GraphQLScalarType:()=>eS,assertEnumType:()=>K,UniqueDirectivesPerLocationRule:()=>aI,assertName:()=>j,getDirectiveValues:()=>ay,isConstValueNode:()=>tL.TZ,isEqualType:()=>eq,isNamedType:()=>eb,isTypeDefinitionNode:()=>tL.a6,validateSchema:()=>tS,parse:()=>h.qg,__Schema:()=>td,isTypeSystemDefinitionNode:()=>tL.xu,valueFromASTUntyped:()=>F,LoneSchemaDefinitionRule:()=>tW,isTypeSubTypeOf:()=>eQ,UniqueArgumentNamesRule:()=>aO,UniqueInputFieldNamesRule:()=>aC,locatedError:()=>aJ,typeFromAST:()=>tR,printLocation:()=>rl.V,assertUnionType:()=>H,separateOperations:()=>rK,getVariableValues:()=>ah,Location:()=>g.aZ,GraphQLObjectType:()=>eO,UniqueArgumentDefinitionNamesRule:()=>aS,stripIgnoredCharacters:()=>rZ,GRAPHQL_MAX_INT:()=>ez,visitInParallel:()=>tV.oP,parseType:()=>h.Mb,isTypeNode:()=>tL.dI,PossibleTypeExtensionsRule:()=>aa,graphqlSync:()=>rp,isSchemaCoordinateNode:()=>tL.gj,DirectiveLocation:()=>eG.H,TypeNameMetaFieldDef:()=>tg,coerceInputValue:()=>au,GraphQLInt:()=>eW,resolveObjMapThunk:()=>eN,GraphQLInterfaceType:()=>eR,UniqueOperationNamesRule:()=>aV,GraphQLSkipDirective:()=>e5,isEnumType:()=>W,assertValidName:()=>rX,buildClientSchema:()=>rN,KnownArgumentNamesRule:()=>tB,ValuesOfCorrectTypeRule:()=>aj,isInputObjectType:()=>J,GraphQLID:()=>eX,NoUnusedFragmentsRule:()=>tX,isUnionType:()=>z,isSpecifiedScalarType:()=>e0,getArgumentValues:()=>av,printSourceLocation:()=>rl.C,__EnumValue:()=>tf,getOperationAST:()=>rw,isExecutableDefinitionNode:()=>tL._m,isAbstractType:()=>eu,assertAbstractType:()=>ec,isTypeExtensionNode:()=>tL.i7,GraphQLInputObjectType:()=>eM,getNamedType:()=>eE,parseConstValue:()=>h.u8,KnownFragmentNamesRule:()=>tY,isListType:()=>X,Lexer:()=>ru.JG,isSpecifiedDirective:()=>tr,responsePathAsArray:()=>al,isDirective:()=>e6,TypeInfo:()=>tF,assertScalarType:()=>B,extendSchema:()=>rS,isIntrospectionType:()=>tb,print:()=>R.y,getIntrospectionQuery:()=>rb,GraphQLBoolean:()=>eZ,KnownTypeNamesRule:()=>tG,assertListType:()=>ee,concatAST:()=>rW,NoDeprecatedCustomRule:()=>ry,defaultFieldResolver:()=>rr,GraphQLDirective:()=>e3,getLocation:()=>rs.g,TypeMetaFieldDef:()=>ty,GRAPHQL_MIN_INT:()=>eH,GraphQLIncludeDirective:()=>e9,ScalarLeafsRule:()=>ao,assertSchema:()=>tE,lexicographicSortSchema:()=>rC,GraphQLList:()=>em,isTypeSystemExtensionNode:()=>tL.fT,specifiedScalarTypes:()=>e1,BreakingChangeType:()=>u,ExecutableDefinitionsRule:()=>t$,assertDirective:()=>e4,__Field:()=>tc,getVisitFn:()=>tV.UY,recommendedRules:()=>aU,SchemaMetaFieldDef:()=>tv,assertCompositeType:()=>el,isRequiredInputField:()=>eB,Token:()=>g.ou,specifiedRules:()=>aB,DangerousChangeType:()=>c,GraphQLUnionType:()=>eF,isCompositeType:()=>es,versionInfo:()=>n,FieldsOnCorrectTypeRule:()=>tM,GraphQLString:()=>eJ,assertType:()=>M,introspectionFromSchema:()=>rT,doTypesOverlap:()=>eY,GraphQLEnumType:()=>ej,resolveReadonlyArrayThunk:()=>eT,GraphQLOneOfDirective:()=>tt,NoFragmentCyclesRule:()=>tJ,findBreakingChanges:()=>r0,ValidationContext:()=>aG,OverlappingFieldsCanBeMergedRule:()=>t2,isScalarType:()=>U,MaxIntrospectionDepthRule:()=>tK,NoUndefinedVariablesRule:()=>tZ,assertObjectType:()=>Q,getOperationRootType:()=>rE,printType:()=>rU,OperationTypeNode:()=>g.cE,isInputType:()=>er,__Directive:()=>ts,GraphQLSchema:()=>tT,Source:()=>rd.k,resolveASTSchemaCoordinate:()=>r7,GraphQLError:()=>y.eO,assertNamedType:()=>ew,buildSchema:()=>rx,introspectionTypes:()=>t_,PossibleFragmentSpreadsRule:()=>at,__Type:()=>tu,getEnterLeaveForKind:()=>tV.XO,TokenKind:()=>rc.Y,printIntrospectionSchema:()=>rL,isNullableType:()=>ey,subscribe:()=>rf});let i="16.12.0",n=Object.freeze({major:16,minor:12,patch:0,preReleaseTag:null});var p,o,d,s,l,u,c,m=a(93217);function f(e){return"function"==typeof(null==e?void 0:e.then)}var h=a(20186),v=a(35198),y=a(48255),g=a(59762);function _(e,t){let[a,r]=t?[e,t]:[void 0,e],i=" Did you mean ";a&&(i+=a+" ");let n=r.map(e=>`"${e}"`);switch(n.length){case 0:return"";case 1:return i+n[0]+"?";case 2:return i+n[0]+" or "+n[1]+"?"}let p=n.slice(0,5),o=p.pop();return i+p.join(", ")+", or "+o+"?"}function b(e){return e}var w=a(50792),E=a(91070);function T(e,t){let a=Object.create(null);for(let r of e)a[t(r)]=r;return a}function N(e,t,a){let r=Object.create(null);for(let i of e)r[t(i)]=a(i);return r}function S(e,t){let a=Object.create(null);for(let r of Object.keys(e))a[r]=t(e[r],r);return a}function O(e,t){let a=0,r=0;for(;a<e.length&&r<t.length;){let i=e.charCodeAt(a),n=t.charCodeAt(r);if(I(i)&&I(n)){let p=0;do++a,p=10*p+i-D,i=e.charCodeAt(a);while(I(i)&&p>0);let o=0;do++r,o=10*o+n-D,n=t.charCodeAt(r);while(I(n)&&o>0);if(p<o)return -1;if(p>o)return 1}else{if(i<n)return -1;if(i>n)return 1;++a,++r}}return e.length-t.length}let D=48;function I(e){return!isNaN(e)&&D<=e&&e<=57}function A(e,t){let a=Object.create(null),r=new k(e),i=Math.floor(.4*e.length)+1;for(let e of t){let t=r.measure(e,i);void 0!==t&&(a[e]=t)}return Object.keys(a).sort((e,t)=>{let r=a[e]-a[t];return 0!==r?r:O(e,t)})}class k{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=x(this._inputLowerCase),this._rows=[Array(e.length+1).fill(0),Array(e.length+1).fill(0),Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;let a=e.toLowerCase();if(this._inputLowerCase===a)return 1;let r=x(a),i=this._inputArray;if(r.length<i.length){let e=r;r=i,i=e}let n=r.length,p=i.length;if(n-p>t)return;let o=this._rows;for(let e=0;e<=p;e++)o[0][e]=e;for(let e=1;e<=n;e++){let a=o[(e-1)%3],n=o[e%3],d=n[0]=e;for(let t=1;t<=p;t++){let p=+(r[e-1]!==i[t-1]),s=Math.min(a[t]+1,n[t-1]+1,a[t-1]+p);e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]&&(s=Math.min(s,o[(e-2)%3][t-2]+1)),s<d&&(d=s),n[t]=s}if(d>t)return}let d=o[n%3][p];return d<=t?d:void 0}}function x(e){let t=e.length,a=Array(t);for(let r=0;r<t;++r)a[r]=e.charCodeAt(r);return a}function C(e){if(null==e)return Object.create(null);if(null===Object.getPrototypeOf(e))return e;let t=Object.create(null);for(let[a,r]of Object.entries(e))t[a]=r;return t}var V=a(42455),R=a(95818);function F(e,t){switch(e.kind){case V.b.NULL:return null;case V.b.INT:return parseInt(e.value,10);case V.b.FLOAT:return parseFloat(e.value);case V.b.STRING:case V.b.ENUM:case V.b.BOOLEAN:return e.value;case V.b.LIST:return e.values.map(e=>F(e,t));case V.b.OBJECT:return N(e.fields,e=>e.name.value,e=>F(e.value,t));case V.b.VARIABLE:return null==t?void 0:t[e.name.value]}}var P=a(25881);function j(e){if(null!=e||(0,m.U)(!1,"Must provide name."),"string"==typeof e||(0,m.U)(!1,"Expected name to be a string."),0===e.length)throw new y.eO("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!(0,P.xr)(e.charCodeAt(t)))throw new y.eO(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!(0,P.un)(e.charCodeAt(0)))throw new y.eO(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}function L(e){if("true"===e||"false"===e||"null"===e)throw new y.eO(`Enum values cannot be named: ${e}`);return j(e)}function $(e){return U(e)||q(e)||Y(e)||z(e)||W(e)||J(e)||X(e)||et(e)}function M(e){if(!$(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL type.`);return e}function U(e){return(0,w.h)(e,eS)}function B(e){if(!U(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Scalar type.`);return e}function q(e){return(0,w.h)(e,eO)}function Q(e){if(!q(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Object type.`);return e}function Y(e){return(0,w.h)(e,eR)}function G(e){if(!Y(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Interface type.`);return e}function z(e){return(0,w.h)(e,eF)}function H(e){if(!z(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Union type.`);return e}function W(e){return(0,w.h)(e,ej)}function K(e){if(!W(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Enum type.`);return e}function J(e){return(0,w.h)(e,eM)}function Z(e){if(!J(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Input Object type.`);return e}function X(e){return(0,w.h)(e,em)}function ee(e){if(!X(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL List type.`);return e}function et(e){return(0,w.h)(e,ef)}function ea(e){if(!et(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Non-Null type.`);return e}function er(e){return U(e)||W(e)||J(e)||eh(e)&&er(e.ofType)}function ei(e){if(!er(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL input type.`);return e}function en(e){return U(e)||q(e)||Y(e)||z(e)||W(e)||eh(e)&&en(e.ofType)}function ep(e){if(!en(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL output type.`);return e}function eo(e){return U(e)||W(e)}function ed(e){if(!eo(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL leaf type.`);return e}function es(e){return q(e)||Y(e)||z(e)}function el(e){if(!es(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL composite type.`);return e}function eu(e){return Y(e)||z(e)}function ec(e){if(!eu(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL abstract type.`);return e}class em{constructor(e){$(e)||(0,m.U)(!1,`Expected ${(0,v.N)(e)} to be a GraphQL type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class ef{constructor(e){ey(e)||(0,m.U)(!1,`Expected ${(0,v.N)(e)} to be a GraphQL nullable type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function eh(e){return X(e)||et(e)}function ev(e){if(!eh(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL wrapping type.`);return e}function ey(e){return $(e)&&!et(e)}function eg(e){if(!ey(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL nullable type.`);return e}function e_(e){if(e)return et(e)?e.ofType:e}function eb(e){return U(e)||q(e)||Y(e)||z(e)||W(e)||J(e)}function ew(e){if(!eb(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL named type.`);return e}function eE(e){if(e){let t=e;for(;eh(t);)t=t.ofType;return t}}function eT(e){return"function"==typeof e?e():e}function eN(e){return"function"==typeof e?e():e}class eS{constructor(e){var t,a,r,i;let n=null!=(t=e.parseValue)?t:b;this.name=j(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=null!=(a=e.serialize)?a:b,this.parseValue=n,this.parseLiteral=null!=(r=e.parseLiteral)?r:(e,t)=>n(F(e,t)),this.extensions=C(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(i=e.extensionASTNodes)?i:[],null==e.specifiedByURL||"string"==typeof e.specifiedByURL||(0,m.U)(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${(0,v.N)(e.specifiedByURL)}.`),null==e.serialize||"function"==typeof e.serialize||(0,m.U)(!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.`),e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||(0,m.U)(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class eO{constructor(e){var t;this.name=j(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=C(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._fields=()=>eI(e),this._interfaces=()=>eD(e),null==e.isTypeOf||"function"==typeof e.isTypeOf||(0,m.U)(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${(0,v.N)(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:ex(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function eD(e){var t;let a=eT(null!=(t=e.interfaces)?t:[]);return Array.isArray(a)||(0,m.U)(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),a}function eI(e){let t=eN(e.fields);return ek(t)||(0,m.U)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),S(t,(t,a)=>{var r;ek(t)||(0,m.U)(!1,`${e.name}.${a} field config must be an object.`),null==t.resolve||"function"==typeof t.resolve||(0,m.U)(!1,`${e.name}.${a} field resolver must be a function if provided, but got: ${(0,v.N)(t.resolve)}.`);let i=null!=(r=t.args)?r:{};return ek(i)||(0,m.U)(!1,`${e.name}.${a} args must be an object with argument names as keys.`),{name:j(a),description:t.description,type:t.type,args:eA(i),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:C(t.extensions),astNode:t.astNode}})}function eA(e){return Object.entries(e).map(([e,t])=>({name:j(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:C(t.extensions),astNode:t.astNode}))}function ek(e){return(0,E.Z)(e)&&!Array.isArray(e)}function ex(e){return S(e,e=>({description:e.description,type:e.type,args:eC(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function eC(e){return N(e,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function eV(e){return et(e.type)&&void 0===e.defaultValue}class eR{constructor(e){var t;this.name=j(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=C(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._fields=eI.bind(void 0,e),this._interfaces=eD.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,m.U)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,v.N)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:ex(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class eF{constructor(e){var t;this.name=j(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=C(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._types=eP.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,m.U)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,v.N)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function eP(e){let t=eT(e.types);return Array.isArray(t)||(0,m.U)(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}class ej{constructor(e){var t;this.name=j(e.name),this.description=e.description,this.extensions=C(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._values="function"==typeof e.values?e.values:e$(this.name,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return"function"==typeof this._values&&(this._values=e$(this.name,this._values())),this._values}getValue(e){return null===this._nameLookup&&(this._nameLookup=T(this.getValues(),e=>e.name)),this._nameLookup[e]}serialize(e){null===this._valueLookup&&(this._valueLookup=new Map(this.getValues().map(e=>[e.value,e])));let t=this._valueLookup.get(e);if(void 0===t)throw new y.eO(`Enum "${this.name}" cannot represent value: ${(0,v.N)(e)}`);return t.name}parseValue(e){if("string"!=typeof e){let t=(0,v.N)(e);throw new y.eO(`Enum "${this.name}" cannot represent non-string value: ${t}.`+eL(this,t))}let t=this.getValue(e);if(null==t)throw new y.eO(`Value "${e}" does not exist in "${this.name}" enum.`+eL(this,e));return t.value}parseLiteral(e,t){if(e.kind!==V.b.ENUM){let t=(0,R.y)(e);throw new y.eO(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+eL(this,t),{nodes:e})}let a=this.getValue(e.value);if(null==a){let t=(0,R.y)(e);throw new y.eO(`Value "${t}" does not exist in "${this.name}" enum.`+eL(this,t),{nodes:e})}return a.value}toConfig(){let e=N(this.getValues(),e=>e.name,e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function eL(e,t){return _("the enum value",A(t,e.getValues().map(e=>e.name)))}function e$(e,t){return ek(t)||(0,m.U)(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([t,a])=>(ek(a)||(0,m.U)(!1,`${e}.${t} must refer to an object with a "value" key representing an internal value but got: ${(0,v.N)(a)}.`),{name:L(t),description:a.description,value:void 0!==a.value?a.value:t,deprecationReason:a.deprecationReason,extensions:C(a.extensions),astNode:a.astNode}))}class eM{constructor(e){var t,a;this.name=j(e.name),this.description=e.description,this.extensions=C(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this.isOneOf=null!=(a=e.isOneOf)&&a,this._fields=eU.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){let e=S(this.getFields(),e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function eU(e){let t=eN(e.fields);return ek(t)||(0,m.U)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),S(t,(t,a)=>("resolve"in t&&(0,m.U)(!1,`${e.name}.${a} field has a resolve property, but Input Types cannot define resolvers.`),{name:j(a),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:C(t.extensions),astNode:t.astNode}))}function eB(e){return et(e.type)&&void 0===e.defaultValue}function eq(e,t){return e===t||!!(et(e)&&et(t)||X(e)&&X(t))&&eq(e.ofType,t.ofType)}function eQ(e,t,a){return t===a||(et(a)?!!et(t)&&eQ(e,t.ofType,a.ofType):et(t)?eQ(e,t.ofType,a):X(a)?!!X(t)&&eQ(e,t.ofType,a.ofType):!X(t)&&eu(a)&&(Y(t)||q(t))&&e.isSubType(a,t))}function eY(e,t,a){return t===a||(eu(t)?eu(a)?e.getPossibleTypes(t).some(t=>e.isSubType(a,t)):e.isSubType(t,a):!!eu(a)&&e.isSubType(a,t))}var eG=a(42868);let ez=0x7fffffff,eH=-0x80000000,eW=new eS({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=e2(e);if("boolean"==typeof t)return+!!t;let a=t;if("string"==typeof t&&""!==t&&(a=Number(t)),"number"!=typeof a||!Number.isInteger(a))throw new y.eO(`Int cannot represent non-integer value: ${(0,v.N)(t)}`);if(a>ez||a<eH)throw new y.eO("Int cannot represent non 32-bit signed integer value: "+(0,v.N)(t));return a},parseValue(e){if("number"!=typeof e||!Number.isInteger(e))throw new y.eO(`Int cannot represent non-integer value: ${(0,v.N)(e)}`);if(e>ez||e<eH)throw new y.eO(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==V.b.INT)throw new y.eO(`Int cannot represent non-integer value: ${(0,R.y)(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>ez||t<eH)throw new y.eO(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),eK=new eS({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(e){let t=e2(e);if("boolean"==typeof t)return+!!t;let a=t;if("string"==typeof t&&""!==t&&(a=Number(t)),"number"!=typeof a||!Number.isFinite(a))throw new y.eO(`Float cannot represent non numeric value: ${(0,v.N)(t)}`);return a},parseValue(e){if("number"!=typeof e||!Number.isFinite(e))throw new y.eO(`Float cannot represent non numeric value: ${(0,v.N)(e)}`);return e},parseLiteral(e){if(e.kind!==V.b.FLOAT&&e.kind!==V.b.INT)throw new y.eO(`Float cannot represent non numeric value: ${(0,R.y)(e)}`,e);return parseFloat(e.value)}}),eJ=new eS({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(e){let t=e2(e);if("string"==typeof t)return t;if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t&&Number.isFinite(t))return t.toString();throw new y.eO(`String cannot represent value: ${(0,v.N)(e)}`)},parseValue(e){if("string"!=typeof e)throw new y.eO(`String cannot represent a non string value: ${(0,v.N)(e)}`);return e},parseLiteral(e){if(e.kind!==V.b.STRING)throw new y.eO(`String cannot represent a non string value: ${(0,R.y)(e)}`,{nodes:e});return e.value}}),eZ=new eS({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){let t=e2(e);if("boolean"==typeof t)return t;if(Number.isFinite(t))return 0!==t;throw new y.eO(`Boolean cannot represent a non boolean value: ${(0,v.N)(t)}`)},parseValue(e){if("boolean"!=typeof e)throw new y.eO(`Boolean cannot represent a non boolean value: ${(0,v.N)(e)}`);return e},parseLiteral(e){if(e.kind!==V.b.BOOLEAN)throw new y.eO(`Boolean cannot represent a non boolean value: ${(0,R.y)(e)}`,{nodes:e});return e.value}}),eX=new eS({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(e){let t=e2(e);if("string"==typeof t)return t;if(Number.isInteger(t))return String(t);throw new y.eO(`ID cannot represent value: ${(0,v.N)(e)}`)},parseValue(e){if("string"==typeof e)return e;if("number"==typeof e&&Number.isInteger(e))return e.toString();throw new y.eO(`ID cannot represent value: ${(0,v.N)(e)}`)},parseLiteral(e){if(e.kind!==V.b.STRING&&e.kind!==V.b.INT)throw new y.eO("ID cannot represent a non-string and non-integer value: "+(0,R.y)(e),{nodes:e});return e.value}}),e1=Object.freeze([eJ,eW,eK,eZ,eX]);function e0(e){return e1.some(({name:t})=>e.name===t)}function e2(e){if((0,E.Z)(e)){if("function"==typeof e.valueOf){let t=e.valueOf();if(!(0,E.Z)(t))return t}if("function"==typeof e.toJSON)return e.toJSON()}return e}function e6(e){return(0,w.h)(e,e3)}function e4(e){if(!e6(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL directive.`);return e}class e3{constructor(e){var t,a;this.name=j(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=null!=(t=e.isRepeatable)&&t,this.extensions=C(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||(0,m.U)(!1,`@${e.name} locations must be an Array.`);let r=null!=(a=e.args)?a:{};(0,E.Z)(r)&&!Array.isArray(r)||(0,m.U)(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=eA(r)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:eC(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}let e9=new e3({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[eG.H.FIELD,eG.H.FRAGMENT_SPREAD,eG.H.INLINE_FRAGMENT],args:{if:{type:new ef(eZ),description:"Included when true."}}}),e5=new e3({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[eG.H.FIELD,eG.H.FRAGMENT_SPREAD,eG.H.INLINE_FRAGMENT],args:{if:{type:new ef(eZ),description:"Skipped when true."}}}),e8="No longer supported",e7=new e3({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[eG.H.FIELD_DEFINITION,eG.H.ARGUMENT_DEFINITION,eG.H.INPUT_FIELD_DEFINITION,eG.H.ENUM_VALUE],args:{reason:{type:eJ,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:e8}}}),te=new e3({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[eG.H.SCALAR],args:{url:{type:new ef(eJ),description:"The URL that specifies the behavior of this scalar."}}}),tt=new e3({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[eG.H.INPUT_OBJECT],args:{}}),ta=Object.freeze([e9,e5,e7,te,tt]);function tr(e){return ta.some(({name:t})=>t===e.name)}var ti=a(71306);function tn(e){return"object"==typeof e&&"function"==typeof(null==e?void 0:e[Symbol.iterator])}function tp(e,t){if(et(t)){let a=tp(e,t.ofType);return(null==a?void 0:a.kind)===V.b.NULL?null:a}if(null===e)return{kind:V.b.NULL};if(void 0===e)return null;if(X(t)){let a=t.ofType;if(tn(e)){let t=[];for(let r of e){let e=tp(r,a);null!=e&&t.push(e)}return{kind:V.b.LIST,values:t}}return tp(e,a)}if(J(t)){if(!(0,E.Z)(e))return null;let a=[];for(let r of Object.values(t.getFields())){let t=tp(e[r.name],r.type);t&&a.push({kind:V.b.OBJECT_FIELD,name:{kind:V.b.NAME,value:r.name},value:t})}return{kind:V.b.OBJECT,fields:a}}if(eo(t)){let a=t.serialize(e);if(null==a)return null;if("boolean"==typeof a)return{kind:V.b.BOOLEAN,value:a};if("number"==typeof a&&Number.isFinite(a)){let e=String(a);return to.test(e)?{kind:V.b.INT,value:e}:{kind:V.b.FLOAT,value:e}}if("string"==typeof a)return W(t)?{kind:V.b.ENUM,value:a}:t===eX&&to.test(a)?{kind:V.b.INT,value:a}:{kind:V.b.STRING,value:a};throw TypeError(`Cannot convert value to AST: ${(0,v.N)(a)}.`)}(0,ti.V)(!1,"Unexpected input type: "+(0,v.N)(t))}let to=/^-?(?:0|[1-9][0-9]*)$/,td=new eO({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:eJ,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new ef(new em(new ef(tu))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new ef(tu),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:tu,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:tu,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new ef(new em(new ef(ts))),resolve:e=>e.getDirectives()}})}),ts=new eO({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn 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 ef(eJ),resolve:e=>e.name},description:{type:eJ,resolve:e=>e.description},isRepeatable:{type:new ef(eZ),resolve:e=>e.isRepeatable},locations:{type:new ef(new em(new ef(tl))),resolve:e=>e.locations},args:{type:new ef(new em(new ef(tm))),args:{includeDeprecated:{type:eZ,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter(e=>null==e.deprecationReason)}})}),tl=new ej({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:eG.H.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:eG.H.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:eG.H.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:eG.H.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:eG.H.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:eG.H.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:eG.H.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:eG.H.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:eG.H.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:eG.H.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:eG.H.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:eG.H.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:eG.H.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:eG.H.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:eG.H.UNION,description:"Location adjacent to a union definition."},ENUM:{value:eG.H.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:eG.H.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:eG.H.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:eG.H.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),tu=new eO({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 ef(th),resolve:e=>U(e)?l.SCALAR:q(e)?l.OBJECT:Y(e)?l.INTERFACE:z(e)?l.UNION:W(e)?l.ENUM:J(e)?l.INPUT_OBJECT:X(e)?l.LIST:et(e)?l.NON_NULL:void(0,ti.V)(!1,`Unexpected type: "${(0,v.N)(e)}".`)},name:{type:eJ,resolve:e=>"name"in e?e.name:void 0},description:{type:eJ,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:eJ,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new em(new ef(tc)),args:{includeDeprecated:{type:eZ,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(q(e)||Y(e)){let a=Object.values(e.getFields());return t?a:a.filter(e=>null==e.deprecationReason)}}},interfaces:{type:new em(new ef(tu)),resolve(e){if(q(e)||Y(e))return e.getInterfaces()}},possibleTypes:{type:new em(new ef(tu)),resolve(e,t,a,{schema:r}){if(eu(e))return r.getPossibleTypes(e)}},enumValues:{type:new em(new ef(tf)),args:{includeDeprecated:{type:eZ,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(W(e)){let a=e.getValues();return t?a:a.filter(e=>null==e.deprecationReason)}}},inputFields:{type:new em(new ef(tm)),args:{includeDeprecated:{type:eZ,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(J(e)){let a=Object.values(e.getFields());return t?a:a.filter(e=>null==e.deprecationReason)}}},ofType:{type:tu,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:eZ,resolve:e=>{if(J(e))return e.isOneOf}}})}),tc=new eO({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 ef(eJ),resolve:e=>e.name},description:{type:eJ,resolve:e=>e.description},args:{type:new ef(new em(new ef(tm))),args:{includeDeprecated:{type:eZ,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter(e=>null==e.deprecationReason)},type:{type:new ef(tu),resolve:e=>e.type},isDeprecated:{type:new ef(eZ),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:eJ,resolve:e=>e.deprecationReason}})}),tm=new eO({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 ef(eJ),resolve:e=>e.name},description:{type:eJ,resolve:e=>e.description},type:{type:new ef(tu),resolve:e=>e.type},defaultValue:{type:eJ,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:a}=e,r=tp(a,t);return r?(0,R.y)(r):null}},isDeprecated:{type:new ef(eZ),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:eJ,resolve:e=>e.deprecationReason}})}),tf=new eO({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 ef(eJ),resolve:e=>e.name},description:{type:eJ,resolve:e=>e.description},isDeprecated:{type:new ef(eZ),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:eJ,resolve:e=>e.deprecationReason}})});(p=l||(l={})).SCALAR="SCALAR",p.OBJECT="OBJECT",p.INTERFACE="INTERFACE",p.UNION="UNION",p.ENUM="ENUM",p.INPUT_OBJECT="INPUT_OBJECT",p.LIST="LIST",p.NON_NULL="NON_NULL";let th=new ej({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:l.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:l.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:l.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:l.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:l.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:l.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:l.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:l.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),tv={name:"__schema",type:new ef(td),description:"Access the current type schema of this server.",args:[],resolve:(e,t,a,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},ty={name:"__type",type:tu,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new ef(eJ),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},a,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},tg={name:"__typename",type:new ef(eJ),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,a,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},t_=Object.freeze([td,ts,tl,tu,tc,tm,tf,th]);function tb(e){return t_.some(({name:t})=>e.name===t)}function tw(e){return(0,w.h)(e,tT)}function tE(e){if(!tw(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL schema.`);return e}class tT{constructor(e){var t,a;this.__validationErrors=!0===e.assumeValid?[]:void 0,(0,E.Z)(e)||(0,m.U)(!1,"Must provide configuration object."),!e.types||Array.isArray(e.types)||(0,m.U)(!1,`"types" must be Array if provided but got: ${(0,v.N)(e.types)}.`),!e.directives||Array.isArray(e.directives)||(0,m.U)(!1,`"directives" must be Array if provided but got: ${(0,v.N)(e.directives)}.`),this.description=e.description,this.extensions=C(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=null!=(a=e.directives)?a:ta;let r=new Set(e.types);if(null!=e.types)for(let t of e.types)r.delete(t),tN(t,r);for(let e of(null!=this._queryType&&tN(this._queryType,r),null!=this._mutationType&&tN(this._mutationType,r),null!=this._subscriptionType&&tN(this._subscriptionType,r),this._directives))if(e6(e))for(let t of e.args)tN(t.type,r);for(let e of(tN(td,r),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null),r)){if(null==e)continue;let t=e.name;if(t||(0,m.U)(!1,"One of the provided types for building the Schema is missing a name."),void 0!==this._typeMap[t])throw Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,Y(e)){for(let t of e.getInterfaces())if(Y(t)){let a=this._implementationsMap[t.name];void 0===a&&(a=this._implementationsMap[t.name]={objects:[],interfaces:[]}),a.interfaces.push(e)}}else if(q(e)){for(let t of e.getInterfaces())if(Y(t)){let a=this._implementationsMap[t.name];void 0===a&&(a=this._implementationsMap[t.name]={objects:[],interfaces:[]}),a.objects.push(e)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case g.cE.QUERY:return this.getQueryType();case g.cE.MUTATION:return this.getMutationType();case g.cE.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return z(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){let t=this._implementationsMap[e.name];return null!=t?t:{objects:[],interfaces:[]}}isSubType(e,t){let a=this._subTypeMap[e.name];if(void 0===a){if(a=Object.create(null),z(e))for(let t of e.getTypes())a[t.name]=!0;else{let t=this.getImplementations(e);for(let e of t.objects)a[e.name]=!0;for(let e of t.interfaces)a[e.name]=!0}this._subTypeMap[e.name]=a}return void 0!==a[t.name]}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(t=>t.name===e)}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:void 0!==this.__validationErrors}}}function tN(e,t){let a=eE(e);if(!t.has(a)){if(t.add(a),z(a))for(let e of a.getTypes())tN(e,t);else if(q(a)||Y(a)){for(let e of a.getInterfaces())tN(e,t);for(let e of Object.values(a.getFields()))for(let a of(tN(e.type,t),e.args))tN(a.type,t)}else if(J(a))for(let e of Object.values(a.getFields()))tN(e.type,t)}return t}function tS(e){var t,a,r,i;let n,p,o,d;if(tE(e),e.__validationErrors)return e.__validationErrors;let s=new tD(e);(p=(n=(t=s).schema).getQueryType())?q(p)||t.reportError(`Query root type must be Object type, it cannot be ${(0,v.N)(p)}.`,null!=(a=tI(n,g.cE.QUERY))?a:p.astNode):t.reportError("Query root type must be provided.",n.astNode),(o=n.getMutationType())&&!q(o)&&t.reportError(`Mutation root type must be Object type if provided, it cannot be ${(0,v.N)(o)}.`,null!=(r=tI(n,g.cE.MUTATION))?r:o.astNode),(d=n.getSubscriptionType())&&!q(d)&&t.reportError(`Subscription root type must be Object type if provided, it cannot be ${(0,v.N)(d)}.`,null!=(i=tI(n,g.cE.SUBSCRIPTION))?i:d.astNode),function(e){for(let a of e.schema.getDirectives()){if(!e6(a)){e.reportError(`Expected directive but got: ${(0,v.N)(a)}.`,null==a?void 0:a.astNode);continue}for(let r of(tA(e,a),0===a.locations.length&&e.reportError(`Directive @${a.name} must include 1 or more locations.`,a.astNode),a.args))if(tA(e,r),er(r.type)||e.reportError(`The type of @${a.name}(${r.name}:) must be Input Type but got: ${(0,v.N)(r.type)}.`,r.astNode),eV(r)&&null!=r.deprecationReason){var t;e.reportError(`Required argument @${a.name}(${r.name}:) cannot be deprecated.`,[tC(r.astNode),null==(t=r.astNode)?void 0:t.type])}}}(s),function(e){var t;let a,r,i,n=(t=e,a=Object.create(null),r=[],i=Object.create(null),function e(n){if(!a[n.name]){for(let p of(a[n.name]=!0,i[n.name]=r.length,Object.values(n.getFields())))if(et(p.type)&&J(p.type.ofType)){let a=p.type.ofType,n=i[a.name];if(r.push(p),void 0===n)e(a);else{let e=r.slice(n),i=e.map(e=>e.name).join(".");t.reportError(`Cannot reference Input Object "${a.name}" within itself through a series of non-null fields: "${i}".`,e.map(e=>e.astNode))}r.pop()}i[n.name]=void 0}});for(let t of Object.values(e.schema.getTypeMap())){if(!eb(t)){e.reportError(`Expected GraphQL named type but got: ${(0,v.N)(t)}.`,t.astNode);continue}tb(t)||tA(e,t),q(t)||Y(t)?(function(e,t){let a=Object.values(t.getFields());for(let p of(0===a.length&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]),a)){var r,i,n;for(let a of(tA(e,p),en(p.type)||e.reportError(`The type of ${t.name}.${p.name} must be Output Type but got: ${(0,v.N)(p.type)}.`,null==(r=p.astNode)?void 0:r.type),p.args)){let r=a.name;tA(e,a),er(a.type)||e.reportError(`The type of ${t.name}.${p.name}(${r}:) must be Input Type but got: ${(0,v.N)(a.type)}.`,null==(i=a.astNode)?void 0:i.type),eV(a)&&null!=a.deprecationReason&&e.reportError(`Required argument ${t.name}.${p.name}(${r}:) cannot be deprecated.`,[tC(a.astNode),null==(n=a.astNode)?void 0:n.type])}}}(e,t),function(e,t){let a=Object.create(null);for(let r of t.getInterfaces()){if(!Y(r)){e.reportError(`Type ${(0,v.N)(t)} must only implement Interface types, it cannot implement ${(0,v.N)(r)}.`,tk(t,r));continue}if(t===r){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,tk(t,r));continue}if(a[r.name]){e.reportError(`Type ${t.name} can only implement ${r.name} once.`,tk(t,r));continue}a[r.name]=!0,function(e,t,a){let r=t.getInterfaces();for(let i of a.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${a.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${a.name}.`,[...tk(a,i),...tk(t,a)])}(e,t,r),function(e,t,a){let r=t.getFields();for(let d of Object.values(a.getFields())){var i,n,p,o;let s=d.name,l=r[s];if(!l){e.reportError(`Interface field ${a.name}.${s} expected but ${t.name} does not provide it.`,[d.astNode,t.astNode,...t.extensionASTNodes]);continue}for(let r of(eQ(e.schema,l.type,d.type)||e.reportError(`Interface field ${a.name}.${s} expects type ${(0,v.N)(d.type)} but ${t.name}.${s} is type ${(0,v.N)(l.type)}.`,[null==(i=d.astNode)?void 0:i.type,null==(n=l.astNode)?void 0:n.type]),d.args)){let i=r.name,n=l.args.find(e=>e.name===i);if(!n){e.reportError(`Interface field argument ${a.name}.${s}(${i}:) expected but ${t.name}.${s} does not provide it.`,[r.astNode,l.astNode]);continue}eq(r.type,n.type)||e.reportError(`Interface field argument ${a.name}.${s}(${i}:) expects type ${(0,v.N)(r.type)} but ${t.name}.${s}(${i}:) is type ${(0,v.N)(n.type)}.`,[null==(p=r.astNode)?void 0:p.type,null==(o=n.astNode)?void 0:o.type])}for(let r of l.args){let i=r.name;!d.args.find(e=>e.name===i)&&eV(r)&&e.reportError(`Object field ${t.name}.${s} includes required argument ${i} that is missing from the Interface field ${a.name}.${s}.`,[r.astNode,d.astNode])}}}(e,t,r)}}(e,t)):z(t)?function(e,t){let a=t.getTypes();0===a.length&&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 a){if(r[i.name]){e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,tx(t,i.name));continue}r[i.name]=!0,q(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${(0,v.N)(i)}.`,tx(t,String(i)))}}(e,t):W(t)?function(e,t){let a=t.getValues();for(let r of(0===a.length&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]),a))tA(e,r)}(e,t):J(t)&&(function(e,t){let a=Object.values(t.getFields());for(let n of(0===a.length&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]),a)){var r,i;tA(e,n),er(n.type)||e.reportError(`The type of ${t.name}.${n.name} must be Input Type but got: ${(0,v.N)(n.type)}.`,null==(r=n.astNode)?void 0:r.type),eB(n)&&null!=n.deprecationReason&&e.reportError(`Required input field ${t.name}.${n.name} cannot be deprecated.`,[tC(n.astNode),null==(i=n.astNode)?void 0:i.type]),t.isOneOf&&function(e,t,a){if(et(t.type)){var r;a.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,null==(r=t.astNode)?void 0:r.type)}void 0!==t.defaultValue&&a.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode)}(t,n,e)}}(e,t),n(t))}}(s);let l=s.getErrors();return e.__validationErrors=l,l}function tO(e){let t=tS(e);if(0!==t.length)throw Error(t.map(e=>e.message).join("\n\n"))}class tD{constructor(e){this._errors=[],this.schema=e}reportError(e,t){let a=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new y.eO(e,{nodes:a}))}getErrors(){return this._errors}}function tI(e,t){var a;return null==(a=[e.astNode,...e.extensionASTNodes].flatMap(e=>{var t;return null!=(t=null==e?void 0:e.operationTypes)?t:[]}).find(e=>e.operation===t))?void 0:a.type}function tA(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function tk(e,t){let{astNode:a,extensionASTNodes:r}=e;return(null!=a?[a,...r]:r).flatMap(e=>{var t;return null!=(t=e.interfaces)?t:[]}).filter(e=>e.name.value===t.name)}function tx(e,t){let{astNode:a,extensionASTNodes:r}=e;return(null!=a?[a,...r]:r).flatMap(e=>{var t;return null!=(t=e.types)?t:[]}).filter(e=>e.name.value===t)}function tC(e){var t;return null==e||null==(t=e.directives)?void 0:t.find(e=>e.name.value===e7.name)}var tV=a(90424);function tR(e,t){switch(t.kind){case V.b.LIST_TYPE:{let a=tR(e,t.type);return a&&new em(a)}case V.b.NON_NULL_TYPE:{let a=tR(e,t.type);return a&&new ef(a)}case V.b.NAMED_TYPE:return e.getType(t.name.value)}}class tF{constructor(e,t,a){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=null!=a?a:tP,t&&(er(t)&&this._inputTypeStack.push(t),es(t)&&this._parentTypeStack.push(t),en(t)&&this._typeStack.push(t))}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(e){let t=this._schema;switch(e.kind){case V.b.SELECTION_SET:{let e=eE(this.getType());this._parentTypeStack.push(es(e)?e:void 0);break}case V.b.FIELD:{let a,r,i=this.getParentType();i&&(a=this._getFieldDef(t,i,e))&&(r=a.type),this._fieldDefStack.push(a),this._typeStack.push(en(r)?r:void 0);break}case V.b.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case V.b.OPERATION_DEFINITION:{let a=t.getRootType(e.operation);this._typeStack.push(q(a)?a:void 0);break}case V.b.INLINE_FRAGMENT:case V.b.FRAGMENT_DEFINITION:{let a=e.typeCondition,r=a?tR(t,a):eE(this.getType());this._typeStack.push(en(r)?r:void 0);break}case V.b.VARIABLE_DEFINITION:{let a=tR(t,e.type);this._inputTypeStack.push(er(a)?a:void 0);break}case V.b.ARGUMENT:{var a;let t,r,i=null!=(a=this.getDirective())?a:this.getFieldDef();i&&(t=i.args.find(t=>t.name===e.name.value))&&(r=t.type),this._argument=t,this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push(er(r)?r:void 0);break}case V.b.LIST:{let e=e_(this.getInputType()),t=X(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push(er(t)?t:void 0);break}case V.b.OBJECT_FIELD:{let t,a,r=eE(this.getInputType());J(r)&&(a=r.getFields()[e.name.value])&&(t=a.type),this._defaultValueStack.push(a?a.defaultValue:void 0),this._inputTypeStack.push(er(t)?t:void 0);break}case V.b.ENUM:{let t,a=eE(this.getInputType());W(a)&&(t=a.getValue(e.value)),this._enumValue=t}}}leave(e){switch(e.kind){case V.b.SELECTION_SET:this._parentTypeStack.pop();break;case V.b.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case V.b.DIRECTIVE:this._directive=null;break;case V.b.OPERATION_DEFINITION:case V.b.INLINE_FRAGMENT:case V.b.FRAGMENT_DEFINITION:this._typeStack.pop();break;case V.b.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case V.b.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case V.b.LIST:case V.b.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case V.b.ENUM:this._enumValue=null}}}function tP(e,t,a){let r=a.name.value;return r===tv.name&&e.getQueryType()===t?tv:r===ty.name&&e.getQueryType()===t?ty:r===tg.name&&es(t)?tg:q(t)||Y(t)?t.getFields()[r]:void 0}function tj(e,t){return{enter(...a){let r=a[0];e.enter(r);let i=(0,tV.XO)(t,r.kind).enter;if(i){let n=i.apply(t,a);return void 0!==n&&(e.leave(r),(0,g.Ll)(n)&&e.enter(n)),n}},leave(...a){let r,i=a[0],n=(0,tV.XO)(t,i.kind).leave;return n&&(r=n.apply(t,a)),e.leave(i),r}}}var tL=a(3420);function t$(e){return{Document(t){for(let a of t.definitions)if(!(0,tL._m)(a)){let t=a.kind===V.b.SCHEMA_DEFINITION||a.kind===V.b.SCHEMA_EXTENSION?"schema":'"'+a.name.value+'"';e.reportError(new y.eO(`The ${t} definition is not executable.`,{nodes:a}))}return!1}}}function tM(e){return{Field(t){let a=e.getParentType();if(a&&!e.getFieldDef()){var r,i;let n=e.getSchema(),p=t.name.value,o=_("to use an inline fragment on",function(e,t,a){if(!eu(t))return[];let r=new Set,i=Object.create(null);for(let p of e.getPossibleTypes(t))if(p.getFields()[a])for(let e of(r.add(p),i[p.name]=1,p.getInterfaces())){var n;e.getFields()[a]&&(r.add(e),i[e.name]=(null!=(n=i[e.name])?n:0)+1)}return[...r].sort((t,a)=>{let r=i[a.name]-i[t.name];return 0!==r?r:Y(t)&&e.isSubType(t,a)?-1:Y(a)&&e.isSubType(a,t)?1:O(t.name,a.name)}).map(e=>e.name)}(n,a,p));""===o&&(o=_((r=a,i=p,q(r)||Y(r)?A(i,Object.keys(r.getFields())):[]))),e.reportError(new y.eO(`Cannot query field "${p}" on type "${a.name}".`+o,{nodes:t}))}}}}function tU(e){return{InlineFragment(t){let a=t.typeCondition;if(a){let t=tR(e.getSchema(),a);if(t&&!es(t)){let t=(0,R.y)(a);e.reportError(new y.eO(`Fragment cannot condition on non composite type "${t}".`,{nodes:a}))}}},FragmentDefinition(t){let a=tR(e.getSchema(),t.typeCondition);if(a&&!es(a)){let a=(0,R.y)(t.typeCondition);e.reportError(new y.eO(`Fragment "${t.name.value}" cannot condition on non composite type "${a}".`,{nodes:t.typeCondition}))}}}}function tB(e){return{...tq(e),Argument(t){let a=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!a&&r&&i){let a=t.name.value,n=A(a,r.args.map(e=>e.name));e.reportError(new y.eO(`Unknown argument "${a}" on field "${i.name}.${r.name}".`+_(n),{nodes:t}))}}}}function tq(e){let t=Object.create(null),a=e.getSchema();for(let e of a?a.getDirectives():ta)t[e.name]=e.args.map(e=>e.name);for(let a of e.getDocument().definitions)if(a.kind===V.b.DIRECTIVE_DEFINITION){var r;let e=null!=(r=a.arguments)?r:[];t[a.name.value]=e.map(e=>e.name.value)}return{Directive(a){let r=a.name.value,i=t[r];if(a.arguments&&i)for(let t of a.arguments){let a=t.name.value;if(!i.includes(a)){let n=A(a,i);e.reportError(new y.eO(`Unknown argument "${a}" on directive "@${r}".`+_(n),{nodes:t}))}}return!1}}}function tQ(e){let t=Object.create(null),a=e.getSchema();for(let e of a?a.getDirectives():ta)t[e.name]=e.locations;for(let a of e.getDocument().definitions)a.kind===V.b.DIRECTIVE_DEFINITION&&(t[a.name.value]=a.locations.map(e=>e.value));return{Directive(a,r,i,n,p){let o=a.name.value,d=t[o];if(!d)return void e.reportError(new y.eO(`Unknown directive "@${o}".`,{nodes:a}));let s=function(e){let t=e[e.length-1];switch("kind"in t||(0,ti.V)(!1),t.kind){case V.b.OPERATION_DEFINITION:var a=t.operation;switch(a){case g.cE.QUERY:return eG.H.QUERY;case g.cE.MUTATION:return eG.H.MUTATION;case g.cE.SUBSCRIPTION:return eG.H.SUBSCRIPTION}return;case V.b.FIELD:return eG.H.FIELD;case V.b.FRAGMENT_SPREAD:return eG.H.FRAGMENT_SPREAD;case V.b.INLINE_FRAGMENT:return eG.H.INLINE_FRAGMENT;case V.b.FRAGMENT_DEFINITION:return eG.H.FRAGMENT_DEFINITION;case V.b.VARIABLE_DEFINITION:return eG.H.VARIABLE_DEFINITION;case V.b.SCHEMA_DEFINITION:case V.b.SCHEMA_EXTENSION:return eG.H.SCHEMA;case V.b.SCALAR_TYPE_DEFINITION:case V.b.SCALAR_TYPE_EXTENSION:return eG.H.SCALAR;case V.b.OBJECT_TYPE_DEFINITION:case V.b.OBJECT_TYPE_EXTENSION:return eG.H.OBJECT;case V.b.FIELD_DEFINITION:return eG.H.FIELD_DEFINITION;case V.b.INTERFACE_TYPE_DEFINITION:case V.b.INTERFACE_TYPE_EXTENSION:return eG.H.INTERFACE;case V.b.UNION_TYPE_DEFINITION:case V.b.UNION_TYPE_EXTENSION:return eG.H.UNION;case V.b.ENUM_TYPE_DEFINITION:case V.b.ENUM_TYPE_EXTENSION:return eG.H.ENUM;case V.b.ENUM_VALUE_DEFINITION:return eG.H.ENUM_VALUE;case V.b.INPUT_OBJECT_TYPE_DEFINITION:case V.b.INPUT_OBJECT_TYPE_EXTENSION:return eG.H.INPUT_OBJECT;case V.b.INPUT_VALUE_DEFINITION:{let t=e[e.length-3];return"kind"in t||(0,ti.V)(!1),t.kind===V.b.INPUT_OBJECT_TYPE_DEFINITION?eG.H.INPUT_FIELD_DEFINITION:eG.H.ARGUMENT_DEFINITION}default:(0,ti.V)(!1,"Unexpected kind: "+(0,v.N)(t.kind))}}(p);s&&!d.includes(s)&&e.reportError(new y.eO(`Directive "@${o}" may not be used on ${s}.`,{nodes:a}))}}}function tY(e){return{FragmentSpread(t){let a=t.name.value;e.getFragment(a)||e.reportError(new y.eO(`Unknown fragment "${a}".`,{nodes:t.name}))}}}function tG(e){let t=e.getSchema(),a=t?t.getTypeMap():Object.create(null),r=Object.create(null);for(let t of e.getDocument().definitions)(0,tL.a6)(t)&&(r[t.name.value]=!0);let i=[...Object.keys(a),...Object.keys(r)];return{NamedType(t,n,p,o,d){let s=t.name.value;if(!a[s]&&!r[s]){var l,u;let a=null!=(l=d[2])?l:p,r=null!=a&&"kind"in(u=a)&&((0,tL.xu)(u)||(0,tL.fT)(u));if(r&&tz.includes(s))return;let n=A(s,r?tz.concat(i):i);e.reportError(new y.eO(`Unknown type "${s}".`+_(n),{nodes:t}))}}}}let tz=[...e1,...t_].map(e=>e.name);function tH(e){let t=0;return{Document(e){t=e.definitions.filter(e=>e.kind===V.b.OPERATION_DEFINITION).length},OperationDefinition(a){!a.name&&t>1&&e.reportError(new y.eO("This anonymous operation must be the only defined operation.",{nodes:a}))}}}function tW(e){var t,a,r;let i=e.getSchema(),n=null!=(t=null!=(a=null!=(r=null==i?void 0:i.astNode)?r:null==i?void 0:i.getQueryType())?a:null==i?void 0:i.getMutationType())?t:null==i?void 0:i.getSubscriptionType(),p=0;return{SchemaDefinition(t){n?e.reportError(new y.eO("Cannot define a new schema within a schema extension.",{nodes:t})):(p>0&&e.reportError(new y.eO("Must provide only one schema definition.",{nodes:t})),++p)}}}function tK(e){return{Field(t){if(("__schema"===t.name.value||"__type"===t.name.value)&&function t(a,r=Object.create(null),i=0){if(a.kind===V.b.FRAGMENT_SPREAD){let n=a.name.value;if(!0===r[n])return!1;let p=e.getFragment(n);if(!p)return!1;try{return r[n]=!0,t(p,r,i)}finally{r[n]=void 0}}if(a.kind===V.b.FIELD&&("fields"===a.name.value||"interfaces"===a.name.value||"possibleTypes"===a.name.value||"inputFields"===a.name.value)&&++i>=3)return!0;if("selectionSet"in a&&a.selectionSet){for(let e of a.selectionSet.selections)if(t(e,r,i))return!0}return!1}(t))return e.reportError(new y.eO("Maximum introspection depth exceeded",{nodes:[t]})),!1}}}function tJ(e){let t=Object.create(null),a=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:i=>((function i(n){if(t[n.name.value])return;let p=n.name.value;t[p]=!0;let o=e.getFragmentSpreads(n.selectionSet);if(0!==o.length){for(let t of(r[p]=a.length,o)){let n=t.name.value,p=r[n];if(a.push(t),void 0===p){let t=e.getFragment(n);t&&i(t)}else{let t=a.slice(p),r=t.slice(0,-1).map(e=>'"'+e.name.value+'"').join(", ");e.reportError(new y.eO(`Cannot spread fragment "${n}" within itself`+(""!==r?` via ${r}.`:"."),{nodes:t}))}a.pop()}r[p]=void 0}})(i),!1)}}function tZ(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(a){for(let{node:r}of e.getRecursiveVariableUsages(a)){let i=r.name.value;!0!==t[i]&&e.reportError(new y.eO(a.name?`Variable "$${i}" is not defined by operation "${a.name.value}".`:`Variable "$${i}" is not defined.`,{nodes:[r,a]}))}}},VariableDefinition(e){t[e.variable.name.value]=!0}}}function tX(e){let t=[],a=[];return{OperationDefinition:e=>(t.push(e),!1),FragmentDefinition:e=>(a.push(e),!1),Document:{leave(){let r=Object.create(null);for(let a of t)for(let t of e.getRecursivelyReferencedFragments(a))r[t.name.value]=!0;for(let t of a){let a=t.name.value;!0!==r[a]&&e.reportError(new y.eO(`Fragment "${a}" is never used.`,{nodes:t}))}}}}}function t1(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(a){let r=Object.create(null);for(let{node:t}of e.getRecursiveVariableUsages(a))r[t.name.value]=!0;for(let i of t){let t=i.variable.name.value;!0!==r[t]&&e.reportError(new y.eO(a.name?`Variable "$${t}" is never used in operation "${a.name.value}".`:`Variable "$${t}" is never used.`,{nodes:i}))}}},VariableDefinition(e){t.push(e)}}}function t0(e){switch(e.kind){case V.b.OBJECT:return{...e,fields:e.fields.map(e=>({...e,value:t0(e.value)})).sort((e,t)=>O(e.name.value,t.name.value))};case V.b.LIST:return{...e,values:e.values.map(t0)};case V.b.INT:case V.b.FLOAT:case V.b.STRING:case V.b.BOOLEAN:case V.b.NULL:case V.b.ENUM:case V.b.VARIABLE:return e}}function t2(e){let t=new t7,a=new ae,r=new Map;return{SelectionSet(i){for(let[[n,p],o,d]of function(e,t,a,r,i,n){let p=[],[o,d]=t5(e,t,i,n);if(function(e,t,a,r,i,n){for(let[p,o]of Object.entries(n))if(o.length>1)for(let n=0;n<o.length;n++)for(let d=n+1;d<o.length;d++){let s=t9(e,a,r,i,!1,p,o[n],o[d]);s&&t.push(s)}}(e,p,t,a,r,o),0!==d.length)for(let i=0;i<d.length;i++){t6(e,p,t,a,r,!1,o,d[i]);for(let n=i+1;n<d.length;n++)t4(e,p,t,a,r,!1,d[i],d[n])}return p}(e,r,t,a,e.getParentType(),i)){let t=function e(t){return Array.isArray(t)?t.map(([t,a])=>`subfields "${t}" conflict because `+e(a)).join(" and "):t}(p);e.reportError(new y.eO(`Fields "${n}" conflict because ${t}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:o.concat(d)}))}}}}function t6(e,t,a,r,i,n,p,o){if(r.has(p,o,n))return;r.add(p,o,n);let d=e.getFragment(o);if(!d)return;let[s,l]=t8(e,a,d);if(p!==s)for(let o of(t3(e,t,a,r,i,n,p,s),l))t6(e,t,a,r,i,n,p,o)}function t4(e,t,a,r,i,n,p,o){if(p===o||i.has(p,o,n))return;i.add(p,o,n);let d=e.getFragment(p),s=e.getFragment(o);if(!d||!s)return;let[l,u]=t8(e,a,d),[c,m]=t8(e,a,s);for(let o of(t3(e,t,a,r,i,n,l,c),m))t4(e,t,a,r,i,n,p,o);for(let p of u)t4(e,t,a,r,i,n,p,o)}function t3(e,t,a,r,i,n,p,o){for(let[d,s]of Object.entries(p)){let p=o[d];if(p)for(let o of s)for(let s of p){let p=t9(e,a,r,i,n,d,o,s);p&&t.push(p)}}}function t9(e,t,a,r,i,n,p,o){let[d,s,l]=p,[u,c,m]=o,f=i||d!==u&&q(d)&&q(u);if(!f){let e=s.name.value,t=c.name.value;if(e!==t)return[[n,`"${e}" and "${t}" are different fields`],[s],[c]];if(!function(e,t){let a=e.arguments,r=t.arguments;if(void 0===a||0===a.length)return void 0===r||0===r.length;if(void 0===r||0===r.length||a.length!==r.length)return!1;let i=new Map(r.map(({name:e,value:t})=>[e.value,t]));return a.every(e=>{let t=e.value,a=i.get(e.name.value);return void 0!==a&&function(e){return(0,R.y)(t0(e))}(t)===function(e){return(0,R.y)(t0(e))}(a)})}(s,c))return[[n,"they have differing arguments"],[s],[c]]}let h=null==l?void 0:l.type,y=null==m?void 0:m.type;if(h&&y&&function e(t,a){return X(t)?!X(a)||e(t.ofType,a.ofType):!!X(a)||(et(t)?!et(a)||e(t.ofType,a.ofType):!!et(a)||!!(eo(t)||eo(a))&&t!==a)}(h,y))return[[n,`they return conflicting types "${(0,v.N)(h)}" and "${(0,v.N)(y)}"`],[s],[c]];let g=s.selectionSet,_=c.selectionSet;if(g&&_){var b=function(e,t,a,r,i,n,p,o,d){let s=[],[l,u]=t5(e,t,n,p),[c,m]=t5(e,t,o,d);for(let n of(t3(e,s,t,a,r,i,l,c),m))t6(e,s,t,a,r,i,l,n);for(let n of u)t6(e,s,t,a,r,i,c,n);for(let n of u)for(let p of m)t4(e,s,t,a,r,i,n,p);return s}(e,t,a,r,f,eE(h),g,eE(y),_),w=n,E=s,T=c;return b.length>0?[[w,b.map(([e])=>e)],[E,...b.map(([,e])=>e).flat()],[T,...b.map(([,,e])=>e).flat()]]:void 0}}function t5(e,t,a,r){let i=t.get(r);if(i)return i;let n=Object.create(null),p=Object.create(null);!function e(t,a,r,i,n){for(let p of r.selections)switch(p.kind){case V.b.FIELD:{let e,t=p.name.value;(q(a)||Y(a))&&(e=a.getFields()[t]);let r=p.alias?p.alias.value:t;i[r]||(i[r]=[]),i[r].push([a,p,e]);break}case V.b.FRAGMENT_SPREAD:n[p.name.value]=!0;break;case V.b.INLINE_FRAGMENT:{let r=p.typeCondition,o=r?tR(t.getSchema(),r):a;e(t,o,p.selectionSet,i,n)}}}(e,a,r,n,p);let o=[n,Object.keys(p)];return t.set(r,o),o}function t8(e,t,a){let r=t.get(a.selectionSet);if(r)return r;let i=tR(e.getSchema(),a.typeCondition);return t5(e,t,i,a.selectionSet)}class t7{constructor(){this._data=new Map}has(e,t,a){var r;let i=null==(r=this._data.get(e))?void 0:r.get(t);return void 0!==i&&(!!a||a===i)}add(e,t,a){let r=this._data.get(e);void 0===r?this._data.set(e,new Map([[t,a]])):r.set(t,a)}}class ae{constructor(){this._orderedPairSet=new t7}has(e,t,a){return e<t?this._orderedPairSet.has(e,t,a):this._orderedPairSet.has(t,e,a)}add(e,t,a){e<t?this._orderedPairSet.add(e,t,a):this._orderedPairSet.add(t,e,a)}}function at(e){return{InlineFragment(t){let a=e.getType(),r=e.getParentType();if(es(a)&&es(r)&&!eY(e.getSchema(),a,r)){let i=(0,v.N)(r),n=(0,v.N)(a);e.reportError(new y.eO(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${n}".`,{nodes:t}))}},FragmentSpread(t){let a=t.name.value,r=function(e,t){let a=e.getFragment(t);if(a){let t=tR(e.getSchema(),a.typeCondition);if(es(t))return t}}(e,a),i=e.getParentType();if(r&&i&&!eY(e.getSchema(),r,i)){let n=(0,v.N)(i),p=(0,v.N)(r);e.reportError(new y.eO(`Fragment "${a}" cannot be spread here as objects of type "${n}" can never be of type "${p}".`,{nodes:t}))}}}}function aa(e){let t=e.getSchema(),a=Object.create(null);for(let t of e.getDocument().definitions)(0,tL.a6)(t)&&(a[t.name.value]=t);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(r){var i;let n,p=r.name.value,o=a[p],d=null==t?void 0:t.getType(p);if(o?n=ar[o.kind]:d&&(n=U(i=d)?V.b.SCALAR_TYPE_EXTENSION:q(i)?V.b.OBJECT_TYPE_EXTENSION:Y(i)?V.b.INTERFACE_TYPE_EXTENSION:z(i)?V.b.UNION_TYPE_EXTENSION:W(i)?V.b.ENUM_TYPE_EXTENSION:J(i)?V.b.INPUT_OBJECT_TYPE_EXTENSION:void(0,ti.V)(!1,"Unexpected type: "+(0,v.N)(i))),n){if(n!==r.kind){let t=function(e){switch(e){case V.b.SCALAR_TYPE_EXTENSION:return"scalar";case V.b.OBJECT_TYPE_EXTENSION:return"object";case V.b.INTERFACE_TYPE_EXTENSION:return"interface";case V.b.UNION_TYPE_EXTENSION:return"union";case V.b.ENUM_TYPE_EXTENSION:return"enum";case V.b.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:(0,ti.V)(!1,"Unexpected kind: "+(0,v.N)(e))}}(r.kind);e.reportError(new y.eO(`Cannot extend non-${t} type "${p}".`,{nodes:o?[o,r]:r}))}}else{let i=A(p,Object.keys({...a,...null==t?void 0:t.getTypeMap()}));e.reportError(new y.eO(`Cannot extend type "${p}" because it is not defined.`+_(i),{nodes:r.name}))}}}let ar={[V.b.SCALAR_TYPE_DEFINITION]:V.b.SCALAR_TYPE_EXTENSION,[V.b.OBJECT_TYPE_DEFINITION]:V.b.OBJECT_TYPE_EXTENSION,[V.b.INTERFACE_TYPE_DEFINITION]:V.b.INTERFACE_TYPE_EXTENSION,[V.b.UNION_TYPE_DEFINITION]:V.b.UNION_TYPE_EXTENSION,[V.b.ENUM_TYPE_DEFINITION]:V.b.ENUM_TYPE_EXTENSION,[V.b.INPUT_OBJECT_TYPE_DEFINITION]:V.b.INPUT_OBJECT_TYPE_EXTENSION};function ai(e){return{...an(e),Field:{leave(t){var a;let r=e.getFieldDef();if(!r)return!1;let i=new Set(null==(a=t.arguments)?void 0:a.map(e=>e.name.value));for(let a of r.args)if(!i.has(a.name)&&eV(a)){let i=(0,v.N)(a.type);e.reportError(new y.eO(`Field "${r.name}" argument "${a.name}" of type "${i}" is required, but it was not provided.`,{nodes:t}))}}}}}function an(e){var t,a;let r=Object.create(null),i=e.getSchema();for(let e of null!=(t=null==i?void 0:i.getDirectives())?t:ta)r[e.name]=T(e.args.filter(eV),e=>e.name);for(let t of e.getDocument().definitions)if(t.kind===V.b.DIRECTIVE_DEFINITION){let e=null!=(a=t.arguments)?a:[];r[t.name.value]=T(e.filter(ap),e=>e.name.value)}return{Directive:{leave(t){let a=t.name.value,i=r[a];if(i){var n;let r=new Set((null!=(n=t.arguments)?n:[]).map(e=>e.name.value));for(let[n,p]of Object.entries(i))if(!r.has(n)){let r=$(p.type)?(0,v.N)(p.type):(0,R.y)(p.type);e.reportError(new y.eO(`Directive "@${a}" argument "${n}" of type "${r}" is required, but it was not provided.`,{nodes:t}))}}}}}}function ap(e){return e.type.kind===V.b.NON_NULL_TYPE&&null==e.defaultValue}function ao(e){return{Field(t){let a=e.getType(),r=t.selectionSet;if(a)if(eo(eE(a))){if(r){let i=t.name.value,n=(0,v.N)(a);e.reportError(new y.eO(`Field "${i}" must not have a selection since type "${n}" has no subfields.`,{nodes:r}))}}else if(r){if(0===r.selections.length){let r=t.name.value,i=(0,v.N)(a);e.reportError(new y.eO(`Field "${r}" of type "${i}" must have at least one field selected.`,{nodes:t}))}}else{let r=t.name.value,i=(0,v.N)(a);e.reportError(new y.eO(`Field "${r}" of type "${i}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}}}}function ad(e){return e.map(e=>"number"==typeof e?"["+e.toString()+"]":"."+e).join("")}function as(e,t,a){return{prev:e,key:t,typename:a}}function al(e){let t=[],a=e;for(;a;)t.push(a.key),a=a.prev;return t.reverse()}function au(e,t,a=ac){return function e(t,a,r,i){if(et(a))return null!=t?e(t,a.ofType,r,i):void r(al(i),t,new y.eO(`Expected non-nullable type "${(0,v.N)(a)}" not to be null.`));if(null==t)return null;if(X(a)){let n=a.ofType;return tn(t)?Array.from(t,(t,a)=>e(t,n,r,as(i,a,void 0))):[e(t,n,r,i)]}if(J(a)){if(!(0,E.Z)(t)||Array.isArray(t))return void r(al(i),t,new y.eO(`Expected type "${a.name}" to be an object.`));let n={},p=a.getFields();for(let o of Object.values(p)){let p=t[o.name];if(void 0===p){if(void 0!==o.defaultValue)n[o.name]=o.defaultValue;else if(et(o.type)){let e=(0,v.N)(o.type);r(al(i),t,new y.eO(`Field "${o.name}" of required type "${e}" was not provided.`))}continue}n[o.name]=e(p,o.type,r,as(i,o.name,a.name))}for(let e of Object.keys(t))if(!p[e]){let n=A(e,Object.keys(a.getFields()));r(al(i),t,new y.eO(`Field "${e}" is not defined by type "${a.name}".`+_(n)))}if(a.isOneOf){let e=Object.keys(n);1!==e.length&&r(al(i),t,new y.eO(`Exactly one key must be specified for OneOf type "${a.name}".`));let p=e[0],o=n[p];null===o&&r(al(i).concat(p),o,new y.eO(`Field "${p}" must be non-null.`))}return n}if(eo(a)){let e;try{e=a.parseValue(t)}catch(e){e instanceof y.eO?r(al(i),t,e):r(al(i),t,new y.eO(`Expected type "${a.name}". `+e.message,{originalError:e}));return}return void 0===e&&r(al(i),t,new y.eO(`Expected type "${a.name}".`)),e}(0,ti.V)(!1,"Unexpected input type: "+(0,v.N)(a))}(e,t,a,void 0)}function ac(e,t,a){let r="Invalid value "+(0,v.N)(t);throw e.length>0&&(r+=` at "value${ad(e)}"`),a.message=r+": "+a.message,a}function am(e,t,a){if(e){if(e.kind===V.b.VARIABLE){let r=e.name.value;if(null==a||void 0===a[r])return;let i=a[r];if(null===i&&et(t))return;return i}if(et(t)){if(e.kind===V.b.NULL)return;return am(e,t.ofType,a)}if(e.kind===V.b.NULL)return null;if(X(t)){let r=t.ofType;if(e.kind===V.b.LIST){let t=[];for(let i of e.values)if(af(i,a)){if(et(r))return;t.push(null)}else{let e=am(i,r,a);if(void 0===e)return;t.push(e)}return t}let i=am(e,r,a);if(void 0===i)return;return[i]}if(J(t)){if(e.kind!==V.b.OBJECT)return;let r=Object.create(null),i=T(e.fields,e=>e.name.value);for(let e of Object.values(t.getFields())){let t=i[e.name];if(!t||af(t.value,a)){if(void 0!==e.defaultValue)r[e.name]=e.defaultValue;else if(et(e.type))return;continue}let n=am(t.value,e.type,a);if(void 0===n)return;r[e.name]=n}if(t.isOneOf){let e=Object.keys(r);if(1!==e.length||null===r[e[0]])return}return r}if(eo(t)){let r;try{r=t.parseLiteral(e,a)}catch(e){return}if(void 0===r)return;return r}(0,ti.V)(!1,"Unexpected input type: "+(0,v.N)(t))}}function af(e,t){return e.kind===V.b.VARIABLE&&(null==t||void 0===t[e.name.value])}function ah(e,t,a,r){let i=[],n=null==r?void 0:r.maxErrors;try{let r=function(e,t,a,r){let i={};for(let n of t){let t=n.variable.name.value,p=tR(e,n.type);if(!er(p)){let e=(0,R.y)(n.type);r(new y.eO(`Variable "$${t}" expected value of type "${e}" which cannot be used as an input type.`,{nodes:n.type}));continue}if(!ag(a,t)){if(n.defaultValue)i[t]=am(n.defaultValue,p);else if(et(p)){let e=(0,v.N)(p);r(new y.eO(`Variable "$${t}" of required type "${e}" was not provided.`,{nodes:n}))}continue}let o=a[t];if(null===o&&et(p)){let e=(0,v.N)(p);r(new y.eO(`Variable "$${t}" of non-null type "${e}" must not be null.`,{nodes:n}));continue}i[t]=au(o,p,(e,a,i)=>{let p=`Variable "$${t}" got invalid value `+(0,v.N)(a);e.length>0&&(p+=` at "${t}${ad(e)}"`),r(new y.eO(p+"; "+i.message,{nodes:n,originalError:i}))})}return i}(e,t,a,e=>{if(null!=n&&i.length>=n)throw new y.eO("Too many errors processing variables, error limit reached. Execution aborted.");i.push(e)});if(0===i.length)return{coerced:r}}catch(e){i.push(e)}return{errors:i}}function av(e,t,a){var r;let i={},n=T(null!=(r=t.arguments)?r:[],e=>e.name.value);for(let r of e.args){let e=r.name,p=r.type,o=n[e];if(!o){if(void 0!==r.defaultValue)i[e]=r.defaultValue;else if(et(p))throw new y.eO(`Argument "${e}" of required type "${(0,v.N)(p)}" was not provided.`,{nodes:t});continue}let d=o.value,s=d.kind===V.b.NULL;if(d.kind===V.b.VARIABLE){let t=d.name.value;if(null==a||!ag(a,t)){if(void 0!==r.defaultValue)i[e]=r.defaultValue;else if(et(p))throw new y.eO(`Argument "${e}" of required type "${(0,v.N)(p)}" was provided the variable "$${t}" which was not provided a runtime value.`,{nodes:d});continue}s=null==a[t]}if(s&&et(p))throw new y.eO(`Argument "${e}" of non-null type "${(0,v.N)(p)}" must not be null.`,{nodes:d});let l=am(d,p,a);if(void 0===l)throw new y.eO(`Argument "${e}" has invalid value ${(0,R.y)(d)}.`,{nodes:d});i[e]=l}return i}function ay(e,t,a){var r;let i=null==(r=t.directives)?void 0:r.find(t=>t.name.value===e.name);if(i)return av(e,i,a)}function ag(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function a_(e,t,a,r,i){let n=new Map;return ab(e,t,a,r,i,n,new Set),n}function ab(e,t,a,r,i,n,p){for(let d of i.selections)switch(d.kind){case V.b.FIELD:{var o;if(!aw(a,d))continue;let e=(o=d).alias?o.alias.value:o.name.value,t=n.get(e);void 0!==t?t.push(d):n.set(e,[d]);break}case V.b.INLINE_FRAGMENT:if(!aw(a,d)||!aE(e,d,r))continue;ab(e,t,a,r,d.selectionSet,n,p);break;case V.b.FRAGMENT_SPREAD:{let i=d.name.value;if(p.has(i)||!aw(a,d))continue;p.add(i);let o=t[i];if(!o||!aE(e,o,r))continue;ab(e,t,a,r,o.selectionSet,n,p)}}}function aw(e,t){let a=ay(e5,t,e);if((null==a?void 0:a.if)===!0)return!1;let r=ay(e9,t,e);return(null==r?void 0:r.if)!==!1}function aE(e,t,a){let r=t.typeCondition;if(!r)return!0;let i=tR(e,r);return i===a||!!eu(i)&&e.isSubType(i,a)}function aT(e){return{OperationDefinition(t){if("subscription"===t.operation){let a=e.getSchema(),r=a.getSubscriptionType();if(r){let i=t.name?t.name.value:null,n=Object.create(null),p=e.getDocument(),o=Object.create(null);for(let e of p.definitions)e.kind===V.b.FRAGMENT_DEFINITION&&(o[e.name.value]=e);let d=a_(a,o,n,r,t.selectionSet);if(d.size>1){let t=[...d.values()].slice(1).flat();e.reportError(new y.eO(null!=i?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(let t of d.values())t[0].name.value.startsWith("__")&&e.reportError(new y.eO(null!=i?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:t}))}}}}}function aN(e,t){let a=new Map;for(let r of e){let e=t(r),i=a.get(e);void 0===i?a.set(e,[r]):i.push(r)}return a}function aS(e){return{DirectiveDefinition(e){var t;let r=null!=(t=e.arguments)?t:[];return a(`@${e.name.value}`,r)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){var t,r;let i=e.name.value;for(let n of null!=(t=e.fields)?t:[]){let e=n.name.value;a(`${i}.${e}`,null!=(r=n.arguments)?r:[])}return!1}function a(t,a){for(let[r,i]of aN(a,e=>e.name.value))i.length>1&&e.reportError(new y.eO(`Argument "${t}(${r}:)" can only be defined once.`,{nodes:i.map(e=>e.name)}));return!1}}function aO(e){return{Field:t,Directive:t};function t(t){var a;for(let[r,i]of aN(null!=(a=t.arguments)?a:[],e=>e.name.value))i.length>1&&e.reportError(new y.eO(`There can be only one argument named "${r}".`,{nodes:i.map(e=>e.name)}))}}function aD(e){let t=Object.create(null),a=e.getSchema();return{DirectiveDefinition(r){let i=r.name.value;return null!=a&&a.getDirective(i)?void e.reportError(new y.eO(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name})):(t[i]?e.reportError(new y.eO(`There can be only one directive named "@${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1)}}}function aI(e){let t=Object.create(null),a=e.getSchema();for(let e of a?a.getDirectives():ta)t[e.name]=!e.isRepeatable;for(let a of e.getDocument().definitions)a.kind===V.b.DIRECTIVE_DEFINITION&&(t[a.name.value]=!a.repeatable);let r=Object.create(null),i=Object.create(null);return{enter(a){let n;if("directives"in a&&a.directives){if(a.kind===V.b.SCHEMA_DEFINITION||a.kind===V.b.SCHEMA_EXTENSION)n=r;else if((0,tL.a6)(a)||(0,tL.i7)(a)){let e=a.name.value;void 0===(n=i[e])&&(i[e]=n=Object.create(null))}else n=Object.create(null);for(let r of a.directives){let a=r.name.value;t[a]&&(n[a]?e.reportError(new y.eO(`The directive "@${a}" can only be used once at this location.`,{nodes:[n[a],r]})):n[a]=r)}}}}}function aA(e){let t=e.getSchema(),a=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){var i;let n=t.name.value;r[n]||(r[n]=Object.create(null));let p=null!=(i=t.values)?i:[],o=r[n];for(let t of p){let r=t.name.value,i=a[n];W(i)&&i.getValue(r)?e.reportError(new y.eO(`Enum value "${n}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):o[r]?e.reportError(new y.eO(`Enum value "${n}.${r}" can only be defined once.`,{nodes:[o[r],t.name]})):o[r]=t.name}return!1}}function ak(e){let t=e.getSchema(),a=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(t){var i,n,p;let o=t.name.value;r[o]||(r[o]=Object.create(null));let d=null!=(i=t.fields)?i:[],s=r[o];for(let t of d){let r=t.name.value;(n=a[o],p=r,(q(n)||Y(n)||J(n))&&null!=n.getFields()[p])?e.reportError(new y.eO(`Field "${o}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):s[r]?e.reportError(new y.eO(`Field "${o}.${r}" can only be defined once.`,{nodes:[s[r],t.name]})):s[r]=t.name}return!1}}function ax(e){let t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(a){let r=a.name.value;return t[r]?e.reportError(new y.eO(`There can be only one fragment named "${r}".`,{nodes:[t[r],a.name]})):t[r]=a.name,!1}}}function aC(e){let t=[],a=Object.create(null);return{ObjectValue:{enter(){t.push(a),a=Object.create(null)},leave(){let e=t.pop();e||(0,ti.V)(!1),a=e}},ObjectField(t){let r=t.name.value;a[r]?e.reportError(new y.eO(`There can be only one input field named "${r}".`,{nodes:[a[r],t.name]})):a[r]=t.name}}}function aV(e){let t=Object.create(null);return{OperationDefinition(a){let r=a.name;return r&&(t[r.value]?e.reportError(new y.eO(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),!1},FragmentDefinition:()=>!1}}function aR(e){let t=e.getSchema(),a=Object.create(null),r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){var i;for(let n of null!=(i=t.operationTypes)?i:[]){let t=n.operation,i=a[t];r[t]?e.reportError(new y.eO(`Type for ${t} already defined in the schema. It cannot be redefined.`,{nodes:n})):i?e.reportError(new y.eO(`There can be only one ${t} type in schema.`,{nodes:[i,n]})):a[t]=n}return!1}}function aF(e){let t=Object.create(null),a=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){let i=r.name.value;return null!=a&&a.getType(i)?void e.reportError(new y.eO(`Type "${i}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name})):(t[i]?e.reportError(new y.eO(`There can be only one type named "${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1)}}function aP(e){return{OperationDefinition(t){var a;for(let[r,i]of aN(null!=(a=t.variableDefinitions)?a:[],e=>e.variable.name.value))i.length>1&&e.reportError(new y.eO(`There can be only one variable named "$${r}".`,{nodes:i.map(e=>e.variable.name)}))}}}function aj(e){let t={};return{OperationDefinition:{enter(){t={}}},VariableDefinition(e){t[e.variable.name.value]=e},ListValue(t){if(!X(e_(e.getParentInputType())))return aL(e,t),!1},ObjectValue(t){let a=eE(e.getInputType());if(!J(a))return aL(e,t),!1;let r=T(t.fields,e=>e.name.value);for(let i of Object.values(a.getFields()))if(!r[i.name]&&eB(i)){let r=(0,v.N)(i.type);e.reportError(new y.eO(`Field "${a.name}.${i.name}" of required type "${r}" was not provided.`,{nodes:t}))}a.isOneOf&&function(e,t,a,r){var i;let n=Object.keys(r);if(1!==n.length)return e.reportError(new y.eO(`OneOf Input Object "${a.name}" must specify exactly one key.`,{nodes:[t]}));let p=null==(i=r[n[0]])?void 0:i.value;p&&p.kind!==V.b.NULL||e.reportError(new y.eO(`Field "${a.name}.${n[0]}" must be non-null.`,{nodes:[t]}))}(e,t,a,r)},ObjectField(t){let a=eE(e.getParentInputType());if(!e.getInputType()&&J(a)){let r=A(t.name.value,Object.keys(a.getFields()));e.reportError(new y.eO(`Field "${t.name.value}" is not defined by type "${a.name}".`+_(r),{nodes:t}))}},NullValue(t){let a=e.getInputType();et(a)&&e.reportError(new y.eO(`Expected value of type "${(0,v.N)(a)}", found ${(0,R.y)(t)}.`,{nodes:t}))},EnumValue:t=>aL(e,t),IntValue:t=>aL(e,t),FloatValue:t=>aL(e,t),StringValue:t=>aL(e,t),BooleanValue:t=>aL(e,t)}}function aL(e,t){let a=e.getInputType();if(!a)return;let r=eE(a);if(!eo(r)){let r=(0,v.N)(a);e.reportError(new y.eO(`Expected value of type "${r}", found ${(0,R.y)(t)}.`,{nodes:t}));return}try{let i=r.parseLiteral(t,void 0);if(void 0===i){let r=(0,v.N)(a);e.reportError(new y.eO(`Expected value of type "${r}", found ${(0,R.y)(t)}.`,{nodes:t}))}}catch(i){let r=(0,v.N)(a);i instanceof y.eO?e.reportError(i):e.reportError(new y.eO(`Expected value of type "${r}", found ${(0,R.y)(t)}; `+i.message,{nodes:t,originalError:i}))}}function a$(e){return{VariableDefinition(t){let a=tR(e.getSchema(),t.type);if(void 0!==a&&!er(a)){let a=t.variable.name.value,r=(0,R.y)(t.type);e.reportError(new y.eO(`Variable "$${a}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}}function aM(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(a){for(let{node:d,type:s,defaultValue:l,parentType:u}of e.getRecursiveVariableUsages(a)){let a=d.name.value,c=t[a];if(c&&s){var r,i,n,p,o;let t=e.getSchema(),m=tR(t,c.type);if(m&&(r=t,i=m,n=c.defaultValue,p=s,o=l,et(p)&&!et(i)?!((null!=n&&n.kind!==V.b.NULL||void 0!==o)&&eQ(r,i,p.ofType)):!eQ(r,i,p))){let t=(0,v.N)(m),r=(0,v.N)(s);e.reportError(new y.eO(`Variable "$${a}" of type "${t}" used in position expecting type "${r}".`,{nodes:[c,d]}))}J(u)&&u.isOneOf&&ey(m)&&e.reportError(new y.eO(`Variable "$${a}" is of type "${m}" but must be non-nullable to be used for OneOf Input Object "${u}".`,{nodes:[c,d]}))}}}},VariableDefinition(e){t[e.variable.name.value]=e}}}let aU=Object.freeze([tK]),aB=Object.freeze([t$,aV,tH,aT,tG,tU,a$,ao,tM,ax,tY,tX,at,tJ,aP,tZ,t1,tQ,aI,tB,aO,aj,ai,aM,t2,aC,...aU]),aq=Object.freeze([tW,aR,aF,aA,ak,aS,aD,tG,tQ,aI,aa,tq,aO,aC,an]);class aQ{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{for(let e of(t=Object.create(null),this.getDocument().definitions))e.kind===V.b.FRAGMENT_DEFINITION&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){let a;t=[];let r=[e];for(;a=r.pop();)for(let e of a.selections)e.kind===V.b.FRAGMENT_SPREAD?t.push(e):e.selectionSet&&r.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){let a;t=[];let r=Object.create(null),i=[e.selectionSet];for(;a=i.pop();)for(let e of this.getFragmentSpreads(a)){let a=e.name.value;if(!0!==r[a]){r[a]=!0;let e=this.getFragment(a);e&&(t.push(e),i.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}class aY extends aQ{constructor(e,t,a){super(e,a),this._schema=t}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class aG extends aQ{constructor(e,t,a,r){super(t,r),this._schema=e,this._typeInfo=a,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){let a=[],r=new tF(this._schema);(0,tV.YR)(e,tj(r,{VariableDefinition:()=>!1,Variable(e){a.push({node:e,type:r.getInputType(),defaultValue:r.getDefaultValue(),parentType:r.getParentInputType()})}})),t=a,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){for(let a of(t=this.getVariableUsages(e),this.getRecursivelyReferencedFragments(e)))t=t.concat(this.getVariableUsages(a));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}function az(e,t,a=aB,r,i=new tF(e)){var n;let p=null!=(n=null==r?void 0:r.maxErrors)?n:100;t||(0,m.U)(!1,"Must provide document."),tO(e);let o=Object.freeze({}),d=[],s=new aG(e,t,i,e=>{if(d.length>=p)throw d.push(new y.eO("Too many validation errors, error limit reached. Validation aborted.")),o;d.push(e)}),l=(0,tV.oP)(a.map(e=>e(s)));try{(0,tV.YR)(t,tj(i,l))}catch(e){if(e!==o)throw e}return d}function aH(e,t,a=aq){let r=[],i=new aY(e,t,e=>{r.push(e)}),n=a.map(e=>e(i));return(0,tV.YR)(e,(0,tV.oP)(n)),r}function aW(e){return Promise.all(Object.values(e)).then(t=>{let a=Object.create(null);for(let[r,i]of Object.keys(e).entries())a[i]=t[r];return a})}class aK extends Error{constructor(e){super("Unexpected error value: "+(0,v.N)(e)),this.name="NonErrorThrown",this.thrownValue=e}}function aJ(e,t,a){var r;let i=e instanceof Error?e:new aK(e);return Array.isArray(i.path)?i:new y.eO(i.message,{nodes:null!=(r=i.nodes)?r:t,source:i.source,positions:i.positions,path:a,originalError:i})}let aZ=(o=(e,t,a)=>(function(e,t,a,r,i){let n=new Map,p=new Set;for(let o of i)o.selectionSet&&ab(e,t,a,r,o.selectionSet,n,p);return n})(e.schema,e.fragments,e.variableValues,t,a),function(e,t,a){void 0===r&&(r=new WeakMap);let i=r.get(e);void 0===i&&(i=new WeakMap,r.set(e,i));let n=i.get(t);void 0===n&&(n=new WeakMap,i.set(t,n));let p=n.get(a);return void 0===p&&(p=o(e,t,a),n.set(a,p)),p});function aX(e){arguments.length<2||(0,m.U)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:t,document:a,variableValues:r,rootValue:i}=e;a2(t,a,r);let n=a6(e);if(!("schema"in n))return{errors:n};try{let{operation:e}=n,t=function(e,t,a){let r=e.schema.getRootType(t.operation);if(null==r)throw new y.eO(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});let i=a_(e.schema,e.fragments,e.variableValues,r,t.selectionSet),n;switch(t.operation){case g.cE.QUERY:return a4(e,r,a,n,i);case g.cE.MUTATION:var p,o,d,s,l;return p=e,o=r,d=a,s=n,l=i,function(e,t,a){let r=a;for(let a of e)r=f(r)?r.then(e=>t(e,a)):t(r,a);return r}(l.entries(),(e,[t,a])=>{let r=as(s,t,o.name),i=a3(p,o,d,a,r);return void 0===i?e:f(i)?i.then(a=>(e[t]=a,e)):(e[t]=i,e)},Object.create(null));case g.cE.SUBSCRIPTION:return a4(e,r,a,n,i)}}(n,e,i);if(f(t))return t.then(e=>a0(e,n.errors),e=>(n.errors.push(e),a0(null,n.errors)));return a0(t,n.errors)}catch(e){return n.errors.push(e),a0(null,n.errors)}}function a1(e){let t=aX(e);if(f(t))throw Error("GraphQL execution failed to complete synchronously.");return t}function a0(e,t){return 0===t.length?{data:e}:{errors:t,data:e}}function a2(e,t,a){t||(0,m.U)(!1,"Must provide document."),tO(e),null==a||(0,E.Z)(a)||(0,m.U)(!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 a6(e){var t,a,r;let i,{schema:n,document:p,rootValue:o,contextValue:d,variableValues:s,operationName:l,fieldResolver:u,typeResolver:c,subscribeFieldResolver:m,options:f}=e,h=Object.create(null);for(let e of p.definitions)switch(e.kind){case V.b.OPERATION_DEFINITION:if(null==l){if(void 0!==i)return[new y.eO("Must provide operation name if query contains multiple operations.")];i=e}else(null==(t=e.name)?void 0:t.value)===l&&(i=e);break;case V.b.FRAGMENT_DEFINITION:h[e.name.value]=e}if(!i)return null!=l?[new y.eO(`Unknown operation named "${l}".`)]:[new y.eO("Must provide an operation.")];let v=ah(n,null!=(a=i.variableDefinitions)?a:[],null!=s?s:{},{maxErrors:null!=(r=null==f?void 0:f.maxCoercionErrors)?r:50});return v.errors?v.errors:{schema:n,fragments:h,rootValue:o,contextValue:d,operation:i,variableValues:v.coerced,fieldResolver:null!=u?u:rr,typeResolver:null!=c?c:ra,subscribeFieldResolver:null!=m?m:rr,errors:[]}}function a4(e,t,a,r,i){let n=Object.create(null),p=!1;try{for(let[o,d]of i.entries()){let i=as(r,o,t.name),s=a3(e,t,a,d,i);void 0!==s&&(n[o]=s,f(s)&&(p=!0))}}catch(e){if(p)return aW(n).finally(()=>{throw e});throw e}return p?aW(n):n}function a3(e,t,a,r,i){var n;let p=ri(e.schema,t,r[0]);if(!p)return;let o=p.type,d=null!=(n=p.resolve)?n:e.fieldResolver,s=a9(e,p,r,t,i);try{let t,n=av(p,r[0],e.variableValues),l=e.contextValue,u=d(a,n,l,s);if(t=f(u)?u.then(t=>a8(e,o,r,s,i,t)):a8(e,o,r,s,i,u),f(t))return t.then(void 0,t=>{let a=aJ(t,r,al(i));return a5(a,o,e)});return t}catch(t){return a5(aJ(t,r,al(i)),o,e)}}function a9(e,t,a,r,i){return{fieldName:t.name,fieldNodes:a,returnType:t.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function a5(e,t,a){if(et(t))throw e;return a.errors.push(e),null}function a8(e,t,a,r,i,n){var p,o,d,s,l,u,c;let m;if(n instanceof Error)throw n;if(et(t)){let p=a8(e,t.ofType,a,r,i,n);if(null===p)throw Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return p}return null==n?null:X(t)?function(e,t,a,r,i,n){if(!tn(n))throw new y.eO(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);let p=t.ofType,o=!1,d=Array.from(n,(t,n)=>{let d=as(i,n,void 0);try{let i;if(i=f(t)?t.then(t=>a8(e,p,a,r,d,t)):a8(e,p,a,r,d,t),f(i))return o=!0,i.then(void 0,t=>{let r=aJ(t,a,al(d));return a5(r,p,e)});return i}catch(t){return a5(aJ(t,a,al(d)),p,e)}});return o?Promise.all(d):d}(e,t,a,r,i,n):eo(t)?function(e,t){let a=e.serialize(t);if(null==a)throw Error(`Expected \`${(0,v.N)(e)}.serialize(${(0,v.N)(t)})\` to return non-nullable value, returned: ${(0,v.N)(a)}`);return a}(t,n):eu(t)?(p=e,o=t,d=a,s=r,l=i,u=n,f(m=(null!=(c=o.resolveType)?c:p.typeResolver)(u,p.contextValue,s,o))?m.then(e=>re(p,a7(e,p,o,d,s,u),d,s,l,u)):re(p,a7(m,p,o,d,s,u),d,s,l,u)):q(t)?re(e,t,a,r,i,n):void(0,ti.V)(!1,"Cannot complete value of unexpected output type: "+(0,v.N)(t))}function a7(e,t,a,r,i,n){if(null==e)throw new y.eO(`Abstract type "${a.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${a.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if(q(e))throw new y.eO("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if("string"!=typeof e)throw new y.eO(`Abstract type "${a.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${(0,v.N)(n)}, received "${(0,v.N)(e)}".`);let p=t.schema.getType(e);if(null==p)throw new y.eO(`Abstract type "${a.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!q(p))throw new y.eO(`Abstract type "${a.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(!t.schema.isSubType(a,p))throw new y.eO(`Runtime Object type "${p.name}" is not a possible type for "${a.name}".`,{nodes:r});return p}function re(e,t,a,r,i,n){let p=aZ(e,t,a);if(t.isTypeOf){let o=t.isTypeOf(n,e.contextValue,r);if(f(o))return o.then(r=>{if(!r)throw rt(t,n,a);return a4(e,t,n,i,p)});if(!o)throw rt(t,n,a)}return a4(e,t,n,i,p)}function rt(e,t,a){return new y.eO(`Expected value of type "${e.name}" but got: ${(0,v.N)(t)}.`,{nodes:a})}let ra=function(e,t,a,r){if((0,E.Z)(e)&&"string"==typeof e.__typename)return e.__typename;let i=a.schema.getPossibleTypes(r),n=[];for(let r=0;r<i.length;r++){let p=i[r];if(p.isTypeOf){let i=p.isTypeOf(e,t,a);if(f(i))n[r]=i;else if(i)return n.length&&Promise.allSettled(n).catch(()=>{}),p.name}}if(n.length)return Promise.all(n).then(e=>{for(let t=0;t<e.length;t++)if(e[t])return i[t].name})},rr=function(e,t,a,r){if((0,E.Z)(e)||"function"==typeof e){let i=e[r.fieldName];return"function"==typeof i?e[r.fieldName](t,a,r):i}};function ri(e,t,a){let r=a.name.value;return r===tv.name&&e.getQueryType()===t?tv:r===ty.name&&e.getQueryType()===t?ty:r===tg.name?tg:t.getFields()[r]}function rn(e){return new Promise(t=>t(ro(e)))}function rp(e){let t=ro(e);if(f(t))throw Error("GraphQL execution failed to complete synchronously.");return t}function ro(e){let t;arguments.length<2||(0,m.U)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:a,source:r,rootValue:i,contextValue:n,variableValues:p,operationName:o,fieldResolver:d,typeResolver:s}=e,l=tS(a);if(l.length>0)return{errors:l};try{t=(0,h.qg)(r)}catch(e){return{errors:[e]}}let u=az(a,t);return u.length>0?{errors:u}:aX({schema:a,document:t,rootValue:i,contextValue:n,variableValues:p,operationName:o,fieldResolver:d,typeResolver:s})}var rd=a(39537),rs=a(73971),rl=a(8238),ru=a(98472),rc=a(12039);function rm(e){return"function"==typeof(null==e?void 0:e[Symbol.asyncIterator])}async function rf(e){arguments.length<2||(0,m.U)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let t=await rh(e);if(!rm(t))return t;let a=t[Symbol.asyncIterator]();async function r(t){if(t.done)return t;try{let a;return{value:await (a=t.value,aX({...e,rootValue:a})),done:!1}}catch(e){if("function"==typeof a.return)try{await a.return()}catch(e){}throw e}}return{next:async()=>r(await a.next()),return:async()=>"function"==typeof a.return?r(await a.return()):{value:void 0,done:!0},async throw(e){if("function"==typeof a.throw)return r(await a.throw(e));throw e},[Symbol.asyncIterator](){return this}}}async function rh(...e){let t,a=(t=e[0])&&"document"in t?t:{schema:t,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]},{schema:r,document:i,variableValues:n}=a;a2(r,i,n);let p=a6(a);if(!("schema"in p))return{errors:p};try{let e=await rv(p);if(!rm(e))throw Error(`Subscription field must return Async Iterable. Received: ${(0,v.N)(e)}.`);return e}catch(e){if(e instanceof y.eO)return{errors:[e]};throw e}}async function rv(e){let{schema:t,fragments:a,operation:r,variableValues:i,rootValue:n}=e,p=t.getSubscriptionType();if(null==p)throw new y.eO("Schema is not configured to execute subscription operation.",{nodes:r});let[o,d]=[...a_(t,a,i,p,r.selectionSet).entries()][0],s=ri(t,p,d[0]);if(!s){let e=d[0].name.value;throw new y.eO(`The subscription field "${e}" is not defined.`,{nodes:d})}let l=as(void 0,o,p.name),u=a9(e,s,d,p,l);try{var c;let t=av(s,d[0],i),a=e.contextValue,r=null!=(c=s.subscribe)?c:e.subscribeFieldResolver,p=await r(n,t,a,u);if(p instanceof Error)throw p;return p}catch(e){throw aJ(e,d,al(l))}}function ry(e){return{Field(t){let a=e.getFieldDef(),r=null==a?void 0:a.deprecationReason;if(a&&null!=r){let i=e.getParentType();null!=i||(0,ti.V)(!1),e.reportError(new y.eO(`The field ${i.name}.${a.name} is deprecated. ${r}`,{nodes:t}))}},Argument(t){let a=e.getArgument(),r=null==a?void 0:a.deprecationReason;if(a&&null!=r){let i=e.getDirective();if(null!=i)e.reportError(new y.eO(`Directive "@${i.name}" argument "${a.name}" is deprecated. ${r}`,{nodes:t}));else{let i=e.getParentType(),n=e.getFieldDef();null!=i&&null!=n||(0,ti.V)(!1),e.reportError(new y.eO(`Field "${i.name}.${n.name}" argument "${a.name}" is deprecated. ${r}`,{nodes:t}))}}},ObjectField(t){let a=eE(e.getParentInputType());if(J(a)){let r=a.getFields()[t.name.value],i=null==r?void 0:r.deprecationReason;null!=i&&e.reportError(new y.eO(`The input field ${a.name}.${r.name} is deprecated. ${i}`,{nodes:t}))}},EnumValue(t){let a=e.getEnumValue(),r=null==a?void 0:a.deprecationReason;if(a&&null!=r){let i=eE(e.getInputType());null!=i||(0,ti.V)(!1),e.reportError(new y.eO(`The enum value "${i.name}.${a.name}" is deprecated. ${r}`,{nodes:t}))}}}}function rg(e){return{Field(t){let a=eE(e.getType());a&&tb(a)&&e.reportError(new y.eO(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}}var r_=a(59841);function rb(e){let t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,oneOf:!1,...e},a=t.descriptions?"description":"",r=t.specifiedByUrl?"specifiedByURL":"",i=t.directiveIsRepeatable?"isRepeatable":"",n=t.schemaDescription?a:"";function p(e){return t.inputValueDeprecation?e:""}let o=t.oneOf?"isOneOf":"";return`
|
|
1041
1043
|
query IntrospectionQuery {
|
|
1042
1044
|
__schema {
|
|
1043
1045
|
${n}
|