function _slicedToArray(t,e){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var a,l,c=[],f=!0,s=!1;try{for(i=i.call(t);!(f=(a=i.next()).done)&&(c.push(a.value),!e||c.length!==e);f=!0);}catch(t){s=!0,l=t}finally{try{f||null==i.return||i.return()}finally{if(s)throw l}}return c}}(t,e)||function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(t,e):void 0}}(t,e)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i<e;i++)a[i]=t[i];return a}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var t,e;t=this,e=function(t){function n(t){return new Promise((function(e,i){t.oncomplete=t.onsuccess=function(){return e(t.result)},t.onabort=t.onerror=function(){return i(t.error)}}))}function r(t,e){var i,a=(!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(t){var n=function(){return indexedDB.databases().finally(t)};i=setInterval(n,100),n()})).finally((function(){return clearInterval(i)})):Promise.resolve()).then((function(){var i=indexedDB.open(t);return i.onupgradeneeded=function(){return i.result.createObjectStore(e)},n(i)}));return function(t,i){return a.then((function(a){return i(a.transaction(e,t).objectStore(e))}))}}var e;function o(){return e||(e=r("keyval-store","keyval")),e}function u(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},n(t.transaction)}t.clear=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:o())("readwrite",(function(t){return t.clear(),n(t.transaction)}))},t.createStore=r,t.del=function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:o())("readwrite",(function(e){return e.delete(t),n(e.transaction)}))},t.delMany=function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:o())("readwrite",(function(e){return t.forEach((function(t){return e.delete(t)})),n(e.transaction)}))},t.entries=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o();return t("readonly",(function(e){if(e.getAll&&e.getAllKeys)return Promise.all([n(e.getAllKeys()),n(e.getAll())]).then((function(t){var e=_slicedToArray(t,2),i=e[0],a=e[1];return i.map((function(t,e){return[t,a[e]]}))}));var i=[];return t("readonly",(function(t){return u(t,(function(t){return i.push([t.key,t.value])})).then((function(){return i}))}))}))},t.get=function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:o())("readonly",(function(e){return n(e.get(t))}))},t.getMany=function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:o())("readonly",(function(e){return Promise.all(t.map((function(t){return n(e.get(t))})))}))},t.keys=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:o())("readonly",(function(t){if(t.getAllKeys)return n(t.getAllKeys());var e=[];return u(t,(function(t){return e.push(t.key)})).then((function(){return e}))}))},t.promisifyRequest=n,t.set=function(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:o())("readwrite",(function(i){return i.put(e,t),n(i.transaction)}))},t.setMany=function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:o())("readwrite",(function(e){return t.forEach((function(t){return e.put(t[1],t[0])})),n(e.transaction)}))},t.update=function(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:o())("readwrite",(function(i){return new Promise((function(a,l){i.get(t).onsuccess=function(){try{i.put(e(this.result),t),a(n(i.transaction))}catch(t){l(t)}}}))}))},t.values=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:o())("readonly",(function(t){if(t.getAll)return n(t.getAll());var e=[];return u(t,(function(t){return e.push(t.value)})).then((function(){return e}))}))},Object.defineProperty(t,"__esModule",{value:!0})},"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).idbKeyval={});