@geins/core 0.5.0 â 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-client/endpointClient.d.ts +3 -2
- package/dist/api-client/managementApiClient.d.ts +2 -1
- package/dist/api-client/merchantApiClient.d.ts +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/logic/channel.d.ts +0 -2
- package/dist/services/cookieService.d.ts +6 -0
- package/dist/services/graphQLService.d.ts +2 -2
- package/dist/utils/jwtUtils.d.ts +5 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("cookie-universal"),t=require("broadcast-channel"),n=require("crypto"),r=require("@cacheable/node-cache"),i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var s=function(){return s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},s.apply(this,arguments)};function a(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function c(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}function u(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function l(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var f="Invariant Violation",h=Object.setPrototypeOf,p=void 0===h?function(e,t){return e.__proto__=t,e}:h,d=function(e){function t(n){void 0===n&&(n=f);var r=e.call(this,"number"==typeof n?f+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=f,p(r,t.prototype),r}return o(t,e),t}(Error);function v(e,t){if(!e)throw new d(t)}var y=["debug","log","warn","error","silent"],m=y.indexOf("log");function g(e){return function(){if(y.indexOf(e)>=m)return(console[e]||console.log).apply(console,arguments)}}!function(e){e.debug=g("debug"),e.log=g("log"),e.warn=g("warn"),e.error=g("error")}(v);var b="3.11.8";function E(e){try{return e()}catch(e){}}var S=E((function(){return globalThis}))||E((function(){return window}))||E((function(){return self}))||E((function(){return global}))||E((function(){return E.constructor("return this")()})),T=new Map;function k(e){var t=T.get(e)||1;return T.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function w(e,t){void 0===t&&(t=0);var n=k("stringifyForDisplay");return JSON.stringify(e,(function(e,t){return void 0===t?n:t}),t).split(JSON.stringify(n)).join("<undefined>")}function _(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if("number"==typeof t){var i=t;(t=I(i))||(t=A(i,n),n=[])}e.apply(void 0,[t].concat(n))}}var O=Object.assign((function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];e||v(e,I(t,n)||A(t,n))}),{debug:_(v.debug),log:_(v.log),warn:_(v.warn),error:_(v.error)});function x(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return new d(I(e,t)||A(e,t))}var N=Symbol.for("ApolloErrorMessageHandler_"+b);function D(e){if("string"==typeof e)return e;try{return w(e,2).slice(0,1e3)}catch(e){return"<non-serializable>"}}function I(e,t){if(void 0===t&&(t=[]),e)return S[N]&&S[N](e,t.map(D))}function A(e,t){if(void 0===t&&(t=[]),e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:b,message:e,args:t.map(D)})))}function C(e,t){if(!Boolean(e))throw new Error(t)}function R(e,t){if(!Boolean(e))throw new Error("Unexpected invariant triggered.")}const F=/\r\n|[\n\r]/g;function L(e,t){let n=0,r=1;for(const i of e.body.matchAll(F)){if("number"==typeof i.index||R(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function P(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,s=t.line+o,a=1===t.line?n:0,c=t.column+a,u=`${e.name}:${s}:${c}\n`,l=r.split(/\r\n|[\n\r]/g),f=l[i];if(f.length>120){const e=Math.floor(c/80),t=c%80,n=[];for(let e=0;e<f.length;e+=80)n.push(f.slice(e,e+80));return u+M([[`${s} |`,n[0]],...n.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return u+M([[s-1+" |",l[i-1]],[`${s} |`,f],["|","^".padStart(c)],[`${s+1} |`,l[i+1]]])}function M(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}class j extends Error{constructor(e,...t){var n,r,i;const{nodes:o,source:s,positions:a,path:c,originalError:u,extensions:l}=function(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=c?c:void 0,this.originalError=null!=u?u:void 0,this.nodes=q(Array.isArray(o)?o:o?[o]:void 0);const f=q(null===(n=this.nodes)||void 0===n?void 0:n.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=s?s:null==f||null===(r=f[0])||void 0===r?void 0:r.source,this.positions=null!=a?a:null==f?void 0:f.map((e=>e.start)),this.locations=a&&s?a.map((e=>L(s,e))):null==f?void 0:f.map((e=>L(e.source,e.start)));const h="object"==typeof(p=null==u?void 0:u.extensions)&&null!==p?null==u?void 0:u.extensions:void 0;var p;this.extensions=null!==(i=null!=l?l:h)&&void 0!==i?i:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=u&&u.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,j):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 n of this.nodes)n.loc&&(e+="\n\n"+P((t=n.loc).source,L(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+P(this.source,t);var t;return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function q(e){return void 0===e||0===e.length?void 0:e}function V(e,t,n){return new j(`Syntax Error: ${n}`,{source:e,positions:[t]})}class U{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 Q{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const B={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"]},K=new Set(Object.keys(B));function G(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&K.has(t)}var z,W,Y,H;function J(e){return 9===e||32===e}function $(e){return e>=48&&e<=57}function X(e){return e>=97&&e<=122||e>=65&&e<=90}function Z(e){return X(e)||95===e}function ee(e){return X(e)||$(e)||95===e}function te(e){var t;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let t=0;t<e.length;++t){var o;const s=e[t],a=ne(s);a!==s.length&&(r=null!==(o=r)&&void 0!==o?o:t,i=t,0!==t&&a<n&&(n=a))}return e.map(((e,t)=>0===t?e:e.slice(n))).slice(null!==(t=r)&&void 0!==t?t:0,i+1)}function ne(e){let t=0;for(;t<e.length&&J(e.charCodeAt(t));)++t;return t}!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(z||(z={})),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"}(W||(W={})),function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(Y||(Y={})),function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(H||(H={}));class re{constructor(e){const t=new Q(H.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(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==H.EOF)do{if(e.next)e=e.next;else{const t=le(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===H.COMMENT);return e}}function ie(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function oe(e,t){return se(e.charCodeAt(t))&&ae(e.charCodeAt(t+1))}function se(e){return e>=55296&&e<=56319}function ae(e){return e>=56320&&e<=57343}function ce(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return H.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function ue(e,t,n,r,i){const o=e.line,s=1+n-e.lineStart;return new Q(t,n,r,o,s,i)}function le(e,t){const n=e.source.body,r=n.length;let i=t;for(;i<r;){const 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:10===n.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return fe(e,i);case 33:return ue(e,H.BANG,i,i+1);case 36:return ue(e,H.DOLLAR,i,i+1);case 38:return ue(e,H.AMP,i,i+1);case 40:return ue(e,H.PAREN_L,i,i+1);case 41:return ue(e,H.PAREN_R,i,i+1);case 46:if(46===n.charCodeAt(i+1)&&46===n.charCodeAt(i+2))return ue(e,H.SPREAD,i,i+3);break;case 58:return ue(e,H.COLON,i,i+1);case 61:return ue(e,H.EQUALS,i,i+1);case 64:return ue(e,H.AT,i,i+1);case 91:return ue(e,H.BRACKET_L,i,i+1);case 93:return ue(e,H.BRACKET_R,i,i+1);case 123:return ue(e,H.BRACE_L,i,i+1);case 124:return ue(e,H.PIPE,i,i+1);case 125:return ue(e,H.BRACE_R,i,i+1);case 34:return 34===n.charCodeAt(i+1)&&34===n.charCodeAt(i+2)?Ee(e,i):de(e,i)}if($(t)||45===t)return he(e,i,t);if(Z(t))return Se(e,i);throw V(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":ie(t)||oe(n,i)?`Unexpected character: ${ce(e,i)}.`:`Invalid character: ${ce(e,i)}.`)}return ue(e,H.EOF,r,r)}function fe(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){const e=n.charCodeAt(i);if(10===e||13===e)break;if(ie(e))++i;else{if(!oe(n,i))break;i+=2}}return ue(e,H.COMMENT,t,i,n.slice(t+1,i))}function he(e,t,n){const r=e.source.body;let i=t,o=n,s=!1;if(45===o&&(o=r.charCodeAt(++i)),48===o){if(o=r.charCodeAt(++i),$(o))throw V(e.source,i,`Invalid number, unexpected digit after 0: ${ce(e,i)}.`)}else i=pe(e,i,o),o=r.charCodeAt(i);if(46===o&&(s=!0,o=r.charCodeAt(++i),i=pe(e,i,o),o=r.charCodeAt(i)),69!==o&&101!==o||(s=!0,o=r.charCodeAt(++i),43!==o&&45!==o||(o=r.charCodeAt(++i)),i=pe(e,i,o),o=r.charCodeAt(i)),46===o||Z(o))throw V(e.source,i,`Invalid number, expected digit but got: ${ce(e,i)}.`);return ue(e,s?H.FLOAT:H.INT,t,i,r.slice(t,i))}function pe(e,t,n){if(!$(n))throw V(e.source,t,`Invalid number, expected digit but got: ${ce(e,t)}.`);const r=e.source.body;let i=t+1;for(;$(r.charCodeAt(i));)++i;return i}function de(e,t){const n=e.source.body,r=n.length;let i=t+1,o=i,s="";for(;i<r;){const r=n.charCodeAt(i);if(34===r)return s+=n.slice(o,i),ue(e,H.STRING,t,i+1,s);if(92!==r){if(10===r||13===r)break;if(ie(r))++i;else{if(!oe(n,i))throw V(e.source,i,`Invalid character within String: ${ce(e,i)}.`);i+=2}}else{s+=n.slice(o,i);const t=117===n.charCodeAt(i+1)?123===n.charCodeAt(i+2)?ve(e,i):ye(e,i):be(e,i);s+=t.value,i+=t.size,o=i}}throw V(e.source,i,"Unterminated string.")}function ve(e,t){const n=e.source.body;let r=0,i=3;for(;i<12;){const e=n.charCodeAt(t+i++);if(125===e){if(i<5||!ie(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|ge(e),r<0)break}throw V(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function ye(e,t){const n=e.source.body,r=me(n,t+2);if(ie(r))return{value:String.fromCodePoint(r),size:6};if(se(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=me(n,t+8);if(ae(e))return{value:String.fromCodePoint(r,e),size:12}}throw V(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function me(e,t){return ge(e.charCodeAt(t))<<12|ge(e.charCodeAt(t+1))<<8|ge(e.charCodeAt(t+2))<<4|ge(e.charCodeAt(t+3))}function ge(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function be(e,t){const 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:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw V(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Ee(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,o=t+3,s=o,a="";const c=[];for(;o<r;){const r=n.charCodeAt(o);if(34===r&&34===n.charCodeAt(o+1)&&34===n.charCodeAt(o+2)){a+=n.slice(s,o),c.push(a);const r=ue(e,H.BLOCK_STRING,t,o+3,te(c).join("\n"));return e.line+=c.length-1,e.lineStart=i,r}if(92!==r||34!==n.charCodeAt(o+1)||34!==n.charCodeAt(o+2)||34!==n.charCodeAt(o+3))if(10!==r&&13!==r)if(ie(r))++o;else{if(!oe(n,o))throw V(e.source,o,`Invalid character within String: ${ce(e,o)}.`);o+=2}else a+=n.slice(s,o),c.push(a),13===r&&10===n.charCodeAt(o+1)?o+=2:++o,a="",s=o,i=o;else a+=n.slice(s,o),s=o+1,o+=4}throw V(e.source,o,"Unterminated string.")}function Se(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){if(!ee(n.charCodeAt(i)))break;++i}return ue(e,H.NAME,t,i,n.slice(t,i))}function Te(e){return ke(e,[])}function ke(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:ke(t,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const n=Math.min(10,e.length),r=e.length-n,i=[];for(let r=0;r<n;++r)i.push(ke(e[r],t));1===r?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>2)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map((([e,n])=>e+": "+ke(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const we=globalThis.process&&"production"===process.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var n;const r=t.prototype[Symbol.toStringTag];if(r===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null===(n=e.constructor)||void 0===n?void 0:n.name)){const t=Te(e);throw new Error(`Cannot use ${r} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class _e{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||C(!1,`Body must be a string. Received: ${Te(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||C(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||C(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}class Oe{constructor(e,t={}){const n=function(e){return we(e,_e)}(e)?e:new _e(e);this._lexer=new re(n),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(H.NAME);return this.node(e,{kind:Y.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:Y.DOCUMENT,definitions:this.many(H.SOF,this.parseDefinition,H.EOF)})}parseDefinition(){if(this.peek(H.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===H.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 V(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(H.BRACE_L))return this.node(e,{kind:Y.OPERATION_DEFINITION,operation:z.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(H.NAME)&&(n=this.parseName()),this.node(e,{kind:Y.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(H.NAME);switch(e.value){case"query":return z.QUERY;case"mutation":return z.MUTATION;case"subscription":return z.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(H.PAREN_L,this.parseVariableDefinition,H.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Y.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(H.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(H.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(H.DOLLAR),this.node(e,{kind:Y.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Y.SELECTION_SET,selections:this.many(H.BRACE_L,this.parseSelection,H.BRACE_R)})}parseSelection(){return this.peek(H.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(H.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:Y.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(H.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(H.PAREN_L,t,H.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(H.COLON),this.node(t,{kind:Y.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(H.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(H.NAME)?this.node(e,{kind:Y.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:Y.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"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:Y.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:Y.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case H.BRACKET_L:return this.parseList(e);case H.BRACE_L:return this.parseObject(e);case H.INT:return this.advanceLexer(),this.node(t,{kind:Y.INT,value:t.value});case H.FLOAT:return this.advanceLexer(),this.node(t,{kind:Y.FLOAT,value:t.value});case H.STRING:case H.BLOCK_STRING:return this.parseStringLiteral();case H.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:Y.BOOLEAN,value:!0});case"false":return this.node(t,{kind:Y.BOOLEAN,value:!1});case"null":return this.node(t,{kind:Y.NULL});default:return this.node(t,{kind:Y.ENUM,value:t.value})}case H.DOLLAR:if(e){if(this.expectToken(H.DOLLAR),this._lexer.token.kind===H.NAME){const e=this._lexer.token.value;throw V(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(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:Y.STRING,value:e.value,block:e.kind===H.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:Y.LIST,values:this.any(H.BRACKET_L,(()=>this.parseValueLiteral(e)),H.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:Y.OBJECT,fields:this.any(H.BRACE_L,(()=>this.parseObjectField(e)),H.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(H.COLON),this.node(t,{kind:Y.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(H.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(H.AT),this.node(t,{kind:Y.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(H.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(H.BRACKET_R),t=this.node(e,{kind:Y.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(H.BANG)?this.node(e,{kind:Y.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:Y.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(H.STRING)||this.peek(H.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(),r=this.many(H.BRACE_L,this.parseOperationTypeDefinition,H.BRACE_R);return this.node(e,{kind:Y.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(H.COLON);const n=this.parseNamedType();return this.node(e,{kind:Y.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:Y.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:Y.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(H.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(H.BRACE_L,this.parseFieldDefinition,H.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(H.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:Y.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(H.PAREN_L,this.parseInputValueDef,H.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(H.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(H.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:Y.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:Y.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:Y.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(H.EQUALS)?this.delimitedMany(H.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:Y.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(H.BRACE_L,this.parseEnumValueDefinition,H.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:Y.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw V(this._lexer.source,this._lexer.token.start,`${xe(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(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:Y.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(H.BRACE_L,this.parseInputValueDef,H.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===H.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(H.BRACE_L,this.parseOperationTypeDefinition,H.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:Y.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(0===n.length)throw this.unexpected();return this.node(e,{kind:Y.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(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:Y.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:Y.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:Y.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:Y.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:Y.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(H.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:Y.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(H.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(W,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new U(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 V(this._lexer.source,t.start,`Expected ${Ne(e)}, found ${xe(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==H.NAME||t.value!==e)throw V(this._lexer.source,t.start,`Expected "${e}", found ${xe(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===H.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return V(this._lexer.source,t.start,`Unexpected ${xe(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}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(void 0!==e&&t.kind!==H.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw V(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function xe(e){const t=e.value;return Ne(e.kind)+(null!=t?` "${t}"`:"")}function Ne(e){return function(e){return e===H.BANG||e===H.DOLLAR||e===H.AMP||e===H.PAREN_L||e===H.PAREN_R||e===H.SPREAD||e===H.COLON||e===H.EQUALS||e===H.AT||e===H.BRACKET_L||e===H.BRACKET_R||e===H.BRACE_L||e===H.PIPE||e===H.BRACE_R}(e)?`"${e}"`:e}const De=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Ie(e){return Ae[e.charCodeAt(0)]}const Ae=["\\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"],Ce=Object.freeze({});function Re(e,t,n=B){const r=new Map;for(const e of Object.values(Y))r.set(e,Fe(t,e));let i,o,s,a=Array.isArray(e),c=[e],u=-1,l=[],f=e;const h=[],p=[];do{u++;const e=u===c.length,m=e&&0!==l.length;if(e){if(o=0===p.length?void 0:h[h.length-1],f=s,s=p.pop(),m)if(a){f=f.slice();let e=0;for(const[t,n]of l){const r=t-e;null===n?(f.splice(r,1),e++):f[r]=n}}else{f=Object.defineProperties({},Object.getOwnPropertyDescriptors(f));for(const[e,t]of l)f[e]=t}u=i.index,c=i.keys,l=i.edits,a=i.inArray,i=i.prev}else if(s){if(o=a?u:c[u],f=s[o],null==f)continue;h.push(o)}let g;if(!Array.isArray(f)){var d,v;G(f)||C(!1,`Invalid AST Node: ${Te(f)}.`);const n=e?null===(d=r.get(f.kind))||void 0===d?void 0:d.leave:null===(v=r.get(f.kind))||void 0===v?void 0:v.enter;if(g=null==n?void 0:n.call(t,f,o,s,h,p),g===Ce)break;if(!1===g){if(!e){h.pop();continue}}else if(void 0!==g&&(l.push([o,g]),!e)){if(!G(g)){h.pop();continue}f=g}}var y;if(void 0===g&&m&&l.push([o,f]),e)h.pop();else i={inArray:a,index:u,keys:c,edits:l,prev:i},a=Array.isArray(f),c=a?f:null!==(y=n[f.kind])&&void 0!==y?y:[],u=-1,l=[],s&&p.push(s),s=f}while(void 0!==i);return 0!==l.length?l[l.length-1][1]:e}function Fe(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}const Le={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>Pe(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=je("(",Pe(e.variableDefinitions,", "),")"),n=Pe([e.operation,Pe([e.name,t]),Pe(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+je(" = ",n)+je(" ",Pe(r," "))},SelectionSet:{leave:({selections:e})=>Me(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=je("",e,": ")+t;let s=o+je("(",Pe(n,", "),")");return s.length>80&&(s=o+je("(\n",qe(Pe(n,"\n")),"\n)")),Pe([s,Pe(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+je(" ",Pe(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>Pe(["...",je("on ",e),Pe(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${je("(",Pe(n,", "),")")} on ${t} ${je("",Pe(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?function(e){const t=e.replace(/"""/g,'\\"""'),n=t.split(/\r\n|[\n\r]/g),r=1===n.length,i=n.length>1&&n.slice(1).every((e=>0===e.length||J(e.charCodeAt(0)))),o=t.endsWith('\\"""'),s=e.endsWith('"')&&!o,a=e.endsWith("\\"),c=s||a,u=!r||e.length>70||c||i||o;let l="";const f=r&&J(e.charCodeAt(0));return(u&&!f||i)&&(l+="\n"),l+=t,(u||c)&&(l+="\n"),'"""'+l+'"""'}(e):`"${e.replace(De,Ie)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+Pe(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+Pe(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+je("(",Pe(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>je("",e,"\n")+Pe(["schema",Pe(t," "),Me(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>je("",e,"\n")+Pe(["scalar",t,Pe(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>je("",e,"\n")+Pe(["type",t,je("implements ",Pe(n," & ")),Pe(r," "),Me(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>je("",e,"\n")+t+(Ve(n)?je("(\n",qe(Pe(n,"\n")),"\n)"):je("(",Pe(n,", "),")"))+": "+r+je(" ",Pe(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>je("",e,"\n")+Pe([t+": "+n,je("= ",r),Pe(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>je("",e,"\n")+Pe(["interface",t,je("implements ",Pe(n," & ")),Pe(r," "),Me(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>je("",e,"\n")+Pe(["union",t,Pe(n," "),je("= ",Pe(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>je("",e,"\n")+Pe(["enum",t,Pe(n," "),Me(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>je("",e,"\n")+Pe([t,Pe(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>je("",e,"\n")+Pe(["input",t,Pe(n," "),Me(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>je("",e,"\n")+"directive @"+t+(Ve(n)?je("(\n",qe(Pe(n,"\n")),"\n)"):je("(",Pe(n,", "),")"))+(r?" repeatable":"")+" on "+Pe(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>Pe(["extend schema",Pe(e," "),Me(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>Pe(["extend scalar",e,Pe(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Pe(["extend type",e,je("implements ",Pe(t," & ")),Pe(n," "),Me(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Pe(["extend interface",e,je("implements ",Pe(t," & ")),Pe(n," "),Me(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>Pe(["extend union",e,Pe(t," "),je("= ",Pe(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>Pe(["extend enum",e,Pe(t," "),Me(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>Pe(["extend input",e,Pe(t," "),Me(n)]," ")}};function Pe(e,t=""){var n;return null!==(n=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==n?n:""}function Me(e){return je("{\n",qe(Pe(e,"\n")),"\n}")}function je(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function qe(e){return je(" ",e.replace(/\n/g,"\n "))}function Ve(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}function Ue(e){return e.kind===Y.FIELD||e.kind===Y.FRAGMENT_SPREAD||e.kind===Y.INLINE_FRAGMENT}function Qe(e,t){var n=e.directives;return!n||!n.length||function(e){var t=[];e&&e.length&&e.forEach((function(e){if(function(e){var t=e.name.value;return"skip"===t||"include"===t}(e)){var n=e.arguments,r=e.name.value;O(n&&1===n.length,71,r);var i=n[0];O(i.name&&"if"===i.name.value,72,r);var o=i.value;O(o&&("Variable"===o.kind||"BooleanValue"===o.kind),73,r),t.push({directive:e,ifArgument:i})}}));return t}(n).every((function(e){var n=e.directive,r=e.ifArgument,i=!1;return"Variable"===r.value.kind?(i=t&&t[r.value.name.value],O(void 0!==i,70,n.name.value)):i=r.value.value,"skip"===n.name.value?!i:i}))}function Be(e,t,n){var r=new Set(e),i=r.size;return Re(t,{Directive:function(e){if(r.delete(e.name.value)&&(!n||!r.size))return Ce}}),n?!r.size:r.size<i}function Ke(e){return e&&Be(["client","export"],e,!0)}const Ge=()=>Object.create(null),{forEach:ze,slice:We}=Array.prototype,{hasOwnProperty:Ye}=Object.prototype;let He=class e{constructor(e=!0,t=Ge){this.weakness=e,this.makeData=t}lookup(){return this.lookupArray(arguments)}lookupArray(e){let t=this;return ze.call(e,(e=>t=t.getChildTrie(e))),Ye.call(t,"data")?t.data:t.data=this.makeData(We.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let t=this;for(let n=0,r=e.length;t&&n<r;++n){const r=t.mapFor(e[n],!1);t=r&&r.get(e[n])}return t&&t.data}remove(){return this.removeArray(arguments)}removeArray(e){let t;if(e.length){const n=e[0],r=this.mapFor(n,!1),i=r&&r.get(n);i&&(t=i.removeArray(We.call(e,1)),i.data||i.weak||i.strong&&i.strong.size||r.delete(n))}else t=this.data,delete this.data;return t}getChildTrie(t){const n=this.mapFor(t,!0);let r=n.get(t);return r||n.set(t,r=new e(this.weakness,this.makeData)),r}mapFor(e,t){return this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(e)?this.weak||(t?this.weak=new WeakMap:void 0):this.strong||(t?this.strong=new Map:void 0)}};var Je="ReactNative"==E((function(){return navigator.product})),$e="function"==typeof WeakMap&&!(Je&&!global.HermesInternal),Xe="function"==typeof WeakSet,Ze="function"==typeof Symbol&&"function"==typeof Symbol.for,et=Ze&&Symbol.asyncIterator;function tt(e){return null!==e&&"object"==typeof e}function nt(e,t){var n=t,r=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw x(74,e.operation,e.name?" named '".concat(e.name.value,"'"):"");"FragmentDefinition"===e.kind&&r.push(e)})),void 0===n&&(O(1===r.length,75,r.length),n=r[0].name.value),s(s({},e),{definitions:l([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],e.definitions,!0)})}function rt(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function it(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var n=e.name.value;if("function"==typeof t)return t(n);var r=t&&t[n];return O(r,76,n),r||null;default:return null}}function ot(){}E((function(){return window.document.createElement})),E((function(){return navigator.userAgent.indexOf("jsdom")>=0}));class st{constructor(e=1/0,t=ot){this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}get size(){return this.map.size}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:e,newer:n}=t;n&&(n.older=e),e&&(e.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t}set(e,t){let n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)}}function at(){}const ct=at,ut="undefined"!=typeof WeakRef?WeakRef:function(e){return{deref:()=>e}},lt="undefined"!=typeof WeakMap?WeakMap:Map,ft="undefined"!=typeof FinalizationRegistry?FinalizationRegistry:function(){return{register:at,unregister:at}};class ht{constructor(e=1/0,t=ct){this.max=e,this.dispose=t,this.map=new lt,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const e=this.unfinalizedNodes.values();for(let t=0;t<10024;t++){const t=e.next().value;if(!t)break;this.unfinalizedNodes.delete(t);const n=t.key;delete t.key,t.keyRef=new ut(n),this.registry.register(n,t,t)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new ft(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:e,newer:n}=t;n&&(n.older=e),e&&(e.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t}set(e,t){let n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.scheduleFinalization(n),this.map.set(e,n),this.size++,n.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const t=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,t),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),t&&this.map.delete(t)}delete(e){const t=this.map.get(e);return!!t&&(this.deleteNode(t),!0)}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}var pt=new WeakSet;function dt(e){e.size<=(e.max||-1)||pt.has(e)||(pt.add(e),setTimeout((function(){e.clean(),pt.delete(e)}),100))}var vt=function(e,t){var n=new ht(e,t);return n.set=function(e,t){var n=ht.prototype.set.call(this,e,t);return dt(this),n},n},yt=function(e,t){var n=new st(e,t);return n.set=function(e,t){var n=st.prototype.set.call(this,e,t);return dt(this),n},n},mt=Symbol.for("apollo.cacheSize"),gt=s({},S[mt]),bt={};function Et(e,t){bt[e]=t}var St=!1!==globalThis.__DEV__?function(){var e,t,n,r,i;if(!1===globalThis.__DEV__)throw new Error("only supported in development mode");return{limits:Object.fromEntries(Object.entries({parser:1e3,canonicalStringify:1e3,print:2e3,"documentTransform.cache":2e3,"queryManager.getDocumentInfo":2e3,"PersistedQueryLink.persistedQueryHashes":2e3,"fragmentRegistry.transform":2e3,"fragmentRegistry.lookup":1e3,"fragmentRegistry.findFragmentSpreads":4e3,"cache.fragmentQueryDocuments":1e3,"removeTypenameFromVariables.getVariableDefinitions":2e3,"inMemoryCache.maybeBroadcastWatch":5e3,"inMemoryCache.executeSelectionSet":5e4,"inMemoryCache.executeSubSelectedArray":1e4}).map((function(e){var t=e[0],n=e[1];return[t,gt[t]||n]}))),sizes:s({print:null===(e=bt.print)||void 0===e?void 0:e.call(bt),parser:null===(t=bt.parser)||void 0===t?void 0:t.call(bt),canonicalStringify:null===(n=bt.canonicalStringify)||void 0===n?void 0:n.call(bt),links:Dt(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:xt(this.queryManager.documentTransform)}},null===(i=(r=this.cache).getMemoryInternals)||void 0===i?void 0:i.call(r))}}:void 0,Tt=!1!==globalThis.__DEV__?function(){var e=this.config.fragments;return s(s({},wt.apply(this)),{addTypenameDocumentTransform:xt(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:_t(this.storeReader.executeSelectionSet),executeSubSelectedArray:_t(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:_t(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:_t(null==e?void 0:e.findFragmentSpreads),lookup:_t(null==e?void 0:e.lookup),transform:_t(null==e?void 0:e.transform)}})}:void 0,kt=!1!==globalThis.__DEV__?wt:void 0;function wt(){return{cache:{fragmentQueryDocuments:_t(this.getFragmentDoc)}}}function _t(e){return function(e){return!!e&&"dirtyKey"in e}(e)?e.size:void 0}function Ot(e){return null!=e}function xt(e){return Nt(e).map((function(e){return{cache:e}}))}function Nt(e){return e?l(l([_t(null==e?void 0:e.performWork)],Nt(null==e?void 0:e.left),!0),Nt(null==e?void 0:e.right),!0).filter(Ot):[]}function Dt(e){var t;return e?l(l([null===(t=null==e?void 0:e.getMemoryInternals)||void 0===t?void 0:t.call(e)],Dt(null==e?void 0:e.left),!0),Dt(null==e?void 0:e.right),!0).filter(Ot):[]}var It,At=Object.assign((function(e){return JSON.stringify(e,Ct)}),{reset:function(){It=new yt(gt.canonicalStringify||1e3)}});function Ct(e,t){if(t&&"object"==typeof t){var n=Object.getPrototypeOf(t);if(n===Object.prototype||null===n){var r=Object.keys(t);if(r.every(Rt))return t;var i=JSON.stringify(r),o=It.get(i);if(!o){r.sort();var s=JSON.stringify(r);o=It.get(s)||r,It.set(i,o),It.set(s,o)}var a=Object.create(n);return o.forEach((function(e){a[e]=t[e]})),a}}return t}function Rt(e,t,n){return 0===t||n[t-1]<=e}function Ft(e){return{__ref:String(e)}}function Lt(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function Pt(e,t,n,r){if(function(e){return"IntValue"===e.kind}(n)||function(e){return"FloatValue"===e.kind}(n))e[t.value]=Number(n.value);else if(function(e){return"BooleanValue"===e.kind}(n)||function(e){return"StringValue"===e.kind}(n))e[t.value]=n.value;else if(function(e){return"ObjectValue"===e.kind}(n)){var i={};n.fields.map((function(e){return Pt(i,e.name,e.value,r)})),e[t.value]=i}else if(function(e){return"Variable"===e.kind}(n)){var o=(r||{})[n.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(n))e[t.value]=n.values.map((function(e){var n={};return Pt(n,t,e,r),n[t.value]}));else if(function(e){return"EnumValue"===e.kind}(n))e[t.value]=n.value;else{if(!function(e){return"NullValue"===e.kind}(n))throw x(85,t.value,n.kind);e[t.value]=null}}!1!==globalThis.__DEV__&&Et("canonicalStringify",(function(){return It.size})),At.reset();var Mt=["connection","include","skip","client","rest","export","nonreactive"],jt=At,qt=Object.assign((function(e,t,n){if(t&&n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach((function(e){i[e]=t[e]})),"".concat(n.connection.key,"(").concat(jt(i),")")}return n.connection.key}var o=e;if(t){var s=jt(t);o+="(".concat(s,")")}return n&&Object.keys(n).forEach((function(e){-1===Mt.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?o+="@".concat(e,"(").concat(jt(n[e]),")"):o+="@".concat(e))})),o}),{setStringify:function(e){var t=jt;return jt=e,t}});function Vt(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach((function(e){var r=e.name,i=e.value;return Pt(n,r,i,t)})),n}return null}function Ut(e){return e.alias?e.alias.value:e.name.value}function Qt(e,t,n){for(var r,i=0,o=t.selections;i<o.length;i++){if(Bt(c=o[i])){if("__typename"===c.name.value)return e[Ut(c)]}else r?r.push(c):r=[c]}if("string"==typeof e.__typename)return e.__typename;if(r)for(var s=0,a=r;s<a.length;s++){var c,u=Qt(e,it(c=a[s],n).selectionSet,n);if("string"==typeof u)return u}}function Bt(e){return"Field"===e.kind}function Kt(e){O(e&&"Document"===e.kind,77);var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw x(78,e.kind);return e}));return O(t.length<=1,79,t.length),e}function Gt(e){return Kt(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function zt(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&!!e.name})).map((function(e){return e.name.value}))[0]||null}function Wt(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function Yt(e){var t=Gt(e);return O(t&&"query"===t.operation,80),t}function Ht(e){var t;Kt(e);for(var n=0,r=e.definitions;n<r.length;n++){var i=r[n];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||t||(t=i)}if(t)return t;throw x(84)}function Jt(e){var t=Object.create(null),n=e&&e.variableDefinitions;return n&&n.length&&n.forEach((function(e){e.defaultValue&&Pt(t,e.variable.name,e.defaultValue)})),t}const $t=()=>Object.create(null),{forEach:Xt,slice:Zt}=Array.prototype,{hasOwnProperty:en}=Object.prototype;class tn{constructor(e=!0,t=$t){this.weakness=e,this.makeData=t}lookup(...e){return this.lookupArray(e)}lookupArray(e){let t=this;return Xt.call(e,(e=>t=t.getChildTrie(e))),en.call(t,"data")?t.data:t.data=this.makeData(Zt.call(e))}peek(...e){return this.peekArray(e)}peekArray(e){let t=this;for(let n=0,r=e.length;t&&n<r;++n){const r=this.weakness&&nn(e[n])?t.weak:t.strong;t=r&&r.get(e[n])}return t&&t.data}getChildTrie(e){const t=this.weakness&&nn(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map);let n=t.get(e);return n||t.set(e,n=new tn(this.weakness,this.makeData)),n}}function nn(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}let rn=null;const on={};let sn=1;function an(e){try{return e()}catch(e){}}const cn="@wry/context:Slot",un=an((()=>globalThis))||an((()=>global))||Object.create(null),ln=un[cn]||Array[cn]||function(e){try{Object.defineProperty(un,cn,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(class{constructor(){this.id=["slot",sn++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=rn;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===on)break;return e!==rn&&(rn.slots[this.id]=t),!0}return rn&&(rn.slots[this.id]=on),!1}getValue(){if(this.hasValue())return rn.slots[this.id]}withValue(e,t,n,r){const i={__proto__:null,[this.id]:e},o=rn;rn={parent:o,slots:i};try{return t.apply(r,n)}finally{rn=o}}static bind(e){const t=rn;return function(){const n=rn;try{return rn=t,e.apply(this,arguments)}finally{rn=n}}}static noContext(e,t,n){if(!rn)return e.apply(n,t);{const r=rn;try{return rn=null,e.apply(n,t)}finally{rn=r}}}}),fn=new ln,{hasOwnProperty:hn}=Object.prototype,pn=Array.from||function(e){const t=[];return e.forEach((e=>t.push(e))),t};function dn(e){const{unsubscribe:t}=e;"function"==typeof t&&(e.unsubscribe=void 0,t())}const vn=[];function yn(e,t){if(!e)throw new Error(t||"assertion failure")}function mn(e,t){const n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}function gn(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function bn(e){return e.slice(0)}class En{constructor(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++En.count}peek(){if(1===this.value.length&&!kn(this))return Sn(this),this.value[0]}recompute(e){return yn(!this.recomputing,"already recomputing"),Sn(this),kn(this)?function(e,t){In(e),fn.withValue(e,Tn,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{dn(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,kn(e))return;_n(e)}(e);return gn(e.value)}(this,e):gn(this.value)}setDirty(){this.dirty||(this.dirty=!0,wn(this),dn(this))}dispose(){this.setDirty(),In(this),On(this,((e,t)=>{e.setDirty(),An(e,this)}))}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=vn.pop()||new Set),this.deps.add(e)}forgetDeps(){this.deps&&(pn(this.deps).forEach((e=>e.delete(this))),this.deps.clear(),vn.push(this.deps),this.deps=null)}}function Sn(e){const t=fn.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),kn(e)?xn(t,e):Nn(t,e),t}function Tn(e,t){e.recomputing=!0;const{normalizeResult:n}=e;let r;n&&1===e.value.length&&(r=bn(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),n&&r&&!mn(r,e.value))try{e.value[0]=n(e.value[0],r[0])}catch(e){}}catch(t){e.value[1]=t}e.recomputing=!1}function kn(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function wn(e){On(e,xn)}function _n(e){On(e,Nn)}function On(e,t){const n=e.parents.size;if(n){const r=pn(e.parents);for(let i=0;i<n;++i)t(r[i],e)}}function xn(e,t){yn(e.childValues.has(t)),yn(kn(t));const n=!kn(e);if(e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=vn.pop()||new Set;e.dirtyChildren.add(t),n&&wn(e)}function Nn(e,t){yn(e.childValues.has(t)),yn(!kn(t));const n=e.childValues.get(t);0===n.length?e.childValues.set(t,bn(t.value)):mn(n,t.value)||e.setDirty(),Dn(e,t),kn(e)||_n(e)}function Dn(e,t){const n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(vn.length<100&&vn.push(n),e.dirtyChildren=null))}function In(e){e.childValues.size>0&&e.childValues.forEach(((t,n)=>{An(e,n)})),e.forgetDeps(),yn(null===e.dirtyChildren)}function An(e,t){t.parents.delete(e),e.childValues.delete(t),Dn(e,t)}En.count=0;const Cn={setDirty:!0,dispose:!0,forget:!0};function Rn(e){const t=new Map;function n(e){const n=fn.getValue();if(n){let r=t.get(e);r||t.set(e,r=new Set),n.dependOn(r)}}return n.dirty=function(e,n){const r=t.get(e);if(r){const i=n&&hn.call(Cn,n)?n:"setDirty";pn(r).forEach((e=>e[i]())),t.delete(e),dn(r)}},n}let Fn;function Ln(...e){return(Fn||(Fn=new tn("function"==typeof WeakMap))).lookupArray(e)}const Pn=new Set;function Mn(e,{max:t=Math.pow(2,16),keyArgs:n,makeCacheKey:r=Ln,normalizeResult:i,subscribe:o,cache:s=st}=Object.create(null)){const a="function"==typeof s?new s(t,(e=>e.dispose())):s,c=function(){const t=r.apply(null,n?n.apply(null,arguments):arguments);if(void 0===t)return e.apply(null,arguments);let s=a.get(t);s||(a.set(t,s=new En(e)),s.normalizeResult=i,s.subscribe=o,s.forget=()=>a.delete(t));const c=s.recompute(Array.prototype.slice.call(arguments));return a.set(t,s),Pn.add(a),fn.hasValue()||(Pn.forEach((e=>e.clean())),Pn.clear()),c};function u(e){const t=e&&a.get(e);t&&t.setDirty()}function l(e){const t=e&&a.get(e);if(t)return t.peek()}function f(e){return!!e&&a.delete(e)}return Object.defineProperty(c,"size",{get:()=>a.size,configurable:!1,enumerable:!1}),Object.freeze(c.options={max:t,keyArgs:n,makeCacheKey:r,normalizeResult:i,subscribe:o,cache:a}),c.dirtyKey=u,c.dirty=function(){u(r.apply(null,arguments))},c.peekKey=l,c.peek=function(){return l(r.apply(null,arguments))},c.forgetKey=f,c.forget=function(){return f(r.apply(null,arguments))},c.makeCacheKey=r,c.getKey=n?function(){return r.apply(null,n.apply(null,arguments))}:r,Object.freeze(c)}function jn(e){return e}var qn,Vn=function(){function e(e,t){void 0===t&&(t=Object.create(null)),this.resultCache=Xe?new WeakSet:new Set,this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),this.cached=!1!==t.cache,this.resetCache()}return e.prototype.getCacheKey=function(e){return[e]},e.identity=function(){return new e(jn,{cache:!1})},e.split=function(t,n,r){return void 0===r&&(r=e.identity()),Object.assign(new e((function(e){return(t(e)?n:r).transformDocument(e)}),{cache:!1}),{left:n,right:r})},e.prototype.resetCache=function(){var t=this;if(this.cached){var n=new He($e);this.performWork=Mn(e.prototype.performWork.bind(this),{makeCacheKey:function(e){var r=t.getCacheKey(e);if(r)return O(Array.isArray(r),69),n.lookupArray(r)},max:gt["documentTransform.cache"],cache:ht})}},e.prototype.performWork=function(e){return Kt(e),this.transform(e)},e.prototype.transformDocument=function(e){if(this.resultCache.has(e))return e;var t=this.performWork(e);return this.resultCache.add(t),t},e.prototype.concat=function(t){var n=this;return Object.assign(new e((function(e){return t.transformDocument(n.transformDocument(e))}),{cache:!1}),{left:this,right:t})},e}(),Un=Object.assign((function(e){var t=qn.get(e);return t||(t=function(e){return Re(e,Le)}(e),qn.set(e,t)),t}),{reset:function(){qn=new vt(gt.print||2e3)}});Un.reset(),!1!==globalThis.__DEV__&&Et("print",(function(){return qn?qn.size:0}));var Qn=Array.isArray;function Bn(e){return Array.isArray(e)&&e.length>0}var Kn={kind:Y.FIELD,name:{kind:Y.NAME,value:"__typename"}};function Gn(e,t){return!e||e.selectionSet.selections.every((function(e){return e.kind===Y.FRAGMENT_SPREAD&&Gn(t[e.name.value],t)}))}function zn(e){return Gn(Gt(e)||function(e){O("Document"===e.kind,81),O(e.definitions.length<=1,82);var t=e.definitions[0];return O("FragmentDefinition"===t.kind,83),t}(e),rt(Wt(e)))?null:e}function Wn(e){var t=new Map;return function(n){void 0===n&&(n=e);var r=t.get(n);return r||t.set(n,r={variables:new Set,fragmentSpreads:new Set}),r}}function Yn(e,t){Kt(t);for(var n=Wn(""),r=Wn(""),i=function(e){for(var t=0,i=void 0;t<e.length&&(i=e[t]);++t)if(!Qn(i)){if(i.kind===Y.OPERATION_DEFINITION)return n(i.name&&i.name.value);if(i.kind===Y.FRAGMENT_DEFINITION)return r(i.name.value)}return!1!==globalThis.__DEV__&&O.error(86),null},o=0,a=t.definitions.length-1;a>=0;--a)t.definitions[a].kind===Y.OPERATION_DEFINITION&&++o;var c=function(e){var t=new Map,n=new Map;return e.forEach((function(e){e&&(e.name?t.set(e.name,e):e.test&&n.set(e.test,e))})),function(e){var r=t.get(e.name.value);return!r&&n.size&&n.forEach((function(t,n){n(e)&&(r=t)})),r}}(e),u=function(e){return Bn(e)&&e.map(c).some((function(e){return e&&e.remove}))},l=new Map,f=!1,h={enter:function(e){if(u(e.directives))return f=!0,null}},p=Re(t,{Field:h,InlineFragment:h,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(e,t,n,r,o){var s=i(o);s&&s.variables.add(e.name.value)}},FragmentSpread:{enter:function(e,t,n,r,o){if(u(e.directives))return f=!0,null;var s=i(o);s&&s.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter:function(e,t,n,r){l.set(JSON.stringify(r),e)},leave:function(e,t,n,i){return e===l.get(JSON.stringify(i))?e:o>0&&e.selectionSet.selections.every((function(e){return e.kind===Y.FIELD&&"__typename"===e.name.value}))?(r(e.name.value).removed=!0,f=!0,null):void 0}},Directive:{leave:function(e){if(c(e))return f=!0,null}}});if(!f)return t;var d=function(e){return e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach((function(t){d(r(t)).transitiveVars.forEach((function(t){e.transitiveVars.add(t)}))}))),e},v=new Set;p.definitions.forEach((function(e){e.kind===Y.OPERATION_DEFINITION?d(n(e.name&&e.name.value)).fragmentSpreads.forEach((function(e){v.add(e)})):e.kind!==Y.FRAGMENT_DEFINITION||0!==o||r(e.name.value).removed||v.add(e.name.value)})),v.forEach((function(e){d(r(e)).fragmentSpreads.forEach((function(e){v.add(e)}))}));var y={enter:function(e){if(t=e.name.value,!v.has(t)||r(t).removed)return null;var t}};return zn(Re(p,{FragmentSpread:y,FragmentDefinition:y,OperationDefinition:{leave:function(e){if(e.variableDefinitions){var t=d(n(e.name&&e.name.value)).transitiveVars;if(t.size<e.variableDefinitions.length)return s(s({},e),{variableDefinitions:e.variableDefinitions.filter((function(e){return t.has(e.variable.name.value)}))})}}}}))}var Hn=Object.assign((function(e){return Re(e,{SelectionSet:{enter:function(e,t,n){if(!n||n.kind!==Y.OPERATION_DEFINITION){var r=e.selections;if(r)if(!r.some((function(e){return Bt(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var i=n;if(!(Bt(i)&&i.directives&&i.directives.some((function(e){return"export"===e.name.value}))))return s(s({},e),{selections:l(l([],r,!0),[Kn],!1)})}}}}})}),{added:function(e){return e===Kn}});function Jn(e){return"query"===Ht(e).operation?e:Re(e,{OperationDefinition:{enter:function(e){return s(s({},e),{operation:"query"})}}})}function $n(e){return Kt(e),Yn([{test:function(e){return"client"===e.name.value},remove:!0}],e)}var Xn=Object.prototype.hasOwnProperty;function Zn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return er(e)}function er(e){var t=e[0]||{},n=e.length;if(n>1)for(var r=new nr,i=1;i<n;++i)t=r.merge(t,e[i]);return t}var tr=function(e,t,n){return this.merge(e[n],t[n])},nr=function(){function e(e){void 0===e&&(e=tr),this.reconciler=e,this.isObject=tt,this.pastCopies=new Set}return e.prototype.merge=function(e,t){for(var n=this,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return tt(t)&&tt(e)?(Object.keys(t).forEach((function(i){if(Xn.call(e,i)){var o=e[i];if(t[i]!==o){var s=n.reconciler.apply(n,l([e,t,i],r,!1));s!==o&&((e=n.shallowCopyForMerge(e))[i]=s)}}else(e=n.shallowCopyForMerge(e))[i]=t[i]})),e):t},e.prototype.shallowCopyForMerge=function(e){return tt(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):s({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},e}();function rr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ir(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ir(e,t)}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ir(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function or(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function sr(e,t,n){return t&&or(e.prototype,t),n&&or(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var ar=function(){return"function"==typeof Symbol},cr=function(e){return ar()&&Boolean(Symbol[e])},ur=function(e){return cr(e)?Symbol[e]:"@@"+e};ar()&&!cr("observable")&&(Symbol.observable=Symbol("observable"));var lr=ur("iterator"),fr=ur("observable"),hr=ur("species");function pr(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function dr(e){var t=e.constructor;return void 0!==t&&null===(t=t[hr])&&(t=void 0),void 0!==t?t:wr}function vr(e){return e instanceof wr}function yr(e){yr.log?yr.log(e):setTimeout((function(){throw e}))}function mr(e){Promise.resolve().then((function(){try{e()}catch(e){yr(e)}}))}function gr(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=pr(t,"unsubscribe");n&&n.call(t)}}catch(e){yr(e)}}function br(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function Er(e,t,n){e._state="running";var r=e._observer;try{var i=pr(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(br(e),!i)throw n;i.call(r,n);break;case"complete":br(e),i&&i.call(r)}}catch(e){yr(e)}"closed"===e._state?gr(e):"running"===e._state&&(e._state="ready")}function Sr(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void mr((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(Er(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void Er(e,t,n);e._queue.push({type:t,value:n})}}var Tr=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var n=new kr(this);try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(br(this),gr(this))},sr(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),kr=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){Sr(this._subscription,"next",e)},t.error=function(e){Sr(this._subscription,"error",e)},t.complete=function(){Sr(this._subscription,"complete")},sr(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),wr=function(){function e(t){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new Tr(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise((function(n,r){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,o)}catch(e){r(e),i.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),n()}}))},t.map=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(dr(this))((function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.filter=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(dr(this))((function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.reduce=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=dr(this),r=arguments.length>1,i=!1,o=arguments[1];return new n((function(n){return t.subscribe({next:function(t){var s=!i;if(i=!0,!s||r)try{o=e(o,t)}catch(e){return n.error(e)}else o=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(o),n.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=dr(this);return new i((function(t){var r,o=0;return function e(s){r=s.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===n.length?(r=void 0,t.complete()):e(i.from(n[o++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))},t.flatMap=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=dr(this);return new n((function(r){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var o=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),s()}});i.push(o)},error:function(e){r.error(e)},complete:function(){s()}});function s(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},t[fr]=function(){return this},e.from=function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=pr(t,fr);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return vr(i)&&i.constructor===n?i:new n((function(e){return i.subscribe(e)}))}if(cr("iterator")&&(r=pr(t,lr)))return new n((function(e){mr((function(){if(!e.closed){for(var n,i=rr(r.call(t));!(n=i()).done;){var o=n.value;if(e.next(o),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){mr((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")},e.of=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return new("function"==typeof this?this:e)((function(e){mr((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))},sr(e,null,[{key:hr,get:function(){return this}}]),e}();ar()&&Object.defineProperty(wr,Symbol("extensions"),{value:{symbol:fr,hostReportError:yr},configurable:!0}),function(e){var t,n=e.Symbol;if("function"==typeof n)if(n.observable)t=n.observable;else{t="function"==typeof n.for?n.for("https://github.com/benlesh/symbol-observable"):n("https://github.com/benlesh/symbol-observable");try{n.observable=t}catch(e){}}else t="@@observable"}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")());var _r=wr.prototype,Or="@@observable";_r[Or]||(_r[Or]=function(){return this});var xr=Object.prototype.toString;function Nr(e){return Dr(e)}function Dr(e,t){switch(xr.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var n=e.slice(0);return t.set(e,n),n.forEach((function(e,r){n[r]=Dr(e,t)})),n;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var r=Object.create(Object.getPrototypeOf(e));return t.set(e,r),Object.keys(e).forEach((function(n){r[n]=Dr(e[n],t)})),r;default:return e}}function Ir(e){var t=new Set([e]);return t.forEach((function(e){tt(e)&&function(e){if(!1!==globalThis.__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(e){if(e instanceof TypeError)return null;throw e}return e}(e)===e&&Object.getOwnPropertyNames(e).forEach((function(n){tt(e[n])&&t.add(e[n])}))})),e}function Ar(e){return!1!==globalThis.__DEV__&&Ir(e),e}function Cr(e,t,n){var r=[];e.forEach((function(e){return e[t]&&r.push(e)})),r.forEach((function(e){return e[t](n)}))}function Rr(e,t,n){return new wr((function(r){var i={then:function(e){return new Promise((function(t){return t(e())}))}};function o(e,t){return function(n){if(e){var o=function(){return r.closed?0:e(n)};i=i.then(o,o).then((function(e){return r.next(e)}),(function(e){return r.error(e)}))}else r[t](n)}}var s={next:o(t,"next"),error:o(n,"error"),complete:function(){i.then((function(){return r.complete()}))}},a=e.subscribe(s);return function(){return a.unsubscribe()}}))}function Fr(e){function t(t){Object.defineProperty(e,t,{value:wr})}return Ze&&Symbol.species&&t(Symbol.species),t("@@species"),e}function Lr(e){return e&&"function"==typeof e.then}var Pr=function(e){function t(t){var n=e.call(this,(function(e){return n.addObserver(e),function(){return n.removeObserver(e)}}))||this;return n.observers=new Set,n.promise=new Promise((function(e,t){n.resolve=e,n.reject=t})),n.handlers={next:function(e){null!==n.sub&&(n.latest=["next",e],n.notify("next",e),Cr(n.observers,"next",e))},error:function(e){var t=n.sub;null!==t&&(t&&setTimeout((function(){return t.unsubscribe()})),n.sub=null,n.latest=["error",e],n.reject(e),n.notify("error",e),Cr(n.observers,"error",e))},complete:function(){var e=n,t=e.sub,r=e.sources;if(null!==t){var i=(void 0===r?[]:r).shift();i?Lr(i)?i.then((function(e){return n.sub=e.subscribe(n.handlers)}),n.handlers.error):n.sub=i.subscribe(n.handlers):(t&&setTimeout((function(){return t.unsubscribe()})),n.sub=null,n.latest&&"next"===n.latest[0]?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),Cr(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(e){n.reject(e),n.sources=[],n.handlers.error(e)},n.promise.catch((function(e){})),"function"==typeof t&&(t=[new wr(t)]),Lr(t)?t.then((function(e){return n.start(e)}),n.handlers.error):n.start(t),n}return o(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],n=e[t];n&&n.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e))},t.prototype.removeObserver=function(e){this.observers.delete(e)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(e,t){var n=this.nextResultListeners;n.size&&(this.nextResultListeners=new Set,n.forEach((function(n){return n(e,t)})))},t.prototype.beforeNext=function(e){var t=!1;this.nextResultListeners.add((function(n,r){t||(t=!0,e(n,r))}))},t}(wr);function Mr(e){return"incremental"in e}function jr(e){return tt(e)&&"payload"in e}function qr(e,t){var n=e,r=new nr;return Mr(t)&&Bn(t.incremental)&&t.incremental.forEach((function(e){for(var t=e.data,i=e.path,o=i.length-1;o>=0;--o){var s=i[o],a=!isNaN(+s)?[]:{};a[s]=t,t=a}n=r.merge(n,t)})),n}function Vr(e){return Bn(Ur(e))}function Ur(e){var t=Bn(e.errors)?e.errors.slice(0):[];return Mr(e)&&Bn(e.incremental)&&e.incremental.forEach((function(e){e.errors&&t.push.apply(t,e.errors)})),t}function Qr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Object.create(null);return e.forEach((function(e){e&&Object.keys(e).forEach((function(t){var r=e[t];void 0!==r&&(n[t]=r)}))})),n}function Br(e,t){return Qr(e,t,t.variables&&{variables:Qr(s(s({},e&&e.variables),t.variables))})}function Kr(e){return new wr((function(t){t.error(e)}))}Fr(Pr);var Gr=function(e,t,n){var r=new Error(n);throw r.name="ServerError",r.response=e,r.statusCode=e.status,r.result=t,r};function zr(e,t){return t?t(e):wr.of()}function Wr(e){return"function"==typeof e?new Hr(e):e}function Yr(e){return e.request.length<=1}var Hr=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return wr.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(Wr).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,n,r){var i,o=Wr(n),s=Wr(r||new e(zr));return i=Yr(o)&&Yr(s)?new e((function(e){return t(e)?o.request(e)||wr.of():s.request(e)||wr.of()})):new e((function(e,n){return t(e)?o.request(e,n)||wr.of():s.request(e,n)||wr.of()})),Object.assign(i,{left:o,right:s})},e.execute=function(e,t){return e.request(function(e,t){var n=s({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){n=s(s({},n),"function"==typeof e?e(n):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return s({},n)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?zt(t.query)||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(t.indexOf(i)<0)throw x(44,i)}return e}(t))))||wr.of()},e.concat=function(t,n){var r=Wr(t);if(Yr(r))return!1!==globalThis.__DEV__&&O.warn(36,r),r;var i,o=Wr(n);return i=Yr(o)?new e((function(e){return r.request(e,(function(e){return o.request(e)||wr.of()}))||wr.of()})):new e((function(e,t){return r.request(e,(function(e){return o.request(e,t)||wr.of()}))||wr.of()})),Object.assign(i,{left:r,right:o})},e.prototype.split=function(t,n,r){return this.concat(e.split(t,n,r||new e(zr)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw x(37)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}(),Jr=Hr.execute;function $r(e){var t=null,n=null,r=!1,i=[],o=[];function s(e){if(!n){if(o.length){var t=o.shift();if(Array.isArray(t)&&t[0])return t[0]({value:e,done:!1})}i.push(e)}}function a(e){n=e,o.slice().forEach((function(t){t[1](e)})),!t||t()}function c(){r=!0,o.slice().forEach((function(e){e[0]({value:void 0,done:!0})})),!t||t()}t=function(){t=null,e.removeListener("data",s),e.removeListener("error",a),e.removeListener("end",c),e.removeListener("finish",c),e.removeListener("close",c)},e.on("data",s),e.on("error",a),e.on("end",c),e.on("finish",c),e.on("close",c);var u={next:function(){return new Promise((function(e,t){return n?t(n):i.length?e({value:i.shift(),done:!1}):r?e({value:void 0,done:!0}):void o.push([e,t])}))}};return et&&(u[Symbol.asyncIterator]=function(){return this}),u}function Xr(e){var t={next:function(){return e.read()}};return et&&(t[Symbol.asyncIterator]=function(){return this}),t}function Zr(e){var t,n,r,i=e;if(e.body&&(i=e.body),function(e){return!(!et||!e[Symbol.asyncIterator])}(i))return function(e){var t,n=e[Symbol.asyncIterator]();return(t={next:function(){return n.next()}})[Symbol.asyncIterator]=function(){return this},t}(i);if(function(e){return!!e.getReader}(i))return Xr(i.getReader());if(function(e){return!!e.stream}(i))return Xr(i.stream().getReader());if(function(e){return!!e.arrayBuffer}(i))return t=i.arrayBuffer(),n=!1,r={next:function(){return n?Promise.resolve({value:void 0,done:!0}):(n=!0,new Promise((function(e,n){t.then((function(t){e({value:t,done:!1})})).catch(n)})))}},et&&(r[Symbol.asyncIterator]=function(){return this}),r;if(function(e){return!!e.pipe}(i))return $r(i);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var ei=Symbol();function ti(e){return e.hasOwnProperty("graphQLErrors")}var ni=function(e){function t(n){var r,i,o=n.graphQLErrors,s=n.protocolErrors,a=n.clientErrors,c=n.networkError,u=n.errorMessage,f=n.extraInfo,h=e.call(this,u)||this;return h.name="ApolloError",h.graphQLErrors=o||[],h.protocolErrors=s||[],h.clientErrors=a||[],h.networkError=c||null,h.message=u||(i=l(l(l([],(r=h).graphQLErrors,!0),r.clientErrors,!0),r.protocolErrors,!0),r.networkError&&i.push(r.networkError),i.map((function(e){return tt(e)&&e.message||"Error message not found."})).join("\n")),h.extraInfo=f,h.cause=l(l(l([c],o||[],!0),s||[],!0),a||[],!0).find((function(e){return!!e}))||null,h.__proto__=t.prototype,h}return o(t,e),t}(Error),ri=Object.prototype.hasOwnProperty;function ii(e){var t={};return e.split("\n").forEach((function(e){var n=e.indexOf(":");if(n>-1){var r=e.slice(0,n).trim().toLowerCase(),i=e.slice(n+1).trim();t[r]=i}})),t}function oi(e,t){if(e.status>=300){Gr(e,function(){try{return JSON.parse(t)}catch(e){return t}}(),"Response not successful: Received status code ".concat(e.status))}try{return JSON.parse(t)}catch(r){var n=r;throw n.name="ServerParseError",n.response=e,n.statusCode=e.status,n.bodyText=t,n}}var si=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var r=x(40,t,e.message);throw r.parseError=e,r}return n},ai={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},ci=function(e,t){return t(e)};function ui(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={},o={};n.forEach((function(e){i=s(s(s({},i),e.options),{headers:s(s({},i.headers),e.headers)}),e.credentials&&(i.credentials=e.credentials),o=s(s({},o),e.http)})),i.headers&&(i.headers=function(e,t){if(!t){var n={};return Object.keys(Object(e)).forEach((function(t){n[t.toLowerCase()]=e[t]})),n}var r={};Object.keys(Object(e)).forEach((function(t){r[t.toLowerCase()]={originalName:t,value:e[t]}}));var i={};return Object.keys(r).forEach((function(e){i[r[e].originalName]=r[e].value})),i}(i.headers,o.preserveHeaderCase));var a=e.operationName,c=e.extensions,u=e.variables,l=e.query,f={operationName:a,variables:u};return o.includeExtensions&&(f.extensions=c),o.includeQuery&&(f.query=t(l,Un)),{options:i,body:f}}var li=E((function(){return fetch})),fi=function(e){void 0===e&&(e={});var t=e.uri,n=void 0===t?"/graphql":t,r=e.fetch,i=e.print,o=void 0===i?ci:i,l=e.includeExtensions,f=e.preserveHeaderCase,h=e.useGETForQueries,p=e.includeUnusedVariables,d=void 0!==p&&p,v=a(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);!1!==globalThis.__DEV__&&function(e){if(!e&&"undefined"==typeof fetch)throw x(38)}(r||li);var y={http:{includeExtensions:l,preserveHeaderCase:f},options:v.fetchOptions,credentials:v.credentials,headers:v.headers};return new Hr((function(e){var t=function(e,t){var n=e.getContext().uri;return n||("function"==typeof t?t(e):t||"/graphql")}(e,n),i=e.getContext(),a={};if(i.clientAwareness){var l=i.clientAwareness,f=l.name,p=l.version;f&&(a["apollographql-client-name"]=f),p&&(a["apollographql-client-version"]=p)}var v=s(s({},a),i.headers),m={http:i.http,options:i.fetchOptions,credentials:i.credentials,headers:v};if(Be(["client"],e.query)){var g=$n(e.query);if(!g)return Kr(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));e.query=g}var b,S,T,k,w,_=ui(e,o,ai,y,m),x=_.options,N=_.body;N.variables&&!d&&(N.variables=(b=N.variables,S=e.query,T=s({},b),k=new Set(Object.keys(b)),Re(S,{Variable:function(e,t,n){n&&"VariableDefinition"!==n.kind&&k.delete(e.name.value)}}),k.forEach((function(e){delete T[e]})),T)),x.signal||"undefined"==typeof AbortController||(w=new AbortController,x.signal=w.signal);var D,I="OperationDefinition"===(D=Ht(e.query)).kind&&"subscription"===D.operation,A=Be(["defer"],e.query);if(h&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(x.method="GET"),A||I){x.headers=x.headers||{};var C="multipart/mixed;";I&&A&&!1!==globalThis.__DEV__&&O.warn(39),I?C+="boundary=graphql;subscriptionSpec=1.0,application/json":A&&(C+="deferSpec=20220824,application/json"),x.headers.accept=C}if("GET"===x.method){var R=function(e,t){var n=[],r=function(e,t){n.push("".concat(e,"=").concat(encodeURIComponent(t)))};if("query"in t&&r("query",t.query),t.operationName&&r("operationName",t.operationName),t.variables){var i=void 0;try{i=si(t.variables,"Variables map")}catch(e){return{parseError:e}}r("variables",i)}if(t.extensions){var o=void 0;try{o=si(t.extensions,"Extensions map")}catch(e){return{parseError:e}}r("extensions",o)}var s="",a=e,c=e.indexOf("#");-1!==c&&(s=e.substr(c),a=e.substr(0,c));var u=-1===a.indexOf("?")?"?":"&";return{newURI:a+u+n.join("&")+s}}(t,N),F=R.newURI,L=R.parseError;if(L)return Kr(L);t=F}else try{x.body=si(N,"Payload")}catch(L){return Kr(L)}return new wr((function(n){var i=r||E((function(){return fetch}))||li,o=n.next.bind(n);return i(t,x).then((function(t){var n;e.setContext({response:t});var r,i=null===(n=t.headers)||void 0===n?void 0:n.get("content-type");return null!==i&&/^multipart\/mixed/i.test(i)?function(e,t){return c(this,void 0,void 0,(function(){var n,r,i,o,a,c,l,f,h,p,d,v,y,m,g,b,E,S,T,k,w,_,O,x;return u(this,(function(u){switch(u.label){case 0:if(void 0===TextDecoder)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");n=new TextDecoder("utf-8"),r=null===(x=e.headers)||void 0===x?void 0:x.get("content-type"),i="boundary=",o=(null==r?void 0:r.includes(i))?null==r?void 0:r.substring((null==r?void 0:r.indexOf(i))+9).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",a="\r\n--".concat(o),c="",l=Zr(e),f=!0,u.label=1;case 1:return f?[4,l.next()]:[3,3];case 2:for(h=u.sent(),p=h.value,d=h.done,v="string"==typeof p?p:n.decode(p),y=c.length-a.length+1,f=!d,m=(c+=v).indexOf(a,y);m>-1;){if(g=void 0,_=[c.slice(0,m),c.slice(m+a.length)],c=_[1],b=(g=_[0]).indexOf("\r\n\r\n"),E=ii(g.slice(0,b)),(S=E["content-type"])&&-1===S.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");if(T=g.slice(b))if(k=oi(e,T),Object.keys(k).length>1||"data"in k||"incremental"in k||"errors"in k||"payload"in k)if(jr(k)){if(w={},"payload"in k){if(1===Object.keys(k).length&&null===k.payload)return[2];w=s({},k.payload)}"errors"in k&&(w=s(s({},w),{extensions:s(s({},"extensions"in w?w.extensions:null),(O={},O[ei]=k.errors,O))})),t(w)}else t(k);else if(1===Object.keys(k).length&&"hasNext"in k&&!k.hasNext)return[2];m=c.indexOf(a)}return[3,1];case 3:return[2]}}))}))}(t,o):(r=e,function(e){return e.text().then((function(t){return oi(e,t)})).then((function(t){return Array.isArray(t)||ri.call(t,"data")||ri.call(t,"errors")||Gr(e,t,"Server response was missing for query '".concat(Array.isArray(r)?r.map((function(e){return e.operationName})):r.operationName,"'.")),t}))})(t).then(o)})).then((function(){w=void 0,n.complete()})).catch((function(e){w=void 0,function(e,t){e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e)}(e,n)})),function(){w&&w.abort()}}))}))},hi=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,fi(t).request)||this;return n.options=t,n}return o(t,e),t}(Hr);const{toString:pi,hasOwnProperty:di}=Object.prototype,vi=Function.prototype.toString,yi=new Map;function mi(e,t){try{return gi(e,t)}finally{yi.clear()}}function gi(e,t){if(e===t)return!0;const n=pi.call(e);if(n!==pi.call(t))return!1;switch(n){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(Ti(e,t))return!0;const n=bi(e),r=bi(t),i=n.length;if(i!==r.length)return!1;for(let e=0;e<i;++e)if(!di.call(t,n[e]))return!1;for(let r=0;r<i;++r){const i=n[r];if(!gi(e[i],t[i]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(Ti(e,t))return!0;const r=e.entries(),i="[object Map]"===n;for(;;){const e=r.next();if(e.done)break;const[n,o]=e.value;if(!t.has(n))return!1;if(i&&!gi(o,t.get(n)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let n=e.byteLength;if(n===t.byteLength)for(;n--&&e[n]===t[n];);return-1===n}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const n=vi.call(e);return n===vi.call(t)&&!function(e,t){const n=e.length-t.length;return n>=0&&e.indexOf(t,n)===n}(n,Si)}}return!1}function bi(e){return Object.keys(e).filter(Ei,e)}function Ei(e){return void 0!==this[e]}const Si="{ [native code] }";function Ti(e,t){let n=yi.get(e);if(n){if(n.has(t))return!0}else yi.set(e,n=new Set);return n.add(t),!1}function ki(e,t,n,r){var i=t.data,o=a(t,["data"]),s=n.data;return mi(o,a(n,["data"]))&&wi(Ht(e).selectionSet,i,s,{fragmentMap:rt(Wt(e)),variables:r})}function wi(e,t,n,r){if(t===n)return!0;var i=new Set;return e.selections.every((function(e){if(i.has(e))return!0;if(i.add(e),!Qe(e,r.variables))return!0;if(_i(e))return!0;if(Bt(e)){var o=Ut(e),s=t&&t[o],a=n&&n[o],c=e.selectionSet;if(!c)return mi(s,a);var u=Array.isArray(s),l=Array.isArray(a);if(u!==l)return!1;if(u&&l){var f=s.length;if(a.length!==f)return!1;for(var h=0;h<f;++h)if(!wi(c,s[h],a[h],r))return!1;return!0}return wi(c,s,a,r)}var p=it(e,r.fragmentMap);return p?!!_i(p)||wi(p.selectionSet,t,n,r):void 0}))}function _i(e){return!!e.directives&&e.directives.some(Oi)}function Oi(e){return"nonreactive"===e.name.value}var xi=function(){function e(){this.assumeImmutableResults=!1,this.getFragmentDoc=Mn(nt,{max:gt["cache.fragmentQueryDocuments"]||1e3,cache:ht})}return e.prototype.batch=function(e){var t,n=this,r="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction((function(){return t=e.update(n)}),r),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(s(s({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.watchFragment=function(e){var t,n=this,r=e.fragment,i=e.fragmentName,o=e.from,c=e.optimistic,u=void 0===c||c,l=a(e,["fragment","fragmentName","from","optimistic"]),f=this.getFragmentDoc(r,i),h=s(s({},l),{returnPartialData:!0,id:void 0===o||"string"==typeof o?o:this.identify(o),query:f,optimistic:u});return new wr((function(e){return n.watch(s(s({},h),{immediate:!0,callback:function(n){if(!t||!ki(f,{data:null==t?void 0:t.result},{data:n.result})){var r={data:n.result,complete:!!n.complete};n.missing&&(r.missing=er(n.missing.map((function(e){return e.missing})))),t=n,e.next(r)}}}))}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(s(s({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,n=e.data,r=a(e,["id","data"]);return this.write(Object.assign(r,{dataId:t||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(e){var t=e.id,n=e.data,r=e.fragment,i=e.fragmentName,o=a(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(r,i),dataId:t,result:n}))},e.prototype.updateQuery=function(e,t){return this.batch({update:function(n){var r=n.readQuery(e),i=t(r);return null==i?r:(n.writeQuery(s(s({},e),{data:i})),i)}})},e.prototype.updateFragment=function(e,t){return this.batch({update:function(n){var r=n.readFragment(e),i=t(r);return null==i?r:(n.writeFragment(s(s({},e),{data:i})),i)}})},e}();!1!==globalThis.__DEV__&&(xi.prototype.getMemoryInternals=kt);var Ni=function(e){function t(n,r,i,o){var s,a=e.call(this,n)||this;if(a.message=n,a.path=r,a.query=i,a.variables=o,Array.isArray(a.path)){a.missing=a.message;for(var c=a.path.length-1;c>=0;--c)a.missing=((s={})[a.path[c]]=a.missing,s)}else a.missing=a.path;return a.__proto__=t.prototype,a}return o(t,e),t}(Error),Di=Object.prototype.hasOwnProperty;function Ii(e){return null==e}function Ai(e,t){var n=e.__typename,r=e.id,i=e._id;if("string"==typeof n&&(t&&(t.keyObject=Ii(r)?Ii(i)?void 0:{_id:i}:{id:r}),Ii(r)&&!Ii(i)&&(r=i),!Ii(r)))return"".concat(n,":").concat("number"==typeof r||"string"==typeof r?r:JSON.stringify(r))}var Ci={dataIdFromObject:Ai,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Ri(e){var t=e.canonizeResults;return void 0===t?Ci.canonizeResults:t}var Fi=/^[_a-z][_0-9a-z]*/i;function Li(e){var t=e.match(Fi);return t?t[0]:e}function Pi(e,t,n){return!!tt(t)&&(Qn(t)?t.every((function(t){return Pi(e,t,n)})):e.selections.every((function(e){if(Bt(e)&&Qe(e,n)){var r=Ut(e);return Di.call(t,r)&&(!e.selectionSet||Pi(e.selectionSet,t[r],n))}return!0})))}function Mi(e){return tt(e)&&!Lt(e)&&!Qn(e)}function ji(e,t){var n=rt(Wt(e));return{fragmentMap:n,lookupFragment:function(e){var r=n[e];return!r&&t&&(r=t.lookup(e)),r||null}}}var qi=Object.create(null),Vi=function(){return qi},Ui=Object.create(null),Qi=function(){function e(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return Ar(Lt(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return Lt(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return Ft(e);if(Lt(e))return e;var r=n.policies.identify(e)[0];if(r){var i=Ft(r);return t&&n.merge(r,e),i}}}return e.prototype.toObject=function(){return s({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),Di.call(this.data,e)){var n=this.data[e];if(n&&Di.call(n,t))return n[t]}return"__typename"===t&&Di.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof zi?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),Di.call(this.data,e)?this.data[e]:this instanceof zi?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var n,r=this;Lt(e)&&(e=e.__ref),Lt(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(n=e):e,o="string"==typeof t?this.lookup(n=t):t;if(o){O("string"==typeof n,1);var s=new nr(Yi).merge(i,o);if(this.data[n]=s,s!==i&&(delete this.refs[n],this.group.caching)){var a=Object.create(null);i||(a.__exists=1),Object.keys(o).forEach((function(e){if(!i||i[e]!==s[e]){a[e]=1;var t=Li(e);t===e||r.policies.hasKeyArgs(s.__typename,t)||(a[t]=1),void 0!==s[e]||r instanceof zi||delete s[e]}})),!a.__typename||i&&i.__typename||this.policies.rootTypenamesById[n]!==s.__typename||delete a.__typename,Object.keys(a).forEach((function(e){return r.group.dirty(n,e)}))}}},e.prototype.modify=function(e,t){var n=this,r=this.lookup(e);if(r){var i=Object.create(null),o=!1,a=!0,c={DELETE:qi,INVALIDATE:Ui,isReference:Lt,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||Ft(e)}:t,{store:n})}};if(Object.keys(r).forEach((function(u){var l=Li(u),f=r[u];if(void 0!==f){var h="function"==typeof t?t:t[u]||t[l];if(h){var p=h===Vi?qi:h(Ar(f),s(s({},c),{fieldName:l,storeFieldName:u,storage:n.getStorage(e,u)}));if(p===Ui)n.group.dirty(e,u);else if(p===qi&&(p=void 0),p!==f&&(i[u]=p,o=!0,f=p,!1!==globalThis.__DEV__)){var d=function(e){if(void 0===n.lookup(e.__ref))return!1!==globalThis.__DEV__&&O.warn(2,e),!0};if(Lt(p))d(p);else if(Array.isArray(p))for(var v=!1,y=void 0,m=0,g=p;m<g.length;m++){var b=g[m];if(Lt(b)){if(v=!0,d(b))break}else if("object"==typeof b&&b)n.policies.identify(b)[0]&&(y=b);if(v&&void 0!==y){!1!==globalThis.__DEV__&&O.warn(3,y);break}}}}void 0!==f&&(a=!1)}})),o)return this.merge(e,i),a&&(this instanceof zi?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,n){var r,i=this.lookup(e);if(i){var o=this.getFieldValue(i,"__typename"),s=t&&n?this.policies.getStoreFieldName({typename:o,fieldName:t,args:n}):t;return this.modify(e,s?((r={})[s]=Vi,r):Vi)}return!1},e.prototype.evict=function(e,t){var n=!1;return e.id&&(Di.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof zi&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach((function(t){Di.call(e.policies.rootTypenamesById,t)||n.push(t)})),n.length&&(t.__META={extraRootIds:n.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(n){e&&Di.call(e,n)||t.delete(n)})),e){var n=e.__META,r=a(e,["__META"]);Object.keys(r).forEach((function(e){t.merge(e,r[e])})),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof zi?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach((function(r){Di.call(n,r)&&(Object.keys(e.findChildRefIds(r)).forEach(t.add,t),delete n[r])}));var r=Object.keys(n);if(r.length){for(var i=this;i instanceof zi;)i=i.parent;r.forEach((function(e){return i.delete(e)}))}return r},e.prototype.findChildRefIds=function(e){if(!Di.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var r=new Set([n]);r.forEach((function(e){Lt(e)&&(t[e.__ref]=!0),tt(e)&&Object.keys(e).forEach((function(t){var n=e[t];tt(n)&&r.add(n)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),Bi=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?Rn():null,this.keyMaker=new He($e)},e.prototype.depend=function(e,t){if(this.d){this.d(Ki(e,t));var n=Li(t);n!==t&&this.d(Ki(e,n)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(Ki(e,t),"__exists"===t?"forget":"setDirty")},e}();function Ki(e,t){return t+"#"+e}function Gi(e,t){Hi(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var n=t.policies,r=t.resultCaching,i=void 0===r||r,o=t.seed,s=e.call(this,n,new Bi(i))||this;return s.stump=new Wi(s),s.storageTrie=new He($e),o&&s.replace(o),s}return o(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(Qi);var zi=function(e){function t(t,n,r,i){var o=e.call(this,n.policies,i)||this;return o.id=t,o.parent=n,o.replay=r,o.group=i,r(o),o}return o(t,e),t.prototype.addLayer=function(e,n){return new t(e,this,n,this.group)},t.prototype.removeLayer=function(e){var t=this,n=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){var r=t.data[e],i=n.lookup(e);i?r?r!==i&&Object.keys(r).forEach((function(n){mi(r[n],i[n])||t.group.dirty(e,n)})):(t.group.dirty(e,"__exists"),Object.keys(i).forEach((function(n){t.group.dirty(e,n)}))):t.delete(e)})),n):n===this.parent?this:n.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return s(s({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return Di.call(this.data,t)?s(s({},n),e.prototype.findChildRefIds.call(this,t)):n},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(Qi),Wi=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new Bi(t.group.caching,t.group))||this}return o(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(e,t){return this.parent.merge(e,t)},t}(zi);function Yi(e,t,n){var r=e[n],i=t[n];return mi(r,i)?r:i}function Hi(e){return!!(e instanceof Qi&&e.group.caching)}function Ji(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $i=function(){function e(){this.known=new(Xe?WeakSet:Set),this.pool=new He($e),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return tt(e)&&this.known.has(e)},e.prototype.pass=function(e){if(tt(e)){var t=function(e){return tt(e)?Qn(e)?e.slice(0):s({__proto__:Object.getPrototypeOf(e)},e):e}(e);return this.passes.set(t,e),t}return e},e.prototype.admit=function(e){var t=this;if(tt(e)){var n=this.passes.get(e);if(n)return n;switch(Object.getPrototypeOf(e)){case Array.prototype:if(this.known.has(e))return e;var r=e.map(this.admit,this);return(a=this.pool.lookupArray(r)).array||(this.known.add(a.array=r),!1!==globalThis.__DEV__&&Object.freeze(r)),a.array;case null:case Object.prototype:if(this.known.has(e))return e;var i=Object.getPrototypeOf(e),o=[i],s=this.sortedKeys(e);o.push(s.json);var a,c=o.length;if(s.sorted.forEach((function(n){o.push(t.admit(e[n]))})),!(a=this.pool.lookupArray(o)).object){var u=a.object=Object.create(i);this.known.add(u),s.sorted.forEach((function(e,t){u[e]=o[c+t]})),!1!==globalThis.__DEV__&&Object.freeze(u)}return a.object}}return e},e.prototype.sortedKeys=function(e){var t=Object.keys(e),n=this.pool.lookupArray(t);if(!n.keys){t.sort();var r=JSON.stringify(t);(n.keys=this.keysByJSON.get(r))||this.keysByJSON.set(r,n.keys={sorted:t,json:r})}return n.keys},e}();function Xi(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var Zi=function(){function e(e){var t=this;this.knownResults=new($e?WeakMap:Map),this.config=Qr(e,{addTypename:!1!==e.addTypename,canonizeResults:Ri(e)}),this.canon=e.canon||new $i,this.executeSelectionSet=Mn((function(e){var n,r=e.context.canonizeResults,i=Xi(e);i[3]=!r;var o=(n=t.executeSelectionSet).peek.apply(n,i);return o?r?s(s({},o),{result:t.canon.admit(o.result)}):o:(Gi(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize||gt["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:Xi,makeCacheKey:function(e,t,n,r){if(Hi(n.store))return n.store.makeCacheKey(e,Lt(t)?t.__ref:t,n.varString,r)}}),this.executeSubSelectedArray=Mn((function(e){return Gi(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize||gt["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(e){var t=e.field,n=e.array,r=e.context;if(Hi(r.store))return r.store.makeCacheKey(t,n,r.varString)}})}return e.prototype.resetCanon=function(){this.canon=new $i},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,r=e.rootId,i=void 0===r?"ROOT_QUERY":r,o=e.variables,a=e.returnPartialData,c=void 0===a||a,u=e.canonizeResults,l=void 0===u?this.config.canonizeResults:u,f=this.config.cache.policies;o=s(s({},Jt(Yt(n))),o);var h,p=Ft(i),d=this.executeSelectionSet({selectionSet:Ht(n).selectionSet,objectOrReference:p,enclosingRef:p,context:s({store:t,query:n,policies:f,variables:o,varString:At(o),canonizeResults:l},ji(n,this.config.fragments))});if(d.missing&&(h=[new Ni(eo(d.missing),d.missing,n,o)],!c))throw h[0];return{result:d.result,complete:!h,missing:h}},e.prototype.isFresh=function(e,t,n,r){if(Hi(r.store)&&this.knownResults.get(e)===n){var i=this.executeSelectionSet.peek(n,t,r,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,r=e.objectOrReference,i=e.enclosingRef,o=e.context;if(Lt(r)&&!o.policies.rootTypenamesById[r.__ref]&&!o.store.has(r.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(r.__ref," object")};var s,a=o.variables,c=o.policies,u=o.store.getFieldValue(r,"__typename"),l=[],f=new nr;function h(e,t){var n;return e.missing&&(s=f.merge(s,((n={})[t]=e.missing,n))),e.result}this.config.addTypename&&"string"==typeof u&&!c.rootIdsByTypename[u]&&l.push({__typename:u});var p=new Set(n.selections);p.forEach((function(e){var n,d;if(Qe(e,a))if(Bt(e)){var v=c.readField({fieldName:e.name.value,field:e,variables:o.variables,from:r},o),y=Ut(e);void 0===v?Hn.added(e)||(s=f.merge(s,((n={})[y]="Can't find field '".concat(e.name.value,"' on ").concat(Lt(r)?r.__ref+" object":"object "+JSON.stringify(r,null,2)),n))):Qn(v)?v.length>0&&(v=h(t.executeSubSelectedArray({field:e,array:v,enclosingRef:i,context:o}),y)):e.selectionSet?null!=v&&(v=h(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:v,enclosingRef:Lt(v)?v:i,context:o}),y)):o.canonizeResults&&(v=t.canon.pass(v)),void 0!==v&&l.push(((d={})[y]=v,d))}else{var m=it(e,o.lookupFragment);if(!m&&e.kind===Y.FRAGMENT_SPREAD)throw x(9,e.name.value);m&&c.fragmentMatches(m,u)&&m.selectionSet.selections.forEach(p.add,p)}}));var d={result:er(l),missing:s},v=o.canonizeResults?this.canon.admit(d):Ar(d);return v.result&&this.knownResults.set(v.result,n),v},e.prototype.execSubSelectedArrayImpl=function(e){var t,n=this,r=e.field,i=e.array,o=e.enclosingRef,s=e.context,a=new nr;function c(e,n){var r;return e.missing&&(t=a.merge(t,((r={})[n]=e.missing,r))),e.result}return r.selectionSet&&(i=i.filter(s.store.canRead)),i=i.map((function(e,t){return null===e?null:Qn(e)?c(n.executeSubSelectedArray({field:r,array:e,enclosingRef:o,context:s}),t):r.selectionSet?c(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,enclosingRef:Lt(e)?e:o,context:s}),t):(!1!==globalThis.__DEV__&&function(e,t,n){if(!t.selectionSet){var r=new Set([n]);r.forEach((function(n){tt(n)&&(O(!Lt(n),10,function(e,t){return Lt(t)?e.get(t.__ref,"__typename"):t&&t.__typename}(e,n),t.name.value),Object.values(n).forEach(r.add,r))}))}}(s.store,r,e),e)})),{result:s.canonizeResults?this.canon.admit(i):i,missing:t}},e}();function eo(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var to=new ln,no=new WeakMap;function ro(e){var t=no.get(e);return t||no.set(e,t={vars:new Set,dep:Rn()}),t}function io(e){ro(e).vars.forEach((function(t){return t.forgetCache(e)}))}function oo(e){var t=new Set,n=new Set,r=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach((function(e){ro(e).dep.dirty(r),function(e){e.broadcastWatches&&e.broadcastWatches()}(e)}));var s=Array.from(n);n.clear(),s.forEach((function(t){return t(e)}))}}else{var a=to.getValue();a&&(i(a),ro(a).dep(r))}return e};r.onNextChange=function(e){return n.add(e),function(){n.delete(e)}};var i=r.attachCache=function(e){return t.add(e),ro(e).vars.add(r),r};return r.forgetCache=function(e){return t.delete(e)},r}var so=Object.create(null);function ao(e){var t=JSON.stringify(e);return so[t]||(so[t]=Object.create(null))}function co(e){var t=ao(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,n){var r=function(e,t){return n.readField(t,e)},i=n.keyObject=lo(e,(function(e){var i=po(n.storeObject,e,r);return void 0===i&&t!==n.storeObject&&Di.call(t,e[0])&&(i=po(t,e,ho)),O(void 0!==i,4,e.join("."),t),i}));return"".concat(n.typename,":").concat(JSON.stringify(i))})}function uo(e){var t=ao(e);return t.keyArgsFn||(t.keyArgsFn=function(t,n){var r=n.field,i=n.variables,o=n.fieldName,s=lo(e,(function(e){var n=e[0],o=n.charAt(0);if("@"!==o)if("$"!==o){if(t)return po(t,e)}else{var s=n.slice(1);if(i&&Di.call(i,s)){var a=e.slice(0);return a[0]=s,po(i,a)}}else if(r&&Bn(r.directives)){var c=n.slice(1),u=r.directives.find((function(e){return e.name.value===c})),l=u&&Vt(u,i);return l&&po(l,e.slice(1))}})),a=JSON.stringify(s);return(t||"{}"!==a)&&(o+=":"+a),o})}function lo(e,t){var n=new nr;return fo(e).reduce((function(e,r){var i,o=t(r);if(void 0!==o){for(var s=r.length-1;s>=0;--s)(i={})[r[s]]=o,o=i;e=n.merge(e,o)}return e}),Object.create(null))}function fo(e){var t=ao(e);if(!t.paths){var n=t.paths=[],r=[];e.forEach((function(t,i){Qn(t)?(fo(t).forEach((function(e){return n.push(r.concat(e))})),r.length=0):(r.push(t),Qn(e[i+1])||(n.push(r.slice(0)),r.length=0))}))}return t.paths}function ho(e,t){return e[t]}function po(e,t,n){return n=n||ho,vo(t.reduce((function e(t,r){return Qn(t)?t.map((function(t){return e(t,r)})):t&&n(t,r)}),e))}function vo(e){return tt(e)?Qn(e)?e.map(vo):lo(Object.keys(e).sort(),(function(t){return po(e,t)})):e}function yo(e){return void 0!==e.args?e.args:e.field?Vt(e.field,e.variables):null}var mo=function(){},go=function(e,t){return t.fieldName},bo=function(e,t,n){return(0,n.mergeObjects)(e,t)},Eo=function(e,t){return t},So=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=s({dataIdFromObject:Ai},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var n,r=this,i=t&&(t.typename||(null===(n=t.storeObject)||void 0===n?void 0:n.__typename))||e.__typename;if(i===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o,a=t&&t.storeObject||e,c=s(s({},t),{typename:i,storeObject:a,readField:t&&t.readField||function(){var e=ko(arguments,a);return r.readField(e,{store:r.cache.data,variables:e.variables})}}),u=i&&this.getTypePolicy(i),l=u&&u.keyFn||this.config.dataIdFromObject;l;){var f=l(s(s({},e),a),c);if(!Qn(f)){o=f;break}l=co(f)}return o=o?String(o):void 0,c.keyObject?[o,c.keyObject]:[o]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(n){var r=e[n],i=r.queryType,o=r.mutationType,s=r.subscriptionType,c=a(r,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",n),o&&t.setRootTypename("Mutation",n),s&&t.setRootTypename("Subscription",n),Di.call(t.toBeAdded,n)?t.toBeAdded[n].push(c):t.toBeAdded[n]=[c]}))},e.prototype.updateTypePolicy=function(e,t){var n=this,r=this.getTypePolicy(e),i=t.keyFields,o=t.fields;function s(e,t){e.merge="function"==typeof t?t:!0===t?bo:!1===t?Eo:e.merge}s(r,t.merge),r.keyFn=!1===i?mo:Qn(i)?co(i):"function"==typeof i?i:r.keyFn,o&&Object.keys(o).forEach((function(t){var r=n.getFieldPolicy(e,t,!0),i=o[t];if("function"==typeof i)r.read=i;else{var a=i.keyArgs,c=i.read,u=i.merge;r.keyFn=!1===a?go:Qn(a)?uo(a):"function"==typeof a?a:r.keyFn,"function"==typeof c&&(r.read=c),s(r,u)}r.read&&r.merge&&(r.keyFn=r.keyFn||go)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(O(!r||r===e,5,e),r&&delete this.rootIdsByTypename[r],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(n){t.getSupertypeSet(n,!0),e[n].forEach((function(e){t.getSupertypeSet(e,!0).add(n);var r=e.match(Fi);r&&r[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!Di.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var r=this.supertypeMap.get(e);!r&&this.fuzzySubtypes.size&&(r=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach((function(n,i){if(n.test(e)){var o=t.supertypeMap.get(i);o&&o.forEach((function(e){return r.add(e)}))}}))),r&&r.size&&r.forEach((function(e){var r=t.getTypePolicy(e),i=r.fields,o=a(r,["fields"]);Object.assign(n,o),Object.assign(n.fields,i)}))}var i=this.toBeAdded[e];return i&&i.length&&i.splice(0).forEach((function(n){t.updateTypePolicy(e,n)})),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,n){if(e){var r=this.getTypePolicy(e).fields;return r[t]||n&&(r[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},e.prototype.fragmentMatches=function(e,t,n,r){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(t,!0),a=[s],c=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&a.indexOf(t)<0&&a.push(t)},u=!(!n||!this.fuzzySubtypes.size),l=!1,f=0;f<a.length;++f){var h=a[f];if(h.has(o))return s.has(o)||(l&&!1!==globalThis.__DEV__&&O.warn(6,t,o),s.add(o)),!0;h.forEach(c),u&&f===a.length-1&&Pi(e.selectionSet,n,r)&&(u=!1,l=!0,this.fuzzySubtypes.forEach((function(e,n){var r=t.match(e);r&&r[0]===t&&c(n)})))}return!1},e.prototype.hasKeyArgs=function(e,t){var n=this.getFieldPolicy(e,t,!1);return!(!n||!n.keyFn)},e.prototype.getStoreFieldName=function(e){var t,n=e.typename,r=e.fieldName,i=this.getFieldPolicy(n,r,!1),o=i&&i.keyFn;if(o&&n)for(var s={typename:n,fieldName:r,field:e.field||null,variables:e.variables},a=yo(e);o;){var c=o(a,s);if(!Qn(c)){t=c||r;break}o=uo(c)}return void 0===t&&(t=e.field?function(e,t){var n=null;e.directives&&(n={},e.directives.forEach((function(e){n[e.name.value]={},e.arguments&&e.arguments.forEach((function(r){var i=r.name,o=r.value;return Pt(n[e.name.value],i,o,t)}))})));var r=null;return e.arguments&&e.arguments.length&&(r={},e.arguments.forEach((function(e){var n=e.name,i=e.value;return Pt(r,n,i,t)}))),qt(e.name.value,r,n)}(e.field,e.variables):qt(r,yo(e))),!1===t?r:r===Li(t)?t:r+":"+t},e.prototype.readField=function(e,t){var n=e.from;if(n&&(e.field||e.fieldName)){if(void 0===e.typename){var r=t.store.getFieldValue(n,"__typename");r&&(e.typename=r)}var i=this.getStoreFieldName(e),o=Li(i),s=t.store.getFieldValue(n,i),a=this.getFieldPolicy(e.typename,o,!1),c=a&&a.read;if(c){var u=To(this,n,e,t,t.store.getStorage(Lt(n)?n.__ref:n,i));return to.withValue(this.cache,c,[s,u])}return s}},e.prototype.getReadFunction=function(e,t){var n=this.getFieldPolicy(e,t,!1);return n&&n.read},e.prototype.getMergeFunction=function(e,t,n){var r=this.getFieldPolicy(e,t,!1),i=r&&r.merge;return!i&&n&&(i=(r=this.getTypePolicy(n))&&r.merge),i},e.prototype.runMergeFunction=function(e,t,n,r,i){var o=n.field,s=n.typename,a=n.merge;return a===bo?wo(r.store)(e,t):a===Eo?t:(r.overwrite&&(e=void 0),a(e,t,To(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:r.variables},r,i||Object.create(null))))},e}();function To(e,t,n,r,i){var o=e.getStoreFieldName(n),s=Li(o),a=n.variables||r.variables,c=r.store,u=c.toReference,l=c.canRead;return{args:yo(n),field:n.field||null,fieldName:s,storeFieldName:o,variables:a,isReference:Lt,toReference:u,storage:i,cache:e.cache,canRead:l,readField:function(){return e.readField(ko(arguments,t,a),r)},mergeObjects:wo(r.store)}}function ko(e,t,n){var r,i=e[0],o=e[1],a=e.length;return"string"==typeof i?r={fieldName:i,from:a>1?o:t}:(r=s({},i),Di.call(r,"from")||(r.from=t)),!1!==globalThis.__DEV__&&void 0===r.from&&!1!==globalThis.__DEV__&&O.warn(7,w(Array.from(e))),void 0===r.variables&&(r.variables=n),r}function wo(e){return function(t,n){if(Qn(t)||Qn(n))throw x(8);if(tt(t)&&tt(n)){var r=e.getFieldValue(t,"__typename"),i=e.getFieldValue(n,"__typename");if(r&&i&&r!==i)return n;if(Lt(t)&&Mi(n))return e.merge(t.__ref,n),t;if(Mi(t)&&Lt(n))return e.merge(t,n.__ref),n;if(Mi(t)&&Mi(n))return s(s({},t),n)}return n}}function _o(e,t,n){var r="".concat(t).concat(n),i=e.flavors.get(r);return i||e.flavors.set(r,i=e.clientOnly===t&&e.deferred===n?e:s(s({},e),{clientOnly:t,deferred:n})),i}var Oo=function(){function e(e,t,n){this.cache=e,this.reader=t,this.fragments=n}return e.prototype.writeToStore=function(e,t){var n=this,r=t.query,i=t.result,o=t.dataId,a=t.variables,c=t.overwrite,u=Gt(r),l=new nr;a=s(s({},Jt(u)),a);var f=s(s({store:e,written:Object.create(null),merge:function(e,t){return l.merge(e,t)},variables:a,varString:At(a)},ji(r,this.fragments)),{overwrite:!!c,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),h=this.processSelectionSet({result:i||Object.create(null),dataId:o,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:f});if(!Lt(h))throw x(11,i);return f.incomingById.forEach((function(t,r){var i=t.storeObject,o=t.mergeTree,a=t.fieldNodeSet,c=Ft(r);if(o&&o.map.size){var u=n.applyMerges(o,c,i,f);if(Lt(u))return;i=u}if(!1!==globalThis.__DEV__&&!f.overwrite){var l=Object.create(null);a.forEach((function(e){e.selectionSet&&(l[e.name.value]=!0)}));Object.keys(i).forEach((function(e){(function(e){return!0===l[Li(e)]})(e)&&!function(e){var t=o&&o.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,n,r){var i=function(e){var t=r.getFieldValue(e,n);return"object"==typeof t&&t},o=i(e);if(!o)return;var a=i(t);if(!a)return;if(Lt(o))return;if(mi(o,a))return;if(Object.keys(o).every((function(e){return void 0!==r.getFieldValue(a,e)})))return;var c=r.getFieldValue(e,"__typename")||r.getFieldValue(t,"__typename"),u=Li(n),l="".concat(c,".").concat(u);if(Co.has(l))return;Co.add(l);var f=[];Qn(o)||Qn(a)||[o,a].forEach((function(e){var t=r.getFieldValue(e,"__typename");"string"!=typeof t||f.includes(t)||f.push(t)}));!1!==globalThis.__DEV__&&O.warn(14,u,c,f.length?"either ensure all objects of type "+f.join(" and ")+" have an ID or a custom merge function, or ":"",l,s({},o),s({},a))}(c,i,e,f.store)}))}e.merge(r,i)})),e.retain(h.__ref),h},e.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,r=e.result,i=e.selectionSet,o=e.context,a=e.mergeTree,c=this.cache.policies,u=Object.create(null),l=n&&c.rootTypenamesById[n]||Qt(r,i,o.fragmentMap)||n&&o.store.get(n,"__typename");"string"==typeof l&&(u.__typename=l);var f=function(){var e=ko(arguments,u,o.variables);if(Lt(e.from)){var t=o.incomingById.get(e.from.__ref);if(t){var n=c.readField(s(s({},e),{from:t.storeObject}),o);if(void 0!==n)return n}}return c.readField(e,o)},h=new Set;this.flattenFields(i,r,o,l).forEach((function(e,n){var i,o=Ut(n),s=r[o];if(h.add(n),void 0!==s){var p=c.getStoreFieldName({typename:l,fieldName:n.name.value,field:n,variables:e.variables}),d=No(a,p),v=t.processFieldValue(s,n,n.selectionSet?_o(e,!1,!1):e,d),y=void 0;n.selectionSet&&(Lt(v)||Mi(v))&&(y=f("__typename",v));var m=c.getMergeFunction(l,n.name.value,y);m?d.info={field:n,typename:l,merge:m}:Ao(a,p),u=e.merge(u,((i={})[p]=v,i))}else!1===globalThis.__DEV__||e.clientOnly||e.deferred||Hn.added(n)||c.getReadFunction(l,n.name.value)||!1!==globalThis.__DEV__&&O.error(12,Ut(n),r)}));try{var p=c.identify(r,{typename:l,selectionSet:i,fragmentMap:o.fragmentMap,storeObject:u,readField:f}),d=p[0],v=p[1];n=n||d,v&&(u=o.merge(u,v))}catch(e){if(!n)throw e}if("string"==typeof n){var y=Ft(n),m=o.written[n]||(o.written[n]=[]);if(m.indexOf(i)>=0)return y;if(m.push(i),this.reader&&this.reader.isFresh(r,y,i,o))return y;var g=o.incomingById.get(n);return g?(g.storeObject=o.merge(g.storeObject,u),g.mergeTree=Do(g.mergeTree,a),h.forEach((function(e){return g.fieldNodeSet.add(e)}))):o.incomingById.set(n,{storeObject:u,mergeTree:Io(a)?void 0:a,fieldNodeSet:h}),y}return u},e.prototype.processFieldValue=function(e,t,n,r){var i=this;return t.selectionSet&&null!==e?Qn(e)?e.map((function(e,o){var s=i.processFieldValue(e,t,n,No(r,o));return Ao(r,o),s})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):!1!==globalThis.__DEV__?Nr(e):e},e.prototype.flattenFields=function(e,t,n,r){void 0===r&&(r=Qt(t,e,n.fragmentMap));var i=new Map,o=this.cache.policies,s=new He(!1);return function e(a,c){var u=s.lookup(a,c.clientOnly,c.deferred);u.visited||(u.visited=!0,a.selections.forEach((function(s){if(Qe(s,n.variables)){var a=c.clientOnly,u=c.deferred;if(a&&u||!Bn(s.directives)||s.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(a=!0),"defer"===t){var r=Vt(e,n.variables);r&&!1===r.if||(u=!0)}})),Bt(s)){var l=i.get(s);l&&(a=a&&l.clientOnly,u=u&&l.deferred),i.set(s,_o(n,a,u))}else{var f=it(s,n.lookupFragment);if(!f&&s.kind===Y.FRAGMENT_SPREAD)throw x(13,s.name.value);f&&o.fragmentMatches(f,r,t,n.variables)&&e(f.selectionSet,_o(n,a,u))}}})))}(e,n),i},e.prototype.applyMerges=function(e,t,n,r,i){var o,a=this;if(e.map.size&&!Lt(n)){var c,u=Qn(n)||!Lt(t)&&!Mi(t)?void 0:t,l=n;u&&!i&&(i=[Lt(u)?u.__ref:u]);var f=function(e,t){return Qn(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){var n=f(u,t),o=f(l,t);if(void 0!==o){i&&i.push(t);var s=a.applyMerges(e,n,o,r,i);s!==o&&(c=c||new Map).set(t,s),i&&O(i.pop()===t)}})),c&&(n=Qn(l)?l.slice(0):s({},l),c.forEach((function(e,t){n[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,i&&(o=r.store).getStorage.apply(o,i)):n},e}(),xo=[];function No(e,t){var n=e.map;return n.has(t)||n.set(t,xo.pop()||{map:new Map}),n.get(t)}function Do(e,t){if(e===t||!t||Io(t))return e;if(!e||Io(e))return t;var n=e.info&&t.info?s(s({},e.info),t.info):e.info||t.info,r=e.map.size&&t.map.size,i={info:n,map:r?new Map:e.map.size?e.map:t.map};if(r){var o=new Set(t.map.keys());e.map.forEach((function(e,n){i.map.set(n,Do(e,t.map.get(n))),o.delete(n)})),o.forEach((function(n){i.map.set(n,Do(t.map.get(n),e.map.get(n)))}))}return i}function Io(e){return!e||!(e.info||e.map.size)}function Ao(e,t){var n=e.map,r=n.get(t);r&&Io(r)&&(xo.push(r),n.delete(t))}var Co=new Set;var Ro,Fo=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.addTypenameTransform=new Vn(Hn),n.assumeImmutableResults=!0,n.makeVar=oo,n.txCount=0,n.config=function(e){return Qr(Ci,e)}(t),n.addTypename=!!n.config.addTypename,n.policies=new So({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return o(t,e),t.prototype.init=function(){var e=this.data=new Qi.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,n=this.storeReader,r=this.config.fragments;this.storeWriter=new Oo(this,this.storeReader=new Zi({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Ri(this.config),canon:e?void 0:n&&n.canon,fragments:r}),r),this.maybeBroadcastWatch=Mn((function(e,n){return t.broadcastWatch(e,n)}),{max:this.config.resultCacheMaxSize||gt["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(e){var n=e.optimistic?t.optimisticData:t.data;if(Hi(n)){var r=e.optimistic,i=e.id,o=e.variables;return n.makeCacheKey(e.query,e.callback,At({optimistic:r,id:i,variables:o}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(e){return e.resetCaching()}))},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,n=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore(s(s({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(e){if(e instanceof Ni)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(Di.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore(s(s({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t,n=this;return this.watches.size||ro(t=this).vars.forEach((function(e){return e.attachCache(t)})),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){n.watches.delete(e)&&!n.watches.size&&io(n),n.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){var t;At.reset(),Un.reset(),this.addTypenameTransform.resetCache(),null===(t=this.config.fragments)||void 0===t||t.resetCaches();var n=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),n},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if(Lt(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){!1!==globalThis.__DEV__&&O.warn(e)}},t.prototype.evict=function(e){if(!e.id){if(Di.call(e,"id"))return!1;e=s(s({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),At.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),io(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,n=this,r=e.update,i=e.optimistic,o=void 0===i||i,a=e.removeOptimistic,c=e.onWatchUpdated,u=function(e){var i=n,o=i.data,s=i.optimisticData;++n.txCount,e&&(n.data=n.optimisticData=e);try{return t=r(n)}finally{--n.txCount,n.data=o,n.optimisticData=s}},l=new Set;return c&&!this.txCount&&this.broadcastWatches(s(s({},e),{onWatchUpdated:function(e){return l.add(e),!1}})),"string"==typeof o?this.optimisticData=this.optimisticData.addLayer(o,u):!1===o?u(this.data):u(),"string"==typeof a&&(this.optimisticData=this.optimisticData.removeLayer(a)),c&&l.size?(this.broadcastWatches(s(s({},e),{onWatchUpdated:function(e,t){var n=c.call(this,e,t);return!1!==n&&l.delete(e),n}})),l.size&&l.forEach((function(e){return n.maybeBroadcastWatch.dirty(e)}))):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){return this.addTypenameToDocument(this.addFragmentsToDocument(e))},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(n){return t.maybeBroadcastWatch(n,e)}))},t.prototype.addFragmentsToDocument=function(e){var t=this.config.fragments;return t?t.transform(e):e},t.prototype.addTypenameToDocument=function(e){return this.addTypename?this.addTypenameTransform.transformDocument(e):e},t.prototype.broadcastWatch=function(e,t){var n=e.lastDiff,r=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(r.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,r,n))||n&&mi(n.result,r.result)||e.callback(e.lastDiff=r,n)},t}(xi);function Lo(e){return!!e&&e<7}!1!==globalThis.__DEV__&&(Fo.prototype.getMemoryInternals=Tt),function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(Ro||(Ro={}));var Po=Object.assign,Mo=Object.hasOwnProperty,jo=function(e){function t(t){var n=t.queryManager,r=t.queryInfo,i=t.options,o=e.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=Vo)}catch(e){}var n=!o.observers.size;o.observers.add(e);var r=o.last;return r&&r.error?e.error&&e.error(r.error):r&&r.result&&e.next&&e.next(r.result),n&&o.reobserve().catch((function(){})),function(){o.observers.delete(e)&&!o.observers.size&&o.tearDownQuery()}}))||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=r,o.queryManager=n,o.waitForOwnResult=Qo(i.fetchPolicy),o.isTornDown=!1,o.subscribeToMore=o.subscribeToMore.bind(o);var a=n.defaultOptions.watchQuery,c=(void 0===a?{}:a).fetchPolicy,u=void 0===c?"cache-first":c,l=i.fetchPolicy,f=void 0===l?u:l,h=i.initialFetchPolicy,p=void 0===h?"standby"===f?u:f:h;o.options=s(s({},i),{initialFetchPolicy:p,fetchPolicy:f}),o.queryId=r.queryId||n.generateQueryId();var d=Gt(o.query);return o.queryName=d&&d.name&&d.name.value,o}return o(t,e),Object.defineProperty(t.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,n){var r={next:function(n){t(n),e.observers.delete(r),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:n},i=e.subscribe(r)}))},t.prototype.resetDiff=function(){this.queryInfo.resetDiff()},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),n=this.queryInfo.networkStatus||t&&t.networkStatus||Ro.ready,r=s(s({},t),{loading:Lo(n),networkStatus:n}),i=this.options.fetchPolicy,o=void 0===i?"cache-first":i;if(Qo(o)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers);else if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var a=this.queryInfo.getDiff();(a.complete||this.options.returnPartialData)&&(r.data=a.result),mi(r.data,{})&&(r.data=void 0),a.complete?(delete r.partial,!a.complete||r.networkStatus!==Ro.loading||"cache-first"!==o&&"cache-only"!==o||(r.networkStatus=Ro.ready,r.loading=!1)):r.partial=!0,!1===globalThis.__DEV__||a.complete||this.options.partialRefetch||r.loading||r.data||r.error||Uo(a.missing)}return e&&this.updateLastResult(r),r},t.prototype.isDifferentFromLastResult=function(e,t){return!this.last||((this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!ki(this.query,this.last.result,e,this.variables):!mi(this.last.result,e))||t&&!mi(this.last.variables,t))},t.prototype.getLast=function(e,t){var n=this.last;if(n&&n[e]&&(!t||mi(n.variables,this.variables)))return n[e]},t.prototype.getLastResult=function(e){return this.getLast("result",e)},t.prototype.getLastError=function(e){return this.getLast("error",e)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,n={pollInterval:0},r=this.options.fetchPolicy;if(n.fetchPolicy="cache-and-network"===r?r:"no-cache"===r?"no-cache":"network-only",!1!==globalThis.__DEV__&&e&&Mo.call(e,"variables")){var i=Yt(this.query),o=i.variableDefinitions;o&&o.some((function(e){return"variables"===e.variable.name.value}))||!1!==globalThis.__DEV__&&O.warn(20,e,(null===(t=i.name)||void 0===t?void 0:t.value)||i)}return e&&!mi(this.options.variables,e)&&(n.variables=this.options.variables=s(s({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(n,Ro.refetch)},t.prototype.fetchMore=function(e){var t=this,n=s(s({},e.query?e:s(s(s(s({},this.options),{query:this.options.query}),e),{variables:s(s({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"});n.query=this.transformDocument(n.query);var r=this.queryManager.generateQueryId();this.lastQuery=e.query?this.transformDocument(this.options.query):n.query;var i=this.queryInfo,o=i.networkStatus;i.networkStatus=Ro.fetchMore,n.notifyOnNetworkStatusChange&&this.observe();var a=new Set,c=null==e?void 0:e.updateQuery,u="no-cache"!==this.options.fetchPolicy;return u||O(c,21),this.queryManager.fetchQuery(r,n,Ro.fetchMore).then((function(l){if(t.queryManager.removeQuery(r),i.networkStatus===Ro.fetchMore&&(i.networkStatus=o),u)t.queryManager.cache.batch({update:function(r){var i=e.updateQuery;i?r.updateQuery({query:t.query,variables:t.variables,returnPartialData:!0,optimistic:!1},(function(e){return i(e,{fetchMoreResult:l.data,variables:n.variables})})):r.writeQuery({query:n.query,variables:n.variables,data:l.data})},onWatchUpdated:function(e){a.add(e.query)}});else{var f=t.getLast("result"),h=c(f.data,{fetchMoreResult:l.data,variables:n.variables});t.reportResult(s(s({},f),{data:h}),t.variables)}return l})).finally((function(){u&&!a.has(t.query)&&qo(t)}))},t.prototype.subscribeToMore=function(e){var t=this,n=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(n){var r=e.updateQuery;r&&t.updateQuery((function(e,t){var i=t.variables;return r(e,{subscriptionData:n,variables:i})}))},error:function(t){e.onError?e.onError(t):!1!==globalThis.__DEV__&&O.error(22,t)}});return this.subscriptions.add(n),function(){t.subscriptions.delete(n)&&n.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.silentSetOptions=function(e){var t=Qr(this.options,e||{});Po(this.options,t)},t.prototype.setVariables=function(e){return mi(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},Ro.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,n=e(t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});n&&(t.cache.writeQuery({query:this.options.query,data:n,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(e,t){if(t.nextFetchPolicy){var n=t.fetchPolicy,r=void 0===n?"cache-first":n,i=t.initialFetchPolicy,o=void 0===i?r:i;"standby"===r||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(r,{reason:e,options:t,observable:this,initialFetchPolicy:o}):t.fetchPolicy="variables-changed"===e?o:t.nextFetchPolicy)}return t.fetchPolicy},t.prototype.fetch=function(e,t,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,e,t,n)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,n=this.options.pollInterval;if(n&&this.hasObservers()){if(!t||t.interval!==n){O(n,23),(t||(this.pollingInfo={})).interval=n;var r=function(){var t,n;e.pollingInfo&&(Lo(e.queryInfo.networkStatus)||(null===(n=(t=e.options).skipPollAttempt)||void 0===n?void 0:n.call(t))?i():e.reobserve({fetchPolicy:"no-cache"===e.options.initialFetchPolicy?"no-cache":"network-only"},Ro.poll).then(i,i))},i=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(r,t.interval))};i()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},t.prototype.updateLastResult=function(e,t){void 0===t&&(t=this.variables);var n=this.getLastError();return n&&this.last&&!mi(t,this.last.variables)&&(n=void 0),this.last=s({result:this.queryManager.assumeImmutableResults?e:Nr(e),variables:t},n?{error:n}:null)},t.prototype.reobserveAsConcast=function(e,t){var n=this;this.isTornDown=!1;var r=t===Ro.refetch||t===Ro.fetchMore||t===Ro.poll,i=this.options.variables,o=this.options.fetchPolicy,a=Qr(this.options,e||{}),c=r?a:Po(this.options,a),u=this.transformDocument(c.query);this.lastQuery=u,r||(this.updatePolling(),!e||!e.variables||mi(e.variables,i)||"standby"===c.fetchPolicy||c.fetchPolicy!==o&&"function"!=typeof c.nextFetchPolicy||(this.applyNextFetchPolicy("variables-changed",c),void 0===t&&(t=Ro.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=Qo(c.fetchPolicy));var l=function(){n.concast===p&&(n.waitForOwnResult=!1)},f=c.variables&&s({},c.variables),h=this.fetch(c,t,u),p=h.concast,d=h.fromLink,v={next:function(e){mi(n.variables,f)&&(l(),n.reportResult(e,f))},error:function(e){mi(n.variables,f)&&(ti(e)||(e=new ni({networkError:e})),l(),n.reportError(e,f))}};return r||!d&&this.concast||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=p,this.observer=v),p.addObserver(v),p},t.prototype.reobserve=function(e,t){return this.reobserveAsConcast(e,t).promise},t.prototype.resubscribeAfterError=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.last;this.resetLastResults();var r=this.subscribe.apply(this,e);return this.last=n,r},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var n=this.getLastError(),r=this.isDifferentFromLastResult(e,t);(n||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),(n||r)&&Cr(this.observers,"next",e)},t.prototype.reportError=function(e,t){var n=s(s({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:Ro.error,loading:!1});this.updateLastResult(n,t),Cr(this.observers,"error",this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t.prototype.transformDocument=function(e){return this.queryManager.transform(e)},t}(wr);function qo(e){var t=e.options,n=t.fetchPolicy,r=t.nextFetchPolicy;return"cache-and-network"===n||"network-only"===n?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(e,t){return this.nextFetchPolicy=r,"function"==typeof this.nextFetchPolicy?this.nextFetchPolicy(e,t):n}}):e.reobserve()}function Vo(e){!1!==globalThis.__DEV__&&O.error(24,e.message,e.stack)}function Uo(e){!1!==globalThis.__DEV__&&e&&!1!==globalThis.__DEV__&&O.debug(25,e)}function Qo(e){return"network-only"===e||"no-cache"===e||"standby"===e}Fr(jo);var Bo=new($e?WeakMap:Map);function Ko(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return Bo.set(e,(Bo.get(e)+1)%1e15),n.apply(this,arguments)})}function Go(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var zo=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;Bo.has(n)||(Bo.set(n,0),Ko(n,"evict"),Ko(n,"modify"),Ko(n,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||Ro.loading;return this.variables&&this.networkStatus!==Ro.loading&&!mi(this.variables,e.variables)&&(t=Ro.setVariables),mi(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){Go(this),this.dirty=!1},e.prototype.resetDiff=function(){this.lastDiff=void 0},e.prototype.getDiff=function(){var e=this.getDiffOptions();if(this.lastDiff&&mi(e,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var t=this.observableQuery;if(t&&"no-cache"===t.options.fetchPolicy)return{complete:!1};var n=this.cache.diff(e);return this.updateLastDiff(n,e),n},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t,n=this,r=this.lastDiff&&this.lastDiff.diff;e&&!e.complete&&(null===(t=this.observableQuery)||void 0===t?void 0:t.getLastError())||(this.updateLastDiff(e),this.dirty||mi(r&&r.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return n.notify()}),0))))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():qo(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;Go(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Lo(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel;var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var n=this.observableQuery;if(!n||"no-cache"!==n.options.fetchPolicy){var r=s(s({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&mi(r,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=r))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===Bo.get(this.cache)&&mi(t,n.variables)&&mi(e.data,n.result.data))},e.prototype.markResult=function(e,t,n,r){var i=this,o=new nr,s=Bn(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Bn(e.incremental)){var a=qr(this.getDiff().result,e);e.data=a}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=o.merge(c.result,e.data)}this.graphQLErrors=s,"no-cache"===n.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):0!==r&&(Wo(e,n.errorPolicy)?this.cache.performTransaction((function(o){if(i.shouldWrite(e,n.variables))o.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:1===r}),i.lastWrite={result:e,variables:n.variables,dmCount:Bo.get(i.cache)};else if(i.lastDiff&&i.lastDiff.diff.complete)return void(e.data=i.lastDiff.diff.result);var s=i.getDiffOptions(n.variables),a=o.diff(s);!i.stopped&&mi(i.variables,n.variables)&&i.updateWatch(n.variables),i.updateLastDiff(a,s),a.complete&&(e.data=a.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Ro.ready},e.prototype.markError=function(e){return this.networkStatus=Ro.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function Wo(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!Vr(e);return!r&&n&&e.data&&(r=!0),r}var Yo=Object.prototype.hasOwnProperty,Ho=Object.create(null),Jo=function(){function e(e){var t=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new vt(gt["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new He(!1);var n=new Vn((function(e){return t.cache.transformDocument(e)}),{cache:!1});this.cache=e.cache,this.link=e.link,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientAwareness=e.clientAwareness,this.localState=e.localState,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults;var r=e.documentTransform;this.documentTransform=r?n.concat(r).concat(n):n,this.defaultContext=e.defaultContext||Object.create(null),(this.onBroadcast=e.onBroadcast)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,n){e.stopQueryNoBroadcast(n)})),this.cancelPendingFetches(x(26))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){return c(this,arguments,void 0,(function(e){var t,n,r,i,o,a,c,l=e.mutation,f=e.variables,h=e.optimisticResponse,p=e.updateQueries,d=e.refetchQueries,v=void 0===d?[]:d,y=e.awaitRefetchQueries,m=void 0!==y&&y,g=e.update,b=e.onQueryUpdated,E=e.fetchPolicy,S=void 0===E?(null===(a=this.defaultOptions.mutate)||void 0===a?void 0:a.fetchPolicy)||"network-only":E,T=e.errorPolicy,k=void 0===T?(null===(c=this.defaultOptions.mutate)||void 0===c?void 0:c.errorPolicy)||"none":T,w=e.keepRootFields,_=e.context;return u(this,(function(e){switch(e.label){case 0:return O(l,27),O("network-only"===S||"no-cache"===S,28),t=this.generateMutationId(),l=this.cache.transformForLink(this.transform(l)),n=this.getDocumentInfo(l).hasClientExports,f=this.getVariables(l,f),n?[4,this.localState.addExportedVariables(l,f,_)]:[3,2];case 1:f=e.sent(),e.label=2;case 2:return r=this.mutationStore&&(this.mutationStore[t]={mutation:l,variables:f,loading:!0,error:null}),i=h&&this.markMutationOptimistic(h,{mutationId:t,document:l,variables:f,fetchPolicy:S,errorPolicy:k,context:_,updateQueries:p,update:g,keepRootFields:w}),this.broadcastQueries(),o=this,[2,new Promise((function(e,n){return Rr(o.getObservableFromLink(l,s(s({},_),{optimisticResponse:i?h:void 0}),f,{},!1),(function(e){if(Vr(e)&&"none"===k)throw new ni({graphQLErrors:Ur(e)});r&&(r.loading=!1,r.error=null);var n=s({},e);return"function"==typeof v&&(v=v(n)),"ignore"===k&&Vr(n)&&delete n.errors,o.markMutationResult({mutationId:t,result:n,document:l,variables:f,fetchPolicy:S,errorPolicy:k,context:_,update:g,updateQueries:p,awaitRefetchQueries:m,refetchQueries:v,removeOptimistic:i?t:void 0,onQueryUpdated:b,keepRootFields:w})})).subscribe({next:function(t){o.broadcastQueries(),"hasNext"in t&&!1!==t.hasNext||e(t)},error:function(e){r&&(r.loading=!1,r.error=e),i&&o.cache.removeOptimistic(t),o.broadcastQueries(),n(e instanceof ni?e:new ni({networkError:e}))}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var n=this;void 0===t&&(t=this.cache);var r=e.result,i=[],o="no-cache"===e.fetchPolicy;if(!o&&Wo(r,e.errorPolicy)){if(Mr(r)||i.push({result:r.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Mr(r)&&Bn(r.incremental)){var a=t.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),c=void 0;a.result&&(c=qr(a.result,r)),void 0!==c&&(r.data=c,i.push({result:c,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach((function(e,o){var s=e.observableQuery,a=s&&s.queryName;if(a&&Yo.call(u,a)){var c=u[a],l=n.queries.get(o),f=l.document,h=l.variables,p=t.diff({query:f,variables:h,returnPartialData:!0,optimistic:!1}),d=p.result;if(p.complete&&d){var v=c(d,{mutationResult:r,queryName:f&&zt(f)||void 0,queryVariables:h});v&&i.push({result:v,dataId:"ROOT_QUERY",query:f,variables:h})}}}))}if(i.length>0||(e.refetchQueries||"").length>0||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(t){o||i.forEach((function(e){return t.write(e)}));var a,c=e.update,u=!(Mr(a=r)||function(e){return"hasNext"in e&&"data"in e}(a))||Mr(r)&&!r.hasNext;if(c){if(!o){var l=t.diff({id:"ROOT_MUTATION",query:n.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});l.complete&&("incremental"in(r=s(s({},r),{data:l.result}))&&delete r.incremental,"hasNext"in r&&delete r.hasNext)}u&&c(t,r,{context:e.context,variables:e.variables})}o||e.keepRootFields||!u||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var n=t.fieldName,r=t.DELETE;return"__typename"===n?e:r}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach((function(e){return l.push(e)})),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then((function(){return r}))}return Promise.resolve(r)},e.prototype.markMutationOptimistic=function(e,t){var n=this,r="function"==typeof e?e(t.variables,{IGNORE:Ho}):e;return r!==Ho&&(this.cache.recordOptimisticTransaction((function(e){try{n.markMutationResult(s(s({},t),{result:{data:r}}),e)}catch(e){!1!==globalThis.__DEV__&&O.error(e)}}),t.mutationId),!0)},e.prototype.fetchQuery=function(e,t,n){return this.fetchConcastWithInfo(e,t,n).concast.promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},e.prototype.getDocumentInfo=function(e){var t=this.transformCache;if(!t.has(e)){var n={hasClientExports:Ke(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:Be(["nonreactive"],e),clientQuery:this.localState.clientQuery(e),serverQuery:Yn([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],e),defaultVars:Jt(Gt(e)),asQuery:s(s({},e),{definitions:e.definitions.map((function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?s(s({},e),{operation:"query"}):e}))})};t.set(e,n)}return t.get(e)},e.prototype.getVariables=function(e,t){return s(s({},this.getDocumentInfo(e).defaultVars),t)},e.prototype.watchQuery=function(e){var t=this.transform(e.query);void 0===(e=s(s({},e),{variables:this.getVariables(t,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var n=new zo(this),r=new jo({queryManager:this,queryInfo:n,options:e});return r.lastQuery=t,this.queries.set(r.queryId,n),n.init({document:t,observableQuery:r,variables:r.variables}),r},e.prototype.query=function(e,t){var n=this;return void 0===t&&(t=this.generateQueryId()),O(e.query,29),O("Document"===e.query.kind,30),O(!e.returnPartialData,31),O(!e.pollInterval,32),this.fetchQuery(t,s(s({},e),{query:this.transform(e.query)})).finally((function(){return n.stopQuery(t)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(x(33)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=Ro.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var n=new Map,r=new Map,i=new Set;return Array.isArray(e)&&e.forEach((function(e){var n;"string"==typeof e?r.set(e,!1):tt(n=e)&&"Document"===n.kind&&Array.isArray(n.definitions)?r.set(t.transform(e),!1):tt(e)&&e.query&&i.add(e)})),this.queries.forEach((function(t,i){var o=t.observableQuery,s=t.document;if(o){if("all"===e)return void n.set(i,o);var a=o.queryName;if("standby"===o.options.fetchPolicy||"active"===e&&!o.hasObservers())return;("active"===e||a&&r.has(a)||s&&r.has(s))&&(n.set(i,o),a&&r.set(a,!0),s&&r.set(s,!0))}})),i.size&&i.forEach((function(e){var r=k("legacyOneTimeQuery"),i=t.getQuery(r).init({document:e.query,variables:e.variables}),o=new jo({queryManager:t,queryInfo:i,options:s(s({},e),{fetchPolicy:"network-only"})});O(o.queryId===r),i.setObservableQuery(o),n.set(r,o)})),!1!==globalThis.__DEV__&&r.size&&r.forEach((function(e,t){e||!1!==globalThis.__DEV__&&O.warn("string"==typeof t?34:35,t)})),n},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach((function(r,i){var o=r.options.fetchPolicy;r.resetLastResults(),(e||"standby"!==o&&"cache-only"!==o)&&n.push(r.refetch()),t.getQuery(i).setDiff(null)})),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,i=e.errorPolicy,o=void 0===i?"none":i,s=e.variables,a=e.context,c=void 0===a?{}:a,u=e.extensions,l=void 0===u?{}:u;n=this.transform(n),s=this.getVariables(n,s);var f=function(e){return t.getObservableFromLink(n,c,e,l).map((function(i){"no-cache"!==r&&(Wo(i,o)&&t.cache.write({query:n,result:i.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries());var s=Vr(i),a=function(e){return!!e.extensions&&Array.isArray(e.extensions[ei])}(i);if(s||a){var c={};if(s&&(c.graphQLErrors=i.errors),a&&(c.protocolErrors=i.extensions[ei]),"none"===o||a)throw new ni(c)}return"ignore"===o&&delete i.errors,i}))};if(this.getDocumentInfo(n).hasClientExports){var h=this.localState.addExportedVariables(n,s,c).then(f);return new wr((function(e){var t=null;return h.then((function(n){return t=n.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return f(s)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,n,r,i){var o,a,c=this;void 0===i&&(i=null!==(o=null==t?void 0:t.queryDeduplication)&&void 0!==o?o:this.queryDeduplication);var u=this.getDocumentInfo(e),l=u.serverQuery,f=u.clientQuery;if(l){var h=this.inFlightLinkObservables,p=this.link,d={query:l,variables:n,operationName:zt(l)||void 0,context:this.prepareContext(s(s({},t),{forceFetch:!i})),extensions:r};if(t=d.context,i){var v=Un(l),y=At(n),m=h.lookup(v,y);if(!(a=m.observable)){var g=new Pr([Jr(p,d)]);a=m.observable=g,g.beforeNext((function(){h.remove(v,y)}))}}else a=new Pr([Jr(p,d)])}else a=new Pr([wr.of({data:{}})]),t=this.prepareContext(t);return f&&(a=Rr(a,(function(e){return c.localState.runResolvers({document:f,remoteResult:e,context:t,variables:n})}))),a},e.prototype.getResultsFromLink=function(e,t,n){var r=e.lastRequestId=this.generateRequestId(),i=this.cache.transformForLink(n.query);return Rr(this.getObservableFromLink(i,n.context,n.variables),(function(o){var s=Ur(o),a=s.length>0,c=n.errorPolicy;if(r>=e.lastRequestId){if(a&&"none"===c)throw e.markError(new ni({graphQLErrors:s}));e.markResult(o,i,n,t),e.markReady()}var u={data:o.data,loading:!1,networkStatus:Ro.ready};return a&&"none"===c&&(u.data=void 0),a&&"ignore"!==c&&(u.errors=s,u.networkStatus=Ro.error),u}),(function(t){var n=ti(t)?t:new ni({networkError:t});throw r>=e.lastRequestId&&e.markError(n),n}))},e.prototype.fetchConcastWithInfo=function(e,t,n,r){var i=this;void 0===n&&(n=Ro.loading),void 0===r&&(r=t.query);var o,s,a=this.getVariables(r,t.variables),c=this.getQuery(e),u=this.defaultOptions.watchQuery,l=t.fetchPolicy,f=void 0===l?u&&u.fetchPolicy||"cache-first":l,h=t.errorPolicy,p=void 0===h?u&&u.errorPolicy||"none":h,d=t.returnPartialData,v=void 0!==d&&d,y=t.notifyOnNetworkStatusChange,m=void 0!==y&&y,g=t.context,b=void 0===g?{}:g,E=Object.assign({},t,{query:r,variables:a,fetchPolicy:f,errorPolicy:p,returnPartialData:v,notifyOnNetworkStatusChange:m,context:b}),S=function(e){E.variables=e;var r=i.fetchQueryByPolicy(c,E,n);return"standby"!==E.fetchPolicy&&r.sources.length>0&&c.observableQuery&&c.observableQuery.applyNextFetchPolicy("after-fetch",t),r},T=function(){return i.fetchCancelFns.delete(e)};if(this.fetchCancelFns.set(e,(function(e){T(),setTimeout((function(){return o.cancel(e)}))})),this.getDocumentInfo(E.query).hasClientExports)o=new Pr(this.localState.addExportedVariables(E.query,E.variables,E.context).then(S).then((function(e){return e.sources}))),s=!0;else{var k=S(E.variables);s=k.fromLink,o=new Pr(k.sources)}return o.promise.then(T,T),{concast:o,fromLink:s}},e.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,r=e.include,i=e.optimistic,o=void 0!==i&&i,s=e.removeOptimistic,a=void 0===s?o?k("refetchQueries"):void 0:s,c=e.onQueryUpdated,u=new Map;r&&this.getObservableQueries(r).forEach((function(e,n){u.set(n,{oq:e,lastDiff:t.getQuery(n).getDiff()})}));var l=new Map;return n&&this.cache.batch({update:n,optimistic:o&&a||!1,removeOptimistic:a,onWatchUpdated:function(e,t,n){var r=e.watcher instanceof zo&&e.watcher.observableQuery;if(r){if(c){u.delete(r.queryId);var i=c(r,t,n);return!0===i&&(i=r.refetch()),!1!==i&&l.set(r,i),i}null!==c&&u.set(r.queryId,{oq:r,lastDiff:n,diff:t})}}}),u.size&&u.forEach((function(e,n){var r,i=e.oq,o=e.lastDiff,s=e.diff;if(c){if(!s){var a=i.queryInfo;a.reset(),s=a.getDiff()}r=c(i,s,o)}c&&!0!==r||(r=i.refetch()),!1!==r&&l.set(i,r),n.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(n)})),a&&this.cache.removeOptimistic(a),l},e.prototype.fetchQueryByPolicy=function(e,t,n){var r=this,i=t.query,o=t.variables,a=t.fetchPolicy,c=t.refetchWritePolicy,u=t.errorPolicy,l=t.returnPartialData,f=t.context,h=t.notifyOnNetworkStatusChange,p=e.networkStatus;e.init({document:i,variables:o,networkStatus:n});var d=function(){return e.getDiff()},v=function(t,n){void 0===n&&(n=e.networkStatus||Ro.loading);var a=t.result;!1===globalThis.__DEV__||l||mi(a,{})||Uo(t.missing);var c=function(e){return wr.of(s({data:e,loading:Lo(n),networkStatus:n},t.complete?null:{partial:!0}))};return a&&r.getDocumentInfo(i).hasForcedResolvers?r.localState.runResolvers({document:i,remoteResult:{data:a},context:f,variables:o,onlyRunForcedResolvers:!0}).then((function(e){return c(e.data||void 0)})):"none"===u&&n===Ro.refetch&&Array.isArray(t.missing)?c(void 0):c(a)},y="no-cache"===a?0:n===Ro.refetch&&"merge"!==c?1:2,m=function(){return r.getResultsFromLink(e,y,{query:i,variables:o,context:f,fetchPolicy:a,errorPolicy:u})},g=h&&"number"==typeof p&&p!==n&&Lo(n);switch(a){default:case"cache-first":return(b=d()).complete?{fromLink:!1,sources:[v(b,e.markReady())]}:l||g?{fromLink:!0,sources:[v(b),m()]}:{fromLink:!0,sources:[m()]};case"cache-and-network":var b;return(b=d()).complete||l||g?{fromLink:!0,sources:[v(b),m()]}:{fromLink:!0,sources:[m()]};case"cache-only":return{fromLink:!1,sources:[v(d(),e.markReady())]};case"network-only":return g?{fromLink:!0,sources:[v(d()),m()]}:{fromLink:!0,sources:[m()]};case"no-cache":return g?{fromLink:!0,sources:[v(e.getDiff()),m()]}:{fromLink:!0,sources:[m()]};case"standby":return{fromLink:!1,sources:[]}}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new zo(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return s(s(s({},this.defaultContext),t),{clientAwareness:this.clientAwareness})},e}(),$o=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=Zn(t.resolvers,e)})):this.resolvers=Zn(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){return c(this,arguments,void 0,(function(e){var t=e.document,n=e.remoteResult,r=e.context,i=e.variables,o=e.onlyRunForcedResolvers,a=void 0!==o&&o;return u(this,(function(e){return t?[2,this.resolveDocument(t,n.data,r,i,this.fragmentMatcher,a).then((function(e){return s(s({},n),{data:e.result})}))]:[2,n]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return Be(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return $n(e)},e.prototype.prepareContext=function(e){var t=this.cache;return s(s({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e){return c(this,arguments,void 0,(function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),u(this,(function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then((function(e){return s(s({},t),e.exportedVariables)}))]:[2,s({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return Re(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return Ce}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:Jn(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t){return c(this,arguments,void 0,(function(e,t,n,r,i,o){var a,c,l,f,h,p,d,v,y,m;return void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i=function(){return!0}),void 0===o&&(o=!1),u(this,(function(u){return a=Ht(e),c=Wt(e),l=rt(c),f=this.collectSelectionsToResolve(a,l),h=a.operation,p=h?h.charAt(0).toUpperCase()+h.slice(1):"Query",v=(d=this).cache,y=d.client,m={fragmentMap:l,context:s(s({},n),{cache:v,client:y}),variables:r,fragmentMatcher:i,defaultOperationType:p,exportedVariables:{},selectionsToResolve:f,onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(a.selectionSet,false,t,m).then((function(e){return{result:e,exportedVariables:m.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,n,r){return c(this,void 0,void 0,(function(){var i,o,s,a,l,f=this;return u(this,(function(h){return i=r.fragmentMap,o=r.context,s=r.variables,a=[n],l=function(e){return c(f,void 0,void 0,(function(){var c,l;return u(this,(function(u){return(t||r.selectionsToResolve.has(e))&&Qe(e,s)?Bt(e)?[2,this.resolveField(e,t,n,r).then((function(t){var n;void 0!==t&&a.push(((n={})[Ut(e)]=t,n))}))]:(!function(e){return"InlineFragment"===e.kind}(e)?(c=i[e.name.value],O(c,18,e.name.value)):c=e,c&&c.typeCondition&&(l=c.typeCondition.name.value,r.fragmentMatcher(n,l,o))?[2,this.resolveSelectionSet(c.selectionSet,t,n,r).then((function(e){a.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(l)).then((function(){return er(a)}))]}))}))},e.prototype.resolveField=function(e,t,n,r){return c(this,void 0,void 0,(function(){var i,o,s,a,c,l,f,h,p,d=this;return u(this,(function(u){return n?(i=r.variables,o=e.name.value,s=Ut(e),a=o!==s,c=n[s]||n[o],l=Promise.resolve(c),r.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(f=n.__typename||r.defaultOperationType,(h=this.resolvers&&this.resolvers[f])&&(p=h[a?o:s])&&(l=Promise.resolve(to.withValue(this.cache,p,[n,Vt(e,i),r.context,{field:e,fragmentMap:r.fragmentMap}])))),[2,l.then((function(n){var i,o;if(void 0===n&&(n=c),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=n)}))})),!e.selectionSet)return n;if(null==n)return n;var s=null!==(o=null===(i=e.directives)||void 0===i?void 0:i.some((function(e){return"client"===e.name.value})))&&void 0!==o&&o;return Array.isArray(n)?d.resolveSubSelectedArray(e,t||s,n,r):e.selectionSet?d.resolveSelectionSet(e.selectionSet,t||s,n,r):void 0}))]):[2,null]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,n,r){var i=this;return Promise.all(n.map((function(n){return null===n?null:Array.isArray(n)?i.resolveSubSelectedArray(e,t,n,r):e.selectionSet?i.resolveSelectionSet(e.selectionSet,t,n,r):void 0})))},e.prototype.collectSelectionsToResolve=function(e,t){var n=function(e){return!Array.isArray(e)},r=this.selectionsToResolveCache;return function e(i){if(!r.has(i)){var o=new Set;r.set(i,o),Re(i,{Directive:function(e,t,r,i,s){"client"===e.name.value&&s.forEach((function(e){n(e)&&Ue(e)&&o.add(e)}))},FragmentSpread:function(r,i,s,a,c){var u=t[r.name.value];O(u,19,r.name.value);var l=e(u);l.size>0&&(c.forEach((function(e){n(e)&&Ue(e)&&o.add(e)})),o.add(r),l.forEach((function(e){o.add(e)})))}})}return r.get(i)}(e)},e}(),Xo=!1,Zo=function(){function e(e){var t=this;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw x(15);var n=e.uri,r=e.credentials,i=e.headers,o=e.cache,a=e.documentTransform,c=e.ssrMode,u=void 0!==c&&c,l=e.ssrForceFetchDelay,f=void 0===l?0:l,h=e.connectToDevTools,p=e.queryDeduplication,d=void 0===p||p,v=e.defaultOptions,y=e.defaultContext,m=e.assumeImmutableResults,g=void 0===m?o.assumeImmutableResults:m,E=e.resolvers,S=e.typeDefs,T=e.fragmentMatcher,k=e.name,w=e.version,_=e.devtools,O=e.link;O||(O=n?new hi({uri:n,credentials:r,headers:i}):Hr.empty()),this.link=O,this.cache=o,this.disableNetworkFetches=u||f>0,this.queryDeduplication=d,this.defaultOptions=v||Object.create(null),this.typeDefs=S,this.devtoolsConfig=s(s({},_),{enabled:(null==_?void 0:_.enabled)||h}),void 0===this.devtoolsConfig.enabled&&(this.devtoolsConfig.enabled=!1!==globalThis.__DEV__),f&&setTimeout((function(){return t.disableNetworkFetches=!1}),f),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=b,this.localState=new $o({cache:o,client:this,resolvers:E,fragmentMatcher:T}),this.queryManager=new Jo({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:y,documentTransform:a,queryDeduplication:d,ssrMode:u,clientAwareness:{name:k,version:w},localState:this.localState,assumeImmutableResults:g,onBroadcast:this.devtoolsConfig.enabled?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return e.prototype.connectToDevTools=function(){if("undefined"!=typeof window){var e=window,t=Symbol.for("apollo.devtools");(e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this,Xo||!1===globalThis.__DEV__||(Xo=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout((function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var e=window.navigator,t=e&&e.userAgent,n=void 0;"string"==typeof t&&(t.indexOf("Chrome/")>-1?n="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":t.indexOf("Firefox/")>-1&&(n="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),n&&!1!==globalThis.__DEV__&&O.log("Download the Apollo DevTools for a better development experience: %s",n)}}),1e4))}},Object.defineProperty(e.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Br(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=s(s({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=Br(this.defaultOptions.query,e)),O("cache-and-network"!==e.fetchPolicy,16),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=s(s({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Br(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.watchFragment=function(e){return this.cache.watchFragment(e)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Jr(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],r=[];t.forEach((function(e,t){n.push(t),r.push(e)}));var i=Promise.all(r);return i.queries=n,i.results=r,i.catch((function(e){!1!==globalThis.__DEV__&&O.debug(17,e)})),i},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},Object.defineProperty(e.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),e}();!1!==globalThis.__DEV__&&(Zo.prototype.getMemoryInternals=St);var es=new Map,ts=new Map,ns=!0,rs=!1;function is(e){return e.replace(/[\s,]+/g," ").trim()}function os(e){var t=new Set,n=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var r=e.name.value,i=is((s=e.loc).source.body.substring(s.start,s.end)),o=ts.get(r);o&&!o.has(i)?ns&&console.warn("Warning: fragment with name "+r+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):o||ts.set(r,o=new Set),o.add(i),t.has(i)||(t.add(i),n.push(e))}else n.push(e);var s})),s(s({},e),{definitions:n})}function ss(e){var t=is(e);if(!es.has(t)){var n=function(e,t){return new Oe(e,t).parseDocument()}(e,{experimentalFragmentVariables:rs,allowLegacyFragmentVariables:rs});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");es.set(t,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(n){var r=e[n];r&&"object"==typeof r&&t.add(r)}))}));var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}(os(n)))}return es.get(t)}function as(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];"string"==typeof e&&(e=[e]);var r=e[0];return t.forEach((function(t,n){t&&"Document"===t.kind?r+=t.loc.source.body:r+=t,r+=e[n+1]})),ss(r)}var cs,us,ls,fs,hs,ps,ds,vs,ys,ms,gs,bs,Es,Ss,Ts,ks,ws,_s,Os,xs,Ns,Ds,Is,As=as,Cs=function(){es.clear(),ts.clear()},Rs=function(){ns=!1},Fs=function(){rs=!0},Ls=function(){rs=!1};(cs=as).gql=As,cs.resetCaches=Cs,cs.disableFragmentWarnings=Rs,cs.enableExperimentalFragmentVariables=Fs,cs.disableExperimentalFragmentVariables=Ls,as.default=as,exports.ItemType=void 0,(us=exports.ItemType||(exports.ItemType={})).PRODUCT="PRODUCT",us.PACKAGE="PACKAGE",function(e){e.OK="OK",e.CUSTOMER_BLACKLISTED="CUSTOMER_BLACKLISTED"}(ls||(ls={})),exports.GeinsEventType=void 0,(fs=exports.GeinsEventType||(exports.GeinsEventType={})).USER="USER",fs.USER_LOGIN="USER_LOGIN",fs.USER_LOGOUT="USER_LOGOUT",fs.USER_UPDATE="USER_UPDATE",fs.USER_DELETE="USER_DELETE",fs.CART="CART",fs.CART_ADD="CART_ADD",fs.CART_REMOVE="CART_REMOVE",fs.CART_UPDATE="CART_UPDATE",fs.CART_CLEAR="CART_CLEAR",exports.CustomerType=void 0,(hs=exports.CustomerType||(exports.CustomerType={})).PERSON="PERSON",hs.ORGANIZATION="ORGANIZATION",exports.GeinsLogLevel=void 0,(ps=exports.GeinsLogLevel||(exports.GeinsLogLevel={})).NONE="NONE",ps.DEBUG="DEBUG",ps.INFO="INFO",ps.WARN="WARN",ps.ERROR="ERROR",exports.RuntimeContext=void 0,(ds=exports.RuntimeContext||(exports.RuntimeContext={})).SERVER="server",ds.CLIENT="client",ds.HYBRID="hybrid",exports.LinkAttributeRelEnum=void 0,(vs=exports.LinkAttributeRelEnum||(exports.LinkAttributeRelEnum={})).follow="follow",vs.noopener="noopener",vs.noreferrer="noreferrer",vs.alternate="alternate",vs.author="author",vs.bookmark="bookmark",vs.external="external",vs.help="help",vs.license="license",vs.next="next",vs.nofollow="nofollow",vs.prev="prev",vs.search="search",vs.tag="tag",exports.AuthClientConnectionModes=void 0,(ys=exports.AuthClientConnectionModes||(exports.AuthClientConnectionModes={})).Proxy="Proxy",ys.Direct="Direct",exports.ProductListSortType=void 0,(ms=exports.ProductListSortType||(exports.ProductListSortType={})).NONE="NONE",ms.PRICE="PRICE",ms.PRICE_DESC="PRICE_DESC",ms.MOST_SOLD="MOST_SOLD",ms.VOTES="VOTES",ms.BRAND="BRAND",ms.LATEST="LATEST",ms.RELEVANCE="RELEVANCE",ms.FACET_ORDER="FACET_ORDER",ms.ALPHABETICAL="ALPHABETICAL",ms.ALPHABETICAL_DESC="ALPHABETICAL_DESC",ms.AVAILABLE_STOCK="AVAILABLE_STOCK",ms.AVAILABLE_STOCK_DESC="AVAILABLE_STOCK_DESC",ms.TOTAL_STOCK="TOTAL_STOCK",ms.TOTAL_STOCK_DESC="TOTAL_STOCK_DESC",exports.ProductFilterModeType=void 0,(gs=exports.ProductFilterModeType||(exports.ProductFilterModeType={})).BY_GROUP="BY_GROUP",gs.CURRENT="CURRENT",exports.FilterSystemEntityTypes=void 0,(bs=exports.FilterSystemEntityTypes||(exports.FilterSystemEntityTypes={})).Brand="Brand",bs.Category="Category",bs.Price="Price",bs.Sku="Sku",bs.StockStatus="StockStatus",bs.DiscountCampaign="DiscountCampaign",bs.DiscountCampaignNumber="DiscountCampaignNumber",bs.Discount="Discount",bs.ReducedPrice="ReducedPrice",exports.GeinsCheckoutStatus=void 0,(Es=exports.GeinsCheckoutStatus||(exports.GeinsCheckoutStatus={})).CustomerBlacklistedType="CUSTOMER_BLACKLISTED",Es.OkType="OK",exports.GeinsCustomerType=void 0,(Ss=exports.GeinsCustomerType||(exports.GeinsCustomerType={})).OrganizationType="ORGANIZATION",Ss.PersonType="PERSON",exports.GeinsDiscountType=void 0,(Ts=exports.GeinsDiscountType||(exports.GeinsDiscountType={})).NoneType="NONE",Ts.PriceCampaignType="PRICE_CAMPAIGN",Ts.SalePriceType="SALE_PRICE",exports.GeinsFilterMode=void 0,(ks=exports.GeinsFilterMode||(exports.GeinsFilterMode={})).ByGroupType="BY_GROUP",ks.CurrentType="CURRENT",exports.GeinsGender=void 0,(ws=exports.GeinsGender||(exports.GeinsGender={})).ManType="MAN",ws.UnspecifiedType="UNSPECIFIED",ws.WomanType="WOMAN",exports.GeinsPaymentType=void 0,(_s=exports.GeinsPaymentType||(exports.GeinsPaymentType={})).AvardaType="AVARDA",_s.KlarnaType="KLARNA",_s.StandardType="STANDARD",_s.SveaType="SVEA",_s.WalleyType="WALLEY",_s.GeinsPayType="GEINS_PAY",exports.GeinsProductRelation=void 0,(Os=exports.GeinsProductRelation||(exports.GeinsProductRelation={})).AccessoriesType="ACCESSORIES",Os.RelatedType="RELATED",Os.SimilarType="SIMILAR",exports.GeinsSortType=void 0,(xs=exports.GeinsSortType||(exports.GeinsSortType={})).AlphabeticalType="ALPHABETICAL",xs.AlphabeticalDescType="ALPHABETICAL_DESC",xs.AvailableStockType="AVAILABLE_STOCK",xs.AvailableStockDescType="AVAILABLE_STOCK_DESC",xs.BrandType="BRAND",xs.Custom_1Type="CUSTOM_1",xs.Custom_2Type="CUSTOM_2",xs.Custom_3Type="CUSTOM_3",xs.Custom_4Type="CUSTOM_4",xs.Custom_5Type="CUSTOM_5",xs.FacetOrderType="FACET_ORDER",xs.LatestType="LATEST",xs.MostSoldType="MOST_SOLD",xs.NoneType="NONE",xs.PriceType="PRICE",xs.PriceDescType="PRICE_DESC",xs.RelevanceType="RELEVANCE",xs.TotalStockType="TOTAL_STOCK",xs.TotalStockDescType="TOTAL_STOCK_DESC",xs.VotesType="VOTES",exports.DiscountType=void 0,(Ns=exports.DiscountType||(exports.DiscountType={}))[Ns.PERCENTAGE=0]="PERCENTAGE",Ns[Ns.FIXED_AMOUNT=1]="FIXED_AMOUNT",exports.Gender=void 0,(Ds=exports.Gender||(exports.Gender={})).UNSET="unset",Ds.UNSPECIFIED="unspecified",Ds.WOMAN="woman",Ds.MAN="man",exports.PaymentOptionCheckoutType=void 0,(Is=exports.PaymentOptionCheckoutType||(exports.PaymentOptionCheckoutType={})).STANDARD="STANDARD",Is.EXTERNAL="EXTERNAL",Is.GEINS_PAY="GEINS_PAY";var Ps,Ms,js="https://merchantapi.geins.io/graphql",qs="https://merchantapi.geins.io/auth/sign/{API-KEY}?identity=",Vs="https://auth-service.geins.io/api/{ACCOUNT}_{ENV}",Us="https://{ACCOUNT}.commerce.services",Qs="https://mgmtapi.geins.io",Bs="https://merchantapi.geins.io/redirect/urlhistory",Ks="https://merchantapi.geins.io/redirect/aliashistory",Gs={main:js,auth:Vs,auth_sign:qs,image:Us},zs={USER:"geins-user",USER_AUTH:"geins-auth",USER_TYPE:"geins-user-type",USER_MAX_AGE:"geins-user-maxage",REFRESH_TOKEN:"geins-auth-refresh-token"},Ws=new Map([["geins-cart","{geins.cartid}"],["geins-pm","{geins.paymentMethodId}"],["geins-pt","{geins.paymentType}"],["geins-uid","{payment.uid}"]]),Ys=function(){function e(e){this.apiKey=e}return e.prototype.getEndpointUrl=function(e){return"".concat(e,"/").concat(this.apiKey)},e.prototype.request=function(e){return c(this,void 0,void 0,(function(){var t,n;return u(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,fetch(e,{headers:{Accept:"application/json","Content-Type":"application/json"}})];case 1:if(!(t=r.sent()).ok)throw new Error("Request failed with status ".concat(t.status,": ").concat(t.statusText));return[4,t.json()];case 2:return[2,r.sent()];case 3:throw n=r.sent(),console.error("Error fetching data from ".concat(e,":"),n),n;case 4:return[2]}}))}))},e.prototype.getUrlHistory=function(e){return c(this,void 0,void 0,(function(){var t;return u(this,(function(n){return t=this.getEndpointUrl(Bs)+(e?"?offset=".concat(e):""),[2,this.request(t)]}))}))},e.prototype.getSlugHistory=function(e){return c(this,void 0,void 0,(function(){var t;return u(this,(function(n){return t=this.getEndpointUrl(Ks)+(e?"?offset=".concat(e):""),[2,this.request(t)]}))}))},e}(),Hs=function(){function e(e){this.baseUrl=Qs,this.apiKey=e.apiKey,this.authToken=this.createAuthToken(e)}return e.prototype.createAuthToken=function(e){return btoa("".concat(e.username,":").concat(e.password))},e.prototype.getEndpointUrl=function(e){return"".concat(this.baseUrl,"/").concat(e)},e.prototype.request=function(e,t){return c(this,arguments,void 0,(function(e,t,n){var r,i;return void 0===n&&(n={}),u(this,(function(o){switch(o.label){case 0:return r=this.getEndpointUrl(t),i={method:e,headers:{Accept:"application/json","Content-Type":"application/json","x-apikey":this.apiKey,Authorization:"Bearer ".concat(this.authToken)},body:JSON.stringify(n)},[4,fetch(r,i).then((function(e){return e.json()}))];case 1:return[2,o.sent()]}}))}))},e}(),Js=function(){function t(t){this.path="/",this.domain="",this.secure=!0,this.httpOnly=!1,this.cookie=e(),this.maxAge=0,t&&(t.path&&(this.path=t.path),t.domain&&(this.domain=t.domain),void 0!==t.secure&&(this.secure=t.secure),void 0!==t.httpOnly&&(this.httpOnly=t.httpOnly),void 0!==t.maxAge&&(this.maxAge=this.parseMaxAge(t.maxAge)))}return t.prototype.getConfig=function(){return{path:this.path,domain:this.domain,secure:this.secure,httpOnly:this.httpOnly,maxAge:this.maxAge}},t.prototype.parseMaxAge=function(e){if("string"==typeof e){var t=parseInt(e,10);return isNaN(t)?0:t}return e},t.prototype.configToCookieOptions=function(e){return{path:e.path,domain:e.domain,secure:e.secure,httpOnly:e.httpOnly,maxAge:void 0!==e.maxAge?this.parseMaxAge(e.maxAge):void 0}},t.prototype.getAll=function(){return this.cookie.getAll()},t.prototype.get=function(e){return this.cookie.get(e)||""},t.prototype.remove=function(e){this.cookie.remove(e)},t.prototype.set=function(e,t){var n=this.getConfig(),r=s(s(s({},n),t),e),i=this.configToCookieOptions(r);this.cookie.set(e.name,e.payload,i)},t}();exports.FetchPolicyOptions=void 0,(Ps=exports.FetchPolicyOptions||(exports.FetchPolicyOptions={})).CACHE_FIRST="cache-first",Ps.NETWORK_ONLY="network-only",Ps.CACHE_ONLY="cache-only",Ps.NO_CACHE="no-cache",Ps.STANDBY="standby",exports.OperationType=void 0,(Ms=exports.OperationType||(exports.OperationType={})).QUERY="query",Ms.MUTATION="mutation";var $s=function(){function e(e){this.fetchPolicy=exports.FetchPolicyOptions.CACHE_FIRST,this.pollInterval=0;var t=e.apiUrl,n=e.apiKey,r=e.userToken,i=e.fetchPolicy;this._apolloClient=this.createClient(t,n),this._cookieService=new Js,r&&(this._userToken=r),i&&(this.fetchPolicy=i)}return e.prototype.updateToken=function(e){this._userToken=e},Object.defineProperty(e.prototype,"userToken",{get:function(){return this._userToken},enumerable:!1,configurable:!0}),e.prototype.createClient=function(e,t){var n=new Fo({typePolicies:{CartType:{fields:{items:{merge:function(e,t){return t}},appliedCampaigns:{merge:function(e,t){return t}}}}}});return new Zo({uri:e,cache:n,headers:{Accept:"application/json","x-apikey":t}})},e.prototype.getClient=function(){return this._apolloClient},e.prototype.clearCacheAndRefetchQueries=function(){this._apolloClient.resetStore()},e.prototype.getFetchPolicy=function(e,t){return e===exports.OperationType.QUERY?t||this.fetchPolicy:e===exports.OperationType.MUTATION?exports.FetchPolicyOptions.NETWORK_ONLY:t===exports.FetchPolicyOptions.NO_CACHE||t===exports.FetchPolicyOptions.NETWORK_ONLY?t:exports.FetchPolicyOptions.NETWORK_ONLY},e.prototype.getOperationObject=function(e,t){var n,r,i=t.query,o=t.queryAsString,s=t.variables,a=t.requestOptions,c=i||as(o||""),u=a||{},l=this._userToken||(null===(r=this._cookieService)||void 0===r?void 0:r.get(zs.USER_AUTH));if(!c)throw new Error("Query is required");var f=((n={})[e]=c,n.variables=s,n.fetchPolicy=this.getFetchPolicy(e,u.fetchPolicy),n.pollInterval=u.pollInterval||this.pollInterval,n);return l&&(f.context={headers:{Authorization:"Bearer ".concat(l)}}),f},e.prototype.runQuery=function(e){return c(this,void 0,void 0,(function(){var t;return u(this,(function(n){return t=this.getOperationObject(exports.OperationType.QUERY,e),[2,this._apolloClient.query(t)]}))}))},e.prototype.runMutation=function(e){return c(this,void 0,void 0,(function(){var t;return u(this,(function(n){t=this.getOperationObject(exports.OperationType.MUTATION,e);try{return[2,this._apolloClient.mutate(t)]}catch(e){}return[2,{}]}))}))},e}(),Xs=function(){function e(e,t){if(this._apiClient=e,!t.channel)throw new Error("Channel is required");this._geinsSettings=t,this._channelId="".concat(t.channel,"|").concat(t.tld)}return e.prototype.destroy=function(){this._apiClient=void 0},e.prototype.createVariables=function(e){var t=s({},e);if(!t.languageId){if(!this._geinsSettings.locale)throw new Error("Language is required");t.languageId=this._geinsSettings.locale}if(!t.marketId){if(!this._geinsSettings.market)throw new Error("Market is required");t.marketId=this._geinsSettings.market}return t.channelId||(t.channelId=this._channelId),t},e.prototype.runQuery=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){if(!this._apiClient)throw new Error("Merchant API Client is not set");return[2,this._apiClient().runQuery(e)]}))}))},e.prototype.runQueryParsed=function(e){return c(this,void 0,void 0,(function(){var t,n;return u(this,(function(r){switch(r.label){case 0:return n=this.cleanObject,[4,this.runQuery(e)];case 1:return t=n.apply(this,[r.sent()]),[2,this.parseResult(t)]}}))}))},e.prototype.runMutation=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){if(!this._apiClient)throw new Error("Merchant API Client is not set");return[2,this._apiClient().runMutation(e)]}))}))},e.prototype.parseResult=function(e){return e},e.prototype.cleanObject=function(e){var t=this,n=Object.entries(e).reduce((function(e,n){var r=n[0],i=n[1];return r.startsWith("__typename")||(Array.isArray(i)?e[r]=i.map((function(e){return e&&"object"==typeof e?t.cleanObject(e):e})):e[r]=i&&"object"==typeof i?t.cleanObject(i):i),e}),{});return n},e}(),Zs=function(){function e(e){if(this.core=e,!e)throw new Error("Core is required");if(!e.client)throw new Error("Merchant API Client is not set");if(!e.geinsSettings)throw new Error("Settings are required");var t=e.client,n=e.geinsSettings;this._geinsSettings=n,this._apiClient=function(){return null!=t?t:void 0}}return e.prototype.pushEvent=function(e,t){var n=t?exports.GeinsEventType[t]:void 0;if(n&&n.includes("_")){var r=n.split("_")[0];this.core.events.push(e,r)}this.core.events.push(e,n)},e.prototype.getCore=function(){return this.core},e}(),ea={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"ChannelFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ChannelType"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"defaultLanguageId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"defaultMarketId"},arguments:[],directives:[]}]}}],loc:{start:0,end:105}};function ta(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){ta(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){ta(e,t)})),e.definitions&&e.definitions.forEach((function(e){ta(e,t)}))}ea.loc.source={body:"fragment ChannelFields on ChannelType {\n id\n name\n type\n url\n defaultLanguageId\n defaultMarketId\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var na={};function ra(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}ea.definitions.forEach((function(e){if(e.name){var t=new Set;ta(e,t),na[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[ra(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=na[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var s=o;o=new Set,s.forEach((function(e){i.has(e)||(i.add(e),(na[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=ra(e,t);r&&n.definitions.push(r)}))}(ea,"ChannelFields");var ia={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"LanguageFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"LanguageType"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"code"},arguments:[],directives:[]}]}}],loc:{start:0,end:63}};function oa(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){oa(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){oa(e,t)})),e.definitions&&e.definitions.forEach((function(e){oa(e,t)}))}ia.loc.source={body:"fragment LanguageFields on LanguageType {\n id\n name\n code\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var sa={};function aa(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}ia.definitions.forEach((function(e){if(e.name){var t=new Set;oa(e,t),sa[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[aa(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=sa[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var s=o;o=new Set,s.forEach((function(e){i.has(e)||(i.add(e),(sa[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=aa(e,t);r&&n.definitions.push(r)}))}(ia,"LanguageFields");var ca={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"CurrencyFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CurrencyType"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"symbol"},arguments:[],directives:[]}]}}],loc:{start:0,end:60}};function ua(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){ua(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){ua(e,t)})),e.definitions&&e.definitions.forEach((function(e){ua(e,t)}))}ca.loc.source={body:"fragment CurrencyFields on CurrencyType {\n code\n symbol\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var la={};function fa(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}ca.definitions.forEach((function(e){if(e.name){var t=new Set;ua(e,t),la[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[fa(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=la[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var s=o;o=new Set,s.forEach((function(e){i.has(e)||(i.add(e),(la[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=fa(e,t);r&&n.definitions.push(r)}))}(ca,"CurrencyFields");var ha={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"CountryFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CountryType"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"code"},arguments:[],directives:[]}]}}],loc:{start:0,end:56}};function pa(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){pa(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){pa(e,t)})),e.definitions&&e.definitions.forEach((function(e){pa(e,t)}))}ha.loc.source={body:"fragment CountryFields on CountryType {\n name\n code\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var da={};function va(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}ha.definitions.forEach((function(e){if(e.name){var t=new Set;pa(e,t),da[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[va(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=da[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var s=o;o=new Set,s.forEach((function(e){i.has(e)||(i.add(e),(da[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=va(e,t);r&&n.definitions.push(r)}))}(ha,"CountryFields");var ya={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"MarketFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MarketType"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"alias"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"allowedLanguages"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"LanguageFields"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"CountryFields"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"CurrencyFields"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"onlyDisplayInCheckout"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"virtual"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"groupKey"},arguments:[],directives:[]}]}}],loc:{start:0,end:313}};ya.loc.source={body:"#import './currencyFields.gql'\n#import './countryFields.gql'\n#import './languageFields.gql'\nfragment MarketFields on MarketType {\n id\n alias\n allowedLanguages {\n ...LanguageFields\n }\n country {\n ...CountryFields\n }\n currency {\n ...CurrencyFields\n }\n onlyDisplayInCheckout\n virtual\n groupKey\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var ma={};function ga(e){return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!ma[t]&&(ma[t]=!0,!0)}))}function ba(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){ba(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){ba(e,t)})),e.definitions&&e.definitions.forEach((function(e){ba(e,t)}))}ya.definitions=ya.definitions.concat(ga(ca.definitions)),ya.definitions=ya.definitions.concat(ga(ha.definitions)),ya.definitions=ya.definitions.concat(ga(ia.definitions));var Ea={};function Sa(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}ya.definitions.forEach((function(e){if(e.name){var t=new Set;ba(e,t),Ea[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[Sa(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=Ea[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var s=o;o=new Set,s.forEach((function(e){i.has(e)||(i.add(e),(Ea[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=Sa(e,t);r&&n.definitions.push(r)}))}(ya,"MarketFields");var Ta={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getChannel"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"channelId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},defaultValue:{kind:"NullValue"},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"channel"},arguments:[{kind:"Argument",name:{kind:"Name",value:"channelId"},value:{kind:"Variable",name:{kind:"Name",value:"channelId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ChannelFields"},directives:[]},{kind:"Field",name:{kind:"Name",value:"markets"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MarketFields"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"languages"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"LanguageFields"},directives:[]}]}}]}}]}}],loc:{start:0,end:358}};Ta.loc.source={body:"#import './fragments/channelFields.gql'\n#import './fragments/languageFields.gql'\n#import './fragments/marketFields.gql'\n#import './fragments/currencyFields.gql'\n\nquery getChannel($channelId: String = null) {\n channel(channelId: $channelId) {\n ...ChannelFields\n markets {\n ...MarketFields\n }\n languages {\n ...LanguageFields\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var ka={};function wa(e){return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!ka[t]&&(ka[t]=!0,!0)}))}function _a(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){_a(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){_a(e,t)})),e.definitions&&e.definitions.forEach((function(e){_a(e,t)}))}Ta.definitions=Ta.definitions.concat(wa(ea.definitions)),Ta.definitions=Ta.definitions.concat(wa(ia.definitions)),Ta.definitions=Ta.definitions.concat(wa(ya.definitions)),Ta.definitions=Ta.definitions.concat(wa(ca.definitions));var Oa={};function xa(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}Ta.definitions.forEach((function(e){if(e.name){var t=new Set;_a(e,t),Oa[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[xa(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=Oa[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var s=o;o=new Set,s.forEach((function(e){i.has(e)||(i.add(e),(Oa[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=xa(e,t);r&&n.definitions.push(r)}))}(Ta,"getChannel");var Na={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getChannels"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"channels"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ChannelFields"},directives:[]},{kind:"Field",name:{kind:"Name",value:"markets"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MarketFields"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"languages"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"LanguageFields"},directives:[]}]}}]}}]}}],loc:{start:0,end:310}};Na.loc.source={body:"#import './fragments/channelFields.gql'\n#import './fragments/languageFields.gql'\n#import './fragments/marketFields.gql'\n#import './fragments/currencyFields.gql'\n\nquery getChannels {\n channels {\n ...ChannelFields\n markets {\n ...MarketFields\n }\n languages {\n ...LanguageFields\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var Da={};function Ia(e){return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!Da[t]&&(Da[t]=!0,!0)}))}function Aa(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){Aa(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){Aa(e,t)})),e.definitions&&e.definitions.forEach((function(e){Aa(e,t)}))}Na.definitions=Na.definitions.concat(Ia(ea.definitions)),Na.definitions=Na.definitions.concat(Ia(ia.definitions)),Na.definitions=Na.definitions.concat(Ia(ya.definitions)),Na.definitions=Na.definitions.concat(Ia(ca.definitions));var Ca={};function Ra(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}Na.definitions.forEach((function(e){if(e.name){var t=new Set;Aa(e,t),Ca[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[Ra(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=Ca[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var s=o;o=new Set,s.forEach((function(e){i.has(e)||(i.add(e),(Ca[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=Ra(e,t);r&&n.definitions.push(r)}))}(Na,"getChannels");var Fa={channels:Na,channel:Ta};function La(e){if(!e||!e.id)throw new Error("Invalid result structure for channel");return{id:e.id,name:e.name,type:e.type,url:e.url,defaultMarketId:e.defaultMarketId,defaultLanguageId:e.defaultLanguageId,markets:e.markets.map((function(e){return{id:(t=e).id,alias:t.alias,allowedLanguages:t.allowedLanguages.map((function(e){return Ma(e)})),country:Pa(t.country),currency:ja(t.currency),onlyDisplayInCheckout:t.onlyDisplayInCheckout,virtual:t.virtual,groupKey:t.groupKey,defaultLanguageId:t.defaultLanguageId};var t})),languages:e.languages.map((function(e){return Ma(e)}))}}function Pa(e){return{name:e.name,code:e.code}}function Ma(e){return{id:e.id,name:e.name,code:e.code}}function ja(e){return{code:e.code,symbol:e.symbol,name:e.name,rate:e.rate}}var qa,Va=function(){function e(e){void 0===e&&(e=3e5),this.defaultTTL=e,this.cache=new Map}return e.prototype.set=function(e,t,n){void 0===n&&(n=this.defaultTTL);var r=Date.now()+n;this.cache.set(e,{value:t,expiry:r})},e.prototype.get=function(e){var t=this.cache.get(e);if(t&&t.expiry>Date.now())return t.value;this.cache.delete(e)},e.prototype.delete=function(e){this.cache.delete(e)},e.prototype.clear=function(){this.cache.clear()},e}(),Ua=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.cache=new Va(9e5),r}return o(t,e),t.prototype.get=function(e){return c(this,void 0,void 0,(function(){var t,n,r,i;return u(this,(function(o){switch(o.label){case 0:return t="channel_".concat(e),(n=this.cache.get(t))?[2,n]:(r={query:Fa.channel,variables:{channelId:e}},[4,this.runQueryParsed(r)]);case 1:return(i=o.sent())&&this.cache.set(t,i),[2,i]}}))}))},t.prototype.parseResult=function(e){return function(e){if(!e||!e.data)throw new Error("Invalid result structure for channel");var t=e.data.channel;if(t)return La(t);console.warn("No channel found")}(e)},t}(Xs),Qa=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.cache=new Va(18e5),r}return o(t,e),t.prototype.get=function(){return c(this,void 0,void 0,(function(){var e,t,n,r;return u(this,(function(i){switch(i.label){case 0:return e="all_channels",(t=this.cache.get(e))?[2,t]:(n={query:Fa.channels,variables:{}},[4,this.runQueryParsed(n)]);case 1:return(r=i.sent())&&this.cache.set(e,r),[2,r]}}))}))},t.prototype.parseResult=function(e){return function(e){if(!e||!e.data)throw new Error("Invalid result structure for channels");var t=e.data.channels;if(t&&0!==t.length)return t.map((function(e){return La(e)}));console.warn("No channel found")}(e)},t}(Xs),Ba={exports:{}};var Ka=(qa||(qa=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new i(r,o||e,s),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,s=new Array(o);i<o;i++)s[i]=r[i].fn;return s},a.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},a.prototype.emit=function(e,t,r,i,o,s){var a=n?n+e:e;if(!this._events[a])return!1;var c,u,l=this._events[a],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,i),!0;case 5:return l.fn.call(l.context,t,r,i,o),!0;case 6:return l.fn.call(l.context,t,r,i,o,s),!0}for(u=1,c=new Array(f-1);u<f;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var h,p=l.length;for(u=0;u<p;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),f){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,r);break;case 4:l[u].fn.call(l[u].context,t,r,i);break;default:if(!c)for(h=1,c=new Array(f-1);h<f;h++)c[h-1]=arguments[h];l[u].fn.apply(l[u].context,c)}}return!0},a.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},a.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},a.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||i&&!a.once||r&&a.context!==r||s(this,o);else{for(var c=0,u=[],l=a.length;c<l;c++)(a[c].fn!==t||i&&!a[c].once||r&&a[c].context!==r)&&u.push(a[c]);u.length?this._events[o]=1===u.length?u[0]:u:s(this,o)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&s(this,t)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a}(Ba)),Ba.exports),Ga=Ji(Ka);function za(){return"undefined"==typeof window}function Wa(e,t,n){return void 0===n&&(n="prod"),{main:Gs.main,auth:Gs.auth.replace("{ACCOUNT}",t).replace("{ENV}",n),authSign:Gs.auth_sign.replace("{API-KEY}",e),image:Gs.image.replace("{ACCOUNT}",t)}}function Ya(e,t){if(!e)throw new Error("Token is required.");var r=e.split(".");if(3!==r.length&&t||2!==r.length&&!t)throw new Error("Invalid JWT token format.");var i=r[0],o=r[1],s=r[2],a=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/"),n=atob(t);return decodeURIComponent(n.split("").map((function(e){return"%".concat(e.charCodeAt(0).toString(16).padStart(2,"0"))})).join(""))},c=JSON.parse(a(i)),u=JSON.parse(a(o));if(t&&n.createHmac("sha256",t).update("".concat(i,".").concat(o)).digest("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")!==s)throw new Error("Invalid token signature.");return{header:c,payload:u}}function Ha(e,t){if(!e||"object"!=typeof e)throw new Error("Payload must be a valid object.");var r=function(e){return btoa(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},i={alg:t?"HS256":"none",typ:"JWT"},o=r(JSON.stringify(i)),s=r(JSON.stringify(e));if(!t)return"".concat(o,".").concat(s);var a=n.createHmac("sha256",t).update("".concat(o,".").concat(s)).digest("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");return"".concat(o,".").concat(s,".").concat(a)}var Ja,$a=function(){function e(e){this.currentLogLevel=e}return e.prototype.shouldLog=function(e){if(this.currentLogLevel===exports.GeinsLogLevel.NONE)return!1;var t=[exports.GeinsLogLevel.DEBUG,exports.GeinsLogLevel.INFO,exports.GeinsLogLevel.WARN,exports.GeinsLogLevel.ERROR];return t.indexOf(e)>=t.indexOf(this.currentLogLevel)},e.prototype.none=function(e){this.shouldLog(exports.GeinsLogLevel.DEBUG)&&console.debug("[DEBUG]: ".concat(e))},e.prototype.debug=function(e){this.shouldLog(exports.GeinsLogLevel.DEBUG)&&console.debug("[DEBUG]: ".concat(e))},e.prototype.info=function(e){this.shouldLog(exports.GeinsLogLevel.INFO)&&console.info("[INFO]: ".concat(e))},e.prototype.warn=function(e){this.shouldLog(exports.GeinsLogLevel.WARN)&&console.warn("[WARN]: ".concat(e))},e.prototype.error=function(e){this.shouldLog(exports.GeinsLogLevel.ERROR)&&console.error("[ERROR]: ".concat(e))},e}(),Xa=function(){function e(){this.eventName="geins-event",this.emitter=new Ga,this.broadcastChannelId="geins-channel",za()||(this.broadcast=new t.BroadcastChannel(this.broadcastChannelId),this.addBroadcastListener())}return e.prototype.addBroadcastListener=function(){var e=this;this.broadcast&&(this.broadcast.onmessage=function(t){e.emitter.emit(t.eventName,t.eventMessage)})},e.prototype.listenerAdd=function(e,t){void 0===t&&(t=this.eventName),this.emitter.on(t,e)},e.prototype.listenerOnce=function(e,t){void 0===t&&(t=this.eventName),this.emitter.once(t,e)},e.prototype.listenerRemove=function(e){void 0===e&&(e=this.eventName),this.emitter.removeAllListeners(e)},e.prototype.listenerCount=function(e){return void 0===e&&(e=this.eventName),this.emitter.listenerCount(e)},e.prototype.listenersGet=function(e){return void 0===e&&(e=this.eventName),this.emitter.listeners(e)},e.prototype.push=function(e,t){var n;void 0===t&&(t=this.eventName),this.emitter.emit(t,e),(null===(n=e.broadcast)||void 0===n||n)&&this.broadcast&&this.broadcast.postMessage({eventMessage:e,eventName:t})},e}(),Za=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.log_to_console=!1,r}return o(t,e),t.prototype.verifyQueryOptions=function(e){var t,n,r,i=s({},e);if(!e.query&&!e.queryAsString)throw new Error("Query or queryAsString is required");try{e.queryAsString&&!e.query&&(i.query=as(e.queryAsString))}catch(e){throw new Error("Error parsing string to query")}var o=i.query,a=o.definitions[0];if(!(a&&"OperationDefinition"===a.kind&&(null!==(n=null===(t=a.variableDefinitions)||void 0===t?void 0:t.length)&&void 0!==n?n:0)>0))return i;i.variables=this.createVariables(i.variables);var c=(null===(r=o.definitions[0].variableDefinitions)||void 0===r?void 0:r.map((function(e){return e.variable.name.value})))||[];return Object.keys(i.variables).forEach((function(e){c.includes(e)||delete i.variables[e]})),i},t.prototype.query=function(e){return c(this,void 0,void 0,(function(){var t,n,r,i;return u(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this.verifyQueryOptions(e)];case 1:return t=o.sent(),(this.log_to_console||e.log_to_console)&&"prod"!==this._geinsSettings.environment&&console.log("[Geins] queryOptions:",t),r=this.cleanObject,[4,this.runQuery(t)];case 2:return n=r.apply(this,[o.sent()]),[2,this.parseResult(n)];case 3:return i=o.sent(),console.error("Query error:",i),[2,null];case 4:return[2]}}))}))},t.prototype.mutation=function(e){return c(this,void 0,void 0,(function(){var t,n;return u(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),(this.log_to_console||e.log_to_console)&&"prod"!==this._geinsSettings.environment&&console.log("[Geins] mutation options:",e),[4,this.runMutation(e)];case 1:return t=r.sent(),[2,this.parseResult(t)];case 2:return n=r.sent(),console.error("Mutation error:",n),[2,null];case 3:return[2]}}))}))},t.prototype.parseResult=function(e){return e.data?e.data:(e.errors&&console.error("GraphQL errors:",e.errors),null)},t}(Xs),ec={trace:{abbreviation:"T",name:"Trace",color:"#881DD7",icon:"đ"},debug:{abbreviation:"D",name:"Debug",color:"#128655",icon:"đ"},info:{abbreviation:"I",name:"Info",color:"#18A7B4",icon:"âšī¸"},warn:{abbreviation:"W",name:"Warning",color:"#D7881D",icon:"â ī¸"},error:{abbreviation:"E",name:"Error",color:"#D72B1D",icon:"â"}},tc="[0m",nc="[1m",rc="[2m",ic="[30m",oc="[44m",sc="[47m",ac={typescript:{abbreviation:"TS",name:"TypeScript",colorServer:oc,color:"#007ACC",icon:"đ",fileExtensions:[".ts",".tsx"]},javascript:{abbreviation:"JS",name:"JavaScript",color:"#F7DF1E",colorServer:"[43m",icon:"đ",fileExtensions:[".js",".mjs","cjs"]},vue:{abbreviation:"VUE",name:"Vue",color:"#41B883",colorServer:"[42m",icon:"đŧī¸",fileExtensions:[".vue"]},jsx:{abbreviation:"JSX",name:"JSX",color:"#61DAFB",colorServer:"[46m",icon:"đ",fileExtensions:[".jsx"]},tsx:{abbreviation:"TSX",name:"TSX",color:"#007ACC",colorServer:oc,icon:"đ",fileExtensions:[".tsx"]},next:{abbreviation:"NEXT",name:"Next.js",color:"#000000",colorServer:oc,icon:"đ",fileExtensions:[".js",".ts",".jsx",".tsx"]},react:{abbreviation:"REACT",name:"React",color:"#61DAFB",colorServer:oc,icon:"âī¸",fileExtensions:[".jsx",".tsx"]},astro:{abbreviation:"ASTRO",name:"Astro",color:"#FF5D01",colorServer:"[35m",icon:"đ",fileExtensions:[".astro"]},angular:{abbreviation:"ANG",name:"Angular",color:"#DD0031",colorServer:oc,icon:"đ
°ī¸",fileExtensions:[".ts",".html"]},svelte:{abbreviation:"SVELTE",name:"Svelte",color:"#FF3E00",colorServer:oc,icon:"đĨ",fileExtensions:[".svelte"]}},cc={"Nuxt.js":/\/_nuxt\//,"Vue.js":/\/\.vue\//,React:/\/react\//,Angular:/\/angular\//,Svelte:/\/svelte\//,"Next.js":/\/next\//,Astro:/\/astro\//},uc=function(){function e(){}return e.configure=function(t){var n=void 0===t?{}:t,r=n.isEnabled,i=void 0===r||r,o=n.logLevel,s=void 0===o?"debug":o;e.configIsEnabled=i,e.configLogLevel=s},e.isServer=function(){return"undefined"==typeof window},e.trace=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e.log("trace",t)},e.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e.log("debug",t)},e.info=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e.log("info",t)},e.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e.log("warn",t)},e.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e.log("error",t)},e.log=function(t,n){var r=e.getCallerInfoExtended(),i=r.methodName,o=r.fileName,s=r.className,a=r.framework,c=r.fileType;e.output(t,i,o,s,a,c,n)},e.output=function(t,n,r,i,o,s,a){var c=ec[t];s&&" (".concat(s.name,")");var u=n?"".concat(n,"()"):"",l=i?"".concat(i,"."):"",f=s?s.color:c.color,h=s?s.colorServer:sc,p=s?s.icon:c.icon;e.isServer()?(console.log("".concat(h).concat(ic).concat(p," ").concat(r," ").concat(tc).concat(sc).concat(ic," ").concat(l).concat(u).concat(tc," ")),a.forEach((function(e){"object"!=typeof e?"string"==typeof e&&console.log("".concat(rc,">> ").concat(tc),"".concat(nc).concat(e).concat(tc)):console.log("".concat(rc,">> ").concat(tc),"".concat(JSON.stringify(e)))}))):(console.log("%c".concat(p," ").concat(r,"%c ").concat(l).concat(u),"background: ".concat(f,"; color: #000; padding: 2px 8px; border-radius: 2px 0 0 2px;"),"background: #D3D3D3; color: #000; padding: 2px 8px; border-radius: 0 2px 2px 0;"),a.forEach((function(e){console.log("%c>>","color: ".concat(c.color,"; margin-left: 5px; font-weight: bold;"),e)})))},e.getCallerInfoExtended=function(){var t={};try{throw new Error("")}catch(e){t=e}if(!t.stack)return{methodName:"anonymous",fileName:"unknown",className:"",framework:null,fileType:null};var n=t.stack.split("\n"),r=null;if(e.isServer()){r="Node.js";for(var i=1;i<n.length;i++){if(!((v=n[i]).includes("LogService")||v.includes("node_modules")||v.includes("logService.ts"))){var o=v.match(/at (?:([\w$]+)\.)?(\w+)\s*\(/),s=v.match(/(http.*\.\w+)/)||v.match(/at (.*):\d+:\d+/),a=o&&o[1]||"",c=o?o[2]:"anonymous",u="unknown",l=null;if(s){var f=s[1].split("/")||[];u=f.pop()||"unknown",f.reverse();var h=f.slice(0,3).reverse().join("/");l=e.getFileTypeFromExtension(u),u="".concat(h,"/").concat(u)}return{methodName:c,fileName:u,className:a,framework:r,fileType:l}}}}else{for(var p=0,d=n;p<d.length;p++){for(var v=d[p],y=0,m=Object.entries(cc);y<m.length;y++){var g=m[y],b=g[0];if(g[1].test(v)){r=b;break}}if(r)break}for(i=1;i<n.length;i++){if(!(v=n[i]).includes("LogService")&&!v.includes("node_modules")){o=v.match(/at (?:([\w$]+)\.)?(\w+)\s*\(/),s=v.match(/(http.*\.\w+)/)||v.match(/at (.*):\d+:\d+/),a=o&&o[1]||"",c=o?o[2]:"anonymous",u="unknown",l=null;if(s)u=s[1].split("?")[0].split("/").pop()||"unknown",l=e.getFileTypeFromExtension(u);return{methodName:c,fileName:u,className:a,framework:r,fileType:l}}}}return{methodName:"anonymous",fileName:"unknown",className:"",framework:null,fileType:null}},e.getFileTypeFromExtension=function(e){for(var t in ac){var n=ac[t];if(n.fileExtensions.some((function(t){return e.endsWith(t)})))return n}return null},e.configIsEnabled=!0,e.configLogLevel="debug",e}(),lc=uc.debug,fc=36e5,hc="urlHistory:lastFetchTime";exports.RoutingServiceState=void 0,(Ja=exports.RoutingServiceState||(exports.RoutingServiceState={}))[Ja.INIT=0]="INIT",Ja[Ja.FETCHING=1]="FETCHING",Ja[Ja.READY=2]="READY",Ja[Ja.ERROR=3]="ERROR";var pc=function(){function e(e,t){if(!e)throw this.state=exports.RoutingServiceState.ERROR,new Error("API key is required");if(!t)throw this.state=exports.RoutingServiceState.ERROR,new Error("Store is required");this.state=exports.RoutingServiceState.INIT,this.store=t,this.apiKey=e,this.apiClient=new Ys(e),this.state=exports.RoutingServiceState.READY}return e.getInstance=function(t,n){return e.instance||(e.instance=new e(t,n)),e.instance},e.prototype.setKey=function(e,t){return c(this,void 0,void 0,(function(){return u(this,(function(n){switch(n.label){case 0:return[4,this.store.setKey(e,t)];case 1:return n.sent(),[2]}}))}))},e.prototype.getKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,this.store.getKey(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.getRoutingRules=function(){return c(this,void 0,void 0,(function(){var e,t,n,r,i,o;return u(this,(function(s){switch(s.label){case 0:return[4,this.store.getKeys()];case 1:e=s.sent(),t=[],n=0,r=e,s.label=2;case 2:return n<r.length?"urlHistory"===(i=r[n])||i===hc?[3,4]:[4,this.store.getKey(i)]:[3,5];case 3:(o=s.sent())&&t.push({fromUrl:i,toUrl:o,httpStatusCode:301,isCanonical:!1}),s.label=4;case 4:return n++,[3,2];case 5:return[2,t]}}))}))},e.prototype.getAllRoutes=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return[4,this.store.getKeys()];case 1:return[2,e.sent()]}}))}))},e.prototype.shouldFetchNewData=function(){return c(this,void 0,void 0,(function(){var e,t;return u(this,(function(n){switch(n.label){case 0:return[4,this.getKey(hc)];case 1:return(e=n.sent())?(t=new Date(e),[2,Date.now()-t.getTime()>=fc]):[2,!0]}}))}))},e.prototype.fetchAndProcessUrlHistory=function(){return c(this,void 0,void 0,(function(){var e,t,n,r;return u(this,(function(i){switch(i.label){case 0:return[4,this.apiClient.getUrlHistory()];case 1:e=i.sent(),t=0,n=e,i.label=2;case 2:return t<n.length?(r=n[t]).oldUrl&&r.newUrl&&!r.deleted?[4,this.setKey(r.oldUrl,r.newUrl)]:[3,4]:[3,5];case 3:i.sent(),i.label=4;case 4:return t++,[3,2];case 5:return[4,this.setKey(hc,(new Date).toISOString())];case 6:return i.sent(),[2]}}))}))},e.prototype.fillUrlHistory=function(){return c(this,void 0,void 0,(function(){var e;return u(this,(function(t){switch(t.label){case 0:if(this.state===exports.RoutingServiceState.FETCHING)return[2,this.store.getKeys()];this.state=exports.RoutingServiceState.FETCHING,t.label=1;case 1:return t.trys.push([1,6,7,8]),[4,this.shouldFetchNewData()];case 2:return t.sent()?[4,this.fetchAndProcessUrlHistory()]:[3,4];case 3:t.sent(),t.label=4;case 4:return[4,this.store.getKeys()];case 5:return[2,t.sent()];case 6:throw e=t.sent(),this.state=exports.RoutingServiceState.ERROR,e;case 7:return this.state!==exports.RoutingServiceState.ERROR&&(this.state=exports.RoutingServiceState.READY),[7];case 8:return[2]}}))}))},e.prototype.getRoute=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,this.getKey(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.refreshUrlHistoryIfNeeded=function(){return c(this,void 0,void 0,(function(){var e,t,n;return u(this,(function(r){switch(r.label){case 0:return e=new Date,[4,this.getKey(hc)];case 1:return(t=r.sent())?(n=new Date(t),e.getTime()-n.getTime()>=fc?[4,this.fillUrlHistory()]:[3,3]):[3,6];case 2:case 4:case 7:return[2,r.sent()];case 3:return[4,this.store.getKeys()];case 5:return[3,8];case 6:return[4,this.fillUrlHistory()];case 8:return[2]}}))}))},e.prototype.getLastFetchTime=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return[4,this.getKey(hc)];case 1:return[2,e.sent()]}}))}))},e.prototype.fillRoutes=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return[4,this.fillUrlHistory()];case 1:return[2,{urlHistory:e.sent()}]}}))}))},e.instance=null,e}(),dc=function(){function e(){this.initStore()}return e.prototype.initStore=function(){this.store=new r.NodeCache({stdTTL:86400,checkperiod:17280,useClones:!1})},e.prototype.setKey=function(e,t){return c(this,void 0,void 0,(function(){return u(this,(function(n){return void 0!==this.store&&this.store.set(e,t),[2]}))}))},e.prototype.getKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){return void 0!==this.store?[2,this.store.get(e)]:[2,null]}))}))},e.prototype.getKeys=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){return void 0===this.store?[2,[]]:[2,this.store.keys()]}))}))},e.prototype.deleteKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return void 0===this.store?[3,2]:[4,this.store.del(e)];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},e.prototype.hasKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){return void 0===this.store?[2,!1]:[2,this.store.has(e)]}))}))},e.prototype.clearStore=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){return void 0!==this.store&&(this.store.flushAll(),this.store.close()),[2]}))}))},e.prototype.destroy=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return[4,this.clearStore()];case 1:return e.sent(),this.store=void 0,[2]}}))}))},e}(),vc=function(){function e(){this.store=this.initStore()}return e.prototype.initStore=function(){return new r.NodeCache({stdTTL:86400,checkperiod:17280,useClones:!1})},e.prototype.setKey=function(e,t){return c(this,void 0,void 0,(function(){return u(this,(function(n){return void 0!==this.store&&this.store.set(e,t),[2]}))}))},e.prototype.getKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){return void 0!==this.store?[2,this.store.get(e)]:[2,null]}))}))},e.prototype.getKeys=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){return void 0===this.store?[2,[]]:[2,this.store.keys()]}))}))},e.prototype.deleteKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return void 0===this.store?[3,2]:[4,this.store.del(e)];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},e.prototype.hasKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){return void 0===this.store?[2,!1]:[2,this.store.has(e)]}))}))},e.prototype.clearStore=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){return void 0!==this.store&&this.store.flushAll(),[2]}))}))},e.prototype.destroy=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return[4,this.clearStore()];case 1:return e.sent(),this.store=void 0,[2]}}))}))},e}(),yc=null,mc=function(){function e(e){if(this.geinsSettings=e,!e.channel)throw new Error("Channel is required");if(!e.apiKey)throw new Error("API Key is required");this.store=new dc,this.channelId="".concat(e.channel,"|").concat(e.tld),this.cache=new Va(36e5),this.initApiClient()}return e.prototype.initApiClient=function(){if(!this.geinsSettings.apiKey||!this.geinsSettings.accountName)throw new Error("API Key and Account Name are required");var e={apiUrl:Wa(this.geinsSettings.apiKey,this.geinsSettings.accountName,this.geinsSettings.environment).main,apiKey:this.geinsSettings.apiKey,requestOptions:{fetchPolicy:exports.FetchPolicyOptions.CACHE_FIRST}};this._apiClient=function(){return new $s(e)}},e.prototype.initChannelService=function(){var e=this;this.channelService=new Ua((function(){return e._apiClient()}),this.geinsSettings)},e.getInstance=function(t){return yc||(yc=new e(t)),yc},e.destroy=function(){var e;yc&&(yc.cache.clear(),null===(e=yc.store)||void 0===e||e.destroy(),yc.channelService=void 0,yc._apiClient=function(){},yc=null)},e.prototype.setKey=function(e,t){if(!this.store)throw new Error("Store is not initialized");this.store.setKey(e,t)},e.prototype.getKey=function(e){if(!this.store)throw new Error("Store is not initialized");return this.store.getKey(e)},e.prototype.setChannel=function(){return c(this,void 0,void 0,(function(){var e,t;return u(this,(function(n){switch(n.label){case 0:return this.channelService||(this._apiClient||this.initApiClient(),this.initChannelService()),[4,null===(t=this.channelService)||void 0===t?void 0:t.get(this.channelId)];case 1:return(e=n.sent())&&this.cache.set(this.channelId,e),[2,e]}}))}))},e.prototype.get=function(){return c(this,void 0,void 0,(function(){var e,t;return u(this,(function(n){switch(n.label){case 0:return(e=this.cache.get(this.channelId))?[2,e]:[4,this.setChannel()];case 1:return[2,null!=(t=n.sent())?t:void 0]}}))}))},e}(),gc=function(){function e(e){if(!e.channel)throw new Error("Channel is required");if(!e.apiKey)throw new Error("API Key is required");if(!e.accountName)throw new Error("Account name is required");this._geinsSettings=s(s({},{environment:"prod"}),e),this._geinsSettings.apiKey&&this._geinsSettings.accountName&&(this._endpointsUrls=Wa(this._geinsSettings.apiKey,this._geinsSettings.accountName,this._geinsSettings.environment)),za()||(this._cookieService=new Js),this._currentChannel=new mc(this._geinsSettings),this._eventService=new Xa}return e.prototype.initApiClient=function(){if(!this._geinsSettings.apiKey||!this._geinsSettings.accountName)throw new Error("Failed to initialize API Client");var e={apiUrl:this._endpointsUrls.main,apiKey:this._geinsSettings.apiKey,userToken:this._userToken};this._apiClient=new $s(e)},e.prototype.initGraphQLService=function(){var e=this;this._graphQLService=new Za((function(){return e.client}),this._geinsSettings)},Object.defineProperty(e.prototype,"channel",{get:function(){return{current:this.channelGet.bind(this),all:this.channelsGet.bind(this)}},enumerable:!1,configurable:!0}),e.prototype.channelGet=function(){return c(this,void 0,void 0,(function(){var e,t;return u(this,(function(n){if(this._currentChannel||(this._currentChannel=new mc(this._geinsSettings)),!this._currentChannel)throw new Error("Failed to initialize channel");return[2,null!==(t=null===(e=this._currentChannel)||void 0===e?void 0:e.get())&&void 0!==t?t:void 0]}))}))},e.prototype.channelsGet=function(){return c(this,void 0,void 0,(function(){var e,t=this;return u(this,(function(n){return this._accountChannels||(this._accountChannels=new Qa((function(){return t.client}),this._geinsSettings)),[2,null!==(e=this._accountChannels.get())&&void 0!==e?e:void 0]}))}))},e.prototype.setUserToken=function(e){this._userToken=e,this._apiClient&&this._apiClient.updateToken(e)},e.prototype.getUserToken=function(){return this._userToken},Object.defineProperty(e.prototype,"endpoints",{get:function(){return this._endpointsUrls},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"client",{get:function(){if(!this._endpointsUrls)throw new Error("Endpoints are not set");return this._apiClient||this.initApiClient(),this._apiClient},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"graphql",{get:function(){return this._graphQLService||this.initGraphQLService(),this._graphQLService},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geinsSettings",{get:function(){return this._geinsSettings},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){return this._eventService},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cookies",{get:function(){return this._cookieService||(this._cookieService=new Js),this._cookieService},enumerable:!1,configurable:!0}),e.encodeJWT=function(e,t){return Ha(e,t)},e.decodeJWT=function(e,t){return Ya(e,t).payload},e}();exports.API_ENDPOINT_SLUG_HISTORY=Ks,exports.API_ENDPOINT_URL_HISTORY=Bs,exports.API_URL=js,exports.AUTH_COOKIES=zs,exports.AUTH_COOKIES_MAX_AGE={DEFAULT:1800,REMEMBER_USER:604800},exports.AUTH_HEADERS={REFRESH_TOKEN:"x-auth-refresh-token"},exports.AUTH_URL=Vs,exports.BaseApiService=Xs,exports.BasePackage=Zs,exports.CART_COOKIES={CART_ID:"geins-cart-id"},exports.CART_COOKIES_MAX_AGE={DEFAULT:604800},exports.CHECKOUT_PARAMETERS=Ws,exports.Channel=mc,exports.ChannelService=Ua,exports.ChannelStore=dc,exports.ChannelsService=Qa,exports.CookieService=Js,exports.ENDPOINTS=Gs,exports.EndpointApiClient=Ys,exports.EventService=Xa,exports.GeinsCore=gc,exports.GraphQLService=Za,exports.IMAGE_URL=Us,exports.LogService=uc,exports.Logger=$a,exports.MANAGEMENT_API_URL=Qs,exports.ManagementApiClient=Hs,exports.MerchantApiClient=$s,exports.RoutingService=pc,exports.RoutingStore=vc,exports.SIGN_URL=qs,exports.SimpleCache=Va,exports.buildEndpoints=Wa,exports.decodeJWT=Ya,exports.encodeJWT=Ha,exports.extractParametersFromUrl=function(e){if(!e)return{url:e,params:new Map};if(!e.includes("?"))return{url:e,params:new Map};var t=e.split("?"),n=t[0],r=t[1];return{url:n,params:new Map(r?r.split("&").map((function(e){return e.split("=")})):[])}},exports.findObjectWithProperty=function e(t,n,r){if(t&&"object"==typeof t){if(n in t){if(void 0===r)return t;if(t[n]===r)return t}for(var i=0,o=Object.keys(t);i<o.length;i++){var s=e(t[o[i]],n,r);if(s)return s}}},exports.gql=as,exports.isServerContext=za,exports.logWrite=lc,exports.parseErrorMessage=function(e){return e&&e.message?e.message:""};
|
|
1
|
+
"use strict";var e=require("cookie-universal"),t=require("crypto"),n=require("broadcast-channel"),r=require("@cacheable/node-cache"),i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var s=function(){return s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},s.apply(this,arguments)};function a(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function c(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}function u(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function l(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var f="Invariant Violation",h=Object.setPrototypeOf,p=void 0===h?function(e,t){return e.__proto__=t,e}:h,d=function(e){function t(n){void 0===n&&(n=f);var r=e.call(this,"number"==typeof n?f+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=f,p(r,t.prototype),r}return o(t,e),t}(Error);function v(e,t){if(!e)throw new d(t)}var y=["debug","log","warn","error","silent"],m=y.indexOf("log");function g(e){return function(){if(y.indexOf(e)>=m)return(console[e]||console.log).apply(console,arguments)}}!function(e){e.debug=g("debug"),e.log=g("log"),e.warn=g("warn"),e.error=g("error")}(v);var b="3.11.8";function E(e){try{return e()}catch(e){}}var S=E((function(){return globalThis}))||E((function(){return window}))||E((function(){return self}))||E((function(){return global}))||E((function(){return E.constructor("return this")()})),T=new Map;function k(e){var t=T.get(e)||1;return T.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function _(e,t){void 0===t&&(t=0);var n=k("stringifyForDisplay");return JSON.stringify(e,(function(e,t){return void 0===t?n:t}),t).split(JSON.stringify(n)).join("<undefined>")}function w(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if("number"==typeof t){var i=t;(t=I(i))||(t=A(i,n),n=[])}e.apply(void 0,[t].concat(n))}}var O=Object.assign((function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];e||v(e,I(t,n)||A(t,n))}),{debug:w(v.debug),log:w(v.log),warn:w(v.warn),error:w(v.error)});function x(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return new d(I(e,t)||A(e,t))}var N=Symbol.for("ApolloErrorMessageHandler_"+b);function D(e){if("string"==typeof e)return e;try{return _(e,2).slice(0,1e3)}catch(e){return"<non-serializable>"}}function I(e,t){if(void 0===t&&(t=[]),e)return S[N]&&S[N](e,t.map(D))}function A(e,t){if(void 0===t&&(t=[]),e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:b,message:e,args:t.map(D)})))}function C(e,t){if(!Boolean(e))throw new Error(t)}function R(e,t){if(!Boolean(e))throw new Error("Unexpected invariant triggered.")}const F=/\r\n|[\n\r]/g;function L(e,t){let n=0,r=1;for(const i of e.body.matchAll(F)){if("number"==typeof i.index||R(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function P(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,s=t.line+o,a=1===t.line?n:0,c=t.column+a,u=`${e.name}:${s}:${c}\n`,l=r.split(/\r\n|[\n\r]/g),f=l[i];if(f.length>120){const e=Math.floor(c/80),t=c%80,n=[];for(let e=0;e<f.length;e+=80)n.push(f.slice(e,e+80));return u+M([[`${s} |`,n[0]],...n.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return u+M([[s-1+" |",l[i-1]],[`${s} |`,f],["|","^".padStart(c)],[`${s+1} |`,l[i+1]]])}function M(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}class j extends Error{constructor(e,...t){var n,r,i;const{nodes:o,source:s,positions:a,path:c,originalError:u,extensions:l}=function(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=c?c:void 0,this.originalError=null!=u?u:void 0,this.nodes=q(Array.isArray(o)?o:o?[o]:void 0);const f=q(null===(n=this.nodes)||void 0===n?void 0:n.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=s?s:null==f||null===(r=f[0])||void 0===r?void 0:r.source,this.positions=null!=a?a:null==f?void 0:f.map((e=>e.start)),this.locations=a&&s?a.map((e=>L(s,e))):null==f?void 0:f.map((e=>L(e.source,e.start)));const h="object"==typeof(p=null==u?void 0:u.extensions)&&null!==p?null==u?void 0:u.extensions:void 0;var p;this.extensions=null!==(i=null!=l?l:h)&&void 0!==i?i:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=u&&u.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,j):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 n of this.nodes)n.loc&&(e+="\n\n"+P((t=n.loc).source,L(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+P(this.source,t);var t;return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function q(e){return void 0===e||0===e.length?void 0:e}function V(e,t,n){return new j(`Syntax Error: ${n}`,{source:e,positions:[t]})}class U{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 Q{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const B={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"]},K=new Set(Object.keys(B));function G(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&K.has(t)}var z,W,Y,H;function J(e){return 9===e||32===e}function $(e){return e>=48&&e<=57}function X(e){return e>=97&&e<=122||e>=65&&e<=90}function Z(e){return X(e)||95===e}function ee(e){return X(e)||$(e)||95===e}function te(e){var t;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let t=0;t<e.length;++t){var o;const s=e[t],a=ne(s);a!==s.length&&(r=null!==(o=r)&&void 0!==o?o:t,i=t,0!==t&&a<n&&(n=a))}return e.map(((e,t)=>0===t?e:e.slice(n))).slice(null!==(t=r)&&void 0!==t?t:0,i+1)}function ne(e){let t=0;for(;t<e.length&&J(e.charCodeAt(t));)++t;return t}!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(z||(z={})),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"}(W||(W={})),function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(Y||(Y={})),function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(H||(H={}));class re{constructor(e){const t=new Q(H.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(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==H.EOF)do{if(e.next)e=e.next;else{const t=le(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===H.COMMENT);return e}}function ie(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function oe(e,t){return se(e.charCodeAt(t))&&ae(e.charCodeAt(t+1))}function se(e){return e>=55296&&e<=56319}function ae(e){return e>=56320&&e<=57343}function ce(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return H.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function ue(e,t,n,r,i){const o=e.line,s=1+n-e.lineStart;return new Q(t,n,r,o,s,i)}function le(e,t){const n=e.source.body,r=n.length;let i=t;for(;i<r;){const 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:10===n.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return fe(e,i);case 33:return ue(e,H.BANG,i,i+1);case 36:return ue(e,H.DOLLAR,i,i+1);case 38:return ue(e,H.AMP,i,i+1);case 40:return ue(e,H.PAREN_L,i,i+1);case 41:return ue(e,H.PAREN_R,i,i+1);case 46:if(46===n.charCodeAt(i+1)&&46===n.charCodeAt(i+2))return ue(e,H.SPREAD,i,i+3);break;case 58:return ue(e,H.COLON,i,i+1);case 61:return ue(e,H.EQUALS,i,i+1);case 64:return ue(e,H.AT,i,i+1);case 91:return ue(e,H.BRACKET_L,i,i+1);case 93:return ue(e,H.BRACKET_R,i,i+1);case 123:return ue(e,H.BRACE_L,i,i+1);case 124:return ue(e,H.PIPE,i,i+1);case 125:return ue(e,H.BRACE_R,i,i+1);case 34:return 34===n.charCodeAt(i+1)&&34===n.charCodeAt(i+2)?Ee(e,i):de(e,i)}if($(t)||45===t)return he(e,i,t);if(Z(t))return Se(e,i);throw V(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":ie(t)||oe(n,i)?`Unexpected character: ${ce(e,i)}.`:`Invalid character: ${ce(e,i)}.`)}return ue(e,H.EOF,r,r)}function fe(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){const e=n.charCodeAt(i);if(10===e||13===e)break;if(ie(e))++i;else{if(!oe(n,i))break;i+=2}}return ue(e,H.COMMENT,t,i,n.slice(t+1,i))}function he(e,t,n){const r=e.source.body;let i=t,o=n,s=!1;if(45===o&&(o=r.charCodeAt(++i)),48===o){if(o=r.charCodeAt(++i),$(o))throw V(e.source,i,`Invalid number, unexpected digit after 0: ${ce(e,i)}.`)}else i=pe(e,i,o),o=r.charCodeAt(i);if(46===o&&(s=!0,o=r.charCodeAt(++i),i=pe(e,i,o),o=r.charCodeAt(i)),69!==o&&101!==o||(s=!0,o=r.charCodeAt(++i),43!==o&&45!==o||(o=r.charCodeAt(++i)),i=pe(e,i,o),o=r.charCodeAt(i)),46===o||Z(o))throw V(e.source,i,`Invalid number, expected digit but got: ${ce(e,i)}.`);return ue(e,s?H.FLOAT:H.INT,t,i,r.slice(t,i))}function pe(e,t,n){if(!$(n))throw V(e.source,t,`Invalid number, expected digit but got: ${ce(e,t)}.`);const r=e.source.body;let i=t+1;for(;$(r.charCodeAt(i));)++i;return i}function de(e,t){const n=e.source.body,r=n.length;let i=t+1,o=i,s="";for(;i<r;){const r=n.charCodeAt(i);if(34===r)return s+=n.slice(o,i),ue(e,H.STRING,t,i+1,s);if(92!==r){if(10===r||13===r)break;if(ie(r))++i;else{if(!oe(n,i))throw V(e.source,i,`Invalid character within String: ${ce(e,i)}.`);i+=2}}else{s+=n.slice(o,i);const t=117===n.charCodeAt(i+1)?123===n.charCodeAt(i+2)?ve(e,i):ye(e,i):be(e,i);s+=t.value,i+=t.size,o=i}}throw V(e.source,i,"Unterminated string.")}function ve(e,t){const n=e.source.body;let r=0,i=3;for(;i<12;){const e=n.charCodeAt(t+i++);if(125===e){if(i<5||!ie(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|ge(e),r<0)break}throw V(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function ye(e,t){const n=e.source.body,r=me(n,t+2);if(ie(r))return{value:String.fromCodePoint(r),size:6};if(se(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=me(n,t+8);if(ae(e))return{value:String.fromCodePoint(r,e),size:12}}throw V(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function me(e,t){return ge(e.charCodeAt(t))<<12|ge(e.charCodeAt(t+1))<<8|ge(e.charCodeAt(t+2))<<4|ge(e.charCodeAt(t+3))}function ge(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function be(e,t){const 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:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw V(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Ee(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,o=t+3,s=o,a="";const c=[];for(;o<r;){const r=n.charCodeAt(o);if(34===r&&34===n.charCodeAt(o+1)&&34===n.charCodeAt(o+2)){a+=n.slice(s,o),c.push(a);const r=ue(e,H.BLOCK_STRING,t,o+3,te(c).join("\n"));return e.line+=c.length-1,e.lineStart=i,r}if(92!==r||34!==n.charCodeAt(o+1)||34!==n.charCodeAt(o+2)||34!==n.charCodeAt(o+3))if(10!==r&&13!==r)if(ie(r))++o;else{if(!oe(n,o))throw V(e.source,o,`Invalid character within String: ${ce(e,o)}.`);o+=2}else a+=n.slice(s,o),c.push(a),13===r&&10===n.charCodeAt(o+1)?o+=2:++o,a="",s=o,i=o;else a+=n.slice(s,o),s=o+1,o+=4}throw V(e.source,o,"Unterminated string.")}function Se(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){if(!ee(n.charCodeAt(i)))break;++i}return ue(e,H.NAME,t,i,n.slice(t,i))}function Te(e){return ke(e,[])}function ke(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:ke(t,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const n=Math.min(10,e.length),r=e.length-n,i=[];for(let r=0;r<n;++r)i.push(ke(e[r],t));1===r?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>2)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map((([e,n])=>e+": "+ke(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const _e=globalThis.process&&"production"===process.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var n;const r=t.prototype[Symbol.toStringTag];if(r===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null===(n=e.constructor)||void 0===n?void 0:n.name)){const t=Te(e);throw new Error(`Cannot use ${r} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class we{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||C(!1,`Body must be a string. Received: ${Te(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||C(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||C(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}class Oe{constructor(e,t={}){const n=function(e){return _e(e,we)}(e)?e:new we(e);this._lexer=new re(n),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(H.NAME);return this.node(e,{kind:Y.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:Y.DOCUMENT,definitions:this.many(H.SOF,this.parseDefinition,H.EOF)})}parseDefinition(){if(this.peek(H.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===H.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 V(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(H.BRACE_L))return this.node(e,{kind:Y.OPERATION_DEFINITION,operation:z.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(H.NAME)&&(n=this.parseName()),this.node(e,{kind:Y.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(H.NAME);switch(e.value){case"query":return z.QUERY;case"mutation":return z.MUTATION;case"subscription":return z.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(H.PAREN_L,this.parseVariableDefinition,H.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Y.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(H.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(H.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(H.DOLLAR),this.node(e,{kind:Y.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Y.SELECTION_SET,selections:this.many(H.BRACE_L,this.parseSelection,H.BRACE_R)})}parseSelection(){return this.peek(H.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(H.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:Y.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(H.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(H.PAREN_L,t,H.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(H.COLON),this.node(t,{kind:Y.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(H.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(H.NAME)?this.node(e,{kind:Y.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:Y.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"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:Y.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:Y.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case H.BRACKET_L:return this.parseList(e);case H.BRACE_L:return this.parseObject(e);case H.INT:return this.advanceLexer(),this.node(t,{kind:Y.INT,value:t.value});case H.FLOAT:return this.advanceLexer(),this.node(t,{kind:Y.FLOAT,value:t.value});case H.STRING:case H.BLOCK_STRING:return this.parseStringLiteral();case H.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:Y.BOOLEAN,value:!0});case"false":return this.node(t,{kind:Y.BOOLEAN,value:!1});case"null":return this.node(t,{kind:Y.NULL});default:return this.node(t,{kind:Y.ENUM,value:t.value})}case H.DOLLAR:if(e){if(this.expectToken(H.DOLLAR),this._lexer.token.kind===H.NAME){const e=this._lexer.token.value;throw V(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(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:Y.STRING,value:e.value,block:e.kind===H.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:Y.LIST,values:this.any(H.BRACKET_L,(()=>this.parseValueLiteral(e)),H.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:Y.OBJECT,fields:this.any(H.BRACE_L,(()=>this.parseObjectField(e)),H.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(H.COLON),this.node(t,{kind:Y.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(H.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(H.AT),this.node(t,{kind:Y.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(H.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(H.BRACKET_R),t=this.node(e,{kind:Y.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(H.BANG)?this.node(e,{kind:Y.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:Y.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(H.STRING)||this.peek(H.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(),r=this.many(H.BRACE_L,this.parseOperationTypeDefinition,H.BRACE_R);return this.node(e,{kind:Y.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(H.COLON);const n=this.parseNamedType();return this.node(e,{kind:Y.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:Y.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:Y.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(H.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(H.BRACE_L,this.parseFieldDefinition,H.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(H.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:Y.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(H.PAREN_L,this.parseInputValueDef,H.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(H.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(H.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:Y.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:Y.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:Y.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(H.EQUALS)?this.delimitedMany(H.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:Y.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(H.BRACE_L,this.parseEnumValueDefinition,H.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:Y.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw V(this._lexer.source,this._lexer.token.start,`${xe(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(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:Y.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(H.BRACE_L,this.parseInputValueDef,H.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===H.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(H.BRACE_L,this.parseOperationTypeDefinition,H.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:Y.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(0===n.length)throw this.unexpected();return this.node(e,{kind:Y.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(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:Y.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:Y.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:Y.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:Y.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:Y.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(H.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:Y.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(H.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(W,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new U(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 V(this._lexer.source,t.start,`Expected ${Ne(e)}, found ${xe(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==H.NAME||t.value!==e)throw V(this._lexer.source,t.start,`Expected "${e}", found ${xe(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===H.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return V(this._lexer.source,t.start,`Unexpected ${xe(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}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(void 0!==e&&t.kind!==H.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw V(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function xe(e){const t=e.value;return Ne(e.kind)+(null!=t?` "${t}"`:"")}function Ne(e){return function(e){return e===H.BANG||e===H.DOLLAR||e===H.AMP||e===H.PAREN_L||e===H.PAREN_R||e===H.SPREAD||e===H.COLON||e===H.EQUALS||e===H.AT||e===H.BRACKET_L||e===H.BRACKET_R||e===H.BRACE_L||e===H.PIPE||e===H.BRACE_R}(e)?`"${e}"`:e}const De=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Ie(e){return Ae[e.charCodeAt(0)]}const Ae=["\\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"],Ce=Object.freeze({});function Re(e,t,n=B){const r=new Map;for(const e of Object.values(Y))r.set(e,Fe(t,e));let i,o,s,a=Array.isArray(e),c=[e],u=-1,l=[],f=e;const h=[],p=[];do{u++;const e=u===c.length,m=e&&0!==l.length;if(e){if(o=0===p.length?void 0:h[h.length-1],f=s,s=p.pop(),m)if(a){f=f.slice();let e=0;for(const[t,n]of l){const r=t-e;null===n?(f.splice(r,1),e++):f[r]=n}}else{f=Object.defineProperties({},Object.getOwnPropertyDescriptors(f));for(const[e,t]of l)f[e]=t}u=i.index,c=i.keys,l=i.edits,a=i.inArray,i=i.prev}else if(s){if(o=a?u:c[u],f=s[o],null==f)continue;h.push(o)}let g;if(!Array.isArray(f)){var d,v;G(f)||C(!1,`Invalid AST Node: ${Te(f)}.`);const n=e?null===(d=r.get(f.kind))||void 0===d?void 0:d.leave:null===(v=r.get(f.kind))||void 0===v?void 0:v.enter;if(g=null==n?void 0:n.call(t,f,o,s,h,p),g===Ce)break;if(!1===g){if(!e){h.pop();continue}}else if(void 0!==g&&(l.push([o,g]),!e)){if(!G(g)){h.pop();continue}f=g}}var y;if(void 0===g&&m&&l.push([o,f]),e)h.pop();else i={inArray:a,index:u,keys:c,edits:l,prev:i},a=Array.isArray(f),c=a?f:null!==(y=n[f.kind])&&void 0!==y?y:[],u=-1,l=[],s&&p.push(s),s=f}while(void 0!==i);return 0!==l.length?l[l.length-1][1]:e}function Fe(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}const Le={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>Pe(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=je("(",Pe(e.variableDefinitions,", "),")"),n=Pe([e.operation,Pe([e.name,t]),Pe(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+je(" = ",n)+je(" ",Pe(r," "))},SelectionSet:{leave:({selections:e})=>Me(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=je("",e,": ")+t;let s=o+je("(",Pe(n,", "),")");return s.length>80&&(s=o+je("(\n",qe(Pe(n,"\n")),"\n)")),Pe([s,Pe(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+je(" ",Pe(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>Pe(["...",je("on ",e),Pe(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${je("(",Pe(n,", "),")")} on ${t} ${je("",Pe(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?function(e){const t=e.replace(/"""/g,'\\"""'),n=t.split(/\r\n|[\n\r]/g),r=1===n.length,i=n.length>1&&n.slice(1).every((e=>0===e.length||J(e.charCodeAt(0)))),o=t.endsWith('\\"""'),s=e.endsWith('"')&&!o,a=e.endsWith("\\"),c=s||a,u=!r||e.length>70||c||i||o;let l="";const f=r&&J(e.charCodeAt(0));return(u&&!f||i)&&(l+="\n"),l+=t,(u||c)&&(l+="\n"),'"""'+l+'"""'}(e):`"${e.replace(De,Ie)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+Pe(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+Pe(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+je("(",Pe(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>je("",e,"\n")+Pe(["schema",Pe(t," "),Me(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>je("",e,"\n")+Pe(["scalar",t,Pe(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>je("",e,"\n")+Pe(["type",t,je("implements ",Pe(n," & ")),Pe(r," "),Me(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>je("",e,"\n")+t+(Ve(n)?je("(\n",qe(Pe(n,"\n")),"\n)"):je("(",Pe(n,", "),")"))+": "+r+je(" ",Pe(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>je("",e,"\n")+Pe([t+": "+n,je("= ",r),Pe(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>je("",e,"\n")+Pe(["interface",t,je("implements ",Pe(n," & ")),Pe(r," "),Me(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>je("",e,"\n")+Pe(["union",t,Pe(n," "),je("= ",Pe(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>je("",e,"\n")+Pe(["enum",t,Pe(n," "),Me(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>je("",e,"\n")+Pe([t,Pe(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>je("",e,"\n")+Pe(["input",t,Pe(n," "),Me(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>je("",e,"\n")+"directive @"+t+(Ve(n)?je("(\n",qe(Pe(n,"\n")),"\n)"):je("(",Pe(n,", "),")"))+(r?" repeatable":"")+" on "+Pe(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>Pe(["extend schema",Pe(e," "),Me(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>Pe(["extend scalar",e,Pe(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Pe(["extend type",e,je("implements ",Pe(t," & ")),Pe(n," "),Me(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Pe(["extend interface",e,je("implements ",Pe(t," & ")),Pe(n," "),Me(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>Pe(["extend union",e,Pe(t," "),je("= ",Pe(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>Pe(["extend enum",e,Pe(t," "),Me(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>Pe(["extend input",e,Pe(t," "),Me(n)]," ")}};function Pe(e,t=""){var n;return null!==(n=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==n?n:""}function Me(e){return je("{\n",qe(Pe(e,"\n")),"\n}")}function je(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function qe(e){return je(" ",e.replace(/\n/g,"\n "))}function Ve(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}function Ue(e){return e.kind===Y.FIELD||e.kind===Y.FRAGMENT_SPREAD||e.kind===Y.INLINE_FRAGMENT}function Qe(e,t){var n=e.directives;return!n||!n.length||function(e){var t=[];e&&e.length&&e.forEach((function(e){if(function(e){var t=e.name.value;return"skip"===t||"include"===t}(e)){var n=e.arguments,r=e.name.value;O(n&&1===n.length,71,r);var i=n[0];O(i.name&&"if"===i.name.value,72,r);var o=i.value;O(o&&("Variable"===o.kind||"BooleanValue"===o.kind),73,r),t.push({directive:e,ifArgument:i})}}));return t}(n).every((function(e){var n=e.directive,r=e.ifArgument,i=!1;return"Variable"===r.value.kind?(i=t&&t[r.value.name.value],O(void 0!==i,70,n.name.value)):i=r.value.value,"skip"===n.name.value?!i:i}))}function Be(e,t,n){var r=new Set(e),i=r.size;return Re(t,{Directive:function(e){if(r.delete(e.name.value)&&(!n||!r.size))return Ce}}),n?!r.size:r.size<i}function Ke(e){return e&&Be(["client","export"],e,!0)}const Ge=()=>Object.create(null),{forEach:ze,slice:We}=Array.prototype,{hasOwnProperty:Ye}=Object.prototype;let He=class e{constructor(e=!0,t=Ge){this.weakness=e,this.makeData=t}lookup(){return this.lookupArray(arguments)}lookupArray(e){let t=this;return ze.call(e,(e=>t=t.getChildTrie(e))),Ye.call(t,"data")?t.data:t.data=this.makeData(We.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let t=this;for(let n=0,r=e.length;t&&n<r;++n){const r=t.mapFor(e[n],!1);t=r&&r.get(e[n])}return t&&t.data}remove(){return this.removeArray(arguments)}removeArray(e){let t;if(e.length){const n=e[0],r=this.mapFor(n,!1),i=r&&r.get(n);i&&(t=i.removeArray(We.call(e,1)),i.data||i.weak||i.strong&&i.strong.size||r.delete(n))}else t=this.data,delete this.data;return t}getChildTrie(t){const n=this.mapFor(t,!0);let r=n.get(t);return r||n.set(t,r=new e(this.weakness,this.makeData)),r}mapFor(e,t){return this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(e)?this.weak||(t?this.weak=new WeakMap:void 0):this.strong||(t?this.strong=new Map:void 0)}};var Je="ReactNative"==E((function(){return navigator.product})),$e="function"==typeof WeakMap&&!(Je&&!global.HermesInternal),Xe="function"==typeof WeakSet,Ze="function"==typeof Symbol&&"function"==typeof Symbol.for,et=Ze&&Symbol.asyncIterator;function tt(e){return null!==e&&"object"==typeof e}function nt(e,t){var n=t,r=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw x(74,e.operation,e.name?" named '".concat(e.name.value,"'"):"");"FragmentDefinition"===e.kind&&r.push(e)})),void 0===n&&(O(1===r.length,75,r.length),n=r[0].name.value),s(s({},e),{definitions:l([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],e.definitions,!0)})}function rt(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function it(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var n=e.name.value;if("function"==typeof t)return t(n);var r=t&&t[n];return O(r,76,n),r||null;default:return null}}function ot(){}E((function(){return window.document.createElement})),E((function(){return navigator.userAgent.indexOf("jsdom")>=0}));class st{constructor(e=1/0,t=ot){this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}get size(){return this.map.size}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:e,newer:n}=t;n&&(n.older=e),e&&(e.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t}set(e,t){let n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)}}function at(){}const ct=at,ut="undefined"!=typeof WeakRef?WeakRef:function(e){return{deref:()=>e}},lt="undefined"!=typeof WeakMap?WeakMap:Map,ft="undefined"!=typeof FinalizationRegistry?FinalizationRegistry:function(){return{register:at,unregister:at}};class ht{constructor(e=1/0,t=ct){this.max=e,this.dispose=t,this.map=new lt,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const e=this.unfinalizedNodes.values();for(let t=0;t<10024;t++){const t=e.next().value;if(!t)break;this.unfinalizedNodes.delete(t);const n=t.key;delete t.key,t.keyRef=new ut(n),this.registry.register(n,t,t)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new ft(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:e,newer:n}=t;n&&(n.older=e),e&&(e.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t}set(e,t){let n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.scheduleFinalization(n),this.map.set(e,n),this.size++,n.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const t=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,t),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),t&&this.map.delete(t)}delete(e){const t=this.map.get(e);return!!t&&(this.deleteNode(t),!0)}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}var pt=new WeakSet;function dt(e){e.size<=(e.max||-1)||pt.has(e)||(pt.add(e),setTimeout((function(){e.clean(),pt.delete(e)}),100))}var vt=function(e,t){var n=new ht(e,t);return n.set=function(e,t){var n=ht.prototype.set.call(this,e,t);return dt(this),n},n},yt=function(e,t){var n=new st(e,t);return n.set=function(e,t){var n=st.prototype.set.call(this,e,t);return dt(this),n},n},mt=Symbol.for("apollo.cacheSize"),gt=s({},S[mt]),bt={};function Et(e,t){bt[e]=t}var St=!1!==globalThis.__DEV__?function(){var e,t,n,r,i;if(!1===globalThis.__DEV__)throw new Error("only supported in development mode");return{limits:Object.fromEntries(Object.entries({parser:1e3,canonicalStringify:1e3,print:2e3,"documentTransform.cache":2e3,"queryManager.getDocumentInfo":2e3,"PersistedQueryLink.persistedQueryHashes":2e3,"fragmentRegistry.transform":2e3,"fragmentRegistry.lookup":1e3,"fragmentRegistry.findFragmentSpreads":4e3,"cache.fragmentQueryDocuments":1e3,"removeTypenameFromVariables.getVariableDefinitions":2e3,"inMemoryCache.maybeBroadcastWatch":5e3,"inMemoryCache.executeSelectionSet":5e4,"inMemoryCache.executeSubSelectedArray":1e4}).map((function(e){var t=e[0],n=e[1];return[t,gt[t]||n]}))),sizes:s({print:null===(e=bt.print)||void 0===e?void 0:e.call(bt),parser:null===(t=bt.parser)||void 0===t?void 0:t.call(bt),canonicalStringify:null===(n=bt.canonicalStringify)||void 0===n?void 0:n.call(bt),links:Dt(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:xt(this.queryManager.documentTransform)}},null===(i=(r=this.cache).getMemoryInternals)||void 0===i?void 0:i.call(r))}}:void 0,Tt=!1!==globalThis.__DEV__?function(){var e=this.config.fragments;return s(s({},_t.apply(this)),{addTypenameDocumentTransform:xt(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:wt(this.storeReader.executeSelectionSet),executeSubSelectedArray:wt(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:wt(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:wt(null==e?void 0:e.findFragmentSpreads),lookup:wt(null==e?void 0:e.lookup),transform:wt(null==e?void 0:e.transform)}})}:void 0,kt=!1!==globalThis.__DEV__?_t:void 0;function _t(){return{cache:{fragmentQueryDocuments:wt(this.getFragmentDoc)}}}function wt(e){return function(e){return!!e&&"dirtyKey"in e}(e)?e.size:void 0}function Ot(e){return null!=e}function xt(e){return Nt(e).map((function(e){return{cache:e}}))}function Nt(e){return e?l(l([wt(null==e?void 0:e.performWork)],Nt(null==e?void 0:e.left),!0),Nt(null==e?void 0:e.right),!0).filter(Ot):[]}function Dt(e){var t;return e?l(l([null===(t=null==e?void 0:e.getMemoryInternals)||void 0===t?void 0:t.call(e)],Dt(null==e?void 0:e.left),!0),Dt(null==e?void 0:e.right),!0).filter(Ot):[]}var It,At=Object.assign((function(e){return JSON.stringify(e,Ct)}),{reset:function(){It=new yt(gt.canonicalStringify||1e3)}});function Ct(e,t){if(t&&"object"==typeof t){var n=Object.getPrototypeOf(t);if(n===Object.prototype||null===n){var r=Object.keys(t);if(r.every(Rt))return t;var i=JSON.stringify(r),o=It.get(i);if(!o){r.sort();var s=JSON.stringify(r);o=It.get(s)||r,It.set(i,o),It.set(s,o)}var a=Object.create(n);return o.forEach((function(e){a[e]=t[e]})),a}}return t}function Rt(e,t,n){return 0===t||n[t-1]<=e}function Ft(e){return{__ref:String(e)}}function Lt(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function Pt(e,t,n,r){if(function(e){return"IntValue"===e.kind}(n)||function(e){return"FloatValue"===e.kind}(n))e[t.value]=Number(n.value);else if(function(e){return"BooleanValue"===e.kind}(n)||function(e){return"StringValue"===e.kind}(n))e[t.value]=n.value;else if(function(e){return"ObjectValue"===e.kind}(n)){var i={};n.fields.map((function(e){return Pt(i,e.name,e.value,r)})),e[t.value]=i}else if(function(e){return"Variable"===e.kind}(n)){var o=(r||{})[n.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(n))e[t.value]=n.values.map((function(e){var n={};return Pt(n,t,e,r),n[t.value]}));else if(function(e){return"EnumValue"===e.kind}(n))e[t.value]=n.value;else{if(!function(e){return"NullValue"===e.kind}(n))throw x(85,t.value,n.kind);e[t.value]=null}}!1!==globalThis.__DEV__&&Et("canonicalStringify",(function(){return It.size})),At.reset();var Mt=["connection","include","skip","client","rest","export","nonreactive"],jt=At,qt=Object.assign((function(e,t,n){if(t&&n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach((function(e){i[e]=t[e]})),"".concat(n.connection.key,"(").concat(jt(i),")")}return n.connection.key}var o=e;if(t){var s=jt(t);o+="(".concat(s,")")}return n&&Object.keys(n).forEach((function(e){-1===Mt.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?o+="@".concat(e,"(").concat(jt(n[e]),")"):o+="@".concat(e))})),o}),{setStringify:function(e){var t=jt;return jt=e,t}});function Vt(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach((function(e){var r=e.name,i=e.value;return Pt(n,r,i,t)})),n}return null}function Ut(e){return e.alias?e.alias.value:e.name.value}function Qt(e,t,n){for(var r,i=0,o=t.selections;i<o.length;i++){if(Bt(c=o[i])){if("__typename"===c.name.value)return e[Ut(c)]}else r?r.push(c):r=[c]}if("string"==typeof e.__typename)return e.__typename;if(r)for(var s=0,a=r;s<a.length;s++){var c,u=Qt(e,it(c=a[s],n).selectionSet,n);if("string"==typeof u)return u}}function Bt(e){return"Field"===e.kind}function Kt(e){O(e&&"Document"===e.kind,77);var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw x(78,e.kind);return e}));return O(t.length<=1,79,t.length),e}function Gt(e){return Kt(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function zt(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&!!e.name})).map((function(e){return e.name.value}))[0]||null}function Wt(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function Yt(e){var t=Gt(e);return O(t&&"query"===t.operation,80),t}function Ht(e){var t;Kt(e);for(var n=0,r=e.definitions;n<r.length;n++){var i=r[n];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||t||(t=i)}if(t)return t;throw x(84)}function Jt(e){var t=Object.create(null),n=e&&e.variableDefinitions;return n&&n.length&&n.forEach((function(e){e.defaultValue&&Pt(t,e.variable.name,e.defaultValue)})),t}const $t=()=>Object.create(null),{forEach:Xt,slice:Zt}=Array.prototype,{hasOwnProperty:en}=Object.prototype;class tn{constructor(e=!0,t=$t){this.weakness=e,this.makeData=t}lookup(...e){return this.lookupArray(e)}lookupArray(e){let t=this;return Xt.call(e,(e=>t=t.getChildTrie(e))),en.call(t,"data")?t.data:t.data=this.makeData(Zt.call(e))}peek(...e){return this.peekArray(e)}peekArray(e){let t=this;for(let n=0,r=e.length;t&&n<r;++n){const r=this.weakness&&nn(e[n])?t.weak:t.strong;t=r&&r.get(e[n])}return t&&t.data}getChildTrie(e){const t=this.weakness&&nn(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map);let n=t.get(e);return n||t.set(e,n=new tn(this.weakness,this.makeData)),n}}function nn(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}let rn=null;const on={};let sn=1;function an(e){try{return e()}catch(e){}}const cn="@wry/context:Slot",un=an((()=>globalThis))||an((()=>global))||Object.create(null),ln=un[cn]||Array[cn]||function(e){try{Object.defineProperty(un,cn,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(class{constructor(){this.id=["slot",sn++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=rn;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===on)break;return e!==rn&&(rn.slots[this.id]=t),!0}return rn&&(rn.slots[this.id]=on),!1}getValue(){if(this.hasValue())return rn.slots[this.id]}withValue(e,t,n,r){const i={__proto__:null,[this.id]:e},o=rn;rn={parent:o,slots:i};try{return t.apply(r,n)}finally{rn=o}}static bind(e){const t=rn;return function(){const n=rn;try{return rn=t,e.apply(this,arguments)}finally{rn=n}}}static noContext(e,t,n){if(!rn)return e.apply(n,t);{const r=rn;try{return rn=null,e.apply(n,t)}finally{rn=r}}}}),fn=new ln,{hasOwnProperty:hn}=Object.prototype,pn=Array.from||function(e){const t=[];return e.forEach((e=>t.push(e))),t};function dn(e){const{unsubscribe:t}=e;"function"==typeof t&&(e.unsubscribe=void 0,t())}const vn=[];function yn(e,t){if(!e)throw new Error(t||"assertion failure")}function mn(e,t){const n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}function gn(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function bn(e){return e.slice(0)}class En{constructor(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++En.count}peek(){if(1===this.value.length&&!kn(this))return Sn(this),this.value[0]}recompute(e){return yn(!this.recomputing,"already recomputing"),Sn(this),kn(this)?function(e,t){In(e),fn.withValue(e,Tn,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{dn(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,kn(e))return;wn(e)}(e);return gn(e.value)}(this,e):gn(this.value)}setDirty(){this.dirty||(this.dirty=!0,_n(this),dn(this))}dispose(){this.setDirty(),In(this),On(this,((e,t)=>{e.setDirty(),An(e,this)}))}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=vn.pop()||new Set),this.deps.add(e)}forgetDeps(){this.deps&&(pn(this.deps).forEach((e=>e.delete(this))),this.deps.clear(),vn.push(this.deps),this.deps=null)}}function Sn(e){const t=fn.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),kn(e)?xn(t,e):Nn(t,e),t}function Tn(e,t){e.recomputing=!0;const{normalizeResult:n}=e;let r;n&&1===e.value.length&&(r=bn(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),n&&r&&!mn(r,e.value))try{e.value[0]=n(e.value[0],r[0])}catch(e){}}catch(t){e.value[1]=t}e.recomputing=!1}function kn(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function _n(e){On(e,xn)}function wn(e){On(e,Nn)}function On(e,t){const n=e.parents.size;if(n){const r=pn(e.parents);for(let i=0;i<n;++i)t(r[i],e)}}function xn(e,t){yn(e.childValues.has(t)),yn(kn(t));const n=!kn(e);if(e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=vn.pop()||new Set;e.dirtyChildren.add(t),n&&_n(e)}function Nn(e,t){yn(e.childValues.has(t)),yn(!kn(t));const n=e.childValues.get(t);0===n.length?e.childValues.set(t,bn(t.value)):mn(n,t.value)||e.setDirty(),Dn(e,t),kn(e)||wn(e)}function Dn(e,t){const n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(vn.length<100&&vn.push(n),e.dirtyChildren=null))}function In(e){e.childValues.size>0&&e.childValues.forEach(((t,n)=>{An(e,n)})),e.forgetDeps(),yn(null===e.dirtyChildren)}function An(e,t){t.parents.delete(e),e.childValues.delete(t),Dn(e,t)}En.count=0;const Cn={setDirty:!0,dispose:!0,forget:!0};function Rn(e){const t=new Map;function n(e){const n=fn.getValue();if(n){let r=t.get(e);r||t.set(e,r=new Set),n.dependOn(r)}}return n.dirty=function(e,n){const r=t.get(e);if(r){const i=n&&hn.call(Cn,n)?n:"setDirty";pn(r).forEach((e=>e[i]())),t.delete(e),dn(r)}},n}let Fn;function Ln(...e){return(Fn||(Fn=new tn("function"==typeof WeakMap))).lookupArray(e)}const Pn=new Set;function Mn(e,{max:t=Math.pow(2,16),keyArgs:n,makeCacheKey:r=Ln,normalizeResult:i,subscribe:o,cache:s=st}=Object.create(null)){const a="function"==typeof s?new s(t,(e=>e.dispose())):s,c=function(){const t=r.apply(null,n?n.apply(null,arguments):arguments);if(void 0===t)return e.apply(null,arguments);let s=a.get(t);s||(a.set(t,s=new En(e)),s.normalizeResult=i,s.subscribe=o,s.forget=()=>a.delete(t));const c=s.recompute(Array.prototype.slice.call(arguments));return a.set(t,s),Pn.add(a),fn.hasValue()||(Pn.forEach((e=>e.clean())),Pn.clear()),c};function u(e){const t=e&&a.get(e);t&&t.setDirty()}function l(e){const t=e&&a.get(e);if(t)return t.peek()}function f(e){return!!e&&a.delete(e)}return Object.defineProperty(c,"size",{get:()=>a.size,configurable:!1,enumerable:!1}),Object.freeze(c.options={max:t,keyArgs:n,makeCacheKey:r,normalizeResult:i,subscribe:o,cache:a}),c.dirtyKey=u,c.dirty=function(){u(r.apply(null,arguments))},c.peekKey=l,c.peek=function(){return l(r.apply(null,arguments))},c.forgetKey=f,c.forget=function(){return f(r.apply(null,arguments))},c.makeCacheKey=r,c.getKey=n?function(){return r.apply(null,n.apply(null,arguments))}:r,Object.freeze(c)}function jn(e){return e}var qn,Vn=function(){function e(e,t){void 0===t&&(t=Object.create(null)),this.resultCache=Xe?new WeakSet:new Set,this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),this.cached=!1!==t.cache,this.resetCache()}return e.prototype.getCacheKey=function(e){return[e]},e.identity=function(){return new e(jn,{cache:!1})},e.split=function(t,n,r){return void 0===r&&(r=e.identity()),Object.assign(new e((function(e){return(t(e)?n:r).transformDocument(e)}),{cache:!1}),{left:n,right:r})},e.prototype.resetCache=function(){var t=this;if(this.cached){var n=new He($e);this.performWork=Mn(e.prototype.performWork.bind(this),{makeCacheKey:function(e){var r=t.getCacheKey(e);if(r)return O(Array.isArray(r),69),n.lookupArray(r)},max:gt["documentTransform.cache"],cache:ht})}},e.prototype.performWork=function(e){return Kt(e),this.transform(e)},e.prototype.transformDocument=function(e){if(this.resultCache.has(e))return e;var t=this.performWork(e);return this.resultCache.add(t),t},e.prototype.concat=function(t){var n=this;return Object.assign(new e((function(e){return t.transformDocument(n.transformDocument(e))}),{cache:!1}),{left:this,right:t})},e}(),Un=Object.assign((function(e){var t=qn.get(e);return t||(t=function(e){return Re(e,Le)}(e),qn.set(e,t)),t}),{reset:function(){qn=new vt(gt.print||2e3)}});Un.reset(),!1!==globalThis.__DEV__&&Et("print",(function(){return qn?qn.size:0}));var Qn=Array.isArray;function Bn(e){return Array.isArray(e)&&e.length>0}var Kn={kind:Y.FIELD,name:{kind:Y.NAME,value:"__typename"}};function Gn(e,t){return!e||e.selectionSet.selections.every((function(e){return e.kind===Y.FRAGMENT_SPREAD&&Gn(t[e.name.value],t)}))}function zn(e){return Gn(Gt(e)||function(e){O("Document"===e.kind,81),O(e.definitions.length<=1,82);var t=e.definitions[0];return O("FragmentDefinition"===t.kind,83),t}(e),rt(Wt(e)))?null:e}function Wn(e){var t=new Map;return function(n){void 0===n&&(n=e);var r=t.get(n);return r||t.set(n,r={variables:new Set,fragmentSpreads:new Set}),r}}function Yn(e,t){Kt(t);for(var n=Wn(""),r=Wn(""),i=function(e){for(var t=0,i=void 0;t<e.length&&(i=e[t]);++t)if(!Qn(i)){if(i.kind===Y.OPERATION_DEFINITION)return n(i.name&&i.name.value);if(i.kind===Y.FRAGMENT_DEFINITION)return r(i.name.value)}return!1!==globalThis.__DEV__&&O.error(86),null},o=0,a=t.definitions.length-1;a>=0;--a)t.definitions[a].kind===Y.OPERATION_DEFINITION&&++o;var c=function(e){var t=new Map,n=new Map;return e.forEach((function(e){e&&(e.name?t.set(e.name,e):e.test&&n.set(e.test,e))})),function(e){var r=t.get(e.name.value);return!r&&n.size&&n.forEach((function(t,n){n(e)&&(r=t)})),r}}(e),u=function(e){return Bn(e)&&e.map(c).some((function(e){return e&&e.remove}))},l=new Map,f=!1,h={enter:function(e){if(u(e.directives))return f=!0,null}},p=Re(t,{Field:h,InlineFragment:h,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(e,t,n,r,o){var s=i(o);s&&s.variables.add(e.name.value)}},FragmentSpread:{enter:function(e,t,n,r,o){if(u(e.directives))return f=!0,null;var s=i(o);s&&s.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter:function(e,t,n,r){l.set(JSON.stringify(r),e)},leave:function(e,t,n,i){return e===l.get(JSON.stringify(i))?e:o>0&&e.selectionSet.selections.every((function(e){return e.kind===Y.FIELD&&"__typename"===e.name.value}))?(r(e.name.value).removed=!0,f=!0,null):void 0}},Directive:{leave:function(e){if(c(e))return f=!0,null}}});if(!f)return t;var d=function(e){return e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach((function(t){d(r(t)).transitiveVars.forEach((function(t){e.transitiveVars.add(t)}))}))),e},v=new Set;p.definitions.forEach((function(e){e.kind===Y.OPERATION_DEFINITION?d(n(e.name&&e.name.value)).fragmentSpreads.forEach((function(e){v.add(e)})):e.kind!==Y.FRAGMENT_DEFINITION||0!==o||r(e.name.value).removed||v.add(e.name.value)})),v.forEach((function(e){d(r(e)).fragmentSpreads.forEach((function(e){v.add(e)}))}));var y={enter:function(e){if(t=e.name.value,!v.has(t)||r(t).removed)return null;var t}};return zn(Re(p,{FragmentSpread:y,FragmentDefinition:y,OperationDefinition:{leave:function(e){if(e.variableDefinitions){var t=d(n(e.name&&e.name.value)).transitiveVars;if(t.size<e.variableDefinitions.length)return s(s({},e),{variableDefinitions:e.variableDefinitions.filter((function(e){return t.has(e.variable.name.value)}))})}}}}))}var Hn=Object.assign((function(e){return Re(e,{SelectionSet:{enter:function(e,t,n){if(!n||n.kind!==Y.OPERATION_DEFINITION){var r=e.selections;if(r)if(!r.some((function(e){return Bt(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var i=n;if(!(Bt(i)&&i.directives&&i.directives.some((function(e){return"export"===e.name.value}))))return s(s({},e),{selections:l(l([],r,!0),[Kn],!1)})}}}}})}),{added:function(e){return e===Kn}});function Jn(e){return"query"===Ht(e).operation?e:Re(e,{OperationDefinition:{enter:function(e){return s(s({},e),{operation:"query"})}}})}function $n(e){return Kt(e),Yn([{test:function(e){return"client"===e.name.value},remove:!0}],e)}var Xn=Object.prototype.hasOwnProperty;function Zn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return er(e)}function er(e){var t=e[0]||{},n=e.length;if(n>1)for(var r=new nr,i=1;i<n;++i)t=r.merge(t,e[i]);return t}var tr=function(e,t,n){return this.merge(e[n],t[n])},nr=function(){function e(e){void 0===e&&(e=tr),this.reconciler=e,this.isObject=tt,this.pastCopies=new Set}return e.prototype.merge=function(e,t){for(var n=this,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return tt(t)&&tt(e)?(Object.keys(t).forEach((function(i){if(Xn.call(e,i)){var o=e[i];if(t[i]!==o){var s=n.reconciler.apply(n,l([e,t,i],r,!1));s!==o&&((e=n.shallowCopyForMerge(e))[i]=s)}}else(e=n.shallowCopyForMerge(e))[i]=t[i]})),e):t},e.prototype.shallowCopyForMerge=function(e){return tt(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):s({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},e}();function rr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ir(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ir(e,t)}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ir(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function or(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function sr(e,t,n){return t&&or(e.prototype,t),n&&or(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var ar=function(){return"function"==typeof Symbol},cr=function(e){return ar()&&Boolean(Symbol[e])},ur=function(e){return cr(e)?Symbol[e]:"@@"+e};ar()&&!cr("observable")&&(Symbol.observable=Symbol("observable"));var lr=ur("iterator"),fr=ur("observable"),hr=ur("species");function pr(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function dr(e){var t=e.constructor;return void 0!==t&&null===(t=t[hr])&&(t=void 0),void 0!==t?t:_r}function vr(e){return e instanceof _r}function yr(e){yr.log?yr.log(e):setTimeout((function(){throw e}))}function mr(e){Promise.resolve().then((function(){try{e()}catch(e){yr(e)}}))}function gr(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=pr(t,"unsubscribe");n&&n.call(t)}}catch(e){yr(e)}}function br(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function Er(e,t,n){e._state="running";var r=e._observer;try{var i=pr(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(br(e),!i)throw n;i.call(r,n);break;case"complete":br(e),i&&i.call(r)}}catch(e){yr(e)}"closed"===e._state?gr(e):"running"===e._state&&(e._state="ready")}function Sr(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void mr((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(Er(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void Er(e,t,n);e._queue.push({type:t,value:n})}}var Tr=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var n=new kr(this);try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(br(this),gr(this))},sr(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),kr=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){Sr(this._subscription,"next",e)},t.error=function(e){Sr(this._subscription,"error",e)},t.complete=function(){Sr(this._subscription,"complete")},sr(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),_r=function(){function e(t){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new Tr(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise((function(n,r){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,o)}catch(e){r(e),i.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),n()}}))},t.map=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(dr(this))((function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.filter=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(dr(this))((function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.reduce=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=dr(this),r=arguments.length>1,i=!1,o=arguments[1];return new n((function(n){return t.subscribe({next:function(t){var s=!i;if(i=!0,!s||r)try{o=e(o,t)}catch(e){return n.error(e)}else o=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(o),n.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=dr(this);return new i((function(t){var r,o=0;return function e(s){r=s.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===n.length?(r=void 0,t.complete()):e(i.from(n[o++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))},t.flatMap=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=dr(this);return new n((function(r){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var o=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),s()}});i.push(o)},error:function(e){r.error(e)},complete:function(){s()}});function s(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},t[fr]=function(){return this},e.from=function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=pr(t,fr);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return vr(i)&&i.constructor===n?i:new n((function(e){return i.subscribe(e)}))}if(cr("iterator")&&(r=pr(t,lr)))return new n((function(e){mr((function(){if(!e.closed){for(var n,i=rr(r.call(t));!(n=i()).done;){var o=n.value;if(e.next(o),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){mr((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")},e.of=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return new("function"==typeof this?this:e)((function(e){mr((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))},sr(e,null,[{key:hr,get:function(){return this}}]),e}();ar()&&Object.defineProperty(_r,Symbol("extensions"),{value:{symbol:fr,hostReportError:yr},configurable:!0}),function(e){var t,n=e.Symbol;if("function"==typeof n)if(n.observable)t=n.observable;else{t="function"==typeof n.for?n.for("https://github.com/benlesh/symbol-observable"):n("https://github.com/benlesh/symbol-observable");try{n.observable=t}catch(e){}}else t="@@observable"}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")());var wr=_r.prototype,Or="@@observable";wr[Or]||(wr[Or]=function(){return this});var xr=Object.prototype.toString;function Nr(e){return Dr(e)}function Dr(e,t){switch(xr.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var n=e.slice(0);return t.set(e,n),n.forEach((function(e,r){n[r]=Dr(e,t)})),n;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var r=Object.create(Object.getPrototypeOf(e));return t.set(e,r),Object.keys(e).forEach((function(n){r[n]=Dr(e[n],t)})),r;default:return e}}function Ir(e){var t=new Set([e]);return t.forEach((function(e){tt(e)&&function(e){if(!1!==globalThis.__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(e){if(e instanceof TypeError)return null;throw e}return e}(e)===e&&Object.getOwnPropertyNames(e).forEach((function(n){tt(e[n])&&t.add(e[n])}))})),e}function Ar(e){return!1!==globalThis.__DEV__&&Ir(e),e}function Cr(e,t,n){var r=[];e.forEach((function(e){return e[t]&&r.push(e)})),r.forEach((function(e){return e[t](n)}))}function Rr(e,t,n){return new _r((function(r){var i={then:function(e){return new Promise((function(t){return t(e())}))}};function o(e,t){return function(n){if(e){var o=function(){return r.closed?0:e(n)};i=i.then(o,o).then((function(e){return r.next(e)}),(function(e){return r.error(e)}))}else r[t](n)}}var s={next:o(t,"next"),error:o(n,"error"),complete:function(){i.then((function(){return r.complete()}))}},a=e.subscribe(s);return function(){return a.unsubscribe()}}))}function Fr(e){function t(t){Object.defineProperty(e,t,{value:_r})}return Ze&&Symbol.species&&t(Symbol.species),t("@@species"),e}function Lr(e){return e&&"function"==typeof e.then}var Pr=function(e){function t(t){var n=e.call(this,(function(e){return n.addObserver(e),function(){return n.removeObserver(e)}}))||this;return n.observers=new Set,n.promise=new Promise((function(e,t){n.resolve=e,n.reject=t})),n.handlers={next:function(e){null!==n.sub&&(n.latest=["next",e],n.notify("next",e),Cr(n.observers,"next",e))},error:function(e){var t=n.sub;null!==t&&(t&&setTimeout((function(){return t.unsubscribe()})),n.sub=null,n.latest=["error",e],n.reject(e),n.notify("error",e),Cr(n.observers,"error",e))},complete:function(){var e=n,t=e.sub,r=e.sources;if(null!==t){var i=(void 0===r?[]:r).shift();i?Lr(i)?i.then((function(e){return n.sub=e.subscribe(n.handlers)}),n.handlers.error):n.sub=i.subscribe(n.handlers):(t&&setTimeout((function(){return t.unsubscribe()})),n.sub=null,n.latest&&"next"===n.latest[0]?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),Cr(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(e){n.reject(e),n.sources=[],n.handlers.error(e)},n.promise.catch((function(e){})),"function"==typeof t&&(t=[new _r(t)]),Lr(t)?t.then((function(e){return n.start(e)}),n.handlers.error):n.start(t),n}return o(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],n=e[t];n&&n.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e))},t.prototype.removeObserver=function(e){this.observers.delete(e)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(e,t){var n=this.nextResultListeners;n.size&&(this.nextResultListeners=new Set,n.forEach((function(n){return n(e,t)})))},t.prototype.beforeNext=function(e){var t=!1;this.nextResultListeners.add((function(n,r){t||(t=!0,e(n,r))}))},t}(_r);function Mr(e){return"incremental"in e}function jr(e){return tt(e)&&"payload"in e}function qr(e,t){var n=e,r=new nr;return Mr(t)&&Bn(t.incremental)&&t.incremental.forEach((function(e){for(var t=e.data,i=e.path,o=i.length-1;o>=0;--o){var s=i[o],a=!isNaN(+s)?[]:{};a[s]=t,t=a}n=r.merge(n,t)})),n}function Vr(e){return Bn(Ur(e))}function Ur(e){var t=Bn(e.errors)?e.errors.slice(0):[];return Mr(e)&&Bn(e.incremental)&&e.incremental.forEach((function(e){e.errors&&t.push.apply(t,e.errors)})),t}function Qr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Object.create(null);return e.forEach((function(e){e&&Object.keys(e).forEach((function(t){var r=e[t];void 0!==r&&(n[t]=r)}))})),n}function Br(e,t){return Qr(e,t,t.variables&&{variables:Qr(s(s({},e&&e.variables),t.variables))})}function Kr(e){return new _r((function(t){t.error(e)}))}Fr(Pr);var Gr=function(e,t,n){var r=new Error(n);throw r.name="ServerError",r.response=e,r.statusCode=e.status,r.result=t,r};function zr(e,t){return t?t(e):_r.of()}function Wr(e){return"function"==typeof e?new Hr(e):e}function Yr(e){return e.request.length<=1}var Hr=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return _r.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(Wr).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,n,r){var i,o=Wr(n),s=Wr(r||new e(zr));return i=Yr(o)&&Yr(s)?new e((function(e){return t(e)?o.request(e)||_r.of():s.request(e)||_r.of()})):new e((function(e,n){return t(e)?o.request(e,n)||_r.of():s.request(e,n)||_r.of()})),Object.assign(i,{left:o,right:s})},e.execute=function(e,t){return e.request(function(e,t){var n=s({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){n=s(s({},n),"function"==typeof e?e(n):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return s({},n)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?zt(t.query)||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(t.indexOf(i)<0)throw x(44,i)}return e}(t))))||_r.of()},e.concat=function(t,n){var r=Wr(t);if(Yr(r))return!1!==globalThis.__DEV__&&O.warn(36,r),r;var i,o=Wr(n);return i=Yr(o)?new e((function(e){return r.request(e,(function(e){return o.request(e)||_r.of()}))||_r.of()})):new e((function(e,t){return r.request(e,(function(e){return o.request(e,t)||_r.of()}))||_r.of()})),Object.assign(i,{left:r,right:o})},e.prototype.split=function(t,n,r){return this.concat(e.split(t,n,r||new e(zr)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw x(37)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}(),Jr=Hr.execute;function $r(e){var t=null,n=null,r=!1,i=[],o=[];function s(e){if(!n){if(o.length){var t=o.shift();if(Array.isArray(t)&&t[0])return t[0]({value:e,done:!1})}i.push(e)}}function a(e){n=e,o.slice().forEach((function(t){t[1](e)})),!t||t()}function c(){r=!0,o.slice().forEach((function(e){e[0]({value:void 0,done:!0})})),!t||t()}t=function(){t=null,e.removeListener("data",s),e.removeListener("error",a),e.removeListener("end",c),e.removeListener("finish",c),e.removeListener("close",c)},e.on("data",s),e.on("error",a),e.on("end",c),e.on("finish",c),e.on("close",c);var u={next:function(){return new Promise((function(e,t){return n?t(n):i.length?e({value:i.shift(),done:!1}):r?e({value:void 0,done:!0}):void o.push([e,t])}))}};return et&&(u[Symbol.asyncIterator]=function(){return this}),u}function Xr(e){var t={next:function(){return e.read()}};return et&&(t[Symbol.asyncIterator]=function(){return this}),t}function Zr(e){var t,n,r,i=e;if(e.body&&(i=e.body),function(e){return!(!et||!e[Symbol.asyncIterator])}(i))return function(e){var t,n=e[Symbol.asyncIterator]();return(t={next:function(){return n.next()}})[Symbol.asyncIterator]=function(){return this},t}(i);if(function(e){return!!e.getReader}(i))return Xr(i.getReader());if(function(e){return!!e.stream}(i))return Xr(i.stream().getReader());if(function(e){return!!e.arrayBuffer}(i))return t=i.arrayBuffer(),n=!1,r={next:function(){return n?Promise.resolve({value:void 0,done:!0}):(n=!0,new Promise((function(e,n){t.then((function(t){e({value:t,done:!1})})).catch(n)})))}},et&&(r[Symbol.asyncIterator]=function(){return this}),r;if(function(e){return!!e.pipe}(i))return $r(i);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var ei=Symbol();function ti(e){return e.hasOwnProperty("graphQLErrors")}var ni=function(e){function t(n){var r,i,o=n.graphQLErrors,s=n.protocolErrors,a=n.clientErrors,c=n.networkError,u=n.errorMessage,f=n.extraInfo,h=e.call(this,u)||this;return h.name="ApolloError",h.graphQLErrors=o||[],h.protocolErrors=s||[],h.clientErrors=a||[],h.networkError=c||null,h.message=u||(i=l(l(l([],(r=h).graphQLErrors,!0),r.clientErrors,!0),r.protocolErrors,!0),r.networkError&&i.push(r.networkError),i.map((function(e){return tt(e)&&e.message||"Error message not found."})).join("\n")),h.extraInfo=f,h.cause=l(l(l([c],o||[],!0),s||[],!0),a||[],!0).find((function(e){return!!e}))||null,h.__proto__=t.prototype,h}return o(t,e),t}(Error),ri=Object.prototype.hasOwnProperty;function ii(e){var t={};return e.split("\n").forEach((function(e){var n=e.indexOf(":");if(n>-1){var r=e.slice(0,n).trim().toLowerCase(),i=e.slice(n+1).trim();t[r]=i}})),t}function oi(e,t){if(e.status>=300){Gr(e,function(){try{return JSON.parse(t)}catch(e){return t}}(),"Response not successful: Received status code ".concat(e.status))}try{return JSON.parse(t)}catch(r){var n=r;throw n.name="ServerParseError",n.response=e,n.statusCode=e.status,n.bodyText=t,n}}var si=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var r=x(40,t,e.message);throw r.parseError=e,r}return n},ai={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},ci=function(e,t){return t(e)};function ui(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={},o={};n.forEach((function(e){i=s(s(s({},i),e.options),{headers:s(s({},i.headers),e.headers)}),e.credentials&&(i.credentials=e.credentials),o=s(s({},o),e.http)})),i.headers&&(i.headers=function(e,t){if(!t){var n={};return Object.keys(Object(e)).forEach((function(t){n[t.toLowerCase()]=e[t]})),n}var r={};Object.keys(Object(e)).forEach((function(t){r[t.toLowerCase()]={originalName:t,value:e[t]}}));var i={};return Object.keys(r).forEach((function(e){i[r[e].originalName]=r[e].value})),i}(i.headers,o.preserveHeaderCase));var a=e.operationName,c=e.extensions,u=e.variables,l=e.query,f={operationName:a,variables:u};return o.includeExtensions&&(f.extensions=c),o.includeQuery&&(f.query=t(l,Un)),{options:i,body:f}}var li=E((function(){return fetch})),fi=function(e){void 0===e&&(e={});var t=e.uri,n=void 0===t?"/graphql":t,r=e.fetch,i=e.print,o=void 0===i?ci:i,l=e.includeExtensions,f=e.preserveHeaderCase,h=e.useGETForQueries,p=e.includeUnusedVariables,d=void 0!==p&&p,v=a(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);!1!==globalThis.__DEV__&&function(e){if(!e&&"undefined"==typeof fetch)throw x(38)}(r||li);var y={http:{includeExtensions:l,preserveHeaderCase:f},options:v.fetchOptions,credentials:v.credentials,headers:v.headers};return new Hr((function(e){var t=function(e,t){var n=e.getContext().uri;return n||("function"==typeof t?t(e):t||"/graphql")}(e,n),i=e.getContext(),a={};if(i.clientAwareness){var l=i.clientAwareness,f=l.name,p=l.version;f&&(a["apollographql-client-name"]=f),p&&(a["apollographql-client-version"]=p)}var v=s(s({},a),i.headers),m={http:i.http,options:i.fetchOptions,credentials:i.credentials,headers:v};if(Be(["client"],e.query)){var g=$n(e.query);if(!g)return Kr(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));e.query=g}var b,S,T,k,_,w=ui(e,o,ai,y,m),x=w.options,N=w.body;N.variables&&!d&&(N.variables=(b=N.variables,S=e.query,T=s({},b),k=new Set(Object.keys(b)),Re(S,{Variable:function(e,t,n){n&&"VariableDefinition"!==n.kind&&k.delete(e.name.value)}}),k.forEach((function(e){delete T[e]})),T)),x.signal||"undefined"==typeof AbortController||(_=new AbortController,x.signal=_.signal);var D,I="OperationDefinition"===(D=Ht(e.query)).kind&&"subscription"===D.operation,A=Be(["defer"],e.query);if(h&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(x.method="GET"),A||I){x.headers=x.headers||{};var C="multipart/mixed;";I&&A&&!1!==globalThis.__DEV__&&O.warn(39),I?C+="boundary=graphql;subscriptionSpec=1.0,application/json":A&&(C+="deferSpec=20220824,application/json"),x.headers.accept=C}if("GET"===x.method){var R=function(e,t){var n=[],r=function(e,t){n.push("".concat(e,"=").concat(encodeURIComponent(t)))};if("query"in t&&r("query",t.query),t.operationName&&r("operationName",t.operationName),t.variables){var i=void 0;try{i=si(t.variables,"Variables map")}catch(e){return{parseError:e}}r("variables",i)}if(t.extensions){var o=void 0;try{o=si(t.extensions,"Extensions map")}catch(e){return{parseError:e}}r("extensions",o)}var s="",a=e,c=e.indexOf("#");-1!==c&&(s=e.substr(c),a=e.substr(0,c));var u=-1===a.indexOf("?")?"?":"&";return{newURI:a+u+n.join("&")+s}}(t,N),F=R.newURI,L=R.parseError;if(L)return Kr(L);t=F}else try{x.body=si(N,"Payload")}catch(L){return Kr(L)}return new _r((function(n){var i=r||E((function(){return fetch}))||li,o=n.next.bind(n);return i(t,x).then((function(t){var n;e.setContext({response:t});var r,i=null===(n=t.headers)||void 0===n?void 0:n.get("content-type");return null!==i&&/^multipart\/mixed/i.test(i)?function(e,t){return c(this,void 0,void 0,(function(){var n,r,i,o,a,c,l,f,h,p,d,v,y,m,g,b,E,S,T,k,_,w,O,x;return u(this,(function(u){switch(u.label){case 0:if(void 0===TextDecoder)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");n=new TextDecoder("utf-8"),r=null===(x=e.headers)||void 0===x?void 0:x.get("content-type"),i="boundary=",o=(null==r?void 0:r.includes(i))?null==r?void 0:r.substring((null==r?void 0:r.indexOf(i))+9).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",a="\r\n--".concat(o),c="",l=Zr(e),f=!0,u.label=1;case 1:return f?[4,l.next()]:[3,3];case 2:for(h=u.sent(),p=h.value,d=h.done,v="string"==typeof p?p:n.decode(p),y=c.length-a.length+1,f=!d,m=(c+=v).indexOf(a,y);m>-1;){if(g=void 0,w=[c.slice(0,m),c.slice(m+a.length)],c=w[1],b=(g=w[0]).indexOf("\r\n\r\n"),E=ii(g.slice(0,b)),(S=E["content-type"])&&-1===S.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");if(T=g.slice(b))if(k=oi(e,T),Object.keys(k).length>1||"data"in k||"incremental"in k||"errors"in k||"payload"in k)if(jr(k)){if(_={},"payload"in k){if(1===Object.keys(k).length&&null===k.payload)return[2];_=s({},k.payload)}"errors"in k&&(_=s(s({},_),{extensions:s(s({},"extensions"in _?_.extensions:null),(O={},O[ei]=k.errors,O))})),t(_)}else t(k);else if(1===Object.keys(k).length&&"hasNext"in k&&!k.hasNext)return[2];m=c.indexOf(a)}return[3,1];case 3:return[2]}}))}))}(t,o):(r=e,function(e){return e.text().then((function(t){return oi(e,t)})).then((function(t){return Array.isArray(t)||ri.call(t,"data")||ri.call(t,"errors")||Gr(e,t,"Server response was missing for query '".concat(Array.isArray(r)?r.map((function(e){return e.operationName})):r.operationName,"'.")),t}))})(t).then(o)})).then((function(){_=void 0,n.complete()})).catch((function(e){_=void 0,function(e,t){e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e)}(e,n)})),function(){_&&_.abort()}}))}))},hi=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,fi(t).request)||this;return n.options=t,n}return o(t,e),t}(Hr);const{toString:pi,hasOwnProperty:di}=Object.prototype,vi=Function.prototype.toString,yi=new Map;function mi(e,t){try{return gi(e,t)}finally{yi.clear()}}function gi(e,t){if(e===t)return!0;const n=pi.call(e);if(n!==pi.call(t))return!1;switch(n){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(Ti(e,t))return!0;const n=bi(e),r=bi(t),i=n.length;if(i!==r.length)return!1;for(let e=0;e<i;++e)if(!di.call(t,n[e]))return!1;for(let r=0;r<i;++r){const i=n[r];if(!gi(e[i],t[i]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(Ti(e,t))return!0;const r=e.entries(),i="[object Map]"===n;for(;;){const e=r.next();if(e.done)break;const[n,o]=e.value;if(!t.has(n))return!1;if(i&&!gi(o,t.get(n)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let n=e.byteLength;if(n===t.byteLength)for(;n--&&e[n]===t[n];);return-1===n}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const n=vi.call(e);return n===vi.call(t)&&!function(e,t){const n=e.length-t.length;return n>=0&&e.indexOf(t,n)===n}(n,Si)}}return!1}function bi(e){return Object.keys(e).filter(Ei,e)}function Ei(e){return void 0!==this[e]}const Si="{ [native code] }";function Ti(e,t){let n=yi.get(e);if(n){if(n.has(t))return!0}else yi.set(e,n=new Set);return n.add(t),!1}function ki(e,t,n,r){var i=t.data,o=a(t,["data"]),s=n.data;return mi(o,a(n,["data"]))&&_i(Ht(e).selectionSet,i,s,{fragmentMap:rt(Wt(e)),variables:r})}function _i(e,t,n,r){if(t===n)return!0;var i=new Set;return e.selections.every((function(e){if(i.has(e))return!0;if(i.add(e),!Qe(e,r.variables))return!0;if(wi(e))return!0;if(Bt(e)){var o=Ut(e),s=t&&t[o],a=n&&n[o],c=e.selectionSet;if(!c)return mi(s,a);var u=Array.isArray(s),l=Array.isArray(a);if(u!==l)return!1;if(u&&l){var f=s.length;if(a.length!==f)return!1;for(var h=0;h<f;++h)if(!_i(c,s[h],a[h],r))return!1;return!0}return _i(c,s,a,r)}var p=it(e,r.fragmentMap);return p?!!wi(p)||_i(p.selectionSet,t,n,r):void 0}))}function wi(e){return!!e.directives&&e.directives.some(Oi)}function Oi(e){return"nonreactive"===e.name.value}var xi=function(){function e(){this.assumeImmutableResults=!1,this.getFragmentDoc=Mn(nt,{max:gt["cache.fragmentQueryDocuments"]||1e3,cache:ht})}return e.prototype.batch=function(e){var t,n=this,r="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction((function(){return t=e.update(n)}),r),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(s(s({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.watchFragment=function(e){var t,n=this,r=e.fragment,i=e.fragmentName,o=e.from,c=e.optimistic,u=void 0===c||c,l=a(e,["fragment","fragmentName","from","optimistic"]),f=this.getFragmentDoc(r,i),h=s(s({},l),{returnPartialData:!0,id:void 0===o||"string"==typeof o?o:this.identify(o),query:f,optimistic:u});return new _r((function(e){return n.watch(s(s({},h),{immediate:!0,callback:function(n){if(!t||!ki(f,{data:null==t?void 0:t.result},{data:n.result})){var r={data:n.result,complete:!!n.complete};n.missing&&(r.missing=er(n.missing.map((function(e){return e.missing})))),t=n,e.next(r)}}}))}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(s(s({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,n=e.data,r=a(e,["id","data"]);return this.write(Object.assign(r,{dataId:t||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(e){var t=e.id,n=e.data,r=e.fragment,i=e.fragmentName,o=a(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(r,i),dataId:t,result:n}))},e.prototype.updateQuery=function(e,t){return this.batch({update:function(n){var r=n.readQuery(e),i=t(r);return null==i?r:(n.writeQuery(s(s({},e),{data:i})),i)}})},e.prototype.updateFragment=function(e,t){return this.batch({update:function(n){var r=n.readFragment(e),i=t(r);return null==i?r:(n.writeFragment(s(s({},e),{data:i})),i)}})},e}();!1!==globalThis.__DEV__&&(xi.prototype.getMemoryInternals=kt);var Ni=function(e){function t(n,r,i,o){var s,a=e.call(this,n)||this;if(a.message=n,a.path=r,a.query=i,a.variables=o,Array.isArray(a.path)){a.missing=a.message;for(var c=a.path.length-1;c>=0;--c)a.missing=((s={})[a.path[c]]=a.missing,s)}else a.missing=a.path;return a.__proto__=t.prototype,a}return o(t,e),t}(Error),Di=Object.prototype.hasOwnProperty;function Ii(e){return null==e}function Ai(e,t){var n=e.__typename,r=e.id,i=e._id;if("string"==typeof n&&(t&&(t.keyObject=Ii(r)?Ii(i)?void 0:{_id:i}:{id:r}),Ii(r)&&!Ii(i)&&(r=i),!Ii(r)))return"".concat(n,":").concat("number"==typeof r||"string"==typeof r?r:JSON.stringify(r))}var Ci={dataIdFromObject:Ai,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Ri(e){var t=e.canonizeResults;return void 0===t?Ci.canonizeResults:t}var Fi=/^[_a-z][_0-9a-z]*/i;function Li(e){var t=e.match(Fi);return t?t[0]:e}function Pi(e,t,n){return!!tt(t)&&(Qn(t)?t.every((function(t){return Pi(e,t,n)})):e.selections.every((function(e){if(Bt(e)&&Qe(e,n)){var r=Ut(e);return Di.call(t,r)&&(!e.selectionSet||Pi(e.selectionSet,t[r],n))}return!0})))}function Mi(e){return tt(e)&&!Lt(e)&&!Qn(e)}function ji(e,t){var n=rt(Wt(e));return{fragmentMap:n,lookupFragment:function(e){var r=n[e];return!r&&t&&(r=t.lookup(e)),r||null}}}var qi=Object.create(null),Vi=function(){return qi},Ui=Object.create(null),Qi=function(){function e(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return Ar(Lt(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return Lt(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return Ft(e);if(Lt(e))return e;var r=n.policies.identify(e)[0];if(r){var i=Ft(r);return t&&n.merge(r,e),i}}}return e.prototype.toObject=function(){return s({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),Di.call(this.data,e)){var n=this.data[e];if(n&&Di.call(n,t))return n[t]}return"__typename"===t&&Di.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof zi?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),Di.call(this.data,e)?this.data[e]:this instanceof zi?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var n,r=this;Lt(e)&&(e=e.__ref),Lt(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(n=e):e,o="string"==typeof t?this.lookup(n=t):t;if(o){O("string"==typeof n,1);var s=new nr(Yi).merge(i,o);if(this.data[n]=s,s!==i&&(delete this.refs[n],this.group.caching)){var a=Object.create(null);i||(a.__exists=1),Object.keys(o).forEach((function(e){if(!i||i[e]!==s[e]){a[e]=1;var t=Li(e);t===e||r.policies.hasKeyArgs(s.__typename,t)||(a[t]=1),void 0!==s[e]||r instanceof zi||delete s[e]}})),!a.__typename||i&&i.__typename||this.policies.rootTypenamesById[n]!==s.__typename||delete a.__typename,Object.keys(a).forEach((function(e){return r.group.dirty(n,e)}))}}},e.prototype.modify=function(e,t){var n=this,r=this.lookup(e);if(r){var i=Object.create(null),o=!1,a=!0,c={DELETE:qi,INVALIDATE:Ui,isReference:Lt,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||Ft(e)}:t,{store:n})}};if(Object.keys(r).forEach((function(u){var l=Li(u),f=r[u];if(void 0!==f){var h="function"==typeof t?t:t[u]||t[l];if(h){var p=h===Vi?qi:h(Ar(f),s(s({},c),{fieldName:l,storeFieldName:u,storage:n.getStorage(e,u)}));if(p===Ui)n.group.dirty(e,u);else if(p===qi&&(p=void 0),p!==f&&(i[u]=p,o=!0,f=p,!1!==globalThis.__DEV__)){var d=function(e){if(void 0===n.lookup(e.__ref))return!1!==globalThis.__DEV__&&O.warn(2,e),!0};if(Lt(p))d(p);else if(Array.isArray(p))for(var v=!1,y=void 0,m=0,g=p;m<g.length;m++){var b=g[m];if(Lt(b)){if(v=!0,d(b))break}else if("object"==typeof b&&b)n.policies.identify(b)[0]&&(y=b);if(v&&void 0!==y){!1!==globalThis.__DEV__&&O.warn(3,y);break}}}}void 0!==f&&(a=!1)}})),o)return this.merge(e,i),a&&(this instanceof zi?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,n){var r,i=this.lookup(e);if(i){var o=this.getFieldValue(i,"__typename"),s=t&&n?this.policies.getStoreFieldName({typename:o,fieldName:t,args:n}):t;return this.modify(e,s?((r={})[s]=Vi,r):Vi)}return!1},e.prototype.evict=function(e,t){var n=!1;return e.id&&(Di.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof zi&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach((function(t){Di.call(e.policies.rootTypenamesById,t)||n.push(t)})),n.length&&(t.__META={extraRootIds:n.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(n){e&&Di.call(e,n)||t.delete(n)})),e){var n=e.__META,r=a(e,["__META"]);Object.keys(r).forEach((function(e){t.merge(e,r[e])})),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof zi?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach((function(r){Di.call(n,r)&&(Object.keys(e.findChildRefIds(r)).forEach(t.add,t),delete n[r])}));var r=Object.keys(n);if(r.length){for(var i=this;i instanceof zi;)i=i.parent;r.forEach((function(e){return i.delete(e)}))}return r},e.prototype.findChildRefIds=function(e){if(!Di.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var r=new Set([n]);r.forEach((function(e){Lt(e)&&(t[e.__ref]=!0),tt(e)&&Object.keys(e).forEach((function(t){var n=e[t];tt(n)&&r.add(n)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),Bi=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?Rn():null,this.keyMaker=new He($e)},e.prototype.depend=function(e,t){if(this.d){this.d(Ki(e,t));var n=Li(t);n!==t&&this.d(Ki(e,n)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(Ki(e,t),"__exists"===t?"forget":"setDirty")},e}();function Ki(e,t){return t+"#"+e}function Gi(e,t){Hi(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var n=t.policies,r=t.resultCaching,i=void 0===r||r,o=t.seed,s=e.call(this,n,new Bi(i))||this;return s.stump=new Wi(s),s.storageTrie=new He($e),o&&s.replace(o),s}return o(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(Qi);var zi=function(e){function t(t,n,r,i){var o=e.call(this,n.policies,i)||this;return o.id=t,o.parent=n,o.replay=r,o.group=i,r(o),o}return o(t,e),t.prototype.addLayer=function(e,n){return new t(e,this,n,this.group)},t.prototype.removeLayer=function(e){var t=this,n=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){var r=t.data[e],i=n.lookup(e);i?r?r!==i&&Object.keys(r).forEach((function(n){mi(r[n],i[n])||t.group.dirty(e,n)})):(t.group.dirty(e,"__exists"),Object.keys(i).forEach((function(n){t.group.dirty(e,n)}))):t.delete(e)})),n):n===this.parent?this:n.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return s(s({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return Di.call(this.data,t)?s(s({},n),e.prototype.findChildRefIds.call(this,t)):n},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(Qi),Wi=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new Bi(t.group.caching,t.group))||this}return o(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(e,t){return this.parent.merge(e,t)},t}(zi);function Yi(e,t,n){var r=e[n],i=t[n];return mi(r,i)?r:i}function Hi(e){return!!(e instanceof Qi&&e.group.caching)}function Ji(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $i=function(){function e(){this.known=new(Xe?WeakSet:Set),this.pool=new He($e),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return tt(e)&&this.known.has(e)},e.prototype.pass=function(e){if(tt(e)){var t=function(e){return tt(e)?Qn(e)?e.slice(0):s({__proto__:Object.getPrototypeOf(e)},e):e}(e);return this.passes.set(t,e),t}return e},e.prototype.admit=function(e){var t=this;if(tt(e)){var n=this.passes.get(e);if(n)return n;switch(Object.getPrototypeOf(e)){case Array.prototype:if(this.known.has(e))return e;var r=e.map(this.admit,this);return(a=this.pool.lookupArray(r)).array||(this.known.add(a.array=r),!1!==globalThis.__DEV__&&Object.freeze(r)),a.array;case null:case Object.prototype:if(this.known.has(e))return e;var i=Object.getPrototypeOf(e),o=[i],s=this.sortedKeys(e);o.push(s.json);var a,c=o.length;if(s.sorted.forEach((function(n){o.push(t.admit(e[n]))})),!(a=this.pool.lookupArray(o)).object){var u=a.object=Object.create(i);this.known.add(u),s.sorted.forEach((function(e,t){u[e]=o[c+t]})),!1!==globalThis.__DEV__&&Object.freeze(u)}return a.object}}return e},e.prototype.sortedKeys=function(e){var t=Object.keys(e),n=this.pool.lookupArray(t);if(!n.keys){t.sort();var r=JSON.stringify(t);(n.keys=this.keysByJSON.get(r))||this.keysByJSON.set(r,n.keys={sorted:t,json:r})}return n.keys},e}();function Xi(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var Zi=function(){function e(e){var t=this;this.knownResults=new($e?WeakMap:Map),this.config=Qr(e,{addTypename:!1!==e.addTypename,canonizeResults:Ri(e)}),this.canon=e.canon||new $i,this.executeSelectionSet=Mn((function(e){var n,r=e.context.canonizeResults,i=Xi(e);i[3]=!r;var o=(n=t.executeSelectionSet).peek.apply(n,i);return o?r?s(s({},o),{result:t.canon.admit(o.result)}):o:(Gi(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize||gt["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:Xi,makeCacheKey:function(e,t,n,r){if(Hi(n.store))return n.store.makeCacheKey(e,Lt(t)?t.__ref:t,n.varString,r)}}),this.executeSubSelectedArray=Mn((function(e){return Gi(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize||gt["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(e){var t=e.field,n=e.array,r=e.context;if(Hi(r.store))return r.store.makeCacheKey(t,n,r.varString)}})}return e.prototype.resetCanon=function(){this.canon=new $i},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,r=e.rootId,i=void 0===r?"ROOT_QUERY":r,o=e.variables,a=e.returnPartialData,c=void 0===a||a,u=e.canonizeResults,l=void 0===u?this.config.canonizeResults:u,f=this.config.cache.policies;o=s(s({},Jt(Yt(n))),o);var h,p=Ft(i),d=this.executeSelectionSet({selectionSet:Ht(n).selectionSet,objectOrReference:p,enclosingRef:p,context:s({store:t,query:n,policies:f,variables:o,varString:At(o),canonizeResults:l},ji(n,this.config.fragments))});if(d.missing&&(h=[new Ni(eo(d.missing),d.missing,n,o)],!c))throw h[0];return{result:d.result,complete:!h,missing:h}},e.prototype.isFresh=function(e,t,n,r){if(Hi(r.store)&&this.knownResults.get(e)===n){var i=this.executeSelectionSet.peek(n,t,r,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,r=e.objectOrReference,i=e.enclosingRef,o=e.context;if(Lt(r)&&!o.policies.rootTypenamesById[r.__ref]&&!o.store.has(r.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(r.__ref," object")};var s,a=o.variables,c=o.policies,u=o.store.getFieldValue(r,"__typename"),l=[],f=new nr;function h(e,t){var n;return e.missing&&(s=f.merge(s,((n={})[t]=e.missing,n))),e.result}this.config.addTypename&&"string"==typeof u&&!c.rootIdsByTypename[u]&&l.push({__typename:u});var p=new Set(n.selections);p.forEach((function(e){var n,d;if(Qe(e,a))if(Bt(e)){var v=c.readField({fieldName:e.name.value,field:e,variables:o.variables,from:r},o),y=Ut(e);void 0===v?Hn.added(e)||(s=f.merge(s,((n={})[y]="Can't find field '".concat(e.name.value,"' on ").concat(Lt(r)?r.__ref+" object":"object "+JSON.stringify(r,null,2)),n))):Qn(v)?v.length>0&&(v=h(t.executeSubSelectedArray({field:e,array:v,enclosingRef:i,context:o}),y)):e.selectionSet?null!=v&&(v=h(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:v,enclosingRef:Lt(v)?v:i,context:o}),y)):o.canonizeResults&&(v=t.canon.pass(v)),void 0!==v&&l.push(((d={})[y]=v,d))}else{var m=it(e,o.lookupFragment);if(!m&&e.kind===Y.FRAGMENT_SPREAD)throw x(9,e.name.value);m&&c.fragmentMatches(m,u)&&m.selectionSet.selections.forEach(p.add,p)}}));var d={result:er(l),missing:s},v=o.canonizeResults?this.canon.admit(d):Ar(d);return v.result&&this.knownResults.set(v.result,n),v},e.prototype.execSubSelectedArrayImpl=function(e){var t,n=this,r=e.field,i=e.array,o=e.enclosingRef,s=e.context,a=new nr;function c(e,n){var r;return e.missing&&(t=a.merge(t,((r={})[n]=e.missing,r))),e.result}return r.selectionSet&&(i=i.filter(s.store.canRead)),i=i.map((function(e,t){return null===e?null:Qn(e)?c(n.executeSubSelectedArray({field:r,array:e,enclosingRef:o,context:s}),t):r.selectionSet?c(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,enclosingRef:Lt(e)?e:o,context:s}),t):(!1!==globalThis.__DEV__&&function(e,t,n){if(!t.selectionSet){var r=new Set([n]);r.forEach((function(n){tt(n)&&(O(!Lt(n),10,function(e,t){return Lt(t)?e.get(t.__ref,"__typename"):t&&t.__typename}(e,n),t.name.value),Object.values(n).forEach(r.add,r))}))}}(s.store,r,e),e)})),{result:s.canonizeResults?this.canon.admit(i):i,missing:t}},e}();function eo(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var to=new ln,no=new WeakMap;function ro(e){var t=no.get(e);return t||no.set(e,t={vars:new Set,dep:Rn()}),t}function io(e){ro(e).vars.forEach((function(t){return t.forgetCache(e)}))}function oo(e){var t=new Set,n=new Set,r=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach((function(e){ro(e).dep.dirty(r),function(e){e.broadcastWatches&&e.broadcastWatches()}(e)}));var s=Array.from(n);n.clear(),s.forEach((function(t){return t(e)}))}}else{var a=to.getValue();a&&(i(a),ro(a).dep(r))}return e};r.onNextChange=function(e){return n.add(e),function(){n.delete(e)}};var i=r.attachCache=function(e){return t.add(e),ro(e).vars.add(r),r};return r.forgetCache=function(e){return t.delete(e)},r}var so=Object.create(null);function ao(e){var t=JSON.stringify(e);return so[t]||(so[t]=Object.create(null))}function co(e){var t=ao(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,n){var r=function(e,t){return n.readField(t,e)},i=n.keyObject=lo(e,(function(e){var i=po(n.storeObject,e,r);return void 0===i&&t!==n.storeObject&&Di.call(t,e[0])&&(i=po(t,e,ho)),O(void 0!==i,4,e.join("."),t),i}));return"".concat(n.typename,":").concat(JSON.stringify(i))})}function uo(e){var t=ao(e);return t.keyArgsFn||(t.keyArgsFn=function(t,n){var r=n.field,i=n.variables,o=n.fieldName,s=lo(e,(function(e){var n=e[0],o=n.charAt(0);if("@"!==o)if("$"!==o){if(t)return po(t,e)}else{var s=n.slice(1);if(i&&Di.call(i,s)){var a=e.slice(0);return a[0]=s,po(i,a)}}else if(r&&Bn(r.directives)){var c=n.slice(1),u=r.directives.find((function(e){return e.name.value===c})),l=u&&Vt(u,i);return l&&po(l,e.slice(1))}})),a=JSON.stringify(s);return(t||"{}"!==a)&&(o+=":"+a),o})}function lo(e,t){var n=new nr;return fo(e).reduce((function(e,r){var i,o=t(r);if(void 0!==o){for(var s=r.length-1;s>=0;--s)(i={})[r[s]]=o,o=i;e=n.merge(e,o)}return e}),Object.create(null))}function fo(e){var t=ao(e);if(!t.paths){var n=t.paths=[],r=[];e.forEach((function(t,i){Qn(t)?(fo(t).forEach((function(e){return n.push(r.concat(e))})),r.length=0):(r.push(t),Qn(e[i+1])||(n.push(r.slice(0)),r.length=0))}))}return t.paths}function ho(e,t){return e[t]}function po(e,t,n){return n=n||ho,vo(t.reduce((function e(t,r){return Qn(t)?t.map((function(t){return e(t,r)})):t&&n(t,r)}),e))}function vo(e){return tt(e)?Qn(e)?e.map(vo):lo(Object.keys(e).sort(),(function(t){return po(e,t)})):e}function yo(e){return void 0!==e.args?e.args:e.field?Vt(e.field,e.variables):null}var mo=function(){},go=function(e,t){return t.fieldName},bo=function(e,t,n){return(0,n.mergeObjects)(e,t)},Eo=function(e,t){return t},So=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=s({dataIdFromObject:Ai},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var n,r=this,i=t&&(t.typename||(null===(n=t.storeObject)||void 0===n?void 0:n.__typename))||e.__typename;if(i===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o,a=t&&t.storeObject||e,c=s(s({},t),{typename:i,storeObject:a,readField:t&&t.readField||function(){var e=ko(arguments,a);return r.readField(e,{store:r.cache.data,variables:e.variables})}}),u=i&&this.getTypePolicy(i),l=u&&u.keyFn||this.config.dataIdFromObject;l;){var f=l(s(s({},e),a),c);if(!Qn(f)){o=f;break}l=co(f)}return o=o?String(o):void 0,c.keyObject?[o,c.keyObject]:[o]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(n){var r=e[n],i=r.queryType,o=r.mutationType,s=r.subscriptionType,c=a(r,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",n),o&&t.setRootTypename("Mutation",n),s&&t.setRootTypename("Subscription",n),Di.call(t.toBeAdded,n)?t.toBeAdded[n].push(c):t.toBeAdded[n]=[c]}))},e.prototype.updateTypePolicy=function(e,t){var n=this,r=this.getTypePolicy(e),i=t.keyFields,o=t.fields;function s(e,t){e.merge="function"==typeof t?t:!0===t?bo:!1===t?Eo:e.merge}s(r,t.merge),r.keyFn=!1===i?mo:Qn(i)?co(i):"function"==typeof i?i:r.keyFn,o&&Object.keys(o).forEach((function(t){var r=n.getFieldPolicy(e,t,!0),i=o[t];if("function"==typeof i)r.read=i;else{var a=i.keyArgs,c=i.read,u=i.merge;r.keyFn=!1===a?go:Qn(a)?uo(a):"function"==typeof a?a:r.keyFn,"function"==typeof c&&(r.read=c),s(r,u)}r.read&&r.merge&&(r.keyFn=r.keyFn||go)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(O(!r||r===e,5,e),r&&delete this.rootIdsByTypename[r],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(n){t.getSupertypeSet(n,!0),e[n].forEach((function(e){t.getSupertypeSet(e,!0).add(n);var r=e.match(Fi);r&&r[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!Di.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var r=this.supertypeMap.get(e);!r&&this.fuzzySubtypes.size&&(r=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach((function(n,i){if(n.test(e)){var o=t.supertypeMap.get(i);o&&o.forEach((function(e){return r.add(e)}))}}))),r&&r.size&&r.forEach((function(e){var r=t.getTypePolicy(e),i=r.fields,o=a(r,["fields"]);Object.assign(n,o),Object.assign(n.fields,i)}))}var i=this.toBeAdded[e];return i&&i.length&&i.splice(0).forEach((function(n){t.updateTypePolicy(e,n)})),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,n){if(e){var r=this.getTypePolicy(e).fields;return r[t]||n&&(r[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},e.prototype.fragmentMatches=function(e,t,n,r){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(t,!0),a=[s],c=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&a.indexOf(t)<0&&a.push(t)},u=!(!n||!this.fuzzySubtypes.size),l=!1,f=0;f<a.length;++f){var h=a[f];if(h.has(o))return s.has(o)||(l&&!1!==globalThis.__DEV__&&O.warn(6,t,o),s.add(o)),!0;h.forEach(c),u&&f===a.length-1&&Pi(e.selectionSet,n,r)&&(u=!1,l=!0,this.fuzzySubtypes.forEach((function(e,n){var r=t.match(e);r&&r[0]===t&&c(n)})))}return!1},e.prototype.hasKeyArgs=function(e,t){var n=this.getFieldPolicy(e,t,!1);return!(!n||!n.keyFn)},e.prototype.getStoreFieldName=function(e){var t,n=e.typename,r=e.fieldName,i=this.getFieldPolicy(n,r,!1),o=i&&i.keyFn;if(o&&n)for(var s={typename:n,fieldName:r,field:e.field||null,variables:e.variables},a=yo(e);o;){var c=o(a,s);if(!Qn(c)){t=c||r;break}o=uo(c)}return void 0===t&&(t=e.field?function(e,t){var n=null;e.directives&&(n={},e.directives.forEach((function(e){n[e.name.value]={},e.arguments&&e.arguments.forEach((function(r){var i=r.name,o=r.value;return Pt(n[e.name.value],i,o,t)}))})));var r=null;return e.arguments&&e.arguments.length&&(r={},e.arguments.forEach((function(e){var n=e.name,i=e.value;return Pt(r,n,i,t)}))),qt(e.name.value,r,n)}(e.field,e.variables):qt(r,yo(e))),!1===t?r:r===Li(t)?t:r+":"+t},e.prototype.readField=function(e,t){var n=e.from;if(n&&(e.field||e.fieldName)){if(void 0===e.typename){var r=t.store.getFieldValue(n,"__typename");r&&(e.typename=r)}var i=this.getStoreFieldName(e),o=Li(i),s=t.store.getFieldValue(n,i),a=this.getFieldPolicy(e.typename,o,!1),c=a&&a.read;if(c){var u=To(this,n,e,t,t.store.getStorage(Lt(n)?n.__ref:n,i));return to.withValue(this.cache,c,[s,u])}return s}},e.prototype.getReadFunction=function(e,t){var n=this.getFieldPolicy(e,t,!1);return n&&n.read},e.prototype.getMergeFunction=function(e,t,n){var r=this.getFieldPolicy(e,t,!1),i=r&&r.merge;return!i&&n&&(i=(r=this.getTypePolicy(n))&&r.merge),i},e.prototype.runMergeFunction=function(e,t,n,r,i){var o=n.field,s=n.typename,a=n.merge;return a===bo?_o(r.store)(e,t):a===Eo?t:(r.overwrite&&(e=void 0),a(e,t,To(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:r.variables},r,i||Object.create(null))))},e}();function To(e,t,n,r,i){var o=e.getStoreFieldName(n),s=Li(o),a=n.variables||r.variables,c=r.store,u=c.toReference,l=c.canRead;return{args:yo(n),field:n.field||null,fieldName:s,storeFieldName:o,variables:a,isReference:Lt,toReference:u,storage:i,cache:e.cache,canRead:l,readField:function(){return e.readField(ko(arguments,t,a),r)},mergeObjects:_o(r.store)}}function ko(e,t,n){var r,i=e[0],o=e[1],a=e.length;return"string"==typeof i?r={fieldName:i,from:a>1?o:t}:(r=s({},i),Di.call(r,"from")||(r.from=t)),!1!==globalThis.__DEV__&&void 0===r.from&&!1!==globalThis.__DEV__&&O.warn(7,_(Array.from(e))),void 0===r.variables&&(r.variables=n),r}function _o(e){return function(t,n){if(Qn(t)||Qn(n))throw x(8);if(tt(t)&&tt(n)){var r=e.getFieldValue(t,"__typename"),i=e.getFieldValue(n,"__typename");if(r&&i&&r!==i)return n;if(Lt(t)&&Mi(n))return e.merge(t.__ref,n),t;if(Mi(t)&&Lt(n))return e.merge(t,n.__ref),n;if(Mi(t)&&Mi(n))return s(s({},t),n)}return n}}function wo(e,t,n){var r="".concat(t).concat(n),i=e.flavors.get(r);return i||e.flavors.set(r,i=e.clientOnly===t&&e.deferred===n?e:s(s({},e),{clientOnly:t,deferred:n})),i}var Oo=function(){function e(e,t,n){this.cache=e,this.reader=t,this.fragments=n}return e.prototype.writeToStore=function(e,t){var n=this,r=t.query,i=t.result,o=t.dataId,a=t.variables,c=t.overwrite,u=Gt(r),l=new nr;a=s(s({},Jt(u)),a);var f=s(s({store:e,written:Object.create(null),merge:function(e,t){return l.merge(e,t)},variables:a,varString:At(a)},ji(r,this.fragments)),{overwrite:!!c,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),h=this.processSelectionSet({result:i||Object.create(null),dataId:o,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:f});if(!Lt(h))throw x(11,i);return f.incomingById.forEach((function(t,r){var i=t.storeObject,o=t.mergeTree,a=t.fieldNodeSet,c=Ft(r);if(o&&o.map.size){var u=n.applyMerges(o,c,i,f);if(Lt(u))return;i=u}if(!1!==globalThis.__DEV__&&!f.overwrite){var l=Object.create(null);a.forEach((function(e){e.selectionSet&&(l[e.name.value]=!0)}));Object.keys(i).forEach((function(e){(function(e){return!0===l[Li(e)]})(e)&&!function(e){var t=o&&o.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,n,r){var i=function(e){var t=r.getFieldValue(e,n);return"object"==typeof t&&t},o=i(e);if(!o)return;var a=i(t);if(!a)return;if(Lt(o))return;if(mi(o,a))return;if(Object.keys(o).every((function(e){return void 0!==r.getFieldValue(a,e)})))return;var c=r.getFieldValue(e,"__typename")||r.getFieldValue(t,"__typename"),u=Li(n),l="".concat(c,".").concat(u);if(Co.has(l))return;Co.add(l);var f=[];Qn(o)||Qn(a)||[o,a].forEach((function(e){var t=r.getFieldValue(e,"__typename");"string"!=typeof t||f.includes(t)||f.push(t)}));!1!==globalThis.__DEV__&&O.warn(14,u,c,f.length?"either ensure all objects of type "+f.join(" and ")+" have an ID or a custom merge function, or ":"",l,s({},o),s({},a))}(c,i,e,f.store)}))}e.merge(r,i)})),e.retain(h.__ref),h},e.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,r=e.result,i=e.selectionSet,o=e.context,a=e.mergeTree,c=this.cache.policies,u=Object.create(null),l=n&&c.rootTypenamesById[n]||Qt(r,i,o.fragmentMap)||n&&o.store.get(n,"__typename");"string"==typeof l&&(u.__typename=l);var f=function(){var e=ko(arguments,u,o.variables);if(Lt(e.from)){var t=o.incomingById.get(e.from.__ref);if(t){var n=c.readField(s(s({},e),{from:t.storeObject}),o);if(void 0!==n)return n}}return c.readField(e,o)},h=new Set;this.flattenFields(i,r,o,l).forEach((function(e,n){var i,o=Ut(n),s=r[o];if(h.add(n),void 0!==s){var p=c.getStoreFieldName({typename:l,fieldName:n.name.value,field:n,variables:e.variables}),d=No(a,p),v=t.processFieldValue(s,n,n.selectionSet?wo(e,!1,!1):e,d),y=void 0;n.selectionSet&&(Lt(v)||Mi(v))&&(y=f("__typename",v));var m=c.getMergeFunction(l,n.name.value,y);m?d.info={field:n,typename:l,merge:m}:Ao(a,p),u=e.merge(u,((i={})[p]=v,i))}else!1===globalThis.__DEV__||e.clientOnly||e.deferred||Hn.added(n)||c.getReadFunction(l,n.name.value)||!1!==globalThis.__DEV__&&O.error(12,Ut(n),r)}));try{var p=c.identify(r,{typename:l,selectionSet:i,fragmentMap:o.fragmentMap,storeObject:u,readField:f}),d=p[0],v=p[1];n=n||d,v&&(u=o.merge(u,v))}catch(e){if(!n)throw e}if("string"==typeof n){var y=Ft(n),m=o.written[n]||(o.written[n]=[]);if(m.indexOf(i)>=0)return y;if(m.push(i),this.reader&&this.reader.isFresh(r,y,i,o))return y;var g=o.incomingById.get(n);return g?(g.storeObject=o.merge(g.storeObject,u),g.mergeTree=Do(g.mergeTree,a),h.forEach((function(e){return g.fieldNodeSet.add(e)}))):o.incomingById.set(n,{storeObject:u,mergeTree:Io(a)?void 0:a,fieldNodeSet:h}),y}return u},e.prototype.processFieldValue=function(e,t,n,r){var i=this;return t.selectionSet&&null!==e?Qn(e)?e.map((function(e,o){var s=i.processFieldValue(e,t,n,No(r,o));return Ao(r,o),s})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):!1!==globalThis.__DEV__?Nr(e):e},e.prototype.flattenFields=function(e,t,n,r){void 0===r&&(r=Qt(t,e,n.fragmentMap));var i=new Map,o=this.cache.policies,s=new He(!1);return function e(a,c){var u=s.lookup(a,c.clientOnly,c.deferred);u.visited||(u.visited=!0,a.selections.forEach((function(s){if(Qe(s,n.variables)){var a=c.clientOnly,u=c.deferred;if(a&&u||!Bn(s.directives)||s.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(a=!0),"defer"===t){var r=Vt(e,n.variables);r&&!1===r.if||(u=!0)}})),Bt(s)){var l=i.get(s);l&&(a=a&&l.clientOnly,u=u&&l.deferred),i.set(s,wo(n,a,u))}else{var f=it(s,n.lookupFragment);if(!f&&s.kind===Y.FRAGMENT_SPREAD)throw x(13,s.name.value);f&&o.fragmentMatches(f,r,t,n.variables)&&e(f.selectionSet,wo(n,a,u))}}})))}(e,n),i},e.prototype.applyMerges=function(e,t,n,r,i){var o,a=this;if(e.map.size&&!Lt(n)){var c,u=Qn(n)||!Lt(t)&&!Mi(t)?void 0:t,l=n;u&&!i&&(i=[Lt(u)?u.__ref:u]);var f=function(e,t){return Qn(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){var n=f(u,t),o=f(l,t);if(void 0!==o){i&&i.push(t);var s=a.applyMerges(e,n,o,r,i);s!==o&&(c=c||new Map).set(t,s),i&&O(i.pop()===t)}})),c&&(n=Qn(l)?l.slice(0):s({},l),c.forEach((function(e,t){n[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,i&&(o=r.store).getStorage.apply(o,i)):n},e}(),xo=[];function No(e,t){var n=e.map;return n.has(t)||n.set(t,xo.pop()||{map:new Map}),n.get(t)}function Do(e,t){if(e===t||!t||Io(t))return e;if(!e||Io(e))return t;var n=e.info&&t.info?s(s({},e.info),t.info):e.info||t.info,r=e.map.size&&t.map.size,i={info:n,map:r?new Map:e.map.size?e.map:t.map};if(r){var o=new Set(t.map.keys());e.map.forEach((function(e,n){i.map.set(n,Do(e,t.map.get(n))),o.delete(n)})),o.forEach((function(n){i.map.set(n,Do(t.map.get(n),e.map.get(n)))}))}return i}function Io(e){return!e||!(e.info||e.map.size)}function Ao(e,t){var n=e.map,r=n.get(t);r&&Io(r)&&(xo.push(r),n.delete(t))}var Co=new Set;var Ro,Fo=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.addTypenameTransform=new Vn(Hn),n.assumeImmutableResults=!0,n.makeVar=oo,n.txCount=0,n.config=function(e){return Qr(Ci,e)}(t),n.addTypename=!!n.config.addTypename,n.policies=new So({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return o(t,e),t.prototype.init=function(){var e=this.data=new Qi.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,n=this.storeReader,r=this.config.fragments;this.storeWriter=new Oo(this,this.storeReader=new Zi({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Ri(this.config),canon:e?void 0:n&&n.canon,fragments:r}),r),this.maybeBroadcastWatch=Mn((function(e,n){return t.broadcastWatch(e,n)}),{max:this.config.resultCacheMaxSize||gt["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(e){var n=e.optimistic?t.optimisticData:t.data;if(Hi(n)){var r=e.optimistic,i=e.id,o=e.variables;return n.makeCacheKey(e.query,e.callback,At({optimistic:r,id:i,variables:o}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(e){return e.resetCaching()}))},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,n=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore(s(s({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(e){if(e instanceof Ni)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(Di.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore(s(s({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t,n=this;return this.watches.size||ro(t=this).vars.forEach((function(e){return e.attachCache(t)})),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){n.watches.delete(e)&&!n.watches.size&&io(n),n.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){var t;At.reset(),Un.reset(),this.addTypenameTransform.resetCache(),null===(t=this.config.fragments)||void 0===t||t.resetCaches();var n=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),n},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if(Lt(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){!1!==globalThis.__DEV__&&O.warn(e)}},t.prototype.evict=function(e){if(!e.id){if(Di.call(e,"id"))return!1;e=s(s({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),At.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),io(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,n=this,r=e.update,i=e.optimistic,o=void 0===i||i,a=e.removeOptimistic,c=e.onWatchUpdated,u=function(e){var i=n,o=i.data,s=i.optimisticData;++n.txCount,e&&(n.data=n.optimisticData=e);try{return t=r(n)}finally{--n.txCount,n.data=o,n.optimisticData=s}},l=new Set;return c&&!this.txCount&&this.broadcastWatches(s(s({},e),{onWatchUpdated:function(e){return l.add(e),!1}})),"string"==typeof o?this.optimisticData=this.optimisticData.addLayer(o,u):!1===o?u(this.data):u(),"string"==typeof a&&(this.optimisticData=this.optimisticData.removeLayer(a)),c&&l.size?(this.broadcastWatches(s(s({},e),{onWatchUpdated:function(e,t){var n=c.call(this,e,t);return!1!==n&&l.delete(e),n}})),l.size&&l.forEach((function(e){return n.maybeBroadcastWatch.dirty(e)}))):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){return this.addTypenameToDocument(this.addFragmentsToDocument(e))},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(n){return t.maybeBroadcastWatch(n,e)}))},t.prototype.addFragmentsToDocument=function(e){var t=this.config.fragments;return t?t.transform(e):e},t.prototype.addTypenameToDocument=function(e){return this.addTypename?this.addTypenameTransform.transformDocument(e):e},t.prototype.broadcastWatch=function(e,t){var n=e.lastDiff,r=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(r.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,r,n))||n&&mi(n.result,r.result)||e.callback(e.lastDiff=r,n)},t}(xi);function Lo(e){return!!e&&e<7}!1!==globalThis.__DEV__&&(Fo.prototype.getMemoryInternals=Tt),function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(Ro||(Ro={}));var Po=Object.assign,Mo=Object.hasOwnProperty,jo=function(e){function t(t){var n=t.queryManager,r=t.queryInfo,i=t.options,o=e.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=Vo)}catch(e){}var n=!o.observers.size;o.observers.add(e);var r=o.last;return r&&r.error?e.error&&e.error(r.error):r&&r.result&&e.next&&e.next(r.result),n&&o.reobserve().catch((function(){})),function(){o.observers.delete(e)&&!o.observers.size&&o.tearDownQuery()}}))||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=r,o.queryManager=n,o.waitForOwnResult=Qo(i.fetchPolicy),o.isTornDown=!1,o.subscribeToMore=o.subscribeToMore.bind(o);var a=n.defaultOptions.watchQuery,c=(void 0===a?{}:a).fetchPolicy,u=void 0===c?"cache-first":c,l=i.fetchPolicy,f=void 0===l?u:l,h=i.initialFetchPolicy,p=void 0===h?"standby"===f?u:f:h;o.options=s(s({},i),{initialFetchPolicy:p,fetchPolicy:f}),o.queryId=r.queryId||n.generateQueryId();var d=Gt(o.query);return o.queryName=d&&d.name&&d.name.value,o}return o(t,e),Object.defineProperty(t.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,n){var r={next:function(n){t(n),e.observers.delete(r),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:n},i=e.subscribe(r)}))},t.prototype.resetDiff=function(){this.queryInfo.resetDiff()},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),n=this.queryInfo.networkStatus||t&&t.networkStatus||Ro.ready,r=s(s({},t),{loading:Lo(n),networkStatus:n}),i=this.options.fetchPolicy,o=void 0===i?"cache-first":i;if(Qo(o)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers);else if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var a=this.queryInfo.getDiff();(a.complete||this.options.returnPartialData)&&(r.data=a.result),mi(r.data,{})&&(r.data=void 0),a.complete?(delete r.partial,!a.complete||r.networkStatus!==Ro.loading||"cache-first"!==o&&"cache-only"!==o||(r.networkStatus=Ro.ready,r.loading=!1)):r.partial=!0,!1===globalThis.__DEV__||a.complete||this.options.partialRefetch||r.loading||r.data||r.error||Uo(a.missing)}return e&&this.updateLastResult(r),r},t.prototype.isDifferentFromLastResult=function(e,t){return!this.last||((this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!ki(this.query,this.last.result,e,this.variables):!mi(this.last.result,e))||t&&!mi(this.last.variables,t))},t.prototype.getLast=function(e,t){var n=this.last;if(n&&n[e]&&(!t||mi(n.variables,this.variables)))return n[e]},t.prototype.getLastResult=function(e){return this.getLast("result",e)},t.prototype.getLastError=function(e){return this.getLast("error",e)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,n={pollInterval:0},r=this.options.fetchPolicy;if(n.fetchPolicy="cache-and-network"===r?r:"no-cache"===r?"no-cache":"network-only",!1!==globalThis.__DEV__&&e&&Mo.call(e,"variables")){var i=Yt(this.query),o=i.variableDefinitions;o&&o.some((function(e){return"variables"===e.variable.name.value}))||!1!==globalThis.__DEV__&&O.warn(20,e,(null===(t=i.name)||void 0===t?void 0:t.value)||i)}return e&&!mi(this.options.variables,e)&&(n.variables=this.options.variables=s(s({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(n,Ro.refetch)},t.prototype.fetchMore=function(e){var t=this,n=s(s({},e.query?e:s(s(s(s({},this.options),{query:this.options.query}),e),{variables:s(s({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"});n.query=this.transformDocument(n.query);var r=this.queryManager.generateQueryId();this.lastQuery=e.query?this.transformDocument(this.options.query):n.query;var i=this.queryInfo,o=i.networkStatus;i.networkStatus=Ro.fetchMore,n.notifyOnNetworkStatusChange&&this.observe();var a=new Set,c=null==e?void 0:e.updateQuery,u="no-cache"!==this.options.fetchPolicy;return u||O(c,21),this.queryManager.fetchQuery(r,n,Ro.fetchMore).then((function(l){if(t.queryManager.removeQuery(r),i.networkStatus===Ro.fetchMore&&(i.networkStatus=o),u)t.queryManager.cache.batch({update:function(r){var i=e.updateQuery;i?r.updateQuery({query:t.query,variables:t.variables,returnPartialData:!0,optimistic:!1},(function(e){return i(e,{fetchMoreResult:l.data,variables:n.variables})})):r.writeQuery({query:n.query,variables:n.variables,data:l.data})},onWatchUpdated:function(e){a.add(e.query)}});else{var f=t.getLast("result"),h=c(f.data,{fetchMoreResult:l.data,variables:n.variables});t.reportResult(s(s({},f),{data:h}),t.variables)}return l})).finally((function(){u&&!a.has(t.query)&&qo(t)}))},t.prototype.subscribeToMore=function(e){var t=this,n=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(n){var r=e.updateQuery;r&&t.updateQuery((function(e,t){var i=t.variables;return r(e,{subscriptionData:n,variables:i})}))},error:function(t){e.onError?e.onError(t):!1!==globalThis.__DEV__&&O.error(22,t)}});return this.subscriptions.add(n),function(){t.subscriptions.delete(n)&&n.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.silentSetOptions=function(e){var t=Qr(this.options,e||{});Po(this.options,t)},t.prototype.setVariables=function(e){return mi(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},Ro.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,n=e(t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});n&&(t.cache.writeQuery({query:this.options.query,data:n,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(e,t){if(t.nextFetchPolicy){var n=t.fetchPolicy,r=void 0===n?"cache-first":n,i=t.initialFetchPolicy,o=void 0===i?r:i;"standby"===r||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(r,{reason:e,options:t,observable:this,initialFetchPolicy:o}):t.fetchPolicy="variables-changed"===e?o:t.nextFetchPolicy)}return t.fetchPolicy},t.prototype.fetch=function(e,t,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,e,t,n)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,n=this.options.pollInterval;if(n&&this.hasObservers()){if(!t||t.interval!==n){O(n,23),(t||(this.pollingInfo={})).interval=n;var r=function(){var t,n;e.pollingInfo&&(Lo(e.queryInfo.networkStatus)||(null===(n=(t=e.options).skipPollAttempt)||void 0===n?void 0:n.call(t))?i():e.reobserve({fetchPolicy:"no-cache"===e.options.initialFetchPolicy?"no-cache":"network-only"},Ro.poll).then(i,i))},i=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(r,t.interval))};i()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},t.prototype.updateLastResult=function(e,t){void 0===t&&(t=this.variables);var n=this.getLastError();return n&&this.last&&!mi(t,this.last.variables)&&(n=void 0),this.last=s({result:this.queryManager.assumeImmutableResults?e:Nr(e),variables:t},n?{error:n}:null)},t.prototype.reobserveAsConcast=function(e,t){var n=this;this.isTornDown=!1;var r=t===Ro.refetch||t===Ro.fetchMore||t===Ro.poll,i=this.options.variables,o=this.options.fetchPolicy,a=Qr(this.options,e||{}),c=r?a:Po(this.options,a),u=this.transformDocument(c.query);this.lastQuery=u,r||(this.updatePolling(),!e||!e.variables||mi(e.variables,i)||"standby"===c.fetchPolicy||c.fetchPolicy!==o&&"function"!=typeof c.nextFetchPolicy||(this.applyNextFetchPolicy("variables-changed",c),void 0===t&&(t=Ro.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=Qo(c.fetchPolicy));var l=function(){n.concast===p&&(n.waitForOwnResult=!1)},f=c.variables&&s({},c.variables),h=this.fetch(c,t,u),p=h.concast,d=h.fromLink,v={next:function(e){mi(n.variables,f)&&(l(),n.reportResult(e,f))},error:function(e){mi(n.variables,f)&&(ti(e)||(e=new ni({networkError:e})),l(),n.reportError(e,f))}};return r||!d&&this.concast||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=p,this.observer=v),p.addObserver(v),p},t.prototype.reobserve=function(e,t){return this.reobserveAsConcast(e,t).promise},t.prototype.resubscribeAfterError=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.last;this.resetLastResults();var r=this.subscribe.apply(this,e);return this.last=n,r},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var n=this.getLastError(),r=this.isDifferentFromLastResult(e,t);(n||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),(n||r)&&Cr(this.observers,"next",e)},t.prototype.reportError=function(e,t){var n=s(s({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:Ro.error,loading:!1});this.updateLastResult(n,t),Cr(this.observers,"error",this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t.prototype.transformDocument=function(e){return this.queryManager.transform(e)},t}(_r);function qo(e){var t=e.options,n=t.fetchPolicy,r=t.nextFetchPolicy;return"cache-and-network"===n||"network-only"===n?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(e,t){return this.nextFetchPolicy=r,"function"==typeof this.nextFetchPolicy?this.nextFetchPolicy(e,t):n}}):e.reobserve()}function Vo(e){!1!==globalThis.__DEV__&&O.error(24,e.message,e.stack)}function Uo(e){!1!==globalThis.__DEV__&&e&&!1!==globalThis.__DEV__&&O.debug(25,e)}function Qo(e){return"network-only"===e||"no-cache"===e||"standby"===e}Fr(jo);var Bo=new($e?WeakMap:Map);function Ko(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return Bo.set(e,(Bo.get(e)+1)%1e15),n.apply(this,arguments)})}function Go(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var zo=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;Bo.has(n)||(Bo.set(n,0),Ko(n,"evict"),Ko(n,"modify"),Ko(n,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||Ro.loading;return this.variables&&this.networkStatus!==Ro.loading&&!mi(this.variables,e.variables)&&(t=Ro.setVariables),mi(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){Go(this),this.dirty=!1},e.prototype.resetDiff=function(){this.lastDiff=void 0},e.prototype.getDiff=function(){var e=this.getDiffOptions();if(this.lastDiff&&mi(e,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var t=this.observableQuery;if(t&&"no-cache"===t.options.fetchPolicy)return{complete:!1};var n=this.cache.diff(e);return this.updateLastDiff(n,e),n},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t,n=this,r=this.lastDiff&&this.lastDiff.diff;e&&!e.complete&&(null===(t=this.observableQuery)||void 0===t?void 0:t.getLastError())||(this.updateLastDiff(e),this.dirty||mi(r&&r.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return n.notify()}),0))))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():qo(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;Go(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Lo(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel;var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var n=this.observableQuery;if(!n||"no-cache"!==n.options.fetchPolicy){var r=s(s({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&mi(r,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=r))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===Bo.get(this.cache)&&mi(t,n.variables)&&mi(e.data,n.result.data))},e.prototype.markResult=function(e,t,n,r){var i=this,o=new nr,s=Bn(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Bn(e.incremental)){var a=qr(this.getDiff().result,e);e.data=a}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=o.merge(c.result,e.data)}this.graphQLErrors=s,"no-cache"===n.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):0!==r&&(Wo(e,n.errorPolicy)?this.cache.performTransaction((function(o){if(i.shouldWrite(e,n.variables))o.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:1===r}),i.lastWrite={result:e,variables:n.variables,dmCount:Bo.get(i.cache)};else if(i.lastDiff&&i.lastDiff.diff.complete)return void(e.data=i.lastDiff.diff.result);var s=i.getDiffOptions(n.variables),a=o.diff(s);!i.stopped&&mi(i.variables,n.variables)&&i.updateWatch(n.variables),i.updateLastDiff(a,s),a.complete&&(e.data=a.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Ro.ready},e.prototype.markError=function(e){return this.networkStatus=Ro.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function Wo(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!Vr(e);return!r&&n&&e.data&&(r=!0),r}var Yo=Object.prototype.hasOwnProperty,Ho=Object.create(null),Jo=function(){function e(e){var t=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new vt(gt["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new He(!1);var n=new Vn((function(e){return t.cache.transformDocument(e)}),{cache:!1});this.cache=e.cache,this.link=e.link,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientAwareness=e.clientAwareness,this.localState=e.localState,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults;var r=e.documentTransform;this.documentTransform=r?n.concat(r).concat(n):n,this.defaultContext=e.defaultContext||Object.create(null),(this.onBroadcast=e.onBroadcast)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,n){e.stopQueryNoBroadcast(n)})),this.cancelPendingFetches(x(26))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){return c(this,arguments,void 0,(function(e){var t,n,r,i,o,a,c,l=e.mutation,f=e.variables,h=e.optimisticResponse,p=e.updateQueries,d=e.refetchQueries,v=void 0===d?[]:d,y=e.awaitRefetchQueries,m=void 0!==y&&y,g=e.update,b=e.onQueryUpdated,E=e.fetchPolicy,S=void 0===E?(null===(a=this.defaultOptions.mutate)||void 0===a?void 0:a.fetchPolicy)||"network-only":E,T=e.errorPolicy,k=void 0===T?(null===(c=this.defaultOptions.mutate)||void 0===c?void 0:c.errorPolicy)||"none":T,_=e.keepRootFields,w=e.context;return u(this,(function(e){switch(e.label){case 0:return O(l,27),O("network-only"===S||"no-cache"===S,28),t=this.generateMutationId(),l=this.cache.transformForLink(this.transform(l)),n=this.getDocumentInfo(l).hasClientExports,f=this.getVariables(l,f),n?[4,this.localState.addExportedVariables(l,f,w)]:[3,2];case 1:f=e.sent(),e.label=2;case 2:return r=this.mutationStore&&(this.mutationStore[t]={mutation:l,variables:f,loading:!0,error:null}),i=h&&this.markMutationOptimistic(h,{mutationId:t,document:l,variables:f,fetchPolicy:S,errorPolicy:k,context:w,updateQueries:p,update:g,keepRootFields:_}),this.broadcastQueries(),o=this,[2,new Promise((function(e,n){return Rr(o.getObservableFromLink(l,s(s({},w),{optimisticResponse:i?h:void 0}),f,{},!1),(function(e){if(Vr(e)&&"none"===k)throw new ni({graphQLErrors:Ur(e)});r&&(r.loading=!1,r.error=null);var n=s({},e);return"function"==typeof v&&(v=v(n)),"ignore"===k&&Vr(n)&&delete n.errors,o.markMutationResult({mutationId:t,result:n,document:l,variables:f,fetchPolicy:S,errorPolicy:k,context:w,update:g,updateQueries:p,awaitRefetchQueries:m,refetchQueries:v,removeOptimistic:i?t:void 0,onQueryUpdated:b,keepRootFields:_})})).subscribe({next:function(t){o.broadcastQueries(),"hasNext"in t&&!1!==t.hasNext||e(t)},error:function(e){r&&(r.loading=!1,r.error=e),i&&o.cache.removeOptimistic(t),o.broadcastQueries(),n(e instanceof ni?e:new ni({networkError:e}))}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var n=this;void 0===t&&(t=this.cache);var r=e.result,i=[],o="no-cache"===e.fetchPolicy;if(!o&&Wo(r,e.errorPolicy)){if(Mr(r)||i.push({result:r.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Mr(r)&&Bn(r.incremental)){var a=t.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),c=void 0;a.result&&(c=qr(a.result,r)),void 0!==c&&(r.data=c,i.push({result:c,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach((function(e,o){var s=e.observableQuery,a=s&&s.queryName;if(a&&Yo.call(u,a)){var c=u[a],l=n.queries.get(o),f=l.document,h=l.variables,p=t.diff({query:f,variables:h,returnPartialData:!0,optimistic:!1}),d=p.result;if(p.complete&&d){var v=c(d,{mutationResult:r,queryName:f&&zt(f)||void 0,queryVariables:h});v&&i.push({result:v,dataId:"ROOT_QUERY",query:f,variables:h})}}}))}if(i.length>0||(e.refetchQueries||"").length>0||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(t){o||i.forEach((function(e){return t.write(e)}));var a,c=e.update,u=!(Mr(a=r)||function(e){return"hasNext"in e&&"data"in e}(a))||Mr(r)&&!r.hasNext;if(c){if(!o){var l=t.diff({id:"ROOT_MUTATION",query:n.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});l.complete&&("incremental"in(r=s(s({},r),{data:l.result}))&&delete r.incremental,"hasNext"in r&&delete r.hasNext)}u&&c(t,r,{context:e.context,variables:e.variables})}o||e.keepRootFields||!u||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var n=t.fieldName,r=t.DELETE;return"__typename"===n?e:r}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach((function(e){return l.push(e)})),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then((function(){return r}))}return Promise.resolve(r)},e.prototype.markMutationOptimistic=function(e,t){var n=this,r="function"==typeof e?e(t.variables,{IGNORE:Ho}):e;return r!==Ho&&(this.cache.recordOptimisticTransaction((function(e){try{n.markMutationResult(s(s({},t),{result:{data:r}}),e)}catch(e){!1!==globalThis.__DEV__&&O.error(e)}}),t.mutationId),!0)},e.prototype.fetchQuery=function(e,t,n){return this.fetchConcastWithInfo(e,t,n).concast.promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},e.prototype.getDocumentInfo=function(e){var t=this.transformCache;if(!t.has(e)){var n={hasClientExports:Ke(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:Be(["nonreactive"],e),clientQuery:this.localState.clientQuery(e),serverQuery:Yn([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],e),defaultVars:Jt(Gt(e)),asQuery:s(s({},e),{definitions:e.definitions.map((function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?s(s({},e),{operation:"query"}):e}))})};t.set(e,n)}return t.get(e)},e.prototype.getVariables=function(e,t){return s(s({},this.getDocumentInfo(e).defaultVars),t)},e.prototype.watchQuery=function(e){var t=this.transform(e.query);void 0===(e=s(s({},e),{variables:this.getVariables(t,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var n=new zo(this),r=new jo({queryManager:this,queryInfo:n,options:e});return r.lastQuery=t,this.queries.set(r.queryId,n),n.init({document:t,observableQuery:r,variables:r.variables}),r},e.prototype.query=function(e,t){var n=this;return void 0===t&&(t=this.generateQueryId()),O(e.query,29),O("Document"===e.query.kind,30),O(!e.returnPartialData,31),O(!e.pollInterval,32),this.fetchQuery(t,s(s({},e),{query:this.transform(e.query)})).finally((function(){return n.stopQuery(t)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(x(33)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=Ro.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var n=new Map,r=new Map,i=new Set;return Array.isArray(e)&&e.forEach((function(e){var n;"string"==typeof e?r.set(e,!1):tt(n=e)&&"Document"===n.kind&&Array.isArray(n.definitions)?r.set(t.transform(e),!1):tt(e)&&e.query&&i.add(e)})),this.queries.forEach((function(t,i){var o=t.observableQuery,s=t.document;if(o){if("all"===e)return void n.set(i,o);var a=o.queryName;if("standby"===o.options.fetchPolicy||"active"===e&&!o.hasObservers())return;("active"===e||a&&r.has(a)||s&&r.has(s))&&(n.set(i,o),a&&r.set(a,!0),s&&r.set(s,!0))}})),i.size&&i.forEach((function(e){var r=k("legacyOneTimeQuery"),i=t.getQuery(r).init({document:e.query,variables:e.variables}),o=new jo({queryManager:t,queryInfo:i,options:s(s({},e),{fetchPolicy:"network-only"})});O(o.queryId===r),i.setObservableQuery(o),n.set(r,o)})),!1!==globalThis.__DEV__&&r.size&&r.forEach((function(e,t){e||!1!==globalThis.__DEV__&&O.warn("string"==typeof t?34:35,t)})),n},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach((function(r,i){var o=r.options.fetchPolicy;r.resetLastResults(),(e||"standby"!==o&&"cache-only"!==o)&&n.push(r.refetch()),t.getQuery(i).setDiff(null)})),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,i=e.errorPolicy,o=void 0===i?"none":i,s=e.variables,a=e.context,c=void 0===a?{}:a,u=e.extensions,l=void 0===u?{}:u;n=this.transform(n),s=this.getVariables(n,s);var f=function(e){return t.getObservableFromLink(n,c,e,l).map((function(i){"no-cache"!==r&&(Wo(i,o)&&t.cache.write({query:n,result:i.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries());var s=Vr(i),a=function(e){return!!e.extensions&&Array.isArray(e.extensions[ei])}(i);if(s||a){var c={};if(s&&(c.graphQLErrors=i.errors),a&&(c.protocolErrors=i.extensions[ei]),"none"===o||a)throw new ni(c)}return"ignore"===o&&delete i.errors,i}))};if(this.getDocumentInfo(n).hasClientExports){var h=this.localState.addExportedVariables(n,s,c).then(f);return new _r((function(e){var t=null;return h.then((function(n){return t=n.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return f(s)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,n,r,i){var o,a,c=this;void 0===i&&(i=null!==(o=null==t?void 0:t.queryDeduplication)&&void 0!==o?o:this.queryDeduplication);var u=this.getDocumentInfo(e),l=u.serverQuery,f=u.clientQuery;if(l){var h=this.inFlightLinkObservables,p=this.link,d={query:l,variables:n,operationName:zt(l)||void 0,context:this.prepareContext(s(s({},t),{forceFetch:!i})),extensions:r};if(t=d.context,i){var v=Un(l),y=At(n),m=h.lookup(v,y);if(!(a=m.observable)){var g=new Pr([Jr(p,d)]);a=m.observable=g,g.beforeNext((function(){h.remove(v,y)}))}}else a=new Pr([Jr(p,d)])}else a=new Pr([_r.of({data:{}})]),t=this.prepareContext(t);return f&&(a=Rr(a,(function(e){return c.localState.runResolvers({document:f,remoteResult:e,context:t,variables:n})}))),a},e.prototype.getResultsFromLink=function(e,t,n){var r=e.lastRequestId=this.generateRequestId(),i=this.cache.transformForLink(n.query);return Rr(this.getObservableFromLink(i,n.context,n.variables),(function(o){var s=Ur(o),a=s.length>0,c=n.errorPolicy;if(r>=e.lastRequestId){if(a&&"none"===c)throw e.markError(new ni({graphQLErrors:s}));e.markResult(o,i,n,t),e.markReady()}var u={data:o.data,loading:!1,networkStatus:Ro.ready};return a&&"none"===c&&(u.data=void 0),a&&"ignore"!==c&&(u.errors=s,u.networkStatus=Ro.error),u}),(function(t){var n=ti(t)?t:new ni({networkError:t});throw r>=e.lastRequestId&&e.markError(n),n}))},e.prototype.fetchConcastWithInfo=function(e,t,n,r){var i=this;void 0===n&&(n=Ro.loading),void 0===r&&(r=t.query);var o,s,a=this.getVariables(r,t.variables),c=this.getQuery(e),u=this.defaultOptions.watchQuery,l=t.fetchPolicy,f=void 0===l?u&&u.fetchPolicy||"cache-first":l,h=t.errorPolicy,p=void 0===h?u&&u.errorPolicy||"none":h,d=t.returnPartialData,v=void 0!==d&&d,y=t.notifyOnNetworkStatusChange,m=void 0!==y&&y,g=t.context,b=void 0===g?{}:g,E=Object.assign({},t,{query:r,variables:a,fetchPolicy:f,errorPolicy:p,returnPartialData:v,notifyOnNetworkStatusChange:m,context:b}),S=function(e){E.variables=e;var r=i.fetchQueryByPolicy(c,E,n);return"standby"!==E.fetchPolicy&&r.sources.length>0&&c.observableQuery&&c.observableQuery.applyNextFetchPolicy("after-fetch",t),r},T=function(){return i.fetchCancelFns.delete(e)};if(this.fetchCancelFns.set(e,(function(e){T(),setTimeout((function(){return o.cancel(e)}))})),this.getDocumentInfo(E.query).hasClientExports)o=new Pr(this.localState.addExportedVariables(E.query,E.variables,E.context).then(S).then((function(e){return e.sources}))),s=!0;else{var k=S(E.variables);s=k.fromLink,o=new Pr(k.sources)}return o.promise.then(T,T),{concast:o,fromLink:s}},e.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,r=e.include,i=e.optimistic,o=void 0!==i&&i,s=e.removeOptimistic,a=void 0===s?o?k("refetchQueries"):void 0:s,c=e.onQueryUpdated,u=new Map;r&&this.getObservableQueries(r).forEach((function(e,n){u.set(n,{oq:e,lastDiff:t.getQuery(n).getDiff()})}));var l=new Map;return n&&this.cache.batch({update:n,optimistic:o&&a||!1,removeOptimistic:a,onWatchUpdated:function(e,t,n){var r=e.watcher instanceof zo&&e.watcher.observableQuery;if(r){if(c){u.delete(r.queryId);var i=c(r,t,n);return!0===i&&(i=r.refetch()),!1!==i&&l.set(r,i),i}null!==c&&u.set(r.queryId,{oq:r,lastDiff:n,diff:t})}}}),u.size&&u.forEach((function(e,n){var r,i=e.oq,o=e.lastDiff,s=e.diff;if(c){if(!s){var a=i.queryInfo;a.reset(),s=a.getDiff()}r=c(i,s,o)}c&&!0!==r||(r=i.refetch()),!1!==r&&l.set(i,r),n.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(n)})),a&&this.cache.removeOptimistic(a),l},e.prototype.fetchQueryByPolicy=function(e,t,n){var r=this,i=t.query,o=t.variables,a=t.fetchPolicy,c=t.refetchWritePolicy,u=t.errorPolicy,l=t.returnPartialData,f=t.context,h=t.notifyOnNetworkStatusChange,p=e.networkStatus;e.init({document:i,variables:o,networkStatus:n});var d=function(){return e.getDiff()},v=function(t,n){void 0===n&&(n=e.networkStatus||Ro.loading);var a=t.result;!1===globalThis.__DEV__||l||mi(a,{})||Uo(t.missing);var c=function(e){return _r.of(s({data:e,loading:Lo(n),networkStatus:n},t.complete?null:{partial:!0}))};return a&&r.getDocumentInfo(i).hasForcedResolvers?r.localState.runResolvers({document:i,remoteResult:{data:a},context:f,variables:o,onlyRunForcedResolvers:!0}).then((function(e){return c(e.data||void 0)})):"none"===u&&n===Ro.refetch&&Array.isArray(t.missing)?c(void 0):c(a)},y="no-cache"===a?0:n===Ro.refetch&&"merge"!==c?1:2,m=function(){return r.getResultsFromLink(e,y,{query:i,variables:o,context:f,fetchPolicy:a,errorPolicy:u})},g=h&&"number"==typeof p&&p!==n&&Lo(n);switch(a){default:case"cache-first":return(b=d()).complete?{fromLink:!1,sources:[v(b,e.markReady())]}:l||g?{fromLink:!0,sources:[v(b),m()]}:{fromLink:!0,sources:[m()]};case"cache-and-network":var b;return(b=d()).complete||l||g?{fromLink:!0,sources:[v(b),m()]}:{fromLink:!0,sources:[m()]};case"cache-only":return{fromLink:!1,sources:[v(d(),e.markReady())]};case"network-only":return g?{fromLink:!0,sources:[v(d()),m()]}:{fromLink:!0,sources:[m()]};case"no-cache":return g?{fromLink:!0,sources:[v(e.getDiff()),m()]}:{fromLink:!0,sources:[m()]};case"standby":return{fromLink:!1,sources:[]}}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new zo(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return s(s(s({},this.defaultContext),t),{clientAwareness:this.clientAwareness})},e}(),$o=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=Zn(t.resolvers,e)})):this.resolvers=Zn(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){return c(this,arguments,void 0,(function(e){var t=e.document,n=e.remoteResult,r=e.context,i=e.variables,o=e.onlyRunForcedResolvers,a=void 0!==o&&o;return u(this,(function(e){return t?[2,this.resolveDocument(t,n.data,r,i,this.fragmentMatcher,a).then((function(e){return s(s({},n),{data:e.result})}))]:[2,n]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return Be(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return $n(e)},e.prototype.prepareContext=function(e){var t=this.cache;return s(s({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e){return c(this,arguments,void 0,(function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),u(this,(function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then((function(e){return s(s({},t),e.exportedVariables)}))]:[2,s({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return Re(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return Ce}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:Jn(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t){return c(this,arguments,void 0,(function(e,t,n,r,i,o){var a,c,l,f,h,p,d,v,y,m;return void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i=function(){return!0}),void 0===o&&(o=!1),u(this,(function(u){return a=Ht(e),c=Wt(e),l=rt(c),f=this.collectSelectionsToResolve(a,l),h=a.operation,p=h?h.charAt(0).toUpperCase()+h.slice(1):"Query",v=(d=this).cache,y=d.client,m={fragmentMap:l,context:s(s({},n),{cache:v,client:y}),variables:r,fragmentMatcher:i,defaultOperationType:p,exportedVariables:{},selectionsToResolve:f,onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(a.selectionSet,false,t,m).then((function(e){return{result:e,exportedVariables:m.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,n,r){return c(this,void 0,void 0,(function(){var i,o,s,a,l,f=this;return u(this,(function(h){return i=r.fragmentMap,o=r.context,s=r.variables,a=[n],l=function(e){return c(f,void 0,void 0,(function(){var c,l;return u(this,(function(u){return(t||r.selectionsToResolve.has(e))&&Qe(e,s)?Bt(e)?[2,this.resolveField(e,t,n,r).then((function(t){var n;void 0!==t&&a.push(((n={})[Ut(e)]=t,n))}))]:(!function(e){return"InlineFragment"===e.kind}(e)?(c=i[e.name.value],O(c,18,e.name.value)):c=e,c&&c.typeCondition&&(l=c.typeCondition.name.value,r.fragmentMatcher(n,l,o))?[2,this.resolveSelectionSet(c.selectionSet,t,n,r).then((function(e){a.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(l)).then((function(){return er(a)}))]}))}))},e.prototype.resolveField=function(e,t,n,r){return c(this,void 0,void 0,(function(){var i,o,s,a,c,l,f,h,p,d=this;return u(this,(function(u){return n?(i=r.variables,o=e.name.value,s=Ut(e),a=o!==s,c=n[s]||n[o],l=Promise.resolve(c),r.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(f=n.__typename||r.defaultOperationType,(h=this.resolvers&&this.resolvers[f])&&(p=h[a?o:s])&&(l=Promise.resolve(to.withValue(this.cache,p,[n,Vt(e,i),r.context,{field:e,fragmentMap:r.fragmentMap}])))),[2,l.then((function(n){var i,o;if(void 0===n&&(n=c),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=n)}))})),!e.selectionSet)return n;if(null==n)return n;var s=null!==(o=null===(i=e.directives)||void 0===i?void 0:i.some((function(e){return"client"===e.name.value})))&&void 0!==o&&o;return Array.isArray(n)?d.resolveSubSelectedArray(e,t||s,n,r):e.selectionSet?d.resolveSelectionSet(e.selectionSet,t||s,n,r):void 0}))]):[2,null]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,n,r){var i=this;return Promise.all(n.map((function(n){return null===n?null:Array.isArray(n)?i.resolveSubSelectedArray(e,t,n,r):e.selectionSet?i.resolveSelectionSet(e.selectionSet,t,n,r):void 0})))},e.prototype.collectSelectionsToResolve=function(e,t){var n=function(e){return!Array.isArray(e)},r=this.selectionsToResolveCache;return function e(i){if(!r.has(i)){var o=new Set;r.set(i,o),Re(i,{Directive:function(e,t,r,i,s){"client"===e.name.value&&s.forEach((function(e){n(e)&&Ue(e)&&o.add(e)}))},FragmentSpread:function(r,i,s,a,c){var u=t[r.name.value];O(u,19,r.name.value);var l=e(u);l.size>0&&(c.forEach((function(e){n(e)&&Ue(e)&&o.add(e)})),o.add(r),l.forEach((function(e){o.add(e)})))}})}return r.get(i)}(e)},e}(),Xo=!1,Zo=function(){function e(e){var t=this;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw x(15);var n=e.uri,r=e.credentials,i=e.headers,o=e.cache,a=e.documentTransform,c=e.ssrMode,u=void 0!==c&&c,l=e.ssrForceFetchDelay,f=void 0===l?0:l,h=e.connectToDevTools,p=e.queryDeduplication,d=void 0===p||p,v=e.defaultOptions,y=e.defaultContext,m=e.assumeImmutableResults,g=void 0===m?o.assumeImmutableResults:m,E=e.resolvers,S=e.typeDefs,T=e.fragmentMatcher,k=e.name,_=e.version,w=e.devtools,O=e.link;O||(O=n?new hi({uri:n,credentials:r,headers:i}):Hr.empty()),this.link=O,this.cache=o,this.disableNetworkFetches=u||f>0,this.queryDeduplication=d,this.defaultOptions=v||Object.create(null),this.typeDefs=S,this.devtoolsConfig=s(s({},w),{enabled:(null==w?void 0:w.enabled)||h}),void 0===this.devtoolsConfig.enabled&&(this.devtoolsConfig.enabled=!1!==globalThis.__DEV__),f&&setTimeout((function(){return t.disableNetworkFetches=!1}),f),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=b,this.localState=new $o({cache:o,client:this,resolvers:E,fragmentMatcher:T}),this.queryManager=new Jo({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:y,documentTransform:a,queryDeduplication:d,ssrMode:u,clientAwareness:{name:k,version:_},localState:this.localState,assumeImmutableResults:g,onBroadcast:this.devtoolsConfig.enabled?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return e.prototype.connectToDevTools=function(){if("undefined"!=typeof window){var e=window,t=Symbol.for("apollo.devtools");(e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this,Xo||!1===globalThis.__DEV__||(Xo=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout((function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var e=window.navigator,t=e&&e.userAgent,n=void 0;"string"==typeof t&&(t.indexOf("Chrome/")>-1?n="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":t.indexOf("Firefox/")>-1&&(n="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),n&&!1!==globalThis.__DEV__&&O.log("Download the Apollo DevTools for a better development experience: %s",n)}}),1e4))}},Object.defineProperty(e.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Br(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=s(s({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=Br(this.defaultOptions.query,e)),O("cache-and-network"!==e.fetchPolicy,16),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=s(s({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Br(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.watchFragment=function(e){return this.cache.watchFragment(e)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Jr(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],r=[];t.forEach((function(e,t){n.push(t),r.push(e)}));var i=Promise.all(r);return i.queries=n,i.results=r,i.catch((function(e){!1!==globalThis.__DEV__&&O.debug(17,e)})),i},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},Object.defineProperty(e.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),e}();!1!==globalThis.__DEV__&&(Zo.prototype.getMemoryInternals=St);var es=new Map,ts=new Map,ns=!0,rs=!1;function is(e){return e.replace(/[\s,]+/g," ").trim()}function os(e){var t=new Set,n=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var r=e.name.value,i=is((s=e.loc).source.body.substring(s.start,s.end)),o=ts.get(r);o&&!o.has(i)?ns&&console.warn("Warning: fragment with name "+r+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):o||ts.set(r,o=new Set),o.add(i),t.has(i)||(t.add(i),n.push(e))}else n.push(e);var s})),s(s({},e),{definitions:n})}function ss(e){var t=is(e);if(!es.has(t)){var n=function(e,t){return new Oe(e,t).parseDocument()}(e,{experimentalFragmentVariables:rs,allowLegacyFragmentVariables:rs});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");es.set(t,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(n){var r=e[n];r&&"object"==typeof r&&t.add(r)}))}));var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}(os(n)))}return es.get(t)}function as(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];"string"==typeof e&&(e=[e]);var r=e[0];return t.forEach((function(t,n){t&&"Document"===t.kind?r+=t.loc.source.body:r+=t,r+=e[n+1]})),ss(r)}var cs,us,ls,fs,hs,ps,ds,vs,ys,ms,gs,bs,Es,Ss,Ts,ks,_s,ws,Os,xs,Ns,Ds,Is,As=as,Cs=function(){es.clear(),ts.clear()},Rs=function(){ns=!1},Fs=function(){rs=!0},Ls=function(){rs=!1};(cs=as).gql=As,cs.resetCaches=Cs,cs.disableFragmentWarnings=Rs,cs.enableExperimentalFragmentVariables=Fs,cs.disableExperimentalFragmentVariables=Ls,as.default=as,exports.ItemType=void 0,(us=exports.ItemType||(exports.ItemType={})).PRODUCT="PRODUCT",us.PACKAGE="PACKAGE",function(e){e.OK="OK",e.CUSTOMER_BLACKLISTED="CUSTOMER_BLACKLISTED"}(ls||(ls={})),exports.GeinsEventType=void 0,(fs=exports.GeinsEventType||(exports.GeinsEventType={})).USER="USER",fs.USER_LOGIN="USER_LOGIN",fs.USER_LOGOUT="USER_LOGOUT",fs.USER_UPDATE="USER_UPDATE",fs.USER_DELETE="USER_DELETE",fs.CART="CART",fs.CART_ADD="CART_ADD",fs.CART_REMOVE="CART_REMOVE",fs.CART_UPDATE="CART_UPDATE",fs.CART_CLEAR="CART_CLEAR",exports.CustomerType=void 0,(hs=exports.CustomerType||(exports.CustomerType={})).PERSON="PERSON",hs.ORGANIZATION="ORGANIZATION",exports.GeinsLogLevel=void 0,(ps=exports.GeinsLogLevel||(exports.GeinsLogLevel={})).NONE="NONE",ps.DEBUG="DEBUG",ps.INFO="INFO",ps.WARN="WARN",ps.ERROR="ERROR",exports.RuntimeContext=void 0,(ds=exports.RuntimeContext||(exports.RuntimeContext={})).SERVER="server",ds.CLIENT="client",ds.HYBRID="hybrid",exports.LinkAttributeRelEnum=void 0,(vs=exports.LinkAttributeRelEnum||(exports.LinkAttributeRelEnum={})).follow="follow",vs.noopener="noopener",vs.noreferrer="noreferrer",vs.alternate="alternate",vs.author="author",vs.bookmark="bookmark",vs.external="external",vs.help="help",vs.license="license",vs.next="next",vs.nofollow="nofollow",vs.prev="prev",vs.search="search",vs.tag="tag",exports.AuthClientConnectionModes=void 0,(ys=exports.AuthClientConnectionModes||(exports.AuthClientConnectionModes={})).Proxy="Proxy",ys.Direct="Direct",exports.ProductListSortType=void 0,(ms=exports.ProductListSortType||(exports.ProductListSortType={})).NONE="NONE",ms.PRICE="PRICE",ms.PRICE_DESC="PRICE_DESC",ms.MOST_SOLD="MOST_SOLD",ms.VOTES="VOTES",ms.BRAND="BRAND",ms.LATEST="LATEST",ms.RELEVANCE="RELEVANCE",ms.FACET_ORDER="FACET_ORDER",ms.ALPHABETICAL="ALPHABETICAL",ms.ALPHABETICAL_DESC="ALPHABETICAL_DESC",ms.AVAILABLE_STOCK="AVAILABLE_STOCK",ms.AVAILABLE_STOCK_DESC="AVAILABLE_STOCK_DESC",ms.TOTAL_STOCK="TOTAL_STOCK",ms.TOTAL_STOCK_DESC="TOTAL_STOCK_DESC",exports.ProductFilterModeType=void 0,(gs=exports.ProductFilterModeType||(exports.ProductFilterModeType={})).BY_GROUP="BY_GROUP",gs.CURRENT="CURRENT",exports.FilterSystemEntityTypes=void 0,(bs=exports.FilterSystemEntityTypes||(exports.FilterSystemEntityTypes={})).Brand="Brand",bs.Category="Category",bs.Price="Price",bs.Sku="Sku",bs.StockStatus="StockStatus",bs.DiscountCampaign="DiscountCampaign",bs.DiscountCampaignNumber="DiscountCampaignNumber",bs.Discount="Discount",bs.ReducedPrice="ReducedPrice",exports.GeinsCheckoutStatus=void 0,(Es=exports.GeinsCheckoutStatus||(exports.GeinsCheckoutStatus={})).CustomerBlacklistedType="CUSTOMER_BLACKLISTED",Es.OkType="OK",exports.GeinsCustomerType=void 0,(Ss=exports.GeinsCustomerType||(exports.GeinsCustomerType={})).OrganizationType="ORGANIZATION",Ss.PersonType="PERSON",exports.GeinsDiscountType=void 0,(Ts=exports.GeinsDiscountType||(exports.GeinsDiscountType={})).NoneType="NONE",Ts.PriceCampaignType="PRICE_CAMPAIGN",Ts.SalePriceType="SALE_PRICE",exports.GeinsFilterMode=void 0,(ks=exports.GeinsFilterMode||(exports.GeinsFilterMode={})).ByGroupType="BY_GROUP",ks.CurrentType="CURRENT",exports.GeinsGender=void 0,(_s=exports.GeinsGender||(exports.GeinsGender={})).ManType="MAN",_s.UnspecifiedType="UNSPECIFIED",_s.WomanType="WOMAN",exports.GeinsPaymentType=void 0,(ws=exports.GeinsPaymentType||(exports.GeinsPaymentType={})).AvardaType="AVARDA",ws.KlarnaType="KLARNA",ws.StandardType="STANDARD",ws.SveaType="SVEA",ws.WalleyType="WALLEY",ws.GeinsPayType="GEINS_PAY",exports.GeinsProductRelation=void 0,(Os=exports.GeinsProductRelation||(exports.GeinsProductRelation={})).AccessoriesType="ACCESSORIES",Os.RelatedType="RELATED",Os.SimilarType="SIMILAR",exports.GeinsSortType=void 0,(xs=exports.GeinsSortType||(exports.GeinsSortType={})).AlphabeticalType="ALPHABETICAL",xs.AlphabeticalDescType="ALPHABETICAL_DESC",xs.AvailableStockType="AVAILABLE_STOCK",xs.AvailableStockDescType="AVAILABLE_STOCK_DESC",xs.BrandType="BRAND",xs.Custom_1Type="CUSTOM_1",xs.Custom_2Type="CUSTOM_2",xs.Custom_3Type="CUSTOM_3",xs.Custom_4Type="CUSTOM_4",xs.Custom_5Type="CUSTOM_5",xs.FacetOrderType="FACET_ORDER",xs.LatestType="LATEST",xs.MostSoldType="MOST_SOLD",xs.NoneType="NONE",xs.PriceType="PRICE",xs.PriceDescType="PRICE_DESC",xs.RelevanceType="RELEVANCE",xs.TotalStockType="TOTAL_STOCK",xs.TotalStockDescType="TOTAL_STOCK_DESC",xs.VotesType="VOTES",exports.DiscountType=void 0,(Ns=exports.DiscountType||(exports.DiscountType={}))[Ns.PERCENTAGE=0]="PERCENTAGE",Ns[Ns.FIXED_AMOUNT=1]="FIXED_AMOUNT",exports.Gender=void 0,(Ds=exports.Gender||(exports.Gender={})).UNSET="unset",Ds.UNSPECIFIED="unspecified",Ds.WOMAN="woman",Ds.MAN="man",exports.PaymentOptionCheckoutType=void 0,(Is=exports.PaymentOptionCheckoutType||(exports.PaymentOptionCheckoutType={})).STANDARD="STANDARD",Is.EXTERNAL="EXTERNAL",Is.GEINS_PAY="GEINS_PAY";var Ps="https://merchantapi.geins.io/graphql",Ms="https://merchantapi.geins.io/auth/sign/{API-KEY}?identity=",js="https://auth-service.geins.io/api/{ACCOUNT}_{ENV}",qs="https://{ACCOUNT}.commerce.services",Vs="https://mgmtapi.geins.io",Us="https://merchantapi.geins.io/redirect/urlhistory",Qs="https://merchantapi.geins.io/redirect/aliashistory",Bs={main:Ps,auth:js,auth_sign:Ms,image:qs},Ks={USER:"geins-user",USER_AUTH:"geins-auth",USER_TYPE:"geins-user-type",USER_MAX_AGE:"geins-user-maxage",REFRESH_TOKEN:"geins-auth-refresh-token"},Gs=new Map([["geins-cart","{geins.cartid}"],["geins-pm","{geins.paymentMethodId}"],["geins-pt","{geins.paymentType}"],["geins-uid","{payment.uid}"]]),zs=function(){function e(e){this.apiKey=e}return e.prototype.getEndpointUrl=function(e){return"".concat(e,"/").concat(this.apiKey)},e.prototype.request=function(t){return c(this,void 0,void 0,(function(){var n,r;return u(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,fetch(t,s(s({},{headers:{Accept:"application/json","Content-Type":"application/json"}}),{signal:AbortSignal.timeout(e.FETCH_TIMEOUT_MS)}))];case 1:if(!(n=i.sent()).ok)throw new Error("Request failed with status ".concat(n.status,": ").concat(n.statusText));return[4,n.json()];case 2:return[2,i.sent()];case 3:throw r=i.sent(),console.error("Error fetching data from ".concat(t,":"),r),r;case 4:return[2]}}))}))},e.prototype.getUrlHistory=function(e){return c(this,void 0,void 0,(function(){var t;return u(this,(function(n){return t=this.getEndpointUrl(Us)+(e?"?offset=".concat(e):""),[2,this.request(t)]}))}))},e.prototype.getSlugHistory=function(e){return c(this,void 0,void 0,(function(){var t;return u(this,(function(n){return t=this.getEndpointUrl(Qs)+(e?"?offset=".concat(e):""),[2,this.request(t)]}))}))},e.FETCH_TIMEOUT_MS=1e4,e}(),Ws=function(){function e(e){this.baseUrl=Vs,this.apiKey=e.apiKey,this.authToken=this.createAuthToken(e)}return e.prototype.createAuthToken=function(e){return btoa("".concat(e.username,":").concat(e.password))},e.prototype.getEndpointUrl=function(e){return"".concat(this.baseUrl,"/").concat(e)},e.prototype.request=function(t,n){return c(this,arguments,void 0,(function(t,n,r){var i,o;return void 0===r&&(r={}),u(this,(function(a){switch(a.label){case 0:return i=this.getEndpointUrl(n),o={method:t,headers:{Accept:"application/json","Content-Type":"application/json","x-apikey":this.apiKey,Authorization:"Bearer ".concat(this.authToken)},body:JSON.stringify(r)},[4,fetch(i,s(s({},o),{signal:AbortSignal.timeout(e.FETCH_TIMEOUT_MS)})).then((function(e){return e.json()}))];case 1:return[2,a.sent()]}}))}))},e.FETCH_TIMEOUT_MS=1e4,e}(),Ys=function(){function t(t){this.path="/",this.domain="",this.secure=!0,this.httpOnly=!0,this.sameSite="lax",this.cookie=e(),this.maxAge=0,t&&(t.path&&(this.path=t.path),t.domain&&(this.domain=t.domain),void 0!==t.secure&&(this.secure=t.secure),void 0!==t.httpOnly&&(this.httpOnly=t.httpOnly),void 0!==t.sameSite&&(this.sameSite=t.sameSite),void 0!==t.maxAge&&(this.maxAge=this.parseMaxAge(t.maxAge)))}return t.prototype.getConfig=function(){return{path:this.path,domain:this.domain,secure:this.secure,httpOnly:this.httpOnly,sameSite:this.sameSite,maxAge:this.maxAge}},t.prototype.parseMaxAge=function(e){if("string"==typeof e){var t=parseInt(e,10);return isNaN(t)?0:t}return e},t.prototype.configToCookieOptions=function(e){return{path:e.path,domain:e.domain,secure:e.secure,httpOnly:e.httpOnly,sameSite:e.sameSite,maxAge:void 0!==e.maxAge?this.parseMaxAge(e.maxAge):void 0}},t.prototype.getAll=function(){return this.cookie.getAll()},t.prototype.get=function(e){return this.cookie.get(e)||""},t.prototype.remove=function(e){this.cookie.remove(e)},t.prototype.set=function(e,t){var n=this.getConfig(),r=s(s(s({},n),t),e),i=this.configToCookieOptions(r);this.cookie.set(e.name,e.payload,i)},t}();function Hs(){return"undefined"==typeof window}function Js(e,t,n){return void 0===n&&(n="prod"),{main:Bs.main,auth:Bs.auth.replace("{ACCOUNT}",t).replace("{ENV}",n),authSign:Bs.auth_sign.replace("{API-KEY}",e),image:Bs.image.replace("{ACCOUNT}",t)}}function $s(e,n){if(!e)throw new Error("Token is required.");var r=e.split(".");if(3!==r.length&&n||2!==r.length&&!n)throw new Error("Invalid JWT token format.");var i=r[0],o=r[1],s=r[2],a=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/"),n=atob(t);return decodeURIComponent(n.split("").map((function(e){return"%".concat(e.charCodeAt(0).toString(16).padStart(2,"0"))})).join(""))},c=JSON.parse(a(i)),u=JSON.parse(a(o));if(n&&t.createHmac("sha256",n).update("".concat(i,".").concat(o)).digest("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")!==s)throw new Error("Invalid token signature.");return{header:c,payload:u}}function Xs(e,n){if(!e||"object"!=typeof e)throw new Error("Payload must be a valid object.");var r=function(e){return btoa(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},i={alg:n?"HS256":"none",typ:"JWT"},o=r(JSON.stringify(i)),s=r(JSON.stringify(e));if(!n)return"".concat(o,".").concat(s);var a=t.createHmac("sha256",n).update("".concat(o,".").concat(s)).digest("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");return"".concat(o,".").concat(s,".").concat(a)}var Zs,ea,ta=function(){function e(e){this.currentLogLevel=e}return e.prototype.shouldLog=function(e){if(this.currentLogLevel===exports.GeinsLogLevel.NONE)return!1;var t=[exports.GeinsLogLevel.DEBUG,exports.GeinsLogLevel.INFO,exports.GeinsLogLevel.WARN,exports.GeinsLogLevel.ERROR];return t.indexOf(e)>=t.indexOf(this.currentLogLevel)},e.prototype.none=function(e){this.shouldLog(exports.GeinsLogLevel.DEBUG)&&console.debug("[DEBUG]: ".concat(e))},e.prototype.debug=function(e){this.shouldLog(exports.GeinsLogLevel.DEBUG)&&console.debug("[DEBUG]: ".concat(e))},e.prototype.info=function(e){this.shouldLog(exports.GeinsLogLevel.INFO)&&console.info("[INFO]: ".concat(e))},e.prototype.warn=function(e){this.shouldLog(exports.GeinsLogLevel.WARN)&&console.warn("[WARN]: ".concat(e))},e.prototype.error=function(e){this.shouldLog(exports.GeinsLogLevel.ERROR)&&console.error("[ERROR]: ".concat(e))},e}(),na=function(){function e(e){void 0===e&&(e=3e5),this.defaultTTL=e,this.cache=new Map}return e.prototype.set=function(e,t,n){void 0===n&&(n=this.defaultTTL);var r=Date.now()+n;this.cache.set(e,{value:t,expiry:r})},e.prototype.get=function(e){var t=this.cache.get(e);if(t&&t.expiry>Date.now())return t.value;this.cache.delete(e)},e.prototype.delete=function(e){this.cache.delete(e)},e.prototype.clear=function(){this.cache.clear()},e}();exports.FetchPolicyOptions=void 0,(Zs=exports.FetchPolicyOptions||(exports.FetchPolicyOptions={})).CACHE_FIRST="cache-first",Zs.NETWORK_ONLY="network-only",Zs.CACHE_ONLY="cache-only",Zs.NO_CACHE="no-cache",Zs.STANDBY="standby",exports.OperationType=void 0,(ea=exports.OperationType||(exports.OperationType={})).QUERY="query",ea.MUTATION="mutation";var ra=function(){function e(e){this.fetchPolicy=Hs()?exports.FetchPolicyOptions.NO_CACHE:exports.FetchPolicyOptions.CACHE_FIRST,this.pollInterval=0;var t=e.apiUrl,n=e.apiKey,r=e.userToken,i=e.fetchPolicy;this._apolloClient=this.createClient(t,n),Hs()||(this._cookieService=new Ys),r&&(this._userToken=r),i&&(this.fetchPolicy=i)}return e.prototype.updateToken=function(e){this._userToken=e},Object.defineProperty(e.prototype,"userToken",{get:function(){return this._userToken},enumerable:!1,configurable:!0}),e.prototype.createClient=function(e,t){var n=new Fo({typePolicies:{CartType:{fields:{items:{merge:function(e,t){return t}},appliedCampaigns:{merge:function(e,t){return t}}}}}});return new Zo({uri:e,cache:n,headers:{Accept:"application/json","x-apikey":t}})},e.prototype.getClient=function(){return this._apolloClient},e.prototype.clearCacheAndRefetchQueries=function(){this._apolloClient.resetStore()},e.prototype.getFetchPolicy=function(e,t){return e===exports.OperationType.QUERY?t||this.fetchPolicy:e===exports.OperationType.MUTATION?exports.FetchPolicyOptions.NETWORK_ONLY:t===exports.FetchPolicyOptions.NO_CACHE||t===exports.FetchPolicyOptions.NETWORK_ONLY?t:exports.FetchPolicyOptions.NETWORK_ONLY},e.prototype.getOperationObject=function(e,t){var n,r,i=t.query,o=t.queryAsString,s=t.variables,a=t.requestOptions,c=i||as(o||""),u=a||{},l=t.userToken||this._userToken||(null===(r=this._cookieService)||void 0===r?void 0:r.get(Ks.USER_AUTH));if(!c)throw new Error("Query is required");var f=((n={})[e]=c,n.variables=s,n.fetchPolicy=this.getFetchPolicy(e,u.fetchPolicy),n.pollInterval=u.pollInterval||this.pollInterval,n);return l&&(f.context={headers:{Authorization:"Bearer ".concat(l)}}),f},e.prototype.runQuery=function(e){return c(this,void 0,void 0,(function(){var t;return u(this,(function(n){return t=this.getOperationObject(exports.OperationType.QUERY,e),[2,this._apolloClient.query(t)]}))}))},e.prototype.runMutation=function(e){return c(this,void 0,void 0,(function(){var t;return u(this,(function(n){return t=this.getOperationObject(exports.OperationType.MUTATION,e),[2,this._apolloClient.mutate(t)]}))}))},e}(),ia=function(){function e(e,t){if(this._apiClient=e,!t.channel)throw new Error("Channel is required");this._geinsSettings=t,this._channelId="".concat(t.channel,"|").concat(t.tld)}return e.prototype.destroy=function(){this._apiClient=void 0},e.prototype.createVariables=function(e){var t=s({},e);if(!t.languageId){if(!this._geinsSettings.locale)throw new Error("Language is required");t.languageId=this._geinsSettings.locale}if(!t.marketId){if(!this._geinsSettings.market)throw new Error("Market is required");t.marketId=this._geinsSettings.market}return t.channelId||(t.channelId=this._channelId),t},e.prototype.runQuery=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){if(!this._apiClient)throw new Error("Merchant API Client is not set");return[2,this._apiClient().runQuery(e)]}))}))},e.prototype.runQueryParsed=function(e){return c(this,void 0,void 0,(function(){var t,n;return u(this,(function(r){switch(r.label){case 0:return n=this.cleanObject,[4,this.runQuery(e)];case 1:return t=n.apply(this,[r.sent()]),[2,this.parseResult(t)]}}))}))},e.prototype.runMutation=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){if(!this._apiClient)throw new Error("Merchant API Client is not set");return[2,this._apiClient().runMutation(e)]}))}))},e.prototype.parseResult=function(e){return e},e.prototype.cleanObject=function(e){var t=this,n=Object.entries(e).reduce((function(e,n){var r=n[0],i=n[1];return r.startsWith("__typename")||(Array.isArray(i)?e[r]=i.map((function(e){return e&&"object"==typeof e?t.cleanObject(e):e})):e[r]=i&&"object"==typeof i?t.cleanObject(i):i),e}),{});return n},e}(),oa=function(){function e(e){if(this.core=e,!e)throw new Error("Core is required");if(!e.client)throw new Error("Merchant API Client is not set");if(!e.geinsSettings)throw new Error("Settings are required");var t=e.client,n=e.geinsSettings;this._geinsSettings=n,this._apiClient=function(){return null!=t?t:void 0}}return e.prototype.pushEvent=function(e,t){var n=t?exports.GeinsEventType[t]:void 0;if(n&&n.includes("_")){var r=n.split("_")[0];this.core.events.push(e,r)}this.core.events.push(e,n)},e.prototype.getCore=function(){return this.core},e}(),sa={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"ChannelFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ChannelType"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"defaultLanguageId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"defaultMarketId"},arguments:[],directives:[]}]}}],loc:{start:0,end:105}};function aa(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){aa(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){aa(e,t)})),e.definitions&&e.definitions.forEach((function(e){aa(e,t)}))}sa.loc.source={body:"fragment ChannelFields on ChannelType {\n id\n name\n type\n url\n defaultLanguageId\n defaultMarketId\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var ca={};function ua(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}sa.definitions.forEach((function(e){if(e.name){var t=new Set;aa(e,t),ca[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[ua(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=ca[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var s=o;o=new Set,s.forEach((function(e){i.has(e)||(i.add(e),(ca[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=ua(e,t);r&&n.definitions.push(r)}))}(sa,"ChannelFields");var la={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"LanguageFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"LanguageType"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"code"},arguments:[],directives:[]}]}}],loc:{start:0,end:63}};function fa(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){fa(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){fa(e,t)})),e.definitions&&e.definitions.forEach((function(e){fa(e,t)}))}la.loc.source={body:"fragment LanguageFields on LanguageType {\n id\n name\n code\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var ha={};function pa(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}la.definitions.forEach((function(e){if(e.name){var t=new Set;fa(e,t),ha[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[pa(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=ha[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var s=o;o=new Set,s.forEach((function(e){i.has(e)||(i.add(e),(ha[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=pa(e,t);r&&n.definitions.push(r)}))}(la,"LanguageFields");var da={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"CurrencyFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CurrencyType"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"symbol"},arguments:[],directives:[]}]}}],loc:{start:0,end:60}};function va(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){va(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){va(e,t)})),e.definitions&&e.definitions.forEach((function(e){va(e,t)}))}da.loc.source={body:"fragment CurrencyFields on CurrencyType {\n code\n symbol\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var ya={};function ma(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}da.definitions.forEach((function(e){if(e.name){var t=new Set;va(e,t),ya[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[ma(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=ya[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var s=o;o=new Set,s.forEach((function(e){i.has(e)||(i.add(e),(ya[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=ma(e,t);r&&n.definitions.push(r)}))}(da,"CurrencyFields");var ga={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"CountryFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CountryType"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"code"},arguments:[],directives:[]}]}}],loc:{start:0,end:56}};function ba(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){ba(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){ba(e,t)})),e.definitions&&e.definitions.forEach((function(e){ba(e,t)}))}ga.loc.source={body:"fragment CountryFields on CountryType {\n name\n code\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var Ea={};function Sa(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}ga.definitions.forEach((function(e){if(e.name){var t=new Set;ba(e,t),Ea[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[Sa(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=Ea[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var s=o;o=new Set,s.forEach((function(e){i.has(e)||(i.add(e),(Ea[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=Sa(e,t);r&&n.definitions.push(r)}))}(ga,"CountryFields");var Ta={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"MarketFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MarketType"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"alias"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"allowedLanguages"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"LanguageFields"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"CountryFields"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"CurrencyFields"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"onlyDisplayInCheckout"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"virtual"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"groupKey"},arguments:[],directives:[]}]}}],loc:{start:0,end:313}};Ta.loc.source={body:"#import './currencyFields.gql'\n#import './countryFields.gql'\n#import './languageFields.gql'\nfragment MarketFields on MarketType {\n id\n alias\n allowedLanguages {\n ...LanguageFields\n }\n country {\n ...CountryFields\n }\n currency {\n ...CurrencyFields\n }\n onlyDisplayInCheckout\n virtual\n groupKey\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var ka={};function _a(e){return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!ka[t]&&(ka[t]=!0,!0)}))}function wa(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){wa(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){wa(e,t)})),e.definitions&&e.definitions.forEach((function(e){wa(e,t)}))}Ta.definitions=Ta.definitions.concat(_a(da.definitions)),Ta.definitions=Ta.definitions.concat(_a(ga.definitions)),Ta.definitions=Ta.definitions.concat(_a(la.definitions));var Oa={};function xa(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}Ta.definitions.forEach((function(e){if(e.name){var t=new Set;wa(e,t),Oa[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[xa(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=Oa[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var s=o;o=new Set,s.forEach((function(e){i.has(e)||(i.add(e),(Oa[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=xa(e,t);r&&n.definitions.push(r)}))}(Ta,"MarketFields");var Na={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getChannel"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"channelId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},defaultValue:{kind:"NullValue"},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"channel"},arguments:[{kind:"Argument",name:{kind:"Name",value:"channelId"},value:{kind:"Variable",name:{kind:"Name",value:"channelId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ChannelFields"},directives:[]},{kind:"Field",name:{kind:"Name",value:"markets"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MarketFields"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"languages"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"LanguageFields"},directives:[]}]}}]}}]}}],loc:{start:0,end:358}};Na.loc.source={body:"#import './fragments/channelFields.gql'\n#import './fragments/languageFields.gql'\n#import './fragments/marketFields.gql'\n#import './fragments/currencyFields.gql'\n\nquery getChannel($channelId: String = null) {\n channel(channelId: $channelId) {\n ...ChannelFields\n markets {\n ...MarketFields\n }\n languages {\n ...LanguageFields\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var Da={};function Ia(e){return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!Da[t]&&(Da[t]=!0,!0)}))}function Aa(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){Aa(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){Aa(e,t)})),e.definitions&&e.definitions.forEach((function(e){Aa(e,t)}))}Na.definitions=Na.definitions.concat(Ia(sa.definitions)),Na.definitions=Na.definitions.concat(Ia(la.definitions)),Na.definitions=Na.definitions.concat(Ia(Ta.definitions)),Na.definitions=Na.definitions.concat(Ia(da.definitions));var Ca={};function Ra(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}Na.definitions.forEach((function(e){if(e.name){var t=new Set;Aa(e,t),Ca[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[Ra(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=Ca[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var s=o;o=new Set,s.forEach((function(e){i.has(e)||(i.add(e),(Ca[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=Ra(e,t);r&&n.definitions.push(r)}))}(Na,"getChannel");var Fa={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getChannels"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"channels"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ChannelFields"},directives:[]},{kind:"Field",name:{kind:"Name",value:"markets"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MarketFields"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"languages"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"LanguageFields"},directives:[]}]}}]}}]}}],loc:{start:0,end:310}};Fa.loc.source={body:"#import './fragments/channelFields.gql'\n#import './fragments/languageFields.gql'\n#import './fragments/marketFields.gql'\n#import './fragments/currencyFields.gql'\n\nquery getChannels {\n channels {\n ...ChannelFields\n markets {\n ...MarketFields\n }\n languages {\n ...LanguageFields\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var La={};function Pa(e){return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!La[t]&&(La[t]=!0,!0)}))}function Ma(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){Ma(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){Ma(e,t)})),e.definitions&&e.definitions.forEach((function(e){Ma(e,t)}))}Fa.definitions=Fa.definitions.concat(Pa(sa.definitions)),Fa.definitions=Fa.definitions.concat(Pa(la.definitions)),Fa.definitions=Fa.definitions.concat(Pa(Ta.definitions)),Fa.definitions=Fa.definitions.concat(Pa(da.definitions));var ja={};function qa(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}Fa.definitions.forEach((function(e){if(e.name){var t=new Set;Ma(e,t),ja[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[qa(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=ja[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var s=o;o=new Set,s.forEach((function(e){i.has(e)||(i.add(e),(ja[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=qa(e,t);r&&n.definitions.push(r)}))}(Fa,"getChannels");var Va={channels:Fa,channel:Na};function Ua(e){if(!e||!e.id)throw new Error("Invalid result structure for channel");return{id:e.id,name:e.name,type:e.type,url:e.url,defaultMarketId:e.defaultMarketId,defaultLanguageId:e.defaultLanguageId,markets:e.markets.map((function(e){return{id:(t=e).id,alias:t.alias,allowedLanguages:t.allowedLanguages.map((function(e){return Ba(e)})),country:Qa(t.country),currency:Ka(t.currency),onlyDisplayInCheckout:t.onlyDisplayInCheckout,virtual:t.virtual,groupKey:t.groupKey,defaultLanguageId:t.defaultLanguageId};var t})),languages:e.languages.map((function(e){return Ba(e)}))}}function Qa(e){return{name:e.name,code:e.code}}function Ba(e){return{id:e.id,name:e.name,code:e.code}}function Ka(e){return{code:e.code,symbol:e.symbol,name:e.name,rate:e.rate}}var Ga,za=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.cache=new na(9e5),r}return o(t,e),t.prototype.get=function(e){return c(this,void 0,void 0,(function(){var t,n,r,i;return u(this,(function(o){switch(o.label){case 0:return t="channel_".concat(e),(n=this.cache.get(t))?[2,n]:(r={query:Va.channel,variables:{channelId:e}},[4,this.runQueryParsed(r)]);case 1:return(i=o.sent())&&this.cache.set(t,i),[2,i]}}))}))},t.prototype.parseResult=function(e){return function(e){if(!e||!e.data)throw new Error("Invalid result structure for channel");var t=e.data.channel;if(t)return Ua(t);console.warn("No channel found")}(e)},t}(ia),Wa=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.cache=new na(18e5),r}return o(t,e),t.prototype.get=function(){return c(this,void 0,void 0,(function(){var e,t,n,r;return u(this,(function(i){switch(i.label){case 0:return e="all_channels",(t=this.cache.get(e))?[2,t]:(n={query:Va.channels,variables:{}},[4,this.runQueryParsed(n)]);case 1:return(r=i.sent())&&this.cache.set(e,r),[2,r]}}))}))},t.prototype.parseResult=function(e){return function(e){if(!e||!e.data)throw new Error("Invalid result structure for channels");var t=e.data.channels;if(t&&0!==t.length)return t.map((function(e){return Ua(e)}));console.warn("No channel found")}(e)},t}(ia),Ya={exports:{}};var Ha,Ja=(Ga||(Ga=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new i(r,o||e,s),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,s=new Array(o);i<o;i++)s[i]=r[i].fn;return s},a.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},a.prototype.emit=function(e,t,r,i,o,s){var a=n?n+e:e;if(!this._events[a])return!1;var c,u,l=this._events[a],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,i),!0;case 5:return l.fn.call(l.context,t,r,i,o),!0;case 6:return l.fn.call(l.context,t,r,i,o,s),!0}for(u=1,c=new Array(f-1);u<f;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var h,p=l.length;for(u=0;u<p;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),f){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,r);break;case 4:l[u].fn.call(l[u].context,t,r,i);break;default:if(!c)for(h=1,c=new Array(f-1);h<f;h++)c[h-1]=arguments[h];l[u].fn.apply(l[u].context,c)}}return!0},a.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},a.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},a.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||i&&!a.once||r&&a.context!==r||s(this,o);else{for(var c=0,u=[],l=a.length;c<l;c++)(a[c].fn!==t||i&&!a[c].once||r&&a[c].context!==r)&&u.push(a[c]);u.length?this._events[o]=1===u.length?u[0]:u:s(this,o)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&s(this,t)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a}(Ya)),Ya.exports),$a=Ji(Ja),Xa=function(){function e(){this.eventName="geins-event",this.emitter=new $a,this.broadcastChannelId="geins-channel",Hs()||(this.broadcast=new n.BroadcastChannel(this.broadcastChannelId),this.addBroadcastListener())}return e.prototype.addBroadcastListener=function(){var e=this;this.broadcast&&(this.broadcast.onmessage=function(t){e.emitter.emit(t.eventName,t.eventMessage)})},e.prototype.listenerAdd=function(e,t){void 0===t&&(t=this.eventName),this.emitter.on(t,e)},e.prototype.listenerOnce=function(e,t){void 0===t&&(t=this.eventName),this.emitter.once(t,e)},e.prototype.listenerRemove=function(e){void 0===e&&(e=this.eventName),this.emitter.removeAllListeners(e)},e.prototype.listenerCount=function(e){return void 0===e&&(e=this.eventName),this.emitter.listenerCount(e)},e.prototype.listenersGet=function(e){return void 0===e&&(e=this.eventName),this.emitter.listeners(e)},e.prototype.push=function(e,t){var n;void 0===t&&(t=this.eventName),this.emitter.emit(t,e),(null===(n=e.broadcast)||void 0===n||n)&&this.broadcast&&this.broadcast.postMessage({eventMessage:e,eventName:t})},e}(),Za=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.log_to_console=!1,r}return o(t,e),t.prototype.verifyQueryOptions=function(e){var t,n,r,i=s({},e);if(!e.query&&!e.queryAsString)throw new Error("Query or queryAsString is required");try{e.queryAsString&&!e.query&&(i.query=as(e.queryAsString))}catch(e){throw new Error("Error parsing string to query")}var o=i.query,a=o.definitions[0];if(!(a&&"OperationDefinition"===a.kind&&(null!==(n=null===(t=a.variableDefinitions)||void 0===t?void 0:t.length)&&void 0!==n?n:0)>0))return i;i.variables=this.createVariables(i.variables);var c=(null===(r=o.definitions[0].variableDefinitions)||void 0===r?void 0:r.map((function(e){return e.variable.name.value})))||[];return Object.keys(i.variables).forEach((function(e){c.includes(e)||delete i.variables[e]})),i},t.prototype.query=function(e){return c(this,void 0,void 0,(function(){var t,n,r;return u(this,(function(i){switch(i.label){case 0:return[4,this.verifyQueryOptions(e)];case 1:return t=i.sent(),(this.log_to_console||e.log_to_console)&&"prod"!==this._geinsSettings.environment&&console.log("[Geins] queryOptions:",t),r=this.cleanObject,[4,this.runQuery(t)];case 2:return n=r.apply(this,[i.sent()]),[2,this.parseResult(n)]}}))}))},t.prototype.mutation=function(e){return c(this,void 0,void 0,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return(this.log_to_console||e.log_to_console)&&"prod"!==this._geinsSettings.environment&&console.log("[Geins] mutation options:",e),[4,this.runMutation(e)];case 1:return t=n.sent(),[2,this.parseResult(t)]}}))}))},t.prototype.parseResult=function(e){if(e.data)return e.data;if(e.errors)throw new Error("GraphQL errors",{cause:e.errors});return null},t}(ia),ec={trace:{abbreviation:"T",name:"Trace",color:"#881DD7",icon:"đ"},debug:{abbreviation:"D",name:"Debug",color:"#128655",icon:"đ"},info:{abbreviation:"I",name:"Info",color:"#18A7B4",icon:"âšī¸"},warn:{abbreviation:"W",name:"Warning",color:"#D7881D",icon:"â ī¸"},error:{abbreviation:"E",name:"Error",color:"#D72B1D",icon:"â"}},tc="[0m",nc="[1m",rc="[2m",ic="[30m",oc="[44m",sc="[47m",ac={typescript:{abbreviation:"TS",name:"TypeScript",colorServer:oc,color:"#007ACC",icon:"đ",fileExtensions:[".ts",".tsx"]},javascript:{abbreviation:"JS",name:"JavaScript",color:"#F7DF1E",colorServer:"[43m",icon:"đ",fileExtensions:[".js",".mjs","cjs"]},vue:{abbreviation:"VUE",name:"Vue",color:"#41B883",colorServer:"[42m",icon:"đŧī¸",fileExtensions:[".vue"]},jsx:{abbreviation:"JSX",name:"JSX",color:"#61DAFB",colorServer:"[46m",icon:"đ",fileExtensions:[".jsx"]},tsx:{abbreviation:"TSX",name:"TSX",color:"#007ACC",colorServer:oc,icon:"đ",fileExtensions:[".tsx"]},next:{abbreviation:"NEXT",name:"Next.js",color:"#000000",colorServer:oc,icon:"đ",fileExtensions:[".js",".ts",".jsx",".tsx"]},react:{abbreviation:"REACT",name:"React",color:"#61DAFB",colorServer:oc,icon:"âī¸",fileExtensions:[".jsx",".tsx"]},astro:{abbreviation:"ASTRO",name:"Astro",color:"#FF5D01",colorServer:"[35m",icon:"đ",fileExtensions:[".astro"]},angular:{abbreviation:"ANG",name:"Angular",color:"#DD0031",colorServer:oc,icon:"đ
°ī¸",fileExtensions:[".ts",".html"]},svelte:{abbreviation:"SVELTE",name:"Svelte",color:"#FF3E00",colorServer:oc,icon:"đĨ",fileExtensions:[".svelte"]}},cc={"Nuxt.js":/\/_nuxt\//,"Vue.js":/\/\.vue\//,React:/\/react\//,Angular:/\/angular\//,Svelte:/\/svelte\//,"Next.js":/\/next\//,Astro:/\/astro\//},uc=function(){function e(){}return e.configure=function(t){var n=void 0===t?{}:t,r=n.isEnabled,i=void 0===r||r,o=n.logLevel,s=void 0===o?"debug":o;e.configIsEnabled=i,e.configLogLevel=s},e.isServer=function(){return"undefined"==typeof window},e.trace=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e.log("trace",t)},e.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e.log("debug",t)},e.info=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e.log("info",t)},e.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e.log("warn",t)},e.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e.log("error",t)},e.log=function(t,n){var r=e.getCallerInfoExtended(),i=r.methodName,o=r.fileName,s=r.className,a=r.framework,c=r.fileType;e.output(t,i,o,s,a,c,n)},e.output=function(t,n,r,i,o,s,a){var c=ec[t];s&&" (".concat(s.name,")");var u=n?"".concat(n,"()"):"",l=i?"".concat(i,"."):"",f=s?s.color:c.color,h=s?s.colorServer:sc,p=s?s.icon:c.icon;e.isServer()?(console.log("".concat(h).concat(ic).concat(p," ").concat(r," ").concat(tc).concat(sc).concat(ic," ").concat(l).concat(u).concat(tc," ")),a.forEach((function(e){"object"!=typeof e?"string"==typeof e&&console.log("".concat(rc,">> ").concat(tc),"".concat(nc).concat(e).concat(tc)):console.log("".concat(rc,">> ").concat(tc),"".concat(JSON.stringify(e)))}))):(console.log("%c".concat(p," ").concat(r,"%c ").concat(l).concat(u),"background: ".concat(f,"; color: #000; padding: 2px 8px; border-radius: 2px 0 0 2px;"),"background: #D3D3D3; color: #000; padding: 2px 8px; border-radius: 0 2px 2px 0;"),a.forEach((function(e){console.log("%c>>","color: ".concat(c.color,"; margin-left: 5px; font-weight: bold;"),e)})))},e.getCallerInfoExtended=function(){var t={};try{throw new Error("")}catch(e){t=e}if(!t.stack)return{methodName:"anonymous",fileName:"unknown",className:"",framework:null,fileType:null};var n=t.stack.split("\n"),r=null;if(e.isServer()){r="Node.js";for(var i=1;i<n.length;i++){if(!((v=n[i]).includes("LogService")||v.includes("node_modules")||v.includes("logService.ts"))){var o=v.match(/at (?:([\w$]+)\.)?(\w+)\s*\(/),s=v.match(/(http.*\.\w+)/)||v.match(/at (.*):\d+:\d+/),a=o&&o[1]||"",c=o?o[2]:"anonymous",u="unknown",l=null;if(s){var f=s[1].split("/")||[];u=f.pop()||"unknown",f.reverse();var h=f.slice(0,3).reverse().join("/");l=e.getFileTypeFromExtension(u),u="".concat(h,"/").concat(u)}return{methodName:c,fileName:u,className:a,framework:r,fileType:l}}}}else{for(var p=0,d=n;p<d.length;p++){for(var v=d[p],y=0,m=Object.entries(cc);y<m.length;y++){var g=m[y],b=g[0];if(g[1].test(v)){r=b;break}}if(r)break}for(i=1;i<n.length;i++){if(!(v=n[i]).includes("LogService")&&!v.includes("node_modules")){o=v.match(/at (?:([\w$]+)\.)?(\w+)\s*\(/),s=v.match(/(http.*\.\w+)/)||v.match(/at (.*):\d+:\d+/),a=o&&o[1]||"",c=o?o[2]:"anonymous",u="unknown",l=null;if(s)u=s[1].split("?")[0].split("/").pop()||"unknown",l=e.getFileTypeFromExtension(u);return{methodName:c,fileName:u,className:a,framework:r,fileType:l}}}}return{methodName:"anonymous",fileName:"unknown",className:"",framework:null,fileType:null}},e.getFileTypeFromExtension=function(e){for(var t in ac){var n=ac[t];if(n.fileExtensions.some((function(t){return e.endsWith(t)})))return n}return null},e.configIsEnabled=!0,e.configLogLevel="debug",e}(),lc=uc.debug,fc=36e5,hc="urlHistory:lastFetchTime";exports.RoutingServiceState=void 0,(Ha=exports.RoutingServiceState||(exports.RoutingServiceState={}))[Ha.INIT=0]="INIT",Ha[Ha.FETCHING=1]="FETCHING",Ha[Ha.READY=2]="READY",Ha[Ha.ERROR=3]="ERROR";var pc=function(){function e(e,t){if(!e)throw this.state=exports.RoutingServiceState.ERROR,new Error("API key is required");if(!t)throw this.state=exports.RoutingServiceState.ERROR,new Error("Store is required");this.state=exports.RoutingServiceState.INIT,this.store=t,this.apiKey=e,this.apiClient=new zs(e),this.state=exports.RoutingServiceState.READY}return e.getInstance=function(t,n){return e.instance||(e.instance=new e(t,n)),e.instance},e.prototype.setKey=function(e,t){return c(this,void 0,void 0,(function(){return u(this,(function(n){switch(n.label){case 0:return[4,this.store.setKey(e,t)];case 1:return n.sent(),[2]}}))}))},e.prototype.getKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,this.store.getKey(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.getRoutingRules=function(){return c(this,void 0,void 0,(function(){var e,t,n,r,i,o;return u(this,(function(s){switch(s.label){case 0:return[4,this.store.getKeys()];case 1:e=s.sent(),t=[],n=0,r=e,s.label=2;case 2:return n<r.length?"urlHistory"===(i=r[n])||i===hc?[3,4]:[4,this.store.getKey(i)]:[3,5];case 3:(o=s.sent())&&t.push({fromUrl:i,toUrl:o,httpStatusCode:301,isCanonical:!1}),s.label=4;case 4:return n++,[3,2];case 5:return[2,t]}}))}))},e.prototype.getAllRoutes=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return[4,this.store.getKeys()];case 1:return[2,e.sent()]}}))}))},e.prototype.shouldFetchNewData=function(){return c(this,void 0,void 0,(function(){var e,t;return u(this,(function(n){switch(n.label){case 0:return[4,this.getKey(hc)];case 1:return(e=n.sent())?(t=new Date(e),[2,Date.now()-t.getTime()>=fc]):[2,!0]}}))}))},e.prototype.fetchAndProcessUrlHistory=function(){return c(this,void 0,void 0,(function(){var e,t,n,r;return u(this,(function(i){switch(i.label){case 0:return[4,this.apiClient.getUrlHistory()];case 1:e=i.sent(),t=0,n=e,i.label=2;case 2:return t<n.length?(r=n[t]).oldUrl&&r.newUrl&&!r.deleted?[4,this.setKey(r.oldUrl,r.newUrl)]:[3,4]:[3,5];case 3:i.sent(),i.label=4;case 4:return t++,[3,2];case 5:return[4,this.setKey(hc,(new Date).toISOString())];case 6:return i.sent(),[2]}}))}))},e.prototype.fillUrlHistory=function(){return c(this,void 0,void 0,(function(){var e;return u(this,(function(t){switch(t.label){case 0:if(this.state===exports.RoutingServiceState.FETCHING)return[2,this.store.getKeys()];this.state=exports.RoutingServiceState.FETCHING,t.label=1;case 1:return t.trys.push([1,6,7,8]),[4,this.shouldFetchNewData()];case 2:return t.sent()?[4,this.fetchAndProcessUrlHistory()]:[3,4];case 3:t.sent(),t.label=4;case 4:return[4,this.store.getKeys()];case 5:return[2,t.sent()];case 6:throw e=t.sent(),this.state=exports.RoutingServiceState.ERROR,e;case 7:return this.state!==exports.RoutingServiceState.ERROR&&(this.state=exports.RoutingServiceState.READY),[7];case 8:return[2]}}))}))},e.prototype.getRoute=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,this.getKey(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.refreshUrlHistoryIfNeeded=function(){return c(this,void 0,void 0,(function(){var e,t,n;return u(this,(function(r){switch(r.label){case 0:return e=new Date,[4,this.getKey(hc)];case 1:return(t=r.sent())?(n=new Date(t),e.getTime()-n.getTime()>=fc?[4,this.fillUrlHistory()]:[3,3]):[3,6];case 2:case 4:case 7:return[2,r.sent()];case 3:return[4,this.store.getKeys()];case 5:return[3,8];case 6:return[4,this.fillUrlHistory()];case 8:return[2]}}))}))},e.prototype.getLastFetchTime=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return[4,this.getKey(hc)];case 1:return[2,e.sent()]}}))}))},e.prototype.fillRoutes=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return[4,this.fillUrlHistory()];case 1:return[2,{urlHistory:e.sent()}]}}))}))},e.instance=null,e}(),dc=function(){function e(){this.initStore()}return e.prototype.initStore=function(){this.store=new r.NodeCache({stdTTL:86400,checkperiod:17280,useClones:!1})},e.prototype.setKey=function(e,t){return c(this,void 0,void 0,(function(){return u(this,(function(n){return void 0!==this.store&&this.store.set(e,t),[2]}))}))},e.prototype.getKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){return void 0!==this.store?[2,this.store.get(e)]:[2,null]}))}))},e.prototype.getKeys=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){return void 0===this.store?[2,[]]:[2,this.store.keys()]}))}))},e.prototype.deleteKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return void 0===this.store?[3,2]:[4,this.store.del(e)];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},e.prototype.hasKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){return void 0===this.store?[2,!1]:[2,this.store.has(e)]}))}))},e.prototype.clearStore=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){return void 0!==this.store&&(this.store.flushAll(),this.store.close()),[2]}))}))},e.prototype.destroy=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return[4,this.clearStore()];case 1:return e.sent(),this.store=void 0,[2]}}))}))},e}(),vc=function(){function e(){this.store=this.initStore()}return e.prototype.initStore=function(){return new r.NodeCache({stdTTL:86400,checkperiod:17280,useClones:!1})},e.prototype.setKey=function(e,t){return c(this,void 0,void 0,(function(){return u(this,(function(n){return void 0!==this.store&&this.store.set(e,t),[2]}))}))},e.prototype.getKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){return void 0!==this.store?[2,this.store.get(e)]:[2,null]}))}))},e.prototype.getKeys=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){return void 0===this.store?[2,[]]:[2,this.store.keys()]}))}))},e.prototype.deleteKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return void 0===this.store?[3,2]:[4,this.store.del(e)];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},e.prototype.hasKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){return void 0===this.store?[2,!1]:[2,this.store.has(e)]}))}))},e.prototype.clearStore=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){return void 0!==this.store&&this.store.flushAll(),[2]}))}))},e.prototype.destroy=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return[4,this.clearStore()];case 1:return e.sent(),this.store=void 0,[2]}}))}))},e}(),yc=function(){function e(e){if(this.geinsSettings=e,!e.channel)throw new Error("Channel is required");if(!e.apiKey)throw new Error("API Key is required");this.store=new dc,this.channelId="".concat(e.channel,"|").concat(e.tld),this.cache=new na(36e5),this.initApiClient()}return e.prototype.initApiClient=function(){if(!this.geinsSettings.apiKey||!this.geinsSettings.accountName)throw new Error("API Key and Account Name are required");var e={apiUrl:Js(this.geinsSettings.apiKey,this.geinsSettings.accountName,this.geinsSettings.environment).main,apiKey:this.geinsSettings.apiKey,requestOptions:{fetchPolicy:exports.FetchPolicyOptions.CACHE_FIRST}};this._apiClient=function(){return new ra(e)}},e.prototype.initChannelService=function(){var e=this;this.channelService=new za((function(){return e._apiClient()}),this.geinsSettings)},e.prototype.setKey=function(e,t){if(!this.store)throw new Error("Store is not initialized");this.store.setKey(e,t)},e.prototype.getKey=function(e){if(!this.store)throw new Error("Store is not initialized");return this.store.getKey(e)},e.prototype.setChannel=function(){return c(this,void 0,void 0,(function(){var e,t;return u(this,(function(n){switch(n.label){case 0:return this.channelService||(this._apiClient||this.initApiClient(),this.initChannelService()),[4,null===(t=this.channelService)||void 0===t?void 0:t.get(this.channelId)];case 1:return(e=n.sent())&&this.cache.set(this.channelId,e),[2,e]}}))}))},e.prototype.get=function(){return c(this,void 0,void 0,(function(){var e,t;return u(this,(function(n){switch(n.label){case 0:return(e=this.cache.get(this.channelId))?[2,e]:[4,this.setChannel()];case 1:return[2,null!=(t=n.sent())?t:void 0]}}))}))},e}(),mc=function(){function e(e){if(!e.channel)throw new Error("Channel is required");if(!e.apiKey)throw new Error("API Key is required");if(!e.accountName)throw new Error("Account name is required");this._geinsSettings=s(s({},{environment:"prod"}),e),this._geinsSettings.apiKey&&this._geinsSettings.accountName&&(this._endpointsUrls=Js(this._geinsSettings.apiKey,this._geinsSettings.accountName,this._geinsSettings.environment)),Hs()||(this._cookieService=new Ys),this._currentChannel=new yc(this._geinsSettings),this._eventService=new Xa}return e.prototype.initApiClient=function(){if(!this._geinsSettings.apiKey||!this._geinsSettings.accountName)throw new Error("Failed to initialize API Client");var e={apiUrl:this._endpointsUrls.main,apiKey:this._geinsSettings.apiKey,userToken:this._userToken};this._apiClient=new ra(e)},e.prototype.initGraphQLService=function(){var e=this;this._graphQLService=new Za((function(){return e.client}),this._geinsSettings)},Object.defineProperty(e.prototype,"channel",{get:function(){return{current:this.channelGet.bind(this),all:this.channelsGet.bind(this)}},enumerable:!1,configurable:!0}),e.prototype.channelGet=function(){return c(this,void 0,void 0,(function(){var e,t;return u(this,(function(n){if(this._currentChannel||(this._currentChannel=new yc(this._geinsSettings)),!this._currentChannel)throw new Error("Failed to initialize channel");return[2,null!==(t=null===(e=this._currentChannel)||void 0===e?void 0:e.get())&&void 0!==t?t:void 0]}))}))},e.prototype.channelsGet=function(){return c(this,void 0,void 0,(function(){var e,t=this;return u(this,(function(n){return this._accountChannels||(this._accountChannels=new Wa((function(){return t.client}),this._geinsSettings)),[2,null!==(e=this._accountChannels.get())&&void 0!==e?e:void 0]}))}))},e.prototype.setUserToken=function(e){this._userToken=e,this._apiClient&&this._apiClient.updateToken(e)},e.prototype.getUserToken=function(){return this._userToken},Object.defineProperty(e.prototype,"endpoints",{get:function(){return this._endpointsUrls},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"client",{get:function(){if(!this._endpointsUrls)throw new Error("Endpoints are not set");return this._apiClient||this.initApiClient(),this._apiClient},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"graphql",{get:function(){return this._graphQLService||this.initGraphQLService(),this._graphQLService},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geinsSettings",{get:function(){return this._geinsSettings},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){return this._eventService},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cookies",{get:function(){return this._cookieService||(this._cookieService=new Ys),this._cookieService},enumerable:!1,configurable:!0}),e.encodeJWT=function(e,t){return Xs(e,t)},e.decodeJWT=function(e,t){return $s(e,t).payload},e}();exports.API_ENDPOINT_SLUG_HISTORY=Qs,exports.API_ENDPOINT_URL_HISTORY=Us,exports.API_URL=Ps,exports.AUTH_COOKIES=Ks,exports.AUTH_COOKIES_MAX_AGE={DEFAULT:1800,REMEMBER_USER:604800},exports.AUTH_HEADERS={REFRESH_TOKEN:"x-auth-refresh-token"},exports.AUTH_URL=js,exports.BaseApiService=ia,exports.BasePackage=oa,exports.CART_COOKIES={CART_ID:"geins-cart-id"},exports.CART_COOKIES_MAX_AGE={DEFAULT:604800},exports.CHECKOUT_PARAMETERS=Gs,exports.Channel=yc,exports.ChannelService=za,exports.ChannelStore=dc,exports.ChannelsService=Wa,exports.CookieService=Ys,exports.ENDPOINTS=Bs,exports.EndpointApiClient=zs,exports.EventService=Xa,exports.GeinsCore=mc,exports.GraphQLService=Za,exports.IMAGE_URL=qs,exports.LogService=uc,exports.Logger=ta,exports.MANAGEMENT_API_URL=Vs,exports.ManagementApiClient=Ws,exports.MerchantApiClient=ra,exports.RoutingService=pc,exports.RoutingStore=vc,exports.SIGN_URL=Ms,exports.SimpleCache=na,exports.buildEndpoints=Js,exports.decodeJWT=$s,exports.encodeJWT=Xs,exports.extractParametersFromUrl=function(e){if(!e)return{url:e,params:new Map};if(!e.includes("?"))return{url:e,params:new Map};var t=e.split("?"),n=t[0],r=t[1];return{url:n,params:new Map(r?r.split("&").map((function(e){return e.split("=")})):[])}},exports.findObjectWithProperty=function e(t,n,r){if(t&&"object"==typeof t){if(n in t){if(void 0===r)return t;if(t[n]===r)return t}for(var i=0,o=Object.keys(t);i<o.length;i++){var s=e(t[o[i]],n,r);if(s)return s}}},exports.gql=as,exports.isServerContext=Hs,exports.logWrite=lc,exports.parseErrorMessage=function(e){return e&&e.message?e.message:""};
|