define(["exports"],function(_exports){function onCachePutFail(e){console.log(e)}function updateCache(instance){var cache=instance.cache;cache&&cache.put("data",new Response(JSON.stringify(instance.localData))).catch(onCachePutFail)}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0;var MyStore=function(){function MyStore(){babelHelpers.classCallCheck(this,MyStore);try{self.caches&&caches.open("embydata").then(function(result){this.cache=result,this.localData={}}.bind(this))}catch(err){console.log("Error opening cache: ".concat(err))}}return babelHelpers.createClass(MyStore,[{key:"setItem",value:function(name,value){localStorage.setItem(name,value);var localData=this.localData;localData&&localData[name]!==value&&(localData[name]=value,updateCache(this))}},{key:"getItem",value:function(name){return localStorage.getItem(name)}},{key:"removeItem",value:function(name){localStorage.removeItem(name);var localData=this.localData;localData&&(localData[name]=null,delete localData[name],updateCache(this))}}]),MyStore}();_exports.default=MyStore});