/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/apollo-cache-inmemory-fork@1.1.8/lib/bundle.umd.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("apollo-utilities"),require("graphql/language/printer"),require("graphql-anywhere"),require("apollo-cache")):"function"==typeof define&&define.amd?define(["exports","apollo-utilities","graphql/language/printer","graphql-anywhere","apollo-cache"],e):e((t.apollo=t.apollo||{},t.apollo.cache=t.apollo.cache||{},t.apollo.cache.inmemory={}),t.apollo.utilities,t.printer,t.graphqlAnywhere,t.apolloCache.core)}(this,(function(t,e,r,a,n){"use strict";a=a&&a.hasOwnProperty("default")?a.default:a;var o=!1,i=function(){function t(){}return t.prototype.ensureReady=function(){return Promise.resolve()},t.prototype.canBypassInit=function(){return!0},t.prototype.match=function(t,r,a){var n=a.store.get(t.id);return!!n&&(n.__typename?(n.__typename===r||(e.warnOnceInDevelopment("You are using the simple (heuristic) fragment matcher, but your queries contain union or interface types.\n     Apollo Client will not be able to able to accurately map fragments.To make this error go away, use the IntrospectionFragmentMatcher as described in the docs: https://www.apollographql.com/docs/react/recipes/fragment-matching.html","error"),a.returnPartialData=!0),!0):(o||(console.warn("You're using fragments in your queries, but either don't have the addTypename:\n  true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n   Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n   can accurately match fragments."),console.warn("Could not find __typename on Fragment ",r,n),console.warn("DEPRECATION WARNING: using fragments without __typename is unsupported behavior and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now."),e.isTest()||(o=!0)),a.returnPartialData=!0,!0))},t}(),s=function(){function t(t){t&&t.introspectionQueryResultData?(this.possibleTypesMap=this.parseIntrospectionResult(t.introspectionQueryResultData),this.isReady=!0):this.isReady=!1,this.match=this.match.bind(this)}return t.prototype.match=function(t,e,r){if(!this.isReady)throw new Error("FragmentMatcher.match() was called before FragmentMatcher.init()");var a=r.store.get(t.id);if(!a)return!1;if(!a.__typename)throw new Error("Cannot match fragment because __typename property is missing: "+JSON.stringify(a));if(a.__typename===e)return!0;var n=this.possibleTypesMap[e];return!!(n&&n.indexOf(a.__typename)>-1)},t.prototype.parseIntrospectionResult=function(t){var e={};return t.__schema.types.forEach((function(t){"UNION"!==t.kind&&"INTERFACE"!==t.kind||(e[t.name]=t.possibleTypes.map((function(t){return t.name})))})),e},t}(),c=function(){function t(t){void 0===t&&(t={}),this.data=t}return t.prototype.toObject=function(){return this.data},t.prototype.get=function(t){return this.data[t]},t.prototype.set=function(t,e){this.data[t]=e},t.prototype.delete=function(t){this.data[t]=void 0},t.prototype.clear=function(){this.data={}},t.prototype.replace=function(t){this.data=t||{}},t}();function u(t){return new c(t)}var l,d=(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),p=Object.assign||function(t){for(var e,r=1,a=arguments.length;r<a;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="WriteError",e}return d(e,t),e}(Error);function h(t,e){var a=new f("Error writing result to store for query:\n "+r.print(e));return a.message+="\n"+t.message,a.stack=t.stack,a}function y(t){var r=t.dataId,a=t.result,n=t.document,o=t.storeFactory,i=void 0===o?u:o,s=t.store,c=void 0===s?i():s,l=t.variables,d=t.dataIdFromObject,p=t.fragmentMatcherFunction,f=e.getOperationDefinition(n),y=f.selectionSet,v=e.createFragmentMap(e.getFragmentDefinitions(n));l=e.assign({},e.getDefaultValues(f),l);try{return m({result:a,dataId:r,selectionSet:y,context:{store:c,storeFactory:i,processedData:{},variables:l,dataIdFromObject:d,fragmentMap:v,fragmentMatcherFunction:p}})}catch(t){throw h(t,n)}}function m(t){var a=t.result,n=t.dataId,o=t.selectionSet,i=t.context,s=i.variables,u=i.store,l=i.fragmentMap;return o.selections.forEach((function(t){var o=e.shouldInclude(t,s);if(e.isField(t)){var u=e.resultKeyNameFromField(t),d=a[u];if(o)if(void 0!==d)!function(t){var a,n,o=t.field,i=t.value,s=t.dataId,c=t.context,u=c.variables,l=c.dataIdFromObject,d=c.store,f=e.storeKeyNameFromField(o,u),h=!1,y="";if(o.selectionSet&&null!==i)if(Array.isArray(i)){a=w(i,s+"."+f,o.selectionSet,c)}else{var O=s+"."+f,I=!0;if(v(O)||(O="$"+O),l){var _=l(i);if(_&&v(_))throw new Error('IDs returned by dataIdFromObject cannot begin with the "$" character.');_&&(O=_,I=!1)}if(b(O,o,c.processedData)||m({dataId:O,result:i,selectionSet:o.selectionSet,context:c}),a={type:"id",id:O,generated:I},(n=d.get(s))&&n[f]!==a){var F=n[f];if(e.isIdValue(a)&&a.generated&&e.isIdValue(F)&&!F.generated)throw new Error("Store error: the application attempted to write an object with no provided id but the store already contains an id of "+F.id+" for this object. The selectionSet that was trying to be written is:\n"+r.print(o));e.isIdValue(F)&&F.generated&&(y=F.id,h=!0)}}else a=null!=i&&"object"==typeof i?{type:"json",json:i}:i;var D,R=p({},d.get(s),((D={})[f]=a,D));h&&g(y,a.id,d);n=d.get(s),n&&a===n[f]||d.set(s,R)}({dataId:n,value:d,field:t,context:i});else!(t.directives&&t.directives.length&&t.directives.some((function(t){return t.name&&"defer"===t.name.value})))&&i.fragmentMatcherFunction&&(e.isProduction()||console.warn("Missing field "+u+" in "+JSON.stringify(a,null,2).substring(0,100)))}else{var f=void 0;if(e.isInlineFragment(t))f=t;else if(!(f=(l||{})[t.name.value]))throw new Error("No fragment named "+t.name.value+".");var h=!0;if(i.fragmentMatcherFunction&&f.typeCondition){var y={store:new c({self:a}),returnPartialData:!1,hasMissingField:!1,cacheResolvers:{}};h=i.fragmentMatcherFunction({type:"id",id:"self",generated:!1},f.typeCondition.name.value,y),!e.isProduction()&&y.returnPartialData&&console.error("WARNING: heuristic fragment matching going on!")}o&&h&&m({result:a,selectionSet:f.selectionSet,dataId:n,context:i})}})),u}function v(t){return"$"===t[0]}function g(t,r,a){var n=a.get(t),o=a.get(r);Object.keys(n).forEach((function(i){var s=n[i],c=o[i];e.isIdValue(s)&&v(s.id)&&e.isIdValue(c)&&g(s.id,c.id,a),a.delete(t),a.set(r,p({},n,o))}))}function b(t,e,r){if(!r)return!1;if(r[t]){if(r[t].indexOf(e)>=0)return!0;r[t].push(e)}else r[t]=[e];return!1}function w(t,e,r,a){return t.map((function(t,n){if(null===t)return null;var o=e+"."+n;if(Array.isArray(t))return w(t,o,r,a);var i=!0;if(a.dataIdFromObject){var s=a.dataIdFromObject(t);s&&(o=s,i=!1)}return b(o,r,a.processedData)||m({dataId:o,result:t,selectionSet:r,context:a}),{type:"id",id:o,generated:i}}))}var O=Object.assign||function(t){for(var e,r=1,a=arguments.length;r<a;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},I="undefined"!=typeof Symbol?Symbol("id"):"@@id";function _(t){return D(O({},t,{returnPartialData:!1})).result}var F=function(t,r,a,n,o){var i=o.resultKey,s=o.directives;R(r);var c=r.id,u=n.store.get(c),l=e.getStoreKeyName(t,a,s),d=(u||{})[l];if(void 0===d&&n.cacheResolvers&&u&&(u.__typename||"ROOT_QUERY"===c)){var p=u.__typename||"Query",f=n.cacheResolvers[p];if(f){var h=f[t];h&&(d=h(u,a))}}if(void 0===d){if(!n.returnPartialData)throw new Error("Can't find field "+l+" on object ("+c+") "+JSON.stringify(u,null,2)+".");return n.hasMissingField=!0,d}return e.isJsonValue(d)?r.previousResult&&e.isEqual(r.previousResult[i],d.json)?r.previousResult[i]:d.json:(r.previousResult&&(d=j(d,r.previousResult[i])),d)};function D(t){var r=t.store,n=t.query,o=t.variables,i=t.previousResult,s=t.returnPartialData,c=void 0===s||s,u=t.rootId,l=void 0===u?"ROOT_QUERY":u,d=t.fragmentMatcherFunction,p=t.config,f=e.getQueryDefinition(n);o=e.assign({},e.getDefaultValues(f),o);var h={store:r,returnPartialData:c,cacheResolvers:p&&p.cacheResolvers||{},hasMissingField:!1};return{result:a(F,n,{type:"id",id:l,previousResult:i},h,o,{fragmentMatcher:d,resultMapper:M}),complete:!h.hasMissingField}}function R(t){if(!e.isIdValue(t))throw new Error("Encountered a sub-selection on the query, but the store doesn't have an object reference. This should never happen during normal use unless you have custom code that is directly manipulating the store; please file an issue.")}function j(t,r){if(e.isIdValue(t))return O({},t,{previousResult:r});if(Array.isArray(t)){var a=new Map;return Array.isArray(r)&&r.forEach((function(t){t&&t[I]&&a.set(t[I],t)})),t.map((function(t,n){var o=r&&r[n];return e.isIdValue(t)&&(o=a.get(t.id)||o),j(t,o)}))}return t}function M(t,e){if(e.previousResult){var r=Object.keys(t);if(Object.keys(e.previousResult).reduce((function(t,e){return t&&r.indexOf(e)>-1}),!0)&&r.every((function(r){return E(t[r],e.previousResult[r])})))return e.previousResult}return Object.defineProperty(t,I,{enumerable:!1,configurable:!1,writable:!1,value:e.id}),t}function E(t,e){return t===e||!(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)&&t.every((function(t,r){return E(t,e[r])}))}var q=Object.assign||function(t){for(var e,r=1,a=arguments.length;r<a;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},T=function(){function t(t){void 0===t&&(t={}),this.data=t,this.recordedData={}}return t.prototype.record=function(t){t(this);var e=this.recordedData;return this.recordedData={},e},t.prototype.toObject=function(){return q({},this.data,this.recordedData)},t.prototype.get=function(t){return this.recordedData.hasOwnProperty(t)?this.recordedData[t]:this.data[t]},t.prototype.set=function(t,e){this.get(t)!==e&&(this.recordedData[t]=e)},t.prototype.delete=function(t){this.recordedData[t]=void 0},t.prototype.clear=function(){var t=this;Object.keys(this.data).forEach((function(e){return t.delete(e)})),this.recordedData={}},t.prototype.replace=function(t){this.clear(),this.recordedData=q({},t)},t}();function P(t,e){return new T(t).record(e)}var S=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}(),A=Object.assign||function(t){for(var e,r=1,a=arguments.length;r<a;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},x={fragmentMatcher:new i,dataIdFromObject:N,addTypename:!0,storeFactory:u};function N(t){if(t.__typename){if(void 0!==t.id)return t.__typename+":"+t.id;if(void 0!==t._id)return t.__typename+":"+t._id}return null}var C=function(t){function r(e){void 0===e&&(e={});var r=t.call(this)||this;return r.optimistic=[],r.watches=[],r.silenceBroadcast=!1,r.config=A({},x,e),r.config.customResolvers&&(r.config.cacheResolvers=r.config.customResolvers),r.addTypename=r.config.addTypename,r.data=r.config.storeFactory(),r}return S(r,t),r.prototype.restore=function(t){return t&&(this.data.replace(t),this.broadcastWatches()),this},r.prototype.extract=function(t){if(void 0===t&&(t=!1),t&&this.optimistic.length>0){var e=this.optimistic.map((function(t){return t.data}));return Object.assign.apply(Object,[{},this.data.toObject()].concat(e))}return this.data.toObject()},r.prototype.read=function(t){return t.rootId&&void 0===this.data.get(t.rootId)?null:_({store:this.config.storeFactory(this.extract(t.optimistic)),query:this.transformDocument(t.query),variables:t.variables,rootId:t.rootId,fragmentMatcherFunction:this.config.fragmentMatcher.match,previousResult:t.previousResult,config:this.config})},r.prototype.write=function(t){y({dataId:t.dataId,result:t.result,variables:t.variables,document:this.transformDocument(t.query),store:this.data,dataIdFromObject:this.config.dataIdFromObject,fragmentMatcherFunction:this.config.fragmentMatcher.match}),this.broadcastWatches()},r.prototype.diff=function(t){return D({store:this.config.storeFactory(this.extract(t.optimistic)),query:this.transformDocument(t.query),variables:t.variables,returnPartialData:t.returnPartialData,previousResult:t.previousResult,fragmentMatcherFunction:this.config.fragmentMatcher.match,config:this.config})},r.prototype.watch=function(t){var e=this;return this.watches.push(t),function(){e.watches=e.watches.filter((function(e){return e!==t}))}},r.prototype.evict=function(t){throw new Error("eviction is not implemented on InMemory Cache")},r.prototype.reset=function(){return this.data.clear(),this.broadcastWatches(),Promise.resolve()},r.prototype.removeOptimistic=function(t){var e=this,r=this.optimistic.filter((function(e){return e.id!==t}));this.optimistic=[],r.forEach((function(t){e.recordOptimisticTransaction(t.transaction,t.id)})),this.broadcastWatches()},r.prototype.performTransaction=function(t){var e=this.silenceBroadcast;this.silenceBroadcast=!0,t(this),e||(this.silenceBroadcast=!1),this.broadcastWatches()},r.prototype.recordOptimisticTransaction=function(t,e){var r=this;this.silenceBroadcast=!0;var a=P(this.extract(!0),(function(e){var a=r.data;r.data=e,r.performTransaction(t),r.data=a}));this.optimistic.push({id:e,transaction:t,data:a}),this.silenceBroadcast=!1,this.broadcastWatches()},r.prototype.transformDocument=function(t){return this.addTypename?e.addTypenameToDocument(t):t},r.prototype.readQuery=function(t,e){return void 0===e&&(e=!1),this.read({query:t.query,variables:t.variables,optimistic:e})},r.prototype.readFragment=function(t,r){return void 0===r&&(r=!1),this.read({query:this.transformDocument(e.getFragmentQueryDocument(t.fragment,t.fragmentName)),variables:t.variables,rootId:t.id,optimistic:r})},r.prototype.writeQuery=function(t){this.write({dataId:"ROOT_QUERY",result:t.data,query:this.transformDocument(t.query),variables:t.variables})},r.prototype.writeFragment=function(t){this.write({dataId:t.id,result:t.data,query:this.transformDocument(e.getFragmentQueryDocument(t.fragment,t.fragmentName)),variables:t.variables})},r.prototype.broadcastWatches=function(){var t=this;this.silenceBroadcast||this.watches.forEach((function(e){var r=t.diff({query:e.query,variables:e.variables,previousResult:e.previousResult&&e.previousResult(),optimistic:e.optimistic});e.callback(r)}))},r}(n.ApolloCache);t.InMemoryCache=C,t.defaultDataIdFromObject=N,t.ID_KEY=I,t.readQueryFromStore=_,t.diffQueryAgainstStore=D,t.assertIdValue=R,t.WriteError=f,t.enhanceErrorWithDocument=h,t.writeQueryToStore=function(t){var r=t.result,a=t.query,n=t.storeFactory,o=void 0===n?u:n,i=t.store,s=void 0===i?o():i,c=t.variables,l=t.dataIdFromObject,d=t.fragmentMap,p=void 0===d?{}:d,f=t.fragmentMatcherFunction,y=e.getQueryDefinition(a);c=e.assign({},e.getDefaultValues(y),c);try{return m({dataId:"ROOT_QUERY",result:r,selectionSet:y.selectionSet,context:{store:s,storeFactory:o,processedData:{},variables:c,dataIdFromObject:l,fragmentMap:p,fragmentMatcherFunction:f}})}catch(t){throw h(t,a)}},t.writeResultToStore=y,t.writeSelectionSetToStore=m,t.HeuristicFragmentMatcher=i,t.IntrospectionFragmentMatcher=s,t.ObjectCache=c,t.defaultNormalizedCacheFactory=u,t.RecordingCache=T,t.record=P,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=/sm/9cd1b8f09305a1415396b57eadf43d773a7d1c8758bd67c983c02d0ea7619e51.map