@banou/ftube 0.0.0-stage → 0.0.0

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.
Files changed (91) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -2
  3. package/__yt_engine__/engine.html +9 -0
  4. package/app.webmanifest +31 -0
  5. package/assets/account-BL8Hv7lS.js +157 -0
  6. package/assets/account-By94iboj.js +1 -0
  7. package/assets/account-DfiXzypA-YE6OyKjK.js +1 -0
  8. package/assets/account-generation-BP_-Qyck-BOth6YQ_.js +1 -0
  9. package/assets/agent-source-E4g0cDzU.js +1 -0
  10. package/assets/api-1NDCtwel-CAaxX8P1.js +3 -0
  11. package/assets/binary-encoding-By5K7InN.js +1 -0
  12. package/assets/build-CNn3bm6X.js +1 -0
  13. package/assets/busy-C1JPjoZ_-CJ0641jK.js +1 -0
  14. package/assets/cards-Csel8naI.js +2334 -0
  15. package/assets/channel-B5f9YTIf.js +1160 -0
  16. package/assets/client-version-D9kIz6Gz.js +1 -0
  17. package/assets/comments-CJp9O808.js +612 -0
  18. package/assets/dislikes-DH5jCVEY.js +1 -0
  19. package/assets/dist-7VpLCl1k.js +1 -0
  20. package/assets/dist-BOrL1gYg.js +2 -0
  21. package/assets/downloads-CMXDjA_E.js +191 -0
  22. package/assets/egress.worker-DopXr5uP.js +104 -0
  23. package/assets/engine-B_kFyW7L.js +2 -0
  24. package/assets/feed-channels-Dg2mvF5x.js +251 -0
  25. package/assets/feed-groups-CnyR4sOO.js +160 -0
  26. package/assets/feed-history-BDAGG9N5.js +368 -0
  27. package/assets/feed-playlists-DcGR2AL6.js +167 -0
  28. package/assets/feed-subscriptions-Sm3tKz4P.js +165 -0
  29. package/assets/feed-you-lxbqknXX.js +110 -0
  30. package/assets/formats-CDwXfKnr.js +1 -0
  31. package/assets/frame-BrGNSf3s.js +2 -0
  32. package/assets/fs-CjRTQ7Nu.js +1 -0
  33. package/assets/fs-CwRtKje1-CBsYhX2-.js +1 -0
  34. package/assets/fullscreen-view-BLgosU84.js +269 -0
  35. package/assets/group-C00s0aT7.js +183 -0
  36. package/assets/groups-button-CvVnqwlu.js +25 -0
  37. package/assets/hashtag-CCIhITaL.js +115 -0
  38. package/assets/icons-DKsqNLSs.js +1 -0
  39. package/assets/index-A5dHbptn.css +1 -0
  40. package/assets/index-DwsYJ-bu.js +1328 -0
  41. package/assets/lib-h0P14ZFl.js +70 -0
  42. package/assets/linkify-B6hdFhsL.js +1 -0
  43. package/assets/packages-C3w3tSjj-BCtDk0vj.js +1 -0
  44. package/assets/party-CUcxsJDF.js +180 -0
  45. package/assets/playlist-DF7wsidw.js +521 -0
  46. package/assets/playlist-card-Btoc7D8f.js +91 -0
  47. package/assets/playlist-panel-D97BwT1f.js +199 -0
  48. package/assets/post-CQ9mfVos.js +39 -0
  49. package/assets/post-card-ZUQixO1G.js +76 -0
  50. package/assets/privacy-hkbqXFeB.js +46 -0
  51. package/assets/protobuf-BXZ2dCCc.js +1 -0
  52. package/assets/read-more-BhddUSlS.js +20 -0
  53. package/assets/rich-text-07paR5O3.js +25 -0
  54. package/assets/roboto-cyrillic-ext-BCp_3N7R.woff2 +0 -0
  55. package/assets/roboto-cyrillic-fOt7epNf.woff2 +0 -0
  56. package/assets/roboto-greek-DlT9XTxE.woff2 +0 -0
  57. package/assets/roboto-greek-ext-Bgw4czJT.woff2 +0 -0
  58. package/assets/roboto-latin-ccAYIvAh.woff2 +0 -0
  59. package/assets/roboto-latin-ext-DYIxWhlt.woff2 +0 -0
  60. package/assets/roboto-math-4a3xuzGk.woff2 +0 -0
  61. package/assets/roboto-symbols-B7iHSfaG.woff2 +0 -0
  62. package/assets/roboto-vietnamese-_f1XEJpo.woff2 +0 -0
  63. package/assets/rooms-B-AvBY-c-FNDqRDHE.js +1 -0
  64. package/assets/rooms-B91zuirR.js +1 -0
  65. package/assets/save-menu-DF1WKqSE.js +462 -0
  66. package/assets/search-Cx5IpDtZ.js +1026 -0
  67. package/assets/settings-kESE_uBm.js +99 -0
  68. package/assets/shaka-BwT9pJcV.js +36 -0
  69. package/assets/share-dialog-Cp0BJ6bg.js +156 -0
  70. package/assets/shorts-BxDB7m0c.js +686 -0
  71. package/assets/shorts-grid-Bgbkl5dP.js +11 -0
  72. package/assets/sign-in-Bx3zmj-m.js +97 -0
  73. package/assets/signed-out-prompt-CEAx65kq.js +79 -0
  74. package/assets/signin-DkI8Ogzz.js +18 -0
  75. package/assets/social-bXt3vmd4.js +1 -0
  76. package/assets/video-card-compact-r-K4XyDb.js +190 -0
  77. package/assets/watch-CkxSP1IA.js +1802 -0
  78. package/assets/web-BNanCsH5.js +43 -0
  79. package/favicon.ico +0 -0
  80. package/favicon.svg +5 -0
  81. package/icons/icon-192.png +0 -0
  82. package/icons/icon-512.png +0 -0
  83. package/index-Bj-Q3X8Q.js +4120 -0
  84. package/index.html +32 -0
  85. package/package.json +45 -4
  86. package/store/background.webp +0 -0
  87. package/store/channel.webp +0 -0
  88. package/store/cover.webp +0 -0
  89. package/store/phone.webp +0 -0
  90. package/store/search.webp +0 -0
  91. package/store/watch.webp +0 -0
@@ -0,0 +1,1328 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));const l={red:`\x1B[31m`,yellow:`\x1B[33m`,magenta:`\x1B[35m`,cyan:`\x1B[36m`,reset:`\x1B[0m`},u=l.yellow+`WARN`+l.reset,d=l.cyan+`INFO`+l.reset,f=l.red+`ERR`+l.reset,p=l.magenta+`DEBUG`+l.reset,m={debug:0,info:1,warn:2,error:3,silent:4},h=()=>{},g=e=>(...t)=>console.log(e,...t),ee=console.debug?(...e)=>console.debug(p,...e):g(p),te=console.info?(...e)=>console.info(d,...e):g(d),_=console.warn?(...e)=>console.warn(u,...e):g(u),ne=console.error?(...e)=>console.error(f,...e):g(f),re=(e={}.DEBUG===`1`?`debug`:`info`)=>{let t=m[e];return{debug:t>m.debug?h:ee,info:t>m.info?h:te,warn:t>m.warn?h:_,error:t>m.error?h:ne}},ie=Symbol.for(`@whatwg-node/promise-helpers/FakePromise`);function v(e){return e?.then!=null}function ae(e){let t=e;return t&&t.then&&t.catch&&t.finally}function y(e,t,n,r){let i=b().then(e).then(t,n);return r&&(i=i.finally(r)),pe(i)}function b(e){return e&&ae(e)?e:v(e)?{then:(t,n)=>b(e.then(t,n)),catch:t=>b(e.then(e=>e,t)),finally:t=>b(t?fe(e,t):e),[Symbol.toStringTag]:`Promise`}:{then(t){if(t)try{return b(t(e))}catch(e){return se(e)}return this},catch(){return this},finally(t){if(t)try{return b(t()).then(()=>e,()=>e)}catch(e){return se(e)}return this},[Symbol.toStringTag]:`Promise`,__fakePromiseValue:e,[ie]:`resolved`}}function oe(){if(Promise.withResolvers)return Promise.withResolvers();let e,t;return{promise:new Promise(function(n,r){e=n,t=r}),get resolve(){return e},get reject(){return t}}}function x(e,t,n){if(e?.length===0)return;let r=e[Symbol.iterator](),i=0;function a(){let{done:e,value:o}=r.next();if(e)return;let s=!1;function c(){s=!0}return y(function(){return t(o,c,i++)},function(e){if(e&&n?.push(e),!s)return a()})}return a()}function se(e){return{then(t,n){if(n)try{return b(n(e))}catch(e){return se(e)}return this},catch(t){if(t)try{return b(t(e))}catch(e){return se(e)}return this},finally(e){if(e)try{e()}catch(e){return se(e)}return this},__fakeRejectError:e,[Symbol.toStringTag]:`Promise`,[ie]:`rejected`}}function ce(e,t,n,r){Symbol.asyncIterator in e&&(e=e[Symbol.asyncIterator]());let i,a,o;if(r){let e;o=t=>(e||=y(r,()=>t,()=>t),e)}typeof e.return==`function`&&(i=e.return,a=t=>{let n=()=>{throw t};return i.call(e).then(n,n)});function s(e){return e.done?o?o(e):e:y(()=>e.value,e=>y(()=>t(e),le,a))}let c;if(n){let e,t=n;c=n=>(e||=y(()=>n,e=>y(()=>t(e),le,a)),e)}return{next(){return e.next().then(s,c)},return(){let t=i?i.call(e).then(s,c):b({value:void 0,done:!0});return o?t.then(o):t},throw(t){return typeof e.throw==`function`?e.throw(t).then(s,c):a?a(t):se(t)},[Symbol.asyncIterator](){return this}}}function le(e){return{value:e,done:!1}}function ue(e){return e?.[ie]===`resolved`}function de(e){return e?.[ie]===`rejected`}function fe(e,t){return`finally`in e?e.finally(t):e.then(e=>{let n=t();return v(n)?n.then(()=>e):e},e=>{let n=t();if(v(n))return n.then(()=>{throw e});throw e})}function pe(e){if(ue(e))return e.__fakePromiseValue;if(de(e))throw e.__fakeRejectError;return e}var me=`<!doctype html><html lang=en><head><meta charset=utf-8><title>__TITLE__</title><link rel=icon href=https://raw.githubusercontent.com/graphql-hive/graphql-yoga/refs/heads/main/website/src/app/favicon.ico><link crossorigin rel=stylesheet href=https://unpkg.com/@graphql-yoga/graphiql@4.4.4/dist/graphiql.css></head><body id=body class=no-focus-outline><noscript>You need to enable JavaScript to run this app.</noscript><div id=root>Loading __TITLE__...</div><script>function prepareBlob(r){const o=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(o)}const workers={},workerUrls={editorWorkerService:"https://unpkg.com/@graphql-yoga/graphiql@4.4.4/dist/monacoeditorwork/editor.worker.bundle.js",json:"https://unpkg.com/@graphql-yoga/graphiql@4.4.4/dist/monacoeditorwork/json.worker.bundle.js",graphql:"https://unpkg.com/@graphql-yoga/graphiql@4.4.4/dist/monacoeditorwork/graphql.worker..bundle.js"};function prepareWorkers(){return Promise.all(Object.entries(workerUrls).map(async([r,o])=>{const e=await fetch(o),t=await e.text();workers[r]=prepareBlob(t)}))}self.MonacoEnvironment={globalAPI:!1,getWorkerUrl:function(r,o){return workers[o]}}<\/script><script src=https://unpkg.com/@graphql-yoga/graphiql@4.4.4/dist/yoga-graphiql.umd.js><\/script><script>prepareWorkers().finally(()=>{YogaGraphiQL.renderYogaGraphiQL(root,__OPTS__)})<\/script></body></html>`;function he({headers:e,method:t}){return t===`GET`&&!!e?.get(`accept`)?.includes(`text/html`)}const ge=e=>me.replace(`__TITLE__`,e?.title||`Yoga GraphiQL`).replace(`__OPTS__`,JSON.stringify(e??{}));function _e(e){let t=e.logger??console,n;n=typeof e?.options==`function`?e?.options:typeof e?.options==`object`?()=>e?.options:e?.options===!1?()=>!1:()=>({});let r=e?.render??ge;return{onRequest({request:i,serverContext:a,fetchAPI:o,endResponse:s,url:c}){let l=e.getGraphQLEndpoint();if(he(i)&&(i.url.endsWith(l)||i.url.endsWith(`${l}/`)||c.pathname===l||c.pathname===`${l}/`||e.getGraphQLEndpointURLPattern().test(c)))return t.debug(`Rendering GraphiQL`),y(()=>n(i,a),e=>{if(e)return y(()=>r({...e===!0?{}:e}),e=>{s(new o.Response(e,{headers:{"Content-Type":`text/html`},status:200}))})})}}}function ve(e){return e?.[Symbol.toStringTag]===`GraphQLSchema`}const ye=e=>{if(e==null)return{};if(ve(e))return{onPluginInit({setSchema:t}){t(e)}};if(`then`in e){let t;return{onRequestParse(){return{onRequestParseDone(){if(!t)return y(()=>e,e=>{t=e})}}},onEnveloped({setSchema:e}){if(t==null)throw Error(`You provide a promise of a schema but it hasn't been resolved yet. Make sure you use this plugin with GraphQL Yoga.`);if(!ve(t))throw Error(`The resolved schema is not a valid GraphQLSchema instance.`);e(t)}}}if(typeof e==`function`){let t=/* @__PURE__ */ new WeakMap;return{onRequestParse({request:n,serverContext:r}){return{onRequestParseDone(){return y(()=>e({...r,request:n}),e=>{if(!ve(e))throw Error(`The factory function did not return a valid GraphQLSchema.`);t.set(n,e)})}}},onEnveloped({setSchema:e,context:n}){if(n?.request==null)throw Error(`Request object is not available in the context. Make sure you use this plugin with GraphQL Yoga.`);let r=t.get(n.request);if(r==null)throw Error(`No schema found for this request. Make sure you use this plugin with GraphQL Yoga.`);e(r)}}}throw Error(`Invalid schema definition provided, expected a schema, promise or function.`)},be=Object.freeze({major:16,minor:14,patch:2,preReleaseTag:null});function S(e,t){if(!e)throw Error(t)}function xe(e){return typeof e==`object`&&!!e}function Se(e,t){if(!e)throw Error(t??`Unexpected invariant triggered.`)}const Ce=/\r\n|[\n\r]/g;function we(e,t){let n=0,r=1;for(let i of e.body.matchAll(Ce)){if(typeof i.index==`number`||Se(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function Te(e){return Ee(e.source,we(e.source,e.start))}function Ee(e,t){let n=e.locationOffset.column-1,r=``.padStart(n)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=t.line===1?n:0,c=t.column+s,l=`${e.name}:${o}:${c}\n`,u=r.split(/\r\n|[\n\r]/g),d=u[i];if(d.length>120){let e=Math.floor(c/80),t=c%80,n=[];for(let e=0;e<d.length;e+=80)n.push(d.slice(e,e+80));return l+De([[`${o} |`,n[0]],...n.slice(1,e+1).map(e=>[`|`,e]),[`|`,`^`.padStart(t)],[`|`,n[e+1]]])}return l+De([[`${o-1} |`,u[i-1]],[`${o} |`,d],[`|`,`^`.padStart(c)],[`${o+1} |`,u[i+1]]])}function De(e){let t=e.filter(([e,t])=>t!==void 0),n=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(n)+(t?` `+t:``)).join(`
2
+ `)}function Oe(e){let t=e[0];return t==null||`kind`in t||`length`in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}var C=class e extends Error{constructor(t,...n){let{nodes:r,source:i,positions:a,path:o,originalError:s,extensions:c}=Oe(n);super(t),this.name=`GraphQLError`,this.path=o??void 0,this.originalError=s??void 0,this.nodes=ke(Array.isArray(r)?r:r?[r]:void 0);let l=ke(this.nodes?.map(e=>e.loc).filter(e=>e!=null));this.source=i??l?.[0]?.source,this.positions=a??l?.map(e=>e.start),this.locations=a&&i?a.map(e=>we(i,e)):l?.map(e=>we(e.source,e.start));let u=xe(s?.extensions)?s?.extensions:void 0;
3
+ /* c8 ignore start */
4
+ this.extensions=c??u??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),s!=null&&s.stack?Object.defineProperty(this,"stack",{value:s.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})
5
+ /* c8 ignore stop */
6
+ }get[Symbol.toStringTag](){return`GraphQLError`}toString(){let e=this.message;if(this.nodes)for(let t of this.nodes)t.loc&&(e+=`
7
+
8
+ `+Te(t.loc));else if(this.source&&this.locations)for(let t of this.locations)e+=`
9
+
10
+ `+Ee(this.source,t);return e}toJSON(){let e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}};function ke(e){return e===void 0||e.length===0?void 0:e}function w(e,t,n){return new C(`Syntax Error: ${n}`,{source:e,positions:[t]})}var Ae=class{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return`Location`}toJSON(){return{start:this.start,end:this.end}}},je=class{constructor(e,t,n,r,i,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return`Token`}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}};const Me={Name:[],Document:[`definitions`],OperationDefinition:[`description`,`name`,`variableDefinitions`,`directives`,`selectionSet`],VariableDefinition:[`description`,`variable`,`type`,`defaultValue`,`directives`],Variable:[`name`],SelectionSet:[`selections`],Field:[`alias`,`name`,`arguments`,`directives`,`selectionSet`],Argument:[`name`,`value`],FragmentSpread:[`name`,`directives`],InlineFragment:[`typeCondition`,`directives`,`selectionSet`],FragmentDefinition:[`description`,`name`,`variableDefinitions`,`typeCondition`,`directives`,`selectionSet`],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:[`values`],ObjectValue:[`fields`],ObjectField:[`name`,`value`],Directive:[`name`,`arguments`],NamedType:[`name`],ListType:[`type`],NonNullType:[`type`],SchemaDefinition:[`description`,`directives`,`operationTypes`],OperationTypeDefinition:[`type`],ScalarTypeDefinition:[`description`,`name`,`directives`],ObjectTypeDefinition:[`description`,`name`,`interfaces`,`directives`,`fields`],FieldDefinition:[`description`,`name`,`arguments`,`type`,`directives`],InputValueDefinition:[`description`,`name`,`type`,`defaultValue`,`directives`],InterfaceTypeDefinition:[`description`,`name`,`interfaces`,`directives`,`fields`],UnionTypeDefinition:[`description`,`name`,`directives`,`types`],EnumTypeDefinition:[`description`,`name`,`directives`,`values`],EnumValueDefinition:[`description`,`name`,`directives`],InputObjectTypeDefinition:[`description`,`name`,`directives`,`fields`],DirectiveDefinition:[`description`,`name`,`arguments`,`directives`,`locations`],SchemaExtension:[`directives`,`operationTypes`],DirectiveExtension:[`name`,`directives`],ScalarTypeExtension:[`name`,`directives`],ObjectTypeExtension:[`name`,`interfaces`,`directives`,`fields`],InterfaceTypeExtension:[`name`,`interfaces`,`directives`,`fields`],UnionTypeExtension:[`name`,`directives`,`types`],EnumTypeExtension:[`name`,`directives`,`values`],InputObjectTypeExtension:[`name`,`directives`,`fields`],TypeCoordinate:[`name`],MemberCoordinate:[`name`,`memberName`],ArgumentCoordinate:[`name`,`fieldName`,`argumentName`],DirectiveCoordinate:[`name`],DirectiveArgumentCoordinate:[`name`,`argumentName`]},Ne=new Set(Object.keys(Me));function Pe(e){let t=e?.kind;return typeof t==`string`&&Ne.has(t)}var Fe;(function(e){e.QUERY=`query`,e.MUTATION=`mutation`,e.SUBSCRIPTION=`subscription`})(Fe||={});var T;(function(e){e.QUERY=`QUERY`,e.MUTATION=`MUTATION`,e.SUBSCRIPTION=`SUBSCRIPTION`,e.FIELD=`FIELD`,e.FRAGMENT_DEFINITION=`FRAGMENT_DEFINITION`,e.FRAGMENT_SPREAD=`FRAGMENT_SPREAD`,e.INLINE_FRAGMENT=`INLINE_FRAGMENT`,e.VARIABLE_DEFINITION=`VARIABLE_DEFINITION`,e.SCHEMA=`SCHEMA`,e.SCALAR=`SCALAR`,e.OBJECT=`OBJECT`,e.FIELD_DEFINITION=`FIELD_DEFINITION`,e.ARGUMENT_DEFINITION=`ARGUMENT_DEFINITION`,e.INTERFACE=`INTERFACE`,e.UNION=`UNION`,e.ENUM=`ENUM`,e.ENUM_VALUE=`ENUM_VALUE`,e.INPUT_OBJECT=`INPUT_OBJECT`,e.INPUT_FIELD_DEFINITION=`INPUT_FIELD_DEFINITION`,e.DIRECTIVE_DEFINITION=`DIRECTIVE_DEFINITION`})(T||={});var E;(function(e){e.NAME=`Name`,e.DOCUMENT=`Document`,e.OPERATION_DEFINITION=`OperationDefinition`,e.VARIABLE_DEFINITION=`VariableDefinition`,e.SELECTION_SET=`SelectionSet`,e.FIELD=`Field`,e.ARGUMENT=`Argument`,e.FRAGMENT_SPREAD=`FragmentSpread`,e.INLINE_FRAGMENT=`InlineFragment`,e.FRAGMENT_DEFINITION=`FragmentDefinition`,e.VARIABLE=`Variable`,e.INT=`IntValue`,e.FLOAT=`FloatValue`,e.STRING=`StringValue`,e.BOOLEAN=`BooleanValue`,e.NULL=`NullValue`,e.ENUM=`EnumValue`,e.LIST=`ListValue`,e.OBJECT=`ObjectValue`,e.OBJECT_FIELD=`ObjectField`,e.DIRECTIVE=`Directive`,e.NAMED_TYPE=`NamedType`,e.LIST_TYPE=`ListType`,e.NON_NULL_TYPE=`NonNullType`,e.SCHEMA_DEFINITION=`SchemaDefinition`,e.OPERATION_TYPE_DEFINITION=`OperationTypeDefinition`,e.SCALAR_TYPE_DEFINITION=`ScalarTypeDefinition`,e.OBJECT_TYPE_DEFINITION=`ObjectTypeDefinition`,e.FIELD_DEFINITION=`FieldDefinition`,e.INPUT_VALUE_DEFINITION=`InputValueDefinition`,e.INTERFACE_TYPE_DEFINITION=`InterfaceTypeDefinition`,e.UNION_TYPE_DEFINITION=`UnionTypeDefinition`,e.ENUM_TYPE_DEFINITION=`EnumTypeDefinition`,e.ENUM_VALUE_DEFINITION=`EnumValueDefinition`,e.INPUT_OBJECT_TYPE_DEFINITION=`InputObjectTypeDefinition`,e.DIRECTIVE_DEFINITION=`DirectiveDefinition`,e.SCHEMA_EXTENSION=`SchemaExtension`,e.DIRECTIVE_EXTENSION=`DirectiveExtension`,e.SCALAR_TYPE_EXTENSION=`ScalarTypeExtension`,e.OBJECT_TYPE_EXTENSION=`ObjectTypeExtension`,e.INTERFACE_TYPE_EXTENSION=`InterfaceTypeExtension`,e.UNION_TYPE_EXTENSION=`UnionTypeExtension`,e.ENUM_TYPE_EXTENSION=`EnumTypeExtension`,e.INPUT_OBJECT_TYPE_EXTENSION=`InputObjectTypeExtension`,e.TYPE_COORDINATE=`TypeCoordinate`,e.MEMBER_COORDINATE=`MemberCoordinate`,e.ARGUMENT_COORDINATE=`ArgumentCoordinate`,e.DIRECTIVE_COORDINATE=`DirectiveCoordinate`,e.DIRECTIVE_ARGUMENT_COORDINATE=`DirectiveArgumentCoordinate`})(E||={});function Ie(e){return e===9||e===32}function Le(e){return e>=48&&e<=57}function Re(e){return e>=97&&e<=122||e>=65&&e<=90}function ze(e){return Re(e)||e===95}function Be(e){return Re(e)||Le(e)||e===95}function Ve(e){let t=2**53-1,n=null,r=-1;for(let i=0;i<e.length;++i){let a=e[i],o=He(a);o!==a.length&&(n??=i,r=i,i!==0&&o<t&&(t=o))}return e.map((e,n)=>n===0?e:e.slice(t)).slice(n??0,r+1)}function He(e){let t=0;for(;t<e.length&&Ie(e.charCodeAt(t));)++t;return t}function Ue(e,t){let n=e.replace(/"""/g,`\\"""`),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,a=r.length>1&&r.slice(1).every(e=>e.length===0||Ie(e.charCodeAt(0))),o=n.endsWith(`\\"""`),s=e.endsWith(`"`)&&!o,c=e.endsWith(`\\`),l=s||c,u=!(t!=null&&t.minimize)&&(!i||e.length>70||l||a||o),d=``,f=i&&Ie(e.charCodeAt(0));return(u&&!f||a)&&(d+=`
11
+ `),d+=n,(u||l)&&(d+=`
12
+ `),`"""`+d+`"""`}var D;(function(e){e.SOF=`<SOF>`,e.EOF=`<EOF>`,e.BANG=`!`,e.DOLLAR=`$`,e.AMP=`&`,e.PAREN_L=`(`,e.PAREN_R=`)`,e.DOT=`.`,e.SPREAD=`...`,e.COLON=`:`,e.EQUALS=`=`,e.AT=`@`,e.BRACKET_L=`[`,e.BRACKET_R=`]`,e.BRACE_L=`{`,e.PIPE=`|`,e.BRACE_R=`}`,e.NAME=`Name`,e.INT=`Int`,e.FLOAT=`Float`,e.STRING=`String`,e.BLOCK_STRING=`BlockString`,e.COMMENT=`Comment`})(D||={});var We=class{constructor(e){let t=new je(D.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return`Lexer`}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==D.EOF)do if(e.next)e=e.next;else{let t=Ze(this,e.end);e.next=t,t.prev=e,e=t}while(e.kind===D.COMMENT);return e}};function Ge(e){return e===D.BANG||e===D.DOLLAR||e===D.AMP||e===D.PAREN_L||e===D.PAREN_R||e===D.DOT||e===D.SPREAD||e===D.COLON||e===D.EQUALS||e===D.AT||e===D.BRACKET_L||e===D.BRACKET_R||e===D.BRACE_L||e===D.PIPE||e===D.BRACE_R}function Ke(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function qe(e,t){return Je(e.charCodeAt(t))&&Ye(e.charCodeAt(t+1))}function Je(e){return e>=55296&&e<=56319}function Ye(e){return e>=56320&&e<=57343}function Xe(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return D.EOF;if(n>=32&&n<=126){let e=String.fromCodePoint(n);return e===`"`?`'"'`:`"${e}"`}return`U+`+n.toString(16).toUpperCase().padStart(4,`0`)}function O(e,t,n,r,i){let a=e.line;return new je(t,n,r,a,1+n-e.lineStart,i)}function Ze(e,t){let n=e.source.body,r=n.length,i=t;for(;i<r;){let t=n.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:n.charCodeAt(i+1)===10?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return Qe(e,i);case 33:return O(e,D.BANG,i,i+1);case 36:return O(e,D.DOLLAR,i,i+1);case 38:return O(e,D.AMP,i,i+1);case 40:return O(e,D.PAREN_L,i,i+1);case 41:return O(e,D.PAREN_R,i,i+1);case 46:if(n.charCodeAt(i+1)===46&&n.charCodeAt(i+2)===46)return O(e,D.SPREAD,i,i+3);break;case 58:return O(e,D.COLON,i,i+1);case 61:return O(e,D.EQUALS,i,i+1);case 64:return O(e,D.AT,i,i+1);case 91:return O(e,D.BRACKET_L,i,i+1);case 93:return O(e,D.BRACKET_R,i,i+1);case 123:return O(e,D.BRACE_L,i,i+1);case 124:return O(e,D.PIPE,i,i+1);case 125:return O(e,D.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?st(e,i):tt(e,i)}if(Le(t)||t===45)return $e(e,i,t);if(ze(t))return ct(e,i);throw w(e.source,i,t===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Ke(t)||qe(n,i)?`Unexpected character: ${Xe(e,i)}.`:`Invalid character: ${Xe(e,i)}.`)}return O(e,D.EOF,r,r)}function Qe(e,t){let n=e.source.body,r=n.length,i=t+1;for(;i<r;){let e=n.charCodeAt(i);if(e===10||e===13)break;if(Ke(e))++i;else if(qe(n,i))i+=2;else break}return O(e,D.COMMENT,t,i,n.slice(t+1,i))}function $e(e,t,n){let r=e.source.body,i=t,a=n,o=!1;if(a===45&&(a=r.charCodeAt(++i)),a===48){if(a=r.charCodeAt(++i),Le(a))throw w(e.source,i,`Invalid number, unexpected digit after 0: ${Xe(e,i)}.`)}else i=et(e,i,a),a=r.charCodeAt(i);if(a===46&&(o=!0,a=r.charCodeAt(++i),i=et(e,i,a),a=r.charCodeAt(i)),(a===69||a===101)&&(o=!0,a=r.charCodeAt(++i),(a===43||a===45)&&(a=r.charCodeAt(++i)),i=et(e,i,a),a=r.charCodeAt(i)),a===46||ze(a))throw w(e.source,i,`Invalid number, expected digit but got: ${Xe(e,i)}.`);return O(e,o?D.FLOAT:D.INT,t,i,r.slice(t,i))}function et(e,t,n){if(!Le(n))throw w(e.source,t,`Invalid number, expected digit but got: ${Xe(e,t)}.`);let r=e.source.body,i=t+1;for(;Le(r.charCodeAt(i));)++i;return i}function tt(e,t){let n=e.source.body,r=n.length,i=t+1,a=i,o=``;for(;i<r;){let r=n.charCodeAt(i);if(r===34)return o+=n.slice(a,i),O(e,D.STRING,t,i+1,o);if(r===92){o+=n.slice(a,i);let t=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?nt(e,i):rt(e,i):ot(e,i);o+=t.value,i+=t.size,a=i;continue}if(r===10||r===13)break;if(Ke(r))++i;else if(qe(n,i))i+=2;else throw w(e.source,i,`Invalid character within String: ${Xe(e,i)}.`)}throw w(e.source,i,`Unterminated string.`)}function nt(e,t){let n=e.source.body,r=0,i=3;for(;i<12;){let e=n.charCodeAt(t+i++);if(e===125){if(i<5||!Ke(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|at(e),r<0)break}throw w(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function rt(e,t){let n=e.source.body,r=it(n,t+2);if(Ke(r))return{value:String.fromCodePoint(r),size:6};if(Je(r)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let e=it(n,t+8);if(Ye(e))return{value:String.fromCodePoint(r,e),size:12}}throw w(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function it(e,t){return at(e.charCodeAt(t))<<12|at(e.charCodeAt(t+1))<<8|at(e.charCodeAt(t+2))<<4|at(e.charCodeAt(t+3))}function at(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function ot(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:`"`,size:2};case 92:return{value:`\\`,size:2};case 47:return{value:`/`,size:2};case 98:return{value:`\b`,size:2};case 102:return{value:`\f`,size:2};case 110:return{value:`
13
+ `,size:2};case 114:return{value:`\r`,size:2};case 116:return{value:` `,size:2}}throw w(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function st(e,t){let n=e.source.body,r=n.length,i=e.lineStart,a=t+3,o=a,s=``,c=[];for(;a<r;){let r=n.charCodeAt(a);if(r===34&&n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34){s+=n.slice(o,a),c.push(s);let r=O(e,D.BLOCK_STRING,t,a+3,Ve(c).join(`
14
+ `));return e.line+=c.length-1,e.lineStart=i,r}if(r===92&&n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34&&n.charCodeAt(a+3)===34){s+=n.slice(o,a),o=a+1,a+=4;continue}if(r===10||r===13){s+=n.slice(o,a),c.push(s),r===13&&n.charCodeAt(a+1)===10?a+=2:++a,s=``,o=a,i=a;continue}if(Ke(r))++a;else if(qe(n,a))a+=2;else throw w(e.source,a,`Invalid character within String: ${Xe(e,a)}.`)}throw w(e.source,a,`Unterminated string.`)}function ct(e,t){let n=e.source.body,r=n.length,i=t+1;for(;i<r&&Be(n.charCodeAt(i));)++i;return O(e,D.NAME,t,i,n.slice(t,i))}function k(e){return lt(e,[])}function lt(e,t){switch(typeof e){case`string`:return JSON.stringify(e);case`function`:return e.name?`[function ${e.name}]`:`[function]`;case`object`:return ut(e,t);default:return String(e)}}function ut(e,t){if(e===null)return`null`;if(t.includes(e))return`[Circular]`;let n=[...t,e];if(dt(e)){let t=e.toJSON();if(t!==e)return typeof t==`string`?t:lt(t,n)}else if(Array.isArray(e))return pt(e,n);return ft(e,n)}function dt(e){return typeof e.toJSON==`function`}function ft(e,t){let n=Object.entries(e);return n.length===0?`{}`:t.length>2?`[`+mt(e)+`]`:`{ `+n.map(([e,n])=>e+`: `+lt(n,t)).join(`, `)+` }`}function pt(e,t){if(e.length===0)return`[]`;if(t.length>2)return`[Array]`;let n=Math.min(10,e.length),r=e.length-n,i=[];for(let r=0;r<n;++r)i.push(lt(e[r],t));return r===1?i.push(`... 1 more item`):r>1&&i.push(`... ${r} more items`),`[`+i.join(`, `)+`]`}function mt(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,``).replace(/]$/,``);if(t===`Object`&&typeof e.constructor==`function`){let t=e.constructor.name;if(typeof t==`string`&&t!==``)return t}return t}const ht=globalThis.process?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if(typeof e==`object`&&e){let n=t.prototype[Symbol.toStringTag];if(n===(Symbol.toStringTag in e?e[Symbol.toStringTag]:e.constructor?.name)){let t=k(e);throw Error(`Cannot use ${n} "${t}" from another module or realm.
15
+
16
+ Ensure that there is only one instance of "graphql" in the node_modules
17
+ directory. If different versions of "graphql" are the dependencies of other
18
+ relied on modules, use "resolutions" to ensure only one version is installed.
19
+
20
+ https://yarnpkg.com/en/docs/selective-version-resolutions
21
+
22
+ Duplicate "graphql" modules cannot be used at the same time since different
23
+ versions may have different capabilities and behavior. The data from one
24
+ version used in the function from another could produce confusing and
25
+ spurious results.`)}}return!1};var gt=class{constructor(e,t=`GraphQL request`,n={line:1,column:1}){typeof e==`string`||S(!1,`Body must be a string. Received: ${k(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||S(!1,`line in locationOffset is 1-indexed and must be positive.`),this.locationOffset.column>0||S(!1,`column in locationOffset is 1-indexed and must be positive.`)}get[Symbol.toStringTag](){return`Source`}};function _t(e){return ht(e,gt)}function vt(e,t){let n=new yt(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}var yt=class{constructor(e,t={}){let{lexer:n,...r}=t;if(n)this._lexer=n;else{let t=_t(e)?e:new gt(e);this._lexer=new We(t)}this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let e=this.expectToken(D.NAME);return this.node(e,{kind:E.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:E.DOCUMENT,definitions:this.many(D.SOF,this.parseDefinition,D.EOF)})}parseDefinition(){if(this.peek(D.BRACE_L))return this.parseOperationDefinition();let e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===D.BRACE_L)throw w(this._lexer.source,this._lexer.token.start,`Unexpected description, descriptions are not supported on shorthand queries.`);if(t.kind===D.NAME){switch(t.value){case`schema`:return this.parseSchemaDefinition();case`scalar`:return this.parseScalarTypeDefinition();case`type`:return this.parseObjectTypeDefinition();case`interface`:return this.parseInterfaceTypeDefinition();case`union`:return this.parseUnionTypeDefinition();case`enum`:return this.parseEnumTypeDefinition();case`input`:return this.parseInputObjectTypeDefinition();case`directive`:return this.parseDirectiveDefinition()}switch(t.value){case`query`:case`mutation`:case`subscription`:return this.parseOperationDefinition();case`fragment`:return this.parseFragmentDefinition()}if(e)throw w(this._lexer.source,this._lexer.token.start,`Unexpected description, only GraphQL definitions support descriptions.`);if(t.value===`extend`)return this.parseTypeSystemExtension()}throw this.unexpected(t)}parseOperationDefinition(){let e=this._lexer.token;if(this.peek(D.BRACE_L))return this.node(e,{kind:E.OPERATION_DEFINITION,operation:Fe.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let t=this.parseDescription(),n=this.parseOperationType(),r;return this.peek(D.NAME)&&(r=this.parseName()),this.node(e,{kind:E.OPERATION_DEFINITION,operation:n,description:t,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let e=this.expectToken(D.NAME);switch(e.value){case`query`:return Fe.QUERY;case`mutation`:return Fe.MUTATION;case`subscription`:return Fe.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(D.PAREN_L,this.parseVariableDefinition,D.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:E.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(D.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(D.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let e=this._lexer.token;return this.expectToken(D.DOLLAR),this.node(e,{kind:E.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:E.SELECTION_SET,selections:this.many(D.BRACE_L,this.parseSelection,D.BRACE_R)})}parseSelection(){return this.peek(D.SPREAD)?this.parseFragment():this.parseField()}parseField(){let e=this._lexer.token,t=this.parseName(),n,r;return this.expectOptionalToken(D.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:E.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(D.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){let t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(D.PAREN_L,t,D.PAREN_R)}parseArgument(e=!1){let t=this._lexer.token,n=this.parseName();return this.expectToken(D.COLON),this.node(t,{kind:E.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let e=this._lexer.token;this.expectToken(D.SPREAD);let t=this.expectOptionalKeyword(`on`);return!t&&this.peek(D.NAME)?this.node(e,{kind:E.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:E.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let e=this._lexer.token,t=this.parseDescription();return this.expectKeyword(`fragment`),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:E.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword(`on`),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:E.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),typeCondition:(this.expectKeyword(`on`),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value===`on`)throw this.unexpected();return this.parseName()}parseValueLiteral(e){let t=this._lexer.token;switch(t.kind){case D.BRACKET_L:return this.parseList(e);case D.BRACE_L:return this.parseObject(e);case D.INT:return this.advanceLexer(),this.node(t,{kind:E.INT,value:t.value});case D.FLOAT:return this.advanceLexer(),this.node(t,{kind:E.FLOAT,value:t.value});case D.STRING:case D.BLOCK_STRING:return this.parseStringLiteral();case D.NAME:switch(this.advanceLexer(),t.value){case`true`:return this.node(t,{kind:E.BOOLEAN,value:!0});case`false`:return this.node(t,{kind:E.BOOLEAN,value:!1});case`null`:return this.node(t,{kind:E.NULL});default:return this.node(t,{kind:E.ENUM,value:t.value})}case D.DOLLAR:if(e){if(this.expectToken(D.DOLLAR),this._lexer.token.kind===D.NAME){let e=this._lexer.token.value;throw w(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:E.STRING,value:e.value,block:e.kind===D.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:E.LIST,values:this.any(D.BRACKET_L,()=>this.parseValueLiteral(e),D.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:E.OBJECT,fields:this.any(D.BRACE_L,()=>this.parseObjectField(e),D.BRACE_R)})}parseObjectField(e){let t=this._lexer.token,n=this.parseName();return this.expectToken(D.COLON),this.node(t,{kind:E.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){let t=[];for(;this.peek(D.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){let t=this._lexer.token;return this.expectToken(D.AT),this.node(t,{kind:E.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){let e=this._lexer.token,t;if(this.expectOptionalToken(D.BRACKET_L)){let n=this.parseTypeReference();this.expectToken(D.BRACKET_R),t=this.node(e,{kind:E.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(D.BANG)?this.node(e,{kind:E.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:E.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(D.STRING)||this.peek(D.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`schema`);let n=this.parseConstDirectives(),r=this.many(D.BRACE_L,this.parseOperationTypeDefinition,D.BRACE_R);return this.node(e,{kind:E.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){let e=this._lexer.token,t=this.parseOperationType();this.expectToken(D.COLON);let n=this.parseNamedType();return this.node(e,{kind:E.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`scalar`);let n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:E.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`type`);let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:E.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword(`implements`)?this.delimitedMany(D.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(D.BRACE_L,this.parseFieldDefinition,D.BRACE_R)}parseFieldDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(D.COLON);let i=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(e,{kind:E.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:a})}parseArgumentDefs(){return this.optionalMany(D.PAREN_L,this.parseInputValueDef,D.PAREN_R)}parseInputValueDef(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(D.COLON);let r=this.parseTypeReference(),i;this.expectOptionalToken(D.EQUALS)&&(i=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(e,{kind:E.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:a})}parseInterfaceTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`interface`);let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:E.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a})}parseUnionTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`union`);let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:E.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(D.EQUALS)?this.delimitedMany(D.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`enum`);let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:E.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(D.BRACE_L,this.parseEnumValueDefinition,D.BRACE_R)}parseEnumValueDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:E.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if(this._lexer.token.value===`true`||this._lexer.token.value===`false`||this._lexer.token.value===`null`)throw w(this._lexer.source,this._lexer.token.start,`${bt(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`input`);let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:E.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(D.BRACE_L,this.parseInputValueDef,D.BRACE_R)}parseTypeSystemExtension(){let e=this._lexer.lookahead();if(e.kind===D.NAME)switch(e.value){case`schema`:return this.parseSchemaExtension();case`scalar`:return this.parseScalarTypeExtension();case`type`:return this.parseObjectTypeExtension();case`interface`:return this.parseInterfaceTypeExtension();case`union`:return this.parseUnionTypeExtension();case`enum`:return this.parseEnumTypeExtension();case`input`:return this.parseInputObjectTypeExtension();case`directive`:if(this._options.experimentalDirectivesOnDirectiveDefinitions)return this.parseDirectiveDefinitionExtension()}throw this.unexpected(e)}parseSchemaExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`schema`);let t=this.parseConstDirectives(),n=this.optionalMany(D.BRACE_L,this.parseOperationTypeDefinition,D.BRACE_R);if(t.length===0&&n.length===0)throw this.unexpected();return this.node(e,{kind:E.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`scalar`);let t=this.parseName(),n=this.parseConstDirectives();if(n.length===0)throw this.unexpected();return this.node(e,{kind:E.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`type`);let t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(n.length===0&&r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:E.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`interface`);let t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(n.length===0&&r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:E.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`union`);let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:E.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`enum`);let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:E.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`input`);let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:E.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinitionExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`directive`),this.expectToken(D.AT);let t=this.parseName(),n=this.parseConstDirectives();if(n.length===0)throw this.unexpected();return this.node(e,{kind:E.DIRECTIVE_EXTENSION,name:t,directives:n})}parseDirectiveDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`directive`),this.expectToken(D.AT);let n=this.parseName(),r=this.parseArgumentDefs(),i=this._options.experimentalDirectivesOnDirectiveDefinitions?this.parseConstDirectives():[],a=this.expectOptionalKeyword(`repeatable`);this.expectKeyword(`on`);let o=this.parseDirectiveLocations();return this.node(e,{kind:E.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,directives:i,repeatable:a,locations:o})}parseDirectiveLocations(){return this.delimitedMany(D.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(T,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){let e=this._lexer.token,t=this.expectOptionalToken(D.AT),n=this.parseName(),r;!t&&this.expectOptionalToken(D.DOT)&&(r=this.parseName());let i;return(t||r)&&this.expectOptionalToken(D.PAREN_L)&&(i=this.parseName(),this.expectToken(D.COLON),this.expectToken(D.PAREN_R)),t?i?this.node(e,{kind:E.DIRECTIVE_ARGUMENT_COORDINATE,name:n,argumentName:i}):this.node(e,{kind:E.DIRECTIVE_COORDINATE,name:n}):r?i?this.node(e,{kind:E.ARGUMENT_COORDINATE,name:n,fieldName:r,argumentName:i}):this.node(e,{kind:E.MEMBER_COORDINATE,name:n,memberName:r}):this.node(e,{kind:E.TYPE_COORDINATE,name:n})}node(e,t){return this._options.noLocation!==!0&&(t.loc=new Ae(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){let t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw w(this._lexer.source,t.start,`Expected ${xt(e)}, found ${bt(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){let t=this._lexer.token;if(t.kind===D.NAME&&t.value===e)this.advanceLexer();else throw w(this._lexer.source,t.start,`Expected "${e}", found ${bt(t)}.`)}expectOptionalKeyword(e){let t=this._lexer.token;return t.kind===D.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){let t=e??this._lexer.token;return w(this._lexer.source,t.start,`Unexpected ${bt(t)}.`)}any(e,t,n){this.expectToken(e);let r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){let e=[];do e.push(t.call(this));while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);let r=[];do r.push(t.call(this));while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);let n=[];do n.push(t.call(this));while(this.expectOptionalToken(e));return n}advanceLexer(){let{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==D.EOF&&(++this._tokenCounter,e!==void 0&&this._tokenCounter>e))throw w(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}};function bt(e){let t=e.value;return xt(e.kind)+(t==null?``:` "${t}"`)}function xt(e){return Ge(e)?`"${e}"`:e}function St(e,t){let[n,r]=t?[e,t]:[void 0,e],i=` Did you mean `;n&&(i+=n+` `);let a=r.map(e=>`"${e}"`);switch(a.length){case 0:return``;case 1:return i+a[0]+`?`;case 2:return i+a[0]+` or `+a[1]+`?`}let o=a.slice(0,5),s=o.pop();return i+o.join(`, `)+`, or `+s+`?`}function Ct(e){return e}function wt(e,t){let n=Object.create(null);for(let r of e)n[t(r)]=r;return n}function Tt(e,t,n){let r=Object.create(null);for(let i of e)r[t(i)]=n(i);return r}function Et(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}function Dt(e,t){let n=0,r=0;for(;n<e.length&&r<t.length;){let i=e.charCodeAt(n),a=t.charCodeAt(r);if(kt(i)&&kt(a)){let o=0;do++n,o=o*10+i-Ot,i=e.charCodeAt(n);while(kt(i)&&o>0);let s=0;do++r,s=s*10+a-Ot,a=t.charCodeAt(r);while(kt(a)&&s>0);if(o<s)return-1;if(o>s)return 1}else{if(i<a)return-1;if(i>a)return 1;++n,++r}}return e.length-t.length}const Ot=48;function kt(e){return!isNaN(e)&&48<=e&&e<=57}function At(e,t){let n=Object.create(null),r=new jt(e),i=Math.floor(e.length*.4)+1;for(let e of t){let t=r.measure(e,i);t!==void 0&&(n[e]=t)}return Object.keys(n).sort((e,t)=>{let r=n[e]-n[t];return r===0?Dt(e,t):r})}var jt=class{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=Mt(this._inputLowerCase),this._rows=[Array(e.length+1).fill(0),Array(e.length+1).fill(0),Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;let n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=Mt(n),i=this._inputArray;if(r.length<i.length){let e=r;r=i,i=e}let a=r.length,o=i.length;if(a-o>t)return;let s=this._rows;for(let e=0;e<=o;e++)s[0][e]=e;for(let e=1;e<=a;e++){let n=s[(e-1)%3],a=s[e%3],c=a[0]=e;for(let t=1;t<=o;t++){let o=r[e-1]===i[t-1]?0:1,l=Math.min(n[t]+1,a[t-1]+1,n[t-1]+o);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){let n=s[(e-2)%3][t-2];l=Math.min(l,n+1)}l<c&&(c=l),a[t]=l}if(c>t)return}let c=s[a%3][o];return c<=t?c:void 0}};function Mt(e){let t=e.length,n=Array(t);for(let r=0;r<t;++r)n[r]=e.charCodeAt(r);return n}function Nt(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[n,r]of Object.entries(e))t[n]=r;return t}function Pt(e){return`"${e.replace(Ft,It)}"`}const Ft=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function It(e){return Lt[e.charCodeAt(0)]}const Lt=/* @__PURE__ */ `\\u0000.\\u0001.\\u0002.\\u0003.\\u0004.\\u0005.\\u0006.\\u0007.\\b.\\t.\\n.\\u000B.\\f.\\r.\\u000E.\\u000F.\\u0010.\\u0011.\\u0012.\\u0013.\\u0014.\\u0015.\\u0016.\\u0017.\\u0018.\\u0019.\\u001A.\\u001B.\\u001C.\\u001D.\\u001E.\\u001F...\\"..........................................................\\\\...................................\\u007F.\\u0080.\\u0081.\\u0082.\\u0083.\\u0084.\\u0085.\\u0086.\\u0087.\\u0088.\\u0089.\\u008A.\\u008B.\\u008C.\\u008D.\\u008E.\\u008F.\\u0090.\\u0091.\\u0092.\\u0093.\\u0094.\\u0095.\\u0096.\\u0097.\\u0098.\\u0099.\\u009A.\\u009B.\\u009C.\\u009D.\\u009E.\\u009F`.split(`.`),Rt=Object.freeze({});function zt(e,t,n=Me){let r=/* @__PURE__ */ new Map;for(let e of Object.values(E))r.set(e,Vt(t,e));let i,a=Array.isArray(e),o=[e],s=-1,c=[],l=e,u,d,f=[],p=[];do{s++;let e=s===o.length,m=e&&c.length!==0;if(e){if(u=p.length===0?void 0:f[f.length-1],l=d,d=p.pop(),m){if(a){l=l.slice();let e=0;for(let[t,n]of c){let r=t-e;n===null?(l.splice(r,1),e++):l[r]=n}}else{l={...l};for(let[e,t]of c)l[e]=t}}s=i.index,o=i.keys,c=i.edits,a=i.inArray,i=i.prev}else if(d){if(u=a?s:o[s],l=d[u],l==null)continue;f.push(u)}let h;if(!Array.isArray(l)){if(Pe(l)||S(!1,`Invalid AST Node: ${k(l)}.`),h=(e?r.get(l.kind)?.leave:r.get(l.kind)?.enter)?.call(t,l,u,d,f,p),h===Rt)break;if(h===!1){if(!e){f.pop();continue}}else if(h!==void 0&&(c.push([u,h]),!e)){if(Pe(h))l=h;else{f.pop();continue}}}h===void 0&&m&&c.push([u,l]),e?f.pop():(i={inArray:a,index:s,keys:o,edits:c,prev:i},a=Array.isArray(l),o=a?l:n[l.kind]??[],s=-1,c=[],d&&p.push(d),d=l)}while(i!==void 0);return c.length===0?e:c[c.length-1][1]}function Bt(e){let t=Array(e.length).fill(null),n=Object.create(null);for(let r of Object.values(E)){let i=!1,a=Array(e.length).fill(void 0),o=Array(e.length).fill(void 0);for(let t=0;t<e.length;++t){let{enter:n,leave:s}=Vt(e[t],r);i||=n!=null||s!=null,a[t]=n,o[t]=s}i&&(n[r]={enter(...n){let r=n[0];for(let i=0;i<e.length;i++)if(t[i]===null){let o=a[i]?.apply(e[i],n);if(o===!1)t[i]=r;else if(o===Rt)t[i]=Rt;else if(o!==void 0)return o}},leave(...n){let r=n[0];for(let i=0;i<e.length;i++)if(t[i]===null){let r=o[i]?.apply(e[i],n);if(r===Rt)t[i]=Rt;else if(r!==void 0&&r!==!1)return r}else t[i]===r&&(t[i]=null)}})}return n}function Vt(e,t){let n=e[t];return typeof n==`object`?n:typeof n==`function`?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function A(e){return zt(e,Ht)}const Ht={Name:{leave:e=>e.value},Variable:{leave:e=>`$`+e.name},Document:{leave:e=>j(e.definitions,`
26
+
27
+ `)},OperationDefinition:{leave(e){let t=Gt(e.variableDefinitions)?M(`(
28
+ `,j(e.variableDefinitions,`
29
+ `),`
30
+ )`):M(`(`,j(e.variableDefinitions,`, `),`)`),n=M(``,e.description,`
31
+ `)+j([e.operation,j([e.name,t]),j(e.directives,` `)],` `);return(n===`query`?``:n+` `)+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r,description:i})=>M(``,i,`
32
+ `)+e+`: `+t+M(` = `,n)+M(` `,j(r,` `))},SelectionSet:{leave:({selections:e})=>Ut(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let a=M(``,e,`: `)+t,o=a+M(`(`,j(n,`, `),`)`);return o.length>80&&(o=a+M(`(
33
+ `,Wt(j(n,`
34
+ `)),`
35
+ )`)),j([o,j(r,` `),i],` `)}},Argument:{leave:({name:e,value:t})=>e+`: `+t},FragmentSpread:{leave:({name:e,directives:t})=>`...`+e+M(` `,j(t,` `))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>j([`...`,M(`on `,e),j(t,` `),n],` `)},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i,description:a})=>M(``,a,`
36
+ `)+`fragment ${e}${M(`(`,j(n,`, `),`)`)} on ${t} ${M(``,j(r,` `),` `)}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?Ue(e):Pt(e)},BooleanValue:{leave:({value:e})=>e?`true`:`false`},NullValue:{leave:()=>`null`},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>`[`+j(e,`, `)+`]`},ObjectValue:{leave:({fields:e})=>`{`+j(e,`, `)+`}`},ObjectField:{leave:({name:e,value:t})=>e+`: `+t},Directive:{leave:({name:e,arguments:t})=>`@`+e+M(`(`,j(t,`, `),`)`)},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>`[`+e+`]`},NonNullType:{leave:({type:e})=>e+`!`},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>M(``,e,`
37
+ `)+j([`schema`,j(t,` `),Ut(n)],` `)},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+`: `+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>M(``,e,`
38
+ `)+j([`scalar`,t,j(n,` `)],` `)},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>M(``,e,`
39
+ `)+j([`type`,t,M(`implements `,j(n,` & `)),j(r,` `),Ut(i)],` `)},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>M(``,e,`
40
+ `)+t+(Gt(n)?M(`(
41
+ `,Wt(j(n,`
42
+ `)),`
43
+ )`):M(`(`,j(n,`, `),`)`))+`: `+r+M(` `,j(i,` `))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>M(``,e,`
44
+ `)+j([t+`: `+n,M(`= `,r),j(i,` `)],` `)},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>M(``,e,`
45
+ `)+j([`interface`,t,M(`implements `,j(n,` & `)),j(r,` `),Ut(i)],` `)},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>M(``,e,`
46
+ `)+j([`union`,t,j(n,` `),M(`= `,j(r,` | `))],` `)},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>M(``,e,`
47
+ `)+j([`enum`,t,j(n,` `),Ut(r)],` `)},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>M(``,e,`
48
+ `)+j([t,j(n,` `)],` `)},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>M(``,e,`
49
+ `)+j([`input`,t,j(n,` `),Ut(r)],` `)},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,directives:r,repeatable:i,locations:a})=>M(``,e,`
50
+ `)+`directive @`+t+(Gt(n)?M(`(
51
+ `,Wt(j(n,`
52
+ `)),`
53
+ )`):M(`(`,j(n,`, `),`)`))+M(` `,j(r,` `))+(i?` repeatable`:``)+` on `+j(a,` | `)},SchemaExtension:{leave:({directives:e,operationTypes:t})=>j([`extend schema`,j(e,` `),Ut(t)],` `)},ScalarTypeExtension:{leave:({name:e,directives:t})=>j([`extend scalar`,e,j(t,` `)],` `)},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>j([`extend type`,e,M(`implements `,j(t,` & `)),j(n,` `),Ut(r)],` `)},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>j([`extend interface`,e,M(`implements `,j(t,` & `)),j(n,` `),Ut(r)],` `)},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>j([`extend union`,e,j(t,` `),M(`= `,j(n,` | `))],` `)},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>j([`extend enum`,e,j(t,` `),Ut(n)],` `)},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>j([`extend input`,e,j(t,` `),Ut(n)],` `)},DirectiveExtension:{leave:({name:e,directives:t})=>j([`extend directive @`+e,j(t,` `)],` `)},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>j([e,M(`.`,t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>j([e,M(`.`,t),M(`(`,n,`:)`)])},DirectiveCoordinate:{leave:({name:e})=>j([`@`,e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>j([`@`,e,M(`(`,t,`:)`)])}};function j(e,t=``){return e?.filter(e=>e).join(t)??``}function Ut(e){return M(`{
54
+ `,Wt(j(e,`
55
+ `)),`
56
+ }`)}function M(e,t,n=``){return t!=null&&t!==``?e+t+n:``}function Wt(e){return M(` `,e.replace(/\n/g,`
57
+ `))}function Gt(e){
58
+ /* c8 ignore next */
59
+ return e?.some(e=>e.includes(`
60
+ `))??!1}function Kt(e,t){switch(e.kind){case E.NULL:return null;case E.INT:return parseInt(e.value,10);case E.FLOAT:return parseFloat(e.value);case E.STRING:case E.ENUM:case E.BOOLEAN:return e.value;case E.LIST:return e.values.map(e=>Kt(e,t));case E.OBJECT:return Tt(e.fields,e=>e.name.value,e=>Kt(e.value,t));case E.VARIABLE:return t?.[e.name.value]}}function qt(e){if(e??S(!1,`Must provide name.`),typeof e==`string`||S(!1,`Expected name to be a string.`),e.length===0)throw new C(`Expected name to be a non-empty string.`);for(let t=1;t<e.length;++t)if(!Be(e.charCodeAt(t)))throw new C(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!ze(e.charCodeAt(0)))throw new C(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}function Jt(e){if(e===`true`||e===`false`||e===`null`)throw new C(`Enum values cannot be named: ${e}`);return qt(e)}function Yt(e){return Xt(e)||N(e)||P(e)||F(e)||I(e)||L(e)||R(e)||z(e)}function Xt(e){return ht(e,un)}function N(e){return ht(e,dn)}function P(e){return ht(e,yn)}function F(e){return ht(e,bn)}function I(e){return ht(e,Sn)}function L(e){return ht(e,Tn)}function R(e){return ht(e,B)}function z(e){return ht(e,V)}function Zt(e){return Xt(e)||I(e)||L(e)||nn(e)&&Zt(e.ofType)}function Qt(e){return Xt(e)||N(e)||P(e)||F(e)||I(e)||nn(e)&&Qt(e.ofType)}function $t(e){return Xt(e)||I(e)}function en(e){return N(e)||P(e)||F(e)}function tn(e){return P(e)||F(e)}var B=class{constructor(e){Yt(e)||S(!1,`Expected ${k(e)} to be a GraphQL type.`),this.ofType=e}get[Symbol.toStringTag](){return`GraphQLList`}toString(){return`[`+String(this.ofType)+`]`}toJSON(){return this.toString()}},V=class{constructor(e){rn(e)||S(!1,`Expected ${k(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 nn(e){return R(e)||z(e)}function rn(e){return Yt(e)&&!z(e)}function an(e){if(e)return z(e)?e.ofType:e}function on(e){return Xt(e)||N(e)||P(e)||F(e)||I(e)||L(e)}function sn(e){if(e){let t=e;for(;nn(t);)t=t.ofType;return t}}function cn(e){return typeof e==`function`?e():e}function ln(e){return typeof e==`function`?e():e}var un=class{constructor(e){let t=e.parseValue??Ct;this.name=qt(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=e.serialize??Ct,this.parseValue=t,this.parseLiteral=e.parseLiteral??((e,n)=>t(Kt(e,n))),this.extensions=Nt(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],e.specifiedByURL==null||typeof e.specifiedByURL==`string`||S(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${k(e.specifiedByURL)}.`),e.serialize==null||typeof e.serialize==`function`||S(!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&&(typeof e.parseValue==`function`&&typeof e.parseLiteral==`function`||S(!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()}},dn=class{constructor(e){this.name=qt(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=Nt(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=()=>pn(e),this._interfaces=()=>fn(e),e.isTypeOf==null||typeof e.isTypeOf==`function`||S(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${k(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return`GraphQLObjectType`}getFields(){return typeof this._fields==`function`&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces==`function`&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:gn(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function fn(e){let t=cn(e.interfaces??[]);return Array.isArray(t)||S(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),t}function pn(e){let t=ln(e.fields);return hn(t)||S(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Et(t,(t,n)=>{hn(t)||S(!1,`${e.name}.${n} field config must be an object.`),t.resolve==null||typeof t.resolve==`function`||S(!1,`${e.name}.${n} field resolver must be a function if provided, but got: ${k(t.resolve)}.`);let r=t.args??{};return hn(r)||S(!1,`${e.name}.${n} args must be an object with argument names as keys.`),{name:qt(n),description:t.description,type:t.type,args:mn(r),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:Nt(t.extensions),astNode:t.astNode}})}function mn(e){return Object.entries(e).map(([e,t])=>({name:qt(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:Nt(t.extensions),astNode:t.astNode}))}function hn(e){return xe(e)&&!Array.isArray(e)}function gn(e){return Et(e,e=>({description:e.description,type:e.type,args:_n(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function _n(e){return Tt(e,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function vn(e){return z(e.type)&&e.defaultValue===void 0}var yn=class{constructor(e){this.name=qt(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=Nt(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=pn.bind(void 0,e),this._interfaces=fn.bind(void 0,e),e.resolveType==null||typeof e.resolveType==`function`||S(!1,`${this.name} must provide "resolveType" as a function, but got: ${k(e.resolveType)}.`)}get[Symbol.toStringTag](){return`GraphQLInterfaceType`}getFields(){return typeof this._fields==`function`&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces==`function`&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:gn(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},bn=class{constructor(e){this.name=qt(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=Nt(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._types=xn.bind(void 0,e),e.resolveType==null||typeof e.resolveType==`function`||S(!1,`${this.name} must provide "resolveType" as a function, but got: ${k(e.resolveType)}.`)}get[Symbol.toStringTag](){return`GraphQLUnionType`}getTypes(){return typeof this._types==`function`&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function xn(e){let t=cn(e.types);return Array.isArray(t)||S(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}var Sn=class{constructor(e){this.name=qt(e.name),this.description=e.description,this.extensions=Nt(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._values=typeof e.values==`function`?e.values:wn(this.name,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return`GraphQLEnumType`}getValues(){return typeof this._values==`function`&&(this._values=wn(this.name,this._values())),this._values}getValue(e){return this._nameLookup===null&&(this._nameLookup=wt(this.getValues(),e=>e.name)),this._nameLookup[e]}serialize(e){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(e=>[e.value,e])));let t=this._valueLookup.get(e);if(t===void 0)throw new C(`Enum "${this.name}" cannot represent value: ${k(e)}`);return t.name}parseValue(e){if(typeof e!=`string`){let t=k(e);throw new C(`Enum "${this.name}" cannot represent non-string value: ${t}.`+Cn(this,t))}let t=this.getValue(e);if(t==null)throw new C(`Value "${e}" does not exist in "${this.name}" enum.`+Cn(this,e));return t.value}parseLiteral(e,t){if(e.kind!==E.ENUM){let t=A(e);throw new C(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+Cn(this,t),{nodes:e})}let n=this.getValue(e.value);if(n==null){let t=A(e);throw new C(`Value "${t}" does not exist in "${this.name}" enum.`+Cn(this,t),{nodes:e})}return n.value}toConfig(){let e=Tt(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 Cn(e,t){return St(`the enum value`,At(t,e.getValues().map(e=>e.name)))}function wn(e,t){return hn(t)||S(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([t,n])=>(hn(n)||S(!1,`${e}.${t} must refer to an object with a "value" key representing an internal value but got: ${k(n)}.`),{name:Jt(t),description:n.description,value:n.value===void 0?t:n.value,deprecationReason:n.deprecationReason,extensions:Nt(n.extensions),astNode:n.astNode}))}var Tn=class{constructor(e){this.name=qt(e.name),this.description=e.description,this.extensions=Nt(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this.isOneOf=e.isOneOf??!1,this._fields=En.bind(void 0,e)}get[Symbol.toStringTag](){return`GraphQLInputObjectType`}getFields(){return typeof this._fields==`function`&&(this._fields=this._fields()),this._fields}toConfig(){let e=Et(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 En(e){let t=ln(e.fields);return hn(t)||S(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Et(t,(t,n)=>(!(`resolve`in t)||S(!1,`${e.name}.${n} field has a resolve property, but Input Types cannot define resolvers.`),{name:qt(n),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:Nt(t.extensions),astNode:t.astNode}))}function Dn(e){return z(e.type)&&e.defaultValue===void 0}function On(e,t){return e===t?!0:z(e)&&z(t)||R(e)&&R(t)?On(e.ofType,t.ofType):!1}function kn(e,t,n){return t===n?!0:z(n)?z(t)?kn(e,t.ofType,n.ofType):!1:z(t)?kn(e,t.ofType,n):R(n)?R(t)?kn(e,t.ofType,n.ofType):!1:!R(t)&&tn(n)&&(P(t)||N(t))&&e.isSubType(n,t)}function An(e,t,n){return t===n?!0:tn(t)?tn(n)?e.getPossibleTypes(t).some(t=>e.isSubType(n,t)):e.isSubType(t,n):tn(n)?e.isSubType(n,t):!1}const jn=new un({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=In(e);if(typeof t==`boolean`)return+!!t;let n=t;if(typeof t==`string`&&t!==``&&(n=Number(t)),typeof n!=`number`||!Number.isInteger(n))throw new C(`Int cannot represent non-integer value: ${k(t)}`);if(n>2147483647||n<-2147483648)throw new C(`Int cannot represent non 32-bit signed integer value: `+k(t));return n},parseValue(e){if(typeof e!=`number`||!Number.isInteger(e))throw new C(`Int cannot represent non-integer value: ${k(e)}`);if(e>2147483647||e<-2147483648)throw new C(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==E.INT)throw new C(`Int cannot represent non-integer value: ${A(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>2147483647||t<-2147483648)throw new C(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),Mn=new un({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=In(e);if(typeof t==`boolean`)return+!!t;let n=t;if(typeof t==`string`&&t!==``&&(n=Number(t)),typeof n!=`number`||!Number.isFinite(n))throw new C(`Float cannot represent non numeric value: ${k(t)}`);return n},parseValue(e){if(typeof e!=`number`||!Number.isFinite(e))throw new C(`Float cannot represent non numeric value: ${k(e)}`);return e},parseLiteral(e){if(e.kind!==E.FLOAT&&e.kind!==E.INT)throw new C(`Float cannot represent non numeric value: ${A(e)}`,e);return parseFloat(e.value)}}),H=new un({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=In(e);if(typeof t==`string`)return t;if(typeof t==`boolean`)return t?`true`:`false`;if(typeof t==`number`&&Number.isFinite(t))return t.toString();throw new C(`String cannot represent value: ${k(e)}`)},parseValue(e){if(typeof e!=`string`)throw new C(`String cannot represent a non string value: ${k(e)}`);return e},parseLiteral(e){if(e.kind!==E.STRING)throw new C(`String cannot represent a non string value: ${A(e)}`,{nodes:e});return e.value}}),U=new un({name:`Boolean`,description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){let t=In(e);if(typeof t==`boolean`)return t;if(Number.isFinite(t))return t!==0;throw new C(`Boolean cannot represent a non boolean value: ${k(t)}`)},parseValue(e){if(typeof e!=`boolean`)throw new C(`Boolean cannot represent a non boolean value: ${k(e)}`);return e},parseLiteral(e){if(e.kind!==E.BOOLEAN)throw new C(`Boolean cannot represent a non boolean value: ${A(e)}`,{nodes:e});return e.value}}),Nn=new un({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=In(e);if(typeof t==`string`)return t;if(Number.isInteger(t))return String(t);throw new C(`ID cannot represent value: ${k(e)}`)},parseValue(e){if(typeof e==`string`)return e;if(typeof e==`number`&&Number.isInteger(e))return e.toString();throw new C(`ID cannot represent value: ${k(e)}`)},parseLiteral(e){if(e.kind!==E.STRING&&e.kind!==E.INT)throw new C(`ID cannot represent a non-string and non-integer value: `+A(e),{nodes:e});return e.value}}),Pn=Object.freeze([H,jn,Mn,U,Nn]);function Fn(e){return Pn.some(({name:t})=>e.name===t)}function In(e){if(xe(e)){if(typeof e.valueOf==`function`){let t=e.valueOf();if(!xe(t))return t}if(typeof e.toJSON==`function`)return e.toJSON()}return e}function Ln(e){return ht(e,Rn)}var Rn=class{constructor(e){this.name=qt(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=e.isRepeatable??!1,this.deprecationReason=e.deprecationReason,this.extensions=Nt(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],Array.isArray(e.locations)||S(!1,`@${e.name} locations must be an Array.`);let t=e.args??{};xe(t)&&!Array.isArray(t)||S(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=mn(t)}get[Symbol.toStringTag](){return`GraphQLDirective`}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:_n(this.args),isRepeatable:this.isRepeatable,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return`@`+this.name}toJSON(){return this.toString()}};const zn=new Rn({name:`include`,description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[T.FIELD,T.FRAGMENT_SPREAD,T.INLINE_FRAGMENT],args:{if:{type:new V(U),description:`Included when true.`}}}),Bn=new Rn({name:`skip`,description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[T.FIELD,T.FRAGMENT_SPREAD,T.INLINE_FRAGMENT],args:{if:{type:new V(U),description:`Skipped when true.`}}}),Vn=new Rn({name:`deprecated`,description:`Marks an element of a GraphQL schema as no longer supported.`,locations:[T.FIELD_DEFINITION,T.ARGUMENT_DEFINITION,T.INPUT_FIELD_DEFINITION,T.ENUM_VALUE,T.DIRECTIVE_DEFINITION],args:{reason:{type:H,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:`No longer supported`}}}),Hn=new Rn({name:`specifiedBy`,description:`Exposes a URL that specifies the behavior of this scalar.`,locations:[T.SCALAR],args:{url:{type:new V(H),description:`The URL that specifies the behavior of this scalar.`}}}),Un=new Rn({name:`oneOf`,description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[T.INPUT_OBJECT],args:{}}),Wn=Object.freeze([zn,Bn,Vn,Hn,Un]);function Gn(e){return Wn.some(({name:t})=>t===e.name)}function Kn(e){return typeof e==`object`&&typeof e?.[Symbol.iterator]==`function`}function qn(e,t){if(z(t)){let n=qn(e,t.ofType);return n?.kind===E.NULL?null:n}if(e===null)return{kind:E.NULL};if(e===void 0)return null;if(R(t)){let n=t.ofType;if(Kn(e)){let t=[];for(let r of e){let e=qn(r,n);e!=null&&t.push(e)}return{kind:E.LIST,values:t}}return qn(e,n)}if(L(t)){if(!xe(e))return null;let n=[];for(let r of Object.values(t.getFields())){let t=qn(e[r.name],r.type);t&&n.push({kind:E.OBJECT_FIELD,name:{kind:E.NAME,value:r.name},value:t})}return{kind:E.OBJECT,fields:n}}if($t(t)){let n=t.serialize(e);if(n==null)return null;if(typeof n==`boolean`)return{kind:E.BOOLEAN,value:n};if(typeof n==`number`&&Number.isFinite(n)){let e=String(n);return Jn.test(e)?{kind:E.INT,value:e}:{kind:E.FLOAT,value:e}}if(typeof n==`string`)return I(t)?{kind:E.ENUM,value:n}:t===Nn&&Jn.test(n)?{kind:E.INT,value:n}:{kind:E.STRING,value:n};throw TypeError(`Cannot convert value to AST: ${k(n)}.`)}
61
+ /* c8 ignore next 3 */
62
+ Se(!1,`Unexpected input type: `+k(t))}const Jn=/^-?(?:0|[1-9][0-9]*)$/,Yn=new dn({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:H,resolve:e=>e.description},types:{description:`A list of all types supported by this server.`,type:new V(new B(new V(Qn))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:`The type that query operations will be rooted at.`,type:new V(Qn),resolve:e=>e.getQueryType()},mutationType:{description:`If this server supports mutation, the type that mutation operations will be rooted at.`,type:Qn,resolve:e=>e.getMutationType()},subscriptionType:{description:`If this server support subscription, the type that subscription operations will be rooted at.`,type:Qn,resolve:e=>e.getSubscriptionType()},directives:{description:`A list of all directives supported by this server.`,type:new V(new B(new V(Xn))),args:{includeDeprecated:{type:new V(U),defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.getDirectives():e.getDirectives().filter(e=>e.deprecationReason==null)}})}),Xn=new dn({name:`__Directive`,description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
63
+
64
+ In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new V(H),resolve:e=>e.name},description:{type:H,resolve:e=>e.description},isRepeatable:{type:new V(U),resolve:e=>e.isRepeatable},locations:{type:new V(new B(new V(Zn))),resolve:e=>e.locations},args:{type:new V(new B(new V(er))),args:{includeDeprecated:{type:U,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(e=>e.deprecationReason==null)}},isDeprecated:{type:new V(U),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:H,resolve:e=>e.deprecationReason}})}),Zn=new Sn({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:T.QUERY,description:`Location adjacent to a query operation.`},MUTATION:{value:T.MUTATION,description:`Location adjacent to a mutation operation.`},SUBSCRIPTION:{value:T.SUBSCRIPTION,description:`Location adjacent to a subscription operation.`},FIELD:{value:T.FIELD,description:`Location adjacent to a field.`},FRAGMENT_DEFINITION:{value:T.FRAGMENT_DEFINITION,description:`Location adjacent to a fragment definition.`},FRAGMENT_SPREAD:{value:T.FRAGMENT_SPREAD,description:`Location adjacent to a fragment spread.`},INLINE_FRAGMENT:{value:T.INLINE_FRAGMENT,description:`Location adjacent to an inline fragment.`},VARIABLE_DEFINITION:{value:T.VARIABLE_DEFINITION,description:`Location adjacent to a variable definition.`},SCHEMA:{value:T.SCHEMA,description:`Location adjacent to a schema definition.`},SCALAR:{value:T.SCALAR,description:`Location adjacent to a scalar definition.`},OBJECT:{value:T.OBJECT,description:`Location adjacent to an object type definition.`},FIELD_DEFINITION:{value:T.FIELD_DEFINITION,description:`Location adjacent to a field definition.`},ARGUMENT_DEFINITION:{value:T.ARGUMENT_DEFINITION,description:`Location adjacent to an argument definition.`},INTERFACE:{value:T.INTERFACE,description:`Location adjacent to an interface definition.`},UNION:{value:T.UNION,description:`Location adjacent to a union definition.`},ENUM:{value:T.ENUM,description:`Location adjacent to an enum definition.`},ENUM_VALUE:{value:T.ENUM_VALUE,description:`Location adjacent to an enum value definition.`},INPUT_OBJECT:{value:T.INPUT_OBJECT,description:`Location adjacent to an input object type definition.`},INPUT_FIELD_DEFINITION:{value:T.INPUT_FIELD_DEFINITION,description:`Location adjacent to an input object field definition.`},DIRECTIVE_DEFINITION:{value:T.DIRECTIVE_DEFINITION,description:`Location adjacent to a directive definition.`}}}),Qn=new dn({name:`__Type`,description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new V(nr),resolve(e){if(Xt(e))return W.SCALAR;if(N(e))return W.OBJECT;if(P(e))return W.INTERFACE;if(F(e))return W.UNION;if(I(e))return W.ENUM;if(L(e))return W.INPUT_OBJECT;if(R(e))return W.LIST;if(z(e))return W.NON_NULL;
65
+ /* c8 ignore next 3 */
66
+ Se(!1,`Unexpected type: "${k(e)}".`)}},name:{type:H,resolve:e=>`name`in e?e.name:void 0},description:{type:H,resolve:e=>`description`in e?e.description:void 0},specifiedByURL:{type:H,resolve:e=>`specifiedByURL`in e?e.specifiedByURL:void 0},fields:{type:new B(new V($n)),args:{includeDeprecated:{type:U,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(N(e)||P(e)){let n=Object.values(e.getFields());return t?n:n.filter(e=>e.deprecationReason==null)}}},interfaces:{type:new B(new V(Qn)),resolve(e){if(N(e)||P(e))return e.getInterfaces()}},possibleTypes:{type:new B(new V(Qn)),resolve(e,t,n,{schema:r}){if(tn(e))return r.getPossibleTypes(e)}},enumValues:{type:new B(new V(tr)),args:{includeDeprecated:{type:U,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(I(e)){let n=e.getValues();return t?n:n.filter(e=>e.deprecationReason==null)}}},inputFields:{type:new B(new V(er)),args:{includeDeprecated:{type:U,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(L(e)){let n=Object.values(e.getFields());return t?n:n.filter(e=>e.deprecationReason==null)}}},ofType:{type:Qn,resolve:e=>`ofType`in e?e.ofType:void 0},isOneOf:{type:U,resolve:e=>{if(L(e))return e.isOneOf}}})}),$n=new dn({name:`__Field`,description:`Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.`,fields:()=>({name:{type:new V(H),resolve:e=>e.name},description:{type:H,resolve:e=>e.description},args:{type:new V(new B(new V(er))),args:{includeDeprecated:{type:U,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(e=>e.deprecationReason==null)}},type:{type:new V(Qn),resolve:e=>e.type},isDeprecated:{type:new V(U),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:H,resolve:e=>e.deprecationReason}})}),er=new dn({name:`__InputValue`,description:`Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.`,fields:()=>({name:{type:new V(H),resolve:e=>e.name},description:{type:H,resolve:e=>e.description},type:{type:new V(Qn),resolve:e=>e.type},defaultValue:{type:H,description:`A GraphQL-formatted string representing the default value for this input value.`,resolve(e){let{type:t,defaultValue:n}=e,r=qn(n,t);return r?A(r):null}},isDeprecated:{type:new V(U),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:H,resolve:e=>e.deprecationReason}})}),tr=new dn({name:`__EnumValue`,description:`One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.`,fields:()=>({name:{type:new V(H),resolve:e=>e.name},description:{type:H,resolve:e=>e.description},isDeprecated:{type:new V(U),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:H,resolve:e=>e.deprecationReason}})});var W;(function(e){e.SCALAR=`SCALAR`,e.OBJECT=`OBJECT`,e.INTERFACE=`INTERFACE`,e.UNION=`UNION`,e.ENUM=`ENUM`,e.INPUT_OBJECT=`INPUT_OBJECT`,e.LIST=`LIST`,e.NON_NULL=`NON_NULL`})(W||={});const nr=new Sn({name:`__TypeKind`,description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:W.SCALAR,description:`Indicates this type is a scalar.`},OBJECT:{value:W.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:W.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:W.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:W.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:W.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:W.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:W.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),rr={name:`__schema`,type:new V(Yn),description:`Access the current type schema of this server.`,args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},ir={name:`__type`,type:Qn,description:`Request the type information of a single type.`,args:[{name:`name`,description:void 0,type:new V(H),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},ar={name:`__typename`,type:new V(H),description:`The name of the current Object type at runtime.`,args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},or=Object.freeze([Yn,Xn,Zn,Qn,$n,er,tr,nr]);function sr(e){return or.some(({name:t})=>e.name===t)}function cr(e){return ht(e,ur)}function lr(e){if(!cr(e))throw Error(`Expected ${k(e)} to be a GraphQL schema.`);return e}var ur=class{constructor(e){this.__validationErrors=e.assumeValid===!0?[]:void 0,xe(e)||S(!1,`Must provide configuration object.`),!e.types||Array.isArray(e.types)||S(!1,`"types" must be Array if provided but got: ${k(e.types)}.`),!e.directives||Array.isArray(e.directives)||S(!1,`"directives" must be Array if provided but got: ${k(e.directives)}.`),this.description=e.description,this.extensions=Nt(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives??Wn;let t=new Set(e.types);if(e.types!=null)for(let n of e.types)t.delete(n),dr(n,t);this._queryType!=null&&dr(this._queryType,t),this._mutationType!=null&&dr(this._mutationType,t),this._subscriptionType!=null&&dr(this._subscriptionType,t);for(let e of this._directives)if(Ln(e))for(let n of e.args)dr(n.type,t);dr(Yn,t),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let e of t){if(e==null)continue;let t=e.name;if(t||S(!1,`One of the provided types for building the Schema is missing a name.`),this._typeMap[t]!==void 0)throw Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,P(e)){for(let t of e.getInterfaces())if(P(t)){let n=this._implementationsMap[t.name];n===void 0&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.interfaces.push(e)}}else if(N(e)){for(let t of e.getInterfaces())if(P(t)){let n=this._implementationsMap[t.name];n===void 0&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.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 Fe.QUERY:return this.getQueryType();case Fe.MUTATION:return this.getMutationType();case Fe.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return F(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){return this._implementationsMap[e.name]??{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap[e.name];if(n===void 0){if(n=Object.create(null),F(e))for(let t of e.getTypes())n[t.name]=!0;else{let t=this.getImplementations(e);for(let e of t.objects)n[e.name]=!0;for(let e of t.interfaces)n[e.name]=!0}this._subTypeMap[e.name]=n}return n[t.name]!==void 0}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:this.__validationErrors!==void 0}}};function dr(e,t){let n=sn(e);if(!t.has(n)){if(t.add(n),F(n))for(let e of n.getTypes())dr(e,t);else if(N(n)||P(n)){for(let e of n.getInterfaces())dr(e,t);for(let e of Object.values(n.getFields())){dr(e.type,t);for(let n of e.args)dr(n.type,t)}}else if(L(n))for(let e of Object.values(n.getFields()))dr(e.type,t)}return t}function fr(e){if(lr(e),e.__validationErrors)return e.__validationErrors;let t=new mr(e);hr(t),_r(t),yr(t);let n=t.getErrors();return e.__validationErrors=n,n}function pr(e){let t=fr(e);if(t.length!==0)throw Error(t.map(e=>e.message).join(`
67
+
68
+ `))}var mr=class{constructor(e){this._errors=[],this.schema=e}reportError(e,t){let n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new C(e,{nodes:n}))}getErrors(){return this._errors}};function hr(e){let t=e.schema,n=t.getQueryType();n?N(n)||e.reportError(`Query root type must be Object type, it cannot be ${k(n)}.`,gr(t,Fe.QUERY)??n.astNode):e.reportError(`Query root type must be provided.`,t.astNode);let r=t.getMutationType();r&&!N(r)&&e.reportError(`Mutation root type must be Object type if provided, it cannot be ${k(r)}.`,gr(t,Fe.MUTATION)??r.astNode);let i=t.getSubscriptionType();i&&!N(i)&&e.reportError(`Subscription root type must be Object type if provided, it cannot be ${k(i)}.`,gr(t,Fe.SUBSCRIPTION)??i.astNode)}function gr(e,t){return[e.astNode,...e.extensionASTNodes].flatMap(e=>e?.operationTypes??[]).find(e=>e.operation===t)?.type}function _r(e){for(let t of e.schema.getDirectives()){if(!Ln(t)){e.reportError(`Expected directive but got: ${k(t)}.`,t?.astNode);continue}vr(e,t),t.locations.length===0&&e.reportError(`Directive @${t.name} must include 1 or more locations.`,t.astNode);for(let n of t.args)vr(e,n),Zt(n.type)||e.reportError(`The type of @${t.name}(${n.name}:) must be Input Type but got: ${k(n.type)}.`,n.astNode),vn(n)&&n.deprecationReason!=null&&e.reportError(`Required argument @${t.name}(${n.name}:) cannot be deprecated.`,[jr(n.astNode),n.astNode?.type])}}function vr(e,t){t.name.startsWith(`__`)&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function yr(e){let t=Or(e),n=e.schema.getTypeMap();for(let r of Object.values(n)){if(!on(r)){e.reportError(`Expected GraphQL named type but got: ${k(r)}.`,r.astNode);continue}sr(r)||vr(e,r),N(r)||P(r)?(br(e,r),xr(e,r)):F(r)?wr(e,r):I(r)?Tr(e,r):L(r)&&(Er(e,r),t(r))}}function br(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let r of n){vr(e,r),!Qt(r.type)&&e.reportError(`The type of ${t.name}.${r.name} must be Output Type but got: ${k(r.type)}.`,r.astNode?.type);for(let n of r.args){let i=n.name;vr(e,n),!Zt(n.type)&&e.reportError(`The type of ${t.name}.${r.name}(${i}:) must be Input Type but got: ${k(n.type)}.`,n.astNode?.type),vn(n)&&n.deprecationReason!=null&&e.reportError(`Required argument ${t.name}.${r.name}(${i}:) cannot be deprecated.`,[jr(n.astNode),n.astNode?.type])}}}function xr(e,t){let n=Object.create(null);for(let r of t.getInterfaces()){if(!P(r)){e.reportError(`Type ${k(t)} must only implement Interface types, it cannot implement ${k(r)}.`,kr(t,r));continue}if(t===r){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,kr(t,r));continue}if(n[r.name]){e.reportError(`Type ${t.name} can only implement ${r.name} once.`,kr(t,r));continue}n[r.name]=!0,Cr(e,t,r),Sr(e,t,r)}}function Sr(e,t,n){let r=t.getFields();for(let i of Object.values(n.getFields())){let a=i.name,o=r[a];if(!o){e.reportError(`Interface field ${n.name}.${a} expected but ${t.name} does not provide it.`,[i.astNode,t.astNode,...t.extensionASTNodes]);continue}kn(e.schema,o.type,i.type)||e.reportError(`Interface field ${n.name}.${a} expects type ${k(i.type)} but ${t.name}.${a} is type ${k(o.type)}.`,[i.astNode?.type,o.astNode?.type]);for(let r of i.args){let i=r.name,s=o.args.find(e=>e.name===i);if(!s){e.reportError(`Interface field argument ${n.name}.${a}(${i}:) expected but ${t.name}.${a} does not provide it.`,[r.astNode,o.astNode]);continue}On(r.type,s.type)||e.reportError(`Interface field argument ${n.name}.${a}(${i}:) expects type ${k(r.type)} but ${t.name}.${a}(${i}:) is type ${k(s.type)}.`,[r.astNode?.type,s.astNode?.type])}for(let r of o.args){let o=r.name;!i.args.find(e=>e.name===o)&&vn(r)&&e.reportError(`Object field ${t.name}.${a} includes required argument ${o} that is missing from the Interface field ${n.name}.${a}.`,[r.astNode,i.astNode])}}}function Cr(e,t,n){let r=t.getInterfaces();for(let i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...kr(n,i),...kr(t,n)])}function wr(e,t){let n=t.getTypes();n.length===0&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let r=Object.create(null);for(let i of n){if(r[i.name]){e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,Ar(t,i.name));continue}r[i.name]=!0,N(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${k(i)}.`,Ar(t,String(i)))}}function Tr(e,t){let n=t.getValues();n.length===0&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(let t of n)vr(e,t)}function Er(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let r of n)vr(e,r),!Zt(r.type)&&e.reportError(`The type of ${t.name}.${r.name} must be Input Type but got: ${k(r.type)}.`,r.astNode?.type),Dn(r)&&r.deprecationReason!=null&&e.reportError(`Required input field ${t.name}.${r.name} cannot be deprecated.`,[jr(r.astNode),r.astNode?.type]),t.isOneOf&&Dr(t,r,e)}function Dr(e,t,n){z(t.type)&&n.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,t.astNode?.type),t.defaultValue!==void 0&&n.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode)}function Or(e){let t=Object.create(null),n=[],r=Object.create(null);return i;function i(a){if(t[a.name])return;t[a.name]=!0,r[a.name]=n.length;let o=Object.values(a.getFields());for(let t of o)if(z(t.type)&&L(t.type.ofType)){let a=t.type.ofType,o=r[a.name];if(n.push(t),o===void 0)i(a);else{let t=n.slice(o),r=t.map(e=>e.name).join(`.`);e.reportError(`Cannot reference Input Object "${a.name}" within itself through a series of non-null fields: "${r}".`,t.map(e=>e.astNode))}n.pop()}r[a.name]=void 0}}function kr(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n==null?r:[n,...r]).flatMap(e=>e.interfaces??[]).filter(e=>e.name.value===t.name)}function Ar(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n==null?r:[n,...r]).flatMap(e=>e.types??[]).filter(e=>e.name.value===t)}function jr(e){return e?.directives?.find(e=>e.name.value===Vn.name)}function Mr(e,t){switch(t.kind){case E.LIST_TYPE:{let n=Mr(e,t.type);return n&&new B(n)}case E.NON_NULL_TYPE:{let n=Mr(e,t.type);return n&&new V(n)}case E.NAMED_TYPE:return e.getType(t.name.value)}}var Nr=class{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=n??Pr,t&&(Zt(t)&&this._inputTypeStack.push(t),en(t)&&this._parentTypeStack.push(t),Qt(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 E.SELECTION_SET:{let e=sn(this.getType());this._parentTypeStack.push(en(e)?e:void 0);break}case E.FIELD:{let n=this.getParentType(),r,i;n&&(r=this._getFieldDef(t,n,e),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push(Qt(i)?i:void 0);break}case E.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case E.OPERATION_DEFINITION:{let n=t.getRootType(e.operation);this._typeStack.push(N(n)?n:void 0);break}case E.INLINE_FRAGMENT:case E.FRAGMENT_DEFINITION:{let n=e.typeCondition,r=n?Mr(t,n):sn(this.getType());this._typeStack.push(Qt(r)?r:void 0);break}case E.VARIABLE_DEFINITION:{let n=Mr(t,e.type);this._inputTypeStack.push(Zt(n)?n:void 0);break}case E.ARGUMENT:{let t,n,r=this.getDirective()??this.getFieldDef();r&&(t=r.args.find(t=>t.name===e.name.value),t&&(n=t.type)),this._argument=t,this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push(Zt(n)?n:void 0);break}case E.LIST:{let e=an(this.getInputType()),t=R(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push(Zt(t)?t:void 0);break}case E.OBJECT_FIELD:{let t=sn(this.getInputType()),n,r;L(t)&&(r=t.getFields()[e.name.value],r&&(n=r.type)),this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push(Zt(n)?n:void 0);break}case E.ENUM:{let t=sn(this.getInputType()),n;I(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}}}leave(e){switch(e.kind){case E.SELECTION_SET:this._parentTypeStack.pop();break;case E.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case E.DIRECTIVE:this._directive=null;break;case E.OPERATION_DEFINITION:case E.INLINE_FRAGMENT:case E.FRAGMENT_DEFINITION:this._typeStack.pop();break;case E.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case E.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case E.LIST:case E.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case E.ENUM:this._enumValue=null}}};function Pr(e,t,n){let r=n.name.value;if(r===rr.name&&e.getQueryType()===t)return rr;if(r===ir.name&&e.getQueryType()===t)return ir;if(r===ar.name&&en(t))return ar;if(N(t)||P(t))return t.getFields()[r]}function Fr(e,t){return{enter(...n){let r=n[0];e.enter(r);let i=Vt(t,r.kind).enter;if(i){let a=i.apply(t,n);return a!==void 0&&(e.leave(r),Pe(a)&&e.enter(a)),a}},leave(...n){let r=n[0],i=Vt(t,r.kind).leave,a;return i&&(a=i.apply(t,n)),e.leave(r),a}}}function Ir(e){return Lr(e)||Rr(e)||Br(e)}function Lr(e){return e.kind===E.OPERATION_DEFINITION||e.kind===E.FRAGMENT_DEFINITION}function Rr(e){return e.kind===E.SCHEMA_DEFINITION||zr(e)||e.kind===E.DIRECTIVE_DEFINITION}function zr(e){return e.kind===E.SCALAR_TYPE_DEFINITION||e.kind===E.OBJECT_TYPE_DEFINITION||e.kind===E.INTERFACE_TYPE_DEFINITION||e.kind===E.UNION_TYPE_DEFINITION||e.kind===E.ENUM_TYPE_DEFINITION||e.kind===E.INPUT_OBJECT_TYPE_DEFINITION}function Br(e){return e.kind===E.SCHEMA_EXTENSION||e.kind===E.DIRECTIVE_EXTENSION||Vr(e)}function Vr(e){return e.kind===E.SCALAR_TYPE_EXTENSION||e.kind===E.OBJECT_TYPE_EXTENSION||e.kind===E.INTERFACE_TYPE_EXTENSION||e.kind===E.UNION_TYPE_EXTENSION||e.kind===E.ENUM_TYPE_EXTENSION||e.kind===E.INPUT_OBJECT_TYPE_EXTENSION}function Hr(e){return{Document(t){for(let n of t.definitions)if(!Lr(n)){let t=n.kind===E.SCHEMA_DEFINITION||n.kind===E.SCHEMA_EXTENSION?`schema`:`"`+n.name.value+`"`;e.reportError(new C(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}}function Ur(e){return{Field(t){let n=e.getParentType();if(n&&!e.getFieldDef()){let r=e.getSchema(),i=t.name.value,a=St(`to use an inline fragment on`,Wr(r,n,i));a===``&&(a=St(Gr(n,i))),e.reportError(new C(`Cannot query field "${i}" on type "${n.name}".`+a,{nodes:t}))}}}}function Wr(e,t,n){if(!tn(t))return[];let r=/* @__PURE__ */ new Set,i=Object.create(null);for(let a of e.getPossibleTypes(t))if(a.getFields()[n]){r.add(a),i[a.name]=1;for(let e of a.getInterfaces())e.getFields()[n]&&(r.add(e),i[e.name]=(i[e.name]??0)+1)}return[...r].sort((t,n)=>{let r=i[n.name]-i[t.name];return r===0?P(t)&&e.isSubType(t,n)?-1:P(n)&&e.isSubType(n,t)?1:Dt(t.name,n.name):r}).map(e=>e.name)}function Gr(e,t){return N(e)||P(e)?At(t,Object.keys(e.getFields())):[]}function Kr(e){return{InlineFragment(t){let n=t.typeCondition;if(n){let t=Mr(e.getSchema(),n);if(t&&!en(t)){let t=A(n);e.reportError(new C(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){let n=Mr(e.getSchema(),t.typeCondition);if(n&&!en(n)){let n=A(t.typeCondition);e.reportError(new C(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}}function qr(e){return{...Jr(e),Argument(t){let n=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!n&&r&&i){let n=t.name.value,a=At(n,r.args.map(e=>e.name));e.reportError(new C(`Unknown argument "${n}" on field "${i.name}.${r.name}".`+St(a),{nodes:t}))}}}}function Jr(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Wn;for(let e of r)t[e.name]=e.args.map(e=>e.name);let i=e.getDocument().definitions;for(let e of i)if(e.kind===E.DIRECTIVE_DEFINITION){
69
+ /* c8 ignore next */
70
+ let n=e.arguments??[];t[e.name.value]=n.map(e=>e.name.value)}return{Directive(n){let r=n.name.value,i=t[r];if(n.arguments&&i)for(let t of n.arguments){let n=t.name.value;if(!i.includes(n)){let a=At(n,i);e.reportError(new C(`Unknown argument "${n}" on directive "@${r}".`+St(a),{nodes:t}))}}return!1}}}function Yr(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Wn;for(let e of r)t[e.name]=e.locations;let i=e.getDocument().definitions;for(let e of i)e.kind===E.DIRECTIVE_DEFINITION&&(t[e.name.value]=e.locations.map(e=>e.value));return{Directive(n,r,i,a,o){let s=n.name.value,c=t[s];if(!c){e.reportError(new C(`Unknown directive "@${s}".`,{nodes:n}));return}let l=Xr(o);l&&!c.includes(l)&&e.reportError(new C(`Directive "@${s}" may not be used on ${l}.`,{nodes:n}))}}}function Xr(e){let t=e[e.length-1];switch(`kind`in t||Se(!1),t.kind){case E.OPERATION_DEFINITION:return Zr(t.operation);case E.FIELD:return T.FIELD;case E.FRAGMENT_SPREAD:return T.FRAGMENT_SPREAD;case E.INLINE_FRAGMENT:return T.INLINE_FRAGMENT;case E.FRAGMENT_DEFINITION:return T.FRAGMENT_DEFINITION;case E.VARIABLE_DEFINITION:return T.VARIABLE_DEFINITION;case E.SCHEMA_DEFINITION:case E.SCHEMA_EXTENSION:return T.SCHEMA;case E.SCALAR_TYPE_DEFINITION:case E.SCALAR_TYPE_EXTENSION:return T.SCALAR;case E.OBJECT_TYPE_DEFINITION:case E.OBJECT_TYPE_EXTENSION:return T.OBJECT;case E.FIELD_DEFINITION:return T.FIELD_DEFINITION;case E.INTERFACE_TYPE_DEFINITION:case E.INTERFACE_TYPE_EXTENSION:return T.INTERFACE;case E.UNION_TYPE_DEFINITION:case E.UNION_TYPE_EXTENSION:return T.UNION;case E.ENUM_TYPE_DEFINITION:case E.ENUM_TYPE_EXTENSION:return T.ENUM;case E.ENUM_VALUE_DEFINITION:return T.ENUM_VALUE;case E.INPUT_OBJECT_TYPE_DEFINITION:case E.INPUT_OBJECT_TYPE_EXTENSION:return T.INPUT_OBJECT;case E.INPUT_VALUE_DEFINITION:{let t=e[e.length-3];return`kind`in t||Se(!1),t.kind===E.INPUT_OBJECT_TYPE_DEFINITION?T.INPUT_FIELD_DEFINITION:T.ARGUMENT_DEFINITION}case E.DIRECTIVE_DEFINITION:case E.DIRECTIVE_EXTENSION:return T.DIRECTIVE_DEFINITION;
71
+ /* c8 ignore next */
72
+ default:Se(!1,`Unexpected kind: `+k(t.kind))}}function Zr(e){switch(e){case Fe.QUERY:return T.QUERY;case Fe.MUTATION:return T.MUTATION;case Fe.SUBSCRIPTION:return T.SUBSCRIPTION}}function Qr(e){return{FragmentSpread(t){let n=t.name.value;e.getFragment(n)||e.reportError(new C(`Unknown fragment "${n}".`,{nodes:t.name}))}}}function $r(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);for(let t of e.getDocument().definitions)zr(t)&&(r[t.name.value]=!0);let i=[...Object.keys(n),...Object.keys(r)];return{NamedType(t,a,o,s,c){let l=t.name.value;if(!n[l]&&!r[l]){let n=c[2]??o,r=n!=null&&ti(n);if(r&&ei.includes(l))return;let a=At(l,r?ei.concat(i):i);e.reportError(new C(`Unknown type "${l}".`+St(a),{nodes:t}))}}}}const ei=[...Pn,...or].map(e=>e.name);function ti(e){return`kind`in e&&(Rr(e)||Br(e))}function ni(e){let t=0;return{Document(e){t=e.definitions.filter(e=>e.kind===E.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new C(`This anonymous operation must be the only defined operation.`,{nodes:n}))}}}function ri(e){let t=e.getSchema(),n=t?.astNode??t?.getQueryType()??t?.getMutationType()??t?.getSubscriptionType(),r=0;return{SchemaDefinition(t){if(n){e.reportError(new C(`Cannot define a new schema within a schema extension.`,{nodes:t}));return}r>0&&e.reportError(new C(`Must provide only one schema definition.`,{nodes:t})),++r}}}function ii(e){function t(n,r=Object.create(null),i=0){if(n.kind===E.FRAGMENT_SPREAD){let a=n.name.value;if(r[a]===!0)return!1;let o=e.getFragment(a);if(!o)return!1;try{return r[a]=!0,t(o,r,i)}finally{r[a]=void 0}}if(n.kind===E.FIELD&&(n.name.value===`fields`||n.name.value===`interfaces`||n.name.value===`possibleTypes`||n.name.value===`inputFields`)&&(i++,i>=3))return!0;if(`selectionSet`in n&&n.selectionSet){for(let e of n.selectionSet.selections)if(t(e,r,i))return!0}return!1}return{Field(n){if((n.name.value===`__schema`||n.name.value===`__type`)&&t(n))return e.reportError(new C(`Maximum introspection depth exceeded`,{nodes:[n]})),!1}}}function ai(e){let t=Object.create(null),n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(e){return i(e),!1}};function i(a){if(t[a.name.value])return;let o=a.name.value;t[o]=!0;let s=e.getFragmentSpreads(a.selectionSet);if(s.length!==0){r[o]=n.length;for(let t of s){let a=t.name.value,o=r[a];if(n.push(t),o===void 0){let t=e.getFragment(a);t&&i(t)}else{let t=n.slice(o),r=t.slice(0,-1).map(e=>`"`+e.name.value+`"`).join(`, `);e.reportError(new C(`Cannot spread fragment "${a}" within itself`+(r===``?`.`:` via ${r}.`),{nodes:t}))}n.pop()}r[o]=void 0}}}function oi(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i}of r){let r=i.name.value;t[r]!==!0&&e.reportError(new C(n.name?`Variable "$${r}" is not defined by operation "${n.name.value}".`:`Variable "$${r}" is not defined.`,{nodes:[i,n]}))}}},VariableDefinition(e){t[e.variable.name.value]=!0}}}function si(e){let t=[],n=[];return{OperationDefinition(e){return t.push(e),!1},FragmentDefinition(e){return n.push(e),!1},Document:{leave(){let r=Object.create(null);for(let n of t)for(let t of e.getRecursivelyReferencedFragments(n))r[t.name.value]=!0;for(let t of n){let n=t.name.value;r[n]!==!0&&e.reportError(new C(`Fragment "${n}" is never used.`,{nodes:t}))}}}}}function ci(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(n){let r=Object.create(null),i=e.getRecursiveVariableUsages(n);for(let{node:e}of i)r[e.name.value]=!0;for(let i of t){let t=i.variable.name.value;r[t]!==!0&&e.reportError(new C(n.name?`Variable "$${t}" is never used in operation "${n.name.value}".`:`Variable "$${t}" is never used.`,{nodes:i}))}}},VariableDefinition(e){t.push(e)}}}function li(e){switch(e.kind){case E.OBJECT:return{...e,fields:ui(e.fields)};case E.LIST:return{...e,values:e.values.map(li)};case E.INT:case E.FLOAT:case E.STRING:case E.BOOLEAN:case E.NULL:case E.ENUM:case E.VARIABLE:return e}}function ui(e){return e.map(e=>({...e,value:li(e.value)})).sort((e,t)=>Dt(e.name.value,t.name.value))}function di(e){return Array.isArray(e)?e.map(([e,t])=>`subfields "${e}" conflict because `+di(t)).join(` and `):e}function fi(e){let t=new Di,n=new Oi,r=/* @__PURE__ */ new Map;return{SelectionSet(i){let a=pi(e,r,t,n,e.getParentType(),i);for(let[[t,n],r,i]of a){let a=di(n);e.reportError(new C(`Fields "${t}" conflict because ${a}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:r.concat(i)}))}}}}function pi(e,t,n,r,i,a){let o=[],[s,c]=Ci(e,t,i,a);if(_i(e,o,t,n,r,s),c.length!==0)for(let i=0;i<c.length;i++){mi(e,o,t,n,r,!1,s,c[i]);for(let a=i+1;a<c.length;a++)hi(e,o,t,n,r,!1,c[i],c[a])}return o}function mi(e,t,n,r,i,a,o,s){if(r.has(o,s,a))return;r.add(o,s,a);let c=e.getFragment(s);if(!c)return;let[l,u]=wi(e,n,c);if(o!==l){vi(e,t,n,r,i,a,o,l);for(let s of u)mi(e,t,n,r,i,a,o,s)}}function hi(e,t,n,r,i,a,o,s){if(o===s||i.has(o,s,a))return;i.add(o,s,a);let c=e.getFragment(o),l=e.getFragment(s);if(!c||!l)return;let[u,d]=wi(e,n,c),[f,p]=wi(e,n,l);vi(e,t,n,r,i,a,u,f);for(let s of p)hi(e,t,n,r,i,a,o,s);for(let o of d)hi(e,t,n,r,i,a,o,s)}function gi(e,t,n,r,i,a,o,s,c){let l=[],[u,d]=Ci(e,t,a,o),[f,p]=Ci(e,t,s,c);vi(e,l,t,n,r,i,u,f);for(let a of p)mi(e,l,t,n,r,i,u,a);for(let a of d)mi(e,l,t,n,r,i,f,a);for(let a of d)for(let o of p)hi(e,l,t,n,r,i,a,o);return l}function _i(e,t,n,r,i,a){for(let[o,s]of Object.entries(a))if(s.length>1)for(let a=0;a<s.length;a++)for(let c=a+1;c<s.length;c++){let l=yi(e,n,r,i,!1,o,s[a],s[c]);l&&t.push(l)}}function vi(e,t,n,r,i,a,o,s){for(let[c,l]of Object.entries(o)){let o=s[c];if(o)for(let s of l)for(let l of o){let o=yi(e,n,r,i,a,c,s,l);o&&t.push(o)}}}function yi(e,t,n,r,i,a,o,s){let[c,l,u]=o,[d,f,p]=s,m=i||c!==d&&N(c)&&N(d);if(!m){let e=l.name.value,t=f.name.value;if(e!==t)return[[a,`"${e}" and "${t}" are different fields`],[l],[f]];if(!bi(l,f))return[[a,`they have differing arguments`],[l],[f]]}let h=u?.type,g=p?.type;if(h&&g&&Si(h,g))return[[a,`they return conflicting types "${k(h)}" and "${k(g)}"`],[l],[f]];let ee=l.selectionSet,te=f.selectionSet;if(ee&&te)return Ei(gi(e,t,n,r,m,sn(h),ee,sn(g),te),a,l,f)}function bi(e,t){let n=e.arguments,r=t.arguments;if(n===void 0||n.length===0)return r===void 0||r.length===0;
73
+ /* c8 ignore next */
74
+ if(r===void 0||r.length===0||n.length!==r.length)
75
+ /* c8 ignore next */
76
+ return!1;let i=new Map(r.map(({name:e,value:t})=>[e.value,t]));return n.every(e=>{let t=e.value,n=i.get(e.name.value);return n!==void 0&&xi(t)===xi(n)})}function xi(e){return A(li(e))}function Si(e,t){return R(e)?!R(t)||Si(e.ofType,t.ofType):R(t)?!0:z(e)?!z(t)||Si(e.ofType,t.ofType):z(t)?!0:$t(e)||$t(t)?e!==t:!1}function Ci(e,t,n,r){let i=t.get(r);if(i)return i;let a=Object.create(null),o=Object.create(null);Ti(e,n,r,a,o);let s=[a,Object.keys(o)];return t.set(r,s),s}function wi(e,t,n){return t.get(n.selectionSet)||Ci(e,t,Mr(e.getSchema(),n.typeCondition),n.selectionSet)}function Ti(e,t,n,r,i){for(let a of n.selections)switch(a.kind){case E.FIELD:{let e=a.name.value,n;(N(t)||P(t))&&(n=t.getFields()[e]);let i=a.alias?a.alias.value:e;r[i]||(r[i]=[]),r[i].push([t,a,n]);break}case E.FRAGMENT_SPREAD:i[a.name.value]=!0;break;case E.INLINE_FRAGMENT:{let n=a.typeCondition;Ti(e,n?Mr(e.getSchema(),n):t,a.selectionSet,r,i);break}}}function Ei(e,t,n,r){if(e.length>0)return[[t,e.map(([e])=>e)],[n,...e.map(([,e])=>e).flat()],[r,...e.map(([,,e])=>e).flat()]]}var Di=class{constructor(){this._data=/* @__PURE__ */ new Map}has(e,t,n){let r=this._data.get(e)?.get(t);return r===void 0?!1:n?!0:n===r}add(e,t,n){let r=this._data.get(e);r===void 0?this._data.set(e,/* @__PURE__ */ new Map([[t,n]])):r.set(t,n)}},Oi=class{constructor(){this._orderedPairSet=new Di}has(e,t,n){return e<t?this._orderedPairSet.has(e,t,n):this._orderedPairSet.has(t,e,n)}add(e,t,n){e<t?this._orderedPairSet.add(e,t,n):this._orderedPairSet.add(t,e,n)}};function ki(e){return{InlineFragment(t){let n=e.getType(),r=e.getParentType();if(en(n)&&en(r)&&!An(e.getSchema(),n,r)){let i=k(r),a=k(n);e.reportError(new C(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${a}".`,{nodes:t}))}},FragmentSpread(t){let n=t.name.value,r=Ai(e,n),i=e.getParentType();if(r&&i&&!An(e.getSchema(),r,i)){let a=k(i),o=k(r);e.reportError(new C(`Fragment "${n}" cannot be spread here as objects of type "${a}" can never be of type "${o}".`,{nodes:t}))}}}}function Ai(e,t){let n=e.getFragment(t);if(n){let t=Mr(e.getSchema(),n.typeCondition);if(en(t))return t}}function ji(e){let t=e.getSchema(),n=Object.create(null);for(let t of e.getDocument().definitions)zr(t)&&(n[t.name.value]=t);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(r){let i=r.name.value,a=n[i],o=t?.getType(i),s;if(a?s=Mi[a.kind]:o&&(s=Ni(o)),s){if(s!==r.kind){let t=Pi(r.kind);e.reportError(new C(`Cannot extend non-${t} type "${i}".`,{nodes:a?[a,r]:r}))}}else{let a=At(i,Object.keys({...n,...t?.getTypeMap()}));e.reportError(new C(`Cannot extend type "${i}" because it is not defined.`+St(a),{nodes:r.name}))}}}const Mi={[E.SCALAR_TYPE_DEFINITION]:E.SCALAR_TYPE_EXTENSION,[E.OBJECT_TYPE_DEFINITION]:E.OBJECT_TYPE_EXTENSION,[E.INTERFACE_TYPE_DEFINITION]:E.INTERFACE_TYPE_EXTENSION,[E.UNION_TYPE_DEFINITION]:E.UNION_TYPE_EXTENSION,[E.ENUM_TYPE_DEFINITION]:E.ENUM_TYPE_EXTENSION,[E.INPUT_OBJECT_TYPE_DEFINITION]:E.INPUT_OBJECT_TYPE_EXTENSION};function Ni(e){if(Xt(e))return E.SCALAR_TYPE_EXTENSION;if(N(e))return E.OBJECT_TYPE_EXTENSION;if(P(e))return E.INTERFACE_TYPE_EXTENSION;if(F(e))return E.UNION_TYPE_EXTENSION;if(I(e))return E.ENUM_TYPE_EXTENSION;if(L(e))return E.INPUT_OBJECT_TYPE_EXTENSION;
77
+ /* c8 ignore next 3 */
78
+ Se(!1,`Unexpected type: `+k(e))}function Pi(e){switch(e){case E.SCALAR_TYPE_EXTENSION:return`scalar`;case E.OBJECT_TYPE_EXTENSION:return`object`;case E.INTERFACE_TYPE_EXTENSION:return`interface`;case E.UNION_TYPE_EXTENSION:return`union`;case E.ENUM_TYPE_EXTENSION:return`enum`;case E.INPUT_OBJECT_TYPE_EXTENSION:return`input object`;
79
+ /* c8 ignore next */
80
+ default:Se(!1,`Unexpected kind: `+k(e))}}function Fi(e){return{...Ii(e),Field:{leave(t){let n=e.getFieldDef();if(!n)return!1;let r=new Set(t.arguments?.map(e=>e.name.value));for(let i of n.args)if(!r.has(i.name)&&vn(i)){let r=k(i.type);e.reportError(new C(`Field "${n.name}" argument "${i.name}" of type "${r}" is required, but it was not provided.`,{nodes:t}))}}}}}function Ii(e){let t=Object.create(null),n=e.getSchema()?.getDirectives()??Wn;for(let e of n)t[e.name]=wt(e.args.filter(vn),e=>e.name);let r=e.getDocument().definitions;for(let e of r)if(e.kind===E.DIRECTIVE_DEFINITION){
81
+ /* c8 ignore next */
82
+ let n=e.arguments??[];t[e.name.value]=wt(n.filter(Li),e=>e.name.value)}return{Directive:{leave(n){let r=n.name.value,i=t[r];if(i){
83
+ /* c8 ignore next */
84
+ let t=n.arguments??[],a=new Set(t.map(e=>e.name.value));for(let[t,o]of Object.entries(i))if(!a.has(t)){let i=Yt(o.type)?k(o.type):A(o.type);e.reportError(new C(`Directive "@${r}" argument "${t}" of type "${i}" is required, but it was not provided.`,{nodes:n}))}}}}}}function Li(e){return e.type.kind===E.NON_NULL_TYPE&&e.defaultValue==null}function Ri(e){return{Field(t){let n=e.getType(),r=t.selectionSet;if(n){if($t(sn(n))){if(r){let i=t.name.value,a=k(n);e.reportError(new C(`Field "${i}" must not have a selection since type "${a}" has no subfields.`,{nodes:r}))}}else if(!r){let r=t.name.value,i=k(n);e.reportError(new C(`Field "${r}" of type "${i}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}else if(r.selections.length===0){let r=t.name.value,i=k(n);e.reportError(new C(`Field "${r}" of type "${i}" must have at least one field selected.`,{nodes:t}))}}}}}function zi(e){return e.map(e=>typeof e==`number`?`[`+e.toString()+`]`:`.`+e).join(``)}function Bi(e,t,n){return{prev:e,key:t,typename:n}}function Vi(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function Hi(e,t,n=Ui){return Wi(e,t,n,void 0)}function Ui(e,t,n){let r=`Invalid value `+k(t);throw e.length>0&&(r+=` at "value${zi(e)}"`),n.message=r+`: `+n.message,n}function Wi(e,t,n,r){if(z(t)){if(e!=null)return Wi(e,t.ofType,n,r);n(Vi(r),e,new C(`Expected non-nullable type "${k(t)}" not to be null.`));return}if(e==null)return null;if(R(t)){let i=t.ofType;return Kn(e)?Array.from(e,(e,t)=>{let a=Bi(r,t,void 0);return Wi(e,i,n,a)}):[Wi(e,i,n,r)]}if(L(t)){if(!xe(e)||Array.isArray(e)){n(Vi(r),e,new C(`Expected type "${t.name}" to be an object.`));return}let i=Object.create(null),a=t.getFields();for(let o of Object.values(a)){let a=e[o.name];if(a===void 0){if(o.defaultValue!==void 0)i[o.name]=o.defaultValue;else if(z(o.type)){let t=k(o.type);n(Vi(r),e,new C(`Field "${o.name}" of required type "${t}" was not provided.`))}continue}i[o.name]=Wi(a,o.type,n,Bi(r,o.name,t.name))}for(let i of Object.keys(e))if(!a[i]){let a=At(i,Object.keys(t.getFields()));n(Vi(r),e,new C(`Field "${i}" is not defined by type "${t.name}".`+St(a)))}if(t.isOneOf){let a=Object.keys(i);a.length!==1&&n(Vi(r),e,new C(`Exactly one key must be specified for OneOf type "${t.name}".`));let o=a[0],s=i[o];s===null&&n(Vi(r).concat(o),s,new C(`Field "${o}" must be non-null.`))}return{...i}}if($t(t)){let i;try{i=t.parseValue(e)}catch(i){i instanceof C?n(Vi(r),e,i):n(Vi(r),e,new C(`Expected type "${t.name}". `+i.message,{originalError:i}));return}return i===void 0&&n(Vi(r),e,new C(`Expected type "${t.name}".`)),i}
85
+ /* c8 ignore next 3 */
86
+ Se(!1,`Unexpected input type: `+k(t))}function Gi(e,t,n){if(e){if(e.kind===E.VARIABLE){let r=e.name.value;if(n==null||n[r]===void 0||!qi(n,r))return;let i=n[r];return i===null&&z(t)?void 0:i}if(z(t))return e.kind===E.NULL?void 0:Gi(e,t.ofType,n);if(e.kind===E.NULL)return null;if(R(t)){let r=t.ofType;if(e.kind===E.LIST){let t=[];for(let i of e.values)if(Ki(i,n)){if(z(r))return;t.push(null)}else{let e=Gi(i,r,n);if(e===void 0)return;t.push(e)}return t}let i=Gi(e,r,n);return i===void 0?void 0:[i]}if(L(t)){if(e.kind!==E.OBJECT)return;let r=Object.create(null),i=wt(e.fields,e=>e.name.value);for(let e of Object.values(t.getFields())){let t=i[e.name];if(!t||Ki(t.value,n)){if(e.defaultValue!==void 0)r[e.name]=e.defaultValue;else if(z(e.type))return;continue}let a=Gi(t.value,e.type,n);if(a===void 0)return;r[e.name]=a}if(t.isOneOf){let e=Object.keys(r);if(e.length!==1||r[e[0]]===null)return}return r}if($t(t)){let r;try{r=t.parseLiteral(e,n)}catch{return}return r===void 0?void 0:r}
87
+ /* c8 ignore next 3 */
88
+ Se(!1,`Unexpected input type: `+k(t))}}function Ki(e,t){return e.kind===E.VARIABLE&&(t==null||t[e.name.value]===void 0||!qi(t,e.name.value))}function qi(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ji(e,t,n){let r=Object.create(null),i=wt(t.arguments??[],e=>e.name.value);for(let a of e.args){let e=a.name,o=a.type,s=i[e];if(!s){if(a.defaultValue!==void 0)r[e]=a.defaultValue;else if(z(o))throw new C(`Argument "${e}" of required type "${k(o)}" was not provided.`,{nodes:t});continue}let c=s.value,l=c.kind===E.NULL;if(c.kind===E.VARIABLE){let t=c.name.value;if(n==null||!Xi(n,t)){if(a.defaultValue!==void 0)r[e]=a.defaultValue;else if(z(o))throw new C(`Argument "${e}" of required type "${k(o)}" was provided the variable "$${t}" which was not provided a runtime value.`,{nodes:c});continue}l=n[t]==null}if(l&&z(o))throw new C(`Argument "${e}" of non-null type "${k(o)}" must not be null.`,{nodes:c});let u=Gi(c,o,n);if(u===void 0)throw new C(`Argument "${e}" has invalid value ${A(c)}.`,{nodes:c});r[e]=u}return{...r}}function Yi(e,t,n){let r=t.directives?.find(t=>t.name.value===e.name);if(r)return Ji(e,r,n)}function Xi(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Zi(e,t,n,r,i){let a=/* @__PURE__ */ new Map;return Qi(e,t,n,r,i,a,/* @__PURE__ */ new Set),a}function Qi(e,t,n,r,i,a,o){for(let s of i.selections)switch(s.kind){case E.FIELD:{if(!$i(n,s))continue;let e=ta(s),t=a.get(e);t===void 0?a.set(e,[s]):t.push(s);break}case E.INLINE_FRAGMENT:if(!$i(n,s)||!ea(e,s,r))continue;Qi(e,t,n,r,s.selectionSet,a,o);break;case E.FRAGMENT_SPREAD:{let i=s.name.value;if(o.has(i)||!$i(n,s))continue;o.add(i);let c=t[i];if(!c||!ea(e,c,r))continue;Qi(e,t,n,r,c.selectionSet,a,o);break}}}function $i(e,t){return Yi(Bn,t,e)?.if!==!0&&Yi(zn,t,e)?.if!==!1}function ea(e,t,n){let r=t.typeCondition;if(!r)return!0;let i=Mr(e,r);return i===n?!0:tn(i)?e.isSubType(i,n):!1}function ta(e){return e.alias?e.alias.value:e.name.value}function na(e){return{OperationDefinition(t){if(t.operation===`subscription`){let n=e.getSchema(),r=n.getSubscriptionType();if(r){let i=t.name?t.name.value:null,a=Object.create(null),o=e.getDocument(),s=Object.create(null);for(let e of o.definitions)e.kind===E.FRAGMENT_DEFINITION&&(s[e.name.value]=e);let c=Zi(n,s,a,r,t.selectionSet);if(c.size>1){let t=[...c.values()].slice(1).flat();e.reportError(new C(i==null?`Anonymous Subscription must select only one top level field.`:`Subscription "${i}" must select only one top level field.`,{nodes:t}))}for(let t of c.values())t[0].name.value.startsWith(`__`)&&e.reportError(new C(i==null?`Anonymous Subscription must not select an introspection top level field.`:`Subscription "${i}" must not select an introspection top level field.`,{nodes:t}))}}}}}function ra(e,t){let n=/* @__PURE__ */ new Map;for(let r of e){let e=t(r),i=n.get(e);i===void 0?n.set(e,[r]):i.push(r)}return n}function ia(e){return{DirectiveDefinition(e){
89
+ /* c8 ignore next */
90
+ let t=e.arguments??[];return n(`@${e.name.value}`,t)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){let t=e.name.value,r=e.fields??[];for(let e of r){let r=e.name.value,i=e.arguments??[];n(`${t}.${r}`,i)}return!1}function n(t,n){let r=ra(n,e=>e.name.value);for(let[n,i]of r)i.length>1&&e.reportError(new C(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:i.map(e=>e.name)}));return!1}}function aa(e){return{Field:t,Directive:t};function t(t){let n=ra(t.arguments??[],e=>e.name.value);for(let[t,r]of n)r.length>1&&e.reportError(new C(`There can be only one argument named "${t}".`,{nodes:r.map(e=>e.name)}))}}function oa(e){let t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(r){let i=r.name.value;if(n!=null&&n.getDirective(i)){e.reportError(new C(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}return t[i]?e.reportError(new C(`There can be only one directive named "@${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1}}}function sa(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Wn;for(let e of r)t[e.name]=!e.isRepeatable;let i=e.getDocument().definitions;for(let e of i)e.kind===E.DIRECTIVE_DEFINITION&&(t[e.name.value]=!e.repeatable);let a=Object.create(null),o=Object.create(null),s=Object.create(null);return{enter(n){if(!(`directives`in n)||!n.directives)return;let r;if(n.kind===E.SCHEMA_DEFINITION||n.kind===E.SCHEMA_EXTENSION)r=a;else if(zr(n)||Vr(n)){let e=n.name.value;r=o[e],r===void 0&&(o[e]=r=Object.create(null))}else if(n.kind===E.DIRECTIVE_DEFINITION||n.kind===E.DIRECTIVE_EXTENSION){let e=n.name.value;r=s[e],r===void 0&&(s[e]=r=Object.create(null))}else r=Object.create(null);for(let i of n.directives){let n=i.name.value;t[n]&&(r[n]?e.reportError(new C(`The directive "@${n}" can only be used once at this location.`,{nodes:[r[n],i]})):r[n]=i)}}}}function ca(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){let i=t.name.value;r[i]||(r[i]=Object.create(null));
91
+ /* c8 ignore next */
92
+ let a=t.values??[],o=r[i];for(let t of a){let r=t.name.value,a=n[i];I(a)&&a.getValue(r)?e.reportError(new C(`Enum value "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):o[r]?e.reportError(new C(`Enum value "${i}.${r}" can only be defined once.`,{nodes:[o[r],t.name]})):o[r]=t.name}return!1}}function la(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(t){let i=t.name.value;r[i]||(r[i]=Object.create(null));
93
+ /* c8 ignore next */
94
+ let a=t.fields??[],o=r[i];for(let t of a){let r=t.name.value;ua(n[i],r)?e.reportError(new C(`Field "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):o[r]?e.reportError(new C(`Field "${i}.${r}" can only be defined once.`,{nodes:[o[r],t.name]})):o[r]=t.name}return!1}}function ua(e,t){return N(e)||P(e)||L(e)?e.getFields()[t]!=null:!1}function da(e){let t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){let r=n.name.value;return t[r]?e.reportError(new C(`There can be only one fragment named "${r}".`,{nodes:[t[r],n.name]})):t[r]=n.name,!1}}}function fa(e){let t=[],n=Object.create(null);return{ObjectValue:{enter(){t.push(n),n=Object.create(null)},leave(){let e=t.pop();e||Se(!1),n=e}},ObjectField(t){let r=t.name.value;n[r]?e.reportError(new C(`There can be only one input field named "${r}".`,{nodes:[n[r],t.name]})):n[r]=t.name}}}function pa(e){let t=Object.create(null);return{OperationDefinition(n){let r=n.name;return r&&(t[r.value]?e.reportError(new C(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),!1},FragmentDefinition:()=>!1}}function ma(e){let t=e.getSchema(),n=Object.create(null),r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){
95
+ /* c8 ignore next */
96
+ let i=t.operationTypes??[];for(let t of i){let i=t.operation,a=n[i];r[i]?e.reportError(new C(`Type for ${i} already defined in the schema. It cannot be redefined.`,{nodes:t})):a?e.reportError(new C(`There can be only one ${i} type in schema.`,{nodes:[a,t]})):n[i]=t}return!1}}function ha(e){let t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){let i=r.name.value;if(n!=null&&n.getType(i)){e.reportError(new C(`Type "${i}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}));return}return t[i]?e.reportError(new C(`There can be only one type named "${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1}}function ga(e){return{OperationDefinition(t){let n=ra(t.variableDefinitions??[],e=>e.variable.name.value);for(let[t,r]of n)r.length>1&&e.reportError(new C(`There can be only one variable named "$${t}".`,{nodes:r.map(e=>e.variable.name)}))}}}function _a(e){return{ListValue(t){if(!R(an(e.getParentInputType())))return va(e,t),!1},ObjectValue(t){let n=sn(e.getInputType());if(!L(n))return va(e,t),!1;let r=wt(t.fields,e=>e.name.value);for(let i of Object.values(n.getFields()))if(!r[i.name]&&Dn(i)){let r=k(i.type);e.reportError(new C(`Field "${n.name}.${i.name}" of required type "${r}" was not provided.`,{nodes:t}))}n.isOneOf&&ya(e,t,n,r)},ObjectField(t){let n=sn(e.getParentInputType());if(!e.getInputType()&&L(n)){let r=At(t.name.value,Object.keys(n.getFields()));e.reportError(new C(`Field "${t.name.value}" is not defined by type "${n.name}".`+St(r),{nodes:t}))}},NullValue(t){let n=e.getInputType();z(n)&&e.reportError(new C(`Expected value of type "${k(n)}", found ${A(t)}.`,{nodes:t}))},EnumValue:t=>va(e,t),IntValue:t=>va(e,t),FloatValue:t=>va(e,t),StringValue:t=>va(e,t),BooleanValue:t=>va(e,t)}}function va(e,t){let n=e.getInputType();if(!n)return;let r=sn(n);if(!$t(r)){let r=k(n);e.reportError(new C(`Expected value of type "${r}", found ${A(t)}.`,{nodes:t}));return}try{if(r.parseLiteral(t,void 0)===void 0){let r=k(n);e.reportError(new C(`Expected value of type "${r}", found ${A(t)}.`,{nodes:t}))}}catch(r){let i=k(n);r instanceof C?e.reportError(r):e.reportError(new C(`Expected value of type "${i}", found ${A(t)}; `+r.message,{nodes:t,originalError:r}))}}function ya(e,t,n,r){let i=Object.keys(r);if(i.length!==1){e.reportError(new C(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[t]}));return}let a=r[i[0]]?.value;(!a||a.kind===E.NULL)&&e.reportError(new C(`Field "${n.name}.${i[0]}" must be non-null.`,{nodes:[t]}))}function ba(e){return{VariableDefinition(t){let n=Mr(e.getSchema(),t.type);if(n!==void 0&&!Zt(n)){let n=t.variable.name.value,r=A(t.type);e.reportError(new C(`Variable "$${n}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}}function xa(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:n,type:i,defaultValue:a,parentType:o}of r){let r=n.name.value,s=t[r];if(s&&i){let t=e.getSchema(),c=Mr(t,s.type);if(c&&!Sa(t,c,s.defaultValue,i,a)){let t=k(c),a=k(i);e.reportError(new C(`Variable "$${r}" of type "${t}" used in position expecting type "${a}".`,{nodes:[s,n]}))}L(o)&&o.isOneOf&&rn(c)&&e.reportError(new C(`Variable "$${r}" is of type "${c}" but must be non-nullable to be used for OneOf Input Object "${o}".`,{nodes:[s,n]}))}}}},VariableDefinition(e){t[e.variable.name.value]=e}}}function Sa(e,t,n,r,i){if(z(r)&&!z(t)){if((n==null||n.kind===E.NULL)&&i===void 0)return!1;let a=r.ofType;return kn(e,t,a)}return kn(e,t,r)}const Ca=Object.freeze([ii]),wa=Object.freeze([Hr,pa,ni,na,$r,Kr,ba,Ri,Ur,da,Qr,si,ki,ai,ga,oi,ci,Yr,sa,qr,aa,_a,Fi,xa,fi,fa,...Ca]),Ta=Object.freeze([ri,ma,ha,ca,la,ia,oa,$r,Yr,sa,ji,Jr,aa,fa,Ii]);var Ea=class{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=/* @__PURE__ */ new Map,this._recursivelyReferencedFragments=/* @__PURE__ */ new Map,this._onError=t}get[Symbol.toStringTag](){return`ASTValidationContext`}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(let e of this.getDocument().definitions)e.kind===E.FRAGMENT_DEFINITION&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];let n=[e],r;for(;r=n.pop();)for(let e of r.selections)e.kind===E.FRAGMENT_SPREAD?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];let n=Object.create(null),r=[e.selectionSet],i;for(;i=r.pop();)for(let e of this.getFragmentSpreads(i)){let i=e.name.value;if(n[i]!==!0){n[i]=!0;let e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}},Da=class extends Ea{constructor(e,t,n){super(e,n),this._schema=t}get[Symbol.toStringTag](){return`SDLValidationContext`}getSchema(){return this._schema}},Oa=class extends Ea{constructor(e,t,n,r){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=/* @__PURE__ */ new Map,this._recursiveVariableUsages=/* @__PURE__ */ new Map}get[Symbol.toStringTag](){return`ValidationContext`}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){let n=[],r=new Nr(this._schema);zt(e,Fr(r,{VariableDefinition:()=>!1,Variable(e){n.push({node:e,type:r.getInputType(),defaultValue:r.getDefaultValue(),parentType:r.getParentInputType()})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(let n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}};const ka=Et(Me,e=>e.filter(e=>e!==`description`));function Aa(e,t,n=wa,r,i=new Nr(e)){let a=r?.maxErrors??100;t||S(!1,`Must provide document.`),pr(e);let o=Object.freeze({}),s=[],c=new Oa(e,t,i,e=>{if(s.length>=a)throw s.push(new C(`Too many validation errors, error limit reached. Validation aborted.`)),o;s.push(e)}),l=Bt(n.map(e=>e(c)));try{zt(t,Fr(i,l),ka)}catch(e){if(e!==o)throw e}return s}function ja(e,t,n=Ta){let r=[],i=new Da(e,t,e=>{r.push(e)});return zt(e,Bt(n.map(e=>e(i)))),r}function Ma(e){let t=ja(e);if(t.length!==0)throw Error(t.map(e=>e.message).join(`
97
+
98
+ `))}function Na(e){return e instanceof Error?e:new Pa(e)}var Pa=class extends Error{constructor(e){super(`Unexpected error value: `+k(e)),this.name=`NonErrorThrown`,this.thrownValue=e}};function Fa(e,t,n){let r=Na(e);return Ia(r)?r:new C(r.message,{nodes:r.nodes??t,source:r.source,positions:r.positions,path:n,originalError:r})}function Ia(e){return Array.isArray(e.path)}function La(e,t){let n=null;for(let r of e.definitions)if(r.kind===E.OPERATION_DEFINITION){if(t==null){if(n)return null;n=r}else if(r.name?.value===t)return r}return n}function Ra(e,t,n){let r=[],i=Object.create(null),a=Object.create(null),o=[],s,c=[];for(let e of t.definitions)if(e.kind===E.SCHEMA_DEFINITION)s=e;else if(e.kind===E.SCHEMA_EXTENSION)c.push(e);else if(zr(e))r.push(e);else if(Vr(e)){let t=e.name.value,n=i[t];i[t]=n?n.concat([e]):[e]}else if(e.kind===E.DIRECTIVE_DEFINITION)o.push(e);else if(e.kind===E.DIRECTIVE_EXTENSION){let t=e.name.value,n=a[t];a[t]=n?n.concat([e]):[e]}if(Object.keys(i).length===0&&r.length===0&&Object.keys(a).length===0&&o.length===0&&c.length===0&&s==null)return e;let l=Object.create(null);for(let t of e.types)l[t.name]=g(t);for(let e of r){let t=e.name.value;l[t]=za[t]??me(e)}let u=Object.create(null);for(let t of e.directives)u[t.name]=b(t);let d={query:e.query&&m(e.query),mutation:e.mutation&&m(e.mutation),subscription:e.subscription&&m(e.subscription),...s&&y([s]),...y(c)},f=Object.values(u);return{description:s?.description?.value,...d,types:Object.values(l),directives:[...f.map(h),...o.map(se)],extensions:Object.create(null),astNode:s??e.astNode,extensionASTNodes:e.extensionASTNodes.concat(c),assumeValid:n?.assumeValid??!1};function p(e){return R(e)?new B(p(e.ofType)):z(e)?new V(p(e.ofType)):m(e)}function m(e){return l[e.name]}function h(e){let t=e.toConfig();return new Rn({...t,args:Et(t.args,ae)})}function g(e){if(sr(e)||Fn(e))return e;if(Xt(e))return _(e);if(N(e))return ne(e);if(P(e))return re(e);if(F(e))return ie(e);if(I(e))return te(e);if(L(e))return ee(e);
99
+ /* c8 ignore next 3 */
100
+ Se(!1,`Unexpected type: `+k(e))}function ee(e){let t=e.toConfig(),n=i[t.name]??[];return new Tn({...t,fields:()=>({...Et(t.fields,e=>({...e,type:p(e.type)})),...ue(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}function te(e){let t=e.toConfig(),n=i[e.name]??[];return new Sn({...t,values:{...t.values,...de(n)},extensionASTNodes:t.extensionASTNodes.concat(n)})}function _(e){let t=e.toConfig(),n=i[t.name]??[],r=t.specifiedByURL;for(let e of n)r=Va(e)??r;return new un({...t,specifiedByURL:r,extensionASTNodes:t.extensionASTNodes.concat(n)})}function ne(e){let t=e.toConfig(),n=i[t.name]??[];return new dn({...t,interfaces:()=>[...e.getInterfaces().map(m),...fe(n)],fields:()=>({...Et(t.fields,v),...ce(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}function re(e){let t=e.toConfig(),n=i[t.name]??[];return new yn({...t,interfaces:()=>[...e.getInterfaces().map(m),...fe(n)],fields:()=>({...Et(t.fields,v),...ce(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}function ie(e){let t=e.toConfig(),n=i[t.name]??[];return new bn({...t,types:()=>[...e.getTypes().map(m),...pe(n)],extensionASTNodes:t.extensionASTNodes.concat(n)})}function v(e){return{...e,type:p(e.type),args:e.args&&Et(e.args,ae)}}function ae(e){return{...e,type:p(e.type)}}function y(e){let t={};for(let n of e){let e=n.operationTypes??[];for(let n of e)t[n.operation]=oe(n.type)}return t}function b(e){let t=e.toConfig(),n=a[t.name]??[],r=t.deprecationReason??n.map(e=>Ba(e)).find(e=>e!=null);return new Rn({...t,deprecationReason:r,extensionASTNodes:t.extensionASTNodes.concat(n)})}function oe(e){let t=e.name.value,n=za[t]??l[t];if(n===void 0)throw Error(`Unknown type: "${t}".`);return n}function x(e){return e.kind===E.LIST_TYPE?new B(x(e.type)):e.kind===E.NON_NULL_TYPE?new V(x(e.type)):oe(e)}function se(e){let t=a[e.name.value]??[],n=Ba(e)??t.map(e=>Ba(e)).find(e=>e!=null);return new Rn({name:e.name.value,description:e.description?.value,locations:e.locations.map(({value:e})=>e),isRepeatable:e.repeatable,args:le(e.arguments),deprecationReason:n,astNode:e,extensionASTNodes:t})}function ce(e){let t=Object.create(null);for(let n of e){let e=n.fields??[];for(let n of e)t[n.name.value]={type:x(n.type),description:n.description?.value,args:le(n.arguments),deprecationReason:Ba(n),astNode:n}}return t}function le(e){let t=e??[],n=Object.create(null);for(let e of t){let t=x(e.type);n[e.name.value]={type:t,description:e.description?.value,defaultValue:Gi(e.defaultValue,t),deprecationReason:Ba(e),astNode:e}}return n}function ue(e){let t=Object.create(null);for(let n of e){let e=n.fields??[];for(let n of e){let e=x(n.type);t[n.name.value]={type:e,description:n.description?.value,defaultValue:Gi(n.defaultValue,e),deprecationReason:Ba(n),astNode:n}}}return t}function de(e){let t=Object.create(null);for(let n of e){let e=n.values??[];for(let n of e)t[n.name.value]={description:n.description?.value,deprecationReason:Ba(n),astNode:n}}return t}function fe(e){return e.flatMap(e=>e.interfaces?.map(oe)??[])}function pe(e){return e.flatMap(e=>e.types?.map(oe)??[])}function me(e){let t=e.name.value,n=i[t]??[];switch(e.kind){case E.OBJECT_TYPE_DEFINITION:{let r=[e,...n];return new dn({name:t,description:e.description?.value,interfaces:()=>fe(r),fields:()=>ce(r),astNode:e,extensionASTNodes:n})}case E.INTERFACE_TYPE_DEFINITION:{let r=[e,...n];return new yn({name:t,description:e.description?.value,interfaces:()=>fe(r),fields:()=>ce(r),astNode:e,extensionASTNodes:n})}case E.ENUM_TYPE_DEFINITION:{let r=[e,...n];return new Sn({name:t,description:e.description?.value,values:de(r),astNode:e,extensionASTNodes:n})}case E.UNION_TYPE_DEFINITION:{let r=[e,...n];return new bn({name:t,description:e.description?.value,types:()=>pe(r),astNode:e,extensionASTNodes:n})}case E.SCALAR_TYPE_DEFINITION:return new un({name:t,description:e.description?.value,specifiedByURL:Va(e),astNode:e,extensionASTNodes:n});case E.INPUT_OBJECT_TYPE_DEFINITION:{let r=[e,...n];return new Tn({name:t,description:e.description?.value,fields:()=>ue(r),astNode:e,extensionASTNodes:n,isOneOf:Ha(e)})}}}}const za=wt([...Pn,...or],e=>e.name);function Ba(e){return Yi(Vn,e)?.reason}function Va(e){return Yi(Hn,e)?.url}function Ha(e){return!!Yi(Un,e)}function Ua(e,t){e!=null&&e.kind===E.DOCUMENT||S(!1,`Must provide valid Document AST.`),t?.assumeValid!==!0&&t?.assumeValidSDL!==!0&&Ma(e);let n=Ra({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(n.astNode==null)for(let e of n.types)switch(e.name){case`Query`:n.query=e;break;case`Mutation`:n.mutation=e;break;case`Subscription`:n.subscription=e}let r=[...n.directives,...Wn.filter(e=>n.directives.every(t=>t.name!==e.name))];return new ur({...n,directives:r})}function Wa(e,t){return Ua(vt(e,{noLocation:t?.noLocation,allowLegacyFragmentVariables:t?.allowLegacyFragmentVariables,experimentalDirectivesOnDirectiveDefinitions:t?.experimentalDirectivesOnDirectiveDefinitions}),{assumeValidSDL:t?.assumeValidSDL,assumeValid:t?.assumeValid})}const Ga=e=>Array.isArray(e)?e:e?[e]:[];function G(e){return Ka(e,[])}function Ka(e,t){switch(typeof e){case`string`:return JSON.stringify(e);case`function`:return e.name?`[function ${e.name}]`:`[function]`;case`object`:return Ja(e,t);default:return String(e)}}function qa(e){return(e.name=`GraphQLError`)?e.toString():`${e.name}: ${e.message};\n ${e.stack}`}function Ja(e,t){if(e===null)return`null`;if(e instanceof Error)return e.name===`AggregateError`?qa(e)+`
101
+ `+Za(e.errors,t):qa(e);if(t.includes(e))return`[Circular]`;let n=[...t,e];if(Ya(e)){let t=e.toJSON();if(t!==e)return typeof t==`string`?t:Ka(t,n)}else if(Array.isArray(e))return Za(e,n);return Xa(e,n)}function Ya(e){return typeof e.toJSON==`function`}function Xa(e,t){let n=Object.entries(e);return n.length===0?`{}`:t.length>3?`[`+Qa(e)+`]`:`{ `+n.map(([e,n])=>e+`: `+Ka(n,t)).join(`, `)+` }`}function Za(e,t){if(e.length===0)return`[]`;if(t.length>3)return`[Array]`;let n=e.length,r=[];for(let i=0;i<n;++i)r.push(Ka(e[i],t));return`[`+r.join(`, `)+`]`}function Qa(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,``).replace(/]$/,``);if(t===`Object`&&typeof e.constructor==`function`){let t=e.constructor.name;if(typeof t==`string`&&t!==``)return t}return t}var K;(function(e){e.TYPE=`MapperKind.TYPE`,e.SCALAR_TYPE=`MapperKind.SCALAR_TYPE`,e.ENUM_TYPE=`MapperKind.ENUM_TYPE`,e.COMPOSITE_TYPE=`MapperKind.COMPOSITE_TYPE`,e.OBJECT_TYPE=`MapperKind.OBJECT_TYPE`,e.INPUT_OBJECT_TYPE=`MapperKind.INPUT_OBJECT_TYPE`,e.ABSTRACT_TYPE=`MapperKind.ABSTRACT_TYPE`,e.UNION_TYPE=`MapperKind.UNION_TYPE`,e.INTERFACE_TYPE=`MapperKind.INTERFACE_TYPE`,e.ROOT_OBJECT=`MapperKind.ROOT_OBJECT`,e.QUERY=`MapperKind.QUERY`,e.MUTATION=`MapperKind.MUTATION`,e.SUBSCRIPTION=`MapperKind.SUBSCRIPTION`,e.DIRECTIVE=`MapperKind.DIRECTIVE`,e.FIELD=`MapperKind.FIELD`,e.COMPOSITE_FIELD=`MapperKind.COMPOSITE_FIELD`,e.OBJECT_FIELD=`MapperKind.OBJECT_FIELD`,e.ROOT_FIELD=`MapperKind.ROOT_FIELD`,e.QUERY_ROOT_FIELD=`MapperKind.QUERY_ROOT_FIELD`,e.MUTATION_ROOT_FIELD=`MapperKind.MUTATION_ROOT_FIELD`,e.SUBSCRIPTION_ROOT_FIELD=`MapperKind.SUBSCRIPTION_ROOT_FIELD`,e.INTERFACE_FIELD=`MapperKind.INTERFACE_FIELD`,e.INPUT_OBJECT_FIELD=`MapperKind.INPUT_OBJECT_FIELD`,e.ARGUMENT=`MapperKind.ARGUMENT`,e.ENUM_VALUE=`MapperKind.ENUM_VALUE`})(K||={});function $a(e,t){if(t){let n=e[t.name];if(N(n))return n}}function eo(e){if(`getFields`in e){let t=e.getFields();for(let e in t)return t[e].name===`_fake`}return!1}function to(e){switch(e.name){case jn.name:return jn;case Mn.name:return Mn;case H.name:return H;case U.name:return U;case Nn.name:return Nn;default:return e}}function no(e,t){let n=Object.create(null);for(let t in e)n[t]=e[t];let r=Object.create(null);for(let e in n){let t=n[e];if(t==null||e.startsWith(`__`))continue;let i=t.name;if(!i.startsWith(`__`)){if(r[i]!=null){console.warn(`Duplicate schema type name ${i} found; keeping the existing one found in the schema`);continue}r[i]=t}}for(let e in r)r[e]=o(r[e]);return{typeMap:r,directives:t.map(e=>i(e))};function i(e){if(Gn(e))return e;let t=e.toConfig();return t.args=a(t.args),new Rn(t)}function a(e){let t={};for(let n in e){let r=e[n],i=u(r.type);i!=null&&(r.type=i,t[n]=r)}return t}function o(e){if(N(e)){let t=e.toConfig();return new dn({...t,fields:()=>s(t.fields),interfaces:()=>l(t.interfaces)})}if(P(e)){let t=e.toConfig(),n={...t,fields:()=>s(t.fields)};return`interfaces`in n&&(n.interfaces=()=>l(t.interfaces)),new yn(n)}if(F(e)){let t=e.toConfig();return new bn({...t,types:()=>l(t.types)})}if(L(e)){let t=e.toConfig();return new Tn({...t,fields:()=>c(t.fields)})}if(I(e))return new Sn(e.toConfig());if(Xt(e))return Fn(e)?e:new un(e.toConfig());throw Error(`Unexpected schema type: ${e}`)}function s(e){let t={};for(let n in e){let r=e[n],i=u(r.type);i!=null&&r.args&&(r.type=i,r.args=a(r.args),t[n]=r)}return t}function c(e){let t={};for(let n in e){let r=e[n],i=u(r.type);i!=null&&(r.type=i,t[n]=r)}return t}function l(e){let t=[];for(let n of e){let e=u(n);e!=null&&t.push(e)}return t}function u(e){if(R(e)){let t=u(e.ofType);return t==null?null:new B(t)}if(z(e)){let t=u(e.ofType);return t==null?null:new V(t)}if(on(e)){let t=n[e.name];return t===void 0&&(t=eo(e)?to(e):o(e),r[t.name]=n[e.name]=t),t==null?null:r[t.name]}return null}}function ro(e,t,n=null,r=null){if(t==null)return t;let i=an(e);if($t(i))return n==null?t:n(i,t);if(R(i))return Ga(t).map(e=>ro(i.ofType,e,n,r));if(L(i)){let e=i.getFields(),a={};for(let i in t){let o=e[i];o!=null&&(a[i]=ro(o.type,t[i],n,r))}return r==null?a:r(i,a)}}function io(e,t){return ro(e,t,(e,t)=>{try{return e.serialize(t)}catch{return t}})}function ao(e,t){return ro(e,t,(e,t)=>{try{return e.parseValue(t)}catch{return t}})}function oo(e,t={}){let n=mo(po(co(uo(lo(co(uo(e.getTypeMap(),e,io),e,t,e=>$t(e)),e,t),e,ao),e,t,e=>!$t(e)),e,t),e,t),{typeMap:r,directives:i}=no(n,ho(e.getDirectives(),e,t));return new ur({...e.toConfig(),query:$a(r,$a(n,e.getQueryType())),mutation:$a(r,$a(n,e.getMutationType())),subscription:$a(r,$a(n,e.getSubscriptionType())),types:Object.values(r),directives:i})}const so=[`String`,`ID`,`Int`,`Float`,`Boolean`];function co(e,t,n,r=()=>!0){let i={};for(let a in e)if(!a.startsWith(`__`)&&!so.includes(a)){let o=e[a];if(o==null||!r(o)){i[a]=o;continue}let s=_o(t,n,a);if(s==null){i[a]=o;continue}let c=s(o,t);if(c===void 0){i[a]=o;continue}i[a]=c}return i}function lo(e,t,n){let r=So(n);return r?co(e,t,{[K.ENUM_TYPE]:e=>{let n=e.toConfig(),i=n.values,a={};for(let n in i){let o=i[n],s=r(o,e.name,t,n);if(s===void 0)a[n]=o;else if(Array.isArray(s)){let[e,t]=s;a[e]=t===void 0?o:t}else s!==null&&(a[n]=s)}return Co(new Sn({...n,values:a}))}},e=>I(e)):e}function uo(e,t,n){let r=mo(e,t,{[K.ARGUMENT]:t=>{if(t.defaultValue===void 0)return t;let r=fo(e,t.type);if(r!=null)return{...t,defaultValue:n(r,t.defaultValue)}}});return po(r,t,{[K.INPUT_OBJECT_FIELD]:e=>{if(e.defaultValue===void 0)return e;let t=fo(r,e.type);if(t!=null)return{...e,defaultValue:n(t,e.defaultValue)}}})}function fo(e,t){if(R(t)){let n=fo(e,t.ofType);return n==null?null:new B(n)}if(z(t)){let n=fo(e,t.ofType);return n==null?null:new V(n)}return on(t)?e[t.name]??null:null}function po(e,t,n){let r={};for(let i in e)if(!i.startsWith(`__`)){let a=e[i];if(!N(a)&&!P(a)&&!L(a)){r[i]=a;continue}let o=yo(t,n,i);if(o==null){r[i]=a;continue}let s=a.toConfig(),c=s.fields,l={};for(let e in c){let n=c[e],r=o(n,e,i,t);if(r===void 0)l[e]=n;else if(Array.isArray(r)){let[e,t]=r;t.astNode!=null&&(t.astNode={...t.astNode,name:{...t.astNode.name,value:e}}),l[e]=t===void 0?n:t}else r!==null&&(l[e]=r)}r[i]=N(a)?Co(new dn({...s,fields:l})):P(a)?Co(new yn({...s,fields:l})):Co(new Tn({...s,fields:l}))}return r}function mo(e,t,n){let r={};for(let i in e)if(!i.startsWith(`__`)){let a=e[i];if(!N(a)&&!P(a)){r[i]=a;continue}let o=bo(n);if(o==null){r[i]=a;continue}let s=a.toConfig(),c=s.fields,l={};for(let e in c){let n=c[e],r=n.args;if(r==null){l[e]=n;continue}let a=Object.keys(r);if(!a.length){l[e]=n;continue}let s={};for(let n of a){let a=r[n],c=o(a,e,i,t);if(c===void 0)s[n]=a;else if(Array.isArray(c)){let[e,t]=c;s[e]=t}else c!==null&&(s[n]=c)}l[e]={...n,args:s}}r[i]=N(a)?new dn({...s,fields:l}):P(a)?new yn({...s,fields:l}):new Tn({...s,fields:l})}return r}function ho(e,t,n){let r=xo(n);if(r==null)return e.slice();let i=[];for(let n of e){let e=r(n,t);e===void 0?i.push(n):e!==null&&i.push(e)}return i}function go(e,t){let n=e.getType(t),r=[K.TYPE];return N(n)?(r.push(K.COMPOSITE_TYPE,K.OBJECT_TYPE),t===e.getQueryType()?.name?r.push(K.ROOT_OBJECT,K.QUERY):t===e.getMutationType()?.name?r.push(K.ROOT_OBJECT,K.MUTATION):t===e.getSubscriptionType()?.name&&r.push(K.ROOT_OBJECT,K.SUBSCRIPTION)):L(n)?r.push(K.INPUT_OBJECT_TYPE):P(n)?r.push(K.COMPOSITE_TYPE,K.ABSTRACT_TYPE,K.INTERFACE_TYPE):F(n)?r.push(K.COMPOSITE_TYPE,K.ABSTRACT_TYPE,K.UNION_TYPE):I(n)?r.push(K.ENUM_TYPE):Xt(n)&&r.push(K.SCALAR_TYPE),r}function _o(e,t,n){let r=go(e,n),i,a=[...r];for(;!i&&a.length>0;)i=t[a.pop()];return i??null}function vo(e,t){let n=e.getType(t),r=[K.FIELD];return N(n)?(r.push(K.COMPOSITE_FIELD,K.OBJECT_FIELD),t===e.getQueryType()?.name?r.push(K.ROOT_FIELD,K.QUERY_ROOT_FIELD):t===e.getMutationType()?.name?r.push(K.ROOT_FIELD,K.MUTATION_ROOT_FIELD):t===e.getSubscriptionType()?.name&&r.push(K.ROOT_FIELD,K.SUBSCRIPTION_ROOT_FIELD)):P(n)?r.push(K.COMPOSITE_FIELD,K.INTERFACE_FIELD):L(n)&&r.push(K.INPUT_OBJECT_FIELD),r}function yo(e,t,n){let r=vo(e,n),i,a=[...r];for(;!i&&a.length>0;)i=t[a.pop()];return i??null}function bo(e){return e[K.ARGUMENT]??null}function xo(e){return e[K.DIRECTIVE]??null}function So(e){return e[K.ENUM_VALUE]??null}function Co(e){if(N(e)){let t=e.toConfig();if(t.astNode!=null){let e=[];for(let n in t.fields){let r=t.fields[n];r.astNode!=null&&e.push(r.astNode)}t.astNode={...t.astNode,kind:E.OBJECT_TYPE_DEFINITION,fields:e}}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(e=>({...e,kind:E.OBJECT_TYPE_EXTENSION,fields:void 0}))),new dn(t)}if(P(e)){let t=e.toConfig();if(t.astNode!=null){let e=[];for(let n in t.fields){let r=t.fields[n];r.astNode!=null&&e.push(r.astNode)}t.astNode={...t.astNode,kind:E.INTERFACE_TYPE_DEFINITION,fields:e}}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(e=>({...e,kind:E.INTERFACE_TYPE_EXTENSION,fields:void 0}))),new yn(t)}if(L(e)){let t=e.toConfig();if(t.astNode!=null){let e=[];for(let n in t.fields){let r=t.fields[n];r.astNode!=null&&e.push(r.astNode)}t.astNode={...t.astNode,kind:E.INPUT_OBJECT_TYPE_DEFINITION,fields:e}}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(e=>({...e,kind:E.INPUT_OBJECT_TYPE_EXTENSION,fields:void 0}))),new Tn(t)}if(I(e)){let t=e.toConfig();if(t.astNode!=null){let e=[];for(let n in t.values){let r=t.values[n];r.astNode!=null&&e.push(r.astNode)}t.astNode={...t.astNode,values:e}}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(e=>({...e,values:void 0}))),new Sn(t)}return e}function wo(e){return To(e.getTypeMap(),e.getDirectives()),e}function To(e,t){let n=Object.create(null);for(let t in e){let r=e[t];if(r==null||t.startsWith(`__`))continue;let i=r.name;if(!i.startsWith(`__`)){if(n[i]!=null){console.warn(`Duplicate schema type name ${i} found; keeping the existing one found in the schema`);continue}n[i]=r}}for(let t in n)e[t]=n[t];for(let e of t)e.args=e.args.filter(e=>(e.type=c(e.type),e.type!==null));for(let t in e){let i=e[t];!t.startsWith(`__`)&&t in n&&i!=null&&r(i)}for(let t in e)!t.startsWith(`__`)&&!(t in n)&&delete e[t];function r(e){if(N(e)){i(e),a(e);return}if(P(e)){i(e),`getInterfaces`in e&&a(e);return}if(F(e)){s(e);return}if(L(e)){o(e);return}if(!$t(e))throw Error(`Unexpected schema type: ${e}`)}function i(e){let t=e.getFields();for(let[e,n]of Object.entries(t))n.args.map(e=>(e.type=c(e.type),e.type===null?null:e)).filter(Boolean),n.type=c(n.type),n.type===null&&delete t[e]}function a(e){if(`getInterfaces`in e){let t=e.getInterfaces();t.push(...t.splice(0).map(e=>c(e)).filter(Boolean))}}function o(e){let t=e.getFields();for(let[e,n]of Object.entries(t))n.type=c(n.type),n.type===null&&delete t[e]}function s(e){let t=e.getTypes();t.push(...t.splice(0).map(e=>c(e)).filter(Boolean))}function c(t){if(R(t)){let e=c(t.ofType);return e==null?null:new B(e)}if(z(t)){let e=c(t.ofType);return e==null?null:new V(e)}if(on(t)){let n=e[t.name];if(n&&t!==n)return n}return t}}function Eo(e,t){let n=e.getTypeMap();for(let e in n){let r=n[e];if(!sn(r).name.startsWith(`__`)&&N(r)){let n=r.getFields();for(let r in n){let i=n[r];t(i,e,r)}}}}function Do(e,t){let n=e.getTypeMap();for(let e in n){let r=n[e];if(!sn(r).name.startsWith(`__`)){if(N(r)){let e=r.getFields();for(let n in e){let r=e[n];for(let e of r.args)e.defaultValue=t(e.type,e.defaultValue)}}else if(L(r)){let e=r.getFields();for(let n in e){let r=e[n];r.defaultValue=t(r.type,r.defaultValue)}}}}}function Oo(e,t={}){let{requireResolversForArgs:n,requireResolversForNonScalar:r,requireResolversForAllFields:i}=t;if(i&&(n||r))throw TypeError(`requireResolversForAllFields takes precedence over the more specific assertions. Please configure either requireResolversForAllFields or requireResolversForArgs / requireResolversForNonScalar, but not a combination of them.`);Eo(e,(e,t,a)=>{i&&ko(`requireResolversForAllFields`,i,e,t,a),n&&e.args.length>0&&ko(`requireResolversForArgs`,n,e,t,a),r!==`ignore`&&!Xt(sn(e.type))&&ko(`requireResolversForNonScalar`,r,e,t,a)})}function ko(e,t,n,r,i){if(!n.resolve){let n=`Resolver missing for "${r}.${i}".
102
+ To disable this validator, use:
103
+ resolverValidationOptions: {
104
+ ${e}: 'ignore'
105
+ }`;if(t===`error`)throw Error(n);t===`warn`&&console.warn(n);return}if(typeof n.resolve!=`function`)throw Error(`Resolver "${r}.${i}" must be a function`)}function Ao(e,t){oo(e,{[K.ABSTRACT_TYPE]:e=>{if(!e.resolveType){let n=`Type "${e.name}" is missing a "__resolveType" resolver. Pass 'ignore' into "resolverValidationOptions.requireResolversForResolveType" to disable this error.`;if(t===`error`)throw Error(n);t===`warn`&&console.warn(n)}}})}function jo(e,t){let n={},r=e.getTypeMap();for(let e in r){let i=r[e];if(`getInterfaces`in i){n[e]={};for(let r of i.getInterfaces())if(t[r.name])for(let i in t[r.name])(i===`__isTypeOf`||!i.startsWith(`__`))&&(n[e][i]=t[r.name][i]);let r=t[e];n[e]={...n[e],...r}}else{let r=t[e];r!=null&&(n[e]=r)}}return n}function Mo({schema:e,resolvers:t,defaultFieldResolver:n,resolverValidationOptions:r={},inheritResolversFromInterfaces:i=!1,updateResolversInPlace:a=!1}){let{requireResolversToMatchSchema:o=`error`,requireResolversForResolveType:s}=r,c=i?jo(e,t):t;for(let t in c){let n=c[t];if(typeof n!=`object`)throw Error(`"${t}" defined in resolvers, but has invalid value "${n}". The resolver's value must be of type object.`);let r=e.getType(t);if(r==null){let e=`"${t}" defined in resolvers, but not in schema`;if(o&&o!==`error`){o===`warn`&&console.warn(e);continue}throw Error(e)}if(Fn(r))for(let e in n)e.startsWith(`__`)?r[e.substring(2)]=n[e]:r[e]=n[e];else if(I(r)){let e=r.getValues();for(let t in n)if(!t.startsWith(`__`)&&!e.some(e=>e.name===t)&&o&&o!==`ignore`){let e=`${r.name}.${t} was defined in resolvers, but not present within ${r.name}`;if(o===`error`)throw Error(e);console.warn(e)}}else if(F(r)){for(let e in n)if(!e.startsWith(`__`)&&o&&o!==`ignore`){let t=`${r.name}.${e} was defined in resolvers, but ${r.name} is not an object or interface type`;if(o===`error`)throw Error(t);console.warn(t)}}else if(N(r)||P(r)){for(let e in n)if(!e.startsWith(`__`)){if(r.getFields()[e]==null){if(o&&o!==`ignore`){let n=`${t}.${e} defined in resolvers, but not in schema`;if(o===`error`)throw Error(n);console.error(n)}}else{let r=n[e];if(typeof r!=`function`&&typeof r!=`object`)throw Error(`Resolver ${t}.${e} must be object or function`)}}}}return e=a?No(e,c,n):Po(e,c,n),s&&s!==`ignore`&&Ao(e,s),e}function No(e,t,n){let r=e.getTypeMap();for(let n in t){let i=e.getType(n),a=t[n];if(Xt(i))for(let e in a)e.startsWith(`__`)?i[e.substring(2)]=a[e]:e===`astNode`&&i.astNode!=null?i.astNode={...i.astNode,description:a?.astNode?.description??i.astNode.description,directives:(i.astNode.directives??[]).concat(a?.astNode?.directives??[])}:e===`extensionASTNodes`&&i.extensionASTNodes!=null?i.extensionASTNodes=i.extensionASTNodes.concat(a?.extensionASTNodes??[]):e===`extensions`&&i.extensions!=null&&a.extensions!=null?i.extensions=Object.assign(Object.create(null),i.extensions,a.extensions):i[e]=a[e];else if(I(i)){let e=i.toConfig(),t=e.values;for(let n in a)n.startsWith(`__`)?e[n.substring(2)]=a[n]:n===`astNode`&&e.astNode!=null?e.astNode={...e.astNode,description:a?.astNode?.description??e.astNode.description,directives:(e.astNode.directives??[]).concat(a?.astNode?.directives??[])}:n===`extensionASTNodes`&&e.extensionASTNodes!=null?e.extensionASTNodes=e.extensionASTNodes.concat(a?.extensionASTNodes??[]):n===`extensions`&&i.extensions!=null&&a.extensions!=null?i.extensions=Object.assign(Object.create(null),i.extensions,a.extensions):t[n]&&(t[n].value=a[n]);r[n]=new Sn(e)}else if(F(i))for(let e in a)e.startsWith(`__`)&&(i[e.substring(2)]=a[e]);else if(N(i)||P(i))for(let e in a){if(e.startsWith(`__`)){i[e.substring(2)]=a[e];continue}let t=i.getFields()[e];if(t!=null){let n=a[e];typeof n==`function`?t.resolve=n.bind(a):Fo(t,n)}}}return Do(e,io),wo(e),Do(e,ao),n!=null&&Eo(e,e=>{e.resolve||=n}),e}function Po(e,t,n){return e=oo(e,{[K.SCALAR_TYPE]:e=>{let n=e.toConfig(),r=t[e.name];if(!Fn(e)&&r!=null){for(let t in r)t.startsWith(`__`)?n[t.substring(2)]=r[t]:t===`astNode`&&n.astNode!=null?n.astNode={...n.astNode,description:r?.astNode?.description??n.astNode.description,directives:(n.astNode.directives??[]).concat(r?.astNode?.directives??[])}:t===`extensionASTNodes`&&n.extensionASTNodes!=null?n.extensionASTNodes=n.extensionASTNodes.concat(r?.extensionASTNodes??[]):t===`extensions`&&n.extensions!=null&&r.extensions!=null?n.extensions=Object.assign(Object.create(null),e.extensions,r.extensions):n[t]=r[t];return new un(n)}},[K.ENUM_TYPE]:e=>{let n=t[e.name],r=e.toConfig(),i=r.values;if(n!=null){for(let t in n)t.startsWith(`__`)?r[t.substring(2)]=n[t]:t===`astNode`&&r.astNode!=null?r.astNode={...r.astNode,description:n?.astNode?.description??r.astNode.description,directives:(r.astNode.directives??[]).concat(n?.astNode?.directives??[])}:t===`extensionASTNodes`&&r.extensionASTNodes!=null?r.extensionASTNodes=r.extensionASTNodes.concat(n?.extensionASTNodes??[]):t===`extensions`&&r.extensions!=null&&n.extensions!=null?r.extensions=Object.assign(Object.create(null),e.extensions,n.extensions):i[t]&&(i[t].value=n[t]);return new Sn(r)}},[K.UNION_TYPE]:e=>{let n=t[e.name];if(n!=null){let t=e.toConfig();return n.__resolveType&&(t.resolveType=n.__resolveType),new bn(t)}},[K.OBJECT_TYPE]:e=>{let n=t[e.name];if(n!=null){let t=e.toConfig();return n.__isTypeOf&&(t.isTypeOf=n.__isTypeOf),new dn(t)}},[K.INTERFACE_TYPE]:e=>{let n=t[e.name];if(n!=null){let t=e.toConfig();return n.__resolveType&&(t.resolveType=n.__resolveType),new yn(t)}},[K.COMPOSITE_FIELD]:(e,n,r)=>{let i=t[r];if(i!=null){let t=i[n];if(t!=null){let n={...e};return typeof t==`function`?n.resolve=t.bind(i):Fo(n,t),n}}}}),n!=null&&(e=oo(e,{[K.OBJECT_FIELD]:e=>({...e,resolve:e.resolve==null?n:e.resolve})})),e}function Fo(e,t){for(let n in t)e[n]=t[n]}function Io(e,t){return String(e)<String(t)?-1:+(String(e)>String(t))}function Lo(e){let t;return`alias`in e&&(t=e.alias?.value),t==null&&`name`in e&&(t=e.name?.value),t??=e.kind,t}function Ro(e,t,n){let r=Lo(e),i=Lo(t);return typeof n==`function`?n(r,i):Io(r,i)}function zo(e){return e!=null}const Bo=[`message`,`locations`,`path`,`nodes`,`source`,`positions`,`originalError`,`name`,`stack`,`extensions`,`coordinate`];function Vo(e){return typeof e==`object`&&!!e&&Object.keys(e).every(e=>Bo.includes(e))}function Ho(e,t){t?.originalError&&!(t.originalError instanceof Error)&&Vo(t.originalError)&&(t.originalError=Ho(t.originalError.message,t.originalError));let n=C,r=be.major>=16?new n(e,t):new n(e,t?.nodes,t?.source,t?.positions,t?.path,t?.originalError,t?.extensions);return t?.coordinate&&r.coordinate==null&&Object.defineProperties(r,{coordinate:{value:t.coordinate,enumerable:!0,configurable:!0}}),r}function Uo(e){return typeof e==`object`&&!!e&&Symbol.iterator in e}function Wo(e){return typeof e==`object`&&!!e}function Go(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ko(e,t,n={}){let r={},i=(t.arguments??[]).reduce((e,t)=>({...e,[t.name.value]:t}),{});for(let a of e.args){let e=i[a.name];if(!e){if(`default`in a&&a.default)r[a.name]=`value`in a.default?a.default.value:Kt(a.default.literal);else if(a.defaultValue!==void 0)r[a.name]=a.defaultValue;else if(z(a.type))throw Ho(`Argument "${a.name}" of required type "${G(a.type)}" was not provided.`,{nodes:[t]});continue}let o=e.value,s=o.kind===E.NULL;if(o.kind===E.VARIABLE){let e=o.name.value;if(n==null||!Go(n,e)){if(a.defaultValue!==void 0)r[a.name]=a.defaultValue;else if(z(a.type))throw Ho(`Argument "${a.name}" of required type "${G(a.type)}" was provided the variable "$${e}" which was not provided a runtime value.`,{nodes:[o]});continue}s=n[e]==null}if(s&&z(a.type))throw Ho(`Argument "${a.name}" of non-null type "${G(a.type)}" must not be null.`,{nodes:[o]});let c=Gi(o,a.type,n);if(c===void 0)throw Ho(`Argument "${a.name}" has invalid value ${A(o)}.`,{nodes:[o]});r[a.name]=c}return r}function qo(e){let t=/* @__PURE__ */ new WeakMap;return function(n){let r=t.get(n);if(r===void 0){let r=e(n);return t.set(n,r),r}return r}}function Jo(e,t,n=[`directives`]){let r={};if(e.extensions){let t=e.extensions;for(let e of n)t=t?.[e];if(t!=null)for(let e in t){let n=t[e],i=e;if(Array.isArray(n))for(let e of n){let t=r[i];t||(t=[],r[i]=t),t.push(e)}else{let e=r[i];e||(e=[],r[i]=e),e.push(n)}}}let i=qo(e=>JSON.stringify(e)),a=[];e.astNode&&a.push(e.astNode),e.extensionASTNodes&&a.push(...e.extensionASTNodes);for(let e of a)if(e.directives?.length)for(let n of e.directives){let e=n.name.value,o=r[e];o||(o=[],r[e]=o);let s=t?.getDirective(e),c={};if(s&&(c=Ko(s,n)),n.arguments)for(let e of n.arguments){let t=e.name.value;if(c[t]==null){let n=s?.args.find(e=>e.name===t);n&&(c[t]=Gi(e.value,n.type))}c[t]??(c[t]=Kt(e.value))}if(a.length>0&&o.length>0){let e=i(c);if(o.some(t=>i(t)===e))continue}o.push(c)}return r}function Yo(e,t=[`directives`]){let n=Jo(e,void 0,t);return Object.entries(n).map(([e,t])=>t?.map(t=>({name:e,args:t}))).flat(1/0).filter(Boolean)}function Xo(e){if(z(e)){let t=Xo(e.ofType);if(t.kind===E.NON_NULL_TYPE)throw Error(`Invalid type node ${G(e)}. Inner type of non-null type cannot be a non-null type.`);return{kind:E.NON_NULL_TYPE,type:t}}return R(e)?{kind:E.LIST_TYPE,type:Xo(e.ofType)}:{kind:E.NAMED_TYPE,name:{kind:E.NAME,value:e.name}}}function Zo(e){if(e===null)return{kind:E.NULL};if(e===void 0)return null;if(Array.isArray(e)){let t=[];for(let n of e){let e=Zo(n);e!=null&&t.push(e)}return{kind:E.LIST,values:t}}if(typeof e==`object`){if(e?.toJSON)return Zo(e.toJSON());let t=[];for(let n in e){let r=e[n],i=Zo(r);i&&t.push({kind:E.OBJECT_FIELD,name:{kind:E.NAME,value:n},value:i})}return{kind:E.OBJECT,fields:t}}if(typeof e==`boolean`)return{kind:E.BOOLEAN,value:e};if(typeof e==`bigint`)return{kind:E.INT,value:String(e)};if(typeof e==`number`&&isFinite(e)){let t=String(e);return Qo.test(t)?{kind:E.INT,value:t}:{kind:E.FLOAT,value:t}}if(typeof e==`string`)return{kind:E.STRING,value:e};throw TypeError(`Cannot convert value to AST: ${e}.`)}const Qo=/^-?(?:0|[1-9][0-9]*)$/;function $o(e,t){if(z(t)){let n=$o(e,t.ofType);return n?.kind===E.NULL?null:n}if(e===null)return{kind:E.NULL};if(e===void 0)return null;if(R(t)){let n=t.ofType;if(Uo(e)){let t=[];for(let r of e){let e=$o(r,n);e!=null&&t.push(e)}return{kind:E.LIST,values:t}}return $o(e,n)}if(L(t)){if(!Wo(e))return null;let n=[];for(let r of Object.values(t.getFields())){let t=$o(e[r.name],r.type);t&&n.push({kind:E.OBJECT_FIELD,name:{kind:E.NAME,value:r.name},value:t})}return{kind:E.OBJECT,fields:n}}if($t(t)){if(I(t)){let n=t.getValues();for(let t of n){if(t.value===e){e=t.name;break}if(t.name===e){e=t.name;break}}return{kind:E.ENUM,value:e}}if(e=t.serialize(e),e==null)return null;if(t.name===`ID`&&typeof e==`string`&&es.test(e))return{kind:E.INT,value:e}}return Zo(e)}const es=/^-?(?:0|[1-9][0-9]*)$/,ts=e=>`default`in e?e.default?`value`in e.default?Zo(e.default.value)??void 0:$o(Kt(e.default.literal),e.type)??void 0:void 0:e.defaultValue===void 0?void 0:$o(e.defaultValue,e.type)??void 0;function ns(e){if(e.astNode?.description)return{...e.astNode.description,block:!0};if(e.description)return{kind:E.STRING,value:e.description,block:!0}}const rs=qo(function(e){let t=/* @__PURE__ */ new Map,n=e.getQueryType();n&&t.set(`query`,n);let r=e.getMutationType();r&&t.set(`mutation`,r);let i=e.getSubscriptionType();return i&&t.set(`subscription`,i),t});function is(e,t={}){let n=t.pathToDirectivesInExtensions,r=e.getTypeMap(),i=as(e,n),a=i==null?[]:[i],o=e.getDirectives();for(let t of o)Gn(t)||a.push(os(t,e,n));for(let t in r){let i=r[t],o=Fn(i),s=sr(i);if(!(o||s)){if(N(i))a.push(ls(i,e,n));else if(P(i))a.push(us(i,e,n));else if(F(i))a.push(ds(i,e,n));else if(L(i))a.push(fs(i,e,n));else if(I(i))a.push(ps(i,e,n));else if(Xt(i))a.push(ms(i,e,n));else throw Error(`Unknown type ${i}.`)}}return{kind:E.DOCUMENT,definitions:a}}function as(e,t){let n=/* @__PURE__ */ new Map([[`query`,void 0],[`mutation`,void 0],[`subscription`,void 0]]),r=[];if(e.astNode!=null&&r.push(e.astNode),e.extensionASTNodes!=null)for(let t of e.extensionASTNodes)r.push(t);for(let e of r)if(e.operationTypes)for(let t of e.operationTypes)n.set(t.operation,t);let i=rs(e);for(let[e,t]of n){let r=i.get(e);if(r!=null){let i=Xo(r);t==null?n.set(e,{kind:E.OPERATION_TYPE_DEFINITION,operation:e,type:i}):t.type=i}}let a=[...n.values()].filter(zo),o=ss(e,e,t);if(!a.length&&!o.length)return null;let s={kind:a.length?E.SCHEMA_DEFINITION:E.SCHEMA_EXTENSION,operationTypes:a,directives:o},c=ns(e);return c&&(s.description=c),s}function os(e,t,n){return{kind:E.DIRECTIVE_DEFINITION,description:ns(e),name:{kind:E.NAME,value:e.name},arguments:e.args?.map(e=>cs(e,t,n)),repeatable:e.isRepeatable,locations:e.locations?.map(e=>({kind:E.NAME,value:e}))||[]}}function ss(e,t,n){let r=[],i=Yo(e,n),a;i!=null&&(a=bs(t,i));let o=null,s=null,c=null;return a!=null&&(r=a.filter(e=>Wn.every(t=>t.name!==e.name.value)),o=a.find(e=>e.name.value===`deprecated`),s=a.find(e=>e.name.value===`specifiedBy`),c=a.find(e=>e.name.value===`oneOf`)),e.deprecationReason!=null&&o==null&&(o=vs(e.deprecationReason)),(e.specifiedByUrl!=null||e.specifiedByURL!=null&&s==null)&&(s=ys(`specifiedBy`,{url:e.specifiedByUrl||e.specifiedByURL})),e.isOneOf&&c==null&&(c=ys(`oneOf`)),o!=null&&r.push(o),s!=null&&r.push(s),c!=null&&r.push(c),r}function cs(e,t,n){return{kind:E.INPUT_VALUE_DEFINITION,description:ns(e),name:{kind:E.NAME,value:e.name},type:Xo(e.type),defaultValue:ts(e),directives:ss(e,t,n)}}function ls(e,t,n){return{kind:E.OBJECT_TYPE_DEFINITION,description:ns(e),name:{kind:E.NAME,value:e.name},fields:Object.values(e.getFields()).map(e=>hs(e,t,n)),interfaces:Object.values(e.getInterfaces()).map(e=>Xo(e)),directives:ss(e,t,n)}}function us(e,t,n){let r={kind:E.INTERFACE_TYPE_DEFINITION,description:ns(e),name:{kind:E.NAME,value:e.name},fields:Object.values(e.getFields()).map(e=>hs(e,t,n)),directives:ss(e,t,n)};return`getInterfaces`in e&&(r.interfaces=Object.values(e.getInterfaces()).map(e=>Xo(e))),r}function ds(e,t,n){return{kind:E.UNION_TYPE_DEFINITION,description:ns(e),name:{kind:E.NAME,value:e.name},directives:ss(e,t,n),types:e.getTypes().map(e=>Xo(e))}}function fs(e,t,n){return{kind:E.INPUT_OBJECT_TYPE_DEFINITION,description:ns(e),name:{kind:E.NAME,value:e.name},fields:Object.values(e.getFields()).map(e=>gs(e,t,n)),directives:ss(e,t,n)}}function ps(e,t,n){return{kind:E.ENUM_TYPE_DEFINITION,description:ns(e),name:{kind:E.NAME,value:e.name},values:Object.values(e.getValues()).map(e=>_s(e,t,n)),directives:ss(e,t,n)}}function ms(e,t,n){let r=bs(t,Yo(e,n)),i=e.specifiedByUrl||e.specifiedByURL;if(i&&!r.some(e=>e.name.value===`specifiedBy`)){let e={url:i};r.push(ys(`specifiedBy`,e))}return{kind:E.SCALAR_TYPE_DEFINITION,description:ns(e),name:{kind:E.NAME,value:e.name},directives:r}}function hs(e,t,n){return{kind:E.FIELD_DEFINITION,description:ns(e),name:{kind:E.NAME,value:e.name},arguments:e.args.map(e=>cs(e,t,n)),type:Xo(e.type),directives:ss(e,t,n)}}function gs(e,t,n){return{kind:E.INPUT_VALUE_DEFINITION,description:ns(e),name:{kind:E.NAME,value:e.name},type:Xo(e.type),directives:ss(e,t,n),defaultValue:ts(e)}}function _s(e,t,n){return{kind:E.ENUM_VALUE_DEFINITION,description:ns(e),name:{kind:E.NAME,value:e.name},directives:ss(e,t,n)}}function vs(e){return ys(`deprecated`,{reason:e},Vn)}function ys(e,t,n){let r=[];for(let e in t){let i=t[e],a;if(n!=null){let t=n.args.find(t=>t.name===e);t&&(a=$o(i,t.type))}a??=Zo(i),a!=null&&r.push({kind:E.ARGUMENT,name:{kind:E.NAME,value:e},value:a})}return{kind:E.DIRECTIVE,name:{kind:E.NAME,value:e},arguments:r}}function bs(e,t){let n=[];for(let{name:r,args:i}of t){let t=e?.getDirective(r);n.push(ys(r,i,t))}return n}let xs={};function Ss(){xs={}}function Cs(e){let t=e.name?.value;if(t!=null)switch(ws(e,t),e.kind){case`EnumTypeDefinition`:if(e.values)for(let n of e.values)ws(n,t,n.name.value);break;case`ObjectTypeDefinition`:case`InputObjectTypeDefinition`:case`InterfaceTypeDefinition`:if(e.fields){for(let n of e.fields)if(ws(n,t,n.name.value),Ps(n)&&n.arguments)for(let e of n.arguments)ws(e,t,n.name.value,e.name.value)}}}function ws(e,t,n,r){let i=Fs(e);if(typeof i!=`string`||i.length===0)return;let a=[t];n&&(a.push(n),r&&a.push(r));let o=a.join(`.`);xs[o]||(xs[o]=[]),xs[o].push(i)}function Ts(e){return`
106
+ # `+e.replace(/\n/g,`
107
+ # `)}function q(e,t){return e?e.filter(e=>e).join(t||``):``}function Es(e){return e?.some(e=>e.includes(`
108
+ `))??!1}function Ds(e){return(t,n,r,i,a)=>{let o=[],s=i.reduce((e,t)=>([`fields`,`arguments`,`values`].includes(t)&&e.name&&o.push(e.name.value),e[t]),a[0]),c=[...o,s?.name?.value].filter(Boolean).join(`.`),l=[];return t.kind.includes(`Definition`)&&xs[c]&&l.push(...xs[c]),q([...l.map(Ts),t.description,e(t,n,r,i,a)],`
109
+ `)}}function Os(e){return e&&` ${e.replace(/\n/g,`
110
+ `)}`}function ks(e){return e&&e.length!==0?`{\n${Os(q(e,`
111
+ `))}\n}`:``}function J(e,t,n){return t?e+t+(n||``):``}function As(e,t=!1){let n=e.replace(/\\/g,`\\\\`).replace(/"""/g,`\\"""`);return(e[0]===` `||e[0]===` `)&&e.indexOf(`
112
+ `)===-1?`"""${n.replace(/"$/,`"
113
+ `)}"""`:`"""\n${t?n:Os(n)}\n"""`}const js={Name:{leave:e=>e.value},Variable:{leave:e=>`$`+e.name},Document:{leave:e=>q(e.definitions,`
114
+
115
+ `)},OperationDefinition:{leave:e=>{let t=J(`(`,q(e.variableDefinitions,`, `),`)`);return q([e.operation,q([e.name,t]),q(e.directives,` `)],` `)+` `+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+`: `+t+J(` = `,n)+J(` `,q(r,` `))},SelectionSet:{leave:({selections:e})=>ks(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let a=J(``,e,`: `)+t,o=a+J(`(`,q(n,`, `),`)`);return o.length>80&&(o=a+J(`(
116
+ `,Os(q(n,`
117
+ `)),`
118
+ )`)),q([o,q(r,` `),i],` `)}},Argument:{leave:({name:e,value:t})=>e+`: `+t},FragmentSpread:{leave:({name:e,directives:t})=>`...`+e+J(` `,q(t,` `))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>q([`...`,J(`on `,e),q(t,` `),n],` `)},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${J(`(`,q(n,`, `),`)`)} on ${t} ${J(``,q(r,` `),` `)}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?As(e):JSON.stringify(e)},BooleanValue:{leave:({value:e})=>e?`true`:`false`},NullValue:{leave:()=>`null`},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>`[`+q(e,`, `)+`]`},ObjectValue:{leave:({fields:e})=>`{`+q(e,`, `)+`}`},ObjectField:{leave:({name:e,value:t})=>e+`: `+t},Directive:{leave:({name:e,arguments:t})=>`@`+e+J(`(`,q(t,`, `),`)`)},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>`[`+e+`]`},NonNullType:{leave:({type:e})=>e+`!`},SchemaDefinition:{leave:({directives:e,operationTypes:t})=>q([`schema`,q(e,` `),ks(t)],` `)},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+`: `+t},ScalarTypeDefinition:{leave:({name:e,directives:t})=>q([`scalar`,e,q(t,` `)],` `)},ObjectTypeDefinition:{leave:({name:e,interfaces:t,directives:n,fields:r})=>q([`type`,e,J(`implements `,q(t,` & `)),q(n,` `),ks(r)],` `)},FieldDefinition:{leave:({name:e,arguments:t,type:n,directives:r})=>e+(Es(t)?J(`(
119
+ `,Os(q(t,`
120
+ `)),`
121
+ )`):J(`(`,q(t,`, `),`)`))+`: `+n+J(` `,q(r,` `))},InputValueDefinition:{leave:({name:e,type:t,defaultValue:n,directives:r})=>q([e+`: `+t,J(`= `,n),q(r,` `)],` `)},InterfaceTypeDefinition:{leave:({name:e,interfaces:t,directives:n,fields:r})=>q([`interface`,e,J(`implements `,q(t,` & `)),q(n,` `),ks(r)],` `)},UnionTypeDefinition:{leave:({name:e,directives:t,types:n})=>q([`union`,e,q(t,` `),J(`= `,q(n,` | `))],` `)},EnumTypeDefinition:{leave:({name:e,directives:t,values:n})=>q([`enum`,e,q(t,` `),ks(n)],` `)},EnumValueDefinition:{leave:({name:e,directives:t})=>q([e,q(t,` `)],` `)},InputObjectTypeDefinition:{leave:({name:e,directives:t,fields:n})=>q([`input`,e,q(t,` `),ks(n)],` `)},DirectiveDefinition:{leave:({name:e,arguments:t,repeatable:n,locations:r})=>`directive @`+e+(Es(t)?J(`(
122
+ `,Os(q(t,`
123
+ `)),`
124
+ )`):J(`(`,q(t,`, `),`)`))+(n?` repeatable`:``)+` on `+q(r,` | `)},SchemaExtension:{leave:({directives:e,operationTypes:t})=>q([`extend schema`,q(e,` `),ks(t)],` `)},ScalarTypeExtension:{leave:({name:e,directives:t})=>q([`extend scalar`,e,q(t,` `)],` `)},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>q([`extend type`,e,J(`implements `,q(t,` & `)),q(n,` `),ks(r)],` `)},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>q([`extend interface`,e,J(`implements `,q(t,` & `)),q(n,` `),ks(r)],` `)},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>q([`extend union`,e,q(t,` `),J(`= `,q(n,` | `))],` `)},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>q([`extend enum`,e,q(t,` `),ks(n)],` `)},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>q([`extend input`,e,q(t,` `),ks(n)],` `)}},Ms=Object.keys(js).reduce((e,t)=>({...e,[t]:{leave:Ds(js[t].leave)}}),{});function Ns(e){return zt(e,Ms)}function Ps(e){return e.kind===`FieldDefinition`}function Fs(e){let t=Is(e);if(t!==void 0)return Ls(`\n${t}`)}function Is(e){let t=e.loc;if(!t)return;let n=[],r=t.startToken.prev;for(;r!=null&&r.kind===D.COMMENT&&r.next!=null&&r.prev!=null&&r.line+1===r.next.line&&r.line!==r.prev.line;){let e=String(r.value);n.push(e),r=r.prev}return n.length>0?n.reverse().join(`
125
+ `):void 0}function Ls(e){let t=e.split(/\r\n|[\n\r]/g),n=Rs(t);if(n!==0)for(let e=1;e<t.length;e++)t[e]=t[e].slice(n);for(;t.length>0&&Bs(t[0]);)t.shift();for(;t.length>0&&Bs(t[t.length-1]);)t.pop();return t.join(`
126
+ `)}function Rs(e){let t=null;for(let n=1;n<e.length;n++){let r=e[n],i=zs(r);if(i!==r.length&&(t===null||i<t)&&(t=i,t===0))break}return t===null?0:t}function zs(e){let t=0;for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;return t}function Bs(e){return zs(e)===e.length}function Vs(e,t=!1,n=!1,r=!1,i=!1){if(e.length===0)return;if(e.length===1)return e[0];let a,o=!0,s=e.every(e=>{if(Array.isArray(e)){if(a===void 0)return a=e.length,!0;if(a===e.length)return!0}else o=!1;return!1});if(r&&s)return Array(a).fill(null).map((a,o)=>Vs(e.map(e=>e[o]),t,n,r,i));if(o)return e.flat(1);let c,l;t&&(l=e.find(e=>Hs(e)),l&&(c??={},Object.setPrototypeOf(c,Object.create(Object.getPrototypeOf(l)))));for(let a of e)if(a!=null){if(Hs(a)){if(c??={},l){let e=Object.getPrototypeOf(c),t=Object.getPrototypeOf(a);if(t)for(let n of Object.getOwnPropertyNames(t)){let r=Object.getOwnPropertyDescriptor(t,n);zo(r)&&Object.defineProperty(e,n,r)}}for(let e in a)e in c?c[e]=Vs([c[e],a[e]],t,n,r,i):c[e]=a[e];if(i&&c!=null)for(let e of Object.getOwnPropertySymbols(a)){let t=Object.getOwnPropertyDescriptor(a,e);t.enumerable||Object.defineProperty(c,e,t)}}else c=Array.isArray(a)&&Array.isArray(c)?Vs([c,a],t,n,r):a}return c}function Hs(e){return e&&typeof e==`object`&&!Array.isArray(e)}function Us(e){return e&&typeof e==`object`&&`kind`in e&&e.kind===E.DOCUMENT}function Ws(e,t){if(!e||Array.isArray(e)&&e.length===0)return{};if(!Array.isArray(e))return e;if(e.length===1)return e[0]||{};let n=[];for(let t of e)Array.isArray(t)&&(t=Ws(t)),typeof t==`object`&&t&&n.push(t);let r=Vs(n,!0);if(t?.exclusions)for(let e of t.exclusions){let[t,n]=e.split(`.`);[`__proto__`,`constructor`,`prototype`].includes(t)||[`__proto__`,`constructor`,`prototype`].includes(n)||(!n||n===`*`?delete r[t]:r[t]&&delete r[t][n])}return r}function Gs(e,t,n){let r=Ks([...t,...e].filter(zo),n);return n&&n.sort&&r.sort(Ro),r}function Ks(e,t){return e.reduce((e,n)=>{let r=e.findIndex(e=>e.name.value===n.name.value);return r===-1?e.concat([n]):(t?.reverseArguments||(e[r]=n),e)},[])}function qs(e,t,n){return!!(t?.[e.name.value]?.repeatable??n?.has(e.name.value))}function Js(e,t){return t.some(({value:t})=>t===e.value)}function Ys(e,t){let n=[];for(let r of[...t,...e]){let e=n.findIndex(e=>e.name.value===r.name.value);if(e===-1)n.push(r);else{let t=n[e];if(t.value.kind===`ListValue`){let e=t.value.values,n=r.value.values;t.value={...t.value,values:rc(e,n,(e,t)=>{let n=e.value;return!n||!t.some(e=>e.value===n)})}}else t.value=r.value}}return n}const Xs=(e,t)=>{if(e.kind===t.kind)switch(e.kind){case E.LIST:return e.values.length===t.values.length&&e.values.every(e=>t.values.find(t=>Xs(e,t)));case E.VARIABLE:case E.NULL:return!0;case E.OBJECT:return e.fields.length===t.fields.length&&e.fields.every(e=>t.fields.find(t=>e.name.value===t.name.value&&Xs(e.value,t.value)));default:return e.value===t.value}return!1},Zs=e=>e.name.value===`link`,Qs=e=>{let t=Zs(e)?e.arguments?.find(e=>e.name.value===`url`)?.value:void 0;return t?.kind===`StringValue`?t.value:void 0},$s=(e,t)=>e.name.value===t.name.value&&e.value.kind===t.value.kind&&Xs(e.value,t.value),ec=(e,t)=>!!(e.name.value===t.name.value&&(e.arguments===t.arguments||e.arguments?.length===t.arguments?.length&&e.arguments?.every(e=>t.arguments?.find(t=>$s(e,t)))));function tc(e=[],t=[],n,r){let i=n&&n.reverseDirectives,a=i?e:t,o=i?t:e,s=[];for(let e of[...a,...o])if(qs(e,r,n?.repeatableLinkImports))s.find(t=>ec(e,t))||s.push(e);else{let t=s.findIndex(t=>t.name.value===e.name.value);if(t===-1)s.push(e);else{if(Zs(e)&&Zs(s[t])){let n=Qs(e),r=Qs(s[t]);if(n&&r&&n!==r){s.push(e);continue}}let n=Ys(e.arguments??[],s[t].arguments??[]);s[t]={...s[t],arguments:n.length===0?void 0:n}}}return s}function nc(e,t){return t?{...e,arguments:rc(t.arguments||[],e.arguments||[],(e,t)=>!Js(e.name,t.map(e=>e.name))),locations:[...t.locations,...e.locations.filter(e=>!Js(e,t.locations))]}:e}function rc(e,t,n){return e.concat(t.filter(t=>n(t,e)))}function ic(e,t,n,r){if(n?.consistentEnumMerge){let n=[];e&&n.push(...e),e=t,t=n}let i=/* @__PURE__ */ new Map;if(e)for(let t of e)i.set(t.name.value,t);if(t)for(let e of t){let t=e.name.value;if(i.has(t)){let n=i.get(t);n.description=e.description||n.description,n.directives=tc(e.directives,n.directives,r)}else i.set(t,e)}let a=[...i.values()];return n&&n.sort&&a.sort(Ro),a}function ac(e,t,n,r){return t?{name:e.name,description:e.description||t.description,kind:n?.convertExtensions||e.kind===`EnumTypeDefinition`||t.kind===`EnumTypeDefinition`?`EnumTypeDefinition`:`EnumTypeExtension`,loc:e.loc,directives:tc(e.directives,t.directives,n,r),values:ic(e.values,t.values,n)}:n?.convertExtensions?{...e,kind:E.ENUM_TYPE_DEFINITION}:e}function oc(e){return typeof e==`string`}function sc(e){return e instanceof gt}function cc(e){let t=e;for(;t.kind===E.LIST_TYPE||t.kind===`NonNullType`;)t=t.type;return t}function lc(e){return e.kind!==E.NAMED_TYPE}function uc(e){return e.kind===E.LIST_TYPE}function dc(e){return e.kind===E.NON_NULL_TYPE}function fc(e){return uc(e)?`[${fc(e.type)}]`:dc(e)?`${fc(e.type)}!`:e.name.value}var pc;(function(e){e[e.A_SMALLER_THAN_B=-1]=`A_SMALLER_THAN_B`,e[e.A_EQUALS_B=0]=`A_EQUALS_B`,e[e.A_GREATER_THAN_B=1]=`A_GREATER_THAN_B`})(pc||={});function mc(e,t){return e==null&&t==null?pc.A_EQUALS_B:e==null?pc.A_SMALLER_THAN_B:t==null?pc.A_GREATER_THAN_B:e<t?pc.A_SMALLER_THAN_B:e>t?pc.A_GREATER_THAN_B:pc.A_EQUALS_B}function hc(e,t){let n=e.findIndex(e=>e.name.value===t.name.value);return[n>-1?e[n]:null,n]}function gc(e,t,n,r,i){let a=[];if(n!=null&&a.push(...n),t!=null)for(let n of t){let[t,o]=hc(a,n);if(t&&!r?.ignoreFieldConflicts){let s=r?.onFieldTypeConflict&&r.onFieldTypeConflict(t,n,e,r?.throwOnConflict)||_c(e,t,n,r?.throwOnConflict);s.arguments=Gs(n.arguments||[],t.arguments||[],r),s.directives=tc(n.directives,t.directives,r,i),s.description=n.description||t.description,a[o]=s}else a.push(n)}if(r&&r.sort&&a.sort(Ro),r&&r.exclusions){let t=r.exclusions;return a.filter(n=>!t.includes(`${e.name.value}.${n.name.value}`))}return a}function _c(e,t,n,r=!1){let i=fc(t.type),a=fc(n.type);if(i!==a){let o=cc(t.type),s=cc(n.type);if(o.name.value!==s.name.value)throw Error(`Field "${n.name.value}" already defined with a different type. Declared as "${o.name.value}", but you tried to override with "${s.name.value}"`);if(!vc(t.type,n.type,!r))throw Error(`Field '${e.name.value}.${t.name.value}' changed type from '${i}' to '${a}'`)}return dc(n.type)&&!dc(t.type)&&(t.type=n.type),t}function vc(e,t,n=!1){return!lc(e)&&!lc(t)?e.toString()===t.toString():dc(t)?vc(dc(e)?e.type:e,t.type):dc(e)?vc(t,e,n):uc(e)?uc(t)&&vc(e.type,t.type)||dc(t)&&vc(e,t.type):!1}function yc(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n?.convertExtensions||e.kind===`InputObjectTypeDefinition`||t.kind===`InputObjectTypeDefinition`?`InputObjectTypeDefinition`:`InputObjectTypeExtension`,loc:e.loc,fields:gc(e,e.fields,t.fields,n),directives:tc(e.directives,t.directives,n,r)}}catch(t){throw Error(`Unable to merge GraphQL input type "${e.name.value}": ${t.message}`)}return n?.convertExtensions?{...e,kind:E.INPUT_OBJECT_TYPE_DEFINITION}:e}function bc(e,t){return!!e.find(e=>e.name.value===t.name.value)}function xc(e=[],t=[],n={}){let r=[...t,...e.filter(e=>!bc(t,e))];return n&&n.sort&&r.sort(Ro),r}function Sc(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n?.convertExtensions||e.kind===`InterfaceTypeDefinition`||t.kind===`InterfaceTypeDefinition`?`InterfaceTypeDefinition`:`InterfaceTypeExtension`,loc:e.loc,fields:gc(e,e.fields,t.fields,n,r),directives:tc(e.directives,t.directives,n,r),interfaces:e.interfaces?xc(e.interfaces,t.interfaces,n):void 0}}catch(t){throw Error(`Unable to merge GraphQL interface "${e.name.value}": ${t.message}`)}return n?.convertExtensions?{...e,kind:E.INTERFACE_TYPE_DEFINITION}:e}function Cc(e,t,n,r){return t?{name:e.name,description:e.description||t.description,kind:n?.convertExtensions||e.kind===`ScalarTypeDefinition`||t.kind===`ScalarTypeDefinition`?`ScalarTypeDefinition`:`ScalarTypeExtension`,loc:e.loc,directives:tc(e.directives,t.directives,n,r)}:n?.convertExtensions?{...e,kind:E.SCALAR_TYPE_DEFINITION}:e}const wc={query:`Query`,mutation:`Mutation`,subscription:`Subscription`};function Tc(e=[],t=[]){let n=[];for(let r in wc){let i=e.find(e=>e.operation===r)||t.find(e=>e.operation===r);i&&n.push(i)}return n}function Ec(e,t,n,r){return t?{kind:e.kind===E.SCHEMA_DEFINITION||t.kind===E.SCHEMA_DEFINITION?E.SCHEMA_DEFINITION:E.SCHEMA_EXTENSION,description:e.description||t.description,directives:tc(e.directives,t.directives,n,r),operationTypes:Tc(e.operationTypes,t.operationTypes)}:n?.convertExtensions?{...e,kind:E.SCHEMA_DEFINITION}:e}function Dc(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n?.convertExtensions||e.kind===`ObjectTypeDefinition`||t.kind===`ObjectTypeDefinition`?`ObjectTypeDefinition`:`ObjectTypeExtension`,loc:e.loc,fields:gc(e,e.fields,t.fields,n,r),directives:tc(e.directives,t.directives,n,r),interfaces:xc(e.interfaces,t.interfaces,n)}}catch(t){throw Error(`Unable to merge GraphQL type "${e.name.value}": ${t.message}`)}return n?.convertExtensions?{...e,kind:E.OBJECT_TYPE_DEFINITION}:e}function Oc(e,t,n,r){return t?{name:e.name,description:e.description||t.description,directives:tc(e.directives,t.directives,n,r),kind:n?.convertExtensions||e.kind===`UnionTypeDefinition`||t.kind===`UnionTypeDefinition`?E.UNION_TYPE_DEFINITION:E.UNION_TYPE_EXTENSION,loc:e.loc,types:xc(e.types,t.types,n)}:n?.convertExtensions?{...e,kind:E.UNION_TYPE_DEFINITION}:e}const kc=`SCHEMA_DEF_SYMBOL`;function Ac(e){return`name`in e}function jc(e,t,n={}){let r=n;for(let i of e)if(Ac(i)){let e=i.name?.value;if(t?.commentDescriptions&&Cs(i),e==null)continue;if(t?.exclusions?.includes(e+`.*`)||t?.exclusions?.includes(e))delete r[e];else switch(i.kind){case E.OBJECT_TYPE_DEFINITION:case E.OBJECT_TYPE_EXTENSION:r[e]=Dc(i,r[e],t,n);break;case E.ENUM_TYPE_DEFINITION:case E.ENUM_TYPE_EXTENSION:r[e]=ac(i,r[e],t,n);break;case E.UNION_TYPE_DEFINITION:case E.UNION_TYPE_EXTENSION:r[e]=Oc(i,r[e],t,n);break;case E.SCALAR_TYPE_DEFINITION:case E.SCALAR_TYPE_EXTENSION:r[e]=Cc(i,r[e],t,n);break;case E.INPUT_OBJECT_TYPE_DEFINITION:case E.INPUT_OBJECT_TYPE_EXTENSION:r[e]=yc(i,r[e],t,n);break;case E.INTERFACE_TYPE_DEFINITION:case E.INTERFACE_TYPE_EXTENSION:r[e]=Sc(i,r[e],t,n);break;case E.DIRECTIVE_DEFINITION:r[e]&&e in{}&&(Mc(r[e])||(r[e]=void 0)),r[e]=nc(i,r[e])}}else(i.kind===E.SCHEMA_DEFINITION||i.kind===E.SCHEMA_EXTENSION)&&(r[kc]=Ec(i,r[kc],t));return r}function Mc(e){return typeof e==`object`&&!!e&&`kind`in e&&typeof e.kind==`string`}function Nc(e){return e.as??e.url.name}function Pc(e){let t=Nc(e);return t&&`@${t}`}function Fc(e,t){if(e.url.name&&t===`@${e.url.name}`)return Pc(e).substring(1);let n=e.imports.find(e=>e.name===t),r=n?.as??n?.name??Ic(Nc(e),t);return r.startsWith(`@`)?r.substring(1):r}function Ic(e,t){return e?.length?t.startsWith(`@`)?`@${e}__${t.substring(1)}`:`${e}__${t}`:t}function Lc(e){let t=[];for(let n of e.definitions)if(n.kind===E.SCHEMA_EXTENSION||n.kind===E.SCHEMA_DEFINITION){let e=(n.directives?.filter(e=>e.name.value===`link`))?.map(e=>Rc(e.arguments??[])).filter(e=>e!==void 0)??[];t=t.concat(e);let r=(n.directives?.filter(({name:e})=>e.value===`core`))?.map(e=>zc(e.arguments??[])).filter(e=>e!==void 0);r&&(t=t.concat(...r))}return t}function Rc(e){let t,n=[],r;for(let i of e)switch(i.name.value){case`url`:i.value.kind===E.STRING&&(t=Hc(i.value.value));break;case`import`:n=Bc(i.value);break;case`as`:i.value.kind===E.STRING&&(r=i.value.value??void 0)}if(t!==void 0)return{url:t,as:r,imports:n}}function zc(e){let t=e.find(({name:e,value:t})=>e.value===`feature`&&t.kind===E.STRING);if(t)return{url:Hc(t.value.value),imports:[]}}function Bc(e){return e.kind===E.LIST?e.values.map(e=>{let t;if(e.kind===E.STRING)t={name:e.value};else if(e.kind===E.OBJECT){let n=``,r;for(let t of e.fields)t.name.value===`name`?t.value.kind===E.STRING&&(n=t.value.value):t.name.value===`as`&&t.value.kind===E.STRING&&(r=t.value.value);t={name:n,as:r}}return t}).filter(e=>e!==void 0):[]}const Vc=/v(\d{1,3})\.(\d{1,4})/i;function Hc(e){let t=new URL(e),n=t.pathname.split(`/`).filter(Boolean),r=n[n.length-1];if(r){if(Vc.test(r)){let e=n[n.length-2];return{identity:t.origin+(e?`/${n.slice(0,n.length-1).join(`/`)}`:``),name:e??null,version:r}}return{identity:`${t.origin}/${n.join(`/`)}`,name:r,version:null}}return{identity:t.origin,name:null,version:null}}function Uc(e,t){Ss();let n={kind:E.DOCUMENT,definitions:Gc(e,{useSchemaDefinition:!0,forceSchemaDefinition:!1,throwOnConflict:!1,commentDescriptions:!1,...t})},r;return r=t?.commentDescriptions?Ns(n):n,Ss(),r}function Wc(e,t,n=[],r=[],i=/* @__PURE__ */ new Set,a=/* @__PURE__ */ new Set){let o=e=>{a.add(e)};if(e&&!i.has(e)){if(i.add(e),typeof e==`function`)Wc(e(),t,n,r,i,a);else if(Array.isArray(e))for(let o of e)Wc(o,t,n,r,i,a);else if(cr(e))Wc(is(e,t).definitions,t,n,r,i,a);else if(oc(e)||sc(e))Wc(vt(e,t).definitions,t,n,r,i,a);else if(typeof e==`object`&&Ir(e)){let t=Lc({definitions:[e],kind:E.DOCUMENT}),i=t.find(e=>e.url.identity===`https://specs.apollo.dev/federation`);i&&(o(Fc(i,`@composeDirective`)),o(Fc(i,`@key`)));let a=t.find(e=>e.url.identity===`https://specs.apollo.dev/link`);a&&o(Fc(a,`@link`)),e.kind===E.DIRECTIVE_DEFINITION?n.push(e):r.push(e)}else if(Us(e))Wc(e.definitions,t,n,r,i,a);else throw Error(`typeDefs must contain only strings, documents, schemas, or functions, got ${typeof e}`)}return{allDirectives:n,allNodes:r,repeatableLinkImports:a}}function Gc(e,t){Ss();let{allDirectives:n,allNodes:r,repeatableLinkImports:i}=Wc(e,t),a=jc(n,t);t.repeatableLinkImports=i;let o=jc(r,t,a);if(t?.useSchemaDefinition){let e=o.SCHEMA_DEF_SYMBOL||{kind:E.SCHEMA_DEFINITION,operationTypes:[]},t=e.operationTypes||[];for(let e in wc)if(!t.find(t=>t.operation===e)){let n=o[wc[e]];n!=null&&n.name!=null&&t.push({kind:E.OPERATION_TYPE_DEFINITION,type:{kind:E.NAMED_TYPE,name:n.name},operation:e})}e?.operationTypes?.length!=null&&e.operationTypes.length>0&&(o[kc]=e)}t?.forceSchemaDefinition&&!o.SCHEMA_DEF_SYMBOL?.operationTypes?.length&&(o[kc]={kind:E.SCHEMA_DEFINITION,operationTypes:[{kind:E.OPERATION_TYPE_DEFINITION,operation:`query`,type:{kind:E.NAMED_TYPE,name:{kind:E.NAME,value:`Query`}}}]});let s=Object.values(o);if(t?.sort){let e=typeof t.sort==`function`?t.sort:mc;s.sort((t,n)=>e(t.name?.value,n.name?.value))}return s}function Kc(e,t){if(e&&t&&t!==e.extensions){if(!e.extensions){e.extensions=t;return}e.extensions=Vs([e.extensions,t],!1,!0)}}function qc(e,t){Kc(e,t.schemaExtensions);for(let[n,r]of Object.entries(t.types||{})){let t=e.getType(n);if(t){if(Kc(t,r.extensions),r.type===`object`||r.type===`interface`)for(let[e,n]of Object.entries(r.fields)){let r=t.getFields()[e];if(r){Kc(r,n.extensions);for(let[e,t]of Object.entries(n.arguments))Kc(r.args.find(t=>t.name===e),t)}}else if(r.type===`input`)for(let[e,n]of Object.entries(r.fields)){let r=t.getFields()[e];Kc(r,n.extensions)}else if(r.type===`enum`)for(let[e,n]of Object.entries(r.values))Kc(t.getValue(e),n)}}return e}function Jc({typeDefs:e,resolvers:t={},resolverValidationOptions:n={},inheritResolversFromInterfaces:r=!1,updateResolversInPlace:i=!1,schemaExtensions:a,defaultFieldResolver:o,...s}){if(typeof n!=`object`)throw Error("Expected `resolverValidationOptions` to be an object");if(!e)throw Error(`Must provide typeDefs`);let c;if(c=cr(e)?e:s?.commentDescriptions?Wa(Uc(e,{...s,commentDescriptions:!0}),s):Ua(Uc(e,s),s),c=Mo({schema:c,resolvers:Ws(t),resolverValidationOptions:n,inheritResolversFromInterfaces:r,updateResolversInPlace:i,defaultFieldResolver:o}),Object.keys(n).length>0&&Oo(c,n),a)for(let e of Ga(a))qc(c,e);return c}function Yc(e){return Jc(e)}function Xc(e,t){let n={...t,...e};for(let r of Object.keys(n))r in e&&r in t&&(n[r]=(n,i)=>e[r](n,()=>t[r](n,i)));return n}const Zc=e=>({fn(t,n){return t?(...r)=>{let i;return t(e,()=>{i=n(...r)}),i}:n},asyncFn(t,n){return t?(...r)=>{let i;return y(()=>t(e,()=>(i=n(...r),v(i)?i.then(()=>void 0):void 0)),()=>i)}:n}}),Qc=/* @__PURE__ */ new WeakMap;function $c(e){return e.length===1?e[0]:{schema:e[0],document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],fieldResolver:e[6],subscribeFieldResolver:e[7]}}const el=e=>((...t)=>e($c(t)));function tl(e){return e.length===1?e[0]:{schema:e[0],document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],fieldResolver:e[6],typeResolver:e[7]}}const nl=e=>((...t)=>e(tl(t)));function rl(e){return typeof e==`object`&&!!e&&typeof e[Symbol.asyncIterator]==`function`}function il(e,t){if(rl(e.result))return{onNext:t};t({args:e.args,result:e.result,setResult:e.setResult})}function al(e,t){let n;function r(){return n||=e[Symbol.asyncIterator](),n}let i=!1;return{[Symbol.asyncIterator](){return this},next(){return r().next().then(e=>(e.done&&i===!1&&(i=!0,t()),e))},return(){let e=r().return?.();return i===!1&&(i=!0,t()),e||b({done:!0,value:void 0})},throw(e){let t=r().throw?.();if(t)return t;throw e},[Symbol.asyncDispose||Symbol.for(`Symbol.asyncDispose`)](){return b()}}}function ol(e,t){let n;function r(){return n||=e[Symbol.asyncIterator](),n}return{[Symbol.asyncIterator](){return this},next(){return r().next().catch(e=>(t(e),{done:!0,value:void 0}))},return(){return r().return?.()||b({done:!0,value:void 0})},throw(e){let t=r().throw?.();if(t)return t;throw e},[Symbol.asyncDispose||Symbol.for(`Symbol.asyncDispose`)](){return b()}}}function sl(e){throw Error(`No \`${e}\` function found! Register it using "useEngine" plugin.`)}function cl({plugins:e}){let t=null,n=!1,r=()=>sl(`parse`),i=()=>sl(`validate`),a=()=>sl(`execute`),o=()=>sl(`subscribe`),s,c=(r,i=-1)=>{if(t!==r&&(t=r,n))for(let[n,r]of e.entries())n!==i&&r.onSchemaChange&&r.onSchemaChange({schema:t,replaceSchema:e=>{c(e,n)}})},l=[];for(let t=0;t<e.length;t++){let n=e[t],r=[];n.onPluginInit?.({plugins:e,addPlugin:e=>{r.push(e)},setSchema:e=>c(e,t),registerContextErrorHandler:e=>l.push(e)}),r.length&&e.splice(t+1,0,...r)}let u={init:[],parse:[],validate:[],subscribe:[],execute:[],context:[]};for(let{onContextBuilding:t,onExecute:n,onParse:r,onSubscribe:i,onValidate:a,onEnveloped:o,instrumentation:c}of e)o&&u.init.push(o),t&&u.context.push(t),n&&u.execute.push(n),r&&u.parse.push(r),i&&u.subscribe.push(i),a&&u.validate.push(a),c&&(s=s?Xc(s,c):c);let d=e=>{for(let[t,n]of u.init.entries())n({context:e,extendContext:t=>{e&&Object.assign(e,t)},setSchema:e=>c(e,t)})},f=u.parse.length?e=>(t,n)=>{let i=null,a=r,o=e,s=[];for(let e of u.parse){let r=e({context:o,extendContext:e=>{Object.assign(o,e)},params:{source:t,options:n},parseFn:a,setParseFn:e=>{a=e},setParsedDocument:e=>{i=e}});r&&s.push(r)}if(i===null)try{i=a(t,n)}catch(e){i=e}for(let e of s)e({context:o,extendContext:e=>{Object.assign(o,e)},replaceParseResult:e=>{i=e},result:i});if(i===null)throw Error(`Failed to parse document.`);if(i instanceof Error)throw i;return Qc.set(i,t.toString()),i}:()=>r,p=u.validate.length?e=>(t,n,r,a,o)=>{let s=r?[...r]:void 0,c=i,l=null,d=e,f=[];for(let e of u.validate){let r=e({context:d,extendContext:e=>{Object.assign(d,e)},params:{schema:t,documentAST:n,rules:s,typeInfo:a,options:o},validateFn:c,addValidationRule:e=>{s||=[],s.push(e)},setValidationFn:e=>{c=e},setResult:e=>{l=e}});r&&f.push(r)}if(l||=c(t,n,s,a,o),!l)return;let p=l.length===0;for(let e of f)e({valid:p,result:l,context:d,extendContext:e=>{Object.assign(d,e)},setResult:e=>{l=e}});return l}:()=>i,m=u.context.length?e=>t=>{let n=[],r=e;t&&Object.assign(r,t);let i=!1;return y(()=>x(u.context,(e,t)=>e({context:r,extendContext:e=>{Object.assign(r,e)},breakContextBuilding:()=>{i=!0,t()}}),n),()=>i?r:y(()=>x(n,e=>e({context:r,extendContext(e){Object.assign(r,e)}})),()=>r),e=>{let t=e;for(let e of l)e({context:r,error:t,setError:e=>{t=e}});throw t})}:e=>t=>(t&&Object.assign(e,t),e),h=u.subscribe.length?el(e=>{let t=o,n=[],r=e.contextValue||{},i;return y(()=>x(u.subscribe,(n,a)=>n({subscribeFn:t,setSubscribeFn:e=>{t=e},context:r,extendContext:e=>{Object.assign(r,e)},args:e,setResultAndStopExecution:e=>{i=e,a()}}),n),()=>{let r=[],a=[];for(let{onSubscribeResult:e,onSubscribeError:t}of n)e&&r.push(e),t&&a.push(t);return y(()=>i||t(e),t=>{let n=[],i=[];for(let a of r){let r=a({args:e,result:t,setResult:e=>{t=e}});r&&(r.onNext&&n.push(r.onNext),r.onEnd&&i.push(r.onEnd))}return n.length&&rl(t)&&(t=ce(t,t=>y(()=>x(n,n=>n({args:e,result:t,setResult:e=>t=e})),()=>t))),i.length&&rl(t)&&(t=al(t,()=>{for(let e of i)e()})),a.length&&rl(t)&&(t=ol(t,e=>{let t=e;for(let e of a)e({error:t,setError:e=>{t=e}});throw t})),t})})}):el(o),g=u.execute.length?nl(e=>{let t=a,n,r=[],i=[],o=e.contextValue||{};return y(()=>x(u.execute,(r,i)=>r({executeFn:t,setExecuteFn:e=>{t=e},setResultAndStopExecution:e=>{n=e,i()},context:o,extendContext:e=>{if(typeof e==`object`)Object.assign(o,e);else throw Error(`Invalid context extension provided! Expected "object", got: "${JSON.stringify(e)}" (${typeof e})`)},args:e}),r),()=>y(()=>n||t({...e,contextValue:o}),t=>y(()=>x(r,n=>n.onExecuteDone?.({args:e,result:t,setResult:e=>{t=e}}),i),()=>{let n=[],r=[];for(let{onNext:e,onEnd:t}of i)e&&n.push(e),t&&r.push(t);return n.length&&rl(t)&&(t=ce(t,t=>y(()=>x(n,n=>n({args:e,result:t,setResult:e=>{t=e}})),()=>t))),r.length&&rl(t)&&(t=al(t,()=>{for(let e of r)e()})),t})))}):nl(a);if(n=!0,t)for(let[n,r]of e.entries())r.onSchemaChange?.({schema:t,replaceSchema:e=>c(e,n)});return{getCurrentSchema(){return t},init:d,parse:f,validate:p,execute:g,subscribe:h,contextFactory:m,instrumentation:s}}function ll(e){return e!=null}function ul(e){let t=e.plugins.filter(ll),n=cl({plugins:t}),r=n.instrumentation,i=(e={})=>{let t=Zc({context:e}),i=n;return t.fn(r?.init,n.init)(e),{parse:t.fn(r?.parse,i.parse(e)),validate:t.fn(r?.validate,i.validate(e)),contextFactory:t.fn(r?.context,i.contextFactory(e)),execute:t.asyncFn(r?.execute,i.execute),subscribe:t.asyncFn(r?.subscribe,i.subscribe),schema:i.getCurrentSchema()}};return i._plugins=t,i}function dl(e){return e instanceof Error&&e.name===`GraphQLError`}function fl(e){return dl(e)?e.originalError==null||fl(e.originalError):!1}function pl(e,t,n){let r=Error(e);if(r.name=`GraphQLError`,n){let e=t instanceof Error?{message:t.message,stack:t.stack}:{message:String(t)};Object.defineProperty(r,"extensions",{get(){return e}})}return Object.defineProperty(r,"toJSON",{value(){return{message:r.message,extensions:r.extensions}}}),r}const ml=(e=>(t,n)=>fl(t)?t:pl(n,t,e))(!1),hl=(e,t)=>({result:n,setResult:r})=>{n.errors!=null&&r({...n,errors:n.errors.map(n=>e(n,t))})};function gl(e){let t=e?.maskError??ml,n=e?.errorMessage||`Unexpected error.`,r=hl(t,n);return{onPluginInit(e){e.registerContextErrorHandler(({error:e,setError:r})=>{r(t(e,n))})},onExecute(){return{onExecuteDone(e){return il(e,r)}}},onSubscribe(){return{onSubscribeResult(e){return il(e,r)},onSubscribeError({error:e,setError:r}){r(t(e,n))}}}}}const _l=e=>({onContextBuilding({context:t,extendContext:n}){return y(()=>e(t),e=>n(e))}}),vl=e=>({onExecute:({setExecuteFn:t})=>{e.execute&&t(e.execute)},onParse:({setParseFn:t})=>{e.parse&&t(e.parse)},onValidate:({setValidationFn:t,addValidationRule:n})=>{e.validate&&t(e.validate),e.specifiedRules?.map(n)},onSubscribe:({setSubscribeFn:t})=>{e.subscribe&&t(e.subscribe)}}),yl=[`message`,`locations`,`path`,`nodes`,`source`,`positions`,`originalError`,`name`,`stack`,`extensions`,`coordinate`];function bl(e){return typeof e==`object`&&!!e&&Object.keys(e).every(e=>yl.includes(e))}function Y(e,t){t?.originalError&&!(t.originalError instanceof Error)&&bl(t.originalError)&&(t.originalError=Y(t.originalError.message,t.originalError));let n=C,r=be.major>=16?new n(e,t):new n(e,t?.nodes,t?.source,t?.positions,t?.path,t?.originalError,t?.extensions);return t?.coordinate&&r.coordinate==null&&Object.defineProperties(r,{coordinate:{value:t.coordinate,enumerable:!0,configurable:!0}}),r}function xl(e,t,n,r){let i=Fa(e,t,n);if(!i.coordinate&&r&&i.coordinate==null){let e=`${r.parentType.name}.${r.fieldName}`;Object.defineProperties(i,{coordinate:{value:e,enumerable:!0,configurable:!0}})}return i}function Sl(e){return typeof e==`object`&&!!e&&Symbol.iterator in e}function Cl(e){return typeof e==`object`&&!!e}function wl(e,t,n){let r=n;for(let n of e)r=y(()=>r,e=>t(e,n));return r}function Tl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function El(e,t,n={}){let r={},i=(t.arguments??[]).reduce((e,t)=>({...e,[t.name.value]:t}),{});for(let a of e.args){let e=i[a.name];if(!e){if(`default`in a&&a.default)r[a.name]=`value`in a.default?a.default.value:Kt(a.default.literal);else if(a.defaultValue!==void 0)r[a.name]=a.defaultValue;else if(z(a.type))throw Y(`Argument "${a.name}" of required type "${G(a.type)}" was not provided.`,{nodes:[t]});continue}let o=e.value,s=o.kind===E.NULL;if(o.kind===E.VARIABLE){let e=o.name.value;if(n==null||!Tl(n,e)){if(a.defaultValue!==void 0)r[a.name]=a.defaultValue;else if(z(a.type))throw Y(`Argument "${a.name}" of required type "${G(a.type)}" was provided the variable "$${e}" which was not provided a runtime value.`,{nodes:[o]});continue}s=n[e]==null}if(s&&z(a.type))throw Y(`Argument "${a.name}" of non-null type "${G(a.type)}" must not be null.`,{nodes:[o]});let c=Gi(o,a.type,n);if(c===void 0)throw Y(`Argument "${a.name}" has invalid value ${A(o)}.`,{nodes:[o]});r[a.name]=c}return r}function Dl(e){let t=/* @__PURE__ */ new WeakMap;return function(n){let r=t.get(n);if(r===void 0){let r=e(n);return t.set(n,r),r}return r}}function Ol(e){let t=/* @__PURE__ */ new WeakMap;return function(n,r,i){let a=t.get(n);if(!a){a=/* @__PURE__ */ new WeakMap,t.set(n,a);let o=/* @__PURE__ */ new WeakMap;a.set(r,o);let s=e(n,r,i);return o.set(i,s),s}let o=a.get(r);if(!o){o=/* @__PURE__ */ new WeakMap,a.set(r,o);let t=e(n,r,i);return o.set(i,t),t}let s=o.get(i);if(s===void 0){let t=e(n,r,i);return o.set(i,t),t}return s}}function kl(e){let t=/* @__PURE__ */ new WeakMap;return function(n,r,i,a,o){let s=t.get(n);if(!s){s=/* @__PURE__ */ new WeakMap,t.set(n,s);let c=/* @__PURE__ */ new WeakMap;s.set(r,c);let l=/* @__PURE__ */ new WeakMap;c.set(i,l);let u=/* @__PURE__ */ new WeakMap;l.set(a,u);let d=e(n,r,i,a,o);return u.set(o,d),d}let c=s.get(r);if(!c){c=/* @__PURE__ */ new WeakMap,s.set(r,c);let t=/* @__PURE__ */ new WeakMap;c.set(i,t);let l=/* @__PURE__ */ new WeakMap;t.set(a,l);let u=e(n,r,i,a,o);return l.set(o,u),u}let l=c.get(i);if(!l){l=/* @__PURE__ */ new WeakMap,c.set(i,l);let t=/* @__PURE__ */ new WeakMap;l.set(a,t);let s=e(n,r,i,a,o);return t.set(o,s),s}let u=l.get(a);if(!u){u=/* @__PURE__ */ new WeakMap,l.set(a,u);let t=e(n,r,i,a,o);return u.set(o,t),t}let d=u.get(o);if(d===void 0){let t=e(n,r,i,a,o);return u.set(o,t),t}return d}}function Al(e,t,n){let r=jl(e).get(t);if(r==null)throw Y(`Schema is not configured to execute ${t} operation.`,{nodes:n});return r}const jl=Dl(function(e){let t=/* @__PURE__ */ new Map,n=e.getQueryType();n&&t.set(`query`,n);let r=e.getMutationType();r&&t.set(`mutation`,r);let i=e.getSubscriptionType();return i&&t.set(`subscription`,i),t});var Ml=class extends Map{get[Symbol.toStringTag](){return`AccumulatorMap`}add(e,t){let n=this.get(e);n===void 0?this.set(e,[t]):n.push(t)}};const Nl=new Rn({name:`defer`,description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[T.FRAGMENT_SPREAD,T.INLINE_FRAGMENT],args:{if:{type:new V(U),description:`Deferred when true or undefined.`,defaultValue:!0},label:{type:H,description:`Unique name`}}}),Pl=new Rn({name:`stream`,description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[T.FIELD],args:{if:{type:new V(U),description:`Stream when true or undefined.`,defaultValue:!0},label:{type:H,description:`Unique name`},initialCount:{defaultValue:0,type:jn,description:`Number of items to return immediately`}}});function Fl(e,t,n,r,i,a,o,s){for(let c of i.selections)switch(c.kind){case E.FIELD:if(!Ll(n,c))continue;a.add(zl(c),c);break;case E.INLINE_FRAGMENT:{if(!Ll(n,c)||!Rl(e,c,r))continue;let i=Bl(n,c);if(i){let a=new Ml;Fl(e,t,n,r,c.selectionSet,a,o,s),o.push({label:i.label,fields:a})}else Fl(e,t,n,r,c.selectionSet,a,o,s);break}case E.FRAGMENT_SPREAD:{let i=c.name.value;if(!Ll(n,c))continue;let l=Bl(n,c);if(s.has(i)&&!l)continue;let u=t[i];if(!u||!Rl(e,u,r))continue;if(l||s.add(i),l){let i=new Ml;Fl(e,t,n,r,u.selectionSet,i,o,s),o.push({label:l.label,fields:i})}else Fl(e,t,n,r,u.selectionSet,a,o,s);break}}}function Il(e,t,n,r,i){let a=new Ml,o=[];return Fl(e,t,n,r,i,a,o,/* @__PURE__ */ new Set),{fields:a,patches:o}}function Ll(e,t){return Yi(Bn,t,e)?.if!==!0&&Yi(zn,t,e)?.if!==!1}function Rl(e,t,n){let r=t.typeCondition;if(!r)return!0;let i=Mr(e,r);return i===n?!0:tn(i)?e.getPossibleTypes(i).includes(n):!1}function zl(e){return e.alias?e.alias.value:e.name.value}function Bl(e,t){let n=Yi(Nl,t,e);if(n&&n.if!==!1)return{label:typeof n.label==`string`?n.label:void 0}}const Vl=kl(function(e,t,n,r,i){let a=new Ml,o=/* @__PURE__ */ new Set,s=[],c={fields:a,patches:s};for(let c of i)c.selectionSet&&Fl(e,t,n,r,c.selectionSet,a,s,o);return c});function Hl(e){return e?.[Symbol.asyncIterator]!=null}function Ul(e,t,n){return{prev:e,key:t,typename:n}}function X(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function Wl(e){return e.map(e=>typeof e==`number`?`[`+e.toString()+`]`:`.`+e).join(``)}var Gl=class extends Error{error;suppressed;constructor(e,t,n){super(n),this.error=e,this.suppressed=t,this.name=`SuppressedError`,Error.captureStackTrace(this,this.constructor)}};const Kl={get dispose(){return Symbol.dispose||Symbol.for(`dispose`)},get asyncDispose(){return Symbol.asyncDispose||Symbol.for(`asyncDispose`)}};function ql(e){return e?.[Kl.dispose]!=null}function Jl(e){return e?.[Kl.asyncDispose]!=null}const Yl=globalThis.SuppressedError||Gl;var Xl=class e{callbacks=[];get disposed(){return this.callbacks.length===0}use(e){return Jl(e)?this.callbacks.push(()=>e[Kl.asyncDispose]()):ql(e)&&this.callbacks.push(()=>e[Kl.dispose]()),e}adopt(e,t){return t&&this.callbacks.push(()=>t(e)),e}defer(e){e&&this.callbacks.push(e)}move(){let t=new e;return t.callbacks=this.callbacks,this.callbacks=[],t}disposeAsync(){return this[Kl.asyncDispose]()}_error;_iterateCallbacks(){let e=this.callbacks.pop();if(e)return y(e,()=>this._iterateCallbacks(),e=>(this._error=this._error?new Yl(e,this._error):e,this._iterateCallbacks()))}[Kl.asyncDispose](){let e=this._iterateCallbacks();if(e?.then)return e.then(()=>{if(this._error){let e=this._error;throw this._error=void 0,e}});if(this._error){let e=this._error;throw this._error=void 0,e}}[Symbol.toStringTag]=`AsyncDisposableStack`};globalThis.SuppressedError,Kl.dispose,globalThis.DisposableStack;const Zl=globalThis.AsyncDisposableStack||Xl;globalThis.SuppressedError;function Ql(e){if(e instanceof Error)return e;if(typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`){let t;`cause`in e&&(t={cause:e.cause});let n=Error(e.message,t);return`stack`in e&&typeof e.stack==`string`&&(n.stack=e.stack),`name`in e&&typeof e.name==`string`&&(n.name=e.name),n}return Error(String(e))}function $l(e){let t=e[Symbol.asyncIterator](),n,r,i=!1;async function a(){if(i)return{value:void 0,done:!0};try{if(!n){if(r)return await r,await a();let e;r=new Promise(t=>{e=t});let o=await t.next();return o.done?(i=!0,await a()):(n=o.value[Symbol.asyncIterator](),r=void 0,e(),await a())}let e=n,o=await n.next();return o.done?(n===e&&(n=void 0),await a()):o}catch(e){throw i=!0,e}}return{next:a,async return(){return i=!0,await Promise.all([n?.return?.(),t.return?.()]),{value:void 0,done:!0}},async throw(e){
127
+ /* c8 ignore next */
128
+ throw i=!0,await Promise.all([n?.throw?.(e),t.throw?.(e)]),e},[Symbol.asyncIterator](){return this},async[Kl.asyncDispose](){i=!0,await Promise.all([n?.[Kl.asyncDispose]?.(),t?.[Kl.asyncDispose]?.()])}}}function eu(e,t){if(!e)throw Error(t??`Unexpected invariant triggered.`)}function tu(e,t,n){t?.throwIfAborted();let r=Object.create(null),i=[];for(let t in e){let n=y(()=>e[t],e=>{r[t]=e});v(n)&&i.push(n)}if(!i.length)return r;let a=i.length===1?i[0]:Promise.all(i);return n?Promise.race([n,a]).then(()=>r):a.then(()=>r)}function nu(e,t,n,r){let i=[],a=r?.maxErrors;try{let r=ru(e,t,n,e=>{if(a!=null&&i.length>=a)throw Y(`Too many errors processing variables, error limit reached. Execution aborted.`);i.push(e)});if(i.length===0)return{coerced:r}}catch(e){i.push(e)}return{errors:i}}function ru(e,t,n,r){let i={};for(let a of t){let t=a.variable.name.value,o=Mr(e,a.type);if(!Zt(o)){r(Y(`Variable "$${t}" expected value of type "${A(a.type)}" which cannot be used as an input type.`,{nodes:a.type}));continue}if(!Tl(n,t)){a.defaultValue?i[t]=Gi(a.defaultValue,o):z(o)&&r(Y(`Variable "$${t}" of required type "${G(o)}" was not provided.`,{nodes:a}));continue}let s=n[t];if(s===null&&z(o)){r(Y(`Variable "$${t}" of non-null type "${G(o)}" must not be null.`,{nodes:a}));continue}i[t]=Hi(s,o,(e,n,i)=>{let o=`Variable "$${t}" got invalid value `+G(n);e.length>0&&(o+=` at "${t}${Wl(e)}"`),r(Y(o+`; `+i.message,{nodes:a,originalError:i}))})}return i}const iu=Ol((e,t,n)=>Vl(e.schema,e.fragments,e.variableValues,t,n));function au(e){let t=lu(e);return`schema`in t?ou(t):{errors:t.map(e=>(Object.defineProperty(e,"extensions",{value:{...e.extensions,http:{...e.extensions?.http||{},status:400}}}),e))}}function ou(e){return e.signal?.throwIfAborted(),y(()=>du(e),t=>{let n=su(t,e.errors);return e.subsequentPayloads.size>0?{initialResult:{...n,hasNext:!0},subsequentResults:Gu(e)}:n},t=>(e.signal?.throwIfAborted(),t.errors?e.errors.push(...t.errors):e.errors.push(t),su(null,e.errors)))}function su(e,t){return t.length===0?{data:e}:{errors:t,data:e}}const cu=Dl(function(e){let t=Object.create(null);for(let n of e.definitions)n.kind===E.FRAGMENT_DEFINITION&&(t[n.name.value]=n);return t});function lu(e){let{schema:t,document:n,rootValue:r,contextValue:i,variableValues:a,operationName:o,fieldResolver:s,typeResolver:c,subscribeFieldResolver:l,signal:u,schemaCoordinateInErrors:d}=e;u?.throwIfAborted(),pr(t);let f=cu(n),p;for(let e of n.definitions)switch(e.kind){case E.OPERATION_DEFINITION:if(o==null){if(p!==void 0)return[Y(`Must provide operation name if query contains multiple operations.`,{extensions:{code:`OPERATION_RESOLUTION_FAILURE`}})];p=e}else e.name?.value===o&&(p=e)}if(p==null)return o==null?[Y(`Must provide an operation.`,{extensions:{code:`OPERATION_RESOLUTION_FAILURE`}})]:[Y(`Unknown operation named "${o}".`,{extensions:{code:`OPERATION_RESOLUTION_FAILURE`}})];let m=nu(t,p.variableDefinitions??[],a??{},{maxErrors:50});if(m.errors)return m.errors;u?.throwIfAborted();let h,g;if(u){let e=/* @__PURE__ */ new Set,t=oe();g=t.promise;let n=()=>{t.reject(u.reason),u.removeEventListener(`abort`,n)};u.addEventListener(`abort`,n,{once:!0}),g.catch(()=>{for(let t of e)t();e.clear()}),h=t=>{e.add(t)}}return{schema:t,fragments:f,rootValue:r,contextValue:i,operation:p,variableValues:m.coerced,fieldResolver:s??ku,typeResolver:c??Ou,subscribeFieldResolver:l??ku,subsequentPayloads:/* @__PURE__ */ new Set,errors:[],signal:u,onSignalAbort:h,signalPromise:g,schemaCoordinateInErrors:d}}function uu(e,t){return{...e,rootValue:t,subsequentPayloads:/* @__PURE__ */ new Set,errors:[]}}function du(e){let{operation:t,schema:n,fragments:r,variableValues:i,rootValue:a}=e,o=Al(n,t.operation,[t]);o??Y(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});let{fields:s,patches:c}=Il(n,r,i,o,t.selectionSet),l;l=t.operation===`mutation`?fu(e,o,a,void 0,s):pu(e,o,a,void 0,s);for(let t of c){let{label:n,fields:r}=t;zu(e,o,a,r,n,void 0)}return l}function fu(e,t,n,r,i){return wl(i,(i,[a,o])=>{let s=Ul(r,a,t.name);return e.signal?.throwIfAborted(),y(()=>mu(e,t,n,o,s),e=>(e===void 0||(i[a]=e),i))},Object.create(null))}function pu(e,t,n,r,i,a){let o=Object.create(null),s=!1;try{for(let[c,l]of i){e.signal?.throwIfAborted();let i=mu(e,t,n,l,Ul(r,c,t.name),a);i!==void 0&&(o[c]=i,v(i)&&(s=!0))}}catch(t){if(t!==e.signal?.reason&&s)return y(()=>tu(o,e.signal),()=>{throw t},()=>{throw t});throw t}return s?tu(o,e.signal,e.signalPromise):o}function mu(e,t,n,r,i,a){let o=a?.errors??e.errors,s=Yu(e.schema,t,r[0]);if(!s)return;let c=s.type,l=s.resolve??e.fieldResolver,u=hu(e,s,r,t,i);try{e.signal?.throwIfAborted();let t=El(s,r[0],e.variableValues),d=e.contextValue,f=l(n,t,d,u),p;return p=v(f)?f.then(t=>_u(e,c,r,u,i,t,a)):_u(e,c,r,u,i,f,a),v(p)?p.then(void 0,t=>{if(t instanceof AggregateError){let n;for(let s of t.errors)s=Ql(s),n=gu(xl(s,r,X(i),e.schemaCoordinateInErrors&&u),c,o),Uu(e,i,a);return n}t=Ql(t);let n=gu(xl(t,r,X(i),e.schemaCoordinateInErrors&&u),c,o);return Uu(e,i,a),n}):p}catch(t){if(t instanceof AggregateError){let n;for(let s of t.errors)s=Ql(s),n=gu(xl(s,r,X(i),e.schemaCoordinateInErrors&&u),c,o),Uu(e,i,a);return n}let n=gu(xl(Ql(t),r,X(i),e.schemaCoordinateInErrors&&u),c,o);return Uu(e,i,a),n}}function hu(e,t,n,r,i){return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues,signal:e.signal}}function gu(e,t,n){if(z(t)||e.extensions?.CRITICAL_ERROR)throw e;return n.push(e),null}function _u(e,t,n,r,i,a,o){if(a instanceof Error)throw a;if(z(t)){let s=_u(e,t.ofType,n,r,i,a,o);if(s===null)throw Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return s}if(a==null)return null;if(R(t))return bu(e,t,n,r,i,a,o);if($t(t))return Su(t,a);if(tn(t))return Cu(e,t,n,r,i,a,o);if(N(t))return Tu(e,t,n,r,i,a,o);
129
+ /* c8 ignore next 6 */
130
+ console.assert(!1,`Cannot complete value of unexpected output type: `+G(t))}function vu(e,t,n){if(typeof n.key==`number`)return;let r=Yi(Pl,t[0],e.variableValues);if(r&&r.if!==!1)return eu(typeof r.initialCount==`number`,`initialCount must be a number`),eu(r.initialCount>=0,`initialCount must be a positive integer`),{initialCount:r.initialCount,label:typeof r.label==`string`?r.label:void 0}}async function yu(e,t,n,r,i,a,o){e.signal?.throwIfAborted(),a.return&&e.onSignalAbort?.(()=>{a.return?.()});let s=o?.errors??e.errors,c=vu(e,n,i),l=!1,u=[],d=0;for(;;){if(c&&typeof c.initialCount==`number`&&d>=c.initialCount){Hu(d,a,e,n,r,t,i,c.label,o);break}let f=Ul(i,d,void 0),p;try{if(p=await a.next(),p.done)break}catch(i){let a=xl(Ql(i),n,X(f),e.schemaCoordinateInErrors&&r);u.push(gu(a,t,s));break}xu(p.value,u,s,e,t,n,r,f,o)&&(l=!0),d+=1}return l?Promise.all(u):u}function bu(e,t,n,r,i,a,o){let s=t.ofType,c=o?.errors??e.errors;if(Hl(a))return yu(e,s,n,r,i,a[Symbol.asyncIterator](),o);if(!Sl(a))throw Y(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);let l=vu(e,n,i),u=!1,d=o,f=[],p=0;for(let t of a){let a=Ul(i,p,void 0);if(l&&typeof l.initialCount==`number`&&p>=l.initialCount){d=Bu(i,a,t,e,n,r,s,l.label,d),p++;continue}xu(t,f,c,e,s,n,r,a,o)&&(u=!0),p++}return u?Promise.all(f):f}function xu(e,t,n,r,i,a,o,s,c){try{let l;if(l=v(e)?e.then(e=>_u(r,i,a,o,s,e,c)):_u(r,i,a,o,s,e,c),v(l))return t.push(l.then(void 0,e=>{e=Ql(e);let t=gu(xl(e,a,X(s),r.schemaCoordinateInErrors&&o),i,n);return Uu(r,s,c),t})),!0;t.push(l)}catch(e){let l=gu(xl(Ql(e),a,X(s),r.schemaCoordinateInErrors&&o),i,n);Uu(r,s,c),t.push(l)}return!1}function Su(e,t){let n;try{n=e.serialize(t)}catch(e){throw e instanceof C?Error(e.message):e}if(n==null)throw Error(`Expected \`${G(e)}.serialize(${G(t)})\` to return non-nullable value, returned: ${G(n)}`);return n}function Cu(e,t,n,r,i,a,o){let s=t.resolveType??e.typeResolver,c=e.contextValue,l=s(a,c,r,t);return v(l)?l.then(s=>Tu(e,wu(s,e,t,n,r,a),n,r,i,a,o)):Tu(e,wu(l,e,t,n,r,a),n,r,i,a,o)}function wu(e,t,n,r,i,a){if(e==null)throw Y(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${n.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,{nodes:r});if(N(e)){if(be.major>=16)throw Y(`Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.`);e=e.name}if(typeof e!=`string`)throw Y(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${G(a)}, received "${G(e)}".`);let o=t.schema.getType(e);if(o==null)throw Y(`Abstract type "${n.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!N(o))throw Y(`Abstract type "${n.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(!t.schema.isSubType(n,o))throw Y(`Runtime Object type "${o.name}" is not a possible type for "${n.name}".`,{nodes:r});return o}function Tu(e,t,n,r,i,a,o){if(t.isTypeOf){let s=t.isTypeOf(a,e.contextValue,r);if(v(s))return s.then(r=>{if(!r)throw Eu(t,a,n);return Du(e,t,n,i,a,o)});if(!s)throw Eu(t,a,n)}return Du(e,t,n,i,a,o)}function Eu(e,t,n){return Y(`Expected value of type "${e.name}" but got: ${G(t)}.`,{nodes:n})}function Du(e,t,n,r,i,a){let{fields:o,patches:s}=iu(e,t,n),c=pu(e,t,i,r,o,a);for(let n of s){let{label:o,fields:s}=n;zu(e,t,i,s,o,r,a)}return c}const Ou=function(e,t,n,r){if(Cl(e)&&typeof e.__typename==`string`)return e.__typename;let i=n.schema.getPossibleTypes(r),a=[];for(let r=0;r<i.length;r++){let o=i[r];if(o.isTypeOf){let i=o.isTypeOf(e,t,n);if(v(i))a[r]=i;else if(i)return o.name}}if(a.length)return Promise.all(a).then(e=>{for(let t=0;t<e.length;t++)if(e[t])return i[t].name})},ku=function(e,t,n,r){if(Cl(e)||typeof e==`function`){let i=e[r.fieldName];return typeof i==`function`?e[r.fieldName](t,n,r):i}};function Au(e){let t=lu(e);if(!(`schema`in t)){for(let e of t){let t=e.extensions||={},n=t.http||={};n.status=400,e.extensions.code=`BAD_USER_INPUT`}return{errors:t}}let n=Iu(t);return v(n)?n.then(e=>Pu(t,e)):Pu(t,n)}function ju(e){return e?.initialResult}function Mu(e){let t=e.subsequentResults,n=!1,r=!1;return{[Symbol.asyncIterator](){return this},next(){return r?b({value:void 0,done:r}):n?t.next():(n=!0,b({value:e.initialResult,done:r}))},return(){return r=!0,t.return()},throw(e){return r=!0,t.throw(e)},[Kl.asyncDispose](){return r=!0,t?.[Kl.asyncDispose]?.()}}}async function*Nu(e){`initialResult`in e?yield*Mu(e):yield e}function Pu(e,t){return Hl(t)?$l(ce(t,t=>y(()=>ou(uu(e,t)),Nu),t=>{throw t instanceof AggregateError?AggregateError(t.errors.map(t=>Fu(t,e.operation)),t.message):Fu(t,e.operation)})):t}function Fu(e,t){return Y(e.message,{originalError:e,nodes:[t]})}function Iu(e){try{let t=Lu(e);return v(t)?t.then(void 0,e=>({errors:[e]})):t}catch(e){return{errors:[e]}}}function Lu(e){let{schema:t,fragments:n,operation:r,variableValues:i,rootValue:a}=e,o=t.getSubscriptionType();if(o==null)throw Y(`Schema is not configured to execute subscription operation.`,{nodes:r});let{fields:s}=Il(t,n,i,o,r.selectionSet),[c,l]=[...s.entries()][0],u=l[0].name.value,d=Yu(t,o,l[0]);if(!d)throw Y(`The subscription field "${u}" is not defined.`,{nodes:l});let f=Ul(void 0,c,o.name),p=hu(e,d,l,o,f);try{let t=El(d,l[0],i),n=e.contextValue,r=(d.subscribe??e.subscribeFieldResolver)(a,t,n,p);return v(r)?r.then(t=>Ru(t,e.signal,e.onSignalAbort)).then(void 0,t=>{throw xl(t,l,X(f),e.schemaCoordinateInErrors&&p)}):Ru(r,e.signal,e.onSignalAbort)}catch(t){throw xl(t,l,X(f),e.schemaCoordinateInErrors&&p)}}function Ru(e,t,n){if(t?.throwIfAborted(),e instanceof Error)throw e;if(!Hl(e))throw Y(`Subscription field must return Async Iterable. Received: ${G(e)}.`);return n?{[Symbol.asyncIterator](){let t=e[Symbol.asyncIterator]();return t.return&&n?.(()=>{t.return?.()}),t}}:e}function zu(e,t,n,r,i,a,o){let s=new Ku({label:i,path:a,parentContext:o,exeContext:e}),c;try{c=pu(e,t,n,a,r,s),v(c)&&(c=c.then(null,e=>(s.errors.push(e),null)))}catch(e){s.errors.push(e),c=null}s.addData(c)}function Bu(e,t,n,r,i,a,o,s,c){let l=new qu({label:s,path:t,parentContext:c,exeContext:r}),u;try{try{u=v(n)?n.then(e=>_u(r,o,i,a,t,e,l)):_u(r,o,i,a,t,n,l),v(u)&&(u=u.then(void 0,e=>{e=Ql(e);let n=gu(xl(e,i,X(t),r.schemaCoordinateInErrors&&a),o,l.errors);return Uu(r,t,l),n}))}catch(e){u=gu(xl(Ql(e),i,X(t),r.schemaCoordinateInErrors&&a),o,l.errors),Uu(r,t,l)}}catch(t){return l.errors.push(t),Uu(r,e,l),l.addItems(null),l}let d;return d=v(u)?u.then(e=>[e],t=>(l.errors.push(t),Uu(r,e,l),null)):[u],l.addItems(d),l}async function Vu(e,t,n,r,i,a,o){let s;try{let{value:t,done:n}=await e.next();if(n)return a.setIsCompletedIterator(),{done:n,value:void 0};s=t}catch(e){return{done:!0,value:gu(xl(Ql(e),n,X(o),t.schemaCoordinateInErrors&&r),i,a.errors)}}let c;try{return c=_u(t,i,n,r,o,s,a),v(c)&&(c=c.then(void 0,e=>{let s=gu(xl(e,n,X(o),t.schemaCoordinateInErrors&&r),i,a.errors);return Uu(t,o,a),s})),{done:!1,value:c}}catch(e){let s=gu(xl(e,n,X(o),t.schemaCoordinateInErrors&&r),i,a.errors);return Uu(t,o,a),{done:!1,value:s}}}async function Hu(e,t,n,r,i,a,o,s,c){let l=e,u=c??void 0;for(;;){let e=Ul(o,l,void 0),c=new qu({label:s,path:e,parentContext:u,iterator:t,exeContext:n}),d;try{d=await Vu(t,n,r,i,a,c,e)}catch(e){c.errors.push(e),Uu(n,o,c),c.addItems(null),t?.return&&t.return().catch(()=>{});return}let{done:f,value:p}=d,m;if(m=v(p)?p.then(e=>[e],e=>(c.errors.push(e),Uu(n,o,c),null)):[p],c.addItems(m),f)break;u=c,l++}}function Uu(e,t,n){let r=X(t);e.subsequentPayloads.forEach(t=>{if(t!==n){for(let e=0;e<r.length;e++)if(t.path[e]!==r[e])return;Ju(t)&&t.iterator?.return&&t.iterator.return().catch(()=>{}),e.subsequentPayloads.delete(t)}})}function Wu(e){let t=[];for(let n of e.subsequentPayloads){let r={};if(n.isCompleted){if(e.subsequentPayloads.delete(n),Ju(n)){let e=n.items;if(n.isCompletedIterator)continue;r.items=e}else r.data=n.data??null;r.path=n.path,n.label&&(r.label=n.label),n.errors.length>0&&(r.errors=n.errors),t.push(r)}}return t}function Gu(e){let t=!1;async function n(){if(t)return{value:void 0,done:!0};let r=Array.from(e.subsequentPayloads).map(e=>e.promise);if(e.signalPromise?await Promise.race([e.signalPromise,...r]):await Promise.race(r),t)return{value:void 0,done:!0};let i=Wu(e),a=e.subsequentPayloads.size>0;return!i.length&&a?n():(a||(t=!0),{value:i.length?{incremental:i,hasNext:a}:{hasNext:a},done:!1})}function r(){let t=[];return e.subsequentPayloads.forEach(e=>{Ju(e)&&e.iterator?.return&&t.push(e.iterator.return())}),Promise.all(t)}return{[Symbol.asyncIterator](){return this},next:n,async return(){return await r(),t=!0,{value:void 0,done:!0}},async throw(e){throw await r(),t=!0,e},async[Kl.asyncDispose](){await r(),t=!0}}}var Ku=class{type;errors;label;path;promise;data;parentContext;isCompleted;_exeContext;_resolve;constructor(e){this.type=`defer`,this.label=e.label,this.path=X(e.path),this.parentContext=e.parentContext,this.errors=[],this._exeContext=e.exeContext,this._exeContext.subsequentPayloads.add(this),this.isCompleted=!1,this.data=null,this.promise=new Promise(e=>{this._resolve=t=>{e(t)}}).then(e=>{this.data=e,this.isCompleted=!0})}addData(e){let t=this.parentContext?.promise;if(t){this._resolve?.(t.then(()=>e));return}this._resolve?.(e)}},qu=class{type;errors;label;path;items;promise;parentContext;iterator;isCompletedIterator;isCompleted;_exeContext;_resolve;constructor(e){this.type=`stream`,this.items=null,this.label=e.label,this.path=X(e.path),this.parentContext=e.parentContext,this.iterator=e.iterator,this.errors=[],this._exeContext=e.exeContext,this._exeContext.subsequentPayloads.add(this),this.isCompleted=!1,this.items=null,this.promise=new Promise(e=>{this._resolve=t=>{e(t)}}).then(e=>{this.items=e,this.isCompleted=!0})}addItems(e){let t=this.parentContext?.promise;if(t){this._resolve?.(t.then(()=>e));return}this._resolve?.(e)}setIsCompletedIterator(){this.isCompletedIterator=!0}};function Ju(e){return e.type===`stream`}function Yu(e,t,n){let r=n.name.value;return r===rr.name&&e.getQueryType()===t?rr:r===ir.name&&e.getQueryType()===t?ir:r===ar.name?ar:t.getFields()[r]}function Xu(e){let t=La(e.document,e.operationName);if(t==null)throw Error(`Must provide an operation.`);return t.operation===`subscription`?Au(e):y(()=>au(e),e=>ju(e)?Mu(e):e)}var Zu=/* @__PURE__ */ o(((e,t)=>{t.exports.fetch=globalThis.fetch,t.exports.Headers=globalThis.Headers,t.exports.Request=globalThis.Request,t.exports.Response=globalThis.Response,t.exports.FormData=globalThis.FormData,t.exports.ReadableStream=globalThis.ReadableStream,t.exports.WritableStream=globalThis.WritableStream,t.exports.TransformStream=globalThis.TransformStream,t.exports.CompressionStream=globalThis.CompressionStream,t.exports.DecompressionStream=globalThis.DecompressionStream,t.exports.TextDecoderStream=globalThis.TextDecoderStream,t.exports.TextEncoderStream=globalThis.TextEncoderStream,t.exports.Blob=globalThis.Blob,t.exports.File=globalThis.File,t.exports.crypto=globalThis.crypto,t.exports.btoa=globalThis.btoa,t.exports.TextEncoder=globalThis.TextEncoder,t.exports.TextDecoder=globalThis.TextDecoder,t.exports.URLPattern=globalThis.URLPattern,t.exports.URL=globalThis.URL,t.exports.URLSearchParams=globalThis.URLSearchParams,t.exports.createFetch=()=>globalThis}));function Qu(e){return typeof e==`object`&&!!e&&typeof e[Symbol.asyncIterator]==`function`}function $u(e){return e.socket?.localPort?e.socket?.localPort:(e.headers?.[`:authority`]||e.headers?.host)?.split(`:`)?.[1]||80}function ed(e){if(e.headers?.[`:authority`])return e.headers?.[`:authority`];if(e.headers?.host)return e.headers?.host;let t=$u(e);if(e.hostname)return e.hostname+`:`+t;let n=e.socket?.localAddress;return n&&!n?.includes(`::`)&&!n?.includes(`ffff`)?`${n}:${t}`:`localhost`}function td(e){let t=ed(e);return`${e.protocol||(e.socket?.encrypted?`https`:`http`)}://${t}${e.originalUrl||e.url||`/graphql`}`}function nd(e){let t=e[Symbol.toStringTag];return!!(typeof e==`string`||t===`Uint8Array`||t===`Blob`||t===`FormData`||t===`URLSearchParams`||Qu(e))}function rd(e,t,n,r){let i=e.raw||e.req||e,a=td(i);if(e.query){let n=new t.URL(a);for(let t in e.query)n.searchParams.set(t,e.query[t]);a=n.toString()}let o=e.headers;if(e.headers?.[`:method`]){o={};for(let t in e.headers)t.startsWith(`:`)||(o[t]=e.headers[t])}let s=r?kd():new AbortController;if(n?.once){let e=()=>{s.signal.aborted||(Object.defineProperty(i,"aborted",{value:!0}),s.abort(n.errored??void 0))};n.once(`error`,e),n.once(`close`,e),n.once(`finish`,()=>{n.removeListener(`close`,e)})}if(e.method===`GET`||e.method===`HEAD`)return new t.Request(a,{method:e.method,headers:o,signal:s.signal});let c=e.body;if(c!=null&&Object.keys(c).length>0){if(nd(c))return new t.Request(a,{method:e.method||`GET`,headers:o,body:c,signal:s.signal});let n=new t.Request(a,{method:e.method||`GET`,headers:o,signal:s.signal});return n.headers.get(`content-type`)?.includes(`json`)||n.headers.set(`content-type`,`application/json; charset=utf-8`),new Proxy(n,{get(e,t,r){switch(t){case`json`:return()=>b(c);case`text`:return()=>b(JSON.stringify(c));default:{let e=Reflect.get(n,t,n);return typeof e==`function`?function(...t){return e.apply(this===r?n:this,t)}:e}}}})}return new t.Request(a,{method:e.method,headers:o,signal:s.signal,body:i,duplex:`half`})}function id(e){return e.read!=null}function ad(e){return id(e)}function od(e){return e!=null&&e.setHeader!=null&&e.end!=null&&e.once!=null&&e.write!=null}function sd(e){return e!=null&&e.getReader!=null}function cd(e){return e!=null&&e.request!=null&&e.respondWith!=null}function ld(e){e?.socket?.setTimeout?.(0),e?.socket?.setNoDelay?.(!0),e?.socket?.setKeepAlive?.(!0)}function ud(e){e.end(null,null,null)}function dd(e,t){let n=!1,r=()=>{n=!0};e.once(`error`,r),e.once(`close`,r),e.once(`finish`,()=>{e.removeListener(`close`,r),e.removeListener(`error`,r)});let i=t[Symbol.asyncIterator]();return pd(()=>i.next(),e,()=>n)}function fd(e){e.end(null,null,null)}function pd(e,t,n){let r=()=>y(e,e=>n?.()||e.done?fd(t):y(()=>md(e.value,t),()=>n?.()?fd(t):r()));return r()}function md(e,t){if(!t.write(e))return new Promise(e=>t.once(`drain`,e))}const hd=globalThis.process?.versions?.node?.startsWith(`1`);function gd(e,t,n,r){if(t.closed||t.destroyed||t.writableEnded)return;if(!e){t.statusCode=404,ud(t);return}if(r&&e.headers?.headersInit&&!Array.isArray(e.headers.headersInit)&&!e.headers.headersInit.get&&!e.headers._map&&!e.headers._setCookies?.length)t.writeHead(e.status,e.statusText,e.headers.headersInit);else{if(t.setHeaders&&!hd)t.setHeaders(e.headers);else{let n=!1;e.headers.forEach((r,i)=>{if(i===`set-cookie`){if(n)return;n=!0;let r=e.headers.getSetCookie?.();if(r){t.setHeader(`set-cookie`,r);return}}t.setHeader(i,r)})}t.writeHead(e.status,e.statusText)}if(e.bodyType===`String`){let n=e.bodyInit;return y(()=>md(n,t),()=>ud(t))}let i=e._buffer;if(i)return y(()=>md(i,t),()=>ud(t));let a=e.body;if(a==null){ud(t);return}if(a[Symbol.toStringTag]===`Uint8Array`)return y(()=>md(a,t),()=>ud(t));if(ld(n),id(a)){t.once(`close`,()=>{a.destroy()}),a.pipe(t,{end:!0});return}if(sd(a))return _d(n,t,a);if(Qu(a))return dd(t,a)}function _d(e,t,n){let r=n.getReader();return e?.once?.(`error`,e=>{r.cancel(e)}),pd(()=>r.read(),t)}function vd(e){return typeof e==`object`&&!!e&&(`body`in e||`cache`in e||`credentials`in e||`headers`in e||`integrity`in e||`keepalive`in e||`method`in e||`mode`in e||`redirect`in e||`referrer`in e||`referrerPolicy`in e||`signal`in e||`window`in e)}function yd(...e){let[t,...n]=e.filter(e=>typeof e==`object`&&!!e);return n.forEach(e=>{let n=Object.getOwnPropertyNames(e).reduce((t,n)=>(Object.getOwnPropertyDescriptor(e,n)&&(t[n]=Object.getOwnPropertyDescriptor(e,n)),t),{});Object.getOwnPropertySymbols(e).forEach(t=>{let r=Object.getOwnPropertyDescriptor(e,t);r?.enumerable&&(n[t]=r)}),Object.defineProperties(t,n)}),t}function bd(e,t){return new t(e.stack||e.message||e.toString(),{status:e.status||500})}function xd(e,t){return e==null?t==null?{}:{waitUntil:t}:yd(Object.create(e),{waitUntil:t},e)}function Sd(e,t){if(t?.aborted)throw t.reason;if(v(e)&&t){let n=oe();function r(){n.reject(t.reason)}return t.addEventListener(`abort`,r,{once:!0}),e.then(function(e){n.resolve(e)}).catch(function(e){n.reject(e)}).finally(()=>{t.removeEventListener(`abort`,r)}),n.promise}return e}const Cd=[`SIGINT`,`exit`,`SIGTERM`],wd=/* @__PURE__ */ new Set;let Td=!1;function Ed(){if(!Td){Td=!0;for(let e of Cd)globalThis.process.once(e,function(){return Promise.allSettled([...wd].map(e=>!e.disposed&&e.disposeAsync()))})}}function Dd(e){globalThis.process&&(Ed(),wd.has(e)||(wd.add(e),e.defer(()=>{wd.delete(e)})))}var Od=class extends EventTarget{aborted=!1;_onabort=null;_reason;constructor(){super();let e=globalThis.process?.getBuiltinModule?.(`node:events`);e?.kMaxEventTargetListeners&&(this[e.kMaxEventTargetListeners]=0)}throwIfAborted(){if(this._nativeCtrl?.signal?.throwIfAborted)return this._nativeCtrl.signal.throwIfAborted();if(this.aborted)throw this._reason}_nativeCtrl;ensureNativeCtrl(){if(!this._nativeCtrl){let e=this.aborted;this._nativeCtrl=new AbortController,e&&this._nativeCtrl.abort(this._reason)}return this._nativeCtrl}abort(e){if(this._nativeCtrl?.abort)return this._nativeCtrl?.abort(e);this._reason=e||new DOMException(`This operation was aborted`,`AbortError`),this.aborted=!0,this.dispatchEvent(new Event(`abort`))}get signal(){return this._nativeCtrl?.signal?this._nativeCtrl.signal:this}get reason(){return this._nativeCtrl?.signal?this._nativeCtrl.signal.reason:this._reason}get onabort(){return this._onabort,this._onabort}set onabort(e){if(this._nativeCtrl?.signal){this._nativeCtrl.signal.onabort=e;return}this._onabort&&this.removeEventListener(`abort`,this._onabort),this._onabort=e,e&&this.addEventListener(`abort`,e)}};function kd(){return globalThis.Bun||globalThis.Deno?new AbortController:new Proxy(new Od,{get(e,t,n){if(t.toString().includes(`kDependantSignals`)){let n=e.ensureNativeCtrl();return Reflect.get(n.signal,t,n.signal)}return Reflect.get(e,t,n)},set(e,t,n,r){if(t.toString().includes(`kDependantSignals`)){let r=e.ensureNativeCtrl();return Reflect.set(r.signal,t,n,r.signal)}return Reflect.set(e,t,n,r)},getPrototypeOf(){return AbortSignal.prototype}})}function Ad(e){return!!e.onData}function jd({req:e,res:t,fetchAPI:n,controller:r}){let i=e.getMethod(),a,o=[],s=[e=>{o.push(e)}],c=e=>{for(let t of s)t(e)},l=!1,u=[()=>{l=!0}],d=()=>{for(let e of u)e()};t.onData(function(e,t){c(Buffer.from(Buffer.from(e,0,e.byteLength))),t&&d()});let f;if(i!==`get`&&i!==`head`){a=`half`,r.signal.addEventListener(`abort`,()=>{d()},{once:!0});let e;f=()=>(e||=new n.ReadableStream({start(e){for(let t of o)e.enqueue(t);if(l){e.close();return}s.push(t=>{e.enqueue(t)}),u.push(()=>{if(r.signal.reason){e.error(r.signal.reason);return}e.desiredSize&&e.close()})}}),e)}let p=new n.Headers;e.forEach((e,t)=>{p.append(e,t)});let m=`http://localhost${e.getUrl()}`,h=e.getQuery();h&&(m+=`?${h}`);let g;function ee(){return f?l?_():f():null}let te=new n.Request(m,{method:i,headers:p,get body(){return ee()},signal:r.signal,duplex:a});function _(){return g||=o.length===1?o[0]:Buffer.concat(o),g}function ne(){return l?b(_()):new Promise((e,t)=>{try{u.push(()=>{e(_())})}catch(e){t(e)}})}return Object.defineProperties(te,{body:{get(){return ee()},configurable:!0,enumerable:!0},json:{value(){return ne().then(e=>e.toString(`utf8`)).then(e=>JSON.parse(e))},configurable:!0,enumerable:!0},text:{value(){return ne().then(e=>e.toString(`utf8`))},configurable:!0,enumerable:!0},arrayBuffer:{value(){return ne()},configurable:!0,enumerable:!0}}),te}function Md(e,t){return new t.WritableStream({write(t){e.cork(()=>{e.write(t)})},close(){e.cork(()=>{e.end()})}})}function Nd(e,t,n,r){if(!t){e.writeStatus(`404 Not Found`),e.end();return}let i=t._buffer,a=t.bodyType===`String`?t.bodyInit:void 0;if(!n.signal.aborted&&(e.cork(()=>{e.writeStatus(`${t.status} ${t.statusText}`);let n=!1;for(let[r,i]of t.headers)if(r!==`content-length`&&r!==`transfer-encoding`){if(r===`set-cookie`){if(n)continue;n=!0;let i=t.headers.getSetCookie?.();if(i){for(let t of i)e.writeHeader(r,t);continue}}e.writeHeader(r,i)}a?e.end(a):i?e.end(i):t.body||e.end()}),!(a||i||!t.body)))return n.signal.addEventListener(`abort`,()=>{t.body?.locked||t.body?.cancel(n.signal.reason)},{once:!0}),t.body.pipeTo(Md(e,r),{signal:n.signal}).catch(e=>{if(!n.signal.aborted)throw e})}var Pd=/* @__PURE__ */ c(Zu(),1);function Fd(e){try{return!!e?.request}catch{return!1}}const Id={};function Ld(e,t){let n=t?.__useSingleWriteHead==null||t.__useSingleWriteHead,r={...Pd,...t?.fetchAPI},i=t?.__useCustomAbortCtrl==null?r.Request!==globalThis.Request:t.__useCustomAbortCtrl,a=typeof e==`function`?e:e.handle,o=[],s=[],c,l=/* @__PURE__ */ new Set,u;function d(){return u||(u=new Zl,t?.disposeOnProcessTerminate&&Dd(u),u.defer(()=>{if(l.size>0)return Promise.allSettled(l).then(()=>{l.clear()},()=>{l.clear()})})),u}function f(e){v(e)&&(d(),l.add(e),e.then(()=>{l.delete(e)},t=>{console.error(`Unexpected error while waiting: ${t.message||t}`),l.delete(e)}))}if(t?.plugins!=null)for(let e of t.plugins){e.instrumentation&&(c=c?Xc(c,e.instrumentation):e.instrumentation),e.onRequest&&o.push(e.onRequest),e.onResponse&&s.push(e.onResponse);let t=e[Kl.dispose];t&&d().defer(t);let n=e[Kl.asyncDispose];n&&d().defer(n),e.onDispose&&d().defer(e.onDispose)}let p=o.length>0||s.length>0?function(e,t){let n=a,i;if(o.length===0)return u();let c=e.parsedUrl||new Proxy(Id,{get(t,n,i){return c=new r.URL(e.url,`http://localhost`),Reflect.get(c,n,c)}});function l(n){return s.length===0?n:y(()=>x(s,i=>i({request:e,response:n,serverContext:t,setResponse(e){n=e},fetchAPI:r})),()=>n)}function u(){return i?l(i):y(()=>n(e,t),l)}return y(()=>x(o,(a,o)=>a({request:e,setRequest(t){e=t},serverContext:t,fetchAPI:r,url:c,requestHandler:n,setRequestHandler(e){n=e},endResponse(e){i=e,e&&o()}})),u)}:a;if(c?.request){let e=p;p=(t,n)=>Zc({request:t}).asyncFn(c.request,e)(t,n)}function m(e,...t){let n=t.length>1?yd(...t):t[0]||{};n.waitUntil||=f;let a=rd(e,r,void 0,i);return p(a,n)}function h(e,t,...n){let a=t.raw||t,o=n.length>1?yd(...n):n[0]||{};o.waitUntil||=f;let s=rd(e,r,a,i);return p(s,o)}function g(e,t,...i){let a={req:e,res:t,waitUntil:f};return pe(b().then(()=>h(e,t,a,...i)).catch(e=>bd(e,r.Response)).then(r=>gd(r,t,e,n)).catch(e=>console.error(`Unexpected error while handling request: ${e.message||e}`)))}function ee(e,t,...n){let a={res:e,req:t,waitUntil:f},o=n.filter(e=>e!=null).length>0?yd(a,...n):a,s=i?kd():new AbortController,c=e.end.bind(e),l=!1;e.end=function(e){return l=!0,c(e)},e.onAborted.bind(e)(function(){s.abort()}),e.onAborted=function(e){s.signal.addEventListener(`abort`,e,{once:!0})};let u=jd({req:t,res:e,fetchAPI:r,controller:s});return y(()=>y(()=>p(u,o),e=>e,e=>bd(e,r.Response)),t=>{if(!s.signal.aborted&&!l)return y(()=>Nd(e,t,s,r),e=>e,e=>{console.error(`Unexpected error while handling request: ${e.message||e}`)})})}function te(e,...t){if(!e.respondWith||!e.request)throw TypeError(`Expected FetchEvent, got ${e}`);let n=t.filter(e=>e!=null),r=n.length>0?yd({},e,...n):xd(e),i=p(e.request,r);e.respondWith(i)}function _(e,...t){let n=t.filter(e=>e!=null),r=n.length>1?yd({},...n):xd(n[0],n[0]==null||n[0].waitUntil==null?f:void 0);return p(e,r)}let ne=(e,...t)=>{if(typeof e==`string`||`href`in e){let[n,...i]=t;if(vd(n)){let t=_(new r.Request(e,n),...i),a=n.signal;return a?Sd(t,a):t}return _(new r.Request(e),...t)}return Sd(_(e,...t),e.signal)},re=(e,...t)=>{let[n,...r]=t;if(ad(e)){if(!od(n))throw TypeError(`Expected ServerResponse, got ${n}`);return g(e,n,...r)}if(Ad(e))return ee(e,n,...r);if(od(n))throw TypeError(`Got Node response without Node request`);return Fd(e)?cd(e)?te(e,...t):_(e.request,e,...t):ne(e,...t)},ie={handleRequest:_,fetch:ne,handleNodeRequest:m,handleNodeRequestAndResponse:h,requestListener:g,handleEvent:te,handleUWS:ee,handle:re,get disposableStack(){return d()},[Kl.asyncDispose](){return u&&!u.disposed?u.disposeAsync():b()},dispose(){return u&&!u.disposed?u.disposeAsync():b()},waitUntil:f},ae=new Proxy(re,{has:(t,n)=>n in ie||n in re||e&&n in e,get:(t,n)=>{if(globalThis.Deno||n===Symbol.asyncDispose||n===Symbol.dispose){let e=Reflect.get(ie,n,ie);if(e)return e}let r=ie[n];if(r)return r.bind?r.bind(ie):r;let i=re[n];if(i)return i.bind?i.bind(re):i;if(e){let t=e[n];if(t)return t.bind?function(...t){let r=e[n](...t);return r===e?ae:r}:t}},apply(e,t,n){return re(...n)}});return ae}function Rd(e,t){let n=e.headers.get(`origin`);if(t===!1||n==null)return null;let r={};if(t.origin==null||t.origin.length===0||t.origin.includes(`*`)?(r[`Access-Control-Allow-Origin`]=n,r.Vary=`Origin`):typeof t.origin==`string`?r[`Access-Control-Allow-Origin`]=t.origin:Array.isArray(t.origin)&&(t.origin.length===1?r[`Access-Control-Allow-Origin`]=t.origin[0]:t.origin.includes(n)?(r[`Access-Control-Allow-Origin`]=n,r.Vary=`Origin`):r[`Access-Control-Allow-Origin`]=`null`),t.methods?.length)r[`Access-Control-Allow-Methods`]=t.methods.join(`, `);else{let t=e.headers.get(`access-control-request-method`);t&&(r[`Access-Control-Allow-Methods`]=t)}if(t.allowedHeaders?.length)r[`Access-Control-Allow-Headers`]=t.allowedHeaders.join(`, `);else{let t=e.headers.get(`access-control-request-headers`);t&&(r[`Access-Control-Allow-Headers`]=t,r.Vary?r.Vary+=`, Access-Control-Request-Headers`:r.Vary=`Access-Control-Request-Headers`)}return t.credentials==null?r[`Access-Control-Allow-Origin`]!==`*`&&(r[`Access-Control-Allow-Credentials`]=`true`):t.credentials===!0&&(r[`Access-Control-Allow-Credentials`]=`true`),t.exposedHeaders&&(r[`Access-Control-Expose-Headers`]=t.exposedHeaders.join(`, `)),t.maxAge&&(r[`Access-Control-Max-Age`]=t.maxAge.toString()),r}function zd(e,t,n){return y(()=>t(e,n),t=>Rd(e,t))}function Bd(e){let t=()=>({});if(e!=null){if(typeof e==`function`)t=e;else if(typeof e==`object`){let n={...e};t=()=>n}else e===!1&&(t=()=>!1)}return{onRequest({request:e,fetchAPI:t,endResponse:n}){e.method.toUpperCase()===`OPTIONS`&&n(new t.Response(null,{status:204,headers:{"Content-Length":`0`}}))},onResponse({request:e,serverContext:n,response:r}){return y(()=>zd(e,t,n),e=>{if(e!=null)for(let t in e)r.headers.set(t,e[t])})}}}const Vd=[`message`,`locations`,`path`,`nodes`,`source`,`positions`,`originalError`,`name`,`stack`,`extensions`,`coordinate`];function Hd(e){return typeof e==`object`&&!!e&&Object.keys(e).every(e=>Vd.includes(e))}function Z(e,t){t?.originalError&&!(t.originalError instanceof Error)&&Hd(t.originalError)&&(t.originalError=Z(t.originalError.message,t.originalError));let n=C,r=be.major>=16?new n(e,t):new n(e,t?.nodes,t?.source,t?.positions,t?.path,t?.originalError,t?.extensions);return t?.coordinate&&r.coordinate==null&&Object.defineProperties(r,{coordinate:{value:t.coordinate,enumerable:!0,configurable:!0}}),r}function Ud(e){return e.coordinate}function Wd(e){return e?.[Symbol.asyncIterator]!=null}function Gd(e){return typeof e==`object`&&!!e&&`errors`in e}function Kd(e){return e!=null&&typeof e.toString==`function`}function qd(e){return e instanceof C}function Jd(e){return e instanceof C?e.originalError==null||Jd(e.originalError):!1}function Yd(e){return typeof e==`object`&&e?.constructor?.name===`DOMException`&&(e.name===`AbortError`||e.name===`TimeoutError`)}function Xd(e,t,n){let r=/* @__PURE__ */ new Set;if(Gd(e))for(let i of e.errors){let e=Xd(i,t,n);for(let t of e)r.add(t)}else if(Yd(e))n.debug(`Request aborted`);else if(t){let i=t.maskError(e,t.errorMessage,t.isDev);i!==e&&n.error(e),r.add(qd(i)?i:Z(i.message,{originalError:i}))}else qd(e)?r.add(e):e instanceof Error?r.add(Z(e.message,{originalError:e})):typeof e==`string`?r.add(Z(e,{extensions:{code:`INTERNAL_SERVER_ERROR`,unexpected:!0}})):Kd(e)?r.add(Z(e.toString(),{extensions:{code:`INTERNAL_SERVER_ERROR`,unexpected:!0}})):(n.error(e),r.add(Z(`Unexpected error.`,{extensions:{unexpected:!0}})));return Array.from(r)}function Zd(e,t={},n=!1){let r,i=!1;if(`extensions`in e&&e.extensions?.http&&(e.extensions.http.headers&&Object.assign(t,e.extensions.http.headers),e.extensions.http.status&&(r=e.extensions.http.status)),`errors`in e&&e.errors?.length)for(let a of e.errors)if(a.extensions?.http){if(a.extensions.http.headers&&Object.assign(t,a.extensions.http.headers),n&&a.extensions.http.spec)continue;a.extensions.http.status&&(!r||a.extensions.http.status>r)&&(r=a.extensions.http.status)}else(!Jd(a)||a.extensions?.unexpected)&&(i=!0);else r||=200;return r||=i&&!(`data`in e)?500:200,{status:r,headers:t}}function Qd(e){return Array.isArray(e)&&e.length>0&&e.some(qd)}function $d(e){return{onResponse({response:t}){tf(t.headers,e)}}}function ef(e){return{onRequest({request:t}){tf(t.headers,e)}}}function tf(e,t){for(let n of e.keys())t.includes(n)||e.delete(n)}function nf(e){let t=e.get(`operationName`)||void 0,n=e.get(`query`)||void 0,r=e.get(`variables`)||void 0,i=e.get(`extensions`)||void 0;return{operationName:t,query:n,variables:r?JSON.parse(r):void 0,extensions:i?JSON.parse(i):void 0}}function rf(e){return nf(new Pd.URLSearchParams(e))}function af(e,t){let n=e.headers.get(`content-type`);return n=n?.split(`,`)[0]||null,n===t||!!n?.startsWith(`${t};`)}function of(e){return e.method===`GET`}function sf(e){let t=e.url.substring(e.url.indexOf(`?`)+1);return nf(new Pd.URLSearchParams(t))}function cf(e){return e.method===`POST`&&af(e,`application/x-www-form-urlencoded`)}function lf(e){return e.text().then(rf)}function uf(e){return e.method===`POST`&&af(e,`application/graphql`)}function df(e){return e.text().then(e=>({query:e}))}function ff(e){return e.method===`POST`&&(af(e,`application/json`)||af(e,`application/graphql+json`))}function pf(e){return y(()=>e.json(),e=>{if(e==null)throw Z(`POST body is expected to be object but received ${e}`,{extensions:{http:{status:400},code:`BAD_REQUEST`}});let t=typeof e;if(t!==`object`)throw Z(`POST body is expected to be object but received ${t}`,{extensions:{http:{status:400},code:`BAD_REQUEST`}});return e},e=>{if(e instanceof C)throw e;let t={http:{spec:!0,status:400},code:`BAD_REQUEST`};throw e instanceof Error&&(t.originalError={name:e.name,message:e.message}),Z(`POST body sent invalid JSON.`,{extensions:t})})}function mf(e){return e.method===`POST`&&af(e,`multipart/form-data`)}function hf(e){return y(()=>e.formData(),e=>{let t=e.get(`operations`);if(!t)throw Z(`Missing multipart form field "operations"`);if(typeof t!=`string`)throw Z(`Multipart form field "operations" must be a string`);let n;try{n=JSON.parse(t)}catch{throw Z(`Multipart form field "operations" must be a valid JSON string`)}let r=e.get(`map`);if(r!=null){if(typeof r!=`string`)throw Z(`Multipart form field "map" must be a string`);let t;try{t=JSON.parse(r)}catch{throw Z(`Multipart form field "map" must be a valid JSON string`)}for(let r in t){let i=e.get(r),a=t[r];for(let e of a)gf(n,e,i)}}return n},e=>{throw e instanceof Error&&e.message.startsWith(`File size limit exceeded: `)?Z(e.message,{extensions:{http:{status:413}}}):e})}function gf(e,t,n){let r=t.split(`.`),i=e;for(let e=0;e<r.length;e++){let t=r[e];if(t===`__proto__`||t===`constructor`||t===`prototype`)return;e===r.length-1?i[t]=n:(t in i||(i[t]={}),i=i[t])}}const _f=/* @__PURE__ */ new Set([`query`,`variables`,`operationName`,`extensions`]);function vf(e,t){if(typeof e!=`object`||!e)throw Z(`Invalid "params" in the request body`,{extensions:{http:{spec:!0,status:400},code:`BAD_REQUEST`}});for(let n in e)if(e[n]!=null&&!_f.has(n)){if(t?.includes(n))continue;throw Z(`Unexpected parameter "${n}" in the request body.`,{extensions:{http:{status:400},code:`BAD_REQUEST`}})}}function yf(e,t){if(!Sf(e))throw Z(`Expected params to be an object but given ${xf(e)}.`,{extensions:{http:{status:400,headers:{Allow:`GET, POST`}},code:`BAD_REQUEST`}});if(vf(e,t),e.query==null)throw Z(`Must provide query string.`,{extensions:{http:{spec:!0,status:400,headers:{Allow:`GET, POST`}},code:`BAD_REQUEST`}});let n=xf(e.query);if(n!==`string`)throw Z(`Expected "query" param to be a string, but given ${n}.`,{extensions:{http:{status:400,headers:{Allow:`GET, POST`}},code:`BAD_REQUEST`}});let r=xf(e.variables);if(![`object`,`null`,`undefined`].includes(r))throw Z(`Expected "variables" param to be empty or an object, but given ${r}.`,{extensions:{http:{status:400,headers:{Allow:`GET, POST`}},code:`BAD_REQUEST`}});let i=xf(e.extensions);if(![`object`,`null`,`undefined`].includes(i))throw Z(`Expected "extensions" param to be empty or an object, but given ${i}.`,{extensions:{http:{status:400,headers:{Allow:`GET, POST`}},code:`BAD_REQUEST`}});return e}function bf(e){return{onParams({params:t}){yf(t,e)}}}function xf(e){return e===null?`null`:Array.isArray(e)?`array`:typeof e}function Sf(e){return xf(e)===`object`}function Cf(e){return e===`GET`||e===`POST`}function wf(){return{onRequestParse({request:e}){if(!Cf(e.method))throw Z(`GraphQL only supports GET and POST requests.`,{extensions:{http:{status:405,headers:{Allow:`GET, POST`}},code:`BAD_REQUEST`}})}}}function Tf(){return{onValidate(){return({valid:e,result:t})=>{if(!e)for(let e of t)e.extensions||={},e.extensions.code||=`GRAPHQL_VALIDATION_FAILED`,e.extensions.http||={},e.extensions.http.spec=e.extensions.http.spec==null||e.extensions.http.spec,e.extensions.http.status||=400}}}}function Ef(e){return{onRequestParse(){return{onRequestParseDone({requestParserResult:t}){if(Array.isArray(t)){if(!e)throw Z(`Batching is not supported.`,{extensions:{http:{status:400},code:`BAD_REQUEST`}});if(t.length>e)throw Z(`Batching is limited to ${e} operations per request.`,{extensions:{http:{status:413},code:`BAD_REQUEST`}})}}}}}}function Df(e,t,n){let r=t?La(t,n)??void 0:void 0;if(!r)throw Z(`Could not determine what operation to execute.`,{extensions:{code:`OPERATION_RESOLUTION_FAILURE`,http:{status:400}}});if(r.operation===`mutation`&&e===`GET`)throw Z(`Can only perform a mutation operation from a POST request.`,{extensions:{http:{status:405,headers:{Allow:`POST`}},code:`BAD_REQUEST`}})}function Of(){return{onParse(){return({result:e,context:{request:t,params:{operationName:n}={}}})=>{if(t){if(e instanceof Error){if(e instanceof C){let t=e.extensions||={};t.code||=`GRAPHQL_PARSE_FAILED`;let n=t.http||={};n.spec||=!0,n.status||=400}}else Df(t.method,e,n)}}}}}function kf({id:e=Date.now().toString(),logger:t=console,endpoint:n=`/health`}={}){return{onRequest({endResponse:r,fetchAPI:i,request:a}){a.url.endsWith(n)&&(t.debug(`Responding Health Check`),r(new i.Response(null,{status:200,headers:{"x-yoga-id":e}})))}}}const Af=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,jf=/* @__PURE__ */ new Set,Mf=typeof process==`object`&&process?process:{},Nf=(e,t,n,r)=>{typeof Mf.emitWarning==`function`?Mf.emitWarning(e,t,n,r):console.error(`[${n}] ${t}: ${e}`)};let Pf=globalThis.AbortController,Ff=globalThis.AbortSignal;
131
+ /* c8 ignore start */
132
+ if(Pf===void 0){Ff=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},Pf=class{constructor(){t()}signal=new Ff;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e=Mf.env?.LRU_CACHE_IGNORE_AC_WARNING!==`1`,t=()=>{e&&(e=!1,Nf("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.",`NO_ABORT_CONTROLLER`,`ENOTSUP`,t))}}
133
+ /* c8 ignore stop */
134
+ const If=e=>!jf.has(e),Lf=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Rf=e=>Lf(e)?e<=256?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?zf:null:null;
135
+ /* c8 ignore stop */
136
+ var zf=class extends Array{constructor(e){super(e),this.fill(0)}},Bf=class e{heap;length;static#e=!1;static create(t){let n=Rf(t);if(!n)return[];e.#e=!0;let r=new e(t,n);return e.#e=!1,r}constructor(t,n){
137
+ /* c8 ignore start */
138
+ if(!e.#e)throw TypeError(`instantiate Stack using Stack.create(n)`);this.heap=new n(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Vf=class e{#e;#t;#n;#r;#i;#a;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;static unsafeExposeInternals(e){return{starts:e.#v,ttls:e.#y,sizes:e.#_,keyMap:e.#c,keyList:e.#l,valList:e.#u,next:e.#d,prev:e.#f,get head(){return e.#p},get tail(){return e.#m},free:e.#h,isBackgroundFetch:t=>e.#L(t),backgroundFetch:(t,n,r,i)=>e.#I(t,n,r,i),moveToTail:t=>e.#z(t),indexes:t=>e.#M(t),rindexes:t=>e.#N(t),isStale:t=>e.#D(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#s}get size(){return this.#o}get fetchMethod(){return this.#i}get memoMethod(){return this.#a}get dispose(){return this.#n}get disposeAfter(){return this.#r}constructor(t){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:p=0,maxEntrySize:m=0,sizeCalculation:h,fetchMethod:g,memoMethod:ee,noDeleteOnFetchRejection:te,noDeleteOnStaleGet:_,allowStaleOnFetchRejection:ne,allowStaleOnFetchAbort:re,ignoreFetchAbort:ie}=t;if(n!==0&&!Lf(n))throw TypeError(`max option must be a nonnegative integer`);let v=n?Rf(n):Array;if(!v)throw Error(`invalid max value: `+n);if(this.#e=n,this.#t=p,this.maxEntrySize=m||this.#t,this.sizeCalculation=h,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(ee!==void 0&&typeof ee!=`function`)throw TypeError(`memoMethod must be a function if defined`);if(this.#a=ee,g!==void 0&&typeof g!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.#i=g,this.#x=!!g,this.#c=/* @__PURE__ */ new Map,this.#l=Array(n).fill(void 0),this.#u=Array(n).fill(void 0),this.#d=new v(n),this.#f=new v(n),this.#p=0,this.#m=0,this.#h=Bf.create(n),this.#o=0,this.#s=0,typeof l==`function`&&(this.#n=l),typeof u==`function`?(this.#r=u,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#b=!!this.#n,this.#S=!!this.#r,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!te,this.allowStaleOnFetchRejection=!!ne,this.allowStaleOnFetchAbort=!!re,this.ignoreFetchAbort=!!ie,this.maxEntrySize!==0){if(this.#t!==0&&!Lf(this.#t))throw TypeError(`maxSize must be a positive integer if specified`);if(!Lf(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.#O()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!_,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=Lf(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=r||0,this.ttl){if(!Lf(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.#C()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t=`LRU_CACHE_UNBOUNDED`;If(t)&&(jf.add(t),Nf(`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`,`UnboundedCacheWarning`,t,e))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#C(){let e=new zf(this.#e),t=new zf(this.#e);this.#y=e,this.#v=t,this.#E=(n,r,i=Af.now())=>{if(t[n]=r===0?0:i,e[n]=r,r!==0&&this.ttlAutopurge){let e=setTimeout(()=>{this.#D(n)&&this.#B(this.#l[n],`expire`)},r+1);
139
+ /* c8 ignore start */
140
+ e.unref&&e.unref()}},this.#w=n=>{t[n]=e[n]===0?0:Af.now()},this.#T=(i,a)=>{if(e[a]){let o=e[a],s=t[a];
141
+ /* c8 ignore next */
142
+ if(!o||!s)return;i.ttl=o,i.start=s,i.now=n||r(),i.remainingTTL=o-(i.now-s)}};let n=0,r=()=>{let e=Af.now();if(this.ttlResolution>0){n=e;let t=setTimeout(()=>n=0,this.ttlResolution);
143
+ /* c8 ignore start */
144
+ t.unref&&t.unref()}return e};this.getRemainingTTL=i=>{let a=this.#c.get(i);if(a===void 0)return 0;let o=e[a],s=t[a];return!o||!s?1/0:o-((n||r())-s)},this.#D=i=>{let a=t[i],o=e[i];return!!o&&!!a&&(n||r())-a>o}}#w=()=>{};#T=()=>{};#E=()=>{};
145
+ /* c8 ignore stop */
146
+ #D=()=>!1;#O(){let e=new zf(this.#e);this.#s=0,this.#_=e,this.#k=t=>{this.#s-=e[t],e[t]=0},this.#j=(e,t,n,r)=>{if(this.#L(t))return 0;if(!Lf(n)){if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!Lf(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`)}return n},this.#A=(t,n,r)=>{if(e[t]=n,this.#t){let n=this.#t-e[t];for(;this.#s>n;)this.#F(!0)}this.#s+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#s)}}#k=e=>{};#A=(e,t,n)=>{};#j=(e,t,n,r)=>{if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`);return 0};*#M({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#m;!(!this.#P(t)||((e||!this.#D(t))&&(yield t),t===this.#p));)t=this.#f[t]}*#N({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#p;!(!this.#P(t)||((e||!this.#D(t))&&(yield t),t===this.#m));)t=this.#d[t]}#P(e){return e!==void 0&&this.#c.get(this.#l[e])===e}*entries(){for(let e of this.#M())this.#u[e]!==void 0&&this.#l[e]!==void 0&&!this.#L(this.#u[e])&&(yield[this.#l[e],this.#u[e]])}*rentries(){for(let e of this.#N())this.#u[e]!==void 0&&this.#l[e]!==void 0&&!this.#L(this.#u[e])&&(yield[this.#l[e],this.#u[e]])}*keys(){for(let e of this.#M()){let t=this.#l[e];t!==void 0&&!this.#L(this.#u[e])&&(yield t)}}*rkeys(){for(let e of this.#N()){let t=this.#l[e];t!==void 0&&!this.#L(this.#u[e])&&(yield t)}}*values(){for(let e of this.#M())this.#u[e]!==void 0&&!this.#L(this.#u[e])&&(yield this.#u[e])}*rvalues(){for(let e of this.#N())this.#u[e]!==void 0&&!this.#L(this.#u[e])&&(yield this.#u[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]=`LRUCache`;find(e,t={}){for(let n of this.#M()){let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;if(i!==void 0&&e(i,this.#l[n],this))return this.get(this.#l[n],t)}}forEach(e,t=this){for(let n of this.#M()){let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#l[n],this)}}rforEach(e,t=this){for(let n of this.#N()){let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#l[n],this)}}purgeStale(){let e=!1;for(let t of this.#N({allowStale:!0}))this.#D(t)&&(this.#B(this.#l[t],`expire`),e=!0);return e}info(e){let t=this.#c.get(e);if(t===void 0)return;let n=this.#u[t],r=this.#L(n)?n.__staleWhileFetching:n;if(r===void 0)return;let i={value:r};if(this.#y&&this.#v){let e=this.#y[t],n=this.#v[t];e&&n&&(i.ttl=e-(Af.now()-n),i.start=Date.now())}return this.#_&&(i.size=this.#_[t]),i}dump(){let e=[];for(let t of this.#M({allowStale:!0})){let n=this.#l[t],r=this.#u[t],i=this.#L(r)?r.__staleWhileFetching:r;if(i===void 0||n===void 0)continue;let a={value:i};if(this.#y&&this.#v){a.ttl=this.#y[t];let e=Af.now()-this.#v[t];a.start=Math.floor(Date.now()-e)}this.#_&&(a.size=this.#_[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=Af.now()-e}this.set(t,n.value,n)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:i,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:s}=n,{noUpdateTTL:c=this.noUpdateTTL}=n,l=this.#j(e,t,n.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize)return s&&(s.set=`miss`,s.maxEntrySizeExceeded=!0),this.#B(e,`set`),this;let u=this.#o===0?void 0:this.#c.get(e);if(u===void 0)u=this.#o===0?this.#m:this.#h.length===0?this.#o===this.#e?this.#F(!1):this.#o:this.#h.pop(),this.#l[u]=e,this.#u[u]=t,this.#c.set(e,u),this.#d[this.#m]=u,this.#f[u]=this.#m,this.#m=u,this.#o++,this.#A(u,l,s),s&&(s.set=`add`),c=!1;else{this.#z(u);let n=this.#u[u];if(t!==n){if(this.#x&&this.#L(n)){n.__abortController.abort(/* @__PURE__ */ Error(`replaced`));let{__staleWhileFetching:t}=n;t!==void 0&&!a&&(this.#b&&this.#n?.(t,e,`set`),this.#S&&this.#g?.push([t,e,`set`]))}else a||(this.#b&&this.#n?.(n,e,`set`),this.#S&&this.#g?.push([n,e,`set`]));if(this.#k(u),this.#A(u,l,s),this.#u[u]=t,s){s.set=`replace`;let e=n&&this.#L(n)?n.__staleWhileFetching:n;e!==void 0&&(s.oldValue=e)}}else s&&(s.set=`update`)}if(r!==0&&!this.#y&&this.#C(),this.#y&&(c||this.#E(u,r,i),s&&this.#T(s,u)),!a&&this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}return this}pop(){try{for(;this.#o;){let e=this.#u[this.#p];if(this.#F(!0),this.#L(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}}}#F(e){let t=this.#p,n=this.#l[t],r=this.#u[t];return this.#x&&this.#L(r)?r.__abortController.abort(/* @__PURE__ */ Error(`evicted`)):(this.#b||this.#S)&&(this.#b&&this.#n?.(r,n,`evict`),this.#S&&this.#g?.push([r,n,`evict`])),this.#k(t),e&&(this.#l[t]=void 0,this.#u[t]=void 0,this.#h.push(t)),this.#o===1?(this.#p=this.#m=0,this.#h.length=0):this.#p=this.#d[t],this.#c.delete(n),this.#o--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,i=this.#c.get(e);if(i!==void 0){let e=this.#u[i];if(this.#L(e)&&e.__staleWhileFetching===void 0)return!1;if(this.#D(i))r&&(r.has=`stale`,this.#T(r,i));else return n&&this.#w(i),r&&(r.has=`hit`,this.#T(r,i)),!0}else r&&(r.has=`miss`);return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,r=this.#c.get(e);if(r===void 0||!n&&this.#D(r))return;let i=this.#u[r];return this.#L(i)?i.__staleWhileFetching:i}#I(e,t,n,r){let i=t===void 0?void 0:this.#u[t];if(this.#L(i))return i;let a=new Pf,{signal:o}=n;o?.addEventListener(`abort`,()=>a.abort(o.reason),{signal:a.signal});let s={signal:a.signal,options:n,context:r},c=(r,i=!1)=>{let{aborted:o}=a.signal,c=n.ignoreFetchAbort&&r!==void 0;if(n.status&&(o&&!i?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),o&&!c&&!i)return u(a.signal.reason);let l=f;return this.#u[t]===f&&(r===void 0?l.__staleWhileFetching?this.#u[t]=l.__staleWhileFetching:this.#B(e,`fetch`):(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,s.options))),r},l=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),u(e)),u=r=>{let{aborted:i}=a.signal,o=i&&n.allowStaleOnFetchAbort,s=o||n.allowStaleOnFetchRejection,c=s||n.noDeleteOnFetchRejection,l=f;if(this.#u[t]===f&&(!c||l.__staleWhileFetching===void 0?this.#B(e,`fetch`):o||(this.#u[t]=l.__staleWhileFetching)),s)return n.status&&l.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),l.__staleWhileFetching;if(l.__returned===l)throw r},d=(t,r)=>{let o=this.#i?.(e,i,s);o&&o instanceof Promise&&o.then(e=>t(e===void 0?void 0:e),r),a.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>c(e,!0)))})};n.status&&(n.status.fetchDispatched=!0);let f=new Promise(d).then(c,l),p=Object.assign(f,{__abortController:a,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.set(e,p,{...s.options,status:void 0}),t=this.#c.get(e)):this.#u[t]=p,p}#L(e){if(!this.#x)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty(`__staleWhileFetching`)&&t.__abortController instanceof Pf}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:h=!1,status:g,signal:ee}=t;if(!this.#x)return g&&(g.fetch=`get`),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:g});let te={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:a,noDisposeOnSet:o,size:s,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:ee},_=this.#c.get(e);if(_===void 0){g&&(g.fetch=`miss`);let t=this.#I(e,_,te,m);return t.__returned=t}{let t=this.#u[_];if(this.#L(t)){let e=n&&t.__staleWhileFetching!==void 0;return g&&(g.fetch=`inflight`,e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#D(_);if(!h&&!i)return g&&(g.fetch=`hit`),this.#z(_),r&&this.#w(_),g&&this.#T(g,_),t;let a=this.#I(e,_,te,m),o=a.__staleWhileFetching!==void 0&&n;return g&&(g.fetch=i?`stale`:`refresh`,o&&i&&(g.returnedStale=!0)),o?a.__staleWhileFetching:a.__returned=a}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw Error(`fetch() returned undefined`);return n}memo(e,t={}){let n=this.#a;if(!n)throw Error(`no memoMethod provided to constructor`);let{context:r,forceRefresh:i,...a}=t,o=this.get(e,a);if(!i&&o!==void 0)return o;let s=n(e,o,{options:a,context:r});return this.set(e,s,a),s}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:a}=t,o=this.#c.get(e);if(o!==void 0){let t=this.#u[o],s=this.#L(t);return a&&this.#T(a,o),this.#D(o)?(a&&(a.get=`stale`),s?(a&&n&&t.__staleWhileFetching!==void 0&&(a.returnedStale=!0),n?t.__staleWhileFetching:void 0):(i||this.#B(e,`expire`),a&&n&&(a.returnedStale=!0),n?t:void 0)):(a&&(a.get=`hit`),s?t.__staleWhileFetching:(this.#z(o),r&&this.#w(o),t))}a&&(a.get=`miss`)}#R(e,t){this.#f[t]=e,this.#d[e]=t}#z(e){e!==this.#m&&(e===this.#p?this.#p=this.#d[e]:this.#R(this.#f[e],this.#d[e]),this.#R(this.#m,e),this.#m=e)}delete(e){return this.#B(e,`delete`)}#B(e,t){let n=!1;if(this.#o!==0){let r=this.#c.get(e);if(r!==void 0){if(n=!0,this.#o===1)this.#V(t);else{this.#k(r);let n=this.#u[r];if(this.#L(n)?n.__abortController.abort(/* @__PURE__ */ Error(`deleted`)):(this.#b||this.#S)&&(this.#b&&this.#n?.(n,e,t),this.#S&&this.#g?.push([n,e,t])),this.#c.delete(e),this.#l[r]=void 0,this.#u[r]=void 0,r===this.#m)this.#m=this.#f[r];else if(r===this.#p)this.#p=this.#d[r];else{let e=this.#f[r];this.#d[e]=this.#d[r];let t=this.#d[r];this.#f[t]=this.#f[r]}this.#o--,this.#h.push(r)}}}if(this.#S&&this.#g?.length){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}return n}clear(){return this.#V(`delete`)}#V(e){for(let t of this.#N({allowStale:!0})){let n=this.#u[t];if(this.#L(n))n.__abortController.abort(/* @__PURE__ */ Error(`deleted`));else{let r=this.#l[t];this.#b&&this.#n?.(n,r,e),this.#S&&this.#g?.push([n,r,e])}}if(this.#c.clear(),this.#u.fill(void 0),this.#l.fill(void 0),this.#y&&this.#v&&(this.#y.fill(0),this.#v.fill(0)),this.#_&&this.#_.fill(0),this.#p=0,this.#m=0,this.#h.length=0,this.#s=0,this.#o=0,this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}}};function Hf({max:e=1024,ttl:t=36e5}={}){return new Vf({max:e,ttl:t})}function Uf({documentCache:e=Hf(),errorCache:t=Hf(),validationCache:n=!0}){let r=Hf();return{onParse({params:n,setParsedDocument:r}){let i=n.source.toString(),a=e.get(i);if(a){r(a);return}let o=t.get(i);if(o)throw o;return({result:n})=>{n!=null&&(n instanceof Error?t.set(i,n):e.set(i,n))}},onValidate({params:{schema:e,documentAST:t,rules:i},setResult:a}){if(e!=null&&n!==!1){let n=i?.map(e=>e.name).join(`,`)||``,o=r.get(n);o||(o=/* @__PURE__ */ new WeakMap,r.set(n,o));let s=o.get(e);s||(s=/* @__PURE__ */ new WeakMap,o.set(e,s));let c=s.get(t);if(c){a(c);return}return({result:e})=>{e!=null&&s?.set(t,e)}}}}}const Wf=()=>!0;function Gf(e){let t=e.match||Wf;return{onRequestParse({request:n,setRequestParser:r}){t(n)&&r(e.parse)}}}function Kf(e){let t=(e.headers.get(`accept`)||`*/*`).replace(/\s/g,``).toLowerCase().split(`,`),n=[];for(let e of t){let[t,...r]=e.split(`;`);t!==void 0&&(r?.find(e=>e.includes(`charset=`))||`charset=utf-8`)===`charset=utf-8`&&n.push(t)}return n.reverse()}function qf(e,t){let[n,r]=e.split(`/`),[i,a]=t.split(`/`);return!(i!==`*`&&i!==n||a!==`*`&&a!==r)}function Jf(e){if(Array.isArray(e))return`[${e.map(e=>{let t=Yf(e);return(e.stringify||JSON.stringify)(t)}).join(`,`)}]`;let t=Yf(e);return(e.stringify||JSON.stringify)(t)}function Yf(e){if(e.errors?.length||e.extensions?.http){let t={...e};if(t.errors&&=t.errors.map(Xf),t.extensions){let{http:n,...r}=e.extensions;t.extensions=Object.keys(r).length?r:void 0}return t}return e}function Xf(e){if(qd(e)){let{http:t,unexpected:n,...r}=(`toJSON`in e&&typeof e.toJSON==`function`?e.toJSON():Object(e)).extensions||{};return Z(e.message,{nodes:e.nodes,source:e.source,positions:e.positions,path:e.path,originalError:Xf(e.originalError||void 0),extensions:Object.keys(r).length?r:void 0,coordinate:Ud(e)})}return e}function Zf(e,t){let n=Zd(e,{Connection:`keep-alive`,"Content-Type":`multipart/mixed; boundary="-"`,"Transfer-Encoding":`chunked`}),r,i=new t.TextEncoder,a=new t.ReadableStream({start(t){if(rl(e))r=e[Symbol.asyncIterator]();else{let t=!1;r={next:()=>t?b({done:!0,value:null}):(t=!0,b({done:!1,value:e}))}}t.enqueue(i.encode(`\r
147
+ `)),t.enqueue(i.encode(`---`))},pull(e){return y(()=>r.next(),({done:t,value:n})=>{if(n!=null){e.enqueue(i.encode(`\r
148
+ `)),e.enqueue(i.encode(`Content-Type: application/json; charset=utf-8`)),e.enqueue(i.encode(`\r
149
+ `));let t=Jf(n),r=i.encode(t);e.enqueue(i.encode(`Content-Length: `+r.byteLength)),e.enqueue(i.encode(`\r
150
+ `)),e.enqueue(i.encode(`\r
151
+ `)),e.enqueue(r),e.enqueue(i.encode(`\r
152
+ `)),e.enqueue(i.encode(`---`))}t&&(e.enqueue(i.encode(`--\r
153
+ `)),e.close())},t=>{e.error(t)})},cancel(e){if(r.return)return y(()=>r.return?.(e),()=>{})}});return new t.Response(a,n)}function Qf(e,t,n){if(Wd(e))return new t.Response(null,{status:406,statusText:`Not Acceptable`,headers:{accept:`application/json; charset=utf-8, application/graphql-response+json; charset=utf-8`}});let r=Zd(e,{"Content-Type":n+`; charset=utf-8`},n===`application/json`&&!Array.isArray(e)&&Qd(e.errors)&&e.errors.some(e=>!e.extensions?.originalError||qd(e.extensions.originalError))),i=Jf(e);return new t.Response(i,r)}function $f(){return function(e,t){let n=Zd(e,{"Content-Type":`text/event-stream`,Connection:`keep-alive`,"Cache-Control":`no-cache`,"Content-Encoding":`none`},!0),r,i,a=new t.TextEncoder,o=new t.ReadableStream({start(t){if(t.enqueue(a.encode(`:
154
+
155
+ `)),i=setInterval(()=>{if(!t.desiredSize){clearInterval(i);return}t.enqueue(a.encode(`:
156
+
157
+ `))},12e3),rl(e))r=e[Symbol.asyncIterator]();else{let t=!1;r={next:()=>t?b({done:!0,value:null}):(t=!0,b({done:!1,value:e}))}}},pull(e){return y(()=>r.next(),t=>{if(t.value!=null){e.enqueue(a.encode(`event: next
158
+ `));let n=Jf(t.value);e.enqueue(a.encode(`data: ${n}\n\n`))}t.done&&(e.enqueue(a.encode(`event: complete
159
+ `)),e.enqueue(a.encode(`data:
160
+
161
+ `)),clearInterval(i),e.close())},t=>{e.error(t)})},cancel(e){if(clearInterval(i),r.return)return y(()=>r.return?.(e),()=>{})}});return new t.Response(o,n)}}const ep={mediaTypes:[`multipart/mixed`],asyncIterables:!0,processResult:Zf};function tp(){return{mediaTypes:[`text/event-stream`],asyncIterables:!0,processResult:$f()}}const np={mediaTypes:[`application/graphql-response+json`,`application/json`],asyncIterables:!1,processResult:Qf};function rp(){let e=/* @__PURE__ */ new WeakMap,t=tp(),n=[t,ep,np],r=[t,np];return{onSubscribe({args:{contextValue:t}}){t.request&&e.set(t.request,!0)},onResultProcess({request:t,result:i,acceptableMediaTypes:a,setResultProcessor:o}){let s=e.get(t)?r:n,c=Kf(t),l=rl(i);for(let e of s)for(let t of c)if(!l||e.asyncIterables)for(let n of e.mediaTypes)a.push(n),qf(n,t)&&o(e.processResult,n)}}}var ip=`<!doctype html><html lang=en><head><meta charset=utf-8><title>Welcome to GraphQL Yoga</title><link rel=icon href=https://raw.githubusercontent.com/graphql-hive/graphql-yoga/refs/heads/main/website/src/app/favicon.ico><style>body,html{padding:0;margin:0;height:100%;font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Fira Sans','Droid Sans','Helvetica Neue',sans-serif;color:#fff;background-color:#000}main>section.hero{display:flex;height:90vh;justify-content:center;align-items:center;flex-direction:column}.logo{display:flex;align-items:center}.buttons{margin-top:24px}h1{font-size:80px}h2{color:#888;max-width:50%;margin-top:0;text-align:center}a{color:#fff;text-decoration:none;margin-left:10px;margin-right:10px;font-weight:700;transition:color .3s ease;padding:4px;overflow:visible}a.graphiql:hover{color:rgba(255,0,255,.7)}a.docs:hover{color:rgba(28,200,238,.7)}a.tutorial:hover{color:rgba(125,85,245,.7)}svg{margin-right:24px}.not-what-your-looking-for{margin-top:5vh}.not-what-your-looking-for>*{margin-left:auto;margin-right:auto}.not-what-your-looking-for>p{text-align:center}.not-what-your-looking-for>h2{color:#464646}.not-what-your-looking-for>p{max-width:600px;line-height:1.3em}.not-what-your-looking-for>pre{max-width:300px}</style></head><body id=body><main><section class=hero><div class=logo><div><svg xmlns=http://www.w3.org/2000/svg viewBox="-0.41 0.445 472.812 499.811" height=150><defs><linearGradient id=paint0_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse gradientTransform="matrix(8.139854, 0, 0, 8.139854, -130.346407, -113.25101)"><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><linearGradient id=paint1_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse gradientTransform="matrix(8.139854, 0, 0, 8.139854, -130.346407, -113.25101)"><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><linearGradient id=paint2_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse gradientTransform="matrix(8.139854, 0, 0, 8.139854, -130.346407, -113.25101)"><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><linearGradient id=paint3_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><linearGradient id=paint4_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><linearGradient id=paint5_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><filter id=filter0_f_1677_11483 x=23 y=-25 width=100 height=100 filterUnits=userSpaceOnUse color-interpolation-filters=sRGB><feFlood flood-opacity=0 result=BackgroundImageFix /><feBlend mode=normal in=SourceGraphic in2=BackgroundImageFix result=shape /><feGaussianBlur stdDeviation=12 result=effect1_foregroundBlur_1677_11483 /></filter><filter id=filter1_f_1677_11483 x=-24 y=19 width=100 height=100 filterUnits=userSpaceOnUse color-interpolation-filters=sRGB><feFlood flood-opacity=0 result=BackgroundImageFix /><feBlend mode=normal in=SourceGraphic in2=BackgroundImageFix result=shape /><feGaussianBlur stdDeviation=12 result=effect1_foregroundBlur_1677_11483 /></filter><linearGradient id=paint6_linear_1677_11483 x1=30 y1=28 x2=66.1645 y2=44.4363 gradientUnits=userSpaceOnUse gradientTransform="matrix(8.139854, 0, 0, 8.139854, -130.346407, -113.25101)"><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><filter id=filter2_f_1677_11483 x=-12 y=-44 width=100 height=100 filterUnits=userSpaceOnUse color-interpolation-filters=sRGB><feFlood flood-opacity=0 result=BackgroundImageFix /><feBlend mode=normal in=SourceGraphic in2=BackgroundImageFix result=shape /><feGaussianBlur stdDeviation=12 result=effect1_foregroundBlur_1677_11483 /></filter><filter id=filter3_f_1677_11483 x=13 y=19 width=100 height=100 filterUnits=userSpaceOnUse color-interpolation-filters=sRGB><feFlood flood-opacity=0 result=BackgroundImageFix /><feBlend mode=normal in=SourceGraphic in2=BackgroundImageFix result=shape /><feGaussianBlur stdDeviation=12 result=effect1_foregroundBlur_1677_11483 /></filter></defs><mask id=mask0_1677_11483 style=mask-type:alpha maskUnits=userSpaceOnUse x=16 y=14 width=58 height=62><path d="M21 25.3501C21.7279 25.3501 22.4195 25.5056 23.0433 25.7853L42.1439 14.8C43.0439 14.3 44.1439 14 45.1439 14C46.2439 14 47.2439 14.3 48.1439 14.8L64.5439 24.3C63.3439 25.1 62.4439 26.3 61.8439 27.7L45.9438 18.5C45.6439 18.3 45.344 18.3 45.0441 18.3C44.7441 18.3 44.4439 18.4 44.1439 18.5L25.8225 29.0251C25.9382 29.4471 26 29.8914 26 30.3501C26 33.1115 23.7614 35.3501 21 35.3501C18.2386 35.3501 16 33.1115 16 30.3501C16 27.5887 18.2386 25.3501 21 25.3501Z" fill=url(#paint3_linear_1677_11483) /><path d="M67.2438 35.0329C65.3487 34.3219 64 32.4934 64 30.35C64 27.5886 66.2386 25.35 69 25.35C71.7614 25.35 74 27.5886 74 30.35C74 32.1825 73.0142 33.7848 71.5439 34.6554V55.2C71.5439 57.4 70.3439 59.4 68.5439 60.5L52.1439 69.9C52.1439 68.4 51.6438 66.9 50.7438 65.8L66.3439 56.8C66.9439 56.5 67.2438 55.9 67.2438 55.2V35.0329Z" fill=url(#paint4_linear_1677_11483) /><path d="M49.8439 69.1055C49.9458 69.5034 50 69.9204 50 70.3501C50 73.1115 47.7614 75.3501 45 75.3501C42.5102 75.3501 40.4454 73.5302 40.0633 71.1481L21.8439 60.6C19.9439 59.5 18.8439 57.5 18.8439 55.3V36.8C19.5439 37 20.3439 37.2 21.0439 37.2C21.7439 37.2 22.4439 37.1 23.0439 36.9V55.3C23.0439 56 23.4438 56.6 23.9438 56.9L41.3263 66.9583C42.2398 65.9694 43.5476 65.3501 45 65.3501C47.3291 65.3501 49.2862 66.9426 49.8419 69.0981L49.8436 69.0997L49.8439 69.1055Z" fill=url(#paint5_linear_1677_11483) /></mask><mask id=mask1_1677_11483 style=mask-type:alpha maskUnits=userSpaceOnUse x=30 y=28 width=30 height=30><path fill-rule=evenodd clip-rule=evenodd d="M49.3945 32.3945C49.3945 34.7088 47.5796 38.5469 45 38.5469C42.4271 38.5469 40.6055 34.7112 40.6055 32.3945C40.6055 29.9714 42.5769 28 45 28C47.4231 28 49.3945 29.9714 49.3945 32.3945ZM35.332 49.0433V48.2148C35.332 42.8117 37.8535 41.0004 39.8796 39.545L39.8801 39.5447C40.3928 39.1767 40.8604 38.8404 41.2488 38.4742C42.3293 39.6642 43.626 40.3047 45 40.3047C46.3752 40.3047 47.6725 39.6642 48.7529 38.4754C49.1408 38.841 49.6078 39.1773 50.1199 39.5447L50.1204 39.545C52.1465 41.0004 54.668 42.8117 54.668 48.2148V49.0433L53.8406 49.092C49.9848 49.3185 46.8646 46.9002 45 43.5777C43.1159 46.935 39.9847 49.318 36.1594 49.092L35.332 49.0433ZM58.1463 51.0747L58.1463 51.0746C57.0179 50.891 50.0128 49.7507 45.0007 55.693C40.0116 49.7553 33.1965 50.8592 31.9095 51.0677L31.9095 51.0677C31.7906 51.087 31.7189 51.0986 31.7002 51.0963C31.7005 51.0969 31.7011 51.1045 31.7023 51.1187C31.726 51.4003 31.9682 54.2745 34.0566 56.2422L30 58H60L55.8956 56.2422C57.8537 54.4764 58.1396 52.2685 58.2508 51.4092V51.4091C58.2697 51.2628 58.2836 51.1556 58.2998 51.0963C58.2881 51.0977 58.2356 51.0892 58.1463 51.0747ZM40.4836 50.104C42.3956 49.3212 43.6746 48.1737 45 46.61C46.332 48.1841 47.6159 49.3259 49.5164 50.104C49.5356 50.1425 49.5557 50.1805 49.5756 50.2182C49.5793 50.2253 49.583 50.2323 49.5867 50.2393C48.0911 50.8127 46.4264 51.825 45.0047 53.1444C43.5906 51.8221 41.9673 50.8196 40.4256 50.2153C40.4455 50.1784 40.4648 50.1415 40.4836 50.104Z" fill=black /></mask><path d="M 40.59 93.095 C 46.517 93.095 52.14 94.365 57.22 96.635 L 212.7 7.22 C 220.025 3.149 228.978 0.706 237.12 0.706 C 246.073 0.706 254.213 3.149 261.54 7.22 L 395.032 84.547 C 385.264 91.059 377.939 100.827 373.055 112.224 L 243.631 37.338 C 241.19 35.71 238.747 35.71 236.305 35.71 C 233.863 35.71 231.42 36.523 228.978 37.338 L 79.84 123.009 C 80.786 126.443 81.29 130.058 81.29 133.793 C 81.29 156.269 63.065 174.493 40.59 174.493 C 18.116 174.493 -0.109 156.269 -0.109 133.793 C -0.109 111.32 18.116 93.095 40.59 93.095 Z" fill=url(#paint0_linear_1677_11483) /><path d="M 417.01 171.913 C 401.585 166.126 390.603 151.238 390.603 133.793 C 390.603 111.32 408.83 93.095 431.303 93.095 C 453.777 93.095 472.001 111.32 472.001 133.793 C 472.001 148.706 463.976 161.755 452.011 168.835 L 452.011 336.07 C 452.011 353.977 442.243 370.258 427.591 379.21 L 294.098 455.726 C 294.098 443.516 290.029 431.306 282.703 422.353 L 409.683 349.093 C 414.568 346.651 417.01 341.767 417.01 336.07 L 417.01 171.913 Z" fill=url(#paint1_linear_1677_11483) /><path d="M 275.376 449.253 C 276.206 452.495 276.646 455.889 276.646 459.389 C 276.646 481.863 258.422 500.087 235.947 500.087 C 215.679 500.087 198.87 485.272 195.761 465.883 L 47.46 380.025 C 31.995 371.071 23.041 354.792 23.041 336.884 L 23.041 186.296 C 28.738 187.923 35.25 189.553 40.948 189.553 C 46.646 189.553 52.345 188.738 57.228 187.111 L 57.228 336.884 C 57.228 342.582 60.485 347.465 64.554 349.908 L 206.042 431.777 C 213.481 423.728 224.127 418.689 235.947 418.689 C 254.905 418.689 270.833 431.656 275.36 449.196 L 275.376 449.214 L 275.376 449.253 Z" fill=url(#paint2_linear_1677_11483) /><g mask=url(#mask0_1677_11483) transform="matrix(8.139854, 0, 0, 8.139854, -130.346375, -113.251038)"><g filter=url(#filter0_f_1677_11483)><circle cx=73 cy=25 r=26 fill=#ED2E7E /></g><g filter=url(#filter1_f_1677_11483)><circle cx=26 cy=69 r=26 fill=#1CC8EE /></g></g><path fill-rule=evenodd clip-rule=evenodd d="M 271.713 150.431 C 271.713 169.275 256.948 200.517 235.947 200.517 C 215.003 200.517 200.172 169.292 200.172 150.431 C 200.172 130.708 216.225 114.666 235.947 114.666 C 255.67 114.666 271.713 130.708 271.713 150.431 Z M 157.251 285.952 L 157.251 279.212 C 157.251 235.233 177.771 220.485 194.27 208.641 C 198.447 205.644 202.247 202.901 205.414 199.923 C 214.204 209.608 224.763 214.826 235.947 214.826 C 247.138 214.826 257.697 209.608 266.496 199.931 C 269.653 202.911 273.456 205.644 277.622 208.641 C 294.114 220.485 314.642 235.233 314.642 279.212 L 314.642 285.952 L 307.912 286.351 C 276.525 288.191 251.128 268.509 235.947 241.468 C 220.611 268.795 195.126 288.191 163.981 286.351 L 157.251 285.952 Z M 342.953 302.492 C 333.771 300.994 276.751 291.715 235.955 340.082 C 195.345 291.749 139.865 300.734 129.389 302.436 C 128.428 302.59 127.841 302.688 127.687 302.665 C 127.687 302.673 127.695 302.729 127.702 302.85 C 127.897 305.138 129.867 328.532 146.872 344.55 L 113.849 358.862 L 358.044 358.862 L 324.639 344.55 C 340.576 330.177 342.905 312.202 343.807 305.212 C 343.962 304.022 344.077 303.153 344.206 302.665 C 344.108 302.68 343.686 302.606 342.953 302.492 Z M 199.188 294.59 C 214.751 288.215 225.161 278.879 235.947 266.15 C 246.788 278.96 257.241 288.255 272.707 294.59 C 272.869 294.898 273.031 295.207 273.196 295.518 C 273.219 295.574 273.252 295.631 273.285 295.688 C 261.107 300.361 247.555 308.598 235.989 319.334 C 224.477 308.573 211.258 300.417 198.715 295.493 C 198.87 295.191 199.033 294.891 199.188 294.59 Z" fill=url(#paint6_linear_1677_11483) /><g mask=url(#mask1_1677_11483) transform="matrix(8.139854, 0, 0, 8.139854, -130.346375, -113.251038)"><g filter=url(#filter2_f_1677_11483)><circle cx=38 cy=6 r=26 fill=#ED2E7E /></g><g filter=url(#filter3_f_1677_11483)><circle cx=63 cy=69 r=26 fill=#1CC8EE /></g></g></svg></div><h1>GraphQL Yoga</h1><p>Version: 5.21.2</p></div><h2>The batteries-included cross-platform GraphQL Server.</h2><div class=buttons><a href=https://www.the-guild.dev/graphql/yoga-server/docs class=docs>Read the Docs</a> <a href=https://www.the-guild.dev/graphql/yoga-server/tutorial/basic class=tutorial>Start the Tutorial </a><a href=__GRAPHIQL_LINK__ class=graphiql>Visit GraphiQL</a></div></section><section class=not-what-your-looking-for><h2>Not the page you are looking for? 👀</h2><p>This page is shown be default whenever a 404 is hit.<br>You can disable this by behavior via the <code>landingPage</code> option.</p><pre>
162
+ <code>
163
+ import { createYoga } from 'graphql-yoga';
164
+
165
+ const yoga = createYoga({
166
+ landingPage: false
167
+ })
168
+ </code>
169
+ </pre><p>If you expected this page to be the GraphQL route, you need to configure Yoga. Currently, the GraphQL route is configured to be on <code>__GRAPHIQL_LINK__</code>.</p><pre>
170
+ <code>
171
+ import { createYoga } from 'graphql-yoga';
172
+
173
+ const yoga = createYoga({
174
+ graphqlEndpoint: '__REQUEST_PATH__',
175
+ })
176
+ </code>
177
+ </pre></section></main></body></html>`;const ap=function(e){return new e.fetchAPI.Response(ip.replace(/__GRAPHIQL_LINK__/g,e.graphqlEndpoint).replace(/__REQUEST_PATH__/g,e.url.pathname),{status:200,statusText:`OK`,headers:{"Content-Type":`text/html`}})};function op(e){let t=e.landingPageRenderer||ap;return{onRequest({request:n,fetchAPI:r,endResponse:i,url:a}){let o=e.getGraphQLEndpoint();if(!n.url.endsWith(o)&&!n.url.endsWith(`${o}/`)&&a.pathname!==o&&a.pathname!==`${o}/`&&!e.getGraphQLEndpointURLPattern().test(a)){if(e.showLandingPage===!0&&n.method===`GET`&&n.headers?.get(`accept`)?.includes(`text/html`)){let s=t({request:n,fetchAPI:r,url:a,graphqlEndpoint:o,get urlPattern(){return e.getGraphQLEndpointURLPattern()}});if(v(s))return s.then(i);i(s);return}i(new r.Response(``,{status:404,statusText:`Not Found`}))}}}}function sp({request:e,result:t,fetchAPI:n,onResultProcessHooks:r,serverContext:i}){let a,o=[],s=`*/*`;return y(()=>x(r,n=>n({request:e,acceptableMediaTypes:o,result:t,setResult(e){t=e},resultProcessor:a,setResultProcessor(e,t){a=e,s=t},serverContext:i})),()=>a?a(t,n,s):new n.Response(null,{status:406,statusText:`Not Acceptable`,headers:{accept:o.join(`; charset=utf-8, `)}}))}function cp({params:e,enveloped:t}){let n=t.parse(e.query),r=t.validate(t.schema,n);return r.length>0?{errors:r}:y(()=>t.contextFactory(),r=>{let i={schema:t.schema,document:n,contextValue:r,variableValues:e.variables,operationName:e.operationName};return(La(n,e.operationName)?.operation===`subscription`?t.subscribe:t.execute)(i)})}function lp(e){return e?.status&&e?.headers}function up(e){return qd(e)?e.toJSON():e instanceof Error?{message:e.message,stack:e.stack,cause:e.cause}:e}const dp=(e,t,n=!1)=>{if(Jd(e))return e;let r={code:`INTERNAL_SERVER_ERROR`,unexpected:!0},i={extensions:r};return qd(e)?(i.nodes=e.nodes,i.source=e.source,i.positions=e.positions,i.path=e.path,i.coordinate=Ud(e),n&&e.originalError&&(r.originalError=up(e.originalError)),e.extensions?.http&&(r.http=e.extensions.http)):n&&(r.originalError=up(e)),Z(t,i)};var fp=class{getEnveloped;logger;fetchAPI;plugins;instrumentation;onRequestParseHooks;onParamsHooks;onExecutionResultHooks;onResultProcessHooks;maskedErrorsOpts;id;_graphqlEndpoint;_graphqlEndpointURLPattern;version=`5.21.2`;constructor(e){if(this.id=e?.id??`yoga`,this.fetchAPI={...Pd},e?.fetchAPI)for(let t in e.fetchAPI)e.fetchAPI[t]&&(this.fetchAPI[t]=e.fetchAPI[t]);let t=e?.logging==null||e.logging;this.logger=typeof t==`boolean`?t===!0?re():re(`silent`):typeof t==`string`?re(t):t;let n=typeof e?.maskedErrors==`object`&&e.maskedErrors.maskError||dp,r=/* @__PURE__ */ new WeakSet;this.maskedErrorsOpts=e?.maskedErrors===!1?null:{errorMessage:`Unexpected error.`,...typeof e?.maskedErrors==`object`?e.maskedErrors:{},maskError:(e,t)=>{if(r.has(e))return e;let i=n(e,t,this.maskedErrorsOpts?.isDev);return i!==e&&this.logger.error(e),r.add(i),i}};let i=this.maskedErrorsOpts==null?null:this.maskedErrorsOpts,a=0;e?.batching&&(a=typeof e.batching==`boolean`?10:e.batching.limit??10),this.graphqlEndpoint=e?.graphqlEndpoint||`/graphql`,this.plugins=[vl({parse:vt,validate:Aa,execute:Xu,subscribe:Xu,specifiedRules:wa}),!!e?.schema&&ye(e.schema),e?.allowedHeaders?.request!=null&&ef(e.allowedHeaders.request),e?.context!=null&&_l(t=>e?.context?typeof e.context==`function`?e.context(t):e.context:{}),kf({id:this.id,logger:this.logger,endpoint:e?.healthCheckEndpoint}),e?.cors!==!1&&Bd(e?.cors),e?.graphiql!==!1&&_e({getGraphQLEndpoint:()=>this._graphqlEndpoint,getGraphQLEndpointURLPattern:()=>this.getUrlPatternForGraphQLEndpoint(),options:e?.graphiql,render:e?.renderGraphiQL,logger:this.logger}),Gf({match:of,parse:sf}),Gf({match:ff,parse:pf}),e?.multipart!==!1&&Gf({match:mf,parse:hf}),Gf({match:uf,parse:df}),Gf({match:cf,parse:lf}),rp(),...e?.plugins??[],e?.parserAndValidationCache!==!1&&Uf(!e?.parserAndValidationCache||e?.parserAndValidationCache===!0?{}:e?.parserAndValidationCache),Ef(a),bf(e?.extraParamNames),op({getGraphQLEndpoint:()=>this.graphqlEndpoint,getGraphQLEndpointURLPattern:()=>this.getUrlPatternForGraphQLEndpoint(),showLandingPage:e?.landingPage!==!1,landingPageRenderer:typeof e?.landingPage==`function`?e.landingPage:void 0}),wf(),Of(),i!==null&&{onSubscribe(){return{onSubscribeError({error:e}){if(Yd(e))throw e}}}},i!==null&&gl(i),e?.allowedHeaders?.response!=null&&$d(e.allowedHeaders.response),Tf()],this.getEnveloped=ul({plugins:this.plugins}),this.plugins=this.getEnveloped._plugins,this.onRequestParseHooks=[],this.onParamsHooks=[],this.onExecutionResultHooks=[],this.onResultProcessHooks=[];for(let e of this.plugins)e&&(e.onYogaInit&&e.onYogaInit({yoga:this}),e.onRequestParse&&this.onRequestParseHooks.push(e.onRequestParse),e.onParams&&this.onParamsHooks.push(e.onParams),e.onExecutionResult&&this.onExecutionResultHooks.push(e.onExecutionResult),e.onResultProcess&&this.onResultProcessHooks.push(e.onResultProcess),e.instrumentation&&(this.instrumentation=this.instrumentation?Xc(this.instrumentation,e.instrumentation):e.instrumentation))}get graphqlEndpoint(){return this._graphqlEndpoint}set graphqlEndpoint(e){this._graphqlEndpoint=e,this._graphqlEndpointURLPattern=void 0}getUrlPatternForGraphQLEndpoint(){return this._graphqlEndpointURLPattern??=new this.fetchAPI.URLPattern({pathname:this._graphqlEndpoint}),this._graphqlEndpointURLPattern}handleParams=({request:e,context:t,params:n})=>{let r=t.request===e?{params:n}:{request:e,params:n};Object.assign(t,r);let i=this.getEnveloped(t);return this.logger.debug(`Processing GraphQL Parameters`),y(()=>y(()=>cp({params:n,enveloped:i}),e=>(this.logger.debug(`Processing GraphQL Parameters done.`),e),e=>({errors:Xd(e,this.maskedErrorsOpts,this.logger)})),e=>(rl(e)&&(e=ce(e,e=>e,e=>{if(e.name===`AbortError`)throw this.logger.debug(`Request aborted`),e;return{errors:Xd(e,this.maskedErrorsOpts,this.logger)}})),e))};getResultForParams=({params:e,request:t},n)=>{let r,i=this.handleParams;return y(()=>x(this.onParamsHooks,a=>a({params:e,request:t,setParams(t){e=t},paramsHandler:i,setParamsHandler(e){i=e},setResult(e){r=e},fetchAPI:this.fetchAPI,context:n})),()=>y(()=>r||i({request:t,params:e,context:n}),e=>y(()=>x(this.onExecutionResultHooks,r=>r({result:e,setResult(t){e=t},request:t,context:n})),()=>e)))};parseRequest=(e,t)=>{let n=new Proxy({},{get:(t,r,i)=>(n=new this.fetchAPI.URL(e.url,`http://localhost`),Reflect.get(n,r,n))}),r,i,a=[];return y(()=>x(this.onRequestParseHooks,(a,o)=>y(()=>a({request:e,url:n,requestParser:r,serverContext:t,setRequestParser(e){r=e},endResponse(e){i=e,o()},fetchAPI:this.fetchAPI}),e=>e?.onRequestParseDone),a),()=>i?{response:i}:(this.logger.debug(`Parsing request to extract GraphQL parameters`),r?y(()=>r(e),e=>{if(lp(e))return{response:e};let t=e;return y(()=>x(a,e=>e({requestParserResult:t,setRequestParserResult(e){t=e}})),()=>({requestParserResult:t}))}):{response:new this.fetchAPI.Response(null,{status:415,statusText:`Unsupported Media Type`})}))};handle=(e,t)=>{let n=this.instrumentation&&Zc({request:e}),r=this.instrumentation?.requestParse?n.asyncFn(this.instrumentation?.requestParse,this.parseRequest):this.parseRequest;return pe(b().then(()=>r(e,t)).then(({response:r,requestParserResult:i})=>{if(r)return r;let a=this.instrumentation?.operation?(e,t)=>Zc({context:t,request:e.request}).asyncFn(this.instrumentation?.operation,this.getResultForParams)(e,t):this.getResultForParams;return y(()=>Array.isArray(i)?Promise.all(i.map(n=>b().then(()=>a({params:n,request:e},Object.create(t))).catch(e=>({errors:Xd(e,this.maskedErrorsOpts,this.logger)})))):a({params:i,request:e},t),r=>(this.instrumentation?.resultProcess?n.asyncFn(this.instrumentation.resultProcess,sp):sp)({request:e,result:r,fetchAPI:this.fetchAPI,onResultProcessHooks:this.onResultProcessHooks,serverContext:t}))}).catch(n=>sp({request:e,result:{errors:Xd(n,this.maskedErrorsOpts,this.logger)},fetchAPI:this.fetchAPI,onResultProcessHooks:this.onResultProcessHooks,serverContext:t})))}};function pp(e){let t=new fp(e);return Ld(t,{fetchAPI:t.fetchAPI,plugins:t.plugins,disposeOnProcessTerminate:e.disposeOnProcessTerminate})}var mp=Object.defineProperty,Q=(e,t)=>{let n={};for(var r in e)mp(n,r,{get:e[r],enumerable:!0});return t||mp(n,Symbol.toStringTag,{value:`Module`}),n},hp=`__OSRA_KEY__`,gp=`__OSRA_DEFAULT_KEY__`,_p=`__OSRA_BOX__`,vp=()=>globalThis.browser??globalThis.chrome,yp=()=>vp()?.runtime,bp=(e,t)=>zp(e)&&e.__OSRA_KEY__===t,xp=(e,t)=>{if(e){if(e.aborted){t();return}e.addEventListener(`abort`,t,{once:!0})}},Sp=({listener:e,transport:t,remoteName:n,key:r=gp,origin:i=`*`,unregisterSignal:a})=>{if(a?.aborted)return;let o=rm(t)?t.receive:t;if(typeof o==`function`){let t=o((t,i)=>{a?.aborted||bp(t,r)&&(n&&t.name!==n||e(t,i))});typeof t==`function`&&xp(a,t);return}if(Up(o)||Wp(o)||Kp(o)||qp(o)){let t=(t,i)=>{let o=(t,a)=>{bp(t,r)&&(n&&t.name!==n||e(t,{port:i,sender:a}))};t.addListener(o),xp(a,()=>t.removeListener(o))};if(Up(o))t(o.onMessage);else if(Kp(o)){let e=e=>t(e.onMessage,e);o.addListener(e),xp(a,()=>o.removeListener(e))}else qp(o)?t(o):t(o.onMessage);return}let s=Lp(o)?o.port:o,c=i!==`*`&&Jp(o),l=t=>{let a=t.data;if(typeof a==`string`)try{a=JSON.parse(a)}catch{return}bp(a,r)&&(n&&a.name!==n||c&&t.origin&&t.origin!==i||e(a,{receiveTransport:o,source:t.source,origin:t.origin}))};s.addEventListener(`message`,l),s instanceof MessagePort&&s.start(),xp(a,()=>s.removeEventListener(`message`,l))},Cp=/* @__PURE__ */ new WeakSet,wp=e=>String(e?.message??e).includes(`disconnected port`),Tp=(e,t,n=`*`,r=[])=>{let i=rm(e)?e.emit:e;if(typeof i==`function`)i(t,r);else if(Jp(i))i.postMessage(t,n,r);else if(Wp(i)){if(Cp.has(i))return;try{i.postMessage(t)}catch(e){if(!wp(e))throw e;Cp.add(i)}}else if(Up(i))i.sendMessage(t)?.catch?.(e=>{if(!String(e?.message).includes(`Receiving end does not exist`))throw e});else if(Mp(i)){let e=JSON.stringify(t);i.readyState===WebSocket.CONNECTING?i.addEventListener(`open`,()=>i.send(e),{once:!0}):i.send(e)}else Lp(i)?i.port.postMessage(t,r):i.postMessage(t,r)},Ep=globalThis.Float16Array,Dp={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float16Array:Ep,Float32Array,Float64Array,BigInt64Array,BigUint64Array},Op=Object.values(Dp),kp=e=>{let t=e.constructor.name;if(t in Dp)return t;for(let[t,n]of Object.entries(Dp))if(n&&e instanceof n)return t;throw Error(`Unknown typed array type`)},Ap=e=>{let t=Dp[e];if(!t)throw Error(`Unknown typed array type`);return t},jp=e=>Op.some(t=>!!t&&e instanceof t),Mp=e=>e instanceof WebSocket,Np=e=>!!globalThis.ServiceWorkerContainer&&e instanceof ServiceWorkerContainer,Pp=e=>!!globalThis.ServiceWorker&&e instanceof ServiceWorker,Fp=e=>!!globalThis.Worker&&e instanceof Worker,Ip=e=>{let t=globalThis.DedicatedWorkerGlobalScope;return!!t&&e instanceof t},Lp=e=>!!globalThis.SharedWorker&&e instanceof SharedWorker,Rp=e=>e instanceof MessagePort,zp=e=>!!e&&typeof e==`object`&&`__OSRA_KEY__`in e&&!!e.__OSRA_KEY__,Bp=(e,t)=>{for(let n of t)if(n&&e instanceof n)return!0;return!1},Vp=e=>Bp(e,[globalThis.SharedArrayBuffer]),Hp=e=>Bp(e,[globalThis.ArrayBuffer,globalThis.MessagePort,globalThis.ReadableStream,globalThis.WritableStream,globalThis.TransformStream,globalThis.ImageBitmap,globalThis.OffscreenCanvas,globalThis.AudioData,globalThis.VideoFrame,globalThis.MediaSourceHandle,globalThis.MediaStreamTrack,globalThis.MIDIAccess,globalThis.RTCDataChannel,globalThis.WebTransportReceiveStream,globalThis.WebTransportSendStream]),Up=e=>{let t=yp();return t?e===t:!1},Wp=(e,t=!1)=>!e||typeof e!=`object`||Jp(e)||!(`name`in e)||!(`disconnect`in e)||!(`postMessage`in e)?!1:!t||`sender`in e&&`onMessage`in e&&`onDisconnect`in e,Gp=e=>!!e&&typeof e==`object`&&!Jp(e)&&`addListener`in e&&`hasListener`in e&&`removeListener`in e,Kp=e=>{let t=yp();return t?e===t.onConnect||e===t.onConnectExternal:!1},qp=e=>Gp(e),Jp=e=>{if(!e||typeof e!=`object`)return!1;try{return`window`in e&&e.window===e}catch{try{return`closed`in e&&typeof e.closed==`boolean`&&`close`in e&&typeof e.close==`function`}catch{return!1}}},Yp=e=>Mp(e)||Wp(e)||Up(e),Xp=e=>Mp(e)||Wp(e)||Kp(e)||qp(e)||Up(e),Zp=e=>!!e&&typeof e==`object`&&!Jp(e)&&`isJson`in e&&e.isJson===!0||Yp(e)||Xp(e),Qp=e=>Jp(e)||Yp(e)||Pp(e)||Fp(e)||Ip(e)||Lp(e)||Rp(e)||tm(e),$p=e=>Jp(e)||Xp(e)||Np(e)||Fp(e)||Ip(e)||Lp(e)||Rp(e)||nm(e),em=e=>{if(!e||typeof e!=`object`||Jp(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},tm=e=>!em(e)||!(`emit`in e)?!1:Qp(e.emit)||typeof e.emit==`function`,nm=e=>!em(e)||!(`receive`in e)?!1:$p(e.receive)||typeof e.receive==`function`,rm=e=>tm(e)||nm(e),$={[_p]:`revivable`},im=e=>!!e&&typeof e==`object`&&`__OSRA_BOX__`in e&&e.__OSRA_BOX__===`revivable`,am=(e,t)=>Zp(t.transport)?{base64Buffer:new Uint8Array(e).toBase64()}:{arrayBuffer:e},om=e=>`arrayBuffer`in e?e.arrayBuffer:Uint8Array.fromBase64(e.base64Buffer).buffer,sm=/* @__PURE__ */ Q({box:()=>um,isType:()=>lm,revive:()=>dm,type:()=>cm}),cm=`arrayBuffer`,lm=e=>e instanceof ArrayBuffer,um=(e,t)=>({...$,type:cm,...am(e,t)}),dm=(e,t)=>om(e),fm=/* @__PURE__ */ Q({box:()=>hm,isType:()=>mm,revive:()=>gm,type:()=>pm}),pm=`date`,mm=e=>e instanceof Date,hm=(e,t)=>({...$,type:pm,ISOString:e.toISOString()}),gm=(e,t)=>new Date(e.ISOString),_m=/* @__PURE__ */ Q({box:()=>bm,isType:()=>ym,revive:()=>xm,type:()=>vm}),vm=`headers`,ym=e=>e instanceof Headers,bm=(e,t)=>({...$,type:vm,entries:[...e.entries()]}),xm=(e,t)=>new Headers(e.entries),Sm=/* @__PURE__ */ Q({box:()=>Em,isType:()=>Tm,revive:()=>Dm,type:()=>Cm}),Cm=`error`,wm={Error,TypeError,RangeError,SyntaxError,ReferenceError,EvalError,URIError},Tm=e=>e instanceof Error,Em=(e,t)=>{let n=`cause`in e&&e.cause!==void 0,r=typeof AggregateError<`u`&&e instanceof AggregateError,i=typeof DOMException<`u`&&e instanceof DOMException;return{...$,type:Cm,name:e.name,message:e.message,stack:e.stack||e.toString(),...n?{cause:A_(e.cause,t)}:{},...r?{errors:A_(e.errors,t)}:{},...i?{isDOMException:!0}:{}}},Dm=(e,t)=>{let n=e.cause===void 0?void 0:j_(e.cause,t),r=n===void 0?void 0:{cause:n};if(e.isDOMException&&typeof DOMException<`u`){let t=new DOMException(e.message,e.name);if(e.stack)try{Object.defineProperty(t,"stack",{value:e.stack,configurable:!0})}catch{}return t}let i;if(e.errors!==void 0&&typeof AggregateError<`u`)i=AggregateError(j_(e.errors,t),e.message,r);else{let t=wm[e.name]??Error;i=r===void 0?new t(e.message):new t(e.message,r)}return e.name&&i.name!==e.name&&(i.name=e.name),e.stack&&(i.stack=e.stack),i},Om=/* @__PURE__ */ Q({box:()=>jm,isType:()=>Am,revive:()=>Mm,type:()=>km}),km=`typedArray`,Am=jp,jm=(e,t)=>{let n=e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return{...$,type:km,typedArrayType:kp(e),...am(n,t)}},Mm=(e,t)=>new(Ap(e.typedArrayType))(om(e)),Nm=/* @__PURE__ */ new WeakMap,Pm=/* @__PURE__ */ new WeakSet,Fm=(e,t)=>{if(Pm.has(e))return t(),()=>{};let n=Nm.get(e);return n||Nm.set(e,n=/* @__PURE__ */ new Set),n.add(t),()=>n.delete(t)},Im=e=>Pm.has(e),Lm=e=>{if(Pm.has(e))return;Pm.add(e);let t=Nm.get(e);if(t){Nm.delete(e);for(let e of t)try{e()}catch{}}},Rm=/* @__PURE__ */ Q({box:()=>Km,isType:()=>Gm,revive:()=>qm,transfer:()=>Wm,type:()=>zm}),zm=`transfer`,Bm=Symbol.for(`osra.transfer`),Vm=e=>typeof e==`object`&&!!e,Hm=e=>Vm(e)&&Bm in e&&e[Bm]===!0,Um=e=>Vm(e)?ArrayBuffer.isView(e)?!0:Bp(e,[globalThis.ArrayBuffer,globalThis.MessagePort,globalThis.ReadableStream,globalThis.WritableStream,globalThis.TransformStream,globalThis.ImageBitmap,globalThis.OffscreenCanvas,globalThis.VideoFrame,globalThis.AudioData]):!1,Wm=e=>Um(e)?{[Bm]:!0,value:e}:e,Gm=e=>Hm(e),Km=(e,t)=>({...$,type:zm,inner:A_(e.value,t),degraded:Zp(t.transport)}),qm=(e,t)=>j_(e.inner,t),Jm=e=>Bp(e,[globalThis.MessagePort,globalThis.ReadableStream,globalThis.WritableStream,globalThis.TransformStream,globalThis.OffscreenCanvas,globalThis.MediaSourceHandle,globalThis.MediaStreamTrack,globalThis.MIDIAccess,globalThis.RTCDataChannel,globalThis.WebTransportReceiveStream,globalThis.WebTransportSendStream]),Ym=e=>im(e)&&e.type===`transfer`,Xm=e=>{let t=[],n=/* @__PURE__ */ new WeakSet,r=(e,i)=>{if(e&&typeof e==`object`&&!n.has(e)&&(n.add(e),!Vp(e))){if(Ym(e)){r(e.inner,i||!e.degraded);return}if(Jm(e)){t.push(e);return}if(Hp(e)){i&&t.push(e);return}if(!ArrayBuffer.isView(e)){if(Array.isArray(e)){for(let t of e)r(t,i);return}for(let t of Object.values(e))r(t,i)}}};return r(e,!1),t},Zm=class{_listeners=/* @__PURE__ */ new Map;addEventListener(e,t,n){if(!t)return;let r=this._listeners.get(e);r||(r=/* @__PURE__ */ new Map,this._listeners.set(e,r)),r.has(t)||r.set(t,typeof n==`object`&&!!n?.once)}removeEventListener(e,t,n){t&&this._listeners.get(e)?.delete(t)}_peer;_queue=[];_started=!1;_closed=!1;_onClose;_onmessage=null;get onmessage(){return this._onmessage}set onmessage(e){this._onmessage=e,e!==null&&this.start()}onmessageerror=null;dispatchEvent(e){e.type===`message`?this._onmessage?.call(this,e):e.type===`messageerror`&&this.onmessageerror?.call(this,e);let t=this._listeners.get(e.type);if(t)for(let[n,r]of[...t])r&&t.delete(n),typeof n==`function`?n.call(this,e):n.handleEvent(e);return!0}postMessage(e,t){let n=this._peer;!n||n._closed||queueMicrotask(()=>{if(n._closed)return;let t=new MessageEvent(`message`,{data:e});n._started?n.dispatchEvent(t):n._queue.push(t)})}start(){if(!this._started){this._started=!0;for(let e of this._queue.splice(0))this.dispatchEvent(e)}}close(){if(this._closed)return;this._closed=!0,this._queue.length=0,this._onClose?.();let e=this._peer;e&&!e._closed&&queueMicrotask(()=>{e._closed||e.dispatchEvent(new Event(`close`))})}},Qm=class{port1;port2;constructor(){let e=new Zm,t=new Zm;e._peer=t,t._peer=e,this.port1=e,this.port2=t}},$m=new FinalizationRegistry(e=>{try{e()}catch{}}),eh=(e,t)=>{let n={};return $m.register(e,t,n),()=>$m.unregister(n)},th=/* @__PURE__ */ Q({box:()=>vh,createRevivableChannel:()=>xh,init:()=>ph,isType:()=>mh,revive:()=>yh,type:()=>nh}),nh=`messagePort`,rh=2048,ih=128,ah=1024,oh=/* @__PURE__ */ new WeakMap,sh=e=>{let t=oh.get(e);if(!t)throw Error(`osra message-port: connection state missing; did init() run?`);return t},ch=(e,t)=>{let n=e.ports.get(t);return n||(n={nextSeq:0,buffer:/* @__PURE__ */ new Map,outSeq:0},e.ports.set(t,n),e.pendingPorts++),n},lh=(e,t)=>{let n=e.ports.get(t);if(n&&!n.handler&&e.pendingPorts--,e.ports.delete(t),e.tombstones.size>=ih){let t=e.tombstones.values().next().value;t!==void 0&&e.tombstones.delete(t)}e.tombstones.add(t)},uh=e=>{if(e.handler)for(let t=e.buffer.get(e.nextSeq);t!==void 0;t=e.buffer.get(e.nextSeq))e.buffer.delete(e.nextSeq),e.nextSeq++,e.handler(t)},dh=(e,t)=>ch(sh(e),t).outSeq++,fh=(e,t,n)=>{let r=sh(e);if(r.tombstones.has(t)){setTimeout(()=>n({type:`message-port-close`,remoteUuid:e.remoteUuid,portId:t}));return}let i=ch(r,t);i.handler||r.pendingPorts--,i.handler=n,uh(i)},ph=e=>{let t={ports:/* @__PURE__ */ new Map,tombstones:/* @__PURE__ */ new Set,pendingPorts:0};oh.set(e,t),e.eventTarget.addEventListener(`message`,({detail:n})=>{if(n.type!==`message`&&n.type!==`message-port-close`||t.tombstones.has(n.portId))return;let r=t.ports.get(n.portId);if(n.seq===void 0){r?.handler?.(n);return}if(!r){if(t.pendingPorts>=ah)return;r=ch(t,n.portId)}if(!(n.seq<r.nextSeq)){if(r.buffer.size>=rh&&!(n.seq===r.nextSeq&&r.handler)){r.buffer.clear(),lh(t,n.portId),r.handler?.({type:`message-port-close`,remoteUuid:e.remoteUuid,portId:n.portId});return}r.buffer.set(n.seq,n),uh(r)}}),Fm(e,()=>{for(let[n,r]of[...t.ports])r.handler?.({type:`message-port-close`,remoteUuid:e.remoteUuid,portId:n});t.ports.clear(),t.tombstones.clear(),t.pendingPorts=0})},mh=e=>e instanceof MessagePort||e instanceof Zm,hh=(e,t)=>{try{let n=sh(e).ports.get(t);e.sendMessage({type:`message-port-close`,remoteUuid:e.remoteUuid,portId:t,seq:n?n.outSeq++:0})}catch{}},gh=(e,t,n)=>{n?e.postMessage(t):e.postMessage(t,Xm(t))},_h=(e,t,n)=>()=>{let r=e.deref();r&&hh(r,n);let i=t.deref();i&&lh(i,n)},vh=(e,t,n)=>{let r=e instanceof Zm;if(!r&&!Zp(t.transport))return{...$,type:nh,port:e,...n?.autoBox?{autoBox:!0}:{}};let i=sh(t),a=e,o=globalThis.crypto.randomUUID(),s=new WeakRef(a),c=new WeakRef(t),l=new WeakRef(i),u=!1,d=()=>{if(u)return;u=!0;let e=l.deref();e&&lh(e,o),m?.();let t=s.deref();t?.removeEventListener(`message`,p),t instanceof Zm&&(t._onClose=void 0)},f=e=>{if(e.type===`message-port-close`){d(),a.dispatchEvent(new Event(`close`)),a.close();return}gh(a,j_(e.data,t),!1)};function p({data:e}){t.sendMessage({type:`message`,remoteUuid:t.remoteUuid,data:A_(e,t),portId:o,seq:dh(t,o)})}let m=eh(a,_h(c,l,o));return a.addEventListener(`message`,p),a.start(),a instanceof Zm&&(a._onClose=()=>{u||(hh(t,o),d())}),fh(t,o,f),{...$,type:nh,portId:o,synthetic:r}},yh=(e,t)=>`port`in e?e.autoBox?bh(e.port,t):e.port:Sh(e.portId,t,e.synthetic),bh=(e,t)=>{let n=new EventTarget,r=({data:e})=>{n.dispatchEvent(new MessageEvent(`message`,{data:j_(e,t)}))},i=()=>{n.dispatchEvent(new Event(`close`))};return e.addEventListener(`message`,r),e.addEventListener(`close`,i),n.postMessage=(n,r)=>{let i=A_(n,t),a=Xm(i),o=Array.isArray(r)?r:[];e.postMessage(i,o.length?[...a,...o]:a)},n.start=()=>e.start(),n.close=()=>{e.removeEventListener(`message`,r),e.removeEventListener(`close`,i),e.close()},n},xh=e=>{if(Zp(e.transport)){let{port1:t,port2:n}=new Qm;return{localPort:t,boxedRemote:vh(n,e)}}let{port1:t,port2:n}=new MessageChannel;return{localPort:bh(t,e),boxedRemote:vh(n,e,{autoBox:!0})}},Sh=(e,t,n)=>{let r=sh(t),{port1:i,port2:a}=n?new Qm:new MessageChannel,o=new WeakRef(i),s=new WeakRef(a),c=!1,l=()=>{if(c)return;c=!0,lh(r,e);let t=s.deref();t?.removeEventListener(`message`,d),t?.close(),f?.()},u=e=>{if(e.type===`message-port-close`){l();let e=o.deref();e?.dispatchEvent(new Event(`close`)),e?.close();return}if(!o.deref()){l();return}let r=s.deref();r&&gh(r,j_(e.data,t),n)},d=({data:n})=>{t.sendMessage({type:`message`,remoteUuid:t.remoteUuid,data:A_(n,t),portId:e,seq:dh(t,e)})},f=eh(i,()=>{hh(t,e),l()});return i instanceof Zm&&(i._onClose=()=>{c||(hh(t,e),l())}),a.addEventListener(`message`,d),a.start(),fh(t,e,u),i},Ch=/* @__PURE__ */ Q({box:()=>Oh,isType:()=>Dh,revive:()=>kh,type:()=>wh}),wh=`promise`,Th=e=>e instanceof Promise,Eh=/* @__PURE__ */ new Set,Dh=e=>e instanceof Promise,Oh=(e,t)=>{if(!Th(e))throw TypeError(`Expected Promise`);let{localPort:n,boxedRemote:r}=xh(t),i=e=>{n.postMessage(e),n.close()};return e.then(e=>i({type:`resolve`,data:e})).catch(e=>i({type:`reject`,error:e})),{...$,type:wh,port:r}},kh=(e,t)=>{let n=yh(e.port,t);Eh.add(n);let r=`portId`in e.port;return new Promise((e,i)=>{let a,o=()=>{n.close(),Eh.delete(n),a?.()};if(r&&Im(t)){i(/* @__PURE__ */ Error(`osra: connection closed`)),o();return}a=r?Fm(t,()=>{i(/* @__PURE__ */ Error(`osra: connection closed`)),o()}):void 0,n.addEventListener(`message`,({data:t})=>{t.type===`resolve`?e(t.data):i(t.error),o()},{once:!0}),n.start()})},Ah=/* @__PURE__ */ Q({box:()=>Fh,isType:()=>Ph,revive:()=>Ih,type:()=>jh}),jh=`function`,Mh=/* @__PURE__ */ new Set,Nh=e=>{e instanceof ReadableStream?e.locked||e.cancel(/* @__PURE__ */ Error(`osra: connection closed`)).catch(()=>{}):typeof WritableStream<`u`&&e instanceof WritableStream&&(e.locked||e.abort(/* @__PURE__ */ Error(`osra: connection closed`)).catch(()=>{}))},Ph=e=>typeof e==`function`,Fh=(e,t)=>{let{port1:n,port2:r}=new Qm;return n.addEventListener(`message`,({data:n})=>{let[r,i]=n;(async()=>{let n;try{n={type:`return`,value:await e(...i)}}catch(e){n={type:`throw`,error:e}}if(Im(t)){n.type===`return`&&Nh(n.value);try{r.close()}catch{}return}let a=(()=>{try{return A_(n,t)}catch(e){return A_({type:`throw`,error:e},t)}})();r.postMessage(a,Xm(a)),queueMicrotask(()=>{try{r.close()}catch{}})})()}),n.start(),{...$,type:jh,port:vh(r,t)}},Ih=(e,t)=>{let n=yh(e.port,t);return((...e)=>new Promise((r,i)=>{if(Im(t)){i(/* @__PURE__ */ Error(`osra: connection closed`));return}let{port1:a,port2:o}=new Qm;Mh.add(a);let s,c=()=>{a.close(),Mh.delete(a),s?.()};s=Fm(t,()=>{i(/* @__PURE__ */ Error(`osra: connection closed`)),c()}),a.addEventListener(`message`,({data:e})=>{let t=e;t.type===`return`?r(t.value):i(t.error),c()},{once:!0}),a.start();let l=A_([o,e],t);n.postMessage(l,Xm(l))}))},Lh=/* @__PURE__ */ Q({MAX_CREDIT_WINDOW:()=>64,box:()=>Uh,isType:()=>zh,revive:()=>qh,type:()=>Rh}),Rh=`readableStream`,zh=e=>e instanceof ReadableStream,Bh=2,Vh=8,Hh=4194304,Uh=(e,t)=>{let{localPort:n,boxedRemote:r}=xh(t),i=e.getReader(),a=0,o=!1,s=!1,c=e=>{s=!0;try{n.postMessage(e)}catch{}n.close()},l=async()=>{if(!(o||s)){for(o=!0;a>0;){let e;try{e=await i.read()}catch(e){s||c({type:`error`,error:e});return}if(s)return;if(e.done){c({type:`end`});return}a--;try{n.postMessage({type:`chunk`,value:e.value})}catch(e){c({type:`error`,error:e}),i.cancel(e).catch(()=>{});return}}o=!1}};return n.addEventListener(`message`,({data:e})=>{e instanceof Promise||!(`type`in e)||(e.type===`pull`?n.postMessage(i.read()):e.type===`credit`?(a+=e.n,l()):e.type===`cancel`&&(s=!0,i.cancel(e.reason).catch(()=>{}),n.close()))}),n.addEventListener(`close`,()=>{s||(s=!0,i.cancel(/* @__PURE__ */ Error(`osra: connection closed`)).catch(()=>{}))},{once:!0}),n.start(),{...$,type:Rh,credit:!0,port:r}},Wh=e=>ArrayBuffer.isView(e)||e instanceof ArrayBuffer?e.byteLength:typeof e==`string`?e.length*2:typeof Blob<`u`&&e instanceof Blob?e.size:void 0,Gh=e=>{let t=!1,n=0,r,i=[],a=!1,o=!1,s,c,l=()=>r===void 0?Vh:Math.max(Bh,Math.min(64,Math.floor(Hh/r))),u=()=>{let t=l(),r=n+i.length;if(r>t/2)return;let a=t-r;n+=a,e.postMessage({type:`credit`,n:a})},d=()=>{t=!0,queueMicrotask(()=>e.close())},f=e=>{if(o=!0,s=e,!c||i.length)return;let t=c;c=void 0,d(),t.reject(e)};return new ReadableStream({start:()=>{e.addEventListener(`message`,({data:o})=>{if(!(o instanceof Promise||!(`type`in o))){if(o.type===`chunk`){if(t)return;if(n<=0){i.length=0,f(/* @__PURE__ */ Error(`osra: stream exceeded its credit window`)),queueMicrotask(()=>e.close());return}n--;let a=Wh(o.value);if(a!==void 0&&(r=r===void 0?a:r*.875+a*.125),c){let e=c;c=void 0,e.controller.enqueue(o.value),e.resolve()}else i.push(o.value)}else if(o.type===`end`){if(t||(a=!0,!c||i.length))return;let e=c;c=void 0,d(),e.controller.close(),e.resolve()}else if(o.type===`error`){if(t)return;f(o.error)}}}),e.addEventListener(`close`,()=>{t||a||o||f(/* @__PURE__ */ Error(`osra: connection closed`))},{once:!0})},pull:e=>{if(!t){if(i.length){e.enqueue(i.shift()),!a&&!o&&u();return}if(a){d(),e.close();return}return o?(d(),Promise.reject(s)):(u(),new Promise((t,n)=>{c={controller:e,resolve:t,reject:n}}))}},cancel:n=>{t=!0,i.length=0;let r=c;c=void 0,r?.resolve(),e.postMessage({type:`cancel`,reason:n}),queueMicrotask(()=>e.close())}})},Kh=e=>{let t=!1;return new ReadableStream({start:n=>{e.addEventListener(`close`,()=>{if(!t){t=!0;try{n.error(/* @__PURE__ */ Error(`osra: connection closed`))}catch{}}},{once:!0})},pull:n=>new Promise((r,i)=>{e.addEventListener(`message`,({data:a})=>{a instanceof Promise&&a.then(i=>{i.done?(t=!0,n.close(),e.postMessage({type:`cancel`}),queueMicrotask(()=>e.close())):n.enqueue(i.value),r()}).catch(e=>{t=!0,i(e)})},{once:!0}),e.postMessage({type:`pull`})}),cancel:n=>{t=!0,e.postMessage({type:`cancel`,reason:n}),queueMicrotask(()=>e.close())}})},qh=(e,t)=>{let n=yh(e.port,t);return n.start(),e.credit?Gh(n):Kh(n)},Jh=/* @__PURE__ */ Q({box:()=>Zh,isType:()=>Xh,revive:()=>Qh,type:()=>Yh}),Yh=`writableStream`,Xh=e=>e instanceof WritableStream,Zh=(e,t)=>{let{localPort:n,boxedRemote:r}=xh(t),i=e.getWriter(),a=!1,o=(e,t)=>e.then(()=>n.postMessage({type:`ack`})).catch(e=>n.postMessage({type:`err`,error:e?.message??String(e)})).then(()=>{t&&(a=!0,queueMicrotask(()=>n.close()))});return n.addEventListener(`message`,({data:e})=>{!e||typeof e!=`object`||!(`type`in e)||(e.type===`write`?o(i.write(e.chunk),!1):e.type===`close`?o(i.close(),!0):e.type===`abort`&&o(i.abort(e.reason),!0))}),n.addEventListener(`close`,()=>{a||(a=!0,i.abort(/* @__PURE__ */ Error(`osra: connection closed`)).catch(()=>{}))},{once:!0}),n.start(),{...$,type:Yh,port:r}},Qh=(e,t)=>{let n=yh(e.port,t);n.start();let r=/* @__PURE__ */ new Set,i=!1;n.addEventListener(`close`,()=>{i=!0;let e=/* @__PURE__ */ Error(`osra: connection closed`);for(let t of[...r])t(e);r.clear()},{once:!0});let a=Promise.resolve(),o=e=>{let t=a.then(()=>new Promise((t,a)=>{if(i){a(/* @__PURE__ */ Error(`osra: connection closed`));return}let o=e=>{r.delete(a),e()};r.add(a),n.addEventListener(`message`,({data:e})=>{!e||typeof e!=`object`||!(`type`in e)||(e.type===`ack`?o(t):e.type===`err`&&o(()=>a(Error(e.error))))},{once:!0}),n.postMessage(e)}));return a=t.catch(()=>{}),t};return new WritableStream({write:e=>o({type:`write`,chunk:e}),close:()=>o({type:`close`}),abort:e=>o({type:`abort`,reason:e})})},$h=/* @__PURE__ */ Q({box:()=>rg,isType:()=>tg,revive:()=>ig,type:()=>eg}),eg=`abortSignal`,tg=e=>e instanceof AbortSignal,ng=/* @__PURE__ */ new WeakMap,rg=(e,t)=>{if(e.aborted)return{...$,type:eg,aborted:!0,reason:A_(e.reason,t)};let{localPort:n,boxedRemote:r}=xh(t),i=()=>{n.postMessage({type:`abort`,reason:e.reason}),n.close(),a()},a=Fm(t,()=>{e.removeEventListener(`abort`,i),n.close()});return e.addEventListener(`abort`,i,{once:!0}),{...$,type:eg,aborted:!1,reason:void 0,port:r}},ig=(e,t)=>{let n=new AbortController;if(e.aborted||e.port===void 0)return n.abort(j_(e.reason,t)),n.signal;let r=yh(e.port,t);return ng.set(n.signal,r),r.start(),r.addEventListener(`message`,({data:e})=>{e.type===`abort`&&(n.abort(j_(e.reason,t)),ng.delete(n.signal),r.close())}),n.signal},ag=/* @__PURE__ */ Q({box:()=>cg,isType:()=>sg,revive:()=>lg,type:()=>og}),og=`response`,sg=e=>e instanceof Response,cg=(e,t)=>({...$,type:og,status:e.status,statusText:e.statusText,headers:bm(e.headers,t),body:e.body?Uh(e.body,t):null,url:e.url,redirected:e.redirected}),lg=(e,t)=>{if(e.status===0)return Response.error();let n=xm(e.headers,t),r=e.body?qh(e.body,t):null,i=e.status===101||e.status===204||e.status===205||e.status===304;r&&i&&r.cancel().catch(()=>{});let a=new Response(i?null:r,{status:e.status,statusText:e.statusText,headers:n});return e.url&&Object.defineProperty(a,"url",{value:e.url,configurable:!0}),e.redirected&&Object.defineProperty(a,"redirected",{value:!0,configurable:!0}),a},ug=/* @__PURE__ */ Q({box:()=>pg,isType:()=>fg,revive:()=>mg,type:()=>dg}),dg=`request`,fg=e=>e instanceof Request,pg=(e,t)=>({...$,type:dg,method:e.method,url:e.url,headers:bm(e.headers,t),body:e.body?Uh(e.body,t):null,credentials:e.credentials,cache:e.cache,mode:e.mode,redirect:e.redirect,referrer:e.referrer,referrerPolicy:e.referrerPolicy,integrity:e.integrity,keepalive:e.keepalive,signal:rg(e.signal,t)}),mg=(e,t)=>{let n=xm(e.headers,t),r={method:e.method,headers:n,credentials:e.credentials,cache:e.cache,redirect:e.redirect,referrer:e.referrer,referrerPolicy:e.referrerPolicy,integrity:e.integrity,keepalive:e.keepalive,signal:ig(e.signal,t)};return e.mode!==`navigate`&&(r.mode=e.mode),e.body&&(r.body=qh(e.body,t),r.duplex=`half`),new Request(e.url,r)},hg=/* @__PURE__ */ Q({box:()=>kg,boxByReference:()=>Ag,identity:()=>Cg,isType:()=>Dg,revive:()=>jg,type:()=>gg}),gg=`identity`,_g=Symbol.for(`osra.identity`),vg=e=>e!==null&&(typeof e==`object`||typeof e==`function`),yg=e=>{if(e===null)return!1;let t=typeof e;return t===`object`||t===`function`||t===`symbol`&&Symbol.keyFor(e)===void 0},bg=e=>vg(e)&&_g in e&&e[_g]===!0,xg=/* @__PURE__ */ new WeakMap,Sg=e=>{if(bg(e))return e;let t=xg.get(e);if(t)return t;let n={[_g]:!0,value:e};return xg.set(e,n),n},Cg=e=>vg(e)?Sg(e):e,wg=/* @__PURE__ */ new WeakMap,Tg=e=>{let t=wg.get(e);if(t)return t;let n=/* @__PURE__ */ new WeakMap,r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=/* @__PURE__ */ new WeakMap,o={sendIds:n,idToSent:r,sendRegistry:new FinalizationRegistry(t=>{r.delete(t);try{e.sendMessage({type:`identity-dispose`,remoteUuid:e.remoteUuid,id:t})}catch{}}),receiveCache:i,revivedToId:a,listenerInstalled:!1};return wg.set(e,o),Eg(e,o),Fm(e,()=>{o.receiveCache.clear(),o.idToSent.clear()}),o},Eg=(e,t)=>{t.listenerInstalled||(t.listenerInstalled=!0,e.eventTarget.addEventListener(`message`,({detail:e})=>{if(e?.type!==`identity-dispose`)return;let n=t.receiveCache.get(e.id);t.receiveCache.delete(e.id),n!==void 0&&yg(n)&&t.revivedToId.delete(n)}))},Dg=e=>bg(e),Og=(e,t)=>{let n=t.sendIds.get(e);if(n!==void 0)return{id:n,isExisting:!0};let r=t.revivedToId.get(e);if(r!==void 0)return{id:r,isExisting:!0};let i=globalThis.crypto.randomUUID();return t.sendIds.set(e,i),t.idToSent.set(i,new WeakRef(e)),t.sendRegistry.register(e,i),{id:i,isExisting:!1}},kg=(e,t)=>{let n=Tg(t),r=e.value,i=A_(r,t);if(!yg(r))return{...$,type:gg,id:globalThis.crypto.randomUUID(),inner:i};let{id:a,isExisting:o}=Og(r,n);return o?{...$,type:gg,id:a}:{...$,type:gg,id:a,inner:i}},Ag=(e,t,n)=>{let{id:r,isExisting:i}=Og(e,Tg(n));return i?{...$,type:gg,id:r}:{...$,type:gg,id:r,inner:t}},jg=(e,t)=>{let n=Tg(t),r=n.receiveCache.get(e.id);if(r!==void 0)return r;let i=n.idToSent.get(e.id)?.deref();if(i!==void 0)return i;if(!(`inner`in e)||e.inner===void 0)throw Error(`osra identity: received id=${e.id} with no inner payload and no cached value`);let a=j_(e.inner,t);return n.receiveCache.set(e.id,a),yg(a)&&n.revivedToId.set(a,e.id),a},Mg=/* @__PURE__ */ Q({box:()=>Pg,isType:()=>Ng,revive:()=>Fg,type:()=>`map`}),Ng=e=>e instanceof Map,Pg=(e,t)=>({...$,type:`map`,entries:Array.from(e,([e,n])=>[A_(e,t),A_(n,t)])}),Fg=(e,t)=>new Map(e.entries.map(([e,n])=>[j_(e,t),j_(n,t)])),Ig=/* @__PURE__ */ Q({box:()=>Rg,isType:()=>Lg,revive:()=>zg,type:()=>`set`}),Lg=e=>e instanceof Set,Rg=(e,t)=>({...$,type:`set`,values:Array.from(e,e=>A_(e,t))}),zg=(e,t)=>new Set(e.values.map(e=>j_(e,t))),Bg=/* @__PURE__ */ Q({box:()=>Ug,isType:()=>Hg,revive:()=>Wg,type:()=>Vg}),Vg=`bigint`,Hg=e=>typeof e==`bigint`,Ug=(e,t)=>({...$,type:Vg,value:e.toString()}),Wg=(e,t)=>BigInt(e.value),Gg=/* @__PURE__ */ Q({box:()=>Jg,isType:()=>qg,revive:()=>Yg,type:()=>Kg}),Kg=`event`,qg=e=>e instanceof Event,Jg=(e,t)=>({...$,type:Kg,eventType:e.type,bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed,...e instanceof CustomEvent?{detail:A_(e.detail,t)}:{}}),Yg=(e,t)=>{let n={bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed};return`detail`in e?new CustomEvent(e.eventType,{...n,detail:j_(e.detail,t)}):new Event(e.eventType,n)},Xg=/* @__PURE__ */ Q({box:()=>$g,isType:()=>Qg,revive:()=>r_,type:()=>Zg}),Zg=`eventTarget`,Qg=e=>e instanceof EventTarget,$g=(e,t)=>{let n=[],r=e=>typeof e==`boolean`?e:!!e?.capture;return{...$,type:Zg,addListener:Fh((t,i,a)=>{n.push({eventType:t,listener:i,capture:r(a)}),e.addEventListener(t,i,a)},t),removeListener:Fh((t,i,a)=>{let o=r(a),s=n.findIndex(e=>e.eventType===t&&e.listener===i&&e.capture===o);s!==-1&&n.splice(s,1),e.removeEventListener(t,i,a)},t),removeAllListeners:Fh(()=>{for(let{eventType:t,listener:r,capture:i}of n.splice(0))e.removeEventListener(t,r,{capture:i})},t)}},e_=/* @__PURE__ */ new WeakMap,t_=e=>{if(typeof e==`function`)return e;let t=e_.get(e);return t||e_.set(e,t=t=>e.handleEvent(t)),t},n_=(e,t,n,r)=>e.find(e=>e.eventType===t&&e.listener===n&&e.capture===r),r_=(e,t)=>{let n=Ih(e.addListener,t),r=Ih(e.removeListener,t),i=Ih(e.removeAllListeners,t),a=new EventTarget,o=[],s=e=>{let t=o.indexOf(e);t!==-1&&o.splice(t,1)};return Object.defineProperty(a,"addEventListener",{value:(e,t,r)=>{if(t===null)return;let i=t_(t),a=typeof r==`boolean`?r:!!r?.capture;if(n_(o,e,i,a))return;let c=typeof r==`object`&&r?.once?e=>(s(l),i(e)):i,l={eventType:e,listener:i,capture:a,wire:c};o.push(l),(typeof r==`object`?r?.signal:void 0)?.addEventListener(`abort`,()=>s(l),{once:!0}),n(e,Cg(c),r).catch(()=>{})}}),Object.defineProperty(a,"removeEventListener",{value:(e,t,n)=>{if(t===null)return;let i=t_(t),a=typeof n==`boolean`?n:!!n?.capture,c=n_(o,e,i,a);c&&(s(c),r(e,Cg(c.wire),{capture:a}).catch(()=>{}))}}),eh(a,()=>{i().catch(()=>{})}),a},i_=/* @__PURE__ */ Q({box:()=>s_,isType:()=>o_,revive:()=>c_,type:()=>a_}),a_=`symbol`,o_=e=>typeof e==`symbol`,s_=(e,t)=>{let n=Symbol.keyFor(e);return n===void 0?Ag(e,{...$,type:a_,description:e.description},t):{...$,type:a_,registryKey:n}},c_=(e,t)=>`registryKey`in e?Symbol.for(e.registryKey):Symbol(e.description),l_=/* @__PURE__ */ Q({box:()=>f_,isType:()=>d_,revive:()=>p_,type:()=>u_}),u_=`asyncIterator`,d_=e=>!e||typeof e!=`object`||typeof ReadableStream<`u`&&e instanceof ReadableStream?!1:typeof e[Symbol.asyncIterator]==`function`,f_=(e,t)=>{let n=e[Symbol.asyncIterator]();return{...$,type:u_,next:Fh((e=>n.next(e)),t),return:Fh((e=>n.return?.(e)??Promise.resolve({done:!0,value:e})),t),throw:Fh((e=>n.throw?.(e)??Promise.reject(e)),t)}},p_=(e,t)=>{let n=Ih(e.next,t),r=Ih(e.return,t),i=Ih(e.throw,t),a={next:(...e)=>n(...e),return:e=>r(e),throw:e=>i(e),[Symbol.asyncIterator]:()=>a};return a},m_=[globalThis.File,globalThis.FileList,globalThis.RegExp,globalThis.DataView,globalThis.ImageData,globalThis.FormData,globalThis.DOMException,globalThis.DOMMatrix,globalThis.DOMMatrixReadOnly,globalThis.DOMPoint,globalThis.DOMPointReadOnly,globalThis.DOMQuad,globalThis.DOMRect,globalThis.DOMRectReadOnly,globalThis.CryptoKey,globalThis.FileSystemHandle,globalThis.FileSystemFileHandle,globalThis.FileSystemDirectoryHandle,globalThis.RTCCertificate],h_=[globalThis.CropTarget,globalThis.EncodedAudioChunk,globalThis.EncodedVideoChunk,globalThis.FencedFrameConfig,globalThis.GPUCompilationInfo,globalThis.GPUCompilationMessage,globalThis.GPUPipelineError,globalThis.RTCEncodedAudioFrame,globalThis.RTCEncodedVideoFrame,globalThis.WebTransportError],g_={type:`clonable`,capableOnly:!0,isType:e=>Bp(e,m_)||Bp(e,h_),box:(e,t)=>e,revive:(e,t)=>e},__=[globalThis.ImageBitmap,globalThis.OffscreenCanvas,globalThis.WritableStream,globalThis.TransformStream,globalThis.MediaStreamTrack,globalThis.RTCDataChannel],v_=[globalThis.AudioData,globalThis.VideoFrame,globalThis.MediaSourceHandle,globalThis.MIDIAccess,globalThis.WebTransportReceiveStream,globalThis.WebTransportSendStream],y_={type:`transferable`,capableOnly:!0,isType:e=>Bp(e,__)||Bp(e,v_),box:(e,t)=>e,revive:(e,t)=>e},b_={type:`blob`,capableOnly:!0,isType:e=>typeof Blob<`u`&&e instanceof Blob,box:(e,t)=>{if(Zp(t.transport))throw TypeError(`osra: Blob is only supported on structured-clone transports, send an ArrayBuffer or Uint8Array instead`);return e},revive:(e,t)=>e},x_=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},S_=[Rm,hg,sm,fm,_m,Sm,Om,Ch,Ah,th,Lh,Jh,$h,ag,ug,Mg,Ig,Bg,i_,Gg,l_,{type:`nonFiniteNumber`,isType:e=>typeof e==`number`&&!Number.isFinite(e),box:(e,t)=>Zp(t.transport)?{...$,type:`nonFiniteNumber`,value:String(e)}:e,revive:(e,t)=>Number(e.value)},{type:`undefined`,isType:e=>e===void 0,box:(e,t)=>Zp(t.transport)?{...$,type:`undefined`}:e,revive:(e,t)=>void 0},g_,y_,b_,Xg,{type:`unclonable`,isType:e=>{if(typeof e!=`object`||!e||Array.isArray(e)||x_(e))return!1;try{return structuredClone(e),!1}catch{return!0}},box:(e,t)=>({...$,type:`unclonable`}),revive:(e,t)=>({})}],C_=(e,t)=>t.find(t=>t.isType(e)),w_=(e,t)=>t.find(t=>t.type===e.type),T_=e=>!!e&&typeof e==`object`&&Object.getPrototypeOf(e)===Object.prototype,E_=(e,t)=>Array.isArray(e)?e.map(e=>t(e)):T_(e)?Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n)])):e,D_=/* @__PURE__ */ new WeakSet,O_=/* @__PURE__ */ new WeakSet,k_=e=>e!==null&&(typeof e==`object`||typeof e==`function`),A_=(e,t)=>{if(im(e))return e;let n=k_(e);if(n){if(D_.has(e))throw TypeError(`osra: cannot serialize a circular structure - break the cycle or send the container by reference`);D_.add(e)}try{let n=C_(e,t.revivableModules);return n?n.box(e,t):E_(e,e=>A_(e,t))}finally{n&&D_.delete(e)}},j_=(e,t)=>{let n=k_(e);if(n){if(O_.has(e))throw TypeError(`osra: cannot revive a circular structure`);O_.add(e)}try{if(im(e)){let n=w_(e,t.revivableModules);if(n)return n.revive(e,t)}return E_(e,e=>j_(e,t))}finally{n&&O_.delete(e)}},M_=/* @__PURE__ */ Q({init:()=>F_,startBidirectionalConnection:()=>P_,type:()=>N_}),N_=`bidirectional`,P_=({transport:e,value:t,remoteUuid:n,eventTarget:r,send:i,revivableModules:a})=>{let o={transport:e,remoteUuid:n,sendMessage:i,eventTarget:r,revivableModules:a};for(let e of a)e.init?.(o);let{promise:s,resolve:c}=Promise.withResolvers();return r.addEventListener(`message`,function e({detail:t}){t.type===`init`&&(c(t.data),r.removeEventListener(`message`,e))}),i({type:`init`,remoteUuid:n,data:A_(t,o)}),{revivableContext:o,remoteValue:s.then(e=>j_(e,o))}},F_=e=>{if(!(Qp(e.transport)&&$p(e.transport)))return;if(e.protocolEventTarget.addEventListener(`message`,({detail:{message:t,peer:n}})=>{if(t.type===`announce`){if(!t.remoteUuid){e.sendMessage({type:`announce`,remoteUuid:t.uuid});return}if(t.remoteUuid!==e.getUuid()||e.connectionContexts.has(t.uuid))return;e.sendMessage({type:`announce`,remoteUuid:t.uuid});let r=e.createConnectionEventTarget(),i={...n(),abort:()=>e.abortConnection(t.uuid)},a;try{let n=e.valueFor(i);if(e.claimPendingAbort(t.uuid)){e.sendMessage({type:`close`,remoteUuid:t.uuid});return}a=P_({transport:e.transport,value:n,remoteUuid:t.uuid,eventTarget:r,send:t=>e.sendMessage(t),revivableModules:e.revivableModules})}catch(n){e.sendMessage({type:`close`,remoteUuid:t.uuid}),e.rejectRemoteValue(n);return}let o={type:`bidirectional`,eventTarget:r,connection:a};e.connectionContexts.set(t.uuid,o),o.connection.remoteValue.then(t=>e.addConnection(i,t),t=>e.rejectRemoteValue(t));return}if(t.type===`close`){if(t.remoteUuid!==e.getUuid())return;let n=e.connectionContexts.get(t.uuid);if(!n)return;e.connectionContexts.delete(t.uuid),Lm(n.connection.revivableContext),e.rejectRemoteValue(/* @__PURE__ */ Error(`osra: peer closed the connection`));return}if(t.remoteUuid!==e.getUuid())return;let r=e.connectionContexts.get(t.uuid);r&&r.eventTarget.dispatchEvent(new CustomEvent(`message`,{detail:t}))}),e.presetRemoteUuid!==void 0){let t=e.presetRemoteUuid,n=e.createConnectionEventTarget(),r,i;try{i={abort:()=>e.abortConnection(t)};let a=e.valueFor(i);if(e.claimPendingAbort(t)){e.sendMessage({type:`close`,remoteUuid:t});return}r=P_({transport:e.transport,value:a,remoteUuid:e.presetRemoteUuid,eventTarget:n,send:t=>e.sendMessage(t),revivableModules:e.revivableModules})}catch(n){e.sendMessage({type:`close`,remoteUuid:t}),e.rejectRemoteValue(n);return}let a={type:`bidirectional`,eventTarget:n,connection:r};e.connectionContexts.set(e.presetRemoteUuid,a),a.connection.remoteValue.then(t=>e.addConnection(i,t),t=>e.rejectRemoteValue(t));return}let t=50,n,r=()=>{if(!(e.unregisterSignal?.aborted||e.connectionContexts.size>0)){try{e.sendMessage({type:`announce`},`*`)}catch{}n=setTimeout(r,t),t=Math.min(t*2,1e3)}};e.unregisterSignal?.addEventListener(`abort`,()=>clearTimeout(n),{once:!0}),r()},I_=()=>new EventTarget,L_=e=>{let t=rm(e),n=t?e.emit:e,r=t?e.receive:e;return{isJson:t&&`isJson`in e&&e.isJson!==void 0?e.isJson:n!==void 0&&Zp(n)||r!==void 0&&Zp(r),...n===void 0?{}:{emit:n},...r===void 0?{}:{receive:r}}},R_=e=>e?e(S_):S_,z_=32,B_=()=>{let e=[],t=/* @__PURE__ */ new Set,n=!1,r=()=>({value:void 0,done:!0});return{push:r=>{if(!n){if(t.size===0){e.push(r),e.length>z_&&e.shift();return}for(let e of t){let t=e.wake;if(t){e.wake=void 0,t({value:r,done:!1});continue}e.buffered.push(r)}}},close:()=>{n=!0;for(let e of t){let t=e.wake;e.wake=void 0,t?.(r())}},iterate:()=>{let i={buffered:[...e]};t.add(i);let a=!1;return{[Symbol.asyncIterator](){return this},next:()=>{if(a)return Promise.resolve(r());let e=i.buffered.shift();return e?Promise.resolve({value:e,done:!1}):n?Promise.resolve(r()):new Promise(e=>{i.wake=e})},return:()=>{a=!0,t.delete(i);let e=i.wake;return i.wake=void 0,e?.(r()),Promise.resolve(r())}}}}},V_=(e,t,n)=>{let r=e.then(n);r.catch(()=>{});let i=()=>{let e=t.iterate();return{[Symbol.asyncIterator](){return this},next:()=>e.next().then(e=>e.done?{value:void 0,done:!0}:{value:n(e.value),done:!1}),return:()=>e.return?.()??Promise.resolve({value:void 0,done:!0})}};return Object.assign(r,{[Symbol.asyncIterator]:i})},H_=Symbol.for(`osra.context`),U_=e=>typeof e==`object`&&!!e&&H_ in e,W_=[M_],G_=(e,{transport:t,name:n,remoteName:r,key:i=gp,origin:a=`*`,unregisterSignal:o,revivableModules:s,uuid:c,remoteUuid:l,connection:u=({value:e})=>e})=>{let d=u,f=L_(t);if(!(Qp(f)&&$p(f))){let e=B_();e.close();let t=Promise.reject(/* @__PURE__ */ Error(`osra: transport must be able to both emit and receive to establish a connection; pass a bidirectional platform transport or a custom { emit, receive } pair`));return t.catch(()=>{}),V_(t,e,d)}let p=R_(s),m=/* @__PURE__ */ new Map,h=/* @__PURE__ */ new Set,g=B_(),{promise:ee,resolve:te,reject:_}=Promise.withResolvers();ee.catch(()=>{});let ne=c??globalThis.crypto.randomUUID(),re=(e,t=a)=>{let r={[hp]:i,name:n,uuid:ne,...e};Tp(f,r,t,Xm(r))},ie=(e,t)=>{o?.aborted||re(e,t)},v=I_(),ae={transport:f,valueFor:t=>U_(e)?e[H_](t):e,revivableModules:p,connectionContexts:m,getUuid:()=>ne,presetRemoteUuid:l,sendMessage:ie,protocolEventTarget:v,rejectRemoteValue:_,abortConnection:e=>{let t=m.get(e);if(!t){h.add(e);return}m.delete(e),re({type:`close`,remoteUuid:e}),Lm(t.connection.revivableContext),_(/* @__PURE__ */ Error(`osra: connection aborted`))},claimPendingAbort:e=>h.delete(e),addConnection:(e,t)=>{let n={value:t,context:e};te(n),g.push(n)},createConnectionEventTarget:I_,unregisterSignal:o};if(Sp({listener:(e,t)=>{e.uuid!==ne&&v.dispatchEvent(new CustomEvent(`message`,{detail:{message:e,peer:()=>({...t.origin?{origin:t.origin}:{},...t.source?{source:t.source}:{},...t.port?{port:t.port}:{},...t.sender?{sender:t.sender}:{}})}}))},transport:f,remoteName:r,key:i,origin:a,unregisterSignal:o}),o?.aborted)return _(o.reason),g.close(),V_(ee,g,d);o?.addEventListener(`abort`,()=>{for(let[e,t]of m)re({type:`close`,remoteUuid:e}),Lm(t.connection.revivableContext);m.clear(),g.close(),_(o.reason)},{once:!0});for(let e of W_)e.init(ae);return V_(ee,g,d)},K_=(e,t)=>G_(e,t),q_=`enum LikeStatus {
178
+ LIKE
179
+ DISLIKE
180
+ INDIFFERENT
181
+ }
182
+
183
+ enum NotificationLevel {
184
+ ALL
185
+ PERSONALIZED
186
+ NONE
187
+ }
188
+
189
+ # The three values the create endpoint accepts. \`Playlist.privacy\` on the READ
190
+ # side stays a String: it echoes whatever the playlist header carries, and a
191
+ # value outside this set must degrade to text rather than fail the whole query.
192
+ enum PlaylistPrivacy {
193
+ PUBLIC
194
+ UNLISTED
195
+ PRIVATE
196
+ }
197
+
198
+ type Channel {
199
+ id: ID!
200
+ name: String!
201
+ avatar: String
202
+ handle: String
203
+ subscriberCountText: String
204
+ videoCountText: String
205
+ banner: String
206
+ description: String
207
+ isSubscribed: Boolean
208
+ # True when the signed-in viewer owns this channel, read off its Studio header actions.
209
+ isOwnChannel: Boolean
210
+ notificationLevel: NotificationLevel
211
+ isVerified: Boolean
212
+ # An official artist channel, badged with a music note instead of the check.
213
+ isVerifiedArtist: Boolean
214
+ }
215
+
216
+ type Video {
217
+ id: ID!
218
+ title: String!
219
+ description: String
220
+ # The description as runs, so its links work. Set on a channel's featured
221
+ # video, whose description carries structured runs upstream.
222
+ descriptionRuns: [TextRun!]
223
+ descriptionSnippet: String
224
+ # A search row's excerpt as runs, the words that matched the query bold, as
225
+ # youtube.com prints them.
226
+ snippetRuns: [TextRun!]
227
+ thumbnail: String
228
+ # Every still upstream published for this video, already formatted as a
229
+ # srcset. The same Video renders at ~360px in a grid and ~168px in the watch
230
+ # sidebar, so no single URL is right for both: \`thumbnail\` stays the fallback
231
+ # for anything that cannot express a slot width, and this lets the browser
232
+ # pick per slot and per pixel ratio.
233
+ thumbnailSrcset: String
234
+ # A few seconds of the video as an animated image, which youtube.com plays
235
+ # over a related video's still on hover. Only lockups carry it.
236
+ animatedThumbnail: String
237
+ # The params youtube.com reads this card's hover preview with, off its
238
+ # inline-playback endpoint. Only the surfaces that preview in a player (search
239
+ # rows, Home) carry them; the rest play the moving thumbnail instead.
240
+ inlinePlayerParams: String
241
+ # The label youtube.com draws in the still's top corner, such as New. Read
242
+ # off a lockup's top-corner overlay, never inferred from the date.
243
+ thumbnailBadge: String
244
+ durationSeconds: Int
245
+ # A song: youtube.com draws a music note before its length. Read off the
246
+ # length badge's own icon, never the title.
247
+ isMusic: Boolean
248
+ viewCount: String
249
+ # youtube.com draws a play arrow before this row's view count. Read off the
250
+ # views part's own icon.
251
+ viewCountIcon: Boolean
252
+ publishedText: String
253
+ # What youtube.com draws between this row's view count and date, as a lockup
254
+ # sends it: a space today, drawn as an 8px gap. Rows from other answers have
255
+ # none and keep a bullet.
256
+ metaDelimiter: String
257
+ # An ISO 8601 time, set only by channelUploads: exact off the uploads feed,
258
+ # about right off the Videos tab's '6d ago' when the feed fails.
259
+ # Lists that merge several channels sort on it.
260
+ publishedAt: String
261
+ isLive: Boolean
262
+ # 0-100 watch progress, for the red bar across the thumbnail. Only feeds that
263
+ # carry a resume overlay (history, home) populate it.
264
+ progressPercent: Int
265
+ # A premiere or a scheduled stream: it has a page but nothing to play yet, so
266
+ # a card must not offer it as watchable the way a finished video is.
267
+ isUpcoming: Boolean
268
+ # youtube.com draws a green Members only mark under the row's date.
269
+ isMembersOnly: Boolean
270
+ # Vertical, and 9:16 in the grid. Shorts reach the normalizers as their own
271
+ # node kind, so this is set at the source rather than guessed from duration.
272
+ isShort: Boolean
273
+ # A Shorts tile's reel sequence. youtube.com's pager reads it after a click on
274
+ # the tile, and so moves through the Shorts of that tile's channel or search
275
+ # rather than the general feed (measured 2026-11-10).
276
+ shortsSequence: String
277
+ # Upstream's own badge texts (4K, CC, New), already localized. Kept as text
278
+ # because the vocabulary changes and an unknown badge should still render.
279
+ badges: [String!]!
280
+ # A collaboration's first channel, when the answer lists them.
281
+ channel: Channel
282
+ # Set only on search rows, which list a video's chapters under its
283
+ # description, with upstream's heading for them ('3 chapters in this video').
284
+ chapters: [Chapter!]
285
+ chaptersTitle: String
286
+ # Set only on a video two or more channels made (a collaboration): its
287
+ # byline as youtube.com prints it, one part per name ('Cleo Abram', 'and
288
+ # Marques Brownlee', or 'and 2 more').
289
+ byline: [BylinePart!]
290
+ # A collaboration's channels, as the choice youtube.com opens from its
291
+ # avatars lists them. A channel's Videos tab names them without these.
292
+ collaborators: [Channel!]
293
+ notInterestedToken: String
294
+ dontRecommendToken: String
295
+ }
296
+
297
+ type BylinePart {
298
+ text: String!
299
+ isVerified: Boolean
300
+ isVerifiedArtist: Boolean
301
+ }
302
+
303
+ type VideoPage {
304
+ items: [Video!]!
305
+ # Playlist rows carried by the same page. A channel's Playlists, Releases and
306
+ # Podcasts tabs consist only of these, so a page that could describe videos
307
+ # alone reported all three as empty.
308
+ playlists: [Playlist!]!
309
+ cursor: String
310
+ }
311
+
312
+ # One slide of the Shorts pager, and deliberately not a Video. The reel
313
+ # sequence answers with an id and a portrait still per entry but metadata for
314
+ # only one of them, so \`title\` is genuinely absent for most slides and the
315
+ # pager fetches the rest per slide as each becomes active.
316
+ type Short {
317
+ id: ID!
318
+ # The true 1080x1920 frame. A feed lockup carries the same frame letterboxed
319
+ # into 16:9, so this is the better still wherever it exists.
320
+ poster: String
321
+ title: String
322
+ }
323
+
324
+ type ShortsPage {
325
+ items: [Short!]!
326
+ cursor: String
327
+ }
328
+
329
+ # A feed that YouTube groups under headings, like History's day boundaries.
330
+ # The grouping is the point of the page, so it is not flattened away.
331
+ type VideoSection {
332
+ title: String
333
+ items: [Video!]!
334
+ }
335
+
336
+ type SectionedVideoPage {
337
+ sections: [VideoSection!]!
338
+ cursor: String
339
+ }
340
+
341
+ # The id is the chip's continuation token, never its label: the label is
342
+ # localized and changes with hl.
343
+ type FeedChip {
344
+ id: ID!
345
+ label: String!
346
+ selected: Boolean!
347
+ }
348
+
349
+ type HomeFeed {
350
+ items: [Video!]!
351
+ # The Shorts shelf, kept out of \`items\` because the grid renders it as its own
352
+ # carousel row. Every page can carry one, not just the first.
353
+ shorts: [Video!]!
354
+ chips: [FeedChip!]!
355
+ cursor: String
356
+ }
357
+
358
+ # A mix has no playlist page: it plays at /watch on \`videoId\` inside its list.
359
+ type Mix {
360
+ id: ID!
361
+ title: String!
362
+ thumbnail: String
363
+ videoId: ID!
364
+ }
365
+
366
+ # The card youtube.com puts above the results of an artist or channel search:
367
+ # the channel, its mix and a row of its top videos.
368
+ type SearchCard {
369
+ channel: Channel!
370
+ mix: Mix
371
+ videos: [Video!]!
372
+ }
373
+
374
+ # A titled group inside the results: "Latest from" a channel as result rows, a
375
+ # row of video cards ("People also search for"), or a row of Shorts.
376
+ type SearchShelf {
377
+ title: String!
378
+ # The line under a row of cards' title: 'People also search for'.
379
+ subtitle: String
380
+ videos: [Video!]!
381
+ # \`videos\` scroll sideways as cards rather than stacking as result rows.
382
+ horizontal: Boolean
383
+ # How many of \`videos\` upstream shows before the rest fold behind a button.
384
+ collapsedCount: Int
385
+ shorts: [Video!]!
386
+ }
387
+
388
+ # A video on a search's topic card.
389
+ type TopicVideo {
390
+ id: ID!
391
+ title: String!
392
+ thumbnail: String
393
+ durationSeconds: Int
394
+ # As upstream prints it: 'Minecraft • 172K • 11h ago' under the newest video,
395
+ # '301K • 3d ago' in the list. Null on a scheduled video.
396
+ subtitle: String
397
+ channel: Channel
398
+ # An ISO 8601 time, on a video not yet out.
399
+ scheduledAt: String
400
+ }
401
+
402
+ # The card youtube.com puts in the right column of a broad search, a game or
403
+ # channel for one: the topic, its newest video and a few more.
404
+ type SearchTopic {
405
+ title: String!
406
+ # 'Video game • Released: 2009' or '@mkbhd'.
407
+ subtitle: String
408
+ # The topic's own channel, which the title and View all open.
409
+ channelId: ID!
410
+ avatar: String
411
+ # True when the card heads a channel rather than a game or league, so it shows
412
+ # a Subscribe control in the header.
413
+ isChannel: Boolean
414
+ isVerified: Boolean
415
+ isVerifiedArtist: Boolean
416
+ hero: TopicVideo
417
+ videos: [TopicVideo!]!
418
+ }
419
+
420
+ # Search ranks channels and playlists above videos for a name query, so a
421
+ # video-only page silently drops the best answer. The source tags every row with
422
+ # its kind, which keeps __resolveType a pure field switch in the worker rather
423
+ # than a second place that has to know youtubei.js node shapes.
424
+ union SearchResult = Video | Channel | Playlist | SearchCard | SearchShelf
425
+
426
+ type SearchPage {
427
+ results: [SearchResult!]!
428
+ # Only on a search's first page.
429
+ topic: SearchTopic
430
+ # Upstream's "did you mean" and related-query chips, as plain query strings.
431
+ refinements: [String!]!
432
+ estimatedResults: Float
433
+ cursor: String
434
+ # Whether upstream offers its Unwatched chip for this search. Without one, a
435
+ # search asked with \`unwatched\` lists the plain results.
436
+ unwatchedChip: Boolean!
437
+ }
438
+
439
+ enum HashtagTab {
440
+ ALL
441
+ SHORTS
442
+ }
443
+
444
+ type HashtagPage {
445
+ tag: String!
446
+ title: String!
447
+ stats: String
448
+ tab: HashtagTab!
449
+ availableTabs: [HashtagTab!]!
450
+ items: [Video!]!
451
+ cursor: String
452
+ }
453
+
454
+ # One suggestion for the search box, \`query\` being what it searches for. \`name\`
455
+ # is set when upstream ties it to a person, a thing or a channel (then
456
+ # \`channelId\`), with what that is in \`description\` and its \`photo\`.
457
+ type SearchSuggestion {
458
+ query: String!
459
+ name: String
460
+ description: String
461
+ photo: String
462
+ channelId: ID
463
+ }
464
+
465
+ # Upstream's own vocabulary, lowercased by the source before it reaches
466
+ # youtubei.js. ALL is the unset state rather than a filter that gets sent.
467
+ enum SearchUploadDate {
468
+ ALL
469
+ TODAY
470
+ WEEK
471
+ MONTH
472
+ YEAR
473
+ }
474
+
475
+ enum SearchType {
476
+ ALL
477
+ VIDEO
478
+ SHORTS
479
+ CHANNEL
480
+ PLAYLIST
481
+ MOVIE
482
+ }
483
+
484
+ enum SearchDuration {
485
+ ALL
486
+ UNDER_THREE_MINS
487
+ THREE_TO_TWENTY_MINS
488
+ OVER_TWENTY_MINS
489
+ }
490
+
491
+ # youtube.com's Prioritize group, Relevance being what an unset sort asks. Its
492
+ # older orderings (upload date, rating) are gone from its panel, and youtubei.js
493
+ # encodes only these two.
494
+ enum SearchSort {
495
+ RELEVANCE
496
+ POPULARITY
497
+ }
498
+
499
+ enum SearchFeature {
500
+ HD
501
+ SUBTITLES
502
+ CREATIVE_COMMONS
503
+ THREE_D
504
+ LIVE
505
+ PURCHASED
506
+ FOUR_K
507
+ THREE_SIXTY
508
+ LOCATION
509
+ HDR
510
+ VR180
511
+ }
512
+
513
+ input SearchFilters {
514
+ uploadDate: SearchUploadDate
515
+ type: SearchType
516
+ duration: SearchDuration
517
+ sortBy: SearchSort
518
+ features: [SearchFeature!]
519
+ # youtube.com's Unwatched chip, which no other filter can say.
520
+ unwatched: Boolean
521
+ }
522
+
523
+ # The tabs a channel can expose. Which ones actually exist varies per channel,
524
+ # so a page reports its own \`availableTabs\` rather than the UI assuming a set.
525
+ enum ChannelTab {
526
+ HOME
527
+ VIDEOS
528
+ SHORTS
529
+ LIVE
530
+ RELEASES
531
+ PODCASTS
532
+ COURSES
533
+ SHOWS
534
+ PLAYLISTS
535
+ COMMUNITY
536
+ STORE
537
+ ABOUT
538
+ SEARCH
539
+ }
540
+
541
+ type Notification {
542
+ id: ID!
543
+ # The whole line as upstream writes it ("Blender uploaded ..."), already
544
+ # localized. There is no separate title or channel name on this node.
545
+ message: String!
546
+ sentText: String
547
+ # The channel avatar, and the video still where the notification is about one.
548
+ avatar: String
549
+ thumbnail: String
550
+ # Where tapping it goes. Absent when the endpoint is a kind this client does
551
+ # not route, in which case the row is shown but not linked.
552
+ videoId: String
553
+ read: Boolean
554
+ }
555
+
556
+ type NotificationPage {
557
+ items: [Notification!]!
558
+ cursor: String
559
+ }
560
+
561
+ type ChannelLink {
562
+ title: String!
563
+ # The destination itself, unwrapped from upstream's redirect page.
564
+ url: String!
565
+ # The short form upstream shows for it, such as "lnk.to/abc".
566
+ displayUrl: String
567
+ }
568
+
569
+ # The About panel. Reached through its own call rather than as a field on
570
+ # ChannelPage: getAbout() is a second round trip, and as its own query it is
571
+ # made once per channel rather than once per tab.
572
+ type ChannelAbout {
573
+ description: String
574
+ country: String
575
+ joinedDateText: String
576
+ viewCountText: String
577
+ subscriberCountText: String
578
+ videoCountText: String
579
+ canonicalUrl: String
580
+ links: [ChannelLink!]!
581
+ }
582
+
583
+ # A community post. \`attachment\` is deliberately reduced to the parts a card can
584
+ # render: the node behind it is a whole union (poll, image, video, playlist) and
585
+ # modelling all of it belongs with the surface that would show it.
586
+ type Post {
587
+ id: ID!
588
+ author: Channel
589
+ text: String!
590
+ publishedText: String
591
+ voteCountText: String
592
+ # As the Posts tab shows it ("1K"). Absent where youtube.com shows none, as
593
+ # on the post's own page.
594
+ commentCountText: String
595
+ # Upstream's spoken form of the count ("1K comments").
596
+ commentCountLabel: String
597
+ attachedVideo: Video
598
+ attachedImage: String
599
+ }
600
+
601
+ type PostPage {
602
+ items: [Post!]!
603
+ cursor: String
604
+ }
605
+
606
+ # A game's own channel, which youtube.com pictures by the game's box art.
607
+ type Game {
608
+ id: ID!
609
+ title: String!
610
+ boxArt: String
611
+ }
612
+
613
+ # A row of a channel's Home tab. Upstream fills a row with one kind of item,
614
+ # so normally only one of the lists has entries.
615
+ type ChannelShelf {
616
+ title: String!
617
+ subtitle: String
618
+ # Upstream's own path for the row's title (a playlist, or one of the
619
+ # channel's tabs), which the app's routes accept as they are.
620
+ url: String
621
+ # A row of full-size cards that "Show more" opens to all of them, as
622
+ # youtube.com draws a topic channel's rows. Otherwise the row scrolls.
623
+ expandable: Boolean
624
+ # The channel's own uploads, whose rows youtube.com prints without the
625
+ # channel's name. A row's video can carry the name all the same: the cache
626
+ # keys a video by its id, so another row of the same video lends it.
627
+ uploads: Boolean
628
+ videos: [Video!]!
629
+ shorts: [Video!]!
630
+ playlists: [Playlist!]!
631
+ channels: [Channel!]!
632
+ games: [Game!]!
633
+ posts: [Post!]!
634
+ }
635
+
636
+ type ChannelHome {
637
+ featured: Video
638
+ # In upstream's order. Rows of a kind this client does not render are left
639
+ # out.
640
+ shelves: [ChannelShelf!]!
641
+ # Upstream's own line for a Home it does not serve in this region ("This
642
+ # page is not available.").
643
+ message: String
644
+ }
645
+
646
+ type ChannelPage {
647
+ channel: Channel!
648
+ # Empty on the Home, Store and Posts tabs, which use \`home\`, \`store\` and \`posts\` instead.
649
+ videos: VideoPage!
650
+ # Only the tabs this channel really has, in upstream's display order.
651
+ availableTabs: [ChannelTab!]!
652
+ tab: ChannelTab!
653
+ # Sort options for the current tab, as upstream's own localized labels. The
654
+ # applied one is echoed back so the control can show what is active.
655
+ sortOptions: [String!]!
656
+ appliedSort: String
657
+ # True when upstream offers the sorts in one dropdown chip at the start of
658
+ # the bar, as on the Live tab, rather than one chip each.
659
+ sortMenu: Boolean!
660
+ # The chips that follow such a dropdown (Members only, Public), as upstream's
661
+ # own localized labels. At most one applies.
662
+ filterOptions: [String!]!
663
+ appliedFilter: String
664
+ # Only on the Home tab.
665
+ home: ChannelHome
666
+ # Only on the Store tab, in upstream's order.
667
+ store: [StoreShelf!]
668
+ # Only on the Posts tab. Later pages continue through \`communityPosts\` with its cursor.
669
+ posts: PostPage
670
+ }
671
+
672
+ # A row of a channel's Store tab.
673
+ type StoreShelf {
674
+ title: String!
675
+ # Laid out as one row that scrolls, rather than a grid.
676
+ scrolls: Boolean
677
+ products: [Product!]!
678
+ }
679
+
680
+ # A product a channel's store sells. \`url\` is its page on that store, never
681
+ # upstream's redirect page.
682
+ type Product {
683
+ title: String!
684
+ url: String!
685
+ thumbnail: String
686
+ # Upstream's own lines: the price, or "Unavailable" in its place, then what
687
+ # the price leaves out ("(taxes included) + additional fees") and the store
688
+ # ("From MKBHD").
689
+ price: String
690
+ priceNote: String
691
+ merchant: String
692
+ }
693
+
694
+ # The queue rail beside the player, present only when /watch was opened inside a
695
+ # playlist. Deliberately NOT a Playlist: \`currentIndex\` describes the video being
696
+ # watched rather than the playlist, so two videos from one playlist would fight
697
+ # over it if this were normalized on the playlist id. See src/graphql.ts.
698
+ type WatchPlaylist {
699
+ id: ID!
700
+ title: String
701
+ # The owner byline as upstream renders it. A mix is bylined "YouTube" with no
702
+ # channel behind it, so this is display text rather than a Channel.
703
+ author: String
704
+ items: [Video!]!
705
+ # 0-based, and it is the SERVER's answer rather than the requested one: an
706
+ # out-of-range playlistIndex comes back corrected here.
707
+ currentIndex: Int
708
+ # A mix or radio: the queue is generated as you watch, so \`items\` is a window
709
+ # onto it rather than the whole playlist.
710
+ isInfinite: Boolean
711
+ }
712
+
713
+ type WatchMeta {
714
+ id: ID!
715
+ # Upstream's own line for a video that no longer exists ("This video isn't
716
+ # available anymore"), which the page shows in place of the player and the rest.
717
+ unavailableText: String
718
+ # The watch page branches on this instead of mounting a player: live playback
719
+ # is not wired, and letting the player try produces three failed attempts and
720
+ # an internal error string.
721
+ isLive: Boolean
722
+ # A finished stream or premiere whose chat \`liveChatReplay\` replays.
723
+ hasChatReplay: Boolean
724
+ # Viewers watching now, which upstream carries in place of a total view count
725
+ # while a stream is live.
726
+ concurrentViewers: Int
727
+ title: String
728
+ # youtube.com's Members only badge under the title.
729
+ isMembersOnly: Boolean
730
+ # True when youtube.com's watch page has no comments section at all, as on a
731
+ # members-only or private video, so the page shows none rather than "Comments
732
+ # are turned off".
733
+ commentsHidden: Boolean
734
+ # The exact count and date, which the expanded description shows.
735
+ viewCountText: String
736
+ publishedDateText: String
737
+ # The rounded count ('1.8B views') and the relative date ('17y ago') the
738
+ # collapsed description shows instead.
739
+ shortViewCountText: String
740
+ relativeDateText: String
741
+ # The hashtags upstream lists beside the counts, each with its '#'.
742
+ hashtags: [String!]!
743
+ likeCountText: String
744
+ commentCountText: String
745
+ description: String
746
+ # The description as runs, so its links and chapter timestamps work. \`text\`
747
+ # above stays for the collapsed clamp.
748
+ descriptionRuns: [TextRun!]!
749
+ likeStatus: LikeStatus
750
+ # A collaboration's first channel.
751
+ channel: Channel
752
+ # Set only on a video two or more channels made, as on Video. Its owner row
753
+ # prints these names, and its Subscribe opens the choice of collaborators.
754
+ byline: [BylinePart!]
755
+ collaborators: [Channel!]
756
+ related: [Video!]!
757
+ # Present when the sidebar has more to load. Pass it to \`relatedVideos\`, the
758
+ # same shape \`Comment.repliesCursor\` uses: \`related\` stays a plain list so the
759
+ # busiest query in the app keeps its selection unchanged.
760
+ relatedCursor: String
761
+ # The video youtube.com's own autoplay moves on to, which is often not the
762
+ # first related one. Null when upstream names none.
763
+ autoplayId: ID
764
+ # Null unless the watch query passed a playlistId.
765
+ playlist: WatchPlaylist
766
+ # In playback order, and empty when the video has none.
767
+ chapters: [Chapter!]!
768
+ # What youtube.com's description section "Transcript" opens: pass it to
769
+ # \`transcript\`. Null for a video without one.
770
+ transcriptPanel: TranscriptPanel
771
+ # youtube.com's description section "Music". Null for a video without one.
772
+ music: MusicSection
773
+ # The card for the video's channel that ends youtube.com's expanded
774
+ # description. Null when upstream sends none.
775
+ channelCard: ChannelCard
776
+ # What youtube.com slides over the player at set times, each opening the
777
+ # channel card's info cards. Empty for a video without cards.
778
+ cardTeasers: [CardTeaser!]!
779
+ }
780
+
781
+ type CardTeaser {
782
+ text: String!
783
+ # Where in the video it slides in.
784
+ startMs: Float!
785
+ # How long it stays before it collapses to the player's "i".
786
+ durationMs: Float!
787
+ }
788
+
789
+ # A card a creator added, which youtube.com lists under the channel card. It
790
+ # opens exactly one of its video, its channel or its url.
791
+ type InfoCard {
792
+ title: String!
793
+ # "by BeckyGVEVO" for a video, the subscriber count for a channel, the call
794
+ # to action for a link.
795
+ subtitle: String
796
+ thumbnail: String
797
+ # A video's length, as its thumbnail shows it.
798
+ duration: String
799
+ videoId: ID
800
+ channelId: ID
801
+ # A page outside youtube.com, past its redirect page.
802
+ url: String
803
+ }
804
+
805
+ type MusicSection {
806
+ # As the section heads its songs, "1 song".
807
+ countText: String
808
+ songs: [Song!]!
809
+ # The channel its Music button opens.
810
+ channelId: ID
811
+ }
812
+
813
+ type Song {
814
+ title: String!
815
+ artist: String
816
+ album: String
817
+ thumbnail: String
818
+ # The song's own video, which its card opens. Null when the card opens nothing.
819
+ videoId: ID
820
+ }
821
+
822
+ type ChannelCard {
823
+ id: ID!
824
+ name: String!
825
+ avatar: String
826
+ subscriberCountText: String
827
+ # youtube.com's addresses of the card's Videos and About buttons, such as
828
+ # /channel/UC.../videos, which the app's routes take as they are.
829
+ videosUrl: String
830
+ aboutUrl: String
831
+ # The channel's own links, such as its Instagram.
832
+ links: [ChannelLink!]!
833
+ # The info cards, which the player's "i" and its teasers open.
834
+ cards: [InfoCard!]!
835
+ }
836
+
837
+ type TranscriptPanel {
838
+ panelId: String!
839
+ params: String!
840
+ }
841
+
842
+ # A video's spoken text, as youtube.com's transcript panel lists it.
843
+ type Transcript {
844
+ # One per chapter, or a single untitled one for a video without chapters.
845
+ sections: [TranscriptSection!]!
846
+ # Pass it to \`transcriptSearch\` with a query. Null on a search's own answer.
847
+ searchToken: String
848
+ }
849
+
850
+ type TranscriptSection {
851
+ # As youtube.com heads it, "Chapter 1: Hardware and performance".
852
+ title: String
853
+ # The chapter's start, which its heading seeks to. Null with the title.
854
+ startSeconds: Float
855
+ lines: [TranscriptLine!]!
856
+ }
857
+
858
+ # A line runs until the next one starts, as youtube.com highlights it.
859
+ type TranscriptLine {
860
+ startSeconds: Float!
861
+ # As youtube.com prints it, "1:02".
862
+ timestamp: String!
863
+ text: String!
864
+ }
865
+
866
+ # A chapter of a video, as the player bar names it. It runs until the next one
867
+ # starts.
868
+ type Chapter {
869
+ title: String!
870
+ startSeconds: Float!
871
+ thumbnail: String
872
+ }
873
+
874
+ # One segment of a rich text body. Upstream hands text back as runs, each of
875
+ # which may carry an endpoint, and collapsing them to a plain string is what
876
+ # makes URLs, mentions and 12:34 timestamps inert.
877
+ #
878
+ # The four kinds are distinguished by which target field is set, rather than by
879
+ # an enum, so a run whose endpoint is a kind this client does not model still
880
+ # renders as its own text instead of disappearing.
881
+ type TextRun {
882
+ text: String!
883
+ bold: Boolean
884
+ # An off-site link.
885
+ url: String
886
+ # A /watch link. \`startSeconds\` is what makes a description chapter or a
887
+ # comment timestamp seek rather than reload the page.
888
+ videoId: String
889
+ startSeconds: Int
890
+ # A channel, hashtag or other browse target.
891
+ browseId: String
892
+ }
893
+
894
+ # Who wrote a comment or a chat line, as that line names them: by @handle where
895
+ # a Channel carries its name. Its own type rather than a Channel, so the cache
896
+ # never writes the handle over the name of the channel with the same id.
897
+ type Author {
898
+ id: ID!
899
+ name: String!
900
+ avatar: String
901
+ handle: String
902
+ isVerified: Boolean
903
+ isVerifiedArtist: Boolean
904
+ }
905
+
906
+ type Comment {
907
+ id: ID!
908
+ author: Author
909
+ text: String!
910
+ # The same body as \`text\`, segmented. \`text\` stays for the collapsed clamp and
911
+ # for anything that only needs a plain string.
912
+ runs: [TextRun!]!
913
+ isLiked: Boolean
914
+ isDisliked: Boolean
915
+ isCreator: Boolean
916
+ isMember: Boolean
917
+ publishedText: String
918
+ likeCountText: String
919
+ replyCount: Int
920
+ isPinned: Boolean
921
+ isHearted: Boolean
922
+ heartAvatar: String
923
+ heartTooltip: String
924
+ # Present only when the comment has replies. Pass it to \`commentReplies\`.
925
+ repliesCursor: String
926
+ # Opaque handle for this comment's own like, dislike and reply endpoints.
927
+ # Absent when the read carried no commands, which is what signed out looks
928
+ # like, so a control without one should not be rendered.
929
+ actionsToken: String
930
+ }
931
+
932
+ # Distinct message card/row kinds supported in live chat and chat replay.
933
+ enum LiveChatMessageKind {
934
+ TEXT
935
+ PAID
936
+ STICKER
937
+ MEMBERSHIP
938
+ GIFT_MEMBERSHIP
939
+ GIFT
940
+ SYSTEM
941
+ }
942
+
943
+ # An inline role, membership, verified, or Top Fan leaderboard badge next to a chat author.
944
+ type LiveChatBadge {
945
+ label: String!
946
+ iconUrl: String
947
+ kind: String
948
+ backgroundColor: String
949
+ textColor: String
950
+ }
951
+
952
+ # One rendered line of live chat. Paid messages (Super Chats) carry an amount
953
+ # and their own colours; stickers, memberships, gifts, and mode notices use kind-specific fields.
954
+ type LiveChatMessage {
955
+ id: ID!
956
+ kind: LiveChatMessageKind
957
+ author: Author
958
+ text: String!
959
+ # Segmented, because a chat line is mostly custom emoji: those arrive as runs
960
+ # with an image and no meaningful text.
961
+ runs: [LiveChatRun!]!
962
+ timestampText: String
963
+ isOwner: Boolean
964
+ isModerator: Boolean
965
+ isMember: Boolean
966
+ badges: [LiveChatBadge!]
967
+ purchaseAmountText: String
968
+ headerBackgroundColor: String
969
+ bodyBackgroundColor: String
970
+ headerPrimaryText: String
971
+ headerSubtext: String
972
+ stickerUrl: String
973
+ stickerLabel: String
974
+ iconType: String
975
+ # On a replay only: the point of the video the line was said at, in
976
+ # milliseconds, which is when the replay shows it.
977
+ offsetMs: Int
978
+ }
979
+
980
+ enum LiveChatInputStatus {
981
+ ENABLED
982
+ RESTRICTED
983
+ SIGN_IN_REQUIRED
984
+ }
985
+
986
+ # Current chat compose capability reported by upstream's actionPanel and mode notices.
987
+ type LiveChatInputState {
988
+ status: LiveChatInputStatus!
989
+ restrictionMessage: String
990
+ restrictionMode: String
991
+ placeholder: String
992
+ maxLength: Int
993
+ slowModeSeconds: Int
994
+ }
995
+
996
+ # Header entry point for opening the Top fans stream leaderboard.
997
+ type LiveChatLeaderboardEntryPoint {
998
+ label: String!
999
+ panelId: String!
1000
+ params: String!
1001
+ }
1002
+
1003
+ type LiveChatLeaderboardItem {
1004
+ rank: String!
1005
+ displayName: String!
1006
+ avatar: String
1007
+ points: String
1008
+ badgeLabel: String
1009
+ badgeBackgroundColor: String
1010
+ badgeTextColor: String
1011
+ }
1012
+
1013
+ type LiveChatLeaderboard {
1014
+ title: String!
1015
+ items: [LiveChatLeaderboardItem!]!
1016
+ }
1017
+
1018
+ type LiveChatPollChoice {
1019
+ id: String!
1020
+ text: String!
1021
+ runs: [LiveChatRun!]!
1022
+ votePercentage: String
1023
+ voteRatio: Float
1024
+ selected: Boolean
1025
+ voteParams: String
1026
+ }
1027
+
1028
+ type LiveChatPoll {
1029
+ id: ID!
1030
+ question: String!
1031
+ questionRuns: [LiveChatRun!]!
1032
+ metadataText: String
1033
+ choices: [LiveChatPollChoice!]!
1034
+ finished: Boolean
1035
+ }
1036
+
1037
+ type LiveChatTickerItem {
1038
+ id: ID!
1039
+ label: String!
1040
+ avatar: String
1041
+ authorName: String
1042
+ backgroundColor: String
1043
+ textColor: String
1044
+ durationSeconds: Int
1045
+ detailText: String
1046
+ }
1047
+
1048
+ # youtube.com's two chat replays. TOP is its default and leaves out what
1049
+ # upstream filters as likely spam; ALL keeps every line.
1050
+ enum ChatReplayView {
1051
+ TOP
1052
+ ALL
1053
+ }
1054
+
1055
+ # A text run, or a custom emoji, which renders as an image.
1056
+ type LiveChatRun {
1057
+ text: String!
1058
+ url: String
1059
+ videoId: String
1060
+ startSeconds: Int
1061
+ browseId: String
1062
+ emojiUrl: String
1063
+ emojiLabel: String
1064
+ }
1065
+
1066
+ type LiveChatEmoji {
1067
+ id: ID!
1068
+ shortcut: String!
1069
+ url: String!
1070
+ }
1071
+
1072
+ type LiveChatPinnedMessage {
1073
+ id: ID!
1074
+ header: String
1075
+ message: LiveChatMessage!
1076
+ }
1077
+
1078
+ type LiveChatPage {
1079
+ items: [LiveChatMessage!]!
1080
+ # Poll this for whatever arrives next. Absent once the chat has ended, which
1081
+ # is what tells the client to stop.
1082
+ cursor: String
1083
+ # Ids the server retracted. The client holds the transcript, so a removal has
1084
+ # to travel as its own instruction rather than as an absence from a later page.
1085
+ removedIds: [ID!]
1086
+ # Authors whose messages moderators removed.
1087
+ removedAuthorIds: [ID!]
1088
+ # Chat is off for this video. Distinct from an empty page, which just means
1089
+ # nothing was said since the last poll.
1090
+ disabled: Boolean
1091
+ pinned: LiveChatPinnedMessage
1092
+ pinnedCleared: Boolean
1093
+ customEmojis: [LiveChatEmoji!]
1094
+ inputState: LiveChatInputState
1095
+ leaderboard: LiveChatLeaderboardEntryPoint
1096
+ poll: LiveChatPoll
1097
+ pollCleared: Boolean
1098
+ tickerItems: [LiveChatTickerItem!]
1099
+ reactionBurst: Int
1100
+ }
1101
+
1102
+ type CommentPage {
1103
+ items: [Comment!]!
1104
+ cursor: String
1105
+ disabled: Boolean
1106
+ # The comments header's own count, which is exact. The /next-derived text on
1107
+ # WatchMeta is a rounded teaser and needed a regex to read.
1108
+ countText: String
1109
+ }
1110
+
1111
+ # youtubei.js encodes only these two orderings, and passing one to getComments
1112
+ # costs a single round trip where Comments.applySort costs two.
1113
+ enum CommentSort {
1114
+ TOP
1115
+ NEWEST
1116
+ }
1117
+
1118
+ type Playlist {
1119
+ id: ID!
1120
+ title: String!
1121
+ description: String
1122
+ thumbnail: String
1123
+ # Counts arrive as localized strings ("50 videos", "1,204 views"), never as
1124
+ # numbers, so they are carried through as text rather than parsed.
1125
+ videoCountText: String
1126
+ viewCountText: String
1127
+ updatedText: String
1128
+ # PUBLIC / UNLISTED / PRIVATE, but the vocabulary is upstream's and changes,
1129
+ # so it stays a String rather than an enum the client would have to exhaust.
1130
+ privacy: String
1131
+ isEditable: Boolean
1132
+ canDelete: Boolean
1133
+ canReorder: Boolean
1134
+ channel: Channel
1135
+ }
1136
+
1137
+ # An entry wraps its Video instead of extending it. \`setVideoId\` identifies the
1138
+ # SLOT, not the video, and removing or reordering an entry needs it: the same
1139
+ # video can sit in one playlist twice, each occurrence with its own setVideoId.
1140
+ type PlaylistItem {
1141
+ video: Video!
1142
+ setVideoId: String
1143
+ # 1-BASED, unlike WatchPlaylist.currentIndex and Query.watch's playlistIndex,
1144
+ # which are 0-based. This one is upstream's own row number and it is what a
1145
+ # \`&index=\` link addresses, so it travels through the UI unshifted and is
1146
+ # converted only where it reaches the query.
1147
+ index: Int
1148
+ }
1149
+
1150
+ type PlaylistPage {
1151
+ # Repeated on every page: a continuation response carries no playlist header,
1152
+ # so the source replays the one read from the first page.
1153
+ playlist: Playlist!
1154
+ items: [PlaylistItem!]!
1155
+ cursor: String
1156
+ }
1157
+
1158
+ type PlaylistListPage {
1159
+ items: [Playlist!]!
1160
+ cursor: String
1161
+ }
1162
+
1163
+ # One channel of the signed-in Google account.
1164
+ type Account {
1165
+ # A brand channel's page ID, which the engine sends as X-Goog-PageId to act as
1166
+ # it. Null for the Google account's own channel.
1167
+ brandPageId: String
1168
+ name: String
1169
+ avatar: String
1170
+ handle: String
1171
+ selected: Boolean
1172
+ # A brand account with no channel cannot be browsed as one.
1173
+ hasChannel: Boolean
1174
+ }
1175
+
1176
+ type Session {
1177
+ signedIn: Boolean!
1178
+ name: String
1179
+ avatar: String
1180
+ handle: String
1181
+ # Every channel of the Google account, including the selected one. Comes off the
1182
+ # same response the header avatar does, so listing them costs no extra round trip.
1183
+ accounts: [Account!]!
1184
+ }
1185
+
1186
+ type Query {
1187
+ # \`chip\` is a FeedChip.id; omitting it is the All feed. Applying one costs a
1188
+ # second browse round trip on top of the base feed.
1189
+ home(chip: ID, cursor: String): HomeFeed!
1190
+ # \`seed\` names the short to open on; the sequence follows from it. With no
1191
+ # seed the home shelf supplies one, so a signed-out session has no Shorts
1192
+ # feed rather than an error. \`sequence\` is the Video.shortsSequence of the
1193
+ # tile the seed was opened from.
1194
+ shorts(seed: ID, cursor: String, sequence: String): ShortsPage!
1195
+ # Signed-in only. youtubei.js refuses these before the network call when
1196
+ # signed out, so callers gate on \`session.signedIn\` rather than firing a
1197
+ # request that cannot succeed.
1198
+ subscriptions(cursor: String): VideoPage!
1199
+ history(query: String, cursor: String): SectionedVideoPage!
1200
+ # Only the first page of the list unless \`all\` is set, which follows it to
1201
+ # the end at one request per page (capped at 20 pages).
1202
+ subscribedChannels(all: Boolean): [Channel!]!
1203
+ # A channel's 15 newest long uploads (no Shorts, no live streams), from its
1204
+ # public feed. \`channelId\` must be of the UC form. A feed that cannot be read,
1205
+ # a 404 included, is an error rather than an empty list. The rows carry no
1206
+ # duration, live state or channel avatar: a query must not select those, or
1207
+ # it writes nulls over what other views cached for the same video.
1208
+ channelUploads(channelId: ID!): [Video!]!
1209
+ # Results are heterogeneous: see the SearchResult union. A cursor is bound to
1210
+ # the query AND the filter set that minted it, so changing a filter starts a
1211
+ # fresh feed rather than paging the previous one's results.
1212
+ search(query: String!, filters: SearchFilters, cursor: String): SearchPage!
1213
+ hashtag(tag: String!, tab: HashtagTab, cursor: String): HashtagPage!
1214
+ # Suggestions for the search box. Not an InnerTube call: it reads
1215
+ # suggestqueries-clients6.youtube.com through the same rewritten fetch, so it
1216
+ # is one tunneled round trip per call and callers must debounce.
1217
+ searchSuggestions(query: String!, previousQuery: String): [SearchSuggestion!]!
1218
+ video(id: ID!): Video
1219
+ # \`tab\` defaults to the channel's own landing tab. \`query\` only applies to the
1220
+ # SEARCH tab and is ignored elsewhere. \`sort\` is one of the page's own
1221
+ # \`sortOptions\` labels and \`filter\` one of its \`filterOptions\`. \`id\` may also
1222
+ # be a youtube.com channel path without its leading slash: \`@handle\`,
1223
+ # \`c/<name>\` or \`user/<name>\`.
1224
+ channel(id: ID!, tab: ChannelTab, sort: String, query: String, cursor: String, filter: String): ChannelPage!
1225
+ # Null when the channel publishes no About panel, which is an ordinary state
1226
+ # rather than a failure: \`ChannelPage.availableTabs\` is what says whether to
1227
+ # ask at all.
1228
+ channelAbout(id: ID!): ChannelAbout
1229
+ communityPosts(channelId: ID!, cursor: String): PostPage!
1230
+ # Null when youtube.com has no post under that id.
1231
+ post(id: ID!): Post
1232
+ # \`playlistId\` puts the video in a queue: the same /next call then also returns
1233
+ # the playlist panel. \`playlistIndex\` is 0-based, and the server corrects an
1234
+ # out-of-range one rather than failing, so read the position back off
1235
+ # \`playlist.currentIndex\` instead of assuming the request was honoured.
1236
+ watch(id: ID!, playlistId: ID, playlistIndex: Int): WatchMeta
1237
+ # The panel and params come from \`WatchMeta.transcriptPanel\`.
1238
+ transcript(panelId: String!, params: String!): Transcript!
1239
+ # The lines matching \`query\`, by youtube.com's own search, which matches words
1240
+ # rather than any substring. \`token\` is \`Transcript.searchToken\`.
1241
+ transcriptSearch(token: String!, query: String!): Transcript!
1242
+ # A cursor is bound to the sort that minted it: switching order has to start a
1243
+ # new feed rather than page the previous ordering's results.
1244
+ comments(videoId: ID!, sort: CommentSort, cursor: String): CommentPage!
1245
+ # A post's comments, as \`comments\` reads a video's. \`channelId\` is the post's
1246
+ # author, which upstream keys them by too.
1247
+ postComments(postId: ID!, channelId: ID!, sort: CommentSort, cursor: String): CommentPage!
1248
+ # Polled rather than subscribed: the whole transport is one response per
1249
+ # request. Call without a cursor to open the chat, then follow the cursor it
1250
+ # returns. A poll parks on the server until something arrives or it times out,
1251
+ # so an empty page is a heartbeat rather than a reason to back off.
1252
+ liveChat(videoId: ID!, view: ChatReplayView, cursor: String): LiveChatPage!
1253
+ # Top fans leaderboard for an active live stream, fetched from get_panel on demand.
1254
+ liveChatLeaderboard(panelId: String!, params: String!): LiveChatLeaderboard!
1255
+ # The chat of a finished stream or premiere. Without a cursor it starts at
1256
+ # \`offsetMs\`, which is how the panel opens and follows a seek, and the page
1257
+ # carries some lines from before that point; a cursor continues past the
1258
+ # previous page. A page with no cursor is the end of the replay.
1259
+ liveChatReplay(videoId: ID!, offsetMs: Int!, view: ChatReplayView, cursor: String): LiveChatPage!
1260
+ # Replies to one comment. The cursor comes from \`Comment.repliesCursor\` and
1261
+ # names its thread, so no video or comment id is needed alongside it.
1262
+ commentReplies(cursor: String!): CommentPage!
1263
+ # More of the watch sidebar. The cursor comes from \`WatchMeta.relatedCursor\`
1264
+ # and names the video it belongs to, so no id is needed alongside it.
1265
+ relatedVideos(cursor: String!): VideoPage!
1266
+ # Signed-in only, like \`subscriptions\` and \`history\`: the library aggregation
1267
+ # browse is refused before the network call when signed out.
1268
+ playlists(cursor: String): PlaylistListPage!
1269
+ # NOT gated: a public playlist opens signed out. An inaccessible one comes
1270
+ # back as an upstream error rather than as an empty page.
1271
+ playlist(id: ID!, cursor: String): PlaylistPage!
1272
+ # Signed-in only. Polling is the caller's business: each call is a tunneled
1273
+ # round trip, so the header polls slowly and only while the tab is visible.
1274
+ notifications(cursor: String): NotificationPage!
1275
+ unseenNotificationCount: Int!
1276
+ session: Session!
1277
+ }
1278
+
1279
+ # Writes return the affected entity rather than a Boolean so the normalized
1280
+ # cache can merge the new state into every view already rendering it: liking on
1281
+ # the watch page updates the same video wherever else it is on screen.
1282
+ #
1283
+ # The returned entity carries ONLY the identity and the fields the write
1284
+ # changed. A mutation document must not select anything else off it (the rest is
1285
+ # not fetched back, and a non-null field like Channel.name would then fail).
1286
+ type Mutation {
1287
+ rateVideo(id: ID!, status: LikeStatus!): WatchMeta!
1288
+ # Resolves to the removed video id so the cache can drop it from the feed.
1289
+ removeFromHistory(videoId: ID!): ID!
1290
+ clearHistory: Boolean!
1291
+ submitFeedback(token: String!): Boolean!
1292
+ # Resolves to a Boolean, not a Comment: upstream answers a create with an
1293
+ # opaque response carrying no parseable comment, and a fabricated id would
1294
+ # poison the normalized cache. The composer prepends its own row instead.
1295
+ postComment(videoId: ID!, text: String!): Boolean!
1296
+ commentOnPost(postId: ID!, channelId: ID!, text: String!): Boolean!
1297
+ # Sends through the chat session the panel already has open, so it fails
1298
+ # rather than silently opening a second poll of the same stream.
1299
+ sendLiveChatMessage(videoId: ID!, text: String!): Boolean!
1300
+ voteLiveChatPoll(videoId: ID!, pollId: ID!, voteParams: String!): Boolean!
1301
+ replyToComment(actionsToken: String!, text: String!): Boolean!
1302
+ rateComment(actionsToken: String!, status: LikeStatus!): Comment!
1303
+ # Resolves to the notification id so the cache can mark just that row read.
1304
+ markNotificationRead(id: ID!): ID!
1305
+ setSubscribed(channelId: ID!, subscribed: Boolean!): Channel!
1306
+ setNotificationLevel(channelId: ID!, level: NotificationLevel!): Channel!
1307
+ addToPlaylist(playlistId: ID!, videoIds: [ID!]!): Playlist!
1308
+ # Entries are addressed by \`setVideoId\`, never by video id: the same video can
1309
+ # sit in one playlist twice and only the setVideoId says which row to drop.
1310
+ # PlaylistItem.setVideoId is where the caller gets them.
1311
+ removeFromPlaylist(playlistId: ID!, setVideoIds: [ID!]!): Playlist!
1312
+ # \`privacy\` and \`description\` are only settable AT CREATION. See
1313
+ # setPlaylistPrivacy for why the edit path is weaker than this one.
1314
+ createPlaylist(title: String!, videoIds: [ID!], privacy: PlaylistPrivacy, description: String): Playlist!
1315
+ # Resolves to the deleted id so the cache can drop it from the library list.
1316
+ deletePlaylist(id: ID!): ID!
1317
+ renamePlaylist(id: ID!, title: String!): Playlist!
1318
+ setPlaylistDescription(id: ID!, description: String!): Playlist!
1319
+ # The one write here whose upstream action name is not attested by youtubei.js
1320
+ # 18.3.0. It is sent verbatim and may be ignored by the server; the resolved
1321
+ # entity is optimistic either way. Prefer setting privacy through
1322
+ # createPlaylist, which goes through an endpoint the library does implement.
1323
+ setPlaylistPrivacy(id: ID!, privacy: PlaylistPrivacy!): Playlist!
1324
+ # \`afterSetVideoId\` is the entry the moved one lands AFTER; omitting it asks
1325
+ # for the first position.
1326
+ movePlaylistItem(playlistId: ID!, setVideoId: ID!, afterSetVideoId: ID): Playlist!
1327
+ }
1328
+ `;const J_=e=>{if(e)return{uploadDate:e.uploadDate??void 0,type:e.type??void 0,duration:e.duration??void 0,sortBy:e.sortBy??void 0,features:e.features??void 0,unwatched:e.unwatched??void 0}},Y_={video:`Video`,channel:`Channel`,playlist:`Playlist`,card:`SearchCard`,shelf:`SearchShelf`},X_={SearchResult:{__resolveType:e=>Y_[e.kind]},Query:{home:(e,{chip:t,cursor:n},r)=>r.source.home(t??void 0,n??void 0),shorts:(e,{seed:t,cursor:n,sequence:r},i)=>i.source.shorts(t??void 0,n??void 0,r??void 0),subscriptions:(e,{cursor:t},n)=>n.source.subscriptions(t??void 0),history:(e,{query:t,cursor:n},r)=>r.source.history(n??void 0,t??void 0),subscribedChannels:(e,{all:t},n)=>n.source.subscribedChannels(t??void 0),channelUploads:(e,{channelId:t},n)=>n.source.channelUploads(t),search:(e,{query:t,filters:n,cursor:r},i)=>i.source.search(t,J_(n),r??void 0),hashtag:(e,{tag:t,tab:n,cursor:r},i)=>i.source.hashtag(t,n??void 0,r??void 0),searchSuggestions:(e,{query:t,previousQuery:n},r)=>r.source.searchSuggestions(t,n??void 0),video:(e,{id:t},n)=>n.source.video(t).then(e=>e??null),channel:(e,{id:t,tab:n,sort:r,query:i,cursor:a,filter:o},s)=>s.source.channel(t,n??void 0,r??void 0,i??void 0,a??void 0,o??void 0),channelAbout:(e,{id:t},n)=>n.source.channelAbout(t).then(e=>e??null),communityPosts:(e,{channelId:t,cursor:n},r)=>r.source.communityPosts(t,n??void 0),post:(e,{id:t},n)=>n.source.post(t).then(e=>e??null),watch:(e,{id:t,playlistId:n,playlistIndex:r},i)=>i.source.watch(t,n??void 0,r??void 0).then(e=>e??null),transcript:(e,{panelId:t,params:n},r)=>r.source.transcript(t,n),transcriptSearch:(e,{token:t,query:n},r)=>r.source.transcriptSearch(t,n),comments:(e,{videoId:t,sort:n,cursor:r},i)=>i.source.comments(t,n??void 0,r??void 0),postComments:(e,{postId:t,channelId:n,sort:r,cursor:i},a)=>a.source.postComments(t,n,r??void 0,i??void 0),liveChat:(e,{videoId:t,view:n,cursor:r},i)=>i.source.liveChat(t,r??void 0,n??void 0),liveChatLeaderboard:(e,{panelId:t,params:n},r)=>r.source.liveChatLeaderboard(t,n),liveChatReplay:(e,{videoId:t,offsetMs:n,view:r,cursor:i},a)=>a.source.liveChatReplay(t,n,r??void 0,i??void 0),commentReplies:(e,{cursor:t},n)=>n.source.commentReplies(t),relatedVideos:(e,{cursor:t},n)=>n.source.relatedVideos(t),playlists:(e,{cursor:t},n)=>n.source.playlists(t??void 0),playlist:(e,{id:t,cursor:n},r)=>r.source.playlist(t,n??void 0),notifications:(e,{cursor:t},n)=>n.source.notifications(t??void 0),unseenNotificationCount:(e,t,n)=>n.source.unseenNotificationCount(),session:(e,t,n)=>n.source.session()},Mutation:{rateVideo:(e,{id:t,status:n},r)=>r.source.rateVideo(t,n),removeFromHistory:(e,{videoId:t},n)=>n.source.removeFromHistory(t),clearHistory:(e,t,n)=>n.source.clearHistory(),submitFeedback:(e,{token:t},n)=>n.source.submitFeedback(t),markNotificationRead:(e,{id:t},n)=>n.source.markNotificationRead(t),postComment:(e,{videoId:t,text:n},r)=>r.source.postComment(t,n),commentOnPost:(e,{postId:t,channelId:n,text:r},i)=>i.source.commentOnPost(t,n,r),sendLiveChatMessage:(e,{videoId:t,text:n},r)=>r.source.sendLiveChatMessage(t,n),voteLiveChatPoll:(e,{videoId:t,pollId:n,voteParams:r},i)=>i.source.voteLiveChatPoll(t,n,r),replyToComment:(e,{actionsToken:t,text:n},r)=>r.source.replyToComment(t,n),rateComment:(e,{actionsToken:t,status:n},r)=>r.source.rateComment(t,n),setSubscribed:(e,{channelId:t,subscribed:n},r)=>r.source.setSubscribed(t,n),setNotificationLevel:(e,{channelId:t,level:n},r)=>r.source.setNotificationLevel(t,n),addToPlaylist:(e,{playlistId:t,videoIds:n},r)=>r.source.addToPlaylist(t,n),removeFromPlaylist:(e,{playlistId:t,setVideoIds:n},r)=>r.source.removeFromPlaylist(t,n),createPlaylist:(e,{title:t,videoIds:n,privacy:r,description:i},a)=>a.source.createPlaylist(t,n??void 0,r??void 0,i??void 0),deletePlaylist:(e,{id:t},n)=>n.source.deletePlaylist(t),renamePlaylist:(e,{id:t,title:n},r)=>r.source.renamePlaylist(t,n),setPlaylistDescription:(e,{id:t,description:n},r)=>r.source.setPlaylistDescription(t,n),setPlaylistPrivacy:(e,{id:t,privacy:n},r)=>r.source.setPlaylistPrivacy(t,n),movePlaylistItem:(e,{playlistId:t,setVideoId:n,afterSetVideoId:r},i)=>i.source.movePlaylistItem(t,n,r??void 0)}},Z_=await K_({},{key:`source`,transport:globalThis}),Q_=pp({graphqlEndpoint:`/graphql`,maskedErrors:!1,schema:Yc({typeDefs:q_,resolvers:X_})});K_({handleRequest:(e,t)=>Q_.handleRequest(new Request(e,t),{source:Z_})},{key:`graphql`,transport:globalThis});