UNPKG

highlight.run

Version:

Open source, fullstack monitoring. Capture frontend errors, record server side logs, and visualize what broke with session replay.

49 lines (43 loc) 740 kB
(function(W,K){typeof exports=="object"&&typeof module!="undefined"?K(exports):typeof define=="function"&&define.amd?define(["exports"],K):(W=typeof globalThis!="undefined"?globalThis:W||self,K(W.LD={}))})(this,function(W){"use strict";var E1=Object.defineProperty,C1=Object.defineProperties;var Z1=Object.getOwnPropertyDescriptors;var jo=Object.getOwnPropertySymbols,L1=Object.getPrototypeOf,Fb=Object.prototype.hasOwnProperty,Jb=Object.prototype.propertyIsEnumerable,x1=Reflect.get;var Au=(W,K)=>(K=Symbol[W])?K:Symbol.for("Symbol."+W),N1=W=>{throw TypeError(W)};var Mu=(W,K,le)=>K in W?E1(W,K,{enumerable:!0,configurable:!0,writable:!0,value:le}):W[K]=le,S=(W,K)=>{for(var le in K||(K={}))Fb.call(K,le)&&Mu(W,le,K[le]);if(jo)for(var le of jo(K))Jb.call(K,le)&&Mu(W,le,K[le]);return W},M=(W,K)=>C1(W,Z1(K));var Ae=(W,K)=>{var le={};for(var Re in W)Fb.call(W,Re)&&K.indexOf(Re)<0&&(le[Re]=W[Re]);if(W!=null&&jo)for(var Re of jo(W))K.indexOf(Re)<0&&Jb.call(W,Re)&&(le[Re]=W[Re]);return le};var b=(W,K,le)=>Mu(W,typeof K!="symbol"?K+"":K,le);var Pu=(W,K,le)=>x1(L1(W),le,K);var Y=(W,K,le)=>new Promise((Re,He)=>{var qe=Be=>{try{ar(le.next(Be))}catch(bn){He(bn)}},xt=Be=>{try{ar(le.throw(Be))}catch(bn){He(bn)}},ar=Be=>Be.done?Re(Be.value):Promise.resolve(Be.value).then(qe,xt);ar((le=le.apply(W,K)).next())}),G1=function(W,K){this[0]=W,this[1]=K};var Uu=W=>{var K=W[Au("asyncIterator")],le=!1,Re,He={};return K==null?(K=W[Au("iterator")](),Re=qe=>He[qe]=xt=>K[qe](xt)):(K=K.call(W),Re=qe=>He[qe]=xt=>{if(le){if(le=!1,qe==="throw")throw xt;return xt}return le=!0,{done:!1,value:new G1(new Promise(ar=>{var Be=K[qe](xt);Be instanceof Object||N1("Object expected"),ar(Be)}),1)}}),He[Au("iterator")]=()=>He,Re("next"),"throw"in K?Re("throw"):He.throw=qe=>{throw qe},"return"in K&&Re("return"),He};const K={key:"_sid"},le="rrweb/sequential-id@1",Re=r=>{const e=K;let t=0;return{name:le,eventProcessor(n){return Object.assign(n,{[e.key]:++t}),n},options:e}};function He(r,e){if(!!!r)throw new Error(e)}function qe(r){return typeof r=="object"&&r!==null}function xt(r,e){if(!!!r)throw new Error("Unexpected invariant triggered.")}const ar=/\r\n|[\n\r]/g;function Be(r,e){let t=0,n=1;for(const i of r.body.matchAll(ar)){if(typeof i.index=="number"||xt(!1),i.index>=e)break;t=i.index+i[0].length,n+=1}return{line:n,column:e+1-t}}function bn(r){return Du(r.source,Be(r.source,r.start))}function Du(r,e){const t=r.locationOffset.column-1,n="".padStart(t)+r.body,i=e.line-1,s=r.locationOffset.line-1,o=e.line+s,a=e.line===1?t:0,l=e.column+a,c=`${r.name}:${o}:${l} `,u=n.split(/\r\n|[\n\r]/g),d=u[i];if(d.length>120){const h=Math.floor(l/80),f=l%80,m=[];for(let p=0;p<d.length;p+=80)m.push(d.slice(p,p+80));return c+Fu([[`${o} |`,m[0]],...m.slice(1,h+1).map(p=>["|",p]),["|","^".padStart(f)],["|",m[h+1]]])}return c+Fu([[`${o-1} |`,u[i-1]],[`${o} |`,d],["|","^".padStart(l)],[`${o+1} |`,u[i+1]]])}function Fu(r){const e=r.filter(([n,i])=>i!==void 0),t=Math.max(...e.map(([n])=>n.length));return e.map(([n,i])=>n.padStart(t)+(i?" "+i:"")).join(` `)}function Qb(r){const e=r[0];return e==null||"kind"in e||"length"in e?{nodes:e,source:r[1],positions:r[2],path:r[3],originalError:r[4],extensions:r[5]}:e}class Qo extends Error{constructor(e,...t){var n,i,s;const{nodes:o,source:a,positions:l,path:c,originalError:u,extensions:d}=Qb(t);super(e),this.name="GraphQLError",this.path=c!=null?c:void 0,this.originalError=u!=null?u:void 0,this.nodes=Ju(Array.isArray(o)?o:o?[o]:void 0);const h=Ju((n=this.nodes)===null||n===void 0?void 0:n.map(m=>m.loc).filter(m=>m!=null));this.source=a!=null?a:h==null||(i=h[0])===null||i===void 0?void 0:i.source,this.positions=l!=null?l:h==null?void 0:h.map(m=>m.start),this.locations=l&&a?l.map(m=>Be(a,m)):h==null?void 0:h.map(m=>Be(m.source,m.start));const f=qe(u==null?void 0:u.extensions)?u==null?void 0:u.extensions:void 0;this.extensions=(s=d!=null?d:f)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),u!=null&&u.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Qo):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+=` `+bn(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+=` `+Du(this.source,t);return e}toJSON(){const 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 Ju(r){return r===void 0||r.length===0?void 0:r}function Ce(r,e,t){return new Qo(`Syntax Error: ${t}`,{source:r,positions:[e]})}class $b{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Yu{constructor(e,t,n,i,s,o){this.kind=e,this.start=t,this.end=n,this.line=i,this.column=s,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const Hu={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},qb=new Set(Object.keys(Hu));function Bu(r){const e=r==null?void 0:r.kind;return typeof e=="string"&&qb.has(e)}var Vr;(function(r){r.QUERY="query",r.MUTATION="mutation",r.SUBSCRIPTION="subscription"})(Vr||(Vr={}));var $o;(function(r){r.QUERY="QUERY",r.MUTATION="MUTATION",r.SUBSCRIPTION="SUBSCRIPTION",r.FIELD="FIELD",r.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",r.FRAGMENT_SPREAD="FRAGMENT_SPREAD",r.INLINE_FRAGMENT="INLINE_FRAGMENT",r.VARIABLE_DEFINITION="VARIABLE_DEFINITION",r.SCHEMA="SCHEMA",r.SCALAR="SCALAR",r.OBJECT="OBJECT",r.FIELD_DEFINITION="FIELD_DEFINITION",r.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",r.INTERFACE="INTERFACE",r.UNION="UNION",r.ENUM="ENUM",r.ENUM_VALUE="ENUM_VALUE",r.INPUT_OBJECT="INPUT_OBJECT",r.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})($o||($o={}));var F;(function(r){r.NAME="Name",r.DOCUMENT="Document",r.OPERATION_DEFINITION="OperationDefinition",r.VARIABLE_DEFINITION="VariableDefinition",r.SELECTION_SET="SelectionSet",r.FIELD="Field",r.ARGUMENT="Argument",r.FRAGMENT_SPREAD="FragmentSpread",r.INLINE_FRAGMENT="InlineFragment",r.FRAGMENT_DEFINITION="FragmentDefinition",r.VARIABLE="Variable",r.INT="IntValue",r.FLOAT="FloatValue",r.STRING="StringValue",r.BOOLEAN="BooleanValue",r.NULL="NullValue",r.ENUM="EnumValue",r.LIST="ListValue",r.OBJECT="ObjectValue",r.OBJECT_FIELD="ObjectField",r.DIRECTIVE="Directive",r.NAMED_TYPE="NamedType",r.LIST_TYPE="ListType",r.NON_NULL_TYPE="NonNullType",r.SCHEMA_DEFINITION="SchemaDefinition",r.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",r.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",r.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",r.FIELD_DEFINITION="FieldDefinition",r.INPUT_VALUE_DEFINITION="InputValueDefinition",r.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",r.UNION_TYPE_DEFINITION="UnionTypeDefinition",r.ENUM_TYPE_DEFINITION="EnumTypeDefinition",r.ENUM_VALUE_DEFINITION="EnumValueDefinition",r.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",r.DIRECTIVE_DEFINITION="DirectiveDefinition",r.SCHEMA_EXTENSION="SchemaExtension",r.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",r.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",r.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",r.UNION_TYPE_EXTENSION="UnionTypeExtension",r.ENUM_TYPE_EXTENSION="EnumTypeExtension",r.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(F||(F={}));function qo(r){return r===9||r===32}function vn(r){return r>=48&&r<=57}function Ku(r){return r>=97&&r<=122||r>=65&&r<=90}function zu(r){return Ku(r)||r===95}function ev(r){return Ku(r)||vn(r)||r===95}function tv(r){var e;let t=Number.MAX_SAFE_INTEGER,n=null,i=-1;for(let o=0;o<r.length;++o){var s;const a=r[o],l=rv(a);l!==a.length&&(n=(s=n)!==null&&s!==void 0?s:o,i=o,o!==0&&l<t&&(t=l))}return r.map((o,a)=>a===0?o:o.slice(t)).slice((e=n)!==null&&e!==void 0?e:0,i+1)}function rv(r){let e=0;for(;e<r.length&&qo(r.charCodeAt(e));)++e;return e}function nv(r,e){const t=r.replace(/"""/g,'\\"""'),n=t.split(/\r\n|[\n\r]/g),i=n.length===1,s=n.length>1&&n.slice(1).every(f=>f.length===0||qo(f.charCodeAt(0))),o=t.endsWith('\\"""'),a=r.endsWith('"')&&!o,l=r.endsWith("\\"),c=a||l,u=!i||r.length>70||c||s||o;let d="";const h=i&&qo(r.charCodeAt(0));return(u&&!h||s)&&(d+=` `),d+=t,(u||c)&&(d+=` `),'"""'+d+'"""'}var C;(function(r){r.SOF="<SOF>",r.EOF="<EOF>",r.BANG="!",r.DOLLAR="$",r.AMP="&",r.PAREN_L="(",r.PAREN_R=")",r.SPREAD="...",r.COLON=":",r.EQUALS="=",r.AT="@",r.BRACKET_L="[",r.BRACKET_R="]",r.BRACE_L="{",r.PIPE="|",r.BRACE_R="}",r.NAME="Name",r.INT="Int",r.FLOAT="Float",r.STRING="String",r.BLOCK_STRING="BlockString",r.COMMENT="Comment"})(C||(C={}));class iv{constructor(e){const t=new Yu(C.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!==C.EOF)do if(e.next)e=e.next;else{const t=ov(this,e.end);e.next=t,t.prev=e,e=t}while(e.kind===C.COMMENT);return e}}function sv(r){return r===C.BANG||r===C.DOLLAR||r===C.AMP||r===C.PAREN_L||r===C.PAREN_R||r===C.SPREAD||r===C.COLON||r===C.EQUALS||r===C.AT||r===C.BRACKET_L||r===C.BRACKET_R||r===C.BRACE_L||r===C.PIPE||r===C.BRACE_R}function Or(r){return r>=0&&r<=55295||r>=57344&&r<=1114111}function xi(r,e){return ju(r.charCodeAt(e))&&Qu(r.charCodeAt(e+1))}function ju(r){return r>=55296&&r<=56319}function Qu(r){return r>=56320&&r<=57343}function lr(r,e){const t=r.source.body.codePointAt(e);if(t===void 0)return C.EOF;if(t>=32&&t<=126){const n=String.fromCodePoint(t);return n==='"'?`'"'`:`"${n}"`}return"U+"+t.toString(16).toUpperCase().padStart(4,"0")}function Te(r,e,t,n,i){const s=r.line,o=1+t-r.lineStart;return new Yu(e,t,n,s,o,i)}function ov(r,e){const t=r.source.body,n=t.length;let i=e;for(;i<n;){const s=t.charCodeAt(i);switch(s){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++r.line,r.lineStart=i;continue;case 13:t.charCodeAt(i+1)===10?i+=2:++i,++r.line,r.lineStart=i;continue;case 35:return av(r,i);case 33:return Te(r,C.BANG,i,i+1);case 36:return Te(r,C.DOLLAR,i,i+1);case 38:return Te(r,C.AMP,i,i+1);case 40:return Te(r,C.PAREN_L,i,i+1);case 41:return Te(r,C.PAREN_R,i,i+1);case 46:if(t.charCodeAt(i+1)===46&&t.charCodeAt(i+2)===46)return Te(r,C.SPREAD,i,i+3);break;case 58:return Te(r,C.COLON,i,i+1);case 61:return Te(r,C.EQUALS,i,i+1);case 64:return Te(r,C.AT,i,i+1);case 91:return Te(r,C.BRACKET_L,i,i+1);case 93:return Te(r,C.BRACKET_R,i,i+1);case 123:return Te(r,C.BRACE_L,i,i+1);case 124:return Te(r,C.PIPE,i,i+1);case 125:return Te(r,C.BRACE_R,i,i+1);case 34:return t.charCodeAt(i+1)===34&&t.charCodeAt(i+2)===34?fv(r,i):cv(r,i)}if(vn(s)||s===45)return lv(r,i,s);if(zu(s))return pv(r,i);throw Ce(r.source,i,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Or(s)||xi(t,i)?`Unexpected character: ${lr(r,i)}.`:`Invalid character: ${lr(r,i)}.`)}return Te(r,C.EOF,n,n)}function av(r,e){const t=r.source.body,n=t.length;let i=e+1;for(;i<n;){const s=t.charCodeAt(i);if(s===10||s===13)break;if(Or(s))++i;else if(xi(t,i))i+=2;else break}return Te(r,C.COMMENT,e,i,t.slice(e+1,i))}function lv(r,e,t){const n=r.source.body;let i=e,s=t,o=!1;if(s===45&&(s=n.charCodeAt(++i)),s===48){if(s=n.charCodeAt(++i),vn(s))throw Ce(r.source,i,`Invalid number, unexpected digit after 0: ${lr(r,i)}.`)}else i=ea(r,i,s),s=n.charCodeAt(i);if(s===46&&(o=!0,s=n.charCodeAt(++i),i=ea(r,i,s),s=n.charCodeAt(i)),(s===69||s===101)&&(o=!0,s=n.charCodeAt(++i),(s===43||s===45)&&(s=n.charCodeAt(++i)),i=ea(r,i,s),s=n.charCodeAt(i)),s===46||zu(s))throw Ce(r.source,i,`Invalid number, expected digit but got: ${lr(r,i)}.`);return Te(r,o?C.FLOAT:C.INT,e,i,n.slice(e,i))}function ea(r,e,t){if(!vn(t))throw Ce(r.source,e,`Invalid number, expected digit but got: ${lr(r,e)}.`);const n=r.source.body;let i=e+1;for(;vn(n.charCodeAt(i));)++i;return i}function cv(r,e){const t=r.source.body,n=t.length;let i=e+1,s=i,o="";for(;i<n;){const a=t.charCodeAt(i);if(a===34)return o+=t.slice(s,i),Te(r,C.STRING,e,i+1,o);if(a===92){o+=t.slice(s,i);const l=t.charCodeAt(i+1)===117?t.charCodeAt(i+2)===123?uv(r,i):dv(r,i):hv(r,i);o+=l.value,i+=l.size,s=i;continue}if(a===10||a===13)break;if(Or(a))++i;else if(xi(t,i))i+=2;else throw Ce(r.source,i,`Invalid character within String: ${lr(r,i)}.`)}throw Ce(r.source,i,"Unterminated string.")}function uv(r,e){const t=r.source.body;let n=0,i=3;for(;i<12;){const s=t.charCodeAt(e+i++);if(s===125){if(i<5||!Or(n))break;return{value:String.fromCodePoint(n),size:i}}if(n=n<<4|Sn(s),n<0)break}throw Ce(r.source,e,`Invalid Unicode escape sequence: "${t.slice(e,e+i)}".`)}function dv(r,e){const t=r.source.body,n=$u(t,e+2);if(Or(n))return{value:String.fromCodePoint(n),size:6};if(ju(n)&&t.charCodeAt(e+6)===92&&t.charCodeAt(e+7)===117){const i=$u(t,e+8);if(Qu(i))return{value:String.fromCodePoint(n,i),size:12}}throw Ce(r.source,e,`Invalid Unicode escape sequence: "${t.slice(e,e+6)}".`)}function $u(r,e){return Sn(r.charCodeAt(e))<<12|Sn(r.charCodeAt(e+1))<<8|Sn(r.charCodeAt(e+2))<<4|Sn(r.charCodeAt(e+3))}function Sn(r){return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1}function hv(r,e){const t=r.source.body;switch(t.charCodeAt(e+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:` `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw Ce(r.source,e,`Invalid character escape sequence: "${t.slice(e,e+2)}".`)}function fv(r,e){const t=r.source.body,n=t.length;let i=r.lineStart,s=e+3,o=s,a="";const l=[];for(;s<n;){const c=t.charCodeAt(s);if(c===34&&t.charCodeAt(s+1)===34&&t.charCodeAt(s+2)===34){a+=t.slice(o,s),l.push(a);const u=Te(r,C.BLOCK_STRING,e,s+3,tv(l).join(` `));return r.line+=l.length-1,r.lineStart=i,u}if(c===92&&t.charCodeAt(s+1)===34&&t.charCodeAt(s+2)===34&&t.charCodeAt(s+3)===34){a+=t.slice(o,s),o=s+1,s+=4;continue}if(c===10||c===13){a+=t.slice(o,s),l.push(a),c===13&&t.charCodeAt(s+1)===10?s+=2:++s,a="",o=s,i=s;continue}if(Or(c))++s;else if(xi(t,s))s+=2;else throw Ce(r.source,s,`Invalid character within String: ${lr(r,s)}.`)}throw Ce(r.source,s,"Unterminated string.")}function pv(r,e){const t=r.source.body,n=t.length;let i=e+1;for(;i<n;){const s=t.charCodeAt(i);if(ev(s))++i;else break}return Te(r,C.NAME,e,i,t.slice(e,i))}const mv=10,qu=2;function ta(r){return Ni(r,[])}function Ni(r,e){switch(typeof r){case"string":return JSON.stringify(r);case"function":return r.name?`[function ${r.name}]`:"[function]";case"object":return gv(r,e);default:return String(r)}}function gv(r,e){if(r===null)return"null";if(e.includes(r))return"[Circular]";const t=[...e,r];if(yv(r)){const n=r.toJSON();if(n!==r)return typeof n=="string"?n:Ni(n,t)}else if(Array.isArray(r))return vv(r,t);return bv(r,t)}function yv(r){return typeof r.toJSON=="function"}function bv(r,e){const t=Object.entries(r);return t.length===0?"{}":e.length>qu?"["+Sv(r)+"]":"{ "+t.map(([i,s])=>i+": "+Ni(s,e)).join(", ")+" }"}function vv(r,e){if(r.length===0)return"[]";if(e.length>qu)return"[Array]";const t=Math.min(mv,r.length),n=r.length-t,i=[];for(let s=0;s<t;++s)i.push(Ni(r[s],e));return n===1?i.push("... 1 more item"):n>1&&i.push(`... ${n} more items`),"["+i.join(", ")+"]"}function Sv(r){const e=Object.prototype.toString.call(r).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof r.constructor=="function"){const t=r.constructor.name;if(typeof t=="string"&&t!=="")return t}return e}const wv=globalThis.process&&process.env.NODE_ENV==="production"?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if(typeof e=="object"&&e!==null){var n;const i=t.prototype[Symbol.toStringTag],s=Symbol.toStringTag in e?e[Symbol.toStringTag]:(n=e.constructor)===null||n===void 0?void 0:n.name;if(i===s){const o=ta(e);throw new Error(`Cannot use ${i} "${o}" from another module or realm. Ensure that there is only one instance of "graphql" in the node_modules directory. If different versions of "graphql" are the dependencies of other relied on modules, use "resolutions" to ensure only one version is installed. https://yarnpkg.com/en/docs/selective-version-resolutions Duplicate "graphql" modules cannot be used at the same time since different versions may have different capabilities and behavior. The data from one version used in the function from another could produce confusing and spurious results.`)}}return!1};class ed{constructor(e,t="GraphQL request",n={line:1,column:1}){typeof e=="string"||He(!1,`Body must be a string. Received: ${ta(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||He(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||He(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function _v(r){return wv(r,ed)}function td(r,e){const t=new Rv(r,e),n=t.parseDocument();return Object.defineProperty(n,"tokenCount",{enumerable:!1,value:t.tokenCount}),n}class Rv{constructor(e,t={}){const n=_v(e)?e:new ed(e);this._lexer=new iv(n),this._options=t,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(C.NAME);return this.node(e,{kind:F.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:F.DOCUMENT,definitions:this.many(C.SOF,this.parseDefinition,C.EOF)})}parseDefinition(){if(this.peek(C.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===C.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()}if(e)throw Ce(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(C.BRACE_L))return this.node(e,{kind:F.OPERATION_DEFINITION,operation:Vr.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(C.NAME)&&(n=this.parseName()),this.node(e,{kind:F.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(C.NAME);switch(e.value){case"query":return Vr.QUERY;case"mutation":return Vr.MUTATION;case"subscription":return Vr.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(C.PAREN_L,this.parseVariableDefinition,C.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:F.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(C.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(C.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(C.DOLLAR),this.node(e,{kind:F.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:F.SELECTION_SET,selections:this.many(C.BRACE_L,this.parseSelection,C.BRACE_R)})}parseSelection(){return this.peek(C.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,i;return this.expectOptionalToken(C.COLON)?(n=t,i=this.parseName()):i=t,this.node(e,{kind:F.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(C.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(C.PAREN_L,t,C.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(C.COLON),this.node(t,{kind:F.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(C.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(C.NAME)?this.node(e,{kind:F.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:F.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:F.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:F.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case C.BRACKET_L:return this.parseList(e);case C.BRACE_L:return this.parseObject(e);case C.INT:return this.advanceLexer(),this.node(t,{kind:F.INT,value:t.value});case C.FLOAT:return this.advanceLexer(),this.node(t,{kind:F.FLOAT,value:t.value});case C.STRING:case C.BLOCK_STRING:return this.parseStringLiteral();case C.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:F.BOOLEAN,value:!0});case"false":return this.node(t,{kind:F.BOOLEAN,value:!1});case"null":return this.node(t,{kind:F.NULL});default:return this.node(t,{kind:F.ENUM,value:t.value})}case C.DOLLAR:if(e)if(this.expectToken(C.DOLLAR),this._lexer.token.kind===C.NAME){const n=this._lexer.token.value;throw Ce(this._lexer.source,t.start,`Unexpected variable "$${n}" in constant value.`)}else throw this.unexpected(t);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:F.STRING,value:e.value,block:e.kind===C.BLOCK_STRING})}parseList(e){const t=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:F.LIST,values:this.any(C.BRACKET_L,t,C.BRACKET_R)})}parseObject(e){const t=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:F.OBJECT,fields:this.any(C.BRACE_L,t,C.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(C.COLON),this.node(t,{kind:F.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(C.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(C.AT),this.node(t,{kind:F.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(C.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(C.BRACKET_R),t=this.node(e,{kind:F.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(C.BANG)?this.node(e,{kind:F.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:F.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(C.STRING)||this.peek(C.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.many(C.BRACE_L,this.parseOperationTypeDefinition,C.BRACE_R);return this.node(e,{kind:F.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:i})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(C.COLON);const n=this.parseNamedType();return this.node(e,{kind:F.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:F.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:i})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:F.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(C.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(C.BRACE_L,this.parseFieldDefinition,C.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(C.COLON);const s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:F.FIELD_DEFINITION,description:t,name:n,arguments:i,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(C.PAREN_L,this.parseInputValueDef,C.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(C.COLON);const i=this.parseTypeReference();let s;this.expectOptionalToken(C.EQUALS)&&(s=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:F.INPUT_VALUE_DEFINITION,description:t,name:n,type:i,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:F.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:s,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(e,{kind:F.UNION_TYPE_DEFINITION,description:t,name:n,directives:i,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(C.EQUALS)?this.delimitedMany(C.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(e,{kind:F.ENUM_TYPE_DEFINITION,description:t,name:n,directives:i,values:s})}parseEnumValuesDefinition(){return this.optionalMany(C.BRACE_L,this.parseEnumValueDefinition,C.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:F.ENUM_VALUE_DEFINITION,description:t,name:n,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw Ce(this._lexer.source,this._lexer.token.start,`${Gi(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(e,{kind:F.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:i,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(C.BRACE_L,this.parseInputValueDef,C.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===C.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()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(C.BRACE_L,this.parseOperationTypeDefinition,C.BRACE_R);if(t.length===0&&n.length===0)throw this.unexpected();return this.node(e,{kind:F.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(n.length===0)throw this.unexpected();return this.node(e,{kind:F.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:F.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:s})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:F.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:s})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:F.UNION_TYPE_EXTENSION,name:t,directives:n,types:i})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:F.ENUM_TYPE_EXTENSION,name:t,directives:n,values:i})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:F.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:i})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(C.AT);const n=this.parseName(),i=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:F.DIRECTIVE_DEFINITION,description:t,name:n,arguments:i,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(C.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call($o,t.value))return t;throw this.unexpected(e)}node(e,t){return this._options.noLocation!==!0&&(t.loc=new $b(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw Ce(this._lexer.source,t.start,`Expected ${rd(e)}, found ${Gi(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){const t=this._lexer.token;if(t.kind===C.NAME&&t.value===e)this.advanceLexer();else throw Ce(this._lexer.source,t.start,`Expected "${e}", found ${Gi(t)}.`)}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===C.NAME&&t.value===e?(this.advanceLexer(),!0):!1}unexpected(e){const t=e!=null?e:this._lexer.token;return Ce(this._lexer.source,t.start,`Unexpected ${Gi(t)}.`)}any(e,t,n){this.expectToken(e);const i=[];for(;!this.expectOptionalToken(n);)i.push(t.call(this));return i}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const i=[];do i.push(t.call(this));while(!this.expectOptionalToken(n));return i}return[]}many(e,t,n){this.expectToken(e);const i=[];do i.push(t.call(this));while(!this.expectOptionalToken(n));return i}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do n.push(t.call(this));while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==C.EOF&&(++this._tokenCounter,e!==void 0&&this._tokenCounter>e))throw Ce(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function Gi(r){const e=r.value;return rd(r.kind)+(e!=null?` "${e}"`:"")}function rd(r){return sv(r)?`"${r}"`:r}function Tv(r){return`"${r.replace(Iv,Ev)}"`}const Iv=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Ev(r){return Cv[r.charCodeAt(0)]}const Cv=["\\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"],Zv=Object.freeze({});function Lv(r,e,t=Hu){const n=new Map;for(const y of Object.values(F))n.set(y,xv(e,y));let i,s=Array.isArray(r),o=[r],a=-1,l=[],c=r,u,d;const h=[],f=[];do{a++;const y=a===o.length,_=y&&l.length!==0;if(y){if(u=f.length===0?void 0:h[h.length-1],c=d,d=f.pop(),_)if(s){c=c.slice();let I=0;for(const[T,Z]of l){const G=T-I;Z===null?(c.splice(G,1),I++):c[G]=Z}}else{c=S({},c);for(const[I,T]of l)c[I]=T}a=i.index,o=i.keys,l=i.edits,s=i.inArray,i=i.prev}else if(d){if(u=s?a:o[a],c=d[u],c==null)continue;h.push(u)}let w;if(!Array.isArray(c)){var m,p;Bu(c)||He(!1,`Invalid AST Node: ${ta(c)}.`);const I=y?(m=n.get(c.kind))===null||m===void 0?void 0:m.leave:(p=n.get(c.kind))===null||p===void 0?void 0:p.enter;if(w=I==null?void 0:I.call(e,c,u,d,h,f),w===Zv)break;if(w===!1){if(!y){h.pop();continue}}else if(w!==void 0&&(l.push([u,w]),!y))if(Bu(w))c=w;else{h.pop();continue}}if(w===void 0&&_&&l.push([u,c]),y)h.pop();else{var g;i={inArray:s,index:a,keys:o,edits:l,prev:i},s=Array.isArray(c),o=s?c:(g=t[c.kind])!==null&&g!==void 0?g:[],a=-1,l=[],d&&f.push(d),d=c}}while(i!==void 0);return l.length!==0?l[l.length-1][1]:r}function xv(r,e){const t=r[e];return typeof t=="object"?t:typeof t=="function"?{enter:t,leave:void 0}:{enter:r.enter,leave:r.leave}}function ra(r){return Lv(r,Gv)}const Nv=80,Gv={Name:{leave:r=>r.value},Variable:{leave:r=>"$"+r.name},Document:{leave:r=>O(r.definitions,` `)},OperationDefinition:{leave(r){const e=ee("(",O(r.variableDefinitions,", "),")"),t=O([r.operation,O([r.name,e]),O(r.directives," ")]," ");return(t==="query"?"":t+" ")+r.selectionSet}},VariableDefinition:{leave:({variable:r,type:e,defaultValue:t,directives:n})=>r+": "+e+ee(" = ",t)+ee(" ",O(n," "))},SelectionSet:{leave:({selections:r})=>ft(r)},Field:{leave({alias:r,name:e,arguments:t,directives:n,selectionSet:i}){const s=ee("",r,": ")+e;let o=s+ee("(",O(t,", "),")");return o.length>Nv&&(o=s+ee(`( `,Vi(O(t,` `)),` )`)),O([o,O(n," "),i]," ")}},Argument:{leave:({name:r,value:e})=>r+": "+e},FragmentSpread:{leave:({name:r,directives:e})=>"..."+r+ee(" ",O(e," "))},InlineFragment:{leave:({typeCondition:r,directives:e,selectionSet:t})=>O(["...",ee("on ",r),O(e," "),t]," ")},FragmentDefinition:{leave:({name:r,typeCondition:e,variableDefinitions:t,directives:n,selectionSet:i})=>`fragment ${r}${ee("(",O(t,", "),")")} on ${e} ${ee("",O(n," ")," ")}`+i},IntValue:{leave:({value:r})=>r},FloatValue:{leave:({value:r})=>r},StringValue:{leave:({value:r,block:e})=>e?nv(r):Tv(r)},BooleanValue:{leave:({value:r})=>r?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:r})=>r},ListValue:{leave:({values:r})=>"["+O(r,", ")+"]"},ObjectValue:{leave:({fields:r})=>"{"+O(r,", ")+"}"},ObjectField:{leave:({name:r,value:e})=>r+": "+e},Directive:{leave:({name:r,arguments:e})=>"@"+r+ee("(",O(e,", "),")")},NamedType:{leave:({name:r})=>r},ListType:{leave:({type:r})=>"["+r+"]"},NonNullType:{leave:({type:r})=>r+"!"},SchemaDefinition:{leave:({description:r,directives:e,operationTypes:t})=>ee("",r,` `)+O(["schema",O(e," "),ft(t)]," ")},OperationTypeDefinition:{leave:({operation:r,type:e})=>r+": "+e},ScalarTypeDefinition:{leave:({description:r,name:e,directives:t})=>ee("",r,` `)+O(["scalar",e,O(t," ")]," ")},ObjectTypeDefinition:{leave:({description:r,name:e,interfaces:t,directives:n,fields:i})=>ee("",r,` `)+O(["type",e,ee("implements ",O(t," & ")),O(n," "),ft(i)]," ")},FieldDefinition:{leave:({description:r,name:e,arguments:t,type:n,directives:i})=>ee("",r,` `)+e+(nd(t)?ee(`( `,Vi(O(t,` `)),` )`):ee("(",O(t,", "),")"))+": "+n+ee(" ",O(i," "))},InputValueDefinition:{leave:({description:r,name:e,type:t,defaultValue:n,directives:i})=>ee("",r,` `)+O([e+": "+t,ee("= ",n),O(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:r,name:e,interfaces:t,directives:n,fields:i})=>ee("",r,` `)+O(["interface",e,ee("implements ",O(t," & ")),O(n," "),ft(i)]," ")},UnionTypeDefinition:{leave:({description:r,name:e,directives:t,types:n})=>ee("",r,` `)+O(["union",e,O(t," "),ee("= ",O(n," | "))]," ")},EnumTypeDefinition:{leave:({description:r,name:e,directives:t,values:n})=>ee("",r,` `)+O(["enum",e,O(t," "),ft(n)]," ")},EnumValueDefinition:{leave:({description:r,name:e,directives:t})=>ee("",r,` `)+O([e,O(t," ")]," ")},InputObjectTypeDefinition:{leave:({description:r,name:e,directives:t,fields:n})=>ee("",r,` `)+O(["input",e,O(t," "),ft(n)]," ")},DirectiveDefinition:{leave:({description:r,name:e,arguments:t,repeatable:n,locations:i})=>ee("",r,` `)+"directive @"+e+(nd(t)?ee(`( `,Vi(O(t,` `)),` )`):ee("(",O(t,", "),")"))+(n?" repeatable":"")+" on "+O(i," | ")},SchemaExtension:{leave:({directives:r,operationTypes:e})=>O(["extend schema",O(r," "),ft(e)]," ")},ScalarTypeExtension:{leave:({name:r,directives:e})=>O(["extend scalar",r,O(e," ")]," ")},ObjectTypeExtension:{leave:({name:r,interfaces:e,directives:t,fields:n})=>O(["extend type",r,ee("implements ",O(e," & ")),O(t," "),ft(n)]," ")},InterfaceTypeExtension:{leave:({name:r,interfaces:e,directives:t,fields:n})=>O(["extend interface",r,ee("implements ",O(e," & ")),O(t," "),ft(n)]," ")},UnionTypeExtension:{leave:({name:r,directives:e,types:t})=>O(["extend union",r,O(e," "),ee("= ",O(t," | "))]," ")},EnumTypeExtension:{leave:({name:r,directives:e,values:t})=>O(["extend enum",r,O(e," "),ft(t)]," ")},InputObjectTypeExtension:{leave:({name:r,directives:e,fields:t})=>O(["extend input",r,O(e," "),ft(t)]," ")}};function O(r,e=""){var t;return(t=r==null?void 0:r.filter(n=>n).join(e))!==null&&t!==void 0?t:""}function ft(r){return ee(`{ `,Vi(O(r,` `)),` }`)}function ee(r,e,t=""){return e!=null&&e!==""?r+e+t:""}function Vi(r){return ee(" ",r.replace(/\n/g,` `))}function nd(r){var e;return(e=r==null?void 0:r.some(t=>t.includes(` `)))!==null&&e!==void 0?e:!1}const na=JSON,Vv=r=>r.toUpperCase(),Ov=r=>{const e={};return r.forEach((t,n)=>{e[n]=t}),e},Xv=(r,e,t)=>r.document?r:{document:r,variables:e,requestHeaders:t,signal:void 0},kv=(r,e,t)=>r.query?r:{query:r,variables:e,requestHeaders:t,signal:void 0},Wv=(r,e)=>r.documents?r:{documents:r,requestHeaders:e,signal:void 0},id=r=>{var n,i;let e;const t=r.definitions.filter(s=>s.kind==="OperationDefinition");return t.length===1&&(e=(i=(n=t[0])==null?void 0:n.name)==null?void 0:i.value),e},ia=r=>{if(typeof r=="string"){let t;try{const n=td(r);t=id(n)}catch(n){}return{query:r,operationName:t}}const e=id(r);return{query:ra(r),operationName:e}};class Xr extends Error{constructor(e,t){const n=`${Xr.extractMessage(e)}: ${JSON.stringify({response:e,request:t})}`;super(n),Object.setPrototypeOf(this,Xr.prototype),this.response=e,this.request=t,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Xr)}static extractMessage(e){var t,n,i;return(i=(n=(t=e.errors)==null?void 0:t[0])==null?void 0:n.message)!=null?i:`GraphQL Error (Code: ${e.status})`}}var sa=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Oi(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var oa={exports:{}};(function(r,e){var t=typeof self!="undefined"?self:sa,n=function(){function s(){this.fetch=!1,this.DOMException=t.DOMException}return s.prototype=t,new s}();(function(s){(function(o){var a={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch(v){return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function l(v){return v&&DataView.prototype.isPrototypeOf(v)}if(a.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(v){return v&&c.indexOf(Object.prototype.toString.call(v))>-1};function d(v){if(typeof v!="string"&&(v=String(v)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(v))throw new TypeError("Invalid character in header field name");return v.toLowerCase()}function h(v){return typeof v!="string"&&(v=String(v)),v}function f(v){var R={next:function(){var V=v.shift();return{done:V===void 0,value:V}}};return a.iterable&&(R[Symbol.iterator]=function(){return R}),R}function m(v){this.map={},v instanceof m?v.forEach(function(R,V){this.append(V,R)},this):Array.isArray(v)?v.forEach(function(R){this.append(R[0],R[1])},this):v&&Object.getOwnPropertyNames(v).forEach(function(R){this.append(R,v[R])},this)}m.prototype.append=function(v,R){v=d(v),R=h(R);var V=this.map[v];this.map[v]=V?V+", "+R:R},m.prototype.delete=function(v){delete this.map[d(v)]},m.prototype.get=function(v){return v=d(v),this.has(v)?this.map[v]:null},m.prototype.has=function(v){return this.map.hasOwnProperty(d(v))},m.prototype.set=function(v,R){this.map[d(v)]=h(R)},m.prototype.forEach=function(v,R){for(var V in this.map)this.map.hasOwnProperty(V)&&v.call(R,this.map[V],V,this)},m.prototype.keys=function(){var v=[];return this.forEach(function(R,V){v.push(V)}),f(v)},m.prototype.values=function(){var v=[];return this.forEach(function(R){v.push(R)}),f(v)},m.prototype.entries=function(){var v=[];return this.forEach(function(R,V){v.push([V,R])}),f(v)},a.iterable&&(m.prototype[Symbol.iterator]=m.prototype.entries);function p(v){if(v.bodyUsed)return Promise.reject(new TypeError("Already read"));v.bodyUsed=!0}function g(v){return new Promise(function(R,V){v.onload=function(){R(v.result)},v.onerror=function(){V(v.error)}})}function y(v){var R=new FileReader,V=g(R);return R.readAsArrayBuffer(v),V}function _(v){var R=new FileReader,V=g(R);return R.readAsText(v),V}function w(v){for(var R=new Uint8Array(v),V=new Array(R.length),U=0;U<R.length;U++)V[U]=String.fromCharCode(R[U]);return V.join("")}function I(v){if(v.slice)return v.slice(0);var R=new Uint8Array(v.byteLength);return R.set(new Uint8Array(v)),R.buffer}function T(){return this.bodyUsed=!1,this._initBody=function(v){this._bodyInit=v,v?typeof v=="string"?this._bodyText=v:a.blob&&Blob.prototype.isPrototypeOf(v)?this._bodyBlob=v:a.formData&&FormData.prototype.isPrototypeOf(v)?this._bodyFormData=v:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(v)?this._bodyText=v.toString():a.arrayBuffer&&a.blob&&l(v)?(this._bodyArrayBuffer=I(v.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(v)||u(v))?this._bodyArrayBuffer=I(v):this._bodyText=v=Object.prototype.toString.call(v):this._bodyText="",this.headers.get("content-type")||(typeof v=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(v)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var v=p(this);if(v)return v;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var v=p(this);if(v)return v;if(this._bodyBlob)return _(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(w(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(E)}),this.json=function(){return this.text().then(JSON.parse)},this}var Z=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function G(v){var R=v.toUpperCase();return Z.indexOf(R)>-1?R:v}function L(v,R){R=R||{};var V=R.body;if(v instanceof L){if(v.bodyUsed)throw new TypeError("Already read");this.url=v.url,this.credentials=v.credentials,R.headers||(this.headers=new m(v.headers)),this.method=v.method,this.mode=v.mode,this.signal=v.signal,!V&&v._bodyInit!=null&&(V=v._bodyInit,v.bodyUsed=!0)}else this.url=String(v);if(this.credentials=R.credentials||this.credentials||"same-origin",(R.headers||!this.headers)&&(this.headers=new m(R.headers)),this.method=G(R.method||this.method||"GET"),this.mode=R.mode||this.mode||null,this.signal=R.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&V)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(V)}L.prototype.clone=function(){return new L(this,{body:this._bodyInit})};function E(v){var R=new FormData;return v.trim().split("&").forEach(function(V){if(V){var U=V.split("="),D=U.shift().replace(/\+/g," "),P=U.join("=").replace(/\+/g," ");R.append(decodeURIComponent(D),decodeURIComponent(P))}}),R}function N(v){var R=new m,V=v.replace(/\r?\n[\t ]+/g," ");return V.split(/\r?\n/).forEach(function(U){var D=U.split(":"),P=D.shift().trim();if(P){var J=D.join(":").trim();R.append(P,J)}}),R}T.call(L.prototype);function X(v,R){R||(R={}),this.type="default",this.status=R.status===void 0?200:R.status,this.ok=this.status>=200&&this.status<300,this.stat