From 5aca2d266de58dd798945e2d3328a088cf6e0b53 Mon Sep 17 00:00:00 2001 From: Johan Fagerberg Date: Mon, 16 May 2022 18:10:08 +0200 Subject: [PATCH 01/11] fix: prepend protocols to auto-origin Fixes an issue where auto-detected origins didn't have protocols prepended This would cause express to not attach the CORS headers because the request origin (https://example.com) didn't match the given origin (example.com) See comment in electerious/Ackee#330 --- src/serverless.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/serverless.js b/src/serverless.js index dbda6149..f48e64f4 100644 --- a/src/serverless.js +++ b/src/serverless.js @@ -21,7 +21,10 @@ const apolloServer = createApolloServer(ApolloServer, { const origin = (origin, callback) => { if (config.autoOrigin === true) { fullyQualifiedDomainNames() - .then((names) => callback(null, names)) + .then((names) => callback( + null, + names.flatMap((name) => [ `http://${ name }`, `https://${ names }`, name ]), + )) .catch((error) => callback(error, false)) return } From 730679937863433f44d46ce0c499155cb9b649b4 Mon Sep 17 00:00:00 2001 From: Johan Fagerberg Date: Mon, 16 May 2022 18:19:12 +0200 Subject: [PATCH 02/11] debug: add logging to ensure auto-origin is fixed --- src/serverless.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/serverless.js b/src/serverless.js index f48e64f4..b11d5b08 100644 --- a/src/serverless.js +++ b/src/serverless.js @@ -59,5 +59,7 @@ exports.handler = (event, context) => { }, }) - return handler(event, context) + const response = handler(event, context) + response.then((value) => console.log('Response', value)) + return response } \ No newline at end of file From e455f7bb60d671ad0e6769f64f0ec9898ee9e4cb Mon Sep 17 00:00:00 2001 From: Johan Fagerberg Date: Mon, 16 May 2022 18:23:00 +0200 Subject: [PATCH 03/11] debug: log qualified domains that we return --- src/serverless.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/serverless.js b/src/serverless.js index b11d5b08..d05c4883 100644 --- a/src/serverless.js +++ b/src/serverless.js @@ -21,10 +21,13 @@ const apolloServer = createApolloServer(ApolloServer, { const origin = (origin, callback) => { if (config.autoOrigin === true) { fullyQualifiedDomainNames() - .then((names) => callback( - null, - names.flatMap((name) => [ `http://${ name }`, `https://${ names }`, name ]), - )) + .then((names) => { + console.log('Got qualified domains', names) + return callback( + null, + names.flatMap((name) => [ `http://${ name }`, `https://${ names }`, name ]), + ) + }) .catch((error) => callback(error, false)) return } From 7f4a0047f3eb1d4654620554315c09368641adc4 Mon Sep 17 00:00:00 2001 From: Johan Fagerberg Date: Mon, 16 May 2022 18:24:31 +0200 Subject: [PATCH 04/11] fix: typo in returned domains --- src/serverless.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serverless.js b/src/serverless.js index d05c4883..c2b5b591 100644 --- a/src/serverless.js +++ b/src/serverless.js @@ -25,7 +25,7 @@ const origin = (origin, callback) => { console.log('Got qualified domains', names) return callback( null, - names.flatMap((name) => [ `http://${ name }`, `https://${ names }`, name ]), + names.flatMap((name) => [ `http://${ name }`, `https://${ name }`, name ]), ) }) .catch((error) => callback(error, false)) From c562806a3894f1b440fe8477d4e6c6a236690bd1 Mon Sep 17 00:00:00 2001 From: Johan Fagerberg Date: Mon, 16 May 2022 18:26:26 +0200 Subject: [PATCH 05/11] debug: remove logging --- src/serverless.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/serverless.js b/src/serverless.js index c2b5b591..85a408f4 100644 --- a/src/serverless.js +++ b/src/serverless.js @@ -21,13 +21,10 @@ const apolloServer = createApolloServer(ApolloServer, { const origin = (origin, callback) => { if (config.autoOrigin === true) { fullyQualifiedDomainNames() - .then((names) => { - console.log('Got qualified domains', names) - return callback( - null, - names.flatMap((name) => [ `http://${ name }`, `https://${ name }`, name ]), - ) - }) + .then((names) => callback( + null, + names.flatMap((name) => [ `http://${ name }`, `https://${ name }`, name ]), + )) .catch((error) => callback(error, false)) return } @@ -62,7 +59,5 @@ exports.handler = (event, context) => { }, }) - const response = handler(event, context) - response.then((value) => console.log('Response', value)) - return response + return handler(event, context) } \ No newline at end of file From 5cb6d4ec4b9af7b70591739329af45b92bad3a51 Mon Sep 17 00:00:00 2001 From: Johan Fagerberg Date: Mon, 16 May 2022 18:38:48 +0200 Subject: [PATCH 06/11] fix: convert multiValueHeaders to headers on Vercel The polyfill to run AWS Lambda API functions on Vercel currently doesn't support .multiValueHeaders. This works around that by converting them to .headers if they only have a single value Fixes electerious/Ackee#330 --- api/index.js | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/api/index.js b/api/index.js index 1f442cd8..a96cc1d0 100644 --- a/api/index.js +++ b/api/index.js @@ -1,5 +1,7 @@ 'use strict' +const handler = require('../src/serverless').handler + /** * A serverless function handler for the '/api' route, for use with Vercel. * This handler follows the AWS Lambda API; Vercel deployments are opted-in @@ -9,4 +11,28 @@ * - https://vercel.com/docs/serverless-functions/supported-languages#node.js * - https://vercel.com/docs/runtimes#advanced-usage/advanced-node-js-usage/aws-lambda-api */ -exports.handler = require('../src/serverless').handler \ No newline at end of file +exports.handler = async (...args) => { + const response = await handler(...args) + return convertMultiValueHeaders(response) +} + +/* + * At the time of writing the Vercel polyfill for the AWS Lambda API doesn't support .multiValueHeaders + * This stops us from attaching CORS headers to requests + * Since all the headers we commonly attach have a single value, we can map them to .headers instead + */ +const convertMultiValueHeaders = (response) => { + if (!(response instanceof Object) || !('multiValueHeaders' in response)) { + console.log('No multiValueHeaders, not converting') + return response + } + response.headers = response.headers || {} + for (const [ key, value ] of Object.entries(response.multiValueHeaders)) { + if (value.length === 1) { + response.headers[key] = value[0] + } else { + console.warn(`multiValueHeaders is currently unsupported on Vercel. Header ${key} will be ignored`) + } + } + return response +} \ No newline at end of file From 202ac2c68ca1c6cfc4cb8ba0982baa622c7e48b0 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Thu, 19 May 2022 13:34:21 +0530 Subject: [PATCH 07/11] netlify.toml Bump NODE_VERSION 14.9.0 -> 14.16.0 --- netlify.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netlify.toml b/netlify.toml index 8e5b9a59..cc1c1187 100644 --- a/netlify.toml +++ b/netlify.toml @@ -2,7 +2,7 @@ publish = "dist" command = "yarn build" functions = "functions/" - environment = { NODE_VERSION = "14.9.0", NODE_ENV = "production" } + environment = { NODE_VERSION = "14.16.0", NODE_ENV = "production" } [[redirects]] from = "/api" @@ -15,4 +15,4 @@ ACKEE_USERNAME = "ACKEE_USERNAME" ACKEE_PASSWORD = "ACKEE_PASSWORD" ACKEE_ALLOW_ORIGIN = "ACKEE_ALLOW_ORIGIN" - ACKEE_AUTO_ORIGIN = "ACKEE_AUTO_ORIGIN" \ No newline at end of file + ACKEE_AUTO_ORIGIN = "ACKEE_AUTO_ORIGIN" From 8d0cae6fc08e752598f4632ffddcb359537cbb27 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Thu, 19 May 2022 13:51:17 +0530 Subject: [PATCH 08/11] Set NODE_VERSION to 14.19.0 1:47:31 PM: error eslint@8.10.0: The engine "node" is incompatible with this module. Expected version "^12.22.0 || ^14.17.0 || >=16.0.0". Got "14.16.0" --- netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index cc1c1187..a24767ff 100644 --- a/netlify.toml +++ b/netlify.toml @@ -2,7 +2,7 @@ publish = "dist" command = "yarn build" functions = "functions/" - environment = { NODE_VERSION = "14.16.0", NODE_ENV = "production" } + environment = { NODE_VERSION = "14.19.0", NODE_ENV = "production" } [[redirects]] from = "/api" From 184a7263bbc3b08c0d03692808fa646e922b1c84 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sat, 21 May 2022 15:03:12 +0200 Subject: [PATCH 09/11] Adjust code style --- api/index.js | 18 +++++++++--------- src/serverless.js | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/api/index.js b/api/index.js index a96cc1d0..fc7f6058 100644 --- a/api/index.js +++ b/api/index.js @@ -17,22 +17,22 @@ exports.handler = async (...args) => { } /* - * At the time of writing the Vercel polyfill for the AWS Lambda API doesn't support .multiValueHeaders - * This stops us from attaching CORS headers to requests - * Since all the headers we commonly attach have a single value, we can map them to .headers instead + * At the time of writing the Vercel polyfill for the AWS Lambda API doesn't support .multiValueHeaders. + * This stops us from attaching CORS headers to requests. + * Since all the headers we commonly attach have a single value, we can map them to .headers instead. */ const convertMultiValueHeaders = (response) => { - if (!(response instanceof Object) || !('multiValueHeaders' in response)) { - console.log('No multiValueHeaders, not converting') - return response - } - response.headers = response.headers || {} + if (response?.multiValueHeaders == null) return response + + response.headers = response.headers ?? {} + for (const [ key, value ] of Object.entries(response.multiValueHeaders)) { if (value.length === 1) { response.headers[key] = value[0] } else { - console.warn(`multiValueHeaders is currently unsupported on Vercel. Header ${key} will be ignored`) + console.warn(`multiValueHeaders is currently unsupported on Vercel. Header ${ key } will be ignored.`) } } + return response } \ No newline at end of file diff --git a/src/serverless.js b/src/serverless.js index 85a408f4..b84bb4b2 100644 --- a/src/serverless.js +++ b/src/serverless.js @@ -44,7 +44,7 @@ const origin = (origin, callback) => { } exports.handler = (event, context) => { - // Set request context which is missing on Vercel + // Set request context which is missing on Vercel: // https://stackoverflow.com/questions/71360059/apollo-server-lambda-unable-to-determine-event-source-based-on-event if (event.requestContext == null) event.requestContext = context From 6a1436313243d060307e95d55221ead4f9b085b6 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sat, 21 May 2022 15:08:51 +0200 Subject: [PATCH 10/11] Update changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38136762..cd2ada0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [3.4.1] - 2022-05-21 + +## Fixed + +- Build failing on Netlify (thanks @adityatelange, #333) +- Vercel not attaching CORS headers because of unsupported `multiValueHeaders` (thanks @birjj, #330) +- `ACKEE_AUTO_ORIGIN` not attaching CORS headers (thanks @birjj, #330) + ## [3.4.0] - 2022-05-15 ### Added From 2b905b9820368083944eddc30da92ea150328dec Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sat, 21 May 2022 15:12:17 +0200 Subject: [PATCH 11/11] Update version --- dist/index.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index a0898ce7..19e6a91e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -89,7 +89,7 @@ function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},ih=L.useState,ah=L.us * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -n((function(e,t){}));var fh=n((function(e){e.exports=ch})),dh=Object.prototype,ph=dh.toString,hh=dh.hasOwnProperty,mh=Function.prototype.toString,vh=new Map;function yh(e,t){try{return gh(e,t)}finally{vh.clear()}}function gh(e,t){if(e===t)return!0;var n,r,i,a=ph.call(e);if(a!==ph.call(t))return!1;switch(a){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(kh(e,t))return!0;var o=bh(e),s=bh(t),l=o.length;if(l!==s.length)return!1;for(var u=0;u=0&&n.indexOf(r,i)===i))}return!1}function bh(e){return Object.keys(e).filter(wh,e)}function wh(e){return void 0!==this[e]}var Eh="{ [native code] }";function kh(e,t){var n=vh.get(e);if(n){if(n.has(t))return!0}else vh.set(e,n=new Set);return n.add(t),!1}function _h(e){return new Np((function(t){t.error(e)}))}var Sh=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 xh(e,t){return t?t(e):Np.of()}function Th(e){return"function"==typeof e?new Nh(e):e}function Oh(e){return e.request.length<=1}var Ch=function(e){function t(t,n){var r=e.call(this,t)||this;return r.link=n,r}return Vc(t,e),t}(Error),Nh=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return Np.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(Th).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,n,r){var i=Th(n),a=Th(r||new e(xh));return Oh(i)&&Oh(a)?new e((function(e){return t(e)?i.request(e)||Np.of():a.request(e)||Np.of()})):new e((function(e,n){return t(e)?i.request(e,n)||Np.of():a.request(e,n)||Np.of()}))},e.execute=function(e,t){return e.request(function(e,t){var n=$c({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){n=$c($c({},n),"function"==typeof e?e(n):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return $c({},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?$d(t.query)||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(e);n=300&&Sh(t,n,"Response not successful: Received status code ".concat(t.status)),Array.isArray(n)||Ah.call(n,"data")||Ah.call(n,"errors")||Sh(t,n,"Server response was missing for query '".concat(Array.isArray(e)?e.map((function(e){return e.operationName})):e.operationName,"'.")),n}))}}var Lh=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var r=__DEV__?new Gc("Network request failed. ".concat(t," is not serializable: ").concat(e.message)):new Gc(21);throw r.parseError=e,r}return n},qh={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},jh=function(e,t){return t(e)};function zh(e,t){for(var n=[],r=2;rthis.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var 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)},e}(),um=new am,cm=Object.prototype.hasOwnProperty,fm=void 0===(sm=Array.from)?function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t}:sm;function dm(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var pm=[];function hm(e,t){if(!e)throw new Error(t||"assertion failure")}function mm(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var vm=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!bm(this))return ym(this),this.value[0]},e.prototype.recompute=function(e){return hm(!this.recomputing,"already recomputing"),ym(this),bm(this)?function(e,t){Tm(e),um.withValue(e,gm,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{dm(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,bm(e))return;Em(e)}(e);return mm(e.value)}(this,e):mm(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,wm(this),dm(this))},e.prototype.dispose=function(){var e=this;this.setDirty(),Tm(this),km(this,(function(t,n){t.setDirty(),Om(t,e)}))},e.prototype.forget=function(){this.dispose()},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=pm.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(fm(this.deps).forEach((function(t){return t.delete(e)})),this.deps.clear(),pm.push(this.deps),this.deps=null)},e.count=0,e}();function ym(e){var t=um.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),bm(e)?_m(t,e):Sm(t,e),t}function gm(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function bm(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function wm(e){km(e,_m)}function Em(e){km(e,Sm)}function km(e,t){var n=e.parents.size;if(n)for(var r=fm(e.parents),i=0;i0&&n===t.length&&e[n-1]===t[n-1]}(n,t.value)||e.setDirty(),xm(e,t),bm(e)||Em(e)}function xm(e,t){var n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(pm.length<100&&pm.push(n),e.dirtyChildren=null))}function Tm(e){e.childValues.size>0&&e.childValues.forEach((function(t,n){Om(e,n)})),e.forgetDeps(),hm(null===e.dirtyChildren)}function Om(e,t){t.parents.delete(e),e.childValues.delete(t),xm(e,t)}var Cm={setDirty:!0,dispose:!0,forget:!0};function Nm(e){var t=new Map,n=e&&e.subscribe;function r(e){var r=um.getValue();if(r){var i=t.get(e);i||t.set(e,i=new Set),r.dependOn(i),"function"==typeof n&&(dm(i),i.unsubscribe=n(e))}}return r.dirty=function(e,n){var r=t.get(e);if(r){var i=n&&cm.call(Cm,n)?n:"setDirty";fm(r).forEach((function(e){return e[i]()})),t.delete(e),dm(r)}},r}function Rm(){var e=new Zh("function"==typeof WeakMap);return function(){return e.lookupArray(arguments)}}Rm();var Dm=new Set;function Im(e,t){void 0===t&&(t=Object.create(null));var n=new lm(t.max||Math.pow(2,16),(function(e){return e.dispose()})),r=t.keyArgs,i=t.makeCacheKey||Rm(),a=function(){var a=i.apply(null,r?r.apply(null,arguments):arguments);if(void 0===a)return e.apply(null,arguments);var o=n.get(a);o||(n.set(a,o=new vm(e)),o.subscribe=t.subscribe,o.forget=function(){return n.delete(a)});var s=o.recompute(Array.prototype.slice.call(arguments));return n.set(a,o),Dm.add(n),um.hasValue()||(Dm.forEach((function(e){return e.clean()})),Dm.clear()),s};function o(e){var t=n.get(e);t&&t.setDirty()}function s(e){var t=n.get(e);if(t)return t.peek()}function l(e){return n.delete(e)}return Object.defineProperty(a,"size",{get:function(){return n.map.size},configurable:!1,enumerable:!1}),a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))},a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))},a.forgetKey=l,a.forget=function(){return l(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=r?function(){return i.apply(null,r.apply(null,arguments))}:i,Object.freeze(a)}var Pm,Fm=function(){function e(){this.getFragmentDoc=Im(Sd)}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.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read($c($c({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read($c($c({},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=Qc(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,a=Qc(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(a,{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($c($c({},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($c($c({},e),{data:i})),i)}})},e}();Pm||(Pm={});var Am=function(e,t,n,r){this.message=e,this.path=t,this.query=n,this.variables=r},Mm=Object.prototype.hasOwnProperty;function Lm(e,t){var n=e.__typename,r=e.id,i=e._id;if("string"==typeof n&&(t&&(t.keyObject=void 0!==r?{id:r}:void 0!==i?{_id:i}:void 0),void 0===r&&(r=i),void 0!==r))return"".concat(n,":").concat("number"==typeof r||"string"==typeof r?r:JSON.stringify(r))}var qm={dataIdFromObject:Lm,addTypename:!0,resultCaching:!0,canonizeResults:!1};function jm(e){var t=e.canonizeResults;return void 0===t?qm.canonizeResults:t}var zm=/^[_a-z][_0-9a-z]*/i;function Vm(e){var t=e.match(zm);return t?t[0]:e}function $m(e,t,n){return!!Od(t)&&(Um(t)?t.every((function(t){return $m(e,t,n)})):e.selections.every((function(e){if(qd(e)&&Ed(e,n)){var r=Md(e);return Mm.call(t,r)&&(!e.selectionSet||$m(e.selectionSet,t[r],n))}return!0})))}function Qm(e){return Od(e)&&!Nd(e)&&!Um(e)}var Um=function(e){return Array.isArray(e)},Bm=Object.create(null),Wm=function(){return Bm},Km=Object.create(null),Hm=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 Mp(Nd(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return Nd(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return Cd(e);if(Nd(e))return e;var r=n.policies.identify(e)[0];if(r){var i=Cd(r);return t&&n.merge(r,e),i}}}return e.prototype.toObject=function(){return $c({},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),Mm.call(this.data,e)){var n=this.data[e];if(n&&Mm.call(n,t))return n[t]}return"__typename"===t&&Mm.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof Xm?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),Mm.call(this.data,e)?this.data[e]:this instanceof Xm?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var n,r=this;Nd(e)&&(e=e.__ref),Nd(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(n=e):e,a="string"==typeof t?this.lookup(n=t):t;if(a){__DEV__?Jc("string"==typeof n,"store.merge expects a string ID"):Jc("string"==typeof n,1);var o=new sp(ev).merge(i,a);if(this.data[n]=o,o!==i&&(delete this.refs[n],this.group.caching)){var s=Object.create(null);i||(s.__exists=1),Object.keys(a).forEach((function(e){if(!i||i[e]!==o[e]){s[e]=1;var t=Vm(e);t===e||r.policies.hasKeyArgs(o.__typename,t)||(s[t]=1),void 0!==o[e]||r instanceof Xm||delete o[e]}})),!s.__typename||i&&i.__typename||this.policies.rootTypenamesById[n]!==o.__typename||delete s.__typename,Object.keys(s).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),a=!1,o=!0,s={DELETE:Bm,INVALIDATE:Km,isReference:Nd,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||Cd(e)}:t,{store:n})}};if(Object.keys(r).forEach((function(l){var u=Vm(l),c=r[l];if(void 0!==c){var f="function"==typeof t?t:t[l]||t[u];if(f){var d=f===Wm?Bm:f(Mp(c),$c($c({},s),{fieldName:u,storeFieldName:l,storage:n.getStorage(e,l)}));d===Km?n.group.dirty(e,l):(d===Bm&&(d=void 0),d!==c&&(i[l]=d,a=!0,c=d))}void 0!==c&&(o=!1)}})),a)return this.merge(e,i),o&&(this instanceof Xm?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 a=this.getFieldValue(i,"__typename"),o=t&&n?this.policies.getStoreFieldName({typename:a,fieldName:t,args:n}):t;return this.modify(e,o?((r={})[o]=Wm,r):Wm)}return!1},e.prototype.evict=function(e,t){var n=!1;return e.id&&(Mm.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Xm&&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){Mm.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&&Mm.call(e,n)||t.delete(n)})),e){var n=e.__META,r=Qc(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 Xm?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){Mm.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 Xm;)i=i.parent;r.forEach((function(e){return i.delete(e)}))}return r},e.prototype.findChildRefIds=function(e){if(!Mm.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){Nd(e)&&(t[e.__ref]=!0),Od(e)&&Object.keys(e).forEach((function(t){var n=e[t];Od(n)&&r.add(n)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),Ym=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?Nm():null,this.keyMaker=new Zh(jp)},e.prototype.depend=function(e,t){if(this.d){this.d(Gm(e,t));var n=Vm(t);n!==t&&this.d(Gm(e,n)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(Gm(e,t),"__exists"===t?"forget":"setDirty")},e}();function Gm(e,t){return t+"#"+e}function Jm(e,t){tv(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,a=t.seed,o=e.call(this,n,new Ym(i))||this;return o.stump=new Zm(o),o.storageTrie=new Zh(jp),a&&o.replace(a),o}return Vc(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}(Hm||(Hm={}));var Xm=function(e){function t(t,n,r,i){var a=e.call(this,n.policies,i)||this;return a.id=t,a.parent=n,a.replay=r,a.group=i,r(a),a}return Vc(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){yh(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 $c($c({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return Mm.call(this.data,t)?$c($c({},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}(Hm),Zm=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new Ym(t.group.caching,t.group))||this}return Vc(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},t}(Xm);function ev(e,t,n){var r=e[n],i=t[n];return yh(r,i)?r:i}function tv(e){return!!(e instanceof Hm&&e.group.caching)}var nv,rv,iv=function(){function e(){this.known=new(zp?WeakSet:Set),this.pool=new Zh(jp),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return Od(e)&&this.known.has(e)},e.prototype.pass=function(e){if(Od(e)){var t=function(e){return Od(e)?Um(e)?e.slice(0):$c({__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(Od(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(s=this.pool.lookupArray(r)).array||(this.known.add(s.array=r),__DEV__&&Object.freeze(r)),s.array;case null:case Object.prototype:if(this.known.has(e))return e;var i=Object.getPrototypeOf(e),a=[i],o=this.sortedKeys(e);a.push(o.json);var s,l=a.length;if(o.sorted.forEach((function(n){a.push(t.admit(e[n]))})),!(s=this.pool.lookupArray(a)).object){var u=s.object=Object.create(i);this.known.add(u),o.sorted.forEach((function(e,t){u[e]=a[l+t]})),__DEV__&&Object.freeze(u)}return s.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}(),av=Object.assign((function(e){if(Od(e)){void 0===nv&&ov();var t=nv.admit(e),n=rv.get(t);return void 0===n&&rv.set(t,n=JSON.stringify(t)),n}return JSON.stringify(e)}),{reset:ov});function ov(){nv=new iv,rv=new(jp?WeakMap:Map)}function sv(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var lv=function(){function e(e){var t=this;this.knownResults=new(jp?WeakMap:Map),this.config=Kp(e,{addTypename:!1!==e.addTypename,canonizeResults:jm(e)}),this.canon=e.canon||new iv,this.executeSelectionSet=Im((function(e){var n,r=e.context.canonizeResults,i=sv(e);i[3]=!r;var a=(n=t.executeSelectionSet).peek.apply(n,i);return a?r?$c($c({},a),{result:t.canon.admit(a.result)}):a:(Jm(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize,keyArgs:sv,makeCacheKey:function(e,t,n,r){if(tv(n.store))return n.store.makeCacheKey(e,Nd(t)?t.__ref:t,n.varString,r)}}),this.executeSubSelectedArray=Im((function(e){return Jm(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var t=e.field,n=e.array,r=e.context;if(tv(r.store))return r.store.makeCacheKey(t,n,r.varString)}})}return e.prototype.resetCanon=function(){this.canon=new iv},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,r=e.rootId,i=void 0===r?"ROOT_QUERY":r,a=e.variables,o=e.returnPartialData,s=void 0===o||o,l=e.canonizeResults,u=void 0===l?this.config.canonizeResults:l,c=this.config.cache.policies;a=$c($c({},Wd(Ud(n))),a);var f,d=Cd(i),p=new sp,h=this.executeSelectionSet({selectionSet:Bd(n).selectionSet,objectOrReference:d,enclosingRef:d,context:{store:t,query:n,policies:c,variables:a,varString:av(a),canonizeResults:u,fragmentMap:xd(Qd(n)),merge:function(e,t){return p.merge(e,t)}}});if(h.missing&&(f=[new Am(uv(h.missing),h.missing,n,a)],!s))throw f[0];return{result:h.result,complete:!f,missing:f}},e.prototype.isFresh=function(e,t,n,r){if(tv(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,a=e.context;if(Nd(r)&&!a.policies.rootTypenamesById[r.__ref]&&!a.store.has(r.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(r.__ref," object")};var o,s=a.variables,l=a.policies,u=a.store.getFieldValue(r,"__typename"),c={};function f(e,t){var n;return e.missing&&(o=a.merge(o,((n={})[t]=e.missing,n))),e.result}this.config.addTypename&&"string"==typeof u&&!l.rootIdsByTypename[u]&&(c={__typename:u});var d=new Set(n.selections);d.forEach((function(e){var n,p;if(Ed(e,s))if(qd(e)){var h=l.readField({fieldName:e.name.value,field:e,variables:a.variables,from:r},a),m=Md(e);void 0===h?Zd.added(e)||(o=a.merge(o,((n={})[m]="Can't find field '".concat(e.name.value,"' on ").concat(Nd(r)?r.__ref+" object":"object "+JSON.stringify(r,null,2)),n))):Um(h)?h=f(t.executeSubSelectedArray({field:e,array:h,enclosingRef:i,context:a}),m):e.selectionSet?null!=h&&(h=f(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:h,enclosingRef:Nd(h)?h:i,context:a}),m)):a.canonizeResults&&(h=t.canon.pass(h)),void 0!==h&&(c=a.merge(c,((p={})[m]=h,p)))}else{var v=Td(e,a.fragmentMap);v&&l.fragmentMatches(v,u)&&v.selectionSet.selections.forEach(d.add,d)}}));var p={result:c,missing:o},h=a.canonizeResults?this.canon.admit(p):Mp(p);return h.result&&this.knownResults.set(h.result,n),h},e.prototype.execSubSelectedArrayImpl=function(e){var t,n=this,r=e.field,i=e.array,a=e.enclosingRef,o=e.context;function s(e,n){var r;return e.missing&&(t=o.merge(t,((r={})[n]=e.missing,r))),e.result}return r.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map((function(e,t){return null===e?null:Um(e)?s(n.executeSubSelectedArray({field:r,array:e,enclosingRef:a,context:o}),t):r.selectionSet?s(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,enclosingRef:Nd(e)?e:a,context:o}),t):(__DEV__&&function(e,t,n){if(!t.selectionSet){var r=new Set([n]);r.forEach((function(n){Od(n)&&(__DEV__?Jc(!Nd(n),"Missing selection set for object of type ".concat(function(e,t){return Nd(t)?e.get(t.__ref,"__typename"):t&&t.__typename}(e,n)," returned for query field ").concat(t.name.value)):Jc(!Nd(n),5),Object.values(n).forEach(r.add,r))}))}}(o.store,r,e),e)})),{result:o.canonizeResults?this.canon.admit(i):i,missing:t}},e}();function uv(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var cv=new am,fv=new WeakMap;function dv(e){var t=fv.get(e);return t||fv.set(e,t={vars:new Set,dep:Nm()}),t}function pv(e){dv(e).vars.forEach((function(t){return t.forgetCache(e)}))}function hv(e){var t=new Set,n=new Set,r=function(a){if(arguments.length>0){if(e!==a){e=a,t.forEach((function(e){dv(e).dep.dirty(r),mv(e)}));var o=Array.from(n);n.clear(),o.forEach((function(t){return t(e)}))}}else{var s=cv.getValue();s&&(i(s),dv(s).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),dv(e).vars.add(r),r};return r.forgetCache=function(e){return t.delete(e)},r}function mv(e){e.broadcastWatches&&e.broadcastWatches()}var vv=Object.create(null);function yv(e){var t=JSON.stringify(e);return vv[t]||(vv[t]=Object.create(null))}function gv(e){var t=yv(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,n){var r=function(e,t){return n.readField(t,e)},i=n.keyObject=wv(e,(function(e){var i=_v(n.storeObject,e,r);return void 0===i&&t!==n.storeObject&&Mm.call(t,e[0])&&(i=_v(t,e,kv)),__DEV__?Jc(void 0!==i,"Missing field '".concat(e.join("."),"' while extracting keyFields from ").concat(JSON.stringify(t))):Jc(void 0!==i,2),i}));return"".concat(n.typename,":").concat(JSON.stringify(i))})}function bv(e){var t=yv(e);return t.keyArgsFn||(t.keyArgsFn=function(t,n){var r=n.field,i=n.variables,a=n.fieldName,o=wv(e,(function(e){var n=e[0],a=n.charAt(0);if("@"!==a)if("$"!==a){if(t)return _v(t,e)}else{var o=n.slice(1);if(i&&Mm.call(i,o)){var s=e.slice(0);return s[0]=o,_v(i,s)}}else if(r&&Bp(r.directives)){var l=n.slice(1),u=r.directives.find((function(e){return e.name.value===l})),c=u&&Ad(u,i);return c&&_v(c,e.slice(1))}})),s=JSON.stringify(o);return(t||"{}"!==s)&&(a+=":"+s),a})}function wv(e,t){var n=new sp;return Ev(e).reduce((function(e,r){var i,a=t(r);if(void 0!==a){for(var o=r.length-1;o>=0;--o)(i={})[r[o]]=a,a=i;e=n.merge(e,a)}return e}),Object.create(null))}function Ev(e){var t=yv(e);if(!t.paths){var n=t.paths=[],r=[];e.forEach((function(t,i){Um(t)?(Ev(t).forEach((function(e){return n.push(r.concat(e))})),r.length=0):(r.push(t),Um(e[i+1])||(n.push(r.slice(0)),r.length=0))}))}return t.paths}function kv(e,t){return e[t]}function _v(e,t,n){return n=n||kv,Sv(t.reduce((function e(t,r){return Um(t)?t.map((function(t){return e(t,r)})):t&&n(t,r)}),e))}function Sv(e){return Od(e)?Um(e)?e.map(Sv):wv(Object.keys(e).sort(),(function(t){return _v(e,t)})):e}function xv(e){return void 0!==e.args?e.args:e.field?Ad(e.field,e.variables):null}Id.setStringify(av);var Tv=function(){},Ov=function(e,t){return t.fieldName},Cv=function(e,t,n){return(0,n.mergeObjects)(e,t)},Nv=function(e,t){return t},Rv=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=$c({dataIdFromObject:Lm},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 a,o=t&&t.storeObject||e,s=$c($c({},t),{typename:i,storeObject:o,readField:t&&t.readField||function(){var e=Iv(arguments,o);return r.readField(e,{store:r.cache.data,variables:e.variables})}}),l=i&&this.getTypePolicy(i),u=l&&l.keyFn||this.config.dataIdFromObject;u;){var c=u(e,s);if(!Um(c)){a=c;break}u=gv(c)}return a=a?String(a):void 0,s.keyObject?[a,s.keyObject]:[a]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(n){var r=e[n],i=r.queryType,a=r.mutationType,o=r.subscriptionType,s=Qc(r,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",n),a&&t.setRootTypename("Mutation",n),o&&t.setRootTypename("Subscription",n),Mm.call(t.toBeAdded,n)?t.toBeAdded[n].push(s):t.toBeAdded[n]=[s]}))},e.prototype.updateTypePolicy=function(e,t){var n=this,r=this.getTypePolicy(e),i=t.keyFields,a=t.fields;function o(e,t){e.merge="function"==typeof t?t:!0===t?Cv:!1===t?Nv:e.merge}o(r,t.merge),r.keyFn=!1===i?Tv:Um(i)?gv(i):"function"==typeof i?i:r.keyFn,a&&Object.keys(a).forEach((function(t){var r=n.getFieldPolicy(e,t,!0),i=a[t];if("function"==typeof i)r.read=i;else{var s=i.keyArgs,l=i.read,u=i.merge;r.keyFn=!1===s?Ov:Um(s)?bv(s):"function"==typeof s?s:r.keyFn,"function"==typeof l&&(r.read=l),o(r,u)}r.read&&r.merge&&(r.keyFn=r.keyFn||Ov)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(__DEV__?Jc(!r||r===e,"Cannot change root ".concat(e," __typename more than once")):Jc(!r||r===e,3),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(zm);r&&r[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!Mm.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var r=this.supertypeMap.get(e);r&&r.size&&r.forEach((function(e){var r=t.getTypePolicy(e),i=r.fields,a=Qc(r,["fields"]);Object.assign(n,a),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 a=e.typeCondition.name.value;if(t===a)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(a))for(var o=this.getSupertypeSet(t,!0),s=[o],l=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},u=!(!n||!this.fuzzySubtypes.size),c=!1,f=0;f1?s:t}:(r=$c({},o),Mm.call(r,"from")||(r.from=t)),__DEV__&&void 0===r.from&&__DEV__&&Jc.warn("Undefined 'from' passed to readField with arguments ".concat((i=Array.from(e),a=Yp("stringifyForDisplay"),JSON.stringify(i,(function(e,t){return void 0===t?a:t})).split(JSON.stringify(a)).join("")))),void 0===r.variables&&(r.variables=n),r}function Pv(e){return function(t,n){if(Um(t)||Um(n))throw __DEV__?new Gc("Cannot automatically merge arrays"):new Gc(4);if(Od(t)&&Od(n)){var r=e.getFieldValue(t,"__typename"),i=e.getFieldValue(n,"__typename");if(r&&i&&r!==i)return n;if(Nd(t)&&Qm(n))return e.merge(t.__ref,n),t;if(Qm(t)&&Nd(n))return e.merge(t,n.__ref),n;if(Qm(t)&&Qm(n))return $c($c({},t),n)}return n}}function Fv(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:$c($c({},e),{clientOnly:t,deferred:n})),i}var Av=function(){function e(e,t){this.cache=e,this.reader=t}return e.prototype.writeToStore=function(e,t){var n=this,r=t.query,i=t.result,a=t.dataId,o=t.variables,s=t.overwrite,l=Vd(r),u=new sp;o=$c($c({},Wd(l)),o);var c={store:e,written:Object.create(null),merge:function(e,t){return u.merge(e,t)},variables:o,varString:av(o),fragmentMap:xd(Qd(r)),overwrite:!!s,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map},f=this.processSelectionSet({result:i||Object.create(null),dataId:a,selectionSet:l.selectionSet,mergeTree:{map:new Map},context:c});if(!Nd(f))throw __DEV__?new Gc("Could not identify object ".concat(JSON.stringify(i))):new Gc(6);return c.incomingById.forEach((function(t,r){var i=t.storeObject,a=t.mergeTree,o=t.fieldNodeSet,s=Cd(r);if(a&&a.map.size){var l=n.applyMerges(a,s,i,c);if(Nd(l))return;i=l}if(__DEV__&&!c.overwrite){var u=Object.create(null);o.forEach((function(e){e.selectionSet&&(u[e.name.value]=!0)}));Object.keys(i).forEach((function(e){(function(e){return!0===u[Vm(e)]})(e)&&!function(e){var t=a&&a.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},a=i(e);if(!a)return;var o=i(t);if(!o)return;if(Nd(a))return;if(yh(a,o))return;if(Object.keys(a).every((function(e){return void 0!==r.getFieldValue(o,e)})))return;var s=r.getFieldValue(e,"__typename")||r.getFieldValue(t,"__typename"),l=Vm(n),u="".concat(s,".").concat(l);if(Vv.has(u))return;Vv.add(u);var c=[];Um(a)||Um(o)||[a,o].forEach((function(e){var t=r.getFieldValue(e,"__typename");"string"!=typeof t||c.includes(t)||c.push(t)}));__DEV__&&Jc.warn("Cache data may be lost when replacing the ".concat(l," field of a ").concat(s," object.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(c.length?"either ensure all objects of type "+c.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(u," field, so InMemoryCache can safely merge these objects:\n\n existing: ").concat(JSON.stringify(a).slice(0,1e3),"\n incoming: ").concat(JSON.stringify(o).slice(0,1e3),"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"))}(s,i,e,c.store)}))}e.merge(r,i)})),e.retain(f.__ref),f},e.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,r=e.result,i=e.selectionSet,a=e.context,o=e.mergeTree,s=this.cache.policies,l=Object.create(null),u=n&&s.rootTypenamesById[n]||Ld(r,i,a.fragmentMap)||n&&a.store.get(n,"__typename");"string"==typeof u&&(l.__typename=u);var c=function(){var e=Iv(arguments,l,a.variables);if(Nd(e.from)){var t=a.incomingById.get(e.from.__ref);if(t){var n=s.readField($c($c({},e),{from:t.storeObject}),a);if(void 0!==n)return n}}return s.readField(e,a)},f=new Set;this.flattenFields(i,r,a,u).forEach((function(e,n){var i,a=Md(n),d=r[a];if(f.add(n),void 0!==d){var p=s.getStoreFieldName({typename:u,fieldName:n.name.value,field:n,variables:e.variables}),h=Lv(o,p),m=t.processFieldValue(d,n,n.selectionSet?Fv(e,!1,!1):e,h),v=void 0;n.selectionSet&&(Nd(m)||Qm(m))&&(v=c("__typename",m));var y=s.getMergeFunction(u,n.name.value,v);y?h.info={field:n,typename:u,merge:y}:zv(o,p),l=e.merge(l,((i={})[p]=m,i))}else!__DEV__||e.clientOnly||e.deferred||Zd.added(n)||s.getReadFunction(u,n.name.value)||__DEV__&&Jc.error("Missing field '".concat(Md(n),"' while writing result ").concat(JSON.stringify(r,null,2)).substring(0,1e3))}));try{var d=s.identify(r,{typename:u,selectionSet:i,fragmentMap:a.fragmentMap,storeObject:l,readField:c}),p=d[0],h=d[1];n=n||p,h&&(l=a.merge(l,h))}catch(e){if(!n)throw e}if("string"==typeof n){var m=Cd(n),v=a.written[n]||(a.written[n]=[]);if(v.indexOf(i)>=0)return m;if(v.push(i),this.reader&&this.reader.isFresh(r,m,i,a))return m;var y=a.incomingById.get(n);return y?(y.storeObject=a.merge(y.storeObject,l),y.mergeTree=qv(y.mergeTree,o),f.forEach((function(e){return y.fieldNodeSet.add(e)}))):a.incomingById.set(n,{storeObject:l,mergeTree:jv(o)?void 0:o,fieldNodeSet:f}),m}return l},e.prototype.processFieldValue=function(e,t,n,r){var i=this;return t.selectionSet&&null!==e?Um(e)?e.map((function(e,a){var o=i.processFieldValue(e,t,n,Lv(r,a));return zv(r,a),o})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):__DEV__?Pp(e):e},e.prototype.flattenFields=function(e,t,n,r){void 0===r&&(r=Ld(t,e,n.fragmentMap));var i=new Map,a=this.cache.policies,o=new Zh(!1);return function e(s,l){var u=o.lookup(s,l.clientOnly,l.deferred);u.visited||(u.visited=!0,s.selections.forEach((function(o){if(Ed(o,n.variables)){var s=l.clientOnly,u=l.deferred;if(s&&u||!Bp(o.directives)||o.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(s=!0),"defer"===t){var r=Ad(e,n.variables);r&&!1===r.if||(u=!0)}})),qd(o)){var c=i.get(o);c&&(s=s&&c.clientOnly,u=u&&c.deferred),i.set(o,Fv(n,s,u))}else{var f=Td(o,n.fragmentMap);f&&a.fragmentMatches(f,r,t,n.variables)&&e(f.selectionSet,Fv(n,s,u))}}})))}(e,n),i},e.prototype.applyMerges=function(e,t,n,r,i){var a,o=this;if(e.map.size&&!Nd(n)){var s,l=Um(n)||!Nd(t)&&!Qm(t)?void 0:t,u=n;l&&!i&&(i=[Nd(l)?l.__ref:l]);var c=function(e,t){return Um(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){var n=c(l,t),a=c(u,t);if(void 0!==a){i&&i.push(t);var f=o.applyMerges(e,n,a,r,i);f!==a&&(s=s||new Map).set(t,f),i&&Jc(i.pop()===t)}})),s&&(n=Um(u)?u.slice(0):$c({},u),s.forEach((function(e,t){n[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,i&&(a=r.store).getStorage.apply(a,i)):n},e}(),Mv=[];function Lv(e,t){var n=e.map;return n.has(t)||n.set(t,Mv.pop()||{map:new Map}),n.get(t)}function qv(e,t){if(e===t||!t||jv(t))return e;if(!e||jv(e))return t;var n=e.info&&t.info?$c($c({},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 a=new Set(t.map.keys());e.map.forEach((function(e,n){i.map.set(n,qv(e,t.map.get(n))),a.delete(n)})),a.forEach((function(n){i.map.set(n,qv(t.map.get(n),e.map.get(n)))}))}return i}function jv(e){return!e||!(e.info||e.map.size)}function zv(e,t){var n=e.map,r=n.get(t);r&&jv(r)&&(Mv.push(r),n.delete(t))}var Vv=new Set;var $v,Qv=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=hv,n.txCount=0,n.config=function(e){return Kp(qm,e)}(t),n.addTypename=!!n.config.addTypename,n.policies=new Rv({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return Vc(t,e),t.prototype.init=function(){var e=this.data=new Hm.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;this.storeWriter=new Av(this,this.storeReader=new lv({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:jm(this.config),canon:e?void 0:n&&n.canon})),this.maybeBroadcastWatch=Im((function(e,n){return t.broadcastWatch(e,n)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var n=e.optimistic?t.optimisticData:t.data;if(tv(n)){var r=e.optimistic,i=e.rootId,a=e.variables;return n.makeCacheKey(e.query,e.callback,av({optimistic:r,rootId:i,variables:a}))}}}),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($c($c({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(e){if(e instanceof Am)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(Mm.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($c($c({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t=this;return this.watches.size||function(e){dv(e).vars.forEach((function(t){return t.attachCache(e)}))}(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&pv(t),t.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){av.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},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(Nd(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){__DEV__&&Jc.warn(e)}},t.prototype.evict=function(e){if(!e.id){if(Mm.call(e,"id"))return!1;e=$c($c({},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(),av.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),pv(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,a=void 0===i||i,o=e.removeOptimistic,s=e.onWatchUpdated,l=function(e){var i=n,a=i.data,o=i.optimisticData;++n.txCount,e&&(n.data=n.optimisticData=e);try{return t=r(n)}finally{--n.txCount,n.data=a,n.optimisticData=o}},u=new Set;return s&&!this.txCount&&this.broadcastWatches($c($c({},e),{onWatchUpdated:function(e){return u.add(e),!1}})),"string"==typeof a?this.optimisticData=this.optimisticData.addLayer(a,l):!1===a?l(this.data):l(),"string"==typeof o&&(this.optimisticData=this.optimisticData.removeLayer(o)),s&&u.size?(this.broadcastWatches($c($c({},e),{onWatchUpdated:function(e,t){var n=s.call(this,e,t);return!1!==n&&u.delete(e),n}})),u.size&&u.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){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=Zd(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(n){return t.maybeBroadcastWatch(n,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&&yh(n.result,r.result)||e.callback(e.lastDiff=r,n)},t}(Fm);function Uv(e){return!!e&&e<7}!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"}($v||($v={}));var Bv=Object.assign,Wv=Object.hasOwnProperty,Kv=function(e){function t(t){var n=t.queryManager,r=t.queryInfo,i=t.options,a=e.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=Yv)}catch(e){}var n=!a.observers.size;a.observers.add(e);var r=a.last;return r&&r.error?e.error&&e.error(r.error):r&&r.result&&e.next&&e.next(r.result),n&&a.reobserve().catch((function(){})),function(){a.observers.delete(e)&&!a.observers.size&&a.tearDownQuery()}}))||this;a.observers=new Set,a.subscriptions=new Set,a.queryInfo=r,a.queryManager=n,a.isTornDown=!1,a.options=$c({initialFetchPolicy:i.fetchPolicy||"cache-first"},i),a.queryId=r.queryId||n.generateQueryId();var o=Vd(a.query);return a.queryName=o&&o.name&&o.name.value,a}return Vc(t,e),Object.defineProperty(t.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},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.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),n=this.queryInfo.networkStatus||t&&t.networkStatus||$v.ready,r=$c($c({},t),{loading:Uv(n),networkStatus:n}),i=this.options.fetchPolicy,a=void 0===i?"cache-first":i;if("network-only"===a||"no-cache"===a||"standby"===a||this.queryManager.transform(this.options.query).hasForcedResolvers);else{var o=this.queryInfo.getDiff();(o.complete||this.options.returnPartialData)&&(r.data=o.result),yh(r.data,{})&&(r.data=void 0),o.complete?(delete r.partial,!o.complete||r.networkStatus!==$v.loading||"cache-first"!==a&&"cache-only"!==a||(r.networkStatus=$v.ready,r.loading=!1)):r.partial=!0,!__DEV__||o.complete||this.options.partialRefetch||r.loading||r.data||r.error||Gv(o.missing)}return e&&this.updateLastResult(r),r},t.prototype.isDifferentFromLastResult=function(e){return!this.last||!yh(this.last.result,e)},t.prototype.getLast=function(e,t){var n=this.last;if(n&&n[e]&&(!t||yh(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",__DEV__&&e&&Wv.call(e,"variables")){var i=Ud(this.query),a=i.variableDefinitions;a&&a.some((function(e){return"variables"===e.variable.name.value}))||__DEV__&&Jc.warn("Called refetch(".concat(JSON.stringify(e),") for query ").concat((null===(t=i.name)||void 0===t?void 0:t.value)||JSON.stringify(i),", which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?"))}return e&&!yh(this.options.variables,e)&&(n.variables=this.options.variables=$c($c({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(n,$v.refetch)},t.prototype.fetchMore=function(e){var t=this,n=$c($c({},e.query?e:$c($c($c($c({},this.options),{query:this.query}),e),{variables:$c($c({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),r=this.queryManager.generateQueryId(),i=this.queryInfo,a=i.networkStatus;i.networkStatus=$v.fetchMore,n.notifyOnNetworkStatusChange&&this.observe();var o=new Set;return this.queryManager.fetchQuery(r,n,$v.fetchMore).then((function(s){return t.queryManager.removeQuery(r),i.networkStatus===$v.fetchMore&&(i.networkStatus=a),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:s.data,variables:n.variables})})):r.writeQuery({query:n.query,variables:n.variables,data:s.data})},onWatchUpdated:function(e){o.add(e.query)}}),s})).finally((function(){o.has(t.query)||Hv(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):__DEV__&&Jc.error("Unhandled GraphQL subscription error",t)}});return this.subscriptions.add(n),function(){t.subscriptions.delete(n)&&n.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.setVariables=function(e){return yh(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},$v.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,a=void 0===i?r:i;"function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(r,{reason:e,options:t,observable:this,initialFetchPolicy:a}):t.fetchPolicy="variables-changed"===e?a:t.nextFetchPolicy}return t.fetchPolicy},t.prototype.fetch=function(e,t){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,e,t)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,n=this.options.pollInterval;if(n){if(!t||t.interval!==n){__DEV__?Jc(n,"Attempted to start a polling query without a polling interval."):Jc(n,10),(t||(this.pollingInfo={})).interval=n;var r=function(){e.pollingInfo&&(Uv(e.queryInfo.networkStatus)?i():e.reobserve({fetchPolicy:"network-only"},$v.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){return void 0===t&&(t=this.variables),this.last=$c($c({},this.last),{result:this.queryManager.assumeImmutableResults?e:Pp(e),variables:t}),Bp(e.errors)||delete this.last.error,this.last},t.prototype.reobserve=function(e,t){var n=this;this.isTornDown=!1;var r=t===$v.refetch||t===$v.fetchMore||t===$v.poll,i=this.options.variables,a=this.options.fetchPolicy,o=Gp(this.options,e||{}),s=r?o:Bv(this.options,o);r||(this.updatePolling(),!e||!e.variables||yh(e.variables,i)||e.fetchPolicy&&e.fetchPolicy!==a||(this.applyNextFetchPolicy("variables-changed",s),void 0===t&&(t=$v.setVariables)));var l=s.variables&&$c({},s.variables),u=this.fetch(s,t),c={next:function(e){n.reportResult(e,l)},error:function(e){n.reportError(e,l)}};return r||(this.concast&&this.observer&&this.concast.removeObserver(this.observer,!0),this.concast=u,this.observer=c),u.addObserver(c),u.promise},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var n=this.getLastError();(n||this.isDifferentFromLastResult(e))&&((n||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),Lp(this.observers,"next",e))},t.prototype.reportError=function(e,t){var n=$c($c({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:$v.error,loading:!1});this.updateLastResult(n,t),Lp(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}(Np);function Hv(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(){return this.nextFetchPolicy=r,"function"==typeof r?r.apply(this,arguments):n}}):e.reobserve()}function Yv(e){__DEV__&&Jc.error("Unhandled error",e.message,e.stack)}function Gv(e){__DEV__&&e&&__DEV__&&Jc.debug("Missing cache result fields: ".concat(JSON.stringify(e)),e)}$p(Kv);var Jv=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;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=ip(t.resolvers,e)})):this.resolvers=ip(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){var t=e.document,n=e.remoteResult,r=e.context,i=e.variables,a=e.onlyRunForcedResolvers,o=void 0!==a&&a;return Uc(this,void 0,void 0,(function(){return Bc(this,(function(e){return t?[2,this.resolveDocument(t,n.data,r,i,this.fragmentMatcher,o).then((function(e){return $c($c({},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 kd(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return function(e){zd(e);var t=Xd([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=dd(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every((function(e){return qd(e)&&"__typename"===e.name.value})))return null}}})),t}(e)},e.prototype.prepareContext=function(e){var t=this.cache;return $c($c({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),Uc(this,void 0,void 0,(function(){return Bc(this,(function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then((function(e){return $c($c({},t),e.exportedVariables)}))]:[2,$c({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return dd(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 fd}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:np(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,n,r,i,a){return void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i=function(){return!0}),void 0===a&&(a=!1),Uc(this,void 0,void 0,(function(){var o,s,l,u,c,f,d,p,h;return Bc(this,(function(m){return o=Bd(e),s=Qd(e),l=xd(s),u=o.operation,c=u?u.charAt(0).toUpperCase()+u.slice(1):"Query",d=(f=this).cache,p=f.client,h={fragmentMap:l,context:$c($c({},n),{cache:d,client:p}),variables:r,fragmentMatcher:i,defaultOperationType:c,exportedVariables:{},onlyRunForcedResolvers:a},[2,this.resolveSelectionSet(o.selectionSet,t,h).then((function(e){return{result:e,exportedVariables:h.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,n){return Uc(this,void 0,void 0,(function(){var r,i,a,o,s,l=this;return Bc(this,(function(u){return r=n.fragmentMap,i=n.context,a=n.variables,o=[t],s=function(e){return Uc(l,void 0,void 0,(function(){var s,l;return Bc(this,(function(u){return Ed(e,a)?qd(e)?[2,this.resolveField(e,t,n).then((function(t){var n;void 0!==t&&o.push(((n={})[Md(e)]=t,n))}))]:(jd(e)?s=e:(s=r[e.name.value],__DEV__?Jc(s,"No fragment named ".concat(e.name.value)):Jc(s,9)),s&&s.typeCondition&&(l=s.typeCondition.name.value,n.fragmentMatcher(t,l,i))?[2,this.resolveSelectionSet(s.selectionSet,t,n).then((function(e){o.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(s)).then((function(){return ap(o)}))]}))}))},e.prototype.resolveField=function(e,t,n){return Uc(this,void 0,void 0,(function(){var r,i,a,o,s,l,u,c,f,d=this;return Bc(this,(function(p){return r=n.variables,i=e.name.value,a=Md(e),o=i!==a,s=t[a]||t[i],l=Promise.resolve(s),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(u=t.__typename||n.defaultOperationType,(c=this.resolvers&&this.resolvers[u])&&(f=c[o?i:a])&&(l=Promise.resolve(cv.withValue(this.cache,f,[t,Ad(e,r),n.context,{field:e,fragmentMap:n.fragmentMap}])))),[2,l.then((function(t){return void 0===t&&(t=s),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&&(n.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?d.resolveSubSelectedArray(e,t,n):e.selectionSet?d.resolveSelectionSet(e.selectionSet,t,n):void 0:t}))]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,n){var r=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?r.resolveSubSelectedArray(e,t,n):e.selectionSet?r.resolveSelectionSet(e.selectionSet,t,n):void 0})))},e}(),Xv=new(jp?WeakMap:Map);function Zv(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return Xv.set(e,(Xv.get(e)+1)%1e15),n.apply(this,arguments)})}function ey(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var ty=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.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;Xv.has(n)||(Xv.set(n,0),Zv(n,"evict"),Zv(n,"modify"),Zv(n,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||$v.loading;return this.variables&&this.networkStatus!==$v.loading&&!yh(this.variables,e.variables)&&(t=$v.setVariables),yh(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(){ey(this),this.lastDiff=void 0,this.dirty=!1},e.prototype.getDiff=function(e){void 0===e&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&yh(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&"no-cache"===n.options.fetchPolicy)return{complete:!1};var r=this.cache.diff(t);return this.updateLastDiff(r,t),r},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=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),this.dirty||yh(n&&n.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.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():Hv(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;ey(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(Uv(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,this.subscriptions.forEach((function(e){return e.unsubscribe()}));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=$c($c({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&yh(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===Xv.get(this.cache)&&yh(t,n.variables)&&yh(e.data,n.result.data))},e.prototype.markResult=function(e,t,n){var r=this;this.graphQLErrors=Bp(e.errors)?e.errors:[],this.reset(),"no-cache"===t.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(t.variables)):0!==n&&(ny(e,t.errorPolicy)?this.cache.performTransaction((function(i){if(r.shouldWrite(e,t.variables))i.writeQuery({query:r.document,data:e.data,variables:t.variables,overwrite:1===n}),r.lastWrite={result:e,variables:t.variables,dmCount:Xv.get(r.cache)};else if(r.lastDiff&&r.lastDiff.diff.complete)return void(e.data=r.lastDiff.diff.result);var a=r.getDiffOptions(t.variables),o=i.diff(a);r.stopped||r.updateWatch(t.variables),r.updateLastDiff(o,a),o.complete&&(e.data=o.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=$v.ready},e.prototype.markError=function(e){return this.networkStatus=$v.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function ny(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!Wp(e);return!r&&n&&e.data&&(r=!0),r}var ry=Object.prototype.hasOwnProperty,iy=function(){function e(e){var t=e.cache,n=e.link,r=e.defaultOptions,i=e.queryDeduplication,a=void 0!==i&&i,o=e.onBroadcast,s=e.ssrMode,l=void 0!==s&&s,u=e.clientAwareness,c=void 0===u?{}:u,f=e.localState,d=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(jp?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=n,this.defaultOptions=r||Object.create(null),this.queryDeduplication=a,this.clientAwareness=c,this.localState=f||new Jv({cache:t}),this.ssrMode=l,this.assumeImmutableResults=!!d,(this.onBroadcast=o)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,n){e.stopQueryNoBroadcast(n)})),this.cancelPendingFetches(__DEV__?new Gc("QueryManager stopped while query was in flight"):new Gc(11))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t,n,r=e.mutation,i=e.variables,a=e.optimisticResponse,o=e.updateQueries,s=e.refetchQueries,l=void 0===s?[]:s,u=e.awaitRefetchQueries,c=void 0!==u&&u,f=e.update,d=e.onQueryUpdated,p=e.fetchPolicy,h=void 0===p?(null===(t=this.defaultOptions.mutate)||void 0===t?void 0:t.fetchPolicy)||"network-only":p,m=e.errorPolicy,v=void 0===m?(null===(n=this.defaultOptions.mutate)||void 0===n?void 0:n.errorPolicy)||"none":m,y=e.keepRootFields,g=e.context;return Uc(this,void 0,void 0,(function(){var e,t,n;return Bc(this,(function(s){switch(s.label){case 0:return __DEV__?Jc(r,"mutation option is required. You must specify your GraphQL document in the mutation option."):Jc(r,12),__DEV__?Jc("network-only"===h||"no-cache"===h,"Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):Jc("network-only"===h||"no-cache"===h,13),e=this.generateMutationId(),r=this.transform(r).document,i=this.getVariables(r,i),this.transform(r).hasClientExports?[4,this.localState.addExportedVariables(r,i,g)]:[3,2];case 1:i=s.sent(),s.label=2;case 2:return t=this.mutationStore&&(this.mutationStore[e]={mutation:r,variables:i,loading:!0,error:null}),a&&this.markMutationOptimistic(a,{mutationId:e,document:r,variables:i,fetchPolicy:h,errorPolicy:v,context:g,updateQueries:o,update:f,keepRootFields:y}),this.broadcastQueries(),n=this,[2,new Promise((function(s,u){return qp(n.getObservableFromLink(r,$c($c({},g),{optimisticResponse:a}),i,!1),(function(s){if(Wp(s)&&"none"===v)throw new nh({graphQLErrors:s.errors});t&&(t.loading=!1,t.error=null);var u=$c({},s);return"function"==typeof l&&(l=l(u)),"ignore"===v&&Wp(u)&&delete u.errors,n.markMutationResult({mutationId:e,result:u,document:r,variables:i,fetchPolicy:h,errorPolicy:v,context:g,update:f,updateQueries:o,awaitRefetchQueries:c,refetchQueries:l,removeOptimistic:a?e:void 0,onQueryUpdated:d,keepRootFields:y})})).subscribe({next:function(e){n.broadcastQueries(),s(e)},error:function(r){t&&(t.loading=!1,t.error=r),a&&n.cache.removeOptimistic(e),n.broadcastQueries(),u(r instanceof nh?r:new nh({networkError:r}))}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var n=this;void 0===t&&(t=this.cache);var r=e.result,i=[],a="no-cache"===e.fetchPolicy;if(!a&&ny(r,e.errorPolicy)){i.push({result:r.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables});var o=e.updateQueries;o&&this.queries.forEach((function(e,a){var s=e.observableQuery,l=s&&s.queryName;if(l&&ry.call(o,l)){var u=o[l],c=n.queries.get(a),f=c.document,d=c.variables,p=t.diff({query:f,variables:d,returnPartialData:!0,optimistic:!1}),h=p.result;if(p.complete&&h){var m=u(h,{mutationResult:r,queryName:f&&$d(f)||void 0,queryVariables:d});m&&i.push({result:m,dataId:"ROOT_QUERY",query:f,variables:d})}}}))}if(i.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var s=[];if(this.refetchQueries({updateCache:function(t){a||i.forEach((function(e){return t.write(e)}));var o=e.update;if(o){if(!a){var s=t.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});s.complete&&(r=$c($c({},r),{data:s.result}))}o(t,r,{context:e.context,variables:e.variables})}a||e.keepRootFields||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 s.push(e)})),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(s).then((function(){return r}))}return Promise.resolve(r)},e.prototype.markMutationOptimistic=function(e,t){var n=this,r="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction((function(e){try{n.markMutationResult($c($c({},t),{result:{data:r}}),e)}catch(e){__DEV__&&Jc.error(e)}}),t.mutationId)},e.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).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){var t,n=this.transformCache;if(!n.has(e)){var r=this.cache.transformDocument(e),i=(t=this.cache.transformForLink(r),Xd([ep],zd(t))),a=this.localState.clientQuery(r),o=i&&this.localState.serverQuery(i),s={document:r,hasClientExports:_d(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:a,serverQuery:o,defaultVars:Wd(Vd(r)),asQuery:$c($c({},r),{definitions:r.definitions.map((function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?$c($c({},e),{operation:"query"}):e}))})},l=function(e){e&&!n.has(e)&&n.set(e,s)};l(e),l(r),l(a),l(o)}return n.get(e)},e.prototype.getVariables=function(e,t){return $c($c({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=$c($c({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new ty(this),n=new Kv({queryManager:this,queryInfo:t,options:e});return this.queries.set(n.queryId,t),t.init({document:n.query,observableQuery:n,variables:n.variables}),n},e.prototype.query=function(e,t){var n=this;return void 0===t&&(t=this.generateQueryId()),__DEV__?Jc(e.query,"query option is required. You must specify your GraphQL document in the query option."):Jc(e.query,14),__DEV__?Jc("Document"===e.query.kind,'You must wrap the query string in a "gql" tag.'):Jc("Document"===e.query.kind,15),__DEV__?Jc(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):Jc(!e.returnPartialData,16),__DEV__?Jc(!e.pollInterval,"pollInterval option only supported on watchQuery."):Jc(!e.pollInterval,17),this.fetchQuery(t,e).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(__DEV__?new Gc("Store reset while query was in flight (not completed in link chain)"):new Gc(18)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=$v.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):Od(n=e)&&"Document"===n.kind&&Array.isArray(n.definitions)?r.set(t.transform(e).document,!1):Od(e)&&e.query&&i.add(e)})),this.queries.forEach((function(t,i){var a=t.observableQuery,o=t.document;if(a){if("all"===e)return void n.set(i,a);var s=a.queryName;if("standby"===a.options.fetchPolicy||"active"===e&&!a.hasObservers())return;("active"===e||s&&r.has(s)||o&&r.has(o))&&(n.set(i,a),s&&r.set(s,!0),o&&r.set(o,!0))}})),i.size&&i.forEach((function(e){var r=Yp("legacyOneTimeQuery"),i=t.getQuery(r).init({document:e.query,variables:e.variables}),a=new Kv({queryManager:t,queryInfo:i,options:$c($c({},e),{fetchPolicy:"network-only"})});Jc(a.queryId===r),i.setObservableQuery(a),n.set(r,a)})),__DEV__&&r.size&&r.forEach((function(e,t){e||__DEV__&&Jc.warn("Unknown query ".concat("string"==typeof t?"named ":"").concat(JSON.stringify(t,null,2)," requested in refetchQueries options.include array"))})),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 a=r.options.fetchPolicy;r.resetLastResults(),(e||"standby"!==a&&"cache-only"!==a)&&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,a=e.variables,o=e.context,s=void 0===o?{}:o;n=this.transform(n).document,a=this.getVariables(n,a);var l=function(e){return t.getObservableFromLink(n,s,e).map((function(a){if("no-cache"!==r&&(ny(a,i)&&t.cache.write({query:n,result:a.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries()),Wp(a))throw new nh({graphQLErrors:a.errors});return a}))};if(this.transform(n).hasClientExports){var u=this.localState.addExportedVariables(n,a,s).then(l);return new Np((function(e){var t=null;return u.then((function(n){return t=n.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return l(a)},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){var i,a,o=this;void 0===r&&(r=null!==(i=null==t?void 0:t.queryDeduplication)&&void 0!==i?i:this.queryDeduplication);var s=this.transform(e).serverQuery;if(s){var l=this.inFlightLinkObservables,u=this.link,c={query:s,variables:n,operationName:$d(s)||void 0,context:this.prepareContext($c($c({},t),{forceFetch:!r}))};if(t=c.context,r){var f=l.get(s)||new Map;l.set(s,f);var d=av(n);if(!(a=f.get(d))){var p=new Up([Fh(u,c)]);f.set(d,a=p),p.cleanup((function(){f.delete(d)&&f.size<1&&l.delete(s)}))}}else a=new Up([Fh(u,c)])}else a=new Up([Np.of({data:{}})]),t=this.prepareContext(t);var h=this.transform(e).clientQuery;return h&&(a=qp(a,(function(e){return o.localState.runResolvers({document:h,remoteResult:e,context:t,variables:n})}))),a},e.prototype.getResultsFromLink=function(e,t,n){var r=e.lastRequestId=this.generateRequestId();return qp(this.getObservableFromLink(e.document,n.context,n.variables),(function(i){var a=Bp(i.errors);if(r>=e.lastRequestId){if(a&&"none"===n.errorPolicy)throw e.markError(new nh({graphQLErrors:i.errors}));e.markResult(i,n,t),e.markReady()}var o={data:i.data,loading:!1,networkStatus:$v.ready};return a&&"ignore"!==n.errorPolicy&&(o.errors=i.errors,o.networkStatus=$v.error),o}),(function(t){var n=th(t)?t:new nh({networkError:t});throw r>=e.lastRequestId&&e.markError(n),n}))},e.prototype.fetchQueryObservable=function(e,t,n){var r=this;void 0===n&&(n=$v.loading);var i=this.transform(t.query).document,a=this.getVariables(i,t.variables),o=this.getQuery(e),s=this.defaultOptions.watchQuery,l=t.fetchPolicy,u=void 0===l?s&&s.fetchPolicy||"cache-first":l,c=t.errorPolicy,f=void 0===c?s&&s.errorPolicy||"none":c,d=t.returnPartialData,p=void 0!==d&&d,h=t.notifyOnNetworkStatusChange,m=void 0!==h&&h,v=t.context,y=void 0===v?{}:v,g=Object.assign({},t,{query:i,variables:a,fetchPolicy:u,errorPolicy:f,returnPartialData:p,notifyOnNetworkStatusChange:m,context:y}),b=function(e){return g.variables=e,r.fetchQueryByPolicy(o,g,n)};this.fetchCancelFns.set(e,(function(e){setTimeout((function(){return w.cancel(e)}))}));var w=new Up(this.transform(g.query).hasClientExports?this.localState.addExportedVariables(g.query,g.variables,g.context).then(b):b(g.variables));return w.cleanup((function(){r.fetchCancelFns.delete(e),o.observableQuery&&o.observableQuery.applyNextFetchPolicy("after-fetch",t)})),w},e.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,r=e.include,i=e.optimistic,a=void 0!==i&&i,o=e.removeOptimistic,s=void 0===o?a?Yp("refetchQueries"):void 0:o,l=e.onQueryUpdated,u=new Map;r&&this.getObservableQueries(r).forEach((function(e,n){u.set(n,{oq:e,lastDiff:t.getQuery(n).getDiff()})}));var c=new Map;return n&&this.cache.batch({update:n,optimistic:a&&s||!1,removeOptimistic:s,onWatchUpdated:function(e,t,n){var r=e.watcher instanceof ty&&e.watcher.observableQuery;if(r){if(l){u.delete(r.queryId);var i=l(r,t,n);return!0===i&&(i=r.refetch()),!1!==i&&c.set(r,i),i}null!==l&&u.set(r.queryId,{oq:r,lastDiff:n,diff:t})}}}),u.size&&u.forEach((function(e,n){var r,i=e.oq,a=e.lastDiff,o=e.diff;if(l){if(!o){var s=i.queryInfo;s.reset(),o=s.getDiff()}r=l(i,o,a)}l&&!0!==r||(r=i.refetch()),!1!==r&&c.set(i,r),n.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(n)})),s&&this.cache.removeOptimistic(s),c},e.prototype.fetchQueryByPolicy=function(e,t,n){var r=this,i=t.query,a=t.variables,o=t.fetchPolicy,s=t.refetchWritePolicy,l=t.errorPolicy,u=t.returnPartialData,c=t.context,f=t.notifyOnNetworkStatusChange,d=e.networkStatus;e.init({document:this.transform(i).document,variables:a,networkStatus:n});var p=function(){return e.getDiff(a)},h=function(t,n){void 0===n&&(n=e.networkStatus||$v.loading);var o=t.result;!__DEV__||u||yh(o,{})||Gv(t.missing);var s=function(e){return Np.of($c({data:e,loading:Uv(n),networkStatus:n},t.complete?null:{partial:!0}))};return o&&r.transform(i).hasForcedResolvers?r.localState.runResolvers({document:i,remoteResult:{data:o},context:c,variables:a,onlyRunForcedResolvers:!0}).then((function(e){return s(e.data||void 0)})):s(o)},m="no-cache"===o?0:n===$v.refetch&&"merge"!==s?1:2,v=function(){return r.getResultsFromLink(e,m,{variables:a,context:c,fetchPolicy:o,errorPolicy:l})},y=f&&"number"==typeof d&&d!==n&&Uv(n);switch(o){default:case"cache-first":return(g=p()).complete?[h(g,e.markReady())]:u||y?[h(g),v()]:[v()];case"cache-and-network":var g;return(g=p()).complete||u||y?[h(g),v()]:[v()];case"cache-only":return[h(p(),e.markReady())];case"network-only":return y?[h(p()),v()]:[v()];case"no-cache":return y?[h(e.getDiff()),v()]:[v()];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new ty(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return $c($c({},t),{clientAwareness:this.clientAwareness})},e}(),ay=!1,oy=function(){function e(e){var t=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,r=e.credentials,i=e.headers,a=e.cache,o=e.ssrMode,s=void 0!==o&&o,l=e.ssrForceFetchDelay,u=void 0===l?0:l,c=e.connectToDevTools,f=void 0===c?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:c,d=e.queryDeduplication,p=void 0===d||d,h=e.defaultOptions,m=e.assumeImmutableResults,v=void 0!==m&&m,y=e.resolvers,g=e.typeDefs,b=e.fragmentMatcher,w=e.name,E=e.version,k=e.link;if(k||(k=n?new Hh({uri:n,credentials:r,headers:i}):Nh.empty()),!a)throw __DEV__?new Gc("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new Gc(7);if(this.link=k,this.cache=a,this.disableNetworkFetches=s||u>0,this.queryDeduplication=p,this.defaultOptions=h||Object.create(null),this.typeDefs=g,u&&setTimeout((function(){return t.disableNetworkFetches=!1}),u),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),f&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!ay&&__DEV__&&(ay=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var _=window.navigator,S=_&&_.userAgent,x=void 0;"string"==typeof S&&(S.indexOf("Chrome/")>-1?x="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":S.indexOf("Firefox/")>-1&&(x="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),x&&__DEV__&&Jc.log("Download the Apollo DevTools for a better development experience: "+x)}this.version="3.6.1",this.localState=new Jv({cache:a,client:this,resolvers:y,fragmentMatcher:b}),this.queryManager=new iy({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:p,ssrMode:s,clientAwareness:{name:w,version:E},localState:this.localState,assumeImmutableResults:v,onBroadcast:f?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Gp(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=$c($c({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=Gp(this.defaultOptions.query,e)),__DEV__?Jc("cache-and-network"!==e.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):Jc("cache-and-network"!==e.fetchPolicy,8),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=$c($c({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Gp(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.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},e.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Fh(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){__DEV__&&Jc.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(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},e}(),sy=new Map,ly=new Map,uy=!0,cy=!1;function fy(e){return e.replace(/[\s,]+/g," ").trim()}function dy(e){var t=new Set,n=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var r=e.name.value,i=fy((o=e.loc).source.body.substring(o.start,o.end)),a=ly.get(r);a&&!a.has(i)?uy&&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"):a||ly.set(r,a=new Set),a.add(i),t.has(i)||(t.add(i),n.push(e))}else n.push(e);var o})),$c($c({},e),{definitions:n})}function py(e){var t=fy(e);if(!sy.has(t)){var n=function(e,t){return new ad(e,t).parseDocument()}(e,{experimentalFragmentVariables:cy,allowLegacyFragmentVariables:cy});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");sy.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}(dy(n)))}return sy.get(t)}function hy(e){for(var t=[],n=1;n0?new nh({graphQLErrors:f}):void 0;if(l===o.current.mutationId&&!u.ignoreResults){var p={called:!0,loading:!1,data:c,error:d,client:n};o.current.isMounted&&!yh(o.current.result,p)&&a(o.current.result=p)}return null===(r=s.onCompleted)||void 0===r||r.call(s,t.data),null===(i=e.onCompleted)||void 0===i||i.call(e,t.data),t})).catch((function(t){var r,i;if(l===o.current.mutationId&&o.current.isMounted){var c={loading:!1,error:t,data:void 0,called:!0,client:n};yh(o.current.result,c)||a(o.current.result=c)}if(s.onError||u.onError)return null===(r=s.onError)||void 0===r||r.call(s,t),null===(i=e.onError)||void 0===i||i.call(e,t),{data:void 0,errors:t};throw t}))}),[]),l=L.useCallback((function(){a({called:!1,loading:!1,client:n})}),[]);return L.useEffect((function(){return o.current.isMounted=!0,function(){o.current.isMounted=!1}}),[]),[s,$c({reset:l},i)]}var My=Object.freeze({__proto__:null,ApolloClient:oy,mergeOptions:Gp,ObservableQuery:Kv,get NetworkStatus(){return $v},isApolloError:th,ApolloError:nh,get Cache(){return Pm},ApolloCache:Fm,InMemoryCache:Qv,MissingFieldError:Am,defaultDataIdFromObject:Lm,makeVar:hv,fromError:_h,toPromise:function(e){var t=!1;return new Promise((function(n,r){e.subscribe({next:function(e){t?__DEV__&&Jc.warn("Promise Wrapper does not support multiple results from Observable"):(t=!0,n(e))},error:r})}))},fromPromise:function(e){return new Np((function(t){e.then((function(e){t.next(e),t.complete()})).catch(t.error.bind(t))}))},throwServerError:Sh,Observable:Np,isReference:Nd,makeReference:Cd,get gql(){return hy},resetCaches:my,disableFragmentWarnings:vy,enableExperimentalFragmentVariables:yy,disableExperimentalFragmentVariables:gy,empty:Rh,from:Dh,split:Ih,concat:Ph,execute:Fh,ApolloLink:Nh,parseAndCheckHttpResponse:Mh,serializeFetchParameter:Lh,fallbackHttpConfig:qh,defaultPrinter:jh,selectHttpOptionsAndBody:function(e,t){for(var n=[],r=2;r.'):Jc(t&&t.client,25),e.children(t.client)}))},getApolloContext:Xp,resetApolloContext:Xp,get DocumentType(){return wy},operationName:Oy,parser:Cy,useQuery:Dy,useApolloClient:eh,useLazyQuery:function(e,t){var n=Iy(eh(t&&t.client),e),r=L.useRef(),i=n.client.defaultOptions.watchQuery,a=t&&t.fetchPolicy||r.current&&r.current.fetchPolicy||i&&i.fetchPolicy||"cache-first",o=n.useQuery($c($c($c({},t),r.current),{skip:!r.current})),s=Object.assign(o,{called:!!r.current}),l=L.useMemo((function(){for(var e={},t=function(t){var i=s[t];e[t]=function(){return r.current||(r.current=Object.create(null),n.forceUpdate()),i.apply(this,arguments)}},i=0,a=Fy;i{switch(t.type){case qy.ActionTypes.REQUEST:return e+1;case qy.ActionTypes.ERROR:case qy.ActionTypes.SUCCESS:case qy.ActionTypes.CANCEL:return Math.max(e-1,0);default:return e}},zy=(e,t)=>{switch(t.type){case qy.ActionTypes.REQUEST:return[];case qy.ActionTypes.ERROR:const{networkError:n}=t.payload;return[n];case qy.ActionTypes.SUCCESS:const{result:r}=t.payload;return!0===(null!=r&&null!=r.errors)?[...r.errors]:e;default:return e}};var Vy="3.4.0",$y="https://github.com/electerious/Ackee",Qy=(e,t)=>({get:()=>{const n=localStorage.getItem(e);return null==n?t:JSON.parse(n)},set:t=>{const n=JSON.stringify(t);return localStorage.setItem(e,n),t},reset:()=>(localStorage.removeItem(e),t)});const Uy=Symbol(),By=Symbol(),{get:Wy,set:Ky,reset:Hy}=Qy("ackee_token_3.4.0"),Yy=(e,t)=>{switch(t.type){case Uy:return Ky(t.token);case By:return Hy();default:return e}};var Gy,Jy=function(){function e(e){var t=e.batchDebounce,n=e.batchInterval,r=e.batchMax,i=e.batchHandler,a=e.batchKey;this.batchesByKey=new Map,this.batchDebounce=t,this.batchInterval=n,this.batchMax=r||0,this.batchHandler=i,this.batchKey=a||function(){return""}}return e.prototype.enqueueRequest=function(e){var t=this,n=$c($c({},e),{next:[],error:[],complete:[],subscribers:new Set}),r=this.batchKey(e.operation);return n.observable||(n.observable=new Np((function(e){var i=t.batchesByKey.get(r);i||t.batchesByKey.set(r,i=new Set);var a=0===i.size,o=0===n.subscribers.size;return n.subscribers.add(e),o&&i.add(n),e.next&&n.next.push(e.next.bind(e)),e.error&&n.error.push(e.error.bind(e)),e.complete&&n.complete.push(e.complete.bind(e)),a?t.scheduleQueueConsumption(r):t.batchDebounce&&(clearTimeout(t.scheduledBatchTimer),t.scheduleQueueConsumption(r)),i.size===t.batchMax&&t.consumeQueue(r),function(){var a;n.subscribers.delete(e)&&n.subscribers.size<1&&i.delete(n)&&i.size<1&&(clearTimeout(t.scheduledBatchTimer),t.batchesByKey.delete(r),null===(a=i.subscription)||void 0===a||a.unsubscribe())}}))),n.observable},e.prototype.consumeQueue=function(e){void 0===e&&(e="");var t=this.batchesByKey.get(e);if(this.batchesByKey.delete(e),t&&t.size){var n=[],r=[],i=[],a=[],o=[],s=[];t.forEach((function(e){n.push(e.operation),r.push(e.forward),i.push(e.observable),a.push(e.next),o.push(e.error),s.push(e.complete)}));var l=this.batchHandler(n,r)||Np.of(),u=function(e){o.forEach((function(t){t&&t.forEach((function(t){return t(e)}))}))};return t.subscription=l.subscribe({next:function(e){if(Array.isArray(e)||(e=[e]),a.length!==e.length){var t=new Error("server returned results with length ".concat(e.length,", expected length of ").concat(a.length));return t.result=e,u(t)}e.forEach((function(e,t){a[t]&&a[t].forEach((function(t){return t(e)}))}))},error:u,complete:function(){s.forEach((function(e){e&&e.forEach((function(e){return e()}))}))}}),i}},e.prototype.scheduleQueueConsumption=function(e){var t=this;this.scheduledBatchTimer=setTimeout((function(){t.consumeQueue(e)}),this.batchInterval)},e}(),Xy=function(e){function t(t){var n=e.call(this)||this,r=t||{},i=r.batchDebounce,a=r.batchInterval,o=void 0===a?10:a,s=r.batchMax,l=void 0===s?0:s,u=r.batchHandler,c=void 0===u?function(){return null}:u,f=r.batchKey,d=void 0===f?function(){return""}:f;return n.batcher=new Jy({batchDebounce:i,batchInterval:o,batchMax:l,batchHandler:c,batchKey:d}),t.batchHandler.length<=1&&(n.request=function(e){return n.batcher.enqueueRequest({operation:e})}),n}return Vc(t,e),t.prototype.request=function(e,t){return this.batcher.enqueueRequest({operation:e,forward:t})},t}(Nh),Zy=function(e){function t(t){var n=e.call(this)||this,r=t||{},i=r.uri,a=void 0===i?"/graphql":i,o=r.fetch,s=r.print,l=void 0===s?jh:s,u=r.includeExtensions,c=r.batchInterval,f=r.batchDebounce,d=r.batchMax,p=r.batchKey,h=Qc(r,["uri","fetch","print","includeExtensions","batchInterval","batchDebounce","batchMax","batchKey"]);$h(o),o||(o=fetch);var m={http:{includeExtensions:u},options:h.fetchOptions,credentials:h.credentials,headers:h.headers};n.batchDebounce=f,n.batchInterval=c||10,n.batchMax=d||10;return p=p||function(e){var t=e.getContext(),n={http:t.http,options:t.fetchOptions,credentials:t.credentials,headers:t.headers};return Uh(e,a)+JSON.stringify(n)},n.batcher=new Xy({batchDebounce:n.batchDebounce,batchInterval:n.batchInterval,batchMax:n.batchMax,batchKey:p,batchHandler:function(e){var t=Uh(e[0],a),n=e[0].getContext(),r={};if(n.clientAwareness){var i=n.clientAwareness,s=i.name,u=i.version;s&&(r["apollographql-client-name"]=s),u&&(r["apollographql-client-version"]=u)}var c,f={http:n.http,options:n.fetchOptions,credentials:n.credentials,headers:$c($c({},r),n.headers)},d=e.map((function(e){return zh(e,l,qh,m,f)})),p=d.map((function(e){return e.body})),h=d[0].options;if("GET"===h.method)return _h(new Error("apollo-link-batch-http does not support GET requests"));try{h.body=Lh(p,"Payload")}catch(e){return _h(e)}if(!h.signal){var v=Qh(),y=v.controller,g=v.signal;(c=y)&&(h.signal=g)}return new Np((function(n){return o(t,h).then((function(t){return e.forEach((function(e){return e.setContext({response:t})})),t})).then(Mh(e)).then((function(e){return n.next(e),n.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&n.next(e.result),n.error(e))})),function(){c&&c.abort()}}))}}),n}return Vc(t,e),t.prototype.request=function(e){return this.batcher.request(e)},t}(Nh),eg=(new Intl.DateTimeFormat).resolvedOptions().timeZone;function tg(){return tg=Object.assign||function(e){for(var t=1;t=0&&(t.hash=e.substr(n),e=e.substr(0,n));var r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var lg=n((function(t,n){var r=[].slice;!function(e,r){null!==n?t.exports=r():e.UrlPattern=r()}(e,(function(){var e,t,n,i,a,o,s,l,u,c,f,d,p,h,m;return u=function(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},s=function(e,t){var n,r,i;for(i=[],n=-1,r=e.length;++n(Array.isArray(o)?o.length-1:0)))return a=Array.isArray(o)?o[i]:o,r&&(n[t]=i+1),a;if(r)throw new Error("too few values provided for key `"+t+"`")}else if(r)throw new Error("no values provided for key `"+t+"`")},n=function(e,t,r){var i,a;if(Array.isArray(e)){for(i=-1,a=e.length;++i!0===kg.some((t=>null!=t.pattern.match(e)))?e:_g.pattern.stringify();var xg=1;var Tg,Og,Cg,Ng={nextValue:function(){return(xg=(9301*xg+49297)%233280)/233280},seed:function(e){xg=e}},Rg="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";function Dg(){Cg=!1}function Ig(e){if(e){if(e!==Tg){if(e.length!==Rg.length)throw new Error("Custom alphabet for shortid must be "+Rg.length+" unique characters. You submitted "+e.length+" characters: "+e);var t=e.split("").filter((function(e,t,n){return t!==n.lastIndexOf(e)}));if(t.length)throw new Error("Custom alphabet for shortid must be "+Rg.length+" unique characters. These characters were not unique: "+t.join(", "));Tg=e,Dg()}}else Tg!==Rg&&(Tg=Rg,Dg())}function Pg(){return Cg||(Cg=function(){Tg||Ig(Rg);for(var e,t=Tg.split(""),n=[],r=Ng.nextValue();t.length>0;)r=Ng.nextValue(),e=Math.floor(r*t.length),n.push(t.splice(e,1)[0]);return n.join("")}(),Cg)}var Fg={get:function(){return Tg||Rg},characters:function(e){return Ig(e),Tg},seed:function(e){Ng.seed(e),Og!==e&&(Dg(),Og=e)},lookup:function(e){return Pg()[e]},shuffled:Pg},Ag="object"==typeof window&&(window.crypto||window.msCrypto),Mg=Ag&&Ag.getRandomValues?function(e){return Ag.getRandomValues(new Uint8Array(e))}:function(e){for(var t=[],n=0;n0&&(t+=zg(qg)),t+=zg(n)};var $g=function(e){return!(!e||"string"!=typeof e||e.length<6)&&!new RegExp("[^"+Fg.get().replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&")+"]").test(e)},Qg=n((function(e){var t=0;function n(){return Vg(t)}e.exports=n,e.exports.generate=n,e.exports.seed=function(t){return Fg.seed(t),e.exports},e.exports.worker=function(n){return t=n,e.exports},e.exports.characters=function(e){return void 0!==e&&Fg.characters(e),Fg.shuffled()},e.exports.isValid=$g})),Ug=Qg,Bg=()=>`_${Ug.generate()}`;const Wg=Symbol(),Kg=Symbol(),Hg=Symbol(),Yg={},Gg=(e,t)=>{switch(t.type){case Wg:return{...e,[t.modalId]:{id:t.modalId,type:t.payload.type,props:t.payload.props}};case Kg:const n={...e};return delete n[t.modalId],n;case Hg:return Yg;default:return e}};var Jg="TOP",Xg="NEW",Zg="RECENT";var eb="LAST_24_HOURS",tb="LAST_7_DAYS",nb="LAST_30_DAYS",rb="LAST_6_MONTHS";var ib="DAILY",ab="MONTHLY",ob="YEARLY";var sb="UNIQUE",lb="TOTAL";var ub="WITH_SOURCE",cb="NO_SOURCE",fb="ONLY_SOURCE";var db="WITH_MODEL",pb="NO_MODEL";var hb="WITH_VERSION",mb="NO_VERSION";var vb="BROWSER_HEIGHT",yb="BROWSER_RESOLUTION",gb="BROWSER_WIDTH",bb="SCREEN_HEIGHT",wb="SCREEN_RESOLUTION",Eb="SCREEN_WIDTH";var kb="WITH_VERSION",_b="NO_VERSION";const Sb=Symbol(),xb=Symbol(),Tb=Symbol(),Ob=Symbol(),Cb=Symbol(),Nb=Symbol(),Rb=Symbol(),Db=Symbol(),Ib=Symbol(),Pb=Symbol(),{get:Fb,set:Ab,reset:Mb}=Qy("ackee_filter_3.4.0",{sorting:Jg,range:tb,interval:ib,viewsType:sb,referrersType:ub,devicesType:db,browsersType:hb,sizesType:yb,systemsType:kb}),Lb=(e,t)=>{switch(t.type){case Sb:return Ab({...e,sorting:t.payload});case xb:return Ab({...e,range:t.payload});case Tb:return Ab({...e,interval:t.payload});case Ob:return Ab({...e,viewsType:t.payload});case Cb:return Ab({...e,referrersType:t.payload});case Nb:return Ab({...e,devicesType:t.payload});case Rb:return Ab({...e,browsersType:t.payload});case Db:return Ab({...e,sizesType:t.payload});case Ib:return Ab({...e,systemsType:t.payload});case Pb:return Mb();default:return e}};const qb=["Token invalid","Token missing","Username or password incorrect"];var jb=e=>!0===qb.includes(e.message),zb="function"==typeof Symbol&&Symbol.for,Vb=zb?Symbol.for("react.element"):60103,$b=zb?Symbol.for("react.portal"):60106,Qb=zb?Symbol.for("react.fragment"):60107,Ub=zb?Symbol.for("react.strict_mode"):60108,Bb=zb?Symbol.for("react.profiler"):60114,Wb=zb?Symbol.for("react.provider"):60109,Kb=zb?Symbol.for("react.context"):60110,Hb=zb?Symbol.for("react.async_mode"):60111,Yb=zb?Symbol.for("react.concurrent_mode"):60111,Gb=zb?Symbol.for("react.forward_ref"):60112,Jb=zb?Symbol.for("react.suspense"):60113,Xb=zb?Symbol.for("react.suspense_list"):60120,Zb=zb?Symbol.for("react.memo"):60115,ew=zb?Symbol.for("react.lazy"):60116,tw=zb?Symbol.for("react.block"):60121,nw=zb?Symbol.for("react.fundamental"):60117,rw=zb?Symbol.for("react.responder"):60118,iw=zb?Symbol.for("react.scope"):60119;function aw(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Vb:switch(e=e.type){case Hb:case Yb:case Qb:case Bb:case Ub:case Jb:return e;default:switch(e=e&&e.$$typeof){case Kb:case Gb:case ew:case Zb:case Wb:return e;default:return t}}case $b:return t}}}function ow(e){return aw(e)===Yb}var sw={AsyncMode:Hb,ConcurrentMode:Yb,ContextConsumer:Kb,ContextProvider:Wb,Element:Vb,ForwardRef:Gb,Fragment:Qb,Lazy:ew,Memo:Zb,Portal:$b,Profiler:Bb,StrictMode:Ub,Suspense:Jb,isAsyncMode:function(e){return ow(e)||aw(e)===Hb},isConcurrentMode:ow,isContextConsumer:function(e){return aw(e)===Kb},isContextProvider:function(e){return aw(e)===Wb},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Vb},isForwardRef:function(e){return aw(e)===Gb},isFragment:function(e){return aw(e)===Qb},isLazy:function(e){return aw(e)===ew},isMemo:function(e){return aw(e)===Zb},isPortal:function(e){return aw(e)===$b},isProfiler:function(e){return aw(e)===Bb},isStrictMode:function(e){return aw(e)===Ub},isSuspense:function(e){return aw(e)===Jb},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===Qb||e===Yb||e===Bb||e===Ub||e===Jb||e===Xb||"object"==typeof e&&null!==e&&(e.$$typeof===ew||e.$$typeof===Zb||e.$$typeof===Wb||e.$$typeof===Kb||e.$$typeof===Gb||e.$$typeof===nw||e.$$typeof===rw||e.$$typeof===iw||e.$$typeof===tw)},typeOf:aw}; +n((function(e,t){}));var fh=n((function(e){e.exports=ch})),dh=Object.prototype,ph=dh.toString,hh=dh.hasOwnProperty,mh=Function.prototype.toString,vh=new Map;function yh(e,t){try{return gh(e,t)}finally{vh.clear()}}function gh(e,t){if(e===t)return!0;var n,r,i,a=ph.call(e);if(a!==ph.call(t))return!1;switch(a){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(kh(e,t))return!0;var o=bh(e),s=bh(t),l=o.length;if(l!==s.length)return!1;for(var u=0;u=0&&n.indexOf(r,i)===i))}return!1}function bh(e){return Object.keys(e).filter(wh,e)}function wh(e){return void 0!==this[e]}var Eh="{ [native code] }";function kh(e,t){var n=vh.get(e);if(n){if(n.has(t))return!0}else vh.set(e,n=new Set);return n.add(t),!1}function _h(e){return new Np((function(t){t.error(e)}))}var Sh=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 xh(e,t){return t?t(e):Np.of()}function Th(e){return"function"==typeof e?new Nh(e):e}function Oh(e){return e.request.length<=1}var Ch=function(e){function t(t,n){var r=e.call(this,t)||this;return r.link=n,r}return Vc(t,e),t}(Error),Nh=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return Np.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(Th).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,n,r){var i=Th(n),a=Th(r||new e(xh));return Oh(i)&&Oh(a)?new e((function(e){return t(e)?i.request(e)||Np.of():a.request(e)||Np.of()})):new e((function(e,n){return t(e)?i.request(e,n)||Np.of():a.request(e,n)||Np.of()}))},e.execute=function(e,t){return e.request(function(e,t){var n=$c({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){n=$c($c({},n),"function"==typeof e?e(n):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return $c({},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?$d(t.query)||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(e);n=300&&Sh(t,n,"Response not successful: Received status code ".concat(t.status)),Array.isArray(n)||Ah.call(n,"data")||Ah.call(n,"errors")||Sh(t,n,"Server response was missing for query '".concat(Array.isArray(e)?e.map((function(e){return e.operationName})):e.operationName,"'.")),n}))}}var Lh=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var r=__DEV__?new Gc("Network request failed. ".concat(t," is not serializable: ").concat(e.message)):new Gc(21);throw r.parseError=e,r}return n},qh={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},jh=function(e,t){return t(e)};function zh(e,t){for(var n=[],r=2;rthis.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var 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)},e}(),um=new am,cm=Object.prototype.hasOwnProperty,fm=void 0===(sm=Array.from)?function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t}:sm;function dm(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var pm=[];function hm(e,t){if(!e)throw new Error(t||"assertion failure")}function mm(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var vm=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!bm(this))return ym(this),this.value[0]},e.prototype.recompute=function(e){return hm(!this.recomputing,"already recomputing"),ym(this),bm(this)?function(e,t){Tm(e),um.withValue(e,gm,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{dm(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,bm(e))return;Em(e)}(e);return mm(e.value)}(this,e):mm(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,wm(this),dm(this))},e.prototype.dispose=function(){var e=this;this.setDirty(),Tm(this),km(this,(function(t,n){t.setDirty(),Om(t,e)}))},e.prototype.forget=function(){this.dispose()},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=pm.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(fm(this.deps).forEach((function(t){return t.delete(e)})),this.deps.clear(),pm.push(this.deps),this.deps=null)},e.count=0,e}();function ym(e){var t=um.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),bm(e)?_m(t,e):Sm(t,e),t}function gm(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function bm(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function wm(e){km(e,_m)}function Em(e){km(e,Sm)}function km(e,t){var n=e.parents.size;if(n)for(var r=fm(e.parents),i=0;i0&&n===t.length&&e[n-1]===t[n-1]}(n,t.value)||e.setDirty(),xm(e,t),bm(e)||Em(e)}function xm(e,t){var n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(pm.length<100&&pm.push(n),e.dirtyChildren=null))}function Tm(e){e.childValues.size>0&&e.childValues.forEach((function(t,n){Om(e,n)})),e.forgetDeps(),hm(null===e.dirtyChildren)}function Om(e,t){t.parents.delete(e),e.childValues.delete(t),xm(e,t)}var Cm={setDirty:!0,dispose:!0,forget:!0};function Nm(e){var t=new Map,n=e&&e.subscribe;function r(e){var r=um.getValue();if(r){var i=t.get(e);i||t.set(e,i=new Set),r.dependOn(i),"function"==typeof n&&(dm(i),i.unsubscribe=n(e))}}return r.dirty=function(e,n){var r=t.get(e);if(r){var i=n&&cm.call(Cm,n)?n:"setDirty";fm(r).forEach((function(e){return e[i]()})),t.delete(e),dm(r)}},r}function Rm(){var e=new Zh("function"==typeof WeakMap);return function(){return e.lookupArray(arguments)}}Rm();var Dm=new Set;function Im(e,t){void 0===t&&(t=Object.create(null));var n=new lm(t.max||Math.pow(2,16),(function(e){return e.dispose()})),r=t.keyArgs,i=t.makeCacheKey||Rm(),a=function(){var a=i.apply(null,r?r.apply(null,arguments):arguments);if(void 0===a)return e.apply(null,arguments);var o=n.get(a);o||(n.set(a,o=new vm(e)),o.subscribe=t.subscribe,o.forget=function(){return n.delete(a)});var s=o.recompute(Array.prototype.slice.call(arguments));return n.set(a,o),Dm.add(n),um.hasValue()||(Dm.forEach((function(e){return e.clean()})),Dm.clear()),s};function o(e){var t=n.get(e);t&&t.setDirty()}function s(e){var t=n.get(e);if(t)return t.peek()}function l(e){return n.delete(e)}return Object.defineProperty(a,"size",{get:function(){return n.map.size},configurable:!1,enumerable:!1}),a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))},a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))},a.forgetKey=l,a.forget=function(){return l(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=r?function(){return i.apply(null,r.apply(null,arguments))}:i,Object.freeze(a)}var Pm,Fm=function(){function e(){this.getFragmentDoc=Im(Sd)}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.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read($c($c({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read($c($c({},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=Qc(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,a=Qc(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(a,{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($c($c({},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($c($c({},e),{data:i})),i)}})},e}();Pm||(Pm={});var Am=function(e,t,n,r){this.message=e,this.path=t,this.query=n,this.variables=r},Mm=Object.prototype.hasOwnProperty;function Lm(e,t){var n=e.__typename,r=e.id,i=e._id;if("string"==typeof n&&(t&&(t.keyObject=void 0!==r?{id:r}:void 0!==i?{_id:i}:void 0),void 0===r&&(r=i),void 0!==r))return"".concat(n,":").concat("number"==typeof r||"string"==typeof r?r:JSON.stringify(r))}var qm={dataIdFromObject:Lm,addTypename:!0,resultCaching:!0,canonizeResults:!1};function jm(e){var t=e.canonizeResults;return void 0===t?qm.canonizeResults:t}var zm=/^[_a-z][_0-9a-z]*/i;function Vm(e){var t=e.match(zm);return t?t[0]:e}function $m(e,t,n){return!!Od(t)&&(Um(t)?t.every((function(t){return $m(e,t,n)})):e.selections.every((function(e){if(qd(e)&&Ed(e,n)){var r=Md(e);return Mm.call(t,r)&&(!e.selectionSet||$m(e.selectionSet,t[r],n))}return!0})))}function Qm(e){return Od(e)&&!Nd(e)&&!Um(e)}var Um=function(e){return Array.isArray(e)},Bm=Object.create(null),Wm=function(){return Bm},Km=Object.create(null),Hm=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 Mp(Nd(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return Nd(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return Cd(e);if(Nd(e))return e;var r=n.policies.identify(e)[0];if(r){var i=Cd(r);return t&&n.merge(r,e),i}}}return e.prototype.toObject=function(){return $c({},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),Mm.call(this.data,e)){var n=this.data[e];if(n&&Mm.call(n,t))return n[t]}return"__typename"===t&&Mm.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof Xm?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),Mm.call(this.data,e)?this.data[e]:this instanceof Xm?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var n,r=this;Nd(e)&&(e=e.__ref),Nd(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(n=e):e,a="string"==typeof t?this.lookup(n=t):t;if(a){__DEV__?Jc("string"==typeof n,"store.merge expects a string ID"):Jc("string"==typeof n,1);var o=new sp(ev).merge(i,a);if(this.data[n]=o,o!==i&&(delete this.refs[n],this.group.caching)){var s=Object.create(null);i||(s.__exists=1),Object.keys(a).forEach((function(e){if(!i||i[e]!==o[e]){s[e]=1;var t=Vm(e);t===e||r.policies.hasKeyArgs(o.__typename,t)||(s[t]=1),void 0!==o[e]||r instanceof Xm||delete o[e]}})),!s.__typename||i&&i.__typename||this.policies.rootTypenamesById[n]!==o.__typename||delete s.__typename,Object.keys(s).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),a=!1,o=!0,s={DELETE:Bm,INVALIDATE:Km,isReference:Nd,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||Cd(e)}:t,{store:n})}};if(Object.keys(r).forEach((function(l){var u=Vm(l),c=r[l];if(void 0!==c){var f="function"==typeof t?t:t[l]||t[u];if(f){var d=f===Wm?Bm:f(Mp(c),$c($c({},s),{fieldName:u,storeFieldName:l,storage:n.getStorage(e,l)}));d===Km?n.group.dirty(e,l):(d===Bm&&(d=void 0),d!==c&&(i[l]=d,a=!0,c=d))}void 0!==c&&(o=!1)}})),a)return this.merge(e,i),o&&(this instanceof Xm?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 a=this.getFieldValue(i,"__typename"),o=t&&n?this.policies.getStoreFieldName({typename:a,fieldName:t,args:n}):t;return this.modify(e,o?((r={})[o]=Wm,r):Wm)}return!1},e.prototype.evict=function(e,t){var n=!1;return e.id&&(Mm.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Xm&&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){Mm.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&&Mm.call(e,n)||t.delete(n)})),e){var n=e.__META,r=Qc(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 Xm?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){Mm.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 Xm;)i=i.parent;r.forEach((function(e){return i.delete(e)}))}return r},e.prototype.findChildRefIds=function(e){if(!Mm.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){Nd(e)&&(t[e.__ref]=!0),Od(e)&&Object.keys(e).forEach((function(t){var n=e[t];Od(n)&&r.add(n)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),Ym=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?Nm():null,this.keyMaker=new Zh(jp)},e.prototype.depend=function(e,t){if(this.d){this.d(Gm(e,t));var n=Vm(t);n!==t&&this.d(Gm(e,n)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(Gm(e,t),"__exists"===t?"forget":"setDirty")},e}();function Gm(e,t){return t+"#"+e}function Jm(e,t){tv(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,a=t.seed,o=e.call(this,n,new Ym(i))||this;return o.stump=new Zm(o),o.storageTrie=new Zh(jp),a&&o.replace(a),o}return Vc(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}(Hm||(Hm={}));var Xm=function(e){function t(t,n,r,i){var a=e.call(this,n.policies,i)||this;return a.id=t,a.parent=n,a.replay=r,a.group=i,r(a),a}return Vc(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){yh(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 $c($c({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return Mm.call(this.data,t)?$c($c({},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}(Hm),Zm=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new Ym(t.group.caching,t.group))||this}return Vc(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},t}(Xm);function ev(e,t,n){var r=e[n],i=t[n];return yh(r,i)?r:i}function tv(e){return!!(e instanceof Hm&&e.group.caching)}var nv,rv,iv=function(){function e(){this.known=new(zp?WeakSet:Set),this.pool=new Zh(jp),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return Od(e)&&this.known.has(e)},e.prototype.pass=function(e){if(Od(e)){var t=function(e){return Od(e)?Um(e)?e.slice(0):$c({__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(Od(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(s=this.pool.lookupArray(r)).array||(this.known.add(s.array=r),__DEV__&&Object.freeze(r)),s.array;case null:case Object.prototype:if(this.known.has(e))return e;var i=Object.getPrototypeOf(e),a=[i],o=this.sortedKeys(e);a.push(o.json);var s,l=a.length;if(o.sorted.forEach((function(n){a.push(t.admit(e[n]))})),!(s=this.pool.lookupArray(a)).object){var u=s.object=Object.create(i);this.known.add(u),o.sorted.forEach((function(e,t){u[e]=a[l+t]})),__DEV__&&Object.freeze(u)}return s.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}(),av=Object.assign((function(e){if(Od(e)){void 0===nv&&ov();var t=nv.admit(e),n=rv.get(t);return void 0===n&&rv.set(t,n=JSON.stringify(t)),n}return JSON.stringify(e)}),{reset:ov});function ov(){nv=new iv,rv=new(jp?WeakMap:Map)}function sv(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var lv=function(){function e(e){var t=this;this.knownResults=new(jp?WeakMap:Map),this.config=Kp(e,{addTypename:!1!==e.addTypename,canonizeResults:jm(e)}),this.canon=e.canon||new iv,this.executeSelectionSet=Im((function(e){var n,r=e.context.canonizeResults,i=sv(e);i[3]=!r;var a=(n=t.executeSelectionSet).peek.apply(n,i);return a?r?$c($c({},a),{result:t.canon.admit(a.result)}):a:(Jm(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize,keyArgs:sv,makeCacheKey:function(e,t,n,r){if(tv(n.store))return n.store.makeCacheKey(e,Nd(t)?t.__ref:t,n.varString,r)}}),this.executeSubSelectedArray=Im((function(e){return Jm(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var t=e.field,n=e.array,r=e.context;if(tv(r.store))return r.store.makeCacheKey(t,n,r.varString)}})}return e.prototype.resetCanon=function(){this.canon=new iv},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,r=e.rootId,i=void 0===r?"ROOT_QUERY":r,a=e.variables,o=e.returnPartialData,s=void 0===o||o,l=e.canonizeResults,u=void 0===l?this.config.canonizeResults:l,c=this.config.cache.policies;a=$c($c({},Wd(Ud(n))),a);var f,d=Cd(i),p=new sp,h=this.executeSelectionSet({selectionSet:Bd(n).selectionSet,objectOrReference:d,enclosingRef:d,context:{store:t,query:n,policies:c,variables:a,varString:av(a),canonizeResults:u,fragmentMap:xd(Qd(n)),merge:function(e,t){return p.merge(e,t)}}});if(h.missing&&(f=[new Am(uv(h.missing),h.missing,n,a)],!s))throw f[0];return{result:h.result,complete:!f,missing:f}},e.prototype.isFresh=function(e,t,n,r){if(tv(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,a=e.context;if(Nd(r)&&!a.policies.rootTypenamesById[r.__ref]&&!a.store.has(r.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(r.__ref," object")};var o,s=a.variables,l=a.policies,u=a.store.getFieldValue(r,"__typename"),c={};function f(e,t){var n;return e.missing&&(o=a.merge(o,((n={})[t]=e.missing,n))),e.result}this.config.addTypename&&"string"==typeof u&&!l.rootIdsByTypename[u]&&(c={__typename:u});var d=new Set(n.selections);d.forEach((function(e){var n,p;if(Ed(e,s))if(qd(e)){var h=l.readField({fieldName:e.name.value,field:e,variables:a.variables,from:r},a),m=Md(e);void 0===h?Zd.added(e)||(o=a.merge(o,((n={})[m]="Can't find field '".concat(e.name.value,"' on ").concat(Nd(r)?r.__ref+" object":"object "+JSON.stringify(r,null,2)),n))):Um(h)?h=f(t.executeSubSelectedArray({field:e,array:h,enclosingRef:i,context:a}),m):e.selectionSet?null!=h&&(h=f(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:h,enclosingRef:Nd(h)?h:i,context:a}),m)):a.canonizeResults&&(h=t.canon.pass(h)),void 0!==h&&(c=a.merge(c,((p={})[m]=h,p)))}else{var v=Td(e,a.fragmentMap);v&&l.fragmentMatches(v,u)&&v.selectionSet.selections.forEach(d.add,d)}}));var p={result:c,missing:o},h=a.canonizeResults?this.canon.admit(p):Mp(p);return h.result&&this.knownResults.set(h.result,n),h},e.prototype.execSubSelectedArrayImpl=function(e){var t,n=this,r=e.field,i=e.array,a=e.enclosingRef,o=e.context;function s(e,n){var r;return e.missing&&(t=o.merge(t,((r={})[n]=e.missing,r))),e.result}return r.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map((function(e,t){return null===e?null:Um(e)?s(n.executeSubSelectedArray({field:r,array:e,enclosingRef:a,context:o}),t):r.selectionSet?s(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,enclosingRef:Nd(e)?e:a,context:o}),t):(__DEV__&&function(e,t,n){if(!t.selectionSet){var r=new Set([n]);r.forEach((function(n){Od(n)&&(__DEV__?Jc(!Nd(n),"Missing selection set for object of type ".concat(function(e,t){return Nd(t)?e.get(t.__ref,"__typename"):t&&t.__typename}(e,n)," returned for query field ").concat(t.name.value)):Jc(!Nd(n),5),Object.values(n).forEach(r.add,r))}))}}(o.store,r,e),e)})),{result:o.canonizeResults?this.canon.admit(i):i,missing:t}},e}();function uv(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var cv=new am,fv=new WeakMap;function dv(e){var t=fv.get(e);return t||fv.set(e,t={vars:new Set,dep:Nm()}),t}function pv(e){dv(e).vars.forEach((function(t){return t.forgetCache(e)}))}function hv(e){var t=new Set,n=new Set,r=function(a){if(arguments.length>0){if(e!==a){e=a,t.forEach((function(e){dv(e).dep.dirty(r),mv(e)}));var o=Array.from(n);n.clear(),o.forEach((function(t){return t(e)}))}}else{var s=cv.getValue();s&&(i(s),dv(s).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),dv(e).vars.add(r),r};return r.forgetCache=function(e){return t.delete(e)},r}function mv(e){e.broadcastWatches&&e.broadcastWatches()}var vv=Object.create(null);function yv(e){var t=JSON.stringify(e);return vv[t]||(vv[t]=Object.create(null))}function gv(e){var t=yv(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,n){var r=function(e,t){return n.readField(t,e)},i=n.keyObject=wv(e,(function(e){var i=_v(n.storeObject,e,r);return void 0===i&&t!==n.storeObject&&Mm.call(t,e[0])&&(i=_v(t,e,kv)),__DEV__?Jc(void 0!==i,"Missing field '".concat(e.join("."),"' while extracting keyFields from ").concat(JSON.stringify(t))):Jc(void 0!==i,2),i}));return"".concat(n.typename,":").concat(JSON.stringify(i))})}function bv(e){var t=yv(e);return t.keyArgsFn||(t.keyArgsFn=function(t,n){var r=n.field,i=n.variables,a=n.fieldName,o=wv(e,(function(e){var n=e[0],a=n.charAt(0);if("@"!==a)if("$"!==a){if(t)return _v(t,e)}else{var o=n.slice(1);if(i&&Mm.call(i,o)){var s=e.slice(0);return s[0]=o,_v(i,s)}}else if(r&&Bp(r.directives)){var l=n.slice(1),u=r.directives.find((function(e){return e.name.value===l})),c=u&&Ad(u,i);return c&&_v(c,e.slice(1))}})),s=JSON.stringify(o);return(t||"{}"!==s)&&(a+=":"+s),a})}function wv(e,t){var n=new sp;return Ev(e).reduce((function(e,r){var i,a=t(r);if(void 0!==a){for(var o=r.length-1;o>=0;--o)(i={})[r[o]]=a,a=i;e=n.merge(e,a)}return e}),Object.create(null))}function Ev(e){var t=yv(e);if(!t.paths){var n=t.paths=[],r=[];e.forEach((function(t,i){Um(t)?(Ev(t).forEach((function(e){return n.push(r.concat(e))})),r.length=0):(r.push(t),Um(e[i+1])||(n.push(r.slice(0)),r.length=0))}))}return t.paths}function kv(e,t){return e[t]}function _v(e,t,n){return n=n||kv,Sv(t.reduce((function e(t,r){return Um(t)?t.map((function(t){return e(t,r)})):t&&n(t,r)}),e))}function Sv(e){return Od(e)?Um(e)?e.map(Sv):wv(Object.keys(e).sort(),(function(t){return _v(e,t)})):e}function xv(e){return void 0!==e.args?e.args:e.field?Ad(e.field,e.variables):null}Id.setStringify(av);var Tv=function(){},Ov=function(e,t){return t.fieldName},Cv=function(e,t,n){return(0,n.mergeObjects)(e,t)},Nv=function(e,t){return t},Rv=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=$c({dataIdFromObject:Lm},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 a,o=t&&t.storeObject||e,s=$c($c({},t),{typename:i,storeObject:o,readField:t&&t.readField||function(){var e=Iv(arguments,o);return r.readField(e,{store:r.cache.data,variables:e.variables})}}),l=i&&this.getTypePolicy(i),u=l&&l.keyFn||this.config.dataIdFromObject;u;){var c=u(e,s);if(!Um(c)){a=c;break}u=gv(c)}return a=a?String(a):void 0,s.keyObject?[a,s.keyObject]:[a]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(n){var r=e[n],i=r.queryType,a=r.mutationType,o=r.subscriptionType,s=Qc(r,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",n),a&&t.setRootTypename("Mutation",n),o&&t.setRootTypename("Subscription",n),Mm.call(t.toBeAdded,n)?t.toBeAdded[n].push(s):t.toBeAdded[n]=[s]}))},e.prototype.updateTypePolicy=function(e,t){var n=this,r=this.getTypePolicy(e),i=t.keyFields,a=t.fields;function o(e,t){e.merge="function"==typeof t?t:!0===t?Cv:!1===t?Nv:e.merge}o(r,t.merge),r.keyFn=!1===i?Tv:Um(i)?gv(i):"function"==typeof i?i:r.keyFn,a&&Object.keys(a).forEach((function(t){var r=n.getFieldPolicy(e,t,!0),i=a[t];if("function"==typeof i)r.read=i;else{var s=i.keyArgs,l=i.read,u=i.merge;r.keyFn=!1===s?Ov:Um(s)?bv(s):"function"==typeof s?s:r.keyFn,"function"==typeof l&&(r.read=l),o(r,u)}r.read&&r.merge&&(r.keyFn=r.keyFn||Ov)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(__DEV__?Jc(!r||r===e,"Cannot change root ".concat(e," __typename more than once")):Jc(!r||r===e,3),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(zm);r&&r[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!Mm.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var r=this.supertypeMap.get(e);r&&r.size&&r.forEach((function(e){var r=t.getTypePolicy(e),i=r.fields,a=Qc(r,["fields"]);Object.assign(n,a),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 a=e.typeCondition.name.value;if(t===a)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(a))for(var o=this.getSupertypeSet(t,!0),s=[o],l=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},u=!(!n||!this.fuzzySubtypes.size),c=!1,f=0;f1?s:t}:(r=$c({},o),Mm.call(r,"from")||(r.from=t)),__DEV__&&void 0===r.from&&__DEV__&&Jc.warn("Undefined 'from' passed to readField with arguments ".concat((i=Array.from(e),a=Yp("stringifyForDisplay"),JSON.stringify(i,(function(e,t){return void 0===t?a:t})).split(JSON.stringify(a)).join("")))),void 0===r.variables&&(r.variables=n),r}function Pv(e){return function(t,n){if(Um(t)||Um(n))throw __DEV__?new Gc("Cannot automatically merge arrays"):new Gc(4);if(Od(t)&&Od(n)){var r=e.getFieldValue(t,"__typename"),i=e.getFieldValue(n,"__typename");if(r&&i&&r!==i)return n;if(Nd(t)&&Qm(n))return e.merge(t.__ref,n),t;if(Qm(t)&&Nd(n))return e.merge(t,n.__ref),n;if(Qm(t)&&Qm(n))return $c($c({},t),n)}return n}}function Fv(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:$c($c({},e),{clientOnly:t,deferred:n})),i}var Av=function(){function e(e,t){this.cache=e,this.reader=t}return e.prototype.writeToStore=function(e,t){var n=this,r=t.query,i=t.result,a=t.dataId,o=t.variables,s=t.overwrite,l=Vd(r),u=new sp;o=$c($c({},Wd(l)),o);var c={store:e,written:Object.create(null),merge:function(e,t){return u.merge(e,t)},variables:o,varString:av(o),fragmentMap:xd(Qd(r)),overwrite:!!s,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map},f=this.processSelectionSet({result:i||Object.create(null),dataId:a,selectionSet:l.selectionSet,mergeTree:{map:new Map},context:c});if(!Nd(f))throw __DEV__?new Gc("Could not identify object ".concat(JSON.stringify(i))):new Gc(6);return c.incomingById.forEach((function(t,r){var i=t.storeObject,a=t.mergeTree,o=t.fieldNodeSet,s=Cd(r);if(a&&a.map.size){var l=n.applyMerges(a,s,i,c);if(Nd(l))return;i=l}if(__DEV__&&!c.overwrite){var u=Object.create(null);o.forEach((function(e){e.selectionSet&&(u[e.name.value]=!0)}));Object.keys(i).forEach((function(e){(function(e){return!0===u[Vm(e)]})(e)&&!function(e){var t=a&&a.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},a=i(e);if(!a)return;var o=i(t);if(!o)return;if(Nd(a))return;if(yh(a,o))return;if(Object.keys(a).every((function(e){return void 0!==r.getFieldValue(o,e)})))return;var s=r.getFieldValue(e,"__typename")||r.getFieldValue(t,"__typename"),l=Vm(n),u="".concat(s,".").concat(l);if(Vv.has(u))return;Vv.add(u);var c=[];Um(a)||Um(o)||[a,o].forEach((function(e){var t=r.getFieldValue(e,"__typename");"string"!=typeof t||c.includes(t)||c.push(t)}));__DEV__&&Jc.warn("Cache data may be lost when replacing the ".concat(l," field of a ").concat(s," object.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(c.length?"either ensure all objects of type "+c.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(u," field, so InMemoryCache can safely merge these objects:\n\n existing: ").concat(JSON.stringify(a).slice(0,1e3),"\n incoming: ").concat(JSON.stringify(o).slice(0,1e3),"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"))}(s,i,e,c.store)}))}e.merge(r,i)})),e.retain(f.__ref),f},e.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,r=e.result,i=e.selectionSet,a=e.context,o=e.mergeTree,s=this.cache.policies,l=Object.create(null),u=n&&s.rootTypenamesById[n]||Ld(r,i,a.fragmentMap)||n&&a.store.get(n,"__typename");"string"==typeof u&&(l.__typename=u);var c=function(){var e=Iv(arguments,l,a.variables);if(Nd(e.from)){var t=a.incomingById.get(e.from.__ref);if(t){var n=s.readField($c($c({},e),{from:t.storeObject}),a);if(void 0!==n)return n}}return s.readField(e,a)},f=new Set;this.flattenFields(i,r,a,u).forEach((function(e,n){var i,a=Md(n),d=r[a];if(f.add(n),void 0!==d){var p=s.getStoreFieldName({typename:u,fieldName:n.name.value,field:n,variables:e.variables}),h=Lv(o,p),m=t.processFieldValue(d,n,n.selectionSet?Fv(e,!1,!1):e,h),v=void 0;n.selectionSet&&(Nd(m)||Qm(m))&&(v=c("__typename",m));var y=s.getMergeFunction(u,n.name.value,v);y?h.info={field:n,typename:u,merge:y}:zv(o,p),l=e.merge(l,((i={})[p]=m,i))}else!__DEV__||e.clientOnly||e.deferred||Zd.added(n)||s.getReadFunction(u,n.name.value)||__DEV__&&Jc.error("Missing field '".concat(Md(n),"' while writing result ").concat(JSON.stringify(r,null,2)).substring(0,1e3))}));try{var d=s.identify(r,{typename:u,selectionSet:i,fragmentMap:a.fragmentMap,storeObject:l,readField:c}),p=d[0],h=d[1];n=n||p,h&&(l=a.merge(l,h))}catch(e){if(!n)throw e}if("string"==typeof n){var m=Cd(n),v=a.written[n]||(a.written[n]=[]);if(v.indexOf(i)>=0)return m;if(v.push(i),this.reader&&this.reader.isFresh(r,m,i,a))return m;var y=a.incomingById.get(n);return y?(y.storeObject=a.merge(y.storeObject,l),y.mergeTree=qv(y.mergeTree,o),f.forEach((function(e){return y.fieldNodeSet.add(e)}))):a.incomingById.set(n,{storeObject:l,mergeTree:jv(o)?void 0:o,fieldNodeSet:f}),m}return l},e.prototype.processFieldValue=function(e,t,n,r){var i=this;return t.selectionSet&&null!==e?Um(e)?e.map((function(e,a){var o=i.processFieldValue(e,t,n,Lv(r,a));return zv(r,a),o})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):__DEV__?Pp(e):e},e.prototype.flattenFields=function(e,t,n,r){void 0===r&&(r=Ld(t,e,n.fragmentMap));var i=new Map,a=this.cache.policies,o=new Zh(!1);return function e(s,l){var u=o.lookup(s,l.clientOnly,l.deferred);u.visited||(u.visited=!0,s.selections.forEach((function(o){if(Ed(o,n.variables)){var s=l.clientOnly,u=l.deferred;if(s&&u||!Bp(o.directives)||o.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(s=!0),"defer"===t){var r=Ad(e,n.variables);r&&!1===r.if||(u=!0)}})),qd(o)){var c=i.get(o);c&&(s=s&&c.clientOnly,u=u&&c.deferred),i.set(o,Fv(n,s,u))}else{var f=Td(o,n.fragmentMap);f&&a.fragmentMatches(f,r,t,n.variables)&&e(f.selectionSet,Fv(n,s,u))}}})))}(e,n),i},e.prototype.applyMerges=function(e,t,n,r,i){var a,o=this;if(e.map.size&&!Nd(n)){var s,l=Um(n)||!Nd(t)&&!Qm(t)?void 0:t,u=n;l&&!i&&(i=[Nd(l)?l.__ref:l]);var c=function(e,t){return Um(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){var n=c(l,t),a=c(u,t);if(void 0!==a){i&&i.push(t);var f=o.applyMerges(e,n,a,r,i);f!==a&&(s=s||new Map).set(t,f),i&&Jc(i.pop()===t)}})),s&&(n=Um(u)?u.slice(0):$c({},u),s.forEach((function(e,t){n[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,i&&(a=r.store).getStorage.apply(a,i)):n},e}(),Mv=[];function Lv(e,t){var n=e.map;return n.has(t)||n.set(t,Mv.pop()||{map:new Map}),n.get(t)}function qv(e,t){if(e===t||!t||jv(t))return e;if(!e||jv(e))return t;var n=e.info&&t.info?$c($c({},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 a=new Set(t.map.keys());e.map.forEach((function(e,n){i.map.set(n,qv(e,t.map.get(n))),a.delete(n)})),a.forEach((function(n){i.map.set(n,qv(t.map.get(n),e.map.get(n)))}))}return i}function jv(e){return!e||!(e.info||e.map.size)}function zv(e,t){var n=e.map,r=n.get(t);r&&jv(r)&&(Mv.push(r),n.delete(t))}var Vv=new Set;var $v,Qv=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=hv,n.txCount=0,n.config=function(e){return Kp(qm,e)}(t),n.addTypename=!!n.config.addTypename,n.policies=new Rv({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return Vc(t,e),t.prototype.init=function(){var e=this.data=new Hm.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;this.storeWriter=new Av(this,this.storeReader=new lv({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:jm(this.config),canon:e?void 0:n&&n.canon})),this.maybeBroadcastWatch=Im((function(e,n){return t.broadcastWatch(e,n)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var n=e.optimistic?t.optimisticData:t.data;if(tv(n)){var r=e.optimistic,i=e.rootId,a=e.variables;return n.makeCacheKey(e.query,e.callback,av({optimistic:r,rootId:i,variables:a}))}}}),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($c($c({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(e){if(e instanceof Am)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(Mm.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($c($c({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t=this;return this.watches.size||function(e){dv(e).vars.forEach((function(t){return t.attachCache(e)}))}(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&pv(t),t.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){av.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},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(Nd(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){__DEV__&&Jc.warn(e)}},t.prototype.evict=function(e){if(!e.id){if(Mm.call(e,"id"))return!1;e=$c($c({},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(),av.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),pv(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,a=void 0===i||i,o=e.removeOptimistic,s=e.onWatchUpdated,l=function(e){var i=n,a=i.data,o=i.optimisticData;++n.txCount,e&&(n.data=n.optimisticData=e);try{return t=r(n)}finally{--n.txCount,n.data=a,n.optimisticData=o}},u=new Set;return s&&!this.txCount&&this.broadcastWatches($c($c({},e),{onWatchUpdated:function(e){return u.add(e),!1}})),"string"==typeof a?this.optimisticData=this.optimisticData.addLayer(a,l):!1===a?l(this.data):l(),"string"==typeof o&&(this.optimisticData=this.optimisticData.removeLayer(o)),s&&u.size?(this.broadcastWatches($c($c({},e),{onWatchUpdated:function(e,t){var n=s.call(this,e,t);return!1!==n&&u.delete(e),n}})),u.size&&u.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){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=Zd(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(n){return t.maybeBroadcastWatch(n,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&&yh(n.result,r.result)||e.callback(e.lastDiff=r,n)},t}(Fm);function Uv(e){return!!e&&e<7}!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"}($v||($v={}));var Bv=Object.assign,Wv=Object.hasOwnProperty,Kv=function(e){function t(t){var n=t.queryManager,r=t.queryInfo,i=t.options,a=e.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=Yv)}catch(e){}var n=!a.observers.size;a.observers.add(e);var r=a.last;return r&&r.error?e.error&&e.error(r.error):r&&r.result&&e.next&&e.next(r.result),n&&a.reobserve().catch((function(){})),function(){a.observers.delete(e)&&!a.observers.size&&a.tearDownQuery()}}))||this;a.observers=new Set,a.subscriptions=new Set,a.queryInfo=r,a.queryManager=n,a.isTornDown=!1,a.options=$c({initialFetchPolicy:i.fetchPolicy||"cache-first"},i),a.queryId=r.queryId||n.generateQueryId();var o=Vd(a.query);return a.queryName=o&&o.name&&o.name.value,a}return Vc(t,e),Object.defineProperty(t.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},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.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),n=this.queryInfo.networkStatus||t&&t.networkStatus||$v.ready,r=$c($c({},t),{loading:Uv(n),networkStatus:n}),i=this.options.fetchPolicy,a=void 0===i?"cache-first":i;if("network-only"===a||"no-cache"===a||"standby"===a||this.queryManager.transform(this.options.query).hasForcedResolvers);else{var o=this.queryInfo.getDiff();(o.complete||this.options.returnPartialData)&&(r.data=o.result),yh(r.data,{})&&(r.data=void 0),o.complete?(delete r.partial,!o.complete||r.networkStatus!==$v.loading||"cache-first"!==a&&"cache-only"!==a||(r.networkStatus=$v.ready,r.loading=!1)):r.partial=!0,!__DEV__||o.complete||this.options.partialRefetch||r.loading||r.data||r.error||Gv(o.missing)}return e&&this.updateLastResult(r),r},t.prototype.isDifferentFromLastResult=function(e){return!this.last||!yh(this.last.result,e)},t.prototype.getLast=function(e,t){var n=this.last;if(n&&n[e]&&(!t||yh(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",__DEV__&&e&&Wv.call(e,"variables")){var i=Ud(this.query),a=i.variableDefinitions;a&&a.some((function(e){return"variables"===e.variable.name.value}))||__DEV__&&Jc.warn("Called refetch(".concat(JSON.stringify(e),") for query ").concat((null===(t=i.name)||void 0===t?void 0:t.value)||JSON.stringify(i),", which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?"))}return e&&!yh(this.options.variables,e)&&(n.variables=this.options.variables=$c($c({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(n,$v.refetch)},t.prototype.fetchMore=function(e){var t=this,n=$c($c({},e.query?e:$c($c($c($c({},this.options),{query:this.query}),e),{variables:$c($c({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),r=this.queryManager.generateQueryId(),i=this.queryInfo,a=i.networkStatus;i.networkStatus=$v.fetchMore,n.notifyOnNetworkStatusChange&&this.observe();var o=new Set;return this.queryManager.fetchQuery(r,n,$v.fetchMore).then((function(s){return t.queryManager.removeQuery(r),i.networkStatus===$v.fetchMore&&(i.networkStatus=a),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:s.data,variables:n.variables})})):r.writeQuery({query:n.query,variables:n.variables,data:s.data})},onWatchUpdated:function(e){o.add(e.query)}}),s})).finally((function(){o.has(t.query)||Hv(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):__DEV__&&Jc.error("Unhandled GraphQL subscription error",t)}});return this.subscriptions.add(n),function(){t.subscriptions.delete(n)&&n.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.setVariables=function(e){return yh(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},$v.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,a=void 0===i?r:i;"function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(r,{reason:e,options:t,observable:this,initialFetchPolicy:a}):t.fetchPolicy="variables-changed"===e?a:t.nextFetchPolicy}return t.fetchPolicy},t.prototype.fetch=function(e,t){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,e,t)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,n=this.options.pollInterval;if(n){if(!t||t.interval!==n){__DEV__?Jc(n,"Attempted to start a polling query without a polling interval."):Jc(n,10),(t||(this.pollingInfo={})).interval=n;var r=function(){e.pollingInfo&&(Uv(e.queryInfo.networkStatus)?i():e.reobserve({fetchPolicy:"network-only"},$v.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){return void 0===t&&(t=this.variables),this.last=$c($c({},this.last),{result:this.queryManager.assumeImmutableResults?e:Pp(e),variables:t}),Bp(e.errors)||delete this.last.error,this.last},t.prototype.reobserve=function(e,t){var n=this;this.isTornDown=!1;var r=t===$v.refetch||t===$v.fetchMore||t===$v.poll,i=this.options.variables,a=this.options.fetchPolicy,o=Gp(this.options,e||{}),s=r?o:Bv(this.options,o);r||(this.updatePolling(),!e||!e.variables||yh(e.variables,i)||e.fetchPolicy&&e.fetchPolicy!==a||(this.applyNextFetchPolicy("variables-changed",s),void 0===t&&(t=$v.setVariables)));var l=s.variables&&$c({},s.variables),u=this.fetch(s,t),c={next:function(e){n.reportResult(e,l)},error:function(e){n.reportError(e,l)}};return r||(this.concast&&this.observer&&this.concast.removeObserver(this.observer,!0),this.concast=u,this.observer=c),u.addObserver(c),u.promise},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var n=this.getLastError();(n||this.isDifferentFromLastResult(e))&&((n||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),Lp(this.observers,"next",e))},t.prototype.reportError=function(e,t){var n=$c($c({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:$v.error,loading:!1});this.updateLastResult(n,t),Lp(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}(Np);function Hv(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(){return this.nextFetchPolicy=r,"function"==typeof r?r.apply(this,arguments):n}}):e.reobserve()}function Yv(e){__DEV__&&Jc.error("Unhandled error",e.message,e.stack)}function Gv(e){__DEV__&&e&&__DEV__&&Jc.debug("Missing cache result fields: ".concat(JSON.stringify(e)),e)}$p(Kv);var Jv=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;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=ip(t.resolvers,e)})):this.resolvers=ip(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){var t=e.document,n=e.remoteResult,r=e.context,i=e.variables,a=e.onlyRunForcedResolvers,o=void 0!==a&&a;return Uc(this,void 0,void 0,(function(){return Bc(this,(function(e){return t?[2,this.resolveDocument(t,n.data,r,i,this.fragmentMatcher,o).then((function(e){return $c($c({},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 kd(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return function(e){zd(e);var t=Xd([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=dd(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every((function(e){return qd(e)&&"__typename"===e.name.value})))return null}}})),t}(e)},e.prototype.prepareContext=function(e){var t=this.cache;return $c($c({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),Uc(this,void 0,void 0,(function(){return Bc(this,(function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then((function(e){return $c($c({},t),e.exportedVariables)}))]:[2,$c({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return dd(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 fd}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:np(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,n,r,i,a){return void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i=function(){return!0}),void 0===a&&(a=!1),Uc(this,void 0,void 0,(function(){var o,s,l,u,c,f,d,p,h;return Bc(this,(function(m){return o=Bd(e),s=Qd(e),l=xd(s),u=o.operation,c=u?u.charAt(0).toUpperCase()+u.slice(1):"Query",d=(f=this).cache,p=f.client,h={fragmentMap:l,context:$c($c({},n),{cache:d,client:p}),variables:r,fragmentMatcher:i,defaultOperationType:c,exportedVariables:{},onlyRunForcedResolvers:a},[2,this.resolveSelectionSet(o.selectionSet,t,h).then((function(e){return{result:e,exportedVariables:h.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,n){return Uc(this,void 0,void 0,(function(){var r,i,a,o,s,l=this;return Bc(this,(function(u){return r=n.fragmentMap,i=n.context,a=n.variables,o=[t],s=function(e){return Uc(l,void 0,void 0,(function(){var s,l;return Bc(this,(function(u){return Ed(e,a)?qd(e)?[2,this.resolveField(e,t,n).then((function(t){var n;void 0!==t&&o.push(((n={})[Md(e)]=t,n))}))]:(jd(e)?s=e:(s=r[e.name.value],__DEV__?Jc(s,"No fragment named ".concat(e.name.value)):Jc(s,9)),s&&s.typeCondition&&(l=s.typeCondition.name.value,n.fragmentMatcher(t,l,i))?[2,this.resolveSelectionSet(s.selectionSet,t,n).then((function(e){o.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(s)).then((function(){return ap(o)}))]}))}))},e.prototype.resolveField=function(e,t,n){return Uc(this,void 0,void 0,(function(){var r,i,a,o,s,l,u,c,f,d=this;return Bc(this,(function(p){return r=n.variables,i=e.name.value,a=Md(e),o=i!==a,s=t[a]||t[i],l=Promise.resolve(s),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(u=t.__typename||n.defaultOperationType,(c=this.resolvers&&this.resolvers[u])&&(f=c[o?i:a])&&(l=Promise.resolve(cv.withValue(this.cache,f,[t,Ad(e,r),n.context,{field:e,fragmentMap:n.fragmentMap}])))),[2,l.then((function(t){return void 0===t&&(t=s),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&&(n.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?d.resolveSubSelectedArray(e,t,n):e.selectionSet?d.resolveSelectionSet(e.selectionSet,t,n):void 0:t}))]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,n){var r=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?r.resolveSubSelectedArray(e,t,n):e.selectionSet?r.resolveSelectionSet(e.selectionSet,t,n):void 0})))},e}(),Xv=new(jp?WeakMap:Map);function Zv(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return Xv.set(e,(Xv.get(e)+1)%1e15),n.apply(this,arguments)})}function ey(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var ty=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.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;Xv.has(n)||(Xv.set(n,0),Zv(n,"evict"),Zv(n,"modify"),Zv(n,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||$v.loading;return this.variables&&this.networkStatus!==$v.loading&&!yh(this.variables,e.variables)&&(t=$v.setVariables),yh(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(){ey(this),this.lastDiff=void 0,this.dirty=!1},e.prototype.getDiff=function(e){void 0===e&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&yh(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&"no-cache"===n.options.fetchPolicy)return{complete:!1};var r=this.cache.diff(t);return this.updateLastDiff(r,t),r},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=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),this.dirty||yh(n&&n.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.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():Hv(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;ey(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(Uv(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,this.subscriptions.forEach((function(e){return e.unsubscribe()}));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=$c($c({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&yh(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===Xv.get(this.cache)&&yh(t,n.variables)&&yh(e.data,n.result.data))},e.prototype.markResult=function(e,t,n){var r=this;this.graphQLErrors=Bp(e.errors)?e.errors:[],this.reset(),"no-cache"===t.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(t.variables)):0!==n&&(ny(e,t.errorPolicy)?this.cache.performTransaction((function(i){if(r.shouldWrite(e,t.variables))i.writeQuery({query:r.document,data:e.data,variables:t.variables,overwrite:1===n}),r.lastWrite={result:e,variables:t.variables,dmCount:Xv.get(r.cache)};else if(r.lastDiff&&r.lastDiff.diff.complete)return void(e.data=r.lastDiff.diff.result);var a=r.getDiffOptions(t.variables),o=i.diff(a);r.stopped||r.updateWatch(t.variables),r.updateLastDiff(o,a),o.complete&&(e.data=o.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=$v.ready},e.prototype.markError=function(e){return this.networkStatus=$v.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function ny(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!Wp(e);return!r&&n&&e.data&&(r=!0),r}var ry=Object.prototype.hasOwnProperty,iy=function(){function e(e){var t=e.cache,n=e.link,r=e.defaultOptions,i=e.queryDeduplication,a=void 0!==i&&i,o=e.onBroadcast,s=e.ssrMode,l=void 0!==s&&s,u=e.clientAwareness,c=void 0===u?{}:u,f=e.localState,d=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(jp?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=n,this.defaultOptions=r||Object.create(null),this.queryDeduplication=a,this.clientAwareness=c,this.localState=f||new Jv({cache:t}),this.ssrMode=l,this.assumeImmutableResults=!!d,(this.onBroadcast=o)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,n){e.stopQueryNoBroadcast(n)})),this.cancelPendingFetches(__DEV__?new Gc("QueryManager stopped while query was in flight"):new Gc(11))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t,n,r=e.mutation,i=e.variables,a=e.optimisticResponse,o=e.updateQueries,s=e.refetchQueries,l=void 0===s?[]:s,u=e.awaitRefetchQueries,c=void 0!==u&&u,f=e.update,d=e.onQueryUpdated,p=e.fetchPolicy,h=void 0===p?(null===(t=this.defaultOptions.mutate)||void 0===t?void 0:t.fetchPolicy)||"network-only":p,m=e.errorPolicy,v=void 0===m?(null===(n=this.defaultOptions.mutate)||void 0===n?void 0:n.errorPolicy)||"none":m,y=e.keepRootFields,g=e.context;return Uc(this,void 0,void 0,(function(){var e,t,n;return Bc(this,(function(s){switch(s.label){case 0:return __DEV__?Jc(r,"mutation option is required. You must specify your GraphQL document in the mutation option."):Jc(r,12),__DEV__?Jc("network-only"===h||"no-cache"===h,"Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):Jc("network-only"===h||"no-cache"===h,13),e=this.generateMutationId(),r=this.transform(r).document,i=this.getVariables(r,i),this.transform(r).hasClientExports?[4,this.localState.addExportedVariables(r,i,g)]:[3,2];case 1:i=s.sent(),s.label=2;case 2:return t=this.mutationStore&&(this.mutationStore[e]={mutation:r,variables:i,loading:!0,error:null}),a&&this.markMutationOptimistic(a,{mutationId:e,document:r,variables:i,fetchPolicy:h,errorPolicy:v,context:g,updateQueries:o,update:f,keepRootFields:y}),this.broadcastQueries(),n=this,[2,new Promise((function(s,u){return qp(n.getObservableFromLink(r,$c($c({},g),{optimisticResponse:a}),i,!1),(function(s){if(Wp(s)&&"none"===v)throw new nh({graphQLErrors:s.errors});t&&(t.loading=!1,t.error=null);var u=$c({},s);return"function"==typeof l&&(l=l(u)),"ignore"===v&&Wp(u)&&delete u.errors,n.markMutationResult({mutationId:e,result:u,document:r,variables:i,fetchPolicy:h,errorPolicy:v,context:g,update:f,updateQueries:o,awaitRefetchQueries:c,refetchQueries:l,removeOptimistic:a?e:void 0,onQueryUpdated:d,keepRootFields:y})})).subscribe({next:function(e){n.broadcastQueries(),s(e)},error:function(r){t&&(t.loading=!1,t.error=r),a&&n.cache.removeOptimistic(e),n.broadcastQueries(),u(r instanceof nh?r:new nh({networkError:r}))}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var n=this;void 0===t&&(t=this.cache);var r=e.result,i=[],a="no-cache"===e.fetchPolicy;if(!a&&ny(r,e.errorPolicy)){i.push({result:r.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables});var o=e.updateQueries;o&&this.queries.forEach((function(e,a){var s=e.observableQuery,l=s&&s.queryName;if(l&&ry.call(o,l)){var u=o[l],c=n.queries.get(a),f=c.document,d=c.variables,p=t.diff({query:f,variables:d,returnPartialData:!0,optimistic:!1}),h=p.result;if(p.complete&&h){var m=u(h,{mutationResult:r,queryName:f&&$d(f)||void 0,queryVariables:d});m&&i.push({result:m,dataId:"ROOT_QUERY",query:f,variables:d})}}}))}if(i.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var s=[];if(this.refetchQueries({updateCache:function(t){a||i.forEach((function(e){return t.write(e)}));var o=e.update;if(o){if(!a){var s=t.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});s.complete&&(r=$c($c({},r),{data:s.result}))}o(t,r,{context:e.context,variables:e.variables})}a||e.keepRootFields||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 s.push(e)})),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(s).then((function(){return r}))}return Promise.resolve(r)},e.prototype.markMutationOptimistic=function(e,t){var n=this,r="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction((function(e){try{n.markMutationResult($c($c({},t),{result:{data:r}}),e)}catch(e){__DEV__&&Jc.error(e)}}),t.mutationId)},e.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).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){var t,n=this.transformCache;if(!n.has(e)){var r=this.cache.transformDocument(e),i=(t=this.cache.transformForLink(r),Xd([ep],zd(t))),a=this.localState.clientQuery(r),o=i&&this.localState.serverQuery(i),s={document:r,hasClientExports:_d(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:a,serverQuery:o,defaultVars:Wd(Vd(r)),asQuery:$c($c({},r),{definitions:r.definitions.map((function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?$c($c({},e),{operation:"query"}):e}))})},l=function(e){e&&!n.has(e)&&n.set(e,s)};l(e),l(r),l(a),l(o)}return n.get(e)},e.prototype.getVariables=function(e,t){return $c($c({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=$c($c({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new ty(this),n=new Kv({queryManager:this,queryInfo:t,options:e});return this.queries.set(n.queryId,t),t.init({document:n.query,observableQuery:n,variables:n.variables}),n},e.prototype.query=function(e,t){var n=this;return void 0===t&&(t=this.generateQueryId()),__DEV__?Jc(e.query,"query option is required. You must specify your GraphQL document in the query option."):Jc(e.query,14),__DEV__?Jc("Document"===e.query.kind,'You must wrap the query string in a "gql" tag.'):Jc("Document"===e.query.kind,15),__DEV__?Jc(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):Jc(!e.returnPartialData,16),__DEV__?Jc(!e.pollInterval,"pollInterval option only supported on watchQuery."):Jc(!e.pollInterval,17),this.fetchQuery(t,e).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(__DEV__?new Gc("Store reset while query was in flight (not completed in link chain)"):new Gc(18)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=$v.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):Od(n=e)&&"Document"===n.kind&&Array.isArray(n.definitions)?r.set(t.transform(e).document,!1):Od(e)&&e.query&&i.add(e)})),this.queries.forEach((function(t,i){var a=t.observableQuery,o=t.document;if(a){if("all"===e)return void n.set(i,a);var s=a.queryName;if("standby"===a.options.fetchPolicy||"active"===e&&!a.hasObservers())return;("active"===e||s&&r.has(s)||o&&r.has(o))&&(n.set(i,a),s&&r.set(s,!0),o&&r.set(o,!0))}})),i.size&&i.forEach((function(e){var r=Yp("legacyOneTimeQuery"),i=t.getQuery(r).init({document:e.query,variables:e.variables}),a=new Kv({queryManager:t,queryInfo:i,options:$c($c({},e),{fetchPolicy:"network-only"})});Jc(a.queryId===r),i.setObservableQuery(a),n.set(r,a)})),__DEV__&&r.size&&r.forEach((function(e,t){e||__DEV__&&Jc.warn("Unknown query ".concat("string"==typeof t?"named ":"").concat(JSON.stringify(t,null,2)," requested in refetchQueries options.include array"))})),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 a=r.options.fetchPolicy;r.resetLastResults(),(e||"standby"!==a&&"cache-only"!==a)&&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,a=e.variables,o=e.context,s=void 0===o?{}:o;n=this.transform(n).document,a=this.getVariables(n,a);var l=function(e){return t.getObservableFromLink(n,s,e).map((function(a){if("no-cache"!==r&&(ny(a,i)&&t.cache.write({query:n,result:a.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries()),Wp(a))throw new nh({graphQLErrors:a.errors});return a}))};if(this.transform(n).hasClientExports){var u=this.localState.addExportedVariables(n,a,s).then(l);return new Np((function(e){var t=null;return u.then((function(n){return t=n.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return l(a)},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){var i,a,o=this;void 0===r&&(r=null!==(i=null==t?void 0:t.queryDeduplication)&&void 0!==i?i:this.queryDeduplication);var s=this.transform(e).serverQuery;if(s){var l=this.inFlightLinkObservables,u=this.link,c={query:s,variables:n,operationName:$d(s)||void 0,context:this.prepareContext($c($c({},t),{forceFetch:!r}))};if(t=c.context,r){var f=l.get(s)||new Map;l.set(s,f);var d=av(n);if(!(a=f.get(d))){var p=new Up([Fh(u,c)]);f.set(d,a=p),p.cleanup((function(){f.delete(d)&&f.size<1&&l.delete(s)}))}}else a=new Up([Fh(u,c)])}else a=new Up([Np.of({data:{}})]),t=this.prepareContext(t);var h=this.transform(e).clientQuery;return h&&(a=qp(a,(function(e){return o.localState.runResolvers({document:h,remoteResult:e,context:t,variables:n})}))),a},e.prototype.getResultsFromLink=function(e,t,n){var r=e.lastRequestId=this.generateRequestId();return qp(this.getObservableFromLink(e.document,n.context,n.variables),(function(i){var a=Bp(i.errors);if(r>=e.lastRequestId){if(a&&"none"===n.errorPolicy)throw e.markError(new nh({graphQLErrors:i.errors}));e.markResult(i,n,t),e.markReady()}var o={data:i.data,loading:!1,networkStatus:$v.ready};return a&&"ignore"!==n.errorPolicy&&(o.errors=i.errors,o.networkStatus=$v.error),o}),(function(t){var n=th(t)?t:new nh({networkError:t});throw r>=e.lastRequestId&&e.markError(n),n}))},e.prototype.fetchQueryObservable=function(e,t,n){var r=this;void 0===n&&(n=$v.loading);var i=this.transform(t.query).document,a=this.getVariables(i,t.variables),o=this.getQuery(e),s=this.defaultOptions.watchQuery,l=t.fetchPolicy,u=void 0===l?s&&s.fetchPolicy||"cache-first":l,c=t.errorPolicy,f=void 0===c?s&&s.errorPolicy||"none":c,d=t.returnPartialData,p=void 0!==d&&d,h=t.notifyOnNetworkStatusChange,m=void 0!==h&&h,v=t.context,y=void 0===v?{}:v,g=Object.assign({},t,{query:i,variables:a,fetchPolicy:u,errorPolicy:f,returnPartialData:p,notifyOnNetworkStatusChange:m,context:y}),b=function(e){return g.variables=e,r.fetchQueryByPolicy(o,g,n)};this.fetchCancelFns.set(e,(function(e){setTimeout((function(){return w.cancel(e)}))}));var w=new Up(this.transform(g.query).hasClientExports?this.localState.addExportedVariables(g.query,g.variables,g.context).then(b):b(g.variables));return w.cleanup((function(){r.fetchCancelFns.delete(e),o.observableQuery&&o.observableQuery.applyNextFetchPolicy("after-fetch",t)})),w},e.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,r=e.include,i=e.optimistic,a=void 0!==i&&i,o=e.removeOptimistic,s=void 0===o?a?Yp("refetchQueries"):void 0:o,l=e.onQueryUpdated,u=new Map;r&&this.getObservableQueries(r).forEach((function(e,n){u.set(n,{oq:e,lastDiff:t.getQuery(n).getDiff()})}));var c=new Map;return n&&this.cache.batch({update:n,optimistic:a&&s||!1,removeOptimistic:s,onWatchUpdated:function(e,t,n){var r=e.watcher instanceof ty&&e.watcher.observableQuery;if(r){if(l){u.delete(r.queryId);var i=l(r,t,n);return!0===i&&(i=r.refetch()),!1!==i&&c.set(r,i),i}null!==l&&u.set(r.queryId,{oq:r,lastDiff:n,diff:t})}}}),u.size&&u.forEach((function(e,n){var r,i=e.oq,a=e.lastDiff,o=e.diff;if(l){if(!o){var s=i.queryInfo;s.reset(),o=s.getDiff()}r=l(i,o,a)}l&&!0!==r||(r=i.refetch()),!1!==r&&c.set(i,r),n.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(n)})),s&&this.cache.removeOptimistic(s),c},e.prototype.fetchQueryByPolicy=function(e,t,n){var r=this,i=t.query,a=t.variables,o=t.fetchPolicy,s=t.refetchWritePolicy,l=t.errorPolicy,u=t.returnPartialData,c=t.context,f=t.notifyOnNetworkStatusChange,d=e.networkStatus;e.init({document:this.transform(i).document,variables:a,networkStatus:n});var p=function(){return e.getDiff(a)},h=function(t,n){void 0===n&&(n=e.networkStatus||$v.loading);var o=t.result;!__DEV__||u||yh(o,{})||Gv(t.missing);var s=function(e){return Np.of($c({data:e,loading:Uv(n),networkStatus:n},t.complete?null:{partial:!0}))};return o&&r.transform(i).hasForcedResolvers?r.localState.runResolvers({document:i,remoteResult:{data:o},context:c,variables:a,onlyRunForcedResolvers:!0}).then((function(e){return s(e.data||void 0)})):s(o)},m="no-cache"===o?0:n===$v.refetch&&"merge"!==s?1:2,v=function(){return r.getResultsFromLink(e,m,{variables:a,context:c,fetchPolicy:o,errorPolicy:l})},y=f&&"number"==typeof d&&d!==n&&Uv(n);switch(o){default:case"cache-first":return(g=p()).complete?[h(g,e.markReady())]:u||y?[h(g),v()]:[v()];case"cache-and-network":var g;return(g=p()).complete||u||y?[h(g),v()]:[v()];case"cache-only":return[h(p(),e.markReady())];case"network-only":return y?[h(p()),v()]:[v()];case"no-cache":return y?[h(e.getDiff()),v()]:[v()];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new ty(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return $c($c({},t),{clientAwareness:this.clientAwareness})},e}(),ay=!1,oy=function(){function e(e){var t=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,r=e.credentials,i=e.headers,a=e.cache,o=e.ssrMode,s=void 0!==o&&o,l=e.ssrForceFetchDelay,u=void 0===l?0:l,c=e.connectToDevTools,f=void 0===c?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:c,d=e.queryDeduplication,p=void 0===d||d,h=e.defaultOptions,m=e.assumeImmutableResults,v=void 0!==m&&m,y=e.resolvers,g=e.typeDefs,b=e.fragmentMatcher,w=e.name,E=e.version,k=e.link;if(k||(k=n?new Hh({uri:n,credentials:r,headers:i}):Nh.empty()),!a)throw __DEV__?new Gc("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new Gc(7);if(this.link=k,this.cache=a,this.disableNetworkFetches=s||u>0,this.queryDeduplication=p,this.defaultOptions=h||Object.create(null),this.typeDefs=g,u&&setTimeout((function(){return t.disableNetworkFetches=!1}),u),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),f&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!ay&&__DEV__&&(ay=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var _=window.navigator,S=_&&_.userAgent,x=void 0;"string"==typeof S&&(S.indexOf("Chrome/")>-1?x="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":S.indexOf("Firefox/")>-1&&(x="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),x&&__DEV__&&Jc.log("Download the Apollo DevTools for a better development experience: "+x)}this.version="3.6.1",this.localState=new Jv({cache:a,client:this,resolvers:y,fragmentMatcher:b}),this.queryManager=new iy({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:p,ssrMode:s,clientAwareness:{name:w,version:E},localState:this.localState,assumeImmutableResults:v,onBroadcast:f?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Gp(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=$c($c({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=Gp(this.defaultOptions.query,e)),__DEV__?Jc("cache-and-network"!==e.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):Jc("cache-and-network"!==e.fetchPolicy,8),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=$c($c({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Gp(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.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},e.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Fh(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){__DEV__&&Jc.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(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},e}(),sy=new Map,ly=new Map,uy=!0,cy=!1;function fy(e){return e.replace(/[\s,]+/g," ").trim()}function dy(e){var t=new Set,n=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var r=e.name.value,i=fy((o=e.loc).source.body.substring(o.start,o.end)),a=ly.get(r);a&&!a.has(i)?uy&&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"):a||ly.set(r,a=new Set),a.add(i),t.has(i)||(t.add(i),n.push(e))}else n.push(e);var o})),$c($c({},e),{definitions:n})}function py(e){var t=fy(e);if(!sy.has(t)){var n=function(e,t){return new ad(e,t).parseDocument()}(e,{experimentalFragmentVariables:cy,allowLegacyFragmentVariables:cy});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");sy.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}(dy(n)))}return sy.get(t)}function hy(e){for(var t=[],n=1;n0?new nh({graphQLErrors:f}):void 0;if(l===o.current.mutationId&&!u.ignoreResults){var p={called:!0,loading:!1,data:c,error:d,client:n};o.current.isMounted&&!yh(o.current.result,p)&&a(o.current.result=p)}return null===(r=s.onCompleted)||void 0===r||r.call(s,t.data),null===(i=e.onCompleted)||void 0===i||i.call(e,t.data),t})).catch((function(t){var r,i;if(l===o.current.mutationId&&o.current.isMounted){var c={loading:!1,error:t,data:void 0,called:!0,client:n};yh(o.current.result,c)||a(o.current.result=c)}if(s.onError||u.onError)return null===(r=s.onError)||void 0===r||r.call(s,t),null===(i=e.onError)||void 0===i||i.call(e,t),{data:void 0,errors:t};throw t}))}),[]),l=L.useCallback((function(){a({called:!1,loading:!1,client:n})}),[]);return L.useEffect((function(){return o.current.isMounted=!0,function(){o.current.isMounted=!1}}),[]),[s,$c({reset:l},i)]}var My=Object.freeze({__proto__:null,ApolloClient:oy,mergeOptions:Gp,ObservableQuery:Kv,get NetworkStatus(){return $v},isApolloError:th,ApolloError:nh,get Cache(){return Pm},ApolloCache:Fm,InMemoryCache:Qv,MissingFieldError:Am,defaultDataIdFromObject:Lm,makeVar:hv,fromError:_h,toPromise:function(e){var t=!1;return new Promise((function(n,r){e.subscribe({next:function(e){t?__DEV__&&Jc.warn("Promise Wrapper does not support multiple results from Observable"):(t=!0,n(e))},error:r})}))},fromPromise:function(e){return new Np((function(t){e.then((function(e){t.next(e),t.complete()})).catch(t.error.bind(t))}))},throwServerError:Sh,Observable:Np,isReference:Nd,makeReference:Cd,get gql(){return hy},resetCaches:my,disableFragmentWarnings:vy,enableExperimentalFragmentVariables:yy,disableExperimentalFragmentVariables:gy,empty:Rh,from:Dh,split:Ih,concat:Ph,execute:Fh,ApolloLink:Nh,parseAndCheckHttpResponse:Mh,serializeFetchParameter:Lh,fallbackHttpConfig:qh,defaultPrinter:jh,selectHttpOptionsAndBody:function(e,t){for(var n=[],r=2;r.'):Jc(t&&t.client,25),e.children(t.client)}))},getApolloContext:Xp,resetApolloContext:Xp,get DocumentType(){return wy},operationName:Oy,parser:Cy,useQuery:Dy,useApolloClient:eh,useLazyQuery:function(e,t){var n=Iy(eh(t&&t.client),e),r=L.useRef(),i=n.client.defaultOptions.watchQuery,a=t&&t.fetchPolicy||r.current&&r.current.fetchPolicy||i&&i.fetchPolicy||"cache-first",o=n.useQuery($c($c($c({},t),r.current),{skip:!r.current})),s=Object.assign(o,{called:!!r.current}),l=L.useMemo((function(){for(var e={},t=function(t){var i=s[t];e[t]=function(){return r.current||(r.current=Object.create(null),n.forceUpdate()),i.apply(this,arguments)}},i=0,a=Fy;i{switch(t.type){case qy.ActionTypes.REQUEST:return e+1;case qy.ActionTypes.ERROR:case qy.ActionTypes.SUCCESS:case qy.ActionTypes.CANCEL:return Math.max(e-1,0);default:return e}},zy=(e,t)=>{switch(t.type){case qy.ActionTypes.REQUEST:return[];case qy.ActionTypes.ERROR:const{networkError:n}=t.payload;return[n];case qy.ActionTypes.SUCCESS:const{result:r}=t.payload;return!0===(null!=r&&null!=r.errors)?[...r.errors]:e;default:return e}};var Vy="3.4.1",$y="https://github.com/electerious/Ackee",Qy=(e,t)=>({get:()=>{const n=localStorage.getItem(e);return null==n?t:JSON.parse(n)},set:t=>{const n=JSON.stringify(t);return localStorage.setItem(e,n),t},reset:()=>(localStorage.removeItem(e),t)});const Uy=Symbol(),By=Symbol(),{get:Wy,set:Ky,reset:Hy}=Qy("ackee_token_3.4.1"),Yy=(e,t)=>{switch(t.type){case Uy:return Ky(t.token);case By:return Hy();default:return e}};var Gy,Jy=function(){function e(e){var t=e.batchDebounce,n=e.batchInterval,r=e.batchMax,i=e.batchHandler,a=e.batchKey;this.batchesByKey=new Map,this.batchDebounce=t,this.batchInterval=n,this.batchMax=r||0,this.batchHandler=i,this.batchKey=a||function(){return""}}return e.prototype.enqueueRequest=function(e){var t=this,n=$c($c({},e),{next:[],error:[],complete:[],subscribers:new Set}),r=this.batchKey(e.operation);return n.observable||(n.observable=new Np((function(e){var i=t.batchesByKey.get(r);i||t.batchesByKey.set(r,i=new Set);var a=0===i.size,o=0===n.subscribers.size;return n.subscribers.add(e),o&&i.add(n),e.next&&n.next.push(e.next.bind(e)),e.error&&n.error.push(e.error.bind(e)),e.complete&&n.complete.push(e.complete.bind(e)),a?t.scheduleQueueConsumption(r):t.batchDebounce&&(clearTimeout(t.scheduledBatchTimer),t.scheduleQueueConsumption(r)),i.size===t.batchMax&&t.consumeQueue(r),function(){var a;n.subscribers.delete(e)&&n.subscribers.size<1&&i.delete(n)&&i.size<1&&(clearTimeout(t.scheduledBatchTimer),t.batchesByKey.delete(r),null===(a=i.subscription)||void 0===a||a.unsubscribe())}}))),n.observable},e.prototype.consumeQueue=function(e){void 0===e&&(e="");var t=this.batchesByKey.get(e);if(this.batchesByKey.delete(e),t&&t.size){var n=[],r=[],i=[],a=[],o=[],s=[];t.forEach((function(e){n.push(e.operation),r.push(e.forward),i.push(e.observable),a.push(e.next),o.push(e.error),s.push(e.complete)}));var l=this.batchHandler(n,r)||Np.of(),u=function(e){o.forEach((function(t){t&&t.forEach((function(t){return t(e)}))}))};return t.subscription=l.subscribe({next:function(e){if(Array.isArray(e)||(e=[e]),a.length!==e.length){var t=new Error("server returned results with length ".concat(e.length,", expected length of ").concat(a.length));return t.result=e,u(t)}e.forEach((function(e,t){a[t]&&a[t].forEach((function(t){return t(e)}))}))},error:u,complete:function(){s.forEach((function(e){e&&e.forEach((function(e){return e()}))}))}}),i}},e.prototype.scheduleQueueConsumption=function(e){var t=this;this.scheduledBatchTimer=setTimeout((function(){t.consumeQueue(e)}),this.batchInterval)},e}(),Xy=function(e){function t(t){var n=e.call(this)||this,r=t||{},i=r.batchDebounce,a=r.batchInterval,o=void 0===a?10:a,s=r.batchMax,l=void 0===s?0:s,u=r.batchHandler,c=void 0===u?function(){return null}:u,f=r.batchKey,d=void 0===f?function(){return""}:f;return n.batcher=new Jy({batchDebounce:i,batchInterval:o,batchMax:l,batchHandler:c,batchKey:d}),t.batchHandler.length<=1&&(n.request=function(e){return n.batcher.enqueueRequest({operation:e})}),n}return Vc(t,e),t.prototype.request=function(e,t){return this.batcher.enqueueRequest({operation:e,forward:t})},t}(Nh),Zy=function(e){function t(t){var n=e.call(this)||this,r=t||{},i=r.uri,a=void 0===i?"/graphql":i,o=r.fetch,s=r.print,l=void 0===s?jh:s,u=r.includeExtensions,c=r.batchInterval,f=r.batchDebounce,d=r.batchMax,p=r.batchKey,h=Qc(r,["uri","fetch","print","includeExtensions","batchInterval","batchDebounce","batchMax","batchKey"]);$h(o),o||(o=fetch);var m={http:{includeExtensions:u},options:h.fetchOptions,credentials:h.credentials,headers:h.headers};n.batchDebounce=f,n.batchInterval=c||10,n.batchMax=d||10;return p=p||function(e){var t=e.getContext(),n={http:t.http,options:t.fetchOptions,credentials:t.credentials,headers:t.headers};return Uh(e,a)+JSON.stringify(n)},n.batcher=new Xy({batchDebounce:n.batchDebounce,batchInterval:n.batchInterval,batchMax:n.batchMax,batchKey:p,batchHandler:function(e){var t=Uh(e[0],a),n=e[0].getContext(),r={};if(n.clientAwareness){var i=n.clientAwareness,s=i.name,u=i.version;s&&(r["apollographql-client-name"]=s),u&&(r["apollographql-client-version"]=u)}var c,f={http:n.http,options:n.fetchOptions,credentials:n.credentials,headers:$c($c({},r),n.headers)},d=e.map((function(e){return zh(e,l,qh,m,f)})),p=d.map((function(e){return e.body})),h=d[0].options;if("GET"===h.method)return _h(new Error("apollo-link-batch-http does not support GET requests"));try{h.body=Lh(p,"Payload")}catch(e){return _h(e)}if(!h.signal){var v=Qh(),y=v.controller,g=v.signal;(c=y)&&(h.signal=g)}return new Np((function(n){return o(t,h).then((function(t){return e.forEach((function(e){return e.setContext({response:t})})),t})).then(Mh(e)).then((function(e){return n.next(e),n.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&n.next(e.result),n.error(e))})),function(){c&&c.abort()}}))}}),n}return Vc(t,e),t.prototype.request=function(e){return this.batcher.request(e)},t}(Nh),eg=(new Intl.DateTimeFormat).resolvedOptions().timeZone;function tg(){return tg=Object.assign||function(e){for(var t=1;t=0&&(t.hash=e.substr(n),e=e.substr(0,n));var r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var lg=n((function(t,n){var r=[].slice;!function(e,r){null!==n?t.exports=r():e.UrlPattern=r()}(e,(function(){var e,t,n,i,a,o,s,l,u,c,f,d,p,h,m;return u=function(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},s=function(e,t){var n,r,i;for(i=[],n=-1,r=e.length;++n(Array.isArray(o)?o.length-1:0)))return a=Array.isArray(o)?o[i]:o,r&&(n[t]=i+1),a;if(r)throw new Error("too few values provided for key `"+t+"`")}else if(r)throw new Error("no values provided for key `"+t+"`")},n=function(e,t,r){var i,a;if(Array.isArray(e)){for(i=-1,a=e.length;++i!0===kg.some((t=>null!=t.pattern.match(e)))?e:_g.pattern.stringify();var xg=1;var Tg,Og,Cg,Ng={nextValue:function(){return(xg=(9301*xg+49297)%233280)/233280},seed:function(e){xg=e}},Rg="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";function Dg(){Cg=!1}function Ig(e){if(e){if(e!==Tg){if(e.length!==Rg.length)throw new Error("Custom alphabet for shortid must be "+Rg.length+" unique characters. You submitted "+e.length+" characters: "+e);var t=e.split("").filter((function(e,t,n){return t!==n.lastIndexOf(e)}));if(t.length)throw new Error("Custom alphabet for shortid must be "+Rg.length+" unique characters. These characters were not unique: "+t.join(", "));Tg=e,Dg()}}else Tg!==Rg&&(Tg=Rg,Dg())}function Pg(){return Cg||(Cg=function(){Tg||Ig(Rg);for(var e,t=Tg.split(""),n=[],r=Ng.nextValue();t.length>0;)r=Ng.nextValue(),e=Math.floor(r*t.length),n.push(t.splice(e,1)[0]);return n.join("")}(),Cg)}var Fg={get:function(){return Tg||Rg},characters:function(e){return Ig(e),Tg},seed:function(e){Ng.seed(e),Og!==e&&(Dg(),Og=e)},lookup:function(e){return Pg()[e]},shuffled:Pg},Ag="object"==typeof window&&(window.crypto||window.msCrypto),Mg=Ag&&Ag.getRandomValues?function(e){return Ag.getRandomValues(new Uint8Array(e))}:function(e){for(var t=[],n=0;n0&&(t+=zg(qg)),t+=zg(n)};var $g=function(e){return!(!e||"string"!=typeof e||e.length<6)&&!new RegExp("[^"+Fg.get().replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&")+"]").test(e)},Qg=n((function(e){var t=0;function n(){return Vg(t)}e.exports=n,e.exports.generate=n,e.exports.seed=function(t){return Fg.seed(t),e.exports},e.exports.worker=function(n){return t=n,e.exports},e.exports.characters=function(e){return void 0!==e&&Fg.characters(e),Fg.shuffled()},e.exports.isValid=$g})),Ug=Qg,Bg=()=>`_${Ug.generate()}`;const Wg=Symbol(),Kg=Symbol(),Hg=Symbol(),Yg={},Gg=(e,t)=>{switch(t.type){case Wg:return{...e,[t.modalId]:{id:t.modalId,type:t.payload.type,props:t.payload.props}};case Kg:const n={...e};return delete n[t.modalId],n;case Hg:return Yg;default:return e}};var Jg="TOP",Xg="NEW",Zg="RECENT";var eb="LAST_24_HOURS",tb="LAST_7_DAYS",nb="LAST_30_DAYS",rb="LAST_6_MONTHS";var ib="DAILY",ab="MONTHLY",ob="YEARLY";var sb="UNIQUE",lb="TOTAL";var ub="WITH_SOURCE",cb="NO_SOURCE",fb="ONLY_SOURCE";var db="WITH_MODEL",pb="NO_MODEL";var hb="WITH_VERSION",mb="NO_VERSION";var vb="BROWSER_HEIGHT",yb="BROWSER_RESOLUTION",gb="BROWSER_WIDTH",bb="SCREEN_HEIGHT",wb="SCREEN_RESOLUTION",Eb="SCREEN_WIDTH";var kb="WITH_VERSION",_b="NO_VERSION";const Sb=Symbol(),xb=Symbol(),Tb=Symbol(),Ob=Symbol(),Cb=Symbol(),Nb=Symbol(),Rb=Symbol(),Db=Symbol(),Ib=Symbol(),Pb=Symbol(),{get:Fb,set:Ab,reset:Mb}=Qy("ackee_filter_3.4.1",{sorting:Jg,range:tb,interval:ib,viewsType:sb,referrersType:ub,devicesType:db,browsersType:hb,sizesType:yb,systemsType:kb}),Lb=(e,t)=>{switch(t.type){case Sb:return Ab({...e,sorting:t.payload});case xb:return Ab({...e,range:t.payload});case Tb:return Ab({...e,interval:t.payload});case Ob:return Ab({...e,viewsType:t.payload});case Cb:return Ab({...e,referrersType:t.payload});case Nb:return Ab({...e,devicesType:t.payload});case Rb:return Ab({...e,browsersType:t.payload});case Db:return Ab({...e,sizesType:t.payload});case Ib:return Ab({...e,systemsType:t.payload});case Pb:return Mb();default:return e}};const qb=["Token invalid","Token missing","Username or password incorrect"];var jb=e=>!0===qb.includes(e.message),zb="function"==typeof Symbol&&Symbol.for,Vb=zb?Symbol.for("react.element"):60103,$b=zb?Symbol.for("react.portal"):60106,Qb=zb?Symbol.for("react.fragment"):60107,Ub=zb?Symbol.for("react.strict_mode"):60108,Bb=zb?Symbol.for("react.profiler"):60114,Wb=zb?Symbol.for("react.provider"):60109,Kb=zb?Symbol.for("react.context"):60110,Hb=zb?Symbol.for("react.async_mode"):60111,Yb=zb?Symbol.for("react.concurrent_mode"):60111,Gb=zb?Symbol.for("react.forward_ref"):60112,Jb=zb?Symbol.for("react.suspense"):60113,Xb=zb?Symbol.for("react.suspense_list"):60120,Zb=zb?Symbol.for("react.memo"):60115,ew=zb?Symbol.for("react.lazy"):60116,tw=zb?Symbol.for("react.block"):60121,nw=zb?Symbol.for("react.fundamental"):60117,rw=zb?Symbol.for("react.responder"):60118,iw=zb?Symbol.for("react.scope"):60119;function aw(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Vb:switch(e=e.type){case Hb:case Yb:case Qb:case Bb:case Ub:case Jb:return e;default:switch(e=e&&e.$$typeof){case Kb:case Gb:case ew:case Zb:case Wb:return e;default:return t}}case $b:return t}}}function ow(e){return aw(e)===Yb}var sw={AsyncMode:Hb,ConcurrentMode:Yb,ContextConsumer:Kb,ContextProvider:Wb,Element:Vb,ForwardRef:Gb,Fragment:Qb,Lazy:ew,Memo:Zb,Portal:$b,Profiler:Bb,StrictMode:Ub,Suspense:Jb,isAsyncMode:function(e){return ow(e)||aw(e)===Hb},isConcurrentMode:ow,isContextConsumer:function(e){return aw(e)===Kb},isContextProvider:function(e){return aw(e)===Wb},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Vb},isForwardRef:function(e){return aw(e)===Gb},isFragment:function(e){return aw(e)===Qb},isLazy:function(e){return aw(e)===ew},isMemo:function(e){return aw(e)===Zb},isPortal:function(e){return aw(e)===$b},isProfiler:function(e){return aw(e)===Bb},isStrictMode:function(e){return aw(e)===Ub},isSuspense:function(e){return aw(e)===Jb},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===Qb||e===Yb||e===Bb||e===Ub||e===Jb||e===Xb||"object"==typeof e&&null!==e&&(e.$$typeof===ew||e.$$typeof===Zb||e.$$typeof===Wb||e.$$typeof===Kb||e.$$typeof===Gb||e.$$typeof===nw||e.$$typeof===rw||e.$$typeof===iw||e.$$typeof===tw)},typeOf:aw}; /** @license React v16.13.1 * react-is.development.js * diff --git a/package.json b/package.json index bb6831da..82590a54 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ackee", "private": true, - "version": "3.4.0", + "version": "3.4.1", "authors": [ "Tobias Reich " ],