@geins/core 0.6.0 → 0.6.2

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/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var e=require("crypto"),t=require("cookie-universal"),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){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(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 h(e){return this instanceof h?(this.v=e,this):new h(e)}function p(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",(function(e){return function(t){return Promise.resolve(t).then(e,u)}})),r[Symbol.asyncIterator]=function(){return this},r;function s(e,t){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||a(e,t)}))},t&&(r[e]=t(r[e])))}function a(e,t){try{(n=i[e](t)).value instanceof h?Promise.resolve(n.value.v).then(c,u):l(o[0][2],n)}catch(e){l(o[0][3],e)}var n}function c(e){a("next",e)}function u(e){a("throw",e)}function l(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function d(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=l(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}"function"==typeof SuppressedError&&SuppressedError;var v="Invariant Violation",y=Object.setPrototypeOf,m=void 0===y?function(e,t){return e.__proto__=t,e}:y,g=function(e){function t(n){void 0===n&&(n=v);var r=e.call(this,"number"==typeof n?v+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=v,m(r,t.prototype),r}return o(t,e),t}(Error);function b(e,t){if(!e)throw new g(t)}var E=["debug","log","warn","error","silent"],T=E.indexOf("log");function _(e){return function(){if(E.indexOf(e)>=T)return(console[e]||console.log).apply(console,arguments)}}!function(e){e.debug=_("debug"),e.log=_("log"),e.warn=_("warn"),e.error=_("error")}(b);var S="3.11.8";function O(e){try{return e()}catch(e){}}var k=O((function(){return globalThis}))||O((function(){return window}))||O((function(){return self}))||O((function(){return global}))||O((function(){return O.constructor("return this")()})),w=new Map;function x(e){var t=w.get(e)||1;return w.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function I(e,t){void 0===t&&(t=0);var n=x("stringifyForDisplay");return JSON.stringify(e,(function(e,t){return void 0===t?n:t}),t).split(JSON.stringify(n)).join("<undefined>")}function N(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=F(i))||(t=L(i,n),n=[])}e.apply(void 0,[t].concat(n))}}var A=Object.assign((function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];e||b(e,F(t,n)||L(t,n))}),{debug:N(b.debug),log:N(b.log),warn:N(b.warn),error:N(b.error)});function C(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return new g(F(e,t)||L(e,t))}var D=Symbol.for("ApolloErrorMessageHandler_"+S);function R(e){if("string"==typeof e)return e;try{return I(e,2).slice(0,1e3)}catch(e){return"<non-serializable>"}}function F(e,t){if(void 0===t&&(t=[]),e)return k[D]&&k[D](e,t.map(R))}function L(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:S,message:e,args:t.map(R)})))}function P(e,t){if(!Boolean(e))throw new Error(t)}function M(e,t){if(!Boolean(e))throw new Error("Unexpected invariant triggered.")}const q=/\r\n|[\n\r]/g;function j(e,t){let n=0,r=1;for(const i of e.body.matchAll(q)){if("number"==typeof i.index||M(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function V(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+U([[`${s} |`,n[0]],...n.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return u+U([[s-1+" |",l[i-1]],[`${s} |`,f],["|","^".padStart(c)],[`${s+1} |`,l[i+1]]])}function U(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 Q 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=G(Array.isArray(o)?o:o?[o]:void 0);const f=G(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=>j(s,e))):null==f?void 0:f.map((e=>j(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,Q):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"+V((t=n.loc).source,j(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+V(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 G(e){return void 0===e||0===e.length?void 0:e}function B(e,t,n){return new Q(`Syntax Error: ${n}`,{source:e,positions:[t]})}class K{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 z{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 W={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"]},H=new Set(Object.keys(W));function Y(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&H.has(t)}var J,$,X,Z;function ee(e){return 9===e||32===e}function te(e){return e>=48&&e<=57}function ne(e){return e>=97&&e<=122||e>=65&&e<=90}function re(e){return ne(e)||95===e}function ie(e){return ne(e)||te(e)||95===e}function oe(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=se(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 se(e){let t=0;for(;t<e.length&&ee(e.charCodeAt(t));)++t;return t}!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(J||(J={})),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"}($||($={})),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"}(X||(X={})),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"}(Z||(Z={}));class ae{constructor(e){const t=new z(Z.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!==Z.EOF)do{if(e.next)e=e.next;else{const t=de(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===Z.COMMENT);return e}}function ce(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function ue(e,t){return le(e.charCodeAt(t))&&fe(e.charCodeAt(t+1))}function le(e){return e>=55296&&e<=56319}function fe(e){return e>=56320&&e<=57343}function he(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return Z.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function pe(e,t,n,r,i){const o=e.line,s=1+n-e.lineStart;return new z(t,n,r,o,s,i)}function de(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 ve(e,i);case 33:return pe(e,Z.BANG,i,i+1);case 36:return pe(e,Z.DOLLAR,i,i+1);case 38:return pe(e,Z.AMP,i,i+1);case 40:return pe(e,Z.PAREN_L,i,i+1);case 41:return pe(e,Z.PAREN_R,i,i+1);case 46:if(46===n.charCodeAt(i+1)&&46===n.charCodeAt(i+2))return pe(e,Z.SPREAD,i,i+3);break;case 58:return pe(e,Z.COLON,i,i+1);case 61:return pe(e,Z.EQUALS,i,i+1);case 64:return pe(e,Z.AT,i,i+1);case 91:return pe(e,Z.BRACKET_L,i,i+1);case 93:return pe(e,Z.BRACKET_R,i,i+1);case 123:return pe(e,Z.BRACE_L,i,i+1);case 124:return pe(e,Z.PIPE,i,i+1);case 125:return pe(e,Z.BRACE_R,i,i+1);case 34:return 34===n.charCodeAt(i+1)&&34===n.charCodeAt(i+2)?Oe(e,i):ge(e,i)}if(te(t)||45===t)return ye(e,i,t);if(re(t))return ke(e,i);throw B(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":ce(t)||ue(n,i)?`Unexpected character: ${he(e,i)}.`:`Invalid character: ${he(e,i)}.`)}return pe(e,Z.EOF,r,r)}function ve(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(ce(e))++i;else{if(!ue(n,i))break;i+=2}}return pe(e,Z.COMMENT,t,i,n.slice(t+1,i))}function ye(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),te(o))throw B(e.source,i,`Invalid number, unexpected digit after 0: ${he(e,i)}.`)}else i=me(e,i,o),o=r.charCodeAt(i);if(46===o&&(s=!0,o=r.charCodeAt(++i),i=me(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=me(e,i,o),o=r.charCodeAt(i)),46===o||re(o))throw B(e.source,i,`Invalid number, expected digit but got: ${he(e,i)}.`);return pe(e,s?Z.FLOAT:Z.INT,t,i,r.slice(t,i))}function me(e,t,n){if(!te(n))throw B(e.source,t,`Invalid number, expected digit but got: ${he(e,t)}.`);const r=e.source.body;let i=t+1;for(;te(r.charCodeAt(i));)++i;return i}function ge(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),pe(e,Z.STRING,t,i+1,s);if(92!==r){if(10===r||13===r)break;if(ce(r))++i;else{if(!ue(n,i))throw B(e.source,i,`Invalid character within String: ${he(e,i)}.`);i+=2}}else{s+=n.slice(o,i);const t=117===n.charCodeAt(i+1)?123===n.charCodeAt(i+2)?be(e,i):Ee(e,i):Se(e,i);s+=t.value,i+=t.size,o=i}}throw B(e.source,i,"Unterminated string.")}function be(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||!ce(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|_e(e),r<0)break}throw B(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function Ee(e,t){const n=e.source.body,r=Te(n,t+2);if(ce(r))return{value:String.fromCodePoint(r),size:6};if(le(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=Te(n,t+8);if(fe(e))return{value:String.fromCodePoint(r,e),size:12}}throw B(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function Te(e,t){return _e(e.charCodeAt(t))<<12|_e(e.charCodeAt(t+1))<<8|_e(e.charCodeAt(t+2))<<4|_e(e.charCodeAt(t+3))}function _e(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Se(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 B(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Oe(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=pe(e,Z.BLOCK_STRING,t,o+3,oe(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(ce(r))++o;else{if(!ue(n,o))throw B(e.source,o,`Invalid character within String: ${he(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 B(e.source,o,"Unterminated string.")}function ke(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){if(!ie(n.charCodeAt(i)))break;++i}return pe(e,Z.NAME,t,i,n.slice(t,i))}function we(e){return xe(e,[])}function xe(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:xe(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(xe(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+": "+xe(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const Ie=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=we(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 Ne{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||P(!1,`Body must be a string. Received: ${we(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||P(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||P(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}class Ae{constructor(e,t={}){const n=function(e){return Ie(e,Ne)}(e)?e:new Ne(e);this._lexer=new ae(n),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(Z.NAME);return this.node(e,{kind:X.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:X.DOCUMENT,definitions:this.many(Z.SOF,this.parseDefinition,Z.EOF)})}parseDefinition(){if(this.peek(Z.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===Z.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 B(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(Z.BRACE_L))return this.node(e,{kind:X.OPERATION_DEFINITION,operation:J.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(Z.NAME)&&(n=this.parseName()),this.node(e,{kind:X.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(Z.NAME);switch(e.value){case"query":return J.QUERY;case"mutation":return J.MUTATION;case"subscription":return J.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(Z.PAREN_L,this.parseVariableDefinition,Z.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:X.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(Z.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Z.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(Z.DOLLAR),this.node(e,{kind:X.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:X.SELECTION_SET,selections:this.many(Z.BRACE_L,this.parseSelection,Z.BRACE_R)})}parseSelection(){return this.peek(Z.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(Z.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:X.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Z.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Z.PAREN_L,t,Z.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(Z.COLON),this.node(t,{kind:X.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(Z.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(Z.NAME)?this.node(e,{kind:X.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:X.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:X.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:X.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 Z.BRACKET_L:return this.parseList(e);case Z.BRACE_L:return this.parseObject(e);case Z.INT:return this.advanceLexer(),this.node(t,{kind:X.INT,value:t.value});case Z.FLOAT:return this.advanceLexer(),this.node(t,{kind:X.FLOAT,value:t.value});case Z.STRING:case Z.BLOCK_STRING:return this.parseStringLiteral();case Z.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:X.BOOLEAN,value:!0});case"false":return this.node(t,{kind:X.BOOLEAN,value:!1});case"null":return this.node(t,{kind:X.NULL});default:return this.node(t,{kind:X.ENUM,value:t.value})}case Z.DOLLAR:if(e){if(this.expectToken(Z.DOLLAR),this._lexer.token.kind===Z.NAME){const e=this._lexer.token.value;throw B(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:X.STRING,value:e.value,block:e.kind===Z.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:X.LIST,values:this.any(Z.BRACKET_L,(()=>this.parseValueLiteral(e)),Z.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:X.OBJECT,fields:this.any(Z.BRACE_L,(()=>this.parseObjectField(e)),Z.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(Z.COLON),this.node(t,{kind:X.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(Z.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(Z.AT),this.node(t,{kind:X.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(Z.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(Z.BRACKET_R),t=this.node(e,{kind:X.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(Z.BANG)?this.node(e,{kind:X.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:X.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(Z.STRING)||this.peek(Z.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(Z.BRACE_L,this.parseOperationTypeDefinition,Z.BRACE_R);return this.node(e,{kind:X.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(Z.COLON);const n=this.parseNamedType();return this.node(e,{kind:X.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:X.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:X.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(Z.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(Z.BRACE_L,this.parseFieldDefinition,Z.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(Z.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:X.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(Z.PAREN_L,this.parseInputValueDef,Z.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(Z.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(Z.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:X.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:X.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:X.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(Z.EQUALS)?this.delimitedMany(Z.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:X.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(Z.BRACE_L,this.parseEnumValueDefinition,Z.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:X.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 B(this._lexer.source,this._lexer.token.start,`${Ce(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:X.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(Z.BRACE_L,this.parseInputValueDef,Z.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===Z.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(Z.BRACE_L,this.parseOperationTypeDefinition,Z.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:X.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:X.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:X.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:X.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:X.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:X.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:X.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Z.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:X.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(Z.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call($,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new K(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 B(this._lexer.source,t.start,`Expected ${De(e)}, found ${Ce(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==Z.NAME||t.value!==e)throw B(this._lexer.source,t.start,`Expected "${e}", found ${Ce(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===Z.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return B(this._lexer.source,t.start,`Unexpected ${Ce(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!==Z.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw B(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function Ce(e){const t=e.value;return De(e.kind)+(null!=t?` "${t}"`:"")}function De(e){return function(e){return e===Z.BANG||e===Z.DOLLAR||e===Z.AMP||e===Z.PAREN_L||e===Z.PAREN_R||e===Z.SPREAD||e===Z.COLON||e===Z.EQUALS||e===Z.AT||e===Z.BRACKET_L||e===Z.BRACKET_R||e===Z.BRACE_L||e===Z.PIPE||e===Z.BRACE_R}(e)?`"${e}"`:e}const Re=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Fe(e){return Le[e.charCodeAt(0)]}const Le=["\\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"],Pe=Object.freeze({});function Me(e,t,n=W){const r=new Map;for(const e of Object.values(X))r.set(e,qe(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;Y(f)||P(!1,`Invalid AST Node: ${we(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===Pe)break;if(!1===g){if(!e){h.pop();continue}}else if(void 0!==g&&(l.push([o,g]),!e)){if(!Y(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 qe(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 je={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>Ve(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=Qe("(",Ve(e.variableDefinitions,", "),")"),n=Ve([e.operation,Ve([e.name,t]),Ve(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+Qe(" = ",n)+Qe(" ",Ve(r," "))},SelectionSet:{leave:({selections:e})=>Ue(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=Qe("",e,": ")+t;let s=o+Qe("(",Ve(n,", "),")");return s.length>80&&(s=o+Qe("(\n",Ge(Ve(n,"\n")),"\n)")),Ve([s,Ve(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+Qe(" ",Ve(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>Ve(["...",Qe("on ",e),Ve(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${Qe("(",Ve(n,", "),")")} on ${t} ${Qe("",Ve(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||ee(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&&ee(e.charCodeAt(0));return(u&&!f||i)&&(l+="\n"),l+=t,(u||c)&&(l+="\n"),'"""'+l+'"""'}(e):`"${e.replace(Re,Fe)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+Ve(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+Ve(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Qe("(",Ve(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Qe("",e,"\n")+Ve(["schema",Ve(t," "),Ue(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Qe("",e,"\n")+Ve(["scalar",t,Ve(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Qe("",e,"\n")+Ve(["type",t,Qe("implements ",Ve(n," & ")),Ve(r," "),Ue(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>Qe("",e,"\n")+t+(Be(n)?Qe("(\n",Ge(Ve(n,"\n")),"\n)"):Qe("(",Ve(n,", "),")"))+": "+r+Qe(" ",Ve(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>Qe("",e,"\n")+Ve([t+": "+n,Qe("= ",r),Ve(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Qe("",e,"\n")+Ve(["interface",t,Qe("implements ",Ve(n," & ")),Ve(r," "),Ue(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>Qe("",e,"\n")+Ve(["union",t,Ve(n," "),Qe("= ",Ve(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>Qe("",e,"\n")+Ve(["enum",t,Ve(n," "),Ue(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Qe("",e,"\n")+Ve([t,Ve(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>Qe("",e,"\n")+Ve(["input",t,Ve(n," "),Ue(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>Qe("",e,"\n")+"directive @"+t+(Be(n)?Qe("(\n",Ge(Ve(n,"\n")),"\n)"):Qe("(",Ve(n,", "),")"))+(r?" repeatable":"")+" on "+Ve(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>Ve(["extend schema",Ve(e," "),Ue(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>Ve(["extend scalar",e,Ve(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Ve(["extend type",e,Qe("implements ",Ve(t," & ")),Ve(n," "),Ue(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Ve(["extend interface",e,Qe("implements ",Ve(t," & ")),Ve(n," "),Ue(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>Ve(["extend union",e,Ve(t," "),Qe("= ",Ve(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>Ve(["extend enum",e,Ve(t," "),Ue(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>Ve(["extend input",e,Ve(t," "),Ue(n)]," ")}};function Ve(e,t=""){var n;return null!==(n=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==n?n:""}function Ue(e){return Qe("{\n",Ge(Ve(e,"\n")),"\n}")}function Qe(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function Ge(e){return Qe(" ",e.replace(/\n/g,"\n "))}function Be(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}function Ke(e){return e.kind===X.FIELD||e.kind===X.FRAGMENT_SPREAD||e.kind===X.INLINE_FRAGMENT}function ze(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;A(n&&1===n.length,71,r);var i=n[0];A(i.name&&"if"===i.name.value,72,r);var o=i.value;A(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],A(void 0!==i,70,n.name.value)):i=r.value.value,"skip"===n.name.value?!i:i}))}function We(e,t,n){var r=new Set(e),i=r.size;return Me(t,{Directive:function(e){if(r.delete(e.name.value)&&(!n||!r.size))return Pe}}),n?!r.size:r.size<i}function He(e){return e&&We(["client","export"],e,!0)}const Ye=()=>Object.create(null),{forEach:Je,slice:$e}=Array.prototype,{hasOwnProperty:Xe}=Object.prototype;let Ze=class e{constructor(e=!0,t=Ye){this.weakness=e,this.makeData=t}lookup(){return this.lookupArray(arguments)}lookupArray(e){let t=this;return Je.call(e,(e=>t=t.getChildTrie(e))),Xe.call(t,"data")?t.data:t.data=this.makeData($e.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($e.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 et="ReactNative"==O((function(){return navigator.product})),tt="function"==typeof WeakMap&&!(et&&!global.HermesInternal),nt="function"==typeof WeakSet,rt="function"==typeof Symbol&&"function"==typeof Symbol.for,it=rt&&Symbol.asyncIterator;function ot(e){return null!==e&&"object"==typeof e}function st(e,t){var n=t,r=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw C(74,e.operation,e.name?" named '".concat(e.name.value,"'"):"");"FragmentDefinition"===e.kind&&r.push(e)})),void 0===n&&(A(1===r.length,75,r.length),n=r[0].name.value),s(s({},e),{definitions:f([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],e.definitions,!0)})}function at(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function ct(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 A(r,76,n),r||null;default:return null}}function ut(){}O((function(){return window.document.createElement})),O((function(){return navigator.userAgent.indexOf("jsdom")>=0}));class lt{constructor(e=1/0,t=ut){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 ft(){}const ht=ft,pt="undefined"!=typeof WeakRef?WeakRef:function(e){return{deref:()=>e}},dt="undefined"!=typeof WeakMap?WeakMap:Map,vt="undefined"!=typeof FinalizationRegistry?FinalizationRegistry:function(){return{register:ft,unregister:ft}};class yt{constructor(e=1/0,t=ht){this.max=e,this.dispose=t,this.map=new dt,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 pt(n),this.registry.register(n,t,t)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new vt(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 mt=new WeakSet;function gt(e){e.size<=(e.max||-1)||mt.has(e)||(mt.add(e),setTimeout((function(){e.clean(),mt.delete(e)}),100))}var bt=function(e,t){var n=new yt(e,t);return n.set=function(e,t){var n=yt.prototype.set.call(this,e,t);return gt(this),n},n},Et=function(e,t){var n=new lt(e,t);return n.set=function(e,t){var n=lt.prototype.set.call(this,e,t);return gt(this),n},n},Tt=Symbol.for("apollo.cacheSize"),_t=s({},k[Tt]),St={};function Ot(e,t){St[e]=t}var kt=!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,_t[t]||n]}))),sizes:s({print:null===(e=St.print)||void 0===e?void 0:e.call(St),parser:null===(t=St.parser)||void 0===t?void 0:t.call(St),canonicalStringify:null===(n=St.canonicalStringify)||void 0===n?void 0:n.call(St),links:Rt(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:Ct(this.queryManager.documentTransform)}},null===(i=(r=this.cache).getMemoryInternals)||void 0===i?void 0:i.call(r))}}:void 0,wt=!1!==globalThis.__DEV__?function(){var e=this.config.fragments;return s(s({},It.apply(this)),{addTypenameDocumentTransform:Ct(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:Nt(this.storeReader.executeSelectionSet),executeSubSelectedArray:Nt(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:Nt(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:Nt(null==e?void 0:e.findFragmentSpreads),lookup:Nt(null==e?void 0:e.lookup),transform:Nt(null==e?void 0:e.transform)}})}:void 0,xt=!1!==globalThis.__DEV__?It:void 0;function It(){return{cache:{fragmentQueryDocuments:Nt(this.getFragmentDoc)}}}function Nt(e){return function(e){return!!e&&"dirtyKey"in e}(e)?e.size:void 0}function At(e){return null!=e}function Ct(e){return Dt(e).map((function(e){return{cache:e}}))}function Dt(e){return e?f(f([Nt(null==e?void 0:e.performWork)],Dt(null==e?void 0:e.left),!0),Dt(null==e?void 0:e.right),!0).filter(At):[]}function Rt(e){var t;return e?f(f([null===(t=null==e?void 0:e.getMemoryInternals)||void 0===t?void 0:t.call(e)],Rt(null==e?void 0:e.left),!0),Rt(null==e?void 0:e.right),!0).filter(At):[]}var Ft,Lt=Object.assign((function(e){return JSON.stringify(e,Pt)}),{reset:function(){Ft=new Et(_t.canonicalStringify||1e3)}});function Pt(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(Mt))return t;var i=JSON.stringify(r),o=Ft.get(i);if(!o){r.sort();var s=JSON.stringify(r);o=Ft.get(s)||r,Ft.set(i,o),Ft.set(s,o)}var a=Object.create(n);return o.forEach((function(e){a[e]=t[e]})),a}}return t}function Mt(e,t,n){return 0===t||n[t-1]<=e}function qt(e){return{__ref:String(e)}}function jt(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function Vt(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 Vt(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 Vt(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 C(85,t.value,n.kind);e[t.value]=null}}!1!==globalThis.__DEV__&&Ot("canonicalStringify",(function(){return Ft.size})),Lt.reset();var Ut=["connection","include","skip","client","rest","export","nonreactive"],Qt=Lt,Gt=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(Qt(i),")")}return n.connection.key}var o=e;if(t){var s=Qt(t);o+="(".concat(s,")")}return n&&Object.keys(n).forEach((function(e){-1===Ut.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?o+="@".concat(e,"(").concat(Qt(n[e]),")"):o+="@".concat(e))})),o}),{setStringify:function(e){var t=Qt;return Qt=e,t}});function Bt(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach((function(e){var r=e.name,i=e.value;return Vt(n,r,i,t)})),n}return null}function Kt(e){return e.alias?e.alias.value:e.name.value}function zt(e,t,n){for(var r,i=0,o=t.selections;i<o.length;i++){if(Wt(c=o[i])){if("__typename"===c.name.value)return e[Kt(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=zt(e,ct(c=a[s],n).selectionSet,n);if("string"==typeof u)return u}}function Wt(e){return"Field"===e.kind}function Ht(e){A(e&&"Document"===e.kind,77);var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw C(78,e.kind);return e}));return A(t.length<=1,79,t.length),e}function Yt(e){return Ht(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function Jt(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&!!e.name})).map((function(e){return e.name.value}))[0]||null}function $t(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function Xt(e){var t=Yt(e);return A(t&&"query"===t.operation,80),t}function Zt(e){var t;Ht(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 C(84)}function en(e){var t=Object.create(null),n=e&&e.variableDefinitions;return n&&n.length&&n.forEach((function(e){e.defaultValue&&Vt(t,e.variable.name,e.defaultValue)})),t}const tn=()=>Object.create(null),{forEach:nn,slice:rn}=Array.prototype,{hasOwnProperty:on}=Object.prototype;class sn{constructor(e=!0,t=tn){this.weakness=e,this.makeData=t}lookup(...e){return this.lookupArray(e)}lookupArray(e){let t=this;return nn.call(e,(e=>t=t.getChildTrie(e))),on.call(t,"data")?t.data:t.data=this.makeData(rn.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&&an(e[n])?t.weak:t.strong;t=r&&r.get(e[n])}return t&&t.data}getChildTrie(e){const t=this.weakness&&an(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 sn(this.weakness,this.makeData)),n}}function an(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}let cn=null;const un={};let ln=1;function fn(e){try{return e()}catch(e){}}const hn="@wry/context:Slot",pn=fn((()=>globalThis))||fn((()=>global))||Object.create(null),dn=pn[hn]||Array[hn]||function(e){try{Object.defineProperty(pn,hn,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(class{constructor(){this.id=["slot",ln++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=cn;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===un)break;return e!==cn&&(cn.slots[this.id]=t),!0}return cn&&(cn.slots[this.id]=un),!1}getValue(){if(this.hasValue())return cn.slots[this.id]}withValue(e,t,n,r){const i={__proto__:null,[this.id]:e},o=cn;cn={parent:o,slots:i};try{return t.apply(r,n)}finally{cn=o}}static bind(e){const t=cn;return function(){const n=cn;try{return cn=t,e.apply(this,arguments)}finally{cn=n}}}static noContext(e,t,n){if(!cn)return e.apply(n,t);{const r=cn;try{return cn=null,e.apply(n,t)}finally{cn=r}}}}),vn=new dn,{hasOwnProperty:yn}=Object.prototype,mn=Array.from||function(e){const t=[];return e.forEach((e=>t.push(e))),t};function gn(e){const{unsubscribe:t}=e;"function"==typeof t&&(e.unsubscribe=void 0,t())}const bn=[];function En(e,t){if(!e)throw new Error(t||"assertion failure")}function Tn(e,t){const n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}function _n(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function Sn(e){return e.slice(0)}class On{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,++On.count}peek(){if(1===this.value.length&&!xn(this))return kn(this),this.value[0]}recompute(e){return En(!this.recomputing,"already recomputing"),kn(this),xn(this)?function(e,t){Fn(e),vn.withValue(e,wn,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{gn(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,xn(e))return;Nn(e)}(e);return _n(e.value)}(this,e):_n(this.value)}setDirty(){this.dirty||(this.dirty=!0,In(this),gn(this))}dispose(){this.setDirty(),Fn(this),An(this,((e,t)=>{e.setDirty(),Ln(e,this)}))}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=bn.pop()||new Set),this.deps.add(e)}forgetDeps(){this.deps&&(mn(this.deps).forEach((e=>e.delete(this))),this.deps.clear(),bn.push(this.deps),this.deps=null)}}function kn(e){const t=vn.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),xn(e)?Cn(t,e):Dn(t,e),t}function wn(e,t){e.recomputing=!0;const{normalizeResult:n}=e;let r;n&&1===e.value.length&&(r=Sn(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),n&&r&&!Tn(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 xn(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function In(e){An(e,Cn)}function Nn(e){An(e,Dn)}function An(e,t){const n=e.parents.size;if(n){const r=mn(e.parents);for(let i=0;i<n;++i)t(r[i],e)}}function Cn(e,t){En(e.childValues.has(t)),En(xn(t));const n=!xn(e);if(e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=bn.pop()||new Set;e.dirtyChildren.add(t),n&&In(e)}function Dn(e,t){En(e.childValues.has(t)),En(!xn(t));const n=e.childValues.get(t);0===n.length?e.childValues.set(t,Sn(t.value)):Tn(n,t.value)||e.setDirty(),Rn(e,t),xn(e)||Nn(e)}function Rn(e,t){const n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(bn.length<100&&bn.push(n),e.dirtyChildren=null))}function Fn(e){e.childValues.size>0&&e.childValues.forEach(((t,n)=>{Ln(e,n)})),e.forgetDeps(),En(null===e.dirtyChildren)}function Ln(e,t){t.parents.delete(e),e.childValues.delete(t),Rn(e,t)}On.count=0;const Pn={setDirty:!0,dispose:!0,forget:!0};function Mn(e){const t=new Map;function n(e){const n=vn.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&&yn.call(Pn,n)?n:"setDirty";mn(r).forEach((e=>e[i]())),t.delete(e),gn(r)}},n}let qn;function jn(...e){return(qn||(qn=new sn("function"==typeof WeakMap))).lookupArray(e)}const Vn=new Set;function Un(e,{max:t=Math.pow(2,16),keyArgs:n,makeCacheKey:r=jn,normalizeResult:i,subscribe:o,cache:s=lt}=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 On(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),Vn.add(a),vn.hasValue()||(Vn.forEach((e=>e.clean())),Vn.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 Qn(e){return e}var Gn,Bn=function(){function e(e,t){void 0===t&&(t=Object.create(null)),this.resultCache=nt?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(Qn,{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 Ze(tt);this.performWork=Un(e.prototype.performWork.bind(this),{makeCacheKey:function(e){var r=t.getCacheKey(e);if(r)return A(Array.isArray(r),69),n.lookupArray(r)},max:_t["documentTransform.cache"],cache:yt})}},e.prototype.performWork=function(e){return Ht(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}(),Kn=Object.assign((function(e){var t=Gn.get(e);return t||(t=function(e){return Me(e,je)}(e),Gn.set(e,t)),t}),{reset:function(){Gn=new bt(_t.print||2e3)}});Kn.reset(),!1!==globalThis.__DEV__&&Ot("print",(function(){return Gn?Gn.size:0}));var zn=Array.isArray;function Wn(e){return Array.isArray(e)&&e.length>0}var Hn={kind:X.FIELD,name:{kind:X.NAME,value:"__typename"}};function Yn(e,t){return!e||e.selectionSet.selections.every((function(e){return e.kind===X.FRAGMENT_SPREAD&&Yn(t[e.name.value],t)}))}function Jn(e){return Yn(Yt(e)||function(e){A("Document"===e.kind,81),A(e.definitions.length<=1,82);var t=e.definitions[0];return A("FragmentDefinition"===t.kind,83),t}(e),at($t(e)))?null:e}function $n(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 Xn(e,t){Ht(t);for(var n=$n(""),r=$n(""),i=function(e){for(var t=0,i=void 0;t<e.length&&(i=e[t]);++t)if(!zn(i)){if(i.kind===X.OPERATION_DEFINITION)return n(i.name&&i.name.value);if(i.kind===X.FRAGMENT_DEFINITION)return r(i.name.value)}return!1!==globalThis.__DEV__&&A.error(86),null},o=0,a=t.definitions.length-1;a>=0;--a)t.definitions[a].kind===X.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 Wn(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=Me(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===X.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===X.OPERATION_DEFINITION?d(n(e.name&&e.name.value)).fragmentSpreads.forEach((function(e){v.add(e)})):e.kind!==X.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 Jn(Me(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 Zn=Object.assign((function(e){return Me(e,{SelectionSet:{enter:function(e,t,n){if(!n||n.kind!==X.OPERATION_DEFINITION){var r=e.selections;if(r)if(!r.some((function(e){return Wt(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var i=n;if(!(Wt(i)&&i.directives&&i.directives.some((function(e){return"export"===e.name.value}))))return s(s({},e),{selections:f(f([],r,!0),[Hn],!1)})}}}}})}),{added:function(e){return e===Hn}});function er(e){return"query"===Zt(e).operation?e:Me(e,{OperationDefinition:{enter:function(e){return s(s({},e),{operation:"query"})}}})}function tr(e){return Ht(e),Xn([{test:function(e){return"client"===e.name.value},remove:!0}],e)}var nr=Object.prototype.hasOwnProperty;function rr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ir(e)}function ir(e){var t=e[0]||{},n=e.length;if(n>1)for(var r=new sr,i=1;i<n;++i)t=r.merge(t,e[i]);return t}var or=function(e,t,n){return this.merge(e[n],t[n])},sr=function(){function e(e){void 0===e&&(e=or),this.reconciler=e,this.isObject=ot,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 ot(t)&&ot(e)?(Object.keys(t).forEach((function(i){if(nr.call(e,i)){var o=e[i];if(t[i]!==o){var s=n.reconciler.apply(n,f([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 ot(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 ar(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 cr(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 cr(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 cr(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 ur(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 lr(e,t,n){return t&&ur(e.prototype,t),n&&ur(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var fr=function(){return"function"==typeof Symbol},hr=function(e){return fr()&&Boolean(Symbol[e])},pr=function(e){return hr(e)?Symbol[e]:"@@"+e};fr()&&!hr("observable")&&(Symbol.observable=Symbol("observable"));var dr=pr("iterator"),vr=pr("observable"),yr=pr("species");function mr(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function gr(e){var t=e.constructor;return void 0!==t&&null===(t=t[yr])&&(t=void 0),void 0!==t?t:Ir}function br(e){return e instanceof Ir}function Er(e){Er.log?Er.log(e):setTimeout((function(){throw e}))}function Tr(e){Promise.resolve().then((function(){try{e()}catch(e){Er(e)}}))}function _r(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=mr(t,"unsubscribe");n&&n.call(t)}}catch(e){Er(e)}}function Sr(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function Or(e,t,n){e._state="running";var r=e._observer;try{var i=mr(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(Sr(e),!i)throw n;i.call(r,n);break;case"complete":Sr(e),i&&i.call(r)}}catch(e){Er(e)}"closed"===e._state?_r(e):"running"===e._state&&(e._state="ready")}function kr(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 Tr((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(Or(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void Or(e,t,n);e._queue.push({type:t,value:n})}}var wr=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var n=new xr(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&&(Sr(this),_r(this))},lr(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),xr=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){kr(this._subscription,"next",e)},t.error=function(e){kr(this._subscription,"error",e)},t.complete=function(){kr(this._subscription,"complete")},lr(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),Ir=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 wr(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(gr(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(gr(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=gr(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=gr(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=gr(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[vr]=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=mr(t,vr);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return br(i)&&i.constructor===n?i:new n((function(e){return i.subscribe(e)}))}if(hr("iterator")&&(r=mr(t,dr)))return new n((function(e){Tr((function(){if(!e.closed){for(var n,i=ar(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){Tr((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){Tr((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))},lr(e,null,[{key:yr,get:function(){return this}}]),e}();fr()&&Object.defineProperty(Ir,Symbol("extensions"),{value:{symbol:vr,hostReportError:Er},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 Nr=Ir.prototype,Ar="@@observable";Nr[Ar]||(Nr[Ar]=function(){return this});var Cr=Object.prototype.toString;function Dr(e){return Rr(e)}function Rr(e,t){switch(Cr.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]=Rr(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]=Rr(e[n],t)})),r;default:return e}}function Fr(e){var t=new Set([e]);return t.forEach((function(e){ot(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){ot(e[n])&&t.add(e[n])}))})),e}function Lr(e){return!1!==globalThis.__DEV__&&Fr(e),e}function Pr(e,t,n){var r=[];e.forEach((function(e){return e[t]&&r.push(e)})),r.forEach((function(e){return e[t](n)}))}function Mr(e,t,n){return new Ir((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 qr(e){function t(t){Object.defineProperty(e,t,{value:Ir})}return rt&&Symbol.species&&t(Symbol.species),t("@@species"),e}function jr(e){return e&&"function"==typeof e.then}var Vr=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),Pr(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),Pr(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?jr(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"),Pr(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 Ir(t)]),jr(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}(Ir);function Ur(e){return"incremental"in e}function Qr(e){return ot(e)&&"payload"in e}function Gr(e,t){var n=e,r=new sr;return Ur(t)&&Wn(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 Br(e){return Wn(Kr(e))}function Kr(e){var t=Wn(e.errors)?e.errors.slice(0):[];return Ur(e)&&Wn(e.incremental)&&e.incremental.forEach((function(e){e.errors&&t.push.apply(t,e.errors)})),t}function zr(){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 Wr(e,t){return zr(e,t,t.variables&&{variables:zr(s(s({},e&&e.variables),t.variables))})}function Hr(e){return new Ir((function(t){t.error(e)}))}qr(Vr);var Yr=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 Jr(e,t){return t?t(e):Ir.of()}function $r(e){return"function"==typeof e?new Zr(e):e}function Xr(e){return e.request.length<=1}var Zr=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return Ir.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map($r).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,n,r){var i,o=$r(n),s=$r(r||new e(Jr));return i=Xr(o)&&Xr(s)?new e((function(e){return t(e)?o.request(e)||Ir.of():s.request(e)||Ir.of()})):new e((function(e,n){return t(e)?o.request(e,n)||Ir.of():s.request(e,n)||Ir.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?Jt(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 C(44,i)}return e}(t))))||Ir.of()},e.concat=function(t,n){var r=$r(t);if(Xr(r))return!1!==globalThis.__DEV__&&A.warn(36,r),r;var i,o=$r(n);return i=Xr(o)?new e((function(e){return r.request(e,(function(e){return o.request(e)||Ir.of()}))||Ir.of()})):new e((function(e,t){return r.request(e,(function(e){return o.request(e,t)||Ir.of()}))||Ir.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(Jr)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw C(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}(),ei=Zr.execute;function ti(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 it&&(u[Symbol.asyncIterator]=function(){return this}),u}function ni(e){var t={next:function(){return e.read()}};return it&&(t[Symbol.asyncIterator]=function(){return this}),t}function ri(e){var t,n,r,i=e;if(e.body&&(i=e.body),function(e){return!(!it||!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 ni(i.getReader());if(function(e){return!!e.stream}(i))return ni(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)})))}},it&&(r[Symbol.asyncIterator]=function(){return this}),r;if(function(e){return!!e.pipe}(i))return ti(i);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var ii=Symbol();function oi(e){return e.hasOwnProperty("graphQLErrors")}var si=function(e){function t(n){var r,i,o=n.graphQLErrors,s=n.protocolErrors,a=n.clientErrors,c=n.networkError,u=n.errorMessage,l=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=f(f(f([],(r=h).graphQLErrors,!0),r.clientErrors,!0),r.protocolErrors,!0),r.networkError&&i.push(r.networkError),i.map((function(e){return ot(e)&&e.message||"Error message not found."})).join("\n")),h.extraInfo=l,h.cause=f(f(f([c],o||[],!0),s||[],!0),a||[],!0).find((function(e){return!!e}))||null,h.__proto__=t.prototype,h}return o(t,e),t}(Error),ai=Object.prototype.hasOwnProperty;function ci(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 ui(e,t){if(e.status>=300){Yr(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 li=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var r=C(40,t,e.message);throw r.parseError=e,r}return n},fi={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},hi=function(e,t){return t(e)};function pi(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,Kn)),{options:i,body:f}}var di=O((function(){return fetch})),vi=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?hi: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 C(38)}(r||di);var y={http:{includeExtensions:l,preserveHeaderCase:f},options:v.fetchOptions,credentials:v.credentials,headers:v.headers};return new Zr((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(We(["client"],e.query)){var g=tr(e.query);if(!g)return Hr(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,E,T,_,S,k=pi(e,o,fi,y,m),w=k.options,x=k.body;x.variables&&!d&&(x.variables=(b=x.variables,E=e.query,T=s({},b),_=new Set(Object.keys(b)),Me(E,{Variable:function(e,t,n){n&&"VariableDefinition"!==n.kind&&_.delete(e.name.value)}}),_.forEach((function(e){delete T[e]})),T)),w.signal||"undefined"==typeof AbortController||(S=new AbortController,w.signal=S.signal);var I,N="OperationDefinition"===(I=Zt(e.query)).kind&&"subscription"===I.operation,C=We(["defer"],e.query);if(h&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(w.method="GET"),C||N){w.headers=w.headers||{};var D="multipart/mixed;";N&&C&&!1!==globalThis.__DEV__&&A.warn(39),N?D+="boundary=graphql;subscriptionSpec=1.0,application/json":C&&(D+="deferSpec=20220824,application/json"),w.headers.accept=D}if("GET"===w.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=li(t.variables,"Variables map")}catch(e){return{parseError:e}}r("variables",i)}if(t.extensions){var o=void 0;try{o=li(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,x),F=R.newURI,L=R.parseError;if(L)return Hr(L);t=F}else try{w.body=li(x,"Payload")}catch(L){return Hr(L)}return new Ir((function(n){var i=r||O((function(){return fetch}))||di,o=n.next.bind(n);return i(t,w).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,T,_,S,O,k,w,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=ri(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,k=[c.slice(0,m),c.slice(m+a.length)],c=k[1],b=(g=k[0]).indexOf("\r\n\r\n"),E=ci(g.slice(0,b)),(T=E["content-type"])&&-1===T.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");if(_=g.slice(b))if(S=ui(e,_),Object.keys(S).length>1||"data"in S||"incremental"in S||"errors"in S||"payload"in S)if(Qr(S)){if(O={},"payload"in S){if(1===Object.keys(S).length&&null===S.payload)return[2];O=s({},S.payload)}"errors"in S&&(O=s(s({},O),{extensions:s(s({},"extensions"in O?O.extensions:null),(w={},w[ii]=S.errors,w))})),t(O)}else t(S);else if(1===Object.keys(S).length&&"hasNext"in S&&!S.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 ui(e,t)})).then((function(t){return Array.isArray(t)||ai.call(t,"data")||ai.call(t,"errors")||Yr(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(){S=void 0,n.complete()})).catch((function(e){S=void 0,function(e,t){e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e)}(e,n)})),function(){S&&S.abort()}}))}))},yi=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,vi(t).request)||this;return n.options=t,n}return o(t,e),t}(Zr);const{toString:mi,hasOwnProperty:gi}=Object.prototype,bi=Function.prototype.toString,Ei=new Map;function Ti(e,t){try{return _i(e,t)}finally{Ei.clear()}}function _i(e,t){if(e===t)return!0;const n=mi.call(e);if(n!==mi.call(t))return!1;switch(n){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(wi(e,t))return!0;const n=Si(e),r=Si(t),i=n.length;if(i!==r.length)return!1;for(let e=0;e<i;++e)if(!gi.call(t,n[e]))return!1;for(let r=0;r<i;++r){const i=n[r];if(!_i(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(wi(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&&!_i(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=bi.call(e);return n===bi.call(t)&&!function(e,t){const n=e.length-t.length;return n>=0&&e.indexOf(t,n)===n}(n,ki)}}return!1}function Si(e){return Object.keys(e).filter(Oi,e)}function Oi(e){return void 0!==this[e]}const ki="{ [native code] }";function wi(e,t){let n=Ei.get(e);if(n){if(n.has(t))return!0}else Ei.set(e,n=new Set);return n.add(t),!1}function xi(e,t,n,r){var i=t.data,o=a(t,["data"]),s=n.data;return Ti(o,a(n,["data"]))&&Ii(Zt(e).selectionSet,i,s,{fragmentMap:at($t(e)),variables:r})}function Ii(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),!ze(e,r.variables))return!0;if(Ni(e))return!0;if(Wt(e)){var o=Kt(e),s=t&&t[o],a=n&&n[o],c=e.selectionSet;if(!c)return Ti(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(!Ii(c,s[h],a[h],r))return!1;return!0}return Ii(c,s,a,r)}var p=ct(e,r.fragmentMap);return p?!!Ni(p)||Ii(p.selectionSet,t,n,r):void 0}))}function Ni(e){return!!e.directives&&e.directives.some(Ai)}function Ai(e){return"nonreactive"===e.name.value}var Ci=function(){function e(){this.assumeImmutableResults=!1,this.getFragmentDoc=Un(st,{max:_t["cache.fragmentQueryDocuments"]||1e3,cache:yt})}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 Ir((function(e){return n.watch(s(s({},h),{immediate:!0,callback:function(n){if(!t||!xi(f,{data:null==t?void 0:t.result},{data:n.result})){var r={data:n.result,complete:!!n.complete};n.missing&&(r.missing=ir(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__&&(Ci.prototype.getMemoryInternals=xt);var Di=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),Ri=Object.prototype.hasOwnProperty;function Fi(e){return null==e}function Li(e,t){var n=e.__typename,r=e.id,i=e._id;if("string"==typeof n&&(t&&(t.keyObject=Fi(r)?Fi(i)?void 0:{_id:i}:{id:r}),Fi(r)&&!Fi(i)&&(r=i),!Fi(r)))return"".concat(n,":").concat("number"==typeof r||"string"==typeof r?r:JSON.stringify(r))}var Pi={dataIdFromObject:Li,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Mi(e){var t=e.canonizeResults;return void 0===t?Pi.canonizeResults:t}var qi=/^[_a-z][_0-9a-z]*/i;function ji(e){var t=e.match(qi);return t?t[0]:e}function Vi(e,t,n){return!!ot(t)&&(zn(t)?t.every((function(t){return Vi(e,t,n)})):e.selections.every((function(e){if(Wt(e)&&ze(e,n)){var r=Kt(e);return Ri.call(t,r)&&(!e.selectionSet||Vi(e.selectionSet,t[r],n))}return!0})))}function Ui(e){return ot(e)&&!jt(e)&&!zn(e)}function Qi(e,t){var n=at($t(e));return{fragmentMap:n,lookupFragment:function(e){var r=n[e];return!r&&t&&(r=t.lookup(e)),r||null}}}var Gi=Object.create(null),Bi=function(){return Gi},Ki=Object.create(null),zi=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 Lr(jt(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return jt(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return qt(e);if(jt(e))return e;var r=n.policies.identify(e)[0];if(r){var i=qt(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),Ri.call(this.data,e)){var n=this.data[e];if(n&&Ri.call(n,t))return n[t]}return"__typename"===t&&Ri.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof Ji?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),Ri.call(this.data,e)?this.data[e]:this instanceof Ji?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var n,r=this;jt(e)&&(e=e.__ref),jt(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){A("string"==typeof n,1);var s=new sr(Xi).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=ji(e);t===e||r.policies.hasKeyArgs(s.__typename,t)||(a[t]=1),void 0!==s[e]||r instanceof Ji||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:Gi,INVALIDATE:Ki,isReference:jt,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||qt(e)}:t,{store:n})}};if(Object.keys(r).forEach((function(u){var l=ji(u),f=r[u];if(void 0!==f){var h="function"==typeof t?t:t[u]||t[l];if(h){var p=h===Bi?Gi:h(Lr(f),s(s({},c),{fieldName:l,storeFieldName:u,storage:n.getStorage(e,u)}));if(p===Ki)n.group.dirty(e,u);else if(p===Gi&&(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__&&A.warn(2,e),!0};if(jt(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(jt(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__&&A.warn(3,y);break}}}}void 0!==f&&(a=!1)}})),o)return this.merge(e,i),a&&(this instanceof Ji?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]=Bi,r):Bi)}return!1},e.prototype.evict=function(e,t){var n=!1;return e.id&&(Ri.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Ji&&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){Ri.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&&Ri.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 Ji?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){Ri.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 Ji;)i=i.parent;r.forEach((function(e){return i.delete(e)}))}return r},e.prototype.findChildRefIds=function(e){if(!Ri.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){jt(e)&&(t[e.__ref]=!0),ot(e)&&Object.keys(e).forEach((function(t){var n=e[t];ot(n)&&r.add(n)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),Wi=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?Mn():null,this.keyMaker=new Ze(tt)},e.prototype.depend=function(e,t){if(this.d){this.d(Hi(e,t));var n=ji(t);n!==t&&this.d(Hi(e,n)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(Hi(e,t),"__exists"===t?"forget":"setDirty")},e}();function Hi(e,t){return t+"#"+e}function Yi(e,t){Zi(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 Wi(i))||this;return s.stump=new $i(s),s.storageTrie=new Ze(tt),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}(zi);var Ji=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){Ti(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 Ri.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}(zi),$i=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new Wi(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}(Ji);function Xi(e,t,n){var r=e[n],i=t[n];return Ti(r,i)?r:i}function Zi(e){return!!(e instanceof zi&&e.group.caching)}function eo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var to=function(){function e(){this.known=new(nt?WeakSet:Set),this.pool=new Ze(tt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return ot(e)&&this.known.has(e)},e.prototype.pass=function(e){if(ot(e)){var t=function(e){return ot(e)?zn(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(ot(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 no(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var ro=function(){function e(e){var t=this;this.knownResults=new(tt?WeakMap:Map),this.config=zr(e,{addTypename:!1!==e.addTypename,canonizeResults:Mi(e)}),this.canon=e.canon||new to,this.executeSelectionSet=Un((function(e){var n,r=e.context.canonizeResults,i=no(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:(Yi(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize||_t["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:no,makeCacheKey:function(e,t,n,r){if(Zi(n.store))return n.store.makeCacheKey(e,jt(t)?t.__ref:t,n.varString,r)}}),this.executeSubSelectedArray=Un((function(e){return Yi(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize||_t["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(e){var t=e.field,n=e.array,r=e.context;if(Zi(r.store))return r.store.makeCacheKey(t,n,r.varString)}})}return e.prototype.resetCanon=function(){this.canon=new to},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({},en(Xt(n))),o);var h,p=qt(i),d=this.executeSelectionSet({selectionSet:Zt(n).selectionSet,objectOrReference:p,enclosingRef:p,context:s({store:t,query:n,policies:f,variables:o,varString:Lt(o),canonizeResults:l},Qi(n,this.config.fragments))});if(d.missing&&(h=[new Di(io(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(Zi(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(jt(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 sr;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(ze(e,a))if(Wt(e)){var v=c.readField({fieldName:e.name.value,field:e,variables:o.variables,from:r},o),y=Kt(e);void 0===v?Zn.added(e)||(s=f.merge(s,((n={})[y]="Can't find field '".concat(e.name.value,"' on ").concat(jt(r)?r.__ref+" object":"object "+JSON.stringify(r,null,2)),n))):zn(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:jt(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=ct(e,o.lookupFragment);if(!m&&e.kind===X.FRAGMENT_SPREAD)throw C(9,e.name.value);m&&c.fragmentMatches(m,u)&&m.selectionSet.selections.forEach(p.add,p)}}));var d={result:ir(l),missing:s},v=o.canonizeResults?this.canon.admit(d):Lr(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 sr;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:zn(e)?c(n.executeSubSelectedArray({field:r,array:e,enclosingRef:o,context:s}),t):r.selectionSet?c(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,enclosingRef:jt(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){ot(n)&&(A(!jt(n),10,function(e,t){return jt(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 io(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var oo=new dn,so=new WeakMap;function ao(e){var t=so.get(e);return t||so.set(e,t={vars:new Set,dep:Mn()}),t}function co(e){ao(e).vars.forEach((function(t){return t.forgetCache(e)}))}function uo(e){var t=new Set,n=new Set,r=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach((function(e){ao(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=oo.getValue();a&&(i(a),ao(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),ao(e).vars.add(r),r};return r.forgetCache=function(e){return t.delete(e)},r}var lo=Object.create(null);function fo(e){var t=JSON.stringify(e);return lo[t]||(lo[t]=Object.create(null))}function ho(e){var t=fo(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,n){var r=function(e,t){return n.readField(t,e)},i=n.keyObject=vo(e,(function(e){var i=go(n.storeObject,e,r);return void 0===i&&t!==n.storeObject&&Ri.call(t,e[0])&&(i=go(t,e,mo)),A(void 0!==i,4,e.join("."),t),i}));return"".concat(n.typename,":").concat(JSON.stringify(i))})}function po(e){var t=fo(e);return t.keyArgsFn||(t.keyArgsFn=function(t,n){var r=n.field,i=n.variables,o=n.fieldName,s=vo(e,(function(e){var n=e[0],o=n.charAt(0);if("@"!==o)if("$"!==o){if(t)return go(t,e)}else{var s=n.slice(1);if(i&&Ri.call(i,s)){var a=e.slice(0);return a[0]=s,go(i,a)}}else if(r&&Wn(r.directives)){var c=n.slice(1),u=r.directives.find((function(e){return e.name.value===c})),l=u&&Bt(u,i);return l&&go(l,e.slice(1))}})),a=JSON.stringify(s);return(t||"{}"!==a)&&(o+=":"+a),o})}function vo(e,t){var n=new sr;return yo(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 yo(e){var t=fo(e);if(!t.paths){var n=t.paths=[],r=[];e.forEach((function(t,i){zn(t)?(yo(t).forEach((function(e){return n.push(r.concat(e))})),r.length=0):(r.push(t),zn(e[i+1])||(n.push(r.slice(0)),r.length=0))}))}return t.paths}function mo(e,t){return e[t]}function go(e,t,n){return n=n||mo,bo(t.reduce((function e(t,r){return zn(t)?t.map((function(t){return e(t,r)})):t&&n(t,r)}),e))}function bo(e){return ot(e)?zn(e)?e.map(bo):vo(Object.keys(e).sort(),(function(t){return go(e,t)})):e}function Eo(e){return void 0!==e.args?e.args:e.field?Bt(e.field,e.variables):null}var To=function(){},_o=function(e,t){return t.fieldName},So=function(e,t,n){return(0,n.mergeObjects)(e,t)},Oo=function(e,t){return t},ko=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:Li},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=xo(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(!zn(f)){o=f;break}l=ho(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),Ri.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?So:!1===t?Oo:e.merge}s(r,t.merge),r.keyFn=!1===i?To:zn(i)?ho(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?_o:zn(a)?po(a):"function"==typeof a?a:r.keyFn,"function"==typeof c&&(r.read=c),s(r,u)}r.read&&r.merge&&(r.keyFn=r.keyFn||_o)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(A(!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(qi);r&&r[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!Ri.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__&&A.warn(6,t,o),s.add(o)),!0;h.forEach(c),u&&f===a.length-1&&Vi(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=Eo(e);o;){var c=o(a,s);if(!zn(c)){t=c||r;break}o=po(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 Vt(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 Vt(r,n,i,t)}))),Gt(e.name.value,r,n)}(e.field,e.variables):Gt(r,Eo(e))),!1===t?r:r===ji(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=ji(i),s=t.store.getFieldValue(n,i),a=this.getFieldPolicy(e.typename,o,!1),c=a&&a.read;if(c){var u=wo(this,n,e,t,t.store.getStorage(jt(n)?n.__ref:n,i));return oo.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===So?Io(r.store)(e,t):a===Oo?t:(r.overwrite&&(e=void 0),a(e,t,wo(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:r.variables},r,i||Object.create(null))))},e}();function wo(e,t,n,r,i){var o=e.getStoreFieldName(n),s=ji(o),a=n.variables||r.variables,c=r.store,u=c.toReference,l=c.canRead;return{args:Eo(n),field:n.field||null,fieldName:s,storeFieldName:o,variables:a,isReference:jt,toReference:u,storage:i,cache:e.cache,canRead:l,readField:function(){return e.readField(xo(arguments,t,a),r)},mergeObjects:Io(r.store)}}function xo(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),Ri.call(r,"from")||(r.from=t)),!1!==globalThis.__DEV__&&void 0===r.from&&!1!==globalThis.__DEV__&&A.warn(7,I(Array.from(e))),void 0===r.variables&&(r.variables=n),r}function Io(e){return function(t,n){if(zn(t)||zn(n))throw C(8);if(ot(t)&&ot(n)){var r=e.getFieldValue(t,"__typename"),i=e.getFieldValue(n,"__typename");if(r&&i&&r!==i)return n;if(jt(t)&&Ui(n))return e.merge(t.__ref,n),t;if(Ui(t)&&jt(n))return e.merge(t,n.__ref),n;if(Ui(t)&&Ui(n))return s(s({},t),n)}return n}}function No(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 Ao=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=Yt(r),l=new sr;a=s(s({},en(u)),a);var f=s(s({store:e,written:Object.create(null),merge:function(e,t){return l.merge(e,t)},variables:a,varString:Lt(a)},Qi(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(!jt(h))throw C(11,i);return f.incomingById.forEach((function(t,r){var i=t.storeObject,o=t.mergeTree,a=t.fieldNodeSet,c=qt(r);if(o&&o.map.size){var u=n.applyMerges(o,c,i,f);if(jt(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[ji(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(jt(o))return;if(Ti(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=ji(n),l="".concat(c,".").concat(u);if(Po.has(l))return;Po.add(l);var f=[];zn(o)||zn(a)||[o,a].forEach((function(e){var t=r.getFieldValue(e,"__typename");"string"!=typeof t||f.includes(t)||f.push(t)}));!1!==globalThis.__DEV__&&A.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]||zt(r,i,o.fragmentMap)||n&&o.store.get(n,"__typename");"string"==typeof l&&(u.__typename=l);var f=function(){var e=xo(arguments,u,o.variables);if(jt(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=Kt(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=Do(a,p),v=t.processFieldValue(s,n,n.selectionSet?No(e,!1,!1):e,d),y=void 0;n.selectionSet&&(jt(v)||Ui(v))&&(y=f("__typename",v));var m=c.getMergeFunction(l,n.name.value,y);m?d.info={field:n,typename:l,merge:m}:Lo(a,p),u=e.merge(u,((i={})[p]=v,i))}else!1===globalThis.__DEV__||e.clientOnly||e.deferred||Zn.added(n)||c.getReadFunction(l,n.name.value)||!1!==globalThis.__DEV__&&A.error(12,Kt(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=qt(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=Ro(g.mergeTree,a),h.forEach((function(e){return g.fieldNodeSet.add(e)}))):o.incomingById.set(n,{storeObject:u,mergeTree:Fo(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?zn(e)?e.map((function(e,o){var s=i.processFieldValue(e,t,n,Do(r,o));return Lo(r,o),s})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):!1!==globalThis.__DEV__?Dr(e):e},e.prototype.flattenFields=function(e,t,n,r){void 0===r&&(r=zt(t,e,n.fragmentMap));var i=new Map,o=this.cache.policies,s=new Ze(!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(ze(s,n.variables)){var a=c.clientOnly,u=c.deferred;if(a&&u||!Wn(s.directives)||s.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(a=!0),"defer"===t){var r=Bt(e,n.variables);r&&!1===r.if||(u=!0)}})),Wt(s)){var l=i.get(s);l&&(a=a&&l.clientOnly,u=u&&l.deferred),i.set(s,No(n,a,u))}else{var f=ct(s,n.lookupFragment);if(!f&&s.kind===X.FRAGMENT_SPREAD)throw C(13,s.name.value);f&&o.fragmentMatches(f,r,t,n.variables)&&e(f.selectionSet,No(n,a,u))}}})))}(e,n),i},e.prototype.applyMerges=function(e,t,n,r,i){var o,a=this;if(e.map.size&&!jt(n)){var c,u=zn(n)||!jt(t)&&!Ui(t)?void 0:t,l=n;u&&!i&&(i=[jt(u)?u.__ref:u]);var f=function(e,t){return zn(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&&A(i.pop()===t)}})),c&&(n=zn(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}(),Co=[];function Do(e,t){var n=e.map;return n.has(t)||n.set(t,Co.pop()||{map:new Map}),n.get(t)}function Ro(e,t){if(e===t||!t||Fo(t))return e;if(!e||Fo(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,Ro(e,t.map.get(n))),o.delete(n)})),o.forEach((function(n){i.map.set(n,Ro(t.map.get(n),e.map.get(n)))}))}return i}function Fo(e){return!e||!(e.info||e.map.size)}function Lo(e,t){var n=e.map,r=n.get(t);r&&Fo(r)&&(Co.push(r),n.delete(t))}var Po=new Set;var Mo,qo=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.addTypenameTransform=new Bn(Zn),n.assumeImmutableResults=!0,n.makeVar=uo,n.txCount=0,n.config=function(e){return zr(Pi,e)}(t),n.addTypename=!!n.config.addTypename,n.policies=new ko({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 zi.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 Ao(this,this.storeReader=new ro({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Mi(this.config),canon:e?void 0:n&&n.canon,fragments:r}),r),this.maybeBroadcastWatch=Un((function(e,n){return t.broadcastWatch(e,n)}),{max:this.config.resultCacheMaxSize||_t["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(e){var n=e.optimistic?t.optimisticData:t.data;if(Zi(n)){var r=e.optimistic,i=e.id,o=e.variables;return n.makeCacheKey(e.query,e.callback,Lt({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 Di)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(Ri.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||ao(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&&co(n),n.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){var t;Lt.reset(),Kn.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(jt(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){!1!==globalThis.__DEV__&&A.warn(e)}},t.prototype.evict=function(e){if(!e.id){if(Ri.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(),Lt.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),co(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&&Ti(n.result,r.result)||e.callback(e.lastDiff=r,n)},t}(Ci);function jo(e){return!!e&&e<7}!1!==globalThis.__DEV__&&(qo.prototype.getMemoryInternals=wt),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"}(Mo||(Mo={}));var Vo=Object.assign,Uo=Object.hasOwnProperty,Qo=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=Bo)}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=zo(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=Yt(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||Mo.ready,r=s(s({},t),{loading:jo(n),networkStatus:n}),i=this.options.fetchPolicy,o=void 0===i?"cache-first":i;if(zo(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),Ti(r.data,{})&&(r.data=void 0),a.complete?(delete r.partial,!a.complete||r.networkStatus!==Mo.loading||"cache-first"!==o&&"cache-only"!==o||(r.networkStatus=Mo.ready,r.loading=!1)):r.partial=!0,!1===globalThis.__DEV__||a.complete||this.options.partialRefetch||r.loading||r.data||r.error||Ko(a.missing)}return e&&this.updateLastResult(r),r},t.prototype.isDifferentFromLastResult=function(e,t){return!this.last||((this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!xi(this.query,this.last.result,e,this.variables):!Ti(this.last.result,e))||t&&!Ti(this.last.variables,t))},t.prototype.getLast=function(e,t){var n=this.last;if(n&&n[e]&&(!t||Ti(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&&Uo.call(e,"variables")){var i=Xt(this.query),o=i.variableDefinitions;o&&o.some((function(e){return"variables"===e.variable.name.value}))||!1!==globalThis.__DEV__&&A.warn(20,e,(null===(t=i.name)||void 0===t?void 0:t.value)||i)}return e&&!Ti(this.options.variables,e)&&(n.variables=this.options.variables=s(s({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(n,Mo.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=Mo.fetchMore,n.notifyOnNetworkStatusChange&&this.observe();var a=new Set,c=null==e?void 0:e.updateQuery,u="no-cache"!==this.options.fetchPolicy;return u||A(c,21),this.queryManager.fetchQuery(r,n,Mo.fetchMore).then((function(l){if(t.queryManager.removeQuery(r),i.networkStatus===Mo.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)&&Go(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__&&A.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=zr(this.options,e||{});Vo(this.options,t)},t.prototype.setVariables=function(e){return Ti(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},Mo.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){A(n,23),(t||(this.pollingInfo={})).interval=n;var r=function(){var t,n;e.pollingInfo&&(jo(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"},Mo.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&&!Ti(t,this.last.variables)&&(n=void 0),this.last=s({result:this.queryManager.assumeImmutableResults?e:Dr(e),variables:t},n?{error:n}:null)},t.prototype.reobserveAsConcast=function(e,t){var n=this;this.isTornDown=!1;var r=t===Mo.refetch||t===Mo.fetchMore||t===Mo.poll,i=this.options.variables,o=this.options.fetchPolicy,a=zr(this.options,e||{}),c=r?a:Vo(this.options,a),u=this.transformDocument(c.query);this.lastQuery=u,r||(this.updatePolling(),!e||!e.variables||Ti(e.variables,i)||"standby"===c.fetchPolicy||c.fetchPolicy!==o&&"function"!=typeof c.nextFetchPolicy||(this.applyNextFetchPolicy("variables-changed",c),void 0===t&&(t=Mo.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=zo(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){Ti(n.variables,f)&&(l(),n.reportResult(e,f))},error:function(e){Ti(n.variables,f)&&(oi(e)||(e=new si({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)&&Pr(this.observers,"next",e)},t.prototype.reportError=function(e,t){var n=s(s({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:Mo.error,loading:!1});this.updateLastResult(n,t),Pr(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}(Ir);function Go(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 Bo(e){!1!==globalThis.__DEV__&&A.error(24,e.message,e.stack)}function Ko(e){!1!==globalThis.__DEV__&&e&&!1!==globalThis.__DEV__&&A.debug(25,e)}function zo(e){return"network-only"===e||"no-cache"===e||"standby"===e}qr(Qo);var Wo=new(tt?WeakMap:Map);function Ho(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return Wo.set(e,(Wo.get(e)+1)%1e15),n.apply(this,arguments)})}function Yo(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var Jo=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;Wo.has(n)||(Wo.set(n,0),Ho(n,"evict"),Ho(n,"modify"),Ho(n,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||Mo.loading;return this.variables&&this.networkStatus!==Mo.loading&&!Ti(this.variables,e.variables)&&(t=Mo.setVariables),Ti(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(){Yo(this),this.dirty=!1},e.prototype.resetDiff=function(){this.lastDiff=void 0},e.prototype.getDiff=function(){var e=this.getDiffOptions();if(this.lastDiff&&Ti(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||Ti(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():Go(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;Yo(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(jo(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&&Ti(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===Wo.get(this.cache)&&Ti(t,n.variables)&&Ti(e.data,n.result.data))},e.prototype.markResult=function(e,t,n,r){var i=this,o=new sr,s=Wn(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Wn(e.incremental)){var a=Gr(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&&($o(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:Wo.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&&Ti(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=Mo.ready},e.prototype.markError=function(e){return this.networkStatus=Mo.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function $o(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!Br(e);return!r&&n&&e.data&&(r=!0),r}var Xo=Object.prototype.hasOwnProperty,Zo=Object.create(null),es=function(){function e(e){var t=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new bt(_t["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Ze(!1);var n=new Bn((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(C(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,T=void 0===E?(null===(a=this.defaultOptions.mutate)||void 0===a?void 0:a.fetchPolicy)||"network-only":E,_=e.errorPolicy,S=void 0===_?(null===(c=this.defaultOptions.mutate)||void 0===c?void 0:c.errorPolicy)||"none":_,O=e.keepRootFields,k=e.context;return u(this,(function(e){switch(e.label){case 0:return A(l,27),A("network-only"===T||"no-cache"===T,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,k)]:[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:T,errorPolicy:S,context:k,updateQueries:p,update:g,keepRootFields:O}),this.broadcastQueries(),o=this,[2,new Promise((function(e,n){return Mr(o.getObservableFromLink(l,s(s({},k),{optimisticResponse:i?h:void 0}),f,{},!1),(function(e){if(Br(e)&&"none"===S)throw new si({graphQLErrors:Kr(e)});r&&(r.loading=!1,r.error=null);var n=s({},e);return"function"==typeof v&&(v=v(n)),"ignore"===S&&Br(n)&&delete n.errors,o.markMutationResult({mutationId:t,result:n,document:l,variables:f,fetchPolicy:T,errorPolicy:S,context:k,update:g,updateQueries:p,awaitRefetchQueries:m,refetchQueries:v,removeOptimistic:i?t:void 0,onQueryUpdated:b,keepRootFields:O})})).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 si?e:new si({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&&$o(r,e.errorPolicy)){if(Ur(r)||i.push({result:r.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Ur(r)&&Wn(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=Gr(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&&Xo.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&&Jt(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=!(Ur(a=r)||function(e){return"hasNext"in e&&"data"in e}(a))||Ur(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:Zo}):e;return r!==Zo&&(this.cache.recordOptimisticTransaction((function(e){try{n.markMutationResult(s(s({},t),{result:{data:r}}),e)}catch(e){!1!==globalThis.__DEV__&&A.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:He(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:We(["nonreactive"],e),clientQuery:this.localState.clientQuery(e),serverQuery:Xn([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],e),defaultVars:en(Yt(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 Jo(this),r=new Qo({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()),A(e.query,29),A("Document"===e.query.kind,30),A(!e.returnPartialData,31),A(!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(C(33)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=Mo.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):ot(n=e)&&"Document"===n.kind&&Array.isArray(n.definitions)?r.set(t.transform(e),!1):ot(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=x("legacyOneTimeQuery"),i=t.getQuery(r).init({document:e.query,variables:e.variables}),o=new Qo({queryManager:t,queryInfo:i,options:s(s({},e),{fetchPolicy:"network-only"})});A(o.queryId===r),i.setObservableQuery(o),n.set(r,o)})),!1!==globalThis.__DEV__&&r.size&&r.forEach((function(e,t){e||!1!==globalThis.__DEV__&&A.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&&($o(i,o)&&t.cache.write({query:n,result:i.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries());var s=Br(i),a=function(e){return!!e.extensions&&Array.isArray(e.extensions[ii])}(i);if(s||a){var c={};if(s&&(c.graphQLErrors=i.errors),a&&(c.protocolErrors=i.extensions[ii]),"none"===o||a)throw new si(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 Ir((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:Jt(l)||void 0,context:this.prepareContext(s(s({},t),{forceFetch:!i})),extensions:r};if(t=d.context,i){var v=Kn(l),y=Lt(n),m=h.lookup(v,y);if(!(a=m.observable)){var g=new Vr([ei(p,d)]);a=m.observable=g,g.beforeNext((function(){h.remove(v,y)}))}}else a=new Vr([ei(p,d)])}else a=new Vr([Ir.of({data:{}})]),t=this.prepareContext(t);return f&&(a=Mr(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 Mr(this.getObservableFromLink(i,n.context,n.variables),(function(o){var s=Kr(o),a=s.length>0,c=n.errorPolicy;if(r>=e.lastRequestId){if(a&&"none"===c)throw e.markError(new si({graphQLErrors:s}));e.markResult(o,i,n,t),e.markReady()}var u={data:o.data,loading:!1,networkStatus:Mo.ready};return a&&"none"===c&&(u.data=void 0),a&&"ignore"!==c&&(u.errors=s,u.networkStatus=Mo.error),u}),(function(t){var n=oi(t)?t:new si({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=Mo.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}),T=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},_=function(){return i.fetchCancelFns.delete(e)};if(this.fetchCancelFns.set(e,(function(e){_(),setTimeout((function(){return o.cancel(e)}))})),this.getDocumentInfo(E.query).hasClientExports)o=new Vr(this.localState.addExportedVariables(E.query,E.variables,E.context).then(T).then((function(e){return e.sources}))),s=!0;else{var S=T(E.variables);s=S.fromLink,o=new Vr(S.sources)}return o.promise.then(_,_),{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?x("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 Jo&&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||Mo.loading);var a=t.result;!1===globalThis.__DEV__||l||Ti(a,{})||Ko(t.missing);var c=function(e){return Ir.of(s({data:e,loading:jo(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===Mo.refetch&&Array.isArray(t.missing)?c(void 0):c(a)},y="no-cache"===a?0:n===Mo.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&&jo(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 Jo(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}(),ts=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=rr(t.resolvers,e)})):this.resolvers=rr(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 We(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return tr(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 Me(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 Pe}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:er(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=Zt(e),c=$t(e),l=at(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))&&ze(e,s)?Wt(e)?[2,this.resolveField(e,t,n,r).then((function(t){var n;void 0!==t&&a.push(((n={})[Kt(e)]=t,n))}))]:(!function(e){return"InlineFragment"===e.kind}(e)?(c=i[e.name.value],A(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 ir(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=Kt(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(oo.withValue(this.cache,p,[n,Bt(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),Me(i,{Directive:function(e,t,r,i,s){"client"===e.name.value&&s.forEach((function(e){n(e)&&Ke(e)&&o.add(e)}))},FragmentSpread:function(r,i,s,a,c){var u=t[r.name.value];A(u,19,r.name.value);var l=e(u);l.size>0&&(c.forEach((function(e){n(e)&&Ke(e)&&o.add(e)})),o.add(r),l.forEach((function(e){o.add(e)})))}})}return r.get(i)}(e)},e}(),ns=!1,rs=function(){function e(e){var t=this;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw C(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,b=e.resolvers,E=e.typeDefs,T=e.fragmentMatcher,_=e.name,O=e.version,k=e.devtools,w=e.link;w||(w=n?new yi({uri:n,credentials:r,headers:i}):Zr.empty()),this.link=w,this.cache=o,this.disableNetworkFetches=u||f>0,this.queryDeduplication=d,this.defaultOptions=v||Object.create(null),this.typeDefs=E,this.devtoolsConfig=s(s({},k),{enabled:(null==k?void 0:k.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=S,this.localState=new ts({cache:o,client:this,resolvers:b,fragmentMatcher:T}),this.queryManager=new es({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:y,documentTransform:a,queryDeduplication:d,ssrMode:u,clientAwareness:{name:_,version:O},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,ns||!1===globalThis.__DEV__||(ns=!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__&&A.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=Wr(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=Wr(this.defaultOptions.query,e)),A("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=Wr(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 ei(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__&&A.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__&&(rs.prototype.getMemoryInternals=kt);var is=new Map,os=new Map,ss=!0,as=!1;function cs(e){return e.replace(/[\s,]+/g," ").trim()}function us(e){var t=new Set,n=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var r=e.name.value,i=cs((s=e.loc).source.body.substring(s.start,s.end)),o=os.get(r);o&&!o.has(i)?ss&&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||os.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 ls(e){var t=cs(e);if(!is.has(t)){var n=function(e,t){return new Ae(e,t).parseDocument()}(e,{experimentalFragmentVariables:as,allowLegacyFragmentVariables:as});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");is.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}(us(n)))}return is.get(t)}function fs(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]})),ls(r)}var hs,ps,ds,vs,ys,ms,gs,bs,Es,Ts,_s,Ss,Os,ks,ws,xs,Is,Ns,As,Cs,Ds,Rs,Fs,Ls,Ps,Ms,qs=fs,js=function(){is.clear(),os.clear()},Vs=function(){ss=!1},Us=function(){as=!0},Qs=function(){as=!1};(hs=fs).gql=qs,hs.resetCaches=js,hs.disableFragmentWarnings=Vs,hs.enableExperimentalFragmentVariables=Us,hs.disableExperimentalFragmentVariables=Qs,fs.default=fs,exports.ItemType=void 0,(ps=exports.ItemType||(exports.ItemType={})).PRODUCT="PRODUCT",ps.PACKAGE="PACKAGE",function(e){e.OK="OK",e.CUSTOMER_BLACKLISTED="CUSTOMER_BLACKLISTED"}(ds||(ds={})),exports.GeinsEventType=void 0,(vs=exports.GeinsEventType||(exports.GeinsEventType={})).USER="USER",vs.USER_LOGIN="USER_LOGIN",vs.USER_LOGOUT="USER_LOGOUT",vs.USER_UPDATE="USER_UPDATE",vs.USER_DELETE="USER_DELETE",vs.CART="CART",vs.CART_ADD="CART_ADD",vs.CART_REMOVE="CART_REMOVE",vs.CART_UPDATE="CART_UPDATE",vs.CART_CLEAR="CART_CLEAR",vs.SESSION="SESSION",vs.SESSION_REFRESH="SESSION_REFRESH",vs.SESSION_EXPIRED="SESSION_EXPIRED",exports.CustomerType=void 0,(ys=exports.CustomerType||(exports.CustomerType={})).PERSON="PERSON",ys.ORGANIZATION="ORGANIZATION",exports.GeinsLogLevel=void 0,(ms=exports.GeinsLogLevel||(exports.GeinsLogLevel={})).NONE="NONE",ms.DEBUG="DEBUG",ms.INFO="INFO",ms.WARN="WARN",ms.ERROR="ERROR",exports.RuntimeContext=void 0,(gs=exports.RuntimeContext||(exports.RuntimeContext={})).SERVER="server",gs.CLIENT="client",gs.HYBRID="hybrid",exports.LinkAttributeRelEnum=void 0,(bs=exports.LinkAttributeRelEnum||(exports.LinkAttributeRelEnum={})).follow="follow",bs.noopener="noopener",bs.noreferrer="noreferrer",bs.alternate="alternate",bs.author="author",bs.bookmark="bookmark",bs.external="external",bs.help="help",bs.license="license",bs.next="next",bs.nofollow="nofollow",bs.prev="prev",bs.search="search",bs.tag="tag",exports.AuthClientConnectionModes=void 0,(Es=exports.AuthClientConnectionModes||(exports.AuthClientConnectionModes={})).Proxy="Proxy",Es.Direct="Direct",exports.ProductListSortType=void 0,(Ts=exports.ProductListSortType||(exports.ProductListSortType={})).NONE="NONE",Ts.PRICE="PRICE",Ts.PRICE_DESC="PRICE_DESC",Ts.MOST_SOLD="MOST_SOLD",Ts.VOTES="VOTES",Ts.BRAND="BRAND",Ts.LATEST="LATEST",Ts.RELEVANCE="RELEVANCE",Ts.FACET_ORDER="FACET_ORDER",Ts.ALPHABETICAL="ALPHABETICAL",Ts.ALPHABETICAL_DESC="ALPHABETICAL_DESC",Ts.AVAILABLE_STOCK="AVAILABLE_STOCK",Ts.AVAILABLE_STOCK_DESC="AVAILABLE_STOCK_DESC",Ts.TOTAL_STOCK="TOTAL_STOCK",Ts.TOTAL_STOCK_DESC="TOTAL_STOCK_DESC",exports.ProductFilterModeType=void 0,(_s=exports.ProductFilterModeType||(exports.ProductFilterModeType={})).BY_GROUP="BY_GROUP",_s.CURRENT="CURRENT",exports.FilterSystemEntityTypes=void 0,(Ss=exports.FilterSystemEntityTypes||(exports.FilterSystemEntityTypes={})).Brand="Brand",Ss.Category="Category",Ss.Price="Price",Ss.Sku="Sku",Ss.StockStatus="StockStatus",Ss.DiscountCampaign="DiscountCampaign",Ss.DiscountCampaignNumber="DiscountCampaignNumber",Ss.Discount="Discount",Ss.ReducedPrice="ReducedPrice",exports.GeinsCheckoutStatus=void 0,(Os=exports.GeinsCheckoutStatus||(exports.GeinsCheckoutStatus={})).CustomerBlacklistedType="CUSTOMER_BLACKLISTED",Os.OkType="OK",exports.GeinsCustomerType=void 0,(ks=exports.GeinsCustomerType||(exports.GeinsCustomerType={})).OrganizationType="ORGANIZATION",ks.PersonType="PERSON",exports.GeinsDiscountType=void 0,(ws=exports.GeinsDiscountType||(exports.GeinsDiscountType={})).ExternalType="EXTERNAL",ws.NoneType="NONE",ws.PriceCampaignType="PRICE_CAMPAIGN",ws.SalePriceType="SALE_PRICE",exports.GeinsFilterMode=void 0,(xs=exports.GeinsFilterMode||(exports.GeinsFilterMode={})).ByGroupType="BY_GROUP",xs.CurrentType="CURRENT",exports.GeinsGender=void 0,(Is=exports.GeinsGender||(exports.GeinsGender={})).ManType="MAN",Is.UnsetType="UNSET",Is.UnspecifiedType="UNSPECIFIED",Is.WomanType="WOMAN",exports.GeinsGenderType=void 0,(Ns=exports.GeinsGenderType||(exports.GeinsGenderType={})).FemaleType="FEMALE",Ns.MaleType="MALE",Ns.UnknownType="UNKNOWN",exports.GeinsIncludeMode=void 0,(As=exports.GeinsIncludeMode||(exports.GeinsIncludeMode={})).IntersectType="INTERSECT",As.UnionType="UNION",exports.GeinsPaymentCheckout=void 0,(Cs=exports.GeinsPaymentCheckout||(exports.GeinsPaymentCheckout={})).ExternalType="EXTERNAL",Cs.GeinsPayType="GEINS_PAY",Cs.StandardType="STANDARD",exports.GeinsPaymentType=void 0,(Ds=exports.GeinsPaymentType||(exports.GeinsPaymentType={})).AvardaType="AVARDA",Ds.GeinsPayType="GEINS_PAY",Ds.KlarnaType="KLARNA",Ds.StandardType="STANDARD",Ds.SveaType="SVEA",Ds.WalleyType="WALLEY",exports.GeinsProductRelation=void 0,(Rs=exports.GeinsProductRelation||(exports.GeinsProductRelation={})).AccessoriesType="ACCESSORIES",Rs.RelatedType="RELATED",Rs.SimilarType="SIMILAR",exports.GeinsSortType=void 0,(Fs=exports.GeinsSortType||(exports.GeinsSortType={})).AlphabeticalType="ALPHABETICAL",Fs.AlphabeticalDescType="ALPHABETICAL_DESC",Fs.AvailableStockType="AVAILABLE_STOCK",Fs.AvailableStockDescType="AVAILABLE_STOCK_DESC",Fs.BrandType="BRAND",Fs.Custom_1Type="CUSTOM_1",Fs.Custom_2Type="CUSTOM_2",Fs.Custom_3Type="CUSTOM_3",Fs.Custom_4Type="CUSTOM_4",Fs.Custom_5Type="CUSTOM_5",Fs.FacetOrderType="FACET_ORDER",Fs.LatestType="LATEST",Fs.MostSoldType="MOST_SOLD",Fs.NoneType="NONE",Fs.PriceType="PRICE",Fs.PriceDescType="PRICE_DESC",Fs.RelevanceType="RELEVANCE",Fs.TotalStockType="TOTAL_STOCK",Fs.TotalStockDescType="TOTAL_STOCK_DESC",Fs.VotesType="VOTES",exports.DiscountType=void 0,(Ls=exports.DiscountType||(exports.DiscountType={}))[Ls.PERCENTAGE=0]="PERCENTAGE",Ls[Ls.FIXED_AMOUNT=1]="FIXED_AMOUNT",exports.Gender=void 0,(Ps=exports.Gender||(exports.Gender={})).UNSET="unset",Ps.UNSPECIFIED="unspecified",Ps.WOMAN="woman",Ps.MAN="man",exports.PaymentOptionCheckoutType=void 0,(Ms=exports.PaymentOptionCheckoutType||(exports.PaymentOptionCheckoutType={})).STANDARD="STANDARD",Ms.EXTERNAL="EXTERNAL",Ms.GEINS_PAY="GEINS_PAY";var Gs,Bs=function(){function e(e,t,n,r,i){var o=this;this.observer=e,this.operation=t,this.forward=n,this.delayFor=r,this.retryIf=i,this.retryCount=0,this.currentSubscription=null,this.onError=function(e){return c(o,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return this.retryCount+=1,[4,this.retryIf(this.retryCount,this.operation,e)];case 1:return t.sent()?(this.scheduleRetry(this.delayFor(this.retryCount,this.operation,e)),[2]):(this.observer.error(e),[2])}}))}))},this.try()}return e.prototype.cancel=function(){this.currentSubscription&&this.currentSubscription.unsubscribe(),clearTimeout(this.timerId),this.timerId=void 0,this.currentSubscription=null},e.prototype.try=function(){this.currentSubscription=this.forward(this.operation).subscribe({next:this.observer.next.bind(this.observer),error:this.onError,complete:this.observer.complete.bind(this.observer)})},e.prototype.scheduleRetry=function(e){var t=this;if(this.timerId)throw new Error("RetryLink BUG! Encountered overlapping retries");this.timerId=setTimeout((function(){t.timerId=void 0,t.try()}),e)},e}(),Ks=function(e){function t(t){var n=e.call(this)||this,r=t||{},i=r.attempts,o=r.delay;return n.delayFor="function"==typeof o?o:function(e){var t=e||{},n=t.initial,r=void 0===n?300:n,i=t.jitter,o=void 0===i||i,s=t.max,a=void 0===s?1/0:s,c=o?r:r/2;return function(e){var t=Math.min(a,c*Math.pow(2,e));return o&&(t=Math.random()*t),t}}(o),n.retryIf="function"==typeof i?i:function(e){var t=e||{},n=t.retryIf,r=t.max,i=void 0===r?5:r;return function(e,t,r){return!(e>=i)&&(n?n(r,t):!!r)}}(i),n}return o(t,e),t.prototype.request=function(e,t){var n=this;return new Ir((function(r){var i=new Bs(r,e,t,n.delayFor,n.retryIf);return function(){i.cancel()}}))},t}(Zr),zs={main:"https://merchantapi.geins.io/graphql",auth:"https://auth-service.geins.io/api/{ACCOUNT}_{ENV}",auth_sign:"https://merchantapi.geins.io/auth/sign/{API-KEY}?identity=",image:"https://{ACCOUNT}.commerce.services"},Ws="x-request-id",Hs="x-sdk-version",Ys="x-idempotency-key",Js=new Map([["geins-cart","{geins.cartid}"],["geins-pm","{geins.paymentMethodId}"],["geins-pt","{geins.paymentType}"],["geins-uid","{payment.uid}"]]);function $s(){return"object"==typeof globalThis&&!("window"in globalThis)}function Xs(e,t,n){return void 0===n&&(n="prod"),{main:zs.main,auth:zs.auth.replace("{ACCOUNT}",t).replace("{ENV}",n),authSign:zs.auth_sign.replace("{API-KEY}",e),image:zs.image.replace("{ACCOUNT}",t)}}exports.GeinsErrorCode=void 0,(Gs=exports.GeinsErrorCode||(exports.GeinsErrorCode={})).AUTH_FAILED="AUTH_FAILED",Gs.AUTH_TOKEN_EXPIRED="AUTH_TOKEN_EXPIRED",Gs.AUTH_TOKEN_REFRESH_FAILED="AUTH_TOKEN_REFRESH_FAILED",Gs.AUTH_NOT_AUTHENTICATED="AUTH_NOT_AUTHENTICATED",Gs.CART_NOT_FOUND="CART_NOT_FOUND",Gs.CART_ITEM_NOT_FOUND="CART_ITEM_NOT_FOUND",Gs.CART_OPERATION_FAILED="CART_OPERATION_FAILED",Gs.CHECKOUT_FAILED="CHECKOUT_FAILED",Gs.ORDER_FAILED="ORDER_FAILED",Gs.INVALID_ARGUMENT="INVALID_ARGUMENT",Gs.NOT_INITIALIZED="NOT_INITIALIZED",Gs.PARSE_ERROR="PARSE_ERROR",Gs.GRAPHQL_ERROR="GRAPHQL_ERROR",Gs.SERVICE_UNAVAILABLE="SERVICE_UNAVAILABLE",Gs.REQUEST_TIMEOUT="REQUEST_TIMEOUT",Gs.RATE_LIMITED="RATE_LIMITED",Gs.RETRY_EXHAUSTED="RETRY_EXHAUSTED",Gs.NETWORK_ERROR="NETWORK_ERROR";var Zs,ea=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.code=n,i.cause=r,i.name="GeinsError",i}return o(t,e),t}(Error);function ta(t,n){if(!t)throw new ea("Token is required.",exports.GeinsErrorCode.INVALID_ARGUMENT);var r=t.split(".");if(3!==r.length&&n||2!==r.length&&!n)throw new ea("Invalid JWT token format.",exports.GeinsErrorCode.PARSE_ERROR);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&&e.createHmac("sha256",n).update("".concat(i,".").concat(o)).digest("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")!==s)throw new ea("Invalid token signature.",exports.GeinsErrorCode.AUTH_FAILED);return{header:c,payload:u}}function na(t,n){if(!t||"object"!=typeof t)throw new ea("Payload must be a valid object.",exports.GeinsErrorCode.INVALID_ARGUMENT);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(t));if(!n)return"".concat(o,".").concat(s);var a=e.createHmac("sha256",n).update("".concat(o,".").concat(s)).digest("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");return"".concat(o,".").concat(s,".").concat(a)}var ra=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}(),ia="undefined"!=typeof process&&"test"===(null===(Zs=process.env)||void 0===Zs?void 0:Zs.NODE_ENV)?exports.GeinsLogLevel.NONE:exports.GeinsLogLevel.WARN,oa=new ra(ia),sa=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}();function aa(e){return p(this,arguments,(function(e,t){var n,r,i,o,s,a,c,l;return void 0===t&&(t={}),u(this,(function(u){switch(u.label){case 0:n=null!==(c=t.take)&&void 0!==c?c:20,r=null!==(l=t.startSkip)&&void 0!==l?l:0,u.label=1;case 1:return[4,h(e(r,n))];case 2:return i=u.sent(),o=i.items,s=i.count,a=r+o.length<s,[4,h({items:o,count:s,hasMore:a,skip:r,take:n})];case 3:return[4,u.sent()];case 4:return u.sent(),a&&0!==o.length?(r+=o.length,[3,1]):[3,5];case 5:return[2]}}))}))}function ca(){return new Zr((function(e,t){var n="undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),r=Date.now();return e.setContext((function(e){var t,i=e.headers;return{headers:s(s({},void 0===i?{}:i),(t={},t[Ws]=n,t[Hs]="0.5.0",t)),requestId:n,requestStartTime:r}})),t(e)}))}var ua=function(e){function t(t,n,r,i){var o=e.call(this,t,n,i)||this;return o.requestId=r,o.name="NetworkRequestError",o}return o(t,e),t}(ea),la=function(e){function t(t,n,r){var i=e.call(this,"Request ".concat(t," timed out after ").concat(n,"ms"),exports.GeinsErrorCode.REQUEST_TIMEOUT,t,r)||this;return i.timeoutMs=n,i.name="TimeoutError",i}return o(t,e),t}(ua),fa=function(e){function t(t,n,r){var i=e.call(this,"Request ".concat(t," rate limited").concat(n?" (retry after ".concat(n,"ms)"):""),exports.GeinsErrorCode.RATE_LIMITED,t,r)||this;return i.retryAfterMs=n,i.name="RateLimitError",i}return o(t,e),t}(ua),ha=function(e){function t(t,n,r){var i=e.call(this,"Request ".concat(t," failed after ").concat(n," attempts"),exports.GeinsErrorCode.RETRY_EXHAUSTED,t,r)||this;return i.attempts=n,i.name="RetryExhaustedError",i}return o(t,e),t}(ua);var pa,da,va=function(){function e(e){var t,n=this;this._totalRequests=0,this._successCount=0,this._errorCount=0,this._timeoutCount=0,this._retryCount=0,this._durations=[],this._timer=null,this._onMetrics=e.onMetrics;var r=null!==(t=e.flushIntervalMs)&&void 0!==t?t:6e4;this._onMetrics&&r>0&&(this._timer=setInterval((function(){return n.flush()}),r),"object"==typeof this._timer&&"unref"in this._timer&&this._timer.unref())}return e.prototype.recordSuccess=function(e){this._totalRequests++,this._successCount++,this._durations.push(e)},e.prototype.recordError=function(e,t){this._totalRequests++,this._errorCount++,t&&this._timeoutCount++,this._durations.push(e)},e.prototype.recordRetry=function(){this._retryCount++},e.prototype.snapshot=function(){var e=f([],this._durations,!0).sort((function(e,t){return e-t})),t=e.length>0?e.reduce((function(e,t){return e+t}),0)/e.length:0,n=Math.max(0,Math.ceil(.95*e.length)-1),r=e.length>0?e[n]:0;return{totalRequests:this._totalRequests,successCount:this._successCount,errorCount:this._errorCount,timeoutCount:this._timeoutCount,retryCount:this._retryCount,avgDurationMs:Math.round(t),p95DurationMs:r}},e.prototype.flush=function(){this._onMetrics&&this._onMetrics(this.snapshot())},e.prototype.reset=function(){this._totalRequests=0,this._successCount=0,this._errorCount=0,this._timeoutCount=0,this._retryCount=0,this._durations=[]},e.prototype.destroy=function(){this._timer&&(clearInterval(this._timer),this._timer=null)},e}();exports.FetchPolicyOptions=void 0,(pa=exports.FetchPolicyOptions||(exports.FetchPolicyOptions={})).CACHE_FIRST="cache-first",pa.NETWORK_ONLY="network-only",pa.CACHE_ONLY="cache-only",pa.NO_CACHE="no-cache",pa.STANDBY="standby",exports.OperationType=void 0,(da=exports.OperationType||(exports.OperationType={})).QUERY="query",da.MUTATION="mutation";var ya=function(){function e(e){this._telemetry=null,this.fetchPolicy=$s()?exports.FetchPolicyOptions.NO_CACHE:exports.FetchPolicyOptions.CACHE_FIRST,this.pollInterval=0;var t=e.apiUrl,n=e.apiKey,r=e.fetchPolicy,i=e.settings;this._apolloClient=this.createClient(t,n,i),r&&(this.fetchPolicy=r)}return e.prototype.createClient=function(e,t,n){var r=new qo({typePolicies:{CartType:{fields:{items:{merge:function(e,t){return t}},appliedCampaigns:{merge:function(e,t){return t}}}}}}),i=this.createLinkChain(e,t,n);return new rs({link:i,cache:r})},e.prototype.createLinkChain=function(e,t,n){var r,i,o=null==n?void 0:n.requestConfig,a=[];a.push(ca()),a.push(new Zr((function(e,t){var n=Zt(e.query);return"OperationDefinition"===n.kind&&"mutation"===n.operation&&e.setContext((function(e){var t,n=e.headers;return{headers:s(s({},void 0===n?{}:n),(t={},t[Ys]="undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),t))}})),t(e)})));var c,u=new ra(null!==(r=null==n?void 0:n.logLevel)&&void 0!==r?r:exports.GeinsLogLevel.NONE);a.push(function(e){return new Zr((function(t,n){var r=t.getContext(),i=r.requestId,o=r.requestStartTime,s=t.operationName||"unknown";return e.debug("[".concat(i,"] Starting ").concat(s)),new Ir((function(r){var a=n(t).subscribe({next:function(t){var n=Date.now()-(o||Date.now());e.debug("[".concat(i,"] ").concat(s," completed in ").concat(n,"ms")),r.next(t)},error:function(t){var n=Date.now()-(o||Date.now());e.error("[".concat(i,"] ").concat(s," failed after ").concat(n,"ms: ").concat(t.message)),r.error(t)},complete:function(){r.complete()}});return function(){return a.unsubscribe()}}))}))}(u)),(null==o?void 0:o.interceptors)&&a.push((c=o.interceptors,new Zr((function(e,t){return new Ir((function(n){var r=e.getContext(),i=r.requestId||"unknown",o=r.requestStartTime||Date.now(),a=e.operationName||"unknown",u=function(){var s=t(e).subscribe({next:function(e){if(c.onResponse){var t={requestId:i,operationName:a,durationMs:Date.now()-o,data:e.data};try{c.onResponse(t)}catch(e){}}n.next(e)},error:function(e){if(c.onError){var t={requestId:i,operationName:a,durationMs:Date.now()-o,error:e,retryCount:r.retryCount||0};try{c.onError(t)}catch(e){}}n.error(e)},complete:function(){n.complete()}});return s};if(c.onRequest){var l,f=s({},r.headers||{}),h={requestId:i,operationName:a,headers:f,timestamp:o};try{var p=c.onRequest(h);p&&"function"==typeof p.then?p.then((function(){e.setContext((function(){return s(s({},r),{headers:h.headers})})),l=u()})).catch((function(e){n.error(e)})):(e.setContext((function(){return s(s({},r),{headers:h.headers})})),l=u())}catch(e){return void n.error(e)}return function(){null==l||l.unsubscribe()}}var d=u();return function(){return d.unsubscribe()}}))}))));var l,f=null!==(i=null==o?void 0:o.timeoutMs)&&void 0!==i?i:0;f>0&&a.push(function(e){return new Zr((function(t,n){return e<=0?n(t):new Ir((function(r){var i=!1,o=setTimeout((function(){if(!i){i=!0;var n=t.getContext().requestId;r.error(new la(n||"unknown",e))}}),e),s=n(t).subscribe({next:function(e){i||r.next(e)},error:function(e){i||(i=!0,clearTimeout(o),r.error(e))},complete:function(){i||(i=!0,clearTimeout(o),r.complete())}});return function(){i=!0,clearTimeout(o),s.unsubscribe()}}))}))}(f)),(null==o?void 0:o.telemetry)&&(this._telemetry=new va(o.telemetry),a.push((l=this._telemetry,new Zr((function(e,t){return new Ir((function(n){var r=e.getContext().requestStartTime||Date.now(),i=t(e).subscribe({next:function(e){l.recordSuccess(Date.now()-r),n.next(e)},error:function(e){var t="TimeoutError"===(null==e?void 0:e.name);l.recordError(Date.now()-r,t),n.error(e)},complete:function(){n.complete()}});return function(){return i.unsubscribe()}}))}))))),(null==o?void 0:o.retry)&&a.push(this.createRetryLink(o.retry));var h=vi({uri:e,headers:{Accept:"application/json","x-apikey":t}});return a.push(h),Zr.from(a)},e.prototype.createRetryLink=function(e){var t=e.maxRetries,n=void 0===t?3:t,r=e.initialDelayMs,i=void 0===r?300:r,o=e.maxDelayMs,s=void 0===o?1e4:o,a=e.jitter;return new Ks({delay:{initial:i,max:s,jitter:void 0===a||a},attempts:{max:n+1,retryIf:function(e){var t;if(!e)return!1;var n=e,r=n.response,i=null!==(t=n.statusCode)&&void 0!==t?t:null==r?void 0:r.status;return 429===i||(!i||i>=500)}}})},e.prototype.getClient=function(){return this._apolloClient},Object.defineProperty(e.prototype,"telemetry",{get:function(){return this._telemetry},enumerable:!1,configurable:!0}),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.buildContext=function(e){if(e)return{headers:{Authorization:"Bearer ".concat(e)}}},e.prototype.runQuery=function(e){return c(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return u(this,(function(c){return t=e.query,n=e.queryAsString,r=e.variables,i=e.requestOptions,o=e.userToken,s=t||fs(n||""),a=i||{},[2,this._apolloClient.query({query:s,variables:r,fetchPolicy:this.getFetchPolicy(exports.OperationType.QUERY,a.fetchPolicy),pollInterval:a.pollInterval||this.pollInterval,context:this.buildContext(o)})]}))}))},e.prototype.runMutation=function(e){return c(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return u(this,(function(c){return t=e.query,n=e.queryAsString,r=e.variables,i=e.requestOptions,o=e.userToken,s=t||fs(n||""),a=i||{},[2,this._apolloClient.mutate({mutation:s,variables:r,fetchPolicy:this.getFetchPolicy(exports.OperationType.MUTATION,a.fetchPolicy),context:this.buildContext(o)})]}))}))},e}(),ma=function(){function e(e){this.baseUrl="https://mgmtapi.geins.io",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}(),ga=function(){function e(e,t){if(this._apiClient=e,!t.channel)throw new ea("Channel is required",exports.GeinsErrorCode.INVALID_ARGUMENT);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 ea("Language is required",exports.GeinsErrorCode.INVALID_ARGUMENT);t.languageId=this._geinsSettings.locale}if(!t.marketId){if(!this._geinsSettings.market)throw new ea("Market is required",exports.GeinsErrorCode.INVALID_ARGUMENT);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 ea("Merchant API Client is not set",exports.GeinsErrorCode.NOT_INITIALIZED);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[4,this.runQuery(e)];case 1:return t=r.sent(),n=this.cleanObject(t),[2,this.parseResult(n)]}}))}))},e.prototype.runMutation=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){if(!this._apiClient)throw new ea("Merchant API Client is not set",exports.GeinsErrorCode.NOT_INITIALIZED);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}(),ba=function(){function e(e){if(this.core=e,!e)throw new ea("Core is required",exports.GeinsErrorCode.NOT_INITIALIZED);if(!e.client)throw new ea("Merchant API Client is not set",exports.GeinsErrorCode.NOT_INITIALIZED);if(!e.geinsSettings)throw new ea("Settings are required",exports.GeinsErrorCode.NOT_INITIALIZED);var t=e.geinsSettings;this._geinsSettings=t,this._apiClient=function(){return e.client}}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=function(e){function t(t,n,r){void 0===n&&(n=exports.GeinsErrorCode.AUTH_FAILED);var i=e.call(this,t,n,r)||this;return i.name="AuthError",i}return o(t,e),t}(ea),Ta=function(e){function t(t,n){void 0===t&&(t="Token has expired");var r=e.call(this,t,exports.GeinsErrorCode.AUTH_TOKEN_EXPIRED,n)||this;return r.name="TokenExpiredError",r}return o(t,e),t}(Ea),_a=function(e){function t(t,n){void 0===t&&(t="Token refresh failed");var r=e.call(this,t,exports.GeinsErrorCode.AUTH_TOKEN_REFRESH_FAILED,n)||this;return r.name="TokenRefreshError",r}return o(t,e),t}(Ea),Sa=function(e){function t(t,n,r){void 0===n&&(n=exports.GeinsErrorCode.CART_OPERATION_FAILED);var i=e.call(this,t,n,r)||this;return i.name="CartError",i}return o(t,e),t}(ea),Oa=function(e){function t(t,n,r){void 0===n&&(n=exports.GeinsErrorCode.CHECKOUT_FAILED);var i=e.call(this,t,n,r)||this;return i.name="CheckoutError",i}return o(t,e),t}(ea),ka=function(e){function t(t,n,r){void 0===n&&(n=exports.GeinsErrorCode.ORDER_FAILED);var i=e.call(this,t,n,r)||this;return i.name="OrderError",i}return o(t,e),t}(ea),wa={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 xa(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){xa(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){xa(e,t)})),e.definitions&&e.definitions.forEach((function(e){xa(e,t)}))}wa.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 Ia={};function Na(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}}wa.definitions.forEach((function(e){if(e.name){var t=new Set;xa(e,t),Ia[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[Na(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=Ia[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),(Ia[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=Na(e,t);r&&n.definitions.push(r)}))}(wa,"ChannelFields");var Aa={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 Ca(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){Ca(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){Ca(e,t)})),e.definitions&&e.definitions.forEach((function(e){Ca(e,t)}))}Aa.loc.source={body:"fragment LanguageFields on LanguageType {\n id\n name\n code\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var Da={};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}}Aa.definitions.forEach((function(e){if(e.name){var t=new Set;Ca(e,t),Da[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=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=Ra(e,t);r&&n.definitions.push(r)}))}(Aa,"LanguageFields");var Fa={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 La(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){La(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){La(e,t)})),e.definitions&&e.definitions.forEach((function(e){La(e,t)}))}Fa.loc.source={body:"fragment CurrencyFields on CurrencyType {\n code\n symbol\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var Pa={};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}}Fa.definitions.forEach((function(e){if(e.name){var t=new Set;La(e,t),Pa[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=Pa[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),(Pa[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=Ma(e,t);r&&n.definitions.push(r)}))}(Fa,"CurrencyFields");var qa={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 ja(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){ja(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){ja(e,t)})),e.definitions&&e.definitions.forEach((function(e){ja(e,t)}))}qa.loc.source={body:"fragment CountryFields on CountryType {\n name\n code\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var Va={};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}}qa.definitions.forEach((function(e){if(e.name){var t=new Set;ja(e,t),Va[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=Va[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),(Va[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=Ua(e,t);r&&n.definitions.push(r)}))}(qa,"CountryFields");var Qa={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}};Qa.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 Ga={};function Ba(e){return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!Ga[t]&&(Ga[t]=!0,!0)}))}function Ka(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){Ka(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){Ka(e,t)})),e.definitions&&e.definitions.forEach((function(e){Ka(e,t)}))}Qa.definitions=Qa.definitions.concat(Ba(Fa.definitions)),Qa.definitions=Qa.definitions.concat(Ba(qa.definitions)),Qa.definitions=Qa.definitions.concat(Ba(Aa.definitions));var za={};function Wa(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}}Qa.definitions.forEach((function(e){if(e.name){var t=new Set;Ka(e,t),za[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[Wa(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=za[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),(za[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=Wa(e,t);r&&n.definitions.push(r)}))}(Qa,"MarketFields");var Ha={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}};Ha.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 Ya={};function Ja(e){return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!Ya[t]&&(Ya[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)}))}Ha.definitions=Ha.definitions.concat(Ja(wa.definitions)),Ha.definitions=Ha.definitions.concat(Ja(Aa.definitions)),Ha.definitions=Ha.definitions.concat(Ja(Qa.definitions)),Ha.definitions=Ha.definitions.concat(Ja(Fa.definitions));var Xa={};function Za(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;$a(e,t),Xa[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[Za(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=Xa[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),(Xa[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=Za(e,t);r&&n.definitions.push(r)}))}(Ha,"getChannel");var ec={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}};ec.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 tc={};function nc(e){return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!tc[t]&&(tc[t]=!0,!0)}))}function rc(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){rc(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){rc(e,t)})),e.definitions&&e.definitions.forEach((function(e){rc(e,t)}))}ec.definitions=ec.definitions.concat(nc(wa.definitions)),ec.definitions=ec.definitions.concat(nc(Aa.definitions)),ec.definitions=ec.definitions.concat(nc(Qa.definitions)),ec.definitions=ec.definitions.concat(nc(Fa.definitions));var ic={};function oc(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}}ec.definitions.forEach((function(e){if(e.name){var t=new Set;rc(e,t),ic[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[oc(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=ic[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),(ic[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=oc(e,t);r&&n.definitions.push(r)}))}(ec,"getChannels");var sc={channels:ec,channel:Ha};function ac(e){if(!e||!e.id)throw new ea("Invalid result structure for channel",exports.GeinsErrorCode.PARSE_ERROR);return{id:e.id,name:e.name,type:e.type,url:e.url,defaultMarketId:e.defaultMarketId,defaultLanguageId:e.defaultLanguageId,markets:e.markets?e.markets.filter((function(e){return null!=e})).map((function(e){return{id:(t=e).id,alias:t.alias,allowedLanguages:t.allowedLanguages?t.allowedLanguages.filter((function(e){return null!=e})).map((function(e){return uc(e)})):[],country:t.country?cc(t.country):{name:"",code:""},currency:t.currency?lc(t.currency):{code:"",symbol:"",name:"",rate:0},onlyDisplayInCheckout:t.onlyDisplayInCheckout,virtual:t.virtual,groupKey:t.groupKey,defaultLanguageId:t.defaultLanguageId};var t})):[],languages:e.languages?e.languages.filter((function(e){return null!=e})).map((function(e){return uc(e)})):[]}}function cc(e){return{name:e.name,code:e.code}}function uc(e){return{id:e.id,name:e.name,code:e.code}}function lc(e){return{code:e.code,symbol:e.symbol,name:e.name,rate:e.rate}}var fc,hc=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.cache=new sa(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:sc.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 ea("Invalid result structure for channel",exports.GeinsErrorCode.PARSE_ERROR);var t=e.data.channel;if(t)return ac(t);oa.warn("No channel found")}(e)},t}(ga),pc=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.cache=new sa(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:sc.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 ea("Invalid result structure for channels",exports.GeinsErrorCode.PARSE_ERROR);var t=e.data.channels;if(t&&0!==t.length)return t.map((function(e){return ac(e)})).filter((function(e){return void 0!==e}));oa.warn("No channel found")}(e)},t}(ga),dc=function(){function e(e){this.path="/",this.domain="",this.secure=!0,this.httpOnly=!0,this.sameSite="lax",this.cookie=t(),this.maxAge=0,e&&(e.path&&(this.path=e.path),e.domain&&(this.domain=e.domain),void 0!==e.secure&&(this.secure=e.secure),void 0!==e.httpOnly&&(this.httpOnly=e.httpOnly),void 0!==e.sameSite&&(this.sameSite=e.sameSite),void 0!==e.maxAge&&(this.maxAge=this.parseMaxAge(e.maxAge)))}return e.prototype.getConfig=function(){return{path:this.path,domain:this.domain,secure:this.secure,httpOnly:this.httpOnly,sameSite:this.sameSite,maxAge:this.maxAge}},e.prototype.parseMaxAge=function(e){if("string"==typeof e){var t=parseInt(e,10);return isNaN(t)?0:t}return e},e.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}},e.prototype.getAll=function(){return this.cookie.getAll()},e.prototype.get=function(e){return this.cookie.get(e)||""},e.prototype.remove=function(e){this.cookie.remove(e)},e.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)},e}(),vc=function(){function e(e){this._cookieService=null!=e?e:new dc}return e.prototype.get=function(e){return this._cookieService.get(e)||void 0},e.prototype.set=function(e,t,n){this._cookieService.set({name:e,payload:t,maxAge:null==n?void 0:n.maxAge})},e.prototype.remove=function(e){this._cookieService.remove(e)},e}(),yc={exports:{}};var mc,gc=(fc||(fc=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}(yc)),yc.exports),bc=eo(gc),Ec=function(){function e(){this.eventName="geins-event",this.emitter=new bc,this.broadcastChannelId="geins-channel",$s()||(this.broadcast=new n.BroadcastChannel(this.broadcastChannelId),this.addBroadcastListener())}return e.prototype.addBroadcastListener=function(){var e=this;this.broadcast&&(this.broadcast.onmessage=function(t){var n=t;e.emitter.emit(n.eventName,n.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}(),Tc=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,o=s({},e);if(!e.query&&!e.queryAsString)throw new ea("Query or queryAsString is required",exports.GeinsErrorCode.INVALID_ARGUMENT);try{e.queryAsString&&!e.query&&(o.query=fs(e.queryAsString))}catch(e){throw new ea("Error parsing string to query",exports.GeinsErrorCode.PARSE_ERROR,e)}var a=o.query,c=a.definitions[0];if(!(c&&"OperationDefinition"===c.kind&&(null!==(n=null===(t=c.variableDefinitions)||void 0===t?void 0:t.length)&&void 0!==n?n:0)>0))return o;o.variables=this.createVariables(null!==(r=o.variables)&&void 0!==r?r:{});var u=(null===(i=a.definitions[0].variableDefinitions)||void 0===i?void 0:i.map((function(e){return e.variable.name.value})))||[];return Object.keys(o.variables).forEach((function(e){u.includes(e)||delete o.variables[e]})),o},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&&oa.debug("[Geins] queryOptions: ".concat(JSON.stringify(t))),[4,this.runQuery(t)];case 2:return n=i.sent(),r=this.cleanObject(n),[2,this.parseResult(r)]}}))}))},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&&oa.debug("[Geins] mutation options: ".concat(JSON.stringify(e))),[4,this.runMutation(e)];case 1:return t=n.sent(),[2,this.parseResult(t)]}}))}))},t.prototype.parseResult=function(e){var t=e;if(null==t?void 0:t.data)return t.data;if(null==t?void 0:t.errors)throw new ea("GraphQL errors",exports.GeinsErrorCode.GRAPHQL_ERROR,t.errors);return null},t}(ga),_c=function(){function e(){this._store=new Map}return e.prototype.get=function(e){return this._store.get(e)},e.prototype.set=function(e,t,n){this._store.set(e,t)},e.prototype.remove=function(e){this._store.delete(e)},e.prototype.clear=function(){this._store.clear()},e}();!function(e){e[e.INIT=0]="INIT",e[e.FETCHING=1]="FETCHING",e[e.READY=2]="READY",e[e.ERROR=3]="ERROR"}(mc||(mc={}));var Sc=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}(),Oc=function(){function e(e){if(this.geinsSettings=e,!e.channel)throw new ea("Channel is required",exports.GeinsErrorCode.INVALID_ARGUMENT);if(!e.apiKey)throw new ea("API Key is required",exports.GeinsErrorCode.INVALID_ARGUMENT);this.store=new Sc,this.channelId="".concat(e.channel,"|").concat(e.tld),this.cache=new sa(36e5),this.initApiClient()}return e.prototype.initApiClient=function(){if(!this.geinsSettings.apiKey||!this.geinsSettings.accountName)throw new ea("API Key and Account Name are required",exports.GeinsErrorCode.INVALID_ARGUMENT);var e={apiUrl:Xs(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 ya(e)}},e.prototype.initChannelService=function(){var e=this;this.channelService=new hc((function(){return e._apiClient()}),this.geinsSettings)},e.prototype.setKey=function(e,t){if(!this.store)throw new ea("Store is not initialized",exports.GeinsErrorCode.NOT_INITIALIZED);this.store.setKey(e,t)},e.prototype.getKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){if(!this.store)throw new ea("Store is not initialized",exports.GeinsErrorCode.NOT_INITIALIZED);return[2,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}(),kc=function(){function e(e){if(!e.channel)throw new ea("Channel is required",exports.GeinsErrorCode.INVALID_ARGUMENT);if(!e.apiKey)throw new ea("API Key is required",exports.GeinsErrorCode.INVALID_ARGUMENT);if(!e.accountName)throw new ea("Account name is required",exports.GeinsErrorCode.INVALID_ARGUMENT);this._geinsSettings=s(s({},{environment:"prod"}),e),this._geinsSettings.apiKey&&this._geinsSettings.accountName&&(this._endpointsUrls=Xs(this._geinsSettings.apiKey,this._geinsSettings.accountName,this._geinsSettings.environment)),$s()||(this._cookieService=new dc),this._currentChannel=new Oc(this._geinsSettings),this._eventService=new Ec}return e.prototype.initApiClient=function(){if(!this._geinsSettings.apiKey||!this._geinsSettings.accountName)throw new ea("Failed to initialize API Client",exports.GeinsErrorCode.NOT_INITIALIZED);var e={apiUrl:this._endpointsUrls.main,apiKey:this._geinsSettings.apiKey,settings:this._geinsSettings};this._apiClient=new ya(e)},e.prototype.initGraphQLService=function(){var e=this;this._graphQLService=new Tc((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 Oc(this._geinsSettings)),!this._currentChannel)throw new ea("Failed to initialize channel",exports.GeinsErrorCode.NOT_INITIALIZED);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 pc((function(){return t.client}),this._geinsSettings)),[2,null!==(e=this._accountChannels.get())&&void 0!==e?e:void 0]}))}))},Object.defineProperty(e.prototype,"endpoints",{get:function(){if(!this._endpointsUrls)throw new ea("Endpoints are not set",exports.GeinsErrorCode.NOT_INITIALIZED);return this._endpointsUrls},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"client",{get:function(){if(!this._endpointsUrls)throw new ea("Endpoints are not set",exports.GeinsErrorCode.NOT_INITIALIZED);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 dc),this._cookieService},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"telemetry",{get:function(){var e,t;return null!==(t=null===(e=this._apiClient)||void 0===e?void 0:e.telemetry)&&void 0!==t?t:null},enumerable:!1,configurable:!0}),e.encodeJWT=function(e,t){return na(e,t)},e.decodeJWT=function(e,t){return ta(e,t).payload},e}();exports.AUTH_HEADERS={REFRESH_TOKEN:"x-auth-refresh-token"},exports.AUTH_STORAGE_KEYS={USER:"geins-user",USER_AUTH:"geins-auth",USER_TYPE:"geins-user-type",USER_MAX_AGE:"geins-user-maxage",REFRESH_TOKEN:"geins-auth-refresh-token"},exports.AUTH_STORAGE_MAX_AGE={DEFAULT:1800,REMEMBER_USER:604800},exports.AuthError=Ea,exports.BaseApiService=ga,exports.BasePackage=ba,exports.CART_STORAGE_KEYS={CART_ID:"geins-cart-id"},exports.CART_STORAGE_MAX_AGE={DEFAULT:604800},exports.CHECKOUT_PARAMETERS=Js,exports.CartError=Sa,exports.Channel=Oc,exports.CheckoutError=Oa,exports.CookieService=dc,exports.CookieStorageAdapter=vc,exports.EventService=Ec,exports.GeinsCore=kc,exports.GeinsError=ea,exports.GraphQLService=Tc,exports.Logger=ra,exports.ManagementApiClient=ma,exports.MemoryStorage=_c,exports.MerchantApiClient=ya,exports.NetworkRequestError=ua,exports.OrderError=ka,exports.RateLimitError=fa,exports.RetryExhaustedError=ha,exports.TelemetryCollector=va,exports.TimeoutError=la,exports.TokenExpiredError=Ta,exports.TokenRefreshError=_a,exports.buildEndpoints=Xs,exports.decodeJWT=ta,exports.encodeJWT=na,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){var i=t;if(n in i){if(void 0===r)return i;if(i[n]===r)return i}for(var o=0,s=Object.keys(i);o<s.length;o++){var a=e(i[s[o]],n,r);if(a)return a}}},exports.gql=fs,exports.isServerContext=$s,exports.paginate=aa,exports.paginateAll=function(e){return c(this,arguments,void 0,(function(e,t){var n,r,i,o,s,a,c,l,f,h;return void 0===t&&(t={}),u(this,(function(u){switch(u.label){case 0:n=[],u.label=1;case 1:u.trys.push([1,6,7,12]),r=!0,i=d(aa(e,t)),u.label=2;case 2:return[4,i.next()];case 3:if(o=u.sent(),c=o.done)return[3,5];h=o.value,r=!1,s=h,n.push.apply(n,s.items),u.label=4;case 4:return r=!0,[3,2];case 5:return[3,12];case 6:return a=u.sent(),l={error:a},[3,12];case 7:return u.trys.push([7,,10,11]),r||c||!(f=i.return)?[3,9]:[4,f.call(i)];case 8:u.sent(),u.label=9;case 9:return[3,11];case 10:if(l)throw l.error;return[7];case 11:return[7];case 12:return[2,n]}}))}))},exports.parseErrorMessage=function(e){return e&&e.message?e.message:""},exports.sdkLogger=oa;
1
+ "use strict";var e=require("crypto"),t=require("cookie-universal"),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){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(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 h(e){return this instanceof h?(this.v=e,this):new h(e)}function p(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",(function(e){return function(t){return Promise.resolve(t).then(e,u)}})),r[Symbol.asyncIterator]=function(){return this},r;function s(e,t){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||a(e,t)}))},t&&(r[e]=t(r[e])))}function a(e,t){try{(n=i[e](t)).value instanceof h?Promise.resolve(n.value.v).then(c,u):l(o[0][2],n)}catch(e){l(o[0][3],e)}var n}function c(e){a("next",e)}function u(e){a("throw",e)}function l(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function d(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=l(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}"function"==typeof SuppressedError&&SuppressedError;var v="Invariant Violation",y=Object.setPrototypeOf,m=void 0===y?function(e,t){return e.__proto__=t,e}:y,g=function(e){function t(n){void 0===n&&(n=v);var r=e.call(this,"number"==typeof n?v+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=v,m(r,t.prototype),r}return o(t,e),t}(Error);function b(e,t){if(!e)throw new g(t)}var E=["debug","log","warn","error","silent"],T=E.indexOf("log");function _(e){return function(){if(E.indexOf(e)>=T)return(console[e]||console.log).apply(console,arguments)}}!function(e){e.debug=_("debug"),e.log=_("log"),e.warn=_("warn"),e.error=_("error")}(b);var S="3.11.8";function O(e){try{return e()}catch(e){}}var k=O((function(){return globalThis}))||O((function(){return window}))||O((function(){return self}))||O((function(){return global}))||O((function(){return O.constructor("return this")()})),w=new Map;function x(e){var t=w.get(e)||1;return w.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function I(e,t){void 0===t&&(t=0);var n=x("stringifyForDisplay");return JSON.stringify(e,(function(e,t){return void 0===t?n:t}),t).split(JSON.stringify(n)).join("<undefined>")}function N(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=F(i))||(t=L(i,n),n=[])}e.apply(void 0,[t].concat(n))}}var A=Object.assign((function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];e||b(e,F(t,n)||L(t,n))}),{debug:N(b.debug),log:N(b.log),warn:N(b.warn),error:N(b.error)});function C(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return new g(F(e,t)||L(e,t))}var D=Symbol.for("ApolloErrorMessageHandler_"+S);function R(e){if("string"==typeof e)return e;try{return I(e,2).slice(0,1e3)}catch(e){return"<non-serializable>"}}function F(e,t){if(void 0===t&&(t=[]),e)return k[D]&&k[D](e,t.map(R))}function L(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:S,message:e,args:t.map(R)})))}function P(e,t){if(!Boolean(e))throw new Error(t)}function M(e,t){if(!Boolean(e))throw new Error("Unexpected invariant triggered.")}const q=/\r\n|[\n\r]/g;function j(e,t){let n=0,r=1;for(const i of e.body.matchAll(q)){if("number"==typeof i.index||M(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function U(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+V([[`${s} |`,n[0]],...n.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return u+V([[s-1+" |",l[i-1]],[`${s} |`,f],["|","^".padStart(c)],[`${s+1} |`,l[i+1]]])}function V(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 Q 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=G(Array.isArray(o)?o:o?[o]:void 0);const f=G(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=>j(s,e))):null==f?void 0:f.map((e=>j(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,Q):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"+U((t=n.loc).source,j(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+U(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 G(e){return void 0===e||0===e.length?void 0:e}function B(e,t,n){return new Q(`Syntax Error: ${n}`,{source:e,positions:[t]})}class K{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 z{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 W={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"]},H=new Set(Object.keys(W));function Y(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&H.has(t)}var J,$,X,Z;function ee(e){return 9===e||32===e}function te(e){return e>=48&&e<=57}function ne(e){return e>=97&&e<=122||e>=65&&e<=90}function re(e){return ne(e)||95===e}function ie(e){return ne(e)||te(e)||95===e}function oe(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=se(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 se(e){let t=0;for(;t<e.length&&ee(e.charCodeAt(t));)++t;return t}!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(J||(J={})),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"}($||($={})),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"}(X||(X={})),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"}(Z||(Z={}));class ae{constructor(e){const t=new z(Z.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!==Z.EOF)do{if(e.next)e=e.next;else{const t=de(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===Z.COMMENT);return e}}function ce(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function ue(e,t){return le(e.charCodeAt(t))&&fe(e.charCodeAt(t+1))}function le(e){return e>=55296&&e<=56319}function fe(e){return e>=56320&&e<=57343}function he(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return Z.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function pe(e,t,n,r,i){const o=e.line,s=1+n-e.lineStart;return new z(t,n,r,o,s,i)}function de(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 ve(e,i);case 33:return pe(e,Z.BANG,i,i+1);case 36:return pe(e,Z.DOLLAR,i,i+1);case 38:return pe(e,Z.AMP,i,i+1);case 40:return pe(e,Z.PAREN_L,i,i+1);case 41:return pe(e,Z.PAREN_R,i,i+1);case 46:if(46===n.charCodeAt(i+1)&&46===n.charCodeAt(i+2))return pe(e,Z.SPREAD,i,i+3);break;case 58:return pe(e,Z.COLON,i,i+1);case 61:return pe(e,Z.EQUALS,i,i+1);case 64:return pe(e,Z.AT,i,i+1);case 91:return pe(e,Z.BRACKET_L,i,i+1);case 93:return pe(e,Z.BRACKET_R,i,i+1);case 123:return pe(e,Z.BRACE_L,i,i+1);case 124:return pe(e,Z.PIPE,i,i+1);case 125:return pe(e,Z.BRACE_R,i,i+1);case 34:return 34===n.charCodeAt(i+1)&&34===n.charCodeAt(i+2)?Oe(e,i):ge(e,i)}if(te(t)||45===t)return ye(e,i,t);if(re(t))return ke(e,i);throw B(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":ce(t)||ue(n,i)?`Unexpected character: ${he(e,i)}.`:`Invalid character: ${he(e,i)}.`)}return pe(e,Z.EOF,r,r)}function ve(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(ce(e))++i;else{if(!ue(n,i))break;i+=2}}return pe(e,Z.COMMENT,t,i,n.slice(t+1,i))}function ye(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),te(o))throw B(e.source,i,`Invalid number, unexpected digit after 0: ${he(e,i)}.`)}else i=me(e,i,o),o=r.charCodeAt(i);if(46===o&&(s=!0,o=r.charCodeAt(++i),i=me(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=me(e,i,o),o=r.charCodeAt(i)),46===o||re(o))throw B(e.source,i,`Invalid number, expected digit but got: ${he(e,i)}.`);return pe(e,s?Z.FLOAT:Z.INT,t,i,r.slice(t,i))}function me(e,t,n){if(!te(n))throw B(e.source,t,`Invalid number, expected digit but got: ${he(e,t)}.`);const r=e.source.body;let i=t+1;for(;te(r.charCodeAt(i));)++i;return i}function ge(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),pe(e,Z.STRING,t,i+1,s);if(92!==r){if(10===r||13===r)break;if(ce(r))++i;else{if(!ue(n,i))throw B(e.source,i,`Invalid character within String: ${he(e,i)}.`);i+=2}}else{s+=n.slice(o,i);const t=117===n.charCodeAt(i+1)?123===n.charCodeAt(i+2)?be(e,i):Ee(e,i):Se(e,i);s+=t.value,i+=t.size,o=i}}throw B(e.source,i,"Unterminated string.")}function be(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||!ce(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|_e(e),r<0)break}throw B(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function Ee(e,t){const n=e.source.body,r=Te(n,t+2);if(ce(r))return{value:String.fromCodePoint(r),size:6};if(le(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=Te(n,t+8);if(fe(e))return{value:String.fromCodePoint(r,e),size:12}}throw B(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function Te(e,t){return _e(e.charCodeAt(t))<<12|_e(e.charCodeAt(t+1))<<8|_e(e.charCodeAt(t+2))<<4|_e(e.charCodeAt(t+3))}function _e(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Se(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 B(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Oe(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=pe(e,Z.BLOCK_STRING,t,o+3,oe(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(ce(r))++o;else{if(!ue(n,o))throw B(e.source,o,`Invalid character within String: ${he(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 B(e.source,o,"Unterminated string.")}function ke(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){if(!ie(n.charCodeAt(i)))break;++i}return pe(e,Z.NAME,t,i,n.slice(t,i))}function we(e){return xe(e,[])}function xe(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:xe(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(xe(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+": "+xe(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const Ie=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=we(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 Ne{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||P(!1,`Body must be a string. Received: ${we(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||P(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||P(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}class Ae{constructor(e,t={}){const n=function(e){return Ie(e,Ne)}(e)?e:new Ne(e);this._lexer=new ae(n),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(Z.NAME);return this.node(e,{kind:X.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:X.DOCUMENT,definitions:this.many(Z.SOF,this.parseDefinition,Z.EOF)})}parseDefinition(){if(this.peek(Z.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===Z.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 B(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(Z.BRACE_L))return this.node(e,{kind:X.OPERATION_DEFINITION,operation:J.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(Z.NAME)&&(n=this.parseName()),this.node(e,{kind:X.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(Z.NAME);switch(e.value){case"query":return J.QUERY;case"mutation":return J.MUTATION;case"subscription":return J.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(Z.PAREN_L,this.parseVariableDefinition,Z.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:X.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(Z.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Z.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(Z.DOLLAR),this.node(e,{kind:X.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:X.SELECTION_SET,selections:this.many(Z.BRACE_L,this.parseSelection,Z.BRACE_R)})}parseSelection(){return this.peek(Z.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(Z.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:X.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Z.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Z.PAREN_L,t,Z.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(Z.COLON),this.node(t,{kind:X.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(Z.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(Z.NAME)?this.node(e,{kind:X.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:X.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:X.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:X.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 Z.BRACKET_L:return this.parseList(e);case Z.BRACE_L:return this.parseObject(e);case Z.INT:return this.advanceLexer(),this.node(t,{kind:X.INT,value:t.value});case Z.FLOAT:return this.advanceLexer(),this.node(t,{kind:X.FLOAT,value:t.value});case Z.STRING:case Z.BLOCK_STRING:return this.parseStringLiteral();case Z.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:X.BOOLEAN,value:!0});case"false":return this.node(t,{kind:X.BOOLEAN,value:!1});case"null":return this.node(t,{kind:X.NULL});default:return this.node(t,{kind:X.ENUM,value:t.value})}case Z.DOLLAR:if(e){if(this.expectToken(Z.DOLLAR),this._lexer.token.kind===Z.NAME){const e=this._lexer.token.value;throw B(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:X.STRING,value:e.value,block:e.kind===Z.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:X.LIST,values:this.any(Z.BRACKET_L,(()=>this.parseValueLiteral(e)),Z.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:X.OBJECT,fields:this.any(Z.BRACE_L,(()=>this.parseObjectField(e)),Z.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(Z.COLON),this.node(t,{kind:X.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(Z.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(Z.AT),this.node(t,{kind:X.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(Z.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(Z.BRACKET_R),t=this.node(e,{kind:X.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(Z.BANG)?this.node(e,{kind:X.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:X.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(Z.STRING)||this.peek(Z.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(Z.BRACE_L,this.parseOperationTypeDefinition,Z.BRACE_R);return this.node(e,{kind:X.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(Z.COLON);const n=this.parseNamedType();return this.node(e,{kind:X.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:X.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:X.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(Z.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(Z.BRACE_L,this.parseFieldDefinition,Z.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(Z.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:X.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(Z.PAREN_L,this.parseInputValueDef,Z.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(Z.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(Z.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:X.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:X.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:X.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(Z.EQUALS)?this.delimitedMany(Z.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:X.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(Z.BRACE_L,this.parseEnumValueDefinition,Z.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:X.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 B(this._lexer.source,this._lexer.token.start,`${Ce(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:X.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(Z.BRACE_L,this.parseInputValueDef,Z.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===Z.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(Z.BRACE_L,this.parseOperationTypeDefinition,Z.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:X.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:X.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:X.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:X.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:X.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:X.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:X.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Z.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:X.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(Z.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call($,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new K(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 B(this._lexer.source,t.start,`Expected ${De(e)}, found ${Ce(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==Z.NAME||t.value!==e)throw B(this._lexer.source,t.start,`Expected "${e}", found ${Ce(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===Z.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return B(this._lexer.source,t.start,`Unexpected ${Ce(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!==Z.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw B(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function Ce(e){const t=e.value;return De(e.kind)+(null!=t?` "${t}"`:"")}function De(e){return function(e){return e===Z.BANG||e===Z.DOLLAR||e===Z.AMP||e===Z.PAREN_L||e===Z.PAREN_R||e===Z.SPREAD||e===Z.COLON||e===Z.EQUALS||e===Z.AT||e===Z.BRACKET_L||e===Z.BRACKET_R||e===Z.BRACE_L||e===Z.PIPE||e===Z.BRACE_R}(e)?`"${e}"`:e}const Re=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Fe(e){return Le[e.charCodeAt(0)]}const Le=["\\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"],Pe=Object.freeze({});function Me(e,t,n=W){const r=new Map;for(const e of Object.values(X))r.set(e,qe(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;Y(f)||P(!1,`Invalid AST Node: ${we(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===Pe)break;if(!1===g){if(!e){h.pop();continue}}else if(void 0!==g&&(l.push([o,g]),!e)){if(!Y(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 qe(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 je={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>Ue(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=Qe("(",Ue(e.variableDefinitions,", "),")"),n=Ue([e.operation,Ue([e.name,t]),Ue(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+Qe(" = ",n)+Qe(" ",Ue(r," "))},SelectionSet:{leave:({selections:e})=>Ve(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=Qe("",e,": ")+t;let s=o+Qe("(",Ue(n,", "),")");return s.length>80&&(s=o+Qe("(\n",Ge(Ue(n,"\n")),"\n)")),Ue([s,Ue(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+Qe(" ",Ue(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>Ue(["...",Qe("on ",e),Ue(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${Qe("(",Ue(n,", "),")")} on ${t} ${Qe("",Ue(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||ee(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&&ee(e.charCodeAt(0));return(u&&!f||i)&&(l+="\n"),l+=t,(u||c)&&(l+="\n"),'"""'+l+'"""'}(e):`"${e.replace(Re,Fe)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+Ue(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+Ue(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Qe("(",Ue(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Qe("",e,"\n")+Ue(["schema",Ue(t," "),Ve(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Qe("",e,"\n")+Ue(["scalar",t,Ue(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Qe("",e,"\n")+Ue(["type",t,Qe("implements ",Ue(n," & ")),Ue(r," "),Ve(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>Qe("",e,"\n")+t+(Be(n)?Qe("(\n",Ge(Ue(n,"\n")),"\n)"):Qe("(",Ue(n,", "),")"))+": "+r+Qe(" ",Ue(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>Qe("",e,"\n")+Ue([t+": "+n,Qe("= ",r),Ue(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Qe("",e,"\n")+Ue(["interface",t,Qe("implements ",Ue(n," & ")),Ue(r," "),Ve(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>Qe("",e,"\n")+Ue(["union",t,Ue(n," "),Qe("= ",Ue(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>Qe("",e,"\n")+Ue(["enum",t,Ue(n," "),Ve(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Qe("",e,"\n")+Ue([t,Ue(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>Qe("",e,"\n")+Ue(["input",t,Ue(n," "),Ve(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>Qe("",e,"\n")+"directive @"+t+(Be(n)?Qe("(\n",Ge(Ue(n,"\n")),"\n)"):Qe("(",Ue(n,", "),")"))+(r?" repeatable":"")+" on "+Ue(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>Ue(["extend schema",Ue(e," "),Ve(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>Ue(["extend scalar",e,Ue(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Ue(["extend type",e,Qe("implements ",Ue(t," & ")),Ue(n," "),Ve(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Ue(["extend interface",e,Qe("implements ",Ue(t," & ")),Ue(n," "),Ve(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>Ue(["extend union",e,Ue(t," "),Qe("= ",Ue(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>Ue(["extend enum",e,Ue(t," "),Ve(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>Ue(["extend input",e,Ue(t," "),Ve(n)]," ")}};function Ue(e,t=""){var n;return null!==(n=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==n?n:""}function Ve(e){return Qe("{\n",Ge(Ue(e,"\n")),"\n}")}function Qe(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function Ge(e){return Qe(" ",e.replace(/\n/g,"\n "))}function Be(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}function Ke(e){return e.kind===X.FIELD||e.kind===X.FRAGMENT_SPREAD||e.kind===X.INLINE_FRAGMENT}function ze(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;A(n&&1===n.length,71,r);var i=n[0];A(i.name&&"if"===i.name.value,72,r);var o=i.value;A(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],A(void 0!==i,70,n.name.value)):i=r.value.value,"skip"===n.name.value?!i:i}))}function We(e,t,n){var r=new Set(e),i=r.size;return Me(t,{Directive:function(e){if(r.delete(e.name.value)&&(!n||!r.size))return Pe}}),n?!r.size:r.size<i}function He(e){return e&&We(["client","export"],e,!0)}const Ye=()=>Object.create(null),{forEach:Je,slice:$e}=Array.prototype,{hasOwnProperty:Xe}=Object.prototype;let Ze=class e{constructor(e=!0,t=Ye){this.weakness=e,this.makeData=t}lookup(){return this.lookupArray(arguments)}lookupArray(e){let t=this;return Je.call(e,(e=>t=t.getChildTrie(e))),Xe.call(t,"data")?t.data:t.data=this.makeData($e.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($e.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 et="ReactNative"==O((function(){return navigator.product})),tt="function"==typeof WeakMap&&!(et&&!global.HermesInternal),nt="function"==typeof WeakSet,rt="function"==typeof Symbol&&"function"==typeof Symbol.for,it=rt&&Symbol.asyncIterator;function ot(e){return null!==e&&"object"==typeof e}function st(e,t){var n=t,r=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw C(74,e.operation,e.name?" named '".concat(e.name.value,"'"):"");"FragmentDefinition"===e.kind&&r.push(e)})),void 0===n&&(A(1===r.length,75,r.length),n=r[0].name.value),s(s({},e),{definitions:f([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],e.definitions,!0)})}function at(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function ct(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 A(r,76,n),r||null;default:return null}}function ut(){}O((function(){return window.document.createElement})),O((function(){return navigator.userAgent.indexOf("jsdom")>=0}));class lt{constructor(e=1/0,t=ut){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 ft(){}const ht=ft,pt="undefined"!=typeof WeakRef?WeakRef:function(e){return{deref:()=>e}},dt="undefined"!=typeof WeakMap?WeakMap:Map,vt="undefined"!=typeof FinalizationRegistry?FinalizationRegistry:function(){return{register:ft,unregister:ft}};class yt{constructor(e=1/0,t=ht){this.max=e,this.dispose=t,this.map=new dt,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 pt(n),this.registry.register(n,t,t)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new vt(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 mt=new WeakSet;function gt(e){e.size<=(e.max||-1)||mt.has(e)||(mt.add(e),setTimeout((function(){e.clean(),mt.delete(e)}),100))}var bt=function(e,t){var n=new yt(e,t);return n.set=function(e,t){var n=yt.prototype.set.call(this,e,t);return gt(this),n},n},Et=function(e,t){var n=new lt(e,t);return n.set=function(e,t){var n=lt.prototype.set.call(this,e,t);return gt(this),n},n},Tt=Symbol.for("apollo.cacheSize"),_t=s({},k[Tt]),St={};function Ot(e,t){St[e]=t}var kt=!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,_t[t]||n]}))),sizes:s({print:null===(e=St.print)||void 0===e?void 0:e.call(St),parser:null===(t=St.parser)||void 0===t?void 0:t.call(St),canonicalStringify:null===(n=St.canonicalStringify)||void 0===n?void 0:n.call(St),links:Rt(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:Ct(this.queryManager.documentTransform)}},null===(i=(r=this.cache).getMemoryInternals)||void 0===i?void 0:i.call(r))}}:void 0,wt=!1!==globalThis.__DEV__?function(){var e=this.config.fragments;return s(s({},It.apply(this)),{addTypenameDocumentTransform:Ct(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:Nt(this.storeReader.executeSelectionSet),executeSubSelectedArray:Nt(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:Nt(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:Nt(null==e?void 0:e.findFragmentSpreads),lookup:Nt(null==e?void 0:e.lookup),transform:Nt(null==e?void 0:e.transform)}})}:void 0,xt=!1!==globalThis.__DEV__?It:void 0;function It(){return{cache:{fragmentQueryDocuments:Nt(this.getFragmentDoc)}}}function Nt(e){return function(e){return!!e&&"dirtyKey"in e}(e)?e.size:void 0}function At(e){return null!=e}function Ct(e){return Dt(e).map((function(e){return{cache:e}}))}function Dt(e){return e?f(f([Nt(null==e?void 0:e.performWork)],Dt(null==e?void 0:e.left),!0),Dt(null==e?void 0:e.right),!0).filter(At):[]}function Rt(e){var t;return e?f(f([null===(t=null==e?void 0:e.getMemoryInternals)||void 0===t?void 0:t.call(e)],Rt(null==e?void 0:e.left),!0),Rt(null==e?void 0:e.right),!0).filter(At):[]}var Ft,Lt=Object.assign((function(e){return JSON.stringify(e,Pt)}),{reset:function(){Ft=new Et(_t.canonicalStringify||1e3)}});function Pt(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(Mt))return t;var i=JSON.stringify(r),o=Ft.get(i);if(!o){r.sort();var s=JSON.stringify(r);o=Ft.get(s)||r,Ft.set(i,o),Ft.set(s,o)}var a=Object.create(n);return o.forEach((function(e){a[e]=t[e]})),a}}return t}function Mt(e,t,n){return 0===t||n[t-1]<=e}function qt(e){return{__ref:String(e)}}function jt(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function Ut(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 Ut(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 Ut(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 C(85,t.value,n.kind);e[t.value]=null}}!1!==globalThis.__DEV__&&Ot("canonicalStringify",(function(){return Ft.size})),Lt.reset();var Vt=["connection","include","skip","client","rest","export","nonreactive"],Qt=Lt,Gt=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(Qt(i),")")}return n.connection.key}var o=e;if(t){var s=Qt(t);o+="(".concat(s,")")}return n&&Object.keys(n).forEach((function(e){-1===Vt.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?o+="@".concat(e,"(").concat(Qt(n[e]),")"):o+="@".concat(e))})),o}),{setStringify:function(e){var t=Qt;return Qt=e,t}});function Bt(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach((function(e){var r=e.name,i=e.value;return Ut(n,r,i,t)})),n}return null}function Kt(e){return e.alias?e.alias.value:e.name.value}function zt(e,t,n){for(var r,i=0,o=t.selections;i<o.length;i++){if(Wt(c=o[i])){if("__typename"===c.name.value)return e[Kt(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=zt(e,ct(c=a[s],n).selectionSet,n);if("string"==typeof u)return u}}function Wt(e){return"Field"===e.kind}function Ht(e){A(e&&"Document"===e.kind,77);var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw C(78,e.kind);return e}));return A(t.length<=1,79,t.length),e}function Yt(e){return Ht(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function Jt(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&!!e.name})).map((function(e){return e.name.value}))[0]||null}function $t(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function Xt(e){var t=Yt(e);return A(t&&"query"===t.operation,80),t}function Zt(e){var t;Ht(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 C(84)}function en(e){var t=Object.create(null),n=e&&e.variableDefinitions;return n&&n.length&&n.forEach((function(e){e.defaultValue&&Ut(t,e.variable.name,e.defaultValue)})),t}const tn=()=>Object.create(null),{forEach:nn,slice:rn}=Array.prototype,{hasOwnProperty:on}=Object.prototype;class sn{constructor(e=!0,t=tn){this.weakness=e,this.makeData=t}lookup(...e){return this.lookupArray(e)}lookupArray(e){let t=this;return nn.call(e,(e=>t=t.getChildTrie(e))),on.call(t,"data")?t.data:t.data=this.makeData(rn.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&&an(e[n])?t.weak:t.strong;t=r&&r.get(e[n])}return t&&t.data}getChildTrie(e){const t=this.weakness&&an(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 sn(this.weakness,this.makeData)),n}}function an(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}let cn=null;const un={};let ln=1;function fn(e){try{return e()}catch(e){}}const hn="@wry/context:Slot",pn=fn((()=>globalThis))||fn((()=>global))||Object.create(null),dn=pn[hn]||Array[hn]||function(e){try{Object.defineProperty(pn,hn,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(class{constructor(){this.id=["slot",ln++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=cn;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===un)break;return e!==cn&&(cn.slots[this.id]=t),!0}return cn&&(cn.slots[this.id]=un),!1}getValue(){if(this.hasValue())return cn.slots[this.id]}withValue(e,t,n,r){const i={__proto__:null,[this.id]:e},o=cn;cn={parent:o,slots:i};try{return t.apply(r,n)}finally{cn=o}}static bind(e){const t=cn;return function(){const n=cn;try{return cn=t,e.apply(this,arguments)}finally{cn=n}}}static noContext(e,t,n){if(!cn)return e.apply(n,t);{const r=cn;try{return cn=null,e.apply(n,t)}finally{cn=r}}}}),vn=new dn,{hasOwnProperty:yn}=Object.prototype,mn=Array.from||function(e){const t=[];return e.forEach((e=>t.push(e))),t};function gn(e){const{unsubscribe:t}=e;"function"==typeof t&&(e.unsubscribe=void 0,t())}const bn=[];function En(e,t){if(!e)throw new Error(t||"assertion failure")}function Tn(e,t){const n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}function _n(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function Sn(e){return e.slice(0)}class On{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,++On.count}peek(){if(1===this.value.length&&!xn(this))return kn(this),this.value[0]}recompute(e){return En(!this.recomputing,"already recomputing"),kn(this),xn(this)?function(e,t){Fn(e),vn.withValue(e,wn,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{gn(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,xn(e))return;Nn(e)}(e);return _n(e.value)}(this,e):_n(this.value)}setDirty(){this.dirty||(this.dirty=!0,In(this),gn(this))}dispose(){this.setDirty(),Fn(this),An(this,((e,t)=>{e.setDirty(),Ln(e,this)}))}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=bn.pop()||new Set),this.deps.add(e)}forgetDeps(){this.deps&&(mn(this.deps).forEach((e=>e.delete(this))),this.deps.clear(),bn.push(this.deps),this.deps=null)}}function kn(e){const t=vn.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),xn(e)?Cn(t,e):Dn(t,e),t}function wn(e,t){e.recomputing=!0;const{normalizeResult:n}=e;let r;n&&1===e.value.length&&(r=Sn(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),n&&r&&!Tn(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 xn(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function In(e){An(e,Cn)}function Nn(e){An(e,Dn)}function An(e,t){const n=e.parents.size;if(n){const r=mn(e.parents);for(let i=0;i<n;++i)t(r[i],e)}}function Cn(e,t){En(e.childValues.has(t)),En(xn(t));const n=!xn(e);if(e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=bn.pop()||new Set;e.dirtyChildren.add(t),n&&In(e)}function Dn(e,t){En(e.childValues.has(t)),En(!xn(t));const n=e.childValues.get(t);0===n.length?e.childValues.set(t,Sn(t.value)):Tn(n,t.value)||e.setDirty(),Rn(e,t),xn(e)||Nn(e)}function Rn(e,t){const n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(bn.length<100&&bn.push(n),e.dirtyChildren=null))}function Fn(e){e.childValues.size>0&&e.childValues.forEach(((t,n)=>{Ln(e,n)})),e.forgetDeps(),En(null===e.dirtyChildren)}function Ln(e,t){t.parents.delete(e),e.childValues.delete(t),Rn(e,t)}On.count=0;const Pn={setDirty:!0,dispose:!0,forget:!0};function Mn(e){const t=new Map;function n(e){const n=vn.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&&yn.call(Pn,n)?n:"setDirty";mn(r).forEach((e=>e[i]())),t.delete(e),gn(r)}},n}let qn;function jn(...e){return(qn||(qn=new sn("function"==typeof WeakMap))).lookupArray(e)}const Un=new Set;function Vn(e,{max:t=Math.pow(2,16),keyArgs:n,makeCacheKey:r=jn,normalizeResult:i,subscribe:o,cache:s=lt}=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 On(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),Un.add(a),vn.hasValue()||(Un.forEach((e=>e.clean())),Un.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 Qn(e){return e}var Gn,Bn=function(){function e(e,t){void 0===t&&(t=Object.create(null)),this.resultCache=nt?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(Qn,{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 Ze(tt);this.performWork=Vn(e.prototype.performWork.bind(this),{makeCacheKey:function(e){var r=t.getCacheKey(e);if(r)return A(Array.isArray(r),69),n.lookupArray(r)},max:_t["documentTransform.cache"],cache:yt})}},e.prototype.performWork=function(e){return Ht(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}(),Kn=Object.assign((function(e){var t=Gn.get(e);return t||(t=function(e){return Me(e,je)}(e),Gn.set(e,t)),t}),{reset:function(){Gn=new bt(_t.print||2e3)}});Kn.reset(),!1!==globalThis.__DEV__&&Ot("print",(function(){return Gn?Gn.size:0}));var zn=Array.isArray;function Wn(e){return Array.isArray(e)&&e.length>0}var Hn={kind:X.FIELD,name:{kind:X.NAME,value:"__typename"}};function Yn(e,t){return!e||e.selectionSet.selections.every((function(e){return e.kind===X.FRAGMENT_SPREAD&&Yn(t[e.name.value],t)}))}function Jn(e){return Yn(Yt(e)||function(e){A("Document"===e.kind,81),A(e.definitions.length<=1,82);var t=e.definitions[0];return A("FragmentDefinition"===t.kind,83),t}(e),at($t(e)))?null:e}function $n(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 Xn(e,t){Ht(t);for(var n=$n(""),r=$n(""),i=function(e){for(var t=0,i=void 0;t<e.length&&(i=e[t]);++t)if(!zn(i)){if(i.kind===X.OPERATION_DEFINITION)return n(i.name&&i.name.value);if(i.kind===X.FRAGMENT_DEFINITION)return r(i.name.value)}return!1!==globalThis.__DEV__&&A.error(86),null},o=0,a=t.definitions.length-1;a>=0;--a)t.definitions[a].kind===X.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 Wn(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=Me(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===X.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===X.OPERATION_DEFINITION?d(n(e.name&&e.name.value)).fragmentSpreads.forEach((function(e){v.add(e)})):e.kind!==X.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 Jn(Me(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 Zn=Object.assign((function(e){return Me(e,{SelectionSet:{enter:function(e,t,n){if(!n||n.kind!==X.OPERATION_DEFINITION){var r=e.selections;if(r)if(!r.some((function(e){return Wt(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var i=n;if(!(Wt(i)&&i.directives&&i.directives.some((function(e){return"export"===e.name.value}))))return s(s({},e),{selections:f(f([],r,!0),[Hn],!1)})}}}}})}),{added:function(e){return e===Hn}});function er(e){return"query"===Zt(e).operation?e:Me(e,{OperationDefinition:{enter:function(e){return s(s({},e),{operation:"query"})}}})}function tr(e){return Ht(e),Xn([{test:function(e){return"client"===e.name.value},remove:!0}],e)}var nr=Object.prototype.hasOwnProperty;function rr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ir(e)}function ir(e){var t=e[0]||{},n=e.length;if(n>1)for(var r=new sr,i=1;i<n;++i)t=r.merge(t,e[i]);return t}var or=function(e,t,n){return this.merge(e[n],t[n])},sr=function(){function e(e){void 0===e&&(e=or),this.reconciler=e,this.isObject=ot,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 ot(t)&&ot(e)?(Object.keys(t).forEach((function(i){if(nr.call(e,i)){var o=e[i];if(t[i]!==o){var s=n.reconciler.apply(n,f([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 ot(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 ar(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 cr(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 cr(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 cr(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 ur(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 lr(e,t,n){return t&&ur(e.prototype,t),n&&ur(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var fr=function(){return"function"==typeof Symbol},hr=function(e){return fr()&&Boolean(Symbol[e])},pr=function(e){return hr(e)?Symbol[e]:"@@"+e};fr()&&!hr("observable")&&(Symbol.observable=Symbol("observable"));var dr=pr("iterator"),vr=pr("observable"),yr=pr("species");function mr(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function gr(e){var t=e.constructor;return void 0!==t&&null===(t=t[yr])&&(t=void 0),void 0!==t?t:Ir}function br(e){return e instanceof Ir}function Er(e){Er.log?Er.log(e):setTimeout((function(){throw e}))}function Tr(e){Promise.resolve().then((function(){try{e()}catch(e){Er(e)}}))}function _r(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=mr(t,"unsubscribe");n&&n.call(t)}}catch(e){Er(e)}}function Sr(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function Or(e,t,n){e._state="running";var r=e._observer;try{var i=mr(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(Sr(e),!i)throw n;i.call(r,n);break;case"complete":Sr(e),i&&i.call(r)}}catch(e){Er(e)}"closed"===e._state?_r(e):"running"===e._state&&(e._state="ready")}function kr(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 Tr((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(Or(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void Or(e,t,n);e._queue.push({type:t,value:n})}}var wr=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var n=new xr(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&&(Sr(this),_r(this))},lr(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),xr=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){kr(this._subscription,"next",e)},t.error=function(e){kr(this._subscription,"error",e)},t.complete=function(){kr(this._subscription,"complete")},lr(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),Ir=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 wr(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(gr(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(gr(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=gr(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=gr(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=gr(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[vr]=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=mr(t,vr);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return br(i)&&i.constructor===n?i:new n((function(e){return i.subscribe(e)}))}if(hr("iterator")&&(r=mr(t,dr)))return new n((function(e){Tr((function(){if(!e.closed){for(var n,i=ar(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){Tr((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){Tr((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))},lr(e,null,[{key:yr,get:function(){return this}}]),e}();fr()&&Object.defineProperty(Ir,Symbol("extensions"),{value:{symbol:vr,hostReportError:Er},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 Nr=Ir.prototype,Ar="@@observable";Nr[Ar]||(Nr[Ar]=function(){return this});var Cr=Object.prototype.toString;function Dr(e){return Rr(e)}function Rr(e,t){switch(Cr.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]=Rr(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]=Rr(e[n],t)})),r;default:return e}}function Fr(e){var t=new Set([e]);return t.forEach((function(e){ot(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){ot(e[n])&&t.add(e[n])}))})),e}function Lr(e){return!1!==globalThis.__DEV__&&Fr(e),e}function Pr(e,t,n){var r=[];e.forEach((function(e){return e[t]&&r.push(e)})),r.forEach((function(e){return e[t](n)}))}function Mr(e,t,n){return new Ir((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 qr(e){function t(t){Object.defineProperty(e,t,{value:Ir})}return rt&&Symbol.species&&t(Symbol.species),t("@@species"),e}function jr(e){return e&&"function"==typeof e.then}var Ur=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),Pr(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),Pr(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?jr(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"),Pr(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 Ir(t)]),jr(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}(Ir);function Vr(e){return"incremental"in e}function Qr(e){return ot(e)&&"payload"in e}function Gr(e,t){var n=e,r=new sr;return Vr(t)&&Wn(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 Br(e){return Wn(Kr(e))}function Kr(e){var t=Wn(e.errors)?e.errors.slice(0):[];return Vr(e)&&Wn(e.incremental)&&e.incremental.forEach((function(e){e.errors&&t.push.apply(t,e.errors)})),t}function zr(){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 Wr(e,t){return zr(e,t,t.variables&&{variables:zr(s(s({},e&&e.variables),t.variables))})}function Hr(e){return new Ir((function(t){t.error(e)}))}qr(Ur);var Yr=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 Jr(e,t){return t?t(e):Ir.of()}function $r(e){return"function"==typeof e?new Zr(e):e}function Xr(e){return e.request.length<=1}var Zr=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return Ir.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map($r).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,n,r){var i,o=$r(n),s=$r(r||new e(Jr));return i=Xr(o)&&Xr(s)?new e((function(e){return t(e)?o.request(e)||Ir.of():s.request(e)||Ir.of()})):new e((function(e,n){return t(e)?o.request(e,n)||Ir.of():s.request(e,n)||Ir.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?Jt(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 C(44,i)}return e}(t))))||Ir.of()},e.concat=function(t,n){var r=$r(t);if(Xr(r))return!1!==globalThis.__DEV__&&A.warn(36,r),r;var i,o=$r(n);return i=Xr(o)?new e((function(e){return r.request(e,(function(e){return o.request(e)||Ir.of()}))||Ir.of()})):new e((function(e,t){return r.request(e,(function(e){return o.request(e,t)||Ir.of()}))||Ir.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(Jr)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw C(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}(),ei=Zr.execute;function ti(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 it&&(u[Symbol.asyncIterator]=function(){return this}),u}function ni(e){var t={next:function(){return e.read()}};return it&&(t[Symbol.asyncIterator]=function(){return this}),t}function ri(e){var t,n,r,i=e;if(e.body&&(i=e.body),function(e){return!(!it||!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 ni(i.getReader());if(function(e){return!!e.stream}(i))return ni(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)})))}},it&&(r[Symbol.asyncIterator]=function(){return this}),r;if(function(e){return!!e.pipe}(i))return ti(i);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var ii=Symbol();function oi(e){return e.hasOwnProperty("graphQLErrors")}var si=function(e){function t(n){var r,i,o=n.graphQLErrors,s=n.protocolErrors,a=n.clientErrors,c=n.networkError,u=n.errorMessage,l=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=f(f(f([],(r=h).graphQLErrors,!0),r.clientErrors,!0),r.protocolErrors,!0),r.networkError&&i.push(r.networkError),i.map((function(e){return ot(e)&&e.message||"Error message not found."})).join("\n")),h.extraInfo=l,h.cause=f(f(f([c],o||[],!0),s||[],!0),a||[],!0).find((function(e){return!!e}))||null,h.__proto__=t.prototype,h}return o(t,e),t}(Error),ai=Object.prototype.hasOwnProperty;function ci(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 ui(e,t){if(e.status>=300){Yr(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 li=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var r=C(40,t,e.message);throw r.parseError=e,r}return n},fi={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},hi=function(e,t){return t(e)};function pi(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,Kn)),{options:i,body:f}}var di=O((function(){return fetch})),vi=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?hi: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 C(38)}(r||di);var y={http:{includeExtensions:l,preserveHeaderCase:f},options:v.fetchOptions,credentials:v.credentials,headers:v.headers};return new Zr((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(We(["client"],e.query)){var g=tr(e.query);if(!g)return Hr(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,E,T,_,S,k=pi(e,o,fi,y,m),w=k.options,x=k.body;x.variables&&!d&&(x.variables=(b=x.variables,E=e.query,T=s({},b),_=new Set(Object.keys(b)),Me(E,{Variable:function(e,t,n){n&&"VariableDefinition"!==n.kind&&_.delete(e.name.value)}}),_.forEach((function(e){delete T[e]})),T)),w.signal||"undefined"==typeof AbortController||(S=new AbortController,w.signal=S.signal);var I,N="OperationDefinition"===(I=Zt(e.query)).kind&&"subscription"===I.operation,C=We(["defer"],e.query);if(h&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(w.method="GET"),C||N){w.headers=w.headers||{};var D="multipart/mixed;";N&&C&&!1!==globalThis.__DEV__&&A.warn(39),N?D+="boundary=graphql;subscriptionSpec=1.0,application/json":C&&(D+="deferSpec=20220824,application/json"),w.headers.accept=D}if("GET"===w.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=li(t.variables,"Variables map")}catch(e){return{parseError:e}}r("variables",i)}if(t.extensions){var o=void 0;try{o=li(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,x),F=R.newURI,L=R.parseError;if(L)return Hr(L);t=F}else try{w.body=li(x,"Payload")}catch(L){return Hr(L)}return new Ir((function(n){var i=r||O((function(){return fetch}))||di,o=n.next.bind(n);return i(t,w).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,T,_,S,O,k,w,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=ri(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,k=[c.slice(0,m),c.slice(m+a.length)],c=k[1],b=(g=k[0]).indexOf("\r\n\r\n"),E=ci(g.slice(0,b)),(T=E["content-type"])&&-1===T.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");if(_=g.slice(b))if(S=ui(e,_),Object.keys(S).length>1||"data"in S||"incremental"in S||"errors"in S||"payload"in S)if(Qr(S)){if(O={},"payload"in S){if(1===Object.keys(S).length&&null===S.payload)return[2];O=s({},S.payload)}"errors"in S&&(O=s(s({},O),{extensions:s(s({},"extensions"in O?O.extensions:null),(w={},w[ii]=S.errors,w))})),t(O)}else t(S);else if(1===Object.keys(S).length&&"hasNext"in S&&!S.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 ui(e,t)})).then((function(t){return Array.isArray(t)||ai.call(t,"data")||ai.call(t,"errors")||Yr(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(){S=void 0,n.complete()})).catch((function(e){S=void 0,function(e,t){e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e)}(e,n)})),function(){S&&S.abort()}}))}))},yi=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,vi(t).request)||this;return n.options=t,n}return o(t,e),t}(Zr);const{toString:mi,hasOwnProperty:gi}=Object.prototype,bi=Function.prototype.toString,Ei=new Map;function Ti(e,t){try{return _i(e,t)}finally{Ei.clear()}}function _i(e,t){if(e===t)return!0;const n=mi.call(e);if(n!==mi.call(t))return!1;switch(n){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(wi(e,t))return!0;const n=Si(e),r=Si(t),i=n.length;if(i!==r.length)return!1;for(let e=0;e<i;++e)if(!gi.call(t,n[e]))return!1;for(let r=0;r<i;++r){const i=n[r];if(!_i(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(wi(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&&!_i(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=bi.call(e);return n===bi.call(t)&&!function(e,t){const n=e.length-t.length;return n>=0&&e.indexOf(t,n)===n}(n,ki)}}return!1}function Si(e){return Object.keys(e).filter(Oi,e)}function Oi(e){return void 0!==this[e]}const ki="{ [native code] }";function wi(e,t){let n=Ei.get(e);if(n){if(n.has(t))return!0}else Ei.set(e,n=new Set);return n.add(t),!1}function xi(e,t,n,r){var i=t.data,o=a(t,["data"]),s=n.data;return Ti(o,a(n,["data"]))&&Ii(Zt(e).selectionSet,i,s,{fragmentMap:at($t(e)),variables:r})}function Ii(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),!ze(e,r.variables))return!0;if(Ni(e))return!0;if(Wt(e)){var o=Kt(e),s=t&&t[o],a=n&&n[o],c=e.selectionSet;if(!c)return Ti(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(!Ii(c,s[h],a[h],r))return!1;return!0}return Ii(c,s,a,r)}var p=ct(e,r.fragmentMap);return p?!!Ni(p)||Ii(p.selectionSet,t,n,r):void 0}))}function Ni(e){return!!e.directives&&e.directives.some(Ai)}function Ai(e){return"nonreactive"===e.name.value}var Ci=function(){function e(){this.assumeImmutableResults=!1,this.getFragmentDoc=Vn(st,{max:_t["cache.fragmentQueryDocuments"]||1e3,cache:yt})}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 Ir((function(e){return n.watch(s(s({},h),{immediate:!0,callback:function(n){if(!t||!xi(f,{data:null==t?void 0:t.result},{data:n.result})){var r={data:n.result,complete:!!n.complete};n.missing&&(r.missing=ir(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__&&(Ci.prototype.getMemoryInternals=xt);var Di=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),Ri=Object.prototype.hasOwnProperty;function Fi(e){return null==e}function Li(e,t){var n=e.__typename,r=e.id,i=e._id;if("string"==typeof n&&(t&&(t.keyObject=Fi(r)?Fi(i)?void 0:{_id:i}:{id:r}),Fi(r)&&!Fi(i)&&(r=i),!Fi(r)))return"".concat(n,":").concat("number"==typeof r||"string"==typeof r?r:JSON.stringify(r))}var Pi={dataIdFromObject:Li,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Mi(e){var t=e.canonizeResults;return void 0===t?Pi.canonizeResults:t}var qi=/^[_a-z][_0-9a-z]*/i;function ji(e){var t=e.match(qi);return t?t[0]:e}function Ui(e,t,n){return!!ot(t)&&(zn(t)?t.every((function(t){return Ui(e,t,n)})):e.selections.every((function(e){if(Wt(e)&&ze(e,n)){var r=Kt(e);return Ri.call(t,r)&&(!e.selectionSet||Ui(e.selectionSet,t[r],n))}return!0})))}function Vi(e){return ot(e)&&!jt(e)&&!zn(e)}function Qi(e,t){var n=at($t(e));return{fragmentMap:n,lookupFragment:function(e){var r=n[e];return!r&&t&&(r=t.lookup(e)),r||null}}}var Gi=Object.create(null),Bi=function(){return Gi},Ki=Object.create(null),zi=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 Lr(jt(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return jt(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return qt(e);if(jt(e))return e;var r=n.policies.identify(e)[0];if(r){var i=qt(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),Ri.call(this.data,e)){var n=this.data[e];if(n&&Ri.call(n,t))return n[t]}return"__typename"===t&&Ri.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof Ji?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),Ri.call(this.data,e)?this.data[e]:this instanceof Ji?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var n,r=this;jt(e)&&(e=e.__ref),jt(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){A("string"==typeof n,1);var s=new sr(Xi).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=ji(e);t===e||r.policies.hasKeyArgs(s.__typename,t)||(a[t]=1),void 0!==s[e]||r instanceof Ji||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:Gi,INVALIDATE:Ki,isReference:jt,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||qt(e)}:t,{store:n})}};if(Object.keys(r).forEach((function(u){var l=ji(u),f=r[u];if(void 0!==f){var h="function"==typeof t?t:t[u]||t[l];if(h){var p=h===Bi?Gi:h(Lr(f),s(s({},c),{fieldName:l,storeFieldName:u,storage:n.getStorage(e,u)}));if(p===Ki)n.group.dirty(e,u);else if(p===Gi&&(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__&&A.warn(2,e),!0};if(jt(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(jt(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__&&A.warn(3,y);break}}}}void 0!==f&&(a=!1)}})),o)return this.merge(e,i),a&&(this instanceof Ji?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]=Bi,r):Bi)}return!1},e.prototype.evict=function(e,t){var n=!1;return e.id&&(Ri.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Ji&&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){Ri.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&&Ri.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 Ji?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){Ri.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 Ji;)i=i.parent;r.forEach((function(e){return i.delete(e)}))}return r},e.prototype.findChildRefIds=function(e){if(!Ri.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){jt(e)&&(t[e.__ref]=!0),ot(e)&&Object.keys(e).forEach((function(t){var n=e[t];ot(n)&&r.add(n)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),Wi=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?Mn():null,this.keyMaker=new Ze(tt)},e.prototype.depend=function(e,t){if(this.d){this.d(Hi(e,t));var n=ji(t);n!==t&&this.d(Hi(e,n)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(Hi(e,t),"__exists"===t?"forget":"setDirty")},e}();function Hi(e,t){return t+"#"+e}function Yi(e,t){Zi(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 Wi(i))||this;return s.stump=new $i(s),s.storageTrie=new Ze(tt),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}(zi);var Ji=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){Ti(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 Ri.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}(zi),$i=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new Wi(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}(Ji);function Xi(e,t,n){var r=e[n],i=t[n];return Ti(r,i)?r:i}function Zi(e){return!!(e instanceof zi&&e.group.caching)}function eo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var to=function(){function e(){this.known=new(nt?WeakSet:Set),this.pool=new Ze(tt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return ot(e)&&this.known.has(e)},e.prototype.pass=function(e){if(ot(e)){var t=function(e){return ot(e)?zn(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(ot(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 no(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var ro=function(){function e(e){var t=this;this.knownResults=new(tt?WeakMap:Map),this.config=zr(e,{addTypename:!1!==e.addTypename,canonizeResults:Mi(e)}),this.canon=e.canon||new to,this.executeSelectionSet=Vn((function(e){var n,r=e.context.canonizeResults,i=no(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:(Yi(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize||_t["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:no,makeCacheKey:function(e,t,n,r){if(Zi(n.store))return n.store.makeCacheKey(e,jt(t)?t.__ref:t,n.varString,r)}}),this.executeSubSelectedArray=Vn((function(e){return Yi(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize||_t["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(e){var t=e.field,n=e.array,r=e.context;if(Zi(r.store))return r.store.makeCacheKey(t,n,r.varString)}})}return e.prototype.resetCanon=function(){this.canon=new to},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({},en(Xt(n))),o);var h,p=qt(i),d=this.executeSelectionSet({selectionSet:Zt(n).selectionSet,objectOrReference:p,enclosingRef:p,context:s({store:t,query:n,policies:f,variables:o,varString:Lt(o),canonizeResults:l},Qi(n,this.config.fragments))});if(d.missing&&(h=[new Di(io(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(Zi(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(jt(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 sr;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(ze(e,a))if(Wt(e)){var v=c.readField({fieldName:e.name.value,field:e,variables:o.variables,from:r},o),y=Kt(e);void 0===v?Zn.added(e)||(s=f.merge(s,((n={})[y]="Can't find field '".concat(e.name.value,"' on ").concat(jt(r)?r.__ref+" object":"object "+JSON.stringify(r,null,2)),n))):zn(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:jt(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=ct(e,o.lookupFragment);if(!m&&e.kind===X.FRAGMENT_SPREAD)throw C(9,e.name.value);m&&c.fragmentMatches(m,u)&&m.selectionSet.selections.forEach(p.add,p)}}));var d={result:ir(l),missing:s},v=o.canonizeResults?this.canon.admit(d):Lr(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 sr;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:zn(e)?c(n.executeSubSelectedArray({field:r,array:e,enclosingRef:o,context:s}),t):r.selectionSet?c(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,enclosingRef:jt(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){ot(n)&&(A(!jt(n),10,function(e,t){return jt(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 io(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var oo=new dn,so=new WeakMap;function ao(e){var t=so.get(e);return t||so.set(e,t={vars:new Set,dep:Mn()}),t}function co(e){ao(e).vars.forEach((function(t){return t.forgetCache(e)}))}function uo(e){var t=new Set,n=new Set,r=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach((function(e){ao(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=oo.getValue();a&&(i(a),ao(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),ao(e).vars.add(r),r};return r.forgetCache=function(e){return t.delete(e)},r}var lo=Object.create(null);function fo(e){var t=JSON.stringify(e);return lo[t]||(lo[t]=Object.create(null))}function ho(e){var t=fo(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,n){var r=function(e,t){return n.readField(t,e)},i=n.keyObject=vo(e,(function(e){var i=go(n.storeObject,e,r);return void 0===i&&t!==n.storeObject&&Ri.call(t,e[0])&&(i=go(t,e,mo)),A(void 0!==i,4,e.join("."),t),i}));return"".concat(n.typename,":").concat(JSON.stringify(i))})}function po(e){var t=fo(e);return t.keyArgsFn||(t.keyArgsFn=function(t,n){var r=n.field,i=n.variables,o=n.fieldName,s=vo(e,(function(e){var n=e[0],o=n.charAt(0);if("@"!==o)if("$"!==o){if(t)return go(t,e)}else{var s=n.slice(1);if(i&&Ri.call(i,s)){var a=e.slice(0);return a[0]=s,go(i,a)}}else if(r&&Wn(r.directives)){var c=n.slice(1),u=r.directives.find((function(e){return e.name.value===c})),l=u&&Bt(u,i);return l&&go(l,e.slice(1))}})),a=JSON.stringify(s);return(t||"{}"!==a)&&(o+=":"+a),o})}function vo(e,t){var n=new sr;return yo(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 yo(e){var t=fo(e);if(!t.paths){var n=t.paths=[],r=[];e.forEach((function(t,i){zn(t)?(yo(t).forEach((function(e){return n.push(r.concat(e))})),r.length=0):(r.push(t),zn(e[i+1])||(n.push(r.slice(0)),r.length=0))}))}return t.paths}function mo(e,t){return e[t]}function go(e,t,n){return n=n||mo,bo(t.reduce((function e(t,r){return zn(t)?t.map((function(t){return e(t,r)})):t&&n(t,r)}),e))}function bo(e){return ot(e)?zn(e)?e.map(bo):vo(Object.keys(e).sort(),(function(t){return go(e,t)})):e}function Eo(e){return void 0!==e.args?e.args:e.field?Bt(e.field,e.variables):null}var To=function(){},_o=function(e,t){return t.fieldName},So=function(e,t,n){return(0,n.mergeObjects)(e,t)},Oo=function(e,t){return t},ko=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:Li},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=xo(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(!zn(f)){o=f;break}l=ho(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),Ri.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?So:!1===t?Oo:e.merge}s(r,t.merge),r.keyFn=!1===i?To:zn(i)?ho(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?_o:zn(a)?po(a):"function"==typeof a?a:r.keyFn,"function"==typeof c&&(r.read=c),s(r,u)}r.read&&r.merge&&(r.keyFn=r.keyFn||_o)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(A(!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(qi);r&&r[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!Ri.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__&&A.warn(6,t,o),s.add(o)),!0;h.forEach(c),u&&f===a.length-1&&Ui(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=Eo(e);o;){var c=o(a,s);if(!zn(c)){t=c||r;break}o=po(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 Ut(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 Ut(r,n,i,t)}))),Gt(e.name.value,r,n)}(e.field,e.variables):Gt(r,Eo(e))),!1===t?r:r===ji(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=ji(i),s=t.store.getFieldValue(n,i),a=this.getFieldPolicy(e.typename,o,!1),c=a&&a.read;if(c){var u=wo(this,n,e,t,t.store.getStorage(jt(n)?n.__ref:n,i));return oo.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===So?Io(r.store)(e,t):a===Oo?t:(r.overwrite&&(e=void 0),a(e,t,wo(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:r.variables},r,i||Object.create(null))))},e}();function wo(e,t,n,r,i){var o=e.getStoreFieldName(n),s=ji(o),a=n.variables||r.variables,c=r.store,u=c.toReference,l=c.canRead;return{args:Eo(n),field:n.field||null,fieldName:s,storeFieldName:o,variables:a,isReference:jt,toReference:u,storage:i,cache:e.cache,canRead:l,readField:function(){return e.readField(xo(arguments,t,a),r)},mergeObjects:Io(r.store)}}function xo(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),Ri.call(r,"from")||(r.from=t)),!1!==globalThis.__DEV__&&void 0===r.from&&!1!==globalThis.__DEV__&&A.warn(7,I(Array.from(e))),void 0===r.variables&&(r.variables=n),r}function Io(e){return function(t,n){if(zn(t)||zn(n))throw C(8);if(ot(t)&&ot(n)){var r=e.getFieldValue(t,"__typename"),i=e.getFieldValue(n,"__typename");if(r&&i&&r!==i)return n;if(jt(t)&&Vi(n))return e.merge(t.__ref,n),t;if(Vi(t)&&jt(n))return e.merge(t,n.__ref),n;if(Vi(t)&&Vi(n))return s(s({},t),n)}return n}}function No(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 Ao=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=Yt(r),l=new sr;a=s(s({},en(u)),a);var f=s(s({store:e,written:Object.create(null),merge:function(e,t){return l.merge(e,t)},variables:a,varString:Lt(a)},Qi(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(!jt(h))throw C(11,i);return f.incomingById.forEach((function(t,r){var i=t.storeObject,o=t.mergeTree,a=t.fieldNodeSet,c=qt(r);if(o&&o.map.size){var u=n.applyMerges(o,c,i,f);if(jt(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[ji(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(jt(o))return;if(Ti(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=ji(n),l="".concat(c,".").concat(u);if(Po.has(l))return;Po.add(l);var f=[];zn(o)||zn(a)||[o,a].forEach((function(e){var t=r.getFieldValue(e,"__typename");"string"!=typeof t||f.includes(t)||f.push(t)}));!1!==globalThis.__DEV__&&A.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]||zt(r,i,o.fragmentMap)||n&&o.store.get(n,"__typename");"string"==typeof l&&(u.__typename=l);var f=function(){var e=xo(arguments,u,o.variables);if(jt(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=Kt(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=Do(a,p),v=t.processFieldValue(s,n,n.selectionSet?No(e,!1,!1):e,d),y=void 0;n.selectionSet&&(jt(v)||Vi(v))&&(y=f("__typename",v));var m=c.getMergeFunction(l,n.name.value,y);m?d.info={field:n,typename:l,merge:m}:Lo(a,p),u=e.merge(u,((i={})[p]=v,i))}else!1===globalThis.__DEV__||e.clientOnly||e.deferred||Zn.added(n)||c.getReadFunction(l,n.name.value)||!1!==globalThis.__DEV__&&A.error(12,Kt(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=qt(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=Ro(g.mergeTree,a),h.forEach((function(e){return g.fieldNodeSet.add(e)}))):o.incomingById.set(n,{storeObject:u,mergeTree:Fo(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?zn(e)?e.map((function(e,o){var s=i.processFieldValue(e,t,n,Do(r,o));return Lo(r,o),s})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):!1!==globalThis.__DEV__?Dr(e):e},e.prototype.flattenFields=function(e,t,n,r){void 0===r&&(r=zt(t,e,n.fragmentMap));var i=new Map,o=this.cache.policies,s=new Ze(!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(ze(s,n.variables)){var a=c.clientOnly,u=c.deferred;if(a&&u||!Wn(s.directives)||s.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(a=!0),"defer"===t){var r=Bt(e,n.variables);r&&!1===r.if||(u=!0)}})),Wt(s)){var l=i.get(s);l&&(a=a&&l.clientOnly,u=u&&l.deferred),i.set(s,No(n,a,u))}else{var f=ct(s,n.lookupFragment);if(!f&&s.kind===X.FRAGMENT_SPREAD)throw C(13,s.name.value);f&&o.fragmentMatches(f,r,t,n.variables)&&e(f.selectionSet,No(n,a,u))}}})))}(e,n),i},e.prototype.applyMerges=function(e,t,n,r,i){var o,a=this;if(e.map.size&&!jt(n)){var c,u=zn(n)||!jt(t)&&!Vi(t)?void 0:t,l=n;u&&!i&&(i=[jt(u)?u.__ref:u]);var f=function(e,t){return zn(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&&A(i.pop()===t)}})),c&&(n=zn(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}(),Co=[];function Do(e,t){var n=e.map;return n.has(t)||n.set(t,Co.pop()||{map:new Map}),n.get(t)}function Ro(e,t){if(e===t||!t||Fo(t))return e;if(!e||Fo(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,Ro(e,t.map.get(n))),o.delete(n)})),o.forEach((function(n){i.map.set(n,Ro(t.map.get(n),e.map.get(n)))}))}return i}function Fo(e){return!e||!(e.info||e.map.size)}function Lo(e,t){var n=e.map,r=n.get(t);r&&Fo(r)&&(Co.push(r),n.delete(t))}var Po=new Set;var Mo,qo=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.addTypenameTransform=new Bn(Zn),n.assumeImmutableResults=!0,n.makeVar=uo,n.txCount=0,n.config=function(e){return zr(Pi,e)}(t),n.addTypename=!!n.config.addTypename,n.policies=new ko({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 zi.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 Ao(this,this.storeReader=new ro({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Mi(this.config),canon:e?void 0:n&&n.canon,fragments:r}),r),this.maybeBroadcastWatch=Vn((function(e,n){return t.broadcastWatch(e,n)}),{max:this.config.resultCacheMaxSize||_t["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(e){var n=e.optimistic?t.optimisticData:t.data;if(Zi(n)){var r=e.optimistic,i=e.id,o=e.variables;return n.makeCacheKey(e.query,e.callback,Lt({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 Di)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(Ri.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||ao(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&&co(n),n.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){var t;Lt.reset(),Kn.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(jt(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){!1!==globalThis.__DEV__&&A.warn(e)}},t.prototype.evict=function(e){if(!e.id){if(Ri.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(),Lt.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),co(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&&Ti(n.result,r.result)||e.callback(e.lastDiff=r,n)},t}(Ci);function jo(e){return!!e&&e<7}!1!==globalThis.__DEV__&&(qo.prototype.getMemoryInternals=wt),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"}(Mo||(Mo={}));var Uo=Object.assign,Vo=Object.hasOwnProperty,Qo=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=Bo)}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=zo(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=Yt(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||Mo.ready,r=s(s({},t),{loading:jo(n),networkStatus:n}),i=this.options.fetchPolicy,o=void 0===i?"cache-first":i;if(zo(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),Ti(r.data,{})&&(r.data=void 0),a.complete?(delete r.partial,!a.complete||r.networkStatus!==Mo.loading||"cache-first"!==o&&"cache-only"!==o||(r.networkStatus=Mo.ready,r.loading=!1)):r.partial=!0,!1===globalThis.__DEV__||a.complete||this.options.partialRefetch||r.loading||r.data||r.error||Ko(a.missing)}return e&&this.updateLastResult(r),r},t.prototype.isDifferentFromLastResult=function(e,t){return!this.last||((this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!xi(this.query,this.last.result,e,this.variables):!Ti(this.last.result,e))||t&&!Ti(this.last.variables,t))},t.prototype.getLast=function(e,t){var n=this.last;if(n&&n[e]&&(!t||Ti(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&&Vo.call(e,"variables")){var i=Xt(this.query),o=i.variableDefinitions;o&&o.some((function(e){return"variables"===e.variable.name.value}))||!1!==globalThis.__DEV__&&A.warn(20,e,(null===(t=i.name)||void 0===t?void 0:t.value)||i)}return e&&!Ti(this.options.variables,e)&&(n.variables=this.options.variables=s(s({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(n,Mo.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=Mo.fetchMore,n.notifyOnNetworkStatusChange&&this.observe();var a=new Set,c=null==e?void 0:e.updateQuery,u="no-cache"!==this.options.fetchPolicy;return u||A(c,21),this.queryManager.fetchQuery(r,n,Mo.fetchMore).then((function(l){if(t.queryManager.removeQuery(r),i.networkStatus===Mo.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)&&Go(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__&&A.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=zr(this.options,e||{});Uo(this.options,t)},t.prototype.setVariables=function(e){return Ti(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},Mo.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){A(n,23),(t||(this.pollingInfo={})).interval=n;var r=function(){var t,n;e.pollingInfo&&(jo(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"},Mo.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&&!Ti(t,this.last.variables)&&(n=void 0),this.last=s({result:this.queryManager.assumeImmutableResults?e:Dr(e),variables:t},n?{error:n}:null)},t.prototype.reobserveAsConcast=function(e,t){var n=this;this.isTornDown=!1;var r=t===Mo.refetch||t===Mo.fetchMore||t===Mo.poll,i=this.options.variables,o=this.options.fetchPolicy,a=zr(this.options,e||{}),c=r?a:Uo(this.options,a),u=this.transformDocument(c.query);this.lastQuery=u,r||(this.updatePolling(),!e||!e.variables||Ti(e.variables,i)||"standby"===c.fetchPolicy||c.fetchPolicy!==o&&"function"!=typeof c.nextFetchPolicy||(this.applyNextFetchPolicy("variables-changed",c),void 0===t&&(t=Mo.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=zo(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){Ti(n.variables,f)&&(l(),n.reportResult(e,f))},error:function(e){Ti(n.variables,f)&&(oi(e)||(e=new si({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)&&Pr(this.observers,"next",e)},t.prototype.reportError=function(e,t){var n=s(s({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:Mo.error,loading:!1});this.updateLastResult(n,t),Pr(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}(Ir);function Go(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 Bo(e){!1!==globalThis.__DEV__&&A.error(24,e.message,e.stack)}function Ko(e){!1!==globalThis.__DEV__&&e&&!1!==globalThis.__DEV__&&A.debug(25,e)}function zo(e){return"network-only"===e||"no-cache"===e||"standby"===e}qr(Qo);var Wo=new(tt?WeakMap:Map);function Ho(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return Wo.set(e,(Wo.get(e)+1)%1e15),n.apply(this,arguments)})}function Yo(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var Jo=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;Wo.has(n)||(Wo.set(n,0),Ho(n,"evict"),Ho(n,"modify"),Ho(n,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||Mo.loading;return this.variables&&this.networkStatus!==Mo.loading&&!Ti(this.variables,e.variables)&&(t=Mo.setVariables),Ti(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(){Yo(this),this.dirty=!1},e.prototype.resetDiff=function(){this.lastDiff=void 0},e.prototype.getDiff=function(){var e=this.getDiffOptions();if(this.lastDiff&&Ti(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||Ti(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():Go(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;Yo(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(jo(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&&Ti(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===Wo.get(this.cache)&&Ti(t,n.variables)&&Ti(e.data,n.result.data))},e.prototype.markResult=function(e,t,n,r){var i=this,o=new sr,s=Wn(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Wn(e.incremental)){var a=Gr(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&&($o(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:Wo.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&&Ti(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=Mo.ready},e.prototype.markError=function(e){return this.networkStatus=Mo.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function $o(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!Br(e);return!r&&n&&e.data&&(r=!0),r}var Xo=Object.prototype.hasOwnProperty,Zo=Object.create(null),es=function(){function e(e){var t=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new bt(_t["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Ze(!1);var n=new Bn((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(C(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,T=void 0===E?(null===(a=this.defaultOptions.mutate)||void 0===a?void 0:a.fetchPolicy)||"network-only":E,_=e.errorPolicy,S=void 0===_?(null===(c=this.defaultOptions.mutate)||void 0===c?void 0:c.errorPolicy)||"none":_,O=e.keepRootFields,k=e.context;return u(this,(function(e){switch(e.label){case 0:return A(l,27),A("network-only"===T||"no-cache"===T,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,k)]:[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:T,errorPolicy:S,context:k,updateQueries:p,update:g,keepRootFields:O}),this.broadcastQueries(),o=this,[2,new Promise((function(e,n){return Mr(o.getObservableFromLink(l,s(s({},k),{optimisticResponse:i?h:void 0}),f,{},!1),(function(e){if(Br(e)&&"none"===S)throw new si({graphQLErrors:Kr(e)});r&&(r.loading=!1,r.error=null);var n=s({},e);return"function"==typeof v&&(v=v(n)),"ignore"===S&&Br(n)&&delete n.errors,o.markMutationResult({mutationId:t,result:n,document:l,variables:f,fetchPolicy:T,errorPolicy:S,context:k,update:g,updateQueries:p,awaitRefetchQueries:m,refetchQueries:v,removeOptimistic:i?t:void 0,onQueryUpdated:b,keepRootFields:O})})).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 si?e:new si({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&&$o(r,e.errorPolicy)){if(Vr(r)||i.push({result:r.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Vr(r)&&Wn(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=Gr(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&&Xo.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&&Jt(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=!(Vr(a=r)||function(e){return"hasNext"in e&&"data"in e}(a))||Vr(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:Zo}):e;return r!==Zo&&(this.cache.recordOptimisticTransaction((function(e){try{n.markMutationResult(s(s({},t),{result:{data:r}}),e)}catch(e){!1!==globalThis.__DEV__&&A.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:He(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:We(["nonreactive"],e),clientQuery:this.localState.clientQuery(e),serverQuery:Xn([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],e),defaultVars:en(Yt(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 Jo(this),r=new Qo({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()),A(e.query,29),A("Document"===e.query.kind,30),A(!e.returnPartialData,31),A(!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(C(33)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=Mo.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):ot(n=e)&&"Document"===n.kind&&Array.isArray(n.definitions)?r.set(t.transform(e),!1):ot(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=x("legacyOneTimeQuery"),i=t.getQuery(r).init({document:e.query,variables:e.variables}),o=new Qo({queryManager:t,queryInfo:i,options:s(s({},e),{fetchPolicy:"network-only"})});A(o.queryId===r),i.setObservableQuery(o),n.set(r,o)})),!1!==globalThis.__DEV__&&r.size&&r.forEach((function(e,t){e||!1!==globalThis.__DEV__&&A.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&&($o(i,o)&&t.cache.write({query:n,result:i.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries());var s=Br(i),a=function(e){return!!e.extensions&&Array.isArray(e.extensions[ii])}(i);if(s||a){var c={};if(s&&(c.graphQLErrors=i.errors),a&&(c.protocolErrors=i.extensions[ii]),"none"===o||a)throw new si(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 Ir((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:Jt(l)||void 0,context:this.prepareContext(s(s({},t),{forceFetch:!i})),extensions:r};if(t=d.context,i){var v=Kn(l),y=Lt(n),m=h.lookup(v,y);if(!(a=m.observable)){var g=new Ur([ei(p,d)]);a=m.observable=g,g.beforeNext((function(){h.remove(v,y)}))}}else a=new Ur([ei(p,d)])}else a=new Ur([Ir.of({data:{}})]),t=this.prepareContext(t);return f&&(a=Mr(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 Mr(this.getObservableFromLink(i,n.context,n.variables),(function(o){var s=Kr(o),a=s.length>0,c=n.errorPolicy;if(r>=e.lastRequestId){if(a&&"none"===c)throw e.markError(new si({graphQLErrors:s}));e.markResult(o,i,n,t),e.markReady()}var u={data:o.data,loading:!1,networkStatus:Mo.ready};return a&&"none"===c&&(u.data=void 0),a&&"ignore"!==c&&(u.errors=s,u.networkStatus=Mo.error),u}),(function(t){var n=oi(t)?t:new si({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=Mo.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}),T=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},_=function(){return i.fetchCancelFns.delete(e)};if(this.fetchCancelFns.set(e,(function(e){_(),setTimeout((function(){return o.cancel(e)}))})),this.getDocumentInfo(E.query).hasClientExports)o=new Ur(this.localState.addExportedVariables(E.query,E.variables,E.context).then(T).then((function(e){return e.sources}))),s=!0;else{var S=T(E.variables);s=S.fromLink,o=new Ur(S.sources)}return o.promise.then(_,_),{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?x("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 Jo&&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||Mo.loading);var a=t.result;!1===globalThis.__DEV__||l||Ti(a,{})||Ko(t.missing);var c=function(e){return Ir.of(s({data:e,loading:jo(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===Mo.refetch&&Array.isArray(t.missing)?c(void 0):c(a)},y="no-cache"===a?0:n===Mo.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&&jo(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 Jo(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}(),ts=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=rr(t.resolvers,e)})):this.resolvers=rr(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 We(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return tr(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 Me(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 Pe}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:er(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=Zt(e),c=$t(e),l=at(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))&&ze(e,s)?Wt(e)?[2,this.resolveField(e,t,n,r).then((function(t){var n;void 0!==t&&a.push(((n={})[Kt(e)]=t,n))}))]:(!function(e){return"InlineFragment"===e.kind}(e)?(c=i[e.name.value],A(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 ir(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=Kt(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(oo.withValue(this.cache,p,[n,Bt(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),Me(i,{Directive:function(e,t,r,i,s){"client"===e.name.value&&s.forEach((function(e){n(e)&&Ke(e)&&o.add(e)}))},FragmentSpread:function(r,i,s,a,c){var u=t[r.name.value];A(u,19,r.name.value);var l=e(u);l.size>0&&(c.forEach((function(e){n(e)&&Ke(e)&&o.add(e)})),o.add(r),l.forEach((function(e){o.add(e)})))}})}return r.get(i)}(e)},e}(),ns=!1,rs=function(){function e(e){var t=this;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw C(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,b=e.resolvers,E=e.typeDefs,T=e.fragmentMatcher,_=e.name,O=e.version,k=e.devtools,w=e.link;w||(w=n?new yi({uri:n,credentials:r,headers:i}):Zr.empty()),this.link=w,this.cache=o,this.disableNetworkFetches=u||f>0,this.queryDeduplication=d,this.defaultOptions=v||Object.create(null),this.typeDefs=E,this.devtoolsConfig=s(s({},k),{enabled:(null==k?void 0:k.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=S,this.localState=new ts({cache:o,client:this,resolvers:b,fragmentMatcher:T}),this.queryManager=new es({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:y,documentTransform:a,queryDeduplication:d,ssrMode:u,clientAwareness:{name:_,version:O},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,ns||!1===globalThis.__DEV__||(ns=!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__&&A.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=Wr(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=Wr(this.defaultOptions.query,e)),A("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=Wr(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 ei(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__&&A.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__&&(rs.prototype.getMemoryInternals=kt);var is=new Map,os=new Map,ss=!0,as=!1;function cs(e){return e.replace(/[\s,]+/g," ").trim()}function us(e){var t=new Set,n=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var r=e.name.value,i=cs((s=e.loc).source.body.substring(s.start,s.end)),o=os.get(r);o&&!o.has(i)?ss&&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||os.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 ls(e){var t=cs(e);if(!is.has(t)){var n=function(e,t){return new Ae(e,t).parseDocument()}(e,{experimentalFragmentVariables:as,allowLegacyFragmentVariables:as});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");is.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}(us(n)))}return is.get(t)}function fs(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]})),ls(r)}var hs,ps,ds,vs,ys,ms,gs,bs,Es,Ts,_s,Ss,Os,ks,ws,xs,Is,Ns,As,Cs,Ds,Rs,Fs,Ls,Ps,Ms,qs=fs,js=function(){is.clear(),os.clear()},Us=function(){ss=!1},Vs=function(){as=!0},Qs=function(){as=!1};(hs=fs).gql=qs,hs.resetCaches=js,hs.disableFragmentWarnings=Us,hs.enableExperimentalFragmentVariables=Vs,hs.disableExperimentalFragmentVariables=Qs,fs.default=fs,exports.ItemType=void 0,(ps=exports.ItemType||(exports.ItemType={})).PRODUCT="PRODUCT",ps.PACKAGE="PACKAGE",function(e){e.OK="OK",e.CUSTOMER_BLACKLISTED="CUSTOMER_BLACKLISTED"}(ds||(ds={})),exports.GeinsEventType=void 0,(vs=exports.GeinsEventType||(exports.GeinsEventType={})).USER="USER",vs.USER_LOGIN="USER_LOGIN",vs.USER_LOGOUT="USER_LOGOUT",vs.USER_UPDATE="USER_UPDATE",vs.USER_DELETE="USER_DELETE",vs.CART="CART",vs.CART_ADD="CART_ADD",vs.CART_REMOVE="CART_REMOVE",vs.CART_UPDATE="CART_UPDATE",vs.CART_CLEAR="CART_CLEAR",vs.SESSION="SESSION",vs.SESSION_REFRESH="SESSION_REFRESH",vs.SESSION_EXPIRED="SESSION_EXPIRED",exports.CustomerType=void 0,(ys=exports.CustomerType||(exports.CustomerType={})).PERSON="PERSON",ys.ORGANIZATION="ORGANIZATION",exports.GeinsLogLevel=void 0,(ms=exports.GeinsLogLevel||(exports.GeinsLogLevel={})).NONE="NONE",ms.DEBUG="DEBUG",ms.INFO="INFO",ms.WARN="WARN",ms.ERROR="ERROR",exports.RuntimeContext=void 0,(gs=exports.RuntimeContext||(exports.RuntimeContext={})).SERVER="server",gs.CLIENT="client",gs.HYBRID="hybrid",exports.LinkAttributeRelEnum=void 0,(bs=exports.LinkAttributeRelEnum||(exports.LinkAttributeRelEnum={})).follow="follow",bs.noopener="noopener",bs.noreferrer="noreferrer",bs.alternate="alternate",bs.author="author",bs.bookmark="bookmark",bs.external="external",bs.help="help",bs.license="license",bs.next="next",bs.nofollow="nofollow",bs.prev="prev",bs.search="search",bs.tag="tag",exports.AuthClientConnectionModes=void 0,(Es=exports.AuthClientConnectionModes||(exports.AuthClientConnectionModes={})).Proxy="Proxy",Es.Direct="Direct",exports.ProductListSortType=void 0,(Ts=exports.ProductListSortType||(exports.ProductListSortType={})).NONE="NONE",Ts.PRICE="PRICE",Ts.PRICE_DESC="PRICE_DESC",Ts.MOST_SOLD="MOST_SOLD",Ts.VOTES="VOTES",Ts.BRAND="BRAND",Ts.LATEST="LATEST",Ts.RELEVANCE="RELEVANCE",Ts.FACET_ORDER="FACET_ORDER",Ts.ALPHABETICAL="ALPHABETICAL",Ts.ALPHABETICAL_DESC="ALPHABETICAL_DESC",Ts.AVAILABLE_STOCK="AVAILABLE_STOCK",Ts.AVAILABLE_STOCK_DESC="AVAILABLE_STOCK_DESC",Ts.TOTAL_STOCK="TOTAL_STOCK",Ts.TOTAL_STOCK_DESC="TOTAL_STOCK_DESC",exports.ProductFilterModeType=void 0,(_s=exports.ProductFilterModeType||(exports.ProductFilterModeType={})).BY_GROUP="BY_GROUP",_s.CURRENT="CURRENT",exports.FilterSystemEntityTypes=void 0,(Ss=exports.FilterSystemEntityTypes||(exports.FilterSystemEntityTypes={})).Brand="Brand",Ss.Category="Category",Ss.Price="Price",Ss.Sku="Sku",Ss.StockStatus="StockStatus",Ss.DiscountCampaign="DiscountCampaign",Ss.DiscountCampaignNumber="DiscountCampaignNumber",Ss.Discount="Discount",Ss.ReducedPrice="ReducedPrice",exports.GeinsCheckoutStatus=void 0,(Os=exports.GeinsCheckoutStatus||(exports.GeinsCheckoutStatus={})).CustomerBlacklistedType="CUSTOMER_BLACKLISTED",Os.OkType="OK",exports.GeinsCustomerType=void 0,(ks=exports.GeinsCustomerType||(exports.GeinsCustomerType={})).OrganizationType="ORGANIZATION",ks.PersonType="PERSON",exports.GeinsDiscountType=void 0,(ws=exports.GeinsDiscountType||(exports.GeinsDiscountType={})).ExternalType="EXTERNAL",ws.NoneType="NONE",ws.PriceCampaignType="PRICE_CAMPAIGN",ws.SalePriceType="SALE_PRICE",exports.GeinsFilterMode=void 0,(xs=exports.GeinsFilterMode||(exports.GeinsFilterMode={})).ByGroupType="BY_GROUP",xs.CurrentType="CURRENT",exports.GeinsGender=void 0,(Is=exports.GeinsGender||(exports.GeinsGender={})).ManType="MAN",Is.UnsetType="UNSET",Is.UnspecifiedType="UNSPECIFIED",Is.WomanType="WOMAN",exports.GeinsGenderType=void 0,(Ns=exports.GeinsGenderType||(exports.GeinsGenderType={})).FemaleType="FEMALE",Ns.MaleType="MALE",Ns.UnknownType="UNKNOWN",exports.GeinsIncludeMode=void 0,(As=exports.GeinsIncludeMode||(exports.GeinsIncludeMode={})).IntersectType="INTERSECT",As.UnionType="UNION",exports.GeinsPaymentCheckout=void 0,(Cs=exports.GeinsPaymentCheckout||(exports.GeinsPaymentCheckout={})).ExternalType="EXTERNAL",Cs.GeinsPayType="GEINS_PAY",Cs.StandardType="STANDARD",exports.GeinsPaymentType=void 0,(Ds=exports.GeinsPaymentType||(exports.GeinsPaymentType={})).AvardaType="AVARDA",Ds.GeinsPayType="GEINS_PAY",Ds.KlarnaType="KLARNA",Ds.StandardType="STANDARD",Ds.SveaType="SVEA",Ds.WalleyType="WALLEY",exports.GeinsProductRelation=void 0,(Rs=exports.GeinsProductRelation||(exports.GeinsProductRelation={})).AccessoriesType="ACCESSORIES",Rs.RelatedType="RELATED",Rs.SimilarType="SIMILAR",exports.GeinsSortType=void 0,(Fs=exports.GeinsSortType||(exports.GeinsSortType={})).AlphabeticalType="ALPHABETICAL",Fs.AlphabeticalDescType="ALPHABETICAL_DESC",Fs.AvailableStockType="AVAILABLE_STOCK",Fs.AvailableStockDescType="AVAILABLE_STOCK_DESC",Fs.BrandType="BRAND",Fs.Custom_1Type="CUSTOM_1",Fs.Custom_2Type="CUSTOM_2",Fs.Custom_3Type="CUSTOM_3",Fs.Custom_4Type="CUSTOM_4",Fs.Custom_5Type="CUSTOM_5",Fs.FacetOrderType="FACET_ORDER",Fs.LatestType="LATEST",Fs.MostSoldType="MOST_SOLD",Fs.NoneType="NONE",Fs.PriceType="PRICE",Fs.PriceDescType="PRICE_DESC",Fs.RelevanceType="RELEVANCE",Fs.TotalStockType="TOTAL_STOCK",Fs.TotalStockDescType="TOTAL_STOCK_DESC",Fs.VotesType="VOTES",exports.DiscountType=void 0,(Ls=exports.DiscountType||(exports.DiscountType={}))[Ls.PERCENTAGE=0]="PERCENTAGE",Ls[Ls.FIXED_AMOUNT=1]="FIXED_AMOUNT",exports.Gender=void 0,(Ps=exports.Gender||(exports.Gender={})).UNSET="unset",Ps.UNSPECIFIED="unspecified",Ps.WOMAN="woman",Ps.MAN="man",exports.PaymentOptionCheckoutType=void 0,(Ms=exports.PaymentOptionCheckoutType||(exports.PaymentOptionCheckoutType={})).STANDARD="STANDARD",Ms.EXTERNAL="EXTERNAL",Ms.GEINS_PAY="GEINS_PAY";var Gs,Bs=function(){function e(e,t,n,r,i){var o=this;this.observer=e,this.operation=t,this.forward=n,this.delayFor=r,this.retryIf=i,this.retryCount=0,this.currentSubscription=null,this.onError=function(e){return c(o,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return this.retryCount+=1,[4,this.retryIf(this.retryCount,this.operation,e)];case 1:return t.sent()?(this.scheduleRetry(this.delayFor(this.retryCount,this.operation,e)),[2]):(this.observer.error(e),[2])}}))}))},this.try()}return e.prototype.cancel=function(){this.currentSubscription&&this.currentSubscription.unsubscribe(),clearTimeout(this.timerId),this.timerId=void 0,this.currentSubscription=null},e.prototype.try=function(){this.currentSubscription=this.forward(this.operation).subscribe({next:this.observer.next.bind(this.observer),error:this.onError,complete:this.observer.complete.bind(this.observer)})},e.prototype.scheduleRetry=function(e){var t=this;if(this.timerId)throw new Error("RetryLink BUG! Encountered overlapping retries");this.timerId=setTimeout((function(){t.timerId=void 0,t.try()}),e)},e}(),Ks=function(e){function t(t){var n=e.call(this)||this,r=t||{},i=r.attempts,o=r.delay;return n.delayFor="function"==typeof o?o:function(e){var t=e||{},n=t.initial,r=void 0===n?300:n,i=t.jitter,o=void 0===i||i,s=t.max,a=void 0===s?1/0:s,c=o?r:r/2;return function(e){var t=Math.min(a,c*Math.pow(2,e));return o&&(t=Math.random()*t),t}}(o),n.retryIf="function"==typeof i?i:function(e){var t=e||{},n=t.retryIf,r=t.max,i=void 0===r?5:r;return function(e,t,r){return!(e>=i)&&(n?n(r,t):!!r)}}(i),n}return o(t,e),t.prototype.request=function(e,t){var n=this;return new Ir((function(r){var i=new Bs(r,e,t,n.delayFor,n.retryIf);return function(){i.cancel()}}))},t}(Zr),zs={main:"https://merchantapi.geins.io/graphql",auth:"https://auth-service.geins.io/api/{ACCOUNT}_{ENV}",auth_sign:"https://merchantapi.geins.io/auth/sign/{API-KEY}?identity=",image:"https://{ACCOUNT}.commerce.services"},Ws="x-request-id",Hs="x-sdk-version",Ys="x-idempotency-key",Js=new Map([["geins-cart","{geins.cartid}"],["geins-pm","{geins.paymentMethodId}"],["geins-pt","{geins.paymentType}"],["geins-uid","{payment.uid}"]]),$s={RAW:"raw",THUMB_SM:"40x40",THUMB:"100x100"};function Xs(){return"object"==typeof globalThis&&!("window"in globalThis)}function Zs(e,t,n){return void 0===n&&(n="prod"),{main:zs.main,auth:zs.auth.replace("{ACCOUNT}",t).replace("{ENV}",n),authSign:zs.auth_sign.replace("{API-KEY}",e),image:zs.image.replace("{ACCOUNT}",t)}}exports.GeinsErrorCode=void 0,(Gs=exports.GeinsErrorCode||(exports.GeinsErrorCode={})).AUTH_FAILED="AUTH_FAILED",Gs.AUTH_TOKEN_EXPIRED="AUTH_TOKEN_EXPIRED",Gs.AUTH_TOKEN_REFRESH_FAILED="AUTH_TOKEN_REFRESH_FAILED",Gs.AUTH_NOT_AUTHENTICATED="AUTH_NOT_AUTHENTICATED",Gs.CART_NOT_FOUND="CART_NOT_FOUND",Gs.CART_ITEM_NOT_FOUND="CART_ITEM_NOT_FOUND",Gs.CART_OPERATION_FAILED="CART_OPERATION_FAILED",Gs.CHECKOUT_FAILED="CHECKOUT_FAILED",Gs.ORDER_FAILED="ORDER_FAILED",Gs.INVALID_ARGUMENT="INVALID_ARGUMENT",Gs.NOT_INITIALIZED="NOT_INITIALIZED",Gs.PARSE_ERROR="PARSE_ERROR",Gs.GRAPHQL_ERROR="GRAPHQL_ERROR",Gs.SERVICE_UNAVAILABLE="SERVICE_UNAVAILABLE",Gs.REQUEST_TIMEOUT="REQUEST_TIMEOUT",Gs.RATE_LIMITED="RATE_LIMITED",Gs.RETRY_EXHAUSTED="RETRY_EXHAUSTED",Gs.NETWORK_ERROR="NETWORK_ERROR";var ea,ta=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.code=n,i.cause=r,i.name="GeinsError",i}return o(t,e),t}(Error);function na(t,n){if(!t)throw new ta("Token is required.",exports.GeinsErrorCode.INVALID_ARGUMENT);var r=t.split(".");if(3!==r.length&&n||2!==r.length&&!n)throw new ta("Invalid JWT token format.",exports.GeinsErrorCode.PARSE_ERROR);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&&e.createHmac("sha256",n).update("".concat(i,".").concat(o)).digest("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")!==s)throw new ta("Invalid token signature.",exports.GeinsErrorCode.AUTH_FAILED);return{header:c,payload:u}}function ra(t,n){if(!t||"object"!=typeof t)throw new ta("Payload must be a valid object.",exports.GeinsErrorCode.INVALID_ARGUMENT);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(t));if(!n)return"".concat(o,".").concat(s);var a=e.createHmac("sha256",n).update("".concat(o,".").concat(s)).digest("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");return"".concat(o,".").concat(s,".").concat(a)}var ia=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}(),oa="undefined"!=typeof process&&"test"===(null===(ea=process.env)||void 0===ea?void 0:ea.NODE_ENV)?exports.GeinsLogLevel.NONE:exports.GeinsLogLevel.WARN,sa=new ia(oa),aa=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}();function ca(e){return p(this,arguments,(function(e,t){var n,r,i,o,s,a,c,l;return void 0===t&&(t={}),u(this,(function(u){switch(u.label){case 0:n=null!==(c=t.take)&&void 0!==c?c:20,r=null!==(l=t.startSkip)&&void 0!==l?l:0,u.label=1;case 1:return[4,h(e(r,n))];case 2:return i=u.sent(),o=i.items,s=i.count,a=r+o.length<s,[4,h({items:o,count:s,hasMore:a,skip:r,take:n})];case 3:return[4,u.sent()];case 4:return u.sent(),a&&0!==o.length?(r+=o.length,[3,1]):[3,5];case 5:return[2]}}))}))}function ua(){return new Zr((function(e,t){var n="undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),r=Date.now();return e.setContext((function(e){var t,i=e.headers;return{headers:s(s({},void 0===i?{}:i),(t={},t[Ws]=n,t[Hs]="0.5.0",t)),requestId:n,requestStartTime:r}})),t(e)}))}var la=function(e){function t(t,n,r,i){var o=e.call(this,t,n,i)||this;return o.requestId=r,o.name="NetworkRequestError",o}return o(t,e),t}(ta),fa=function(e){function t(t,n,r){var i=e.call(this,"Request ".concat(t," timed out after ").concat(n,"ms"),exports.GeinsErrorCode.REQUEST_TIMEOUT,t,r)||this;return i.timeoutMs=n,i.name="TimeoutError",i}return o(t,e),t}(la),ha=function(e){function t(t,n,r){var i=e.call(this,"Request ".concat(t," rate limited").concat(n?" (retry after ".concat(n,"ms)"):""),exports.GeinsErrorCode.RATE_LIMITED,t,r)||this;return i.retryAfterMs=n,i.name="RateLimitError",i}return o(t,e),t}(la),pa=function(e){function t(t,n,r){var i=e.call(this,"Request ".concat(t," failed after ").concat(n," attempts"),exports.GeinsErrorCode.RETRY_EXHAUSTED,t,r)||this;return i.attempts=n,i.name="RetryExhaustedError",i}return o(t,e),t}(la);var da,va,ya=function(){function e(e){var t,n=this;this._totalRequests=0,this._successCount=0,this._errorCount=0,this._timeoutCount=0,this._retryCount=0,this._durations=[],this._timer=null,this._onMetrics=e.onMetrics;var r=null!==(t=e.flushIntervalMs)&&void 0!==t?t:6e4;this._onMetrics&&r>0&&(this._timer=setInterval((function(){return n.flush()}),r),"object"==typeof this._timer&&"unref"in this._timer&&this._timer.unref())}return e.prototype.recordSuccess=function(e){this._totalRequests++,this._successCount++,this._durations.push(e)},e.prototype.recordError=function(e,t){this._totalRequests++,this._errorCount++,t&&this._timeoutCount++,this._durations.push(e)},e.prototype.recordRetry=function(){this._retryCount++},e.prototype.snapshot=function(){var e=f([],this._durations,!0).sort((function(e,t){return e-t})),t=e.length>0?e.reduce((function(e,t){return e+t}),0)/e.length:0,n=Math.max(0,Math.ceil(.95*e.length)-1),r=e.length>0?e[n]:0;return{totalRequests:this._totalRequests,successCount:this._successCount,errorCount:this._errorCount,timeoutCount:this._timeoutCount,retryCount:this._retryCount,avgDurationMs:Math.round(t),p95DurationMs:r}},e.prototype.flush=function(){this._onMetrics&&this._onMetrics(this.snapshot())},e.prototype.reset=function(){this._totalRequests=0,this._successCount=0,this._errorCount=0,this._timeoutCount=0,this._retryCount=0,this._durations=[]},e.prototype.destroy=function(){this._timer&&(clearInterval(this._timer),this._timer=null)},e}();exports.FetchPolicyOptions=void 0,(da=exports.FetchPolicyOptions||(exports.FetchPolicyOptions={})).CACHE_FIRST="cache-first",da.NETWORK_ONLY="network-only",da.CACHE_ONLY="cache-only",da.NO_CACHE="no-cache",da.STANDBY="standby",exports.OperationType=void 0,(va=exports.OperationType||(exports.OperationType={})).QUERY="query",va.MUTATION="mutation";var ma=function(){function e(e){this._telemetry=null,this.fetchPolicy=Xs()?exports.FetchPolicyOptions.NO_CACHE:exports.FetchPolicyOptions.CACHE_FIRST,this.pollInterval=0;var t=e.apiUrl,n=e.apiKey,r=e.fetchPolicy,i=e.settings;this._apolloClient=this.createClient(t,n,i),r&&(this.fetchPolicy=r)}return e.prototype.createClient=function(e,t,n){var r=new qo({typePolicies:{CartType:{fields:{items:{merge:function(e,t){return t}},appliedCampaigns:{merge:function(e,t){return t}}}}}}),i=this.createLinkChain(e,t,n);return new rs({link:i,cache:r})},e.prototype.createLinkChain=function(e,t,n){var r,i,o=null==n?void 0:n.requestConfig,a=[];a.push(ua()),a.push(new Zr((function(e,t){var n=Zt(e.query);return"OperationDefinition"===n.kind&&"mutation"===n.operation&&e.setContext((function(e){var t,n=e.headers;return{headers:s(s({},void 0===n?{}:n),(t={},t[Ys]="undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),t))}})),t(e)})));var c,u=new ia(null!==(r=null==n?void 0:n.logLevel)&&void 0!==r?r:exports.GeinsLogLevel.NONE);a.push(function(e){return new Zr((function(t,n){var r=t.getContext(),i=r.requestId,o=r.requestStartTime,s=t.operationName||"unknown";return e.debug("[".concat(i,"] Starting ").concat(s)),new Ir((function(r){var a=n(t).subscribe({next:function(t){var n=Date.now()-(o||Date.now());e.debug("[".concat(i,"] ").concat(s," completed in ").concat(n,"ms")),r.next(t)},error:function(t){var n=Date.now()-(o||Date.now());e.error("[".concat(i,"] ").concat(s," failed after ").concat(n,"ms: ").concat(t.message)),r.error(t)},complete:function(){r.complete()}});return function(){return a.unsubscribe()}}))}))}(u)),(null==o?void 0:o.interceptors)&&a.push((c=o.interceptors,new Zr((function(e,t){return new Ir((function(n){var r=e.getContext(),i=r.requestId||"unknown",o=r.requestStartTime||Date.now(),a=e.operationName||"unknown",u=function(){var s=t(e).subscribe({next:function(e){if(c.onResponse){var t={requestId:i,operationName:a,durationMs:Date.now()-o,data:e.data};try{c.onResponse(t)}catch(e){}}n.next(e)},error:function(e){if(c.onError){var t={requestId:i,operationName:a,durationMs:Date.now()-o,error:e,retryCount:r.retryCount||0};try{c.onError(t)}catch(e){}}n.error(e)},complete:function(){n.complete()}});return s};if(c.onRequest){var l,f=s({},r.headers||{}),h={requestId:i,operationName:a,headers:f,timestamp:o};try{var p=c.onRequest(h);p&&"function"==typeof p.then?p.then((function(){e.setContext((function(){return s(s({},r),{headers:h.headers})})),l=u()})).catch((function(e){n.error(e)})):(e.setContext((function(){return s(s({},r),{headers:h.headers})})),l=u())}catch(e){return void n.error(e)}return function(){null==l||l.unsubscribe()}}var d=u();return function(){return d.unsubscribe()}}))}))));var l,f=null!==(i=null==o?void 0:o.timeoutMs)&&void 0!==i?i:0;f>0&&a.push(function(e){return new Zr((function(t,n){return e<=0?n(t):new Ir((function(r){var i=!1,o=setTimeout((function(){if(!i){i=!0;var n=t.getContext().requestId;r.error(new fa(n||"unknown",e))}}),e),s=n(t).subscribe({next:function(e){i||r.next(e)},error:function(e){i||(i=!0,clearTimeout(o),r.error(e))},complete:function(){i||(i=!0,clearTimeout(o),r.complete())}});return function(){i=!0,clearTimeout(o),s.unsubscribe()}}))}))}(f)),(null==o?void 0:o.telemetry)&&(this._telemetry=new ya(o.telemetry),a.push((l=this._telemetry,new Zr((function(e,t){return new Ir((function(n){var r=e.getContext().requestStartTime||Date.now(),i=t(e).subscribe({next:function(e){l.recordSuccess(Date.now()-r),n.next(e)},error:function(e){var t="TimeoutError"===(null==e?void 0:e.name);l.recordError(Date.now()-r,t),n.error(e)},complete:function(){n.complete()}});return function(){return i.unsubscribe()}}))}))))),(null==o?void 0:o.retry)&&a.push(this.createRetryLink(o.retry));var h=vi({uri:e,headers:{Accept:"application/json","x-apikey":t}});return a.push(h),Zr.from(a)},e.prototype.createRetryLink=function(e){var t=e.maxRetries,n=void 0===t?3:t,r=e.initialDelayMs,i=void 0===r?300:r,o=e.maxDelayMs,s=void 0===o?1e4:o,a=e.jitter;return new Ks({delay:{initial:i,max:s,jitter:void 0===a||a},attempts:{max:n+1,retryIf:function(e){var t;if(!e)return!1;var n=e,r=n.response,i=null!==(t=n.statusCode)&&void 0!==t?t:null==r?void 0:r.status;return 429===i||(!i||i>=500)}}})},e.prototype.getClient=function(){return this._apolloClient},Object.defineProperty(e.prototype,"telemetry",{get:function(){return this._telemetry},enumerable:!1,configurable:!0}),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.buildContext=function(e){if(e)return{headers:{Authorization:"Bearer ".concat(e)}}},e.prototype.runQuery=function(e){return c(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return u(this,(function(c){return t=e.query,n=e.queryAsString,r=e.variables,i=e.requestOptions,o=e.userToken,s=t||fs(n||""),a=i||{},[2,this._apolloClient.query({query:s,variables:r,fetchPolicy:this.getFetchPolicy(exports.OperationType.QUERY,a.fetchPolicy),pollInterval:a.pollInterval||this.pollInterval,context:this.buildContext(o)})]}))}))},e.prototype.runMutation=function(e){return c(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return u(this,(function(c){return t=e.query,n=e.queryAsString,r=e.variables,i=e.requestOptions,o=e.userToken,s=t||fs(n||""),a=i||{},[2,this._apolloClient.mutate({mutation:s,variables:r,fetchPolicy:this.getFetchPolicy(exports.OperationType.MUTATION,a.fetchPolicy),context:this.buildContext(o)})]}))}))},e}(),ga=function(){function e(e){this.baseUrl="https://mgmtapi.geins.io",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}(),ba=function(){function e(e,t){if(this._apiClient=e,!t.channel)throw new ta("Channel is required",exports.GeinsErrorCode.INVALID_ARGUMENT);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 ta("Language is required",exports.GeinsErrorCode.INVALID_ARGUMENT);t.languageId=this._geinsSettings.locale}if(!t.marketId){if(!this._geinsSettings.market)throw new ta("Market is required",exports.GeinsErrorCode.INVALID_ARGUMENT);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 ta("Merchant API Client is not set",exports.GeinsErrorCode.NOT_INITIALIZED);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[4,this.runQuery(e)];case 1:return t=r.sent(),n=this.cleanObject(t),[2,this.parseResult(n)]}}))}))},e.prototype.runMutation=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){if(!this._apiClient)throw new ta("Merchant API Client is not set",exports.GeinsErrorCode.NOT_INITIALIZED);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}(),Ea=function(){function e(e){if(this.core=e,!e)throw new ta("Core is required",exports.GeinsErrorCode.NOT_INITIALIZED);if(!e.client)throw new ta("Merchant API Client is not set",exports.GeinsErrorCode.NOT_INITIALIZED);if(!e.geinsSettings)throw new ta("Settings are required",exports.GeinsErrorCode.NOT_INITIALIZED);var t=e.geinsSettings;this._geinsSettings=t,this._apiClient=function(){return e.client}}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}(),Ta=function(e){function t(t,n,r){void 0===n&&(n=exports.GeinsErrorCode.AUTH_FAILED);var i=e.call(this,t,n,r)||this;return i.name="AuthError",i}return o(t,e),t}(ta),_a=function(e){function t(t,n){void 0===t&&(t="Token has expired");var r=e.call(this,t,exports.GeinsErrorCode.AUTH_TOKEN_EXPIRED,n)||this;return r.name="TokenExpiredError",r}return o(t,e),t}(Ta),Sa=function(e){function t(t,n){void 0===t&&(t="Token refresh failed");var r=e.call(this,t,exports.GeinsErrorCode.AUTH_TOKEN_REFRESH_FAILED,n)||this;return r.name="TokenRefreshError",r}return o(t,e),t}(Ta),Oa=function(e){function t(t,n,r){void 0===n&&(n=exports.GeinsErrorCode.CART_OPERATION_FAILED);var i=e.call(this,t,n,r)||this;return i.name="CartError",i}return o(t,e),t}(ta),ka=function(e){function t(t,n,r){void 0===n&&(n=exports.GeinsErrorCode.CHECKOUT_FAILED);var i=e.call(this,t,n,r)||this;return i.name="CheckoutError",i}return o(t,e),t}(ta),wa=function(e){function t(t,n,r){void 0===n&&(n=exports.GeinsErrorCode.ORDER_FAILED);var i=e.call(this,t,n,r)||this;return i.name="OrderError",i}return o(t,e),t}(ta),xa={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 Ia(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){Ia(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){Ia(e,t)})),e.definitions&&e.definitions.forEach((function(e){Ia(e,t)}))}xa.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 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}}xa.definitions.forEach((function(e){if(e.name){var t=new Set;Ia(e,t),Na[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=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=Aa(e,t);r&&n.definitions.push(r)}))}(xa,"ChannelFields");var Ca={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 Da(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){Da(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){Da(e,t)})),e.definitions&&e.definitions.forEach((function(e){Da(e,t)}))}Ca.loc.source={body:"fragment LanguageFields on LanguageType {\n id\n name\n code\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var Ra={};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;Da(e,t),Ra[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=Ra[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),(Ra[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=Fa(e,t);r&&n.definitions.push(r)}))}(Ca,"LanguageFields");var La={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 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)}))}La.loc.source={body:"fragment CurrencyFields on CurrencyType {\n code\n symbol\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var Ma={};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}}La.definitions.forEach((function(e){if(e.name){var t=new Set;Pa(e,t),Ma[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=Ma[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),(Ma[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=qa(e,t);r&&n.definitions.push(r)}))}(La,"CurrencyFields");var ja={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 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)}))}ja.loc.source={body:"fragment CountryFields on CountryType {\n name\n code\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var Va={};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}}ja.definitions.forEach((function(e){if(e.name){var t=new Set;Ua(e,t),Va[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=Va[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),(Va[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=Qa(e,t);r&&n.definitions.push(r)}))}(ja,"CountryFields");var Ga={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}};Ga.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 Ba={};function Ka(e){return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!Ba[t]&&(Ba[t]=!0,!0)}))}function za(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){za(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){za(e,t)})),e.definitions&&e.definitions.forEach((function(e){za(e,t)}))}Ga.definitions=Ga.definitions.concat(Ka(La.definitions)),Ga.definitions=Ga.definitions.concat(Ka(ja.definitions)),Ga.definitions=Ga.definitions.concat(Ka(Ca.definitions));var Wa={};function Ha(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;za(e,t),Wa[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[Ha(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=Wa[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),(Wa[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=Ha(e,t);r&&n.definitions.push(r)}))}(Ga,"MarketFields");var Ya={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}};Ya.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 Ja={};function $a(e){return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!Ja[t]&&(Ja[t]=!0,!0)}))}function Xa(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){Xa(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){Xa(e,t)})),e.definitions&&e.definitions.forEach((function(e){Xa(e,t)}))}Ya.definitions=Ya.definitions.concat($a(xa.definitions)),Ya.definitions=Ya.definitions.concat($a(Ca.definitions)),Ya.definitions=Ya.definitions.concat($a(Ga.definitions)),Ya.definitions=Ya.definitions.concat($a(La.definitions));var Za={};function ec(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;Xa(e,t),Za[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[ec(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=Za[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),(Za[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=ec(e,t);r&&n.definitions.push(r)}))}(Ya,"getChannel");var tc={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}};tc.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 nc={};function rc(e){return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!nc[t]&&(nc[t]=!0,!0)}))}function ic(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){ic(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){ic(e,t)})),e.definitions&&e.definitions.forEach((function(e){ic(e,t)}))}tc.definitions=tc.definitions.concat(rc(xa.definitions)),tc.definitions=tc.definitions.concat(rc(Ca.definitions)),tc.definitions=tc.definitions.concat(rc(Ga.definitions)),tc.definitions=tc.definitions.concat(rc(La.definitions));var oc={};function sc(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}}tc.definitions.forEach((function(e){if(e.name){var t=new Set;ic(e,t),oc[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[sc(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=oc[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),(oc[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=sc(e,t);r&&n.definitions.push(r)}))}(tc,"getChannels");var ac={channels:tc,channel:Ya};function cc(e){if(!e||!e.id)throw new ta("Invalid result structure for channel",exports.GeinsErrorCode.PARSE_ERROR);return{id:e.id,name:e.name,type:e.type,url:e.url,defaultMarketId:e.defaultMarketId,defaultLanguageId:e.defaultLanguageId,markets:e.markets?e.markets.filter((function(e){return null!=e})).map((function(e){return{id:(t=e).id,alias:t.alias,allowedLanguages:t.allowedLanguages?t.allowedLanguages.filter((function(e){return null!=e})).map((function(e){return lc(e)})):[],country:t.country?uc(t.country):{name:"",code:""},currency:t.currency?fc(t.currency):{code:"",symbol:"",name:"",rate:0},onlyDisplayInCheckout:t.onlyDisplayInCheckout,virtual:t.virtual,groupKey:t.groupKey,defaultLanguageId:t.defaultLanguageId};var t})):[],languages:e.languages?e.languages.filter((function(e){return null!=e})).map((function(e){return lc(e)})):[]}}function uc(e){return{name:e.name,code:e.code}}function lc(e){return{id:e.id,name:e.name,code:e.code}}function fc(e){return{code:e.code,symbol:e.symbol,name:e.name,rate:e.rate}}var hc,pc=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.cache=new aa(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:ac.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 ta("Invalid result structure for channel",exports.GeinsErrorCode.PARSE_ERROR);var t=e.data.channel;if(t)return cc(t);sa.warn("No channel found")}(e)},t}(ba),dc=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.cache=new aa(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:ac.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 ta("Invalid result structure for channels",exports.GeinsErrorCode.PARSE_ERROR);var t=e.data.channels;if(t&&0!==t.length)return t.map((function(e){return cc(e)})).filter((function(e){return void 0!==e}));sa.warn("No channel found")}(e)},t}(ba),vc=function(){function e(e){this.path="/",this.domain="",this.secure=!0,this.httpOnly=!0,this.sameSite="lax",this.cookie=t(),this.maxAge=0,e&&(e.path&&(this.path=e.path),e.domain&&(this.domain=e.domain),void 0!==e.secure&&(this.secure=e.secure),void 0!==e.httpOnly&&(this.httpOnly=e.httpOnly),void 0!==e.sameSite&&(this.sameSite=e.sameSite),void 0!==e.maxAge&&(this.maxAge=this.parseMaxAge(e.maxAge)))}return e.prototype.getConfig=function(){return{path:this.path,domain:this.domain,secure:this.secure,httpOnly:this.httpOnly,sameSite:this.sameSite,maxAge:this.maxAge}},e.prototype.parseMaxAge=function(e){if("string"==typeof e){var t=parseInt(e,10);return isNaN(t)?0:t}return e},e.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}},e.prototype.getAll=function(){return this.cookie.getAll()},e.prototype.get=function(e){return this.cookie.get(e)||""},e.prototype.remove=function(e){this.cookie.remove(e)},e.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)},e}(),yc=function(){function e(e){this._cookieService=null!=e?e:new vc}return e.prototype.get=function(e){return this._cookieService.get(e)||void 0},e.prototype.set=function(e,t,n){this._cookieService.set({name:e,payload:t,maxAge:null==n?void 0:n.maxAge})},e.prototype.remove=function(e){this._cookieService.remove(e)},e}(),mc={exports:{}};var gc,bc=(hc||(hc=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}(mc)),mc.exports),Ec=eo(bc),Tc=function(){function e(){this.eventName="geins-event",this.emitter=new Ec,this.broadcastChannelId="geins-channel",Xs()||(this.broadcast=new n.BroadcastChannel(this.broadcastChannelId),this.addBroadcastListener())}return e.prototype.addBroadcastListener=function(){var e=this;this.broadcast&&(this.broadcast.onmessage=function(t){var n=t;e.emitter.emit(n.eventName,n.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}(),_c=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,o=s({},e);if(!e.query&&!e.queryAsString)throw new ta("Query or queryAsString is required",exports.GeinsErrorCode.INVALID_ARGUMENT);try{e.queryAsString&&!e.query&&(o.query=fs(e.queryAsString))}catch(e){throw new ta("Error parsing string to query",exports.GeinsErrorCode.PARSE_ERROR,e)}var a=o.query,c=a.definitions[0];if(!(c&&"OperationDefinition"===c.kind&&(null!==(n=null===(t=c.variableDefinitions)||void 0===t?void 0:t.length)&&void 0!==n?n:0)>0))return o;o.variables=this.createVariables(null!==(r=o.variables)&&void 0!==r?r:{});var u=(null===(i=a.definitions[0].variableDefinitions)||void 0===i?void 0:i.map((function(e){return e.variable.name.value})))||[];return Object.keys(o.variables).forEach((function(e){u.includes(e)||delete o.variables[e]})),o},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&&sa.debug("[Geins] queryOptions: ".concat(JSON.stringify(t))),[4,this.runQuery(t)];case 2:return n=i.sent(),r=this.cleanObject(n),[2,this.parseResult(r)]}}))}))},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&&sa.debug("[Geins] mutation options: ".concat(JSON.stringify(e))),[4,this.runMutation(e)];case 1:return t=n.sent(),[2,this.parseResult(t)]}}))}))},t.prototype.parseResult=function(e){var t=e;if(null==t?void 0:t.data)return t.data;if(null==t?void 0:t.errors)throw new ta("GraphQL errors",exports.GeinsErrorCode.GRAPHQL_ERROR,t.errors);return null},t}(ba),Sc=function(){function e(){this._store=new Map}return e.prototype.get=function(e){return this._store.get(e)},e.prototype.set=function(e,t,n){this._store.set(e,t)},e.prototype.remove=function(e){this._store.delete(e)},e.prototype.clear=function(){this._store.clear()},e}();!function(e){e[e.INIT=0]="INIT",e[e.FETCHING=1]="FETCHING",e[e.READY=2]="READY",e[e.ERROR=3]="ERROR"}(gc||(gc={}));var Oc=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}(),kc=function(){function e(e){if(this.geinsSettings=e,!e.channel)throw new ta("Channel is required",exports.GeinsErrorCode.INVALID_ARGUMENT);if(!e.apiKey)throw new ta("API Key is required",exports.GeinsErrorCode.INVALID_ARGUMENT);this.store=new Oc,this.channelId="".concat(e.channel,"|").concat(e.tld),this.cache=new aa(36e5),this.initApiClient()}return e.prototype.initApiClient=function(){if(!this.geinsSettings.apiKey||!this.geinsSettings.accountName)throw new ta("API Key and Account Name are required",exports.GeinsErrorCode.INVALID_ARGUMENT);var e={apiUrl:Zs(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 ma(e)}},e.prototype.initChannelService=function(){var e=this;this.channelService=new pc((function(){return e._apiClient()}),this.geinsSettings)},e.prototype.setKey=function(e,t){if(!this.store)throw new ta("Store is not initialized",exports.GeinsErrorCode.NOT_INITIALIZED);this.store.setKey(e,t)},e.prototype.getKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){if(!this.store)throw new ta("Store is not initialized",exports.GeinsErrorCode.NOT_INITIALIZED);return[2,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}(),wc=function(){function e(e){if(!e.channel)throw new ta("Channel is required",exports.GeinsErrorCode.INVALID_ARGUMENT);if(!e.apiKey)throw new ta("API Key is required",exports.GeinsErrorCode.INVALID_ARGUMENT);if(!e.accountName)throw new ta("Account name is required",exports.GeinsErrorCode.INVALID_ARGUMENT);this._geinsSettings=s(s({},{environment:"prod"}),e),this._geinsSettings.apiKey&&this._geinsSettings.accountName&&(this._endpointsUrls=Zs(this._geinsSettings.apiKey,this._geinsSettings.accountName,this._geinsSettings.environment)),Xs()||(this._cookieService=new vc),this._currentChannel=new kc(this._geinsSettings),this._eventService=new Tc}return e.prototype.initApiClient=function(){if(!this._geinsSettings.apiKey||!this._geinsSettings.accountName)throw new ta("Failed to initialize API Client",exports.GeinsErrorCode.NOT_INITIALIZED);var e={apiUrl:this._endpointsUrls.main,apiKey:this._geinsSettings.apiKey,settings:this._geinsSettings};this._apiClient=new ma(e)},e.prototype.initGraphQLService=function(){var e=this;this._graphQLService=new _c((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 kc(this._geinsSettings)),!this._currentChannel)throw new ta("Failed to initialize channel",exports.GeinsErrorCode.NOT_INITIALIZED);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 dc((function(){return t.client}),this._geinsSettings)),[2,null!==(e=this._accountChannels.get())&&void 0!==e?e:void 0]}))}))},Object.defineProperty(e.prototype,"endpoints",{get:function(){if(!this._endpointsUrls)throw new ta("Endpoints are not set",exports.GeinsErrorCode.NOT_INITIALIZED);return this._endpointsUrls},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"client",{get:function(){if(!this._endpointsUrls)throw new ta("Endpoints are not set",exports.GeinsErrorCode.NOT_INITIALIZED);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 vc),this._cookieService},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"telemetry",{get:function(){var e,t;return null!==(t=null===(e=this._apiClient)||void 0===e?void 0:e.telemetry)&&void 0!==t?t:null},enumerable:!1,configurable:!0}),e.encodeJWT=function(e,t){return ra(e,t)},e.decodeJWT=function(e,t){return na(e,t).payload},e}();function xc(e,t,n,r){return e&&r?"".concat(e,"/").concat(t,"/").concat(n,"/").concat(encodeURIComponent(r)):""}exports.AUTH_HEADERS={REFRESH_TOKEN:"x-auth-refresh-token"},exports.AUTH_STORAGE_KEYS={USER:"geins-user",USER_AUTH:"geins-auth",USER_TYPE:"geins-user-type",USER_MAX_AGE:"geins-user-maxage",REFRESH_TOKEN:"geins-auth-refresh-token"},exports.AUTH_STORAGE_MAX_AGE={DEFAULT:1800,REMEMBER_USER:604800},exports.AuthError=Ta,exports.BaseApiService=ba,exports.BasePackage=Ea,exports.CART_STORAGE_KEYS={CART_ID:"geins-cart-id"},exports.CART_STORAGE_MAX_AGE={DEFAULT:604800},exports.CHECKOUT_PARAMETERS=Js,exports.CartError=Oa,exports.Channel=kc,exports.CheckoutError=ka,exports.CookieService=vc,exports.CookieStorageAdapter=yc,exports.EventService=Tc,exports.GEINS_IMAGE_FOLDER=$s,exports.GeinsCore=wc,exports.GeinsError=ta,exports.GraphQLService=_c,exports.Logger=ia,exports.ManagementApiClient=ga,exports.MemoryStorage=Sc,exports.MerchantApiClient=ma,exports.NetworkRequestError=la,exports.OrderError=wa,exports.RateLimitError=ha,exports.RetryExhaustedError=pa,exports.TelemetryCollector=ya,exports.TimeoutError=fa,exports.TokenExpiredError=_a,exports.TokenRefreshError=Sa,exports.buildEndpoints=Zs,exports.buildGeinsImageUrl=xc,exports.buildGeinsRawUrl=function(e,t,n){return xc(e,t,$s.RAW,n)},exports.buildGeinsThumbnailUrl=function(e,t,n){return xc(e,t,$s.THUMB,n)},exports.decodeJWT=na,exports.encodeJWT=ra,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){var i=t;if(n in i){if(void 0===r)return i;if(i[n]===r)return i}for(var o=0,s=Object.keys(i);o<s.length;o++){var a=e(i[s[o]],n,r);if(a)return a}}},exports.gql=fs,exports.isServerContext=Xs,exports.paginate=ca,exports.paginateAll=function(e){return c(this,arguments,void 0,(function(e,t){var n,r,i,o,s,a,c,l,f,h;return void 0===t&&(t={}),u(this,(function(u){switch(u.label){case 0:n=[],u.label=1;case 1:u.trys.push([1,6,7,12]),r=!0,i=d(ca(e,t)),u.label=2;case 2:return[4,i.next()];case 3:if(o=u.sent(),c=o.done)return[3,5];h=o.value,r=!1,s=h,n.push.apply(n,s.items),u.label=4;case 4:return r=!0,[3,2];case 5:return[3,12];case 6:return a=u.sent(),l={error:a},[3,12];case 7:return u.trys.push([7,,10,11]),r||c||!(f=i.return)?[3,9]:[4,f.call(i)];case 8:u.sent(),u.label=9;case 9:return[3,11];case 10:if(l)throw l.error;return[7];case 11:return[7];case 12:return[2,n]}}))}))},exports.parseErrorMessage=function(e){return e&&e.message?e.message:""},exports.sdkLogger=sa;