indexeddbshim 16.0.0 → 16.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/badges/licenses-badge-dev.svg +1 -1
- package/dist/IDBCursor.d.ts +2 -1
- package/dist/IDBCursor.d.ts.map +1 -1
- package/dist/IDBFactory.d.ts.map +1 -1
- package/dist/Key.d.ts.map +1 -1
- package/dist/indexeddbshim-Key.js +1668 -1838
- package/dist/indexeddbshim-Key.js.map +1 -1
- package/dist/indexeddbshim-Key.min.js +2 -2
- package/dist/indexeddbshim-Key.min.js.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs +546 -550
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.js +1812 -2495
- package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js +2 -4
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
- package/dist/indexeddbshim-node.cjs +546 -550
- package/dist/indexeddbshim-node.cjs.map +1 -1
- package/dist/indexeddbshim-noninvasive.js +1810 -2493
- package/dist/indexeddbshim-noninvasive.js.map +1 -1
- package/dist/indexeddbshim-noninvasive.min.js +2 -4
- package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
- package/dist/indexeddbshim.js +1811 -2486
- package/dist/indexeddbshim.js.map +1 -1
- package/dist/indexeddbshim.min.js +2 -4
- package/dist/indexeddbshim.min.js.map +1 -1
- package/dist/setGlobalVars.d.ts.map +1 -1
- package/package.json +20 -21
- package/src/IDBCursor.js +7 -3
- package/src/IDBFactory.js +0 -1
- package/src/Key.js +4 -0
- package/src/browser-UnicodeIdentifiers.js +2 -2
- package/src/browser-noninvasive.js +1 -1
- package/src/browser.js +1 -1
- package/src/setGlobalVars.js +0 -2
- package/src/unicode-regex.js +1 -1
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/*! indexeddbshim - v16.
|
|
2
|
-
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)}function n(e){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=e.apply(n,r);function u(e){t(a,o,i,u,c,"next",e)}function c(e){t(a,o,i,u,c,"throw",e)}u(void 0)}))}}function r(e,t,n){if(c())return Reflect.construct.apply(null,arguments);var r=[null];return r.push.apply(r,t),new(e.bind.apply(e,r))}function o(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,y(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=v(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function a(e,t,n,r){var o={configurable:!0,enumerable:!0};return o[e]=r,Object.defineProperty(t,n,o)}function u(e,t,n){return(t=y(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function f(){
|
|
3
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
4
|
-
var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var c=r&&r.prototype instanceof u?r:u,s=Object.create(c.prototype);return d(s,"_invoke",function(n,r,o){var i,u,c,s=0,l=o||[],f=!1,d={p:0,n:0,v:e,a:_,f:_.bind(e,4),d:function(t,n){return i=t,u=0,c=e,d.n=n,a}};function _(n,r){for(u=n,c=r,t=0;!f&&s&&!o&&t<l.length;t++){var o,i=l[t],_=d.p,p=i[2];n>3?(o=p===r)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=_&&((o=n<2&&_<i[1])?(u=0,d.v=r,d.n=i[1]):_<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,d.n=p,u=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,p){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&_(l,p),u=l,c=p;(t=u<2?e:c)||!f;){i||(u?u<3?(u>1&&(d.n=-1),_(u,c)):d.n=c:d.v=c);try{if(s=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(f=d.n<0)?c:n.call(r,d))!==a)break}catch(t){i=e,u=1,c=t}finally{s=1}}return{value:t,done:f}}}(n,o,i),!0),s}var a={};function u(){}function c(){}function s(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(d(t={},r,(function(){return this})),t),_=s.prototype=u.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,d(e,o,"GeneratorFunction")),e.prototype=Object.create(_),e}return c.prototype=s,d(_,"constructor",s),d(s,"constructor",c),c.displayName="GeneratorFunction",d(s,o,"GeneratorFunction"),d(_),d(_,o,"Generator"),d(_,r,(function(){return this})),d(_,"toString",(function(){return"[object Generator]"})),(f=function(){return{w:i,m:p}})()}function d(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}d=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{function i(t,n){d(e,t,(function(e){return this._invoke(t,n,e)}))}i("next",0),i("throw",1),i("return",2)}},d(e,t,n,r)}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(e,t)||v(e,t)||function(){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 p(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||v(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function v(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}var g=0,m=1,E=2,w=3,D="undefined"==typeof DOMException?function(e,t){var n=new Error(e);return n.name=t,n}:DOMException,I=new WeakMap,O=new WeakMap,S=function(e){var t=this;this[Symbol.toStringTag]="Event",this.toString=function(){return"[object Event]"};var n=Array.prototype.slice.call(arguments),r=n[1],o=n[2];if(!arguments.length)throw new TypeError("Failed to construct 'Event': 1 argument required, but only 0 present.");o=o||{};var i={};"composed"in(r=r||{})&&(i.composed=r.composed),I.set(this,o),O.set(this,i);this.initEvent(e,r.bubbles,r.cancelable),["target","currentTarget","eventPhase","defaultPrevented"].forEach((function(e){var n=e;Object.defineProperty(t,n,{get:function(){return void 0!==i[n]?i[n]:n in o?o[n]:"eventPhase"===n?0:"defaultPrevented"!==n&&null}})}));var a=["type","bubbles","cancelable","isTrusted","timeStamp","initEvent","composedPath","composed"];"[object CustomEvent]"===this.toString()&&a.push("detail","initCustomEvent"),Object.defineProperties(this,a.reduce((function(e,t){var n=t;return e[n]={get:function(){return n in i?i[n]:n in o?o[n]:!["bubbles","cancelable","composed"].includes(n)&&void 0}},e}),{}))};S.prototype.preventDefault=function(){if(!(this instanceof S))throw new TypeError("Illegal invocation");var e=I.get(this),t=O.get(this);this.cancelable&&!t._passive&&(t.defaultPrevented=!0,"function"==typeof e.preventDefault&&e.preventDefault())},S.prototype.stopImmediatePropagation=function(){O.get(this)._stopImmediatePropagation=!0},S.prototype.stopPropagation=function(){O.get(this)._stopPropagation=!0},S.prototype.initEvent=function(e,t,n){var r=O.get(this);r._dispatched||(Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,get:function(){return e}}),Object.defineProperty(this,"bubbles",{enumerable:!0,configurable:!0,get:function(){return t}}),Object.defineProperty(this,"cancelable",{enumerable:!0,configurable:!0,get:function(){return n}}),r.type=e,void 0!==t&&(r.bubbles=t),void 0!==n&&(r.cancelable=n))},["type","target","currentTarget"].forEach((function(e){Object.defineProperty(S.prototype,e,{enumerable:!0,configurable:!0,get:function(){throw new TypeError("Illegal invocation")}})})),["eventPhase","defaultPrevented","bubbles","cancelable","timeStamp"].forEach((function(e){Object.defineProperty(S.prototype,e,{enumerable:!0,configurable:!0,get:function(){throw new TypeError("Illegal invocation")}})})),["NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE"].forEach((function(e,t){Object.defineProperty(S,e,{enumerable:!0,writable:!1,value:t}),Object.defineProperty(S.prototype,e,{writable:!1,value:t})})),S[Symbol.toStringTag]="Function",S.prototype[Symbol.toStringTag]="EventPrototype",Object.defineProperty(S,"prototype",{writable:!1});var T=function(e){var t=Array.prototype.slice.call(arguments),n=t[1],r=t[2];S.call(this,e,n,r),this[Symbol.toStringTag]="CustomEvent",this.toString=function(){return"[object CustomEvent]"},n=n||{},this.initCustomEvent(e,n.bubbles,n.cancelable,"detail"in n?n.detail:null)};function A(e,t,n){var r=e[t];void 0===r&&(e[t]=r=[]);var o="boolean"==typeof n?{capture:n}:n||{},i=JSON.stringify(o);return{listenersByTypeOptions:r.filter((function(e){return i===JSON.stringify(e.options)})),options:o,listenersByType:r}}Object.defineProperty(T.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:T}),T.prototype.initCustomEvent=function(e,t,n,r){if(!(this instanceof T))throw new TypeError("Illegal invocation");var o=O.get(this);T.call(this,e,{bubbles:t,cancelable:n,detail:r},arguments[4]),o._dispatched||(void 0!==r&&(o.detail=r),Object.defineProperty(this,"detail",{get:function(){return o.detail}}))},T[Symbol.toStringTag]="Function",T.prototype[Symbol.toStringTag]="CustomEventPrototype",Object.defineProperty(T.prototype,"detail",{enumerable:!0,configurable:!0,get:function(){throw new TypeError("Illegal invocation")}}),Object.defineProperty(T,"prototype",{writable:!1});var N={addListener:function(e,t,n,r){var o=A(e,n,r),i=o.listenersByTypeOptions;r=o.options;var a=o.listenersByType;i.some((function(e){return e.listener===t}))||a.push({listener:t,options:r})},removeListener:function(e,t,n,r){var o=A(e,n,r),i=o.listenersByType,a=JSON.stringify(o.options);i.some((function(r,o){return r.listener===t&&a===JSON.stringify(r.options)&&(i.splice(o,1),i.length||delete e[n],!0)}))},hasListener:function(e,t,n,r){return A(e,n,r).listenersByTypeOptions.some((function(e){return e.listener===t}))}};function x(){throw new TypeError("Illegal constructor")}Object.assign(x.prototype,["Early","","Late","Default"].reduce((function(e,t){return["add","remove","has"].forEach((function(n){e[n+t+"EventListener"]=function(e,r){var o=arguments[2];if(arguments.length<2)throw new TypeError("2 or more arguments required");if("string"!=typeof e)throw new D("UNSPECIFIED_EVENT_TYPE_ERR","UNSPECIFIED_EVENT_TYPE_ERR");try{"handleEvent"in r&&r.handleEvent.bind&&(r=r.handleEvent.bind(r))}catch(e){console.log("Uncaught `handleEvent` error",e)}var i="_"+t.toLowerCase()+(""===t?"l":"L")+"isteners";return this[i]||Object.defineProperty(this,i,{value:{}}),N[n+"Listener"](this[i],r,e,o)}})),e}),{})),Object.assign(x.prototype,{_legacyOutputDidListenersThrowCheck:void 0,__setOptions:function(e){e=e||{},this._defaultSync=e.defaultSync,this._extraProperties=e.extraProperties||[],e.legacyOutputDidListenersThrowFlag&&(this._legacyOutputDidListenersThrowCheck=!0,this._extraProperties.push("__legacyOutputDidListenersThrowError"))},dispatchEvent:function(e){return this._dispatchEvent(e,!0)},_dispatchEvent:function(e,t){var n=this;["early","","late","default"].forEach((function(e){var t="_"+e+(""===e?"l":"L")+"isteners";n[t]||Object.defineProperty(n,t,{value:{}})}));var r,o=O.get(e);if(o&&t&&o._dispatched)throw new D("The object is in an invalid state.","InvalidStateError");o?r=e:(r=function(e){var t=e.bubbles,n=e.cancelable,r=e.detail,o=e.type;return"detail"in e?new T(o,{bubbles:t,cancelable:n,detail:r},e):new S(o,{bubbles:t,cancelable:n},e)}(e),(o=O.get(r))._dispatched=!0,this._extraProperties.forEach((function(t){t in e&&(r[t]=e[t])})));var i=r.type;function a(){o.eventPhase=g,o.currentTarget=null,delete o._children}function u(){o._stopImmediatePropagation=void 0,o._stopPropagation=void 0,r.defaultPrevented&&o.cancelable||(o.eventPhase=E,r.target.invokeCurrentListeners(r.target._defaultListeners,r,i)),a()}var c=function(){return o._stopImmediatePropagation=void 0,o._stopPropagation=void 0,n._defaultSync?u():setTimeout(u,0),o.eventPhase=E,o._stopPropagation||(o._stopImmediatePropagation=void 0,o._stopPropagation=void 0,r.target.invokeCurrentListeners(r.target._lateListeners,r,i)),a(),!r.defaultPrevented};switch(t&&(o.target=this),"eventPhase"in r&&r.eventPhase){case m:if(o._stopPropagation)return c();this.invokeCurrentListeners(this._listeners,r,i);var s=o._children&&o._children.length&&o._children.pop();return s&&s!==r.target||(o.eventPhase=E),s&&(s._defaultSync=this._defaultSync),(s||this)._dispatchEvent(r,!1);case E:return o._stopPropagation?c():(this.invokeCurrentListeners(this._listeners,r,i,!0),o.bubbles?(o.eventPhase=w,this._dispatchEvent(r,!1)):c());case w:if(o._stopPropagation)return c();var l=this.__getParent&&this.__getParent();return l?(l.invokeCurrentListeners(l._listeners,r,i,!0),l._defaultSync=this._defaultSync,l._dispatchEvent(r,!1)):c();default:if(o.eventPhase=E,this.invokeCurrentListeners(this._earlyListeners,r,i),!("__getParent"in this))return o.eventPhase=E,this._dispatchEvent(r,!1);for(var f=this,d=this;f.__getParent&&null!==(f=f.__getParent());)o._children||(o._children=[]),o._children.push(d),d=f;return d._defaultSync=this._defaultSync,o.eventPhase=m,d._dispatchEvent(r,!1)}},invokeCurrentListeners:function(e,t,n,r){var o=this,i=O.get(t);i.currentTarget=this;var a=A(e,n,{}).listenersByType.concat(),u=a.length?1:0;return a.some((function(e,a){var c=r?o["on"+n]:null;if(i._stopImmediatePropagation)return!0;a===u&&"function"==typeof c&&o.tryCatch(t,(function(){!1===c.call(t.currentTarget,t)&&t.preventDefault()}));var s=e.options,l=s.once,f=s.passive,d=s.capture;if(i._passive=f,d&&t.target!==t.currentTarget&&t.eventPhase===m||t.eventPhase===E||!d&&t.target!==t.currentTarget&&t.eventPhase===w){var _=e.listener;o.tryCatch(t,(function(){_.call(t.currentTarget,t)})),l&&o.removeEventListener(n,_,s)}return!1})),this.tryCatch(t,(function(){var e=r?o["on"+n]:null;"function"==typeof e&&a.length<2&&(!1===e.call(t.currentTarget,t)&&t.preventDefault())})),!t.defaultPrevented},tryCatch:function(e,t){try{t()}catch(t){this.triggerErrorEvent(t,e)}},triggerErrorEvent:function(e,t){var n,r=e;"string"==typeof e&&(r=new Error("Uncaught exception: "+e));var o=!1;"undefined"==typeof window||"undefined"==typeof ErrorEvent||window&&"object"===("undefined"==typeof window?"undefined":b(window))&&!window.dispatchEvent?(o=!0,n=function(){setTimeout((function(){throw r}))}):n=function(){var t=new ErrorEvent("error",{error:e,message:r.message||"",filename:r.fileName||"",lineno:r.lineNumber||0,colno:r.columnNumber||0});window.dispatchEvent(t)},o&&this._legacyOutputDidListenersThrowCheck||n(),this._legacyOutputDidListenersThrowCheck&&(t.__legacyOutputDidListenersThrowError=r)}}),x.prototype[Symbol.toStringTag]="EventTargetPrototype",Object.defineProperty(x,"prototype",{writable:!1});var B=x,F={createInstance:function(e){var t=function(){this.__setOptions(e)};return t.prototype=B.prototype,new t}};x.ShimEvent=S,x.ShimCustomEvent=T,x.ShimDOMException=D,x.ShimEventTarget=x,x.EventTargetFactory=F;var j,C,P={},k={};function R(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}["DEBUG","cacheDatabaseInstances","autoName","fullIDLSupport","checkOrigin","cursorPreloadPackSize","UnicodeIDStart","UnicodeIDContinue","registerSCA","avoidAutoShim","win","DEFAULT_DB_SIZE","useSQLiteIndexes","fs","addNonIDBGlobals","replaceNonIDBGlobals","escapeDatabaseName","unescapeDatabaseName","databaseCharacterEscapeList","databaseNameLengthLimit","escapeNFDForDatabaseNames","addSQLiteExtension",["memoryDatabase",function(e){if(!/^(?::memory:|file::memory:(\?(?:[\0-"\$-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?(#(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?)?$/.test(e))throw new TypeError('`memoryDatabase` must be the empty string, ":memory:", or a "file::memory:[?queryString][#hash] URL".')}],"deleteDatabaseFiles","databaseBasePath","sysDatabaseBasePath","sqlBusyTimeout","sqlTrace","sqlProfile","createIndexes"].forEach((function(e){var t;if(Array.isArray(e)){var n=_(e,2);e=n[0],t=n[1]}Object.defineProperty(k,e,{get:function(){return P[e]},set:function(n){t&&t(n),P[e]=n}})}));var L=R(C?j:(C=1,j=/[\xC0-\xC5\xC7-\xCF\xD1-\xD6\xD9-\xDD\xE0-\xE5\xE7-\xEF\xF1-\xF6\xF9-\xFD\xFF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0\u01A1\u01AF\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01F0\u01F4\u01F5\u01F8-\u021B\u021E\u021F\u0226-\u0233\u0344\u0385\u0386\u0388-\u038A\u038C\u038E-\u0390\u03AA-\u03B0\u03CA-\u03CE\u03D3\u03D4\u0400\u0401\u0403\u0407\u040C-\u040E\u0419\u0439\u0450\u0451\u0453\u0457\u045C-\u045E\u0476\u0477\u04C1\u04C2\u04D0-\u04D3\u04D6\u04D7\u04DA-\u04DF\u04E2-\u04E7\u04EA-\u04F5\u04F8\u04F9\u0622-\u0626\u06C0\u06C2\u06D3\u0929\u0931\u0934\u0958-\u095F\u09CB\u09CC\u09DC\u09DD\u09DF\u0A33\u0A36\u0A59-\u0A5B\u0A5E\u0B48\u0B4B\u0B4C\u0B5C\u0B5D\u0B94\u0BCA-\u0BCC\u0C48\u0CC0\u0CC7\u0CC8\u0CCA\u0CCB\u0D4A-\u0D4C\u0DDA\u0DDC-\u0DDE\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69\u0F73\u0F75\u0F76\u0F78\u0F81\u0F93\u0F9D\u0FA2\u0FA7\u0FAC\u0FB9\u1026\u1B06\u1B08\u1B0A\u1B0C\u1B0E\u1B12\u1B3B\u1B3D\u1B40\u1B41\u1B43\u1E00-\u1E99\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FC1-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEE\u1FF2-\u1FF4\u1FF6-\u1FFC\u212B\u219A\u219B\u21AE\u21CD-\u21CF\u2204\u2209\u220C\u2224\u2226\u2241\u2244\u2247\u2249\u2260\u2262\u226D-\u2271\u2274\u2275\u2278\u2279\u2280\u2281\u2284\u2285\u2288\u2289\u22AC-\u22AF\u22E0-\u22E3\u22EA-\u22ED\u2ADC\u304C\u304E\u3050\u3052\u3054\u3056\u3058\u305A\u305C\u305E\u3060\u3062\u3065\u3067\u3069\u3070\u3071\u3073\u3074\u3076\u3077\u3079\u307A\u307C\u307D\u3094\u309E\u30AC\u30AE\u30B0\u30B2\u30B4\u30B6\u30B8\u30BA\u30BC\u30BE\u30C0\u30C2\u30C5\u30C7\u30C9\u30D0\u30D1\u30D3\u30D4\u30D6\u30D7\u30D9\u30DA\u30DC\u30DD\u30F4\u30F7-\u30FA\u30FE\uAC00-\uD7A3\uFB1D\uFB1F\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4E]|\uD804[\uDC9A\uDC9C\uDCAB\uDD2E\uDD2F\uDF4B\uDF4C]|\uD805[\uDCBB\uDCBC\uDCBE\uDDBA\uDDBB]|\uD806\uDD38|\uD834[\uDD5E-\uDD64\uDDBB-\uDDC0]/));function q(e){return e.replaceAll(/((?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])))(?!(?:(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))|(^|(?:[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))((?:(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))/g,(function(e,t,n,r){return t?"^2"+t.codePointAt().toString(16).padStart(4,"0"):(n||"")+"^3"+r.codePointAt().toString(16).padStart(4,"0")}))}function U(e){return"_"+q(e.replaceAll("^","^^").replaceAll("\0","^0").replaceAll(/([A-Z])/g,"^$1"))}function M(e){return q(e.replaceAll("^","^^").replaceAll("\0","^0"))}function V(e){return function(e){return e.replaceAll(/(\^+)3(d[0-9a-f]{3})/g,(function(e,t,n){return t.length%2?t.slice(1)+String.fromCodePoint(Number.parseInt(n,16)):e})).replaceAll(/(\^+)2(d[0-9a-f]{3})/g,(function(e,t,n){return t.length%2?t.slice(1)+String.fromCodePoint(Number.parseInt(n,16)):e}))}(e).replaceAll(/(\^+)0/g,(function(e,t){return t.length%2?t.slice(1)+"\0":e})).replaceAll("^^","^")}function K(e){return'"'+function(e){return e.replaceAll('"','""')}(e)+'"'}function G(e){if(k.escapeDatabaseName)return k.escapeDatabaseName(M(e));if(e="D"+U(e),!1!==k.escapeNFDForDatabaseNames&&(e=e.replaceAll(new RegExp(L,"gu"),(function(e){return"^4"+e.codePointAt(0).toString(16).padStart(6,"0")}))),!1!==k.databaseCharacterEscapeList&&(e=e.replace(k.databaseCharacterEscapeList?new RegExp(k.databaseCharacterEscapeList,"gu"):/[\0-\x1F"\*\/:<>\?\\\|\x7F]/g,(function(e){return"^1"+e.charCodeAt(0).toString(16).padStart(2,"0")}))),!1!==k.databaseNameLengthLimit&&e.length>=(k.databaseNameLengthLimit||254)-(!1!==k.addSQLiteExtension?7:0))throw new Error("Unexpectedly long database name supplied; length limit required for Node compatibility; passed length: "+e.length+"; length limit setting: "+(k.databaseNameLengthLimit||254)+".");return e+(!1!==k.addSQLiteExtension?".sqlite":"")}function H(e){return K("S"+U(e))}function Q(e){return K("I"+U(e))}function W(e){return"I"+U(e)}function z(e){return e.replaceAll("^","^^")}function $(e,t){return t[Symbol.hasInstance](e)}function Y(e){return null!==e&&"object"===h(e)}function J(e){return Y(e)&&Symbol.iterator in e&&"function"==typeof e[Symbol.iterator]}function X(e,t){t.forEach((function(t){var n=a("set",a("get",{},t,(function(){throw new TypeError("Illegal invocation")})),t,(function(e){throw new TypeError("Illegal invocation")})),r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r)}))}function Z(e,t){t.forEach((function(t){var n=a("get",{},t,(function(){throw new TypeError("Illegal invocation")})),r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r)}))}function ee(e,t){(t="string"==typeof t?[t]:t).forEach((function(t){var n=a("set",a("get",{},t,(function(){return e["__"+t]})),t,(function(n){e["__"+t]=n})),r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r)})),t.forEach((function(t){e[t]=null}))}function te(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;(t="string"==typeof t?[t]:t).forEach((function(t){var r;n&&t in n?r=n[t]:(Object.defineProperty(e,"__"+t,{enumerable:!1,configurable:!1,writable:!0}),r=a("get",{},t,(function(){return this["__"+t]})));var o=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,o)}))}function ne(e){var t=k.UnicodeIDStart||"[$A-Z_a-z]",n=k.UnicodeIDContinue||"[$0-9A-Z_a-z]";return new RegExp("^"+("(?:"+t+"|[$_])")+("(?:"+n+"|[$_])")+"*$","u").test(e)}function re(e){return"string"==typeof e&&(""===e||ne(e)||e.split(".").every((function(e){return ne(e)})))}function oe(e){return re(e)||Array.isArray(e)&&Boolean(e.length)&&p(e).every((function(e){return re(e)}))}function ie(e,t){var n,r;switch(e=Math.floor(Number(e)),t){case"unsigned long long":n=9007199254740991,r=0;break;case"unsigned long":n=4294967295,r=0;break;default:throw new Error("Unrecognized type supplied to enforceRange")}if(!Number.isFinite(e)||e>n||e<r)throw new TypeError("Invalid range: "+e);return e}function ae(e,t){return null===e&&t?"":ue(e)}function ue(e){return""+e}function ce(e){return J(e)?p(e).map((function(e){return ue(e)})):ue(e)}function se(e){return null==e}function le(e,t,n){var r=new S(e,n);return r.debug=t,r}Object.defineProperty(S,Symbol.hasInstance,{value:function(e){return Y(e)&&"target"in e&&"bubbles"in e&&"boolean"==typeof e.bubbles}});function fe(e){S.call(this,e),this[Symbol.toStringTag]="IDBVersionChangeEvent",this.toString=function(){return"[object IDBVersionChangeEvent]"},this.__eventInitDict=arguments[1]||{}}function de(e,t){return new DOMException.prototype.constructor(t,e||"DOMException")}fe.prototype=Object.create(S.prototype),fe.prototype[Symbol.toStringTag]="IDBVersionChangeEventPrototype",["oldVersion","newVersion"].forEach((function(e){var t=a("get",{},e,(function(){if(!(this instanceof fe))throw new TypeError("Illegal invocation");return this.__eventInitDict&&this.__eventInitDict[e]||("oldVersion"===e?0:null)})),n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(fe.prototype,e,n)})),Object.defineProperty(fe,Symbol.hasInstance,{value:function(e){return Y(e)&&"oldVersion"in e&&"defaultPrevented"in e&&"boolean"==typeof e.defaultPrevented}}),Object.defineProperty(fe.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:fe}),Object.defineProperty(fe,"prototype",{writable:!1});var _e={IndexSizeError:1,HierarchyRequestError:3,WrongDocumentError:4,InvalidCharacterError:5,NoModificationAllowedError:7,NotFoundError:8,NotSupportedError:9,InUseAttributeError:10,InvalidStateError:11,SyntaxError:12,InvalidModificationError:13,NamespaceError:14,InvalidAccessError:15,TypeMismatchError:17,SecurityError:18,NetworkError:19,AbortError:20,URLMismatchError:21,QuotaExceededError:22,TimeoutError:23,InvalidNodeTypeError:24,DataCloneError:25,EncodingError:0,NotReadableError:0,UnknownError:0,ConstraintError:0,DataError:0,TransactionInactiveError:0,ReadOnlyError:0,VersionError:0,OperationError:0,NotAllowedError:0},pe={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};var ye=function(){function e(e,t){this[Symbol.toStringTag]="DOMException",this._code=t in _e?_e[t]:pe[t]||0,this._name=t||"Error",this._message=void 0===e?"":""+e,Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,writable:!0,value:this._code}),void 0!==t&&Object.defineProperty(this,"name",{configurable:!0,enumerable:!0,writable:!0,value:this._name}),void 0!==e&&Object.defineProperty(this,"message",{configurable:!0,enumerable:!1,writable:!0,value:this._message})}var t=function(){};return t.prototype=Object.create(Error.prototype),["name","message"].forEach((function(n){Object.defineProperty(t.prototype,n,{enumerable:!0,get:function(){if(!(this instanceof e||this instanceof t||this instanceof Error))throw new TypeError("Illegal invocation");return this["name"===n?"_name":"_message"]}})})),Object.defineProperty(t.prototype,"code",{configurable:!0,enumerable:!0,get:function(){throw new TypeError("Illegal invocation")}}),e.prototype=new t,e.prototype[Symbol.toStringTag]="DOMExceptionPrototype",Object.defineProperty(e,"prototype",{writable:!1}),Object.keys(_e).forEach((function(t){Object.defineProperty(e.prototype,t,{enumerable:!0,configurable:!1,value:_e[t]}),Object.defineProperty(e,t,{enumerable:!0,configurable:!1,value:_e[t]})})),Object.keys(pe).forEach((function(t){Object.defineProperty(e.prototype,t,{enumerable:!0,configurable:!1,value:pe[t]}),Object.defineProperty(e,t,{enumerable:!0,configurable:!1,value:pe[t]})})),Object.defineProperty(e.prototype,"constructor",{writable:!0,configurable:!0,enumerable:!1,value:e}),e}();function he(e,t,n){if(k.DEBUG){var r=n&&"object"===h(n)&&n.message?n.message:n,o="function"==typeof console.error?"error":"log";console[o](e+": "+t+". "+(r||"")),console.trace&&console.trace()}}function ve(e){return e&&"object"===h(e)&&"string"==typeof e.name}function be(e){var t,n;if(4===e.code)t="QuotaExceededError",n="The operation failed because there was not enough remaining storage space, or the storage quota was reached and the user declined to give more space to the database.";else t="UnknownError",n="The operation failed for reasons unrelated to the database itself and not covered by any other errors.";n+=" ("+e.message+")--("+e.code+")";var r=Ee(t,n);return r.sqlError=e,r}var ge,me=!1;try{ve(ge=de("test name","test message"))&&"test name"===ge.name&&"test message"===ge.message&&(me=!0)}catch(e){}var Ee=me?function(e,t,n){return he(e,t,n),de(e,t)}:function(e,t,n){return he(e,t,n),function(e,t){return new ye(t,e)}(e,t)},we=me?DOMException:ye,De=["onsuccess","onerror"],Ie=["source","transaction","readyState"],Oe=["result","error"];function Se(){throw new TypeError("Illegal constructor")}Se.__super=function(){var e=this;this[Symbol.toStringTag]="IDBRequest",this.__setOptions({legacyOutputDidListenersThrowFlag:!0}),Oe.forEach((function(t){Object.defineProperty(e,"__"+t,{enumerable:!1,configurable:!1,writable:!0}),Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){if(!this.__done)throw Ee("InvalidStateError","Can't get "+t+"; the request is still pending.");return this["__"+t]}})})),te(this,Ie,{readyState:{get readyState(){return this.__done?"done":"pending"}}}),ee(this,De),this.__result=void 0,this.__error=this.__source=this.__transaction=null,this.__done=!1},Se.__createInstance=function(){return new Se.__super},Se.prototype=F.createInstance({extraProperties:["debug"]}),Se.prototype[Symbol.toStringTag]="IDBRequestPrototype",Se.prototype.__getParent=function(){return"[object IDBOpenDBRequest]"===this.toString()?null:this.__transaction},Z(Se.prototype,Ie),Z(Se.prototype,Oe),X(Se.prototype,De),Object.defineProperty(Se.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:Se}),Se.__super.prototype=Se.prototype,Object.defineProperty(Se,"prototype",{writable:!1});var Te=["onblocked","onupgradeneeded"];function Ae(){throw new TypeError("Illegal constructor")}Ae.prototype=Object.create(Se.prototype),Object.defineProperty(Ae.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:Ae});var Ne=Ae;function xe(e){return e&&"function"==typeof e.then}function Be(e,t){e.then(null,t)}Ae.__createInstance=function(){function e(){Se.__super.call(this),this[Symbol.toStringTag]="IDBOpenDBRequest",this.__setOptions({legacyOutputDidListenersThrowFlag:!0,extraProperties:["oldVersion","newVersion","debug"]}),ee(this,Te)}return e.prototype=Ne.prototype,new e},X(Ae.prototype,Te),Ae.prototype[Symbol.toStringTag]="IDBOpenDBRequestPrototype",Object.defineProperty(Ae,"prototype",{writable:!1});var Fe=2,je=0,Ce=1;function Pe(e){var t=this;function n(e,n){t.v=e,t.s=n,t.c[n].forEach((function(t){t(e)})),t.c[n].length&&(t.c=null)}function r(e){t.c&&(xe(e)?Be(e.then(r),r):n(e,Ce))}t.v=0,t.s=Fe,t.c=[[],[]];try{e((function e(o){t.c&&(xe(o)?Be(o.then(e),r):n(o,je))}),r)}catch(e){r(e)}}function ke(e,t){var n=ct(e),r=ct(t),o=n>r?1:n===r?0:-1;if(k.DEBUG){var i=st(n),a=st(r);"object"===h(e)&&(e=JSON.stringify(e),i=JSON.stringify(i)),"object"===h(t)&&(t=JSON.stringify(t),a=JSON.stringify(a)),i!==e&&console.warn(e+" was incorrectly encoded as "+i),a!==t&&console.warn(t+" was incorrectly encoded as "+a)}return o}Pe.prototype.then=function(e,t){var n=this;return new Pe((function(r,o){var i="function"==typeof t?t:o;function a(){try{r(e?e(n.v):n.v)}catch(e){i(e)}}n.s===je?a():n.s===Ce?i(n.v):(n.c[je].push(a),n.c[Ce].push(i))}))},Pe.prototype.catch=function(e){var t=this;return new Pe((function(n,r){function o(){try{n(e(t.v))}catch(e){r(e)}}t.s===Ce?o():t.s===je?n(t.v):(t.c[Ce].push(o),t.c[je].push(n))}))},Pe.all=function(e){return new Pe((function(t,n){var r=e.length,o=[];r?e.forEach((function(i,a){xe(i)?Be(i.then((function(e){o[a]=e,--r||t(o)})),n):(o[a]=i,--r||t(e))})):t(o)}))},Pe.race=function(e){var t=!1;return new Pe((function(n,r){e.some((function(e,o){return xe(e)?(Be(e.then((function(e){t||(n(e),t=!0)})),r),!1):(n(e),t=!0,!0)}))}))},Pe.resolve=function(e){return new Pe((function(t,n){t(e)}))},Pe.reject=function(e){return new Pe((function(t,n){n(e)}))};var Re={invalid:100,number:200,date:300,string:400,binary:500,array:600},Le=Object.keys(Re);Le.forEach((function(e){Re[e]=String.fromCodePoint(Re[e])}));var qe=Le.reduce((function(e,t){return e[Re[t]]=t,e}),{}),Ue=["negativeInfinity","bigNegative","smallNegative","smallPositive","bigPositive","positiveInfinity"],Me={invalid:{encode:function(){return Re.invalid+"-"},decode:function(){}},number:{encode:function(e){var t,n,r,o=e===Number.MIN_VALUE?"0."+"0".repeat(214)+"2":Math.abs(e).toString(32),i=o.indexOf("."),a=(o=-1!==i?o.replace(".",""):o).search(/(?:[\0-\/1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/);return o=o.slice(a),Number.isFinite(Number(e))?e<0?e>-1?(t=Ue.indexOf("smallNegative"),n=Ve(a),r=Ge(Ke(o))):(t=Ue.indexOf("bigNegative"),n=Ge(Ve(-1!==i?i:o.length)),r=Ge(Ke(o))):e<1?(t=Ue.indexOf("smallPositive"),n=Ge(Ve(a)),r=Ke(o)):(t=Ue.indexOf("bigPositive"),n=Ve(-1!==i?i:o.length),r=Ke(o)):(n=We(2),r=We(11),t=Ue.indexOf(e>0?"positiveInfinity":"negativeInfinity")),Re.number+"-"+t+n+r},decode:function(e){var t=Number(e.slice(2,3)),n=e.slice(3,5),r=e.slice(5,16);switch(Ue[t]){case"negativeInfinity":return Number.NEGATIVE_INFINITY;case"positiveInfinity":return Number.POSITIVE_INFINITY;case"bigPositive":return He(r,n);case"smallPositive":return He(r,n=ze(Ge(n)));case"smallNegative":return n=ze(n),-He(r=Ge(r),n);case"bigNegative":return n=Ge(n),-He(r=Ge(r),n);default:throw new Error("Invalid number.")}}},string:{encode:function(e,t){return t&&(e=e.replaceAll(/((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))/g,"-$1")+" "),Re.string+"-"+e},decode:function(e,t){return e=e.slice(2),t&&(e=e.slice(0,-1).replaceAll(/-((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))/g,"$1")),e}},array:{encode:function(e){var t,n=[],r=i(e.entries());try{for(r.s();!(t=r.n()).done;){var o=_(t.value,2),a=o[0],u=ct(o[1],!0);n[a]=u}}catch(e){r.e(e)}finally{r.f()}return n.push(Re.invalid+"-"),Re.array+"-"+JSON.stringify(n)},decode:function(e){var t=JSON.parse(e.slice(2));t.pop();for(var n=0;n<t.length;n++){var r=st(t[n],!0);t[n]=r}return t}},date:{encode:function(e){return Re.date+"-"+e.toJSON()},decode:function(e){return new Date(e.slice(2))}},binary:{encode:function(e){return Re.binary+"-"+(e.byteLength?p(Je(e)).map((function(e){return String(e).padStart(3,"0")})):"")},decode:function(e){var t=e.slice(2),n=t.length?t.split(",").map((function(e){return Number.parseInt(e)})):[],r=new ArrayBuffer(n.length);return new Uint8Array(r).set(n),r}}};function Ve(e){var t=e.toString(32);return 1===t.length?"0"+t:t}function Ke(e){return(e+We(11)).slice(0,11)}function Ge(e){var t,n="",r=i(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;n+=(31-Number.parseInt(o,32)).toString(32)}}catch(e){r.e(e)}finally{r.f()}return n}function He(e,t){var n=Number.parseInt(t,32);if(n<0)return Qe(Number.parseInt(e,32)*Math.pow(32,n-10));if(n<11){var r=e.slice(0,n),o=Number.parseInt(r,32),i=e.slice(n);return Qe(o+Number.parseInt(i,32)*Math.pow(32,n-11))}var a=e+We(n-11);return Number.parseInt(a,32)}function Qe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;return Number.parseFloat(e.toPrecision(t))}function We(e){return"0".repeat(e)}function ze(e){return"-"+e}function $e(e){if(Array.isArray(e))return"array";if(Y(t=e)&&"getDate"in t&&"function"==typeof t.getDate)return"date";var t;if(function(e){return Y(e)&&"byteLength"in e&&"number"==typeof e.byteLength&&("slice"in e&&"function"==typeof e.slice||"getFloat64"in e&&"function"==typeof e.getFloat64)}(e))return"binary";var n=h(e);return["string","number"].includes(n)?n:"invalid"}function Ye(e,t){return Xe(e,t,!1,!0)}function Je(e){var t=0,n=0;if(ArrayBuffer.isView(e)){if(void 0===e.buffer)throw new TypeError("Could not copy the bytes held by a buffer source as the buffer was undefined.");t=e.byteOffset,n=e.byteLength}else n=e.byteLength;return new Uint8Array("buffer"in e&&e.buffer||e,t,n)}function Xe(e,t,n,r){if((t=t||[]).includes(e))return{type:"array",invalid:!0,message:"An array key cannot be circular"};var o=$e(e),i={type:o,value:e};switch(o){case"number":return Number.isNaN(e)?{type:"NaN",invalid:!0}:Object.is(e,-0)?{type:o,value:0}:i;case"string":return i;case"binary":return{type:"binary",value:Je(e)};case"array":var a=e,u=a.length;t.push(e);for(var c,s=[],l=function(){if(!n&&!Object.hasOwn(a,f))return{v:{type:o,invalid:!0,message:"Does not have own index property"}};try{var e=Xe(a[f],t,!1,r);if(e.invalid)return n?0:{v:{type:o,invalid:!0,message:"Bad array entry value-to-key conversion"}};(!n||!r&&s.every((function(t){return 0!==ke(t,e.value)}))||r&&s.every((function(t){return 0!==ke(t,e)})))&&s.push(r?e:e.value)}catch(e){if(!n)throw e}},f=0;f<u;f++)if(0!==(c=l())&&c)return c.v;return{type:o,value:s};case"date":var d=e;return Number.isNaN(d.getTime())?{type:o,invalid:!0,message:"Not a valid date"}:r?{type:o,value:d.getTime()}:{type:o,value:new Date(d)};default:var _=null===e?"null":h(e);return{type:_,invalid:!0,message:"Not a valid key; type "+_}}}function Ze(e,t){return Xe(e,null,!0,t)}function et(e,t){var n=Ye(e,t);if(n.invalid)throw Ee("DataError",n.message||"Not a valid key; type: "+n.type);return n}function tt(e,t,n,r){var o=nt(e,t);return o.failure?o:n?Ze(o.value,r):Xe(o.value,null,!1,r)}function nt(e,t,n,r){if(Array.isArray(t)){var o=[];return t.some((function(t){var n=nt(e,t);return!!n.failure||(o.push(n.value),!1)}))?{failure:!0}:{value:o}}return""===t?{value:e}:t.split(".").some((function(t){if("length"!==t||"string"!=typeof e&&!Array.isArray(e))if(Y(n=e)&&"size"in n&&"number"==typeof n.size&&"slice"in n&&"function"==typeof n.slice&&!("lastModified"in n))switch(t){case"size":case"type":e=e[t]}else{if(!function(e){return Y(e)&&"name"in e&&"string"==typeof e.name&&"slice"in e&&"function"==typeof e.slice&&"lastModified"in e}(e))return!Y(e)||!Object.hasOwn(e,t)||void 0===(e=e[t]);switch(t){case"name":case"lastModified":e=e[t];break;case"lastModifiedDate":e=new Date(e.lastModified)}}else e=e.length;var n;return!1}))?{failure:!0}:{value:e}}function rt(e,t,n){var r=n.split("."),o=r.pop();r.forEach((function(t){Object.hasOwn(e,t)||(e[t]={}),e=e[t]})),e[o]=t}function ot(e,t){var n=t.split(".");n.pop();var r,o=i(n);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(!Y(e))return!1;if(!Object.hasOwn(e,a))return!0;e=e[a]}}catch(e){o.e(e)}finally{o.f()}return Y(e)}function it(e,t,n){var r=void 0===t.lower,o=void 0===t.upper,i=ct(e,!0),a=n?t.__lowerCached:ct(t.lower,!0),u=n?t.__upperCached:ct(t.upper,!0);return!r&&(t.lowerOpen&&null!==i&&null!==a&&i>a||!t.lowerOpen&&(!i&&!a||null!==i&&null!==a&&i>=a))&&(r=!0),!o&&(t.upperOpen&&null!==i&&null!==u&&i<u||!t.upperOpen&&(!i&&!u||null!==i&&null!==u&&i<=u))&&(o=!0),r&&o}function at(e,t){return"array"===qe[t.slice(0,1)]?t.indexOf(e)>1:t===e}function ut(e,t){var n=[];if(Array.isArray(e)){var r,o=i(e);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(Array.isArray(a)){if(t&&t.lower===t.upper)continue;if(1!==a.length){ut(a,t).length>0&&n.push(a);continue}a=a[0]}(se(t)||it(a,t,!0))&&n.push(a)}}catch(e){o.e(e)}finally{o.f()}}else(se(t)||it(e,t,!0))&&n.push(e);return n}function ct(e,t){return void 0===e?null:Me[$e(e)].encode(e,t)}function st(e,t){if("string"==typeof e)return Me[qe[e.slice(0,1)]].decode(e,t)}function lt(e,t){return st(ct(e,t),t)}var ft=9007199254740992;function dt(e,t,n,r){e.executeSql('SELECT "currNum" FROM __sys__ WHERE "name" = ?',[M(t.__currentName)],(function(e,t){1!==t.rows.length?n(1):n(t.rows.item(0).currNum)}),(function(e,t){return r(Ee("DataError","Could not get the auto increment value for key",t)),!1}))}function _t(e,t,n,r,o){var i='UPDATE __sys__ SET "currNum" = ? WHERE "name" = ?',a=[n,M(t.__currentName)];k.DEBUG&&console.log(i,a),e.executeSql(i,a,(function(){r(n)}),(function(e,t){return o(Ee("UnknownError","Could not set the auto increment value for key",t)),!1}))}function pt(e,t,n,r,o){return _t(e,t,n=n===ft?n+2:n+1,r,o)}function yt(e,t,n,r){dt(e,t,(function(o){o>ft?n("failure"):pt(e,t,o,(function(){n(null,o,o)}),r)}),r)}function ht(e,t,n,r,o){"number"!=typeof n||n<1?r():dt(e,t,(function(i){var a=Math.floor(Math.min(n,ft));a>=i?pt(e,t,a,(function(){r(i)}),o):r()}),o)}var vt=Object.freeze({__proto__:null,assignCurrentNumber:_t,checkKeyCouldBeInjectedIntoValue:ot,convertKeyToValue:function e(t){var n=t.type,r=t.value;switch(n){case"number":case"string":return r;case"array":for(var o=[],i=r.length,a=0;a<i;){var u=e(r[a]);o[a]=u,a++}return o;case"date":return new Date(r);case"binary":var c=r.length,s=new ArrayBuffer(c);return new Uint8Array(s,r.byteOffset||0,r.byteLength).set(r),s;default:throw new Error("Bad key")}},convertValueToKey:Ye,convertValueToKeyRethrowingAndIfInvalid:et,convertValueToKeyValueDecoded:Xe,convertValueToMultiEntryKey:function(e){return Xe(e,null,!0,!0)},convertValueToMultiEntryKeyDecoded:Ze,decode:st,encode:ct,evaluateKeyPathOnValue:function(e,t,n){return nt(e,t)},extractKeyFromValueUsingKeyPath:function(e,t,n){return tt(e,t,n,!0)},extractKeyValueDecodedFromValueUsingKeyPath:tt,findMultiEntryMatches:ut,generateKeyForStore:yt,injectKeyIntoValueUsingKeyPath:rt,isKeyInRange:it,isMultiEntryMatch:at,possiblyUpdateKeyGenerator:ht,roundTrip:lt});function bt(){throw this.__lowerOpen=!1,this.__upperOpen=!1,new TypeError("Illegal constructor")}var gt=bt;function mt(e,t,n,r,o,i){if(e&&(void 0!==e.lower||void 0!==e.upper)){var a,u;o&&n.push("AND");var c=void 0!==e.lower,s=void 0!==e.upper;if(c&&(a=i?e.__lowerCached:ct(e.lower)),s&&(u=i?e.__upperCached:ct(e.upper)),c){if(r.push(M(a)),s&&a===u&&!e.lowerOpen&&!e.upperOpen)return void n.push(t,"=","?");n.push(t,e.lowerOpen?">":">=","?")}c&&s&&n.push("AND"),s&&(n.push(t,e.upperOpen?"<":"<=","?"),r.push(M(u)))}}function Et(e,t){if($(e,bt))return"[object IDBKeyRange]"!==e.toString()?bt.__createInstance(e.lower,e.upper,e.lowerOpen,e.upperOpen):e;if(!se(e))return et(e),bt.only(e);if(t)throw Ee("DataError","No key or range was specified")}bt.__createInstance=function(e,t,n,r){function o(){if(this[Symbol.toStringTag]="IDBKeyRange",void 0===e&&void 0===t)throw Ee("DataError","Both arguments to the key range method cannot be undefined");var o,i;if(void 0!==e&&(o=lt(e),et(e)),void 0!==t&&(i=lt(t),et(t)),void 0!==e&&void 0!==t&&e!==t&&ct(e)>ct(t))throw Ee("DataError","`lower` must not be greater than `upper` argument in `bound()` call.");this.__lower=o,this.__upper=i,this.__lowerOpen=Boolean(n),this.__upperOpen=Boolean(r)}return o.prototype=gt.prototype,new o},bt.prototype.includes=function(e){if(!Y(this)||"boolean"!=typeof this.__lowerOpen)throw new TypeError("Illegal invocation");if(!arguments.length)throw new TypeError("IDBKeyRange.includes requires a key argument");return et(e),it(e,this)},bt.only=function(e){if(!arguments.length)throw new TypeError("IDBKeyRange.only requires a value argument");return bt.__createInstance(e,e,!1,!1)},bt.lowerBound=function(e){if(!arguments.length)throw new TypeError("IDBKeyRange.lowerBound requires a value argument");return bt.__createInstance(e,void 0,arguments[1],!0)},bt.upperBound=function(e){if(!arguments.length)throw new TypeError("IDBKeyRange.upperBound requires a value argument");return bt.__createInstance(void 0,e,!0,arguments[1])},bt.bound=function(e,t){if(arguments.length<=1)throw new TypeError("IDBKeyRange.bound requires lower and upper arguments");return bt.__createInstance(e,t,arguments[2],arguments[3])},bt.prototype[Symbol.toStringTag]="IDBKeyRangePrototype",["lower","upper","lowerOpen","upperOpen"].forEach((function(e){Object.defineProperty(bt.prototype,"__"+e,{enumerable:!1,configurable:!1,writable:!0});var t=a("get",{},e,(function(){if(!Y(this)||"boolean"!=typeof this.__lowerOpen)throw new TypeError("Illegal invocation");return this["__"+e]})),n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(bt.prototype,e,n)})),Object.defineProperty(bt,Symbol.hasInstance,{value:function(e){return Y(e)&&"upper"in e&&"lowerOpen"in e&&"boolean"==typeof e.lowerOpen}}),Object.defineProperty(bt,"prototype",{writable:!1});var wt=!1,Dt={test:!0};if(Object.defineProperty)try{Object.defineProperty(Dt,"test",{enumerable:!1}),Dt.test&&(wt=!0)}catch(e){}var It=function(){throw this._items=[],this._length=0,new TypeError("Illegal constructor")};It.prototype=u(u({constructor:It,contains:function(e){if(!arguments.length)throw new TypeError("DOMStringList.contains must be supplied a value");return this._items.includes(e)},item:function(e){if(!arguments.length)throw new TypeError("DOMStringList.item must be supplied a value");return e<0||e>=this.length||!Number.isInteger(e)?null:this._items[e]},clone:function(){var e=It.__createInstance();return e._items=this._items.slice(),e._length=this.length,e.addIndexes(),e},addIndexes:function(){for(var e=0;e<this._items.length;e++)this[e]=this._items[e]},sortList:function(){return this._items.sort(),this.addIndexes(),this._items},forEach:function(e,t){this._items.forEach(e,t)},map:function(e,t){return this._items.map(e,t)},indexOf:function(e){return this._items.indexOf(e)},push:function(e){this._items.push(e),this._length++,this.sortList()},splice:function(){var e;for(var t in(e=this._items).splice.apply(e,arguments),this._length=this._items.length,this)t===String(Number.parseInt(t))&&delete this[t];this.sortList()}},Symbol.toStringTag,"DOMStringListPrototype"),Symbol.iterator,f().m((function e(){var t;return f().w((function(e){for(;;)switch(e.n){case 0:t=0;case 1:if(!(t<this._items.length)){e.n=3;break}return e.n=2,this._items[t++];case 2:e.n=1;break;case 3:return e.a(2)}}),e,this)}))),Object.defineProperty(It,Symbol.hasInstance,{value:function(e){return"DOMStringListPrototype"===Object.prototype.toString.call(e)}});var Ot=It;if(Object.defineProperty(It,"__createInstance",{value:function(){var e=function(){this.toString=function(){return"[object DOMStringList]"},Object.defineProperty(this,"length",{enumerable:!0,get:function(){return this._length}}),this._items=[],this._length=0};return e.prototype=Ot.prototype,new e}}),wt){Object.defineProperty(It,"prototype",{writable:!1});["addIndexes","sortList","forEach","map","indexOf","push","splice","constructor","__createInstance"].forEach((function(e){Object.defineProperty(It.prototype,e,{enumerable:!1})})),Object.defineProperty(It.prototype,"length",{configurable:!0,enumerable:!0,get:function(){throw new TypeError("Illegal invocation")}});["_items","_length"].forEach((function(e){Object.defineProperty(It.prototype,e,{enumerable:!1,writable:!0})}))}var St=0,Tt=["onabort","oncomplete","onerror"],At=["objectStoreNames","mode","db","error"];function Nt(){throw new TypeError("Illegal constructor")}var xt=Nt;function Bt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ft(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bt(Object(n),!0).forEach((function(t){kt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jt(e){return jt="function"==typeof Symbol&&"symbol"==h(Symbol.iterator)?function(e){return h(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":h(e)},jt(e)}function Ct(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pt(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ut(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function kt(e,t,n){return(t=Ut(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(e,t)||Lt(e,t)||function(){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 Lt(e,t){if(e){if("string"==typeof e)return qt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qt(e,t):void 0}}function qt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ut(e){var t=function(e,t){if("object"!=h(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==h(t)?t:String(t)}Nt.__createInstance=function(e,t,n){function r(){var r=this,o=this;o[Symbol.toStringTag]="IDBTransaction",te(o,At),o.__id=++St,o.__active=!0,o.__running=!1,o.__errored=!1,o.__requests=[],o.__objectStoreNames=t,o.__mode=n,o.__db=e,o.__error=null,o.__setOptions({legacyOutputDidListenersThrowFlag:!0}),At.forEach((function(e){Object.defineProperty(r,e,{configurable:!0})})),ee(this,Tt),o.__storeHandles={},setTimeout((function(){o.__executeRequests()}),0)}return r.prototype=xt.prototype,new r},Nt.prototype=F.createInstance({defaultSync:!0,extraProperties:["complete"]}),Nt.prototype.__transFinishedCb=function(e,t){t(Boolean(e))},Nt.prototype.__executeRequests=function(){var e=this;e.__running?k.DEBUG&&console.log("Looks like the request set is already running",e.mode):(e.__running=!0,e.db.__db["readonly"===e.mode?"readTransaction":"transaction"]((function(t){e.__tx=t;var n,r=-1;function o(t,r){if(!e.__errored&&!e.__requestsFinished&&(r&&(n.req=r),n.req&&!n.req.__done)){n.req.__done=!0,n.req.__result=t,n.req.__error=null,e.__active=!0;var o=le("success");if(n.req.dispatchEvent(o),o.__legacyOutputDidListenersThrowError)return he("Error","An error occurred in a success handler attached to request chain",o.__legacyOutputDidListenersThrowError),void e.__abortTransaction(Ee("AbortError","A request was aborted (in user handler after success)."));u()}}function a(){if(!(e.__errored||e.__requestsFinished||n.req&&n.req.__done)){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var a=function(e){var t;if(e){if(1===e.length)return e[0];var n,r=i(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(ve(o))return o;o&&"string"==typeof o.message&&(t=o)}}catch(t){r.e(t)}finally{r.f()}}return t}(r);if(n.req){n.req.__done=!0,n.req.__error=a,n.req.__result=void 0,n.req.addLateEventListener("error",(function(e){e.cancelable&&e.defaultPrevented&&!e.__legacyOutputDidListenersThrowError&&u()})),n.req.addDefaultEventListener("error",(function(){n.req&&e.__abortTransaction(n.req.__error)})),e.__active=!0;var c=le("error",a,{bubbles:!0,cancelable:!0});n.req.dispatchEvent(c),c.__legacyOutputDidListenersThrowError&&(he("Error","An error occurred in an error handler attached to request chain",c.__legacyOutputDidListenersThrowError),c.preventDefault(),e.__abortTransaction(Ee("AbortError","A request was aborted (in user handler after error).")))}else e.__abortTransaction(a)}}function u(){if(!e.__errored&&!e.__requestsFinished)if(++r>=e.__requests.length)e.__requests=[],e.__active&&function(){function t(){e.__completed=!0,k.DEBUG&&console.log("Transaction completed");var t=le("complete");try{e.__internal=!0,e.dispatchEvent(t),e.__internal=!1,e.dispatchEvent(le("__complete"))}catch(t){throw e.__internal=!1,e.__errored=!0,t}finally{e.__storeHandles={}}}if(e.__active=!1,e.__requestsFinished=!0,"readwrite"===e.mode)return e.__transactionFinished?void t():void(e.__transactionEndCallback=t);if("readonly"===e.mode)return void t();var n=le("__beforecomplete");n.complete=t,e.dispatchEvent(n)}();else try{if(!(n=e.__requests[r]).req)return void n.op(t,n.args,u,a);if(n.req.__done)return;n.op(t,n.args,o,a,u)}catch(e){a(e)}}u()}),(function(t){if(!0!==t){var n=be(t);e.__abortTransaction(n)}}),(function(){e.__transFinishedCb===Nt.prototype.__transFinishedCb&&(e.__transactionEndCallback||e.__requestsFinished?e.__transactionEndCallback&&!e.__completed&&e.__transFinishedCb(e.__errored,e.__transactionEndCallback):e.__transactionFinished=!0)}),(function(t,n,r,o,i){return!(!t.readOnly&&!n)||(e.__transFinishedCb=function(e,t){e?o(e,t):i(t)},e.__transactionEndCallback&&!e.__completed&&e.__transFinishedCb(e.__errored,e.__transactionEndCallback),!1)})))},Nt.prototype.__createRequest=function(e){var t=Se.__createInstance();return t.__source=void 0!==e?e:this.db,t.__transaction=this,t},Nt.prototype.__addToTransactionQueue=function(e,t,n){var r=this.__createRequest(n);return this.__pushToQueue(r,e,t),r},Nt.prototype.__addNonRequestToTransactionQueue=function(e,t){this.__pushToQueue(null,e,t)},Nt.prototype.__pushToQueue=function(e,t,n){this.__assertActive(),this.__requests.push({op:t,args:n,req:e})},Nt.prototype.__assertActive=function(){if(!this.__active)throw Ee("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished")},Nt.prototype.__assertWritable=function(){if("readonly"===this.mode)throw Ee("ReadOnlyError","The transaction is read only")},Nt.prototype.__assertVersionChange=function(){Nt.__assertVersionChange(this)},Nt.prototype.objectStore=function(e){var t=this;if(!(t instanceof Nt))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No object store name was specified");if(Nt.__assertNotFinished(t),-1===t.__objectStoreNames.indexOf(e))throw Ee("NotFoundError",e+" is not participating in this transaction");var n=t.db.__objectStores[e];if(!n)throw Ee("NotFoundError",e+" does not exist in "+t.db.name);return(!t.__storeHandles[e]||t.__storeHandles[e].__pendingDelete||t.__storeHandles[e].__deleted)&&(t.__storeHandles[e]=_r.__clone(n,t)),t.__storeHandles[e]},Nt.prototype.__abortTransaction=function(e){var t=this;function n(n,r){n?r&&"code"in r&&"number"==typeof r.code?k.DEBUG&&console.log("Rollback erred; feature is probably not supported as per WebSQL",t):k.DEBUG&&console.log("Rollback succeeded",t):k.DEBUG&&console.log("Rollback not possible due to missing transaction",t),t.dispatchEvent(le("__preabort")),t.__requests.filter((function(e,t,n){return e.req&&!e.req.__done&&[t,-1].includes(n.map((function(e){return e.req})).lastIndexOf(e.req))})).reduce((function(e,t){return e.then((function(){if(!t.req)throw new Error("Missing request");t.req.__done=!0,t.req.__result=void 0,t.req.__error=Ee("AbortError","A request was aborted (an unfinished request).");var e=le("error",t.req.__error,{bubbles:!0,cancelable:!0});return new Pe((function(n){setTimeout((function(){if(!t.req)throw new Error("Missing request");t.req.dispatchEvent(e),n()}))}))}))}),Pe.resolve(void 0)).then((function(){var n=le("abort",e,{bubbles:!0,cancelable:!1});setTimeout((function(){t.__abortFinished=!0,t.dispatchEvent(n),t.__storeHandles={},t.dispatchEvent(le("__abort"))}))})).catch((function(e){throw console.log("Abort error"),e}))}he("Error","An error occurred in a transaction",e),t.__errored||(t.__errored=!0,"versionchange"===t.mode&&(t.db.__version=t.db.__oldVersion,t.db.__objectStoreNames=t.db.__oldObjectStoreNames,t.__objectStoreNames=t.db.__oldObjectStoreNames,Object.values(t.db.__objectStores).concat(Object.values(t.__storeHandles)).forEach((function(e){"__pendingName"in e&&t.db.__oldObjectStoreNames.indexOf(e.__pendingName)>-1&&(e.__name=e.__originalName),e.__indexNames=e.__oldIndexNames,delete e.__pendingDelete,Object.values(e.__indexes).concat(Object.values(e.__indexHandles)).forEach((function(t){"__pendingName"in t&&e.__oldIndexNames.indexOf(t.__pendingName)>-1&&(t.__name=t.__originalName),delete t.__pendingDelete}))}))),t.__active=!1,null!==e&&(t.__error=e),t.__requestsFinished&&setTimeout((function(){throw e}),0),t.__transFinishedCb(!0,(function(e){if(e&&t.__tx){if("readwrite"===t.mode)return t.__transactionFinished?void n():void(t.__transactionEndCallback=n);try{t.__tx.executeSql("ROLLBACK",[],n,n)}catch(e){n()}}else n(null,{code:0})})))},Nt.prototype.abort=function(){var e=this;if(!(e instanceof Nt))throw new TypeError("Illegal invocation");k.DEBUG&&console.log("The transaction was aborted",e),Nt.__assertNotFinished(e),e.__abortTransaction(null)},Nt.prototype[Symbol.toStringTag]="IDBTransactionPrototype",Nt.__assertVersionChange=function(e){if(!e||"versionchange"!==e.mode)throw Ee("InvalidStateError","Not a version transaction")},Nt.__assertNotVersionChange=function(e){if(e&&"versionchange"===e.mode)throw Ee("InvalidStateError","Cannot be called during a version transaction")},Nt.__assertNotFinished=function(e){if(!e||e.__completed||e.__abortFinished||e.__errored)throw Ee("InvalidStateError","Transaction finished by commit or abort")},Nt.__assertNotFinishedObjectStoreMethod=function(e){try{Nt.__assertNotFinished(e)}catch(t){if(e&&!e.__completed&&!e.__abortFinished)throw Ee("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished");throw t}},Nt.__assertActive=function(e){if(!e||!e.__active)throw Ee("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished")},Nt.prototype.__getParent=function(){return this.db},X(Nt.prototype,Tt),Z(Nt.prototype,At),Object.defineProperty(Nt.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:Nt}),Object.defineProperty(Nt,"prototype",{writable:!1});var Mt=Pt((function e(t){Ct(this,e),this.p=new Promise(t)}));Mt.__typeson__type__="TypesonPromise","undefined"!=typeof Symbol&&Object.defineProperty(Mt.prototype,Symbol.toStringTag,{get:function(){return"TypesonPromise"}}),Mt.prototype.then=function(e,t){var n=this;return new Mt((function(r,o){n.p.then((function(t){r(e?e(t):t)})).catch((function(e){return t?t(e):Promise.reject(e)})).then(r,o)}))},Mt.prototype.catch=function(e){return this.then((function(){}),e)},Mt.resolve=function(e){return new Mt((function(t){t(e)}))},Mt.reject=function(e){return new Mt((function(t,n){n(e)}))},Mt.all=function(e){return new Mt((function(t,n){Promise.all(e.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(t,n)}))},Mt.race=function(e){return new Mt((function(t,n){Promise.race(e.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(t,n)}))},Mt.allSettled=function(e){return new Mt((function(t,n){Promise.allSettled(e.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(t,n)}))};var Vt=Object.hasOwn,Kt=Object.getPrototypeOf;function Gt(e,t){return $t(e)&&"function"==typeof e.then&&!0}function Ht(e){return Object.prototype.toString.call(e).slice(8,-1)}function Qt(e,t){if(!e||"object"!==jt(e))return!1;var n=Kt(e);if(!n)return null===t;var r=Vt(n,"constructor")&&n.constructor;return"function"!=typeof r?null===t:t===r||null!==t&&Function.prototype.toString.call(r)===Function.prototype.toString.call(t)||"function"==typeof t&&"string"==typeof r.__typeson__type__&&r.__typeson__type__===t.__typeson__type__}function Wt(e){return!(!e||"Object"!==Ht(e))&&(!Kt(e)||Qt(e,Object))}function zt(e){if(!e||"Object"!==Ht(e))return!1;var t=Kt(e);return!t||Qt(e,Object)||zt(t)}function $t(e){return null!==e&&"object"===jt(e)}function Yt(e){return e.replaceAll("''","''''").replace(/^$/,"''").replaceAll("~","~0").replaceAll(".","~1")}function Jt(e){return e.replaceAll("~1",".").replaceAll("~0","~").replace(/^''$/,"").replaceAll("''''","''")}function Xt(e,t){if(""===t)return e;if(null===e||"object"!==jt(e))throw new TypeError("Unexpected non-object type");var n=t.indexOf(".");if(n>-1){var r=e[Jt(t.slice(0,n))];return void 0===r?void 0:Xt(r,t.slice(n+1))}return e[Jt(t)]}function Zt(e,t,n){if(""===t)return n;if(!e||"object"!==jt(e))throw new TypeError("Unexpected non-object type");var r=t.indexOf(".");return r>-1?Zt(e[Jt(t.slice(0,r))],t.slice(r+1),n):(e[Jt(t)]=n,e)}function en(e){return null===e?"null":Array.isArray(e)?"array":jt(e)}function tn(e,t,n){return e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e}var nn=Object.keys,rn=Object.hasOwn,on=Array.isArray,an=["type","replaced","iterateIn","iterateUnsetNumeric","addLength"];function un(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}function cn(e,t){var n,r;if(""===e.keypath)return-1;var o=null!==(n=e.keypath.match(/\./g))&&void 0!==n?n:0,i=null!==(r=t.keypath.match(/\./g))&&void 0!==r?r:0;return o&&(o=o.length),i&&(i=i.length),o>i?-1:o<i?1:e.keypath<t.keypath?-1:e.keypath>t.keypath?1:0}var sn=function(){function e(t){Ct(this,e),this.options=t,this.plainObjectReplacers=[],this.nonplainObjectReplacers=[],this.revivers={},this.types={}}return Pt(e,[{key:"stringify",value:function(e,t,n,r){r=Ft(Ft(Ft({},this.options),r),{},{stringification:!0});var o=this.encapsulate(e,null,r);return on(o)?JSON.stringify(o[0],t,n):o.then((function(e){return JSON.stringify(e,t,n)}))}},{key:"stringifySync",value:function(e,t,n,r){return this.stringify(e,t,n,Ft(Ft({throwOnBadSyncType:!0},r),{},{sync:!0}))}},{key:"stringifyAsync",value:function(e,t,n,r){return this.stringify(e,t,n,Ft(Ft({throwOnBadSyncType:!0},r),{},{sync:!1}))}},{key:"parse",value:function(e,t,n){return n=Ft(Ft(Ft({},this.options),n),{},{parse:!0}),this.revive(JSON.parse(e,t),n)}},{key:"parseSync",value:function(e,t,n){return this.parse(e,t,Ft(Ft({throwOnBadSyncType:!0},n),{},{sync:!0}))}},{key:"parseAsync",value:function(e,t,n){return this.parse(e,t,Ft(Ft({throwOnBadSyncType:!0},n),{},{sync:!1}))}},{key:"specialTypeNames",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.returnTypeNames=!0,this.encapsulate(e,t,n)}},{key:"rootTypeName",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.iterateNone=!0,this.encapsulate(e,t,n)}},{key:"encapsulate",value:function(e,t,n){var r=this,o=Ft(Ft({sync:!0},this.options),n),i=o.sync,a={},u=[],c=[],s=[],l=!("cyclic"in o)||o.cyclic,f=o.encapsulateObserver,d=function(e){var t=Object.values(a);if(o.iterateNone)return t.length?t[0]:en(e);if(t.length){if(o.returnTypeNames)return function(e){return function(e){if(Array.isArray(e))return qt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Lt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(new Set(t));e&&Wt(e)&&!rn(e,"$types")?e.$types=a:e={$:e,$types:{$:a}}}else $t(e)&&rn(e,"$types")&&(e={$:e,$types:!0});return!o.returnTypeNames&&e},_=un((function(e,t){return tn(Promise.all(t.map((function(e){return e[1].p}))),(function(n){return tn(Promise.all(n.map(un((function(n){var r=!1,o=[],i=Rt(t.splice(0,1),1),a=Rt(i[0],7),u=a[0],c=a[2],s=a[3],l=a[4],f=a[5],d=a[6],p=y(u,n,c,s,o,!0,d),h=Qt(p,Mt);return function(e,t){var n=e();return n&&n.then?n.then(t):t(n)}((function(){if(u&&h)return tn(p.p,(function(t){l[f]=t;var n=_(e,o);return r=!0,n}))}),(function(t){return r?t:(u?l[f]=p:e=h?p.p:p,_(e,o))}))})))),(function(){return e}))}))})),p=function(e,t,n){Object.assign(e,t);var r=an.map((function(t){var n=e[t];return delete e[t],n}));n(),an.forEach((function(t,n){e[t]=r[n]}))},y=function e(t,n,i,s,l,d,_){var y,v={},b=jt(n),g=f?function(e){var r,o=null!==(r=null!=_?_:s.type)&&void 0!==r?r:en(n);f(Object.assign(null!=e?e:v,{keypath:t,value:n,cyclic:i,stateObj:s,promisesData:l,resolvingTypesonPromise:d,awaitingTypesonPromise:Qt(n,Mt)},{type:o}))}:null;if(["string","boolean","number","undefined"].includes(b))return void 0===n||Number.isNaN(n)||n===Number.NEGATIVE_INFINITY||n===Number.POSITIVE_INFINITY||0===n?(y=s.replaced?n:h(t,n,s,l,!1,d,g))!==n&&(v={replaced:y}):y=n,g&&g(),y;if(null===n)return g&&g(),n;if(i&&!s.iterateIn&&!s.iterateUnsetNumeric&&n&&"object"===jt(n)){var m=u.indexOf(n);if(!(m<0))return a[t]="#",g&&g({cyclicKeypath:c[m]}),"#"+c[m];!0===i&&(u.push(n),c.push(t))}var E,w,D=Wt(n),I=on(n),O=(D||I)&&(!r.plainObjectReplacers.length||s.replaced)||s.iterateIn?n:h(t,n,s,l,D||I,null,g);if(O!==n?(y=O,v={replaced:O}):""===t&&Qt(n,Mt)?(l.push([t,n,i,s,void 0,void 0,s.type]),y=n):I&&"object"!==s.iterateIn||"array"===s.iterateIn?(E=new Array(n.length),v={clone:E}):(["function","symbol"].includes(jt(n))||"toJSON"in n||Qt(n,Mt)||Qt(n,Promise)||Qt(n,ArrayBuffer))&&!D&&"object"!==s.iterateIn?y=n:(E={},s.addLength&&(E.length=n.length),v={clone:E}),g&&g(),o.iterateNone)return null!==(w=E)&&void 0!==w?w:y;if(!E)return y;if(s.iterateIn){var S=function(r){var o={ownKeys:rn(n,r)};p(s,o,(function(){var o=t+(t?".":"")+Yt(r),a=e(o,n[r],Boolean(i),s,l,d);Qt(a,Mt)?l.push([o,a,Boolean(i),s,E,r,s.type]):void 0!==a&&(E[r]=a)}))};for(var T in n)S(T);g&&g({endIterateIn:!0,end:!0})}else nn(n).forEach((function(r){var o=t+(t?".":"")+Yt(r);p(s,{ownKeys:!0},(function(){var t=e(o,n[r],Boolean(i),s,l,d);Qt(t,Mt)?l.push([o,t,Boolean(i),s,E,r,s.type]):void 0!==t&&(E[r]=t)}))})),g&&g({endIterateOwn:!0,end:!0});if(s.iterateUnsetNumeric){for(var A=n.length,N=function(r){if(!(r in n)){var o="".concat(t).concat(t?".":"").concat(r);p(s,{ownKeys:!1},(function(){var t=e(o,void 0,Boolean(i),s,l,d);Qt(t,Mt)?l.push([o,t,Boolean(i),s,E,r,s.type]):void 0!==t&&(E[r]=t)}))}},x=0;x<A;x++)N(x);g&&g({endIterateUnsetNumeric:!0,end:!0})}return E},h=function(e,t,n,o,u,c,s){for(var f=u?r.plainObjectReplacers:r.nonplainObjectReplacers,d=f.length;d--;){var _=f[d];if(_.test(t,n)){var p=_.type;if(r.revivers[p]){var h=a[e];a[e]=h?[p].concat(h):p}if(Object.assign(n,{type:p,replaced:!0}),(i||!_.replaceAsync)&&!_.replace)return s&&s({typeDetected:!0}),y(e,t,l&&"readonly",n,o,c,p);s&&s({replacing:!0});var v=void 0;if(i||!_.replaceAsync){if(void 0===_.replace)throw new TypeError("Missing replacer");v=_.replace(t,n)}else v=_.replaceAsync(t,n);return y(e,v,l&&"readonly",n,o,c,p)}}return t},v=y("",e,l,null!=t?t:{},s);if(s.length)return i&&o.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Promise.resolve(_(v,s)).then(d);if(!i&&o.throwOnBadSyncType)throw new TypeError("Async method requested but sync result obtained");return o.stringification&&i?[d(v)]:i?d(v):Promise.resolve(d(v))}},{key:"encapsulateSync",value:function(e,t,n){return this.encapsulate(e,t,Ft(Ft({throwOnBadSyncType:!0},n),{},{sync:!0}))}},{key:"encapsulateAsync",value:function(e,t,n){return this.encapsulate(e,t,Ft(Ft({throwOnBadSyncType:!0},n),{},{sync:!1}))}},{key:"revive",value:function(e,t){var n=this,r=Ft(Ft({sync:!0},this.options),t),o=r.sync;function i(e){if(o)return e;if(r.throwOnBadSyncType)throw new TypeError("Async method requested but sync result obtained");return Promise.resolve(e)}if(!e||"object"!==jt(e)||Array.isArray(e))return i(e);var a=e.$types;if(!0===a)return i(e.$);if(!a||"object"!==jt(a)||Array.isArray(a))return i(e);var u=[],c={},s=!0;a.$&&Wt(a.$)&&(e=e.$,a=a.$,s=!1);var l=function(e,t){var r,i=Rt(null!==(r=n.revivers[e])&&void 0!==r?r:[],1)[0];if(!i)throw new Error("Unregistered type: "+e);if(o&&!("revive"in i))return t;if(!o&&i.reviveAsync)return i.reviveAsync(t,c);if(i.revive)return i.revive(t,c);throw new Error("Missing reviver")},f=[];function d(e){return Qt(e,ln)?void 0:e}var _,p=function(){var t=[];if(!a)throw new Error("Found bad `types`");if(Object.entries(a).forEach((function(e){var r=Rt(e,2),o=r[0],i=r[1];"#"!==i&&[].concat(i).forEach((function(e){var r;Rt(null!==(r=n.revivers[e])&&void 0!==r?r:[null,{}],2)[1].plain&&(t.push({keypath:o,type:e}),delete a[o])}))})),t.length)return t.sort(cn).reduce((function t(n,r){var o=r.keypath,i=r.type;if(Gt(n))return n.then((function(e){return t(e,{keypath:o,type:i})}));var a=Xt(e,o);if(Qt(a=l(i,a),Mt))return a.then((function(t){var n=Zt(e,o,t);n===t&&(e=n)}));var u=Zt(e,o,a);u===a&&(e=u)}),void 0)}();return Qt(p,Mt)?_=p.then((function(){return e})):(_=function e(t,n,r,o,i){if(!s||"$types"!==t){var c=a[t],d=on(n);if(d||Wt(n)){var _=d?new Array(n.length):{};for(nn(n).forEach((function(o){var i=e(t+(t?".":"")+Yt(o),n[o],null!=r?r:_,_,o),a=function(e){return Qt(e,ln)?_[o]=void 0:void 0!==e&&(_[o]=e),e};Qt(i,Mt)?f.push(i.then((function(e){return a(e)}))):a(i)})),n=_;u.length;){var p=Rt(u[0],4),y=p[0],h=p[1],v=p[2],b=p[3],g=Xt(y,h);if(void 0===g)break;v[b]=g,u.splice(0,1)}}if(!c)return n;if("#"===c){var m=Xt(r,n.slice(1));return void 0===m&&u.push([r,n.slice(1),o,i]),m}return[].concat(c).reduce((function e(t,n){if(Qt(t,Mt))return t.then((function(t){return e(t,n)}));if("string"!=typeof n)throw new TypeError("Bad type JSON");return l(n,t)}),n)}}("",e,null),f.length&&(_=Mt.resolve(_).then((function(e){return Mt.all([e].concat(f))})).then((function(e){return Rt(e,1)[0]})))),Gt(_)?o&&r.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Qt(_,Mt)?_.p.then(d):_:!o&&r.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():o?d(_):Promise.resolve(d(_))}},{key:"reviveSync",value:function(e,t){return this.revive(e,Ft(Ft({throwOnBadSyncType:!0},t),{},{sync:!0}))}},{key:"reviveAsync",value:function(e,t){return this.revive(e,Ft(Ft({throwOnBadSyncType:!0},t),{},{sync:!1}))}},{key:"register",value:function(e,t){var n=this,r=null!=t?t:{},o=function e(t){on(t)?t.forEach((function(t){return e(t)})):nn(t).forEach((function(e){var o;if("#"===e)throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");if(fn.includes(e))throw new TypeError("Plain JSON object types are reserved as type names");var i=t[e],a=i&&"function"!=typeof i&&!Array.isArray(i)&&i.testPlainObjects?n.plainObjectReplacers:n.nonplainObjectReplacers,u=a.filter((function(t){return t.type===e}));if(u.length&&(a.splice(a.indexOf(u[0]),1),delete n.revivers[e],delete n.types[e]),"function"==typeof i){var c=i;i={test:function(e){return e&&e.constructor===c},replace:function(e){return Ft({},e)},revive:function(e){return Object.assign(Object.create(c.prototype),e)}}}else if(on(i)){var s=Rt(i,3);i={test:s[0],replace:s[1],revive:s[2]}}if(null!==(o=i)&&void 0!==o&&o.test){var l={type:e,test:i.test.bind(i)};i.replace&&(l.replace=i.replace.bind(i)),i.replaceAsync&&(l.replaceAsync=i.replaceAsync.bind(i));var f="number"==typeof r.fallback?r.fallback:r.fallback?0:Number.POSITIVE_INFINITY;if(i.testPlainObjects?n.plainObjectReplacers.splice(f,0,l):n.nonplainObjectReplacers.splice(f,0,l),i.revive||i.reviveAsync){var d={};i.revive&&(d.revive=i.revive.bind(i)),i.reviveAsync&&(d.reviveAsync=i.reviveAsync.bind(i)),n.revivers[e]=[d,{plain:i.testPlainObjects}]}n.types[e]=i}}))};return[].concat(e).forEach((function(e){return o(e)})),this}}]),e}(),ln=Pt((function e(){Ct(this,e)}));ln.__typeson__type__="TypesonUndefined";for(var fn=["null","boolean","number","string","array","object"],dn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_n=new Uint8Array(256),pn=0;pn<64;pn++)_n[dn.codePointAt(pn)]=pn;var yn=function(e,t,n){null==n&&(n=e.byteLength);for(var r=new Uint8Array(e,0,n),o=r.length,i="",a=0;a<o;a+=3)i+=dn[r[a]>>2],i+=dn[(3&r[a])<<4|r[a+1]>>4],i+=dn[(15&r[a+1])<<2|r[a+2]>>6],i+=dn[63&r[a+2]];return o%3==2?i=i.slice(0,-1)+"=":o%3==1&&(i=i.slice(0,-2)+"=="),i},hn=function(e,t){var n=e.length;if(n%4)throw new Error("Bad base64 length: not divisible by four");var r,o,i,a,u=.75*e.length,c=0;"="===e[e.length-1]&&(u--,"="===e[e.length-2]&&u--);for(var s=new ArrayBuffer(u,t),l=new Uint8Array(s),f=0;f<n;f+=4)r=_n[e.codePointAt(f)],o=_n[e.codePointAt(f+1)],i=_n[e.codePointAt(f+2)],a=_n[e.codePointAt(f+3)],l[c++]=r<<2|o>>4,l[c++]=(15&o)<<4|i>>2,l[c++]=(3&i)<<6|63&a;return s},vn={arraybuffer:{test:function(e){return"ArrayBuffer"===Ht(e)},replace:function(e,t){t.buffers||(t.buffers=[]);var n=t.buffers.indexOf(e);return n>-1?{index:n}:(t.buffers.push(e),{s:yn(e),maxByteLength:e.maxByteLength,resizable:e.resizable})},revive:function(e,t){if(t.buffers||(t.buffers=[]),Object.hasOwn(e,"index"))return t.buffers[e.index];var n=hn(e.s,e.resizable?{maxByteLength:e.maxByteLength}:void 0);return t.buffers.push(n),n}}},bn={bigintObject:{test:function(e){return"object"==h(e)&&Qt(e,BigInt)},replace:String,revive:function(e){return new Object(BigInt(e))}}},gn={bigint:{test:function(e){return"bigint"==typeof e},replace:String,revive:function(e){return BigInt(e)}}};function mn(e){return new Uint8Array(e).reduce((function(e,t){return e+String.fromCodePoint(t)}),"")}function En(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t.buffer}var wn={blob:{test:function(e){return"Blob"===Ht(e)},replace:function(e){var t=new XMLHttpRequest;if(t.overrideMimeType("text/plain; charset=x-user-defined"),t.open("GET",URL.createObjectURL(e),!1),t.send(),200!==t.status&&0!==t.status)throw new Error("Bad Blob access: "+t.status);return{type:e.type,stringContents:t.responseText}},revive:function(e){var t=e.type,n=e.stringContents;return new Blob([En(n)],{type:t})},replaceAsync:function(e){return new Mt((function(t,n){var r=new FileReader;r.addEventListener("load",(function(){t({type:e.type,stringContents:mn(r.result)})})),r.addEventListener("error",(function(){n(r.error)})),r.readAsArrayBuffer(e)}))}}},Dn={cryptokey:{test:function(e){return"CryptoKey"===Ht(e)&&e.extractable},replaceAsync:function(e){return new Mt(function(){var t=n(f().m((function t(n,r){var o,i;return f().w((function(t){for(;;)switch(t.n){case 0:return t.p=0,t.n=1,crypto.subtle.exportKey("jwk",e);case 1:o=t.v,t.n=3;break;case 2:return t.p=2,i=t.v,t.a(2,void r(i));case 3:n({jwk:o,algorithm:e.algorithm,usages:e.usages});case 4:return t.a(2)}}),t,null,[[0,2]])})));return function(e,n){return t.apply(this,arguments)}}())},revive:function(e){var t=e.jwk,n=e.algorithm,r=e.usages;return crypto.subtle.importKey("jwk",t,n,!0,r)}}},In={dataview:{test:function(e){return"DataView"===Ht(e)},replace:function(e,t){var n=e.buffer,r=e.byteOffset,o=e.byteLength;t.buffers||(t.buffers=[]);var i=t.buffers.indexOf(n);return i>-1?{index:i,byteOffset:r,byteLength:o}:(t.buffers.push(n),{encoded:yn(n),maxByteLength:n.maxByteLength,resizable:n.resizable,byteOffset:r,byteLength:o})},revive:function(e,t){t.buffers||(t.buffers=[]);var n,r=e.byteOffset,o=e.byteLength,i=e.encoded,a=e.index,u=e.maxByteLength,c=e.resizable;return"index"in e?n=t.buffers[a]:(n=hn(i,c?{maxByteLength:u}:u),t.buffers.push(n)),new DataView(n,r,o)}}},On={date:{test:function(e){return"Date"===Ht(e)},replace:function(e){var t=e.getTime();return Number.isNaN(t)?"NaN":t},revive:function(e){return"NaN"===e?new Date(Number.NaN):new Date(e)}}},Sn={domexception:{test:function(e){return"DOMException"===Ht(e)},replace:function(e){return{name:e.name,message:e.message}},revive:function(e){var t=e.message,n=e.name;return new DOMException(t,n)}}},Tn={};function An(e){Tn[e.name.toLowerCase()]={test:function(t){return Ht(t)===e.name},replace:function(e){return e.is2D?{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}:{m11:e.m11,m12:e.m12,m13:e.m13,m14:e.m14,m21:e.m21,m22:e.m22,m23:e.m23,m24:e.m24,m31:e.m31,m32:e.m32,m33:e.m33,m34:e.m34,m41:e.m41,m42:e.m42,m43:e.m43,m44:e.m44}},revive:function(t){return Object.hasOwn(t,"a")?new e([t.a,t.b,t.c,t.d,t.e,t.f]):new e([t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44])}}}"undefined"!=typeof DOMMatrix&&An(DOMMatrix),"undefined"!=typeof DOMMatrixReadOnly&&An(DOMMatrixReadOnly);var Nn={};function xn(e){Nn[e.name.toLowerCase()]={test:function(t){return Ht(t)===e.name},replace:function(e){return{x:e.x,y:e.y,z:e.z,w:e.w}},revive:function(t){var n=t.x,r=t.y,o=t.z,i=t.w;return new e(n,r,o,i)}}}"undefined"!=typeof DOMPoint&&xn(DOMPoint),"undefined"!=typeof DOMPointReadOnly&&xn(DOMPointReadOnly);var Bn={domquad:{test:function(e){return"DOMQuad"===Ht(e)},replace:function(e){return{p1:e.p1,p2:e.p2,p3:e.p3,p4:e.p4}},revive:function(e){var t=e.p1,n=e.p2,r=e.p3,o=e.p4;return new DOMQuad(t,n,r,o)}}},Fn={};function jn(e){Fn[e.name.toLowerCase()]={test:function(t){return Ht(t)===e.name},replace:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}},revive:function(t){var n=t.x,r=t.y,o=t.width,i=t.height;return new e(n,r,o,i)}}}"undefined"!=typeof DOMRect&&jn(DOMRect),"undefined"!=typeof DOMRectReadOnly&&jn(DOMRectReadOnly);var Cn={error:{test:function(e){return"Error"===Ht(e)},replace:function(e){return{name:e.name,message:e.message,cause:e.cause,stack:e.stack,fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber}},revive:function(e){var t=new Error(e.message);return t.name=e.name,t.cause=e.cause,t.stack=e.stack,t.fileName=e.fileName,t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}}},Pn={};function kn(e){Pn[e.name.toLowerCase()]={test:function(t){return Qt(t,e)},replace:function(e){return{name:e.name,message:e.message,cause:e.cause,stack:e.stack,fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber,errors:e.errors}},revive:function(t){var n="undefined"!=typeof AggregateError&&e===AggregateError?new e(t.errors,t.message):new e(t.message);return n.name=t.name,n.cause=t.cause,n.stack=t.stack,n.fileName=t.fileName,n.lineNumber=t.lineNumber,n.columnNumber=t.columnNumber,n}}}[TypeError,RangeError,SyntaxError,ReferenceError,EvalError,URIError].forEach((function(e){return kn(e)})),"undefined"!=typeof AggregateError&&kn(AggregateError),"function"==typeof InternalError&&kn(InternalError);var Rn={file:{test:function(e){return"File"===Ht(e)},replace:function(e){var t=new XMLHttpRequest;if(t.overrideMimeType("text/plain; charset=x-user-defined"),t.open("GET",URL.createObjectURL(e),!1),t.send(),200!==t.status&&0!==t.status)throw new Error("Bad File access: "+t.status);return{type:e.type,stringContents:t.responseText,name:e.name,lastModified:e.lastModified}},revive:function(e){var t=e.name,n=e.type,r=e.stringContents,o=e.lastModified;return new File([En(r)],t,{type:n,lastModified:o})},replaceAsync:function(e){return new Mt((function(t,n){var r=new FileReader;r.addEventListener("load",(function(){t({type:e.type,stringContents:mn(r.result),name:e.name,lastModified:e.lastModified})})),r.addEventListener("error",(function(){n(r.error)})),r.readAsArrayBuffer(e)}))}}},Ln={file:Rn.file,filelist:{test:function(e){return"FileList"===Ht(e)},replace:function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e.item(n);return t},revive:function(e){var t=function(){return o((function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._files=arguments[0],this.length=this._files.length}),[{key:"item",value:function(e){return this._files[e]}},{key:Symbol.toStringTag,get:function(){return"FileList"}}])}();return new t(e)}}},qn={imagebitmap:{test:function(e){return"ImageBitmap"===Ht(e)||e&&e.dataset&&"ImageBitmap"===e.dataset.toStringTag},replace:function(e){var t=document.createElement("canvas");return t.getContext("2d").drawImage(e,0,0),{width:e.width,height:e.height,dataURL:t.toDataURL()}},revive:function(e){var t="undefined"==typeof OffscreenCanvas?document.createElement("canvas"):new OffscreenCanvas(e.width,e.height),n=t.getContext("2d"),r=document.createElement("img");return r.addEventListener("load",(function(){n.drawImage(r,0,0)})),r.src=e.dataURL,"undefined"==typeof OffscreenCanvas?t:t.transferToImageBitmap()},reviveAsync:function(e){var t=document.createElement("canvas"),r=t.getContext("2d"),o=document.createElement("img");return o.addEventListener("load",(function(){r.drawImage(o,0,0)})),o.src=e.dataURL,new Mt(function(){var e=n(f().m((function e(n,r){var o,i,a;return f().w((function(e){for(;;)switch(e.n){case 0:return e.p=0,o=n,e.n=1,createImageBitmap(t);case 1:i=e.v,o(i),e.n=3;break;case 2:e.p=2,a=e.v,r(a);case 3:return e.a(2)}}),e,null,[[0,2]])})));return function(t,n){return e.apply(this,arguments)}}())}}},Un={imagedata:{test:function(e){return"ImageData"===Ht(e)},replace:function(e){return{array:p(e.data),width:e.width,height:e.height}},revive:function(e){return new ImageData(new Uint8ClampedArray(e.array),e.width,e.height)}}},Mn={infinity:{test:function(e){return e===Number.POSITIVE_INFINITY},replace:function(){return"Infinity"},revive:function(){return Number.POSITIVE_INFINITY}}},Vn={map:{test:function(e){return"Map"===Ht(e)},replace:function(e){return p(e.entries())},revive:function(e){return new Map(e)}}},Kn={nan:{test:function(e){return Number.isNaN(e)},replace:function(){return"NaN"},revive:function(){return Number.NaN}}},Gn={negativeInfinity:{test:function(e){return e===Number.NEGATIVE_INFINITY},replace:function(){return"-Infinity"},revive:function(){return Number.NEGATIVE_INFINITY}}},Hn={negativeZero:{test:function(e){return Object.is(e,-0)},replace:function(){return 0},revive:function(){return-0}}},Qn={StringObject:{test:function(e){return"String"===Ht(e)&&"object"==h(e)},replace:String,revive:function(e){return new String(e)}},BooleanObject:{test:function(e){return"Boolean"===Ht(e)&&"object"==h(e)},replace:function(e){return e.valueOf()},revive:function(e){return new Boolean(e)}},NumberObject:{test:function(e){return"Number"===Ht(e)&&"object"==h(e)},replace:Number,revive:function(e){return new Number(e)}}},Wn={regexp:{test:function(e){return"RegExp"===Ht(e)},replace:function(e){return{source:e.source,flags:(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.sticky?"y":"")+(e.unicode?"u":"")}},revive:function(e){var t=e.source,n=e.flags;return new RegExp(t,n)}}},zn={set:{test:function(e){return"Set"===Ht(e)},replace:function(e){return p(e.values())},revive:function(e){return new Set(e)}}},$n={};"function"==typeof Int8Array&&[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array].concat(p("function"==typeof BigInt64Array?[BigInt64Array,BigUint64Array]:[])).forEach((function(e){return function(e){var t=e.name;$n[t.toLowerCase()]={test:function(e){return Ht(e)===t},replace:function(e){return(0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e:e.slice(0)).buffer},revive:function(t){return"ArrayBuffer"===Ht(t)?new e(t):t}}}(e)}));var Yn={};"function"==typeof Int8Array&&[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array].concat(p("function"==typeof BigInt64Array?[BigInt64Array,BigUint64Array]:[])).forEach((function(e){return function(e){var t=e.name;Yn[t.toLowerCase()]={test:function(e){return Ht(e)===t},replace:function(e,t){var n=e.buffer,r=e.byteOffset,o=e.length;t.buffers||(t.buffers=[]);var i=t.buffers.indexOf(n);return i>-1?{index:i,byteOffset:r,length:o}:(t.buffers.push(n),{maxByteLength:n.maxByteLength,resizable:n.resizable,encoded:yn(n),byteOffset:r,length:o})},revive:function(t,n){n.buffers||(n.buffers=[]);var r,o=t.byteOffset,i=t.length,a=t.encoded,u=t.index,c=t.maxByteLength,s=t.resizable;return"index"in t?r=n.buffers[u]:(r=hn(a,s?{maxByteLength:c}:void 0),n.buffers.push(r)),new e(r,o,i)}}}(e)}));var Jn={undef:{test:function(e,t){return void 0===e&&(t.ownKeys||!("ownKeys"in t))},replace:function(){return 0},revive:function(){return new ln}}},Xn={userObject:{test:function(e){return zt(e)},replace:function(e){return l({},e)},revive:function(e){return e}}},Zn=[{arrayNonindexKeys:{testPlainObjects:!0,test:function(e,t){return!!Array.isArray(e)&&(Object.keys(e).some((function(e){return String(Number.parseInt(e))!==e}))&&(t.iterateIn="object",t.addLength=!0),!0)},replace:function(e,t){return t.iterateUnsetNumeric=!0,e},revive:function(e){if(Array.isArray(e))return e;var t=[];return Object.entries(e).forEach((function(e){var n=_(e,2),r=n[0],o=n[1];t[r]=o})),t}}},{sparseUndefined:{test:function(e,t){return void 0===e&&!1===t.ownKeys},replace:function(){return 0},revive:function(){}}}],er=[Xn,Jn,Zn,Qn,[Kn,Mn,Gn,Hn],On,Wn,Un,qn,Rn,Ln,wn,Cn,Pn].concat("function"==typeof Map?Vn:[],"function"==typeof Set?zn:[],"function"==typeof ArrayBuffer?vn:[],"function"==typeof Uint8Array?Yn:[],"function"==typeof DataView?In:[],"undefined"!=typeof crypto?Dn:[],"undefined"!=typeof BigInt?[gn,bn]:[],"undefined"!=typeof DOMException?Sn:[],"undefined"!=typeof DOMRect?Fn:[],"undefined"!=typeof DOMPoint?Nn:[],"undefined"!=typeof DOMQuad?Bn:[],"undefined"!=typeof DOMMatrix?Tn:[]).concat({checkDataCloneException:{test:function(e){var t={}.toString.call(e).slice(8,-1);if(["symbol","function"].includes(h(e))||["Arguments","Module","Promise","WeakMap","WeakSet","Event","MessageChannel"].includes(t)||e&&"object"==h(e)&&"number"==typeof e.nodeType&&"function"==typeof e.insertBefore)throw new DOMException("The object cannot be cloned.","DataCloneError");return!1}}}),tr=(new sn).register(er);function nr(e){tr=(new sn).register(e(er))}function rr(e,t){var n;try{n=tr.stringifySync(e)}catch(e){if(Qt(e,ReferenceError)||Qt(e,we))throw Ee("DataCloneError","The object cannot be cloned.");throw e}return t&&t(n),n}function or(e){return tr.parse(e)}function ir(e){return or(rr(e))}var ar=Object.freeze({__proto__:null,clone:ir,decode:or,encode:rr,register:nr}),ur=["objectStore","keyPath","multiEntry","unique"];function cr(){throw new TypeError("Illegal constructor")}var sr=cr;function lr(e,t,n,r,o,i,a,u,c,s,l,f,d){t&&(e=1),e&&u.push("LIMIT",String(e));var _="count"===i;k.DEBUG&&console.log("Trying to fetch data for Index",u.join(" "),c),s.executeSql(u.join(" "),c,(function(e,u){var c=[],s=0,l=_?function(){}:"key"===i?function(e){return st(V(e.key))}:function(e){return or(V(e.value))};if(n.multiEntry)for(var d=W(n.name),p=ct(o,n.multiEntry),y=function(){var e,n=u.rows.item(h),i=st(n[d]);if(r&&(a&&o.some((function(e){return i.includes(e)}))||at(JSON.stringify(p).slice(1,-1),n[d]))?(s++,e=n):r||a||void 0!==i&&(s+=Array.isArray(i)?i.length:1,e=n),e&&(c.push(l(e)),t))return 1},h=0;h<u.rows.length&&!y();h++);else{for(var v=0;v<u.rows.length;v++){var b=u.rows.item(v);b&&c.push(l(b))}s=c.length}f(_?s:0===s?t?void 0:[]:t?c[0]:c)}),d)}function fr(e,t,n,r,o){var i=e||!se(n),a=["SELECT",K("count"===r?"key":r)+(t.multiEntry?", "+Q(t.name):""),"FROM",H(t.objectStore.__currentName),"WHERE",Q(t.name),"NOT NULL"],u=[];if(i)if(o)a.push("AND ("),n.forEach((function(e,n){n>0&&a.push("OR"),a.push(Q(t.name),"LIKE ? ESCAPE '^' "),u.push("%"+z(ct(e,t.multiEntry))+"%")})),a.push(")");else if(t.multiEntry)a.push("AND",Q(t.name),"LIKE ? ESCAPE '^'"),Array.isArray(n)?u.push("%"+z(JSON.stringify(ct(n,t.multiEntry)).slice(1,-1))+"%"):u.push("%"+z(ct(n,t.multiEntry))+"%");else{mt(Et(n,e),Q(t.name),a,u,!0,!1)}return[e,t,i,n,r,o,a,u]}cr.__createInstance=function(e,t){function n(){var n=this;n[Symbol.toStringTag]="IDBIndex",te(n,ur),n.__objectStore=e,n.__name=n.__originalName=t.columnName,n.__keyPath=Array.isArray(t.keyPath)?t.keyPath.slice():t.keyPath;var r=t.optionalParams;n.__multiEntry=Boolean(r&&r.multiEntry),n.__unique=Boolean(r&&r.unique),n.__deleted=Boolean(t.__deleted),n.__objectStore.__cursors=t.cursors||[],Object.defineProperty(n,"__currentName",{get:function(){return"__pendingName"in n?n.__pendingName:n.name}}),Object.defineProperty(n,"name",{enumerable:!1,configurable:!1,get:function(){return this.__name},set:function(t){var n=this;t=ae(t);var r=n.name;if(Nt.__assertVersionChange(n.objectStore.transaction),Nt.__assertActive(n.objectStore.transaction),sr.__invalidStateIfDeleted(n),_r.__invalidStateIfDeleted(n),t!==r){if(n.objectStore.__indexes[t]&&!n.objectStore.__indexes[t].__deleted&&!n.objectStore.__indexes[t].__pendingDelete)throw Ee("ConstraintError",'Index "'+t+'" already exists on '+n.objectStore.__currentName);n.__name=t;var o=n.objectStore;delete o.__indexes[r],o.__indexes[t]=n,o.indexNames.splice(o.indexNames.indexOf(r),1,t);var i=o.transaction.__storeHandles[o.name],a=i.__indexHandles[r];a.__name=t,i.__indexHandles[t]=a,n.__pendingName=r;var u=[["key","BLOB "+(o.autoIncrement?"UNIQUE, inc INTEGER PRIMARY KEY AUTOINCREMENT":"PRIMARY KEY")],["value","BLOB"]].concat(p(o.indexNames).filter((function(e){return e!==t})).map((function(e){return[Q(e),"BLOB"]})));n.__renameIndex(o,r,t,u,(function(t,n){sr.__updateIndexList(e,t,(function(e){delete i.__pendingName,n(e)}))}))}}})}return n.prototype=sr.prototype,new n},cr.__invalidStateIfDeleted=function(e,t){if(e.__deleted||e.__pendingDelete||e.__pendingCreate&&e.objectStore.transaction&&e.objectStore.transaction.__errored)throw Ee("InvalidStateError",t||"This index has been deleted")},cr.__clone=function(e,t){var n=cr.__createInstance(t,{columnName:e.name,keyPath:e.keyPath,optionalParams:{multiEntry:e.multiEntry,unique:e.unique}});return["__pendingCreate","__pendingDelete","__deleted","__originalName","__recreated"].forEach((function(t){n[t]=e[t]})),n},cr.__createIndex=function(e,t){var n=t.name,r=e.__currentName,o=e.__indexes[n];t.__pendingCreate=!0,e.indexNames.push(n),e.__indexes[n]=t;var i=e.__indexHandles[n];(!i||t.__pendingDelete||t.__deleted||i.__pendingDelete||i.__deleted)&&(i=e.__indexHandles[n]=cr.__clone(t,e)),e.transaction.__addNonRequestToTransactionQueue((function(a,u,c,s){var l=o&&(o.__deleted||o.__recreated),f={};function d(e,t){s(Ee("UnknownError",'Could not create index "'+n+'"'+t.code+"::"+t.message,t))}function _(o){cr.__updateIndexList(e,o,(function(){o.executeSql('SELECT "key", "value" FROM '+H(r),[],(function(o,a){k.DEBUG&&console.log("Adding existing "+r+" records to the "+n+" index"),function u(l){if(l<a.rows.length)try{var _=tt(or(V(a.rows.item(l).value)),t.keyPath,t.multiEntry);if("invalid"in _&&_.invalid||"failure"in _&&_.failure)throw new Error("Go to catch; ignore bad indexKey");var p=ct(_.value,t.multiEntry);if(t.unique){if(f[p])return f={},void s(Ee("ConstraintError","Duplicate values already exist within the store"));f[p]=!0}o.executeSql("UPDATE "+H(r)+" SET "+Q(n)+' = ? WHERE "key" = ?',[M(p),a.rows.item(l).key],(function(){u(l+1)}),d)}catch(e){u(l+1)}else delete t.__pendingCreate,delete i.__pendingCreate,t.__deleted&&(delete t.__deleted,delete i.__deleted,t.__recreated=!0,i.__recreated=!0),f={},c(e)}(0)}),d)}),d)}var p=H(r),y=Q(t.name);if(l)_(a);else{var h=["ALTER TABLE",p,"ADD",y,"BLOB"].join(" ");k.DEBUG&&console.log(h),a.executeSql(h,[],(function(e){k.useSQLiteIndexes?e.executeSql('CREATE INDEX IF NOT EXISTS "'+p.slice(1,-1)+"^5"+y.slice(1,-1)+'" ON '+p+"("+y+")",[],_,d):_(e)}),d)}}))},cr.__deleteIndex=function(e,t){t.__pendingDelete=!0;var n=e.__indexHandles[t.name];n&&(n.__pendingDelete=!0),e.indexNames.splice(e.indexNames.indexOf(t.name),1),e.transaction.__addNonRequestToTransactionQueue((function(r,o,i,a){function u(e,n){a(Ee("UnknownError",'Could not delete index "'+t.name+'"',n))}function c(){cr.__updateIndexList(e,r,(function(e){delete t.__pendingDelete,delete t.__recreated,t.__deleted=!0,n&&(n.__deleted=!0,delete n.__pendingDelete),i(e)}),u)}k.useSQLiteIndexes?r.executeSql("DROP INDEX IF EXISTS "+K(H(e.name).slice(1,-1)+"^5"+Q(t.name).slice(1,-1)),[],c,u):c()}))},cr.__updateIndexList=function(e,t,n,r){for(var o={},i=0;i<e.indexNames.length;i++){var a=e.__indexes[e.indexNames[i]];o[a.name]={columnName:a.name,keyPath:a.keyPath,optionalParams:{unique:a.unique,multiEntry:a.multiEntry},deleted:Boolean(a.__deleted)}}k.DEBUG&&console.log("Updating the index list for "+e.__currentName,o),t.executeSql('UPDATE __sys__ SET "indexList" = ? WHERE "name" = ?',[JSON.stringify(o),M(e.__currentName)],(function(){n(e)}),r)},cr.prototype.__fetchIndexData=function(e,t,n,r){var o=this;if(void 0!==r&&(r=ie(r,"unsigned long")),cr.__invalidStateIfDeleted(o),_r.__invalidStateIfDeleted(o.objectStore),o.objectStore.__deleted)throw Ee("InvalidStateError","This index's object store has been deleted");if(Nt.__assertActive(o.objectStore.transaction),n&&se(e))throw Ee("DataError","No key or range was specified");var i=fr(n,o,e,t,!1);return o.objectStore.transaction.__addToTransactionQueue((function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];lr.apply(void 0,[r].concat(p(i),t))}),void 0,o)},cr.prototype.openCursor=function(){var e=this,t=Array.prototype.slice.call(arguments),n=t[0],r=t[1],o=Wr.__createInstance(n,r,e.objectStore,e,W(e.name),"value");return e.__objectStore.__cursors.push(o),o.__request},cr.prototype.openKeyCursor=function(){var e=this,t=Array.prototype.slice.call(arguments),n=t[0],r=t[1],o=Gr.__createInstance(n,r,e.objectStore,e,W(e.name),"key");return e.__objectStore.__cursors.push(o),o.__request},cr.prototype.get=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBIndex.get`.");return this.__fetchIndexData(e,"value",!0)},cr.prototype.getKey=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBIndex.getKey`.");return this.__fetchIndexData(e,"key",!0)},cr.prototype.getAll=function(){var e=Array.prototype.slice.call(arguments),t=e[0],n=e[1];return this.__fetchIndexData(t,"value",!1,n)},cr.prototype.getAllKeys=function(){var e=Array.prototype.slice.call(arguments),t=e[0],n=e[1];return this.__fetchIndexData(t,"key",!1,n)},cr.prototype.count=function(){var e=this,t=arguments[0];return $(t,bt)?Wr.__createInstance(t,"next",e.objectStore,e,W(e.name),"value",!0).__request:e.__fetchIndexData(t,"count",!1)},cr.prototype.__renameIndex=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=e.__currentName,a=H(i),u=Q(n),c=K("tmp_"+H(i).slice(1,-1)),s=r.map((function(e){return e[0]})),l=r.map((function(e){return e.join(" ")})),f=l.length?l.join(", ")+", ":"",d=s.length?s.join(", ")+", ":"";e.transaction.__addNonRequestToTransactionQueue((function(e,n,r,i){function l(e,t){i(t)}function _(){o?o(e,r):r()}var p="CREATE TABLE "+c+"("+f+u+" BLOB)";k.DEBUG&&console.log(p),e.executeSql(p,[],(function(){var n="INSERT INTO "+c+"("+d+u+") SELECT "+d+Q(t)+" FROM "+a;k.DEBUG&&console.log(n),e.executeSql(n,[],(function(){var t="DROP TABLE "+a;k.DEBUG&&console.log(t),e.executeSql(t,[],(function(){var t="ALTER TABLE "+c+" RENAME TO "+a;k.DEBUG&&console.log(t),e.executeSql(t,[],(function(e){if(k.useSQLiteIndexes){var t=s.slice(2).map((function(t){return new Pe((function(n,r){var o="CREATE INDEX "+K(a.slice(1,-1)+"^5"+t.slice(1,-1))+" ON "+a+"("+t+")";k.DEBUG&&console.log(o),e.executeSql(o,[],n,(function(e,t){r(t)}))}))}));t.push(new Pe((function(t,n){var r=K("sk_"+a.slice(1,-1)),o="DROP INDEX IF EXISTS "+r;k.DEBUG&&console.log(o),e.executeSql(o,[],(function(){var o="CREATE INDEX "+r+" ON "+a+'("key")';k.DEBUG&&console.log(o),e.executeSql(o,[],t,(function(e,t){n(t)}))}),(function(e,t){n(t)}))}))),Pe.all(t).then(_,i).catch((function(e){throw console.log("Index rename error"),e}))}else _()}),l)}),l)}),l)}),l)}))},Object.defineProperty(cr,Symbol.hasInstance,{value:function(e){return Y(e)&&"openCursor"in e&&"function"==typeof e.openCursor&&"multiEntry"in e&&"boolean"==typeof e.multiEntry}}),Z(cr.prototype,ur),X(cr.prototype,["name"]),cr.prototype[Symbol.toStringTag]="IDBIndexPrototype",Object.defineProperty(cr,"prototype",{writable:!1});var dr=["keyPath","indexNames","transaction","autoIncrement"];function _r(){throw new TypeError("Illegal constructor")}var pr=_r;function yr(e,t){for(var n=0,r=e.length-1;r>=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}_r.__createInstance=function(e,t){function n(){var n=this;n[Symbol.toStringTag]="IDBObjectStore",te(this,dr),n.__name=n.__originalName=e.name,n.__keyPath=Array.isArray(e.keyPath)?e.keyPath.slice():e.keyPath,n.__transaction=t,n.__idbdb=e.idbdb,n.__cursors=e.cursors||[],n.__autoIncrement=Boolean(e.autoInc),n.__indexes={},n.__indexHandles={},n.__indexNames=It.__createInstance();var r=e.indexList;for(var o in r)if(Object.hasOwn(r,o)){var i=cr.__createInstance(n,r[o]);n.__indexes[i.name]=i,i.__deleted||n.indexNames.push(i.name)}n.__oldIndexNames=n.indexNames.clone(),Object.defineProperty(this,"__currentName",{get:function(){return"__pendingName"in this?this.__pendingName:this.name}}),Object.defineProperty(this,"name",{enumerable:!1,configurable:!1,get:function(){return this.__name},set:function(e){var t=this;e=ae(e);var n=t.name;if(pr.__invalidStateIfDeleted(t),Nt.__assertVersionChange(t.transaction),Nt.__assertActive(t.transaction),n!==e){if(t.__idbdb.__objectStores[e]&&!t.__idbdb.__objectStores[e].__pendingDelete)throw Ee("ConstraintError",'Object store "'+e+'" already exists in '+t.__idbdb.name);t.__name=e;var r=t.__idbdb.__objectStores[n];r.__name=e,t.__idbdb.__objectStores[e]=r,delete t.__idbdb.__objectStores[n],t.__idbdb.objectStoreNames.splice(t.__idbdb.objectStoreNames.indexOf(n),1,e);var o=t.transaction.__storeHandles[n];o.__name=e,t.transaction.__storeHandles[e]=o,t.__pendingName=n;var i='UPDATE __sys__ SET "name" = ? WHERE "name" = ?',a=[M(e),M(n)];k.DEBUG&&console.log(i,a),t.transaction.__addNonRequestToTransactionQueue((function(r,o,u,c){r.executeSql(i,a,(function(r){var o="ALTER TABLE "+H(n)+" RENAME TO "+H(e);k.DEBUG&&console.log(o),r.executeSql(o,[],(function(){delete t.__pendingName,u()}))}),(function(e,t){return c(t),!1}))}))}}})}return n.prototype=pr.prototype,new n},_r.__clone=function(e,t){var n=_r.__createInstance({name:e.__currentName,keyPath:Array.isArray(e.keyPath)?e.keyPath.slice():e.keyPath,autoInc:e.autoIncrement,indexList:{},idbdb:e.__idbdb,cursors:e.__cursors},t);return["__indexes","__indexNames","__oldIndexNames","__deleted","__pendingDelete","__pendingCreate","__originalName"].forEach((function(t){n[t]=e[t]})),n},_r.__invalidStateIfDeleted=function(e,t){if(e.__deleted||e.__pendingDelete||e.__pendingCreate&&"transaction"in e&&e.transaction&&e.transaction.__errored)throw Ee("InvalidStateError",t||"This store has been deleted")},_r.__createObjectStore=function(e,t){var n=t.__currentName;t.__pendingCreate=!0,e.__objectStores[n]=t,e.objectStoreNames.push(n);var r=e.__versionTransaction,o=r.__storeHandles;return(!o[n]||o[n].__pendingDelete||o[n].__deleted)&&(o[n]=_r.__clone(t,r)),r.__addNonRequestToTransactionQueue((function(e,r,o,i){function a(e,t){return k.DEBUG&&console.log(t),i(Ee("UnknownError",'Could not create object store "'+n+'"',t)),!1}var u=H(n),c=["CREATE TABLE",u,"(key BLOB",t.autoIncrement?"UNIQUE, inc INTEGER PRIMARY KEY AUTOINCREMENT":"PRIMARY KEY",", value BLOB)"].join(" ");k.DEBUG&&console.log(c),e.executeSql(c,[],(function(e){function r(){var r=JSON.stringify(t.keyPath);e.executeSql("INSERT INTO __sys__ VALUES (?,?,?,?,?)",[M(n),r,Number(t.autoIncrement),"{}",1],(function(){delete t.__pendingCreate,delete t.__deleted,o(t)}),a)}k.useSQLiteIndexes?e.executeSql("CREATE INDEX IF NOT EXISTS "+K("sk_"+u.slice(1,-1))+" ON "+u+'("key")',[],r,a):r()}),a)})),o[n]},_r.__deleteObjectStore=function(e,t){t.__pendingDelete=!0,t.__indexNames=It.__createInstance(),e.objectStoreNames.splice(e.objectStoreNames.indexOf(t.__currentName),1);var n=e.__versionTransaction.__storeHandles[t.__currentName];n&&(n.__indexNames=It.__createInstance(),n.__pendingDelete=!0),e.__versionTransaction.__addNonRequestToTransactionQueue((function(e,r,o,i){function a(e,t){return k.DEBUG&&console.log(t),i(Ee("UnknownError","Could not delete ObjectStore",t)),!1}e.executeSql('SELECT "name" FROM __sys__ WHERE "name" = ?',[M(t.__currentName)],(function(e,r){r.rows.length>0&&e.executeSql("DROP TABLE "+H(t.__currentName),[],(function(){e.executeSql('DELETE FROM __sys__ WHERE "name" = ?',[M(t.__currentName)],(function(){delete t.__pendingDelete,t.__deleted=!0,n&&(delete n.__pendingDelete,n.__deleted=!0),o()}),a)}),a)}))}))},_r.prototype.__validateKeyAndValueAndCloneValue=function(e,t,n){var r=this;if(null!==r.keyPath){if(void 0!==t)throw Ee("DataError","The object store uses in-line keys and the key parameter was provided");var o=ir(e);if((t=tt(o,r.keyPath)).invalid)throw Ee("DataError","KeyPath was specified, but key was invalid.");if(t.failure){if(!n){if(!r.autoIncrement)throw Ee("DataError","Could not evaluate a key from keyPath and there is no key generator");if(!ot(o,r.keyPath))throw Ee("DataError","A key could not be injected into a value");return[void 0,o]}throw Ee("DataError","Could not evaluate a key from keyPath")}return[t.value,o]}if(void 0===t){if(!r.autoIncrement)throw Ee("DataError","The object store uses out-of-line keys and has no key generator and the key parameter was not provided.");t=void 0}else et(t);return[t,ir(e)]},_r.prototype.__deriveKey=function(e,t,n,r,o){var i=this;function a(e){rr(n,(function(t){t=or(t),r(t,e)}))}i.autoIncrement?void 0===n?yt(e,i,(function(e,n,a){e?o(Ee("ConstraintError","The key generator's current number has reached the maximum safe integer limit")):(null!==i.keyPath&&rt(t,n,i.keyPath),r(n,a))}),o):ht(e,i,n,a,o):a()},_r.prototype.__insertData=function(e,t,n,r,o,i,a){var u=this,c={},s=Object.keys(u.__indexes).map((function(t){return new Pe((function(r,o){var i=u.__indexes[t];if(i.__pendingCreate||i.__deleted)r(void 0);else{var a;try{if("invalid"in(a=tt(n,i.keyPath,i.multiEntry))&&a.invalid||"failure"in a&&a.failure)throw new Error("Go to catch")}catch(e){return void r(void 0)}if(a=a.value,i.unique){var s=i.multiEntry&&Array.isArray(a),l=fr(!0,i,a,"key",s);lr.apply(void 0,[null].concat(p(l),[e,null,function(e){if(void 0===e)return f(i),void r(void 0);o(Ee("ConstraintError","Index already contains a record equal to "+(s?"one of the subkeys of":"")+"`indexKey`"))},o]))}else f(i),r(void 0)}function f(e){void 0!==a&&(c[e.__currentName]=ct(a,e.multiEntry))}}))}));return Pe.all(s).then((function(){var n=["INSERT INTO",H(u.__currentName),"("],o=[" VALUES ("],s=[];void 0!==r&&(n.push(K("key"),","),o.push("?,"),s.push(M(ct(r)))),Object.entries(c).forEach((function(e){var t=_(e,2),r=t[0],i=t[1];n.push(Q(r)+","),o.push("?,"),s.push(M(i))})),n.push(K("value")+" )"),o.push("?)"),s.push(M(t));var l=n.join(" ")+o.join(" ");k.DEBUG&&console.log("SQL for adding",l,s),e.executeSql(l,s,(function(){i(r)}),(function(e,t){return a(Ee("ConstraintError",t.message,t)),!1}))})).catch((function(t){function n(){a(t)}return"number"==typeof o?(_t(e,u,o,n,n),null):(n(),null)}))},_r.prototype.add=function(e){var t=this,n=arguments[1];if(!(t instanceof _r))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No value was specified");_r.__invalidStateIfDeleted(t),Nt.__assertActive(t.transaction),t.transaction.__assertWritable();var r=t.transaction.__createRequest(t),o=_(t.__validateKeyAndValueAndCloneValue(e,n,!1),2),i=o[0],a=o[1];return _r.__storingRecordObjectStore(r,t,!0,a,!0,i),r},_r.prototype.put=function(e){var t=this,n=arguments[1];if(!(t instanceof _r))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No value was specified");_r.__invalidStateIfDeleted(t),Nt.__assertActive(t.transaction),t.transaction.__assertWritable();var r=t.transaction.__createRequest(t),o=_(t.__validateKeyAndValueAndCloneValue(e,n,!1),2),i=o[0],a=o[1];return _r.__storingRecordObjectStore(r,t,!0,a,!1,i),r},_r.prototype.__overwrite=function(e,t,n,r){var o="DELETE FROM "+H(this.__currentName)+' WHERE "key" = ?',i=ct(t);e.executeSql(o,[M(i)],(function(e,r){k.DEBUG&&console.log("Did the row with the",t,"exist?",r.rowsAffected),n(e)}),(function(e,t){return r(t),!1}))},_r.__storingRecordObjectStore=function(e,t,n,r,o){var i=arguments[5];t.transaction.__pushToQueue(e,(function(e,a,u,c){t.__deriveKey(e,r,i,(function(i,a){rr(r,(function(s){function l(e){t.__insertData(e,s,r,i,a,(function(){n&&t.__cursors.forEach((function(e){e.__invalidateCache()})),u.apply(void 0,arguments)}),c)}o?l(e):t.__overwrite(e,i,l,c)}))}),c)}))},_r.prototype.__get=function(e,t,n,r){var o=this;void 0!==r&&(r=ie(r,"unsigned long")),_r.__invalidStateIfDeleted(o),Nt.__assertActive(o.transaction);var i=Et(e,!n),a=["SELECT",K(t?"key":"value"),"FROM",H(o.__currentName)],u=[];if(void 0!==i&&(a.push("WHERE"),mt(i,K("key"),a,u)),n||(r=1),r){if(!Number.isFinite(r))throw new TypeError("The count parameter must be a finite number");a.push("LIMIT",String(r))}var c=a.join(" ");return o.transaction.__addToTransactionQueue((function(e,r,i,a){k.DEBUG&&console.log("Fetching",o.__currentName,u),e.executeSql(c,u,(function(e,r){var o;k.DEBUG&&console.log("Fetched data",r);try{if(0===r.rows.length)return void(n?i([]):i());if(o=[],t)for(var a=0;a<r.rows.length;a++)o.push(st(V(r.rows.item(a).key),!1));else for(var u=0;u<r.rows.length;u++)o.push(or(V(r.rows.item(u).value)));n||(o=o[0])}catch(e){k.DEBUG&&console.log(e)}i(o)}),(function(e,t){return a(t),!1}))}),void 0,o)},_r.prototype.get=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBObjectStore.get`.");return this.__get(e)},_r.prototype.getKey=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBObjectStore.getKey`.");return this.__get(e,!0)},_r.prototype.getAll=function(){var e=Array.prototype.slice.call(arguments),t=e[0],n=e[1];return this.__get(t,!1,!0,n)},_r.prototype.getAllKeys=function(){var e=Array.prototype.slice.call(arguments),t=e[0],n=e[1];return this.__get(t,!0,!0,n)},_r.prototype.delete=function(e){var t=this;if(!(this instanceof _r))throw new TypeError("Illegal invocation");if(!arguments.length)throw new TypeError("A parameter was missing for `IDBObjectStore.delete`.");_r.__invalidStateIfDeleted(t),Nt.__assertActive(t.transaction),t.transaction.__assertWritable();var n=Et(e,!0),r=["DELETE FROM",H(t.__currentName),"WHERE"],o=[];mt(n,K("key"),r,o);var i=r.join(" ");return t.transaction.__addToTransactionQueue((function(e,n,r,a){k.DEBUG&&console.log("Deleting",t.__currentName,o),e.executeSql(i,o,(function(e,n){k.DEBUG&&console.log("Deleted from database",n.rowsAffected),t.__cursors.forEach((function(e){e.__invalidateCache()})),r()}),(function(e,t){return a(t),!1}))}),void 0,t)},_r.prototype.clear=function(){var e=this;if(!(this instanceof _r))throw new TypeError("Illegal invocation");return _r.__invalidStateIfDeleted(e),Nt.__assertActive(e.transaction),e.transaction.__assertWritable(),e.transaction.__addToTransactionQueue((function(t,n,r,o){t.executeSql("DELETE FROM "+H(e.__currentName),[],(function(t,n){k.DEBUG&&console.log("Cleared all records from database",n.rowsAffected),e.__cursors.forEach((function(e){e.__invalidateCache()})),r()}),(function(e,t){return o(t),!1}))}),void 0,e)},_r.prototype.count=function(){var e=this,t=arguments[0];if(!(e instanceof _r))throw new TypeError("Illegal invocation");return _r.__invalidStateIfDeleted(e),Nt.__assertActive(e.transaction),Wr.__createInstance(t,"next",e,e,"key","value",!0).__request},_r.prototype.openCursor=function(){var e=this,t=Array.prototype.slice.call(arguments),n=t[0],r=t[1];if(!(e instanceof _r))throw new TypeError("Illegal invocation");_r.__invalidStateIfDeleted(e);var o=Wr.__createInstance(n,r,e,e,"key","value");return e.__cursors.push(o),o.__request},_r.prototype.openKeyCursor=function(){var e=this;if(!(e instanceof _r))throw new TypeError("Illegal invocation");_r.__invalidStateIfDeleted(e);var t=Array.prototype.slice.call(arguments),n=t[0],r=t[1],o=Gr.__createInstance(n,r,e,e,"key","key");return e.__cursors.push(o),o.__request},_r.prototype.index=function(e){var t=this;if(!(t instanceof _r))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No index name was specified");_r.__invalidStateIfDeleted(t),Nt.__assertNotFinished(t.transaction);var n=t.__indexes[e];if(!n||n.__deleted)throw Ee("NotFoundError",'Index "'+e+'" does not exist on '+t.__currentName);return(!t.__indexHandles[e]||t.__indexes[e].__pendingDelete||t.__indexes[e].__deleted)&&(t.__indexHandles[e]=cr.__clone(n,t)),t.__indexHandles[e]},_r.prototype.createIndex=function(e,t){var n=this,r=arguments[2];if(!(n instanceof _r))throw new TypeError("Illegal invocation");if(e=String(e),0===arguments.length)throw new TypeError("No index name was specified");if(1===arguments.length)throw new TypeError("No key path was specified");if(Nt.__assertVersionChange(n.transaction),_r.__invalidStateIfDeleted(n),Nt.__assertActive(n.transaction),n.__indexes[e]&&!n.__indexes[e].__deleted&&!n.__indexes[e].__pendingDelete)throw Ee("ConstraintError",'Index "'+e+'" already exists on '+n.__currentName);if(!oe(t=ce(t)))throw Ee("SyntaxError","A valid keyPath must be supplied");if(Array.isArray(t)&&r&&r.multiEntry)throw Ee("InvalidAccessError","The keyPath argument was an array and the multiEntry option is true.");r=r||{};var o={columnName:e,keyPath:t,optionalParams:{unique:Boolean(r.unique),multiEntry:Boolean(r.multiEntry)}},i=cr.__createInstance(n,o);return cr.__createIndex(n,i),i},_r.prototype.deleteIndex=function(e){var t=this;if(!(t instanceof _r))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No index name was specified");Nt.__assertVersionChange(t.transaction),_r.__invalidStateIfDeleted(t),Nt.__assertActive(t.transaction);var n=t.__indexes[e];if(!n)throw Ee("NotFoundError",'Index "'+e+'" does not exist on '+t.__currentName);cr.__deleteIndex(t,n)},Z(_r.prototype,dr),X(_r.prototype,["name"]),_r.prototype[Symbol.toStringTag]="IDBObjectStorePrototype",Object.defineProperty(_r,"prototype",{writable:!1});var hr=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,vr=function(e){return hr.exec(e).slice(1)};function br(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:"/";if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(e=r+"/"+e,t="/"===r.charAt(0))}return e=yr(wr(e.split("/"),(function(e){return!!e})),!t).join("/"),(t?"/":"")+e||"."}function gr(e){var t=mr(e),n="/"===Dr(e,-1);return e=yr(wr(e.split("/"),(function(e){return!!e})),!t).join("/"),e||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e}function mr(e){return"/"===e.charAt(0)}var Er={extname:function(e){return vr(e)[3]},basename:function(e,t){var n=vr(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},dirname:function(e){var t=vr(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},sep:"/",delimiter:":",relative:function(e,t){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=br(e).substr(1),t=br(t).substr(1);for(var r=n(e.split("/")),o=n(t.split("/")),i=Math.min(r.length,o.length),a=i,u=0;u<i;u++)if(r[u]!==o[u]){a=u;break}var c=[];for(u=a;u<r.length;u++)c.push("..");return(c=c.concat(o.slice(a))).join("/")},join:function(){return gr(wr(Array.prototype.slice.call(arguments,0),(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},isAbsolute:mr,normalize:gr,resolve:br};function wr(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}var Dr="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)},Ir=["onabort","onclose","onerror","onversionchange"],Or=["name","version","objectStoreNames"];function Sr(){throw this.__versionTransaction=null,this.__objectStores=null,this.__transactions=[],new TypeError("Illegal constructor")}var Tr,Ar=Sr;Sr.__createInstance=function(e,t,n,r,o){function i(){var i=this;this[Symbol.toStringTag]="IDBDatabase",te(this,Or),this.__db=e,this.__closePending=!1,this.__oldVersion=n,this.__version=r,this.__name=t,this.__upgradeTransaction=null,ee(this,Ir),this.__setOptions({legacyOutputDidListenersThrowFlag:!0}),this.__transactions=[],this.__objectStores={},this.__objectStoreNames=It.__createInstance();for(var a={},u=function(){var e=o.rows.item(c);a.name=e.name,a.keyPath=JSON.parse(e.keyPath),["autoInc","indexList"].forEach((function(t){a[t]=JSON.parse(e[t])})),a.idbdb=i;var t=_r.__createInstance(a);i.__objectStores[t.name]=t,i.objectStoreNames.push(t.name)},c=0;c<o.rows.length;c++)u();this.__oldObjectStoreNames=this.objectStoreNames.clone()}return i.prototype=Ar.prototype,new i},Sr.prototype=F.createInstance(),Sr.prototype[Symbol.toStringTag]="IDBDatabasePrototype",Sr.prototype.createObjectStore=function(e){var t=arguments[1];if(e=String(e),!(this instanceof Sr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No object store name was specified");Nt.__assertVersionChange(this.__versionTransaction),this.throwIfUpgradeTransactionNull(),Nt.__assertActive(this.__versionTransaction);var n=(t=l({},t)).keyPath;if(null!==(n=void 0===n?null:ce(n))&&!oe(n))throw Ee("SyntaxError","The keyPath argument contains an invalid key path.");if(this.__objectStores[e]&&!this.__objectStores[e].__pendingDelete)throw Ee("ConstraintError",'Object store "'+e+'" already exists in '+this.name);var r=t.autoIncrement;if(r&&(""===n||Array.isArray(n)))throw Ee("InvalidAccessError","With autoIncrement set, the keyPath argument must not be an array or empty string.");var o={name:e,keyPath:n,autoInc:r,indexList:{},idbdb:this},i=_r.__createInstance(o,this.__versionTransaction);return _r.__createObjectStore(this,i)},Sr.prototype.deleteObjectStore=function(e){if(!(this instanceof Sr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No object store name was specified");Nt.__assertVersionChange(this.__versionTransaction),this.throwIfUpgradeTransactionNull(),Nt.__assertActive(this.__versionTransaction);var t=this.__objectStores[e];if(!t)throw Ee("NotFoundError",'Object store "'+e+'" does not exist in '+this.name);_r.__deleteObjectStore(this,t)},Sr.prototype.close=function(){if(!(this instanceof Sr))throw new TypeError("Illegal invocation");this.__closePending=!0,this.__unblocking&&this.__unblocking.check(),this.__transactions=[]},Sr.prototype.transaction=function(e){var t=this;if(0===arguments.length)throw new TypeError("You must supply a valid `storeNames` to `IDBDatabase.transaction`");var n=arguments[1];if(e=J(e)?p(new Set(ce(e))).sort():[ae(e)],n=n||"readonly",Nt.__assertNotVersionChange(this.__versionTransaction),this.__closePending)throw Ee("InvalidStateError","An attempt was made to start a new transaction on a database connection that is not open");var r=It.__createInstance();if(e.forEach((function(e){if(!t.objectStoreNames.contains(e))throw Ee("NotFoundError",'The "'+e+'" object store does not exist');r.push(e)})),0===e.length)throw Ee("InvalidAccessError","No valid object store names were specified");if("readonly"!==n&&"readwrite"!==n)throw new TypeError("Invalid transaction mode: "+n);var o=Nt.__createInstance(this,r,n);return this.__transactions.push(o),o},Sr.prototype.throwIfUpgradeTransactionNull=function(){if(null===this.__upgradeTransaction)throw Ee("InvalidStateError","No upgrade transaction associated with database.")},Sr.prototype.__forceClose=function(e){var t=this;t.close();var n=0;t.__transactions.forEach((function(r){r.on__abort=function(){if(++n===t.__transactions.length){var e=le("close");setTimeout((function(){t.dispatchEvent(e)}))}},r.__abortTransaction(Ee("AbortError","The connection was force-closed: "+(e||"")))})),t.__transactions=[]},X(Sr.prototype,Ir),Z(Sr.prototype,Or),Object.defineProperty(Sr.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:Sr}),Object.defineProperty(Sr,"prototype",{writable:!1});var Nr=function(){return"object"===("undefined"==typeof location?"undefined":h(location))&&location?location.origin:"null"},xr=function(){return!1!==k.checkOrigin&&"null"===Nr()},Br={};function Fr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Nr(),n=Br[t][e];if(n[0]){var r=n[0],o=r.req,i=r.cb;o.addEventListener("success",a),o.addEventListener("error",a),o.addEventListener("blocked",a),i(o)}function a(){n.shift(),Fr(e,t)}}function jr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Nr(),r=arguments.length>3?arguments[3]:void 0;Br[n][t]||(Br[n][t]=[]),Br[n][t].push({req:e,cb:r}),1===Br[n][t].length&&Fr(t,n)}function Cr(e,t,n,r){var o=function(e){return e.__closePending},i=function(){return e.every((function(e){return o(e)}))};return e.reduce((function(e,t){return o(t)?e:e.then((function(){if(!o(t)){var e=new fe("versionchange",{oldVersion:n,newVersion:r});return new Pe((function(n){setTimeout((function(){t.dispatchEvent(e),n(void 0)}))}))}}))}),Pe.resolve(void 0)).then((function(){if(!i())return new Pe((function(a){var u={check:function(){i()&&a(void 0)}},c=new fe("blocked",{oldVersion:n,newVersion:r});setTimeout((function(){t.dispatchEvent(c),i()?a(void 0):e.forEach((function(e){o(e)||(e.__unblocking=u)}))}))}))}))}var Pr,kr={},Rr=0;function Lr(e){return Object.keys(kr[e]).map(Number).reduce((function(e,t){return Math.max(t,e)}),0)}function qr(e,t,n,r,o){if("string"==typeof k.memoryDatabase){var i=kr[t]?function(e){return kr[e]&&kr[e][Lr(e)]}(t):null;if(!i)return console.warn("Could not find a memory database instance to delete."),void r();var a=i._db&&i._db._db;return a&&a.close?void a.close((function(e){e?console.warn("Error closing (destroying) memory database"):r()})):void console.error("The `openDatabase` implementation does not have the expected `._db._db.close` method for closing the database")}Tr&&!1!==k.deleteDatabaseFiles?Tr.unlink(Er.join(k.databaseBasePath||"",n),(function(e){e&&"ENOENT"!==e.code?o({code:0,message:"Error removing database file: "+n+" "+e}):r()})):e(Er.join(k.databaseBasePath||"",n),"1",t,k.DEFAULT_DB_SIZE).transaction((function(e){e.executeSql('SELECT "name" FROM __sys__',[],(function(e,t){var n=t.rows;!function t(i){i>=n.length?e.executeSql("DROP TABLE IF EXISTS __sys__",[],(function(){r()}),o):e.executeSql("DROP TABLE "+H(V(n.item(i).name)),[],(function(){t(i+1)}),(function(){return t(i+1),!1}))}(0)}),(function(){return r(),!1}))}))}function Ur(e,t,n){function r(e,t){var r=be(t||e);k.DEBUG&&console.log("Error in sysdb transaction - when creating dbVersions",t),n(r)}Pr?t():(Pr=e("string"==typeof k.memoryDatabase?k.memoryDatabase:Er.join("string"==typeof k.sysDatabaseBasePath?k.sysDatabaseBasePath:k.databaseBasePath||"","__sysdb__"+(!1!==k.addSQLiteExtension?".sqlite":"")),"1","System Database",k.DEFAULT_DB_SIZE)).transaction((function(e){e.executeSql("CREATE TABLE IF NOT EXISTS dbVersions (name BLOB, version INT);",[],(function(e){k.useSQLiteIndexes?e.executeSql("CREATE INDEX IF NOT EXISTS dbvname ON dbVersions(name)",[],t,r):t()}),r)}),r)}function Mr(){throw new TypeError("Illegal constructor")}var Vr=Mr;Mr.__createInstance=function(){function e(){this[Symbol.toStringTag]="IDBFactory",this.__connections={}}return e.prototype=Vr.prototype,new e},Mr.prototype.open=function(e){var t=this;if(!(t instanceof Mr))throw new TypeError("Illegal invocation");var n=arguments[1];if(0===arguments.length)throw new TypeError("Database name is required");if(void 0!==n&&0===(n=ie(n,"unsigned long long")))throw new TypeError("Version cannot be 0");if(xr())throw Ee("SecurityError","Cannot open an IndexedDB database from an opaque origin.");var r=Ae.__createInstance(),o=!1;k.autoName&&""===e&&(e="autoNamedDatabase_"+Rr++);var i,a=M(e=String(e)),u="string"==typeof k.memoryDatabase,c=!1!==k.cacheDatabaseInstances||u;try{i=G(e)}catch(e){throw e}function s(e,t){if(o)return!1;var n=t?be(t):e;o=!0;var i=le("error",n,{bubbles:!0,cancelable:!0});return r.__done=!0,r.__error=n,r.__result=void 0,r.dispatchEvent(i),!1}function l(o){var l;if((u||c)&&e in kr&&kr[e][n]?l=kr[e][n]:(l=t.__openDatabase(u?k.memoryDatabase:Er.join(k.databaseBasePath||"",i),"1",e,k.DEFAULT_DB_SIZE),c&&(e in kr||(kr[e]={}),kr[e][n]=l)),void 0===n&&(n=o||1),o>n){var f=Ee("VersionError","An attempt was made to open a database using a lower version than the existing version.",n);c?setTimeout((function(){s(f)})):s(f)}else l.transaction((function(u){u.executeSql("CREATE TABLE IF NOT EXISTS __sys__ (name BLOB, keyPath BLOB, autoInc BOOLEAN, indexList BLOB, currNum INTEGER)",[],(function(){function f(){!function(o,u,l){o.executeSql('SELECT "name", "keyPath", "autoInc", "indexList" FROM __sys__',[],(function(o,f){function d(){r.__result=_,r.__done=!0}var _=Sr.__createInstance(u,e,l,n,f);if(t.__connections[e]||(t.__connections[e]=[]),t.__connections[e].push(_),l<n)Cr(t.__connections[e].slice(0,-1),r,l,n).then((function(){var o=function(e,t,n){if(t)try{e.executeSql("ROLLBACK",[],n,n)}catch(t){Pr.transaction((function(e){function t(e){throw new Error("Unable to roll back upgrade transaction!"+(e||""))}0===l?e.executeSql('DELETE FROM dbVersions WHERE "name" = ?',[a],(function(){n(t)}),t):e.executeSql('UPDATE dbVersions SET "version" = ? WHERE "name" = ?',[l,a],n,t)}))}else n()};Pr.transaction((function(u){function f(){var a=new fe("upgradeneeded",{oldVersion:l,newVersion:n});r.__result=_,_.__upgradeTransaction=r.__transaction=r.__result.__versionTransaction=Nt.__createInstance(r.__result,r.__result.objectStoreNames,"versionchange"),r.__done=!0,r.transaction.__addNonRequestToTransactionQueue((function(e,t,n){if(r.dispatchEvent(a),a.__legacyOutputDidListenersThrowError)return he("Error","An error occurred in an upgradeneeded handler attached to request chain",a.__legacyOutputDidListenersThrowError),void r.transaction.__abortTransaction(Ee("AbortError","A request was aborted."));n()})),r.transaction.on__beforecomplete=function(e){_.__upgradeTransaction=null,r.__result.__versionTransaction=null,o(u,!1,(function(){return r.transaction.__transFinishedCb(!1,(function(){e.complete(),r.__transaction=null})),!1}))},r.transaction.on__preabort=function(){_.__upgradeTransaction=null,c&&e in kr&&delete kr[e][n]},r.transaction.on__abort=function(){r.__transaction=null,r.__result=void 0,r.__done=!1,_.close(),setTimeout((function(){var n=Ee("AbortError","The upgrade transaction was aborted.");o(u,n,(function(r){return 0===l?(qr(t.__openDatabase,e,i,s.bind(null,n),r||s),!1):(s(n),!1)}))}))},r.transaction.on__complete=function(){var e=_.__transactions.indexOf(r.transaction);if(-1!==e&&_.__transactions.splice(e,1),r.__result.__closePending)return r.__transaction=null,void s(Ee("AbortError","The connection has been closed."));d(),r.__transaction=null;var t=le("success");r.dispatchEvent(t)}}0===l?u.executeSql("INSERT INTO dbVersions VALUES (?,?)",[a,n],f,s):u.executeSql('UPDATE dbVersions SET "version" = ? WHERE "name" = ?',[n,a],f,s)}),s,void 0,(function(e,t,n,r,i){return!(!e.readOnly&&!t&&(o=function(e,t,n){t?r(t,n):i(n)},1))}))})).catch((function(e){throw console.log("Error within `triggerAnyVersionChangeAndBlockedEvents`"),e}));else{d();var p=le("success");r.dispatchEvent(p)}}),s)}(u,l,o)}k.createIndexes?u.executeSql("CREATE INDEX IF NOT EXISTS sysname ON __sys__(name)",[],f,s):f()}),s)}),s)}return jr(r,e,void 0,(function(){var n;c&&(e in kr||(kr[e]={}),n=Lr(e)),n?l(n):Ur(t.__openDatabase,(function(){Pr.readTransaction((function(e){e.executeSql('SELECT "version" FROM dbVersions WHERE "name" = ?',[a],(function(e,t){0===t.rows.length?l(0):l(t.rows.item(0).version)}),s)}),s)}),s)})),r},Mr.prototype.deleteDatabase=function(e){var t=this;if(!(t instanceof Mr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("Database name is required");if(xr())throw Ee("SecurityError","Cannot delete an IndexedDB database from an opaque origin.");var n,r=M(e=String(e));try{n=G(e)}catch(e){throw e}var o="string"==typeof k.memoryDatabase,i=!1!==k.cacheDatabaseInstances||o,a=Ae.__createInstance(),u=!1,c=0,s=function(e,t){t(e)};function l(e,t){if(u||!0===t)return!1;var n=be(t||e);return s(!0,(function(){a.__done=!0,a.__error=n,a.__result=void 0;var e=le("error",n,{bubbles:!0,cancelable:!0});a.dispatchEvent(e),u=!0})),!1}return jr(a,e,void 0,(function(o){Ur(t.__openDatabase,(function(){function a(){o.__result=void 0,o.__done=!0;var e=new fe("success",{oldVersion:c,newVersion:null});o.dispatchEvent(e)}function u(){s(!1,(function(){i&&e in kr&&delete kr[e],delete t.__connections[e],a()}))}Pr.readTransaction((function(i){i.executeSql('SELECT "version" FROM dbVersions WHERE "name" = ?',[r],(function(i,f){if(0!==f.rows.length){var d=f.rows.item(0);c=d.version,Cr(t.__connections[e]||[],o,c,null).then((function(){Pr.transaction((function(o){o.executeSql('DELETE FROM dbVersions WHERE "name" = ? ',[r],(function(){qr(t.__openDatabase,e,n,u,l)}),l)}),l,void 0,(function(e,t,n,r,o){return!(!e.readOnly&&!t)||(s=function(e,t){e?r(e,t):o(t)},!1)}))}),l)}else a()}),l)}))}),l)})),a},Mr.prototype.cmp=function(e,t){if(!(this instanceof Mr))throw new TypeError("Illegal invocation");if(arguments.length<2)throw new TypeError("You must provide two keys to be compared");return et(e),et(t),ke(e,t)},Mr.prototype.databases=function(){var e=this,t=!1;return new Promise((function(n,r){if(!(e instanceof Mr))throw new TypeError("Illegal invocation");if(xr())throw Ee("SecurityError","Cannot get IndexedDB database names from an opaque origin.");function o(e,n){if(t)return!1;var o=n?be(n):e;return t=!0,r(o),!1}Ur(e.__openDatabase,(function(){Pr.readTransaction((function(e){e.executeSql('SELECT "name", "version" FROM dbVersions',[],(function(e,t){for(var r=[],o=0;o<t.rows.length;o++){var i=t.rows.item(o),a=i.name,u=i.version;r.push({name:V(a),version:u})}n(r)}),o)}),o)}),o)}))},Mr.prototype.__forceClose=function(e,t,n){var r=this;function o(e){e.__forceClose(n)}if(se(e))Object.values(r.__connections).forEach((function(e){e.forEach((function(e){o(e)}))}));else if(r.__connections[e])if(se(t))r.__connections[e].forEach((function(e){o(e)}));else{if(!Number.isInteger(t)||t<0||t>r.__connections[e].length-1)throw new TypeError("If providing an argument, __forceClose must be called with a numeric index to indicate a specific connection to close");o(r.__connections[e][t])}else console.log("No database connections with that name to force close")},Mr.prototype.__setConnectionQueueOrigin=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Nr();Br[e]={}},Mr.prototype[Symbol.toStringTag]="IDBFactoryPrototype",Object.defineProperty(Mr,"prototype",{writable:!1});var Kr=Mr.__createInstance();function Gr(){throw new TypeError("Illegal constructor")}var Hr=Gr;Gr.__super=function(e,t,n,r,o,i,a){this[Symbol.toStringTag]="IDBCursor",te(this,["key","primaryKey","request"]),_r.__invalidStateIfDeleted(n),this.__indexSource=$(r,cr),this.__indexSource&&cr.__invalidStateIfDeleted(r),Nt.__assertActive(n.transaction);var u=Et(e);if(void 0!==t&&!["next","prev","nextunique","prevunique"].includes(t))throw new TypeError(t+"is not a valid cursor direction");Object.defineProperties(this,{source:{writable:!1,value:r},direction:{writable:!1,value:t||"next"}}),this.__key=void 0,this.__primaryKey=void 0,this.__store=n,this.__range=u,this.__request=Se.__createInstance(),this.__request.__source=r,this.__request.__transaction=this.__store.transaction,this.__keyColumnName=o,this.__valueColumnName=i,this.__keyOnly="key"===i,this.__valueDecoder=this.__keyOnly?vt:ar,this.__count=a,this.__prefetchedIndex=-1,this.__multiEntryIndex=!!this.__indexSource&&("multiEntry"in r&&r.multiEntry),this.__unique=this.direction.includes("unique"),this.__sqlDirection=["prev","prevunique"].includes(this.direction)?"DESC":"ASC",void 0!==u&&(u.__lowerCached=void 0!==u.lower&&ct(u.lower,this.__multiEntryIndex),u.__upperCached=void 0!==u.upper&&ct(u.upper,this.__multiEntryIndex)),this.__gotValue=!0,this.continue()},Gr.__createInstance=function(){var e=Hr.__super;e.prototype=Hr.prototype;for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return r(e,n)},Gr.prototype.__find=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(this.__multiEntryIndex){var r=t[0],o=t[1],i=t[2],a=t[3],u=t[4];this.__findMultiEntry(r,o,i,a,u)}else{var c=t[0],s=t[1],l=t[2],f=t[3],d=t[4],_=t[5];this.__findBasic(c,s,l,f,d,_)}},Gr.prototype.__findBasic=function(e,t,n,r,o,i){var a=void 0!==i;i=i||1;var u=this,c=K(u.__keyColumnName),s=K("key"),l=["SELECT * FROM",H(u.__store.__currentName)],f=[];l.push("WHERE",c,"NOT NULL"),mt(u.__range,c,l,f,!0,!0);var d=u.__sqlDirection,_="ASC"===d?">":"<";void 0!==t&&(l.push("AND",s,_+"= ?"),f.push(ct(t))),void 0!==e?(l.push("AND",c,_+"= ?"),f.push(ct(e))):a&&void 0!==u.__key&&(l.push("AND",c,_+" ?"),f.push(ct(u.__key))),u.__count||(l.push("ORDER BY",c,d),"key"!==u.__keyColumnName&&(u.__unique?"prevunique"===u.direction&&l.push(",",s,"ASC"):l.push(",",s,d)),!u.__unique&&u.__indexSource&&l.push(",",K(u.__valueColumnName),d),l.push("LIMIT",String(i)));var p=l.join(" ");k.DEBUG&&console.log(p,f),n.executeSql(p,f,(function(e,t){u.__count?r(void 0,t.rows.length,void 0):t.rows.length>1?(u.__prefetchedIndex=0,u.__prefetchedData=t.rows,k.DEBUG&&console.log("Preloaded "+u.__prefetchedData.length+" records for cursor"),u.__decode(t.rows.item(0),r)):1===t.rows.length?u.__decode(t.rows.item(0),r):(k.DEBUG&&console.log("Reached end of cursors"),r(void 0,void 0,void 0))}),(function(e,t){return k.DEBUG&&console.log("Could not execute Cursor.continue",p,f),o(t),!1}))};var Qr=/\[/g;function Wr(){throw new TypeError("Illegal constructor")}Gr.prototype.__findMultiEntry=function(e,t,n,r,o){var a=this;if(a.__prefetchedData&&a.__prefetchedData.length===a.__prefetchedIndex)return k.DEBUG&&console.log("Reached end of multiEntry cursor"),void r(void 0,void 0,void 0);var u=K(a.__keyColumnName),c=["SELECT * FROM",H(a.__store.__currentName)],s=[];c.push("WHERE",u,"NOT NULL"),a.__range&&void 0!==a.__range.lower&&Array.isArray(a.__range.upper)&&0===a.__range.upper.indexOf(a.__range.lower)&&(c.push("AND",u,"LIKE ? ESCAPE '^'"),s.push("%"+z(a.__range.__lowerCached.slice(0,-1))+"%"));var l=a.__sqlDirection,f="ASC"===l?">":"<",d=K("key");void 0!==t&&(c.push("AND",d,f+"= ?"),s.push(ct(t))),void 0!==e?(c.push("AND",u,f+"= ?"),s.push(ct(e))):void 0!==a.__key&&(c.push("AND",u,f+" ?"),s.push(ct(a.__key))),a.__count||(c.push("ORDER BY",u,l),a.__unique||"key"===a.__keyColumnName||c.push(",",K("key"),l),!a.__unique&&a.__indexSource&&c.push(",",K(a.__valueColumnName),l));var _=c.join(" ");k.DEBUG&&console.log(_,s),n.executeSql(_,s,(function(e,t){if(t.rows.length>0){if(a.__count){for(var n=0,o=0;o<t.rows.length;o++){n+=ut(st(t.rows.item(o)[a.__keyColumnName],!0),a.__range).length}return void r(void 0,n,void 0)}for(var u=[],c=0;c<t.rows.length;c++){var s,l=t.rows.item(c),f=i(ut(st(l[a.__keyColumnName],!0),a.__range));try{for(f.s();!(s=f.n()).done;){var d={matchingKey:ct(s.value,!0),key:l.key};d[a.__keyColumnName]=l[a.__keyColumnName],d[a.__valueColumnName]=l[a.__valueColumnName],u.push(d)}}catch(e){f.e(e)}finally{f.f()}}var _=0===a.direction.indexOf("prev");u.sort((function(e,t){return e.matchingKey.replaceAll(Qr,"z")<t.matchingKey.replaceAll(Qr,"z")?_?1:-1:e.matchingKey.replaceAll(Qr,"z")>t.matchingKey.replaceAll(Qr,"z")?_?-1:1:e.key<t.key?"prev"===a.direction?1:-1:e.key>t.key?"prev"===a.direction?-1:1:0})),u.length>1?(a.__prefetchedIndex=0,a.__prefetchedData={data:u,length:u.length,item:function(e){return this.data[e]}},k.DEBUG&&console.log("Preloaded "+a.__prefetchedData.length+" records for multiEntry cursor"),a.__decode(u[0],r)):1===u.length?(k.DEBUG&&console.log("Reached end of multiEntry cursor"),a.__decode(u[0],r)):(k.DEBUG&&console.log("Reached end of multiEntry cursor"),r(void 0,void 0,void 0))}else k.DEBUG&&console.log("Reached end of multiEntry cursor"),r(void 0,void 0,void 0)}),(function(e,t){return k.DEBUG&&console.log("Could not execute Cursor.continue",_,s),o(t),!1}))},Gr.prototype.__onsuccess=function(e){var t=this;return function(n,r,o){t.__count?e(r,t.__request):(void 0!==n&&(t.__gotValue=!0),t.__key=void 0===n?null:n,t.__primaryKey=void 0===o?null:o,t.__value=void 0===r?null:r,e(void 0===n?null:t,t.__request))}},Gr.prototype.__decode=function(e,t){var n=this;if(n.__multiEntryIndex&&n.__unique){if(n.__matchedKeys||(n.__matchedKeys={}),n.__matchedKeys[e.matchingKey])return void t(void 0,void 0,void 0);n.__matchedKeys[e.matchingKey]=!0}var r=V(n.__multiEntryIndex?e.matchingKey:e[n.__keyColumnName]),o=V(e[n.__valueColumnName]),i=V(e.key);t(st(r,n.__multiEntryIndex),n.__valueDecoder.decode(o),st(i),r)},Gr.prototype.__sourceOrEffectiveObjStoreDeleted=function(){_r.__invalidStateIfDeleted(this.__store,"The cursor's effective object store has been deleted"),this.__indexSource&&cr.__invalidStateIfDeleted(this.source,"The cursor's index source has been deleted")},Gr.prototype.__invalidateCache=function(){this.__prefetchedData=null},Gr.prototype.__continue=function(e,t){var n=this,r=void 0!==n.__advanceCount;if(Nt.__assertActive(n.__store.transaction),n.__sourceOrEffectiveObjStoreDeleted(),!n.__gotValue&&!t)throw Ee("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(void 0!==e){et(e);var o=ke(e,n.key);if(0===o||n.direction.includes("next")&&-1===o||n.direction.includes("prev")&&1===o)throw Ee("DataError","Cannot "+(r?"advance":"continue")+" the cursor in an unexpected direction")}this.__continueFinish(e,void 0,r)},Gr.prototype.__continueFinish=function(e,t,n){var r=this,o=r.__advanceCount||k.cursorPreloadPackSize||100;r.__gotValue=!1,r.__request.__done=!1,r.__store.transaction.__pushToQueue(r.__request,(function i(a,u,c,s,l){function f(e,t,o){if(n){if(r.__advanceCount&&r.__advanceCount>=2&&void 0!==e)return r.__advanceCount--,r.__key=e,r.__continue(void 0,!0),void l();r.__advanceCount=void 0}r.__onsuccess(c)(e,t,o)}r.__prefetchedData&&(r.__prefetchedIndex++,r.__prefetchedIndex<r.__prefetchedData.length)?r.__decode(r.__prefetchedData.item(r.__prefetchedIndex),(function(n,o,l,d){var _;!r.__unique||r.__multiEntryIndex||d!==ct(r.key,r.__multiEntryIndex)?(_=Number(void 0===e)||ke(n,e))>0||0===_&&(r.__unique||void 0===t||ke(l,t)>=0)?f(n,o,l):i(a,u,c,s):i(a,u,c,s)})):r.__find(e,t,a,f,(function(){r.__advanceCount=void 0;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=t[0],i=t[1];s(o,i)}),o)}))},Gr.prototype.continue=function(){this.__continue(arguments[0])},Gr.prototype.continuePrimaryKey=function(e,t){var n=this;if(Nt.__assertActive(n.__store.transaction),n.__sourceOrEffectiveObjStoreDeleted(),!n.__indexSource)throw Ee("InvalidAccessError","`continuePrimaryKey` may only be called on an index source.");if(!["next","prev"].includes(n.direction))throw Ee("InvalidAccessError","`continuePrimaryKey` may not be called with unique cursors.");if(!n.__gotValue)throw Ee("InvalidStateError","The cursor is being iterated or has iterated past its end.");et(e),et(t);var r=ke(e,n.key);if("next"===n.direction&&-1===r||"prev"===n.direction&&1===r)throw Ee("DataError","Cannot continue the cursor in an unexpected direction");function o(){n.__continueFinish(e,t,!1)}0===r?rr(t,(function(e){rr(n.primaryKey,(function(t){if(e===t||"next"===n.direction&&e<t||"prev"===n.direction&&e>t)throw Ee("DataError","Cannot continue the cursor in an unexpected direction");o()}))})):o()},Gr.prototype.advance=function(e){var t=this;if(0===(e=ie(e,"unsigned long")))throw new TypeError("Calling advance() with count argument 0");t.__gotValue&&(t.__advanceCount=e),t.__continue()},Gr.prototype.update=function(e){var t=this;if(!arguments.length)throw new TypeError("A value must be passed to update()");if(Nt.__assertActive(t.__store.transaction),t.__store.transaction.__assertWritable(),t.__sourceOrEffectiveObjStoreDeleted(),!t.__gotValue)throw Ee("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(t.__keyOnly)throw Ee("InvalidStateError","This cursor method cannot be called when the key only flag has been set.");var n=t.__store.transaction.__createRequest(t),r=t.primaryKey;function o(e){_r.__storingRecordObjectStore(n,t.__store,!1,e,!1,r)}if(null!==t.__store.keyPath){var i=_(t.__store.__validateKeyAndValueAndCloneValue(e,void 0,!0),2),a=i[0],u=i[1];if(0!==ke(t.primaryKey,a))throw Ee("DataError","The key of the supplied value to `update` is not equal to the cursor's effective key");o(u)}else{o(ir(e))}return n},Gr.prototype.delete=function(){var e=this;if(Nt.__assertActive(e.__store.transaction),e.__store.transaction.__assertWritable(),e.__sourceOrEffectiveObjStoreDeleted(),!e.__gotValue)throw Ee("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(e.__keyOnly)throw Ee("InvalidStateError","This cursor method cannot be called when the key only flag has been set.");return this.__store.transaction.__addToTransactionQueue((function(t,n,r,o){e.__find(void 0,void 0,t,(function(n,i,a){var u="DELETE FROM "+H(e.__store.__currentName)+' WHERE "key" = ?';k.DEBUG&&console.log(u,n,a),t.executeSql(u,[M(ct(a))],(function(e,t){1===t.rowsAffected?r(void 0):o("No rows with key found"+n)}),(function(e,t){return o(t),!1}))}),o)}),void 0,e)},Gr.prototype[Symbol.toStringTag]="IDBCursorPrototype",Z(Gr.prototype,["source","direction","key","primaryKey","request"]),Object.defineProperty(Gr,"prototype",{writable:!1}),Wr.prototype=Object.create(Gr.prototype),Object.defineProperty(Wr.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:Wr});var zr=Wr;function $r(e,t){if(e&&"object"===h(e))Object.entries(e).forEach((function(e){var t=_(e,2);$r(t[0],t[1])}));else{if(!(e in k))throw new Error(e+" is not a valid configuration property");k[e]=t,"registerSCA"===e&&"function"==typeof t&&nr(t)}}Wr.__createInstance=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];function r(){var e=t[0],n=t[1],r=t[2],o=t[3],i=t[4],a=t[5],u=t[6];Gr.__super.call(this,e,n,r,o,i,a,u),this[Symbol.toStringTag]="IDBCursorWithValue",te(this,"value")}return r.prototype=zr.prototype,new r},Z(Wr.prototype,["value"]),Wr.prototype[Symbol.toStringTag]="IDBCursorWithValuePrototype",Object.defineProperty(Wr,"prototype",{writable:!1}),k.win="undefined"!=typeof window?window:self,function(){var e=globalThis||{};function t(t,n,r){if(!r||!Object.defineProperty)try{e[t]=n}catch(e){console.log(e)}if(e[t]!==n&&Object.defineProperty)try{var o=r||{};if("get"in o){var i=a("get",{},t,(function(){return r.get.call(this)}));o=Object.getOwnPropertyDescriptor(i,t)}else"value"in o||(o.value=n),"writable"in o||(o.writable=!0);Object.defineProperty(e,t,o)}catch(e){}e[t]!==n&&"undefined"!=typeof console&&console.warn&&console.warn("Unable to shim "+t)}void 0!==k.win.openDatabase&&t("shimIndexedDB",Kr,{enumerable:!1,configurable:!0}),"shimIndexedDB"in e&&e.shimIndexedDB?(e.shimIndexedDB.__useShim=function(){function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";t(e+"DOMException",we),t(e+"DOMStringList",It,{enumerable:!1,configurable:!0,writable:!0,value:It}),t(e+"Event",S,{configurable:!0,writable:!0,value:S,enumerable:!1}),t(e+"CustomEvent",T,{configurable:!0,writable:!0,value:T,enumerable:!1}),t(e+"EventTarget",x,{configurable:!0,writable:!0,value:x,enumerable:!1})}var r,o=Mr;if(void 0!==k.win.openDatabase){if(Kr.__openDatabase=k.win.openDatabase.bind(k.win),t("indexedDB",Kr,{enumerable:!0,configurable:!0,get:function(){if(this!==e&&!se(this)&&!this.shimNS)throw new TypeError("Illegal invocation");return Kr}}),[["IDBFactory",o],["IDBDatabase",Sr],["IDBObjectStore",_r],["IDBIndex",cr],["IDBTransaction",Nt],["IDBCursor",Gr],["IDBCursorWithValue",Wr],["IDBKeyRange",bt],["IDBRequest",Se],["IDBOpenDBRequest",Ae],["IDBVersionChangeEvent",fe]].forEach((function(e){var n=_(e,2);t(n[0],n[1],{enumerable:!1,configurable:!0})})),k.fs&&(r=k.fs,Tr=r),k.fullIDLSupport&&(Object.setPrototypeOf(e.IDBOpenDBRequest,e.IDBRequest),Object.setPrototypeOf(e.IDBCursorWithValue,e.IDBCursor),Object.setPrototypeOf(Sr,x),Object.setPrototypeOf(Se,x),Object.setPrototypeOf(Nt,x),Object.setPrototypeOf(fe,S),Object.setPrototypeOf(we,Error),Object.setPrototypeOf(we.prototype,Error.prototype),Object.setPrototypeOf(T,S),Object.setPrototypeOf(T.prototype,S.prototype)),e.indexedDB&&!e.indexedDB.toString().includes("[native code]")&&(k.addNonIDBGlobals&&n("Shim"),k.replaceNonIDBGlobals&&n()),!e.shimIndexedDB)return;e.shimIndexedDB.__setConnectionQueueOrigin()}},e.shimIndexedDB.__debug=function(e){k.DEBUG=e},e.shimIndexedDB.__setConfig=$r,e.shimIndexedDB.__getConfig=function(e){if(!(e in k))throw new Error(e+" is not a valid configuration property");return k[e]},e.shimIndexedDB.__setUnicodeIdentifiers=function(e){$r({UnicodeIDStart:e.UnicodeIDStart,UnicodeIDContinue:e.UnicodeIDContinue})}):(e.shimIndexedDB={},["__useShim","__debug","__setConfig","__getConfig","__setUnicodeIdentifiers"].forEach((function(t){e.shimIndexedDB[t]=function(){console.warn("This browser does not have WebSQL to shim.")}}))),"indexedDB"in e||"undefined"==typeof window||(e.indexedDB=e.indexedDB||"webkitIndexedDB"in e&&e.webkitIndexedDB||"mozIndexedDB"in e&&e.mozIndexedDB||"oIndexedDB"in e&&e.oIndexedDB||"msIndexedDB"in e&&e.msIndexedDB);var n=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(/Android (?:2|3|4\.[0-3])/.test(navigator.userAgent)&&!navigator.userAgent.includes("Chrome")||(!navigator.userAgent.includes("Safari")||navigator.userAgent.includes("Chrome"))&&/(iPad|iPhone|iPod)(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])* o[s\u017F] 9_/i.test(navigator.userAgent)&&"undefined"!=typeof window&&!("MSStream"in window))&&(n=!0),k.DEFAULT_DB_SIZE||(k.DEFAULT_DB_SIZE=1024*("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")?25:4)*1024),k.avoidAutoShim||e.indexedDB&&!n||void 0===k.win.openDatabase?(e.IDBDatabase=e.IDBDatabase||"webkitIDBDatabase"in e&&e.webkitIDBDatabase,e.IDBTransaction=e.IDBTransaction||"webkitIDBTransaction"in e&&e.webkitIDBTransaction||{},e.IDBCursor=e.IDBCursor||"webkitIDBCursor"in e&&e.webkitIDBCursor,e.IDBKeyRange=e.IDBKeyRange||"webkitIDBKeyRange"in e&&e.webkitIDBKeyRange):e.shimIndexedDB.__useShim()}()}));
|
|
1
|
+
/*! indexeddbshim - v16.1.0 - 9/1/2025 */
|
|
2
|
+
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}var t=0,n=1,r=2,o=3,i="undefined"==typeof DOMException?function(e,t){var n=new Error(e);return n.name=t,n}:DOMException,a=new WeakMap,s=new WeakMap,c=function(e){var t=this;this[Symbol.toStringTag]="Event",this.toString=function(){return"[object Event]"};var n=Array.prototype.slice.call(arguments),r=n[1],o=n[2];if(!arguments.length)throw new TypeError("Failed to construct 'Event': 1 argument required, but only 0 present.");o=o||{};var i={};"composed"in(r=r||{})&&(i.composed=r.composed),a.set(this,o),s.set(this,i);this.initEvent(e,r.bubbles,r.cancelable),["target","currentTarget","eventPhase","defaultPrevented"].forEach((function(e){var n=e;Object.defineProperty(t,n,{get:function(){return void 0!==i[n]?i[n]:n in o?o[n]:"eventPhase"===n?0:"defaultPrevented"!==n&&null}})}));var c=["type","bubbles","cancelable","isTrusted","timeStamp","initEvent","composedPath","composed"];"[object CustomEvent]"===this.toString()&&c.push("detail","initCustomEvent"),Object.defineProperties(this,c.reduce((function(e,t){var n=t;return e[n]={get:function(){return n in i?i[n]:n in o?o[n]:!["bubbles","cancelable","composed"].includes(n)&&void 0}},e}),{}))};c.prototype.preventDefault=function(){if(!(this instanceof c))throw new TypeError("Illegal invocation");var e=a.get(this),t=s.get(this);this.cancelable&&!t._passive&&(t.defaultPrevented=!0,"function"==typeof e.preventDefault&&e.preventDefault())},c.prototype.stopImmediatePropagation=function(){s.get(this)._stopImmediatePropagation=!0},c.prototype.stopPropagation=function(){s.get(this)._stopPropagation=!0},c.prototype.initEvent=function(e,t,n){var r=s.get(this);r._dispatched||(Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,get:function(){return e}}),Object.defineProperty(this,"bubbles",{enumerable:!0,configurable:!0,get:function(){return t}}),Object.defineProperty(this,"cancelable",{enumerable:!0,configurable:!0,get:function(){return n}}),r.type=e,void 0!==t&&(r.bubbles=t),void 0!==n&&(r.cancelable=n))},["type","target","currentTarget"].forEach((function(e){Object.defineProperty(c.prototype,e,{enumerable:!0,configurable:!0,get:function(){throw new TypeError("Illegal invocation")}})})),["eventPhase","defaultPrevented","bubbles","cancelable","timeStamp"].forEach((function(e){Object.defineProperty(c.prototype,e,{enumerable:!0,configurable:!0,get:function(){throw new TypeError("Illegal invocation")}})})),["NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE"].forEach((function(e,t){Object.defineProperty(c,e,{enumerable:!0,writable:!1,value:t}),Object.defineProperty(c.prototype,e,{writable:!1,value:t})})),c[Symbol.toStringTag]="Function",c.prototype[Symbol.toStringTag]="EventPrototype",Object.defineProperty(c,"prototype",{writable:!1});var u=function(e){var t=Array.prototype.slice.call(arguments),n=t[1],r=t[2];c.call(this,e,n,r),this[Symbol.toStringTag]="CustomEvent",this.toString=function(){return"[object CustomEvent]"},n=n||{},this.initCustomEvent(e,n.bubbles,n.cancelable,"detail"in n?n.detail:null)};function l(e,t,n){var r=e[t];void 0===r&&(e[t]=r=[]);var o="boolean"==typeof n?{capture:n}:n||{},i=JSON.stringify(o);return{listenersByTypeOptions:r.filter((function(e){return i===JSON.stringify(e.options)})),options:o,listenersByType:r}}Object.defineProperty(u.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:u}),u.prototype.initCustomEvent=function(e,t,n,r){if(!(this instanceof u))throw new TypeError("Illegal invocation");var o=s.get(this);u.call(this,e,{bubbles:t,cancelable:n,detail:r},arguments[4]),o._dispatched||(void 0!==r&&(o.detail=r),Object.defineProperty(this,"detail",{get:function(){return o.detail}}))},u[Symbol.toStringTag]="Function",u.prototype[Symbol.toStringTag]="CustomEventPrototype",Object.defineProperty(u.prototype,"detail",{enumerable:!0,configurable:!0,get:function(){throw new TypeError("Illegal invocation")}}),Object.defineProperty(u,"prototype",{writable:!1});var _={addListener:function(e,t,n,r){var o=l(e,n,r),i=o.listenersByTypeOptions;r=o.options;var a=o.listenersByType;i.some((function(e){return e.listener===t}))||a.push({listener:t,options:r})},removeListener:function(e,t,n,r){var o=l(e,n,r),i=o.listenersByType,a=JSON.stringify(o.options);i.some((function(r,o){return r.listener===t&&a===JSON.stringify(r.options)&&(i.splice(o,1),i.length||delete e[n],!0)}))},hasListener:function(e,t,n,r){return l(e,n,r).listenersByTypeOptions.some((function(e){return e.listener===t}))}};function d(){throw new TypeError("Illegal constructor")}Object.assign(d.prototype,["Early","","Late","Default"].reduce((function(e,t){return["add","remove","has"].forEach((function(n){e[n+t+"EventListener"]=function(e,r){var o=arguments[2];if(arguments.length<2)throw new TypeError("2 or more arguments required");if("string"!=typeof e)throw new i("UNSPECIFIED_EVENT_TYPE_ERR","UNSPECIFIED_EVENT_TYPE_ERR");try{"handleEvent"in r&&r.handleEvent.bind&&(r=r.handleEvent.bind(r))}catch(e){console.log("Uncaught `handleEvent` error",e)}var a="_"+t.toLowerCase()+(""===t?"l":"L")+"isteners";return this[a]||Object.defineProperty(this,a,{value:{}}),_[n+"Listener"](this[a],r,e,o)}})),e}),{})),Object.assign(d.prototype,{_legacyOutputDidListenersThrowCheck:void 0,__setOptions:function(e){e=e||{},this._defaultSync=e.defaultSync,this._extraProperties=e.extraProperties||[],e.legacyOutputDidListenersThrowFlag&&(this._legacyOutputDidListenersThrowCheck=!0,this._extraProperties.push("__legacyOutputDidListenersThrowError"))},dispatchEvent:function(e){return this._dispatchEvent(e,!0)},_dispatchEvent:function(e,a){var l=this;["early","","late","default"].forEach((function(e){var t="_"+e+(""===e?"l":"L")+"isteners";l[t]||Object.defineProperty(l,t,{value:{}})}));var _,d=s.get(e);if(d&&a&&d._dispatched)throw new i("The object is in an invalid state.","InvalidStateError");d?_=e:(_=function(e){var t=e.bubbles,n=e.cancelable,r=e.detail,o=e.type;return"detail"in e?new u(o,{bubbles:t,cancelable:n,detail:r},e):new c(o,{bubbles:t,cancelable:n},e)}(e),(d=s.get(_))._dispatched=!0,this._extraProperties.forEach((function(t){t in e&&(_[t]=e[t])})));var f=_.type;function p(){d.eventPhase=t,d.currentTarget=null,delete d._children}function h(){d._stopImmediatePropagation=void 0,d._stopPropagation=void 0,_.defaultPrevented&&d.cancelable||(d.eventPhase=r,_.target.invokeCurrentListeners(_.target._defaultListeners,_,f)),p()}var y=function(){return d._stopImmediatePropagation=void 0,d._stopPropagation=void 0,l._defaultSync?h():setTimeout(h,0),d.eventPhase=r,d._stopPropagation||(d._stopImmediatePropagation=void 0,d._stopPropagation=void 0,_.target.invokeCurrentListeners(_.target._lateListeners,_,f)),p(),!_.defaultPrevented};switch(a&&(d.target=this),"eventPhase"in _&&_.eventPhase){case n:if(d._stopPropagation)return y();this.invokeCurrentListeners(this._listeners,_,f);var b=d._children&&d._children.length&&d._children.pop();return b&&b!==_.target||(d.eventPhase=r),b&&(b._defaultSync=this._defaultSync),(b||this)._dispatchEvent(_,!1);case r:return d._stopPropagation?y():(this.invokeCurrentListeners(this._listeners,_,f,!0),d.bubbles?(d.eventPhase=o,this._dispatchEvent(_,!1)):y());case o:if(d._stopPropagation)return y();var g=this.__getParent&&this.__getParent();return g?(g.invokeCurrentListeners(g._listeners,_,f,!0),g._defaultSync=this._defaultSync,g._dispatchEvent(_,!1)):y();default:if(d.eventPhase=r,this.invokeCurrentListeners(this._earlyListeners,_,f),!("__getParent"in this))return d.eventPhase=r,this._dispatchEvent(_,!1);for(var m=this,v=this;m.__getParent&&null!==(m=m.__getParent());)d._children||(d._children=[]),d._children.push(v),v=m;return v._defaultSync=this._defaultSync,d.eventPhase=n,v._dispatchEvent(_,!1)}},invokeCurrentListeners:function(e,t,i,a){var c=this,u=s.get(t);u.currentTarget=this;var _=l(e,i,{}).listenersByType.concat(),d=_.length?1:0;return _.some((function(e,s){var l=a?c["on"+i]:null;if(u._stopImmediatePropagation)return!0;s===d&&"function"==typeof l&&c.tryCatch(t,(function(){!1===l.call(t.currentTarget,t)&&t.preventDefault()}));var _=e.options,f=_.once,p=_.passive,h=_.capture;if(u._passive=p,h&&t.target!==t.currentTarget&&t.eventPhase===n||t.eventPhase===r||!h&&t.target!==t.currentTarget&&t.eventPhase===o){var y=e.listener;c.tryCatch(t,(function(){y.call(t.currentTarget,t)})),f&&c.removeEventListener(i,y,_)}return!1})),this.tryCatch(t,(function(){var e=a?c["on"+i]:null;"function"==typeof e&&_.length<2&&(!1===e.call(t.currentTarget,t)&&t.preventDefault())})),!t.defaultPrevented},tryCatch:function(e,t){try{t()}catch(t){this.triggerErrorEvent(t,e)}},triggerErrorEvent:function(t,n){var r,o=t;"string"==typeof t&&(o=new Error("Uncaught exception: "+t));var i=!1;"undefined"==typeof window||"undefined"==typeof ErrorEvent||window&&"object"===("undefined"==typeof window?"undefined":e(window))&&!window.dispatchEvent?(i=!0,r=function(){setTimeout((function(){throw o}))}):r=function(){var e=new ErrorEvent("error",{error:t,message:o.message||"",filename:o.fileName||"",lineno:o.lineNumber||0,colno:o.columnNumber||0});window.dispatchEvent(e)},i&&this._legacyOutputDidListenersThrowCheck||r(),this._legacyOutputDidListenersThrowCheck&&(n.__legacyOutputDidListenersThrowError=o)}}),d.prototype[Symbol.toStringTag]="EventTargetPrototype",Object.defineProperty(d,"prototype",{writable:!1});var f=d,p={createInstance:function(e){var t=function(){this.__setOptions(e)};return t.prototype=f.prototype,new t}};d.ShimEvent=c,d.ShimCustomEvent=u,d.ShimDOMException=i,d.ShimEventTarget=d,d.EventTargetFactory=p;const h={},y={};function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var g,m;["DEBUG","cacheDatabaseInstances","autoName","fullIDLSupport","checkOrigin","cursorPreloadPackSize","UnicodeIDStart","UnicodeIDContinue","registerSCA","avoidAutoShim","win","DEFAULT_DB_SIZE","useSQLiteIndexes","fs","addNonIDBGlobals","replaceNonIDBGlobals","escapeDatabaseName","unescapeDatabaseName","databaseCharacterEscapeList","databaseNameLengthLimit","escapeNFDForDatabaseNames","addSQLiteExtension",["memoryDatabase",e=>{if(!/^(?::memory:|file::memory:(\?[^#]*)?(#.*)?)?$/u.test(e))throw new TypeError('`memoryDatabase` must be the empty string, ":memory:", or a "file::memory:[?queryString][#hash] URL".')}],"deleteDatabaseFiles","databaseBasePath","sysDatabaseBasePath","sqlBusyTimeout","sqlTrace","sqlProfile","createIndexes"].forEach((e=>{let t;Array.isArray(e)&&([e,t]=e),Object.defineProperty(y,e,{get:()=>h[e],set(n){t&&t(n),h[e]=n}})}));var v=b(m?g:(m=1,g=/[\xC0-\xC5\xC7-\xCF\xD1-\xD6\xD9-\xDD\xE0-\xE5\xE7-\xEF\xF1-\xF6\xF9-\xFD\xFF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0\u01A1\u01AF\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01F0\u01F4\u01F5\u01F8-\u021B\u021E\u021F\u0226-\u0233\u0344\u0385\u0386\u0388-\u038A\u038C\u038E-\u0390\u03AA-\u03B0\u03CA-\u03CE\u03D3\u03D4\u0400\u0401\u0403\u0407\u040C-\u040E\u0419\u0439\u0450\u0451\u0453\u0457\u045C-\u045E\u0476\u0477\u04C1\u04C2\u04D0-\u04D3\u04D6\u04D7\u04DA-\u04DF\u04E2-\u04E7\u04EA-\u04F5\u04F8\u04F9\u0622-\u0626\u06C0\u06C2\u06D3\u0929\u0931\u0934\u0958-\u095F\u09CB\u09CC\u09DC\u09DD\u09DF\u0A33\u0A36\u0A59-\u0A5B\u0A5E\u0B48\u0B4B\u0B4C\u0B5C\u0B5D\u0B94\u0BCA-\u0BCC\u0C48\u0CC0\u0CC7\u0CC8\u0CCA\u0CCB\u0D4A-\u0D4C\u0DDA\u0DDC-\u0DDE\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69\u0F73\u0F75\u0F76\u0F78\u0F81\u0F93\u0F9D\u0FA2\u0FA7\u0FAC\u0FB9\u1026\u1B06\u1B08\u1B0A\u1B0C\u1B0E\u1B12\u1B3B\u1B3D\u1B40\u1B41\u1B43\u1E00-\u1E99\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FC1-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEE\u1FF2-\u1FF4\u1FF6-\u1FFC\u212B\u219A\u219B\u21AE\u21CD-\u21CF\u2204\u2209\u220C\u2224\u2226\u2241\u2244\u2247\u2249\u2260\u2262\u226D-\u2271\u2274\u2275\u2278\u2279\u2280\u2281\u2284\u2285\u2288\u2289\u22AC-\u22AF\u22E0-\u22E3\u22EA-\u22ED\u2ADC\u304C\u304E\u3050\u3052\u3054\u3056\u3058\u305A\u305C\u305E\u3060\u3062\u3065\u3067\u3069\u3070\u3071\u3073\u3074\u3076\u3077\u3079\u307A\u307C\u307D\u3094\u309E\u30AC\u30AE\u30B0\u30B2\u30B4\u30B6\u30B8\u30BA\u30BC\u30BE\u30C0\u30C2\u30C5\u30C7\u30C9\u30D0\u30D1\u30D3\u30D4\u30D6\u30D7\u30D9\u30DA\u30DC\u30DD\u30F4\u30F7-\u30FA\u30FE\uAC00-\uD7A3\uFB1D\uFB1F\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4E]|\uD801[\uDDC9\uDDE4]|\uD804[\uDC9A\uDC9C\uDCAB\uDD2E\uDD2F\uDF4B\uDF4C\uDF83\uDF85\uDF8E\uDF91\uDFC5\uDFC7\uDFC8]|\uD805[\uDCBB\uDCBC\uDCBE\uDDBA\uDDBB]|\uD806\uDD38|\uD818[\uDD21-\uDD28]|\uD81B[\uDD68-\uDD6A]|\uD834[\uDD5E-\uDD64\uDDBB-\uDDC0]/));function E(e){return e.replaceAll(/([\uD800-\uDBFF])(?![\uDC00-\uDFFF])|(^|[^\uD800-\uDBFF])([\uDC00-\uDFFF])/gu,(function(e,t,n,r){return t?"^2"+t.codePointAt().toString(16).padStart(4,"0"):(n||"")+"^3"+r.codePointAt().toString(16).padStart(4,"0")}))}function w(e){return"_"+E(e.replaceAll("^","^^").replaceAll("\0","^0").replaceAll(/([A-Z])/gu,"^$1"))}function D(e){return E(e.replaceAll("^","^^").replaceAll("\0","^0"))}function I(e){return function(e){return e.replaceAll(/(\^+)3(d[0-9a-f]{3})/gu,((e,t,n)=>t.length%2?t.slice(1)+String.fromCodePoint(Number.parseInt(n,16)):e)).replaceAll(/(\^+)2(d[0-9a-f]{3})/gu,((e,t,n)=>t.length%2?t.slice(1)+String.fromCodePoint(Number.parseInt(n,16)):e))}(e).replaceAll(/(\^+)0/gu,((e,t)=>t.length%2?t.slice(1)+"\0":e)).replaceAll("^^","^")}function O(e){return'"'+function(e){return e.replaceAll('"','""')}(e)+'"'}function S(e){if(y.escapeDatabaseName)return y.escapeDatabaseName(D(e));if(e="D"+w(e),!1!==y.escapeNFDForDatabaseNames&&(e=e.replaceAll(new RegExp(v,"gu"),(function(e){return"^4"+e.codePointAt(0).toString(16).padStart(6,"0")}))),!1!==y.databaseCharacterEscapeList&&(e=e.replace(y.databaseCharacterEscapeList?new RegExp(y.databaseCharacterEscapeList,"gu"):/[\u0000-\u001F\u007F"*/:<>?\\|]/gu,(function(e){return"^1"+e.charCodeAt(0).toString(16).padStart(2,"0")}))),!1!==y.databaseNameLengthLimit&&e.length>=(y.databaseNameLengthLimit||254)-(!1!==y.addSQLiteExtension?7:0))throw new Error("Unexpectedly long database name supplied; length limit required for Node compatibility; passed length: "+e.length+"; length limit setting: "+(y.databaseNameLengthLimit||254)+".");return e+(!1!==y.addSQLiteExtension?".sqlite":"")}function T(e){return O("S"+w(e))}function N(e){return O("I"+w(e))}function A(e){return"I"+w(e)}function x(e){return e.replaceAll("^","^^")}function B(e,t){return t[Symbol.hasInstance](e)}function j(e){return null!==e&&"object"==typeof e}function C(e){return j(e)&&Symbol.iterator in e&&"function"==typeof e[Symbol.iterator]}function P(e,t){t.forEach((t=>{const n={get[t](){throw new TypeError("Illegal invocation")},set[t](e){throw new TypeError("Illegal invocation")}},r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r)}))}function k(e,t){t.forEach((t=>{const n={get[t](){throw new TypeError("Illegal invocation")}},r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r)}))}function R(e,t){(t="string"==typeof t?[t]:t).forEach((t=>{const n={get[t](){return e["__"+t]},set[t](n){e["__"+t]=n}},r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r)})),t.forEach((t=>{e[t]=null}))}function F(e,t,n=null){(t="string"==typeof t?[t]:t).forEach((function(t){let r;n&&t in n?r=n[t]:(Object.defineProperty(e,"__"+t,{enumerable:!1,configurable:!1,writable:!0}),r={get[t](){return this["__"+t]}});const o=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,o)}))}function L(e){const t=y.UnicodeIDStart||"[$A-Z_a-z]",n=y.UnicodeIDContinue||"[$0-9A-Z_a-z]";return new RegExp("^"+("(?:"+t+"|[$_])")+("(?:"+n+"|[$_])")+"*$","u").test(e)}function q(e){return"string"==typeof e&&(""===e||L(e)||e.split(".").every((e=>L(e))))}function U(e){return q(e)||Array.isArray(e)&&Boolean(e.length)&&[...e].every((e=>q(e)))}function M(e,t){let n,r;switch(e=Math.floor(Number(e)),t){case"unsigned long long":n=9007199254740991,r=0;break;case"unsigned long":n=4294967295,r=0;break;default:throw new Error("Unrecognized type supplied to enforceRange")}if(!Number.isFinite(e)||e>n||e<r)throw new TypeError("Invalid range: "+e);return e}function V(e,t){return null===e&&t?"":K(e)}function K(e){return""+e}function G(e){return C(e)?[...e].map((e=>K(e))):K(e)}function H(e){return null==e}function Q(e,t,n){const r=new c(e,n);return r.debug=t,r}Object.defineProperty(c,Symbol.hasInstance,{value:e=>j(e)&&"target"in e&&"bubbles"in e&&"boolean"==typeof e.bubbles});function W(e){c.call(this,e),this[Symbol.toStringTag]="IDBVersionChangeEvent",this.toString=function(){return"[object IDBVersionChangeEvent]"},this.__eventInitDict=arguments[1]||{}}function z(e,t){return new DOMException.prototype.constructor(t,e||"DOMException")}W.prototype=Object.create(c.prototype),W.prototype[Symbol.toStringTag]="IDBVersionChangeEventPrototype",["oldVersion","newVersion"].forEach((e=>{const t={get[e](){if(!(this instanceof W))throw new TypeError("Illegal invocation");return this.__eventInitDict&&this.__eventInitDict[e]||("oldVersion"===e?0:null)}},n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(W.prototype,e,n)})),Object.defineProperty(W,Symbol.hasInstance,{value:e=>j(e)&&"oldVersion"in e&&"defaultPrevented"in e&&"boolean"==typeof e.defaultPrevented}),Object.defineProperty(W.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:W}),Object.defineProperty(W,"prototype",{writable:!1});const Y={IndexSizeError:1,HierarchyRequestError:3,WrongDocumentError:4,InvalidCharacterError:5,NoModificationAllowedError:7,NotFoundError:8,NotSupportedError:9,InUseAttributeError:10,InvalidStateError:11,SyntaxError:12,InvalidModificationError:13,NamespaceError:14,InvalidAccessError:15,TypeMismatchError:17,SecurityError:18,NetworkError:19,AbortError:20,URLMismatchError:21,QuotaExceededError:22,TimeoutError:23,InvalidNodeTypeError:24,DataCloneError:25,EncodingError:0,NotReadableError:0,UnknownError:0,ConstraintError:0,DataError:0,TransactionInactiveError:0,ReadOnlyError:0,VersionError:0,OperationError:0,NotAllowedError:0},$={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};const J=function(){function e(e,t){this[Symbol.toStringTag]="DOMException",this._code=t in Y?Y[t]:$[t]||0,this._name=t||"Error",this._message=void 0===e?"":""+e,Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,writable:!0,value:this._code}),void 0!==t&&Object.defineProperty(this,"name",{configurable:!0,enumerable:!0,writable:!0,value:this._name}),void 0!==e&&Object.defineProperty(this,"message",{configurable:!0,enumerable:!1,writable:!0,value:this._message})}const t=function(){};return t.prototype=Object.create(Error.prototype),["name","message"].forEach((n=>{Object.defineProperty(t.prototype,n,{enumerable:!0,get(){if(!(this instanceof e||this instanceof t||this instanceof Error))throw new TypeError("Illegal invocation");return this["name"===n?"_name":"_message"]}})})),Object.defineProperty(t.prototype,"code",{configurable:!0,enumerable:!0,get(){throw new TypeError("Illegal invocation")}}),e.prototype=new t,e.prototype[Symbol.toStringTag]="DOMExceptionPrototype",Object.defineProperty(e,"prototype",{writable:!1}),Object.keys(Y).forEach((t=>{Object.defineProperty(e.prototype,t,{enumerable:!0,configurable:!1,value:Y[t]}),Object.defineProperty(e,t,{enumerable:!0,configurable:!1,value:Y[t]})})),Object.keys($).forEach((t=>{Object.defineProperty(e.prototype,t,{enumerable:!0,configurable:!1,value:$[t]}),Object.defineProperty(e,t,{enumerable:!0,configurable:!1,value:$[t]})})),Object.defineProperty(e.prototype,"constructor",{writable:!0,configurable:!0,enumerable:!1,value:e}),e}();function X(e,t,n){if(y.DEBUG){const r=n&&"object"==typeof n&&n.message?n.message:n,o="function"==typeof console.error?"error":"log";console[o](e+": "+t+". "+(r||"")),console.trace&&console.trace()}}function Z(e){return e&&"object"==typeof e&&"string"==typeof e.name}function ee(e){let t,n;if(4===e.code)t="QuotaExceededError",n="The operation failed because there was not enough remaining storage space, or the storage quota was reached and the user declined to give more space to the database.";else t="UnknownError",n="The operation failed for reasons unrelated to the database itself and not covered by any other errors.";n+=" ("+e.message+")--("+e.code+")";const r=re(t,n);return r.sqlError=e,r}let te,ne=!1;try{te=z("test name","test message"),Z(te)&&"test name"===te.name&&"test message"===te.message&&(ne=!0)}catch(e){}const re=ne?function(e,t,n){return X(e,t,n),z(e,t)}:function(e,t,n){return X(e,t,n),function(e,t){return new J(t,e)}(e,t)},oe=ne?DOMException:J,ie=["onsuccess","onerror"],ae=["source","transaction","readyState"],se=["result","error"];function ce(){throw new TypeError("Illegal constructor")}ce.__super=function(){this[Symbol.toStringTag]="IDBRequest",this.__setOptions({legacyOutputDidListenersThrowFlag:!0}),se.forEach((e=>{Object.defineProperty(this,"__"+e,{enumerable:!1,configurable:!1,writable:!0}),Object.defineProperty(this,e,{enumerable:!0,configurable:!0,get(){if(!this.__done)throw re("InvalidStateError","Can't get "+e+"; the request is still pending.");return this["__"+e]}})})),F(this,ae,{readyState:{get readyState(){return this.__done?"done":"pending"}}}),R(this,ie),this.__result=void 0,this.__error=this.__source=this.__transaction=null,this.__done=!1},ce.__createInstance=function(){return new ce.__super},ce.prototype=p.createInstance({extraProperties:["debug"]}),ce.prototype[Symbol.toStringTag]="IDBRequestPrototype",ce.prototype.__getParent=function(){return"[object IDBOpenDBRequest]"===this.toString()?null:this.__transaction},k(ce.prototype,ae),k(ce.prototype,se),P(ce.prototype,ie),Object.defineProperty(ce.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:ce}),ce.__super.prototype=ce.prototype,Object.defineProperty(ce,"prototype",{writable:!1});const ue=["onblocked","onupgradeneeded"];function le(){throw new TypeError("Illegal constructor")}le.prototype=Object.create(ce.prototype),Object.defineProperty(le.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:le});const _e=le;function de(e){return e&&"function"==typeof e.then}function fe(e,t){e.then(null,t)}le.__createInstance=function(){function e(){ce.__super.call(this),this[Symbol.toStringTag]="IDBOpenDBRequest",this.__setOptions({legacyOutputDidListenersThrowFlag:!0,extraProperties:["oldVersion","newVersion","debug"]}),R(this,ue)}return e.prototype=_e.prototype,new e},P(le.prototype,ue),le.prototype[Symbol.toStringTag]="IDBOpenDBRequestPrototype",Object.defineProperty(le,"prototype",{writable:!1});const pe=2,he=0,ye=1;function be(e){const t=this;function n(e,n){t.v=e,t.s=n,t.c[n].forEach((function(t){t(e)})),t.c[n].length&&(t.c=null)}function r(e){t.c&&(de(e)?fe(e.then(r),r):n(e,ye))}t.v=0,t.s=pe,t.c=[[],[]];try{e((function e(o){t.c&&(de(o)?fe(o.then(e),r):n(o,he))}),r)}catch(e){r(e)}}function ge(e,t){const n=Ge(e),r=Ge(t),o=n>r?1:n===r?0:-1;if(y.DEBUG){let o=He(n),i=He(r);"object"==typeof e&&(e=JSON.stringify(e),o=JSON.stringify(o)),"object"==typeof t&&(t=JSON.stringify(t),i=JSON.stringify(i)),o!==e&&console.warn(e+" was incorrectly encoded as "+o),i!==t&&console.warn(t+" was incorrectly encoded as "+i)}return o}be.prototype.then=function(e,t){const n=this;return new be((function(r,o){const i="function"==typeof t?t:o;function a(){try{r(e?e(n.v):n.v)}catch(e){i(e)}}n.s===he?a():n.s===ye?i(n.v):(n.c[he].push(a),n.c[ye].push(i))}))},be.prototype.catch=function(e){const t=this;return new be((function(n,r){function o(){try{n(e(t.v))}catch(e){r(e)}}t.s===ye?o():t.s===he?n(t.v):(t.c[ye].push(o),t.c[he].push(n))}))},be.all=function(e){return new be(((t,n)=>{let r=e.length;const o=[];r?e.forEach(((i,a)=>{de(i)?fe(i.then((e=>{o[a]=e,--r||t(o)})),n):(o[a]=i,--r||t(e))})):t(o)}))},be.race=function(e){let t=!1;return new be(((n,r)=>{e.some(((e,o)=>de(e)?(fe(e.then((e=>{t||(n(e),t=!0)})),r),!1):(n(e),t=!0,!0)))}))},be.resolve=function(e){return new be(((t,n)=>{t(e)}))},be.reject=function(e){return new be(((t,n)=>{n(e)}))};const me={invalid:100,number:200,date:300,string:400,binary:500,array:600},ve=Object.keys(me);ve.forEach((e=>{me[e]=String.fromCodePoint(me[e])}));const Ee=ve.reduce(((e,t)=>(e[me[t]]=t,e)),{}),we=["negativeInfinity","bigNegative","smallNegative","smallPositive","bigPositive","positiveInfinity"],De={invalid:{encode:()=>me.invalid+"-",decode(){}},number:{encode(e){let t=e===Number.MIN_VALUE?"0."+"0".repeat(214)+"2":Math.abs(e).toString(32);const n=t.indexOf(".");t=-1!==n?t.replace(".",""):t;const r=t.search(/[^0]/u);let o,i,a;return t=t.slice(r),Number.isFinite(Number(e))?e<0?e>-1?(o=we.indexOf("smallNegative"),i=Ie(r),a=Se(Oe(t))):(o=we.indexOf("bigNegative"),i=Se(Ie(-1!==n?n:t.length)),a=Se(Oe(t))):e<1?(o=we.indexOf("smallPositive"),i=Se(Ie(r)),a=Oe(t)):(o=we.indexOf("bigPositive"),i=Ie(-1!==n?n:t.length),a=Oe(t)):(i=Ae(2),a=Ae(11),o=we.indexOf(e>0?"positiveInfinity":"negativeInfinity")),me.number+"-"+o+i+a},decode(e){const t=Number(e.slice(2,3));let n=e.slice(3,5),r=e.slice(5,16);switch(we[t]){case"negativeInfinity":return Number.NEGATIVE_INFINITY;case"positiveInfinity":return Number.POSITIVE_INFINITY;case"bigPositive":return Te(r,n);case"smallPositive":return n=xe(Se(n)),Te(r,n);case"smallNegative":return n=xe(n),r=Se(r),-Te(r,n);case"bigNegative":return n=Se(n),r=Se(r),-Te(r,n);default:throw new Error("Invalid number.")}}},string:{encode:(e,t)=>(t&&(e=e.replaceAll(/(.)/gu,"-$1")+" "),me.string+"-"+e),decode:(e,t)=>(e=e.slice(2),t&&(e=e.slice(0,-1).replaceAll(/-(.)/gu,"$1")),e)},array:{encode(e){const t=[];for(const[n,r]of e.entries()){const e=Ge(r,!0);t[n]=e}return t.push(me.invalid+"-"),me.array+"-"+JSON.stringify(t)},decode(e){const t=JSON.parse(e.slice(2));t.pop();for(let e=0;e<t.length;e++){const n=He(t[e],!0);t[e]=n}return t}},date:{encode:e=>me.date+"-"+e.toJSON(),decode:e=>new Date(e.slice(2))},binary:{encode:e=>me.binary+"-"+(e.byteLength?[...Ce(e)].map((e=>String(e).padStart(3,"0"))):""),decode(e){const t=e.slice(2),n=t.length?t.split(",").map((e=>Number.parseInt(e))):[],r=new ArrayBuffer(n.length);return new Uint8Array(r).set(n),r}}};function Ie(e){const t=e.toString(32);return 1===t.length?"0"+t:t}function Oe(e){return(e+Ae(11)).slice(0,11)}function Se(e){let t="";for(const n of e)t+=(31-Number.parseInt(n,32)).toString(32);return t}function Te(e,t){const n=Number.parseInt(t,32);if(n<0)return Ne(Number.parseInt(e,32)*32**(n-10));if(n<11){const t=e.slice(0,n),r=Number.parseInt(t,32),o=e.slice(n);return Ne(r+Number.parseInt(o,32)*32**(n-11))}const r=e+Ae(n-11);return Number.parseInt(r,32)}function Ne(e,t=16){return Number.parseFloat(e.toPrecision(t))}function Ae(e){return"0".repeat(e)}function xe(e){return"-"+e}function Be(e){if(Array.isArray(e))return"array";if(j(t=e)&&"getDate"in t&&"function"==typeof t.getDate)return"date";var t;if(function(e){return j(e)&&"byteLength"in e&&"number"==typeof e.byteLength&&("slice"in e&&"function"==typeof e.slice||"getFloat64"in e&&"function"==typeof e.getFloat64)}(e))return"binary";const n=typeof e;return["string","number"].includes(n)?n:"invalid"}function je(e,t){return Pe(e,t,!1,!0)}function Ce(e){let t=0,n=0;if(ArrayBuffer.isView(e)){if(void 0===e.buffer)throw new TypeError("Could not copy the bytes held by a buffer source as the buffer was undefined.");t=e.byteOffset,n=e.byteLength}else n=e.byteLength;return new Uint8Array("buffer"in e&&e.buffer||e,t,n)}function Pe(e,t,n,r){if((t=t||[]).includes(e))return{type:"array",invalid:!0,message:"An array key cannot be circular"};const o=Be(e),i={type:o,value:e};switch(o){case"number":return Number.isNaN(e)?{type:"NaN",invalid:!0}:Object.is(e,-0)?{type:o,value:0}:i;case"string":return i;case"binary":return{type:"binary",value:Ce(e)};case"array":{const i=e,a=i.length;t.push(e);const s=[];for(let e=0;e<a;e++){if(!n&&!Object.hasOwn(i,e))return{type:o,invalid:!0,message:"Does not have own index property"};try{const a=Pe(i[e],t,!1,r);if(a.invalid){if(n)continue;return{type:o,invalid:!0,message:"Bad array entry value-to-key conversion"}}(!n||!r&&s.every((e=>0!==ge(e,a.value)))||r&&s.every((e=>0!==ge(e,a))))&&s.push(r?a:a.value)}catch(e){if(!n)throw e}}return{type:o,value:s}}case"date":{const t=e;return Number.isNaN(t.getTime())?{type:o,invalid:!0,message:"Not a valid date"}:r?{type:o,value:t.getTime()}:{type:o,value:new Date(t)}}default:{const t=null===e?"null":typeof e;return{type:t,invalid:!0,message:"Not a valid key; type "+t}}}}function ke(e,t){return Pe(e,null,!0,t)}function Re(e,t){const n=je(e,t);if(n.invalid)throw re("DataError",n.message||"Not a valid key; type: "+n.type);return n}function Fe(e,t,n,r){const o=Le(e,t);return o.failure?o:n?ke(o.value,r):Pe(o.value,null,!1,r)}function Le(e,t,n,r){if(Array.isArray(t)){const n=[];return t.some((t=>{const r=Le(e,t);return!!r.failure||(n.push(r.value),!1)}))?{failure:!0}:{value:n}}if(""===t)return{value:e};return t.split(".").some((t=>{if("length"!==t||"string"!=typeof e&&!Array.isArray(e))if(j(n=e)&&"size"in n&&"number"==typeof n.size&&"slice"in n&&"function"==typeof n.slice&&!("lastModified"in n))switch(t){case"size":case"type":e=e[t]}else{if(!function(e){return j(e)&&"name"in e&&"string"==typeof e.name&&"slice"in e&&"function"==typeof e.slice&&"lastModified"in e}(e))return!j(e)||!Object.hasOwn(e,t)||void 0===(e=e[t]);switch(t){case"name":case"lastModified":e=e[t];break;case"lastModifiedDate":e=new Date(e.lastModified)}}else e=e.length;var n;return!1}))?{failure:!0}:{value:e}}function qe(e,t,n){const r=n.split("."),o=r.pop();r.forEach((t=>{Object.hasOwn(e,t)||(e[t]={}),e=e[t]})),e[o]=t}function Ue(e,t){const n=t.split(".");n.pop();for(const t of n){if(!j(e))return!1;if(!Object.hasOwn(e,t))return!0;e=e[t]}return j(e)}function Me(e,t,n){let r=void 0===t.lower,o=void 0===t.upper;const i=Ge(e,!0),a=n?t.__lowerCached:Ge(t.lower,!0),s=n?t.__upperCached:Ge(t.upper,!0);return!r&&(t.lowerOpen&&null!==i&&null!==a&&i>a||!t.lowerOpen&&(!i&&!a||null!==i&&null!==a&&i>=a))&&(r=!0),!o&&(t.upperOpen&&null!==i&&null!==s&&i<s||!t.upperOpen&&(!i&&!s||null!==i&&null!==s&&i<=s))&&(o=!0),r&&o}function Ve(e,t){return"array"===Ee[t.slice(0,1)]?t.indexOf(e)>1:t===e}function Ke(e,t){const n=[];if(Array.isArray(e))for(let r of e){if(Array.isArray(r)){if(t&&t.lower===t.upper)continue;if(1!==r.length){Ke(r,t).length>0&&n.push(r);continue}r=r[0]}(H(t)||Me(r,t,!0))&&n.push(r)}else(H(t)||Me(e,t,!0))&&n.push(e);return n}function Ge(e,t){return void 0===e?null:De[Be(e)].encode(e,t)}function He(e,t){if("string"==typeof e)return De[Ee[e.slice(0,1)]].decode(e,t)}function Qe(e,t){return He(Ge(e,t),t)}const We=9007199254740992;function ze(e,t,n,r){e.executeSql('SELECT "currNum" FROM __sys__ WHERE "name" = ?',[D(t.__currentName)],(function(e,t){1!==t.rows.length?n(1):n(t.rows.item(0).currNum)}),(function(e,t){return r(re("DataError","Could not get the auto increment value for key",t)),!1}))}function Ye(e,t,n,r,o){const i='UPDATE __sys__ SET "currNum" = ? WHERE "name" = ?',a=[n,D(t.__currentName)];y.DEBUG&&console.log(i,a),e.executeSql(i,a,(function(){r(n)}),(function(e,t){return o(re("UnknownError","Could not set the auto increment value for key",t)),!1}))}function $e(e,t,n,r,o){return Ye(e,t,n=n===We?n+2:n+1,r,o)}function Je(e,t,n,r){ze(e,t,(function(o){o>We?n("failure"):$e(e,t,o,(function(){n(null,o,o)}),r)}),r)}function Xe(e,t,n,r,o){"number"!=typeof n||n<1?r():ze(e,t,(function(i){const a=Math.floor(Math.min(n,We));a>=i?$e(e,t,a,(function(){r(i)}),o):r()}),o)}var Ze=Object.freeze({__proto__:null,assignCurrentNumber:Ye,checkKeyCouldBeInjectedIntoValue:Ue,convertKeyToValue:function e(t){const{type:n,value:r}=t;switch(n){case"number":case"string":return r;case"array":{const t=[],n=r.length;let o=0;for(;o<n;){const n=e(r[o]);t[o]=n,o++}return t}case"date":return new Date(r);case"binary":{const e=r.length,t=new ArrayBuffer(e);return new Uint8Array(t,r.byteOffset||0,r.byteLength).set(r),t}default:throw new Error("Bad key")}},convertValueToKey:je,convertValueToKeyRethrowingAndIfInvalid:Re,convertValueToKeyValueDecoded:Pe,convertValueToMultiEntryKey:function(e){return Pe(e,null,!0,!0)},convertValueToMultiEntryKeyDecoded:ke,decode:He,encode:Ge,evaluateKeyPathOnValue:function(e,t,n){return Le(e,t)},extractKeyFromValueUsingKeyPath:function(e,t,n){return Fe(e,t,n,!0)},extractKeyValueDecodedFromValueUsingKeyPath:Fe,findMultiEntryMatches:Ke,generateKeyForStore:Je,injectKeyIntoValueUsingKeyPath:qe,isKeyInRange:Me,isMultiEntryMatch:Ve,possiblyUpdateKeyGenerator:Xe,roundTrip:Qe});function et(){throw this.__lowerOpen=!1,this.__upperOpen=!1,new TypeError("Illegal constructor")}const tt=et;function nt(e,t,n,r,o,i){if(e&&(void 0!==e.lower||void 0!==e.upper)){let a,s;o&&n.push("AND");const c=void 0!==e.lower,u=void 0!==e.upper;if(c&&(a=i?e.__lowerCached:Ge(e.lower)),u&&(s=i?e.__upperCached:Ge(e.upper)),c){if(r.push(D(a)),u&&a===s&&!e.lowerOpen&&!e.upperOpen)return void n.push(t,"=","?");n.push(t,e.lowerOpen?">":">=","?")}c&&u&&n.push("AND"),u&&(n.push(t,e.upperOpen?"<":"<=","?"),r.push(D(s)))}}function rt(e,t){if(B(e,et))return"[object IDBKeyRange]"!==e.toString()?et.__createInstance(e.lower,e.upper,e.lowerOpen,e.upperOpen):e;if(!H(e))return Re(e),et.only(e);if(t)throw re("DataError","No key or range was specified")}et.__createInstance=function(e,t,n,r){function o(){if(this[Symbol.toStringTag]="IDBKeyRange",void 0===e&&void 0===t)throw re("DataError","Both arguments to the key range method cannot be undefined");let o,i;if(void 0!==e&&(o=Qe(e),Re(e)),void 0!==t&&(i=Qe(t),Re(t)),void 0!==e&&void 0!==t&&e!==t&&Ge(e)>Ge(t))throw re("DataError","`lower` must not be greater than `upper` argument in `bound()` call.");this.__lower=o,this.__upper=i,this.__lowerOpen=Boolean(n),this.__upperOpen=Boolean(r)}return o.prototype=tt.prototype,new o},et.prototype.includes=function(e){if(!j(this)||"boolean"!=typeof this.__lowerOpen)throw new TypeError("Illegal invocation");if(!arguments.length)throw new TypeError("IDBKeyRange.includes requires a key argument");return Re(e),Me(e,this)},et.only=function(e){if(!arguments.length)throw new TypeError("IDBKeyRange.only requires a value argument");return et.__createInstance(e,e,!1,!1)},et.lowerBound=function(e){if(!arguments.length)throw new TypeError("IDBKeyRange.lowerBound requires a value argument");return et.__createInstance(e,void 0,arguments[1],!0)},et.upperBound=function(e){if(!arguments.length)throw new TypeError("IDBKeyRange.upperBound requires a value argument");return et.__createInstance(void 0,e,!0,arguments[1])},et.bound=function(e,t){if(arguments.length<=1)throw new TypeError("IDBKeyRange.bound requires lower and upper arguments");return et.__createInstance(e,t,arguments[2],arguments[3])},et.prototype[Symbol.toStringTag]="IDBKeyRangePrototype",["lower","upper","lowerOpen","upperOpen"].forEach((e=>{Object.defineProperty(et.prototype,"__"+e,{enumerable:!1,configurable:!1,writable:!0});const t={get[e](){if(!j(this)||"boolean"!=typeof this.__lowerOpen)throw new TypeError("Illegal invocation");return this["__"+e]}},n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(et.prototype,e,n)})),Object.defineProperty(et,Symbol.hasInstance,{value:e=>j(e)&&"upper"in e&&"lowerOpen"in e&&"boolean"==typeof e.lowerOpen}),Object.defineProperty(et,"prototype",{writable:!1});let ot=!1;const it={test:!0};if(Object.defineProperty)try{Object.defineProperty(it,"test",{enumerable:!1}),it.test&&(ot=!0)}catch(e){}const at=function(){throw this._items=[],this._length=0,new TypeError("Illegal constructor")};at.prototype={constructor:at,contains(e){if(!arguments.length)throw new TypeError("DOMStringList.contains must be supplied a value");return this._items.includes(e)},item(e){if(!arguments.length)throw new TypeError("DOMStringList.item must be supplied a value");return e<0||e>=this.length||!Number.isInteger(e)?null:this._items[e]},clone(){const e=at.__createInstance();return e._items=this._items.slice(),e._length=this.length,e.addIndexes(),e},addIndexes(){for(let e=0;e<this._items.length;e++)this[e]=this._items[e]},sortList(){return this._items.sort(),this.addIndexes(),this._items},forEach(e,t){this._items.forEach(e,t)},map(e,t){return this._items.map(e,t)},indexOf(e){return this._items.indexOf(e)},push(e){this._items.push(e),this._length++,this.sortList()},splice(...e){this._items.splice(...e),this._length=this._items.length;for(const e in this)e===String(Number.parseInt(e))&&delete this[e];this.sortList()},[Symbol.toStringTag]:"DOMStringListPrototype",*[Symbol.iterator](){let e=0;for(;e<this._items.length;)yield this._items[e++]}},Object.defineProperty(at,Symbol.hasInstance,{value:e=>"DOMStringListPrototype"===Object.prototype.toString.call(e)});const st=at;if(Object.defineProperty(at,"__createInstance",{value(){const e=function(){this.toString=function(){return"[object DOMStringList]"},Object.defineProperty(this,"length",{enumerable:!0,get(){return this._length}}),this._items=[],this._length=0};return e.prototype=st.prototype,new e}}),ot){Object.defineProperty(at,"prototype",{writable:!1});["addIndexes","sortList","forEach","map","indexOf","push","splice","constructor","__createInstance"].forEach((e=>{Object.defineProperty(at.prototype,e,{enumerable:!1})})),Object.defineProperty(at.prototype,"length",{configurable:!0,enumerable:!0,get(){throw new TypeError("Illegal invocation")}});["_items","_length"].forEach((e=>{Object.defineProperty(at.prototype,e,{enumerable:!1,writable:!0})}))}let ct=0;const ut=["onabort","oncomplete","onerror"],lt=["objectStoreNames","mode","db","error"];function _t(){throw new TypeError("Illegal constructor")}const dt=_t;function ft(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ht(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,vt(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function yt(e,t,n){return(t=vt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bt(Object(n),!0).forEach((function(t){yt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function mt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||wt(e,t)||function(){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 vt(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function Et(e){return Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Et(e)}function wt(e,t){if(e){if("string"==typeof e)return ft(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ft(e,t):void 0}}_t.__createInstance=function(e,t,n){function r(){const r=this;r[Symbol.toStringTag]="IDBTransaction",F(r,lt),r.__id=++ct,r.__active=!0,r.__running=!1,r.__errored=!1,r.__requests=[],r.__objectStoreNames=t,r.__mode=n,r.__db=e,r.__error=null,r.__setOptions({legacyOutputDidListenersThrowFlag:!0}),lt.forEach((e=>{Object.defineProperty(this,e,{configurable:!0})})),R(this,ut),r.__storeHandles={},setTimeout((()=>{r.__executeRequests()}),0)}return r.prototype=dt.prototype,new r},_t.prototype=p.createInstance({defaultSync:!0,extraProperties:["complete"]}),_t.prototype.__transFinishedCb=function(e,t){t(Boolean(e))},_t.prototype.__executeRequests=function(){const e=this;e.__running?y.DEBUG&&console.log("Looks like the request set is already running",e.mode):(e.__running=!0,e.db.__db["readonly"===e.mode?"readTransaction":"transaction"]((function(t){e.__tx=t;let n,r=-1;function o(t,r){if(e.__errored||e.__requestsFinished)return;if(r&&(n.req=r),!n.req)return;if(n.req.__done)return;n.req.__done=!0,n.req.__result=t,n.req.__error=null,e.__active=!0;const o=Q("success");if(n.req.dispatchEvent(o),o.__legacyOutputDidListenersThrowError)return X("Error","An error occurred in a success handler attached to request chain",o.__legacyOutputDidListenersThrowError),void e.__abortTransaction(re("AbortError","A request was aborted (in user handler after success)."));a()}function i(...t){if(e.__errored||e.__requestsFinished)return;if(n.req&&n.req.__done)return;const r=function(e){let t;if(e){if(1===e.length)return e[0];for(const n of e){if(Z(n))return n;n&&"string"==typeof n.message&&(t=n)}}return t}(t);if(!n.req)return void e.__abortTransaction(r);n.req.__done=!0,n.req.__error=r,n.req.__result=void 0,n.req.addLateEventListener("error",(function(e){e.cancelable&&e.defaultPrevented&&!e.__legacyOutputDidListenersThrowError&&a()})),n.req.addDefaultEventListener("error",(function(){n.req&&e.__abortTransaction(n.req.__error)})),e.__active=!0;const o=Q("error",r,{bubbles:!0,cancelable:!0});n.req.dispatchEvent(o),o.__legacyOutputDidListenersThrowError&&(X("Error","An error occurred in an error handler attached to request chain",o.__legacyOutputDidListenersThrowError),o.preventDefault(),e.__abortTransaction(re("AbortError","A request was aborted (in user handler after error).")))}function a(){if(!e.__errored&&!e.__requestsFinished)if(r++,r>=e.__requests.length)e.__requests=[],e.__active&&function(){function t(){e.__completed=!0,y.DEBUG&&console.log("Transaction completed");const t=Q("complete");try{e.__internal=!0,e.dispatchEvent(t),e.__internal=!1,e.dispatchEvent(Q("__complete"))}catch(t){throw e.__internal=!1,e.__errored=!0,t}finally{e.__storeHandles={}}}if(e.__active=!1,e.__requestsFinished=!0,"readwrite"===e.mode)return e.__transactionFinished?void t():void(e.__transactionEndCallback=t);if("readonly"===e.mode)return void t();const n=Q("__beforecomplete");n.complete=t,e.dispatchEvent(n)}();else try{if(n=e.__requests[r],!n.req)return void n.op(t,n.args,a,i);if(n.req.__done)return;n.op(t,n.args,o,i,a)}catch(e){i(e)}}a()}),(function(t){if(!0===t)return;const n=ee(t);e.__abortTransaction(n)}),(function(){e.__transFinishedCb===_t.prototype.__transFinishedCb&&(e.__transactionEndCallback||e.__requestsFinished?e.__transactionEndCallback&&!e.__completed&&e.__transFinishedCb(e.__errored,e.__transactionEndCallback):e.__transactionFinished=!0)}),(function(t,n,r,o,i){return!(!t.readOnly&&!n)||(e.__transFinishedCb=function(e,t){e?o(e,t):i(t)},e.__transactionEndCallback&&!e.__completed&&e.__transFinishedCb(e.__errored,e.__transactionEndCallback),!1)})))},_t.prototype.__createRequest=function(e){const t=ce.__createInstance();return t.__source=void 0!==e?e:this.db,t.__transaction=this,t},_t.prototype.__addToTransactionQueue=function(e,t,n){const r=this.__createRequest(n);return this.__pushToQueue(r,e,t),r},_t.prototype.__addNonRequestToTransactionQueue=function(e,t){this.__pushToQueue(null,e,t)},_t.prototype.__pushToQueue=function(e,t,n){this.__assertActive(),this.__requests.push({op:t,args:n,req:e})},_t.prototype.__assertActive=function(){if(!this.__active)throw re("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished")},_t.prototype.__assertWritable=function(){if("readonly"===this.mode)throw re("ReadOnlyError","The transaction is read only")},_t.prototype.__assertVersionChange=function(){_t.__assertVersionChange(this)},_t.prototype.objectStore=function(e){const t=this;if(!(t instanceof _t))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No object store name was specified");if(_t.__assertNotFinished(t),-1===t.__objectStoreNames.indexOf(e))throw re("NotFoundError",e+" is not participating in this transaction");const n=t.db.__objectStores[e];if(!n)throw re("NotFoundError",e+" does not exist in "+t.db.name);return(!t.__storeHandles[e]||t.__storeHandles[e].__pendingDelete||t.__storeHandles[e].__deleted)&&(t.__storeHandles[e]=Yn.__clone(n,t)),t.__storeHandles[e]},_t.prototype.__abortTransaction=function(e){const t=this;function n(n,r){n?r&&"code"in r&&"number"==typeof r.code?y.DEBUG&&console.log("Rollback erred; feature is probably not supported as per WebSQL",t):y.DEBUG&&console.log("Rollback succeeded",t):y.DEBUG&&console.log("Rollback not possible due to missing transaction",t),t.dispatchEvent(Q("__preabort")),t.__requests.filter((function(e,t,n){return e.req&&!e.req.__done&&[t,-1].includes(n.map((e=>e.req)).lastIndexOf(e.req))})).reduce((function(e,t){return e.then((function(){if(!t.req)throw new Error("Missing request");t.req.__done=!0,t.req.__result=void 0,t.req.__error=re("AbortError","A request was aborted (an unfinished request).");const e=Q("error",t.req.__error,{bubbles:!0,cancelable:!0});return new be((n=>{setTimeout((()=>{if(!t.req)throw new Error("Missing request");t.req.dispatchEvent(e),n()}))}))}))}),be.resolve(void 0)).then((function(){const n=Q("abort",e,{bubbles:!0,cancelable:!1});setTimeout((()=>{t.__abortFinished=!0,t.dispatchEvent(n),t.__storeHandles={},t.dispatchEvent(Q("__abort"))}))})).catch((e=>{throw console.log("Abort error"),e}))}X("Error","An error occurred in a transaction",e),t.__errored||(t.__errored=!0,"versionchange"===t.mode&&(t.db.__version=t.db.__oldVersion,t.db.__objectStoreNames=t.db.__oldObjectStoreNames,t.__objectStoreNames=t.db.__oldObjectStoreNames,Object.values(t.db.__objectStores).concat(Object.values(t.__storeHandles)).forEach((function(e){"__pendingName"in e&&t.db.__oldObjectStoreNames.indexOf(e.__pendingName)>-1&&(e.__name=e.__originalName),e.__indexNames=e.__oldIndexNames,delete e.__pendingDelete,Object.values(e.__indexes).concat(Object.values(e.__indexHandles)).forEach((function(t){"__pendingName"in t&&e.__oldIndexNames.indexOf(t.__pendingName)>-1&&(t.__name=t.__originalName),delete t.__pendingDelete}))}))),t.__active=!1,null!==e&&(t.__error=e),t.__requestsFinished&&setTimeout((()=>{throw e}),0),t.__transFinishedCb(!0,(function(e){if(e&&t.__tx){if("readwrite"===t.mode)return t.__transactionFinished?void n():void(t.__transactionEndCallback=n);try{t.__tx.executeSql("ROLLBACK",[],n,n)}catch(e){n()}}else n(null,{code:0})})))},_t.prototype.abort=function(){const e=this;if(!(e instanceof _t))throw new TypeError("Illegal invocation");y.DEBUG&&console.log("The transaction was aborted",e),_t.__assertNotFinished(e),e.__abortTransaction(null)},_t.prototype[Symbol.toStringTag]="IDBTransactionPrototype",_t.__assertVersionChange=function(e){if(!e||"versionchange"!==e.mode)throw re("InvalidStateError","Not a version transaction")},_t.__assertNotVersionChange=function(e){if(e&&"versionchange"===e.mode)throw re("InvalidStateError","Cannot be called during a version transaction")},_t.__assertNotFinished=function(e){if(!e||e.__completed||e.__abortFinished||e.__errored)throw re("InvalidStateError","Transaction finished by commit or abort")},_t.__assertNotFinishedObjectStoreMethod=function(e){try{_t.__assertNotFinished(e)}catch(t){if(e&&!e.__completed&&!e.__abortFinished)throw re("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished");throw t}},_t.__assertActive=function(e){if(!e||!e.__active)throw re("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished")},_t.prototype.__getParent=function(){return this.db},P(_t.prototype,ut),k(_t.prototype,lt),Object.defineProperty(_t.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:_t}),Object.defineProperty(_t,"prototype",{writable:!1});var Dt=ht((function e(t){pt(this,e),this.p=new Promise(t)}));Dt.__typeson__type__="TypesonPromise","undefined"!=typeof Symbol&&Object.defineProperty(Dt.prototype,Symbol.toStringTag,{get:function(){return"TypesonPromise"}}),Dt.prototype.then=function(e,t){var n=this;return new Dt((function(r,o){n.p.then((function(t){r(e?e(t):t)})).catch((function(e){return t?t(e):Promise.reject(e)})).then(r,o)}))},Dt.prototype.catch=function(e){return this.then((function(){}),e)},Dt.resolve=function(e){return new Dt((function(t){t(e)}))},Dt.reject=function(e){return new Dt((function(t,n){n(e)}))},Dt.all=function(e){return new Dt((function(t,n){Promise.all(e.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(t,n)}))},Dt.race=function(e){return new Dt((function(t,n){Promise.race(e.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(t,n)}))},Dt.allSettled=function(e){return new Dt((function(t,n){Promise.allSettled(e.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(t,n)}))};var It=Object.hasOwn,Ot=Object.getPrototypeOf;function St(e,t){return Bt(e)&&"function"==typeof e.then&&!0}function Tt(e){return Object.prototype.toString.call(e).slice(8,-1)}function Nt(e,t){if(!e||"object"!==Et(e))return!1;var n=Ot(e);if(!n)return null===t;var r=It(n,"constructor")&&n.constructor;return"function"!=typeof r?null===t:t===r||null!==t&&Function.prototype.toString.call(r)===Function.prototype.toString.call(t)||"function"==typeof t&&"string"==typeof r.__typeson__type__&&r.__typeson__type__===t.__typeson__type__}function At(e){return!(!e||"Object"!==Tt(e))&&(!Ot(e)||Nt(e,Object))}function xt(e){if(!e||"Object"!==Tt(e))return!1;var t=Ot(e);return!t||Nt(e,Object)||xt(t)}function Bt(e){return null!==e&&"object"===Et(e)}function jt(e){return e.replaceAll("''","''''").replace(/^$/,"''").replaceAll("~","~0").replaceAll(".","~1")}function Ct(e){return e.replaceAll("~1",".").replaceAll("~0","~").replace(/^''$/,"").replaceAll("''''","''")}function Pt(e,t){if(""===t)return e;if(null===e||"object"!==Et(e))throw new TypeError("Unexpected non-object type");var n=t.indexOf(".");if(-1!==n){var r=e[Ct(t.slice(0,n))];return void 0===r?void 0:Pt(r,t.slice(n+1))}return e[Ct(t)]}function kt(e,t,n){if(""===t)return n;if(!e||"object"!==Et(e))throw new TypeError("Unexpected non-object type");if("__proto__"===t)throw new TypeError("Invalid property");var r=t.indexOf(".");return-1!==r?kt(e[Ct(t.slice(0,r))],t.slice(r+1),n):(e[Ct(t)]=n,e)}function Rt(e){return null===e?"null":Array.isArray(e)?"array":Et(e)}function Ft(e,t,n){return e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e}var Lt=Object.keys,qt=Object.hasOwn,Ut=Array.isArray,Mt=["type","replaced","iterateIn","iterateUnsetNumeric","addLength"];function Vt(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}function Kt(e,t){var n,r;if(""===e.keypath)return-1;var o=null!==(n=e.keypath.match(/\./g))&&void 0!==n?n:0,i=null!==(r=t.keypath.match(/\./g))&&void 0!==r?r:0;return o&&(o=o.length),i&&(i=i.length),o>i?-1:o<i?1:e.keypath<t.keypath?-1:e.keypath>t.keypath?1:0}var Gt=ht((function e(t){pt(this,e),this.options=t,this.plainObjectReplacers=[],this.nonplainObjectReplacers=[],this.revivers={},this.types={}}),[{key:"stringify",value:function(e,t,n,r){r=gt(gt(gt({},this.options),r),{},{stringification:!0});var o=this.encapsulate(e,null,r);return Ut(o)?JSON.stringify(o[0],t,n):o.then((function(e){return JSON.stringify(e,t,n)}))}},{key:"stringifySync",value:function(e,t,n,r){return this.stringify(e,t,n,gt(gt({throwOnBadSyncType:!0},r),{},{sync:!0}))}},{key:"stringifyAsync",value:function(e,t,n,r){return this.stringify(e,t,n,gt(gt({throwOnBadSyncType:!0},r),{},{sync:!1}))}},{key:"parse",value:function(e,t,n){return n=gt(gt(gt({},this.options),n),{},{parse:!0}),this.revive(JSON.parse(e,t),n)}},{key:"parseSync",value:function(e,t,n){return this.parse(e,t,gt(gt({throwOnBadSyncType:!0},n),{},{sync:!0}))}},{key:"parseAsync",value:function(e,t,n){return this.parse(e,t,gt(gt({throwOnBadSyncType:!0},n),{},{sync:!1}))}},{key:"specialTypeNames",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.returnTypeNames=!0,this.encapsulate(e,t,n)}},{key:"rootTypeName",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.iterateNone=!0,this.encapsulate(e,t,n)}},{key:"encapsulate",value:function(e,t,n){var r=this,o=gt(gt({sync:!0},this.options),n),i=o.sync,a={},s=[],c=[],u=[],l=!("cyclic"in o)||o.cyclic,_=o.encapsulateObserver,d=function(e){var t=Object.values(a);if(o.iterateNone)return t.length?t[0]:Rt(e);if(t.length){if(o.returnTypeNames)return function(e){return function(e){if(Array.isArray(e))return ft(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||wt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(new Set(t));e&&At(e)&&!qt(e,"$types")?e.$types=a:e={$:e,$types:{$:a}}}else Bt(e)&&qt(e,"$types")&&(e={$:e,$types:!0});return!o.returnTypeNames&&e},f=Vt((function(e,t){return Ft(Promise.all(t.map((function(e){return e[1].p}))),(function(n){return Ft(Promise.all(n.map(Vt((function(n){var r=!1,o=[],i=mt(t.splice(0,1),1),a=mt(i[0],7),s=a[0],c=a[2],u=a[3],l=a[4],_=a[5],d=a[6],p=h(s,n,c,u,o,!0,d),y=Nt(p,Dt);return function(e,t){var n=e();return n&&n.then?n.then(t):t(n)}((function(){if(s&&y)return Ft(p.p,(function(t){l[_]=t;var n=f(e,o);return r=!0,n}))}),(function(t){return r?t:(s?l[_]=p:e=y?p.p:p,f(e,o))}))})))),(function(){return e}))}))})),p=function(e,t,n){Object.assign(e,t);var r=Mt.map((function(t){var n=e[t];return delete e[t],n}));n(),Mt.forEach((function(t,n){e[t]=r[n]}))},h=function(e,t,n,i,u,l,d){var f,b={},g=Et(t),m=_?function(r){var o,a=null!==(o=null!=d?d:i.type)&&void 0!==o?o:Rt(t);_(Object.assign(null!=r?r:b,{keypath:e,value:t,cyclic:n,stateObj:i,promisesData:u,resolvingTypesonPromise:l,awaitingTypesonPromise:Nt(t,Dt)},{type:a}))}:null;if(["string","boolean","number","undefined"].includes(g))return void 0===t||Number.isNaN(t)||t===Number.NEGATIVE_INFINITY||t===Number.POSITIVE_INFINITY||0===t?(f=i.replaced?t:y(e,t,i,u,!1,l,m))!==t&&(b={replaced:f}):f=t,m&&m(),f;if(null===t)return m&&m(),t;if(n&&!i.iterateIn&&!i.iterateUnsetNumeric&&t&&"object"===Et(t)){var v=s.indexOf(t);if(-1!==v)return a[e]="#",m&&m({cyclicKeypath:c[v]}),"#"+c[v];!0===n&&(s.push(t),c.push(e))}var E,w=At(t),D=Ut(t),I=(w||D)&&(!r.plainObjectReplacers.length||i.replaced)||i.iterateIn?t:y(e,t,i,u,w||D,null,m);if(I!==t?(f=I,b={replaced:I}):""===e&&Nt(t,Dt)?(u.push([e,t,n,i,void 0,void 0,i.type]),f=t):D&&"object"!==i.iterateIn||"array"===i.iterateIn?(E=new Array(t.length),b={clone:E}):(["function","symbol"].includes(Et(t))||"toJSON"in t||Nt(t,Dt)||Nt(t,Promise)||Nt(t,ArrayBuffer))&&!w&&"object"!==i.iterateIn?f=t:(E={},i.addLength&&(E.length=t.length),b={clone:E}),m&&m(),o.iterateNone)return null!=E?E:f;if(!E)return f;if(i.iterateIn){var O=function(r){var o={ownKeys:qt(t,r)};p(i,o,(function(){var o=e+(e?".":"")+jt(r),a=h(o,t[r],Boolean(n),i,u,l);Nt(a,Dt)?u.push([o,a,Boolean(n),i,E,r,i.type]):void 0!==a&&(E[r]=a)}))};for(var S in t)O(S);m&&m({endIterateIn:!0,end:!0})}else Lt(t).forEach((function(r){var o=e+(e?".":"")+jt(r);p(i,{ownKeys:!0},(function(){var e=h(o,t[r],Boolean(n),i,u,l);Nt(e,Dt)?u.push([o,e,Boolean(n),i,E,r,i.type]):void 0!==e&&(E[r]=e)}))})),m&&m({endIterateOwn:!0,end:!0});if(i.iterateUnsetNumeric){for(var T=t.length,N=function(r){if(!(r in t)){var o="".concat(e).concat(e?".":"").concat(String(r));p(i,{ownKeys:!1},(function(){var e=h(o,void 0,Boolean(n),i,u,l);Nt(e,Dt)?u.push([o,e,Boolean(n),i,E,r,i.type]):void 0!==e&&(E[r]=e)}))}},A=0;A<T;A++)N(A);m&&m({endIterateUnsetNumeric:!0,end:!0})}return E},y=function(e,t,n,o,s,c,u){for(var _=s?r.plainObjectReplacers:r.nonplainObjectReplacers,d=_.length;d--;){var f=_[d];if(f.test(t,n)){var p=f.type;if(r.revivers[p]){var y=a[e];a[e]=y?[p].concat(y):p}if(Object.assign(n,{type:p,replaced:!0}),(i||!f.replaceAsync)&&!f.replace)return u&&u({typeDetected:!0}),h(e,t,l&&"readonly",n,o,c,p);u&&u({replacing:!0});var b=void 0;if(i||!f.replaceAsync){if(void 0===f.replace)throw new TypeError("Missing replacer");b=f.replace(t,n)}else b=f.replaceAsync(t,n);return h(e,b,l&&"readonly",n,o,c,p)}}return t},b=h("",e,l,null!=t?t:{},u);if(u.length)return i&&o.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Promise.resolve(f(b,u)).then(d);if(!i&&o.throwOnBadSyncType)throw new TypeError("Async method requested but sync result obtained");return o.stringification&&i?[d(b)]:i?d(b):Promise.resolve(d(b))}},{key:"encapsulateSync",value:function(e,t,n){return this.encapsulate(e,t,gt(gt({throwOnBadSyncType:!0},n),{},{sync:!0}))}},{key:"encapsulateAsync",value:function(e,t,n){return this.encapsulate(e,t,gt(gt({throwOnBadSyncType:!0},n),{},{sync:!1}))}},{key:"revive",value:function(e,t){var n=this,r=gt(gt({sync:!0},this.options),t),o=r.sync;function i(e){if(o)return e;if(r.throwOnBadSyncType)throw new TypeError("Async method requested but sync result obtained");return Promise.resolve(e)}if(!e||"object"!==Et(e)||Array.isArray(e))return i(e);var a=e.$types;if(!0===a)return i(e.$);if(!a||"object"!==Et(a)||Array.isArray(a))return i(e);var s=[],c={},u=!0;a.$&&At(a.$)&&(e=e.$,a=a.$,u=!1);var l=function(e,t){var r,i=mt(null!==(r=n.revivers[e])&&void 0!==r?r:[],1)[0];if(!i)throw new Error("Unregistered type: "+e);if(o&&!("revive"in i))return t;if(!o&&i.reviveAsync)return i.reviveAsync(t,c);if(i.revive)return i.revive(t,c);throw new Error("Missing reviver")},_=[];function d(e){return Nt(e,Ht)?void 0:e}var f,p=function(){var t=[];if(!a)throw new Error("Found bad `types`");if(Object.entries(a).forEach((function(e){var r=mt(e,2),o=r[0],i=r[1];"#"!==i&&[].concat(i).forEach((function(e){var r;mt(null!==(r=n.revivers[e])&&void 0!==r?r:[null,{}],2)[1].plain&&(t.push({keypath:o,type:e}),delete a[o])}))})),t.length)return t.sort(Kt),t.reduce((function t(n,r){var o=r.keypath,i=r.type;if(St(n))return n.then((function(e){return t(e,{keypath:o,type:i})}));var a=Pt(e,o);if(Nt(a=l(i,a),Dt))return a.then((function(t){var n=kt(e,o,t);n===t&&(e=n)}));var s=kt(e,o,a);s===a&&(e=s)}),void 0)}();return Nt(p,Dt)?f=p.then((function(){return e})):(f=function e(t,n,r,o,i){if(!u||"$types"!==t){var c=a[t],d=Ut(n);if(d||At(n)){var f=d?new Array(n.length):{};for(Lt(n).forEach((function(o){var i=e(t+(t?".":"")+jt(o),n[o],null!=r?r:f,f,o),a=function(e){return Nt(e,Ht)?f[o]=void 0:void 0!==e&&(f[o]=e),e};Nt(i,Dt)?_.push(i.then((function(e){return a(e)}))):a(i)})),n=f;s.length;){var p=mt(s[0],4),h=p[0],y=p[1],b=p[2],g=p[3],m=Pt(h,y);if(void 0===m)break;b[g]=m,s.splice(0,1)}}if(!c)return n;if("#"===c){var v=Pt(r,n.slice(1));return void 0===v&&s.push([r,n.slice(1),o,i]),v}return[].concat(c).reduce((function e(t,n){if(Nt(t,Dt))return t.then((function(t){return e(t,n)}));if("string"!=typeof n)throw new TypeError("Bad type JSON");return l(n,t)}),n)}}("",e,null),_.length&&(f=Dt.resolve(f).then((function(e){return Dt.all([e].concat(_))})).then((function(e){return mt(e,1)[0]})))),St(f)?o&&r.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Nt(f,Dt)?f.p.then(d):f:!o&&r.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():o?d(f):Promise.resolve(d(f))}},{key:"reviveSync",value:function(e,t){return this.revive(e,gt(gt({throwOnBadSyncType:!0},t),{},{sync:!0}))}},{key:"reviveAsync",value:function(e,t){return this.revive(e,gt(gt({throwOnBadSyncType:!0},t),{},{sync:!1}))}},{key:"register",value:function(e,t){var n=this,r=null!=t?t:{},o=function(e){Ut(e)?e.forEach((function(e){o(e)})):Lt(e).forEach((function(t){var o;if("#"===t)throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");if(Qt.includes(t))throw new TypeError("Plain JSON object types are reserved as type names");var i=e[t],a=i&&"function"!=typeof i&&!Array.isArray(i)&&i.testPlainObjects?n.plainObjectReplacers:n.nonplainObjectReplacers,s=a.filter((function(e){return e.type===t}));if(s.length&&(a.splice(a.indexOf(s[0]),1),delete n.revivers[t],delete n.types[t]),"function"==typeof i){var c=i;i={test:function(e){return e&&e.constructor===c},replace:function(e){return gt({},e)},revive:function(e){return Object.assign(Object.create(c.prototype),e)}}}else if(Ut(i)){var u=mt(i,3);i={test:u[0],replace:u[1],revive:u[2]}}if(null!==(o=i)&&void 0!==o&&o.test){var l={type:t,test:i.test.bind(i)};i.replace&&(l.replace=i.replace.bind(i)),i.replaceAsync&&(l.replaceAsync=i.replaceAsync.bind(i));var _="number"==typeof r.fallback?r.fallback:r.fallback?0:Number.POSITIVE_INFINITY;if(i.testPlainObjects?n.plainObjectReplacers.splice(_,0,l):n.nonplainObjectReplacers.splice(_,0,l),i.revive||i.reviveAsync){var d={};i.revive&&(d.revive=i.revive.bind(i)),i.reviveAsync&&(d.reviveAsync=i.reviveAsync.bind(i)),n.revivers[t]=[d,{plain:i.testPlainObjects}]}n.types[t]=i}}))};return[].concat(e).forEach((function(e){o(e)})),this}}]),Ht=ht((function e(){pt(this,e)}));Ht.__typeson__type__="TypesonUndefined";for(var Qt=["null","boolean","number","string","array","object"],Wt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",zt=new Uint8Array(256),Yt=0;Yt<64;Yt++)zt[Wt.codePointAt(Yt)]=Yt;var $t=function(e,t,n){null==n&&(n=e.byteLength);for(var r=new Uint8Array(e,0,n),o=r.length,i="",a=0;a<o;a+=3)i+=Wt[r[a]>>2],i+=Wt[(3&r[a])<<4|r[a+1]>>4],i+=Wt[(15&r[a+1])<<2|r[a+2]>>6],i+=Wt[63&r[a+2]];return o%3==2?i=i.slice(0,-1)+"=":o%3==1&&(i=i.slice(0,-2)+"=="),i},Jt=function(e,t){var n=e.length;if(n%4)throw new Error("Bad base64 length: not divisible by four");var r,o,i,a,s=.75*e.length,c=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);for(var u=new ArrayBuffer(s,t),l=new Uint8Array(u),_=0;_<n;_+=4)r=zt[e.codePointAt(_)],o=zt[e.codePointAt(_+1)],i=zt[e.codePointAt(_+2)],a=zt[e.codePointAt(_+3)],l[c++]=r<<2|o>>4,l[c++]=(15&o)<<4|i>>2,l[c++]=(3&i)<<6|63&a;return u};const Xt={arraybuffer:{test:e=>"ArrayBuffer"===Tt(e),replace(e,t){t.buffers||(t.buffers=[]);const n=t.buffers.indexOf(e);return-1!==n?{index:n}:(t.buffers.push(e),{s:$t(e),maxByteLength:e.maxByteLength,resizable:e.resizable})},revive(e,t){if(t.buffers||(t.buffers=[]),Object.hasOwn(e,"index"))return t.buffers[e.index];const n=Jt(e.s,e.resizable?{maxByteLength:e.maxByteLength}:void 0);return t.buffers.push(n),n}}},Zt={bigintObject:{test:e=>"object"==typeof e&&Nt(e,BigInt),replace:String,revive:e=>new Object(BigInt(e))}},en={bigint:{test:e=>"bigint"==typeof e,replace:String,revive:e=>BigInt(e)}};function tn(e){return new Uint8Array(e).reduce(((e,t)=>e+String.fromCodePoint(t)),"")}function nn(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t.buffer}const rn={blob:{test:e=>"Blob"===Tt(e),replace(e){const t=new XMLHttpRequest;if(t.overrideMimeType("text/plain; charset=x-user-defined"),t.open("GET",URL.createObjectURL(e),!1),t.send(),200!==t.status&&0!==t.status)throw new Error("Bad Blob access: "+t.status);return{type:e.type,stringContents:t.responseText}},revive(e){const{type:t,stringContents:n}=e;return new Blob([nn(n)],{type:t})},replaceAsync:e=>new Dt(((t,n)=>{const r=new FileReader;r.addEventListener("load",(()=>{t({type:e.type,stringContents:tn(r.result)})})),r.addEventListener("error",(()=>{n(r.error)})),r.readAsArrayBuffer(e)}))}},on={cryptokey:{test:e=>"CryptoKey"===Tt(e)&&e.extractable,replaceAsync:e=>new Dt((async(t,n)=>{let r;try{r=await crypto.subtle.exportKey("jwk",e)}catch(t){return void n(t)}t({jwk:r,algorithm:e.algorithm,usages:e.usages})})),revive(e){const{jwk:t,algorithm:n,usages:r}=e;return crypto.subtle.importKey("jwk",t,n,!0,r)}}},an={dataview:{test:e=>"DataView"===Tt(e),replace({buffer:e,byteOffset:t,byteLength:n},r){r.buffers||(r.buffers=[]);const o=r.buffers.indexOf(e);return-1!==o?{index:o,byteOffset:t,byteLength:n}:(r.buffers.push(e),{encoded:$t(e),maxByteLength:e.maxByteLength,resizable:e.resizable,byteOffset:t,byteLength:n})},revive(e,t){t.buffers||(t.buffers=[]);const{byteOffset:n,byteLength:r,encoded:o,index:i,maxByteLength:a,resizable:s}=e;let c;return"index"in e?c=t.buffers[i]:(c=Jt(o,s?{maxByteLength:a}:a),t.buffers.push(c)),new DataView(c,n,r)}}},sn={date:{test:e=>"Date"===Tt(e),replace(e){const t=e.getTime();return Number.isNaN(t)?"NaN":t},revive:e=>"NaN"===e?new Date(Number.NaN):new Date(e)}},cn={domexception:{test:e=>"DOMException"===Tt(e),replace:e=>({name:e.name,message:e.message}),revive:({message:e,name:t})=>new DOMException(e,t)}},un={};function ln(e){un[e.name.toLowerCase()]={test:t=>Tt(t)===e.name,replace:e=>e.is2D?{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}:{m11:e.m11,m12:e.m12,m13:e.m13,m14:e.m14,m21:e.m21,m22:e.m22,m23:e.m23,m24:e.m24,m31:e.m31,m32:e.m32,m33:e.m33,m34:e.m34,m41:e.m41,m42:e.m42,m43:e.m43,m44:e.m44},revive:t=>Object.hasOwn(t,"a")?new e([t.a,t.b,t.c,t.d,t.e,t.f]):new e([t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44])}}"undefined"!=typeof DOMMatrix&&ln(DOMMatrix),"undefined"!=typeof DOMMatrixReadOnly&&ln(DOMMatrixReadOnly);const _n={};function dn(e){_n[e.name.toLowerCase()]={test:t=>Tt(t)===e.name,replace:e=>({x:e.x,y:e.y,z:e.z,w:e.w}),revive:({x:t,y:n,z:r,w:o})=>new e(t,n,r,o)}}"undefined"!=typeof DOMPoint&&dn(DOMPoint),"undefined"!=typeof DOMPointReadOnly&&dn(DOMPointReadOnly);const fn={domquad:{test:e=>"DOMQuad"===Tt(e),replace:e=>({p1:e.p1,p2:e.p2,p3:e.p3,p4:e.p4}),revive:({p1:e,p2:t,p3:n,p4:r})=>new DOMQuad(e,t,n,r)}},pn={};function hn(e){pn[e.name.toLowerCase()]={test:t=>Tt(t)===e.name,replace:e=>({x:e.x,y:e.y,width:e.width,height:e.height}),revive:({x:t,y:n,width:r,height:o})=>new e(t,n,r,o)}}"undefined"!=typeof DOMRect&&hn(DOMRect),"undefined"!=typeof DOMRectReadOnly&&hn(DOMRectReadOnly);const yn={error:{test:e=>"Error"===Tt(e),replace:({name:e,message:t,cause:n,stack:r,fileName:o,lineNumber:i,columnNumber:a})=>({name:e,message:t,cause:n,stack:r,fileName:o,lineNumber:i,columnNumber:a}),revive(e){const t=new Error(e.message);return t.name=e.name,t.cause=e.cause,t.stack=e.stack,t.fileName=e.fileName,t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}}},bn={};function gn(e){bn[e.name.toLowerCase()]={test:t=>Nt(t,e),replace:({name:e,message:t,cause:n,stack:r,fileName:o,lineNumber:i,columnNumber:a,errors:s})=>({name:e,message:t,cause:n,stack:r,fileName:o,lineNumber:i,columnNumber:a,errors:s}),revive(t){const n="undefined"!=typeof AggregateError&&e===AggregateError?new e(t.errors,t.message):new e(t.message);return n.name=t.name,n.cause=t.cause,n.stack=t.stack,n.fileName=t.fileName,n.lineNumber=t.lineNumber,n.columnNumber=t.columnNumber,n}}}[TypeError,RangeError,SyntaxError,ReferenceError,EvalError,URIError].forEach((e=>gn(e))),"undefined"!=typeof AggregateError&&gn(AggregateError),"function"==typeof InternalError&&gn(InternalError);const mn={file:{test:e=>"File"===Tt(e),replace(e){const t=new XMLHttpRequest;if(t.overrideMimeType("text/plain; charset=x-user-defined"),t.open("GET",URL.createObjectURL(e),!1),t.send(),200!==t.status&&0!==t.status)throw new Error("Bad File access: "+t.status);return{type:e.type,stringContents:t.responseText,name:e.name,lastModified:e.lastModified}},revive:({name:e,type:t,stringContents:n,lastModified:r})=>new File([nn(n)],e,{type:t,lastModified:r}),replaceAsync:e=>new Dt((function(t,n){const r=new FileReader;r.addEventListener("load",(function(){t({type:e.type,stringContents:tn(r.result),name:e.name,lastModified:e.lastModified})})),r.addEventListener("error",(function(){n(r.error)})),r.readAsArrayBuffer(e)}))}},vn={file:mn.file,filelist:{test:e=>"FileList"===Tt(e),replace(e){const t=[];for(let n=0;n<e.length;n++)t[n]=e.item(n);return t},revive(e){class t{constructor(){this._files=arguments[0],this.length=this._files.length}item(e){return this._files[e]}get[Symbol.toStringTag](){return"FileList"}}return new t(e)}}},En={imagebitmap:{test:e=>"ImageBitmap"===Tt(e)||e&&e.dataset&&"ImageBitmap"===e.dataset.toStringTag,replace(e){const t=document.createElement("canvas");return t.getContext("2d").drawImage(e,0,0),{width:e.width,height:e.height,dataURL:t.toDataURL()}},revive(e){const t="undefined"==typeof OffscreenCanvas?document.createElement("canvas"):new OffscreenCanvas(e.width,e.height),n=t.getContext("2d"),r=document.createElement("img");return r.addEventListener("load",(function(){n.drawImage(r,0,0)})),r.src=e.dataURL,"undefined"==typeof OffscreenCanvas?t:t.transferToImageBitmap()},reviveAsync(e){const t=document.createElement("canvas"),n=t.getContext("2d"),r=document.createElement("img");return r.addEventListener("load",(function(){n.drawImage(r,0,0)})),r.src=e.dataURL,new Dt((async(e,n)=>{try{e(await createImageBitmap(t))}catch(e){n(e)}}))}}},wn={imagedata:{test:e=>"ImageData"===Tt(e),replace:e=>({array:[...e.data],width:e.width,height:e.height}),revive:e=>new ImageData(new Uint8ClampedArray(e.array),e.width,e.height)}},Dn={infinity:{test:e=>e===Number.POSITIVE_INFINITY,replace:()=>"Infinity",revive:()=>Number.POSITIVE_INFINITY}},In={map:{test:e=>"Map"===Tt(e),replace:e=>[...e.entries()],revive:e=>new Map(e)}},On={nan:{test:e=>Number.isNaN(e),replace:()=>"NaN",revive:()=>Number.NaN}},Sn={negativeInfinity:{test:e=>e===Number.NEGATIVE_INFINITY,replace:()=>"-Infinity",revive:()=>Number.NEGATIVE_INFINITY}},Tn={negativeZero:{test:e=>Object.is(e,-0),replace:()=>0,revive:()=>-0}},Nn={StringObject:{test:e=>"String"===Tt(e)&&"object"==typeof e,replace:String,revive:e=>new String(e)},BooleanObject:{test:e=>"Boolean"===Tt(e)&&"object"==typeof e,replace:e=>e.valueOf(),revive:e=>new Boolean(e)},NumberObject:{test:e=>"Number"===Tt(e)&&"object"==typeof e,replace:Number,revive:e=>new Number(e)}},An={regexp:{test:e=>"RegExp"===Tt(e),replace:e=>({source:e.source,flags:(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.sticky?"y":"")+(e.unicode?"u":"")+(e.unicodeSets?"v":"")+(e.hasIndices?"d":"")+(e.dotAll?"s":"")}),revive:({source:e,flags:t})=>new RegExp(e,t)}},xn={set:{test:e=>"Set"===Tt(e),replace:e=>[...e.values()],revive:e=>new Set(e)}},Bn={};"function"==typeof Int8Array&&[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,..."function"==typeof BigInt64Array?[BigInt64Array,BigUint64Array]:[]].forEach((e=>function(e){const t=e.name;Bn[t.toLowerCase()]={test:e=>Tt(e)===t,replace:e=>(0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e:e.slice(0)).buffer,revive:t=>"ArrayBuffer"===Tt(t)?new e(t):t}}(e)));const jn={};"function"==typeof Int8Array&&[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,..."function"==typeof BigInt64Array?[BigInt64Array,BigUint64Array]:[]].forEach((e=>function(e){const t=e.name;jn[t.toLowerCase()]={test:e=>Tt(e)===t,replace({buffer:e,byteOffset:t,length:n},r){r.buffers||(r.buffers=[]);const o=r.buffers.indexOf(e);return-1!==o?{index:o,byteOffset:t,length:n}:(r.buffers.push(e),{maxByteLength:e.maxByteLength,resizable:e.resizable,encoded:$t(e),byteOffset:t,length:n})},revive(t,n){n.buffers||(n.buffers=[]);const{byteOffset:r,length:o,encoded:i,index:a,maxByteLength:s,resizable:c}=t;let u;return"index"in t?u=n.buffers[a]:(u=Jt(i,c?{maxByteLength:s}:void 0),n.buffers.push(u)),new e(u,r,o)}}}(e)));const Cn={undef:{test:(e,t)=>void 0===e&&(t.ownKeys||!("ownKeys"in t)),replace:()=>0,revive:()=>new Ht}},Pn={userObject:{test:e=>xt(e),replace:e=>({...e}),revive:e=>e}},kn=[{arrayNonindexKeys:{testPlainObjects:!0,test:(e,t)=>!!Array.isArray(e)&&(Object.keys(e).some((e=>String(Number.parseInt(e))!==e))&&(t.iterateIn="object",t.addLength=!0),!0),replace:(e,t)=>(t.iterateUnsetNumeric=!0,e),revive(e){if(Array.isArray(e))return e;const t=[];return Object.entries(e).forEach((([e,n])=>{t[e]=n})),t}}},{sparseUndefined:{test:(e,t)=>void 0===e&&!1===t.ownKeys,replace:()=>0,revive(){}}}],Rn=[Pn,Cn,kn,Nn,[On,Dn,Sn,Tn],sn,An,wn,En,mn,vn,rn,yn,bn].concat("function"==typeof Map?In:[],"function"==typeof Set?xn:[],"function"==typeof ArrayBuffer?Xt:[],"function"==typeof Uint8Array?jn:[],"function"==typeof DataView?an:[],"undefined"!=typeof crypto?on:[],"undefined"!=typeof BigInt?[en,Zt]:[],"undefined"!=typeof DOMException?cn:[],"undefined"!=typeof DOMRect?pn:[],"undefined"!=typeof DOMPoint?_n:[],"undefined"!=typeof DOMQuad?fn:[],"undefined"!=typeof DOMMatrix?un:[]).concat({checkDataCloneException:{test(e){const t={}.toString.call(e).slice(8,-1);if(["symbol","function"].includes(typeof e)||["Arguments","Module","Promise","WeakMap","WeakSet","Event","MessageChannel"].includes(t)||e&&"object"==typeof e&&"number"==typeof e.nodeType&&"function"==typeof e.insertBefore)throw new DOMException("The object cannot be cloned.","DataCloneError");return!1}}});let Fn=(new Gt).register(Rn);function Ln(e){Fn=(new Gt).register(e(Rn))}function qn(e,t){let n;try{n=Fn.stringifySync(e)}catch(e){if(Nt(e,ReferenceError)||Nt(e,oe))throw re("DataCloneError","The object cannot be cloned.");throw e}return t&&t(n),n}function Un(e){return Fn.parse(e)}function Mn(e){return Un(qn(e))}var Vn=Object.freeze({__proto__:null,clone:Mn,decode:Un,encode:qn,register:Ln});const Kn=["objectStore","keyPath","multiEntry","unique"];function Gn(){throw new TypeError("Illegal constructor")}const Hn=Gn;function Qn(e,t,n,r,o,i,a,s,c,u,l,_,d){t&&(e=1),e&&s.push("LIMIT",String(e));const f="count"===i;y.DEBUG&&console.log("Trying to fetch data for Index",s.join(" "),c),u.executeSql(s.join(" "),c,(function(e,s){const c=[];let u=0;const l=f?()=>{}:"key"===i?e=>He(I(e.key)):e=>Un(I(e.value));if(n.multiEntry){const e=A(n.name),i=Ge(o,n.multiEntry);for(let n=0;n<s.rows.length;n++){const _=s.rows.item(n),d=He(_[e]);let f;if(r&&(a&&o.some((e=>d.includes(e)))||Ve(JSON.stringify(i).slice(1,-1),_[e]))?(u++,f=_):r||a||void 0!==d&&(u+=Array.isArray(d)?d.length:1,f=_),f&&(c.push(l(f)),t))break}}else{for(let e=0;e<s.rows.length;e++){const t=s.rows.item(e);t&&c.push(l(t))}u=c.length}_(f?u:0===u?t?void 0:[]:t?c[0]:c)}),d)}function Wn(e,t,n,r,o){const i=e||!H(n),a=["SELECT",O("count"===r?"key":r)+(t.multiEntry?", "+N(t.name):""),"FROM",T(t.objectStore.__currentName),"WHERE",N(t.name),"NOT NULL"],s=[];if(i)if(o)a.push("AND ("),n.forEach(((e,n)=>{n>0&&a.push("OR"),a.push(N(t.name),"LIKE ? ESCAPE '^' "),s.push("%"+x(Ge(e,t.multiEntry))+"%")})),a.push(")");else if(t.multiEntry)a.push("AND",N(t.name),"LIKE ? ESCAPE '^'"),Array.isArray(n)?s.push("%"+x(JSON.stringify(Ge(n,t.multiEntry)).slice(1,-1))+"%"):s.push("%"+x(Ge(n,t.multiEntry))+"%");else{nt(rt(n,e),N(t.name),a,s,!0,!1)}return[e,t,i,n,r,o,a,s]}Gn.__createInstance=function(e,t){function n(){const n=this;n[Symbol.toStringTag]="IDBIndex",F(n,Kn),n.__objectStore=e,n.__name=n.__originalName=t.columnName,n.__keyPath=Array.isArray(t.keyPath)?t.keyPath.slice():t.keyPath;const{optionalParams:r}=t;n.__multiEntry=Boolean(r&&r.multiEntry),n.__unique=Boolean(r&&r.unique),n.__deleted=Boolean(t.__deleted),n.__objectStore.__cursors=t.cursors||[],Object.defineProperty(n,"__currentName",{get:()=>"__pendingName"in n?n.__pendingName:n.name}),Object.defineProperty(n,"name",{enumerable:!1,configurable:!1,get(){return this.__name},set(t){const n=this;t=V(t);const r=n.name;if(_t.__assertVersionChange(n.objectStore.transaction),_t.__assertActive(n.objectStore.transaction),Hn.__invalidStateIfDeleted(n),Yn.__invalidStateIfDeleted(n),t===r)return;if(n.objectStore.__indexes[t]&&!n.objectStore.__indexes[t].__deleted&&!n.objectStore.__indexes[t].__pendingDelete)throw re("ConstraintError",'Index "'+t+'" already exists on '+n.objectStore.__currentName);n.__name=t;const{objectStore:o}=n;delete o.__indexes[r],o.__indexes[t]=n,o.indexNames.splice(o.indexNames.indexOf(r),1,t);const i=o.transaction.__storeHandles[o.name],a=i.__indexHandles[r];a.__name=t,i.__indexHandles[t]=a,n.__pendingName=r;const s=[["key","BLOB "+(o.autoIncrement?"UNIQUE, inc INTEGER PRIMARY KEY AUTOINCREMENT":"PRIMARY KEY")],["value","BLOB"]].concat([...o.indexNames].filter((e=>e!==t)).map((e=>[N(e),"BLOB"])));n.__renameIndex(o,r,t,s,(function(t,n){Hn.__updateIndexList(e,t,(function(e){delete i.__pendingName,n(e)}))}))}})}return n.prototype=Hn.prototype,new n},Gn.__invalidStateIfDeleted=function(e,t){if(e.__deleted||e.__pendingDelete||e.__pendingCreate&&e.objectStore.transaction&&e.objectStore.transaction.__errored)throw re("InvalidStateError",t||"This index has been deleted")},Gn.__clone=function(e,t){const n=Gn.__createInstance(t,{columnName:e.name,keyPath:e.keyPath,optionalParams:{multiEntry:e.multiEntry,unique:e.unique}});return["__pendingCreate","__pendingDelete","__deleted","__originalName","__recreated"].forEach((t=>{n[t]=e[t]})),n},Gn.__createIndex=function(e,t){const n=t.name,r=e.__currentName,o=e.__indexes[n];t.__pendingCreate=!0,e.indexNames.push(n),e.__indexes[n]=t;let i=e.__indexHandles[n];(!i||t.__pendingDelete||t.__deleted||i.__pendingDelete||i.__deleted)&&(i=e.__indexHandles[n]=Gn.__clone(t,e));const{transaction:a}=e;a.__addNonRequestToTransactionQueue((function(a,s,c,u){const l=o&&(o.__deleted||o.__recreated);let _={};function d(e,t){u(re("UnknownError",'Could not create index "'+n+'"'+t.code+"::"+t.message,t))}function f(o){Gn.__updateIndexList(e,o,(function(){o.executeSql('SELECT "key", "value" FROM '+T(r),[],(function(o,a){y.DEBUG&&console.log("Adding existing "+r+" records to the "+n+" index"),function s(l){if(l<a.rows.length)try{const e=Fe(Un(I(a.rows.item(l).value)),t.keyPath,t.multiEntry);if("invalid"in e&&e.invalid||"failure"in e&&e.failure)throw new Error("Go to catch; ignore bad indexKey");const i=Ge(e.value,t.multiEntry);if(t.unique){if(_[i])return _={},void u(re("ConstraintError","Duplicate values already exist within the store"));_[i]=!0}o.executeSql("UPDATE "+T(r)+" SET "+N(n)+' = ? WHERE "key" = ?',[D(i),a.rows.item(l).key],(function(){s(l+1)}),d)}catch(e){s(l+1)}else delete t.__pendingCreate,delete i.__pendingCreate,t.__deleted&&(delete t.__deleted,delete i.__deleted,t.__recreated=!0,i.__recreated=!0),_={},c(e)}(0)}),d)}),d)}const p=T(r),h=N(t.name);if(l)f(a);else{const e=["ALTER TABLE",p,"ADD",h,"BLOB"].join(" ");y.DEBUG&&console.log(e),a.executeSql(e,[],(function(e){y.useSQLiteIndexes?e.executeSql('CREATE INDEX IF NOT EXISTS "'+p.slice(1,-1)+"^5"+h.slice(1,-1)+'" ON '+p+"("+h+")",[],f,d):f(e)}),d)}}))},Gn.__deleteIndex=function(e,t){t.__pendingDelete=!0;const n=e.__indexHandles[t.name];n&&(n.__pendingDelete=!0),e.indexNames.splice(e.indexNames.indexOf(t.name),1);const{transaction:r}=e;r.__addNonRequestToTransactionQueue((function(r,o,i,a){function s(e,n){a(re("UnknownError",'Could not delete index "'+t.name+'"',n))}function c(){Gn.__updateIndexList(e,r,(function(e){delete t.__pendingDelete,delete t.__recreated,t.__deleted=!0,n&&(n.__deleted=!0,delete n.__pendingDelete),i(e)}),s)}y.useSQLiteIndexes?r.executeSql("DROP INDEX IF EXISTS "+O(T(e.name).slice(1,-1)+"^5"+N(t.name).slice(1,-1)),[],c,s):c()}))},Gn.__updateIndexList=function(e,t,n,r){const o={};for(let t=0;t<e.indexNames.length;t++){const n=e.__indexes[e.indexNames[t]];o[n.name]={columnName:n.name,keyPath:n.keyPath,optionalParams:{unique:n.unique,multiEntry:n.multiEntry},deleted:Boolean(n.__deleted)}}y.DEBUG&&console.log("Updating the index list for "+e.__currentName,o),t.executeSql('UPDATE __sys__ SET "indexList" = ? WHERE "name" = ?',[JSON.stringify(o),D(e.__currentName)],(function(){n(e)}),r)},Gn.prototype.__fetchIndexData=function(e,t,n,r){const o=this;if(void 0!==r&&(r=M(r,"unsigned long")),Gn.__invalidStateIfDeleted(o),Yn.__invalidStateIfDeleted(o.objectStore),o.objectStore.__deleted)throw re("InvalidStateError","This index's object store has been deleted");if(_t.__assertActive(o.objectStore.transaction),n&&H(e))throw re("DataError","No key or range was specified");const i=Wn(n,o,e,t,!1);return o.objectStore.transaction.__addToTransactionQueue((function(...e){Qn(r,...i,...e)}),void 0,o)},Gn.prototype.openCursor=function(){const e=this,[t,n]=arguments,r=Ar.__createInstance(t,n,e.objectStore,e,A(e.name),"value");return e.__objectStore.__cursors.push(r),r.__request},Gn.prototype.openKeyCursor=function(){const e=this,[t,n]=arguments,r=Sr.__createInstance(t,n,e.objectStore,e,A(e.name),"key");return e.__objectStore.__cursors.push(r),r.__request},Gn.prototype.get=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBIndex.get`.");return this.__fetchIndexData(e,"value",!0)},Gn.prototype.getKey=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBIndex.getKey`.");return this.__fetchIndexData(e,"key",!0)},Gn.prototype.getAll=function(){const[e,t]=arguments;return this.__fetchIndexData(e,"value",!1,t)},Gn.prototype.getAllKeys=function(){const[e,t]=arguments;return this.__fetchIndexData(e,"key",!1,t)},Gn.prototype.count=function(){const e=this,t=arguments[0];return B(t,et)?Ar.__createInstance(t,"next",e.objectStore,e,A(e.name),"value",!0).__request:e.__fetchIndexData(t,"count",!1)},Gn.prototype.__renameIndex=function(e,t,n,r=[],o=null){const i=e.__currentName,a=T(i),s=N(n),c=O("tmp_"+T(i).slice(1,-1)),u=r.map((e=>e[0])),l=r.map((e=>e.join(" "))),_=l.length?l.join(", ")+", ":"",d=u.length?u.join(", ")+", ":"";e.transaction.__addNonRequestToTransactionQueue((function(e,n,r,i){function l(e,t){i(t)}function f(){o?o(e,r):r()}const p="CREATE TABLE "+c+"("+_+s+" BLOB)";y.DEBUG&&console.log(p),e.executeSql(p,[],(function(){const n="INSERT INTO "+c+"("+d+s+") SELECT "+d+N(t)+" FROM "+a;y.DEBUG&&console.log(n),e.executeSql(n,[],(function(){const t="DROP TABLE "+a;y.DEBUG&&console.log(t),e.executeSql(t,[],(function(){const t="ALTER TABLE "+c+" RENAME TO "+a;y.DEBUG&&console.log(t),e.executeSql(t,[],(function(e){if(!y.useSQLiteIndexes)return void f();const t=u.slice(2).map((t=>new be((function(n,r){const o="CREATE INDEX "+O(a.slice(1,-1)+"^5"+t.slice(1,-1))+" ON "+a+"("+t+")";y.DEBUG&&console.log(o),e.executeSql(o,[],n,(function(e,t){r(t)}))}))));t.push(new be((function(t,n){const r=O("sk_"+a.slice(1,-1)),o="DROP INDEX IF EXISTS "+r;y.DEBUG&&console.log(o),e.executeSql(o,[],(function(){const o="CREATE INDEX "+r+" ON "+a+'("key")';y.DEBUG&&console.log(o),e.executeSql(o,[],t,(function(e,t){n(t)}))}),(function(e,t){n(t)}))}))),be.all(t).then(f,i).catch((e=>{throw console.log("Index rename error"),e}))}),l)}),l)}),l)}),l)}))},Object.defineProperty(Gn,Symbol.hasInstance,{value:e=>j(e)&&"openCursor"in e&&"function"==typeof e.openCursor&&"multiEntry"in e&&"boolean"==typeof e.multiEntry}),k(Gn.prototype,Kn),P(Gn.prototype,["name"]),Gn.prototype[Symbol.toStringTag]="IDBIndexPrototype",Object.defineProperty(Gn,"prototype",{writable:!1});const zn=["keyPath","indexNames","transaction","autoIncrement"];function Yn(){throw new TypeError("Illegal constructor")}const $n=Yn;function Jn(e,t){for(var n=0,r=e.length-1;r>=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}Yn.__createInstance=function(e,t){function n(){const n=this;n[Symbol.toStringTag]="IDBObjectStore",F(this,zn),n.__name=n.__originalName=e.name,n.__keyPath=Array.isArray(e.keyPath)?e.keyPath.slice():e.keyPath,n.__transaction=t,n.__idbdb=e.idbdb,n.__cursors=e.cursors||[],n.__autoIncrement=Boolean(e.autoInc),n.__indexes={},n.__indexHandles={},n.__indexNames=at.__createInstance();const{indexList:r}=e;for(const e in r)if(Object.hasOwn(r,e)){const t=Gn.__createInstance(n,r[e]);n.__indexes[t.name]=t,t.__deleted||n.indexNames.push(t.name)}n.__oldIndexNames=n.indexNames.clone(),Object.defineProperty(this,"__currentName",{get(){return"__pendingName"in this?this.__pendingName:this.name}}),Object.defineProperty(this,"name",{enumerable:!1,configurable:!1,get(){return this.__name},set(e){const t=this;e=V(e);const n=t.name;if($n.__invalidStateIfDeleted(t),_t.__assertVersionChange(t.transaction),_t.__assertActive(t.transaction),n===e)return;if(t.__idbdb.__objectStores[e]&&!t.__idbdb.__objectStores[e].__pendingDelete)throw re("ConstraintError",'Object store "'+e+'" already exists in '+t.__idbdb.name);t.__name=e;const r=t.__idbdb.__objectStores[n];r.__name=e,t.__idbdb.__objectStores[e]=r,delete t.__idbdb.__objectStores[n],t.__idbdb.objectStoreNames.splice(t.__idbdb.objectStoreNames.indexOf(n),1,e);const o=t.transaction.__storeHandles[n];o.__name=e,t.transaction.__storeHandles[e]=o,t.__pendingName=n;const i='UPDATE __sys__ SET "name" = ? WHERE "name" = ?',a=[D(e),D(n)];y.DEBUG&&console.log(i,a),t.transaction.__addNonRequestToTransactionQueue((function(r,o,s,c){r.executeSql(i,a,(function(r){const o="ALTER TABLE "+T(n)+" RENAME TO "+T(e);y.DEBUG&&console.log(o),r.executeSql(o,[],(function(){delete t.__pendingName,s()}))}),(function(e,t){return c(t),!1}))}))}})}return n.prototype=$n.prototype,new n},Yn.__clone=function(e,t){const n=Yn.__createInstance({name:e.__currentName,keyPath:Array.isArray(e.keyPath)?e.keyPath.slice():e.keyPath,autoInc:e.autoIncrement,indexList:{},idbdb:e.__idbdb,cursors:e.__cursors},t);return["__indexes","__indexNames","__oldIndexNames","__deleted","__pendingDelete","__pendingCreate","__originalName"].forEach((t=>{n[t]=e[t]})),n},Yn.__invalidStateIfDeleted=function(e,t){if(e.__deleted||e.__pendingDelete||e.__pendingCreate&&"transaction"in e&&e.transaction&&e.transaction.__errored)throw re("InvalidStateError",t||"This store has been deleted")},Yn.__createObjectStore=function(e,t){const n=t.__currentName;t.__pendingCreate=!0,e.__objectStores[n]=t,e.objectStoreNames.push(n);const r=e.__versionTransaction,o=r.__storeHandles;return(!o[n]||o[n].__pendingDelete||o[n].__deleted)&&(o[n]=Yn.__clone(t,r)),r.__addNonRequestToTransactionQueue((function(e,r,o,i){function a(e,t){return y.DEBUG&&console.log(t),i(re("UnknownError",'Could not create object store "'+n+'"',t)),!1}const s=T(n),c=["CREATE TABLE",s,"(key BLOB",t.autoIncrement?"UNIQUE, inc INTEGER PRIMARY KEY AUTOINCREMENT":"PRIMARY KEY",", value BLOB)"].join(" ");y.DEBUG&&console.log(c),e.executeSql(c,[],(function(e){function r(){const r=JSON.stringify(t.keyPath);e.executeSql("INSERT INTO __sys__ VALUES (?,?,?,?,?)",[D(n),r,Number(t.autoIncrement),"{}",1],(function(){delete t.__pendingCreate,delete t.__deleted,o(t)}),a)}y.useSQLiteIndexes?e.executeSql("CREATE INDEX IF NOT EXISTS "+O("sk_"+s.slice(1,-1))+" ON "+s+'("key")',[],r,a):r()}),a)})),o[n]},Yn.__deleteObjectStore=function(e,t){t.__pendingDelete=!0,t.__indexNames=at.__createInstance(),e.objectStoreNames.splice(e.objectStoreNames.indexOf(t.__currentName),1);const n=e.__versionTransaction.__storeHandles[t.__currentName];n&&(n.__indexNames=at.__createInstance(),n.__pendingDelete=!0);e.__versionTransaction.__addNonRequestToTransactionQueue((function(e,r,o,i){function a(e,t){return y.DEBUG&&console.log(t),i(re("UnknownError","Could not delete ObjectStore",t)),!1}e.executeSql('SELECT "name" FROM __sys__ WHERE "name" = ?',[D(t.__currentName)],(function(e,r){r.rows.length>0&&e.executeSql("DROP TABLE "+T(t.__currentName),[],(function(){e.executeSql('DELETE FROM __sys__ WHERE "name" = ?',[D(t.__currentName)],(function(){delete t.__pendingDelete,t.__deleted=!0,n&&(delete n.__pendingDelete,n.__deleted=!0),o()}),a)}),a)}))}))},Yn.prototype.__validateKeyAndValueAndCloneValue=function(e,t,n){const r=this;if(null!==r.keyPath){if(void 0!==t)throw re("DataError","The object store uses in-line keys and the key parameter was provided");const o=Mn(e);if((t=Fe(o,r.keyPath)).invalid)throw re("DataError","KeyPath was specified, but key was invalid.");if(t.failure){if(!n){if(!r.autoIncrement)throw re("DataError","Could not evaluate a key from keyPath and there is no key generator");if(!Ue(o,r.keyPath))throw re("DataError","A key could not be injected into a value");return[void 0,o]}throw re("DataError","Could not evaluate a key from keyPath")}return[t.value,o]}if(void 0===t){if(!r.autoIncrement)throw re("DataError","The object store uses out-of-line keys and has no key generator and the key parameter was not provided.");t=void 0}else Re(t);return[t,Mn(e)]},Yn.prototype.__deriveKey=function(e,t,n,r,o){const i=this;function a(e){qn(n,(function(t){t=Un(t),r(t,e)}))}i.autoIncrement?void 0===n?Je(e,i,(function(e,n,a){e?o(re("ConstraintError","The key generator's current number has reached the maximum safe integer limit")):(null!==i.keyPath&&qe(t,n,i.keyPath),r(n,a))}),o):Xe(e,i,n,a,o):a()},Yn.prototype.__insertData=function(e,t,n,r,o,i,a){const s=this,c={},u=Object.keys(s.__indexes).map((t=>new be(((r,o)=>{const i=s.__indexes[t];if(i.__pendingCreate||i.__deleted)return void r(void 0);let a;try{if(a=Fe(n,i.keyPath,i.multiEntry),"invalid"in a&&a.invalid||"failure"in a&&a.failure)throw new Error("Go to catch")}catch(e){return void r(void 0)}function u(e){void 0!==a&&(c[e.__currentName]=Ge(a,e.multiEntry))}if(a=a.value,i.unique){const t=i.multiEntry&&Array.isArray(a);Qn(null,...Wn(!0,i,a,"key",t),e,null,(function(e){if(void 0===e)return u(i),void r(void 0);o(re("ConstraintError","Index already contains a record equal to "+(t?"one of the subkeys of":"")+"`indexKey`"))}),o)}else u(i),r(void 0)}))));return be.all(u).then((()=>{const n=["INSERT INTO",T(s.__currentName),"("],o=[" VALUES ("],u=[];void 0!==r&&(n.push(O("key"),","),o.push("?,"),u.push(D(Ge(r)))),Object.entries(c).forEach((([e,t])=>{n.push(N(e)+","),o.push("?,"),u.push(D(t))})),n.push(O("value")+" )"),o.push("?)"),u.push(D(t));const l=n.join(" ")+o.join(" ");y.DEBUG&&console.log("SQL for adding",l,u),e.executeSql(l,u,(function(){i(r)}),(function(e,t){return a(re("ConstraintError",t.message,t)),!1}))})).catch((function(t){function n(){a(t)}return"number"==typeof o?(Ye(e,s,o,n,n),null):(n(),null)}))},Yn.prototype.add=function(e){const t=this,n=arguments[1];if(!(t instanceof Yn))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No value was specified");Yn.__invalidStateIfDeleted(t),_t.__assertActive(t.transaction),t.transaction.__assertWritable();const r=t.transaction.__createRequest(t),[o,i]=t.__validateKeyAndValueAndCloneValue(e,n,!1);return Yn.__storingRecordObjectStore(r,t,!0,i,!0,o),r},Yn.prototype.put=function(e){const t=this,n=arguments[1];if(!(t instanceof Yn))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No value was specified");Yn.__invalidStateIfDeleted(t),_t.__assertActive(t.transaction),t.transaction.__assertWritable();const r=t.transaction.__createRequest(t),[o,i]=t.__validateKeyAndValueAndCloneValue(e,n,!1);return Yn.__storingRecordObjectStore(r,t,!0,i,!1,o),r},Yn.prototype.__overwrite=function(e,t,n,r){const o="DELETE FROM "+T(this.__currentName)+' WHERE "key" = ?',i=Ge(t);e.executeSql(o,[D(i)],(function(e,r){y.DEBUG&&console.log("Did the row with the",t,"exist?",r.rowsAffected),n(e)}),(function(e,t){return r(t),!1}))},Yn.__storingRecordObjectStore=function(e,t,n,r,o){const i=arguments[5];t.transaction.__pushToQueue(e,(function(e,a,s,c){t.__deriveKey(e,r,i,(function(i,a){qn(r,(function(u){function l(e){t.__insertData(e,u,r,i,a,(function(...e){n&&t.__cursors.forEach((e=>{e.__invalidateCache()})),s(...e)}),c)}o?l(e):t.__overwrite(e,i,l,c)}))}),c)}))},Yn.prototype.__get=function(e,t,n,r){const o=this;void 0!==r&&(r=M(r,"unsigned long")),Yn.__invalidStateIfDeleted(o),_t.__assertActive(o.transaction);const i=rt(e,!n),a=["SELECT",O(t?"key":"value"),"FROM",T(o.__currentName)],s=[];if(void 0!==i&&(a.push("WHERE"),nt(i,O("key"),a,s)),n||(r=1),r){if(!Number.isFinite(r))throw new TypeError("The count parameter must be a finite number");a.push("LIMIT",String(r))}const c=a.join(" ");return o.transaction.__addToTransactionQueue((function(e,r,i,a){y.DEBUG&&console.log("Fetching",o.__currentName,s),e.executeSql(c,s,(function(e,r){let o;y.DEBUG&&console.log("Fetched data",r);try{if(0===r.rows.length)return void(n?i([]):i());if(o=[],t)for(let e=0;e<r.rows.length;e++)o.push(He(I(r.rows.item(e).key),!1));else for(let e=0;e<r.rows.length;e++)o.push(Un(I(r.rows.item(e).value)));n||(o=o[0])}catch(e){y.DEBUG&&console.log(e)}i(o)}),(function(e,t){return a(t),!1}))}),void 0,o)},Yn.prototype.get=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBObjectStore.get`.");return this.__get(e)},Yn.prototype.getKey=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBObjectStore.getKey`.");return this.__get(e,!0)},Yn.prototype.getAll=function(){const[e,t]=arguments;return this.__get(e,!1,!0,t)},Yn.prototype.getAllKeys=function(){const[e,t]=arguments;return this.__get(e,!0,!0,t)},Yn.prototype.delete=function(e){const t=this;if(!(this instanceof Yn))throw new TypeError("Illegal invocation");if(!arguments.length)throw new TypeError("A parameter was missing for `IDBObjectStore.delete`.");Yn.__invalidStateIfDeleted(t),_t.__assertActive(t.transaction),t.transaction.__assertWritable();const n=rt(e,!0),r=["DELETE FROM",T(t.__currentName),"WHERE"],o=[];nt(n,O("key"),r,o);const i=r.join(" ");return t.transaction.__addToTransactionQueue((function(e,n,r,a){y.DEBUG&&console.log("Deleting",t.__currentName,o),e.executeSql(i,o,(function(e,n){y.DEBUG&&console.log("Deleted from database",n.rowsAffected),t.__cursors.forEach((e=>{e.__invalidateCache()})),r()}),(function(e,t){return a(t),!1}))}),void 0,t)},Yn.prototype.clear=function(){const e=this;if(!(this instanceof Yn))throw new TypeError("Illegal invocation");return Yn.__invalidStateIfDeleted(e),_t.__assertActive(e.transaction),e.transaction.__assertWritable(),e.transaction.__addToTransactionQueue((function(t,n,r,o){t.executeSql("DELETE FROM "+T(e.__currentName),[],(function(t,n){y.DEBUG&&console.log("Cleared all records from database",n.rowsAffected),e.__cursors.forEach((e=>{e.__invalidateCache()})),r()}),(function(e,t){return o(t),!1}))}),void 0,e)},Yn.prototype.count=function(){const e=this,t=arguments[0];if(!(e instanceof Yn))throw new TypeError("Illegal invocation");return Yn.__invalidStateIfDeleted(e),_t.__assertActive(e.transaction),Ar.__createInstance(t,"next",e,e,"key","value",!0).__request},Yn.prototype.openCursor=function(){const e=this,[t,n]=arguments;if(!(e instanceof Yn))throw new TypeError("Illegal invocation");Yn.__invalidStateIfDeleted(e);const r=Ar.__createInstance(t,n,e,e,"key","value");return e.__cursors.push(r),r.__request},Yn.prototype.openKeyCursor=function(){const e=this;if(!(e instanceof Yn))throw new TypeError("Illegal invocation");Yn.__invalidStateIfDeleted(e);const[t,n]=arguments,r=Sr.__createInstance(t,n,e,e,"key","key");return e.__cursors.push(r),r.__request},Yn.prototype.index=function(e){const t=this;if(!(t instanceof Yn))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No index name was specified");Yn.__invalidStateIfDeleted(t),_t.__assertNotFinished(t.transaction);const n=t.__indexes[e];if(!n||n.__deleted)throw re("NotFoundError",'Index "'+e+'" does not exist on '+t.__currentName);return(!t.__indexHandles[e]||t.__indexes[e].__pendingDelete||t.__indexes[e].__deleted)&&(t.__indexHandles[e]=Gn.__clone(n,t)),t.__indexHandles[e]},Yn.prototype.createIndex=function(e,t){const n=this;let r=arguments[2];if(!(n instanceof Yn))throw new TypeError("Illegal invocation");if(e=String(e),0===arguments.length)throw new TypeError("No index name was specified");if(1===arguments.length)throw new TypeError("No key path was specified");if(_t.__assertVersionChange(n.transaction),Yn.__invalidStateIfDeleted(n),_t.__assertActive(n.transaction),n.__indexes[e]&&!n.__indexes[e].__deleted&&!n.__indexes[e].__pendingDelete)throw re("ConstraintError",'Index "'+e+'" already exists on '+n.__currentName);if(!U(t=G(t)))throw re("SyntaxError","A valid keyPath must be supplied");if(Array.isArray(t)&&r&&r.multiEntry)throw re("InvalidAccessError","The keyPath argument was an array and the multiEntry option is true.");r=r||{};const o={columnName:e,keyPath:t,optionalParams:{unique:Boolean(r.unique),multiEntry:Boolean(r.multiEntry)}},i=Gn.__createInstance(n,o);return Gn.__createIndex(n,i),i},Yn.prototype.deleteIndex=function(e){const t=this;if(!(t instanceof Yn))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No index name was specified");_t.__assertVersionChange(t.transaction),Yn.__invalidStateIfDeleted(t),_t.__assertActive(t.transaction);const n=t.__indexes[e];if(!n)throw re("NotFoundError",'Index "'+e+'" does not exist on '+t.__currentName);Gn.__deleteIndex(t,n)},k(Yn.prototype,zn),P(Yn.prototype,["name"]),Yn.prototype[Symbol.toStringTag]="IDBObjectStorePrototype",Object.defineProperty(Yn,"prototype",{writable:!1});var Xn=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,Zn=function(e){return Xn.exec(e).slice(1)};function er(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:"/";if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(e=r+"/"+e,t="/"===r.charAt(0))}return e=Jn(or(e.split("/"),(function(e){return!!e})),!t).join("/"),(t?"/":"")+e||"."}function tr(e){var t=nr(e),n="/"===ir(e,-1);return e=Jn(or(e.split("/"),(function(e){return!!e})),!t).join("/"),e||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e}function nr(e){return"/"===e.charAt(0)}var rr={extname:function(e){return Zn(e)[3]},basename:function(e,t){var n=Zn(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},dirname:function(e){var t=Zn(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},sep:"/",delimiter:":",relative:function(e,t){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=er(e).substr(1),t=er(t).substr(1);for(var r=n(e.split("/")),o=n(t.split("/")),i=Math.min(r.length,o.length),a=i,s=0;s<i;s++)if(r[s]!==o[s]){a=s;break}var c=[];for(s=a;s<r.length;s++)c.push("..");return(c=c.concat(o.slice(a))).join("/")},join:function(){return tr(or(Array.prototype.slice.call(arguments,0),(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},isAbsolute:nr,normalize:tr,resolve:er};function or(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}var ir="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)};const ar=["onabort","onclose","onerror","onversionchange"],sr=["name","version","objectStoreNames"];function cr(){throw this.__versionTransaction=null,this.__objectStores=null,this.__transactions=[],new TypeError("Illegal constructor")}const ur=cr;let lr;cr.__createInstance=function(e,t,n,r,o){function i(){this[Symbol.toStringTag]="IDBDatabase",F(this,sr),this.__db=e,this.__closePending=!1,this.__oldVersion=n,this.__version=r,this.__name=t,this.__upgradeTransaction=null,R(this,ar),this.__setOptions({legacyOutputDidListenersThrowFlag:!0}),this.__transactions=[],this.__objectStores={},this.__objectStoreNames=at.__createInstance();const i={};for(let e=0;e<o.rows.length;e++){const t=o.rows.item(e);i.name=t.name,i.keyPath=JSON.parse(t.keyPath),["autoInc","indexList"].forEach((e=>{i[e]=JSON.parse(t[e])})),i.idbdb=this;const n=Yn.__createInstance(i);this.__objectStores[n.name]=n,this.objectStoreNames.push(n.name)}this.__oldObjectStoreNames=this.objectStoreNames.clone()}return i.prototype=ur.prototype,new i},cr.prototype=p.createInstance(),cr.prototype[Symbol.toStringTag]="IDBDatabasePrototype",cr.prototype.createObjectStore=function(e){let t=arguments[1];if(e=String(e),!(this instanceof cr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No object store name was specified");_t.__assertVersionChange(this.__versionTransaction),this.throwIfUpgradeTransactionNull(),_t.__assertActive(this.__versionTransaction),t={...t};let{keyPath:n}=t;if(n=void 0===n?null:G(n),null!==n&&!U(n))throw re("SyntaxError","The keyPath argument contains an invalid key path.");if(this.__objectStores[e]&&!this.__objectStores[e].__pendingDelete)throw re("ConstraintError",'Object store "'+e+'" already exists in '+this.name);const r=t.autoIncrement;if(r&&(""===n||Array.isArray(n)))throw re("InvalidAccessError","With autoIncrement set, the keyPath argument must not be an array or empty string.");const o={name:e,keyPath:n,autoInc:r,indexList:{},idbdb:this},i=Yn.__createInstance(o,this.__versionTransaction);return Yn.__createObjectStore(this,i)},cr.prototype.deleteObjectStore=function(e){if(!(this instanceof cr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No object store name was specified");_t.__assertVersionChange(this.__versionTransaction),this.throwIfUpgradeTransactionNull(),_t.__assertActive(this.__versionTransaction);const t=this.__objectStores[e];if(!t)throw re("NotFoundError",'Object store "'+e+'" does not exist in '+this.name);Yn.__deleteObjectStore(this,t)},cr.prototype.close=function(){if(!(this instanceof cr))throw new TypeError("Illegal invocation");this.__closePending=!0,this.__unblocking&&this.__unblocking.check(),this.__transactions=[]},cr.prototype.transaction=function(e){if(0===arguments.length)throw new TypeError("You must supply a valid `storeNames` to `IDBDatabase.transaction`");let t=arguments[1];if(e=C(e)?[...new Set(G(e))].sort():[V(e)],t=t||"readonly",_t.__assertNotVersionChange(this.__versionTransaction),this.__closePending)throw re("InvalidStateError","An attempt was made to start a new transaction on a database connection that is not open");const n=at.__createInstance();if(e.forEach((e=>{if(!this.objectStoreNames.contains(e))throw re("NotFoundError",'The "'+e+'" object store does not exist');n.push(e)})),0===e.length)throw re("InvalidAccessError","No valid object store names were specified");if("readonly"!==t&&"readwrite"!==t)throw new TypeError("Invalid transaction mode: "+t);const r=_t.__createInstance(this,n,t);return this.__transactions.push(r),r},cr.prototype.throwIfUpgradeTransactionNull=function(){if(null===this.__upgradeTransaction)throw re("InvalidStateError","No upgrade transaction associated with database.")},cr.prototype.__forceClose=function(e){const t=this;t.close();let n=0;t.__transactions.forEach((function(r){r.on__abort=function(){if(n++,n===t.__transactions.length){const e=Q("close");setTimeout((()=>{t.dispatchEvent(e)}))}},r.__abortTransaction(re("AbortError","The connection was force-closed: "+(e||"")))})),t.__transactions=[]},P(cr.prototype,ar),k(cr.prototype,sr),Object.defineProperty(cr.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:cr}),Object.defineProperty(cr,"prototype",{writable:!1});const _r=()=>"object"==typeof location&&location?location.origin:"null",dr=()=>!1!==y.checkOrigin&&"null"===_r(),fr={};function pr(e,t=_r()){const n=fr[t][e];if(!n[0])return;const{req:r,cb:o}=n[0];function i(){n.shift(),pr(e,t)}r.addEventListener("success",i),r.addEventListener("error",i),r.addEventListener("blocked",i),o(r)}function hr(e,t,n=_r(),r){fr[n][t]||(fr[n][t]=[]),fr[n][t].push({req:e,cb:r}),1===fr[n][t].length&&pr(t,n)}function yr(e,t,n,r){const o=e=>e.__closePending,i=()=>e.every((e=>o(e)));return e.reduce((function(e,t){return o(t)?e:e.then((function(){if(o(t))return;const e=new W("versionchange",{oldVersion:n,newVersion:r});return new be((function(n){setTimeout((()=>{t.dispatchEvent(e),n(void 0)}))}))}))}),be.resolve(void 0)).then((function(){if(!i())return new be((function(a){const s={check(){i()&&a(void 0)}},c=new W("blocked",{oldVersion:n,newVersion:r});setTimeout((()=>{t.dispatchEvent(c),i()?a(void 0):e.forEach((e=>{o(e)||(e.__unblocking=s)}))}))}))}))}const br={};let gr,mr=0;function vr(e){return Object.keys(br[e]).map(Number).reduce(((e,t)=>Math.max(t,e)),0)}function Er(e,t,n,r,o){if("string"==typeof y.memoryDatabase){const e=br[t]?function(e){return br[e]&&br[e][vr(e)]}(t):null;if(!e)return console.warn("Could not find a memory database instance to delete."),void r();const n=e._db&&e._db._db;return n&&n.close?void n.close((e=>{e?console.warn("Error closing (destroying) memory database"):r()})):void console.error("The `openDatabase` implementation does not have the expected `._db._db.close` method for closing the database")}if(lr&&!1!==y.deleteDatabaseFiles)return void lr.unlink(rr.join(y.databaseBasePath||"",n),(e=>{e&&"ENOENT"!==e.code?o({code:0,message:"Error removing database file: "+n+" "+e}):r()}));e(rr.join(y.databaseBasePath||"",n),"1",t,y.DEFAULT_DB_SIZE).transaction((function(e){e.executeSql('SELECT "name" FROM __sys__',[],(function(e,t){const n=t.rows;!function t(i){i>=n.length?e.executeSql("DROP TABLE IF EXISTS __sys__",[],(function(){r()}),o):e.executeSql("DROP TABLE "+T(I(n.item(i).name)),[],(function(){t(i+1)}),(function(){return t(i+1),!1}))}(0)}),(function(){return r(),!1}))}))}function wr(e,t,n){function r(e,t){const r=ee(t||e);y.DEBUG&&console.log("Error in sysdb transaction - when creating dbVersions",t),n(r)}gr?t():(gr=e("string"==typeof y.memoryDatabase?y.memoryDatabase:rr.join("string"==typeof y.sysDatabaseBasePath?y.sysDatabaseBasePath:y.databaseBasePath||"","__sysdb__"+(!1!==y.addSQLiteExtension?".sqlite":"")),"1","System Database",y.DEFAULT_DB_SIZE),gr.transaction((function(e){e.executeSql("CREATE TABLE IF NOT EXISTS dbVersions (name BLOB, version INT);",[],(function(e){y.useSQLiteIndexes?e.executeSql("CREATE INDEX IF NOT EXISTS dbvname ON dbVersions(name)",[],t,r):t()}),r)}),r))}function Dr(){throw new TypeError("Illegal constructor")}const Ir=Dr;Dr.__createInstance=function(){function e(){this[Symbol.toStringTag]="IDBFactory",this.__connections={}}return e.prototype=Ir.prototype,new e},Dr.prototype.open=function(e){const t=this;if(!(t instanceof Dr))throw new TypeError("Illegal invocation");let n=arguments[1];if(0===arguments.length)throw new TypeError("Database name is required");if(void 0!==n&&(n=M(n,"unsigned long long"),0===n))throw new TypeError("Version cannot be 0");if(dr())throw re("SecurityError","Cannot open an IndexedDB database from an opaque origin.");const r=le.__createInstance();let o=!1;y.autoName&&""===e&&(e="autoNamedDatabase_"+mr++);const i=D(e=String(e)),a="string"==typeof y.memoryDatabase,s=!1!==y.cacheDatabaseInstances||a;let c;try{c=S(e)}catch(e){throw e}function u(e,t){if(o)return!1;const n=t?ee(t):e;o=!0;const i=Q("error",n,{bubbles:!0,cancelable:!0});return r.__done=!0,r.__error=n,r.__result=void 0,r.dispatchEvent(i),!1}function l(o){let l;if((a||s)&&e in br&&br[e][n]?l=br[e][n]:(l=t.__openDatabase(a?y.memoryDatabase:rr.join(y.databaseBasePath||"",c),"1",e,y.DEFAULT_DB_SIZE),s&&(e in br||(br[e]={}),br[e][n]=l)),void 0===n&&(n=o||1),o>n){const e=re("VersionError","An attempt was made to open a database using a lower version than the existing version.",n);s?setTimeout((()=>{u(e)})):u(e)}else l.transaction((function(a){a.executeSql("CREATE TABLE IF NOT EXISTS __sys__ (name BLOB, keyPath BLOB, autoInc BOOLEAN, indexList BLOB, currNum INTEGER)",[],(function(){function _(){!function(o,a,l){o.executeSql('SELECT "name", "keyPath", "autoInc", "indexList" FROM __sys__',[],(function(o,_){function d(){r.__result=f,r.__done=!0}const f=cr.__createInstance(a,e,l,n,_);if(t.__connections[e]||(t.__connections[e]=[]),t.__connections[e].push(f),l<n)yr(t.__connections[e].slice(0,-1),r,l,n).then((function(){let o=function(e,t,n){if(t)try{e.executeSql("ROLLBACK",[],n,n)}catch(t){gr.transaction((function(e){function t(e){throw new Error("Unable to roll back upgrade transaction!"+(e||""))}0===l?e.executeSql('DELETE FROM dbVersions WHERE "name" = ?',[i],(function(){n(t)}),t):e.executeSql('UPDATE dbVersions SET "version" = ? WHERE "name" = ?',[l,i],n,t)}))}else n()};gr.transaction((function(a){function _(){const i=new W("upgradeneeded",{oldVersion:l,newVersion:n});r.__result=f,f.__upgradeTransaction=r.__transaction=r.__result.__versionTransaction=_t.__createInstance(r.__result,r.__result.objectStoreNames,"versionchange"),r.__done=!0,r.transaction.__addNonRequestToTransactionQueue((function(e,t,n){if(r.dispatchEvent(i),i.__legacyOutputDidListenersThrowError)return X("Error","An error occurred in an upgradeneeded handler attached to request chain",i.__legacyOutputDidListenersThrowError),void r.transaction.__abortTransaction(re("AbortError","A request was aborted."));n()})),r.transaction.on__beforecomplete=function(e){f.__upgradeTransaction=null,r.__result.__versionTransaction=null,o(a,!1,(function(){return r.transaction.__transFinishedCb(!1,(function(){e.complete(),r.__transaction=null})),!1}))},r.transaction.on__preabort=function(){f.__upgradeTransaction=null,s&&e in br&&delete br[e][n]},r.transaction.on__abort=function(){r.__transaction=null,r.__result=void 0,r.__done=!1,f.close(),setTimeout((()=>{const n=re("AbortError","The upgrade transaction was aborted.");o(a,n,(function(r){return 0===l?(Er(t.__openDatabase,e,c,u.bind(null,n),r||u),!1):(u(n),!1)}))}))},r.transaction.on__complete=function(){const e=f.__transactions.indexOf(r.transaction);if(-1!==e&&f.__transactions.splice(e,1),r.__result.__closePending)return r.__transaction=null,void u(re("AbortError","The connection has been closed."));d(),r.__transaction=null;const t=Q("success");r.dispatchEvent(t)}}0===l?a.executeSql("INSERT INTO dbVersions VALUES (?,?)",[i,n],_,u):a.executeSql('UPDATE dbVersions SET "version" = ? WHERE "name" = ?',[n,i],_,u)}),u,void 0,(function(e,t,n,r,i){return!(!e.readOnly&&!t&&(o=function(e,t,n){t?r(t,n):i(n)},1))}))})).catch((e=>{throw console.log("Error within `triggerAnyVersionChangeAndBlockedEvents`"),e}));else{d();const e=Q("success");r.dispatchEvent(e)}}),u)}(a,l,o)}y.createIndexes?a.executeSql("CREATE INDEX IF NOT EXISTS sysname ON __sys__(name)",[],_,u):_()}),u)}),u)}return hr(r,e,void 0,(function(){let n;s&&(e in br||(br[e]={}),n=vr(e)),n?l(n):wr(t.__openDatabase,(function(){gr.readTransaction((function(e){e.executeSql('SELECT "version" FROM dbVersions WHERE "name" = ?',[i],(function(e,t){0===t.rows.length?l(0):l(t.rows.item(0).version)}),u)}),u)}),u)})),r},Dr.prototype.deleteDatabase=function(e){const t=this;if(!(t instanceof Dr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("Database name is required");if(dr())throw re("SecurityError","Cannot delete an IndexedDB database from an opaque origin.");const n=D(e=String(e));let r;try{r=S(e)}catch(e){throw e}const o="string"==typeof y.memoryDatabase,i=!1!==y.cacheDatabaseInstances||o,a=le.__createInstance();let s=!1,c=0,u=function(e,t){t(e)};function l(e,t){if(s||!0===t)return!1;const n=ee(t||e);return u(!0,(function(){a.__done=!0,a.__error=n,a.__result=void 0;const e=Q("error",n,{bubbles:!0,cancelable:!0});a.dispatchEvent(e),s=!0})),!1}return hr(a,e,void 0,(function(o){wr(t.__openDatabase,(function(){function a(){o.__result=void 0,o.__done=!0;const e=new W("success",{oldVersion:c,newVersion:null});o.dispatchEvent(e)}function s(){u(!1,(function(){i&&e in br&&delete br[e],delete t.__connections[e],a()}))}gr.readTransaction((function(i){i.executeSql('SELECT "version" FROM dbVersions WHERE "name" = ?',[n],(function(i,_){if(0===_.rows.length)return void a();({version:c}=_.rows.item(0));yr(t.__connections[e]||[],o,c,null).then((function(){gr.transaction((function(o){o.executeSql('DELETE FROM dbVersions WHERE "name" = ? ',[n],(function(){Er(t.__openDatabase,e,r,s,l)}),l)}),l,void 0,(function(e,t,n,r,o){return!(!e.readOnly&&!t)||(u=function(e,t){e?r(e,t):o(t)},!1)}))}),l)}),l)}))}),l)})),a},Dr.prototype.cmp=function(e,t){if(!(this instanceof Dr))throw new TypeError("Illegal invocation");if(arguments.length<2)throw new TypeError("You must provide two keys to be compared");return Re(e),Re(t),ge(e,t)},Dr.prototype.databases=function(){const e=this;let t=!1;return new Promise((function(n,r){if(!(e instanceof Dr))throw new TypeError("Illegal invocation");if(dr())throw re("SecurityError","Cannot get IndexedDB database names from an opaque origin.");function o(e,n){if(t)return!1;const o=n?ee(n):e;return t=!0,r(o),!1}wr(e.__openDatabase,(function(){gr.readTransaction((function(e){e.executeSql('SELECT "name", "version" FROM dbVersions',[],(function(e,t){const r=[];for(let e=0;e<t.rows.length;e++){const{name:n,version:o}=t.rows.item(e);r.push({name:I(n),version:o})}n(r)}),o)}),o)}),o)}))},Dr.prototype.__forceClose=function(e,t,n){const r=this;function o(e){e.__forceClose(n)}if(H(e))Object.values(r.__connections).forEach((e=>{e.forEach((e=>{o(e)}))}));else if(r.__connections[e])if(H(t))r.__connections[e].forEach((e=>{o(e)}));else{if(!Number.isInteger(t)||t<0||t>r.__connections[e].length-1)throw new TypeError("If providing an argument, __forceClose must be called with a numeric index to indicate a specific connection to close");o(r.__connections[e][t])}else console.log("No database connections with that name to force close")},Dr.prototype.__setConnectionQueueOrigin=function(e=_r()){fr[e]={}},Dr.prototype[Symbol.toStringTag]="IDBFactoryPrototype",Object.defineProperty(Dr,"prototype",{writable:!1});const Or=Dr.__createInstance();function Sr(){throw new TypeError("Illegal constructor")}const Tr=Sr;Sr.__super=function(e,t,n,r,o,i,a){this[Symbol.toStringTag]="IDBCursor",F(this,["key","primaryKey","request"]),Yn.__invalidStateIfDeleted(n),this.__indexSource=B(r,Gn),this.__indexSource&&Gn.__invalidStateIfDeleted(r),_t.__assertActive(n.transaction);const s=rt(e);if(void 0!==t&&!["next","prev","nextunique","prevunique"].includes(t))throw new TypeError(t+"is not a valid cursor direction");Object.defineProperties(this,{source:{writable:!1,value:r},direction:{writable:!1,value:t||"next"}}),this.__key=void 0,this.__primaryKey=void 0,this.__store=n,this.__range=s,this.__request=ce.__createInstance(),this.__request.__source=r,this.__request.__transaction=this.__store.transaction,this.__keyColumnName=o,this.__valueColumnName=i,this.__keyOnly="key"===i,this.__valueDecoder=this.__keyOnly?Ze:Vn,this.__count=a,this.__prefetchedIndex=-1,this.__multiEntryIndex=!!this.__indexSource&&("multiEntry"in r&&r.multiEntry),this.__unique=this.direction.includes("unique"),this.__sqlDirection=["prev","prevunique"].includes(this.direction)?"DESC":"ASC",void 0!==s&&(s.__lowerCached=void 0!==s.lower&&Ge(s.lower,this.__multiEntryIndex),s.__upperCached=void 0!==s.upper&&Ge(s.upper,this.__multiEntryIndex)),this.__gotValue=!0,this.continue()},Sr.__createInstance=function(...e){const t=Tr.__super;return t.prototype=Tr.prototype,new t(...e)},Sr.prototype.__find=function(...e){if(this.__multiEntryIndex){const[t,n,r,o,i,a]=e;this.__findMultiEntry(t,n,r,o,i,a)}else{const[t,n,r,o,i,a]=e;this.__findBasic(t,n,r,o,i,a)}},Sr.prototype.__findBasic=function(e,t,n,r,o,i){const a=void 0!==i;i=i||1;const s=this,c=O(s.__keyColumnName),u=O("key"),l=["SELECT * FROM",T(s.__store.__currentName)],_=[];l.push("WHERE",c,"NOT NULL"),nt(s.__range,c,l,_,!0,!0);const d=s.__sqlDirection,f="ASC"===d?">":"<";void 0!==t&&(l.push("AND",u,f+"= ?"),_.push(Ge(t))),void 0!==e?(l.push("AND",c,f+"= ?"),_.push(Ge(e))):a&&void 0!==s.__key&&(l.push("AND",c,f+" ?"),_.push(Ge(s.__key))),s.__count||(l.push("ORDER BY",c,d),"key"!==s.__keyColumnName&&(s.__unique?"prevunique"===s.direction&&l.push(",",u,"ASC"):l.push(",",u,d)),!s.__unique&&s.__indexSource&&l.push(",",O(s.__valueColumnName),d),l.push("LIMIT",String(i)));const p=l.join(" ");y.DEBUG&&console.log(p,_),n.executeSql(p,_,(function(e,t){s.__count?r(void 0,t.rows.length,void 0):t.rows.length>1?(s.__prefetchedIndex=0,s.__prefetchedData=t.rows,y.DEBUG&&console.log("Preloaded "+s.__prefetchedData.length+" records for cursor"),s.__decode(t.rows.item(0),r)):1===t.rows.length?s.__decode(t.rows.item(0),r):(y.DEBUG&&console.log("Reached end of cursors"),r(void 0,void 0,void 0))}),(function(e,t){return y.DEBUG&&console.log("Could not execute Cursor.continue",p,_),o(t),!1}))};const Nr=/\[/gu;function Ar(){throw new TypeError("Illegal constructor")}Sr.prototype.__findMultiEntry=function(e,t,n,r,o,i){const a=this;if(a.__prefetchedData&&a.__prefetchedData.length===a.__prefetchedIndex)return y.DEBUG&&console.log("Reached end of multiEntry cursor"),void r(void 0,void 0,void 0);const s=O(a.__keyColumnName),c=["SELECT * FROM",T(a.__store.__currentName)],u=[];c.push("WHERE",s,"NOT NULL"),a.__range&&void 0!==a.__range.lower&&Array.isArray(a.__range.upper)&&0===a.__range.upper.indexOf(a.__range.lower)&&(c.push("AND",s,"LIKE ? ESCAPE '^'"),u.push("%"+x(a.__range.__lowerCached.slice(0,-1))+"%"));const l=a.__sqlDirection,_="ASC"===l?">":"<",d=O("key");void 0!==t&&(c.push("AND",d,_+"= ?"),u.push(Ge(t))),void 0!==e?(c.push("AND",s,_+"= ?"),u.push(Ge(e))):void 0!==a.__key&&(c.push("AND",s,_+" ?"),u.push(Ge(a.__key))),a.__count||(c.push("ORDER BY",s,l),a.__unique||"key"===a.__keyColumnName||c.push(",",O("key"),l),!a.__unique&&a.__indexSource&&c.push(",",O(a.__valueColumnName),l),c.push("LIMIT",String(i)));const f=c.join(" ");y.DEBUG&&console.log(f,u),n.executeSql(f,u,(function(e,t){if(t.rows.length>0){if(a.__count){let e=0;for(let n=0;n<t.rows.length;n++){e+=Ke(He(t.rows.item(n)[a.__keyColumnName],!0),a.__range).length}return void r(void 0,e,void 0)}const e=[];for(let n=0;n<t.rows.length;n++){const r=t.rows.item(n),o=Ke(He(r[a.__keyColumnName],!0),a.__range);for(const t of o){const n={matchingKey:Ge(t,!0),key:r.key};n[a.__keyColumnName]=r[a.__keyColumnName],n[a.__valueColumnName]=r[a.__valueColumnName],e.push(n)}}const n=0===a.direction.indexOf("prev");e.sort((function(e,t){return e.matchingKey.replaceAll(Nr,"z")<t.matchingKey.replaceAll(Nr,"z")?n?1:-1:e.matchingKey.replaceAll(Nr,"z")>t.matchingKey.replaceAll(Nr,"z")?n?-1:1:e.key<t.key?"prev"===a.direction?1:-1:e.key>t.key?"prev"===a.direction?-1:1:0})),e.length>1?(a.__prefetchedIndex=0,a.__prefetchedData={data:e,length:e.length,item(e){return this.data[e]}},y.DEBUG&&console.log("Preloaded "+a.__prefetchedData.length+" records for multiEntry cursor"),a.__decode(e[0],r)):1===e.length?(y.DEBUG&&console.log("Reached end of multiEntry cursor"),a.__decode(e[0],r)):(y.DEBUG&&console.log("Reached end of multiEntry cursor"),r(void 0,void 0,void 0))}else y.DEBUG&&console.log("Reached end of multiEntry cursor"),r(void 0,void 0,void 0)}),(function(e,t){return y.DEBUG&&console.log("Could not execute Cursor.continue",f,u),o(t),!1}))},Sr.prototype.__onsuccess=function(e){const t=this;return function(n,r,o){if(t.__count)e(r,t.__request);else{void 0!==n&&(t.__gotValue=!0),t.__key=void 0===n?null:n,t.__primaryKey=void 0===o?null:o,t.__value=void 0===r?null:r;e(void 0===n?null:t,t.__request)}}},Sr.prototype.__decode=function(e,t){const n=this;if(n.__multiEntryIndex&&n.__unique){if(n.__matchedKeys||(n.__matchedKeys={}),n.__matchedKeys[e.matchingKey])return void t(void 0,void 0,void 0);n.__matchedKeys[e.matchingKey]=!0}const r=I(n.__multiEntryIndex?e.matchingKey:e[n.__keyColumnName]),o=I(e[n.__valueColumnName]),i=I(e.key);t(He(r,n.__multiEntryIndex),n.__valueDecoder.decode(o),He(i),r)},Sr.prototype.__sourceOrEffectiveObjStoreDeleted=function(){Yn.__invalidStateIfDeleted(this.__store,"The cursor's effective object store has been deleted"),this.__indexSource&&Gn.__invalidStateIfDeleted(this.source,"The cursor's index source has been deleted")},Sr.prototype.__invalidateCache=function(){this.__prefetchedData=null},Sr.prototype.__continue=function(e,t){const n=this,r=void 0!==n.__advanceCount;if(_t.__assertActive(n.__store.transaction),n.__sourceOrEffectiveObjStoreDeleted(),!n.__gotValue&&!t)throw re("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(void 0!==e){Re(e);const t=ge(e,n.key);if(0===t||n.direction.includes("next")&&-1===t||n.direction.includes("prev")&&1===t)throw re("DataError","Cannot "+(r?"advance":"continue")+" the cursor in an unexpected direction")}this.__continueFinish(e,void 0,r)},Sr.prototype.__continueFinish=function(e,t,n){const r=this,o=r.__advanceCount||y.cursorPreloadPackSize||100;r.__gotValue=!1,r.__request.__done=!1,r.__store.transaction.__pushToQueue(r.__request,(function i(a,s,c,u,l){function _(e,t,o){if(n){if(r.__advanceCount&&r.__advanceCount>=2&&void 0!==e)return r.__advanceCount--,r.__key=e,r.__continue(void 0,!0),void l();r.__advanceCount=void 0}r.__onsuccess(c)(e,t,o)}r.__prefetchedData&&(r.__prefetchedIndex++,r.__prefetchedIndex<r.__prefetchedData.length)?r.__decode(r.__prefetchedData.item(r.__prefetchedIndex),(function(n,o,l,d){!r.__unique||r.__multiEntryIndex||d!==Ge(r.key,r.__multiEntryIndex)?function(){const d=Number(void 0===e)||ge(n,e);d>0||0===d&&(r.__unique||void 0===t||ge(l,t)>=0)?_(n,o,l):i(a,s,c,u)}():i(a,s,c,u)})):r.__find(e,t,a,_,(function(...e){r.__advanceCount=void 0;const[t,n]=e;u(t,n)}),o)}))},Sr.prototype.continue=function(){this.__continue(arguments[0])},Sr.prototype.continuePrimaryKey=function(e,t){const n=this;if(_t.__assertActive(n.__store.transaction),n.__sourceOrEffectiveObjStoreDeleted(),!n.__indexSource)throw re("InvalidAccessError","`continuePrimaryKey` may only be called on an index source.");if(!["next","prev"].includes(n.direction))throw re("InvalidAccessError","`continuePrimaryKey` may not be called with unique cursors.");if(!n.__gotValue)throw re("InvalidStateError","The cursor is being iterated or has iterated past its end.");Re(e),Re(t);const r=ge(e,n.key);if("next"===n.direction&&-1===r||"prev"===n.direction&&1===r)throw re("DataError","Cannot continue the cursor in an unexpected direction");function o(){n.__continueFinish(e,t,!1)}0===r?qn(t,(function(e){qn(n.primaryKey,(function(t){if(e===t||"next"===n.direction&&e<t||"prev"===n.direction&&e>t)throw re("DataError","Cannot continue the cursor in an unexpected direction");o()}))})):o()},Sr.prototype.advance=function(e){const t=this;if(0===(e=M(e,"unsigned long")))throw new TypeError("Calling advance() with count argument 0");t.__gotValue&&(t.__advanceCount=e),t.__continue()},Sr.prototype.update=function(e){const t=this;if(!arguments.length)throw new TypeError("A value must be passed to update()");if(_t.__assertActive(t.__store.transaction),t.__store.transaction.__assertWritable(),t.__sourceOrEffectiveObjStoreDeleted(),!t.__gotValue)throw re("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(t.__keyOnly)throw re("InvalidStateError","This cursor method cannot be called when the key only flag has been set.");const n=t.__store.transaction.__createRequest(t),r=t.primaryKey;function o(e){Yn.__storingRecordObjectStore(n,t.__store,!1,e,!1,r)}if(null!==t.__store.keyPath){const[n,r]=t.__store.__validateKeyAndValueAndCloneValue(e,void 0,!0);if(0!==ge(t.primaryKey,n))throw re("DataError","The key of the supplied value to `update` is not equal to the cursor's effective key");o(r)}else{o(Mn(e))}return n},Sr.prototype.delete=function(){const e=this;if(_t.__assertActive(e.__store.transaction),e.__store.transaction.__assertWritable(),e.__sourceOrEffectiveObjStoreDeleted(),!e.__gotValue)throw re("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(e.__keyOnly)throw re("InvalidStateError","This cursor method cannot be called when the key only flag has been set.");return this.__store.transaction.__addToTransactionQueue((function(t,n,r,o){e.__find(void 0,void 0,t,(function(n,i,a){const s="DELETE FROM "+T(e.__store.__currentName)+' WHERE "key" = ?';y.DEBUG&&console.log(s,n,a),t.executeSql(s,[D(Ge(a))],(function(e,t){1===t.rowsAffected?r(void 0):o("No rows with key found"+n)}),(function(e,t){return o(t),!1}))}),o)}),void 0,e)},Sr.prototype[Symbol.toStringTag]="IDBCursorPrototype",k(Sr.prototype,["source","direction","key","primaryKey","request"]),Object.defineProperty(Sr,"prototype",{writable:!1}),Ar.prototype=Object.create(Sr.prototype),Object.defineProperty(Ar.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:Ar});const xr=Ar;function Br(e,t){if(e&&"object"==typeof e)Object.entries(e).forEach((([e,t])=>{Br(e,t)}));else{if(!(e in y))throw new Error(e+" is not a valid configuration property");y[e]=t,"registerSCA"===e&&"function"==typeof t&&Ln(t)}}Ar.__createInstance=function(...e){function t(){const[t,n,r,o,i,a,s]=e;Sr.__super.call(this,t,n,r,o,i,a,s),this[Symbol.toStringTag]="IDBCursorWithValue",F(this,"value")}return t.prototype=xr.prototype,new t},k(Ar.prototype,["value"]),Ar.prototype[Symbol.toStringTag]="IDBCursorWithValuePrototype",Object.defineProperty(Ar,"prototype",{writable:!1}),y.win="undefined"!=typeof window?window:self,function(){const e=globalThis||{};function t(t,n,r){if(!r||!Object.defineProperty)try{e[t]=n}catch(e){console.log(e)}if(e[t]!==n&&Object.defineProperty)try{let o=r||{};if("get"in o){const e={get[t](){return r.get.call(this)}};o=Object.getOwnPropertyDescriptor(e,t)}else"value"in o||(o.value=n),"writable"in o||(o.writable=!0);Object.defineProperty(e,t,o)}catch(e){}e[t]!==n&&"undefined"!=typeof console&&console.warn&&console.warn("Unable to shim "+t)}void 0!==y.win.openDatabase&&t("shimIndexedDB",Or,{enumerable:!1,configurable:!0}),"shimIndexedDB"in e&&e.shimIndexedDB?(e.shimIndexedDB.__useShim=function(){function n(e=""){t(e+"DOMException",oe),t(e+"DOMStringList",at,{enumerable:!1,configurable:!0,writable:!0,value:at}),t(e+"Event",c,{configurable:!0,writable:!0,value:c,enumerable:!1}),t(e+"CustomEvent",u,{configurable:!0,writable:!0,value:u,enumerable:!1}),t(e+"EventTarget",d,{configurable:!0,writable:!0,value:d,enumerable:!1})}const r=Dr;if(void 0!==y.win.openDatabase){if(Or.__openDatabase=y.win.openDatabase.bind(y.win),t("indexedDB",Or,{enumerable:!0,configurable:!0,get(){if(this!==e&&!H(this)&&!this.shimNS)throw new TypeError("Illegal invocation");return Or}}),[["IDBFactory",r],["IDBDatabase",cr],["IDBObjectStore",Yn],["IDBIndex",Gn],["IDBTransaction",_t],["IDBCursor",Sr],["IDBCursorWithValue",Ar],["IDBKeyRange",et],["IDBRequest",ce],["IDBOpenDBRequest",le],["IDBVersionChangeEvent",W]].forEach((([e,n])=>{t(e,n,{enumerable:!1,configurable:!0})})),y.fs&&(o=y.fs,lr=o),y.fullIDLSupport&&(Object.setPrototypeOf(e.IDBOpenDBRequest,e.IDBRequest),Object.setPrototypeOf(e.IDBCursorWithValue,e.IDBCursor),Object.setPrototypeOf(cr,d),Object.setPrototypeOf(ce,d),Object.setPrototypeOf(_t,d),Object.setPrototypeOf(W,c),Object.setPrototypeOf(oe,Error),Object.setPrototypeOf(oe.prototype,Error.prototype),Object.setPrototypeOf(u,c),Object.setPrototypeOf(u.prototype,c.prototype)),e.indexedDB&&!e.indexedDB.toString().includes("[native code]")&&(y.addNonIDBGlobals&&n("Shim"),y.replaceNonIDBGlobals&&n()),!e.shimIndexedDB)return;e.shimIndexedDB.__setConnectionQueueOrigin()}var o},e.shimIndexedDB.__debug=function(e){y.DEBUG=e},e.shimIndexedDB.__setConfig=Br,e.shimIndexedDB.__getConfig=function(e){if(!(e in y))throw new Error(e+" is not a valid configuration property");return y[e]},e.shimIndexedDB.__setUnicodeIdentifiers=function({UnicodeIDStart:e,UnicodeIDContinue:t}){Br({UnicodeIDStart:e,UnicodeIDContinue:t})}):(e.shimIndexedDB={},["__useShim","__debug","__setConfig","__getConfig","__setUnicodeIdentifiers"].forEach((t=>{e.shimIndexedDB[t]=function(){console.warn("This browser does not have WebSQL to shim.")}}))),"indexedDB"in e||"undefined"==typeof window||(e.indexedDB=e.indexedDB||"webkitIndexedDB"in e&&e.webkitIndexedDB||"mozIndexedDB"in e&&e.mozIndexedDB||"oIndexedDB"in e&&e.oIndexedDB||"msIndexedDB"in e&&e.msIndexedDB);let n=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(/Android (?:2|3|4\.[0-3])/u.test(navigator.userAgent)&&!navigator.userAgent.includes("Chrome")||(!navigator.userAgent.includes("Safari")||navigator.userAgent.includes("Chrome"))&&/(iPad|iPhone|iPod).* os 9_/iu.test(navigator.userAgent)&&"undefined"!=typeof window&&!("MSStream"in window))&&(n=!0),y.DEFAULT_DB_SIZE||(y.DEFAULT_DB_SIZE=1024*("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")?25:4)*1024),y.avoidAutoShim||e.indexedDB&&!n||void 0===y.win.openDatabase?(e.IDBDatabase=e.IDBDatabase||"webkitIDBDatabase"in e&&e.webkitIDBDatabase,e.IDBTransaction=e.IDBTransaction||"webkitIDBTransaction"in e&&e.webkitIDBTransaction||{},e.IDBCursor=e.IDBCursor||"webkitIDBCursor"in e&&e.webkitIDBCursor,e.IDBKeyRange=e.IDBKeyRange||"webkitIDBKeyRange"in e&&e.webkitIDBKeyRange):e.shimIndexedDB.__useShim()}()}));
|
|
5
3
|
//# sourceMappingURL=indexeddbshim.min.js.map
|