!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(window,(function(){return function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="./",r(r.s=13)}({13:function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return i}));var o=r(4);function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}var i=function(){function e(e){this.CACHE_MAP={},this.config=n({},{keyPrefix:"CACHE",timeout:3e5,storage:!1},e||{}),this.config.storage&&this.mapStorageToCaches()}var t=e.prototype;return t.getKey=function(e){return this.config.keyPrefix+"-"+e},t.get=function(e,t){void 0===t&&(t={}),e=this.getKey(e);var r=this.CACHE_MAP[e];return r||(t.storage&&this.config.storage?Object(o.getStorage)(e):void 0)},t.set=function(e,t,r){void 0===r&&(r={}),e=this.getKey(e);var n,i={expireTime:(n=r.timeout||this.config.timeout,Date.now()+n),data:t};this.CACHE_MAP[e]=i,r.storage&&this.config.storage&&Object(o.setStorage)(e,i)},t.remove=function(e,t){void 0===t&&(t={}),e=this.getKey(e),delete this.CACHE_MAP[e],t.storage&&this.config.storage&&Object(o.removeStorage)(e)},t.clear=function(e){var t=Object.keys(this.CACHE_MAP);this.CACHE_MAP={},e.storage&&this.config.storage&&t.map((function(e){Object(o.removeStorage)(e)}))},t.isCacheKey=function(e){return e.startsWith(this.config.keyPrefix)},t.mapStorageToCaches=function(){var e=this;Object.entries(localStorage).map((function(t){var r=t[0],o=t[1];e.isCacheKey(r)&&(e.CACHE_MAP[r]=JSON.parse(o))}))},e}()},4:function(e,t,r){"use strict";function o(e,t){localStorage.setItem(e,JSON.stringify(t))}function n(e){var t=localStorage.getItem(e);return JSON.parse(t)}function i(e){localStorage.removeItem(e)}function a(){localStorage.clear()}r.r(t),r.d(t,"clearStorage",(function(){return a})),r.d(t,"setStorage",(function(){return o})),r.d(t,"getStorage",(function(){return n})),r.d(t,"removeStorage",(function(){return i}))}})}));
//# sourceMappingURL=cache.js.map