/*! indexeddbshim - v13.0.0 - 12/7/2023 */ !function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(e,t,n,r){var o={configurable:!0,enumerable:!0};return o[e]=r,Object.defineProperty(t,n,o)}function t(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 n(e){for(var n=1;n=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(c&&s){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:B(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function o(e){return o="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},o(e)}function i(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 a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function u(e){i(a,r,o,u,c,"next",e)}function c(e){i(a,r,o,u,c,"throw",e)}u(void 0)}))}}function u(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=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 y(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");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:String(t)}function v(e){return v="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},v(e)}var b=0,g=1,m=2,E=3,w="undefined"==typeof DOMException?function(e,t){var n=new Error(e);return n.name=t,n}:DOMException,D=new WeakMap,I=new WeakMap,O=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),D.set(this,o),I.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}),{}))};O.prototype.preventDefault=function(){if(!(this instanceof O))throw new TypeError("Illegal invocation");var e=D.get(this),t=I.get(this);this.cancelable&&!t._passive&&(t.defaultPrevented=!0,"function"==typeof e.preventDefault&&e.preventDefault())},O.prototype.stopImmediatePropagation=function(){I.get(this)._stopImmediatePropagation=!0},O.prototype.stopPropagation=function(){I.get(this)._stopPropagation=!0},O.prototype.initEvent=function(e,t,n){var r=I.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(O.prototype,e,{enumerable:!0,configurable:!0,get:function(){throw new TypeError("Illegal invocation")}})})),["eventPhase","defaultPrevented","bubbles","cancelable","timeStamp"].forEach((function(e){Object.defineProperty(O.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(O,e,{enumerable:!0,writable:!1,value:t}),Object.defineProperty(O.prototype,e,{writable:!1,value:t})})),O[Symbol.toStringTag]="Function",O.prototype[Symbol.toStringTag]="EventPrototype",Object.defineProperty(O,"prototype",{writable:!1});var S=function(e){var t=Array.prototype.slice.call(arguments),n=t[1],r=t[2];O.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 T(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(S.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:S}),S.prototype.initCustomEvent=function(e,t,n,r){if(!(this instanceof S))throw new TypeError("Illegal invocation");var o=I.get(this);S.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}}))},S[Symbol.toStringTag]="Function",S.prototype[Symbol.toStringTag]="CustomEventPrototype",Object.defineProperty(S.prototype,"detail",{enumerable:!0,configurable:!0,get:function(){throw new TypeError("Illegal invocation")}}),Object.defineProperty(S,"prototype",{writable:!1});var A={addListener:function(e,t,n,r){var o=T(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=T(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 T(e,n,r).listenersByTypeOptions.some((function(e){return e.listener===t}))}};function N(){throw new TypeError("Illegal constructor")}Object.assign(N.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 w("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:{}}),A[n+"Listener"](this[i],r,e,o)}})),e}),{})),Object.assign(N.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=I.get(e);if(o&&t&&o._dispatched)throw new w("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 S(o,{bubbles:t,cancelable:n,detail:r},e):new O(o,{bubbles:t,cancelable:n},e)}(e),(o=I.get(r))._dispatched=!0,this._extraProperties.forEach((function(t){t in e&&(r[t]=e[t])})));var i=r.type;function a(){o.eventPhase=b,o.currentTarget=null,delete o._children}function u(){o._stopImmediatePropagation=void 0,o._stopPropagation=void 0,r.defaultPrevented&&o.cancelable||(o.eventPhase=m,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=m,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 g: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=m),s&&(s._defaultSync=this._defaultSync),(s||this)._dispatchEvent(r,!1);case m:return o._stopPropagation?c():(this.invokeCurrentListeners(this._listeners,r,i,!0),o.bubbles?(o.eventPhase=E,this._dispatchEvent(r,!1)):c());case E: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=m,this.invokeCurrentListeners(this._earlyListeners,r,i),!("__getParent"in this))return o.eventPhase=m,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=g,d._dispatchEvent(r,!1)}},invokeCurrentListeners:function(e,t,n,r){var o=this,i=I.get(t);i.currentTarget=this;var a=T(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===g||t.eventPhase===m||!d&&t.target!==t.currentTarget&&t.eventPhase===E){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":v(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)}}),N.prototype[Symbol.toStringTag]="EventTargetPrototype",Object.defineProperty(N,"prototype",{writable:!1});var x=N,j={createInstance:function(e){var t=function(){this.__setOptions(e)};return t.prototype=x.prototype,new t}};N.ShimEvent=O,N.ShimCustomEvent=S,N.ShimDOMException=w,N.ShimEventTarget=N,N.EventTargetFactory=j;var B={},F={};function P(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=f(e,2);e=n[0],t=n[1]}Object.defineProperty(F,e,{get:function(){return B[e]},set:function(n){t&&t(n),B[e]=n}})}));var C=P(/[\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 k(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 R(e){return"_"+k(e.replaceAll("^","^^").replaceAll("\0","^0").replaceAll(/([A-Z])/g,"^$1"))}function L(e){return k(e.replaceAll("^","^^").replaceAll("\0","^0"))}function q(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 U(e){return e.replaceAll('"','""')}function M(e){return'"'+U(e)+'"'}function V(e){if(F.escapeDatabaseName)return F.escapeDatabaseName(L(e));if(e="D"+R(e),!1!==F.escapeNFDForDatabaseNames&&(e=e.replaceAll(new RegExp(C,"gu"),(function(e){return"^4"+e.codePointAt(0).toString(16).padStart(6,"0")}))),!1!==F.databaseCharacterEscapeList&&(e=e.replace(F.databaseCharacterEscapeList?new RegExp(F.databaseCharacterEscapeList,"gu"):/[\0-\x1F"\*\/:<>\?\\\|\x7F]/g,(function(e){return"^1"+e.charCodeAt(0).toString(16).padStart(2,"0")}))),!1!==F.databaseNameLengthLimit&&e.length>=(F.databaseNameLengthLimit||254)-(!1!==F.addSQLiteExtension?7:0))throw new Error("Unexpectedly long database name supplied; length limit required for Node compatibility; passed length: "+e.length+"; length limit setting: "+(F.databaseNameLengthLimit||254)+".");return e+(!1!==F.addSQLiteExtension?".sqlite":"")}function K(e){return M("S"+R(e))}function G(e){return M("I"+R(e))}function H(e){return"I"+R(e)}function Q(e){return U(e).replaceAll("^","^^")}function W(e,t){return t[Symbol.hasInstance](e)}function Y(e){return null!==e&&"object"===o(e)}function $(e){return Y(e)&&Symbol.iterator in e&&"function"==typeof e[Symbol.iterator]}function X(t,n){n.forEach((function(n){var r=e("set",e("get",{},n,(function(){throw new TypeError("Illegal invocation")})),n,(function(e){throw new TypeError("Illegal invocation")})),o=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,o)}))}function z(t,n){n.forEach((function(n){var r=e("get",{},n,(function(){throw new TypeError("Illegal invocation")})),o=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,o)}))}function J(t,n){(n="string"==typeof n?[n]:n).forEach((function(n){var r=e("set",e("get",{},n,(function(){return t["__"+n]})),n,(function(e){t["__"+n]=e})),o=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,o)})),n.forEach((function(e){t[e]=null}))}function Z(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;(n="string"==typeof n?[n]:n).forEach((function(n){var o;r&&n in r?o=r[n]:(Object.defineProperty(t,"__"+n,{enumerable:!1,configurable:!1,writable:!0}),o=e("get",{},n,(function(){return this["__"+n]})));var i=Object.getOwnPropertyDescriptor(o,n);Object.defineProperty(t,n,i)}))}function ee(e){var t=F.UnicodeIDStart||"[$A-Z_a-z]",n=F.UnicodeIDContinue||"[$0-9A-Z_a-z]";return new RegExp("^"+("(?:"+t+"|[$_])")+("(?:"+n+"|[$_‌‍])")+"*$","u").test(e)}function te(e){return"string"==typeof e&&(""===e||ee(e)||e.split(".").every((function(e){return ee(e)})))}function ne(e){return te(e)||Array.isArray(e)&&Boolean(e.length)&&d(e).every((function(e){return te(e)}))}function re(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||er?1:n===r?0:-1;if(F.DEBUG){var a=ut(n),u=ut(r);"object"===o(e)&&(e=JSON.stringify(e),a=JSON.stringify(a)),"object"===o(t)&&(t=JSON.stringify(t),u=JSON.stringify(u)),a!==e&&console.warn(e+" was incorrectly encoded as "+a),u!==t&&console.warn(t+" was incorrectly encoded as "+u)}return i}Fe.prototype.then=function(e,t){var n=this;return new Fe((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===Be?i(n.v):(n.c[je].push(a),n.c[Be].push(i))}))},Fe.prototype.catch=function(e){var t=this;return new Fe((function(n,r){function o(){try{n(e(t.v))}catch(e){r(e)}}t.s===Be?o():t.s===je?n(t.v):(t.c[Be].push(o),t.c[je].push(n))}))},Fe.all=function(e){return new Fe((function(t,n){var r=e.length,o=[];r?e.forEach((function(i,a){Ae(i)?Ne(i.then((function(e){o[a]=e,--r||t(o)})),n):(o[a]=i,--r||t(e))})):t(o)}))},Fe.race=function(e){var t=!1;return new Fe((function(n,r){e.some((function(e,o){return Ae(e)?(Ne(e.then((function(e){t||(n(e),t=!0)})),r),!1):(n(e),t=!0,!0)}))}))},Fe.resolve=function(e){return new Fe((function(t,n){t(e)}))},Fe.reject=function(e){return new Fe((function(t,n){n(e)}))};var Ce={invalid:100,number:200,date:300,string:400,binary:500,array:600},ke=Object.keys(Ce);ke.forEach((function(e){Ce[e]=String.fromCodePoint(Ce[e])}));var Re=ke.reduce((function(e,t){return e[Ce[t]]=t,e}),{}),Le=["negativeInfinity","bigNegative","smallNegative","smallPositive","bigPositive","positiveInfinity"],qe={invalid:{encode:function(){return Ce.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=Le.indexOf("smallNegative"),n=Ue(a),r=Ve(Me(o))):(t=Le.indexOf("bigNegative"),n=Ve(Ue(-1!==i?i:o.length)),r=Ve(Me(o))):e<1?(t=Le.indexOf("smallPositive"),n=Ve(Ue(a)),r=Me(o)):(t=Le.indexOf("bigPositive"),n=Ue(-1!==i?i:o.length),r=Me(o)):(n=He(2),r=He(11),t=Le.indexOf(e>0?"positiveInfinity":"negativeInfinity")),Ce.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(Le[t]){case"negativeInfinity":return Number.NEGATIVE_INFINITY;case"positiveInfinity":return Number.POSITIVE_INFINITY;case"bigPositive":return Ke(r,n);case"smallPositive":return Ke(r,n=Qe(Ve(n)));case"smallNegative":return n=Qe(n),-Ke(r=Ve(r),n);case"bigNegative":return n=Ve(n),-Ke(r=Ve(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")+" "),Ce.string+"-"+e},decode:function(e,t){return e=e.slice(2),t&&(e=e.slice(0,-1).replaceAll(/\x2D((?:[\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=h(e.entries());try{for(r.s();!(t=r.n()).done;){var o=f(t.value,2),i=o[0],a=at(o[1],!0);n[i]=a}}catch(e){r.e(e)}finally{r.f()}return n.push(Ce.invalid+"-"),Ce.array+"-"+JSON.stringify(n)},decode:function(e){var t=JSON.parse(e.slice(2));t.pop();for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:16;return Number.parseFloat(e.toPrecision(t))}function He(e){return"0".repeat(e)}function Qe(e){return"-"+e}function We(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=o(e);return["string","number"].includes(n)?n:"invalid"}function Ye(e,t){return Xe(e,t,!1,!0)}function $e(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 i=We(e),a={type:i,value:e};switch(i){case"number":return Number.isNaN(e)?{type:"NaN",invalid:!0}:Object.is(e,-0)?{type:i,value:0}:a;case"string":return a;case"binary":return{type:"binary",value:$e(e)};case"array":var u=e,c=u.length;t.push(e);for(var s,l=[],f=function(){if(!n&&!Object.hasOwn(u,d))return{v:{type:i,invalid:!0,message:"Does not have own index property"}};try{var e=Xe(u[d],t,!1,r);if(e.invalid)return n?0:{v:{type:i,invalid:!0,message:"Bad array entry value-to-key conversion"}};(!n||!r&&l.every((function(t){return 0!==Pe(t,e.value)}))||r&&l.every((function(t){return 0!==Pe(t,e)})))&&l.push(r?e:e.value)}catch(e){if(!n)throw e}},d=0;da||!t.lowerOpen&&(!i&&!a||null!==i&&null!==a&&i>=a))&&(r=!0),!o&&(t.upperOpen&&null!==i&&null!==u&&i1:t===e}function it(e,t){var n=[];if(Array.isArray(e)){var r,o=h(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;if(Array.isArray(i)){if(t&&t.lower===t.upper)continue;if(1!==i.length){it(i,t).length>0&&n.push(i);continue}i=i[0]}(ue(t)||rt(i,t,!0))&&n.push(i)}}catch(e){o.e(e)}finally{o.f()}}else(ue(t)||rt(e,t,!0))&&n.push(e);return n}function at(e,t){return void 0===e?null:qe[We(e)].encode(e,t)}function ut(e,t){if("string"==typeof e)return qe[Re[e.slice(0,1)]].decode(e,t)}function ct(e,t){return ut(at(e,t),t)}var st=9007199254740992;function lt(e,t,n,r){e.executeSql('SELECT "currNum" FROM __sys__ WHERE "name" = ?',[L(t.__currentName)],(function(e,t){1!==t.rows.length?n(1):n(t.rows.item(0).currNum)}),(function(e,t){return r(ge("DataError","Could not get the auto increment value for key",t)),!1}))}function ft(e,t,n,r,o){var i='UPDATE __sys__ SET "currNum" = ? WHERE "name" = ?',a=[n,L(t.__currentName)];F.DEBUG&&console.log(i,a),e.executeSql(i,a,(function(){r(n)}),(function(e,t){return o(ge("UnknownError","Could not set the auto increment value for key",t)),!1}))}function dt(e,t,n,r,o){return ft(e,t,n=n===st?n+2:n+1,r,o)}function _t(e,t,n,r){lt(e,t,(function(o){o>st?n("failure"):dt(e,t,o,(function(){n(null,o,o)}),r)}),r)}function pt(e,t,n,r,o){"number"!=typeof n||n<1?r():lt(e,t,(function(i){var a=Math.floor(Math.min(n,st));a>=i?dt(e,t,a,(function(){r(i)}),o):r()}),o)}var ht=Object.freeze({__proto__:null,assignCurrentNumber:ft,checkKeyCouldBeInjectedIntoValue:nt,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":">=","?")}c&&s&&n.push("AND"),s&&(n.push(t,e.upperOpen?"<":"<=","?"),r.push(L(u)))}}function gt(e,t){if(W(e,yt))return"[object IDBKeyRange]"!==e.toString()?yt.__createInstance(e.lower,e.upper,e.lowerOpen,e.upperOpen):e;if(!ue(e))return Je(e),yt.only(e);if(t)throw ge("DataError","No key or range was specified")}yt.__createInstance=function(e,t,n,r){function o(){if(this[Symbol.toStringTag]="IDBKeyRange",void 0===e&&void 0===t)throw ge("DataError","Both arguments to the key range method cannot be undefined");var o,i;if(void 0!==e&&(o=ct(e),Je(e)),void 0!==t&&(i=ct(t),Je(t)),void 0!==e&&void 0!==t&&e!==t&&at(e)>at(t))throw ge("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=vt.prototype,new o},yt.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 Je(e),rt(e,this)},yt.only=function(e){if(!arguments.length)throw new TypeError("IDBKeyRange.only requires a value argument");return yt.__createInstance(e,e,!1,!1)},yt.lowerBound=function(e){if(!arguments.length)throw new TypeError("IDBKeyRange.lowerBound requires a value argument");return yt.__createInstance(e,void 0,arguments[1],!0)},yt.upperBound=function(e){if(!arguments.length)throw new TypeError("IDBKeyRange.upperBound requires a value argument");return yt.__createInstance(void 0,e,!0,arguments[1])},yt.bound=function(e,t){if(arguments.length<=1)throw new TypeError("IDBKeyRange.bound requires lower and upper arguments");return yt.__createInstance(e,t,arguments[2],arguments[3])},yt.prototype[Symbol.toStringTag]="IDBKeyRangePrototype",["lower","upper","lowerOpen","upperOpen"].forEach((function(t){Object.defineProperty(yt.prototype,"__"+t,{enumerable:!1,configurable:!1,writable:!0});var n=e("get",{},t,(function(){if(!Y(this)||"boolean"!=typeof this.__lowerOpen)throw new TypeError("Illegal invocation");return this["__"+t]})),r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(yt.prototype,t,r)})),Object.defineProperty(yt,Symbol.hasInstance,{value:function(e){return Y(e)&&"upper"in e&&"lowerOpen"in e&&"boolean"==typeof e.lowerOpen}}),Object.defineProperty(yt,"prototype",{writable:!1});var mt=!1,Et={test:!0};if(Object.defineProperty)try{Object.defineProperty(Et,"test",{enumerable:!1}),Et.test&&(mt=!0)}catch(Ut){}var wt=function(){throw this._items=[],this._length=0,new TypeError("Illegal constructor")};wt.prototype=c(c({constructor:wt,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=wt.__createInstance();return e._items=this._items.slice(),e._length=this.length,e.addIndexes(),e},addIndexes:function(){for(var e=0;ee.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.__requests.length)e.__requests=[],e.__active&&function(){function t(){e.__completed=!0,F.DEBUG&&console.log("Transaction completed");var t=ce("complete");try{e.__internal=!0,e.dispatchEvent(t),e.__internal=!1,e.dispatchEvent(ce("__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=ce("__beforecomplete");n.complete=t,e.dispatchEvent(n)}();else try{if(!(n=e.__requests[r]).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){var n=ye(t);e.__abortTransaction(n)}}),(function(){e.__transFinishedCb===Tt.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)})))},Tt.prototype.__createRequest=function(e){var t=Ie.__createInstance();return t.__source=void 0!==e?e:this.db,t.__transaction=this,t},Tt.prototype.__addToTransactionQueue=function(e,t,n){var r=this.__createRequest(n);return this.__pushToQueue(r,e,t),r},Tt.prototype.__addNonRequestToTransactionQueue=function(e,t){this.__pushToQueue(null,e,t)},Tt.prototype.__pushToQueue=function(e,t,n){this.__assertActive(),this.__requests.push({op:t,args:n,req:e})},Tt.prototype.__assertActive=function(){if(!this.__active)throw ge("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished")},Tt.prototype.__assertWritable=function(){if("readonly"===this.mode)throw ge("ReadOnlyError","The transaction is read only")},Tt.prototype.__assertVersionChange=function(){Tt.__assertVersionChange(this)},Tt.prototype.objectStore=function(e){var t=this;if(!(t instanceof Tt))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No object store name was specified");if(Tt.__assertNotFinished(t),-1===t.__objectStoreNames.indexOf(e))throw ge("NotFoundError",e+" is not participating in this transaction");var n=t.db.__objectStores[e];if(!n)throw ge("NotFoundError",e+" does not exist in "+t.db.name);return(!t.__storeHandles[e]||t.__storeHandles[e].__pendingDelete||t.__storeHandles[e].__deleted)&&(t.__storeHandles[e]=fr.__clone(n,t)),t.__storeHandles[e]},Tt.prototype.__abortTransaction=function(e){var t=this;function n(n,r){n?r&&"code"in r&&"number"==typeof r.code?F.DEBUG&&console.log("Rollback erred; feature is probably not supported as per WebSQL",t):F.DEBUG&&console.log("Rollback succeeded",t):F.DEBUG&&console.log("Rollback not possible due to missing transaction",t),t.dispatchEvent(ce("__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=ge("AbortError","A request was aborted (an unfinished request).");var e=ce("error",t.req.__error,{bubbles:!0,cancelable:!0});return new Fe((function(n){setTimeout((function(){if(!t.req)throw new Error("Missing request");t.req.dispatchEvent(e),n()}))}))}))}),Fe.resolve(void 0)).then((function(){var n=ce("abort",e,{bubbles:!0,cancelable:!1});setTimeout((function(){t.__abortFinished=!0,t.dispatchEvent(n),t.__storeHandles={},t.dispatchEvent(ce("__abort"))}))})).catch((function(e){throw console.log("Abort error"),e}))}pe("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})})))},Tt.prototype.abort=function(){var e=this;if(!(e instanceof Tt))throw new TypeError("Illegal invocation");F.DEBUG&&console.log("The transaction was aborted",e),Tt.__assertNotFinished(e),e.__abortTransaction(null)},Tt.prototype[Symbol.toStringTag]="IDBTransactionPrototype",Tt.__assertVersionChange=function(e){if(!e||"versionchange"!==e.mode)throw ge("InvalidStateError","Not a version transaction")},Tt.__assertNotVersionChange=function(e){if(e&&"versionchange"===e.mode)throw ge("InvalidStateError","Cannot be called during a version transaction")},Tt.__assertNotFinished=function(e){if(!e||e.__completed||e.__abortFinished||e.__errored)throw ge("InvalidStateError","Transaction finished by commit or abort")},Tt.__assertNotFinishedObjectStoreMethod=function(e){try{Tt.__assertNotFinished(e)}catch(t){if(e&&!e.__completed&&!e.__abortFinished)throw ge("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished");throw t}},Tt.__assertActive=function(e){if(!e||!e.__active)throw ge("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished")},Tt.prototype.__getParent=function(){return this.db},X(Tt.prototype,Ot),z(Tt.prototype,St),Object.defineProperty(Tt.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:Tt}),Object.defineProperty(Tt,"prototype",{writable:!1});var Ut=Pt((function e(t){Bt(this,e),this.p=new Promise(t)}));Ut.__typeson__type__="TypesonPromise","undefined"!=typeof Symbol&&Object.defineProperty(Ut.prototype,Symbol.toStringTag,{get:function(){return"TypesonPromise"}}),Ut.prototype.then=function(e,t){var n=this;return new Ut((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)}))},Ut.prototype.catch=function(e){return this.then((function(){}),e)},Ut.resolve=function(e){return new Ut((function(t){t(e)}))},Ut.reject=function(e){return new Ut((function(t,n){n(e)}))},Ut.all=function(e){return new Ut((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)}))},Ut.race=function(e){return new Ut((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)}))},Ut.allSettled=function(e){return new Ut((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 Mt=Object.hasOwn,Vt=Object.getPrototypeOf;function Kt(e,t){return Yt(e)&&"function"==typeof e.then&&(!t||"function"==typeof e.catch)}function Gt(e){return Object.prototype.toString.call(e).slice(8,-1)}function Ht(e,t){if(!e||"object"!==jt(e))return!1;var n=Vt(e);if(!n)return null===t;var r=Mt(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 Qt(e){return!(!e||"Object"!==Gt(e))&&(!Vt(e)||Ht(e,Object))}function Wt(e){if(!e||"Object"!==Gt(e))return!1;var t=Vt(e);return!t||Ht(e,Object)||Wt(t)}function Yt(e){return null!==e&&"object"===jt(e)}function $t(e){return e.replaceAll("''","''''").replace(/^$/,"''").replaceAll("~","~0").replaceAll(".","~1")}function Xt(e){return e.replaceAll("~1",".").replaceAll("~0","~").replace(/^''$/,"").replaceAll("''''","''")}function zt(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[Xt(t.slice(0,n))];return void 0===r?void 0:zt(r,t.slice(n+1))}return e[Xt(t)]}function Jt(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?Jt(e[Xt(t.slice(0,r))],t.slice(r+1),n):(e[Xt(t)]=n,e)}function Zt(e){return null===e?"null":Array.isArray(e)?"array":jt(e)}function en(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var tn=Object.keys,nn=Object.hasOwn,rn=Array.isArray,on=["type","replaced","iterateIn","iterateUnsetNumeric","addLength"];function an(e){return function(){for(var t=[],n=0;ni?-1:ot.keypath?1:0}var cn=function(){function e(t){Bt(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=xt(xt(xt({},this.options),r),{},{stringification:!0});var o=this.encapsulate(e,null,r);return rn(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,xt(xt({throwOnBadSyncType:!0},r),{},{sync:!0}))}},{key:"stringifyAsync",value:function(e,t,n,r){return this.stringify(e,t,n,xt(xt({throwOnBadSyncType:!0},r),{},{sync:!1}))}},{key:"parse",value:function(e,t,n){return n=xt(xt(xt({},this.options),n),{},{parse:!0}),this.revive(JSON.parse(e,t),n)}},{key:"parseSync",value:function(e,t,n){return this.parse(e,t,xt(xt({throwOnBadSyncType:!0},n),{},{sync:!0}))}},{key:"parseAsync",value:function(e,t,n){return this.parse(e,t,xt(xt({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=xt(xt({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]:Zt(e);if(t.length){if(o.returnTypeNames)return function(e){return function(e){if(Array.isArray(e))return Lt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Rt(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&&Qt(e)&&!nn(e,"$types")?e.$types=a:e={$:e,$types:{$:a}}}else Yt(e)&&nn(e,"$types")&&(e={$:e,$types:!0});return!o.returnTypeNames&&e},_=an((function(e,t){return en(Promise.all(t.map((function(e){return e[1].p}))),(function(n){return en(Promise.all(n.map(an((function(n){var r=!1,o=[],i=kt(t.splice(0,1),1),a=kt(i[0],7),u=a[0],c=a[2],s=a[3],l=a[4],f=a[5],d=a[6],p=h(u,n,c,s,o,!0,d),y=Ht(p,Ut);return function(e,t){var n=e();return n&&n.then?n.then(t):t(n)}((function(){if(u&&y)return en(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=y?p.p:p,_(e,o))}))})))),(function(){return e}))}))})),p=function(e,t,n){Object.assign(e,t);var r=on.map((function(t){var n=e[t];return delete e[t],n}));n(),on.forEach((function(t,n){e[t]=r[n]}))},h=function e(t,n,i,s,l,d,_){var h,v={},b=jt(n),g=f?function(e){var r,o=null!==(r=null!=_?_:s.type)&&void 0!==r?r:Zt(n);f(Object.assign(null!=e?e:v,{keypath:t,value:n,cyclic:i,stateObj:s,promisesData:l,resolvingTypesonPromise:d,awaitingTypesonPromise:Ht(n,Ut)},{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?(h=s.replaced?n:y(t,n,s,l,!1,d,g))!==n&&(v={replaced:h}):h=n,g&&g(),h;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=Qt(n),I=rn(n),O=(D||I)&&(!r.plainObjectReplacers.length||s.replaced)||s.iterateIn?n:y(t,n,s,l,D||I,null,g);if(O!==n?(h=O,v={replaced:O}):""===t&&Ht(n,Ut)?(l.push([t,n,i,s,void 0,void 0,s.type]),h=n):I&&"object"!==s.iterateIn||"array"===s.iterateIn?(E=new Array(n.length),v={clone:E}):(["function","symbol"].includes(jt(n))||"toJSON"in n||Ht(n,Ut)||Ht(n,Promise)||Ht(n,ArrayBuffer))&&!D&&"object"!==s.iterateIn?h=n:(E={},s.addLength&&(E.length=n.length),v={clone:E}),g&&g(),o.iterateNone)return null!==(w=E)&&void 0!==w?w:h;if(!E)return h;if(s.iterateIn){var S=function(r){var o={ownKeys:nn(n,r)};p(s,o,(function(){var o=t+(t?".":"")+$t(r),a=e(o,n[r],Boolean(i),s,l,d);Ht(a,Ut)?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 tn(n).forEach((function(r){var o=t+(t?".":"")+$t(r);p(s,{ownKeys:!0},(function(){var t=e(o,n[r],Boolean(i),s,l,d);Ht(t,Ut)?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);Ht(t,Ut)?l.push([o,t,Boolean(i),s,E,r,s.type]):void 0!==t&&(E[r]=t)}))}},x=0;x>2],i+=fn[(3&r[a])<<4|r[a+1]>>4],i+=fn[(15&r[a+1])<<2|r[a+2]>>6],i+=fn[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){var t=e.length;if(t%4)throw new Error("Bad base64 length: not divisible by four");var n,r,o,i,a=.75*e.length,u=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);for(var c=new ArrayBuffer(a),s=new Uint8Array(c),l=0;l>4,s[u++]=(15&r)<<4|o>>2,s[u++]=(3&o)<<6|63&i;return c},yn={arraybuffer:{test:function(e){return"ArrayBuffer"===Gt(e)},replace:function(e,t){t.buffers||(t.buffers=[]);var n=t.buffers.indexOf(e);return n>-1?{index:n}:(t.buffers.push(e),pn(e))},revive:function(e,t){if(t.buffers||(t.buffers=[]),"object"==o(e))return t.buffers[e.index];var n=hn(e);return t.buffers.push(n),n}}},vn={bigintObject:{test:function(e){return"object"==o(e)&&Ht(e,BigInt)},replace:String,revive:function(e){return new Object(BigInt(e))}}},bn={bigint:{test:function(e){return"bigint"==typeof e},replace:String,revive:function(e){return BigInt(e)}}};function gn(e){for(var t=new Uint8Array(e.length),n=0;n-1?{index:i,byteOffset:r,byteLength:o}:(t.buffers.push(n),{encoded:pn(n),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;return"index"in e?n=t.buffers[a]:(n=hn(i),t.buffers.push(n)),new DataView(n,r,o)}}},Dn={date:{test:function(e){return"Date"===Gt(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)}}},In={domexception:{test:function(e){return"DOMException"===Gt(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)}}},On={};function Sn(e){On[e.name.toLowerCase()]={test:function(t){return Gt(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&&Sn(DOMMatrix),"undefined"!=typeof DOMMatrixReadOnly&&Sn(DOMMatrixReadOnly);var Tn={};function An(e){Tn[e.name.toLowerCase()]={test:function(t){return Gt(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&&An(DOMPoint),"undefined"!=typeof DOMPointReadOnly&&An(DOMPointReadOnly);var Nn={domquad:{test:function(e){return"DOMQuad"===Gt(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)}}},xn={};function jn(e){xn[e.name.toLowerCase()]={test:function(t){return Gt(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 Bn={error:{test:function(e){return"Error"===Gt(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}}},Fn={};function Pn(e){Fn[e.name.toLowerCase()]={test:function(t){return Ht(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 Pn(e)})),"undefined"!=typeof AggregateError&&Pn(AggregateError),"function"==typeof InternalError&&Pn(InternalError);var Cn={file:{test:function(e){return"File"===Gt(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([gn(r)],t,{type:n,lastModified:o})},replaceAsync:function(e){return new Ut((function(t,n){var r=new FileReader;r.addEventListener("load",(function(){t({type:e.type,stringContents:r.result,name:e.name,lastModified:e.lastModified})})),r.addEventListener("error",(function(){n(r.error)})),r.readAsBinaryString(e)}))}}},kn={file:Cn.file,filelist:{test:function(e){return"FileList"===Gt(e)},replace:function(e){for(var t=[],n=0;n-1?{index:i,byteOffset:r,length:o}:(t.buffers.push(n),{encoded:pn(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;return"index"in t?r=n.buffers[u]:(r=hn(a),n.buffers.push(r)),new e(r,o,i)}}}(e)}));var $n={undef:{test:function(e,t){return void 0===e&&(t.ownKeys||!("ownKeys"in t))},replace:function(){return 0},revive:function(){return new sn}}},Xn={userObject:{test:function(e){return Wt(e)},replace:function(e){return n({},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=f(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(){}}}],Jn=[Xn,$n,zn,Gn,[Mn,qn,Vn,Kn],Dn,Hn,Ln,Rn,Cn,kn,mn,Bn,Fn].concat("function"==typeof Map?Un:[],"function"==typeof Set?Qn:[],"function"==typeof ArrayBuffer?yn:[],"function"==typeof Uint8Array?Yn:[],"function"==typeof DataView?wn:[],"undefined"!=typeof crypto?En:[],"undefined"!=typeof BigInt?[bn,vn]:[],"undefined"!=typeof DOMException?In:[],"undefined"!=typeof DOMRect?xn:[],"undefined"!=typeof DOMPoint?Tn:[],"undefined"!=typeof DOMQuad?Nn:[],"undefined"!=typeof DOMMatrix?On:[]).concat({checkDataCloneException:{test:function(e){var t={}.toString.call(e).slice(8,-1);if(["symbol","function"].includes(o(e))||["Arguments","Module","Promise","WeakMap","WeakSet","Event","MessageChannel"].includes(t)||e&&"object"==o(e)&&"number"==typeof e.nodeType&&"function"==typeof e.insertBefore)throw new DOMException("The object cannot be cloned.","DataCloneError");return!1}}}),Zn=(new cn).register(Jn);function er(e){Zn=(new cn).register(e(Jn))}function tr(e,t){var n;try{n=Zn.stringifySync(e)}catch(e){if(Ht(e,ReferenceError)||Ht(e,me))throw ge("DataCloneError","The object cannot be cloned.");throw e}return t&&t(n),n}function nr(e){return Zn.parse(e)}function rr(e){return nr(tr(e))}var or=Object.freeze({__proto__:null,clone:rr,decode:nr,encode:tr,register:er}),ir=["objectStore","keyPath","multiEntry","unique"];function ar(){throw new TypeError("Illegal constructor")}var ur=ar;function cr(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;F.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 ut(q(e.key))}:function(e){return nr(q(e.value))};if(n.multiEntry)for(var d=H(n.name),p=at(o,n.multiEntry),h=function(){var e,n=u.rows.item(y),i=ut(n[d]);if(r&&(a&&o.some((function(e){return i.includes(e)}))||ot(p,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},y=0;y0&&a.push("OR"),a.push(G(t.name),"LIKE ? ESCAPE '^' "),u.push("%"+Q(at(e,t.multiEntry))+"%")})),a.push(")");else if(t.multiEntry)a.push("AND",G(t.name),"LIKE ? ESCAPE '^'"),u.push("%"+Q(at(n,t.multiEntry))+"%");else{bt(gt(n,e),G(t.name),a,u,!0,!1)}return[e,t,i,n,r,o,a,u]}ar.__createInstance=function(e,t){function n(){var n=this;n[Symbol.toStringTag]="IDBIndex",Z(n,ir),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=oe(t);var r=n.name;if(Tt.__assertVersionChange(n.objectStore.transaction),Tt.__assertActive(n.objectStore.transaction),ur.__invalidStateIfDeleted(n),fr.__invalidStateIfDeleted(n),t!==r){if(n.objectStore.__indexes[t]&&!n.objectStore.__indexes[t].__deleted&&!n.objectStore.__indexes[t].__pendingDelete)throw ge("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(d(o.indexNames).filter((function(e){return e!==t})).map((function(e){return[G(e),"BLOB"]})));n.__renameIndex(o,r,t,u,(function(t,n){ur.__updateIndexList(e,t,(function(e){delete i.__pendingName,n(e)}))}))}}})}return n.prototype=ur.prototype,new n},ar.__invalidStateIfDeleted=function(e,t){if(e.__deleted||e.__pendingDelete||e.__pendingCreate&&e.objectStore.transaction&&e.objectStore.transaction.__errored)throw ge("InvalidStateError",t||"This index has been deleted")},ar.__clone=function(e,t){var n=ar.__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},ar.__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]=ar.__clone(t,e)),e.transaction.__addNonRequestToTransactionQueue((function(a,u,c,s){var l=o&&(o.__deleted||o.__recreated),f={};function d(e,t){s(ge("UnknownError",'Could not create index "'+n+'"'+t.code+"::"+t.message,t))}function _(o){ar.__updateIndexList(e,o,(function(){o.executeSql('SELECT "key", "value" FROM '+K(r),[],(function(o,a){F.DEBUG&&console.log("Adding existing "+r+" records to the "+n+" index"),function u(l){if(l3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=e.__currentName,a=K(i),u=G(n),c=M("tmp_"+K(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)";F.DEBUG&&console.log(p),e.executeSql(p,[],(function(){var n="INSERT INTO "+c+"("+d+u+") SELECT "+d+G(t)+" FROM "+a;F.DEBUG&&console.log(n),e.executeSql(n,[],(function(){var t="DROP TABLE "+a;F.DEBUG&&console.log(t),e.executeSql(t,[],(function(){var t="ALTER TABLE "+c+" RENAME TO "+a;F.DEBUG&&console.log(t),e.executeSql(t,[],(function(e){if(F.useSQLiteIndexes){var t=s.slice(2).map((function(t){return new Fe((function(n,r){var o="CREATE INDEX "+M(a.slice(1,-1)+"^5"+t.slice(1,-1))+" ON "+a+"("+t+")";F.DEBUG&&console.log(o),e.executeSql(o,[],n,(function(e,t){r(t)}))}))}));t.push(new Fe((function(t,n){var r=M("sk_"+a.slice(1,-1)),o="DROP INDEX IF EXISTS "+r;F.DEBUG&&console.log(o),e.executeSql(o,[],(function(){var o="CREATE INDEX "+r+" ON "+a+'("key")';F.DEBUG&&console.log(o),e.executeSql(o,[],t,(function(e,t){n(t)}))}),(function(e,t){n(t)}))}))),Fe.all(t).then(_,i).catch((function(e){throw console.log("Index rename error"),e}))}else _()}),l)}),l)}),l)}),l)}))},Object.defineProperty(ar,Symbol.hasInstance,{value:function(e){return Y(e)&&"openCursor"in e&&"function"==typeof e.openCursor&&"multiEntry"in e&&"boolean"==typeof e.multiEntry}}),z(ar.prototype,ir),X(ar.prototype,["name"]),ar.prototype[Symbol.toStringTag]="IDBIndexPrototype",Object.defineProperty(ar,"prototype",{writable:!1});var lr=["keyPath","indexNames","transaction","autoIncrement"];function fr(){throw new TypeError("Illegal constructor")}var dr=fr;function _r(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}fr.__createInstance=function(e,t){function n(){var n=this;n[Symbol.toStringTag]="IDBObjectStore",Z(this,lr),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=wt.__createInstance();var r=e.indexList;for(var o in r)if(Object.hasOwn(r,o)){var i=ar.__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=oe(e);var n=t.name;if(dr.__invalidStateIfDeleted(t),Tt.__assertVersionChange(t.transaction),Tt.__assertActive(t.transaction),n!==e){if(t.__idbdb.__objectStores[e]&&!t.__idbdb.__objectStores[e].__pendingDelete)throw ge("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=[L(e),L(n)];F.DEBUG&&console.log(i,a),t.transaction.__addNonRequestToTransactionQueue((function(r,o,u,c){r.executeSql(i,a,(function(r){var o="ALTER TABLE "+K(n)+" RENAME TO "+K(e);F.DEBUG&&console.log(o),r.executeSql(o,[],(function(){delete t.__pendingName,u()}))}),(function(e,t){return c(t),!1}))}))}}})}return n.prototype=dr.prototype,new n},fr.__clone=function(e,t){var n=fr.__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},fr.__invalidStateIfDeleted=function(e,t){if(e.__deleted||e.__pendingDelete||e.__pendingCreate&&"transaction"in e&&e.transaction&&e.transaction.__errored)throw ge("InvalidStateError",t||"This store has been deleted")},fr.__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]=fr.__clone(t,r)),r.__addNonRequestToTransactionQueue((function(e,r,o,i){function a(e,t){return F.DEBUG&&console.log(t),i(ge("UnknownError",'Could not create object store "'+n+'"',t)),!1}var u=K(n),c=["CREATE TABLE",u,"(key BLOB",t.autoIncrement?"UNIQUE, inc INTEGER PRIMARY KEY AUTOINCREMENT":"PRIMARY KEY",", value BLOB)"].join(" ");F.DEBUG&&console.log(c),e.executeSql(c,[],(function(e){function r(){var r=JSON.stringify(t.keyPath);e.executeSql("INSERT INTO __sys__ VALUES (?,?,?,?,?)",[L(n),r,Number(t.autoIncrement),"{}",1],(function(){delete t.__pendingCreate,delete t.__deleted,o(t)}),a)}F.useSQLiteIndexes?e.executeSql("CREATE INDEX IF NOT EXISTS "+M("sk_"+u.slice(1,-1))+" ON "+u+'("key")',[],r,a):r()}),a)})),o[n]},fr.__deleteObjectStore=function(e,t){t.__pendingDelete=!0,t.__indexNames=wt.__createInstance(),e.objectStoreNames.splice(e.objectStoreNames.indexOf(t.__currentName),1);var n=e.__versionTransaction.__storeHandles[t.__currentName];n&&(n.__indexNames=wt.__createInstance(),n.__pendingDelete=!0),e.__versionTransaction.__addNonRequestToTransactionQueue((function(e,r,o,i){function a(e,t){return F.DEBUG&&console.log(t),i(ge("UnknownError","Could not delete ObjectStore",t)),!1}e.executeSql('SELECT "name" FROM __sys__ WHERE "name" = ?',[L(t.__currentName)],(function(e,r){r.rows.length>0&&e.executeSql("DROP TABLE "+K(t.__currentName),[],(function(){e.executeSql('DELETE FROM __sys__ WHERE "name" = ?',[L(t.__currentName)],(function(){delete t.__pendingDelete,t.__deleted=!0,n&&(delete n.__pendingDelete,n.__deleted=!0),o()}),a)}),a)}))}))},fr.prototype.__validateKeyAndValueAndCloneValue=function(e,t,n){var r=this;if(null!==r.keyPath){if(void 0!==t)throw ge("DataError","The object store uses in-line keys and the key parameter was provided");var o=rr(e);if((t=Ze(o,r.keyPath)).invalid)throw ge("DataError","KeyPath was specified, but key was invalid.");if(t.failure){if(!n){if(!r.autoIncrement)throw ge("DataError","Could not evaluate a key from keyPath and there is no key generator");if(!nt(o,r.keyPath))throw ge("DataError","A key could not be injected into a value");return[void 0,o]}throw ge("DataError","Could not evaluate a key from keyPath")}return[t.value,o]}if(void 0===t){if(!r.autoIncrement)throw ge("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 Je(t);return[t,rr(e)]},fr.prototype.__deriveKey=function(e,t,n,r,o){var i=this;function a(e){tr(n,(function(t){t=nr(t),r(t,e)}))}i.autoIncrement?void 0===n?_t(e,i,(function(e,n,a){e?o(ge("ConstraintError","The key generator's current number has reached the maximum safe integer limit")):(null!==i.keyPath&&tt(t,n,i.keyPath),r(n,a))}),o):pt(e,i,n,a,o):a()},fr.prototype.__insertData=function(e,t,n,r,o,i,a){var u=this,c={},s=Object.keys(u.__indexes).map((function(t){return new Fe((function(r,o){var i=u.__indexes[t];if(i.__pendingCreate||i.__deleted)r(void 0);else{var a;try{if("invalid"in(a=Ze(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=sr(!0,i,a,"key",s);cr.apply(void 0,[null].concat(d(l),[e,null,function(e){if(void 0===e)return f(i),void r(void 0);o(ge("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]=at(a,e.multiEntry))}}))}));return Fe.all(s).then((function(){var n=["INSERT INTO",K(u.__currentName),"("],o=[" VALUES ("],s=[];void 0!==r&&(n.push(M("key"),","),o.push("?,"),s.push(L(at(r)))),Object.entries(c).forEach((function(e){var t=f(e,2),r=t[0],i=t[1];n.push(G(r)+","),o.push("?,"),s.push(L(i))})),n.push(M("value")+" )"),o.push("?)"),s.push(L(t));var l=n.join(" ")+o.join(" ");F.DEBUG&&console.log("SQL for adding",l,s),e.executeSql(l,s,(function(){i(r)}),(function(e,t){return a(ge("ConstraintError",t.message,t)),!1}))})).catch((function(t){function n(){a(t)}return"number"==typeof o?(ft(e,u,o,n,n),null):(n(),null)}))},fr.prototype.add=function(e){var t=this,n=arguments[1];if(!(t instanceof fr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No value was specified");fr.__invalidStateIfDeleted(t),Tt.__assertActive(t.transaction),t.transaction.__assertWritable();var r=t.transaction.__createRequest(t),o=f(t.__validateKeyAndValueAndCloneValue(e,n,!1),2),i=o[0],a=o[1];return fr.__storingRecordObjectStore(r,t,!0,a,!0,i),r},fr.prototype.put=function(e){var t=this,n=arguments[1];if(!(t instanceof fr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No value was specified");fr.__invalidStateIfDeleted(t),Tt.__assertActive(t.transaction),t.transaction.__assertWritable();var r=t.transaction.__createRequest(t),o=f(t.__validateKeyAndValueAndCloneValue(e,n,!1),2),i=o[0],a=o[1];return fr.__storingRecordObjectStore(r,t,!0,a,!1,i),r},fr.prototype.__overwrite=function(e,t,n,r){var o="DELETE FROM "+K(this.__currentName)+' WHERE "key" = ?',i=at(t);e.executeSql(o,[L(i)],(function(e,r){F.DEBUG&&console.log("Did the row with the",t,"exist?",r.rowsAffected),n(e)}),(function(e,t){return r(t),!1}))},fr.__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){tr(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)}))},fr.prototype.__get=function(e,t,n,r){var o=this;void 0!==r&&(r=re(r,"unsigned long")),fr.__invalidStateIfDeleted(o),Tt.__assertActive(o.transaction);var i=gt(e,!n),a=["SELECT",M(t?"key":"value"),"FROM",K(o.__currentName)],u=[];if(void 0!==i&&(a.push("WHERE"),bt(i,M("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){F.DEBUG&&console.log("Fetching",o.__currentName,u),e.executeSql(c,u,(function(e,r){var o;F.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=-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=_r(mr(e.split("/"),(function(e){return!!e})),!t).join("/"),(t?"/":"")+e||"."}function vr(e){var t=br(e),n="/"===Er(e,-1);return e=_r(mr(e.split("/"),(function(e){return!!e})),!t).join("/"),e||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e}function br(e){return"/"===e.charAt(0)}var gr={extname:function(e){return hr(e)[3]},basename:function(e,t){var n=hr(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},dirname:function(e){var t=hr(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=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=yr(e).substr(1),t=yr(t).substr(1);for(var r=n(e.split("/")),o=n(t.split("/")),i=Math.min(r.length,o.length),a=i,u=0;u1&&void 0!==arguments[1]?arguments[1]:Tr(),n=Nr[t][e];if(n[0]){var r=n[0],o=r.req,i=r.cb;o.addEventListener("success",a),o.addEventListener("error",a),i(o)}function a(){n.shift(),xr(e,t)}}function jr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Tr(),r=arguments.length>3?arguments[3]:void 0;Nr[n][t]||(Nr[n][t]=[]),Nr[n][t].push({req:e,cb:r}),1===Nr[n][t].length&&xr(t,n)}function Br(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 se("versionchange",{oldVersion:n,newVersion:r});return new Fe((function(n){setTimeout((function(){t.dispatchEvent(e),n(void 0)}))}))}}))}),Fe.resolve(void 0)).then((function(){if(!i())return new Fe((function(a){var u={check:function(){i()&&a(void 0)}},c=new se("blocked",{oldVersion:n,newVersion:r});setTimeout((function(){t.dispatchEvent(c),i()?a(void 0):e.forEach((function(e){o(e)||(e.__unblocking=u)}))}))}))}))}var Fr,Pr={},Cr=0;function kr(e){return Object.keys(Pr[e]).map(Number).reduce((function(e,t){return t>e?t:e}),0)}function Rr(e,t,n,r,o){if("string"==typeof F.memoryDatabase){var i=Pr[t]?function(e){return Pr[e]&&Pr[e][kr(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")}Or&&!1!==F.deleteDatabaseFiles?Or.unlink(gr.join(F.databaseBasePath||"",n),(function(e){e&&"ENOENT"!==e.code?o({code:0,message:"Error removing database file: "+n+" "+e}):r()})):e(gr.join(F.databaseBasePath||"",n),"1",t,F.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 "+K(q(n.item(i).name)),[],(function(){t(i+1)}),(function(){return t(i+1),!1}))}(0)}),(function(){return r(),!1}))}))}function Lr(e,t,n){function r(e,t){var r=ye(t||e);F.DEBUG&&console.log("Error in sysdb transaction - when creating dbVersions",t),n(r)}Fr?t():(Fr=e("string"==typeof F.memoryDatabase?F.memoryDatabase:gr.join("string"==typeof F.sysDatabaseBasePath?F.sysDatabaseBasePath:F.databaseBasePath||"","__sysdb__"+(!1!==F.addSQLiteExtension?".sqlite":"")),"1","System Database",F.DEFAULT_DB_SIZE)).transaction((function(e){e.executeSql("CREATE TABLE IF NOT EXISTS dbVersions (name BLOB, version INT);",[],(function(e){F.useSQLiteIndexes?e.executeSql("CREATE INDEX IF NOT EXISTS dbvname ON dbVersions(name)",[],t,r):t()}),r)}),r)}function qr(){throw new TypeError("Illegal constructor")}var Ur=qr;qr.__createInstance=function(){function e(){this[Symbol.toStringTag]="IDBFactory",this.__connections={}}return e.prototype=Ur.prototype,new e},qr.prototype.open=function(e){var t=this;if(!(t instanceof qr))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=re(n,"unsigned long long")))throw new TypeError("Version cannot be 0");if(Ar())throw ge("SecurityError","Cannot open an IndexedDB database from an opaque origin.");var r=Se.__createInstance(),o=!1;F.autoName&&""===e&&(e="autoNamedDatabase_"+Cr++);var i,a=L(e=String(e)),u="string"==typeof F.memoryDatabase,c=!1!==F.cacheDatabaseInstances||u;try{i=V(e)}catch(e){throw e}function s(e,t){if(o)return!1;var n=t?ye(t):e;o=!0;var i=ce("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 Pr&&Pr[e][n]?l=Pr[e][n]:(l=t.__openDatabase(u?F.memoryDatabase:gr.join(F.databaseBasePath||"",i),"1",e,F.DEFAULT_DB_SIZE),c&&(e in Pr||(Pr[e]={}),Pr[e][n]=l)),void 0===n&&(n=o||1),o>n){var f=ge("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 _=Ir.__createInstance(u,e,l,n,f);if(t.__connections[e]||(t.__connections[e]=[]),t.__connections[e].push(_),lr.__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 lose");o(r.__connections[e][t])}else console.log("No database connections with that name to force close")},qr.prototype.__setConnectionQueueOrigin=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Tr();Nr[e]={}},qr.prototype[Symbol.toStringTag]="IDBFactoryPrototype",Object.defineProperty(qr,"prototype",{writable:!1});var Mr=qr.__createInstance();function Vr(){throw new TypeError("Illegal constructor")}var Kr=Vr;Vr.__super=function(e,t,n,r,o,i,a){this[Symbol.toStringTag]="IDBCursor",Z(this,["key","primaryKey","request"]),fr.__invalidStateIfDeleted(n),this.__indexSource=W(r,ar),this.__indexSource&&ar.__invalidStateIfDeleted(r),Tt.__assertActive(n.transaction);var u=gt(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=Ie.__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?ht:or,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&&at(u.lower,this.__multiEntryIndex),u.__upperCached=void 0!==u.upper&&at(u.upper,this.__multiEntryIndex)),this.__gotValue=!0,this.continue()},Vr.__createInstance=function(){var e=Kr.__super;e.prototype=Kr.prototype;for(var t=arguments.length,n=new Array(t),r=0;r":"<";void 0!==t&&(l.push("AND",s,_+"= ?"),f.push(at(t))),void 0!==e?(l.push("AND",c,_+"= ?"),f.push(at(e))):a&&void 0!==u.__key&&(l.push("AND",c,_+" ?"),f.push(at(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(",",M(u.__valueColumnName),d),l.push("LIMIT",String(i)));var p=l.join(" ");F.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,F.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):(F.DEBUG&&console.log("Reached end of cursors"),r(void 0,void 0,void 0))}),(function(e,t){return F.DEBUG&&console.log("Could not execute Cursor.continue",p,f),o(t),!1}))};var Gr=/\[/g;function Hr(){throw new TypeError("Illegal constructor")}Vr.prototype.__findMultiEntry=function(e,t,n,r,o){var i=this;if(i.__prefetchedData&&i.__prefetchedData.length===i.__prefetchedIndex)return F.DEBUG&&console.log("Reached end of multiEntry cursor"),void r(void 0,void 0,void 0);var a=M(i.__keyColumnName),u=["SELECT * FROM",K(i.__store.__currentName)],c=[];u.push("WHERE",a,"NOT NULL"),i.__range&&void 0!==i.__range.lower&&Array.isArray(i.__range.upper)&&0===i.__range.upper.indexOf(i.__range.lower)&&(u.push("AND",a,"LIKE ? ESCAPE '^'"),c.push("%"+Q(i.__range.__lowerCached.slice(0,-1))+"%"));var s=i.__sqlDirection,l="ASC"===s?">":"<",f=M("key");void 0!==t&&(u.push("AND",f,l+"= ?"),c.push(at(t))),void 0!==e?(u.push("AND",a,l+"= ?"),c.push(at(e))):void 0!==i.__key&&(u.push("AND",a,l+" ?"),c.push(at(i.__key))),i.__count||(u.push("ORDER BY",a,s),i.__unique||"key"===i.__keyColumnName||u.push(",",M("key"),s),!i.__unique&&i.__indexSource&&u.push(",",M(i.__valueColumnName),s));var d=u.join(" ");F.DEBUG&&console.log(d,c),n.executeSql(d,c,(function(e,t){if(t.rows.length>0){if(i.__count){for(var n=0,o=0;ot.matchingKey.replaceAll(Gr,"z")?d?-1:1:e.keyt.key?"prev"===i.direction?-1:1:0})),a.length>1?(i.__prefetchedIndex=0,i.__prefetchedData={data:a,length:a.length,item:function(e){return this.data[e]}},F.DEBUG&&console.log("Preloaded "+i.__prefetchedData.length+" records for multiEntry cursor"),i.__decode(a[0],r)):1===a.length?(F.DEBUG&&console.log("Reached end of multiEntry cursor"),i.__decode(a[0],r)):(F.DEBUG&&console.log("Reached end of multiEntry cursor"),r(void 0,void 0,void 0))}else F.DEBUG&&console.log("Reached end of multiEntry cursor"),r(void 0,void 0,void 0)}),(function(e,t){return F.DEBUG&&console.log("Could not execute Cursor.continue",d,c),o(t),!1}))},Vr.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))}},Vr.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=q(n.__multiEntryIndex?e.matchingKey:e[n.__keyColumnName]),o=q(e[n.__valueColumnName]),i=q(e.key);t(ut(r,n.__multiEntryIndex),n.__valueDecoder.decode(o),ut(i),r)},Vr.prototype.__sourceOrEffectiveObjStoreDeleted=function(){fr.__invalidStateIfDeleted(this.__store,"The cursor's effective object store has been deleted"),this.__indexSource&&ar.__invalidStateIfDeleted(this.source,"The cursor's index source has been deleted")},Vr.prototype.__invalidateCache=function(){this.__prefetchedData=null},Vr.prototype.__continue=function(e,t){var n=this,r=void 0!==n.__advanceCount;if(Tt.__assertActive(n.__store.transaction),n.__sourceOrEffectiveObjStoreDeleted(),!n.__gotValue&&!t)throw ge("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(void 0!==e){Je(e);var o=Pe(e,n.key);if(0===o||n.direction.includes("next")&&-1===o||n.direction.includes("prev")&&1===o)throw ge("DataError","Cannot "+(r?"advance":"continue")+" the cursor in an unexpected direction")}this.__continueFinish(e,void 0,r)},Vr.prototype.__continueFinish=function(e,t,n){var r=this,o=r.__advanceCount||F.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.__prefetchedIndex0||0===_&&(r.__unique||void 0===t||Pe(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;nt)throw ge("DataError","Cannot continue the cursor in an unexpected direction");o()}))})):o()},Vr.prototype.advance=function(e){var t=this;if(0===(e=re(e,"unsigned long")))throw new TypeError("Calling advance() with count argument 0");t.__gotValue&&(t.__advanceCount=e),t.__continue()},Vr.prototype.update=function(e){var t=this;if(!arguments.length)throw new TypeError("A value must be passed to update()");if(Tt.__assertActive(t.__store.transaction),t.__store.transaction.__assertWritable(),t.__sourceOrEffectiveObjStoreDeleted(),!t.__gotValue)throw ge("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(t.__keyOnly)throw ge("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){fr.__storingRecordObjectStore(n,t.__store,!1,e,!1,r)}if(null!==t.__store.keyPath){var i=f(t.__store.__validateKeyAndValueAndCloneValue(e,void 0,!0),2),a=i[0],u=i[1];if(0!==Pe(t.primaryKey,a))throw ge("DataError","The key of the supplied value to `update` is not equal to the cursor's effective key");o(u)}else{o(rr(e))}return n},Vr.prototype.delete=function(){var e=this;if(Tt.__assertActive(e.__store.transaction),e.__store.transaction.__assertWritable(),e.__sourceOrEffectiveObjStoreDeleted(),!e.__gotValue)throw ge("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(e.__keyOnly)throw ge("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 "+K(e.__store.__currentName)+' WHERE "key" = ?';F.DEBUG&&console.log(u,n,a),t.executeSql(u,[L(at(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)},Vr.prototype[Symbol.toStringTag]="IDBCursorPrototype",z(Vr.prototype,["source","direction","key","primaryKey","request"]),Object.defineProperty(Vr,"prototype",{writable:!1}),Hr.prototype=Object.create(Vr.prototype),Object.defineProperty(Hr.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:Hr});var Qr=Hr;function Wr(e,t){if(e&&"object"===o(e))Object.entries(e).forEach((function(e){var t=f(e,2);Wr(t[0],t[1])}));else{if(!(e in F))throw new Error(e+" is not a valid configuration property");F[e]=t,"registerSCA"===e&&"function"==typeof t&&er(t)}}Hr.__createInstance=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:"";o(e+"DOMException",me),o(e+"DOMStringList",wt,{enumerable:!1,configurable:!0,writable:!0,value:wt}),o(e+"Event",O,{configurable:!0,writable:!0,value:O,enumerable:!1}),o(e+"CustomEvent",S,{configurable:!0,writable:!0,value:S,enumerable:!1}),o(e+"EventTarget",N,{configurable:!0,writable:!0,value:N,enumerable:!1})}var t,n=qr;if(void 0!==F.win.openDatabase){if(Mr.__openDatabase=F.win.openDatabase.bind(F.win),o("indexedDB",Mr,{enumerable:!0,configurable:!0,get:function(){if(this!==r&&!ue(this)&&!this.shimNS)throw new TypeError("Illegal invocation");return Mr}}),[["IDBFactory",n],["IDBDatabase",Ir],["IDBObjectStore",fr],["IDBIndex",ar],["IDBTransaction",Tt],["IDBCursor",Vr],["IDBCursorWithValue",Hr],["IDBKeyRange",yt],["IDBRequest",Ie],["IDBOpenDBRequest",Se],["IDBVersionChangeEvent",se]].forEach((function(e){var t=f(e,2);o(t[0],t[1],{enumerable:!1,configurable:!0})})),F.fs&&(t=F.fs,Or=t),F.fullIDLSupport&&(Object.setPrototypeOf(r.IDBOpenDBRequest,r.IDBRequest),Object.setPrototypeOf(r.IDBCursorWithValue,r.IDBCursor),Object.setPrototypeOf(Ir,N),Object.setPrototypeOf(Ie,N),Object.setPrototypeOf(Tt,N),Object.setPrototypeOf(se,O),Object.setPrototypeOf(me,Error),Object.setPrototypeOf(me.prototype,Error.prototype),Object.setPrototypeOf(S,O),Object.setPrototypeOf(S.prototype,O.prototype)),r.indexedDB&&!r.indexedDB.toString().includes("[native code]")&&(F.addNonIDBGlobals&&e("Shim"),F.replaceNonIDBGlobals&&e()),!r.shimIndexedDB)return;r.shimIndexedDB.__setConnectionQueueOrigin()}},r.shimIndexedDB.__debug=function(e){F.DEBUG=e},r.shimIndexedDB.__setConfig=Wr,r.shimIndexedDB.__getConfig=function(e){if(!(e in F))throw new Error(e+" is not a valid configuration property");return F[e]},r.shimIndexedDB.__setUnicodeIdentifiers=function(e){Wr({UnicodeIDStart:e.UnicodeIDStart,UnicodeIDContinue:e.UnicodeIDContinue})}):(r.shimIndexedDB={},["__useShim","__debug","__setConfig","__getConfig","__setUnicodeIdentifiers"].forEach((function(e){r.shimIndexedDB[e]=function(){console.warn("This browser does not have WebSQL to shim.")}}))),"indexedDB"in r||"undefined"==typeof window||(r.indexedDB=r.indexedDB||"webkitIndexedDB"in r&&r.webkitIndexedDB||"mozIndexedDB"in r&&r.mozIndexedDB||"oIndexedDB"in r&&r.oIndexedDB||"msIndexedDB"in r&&r.msIndexedDB);var i=!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)&&!("MSStream"in window))&&(i=!0),F.DEFAULT_DB_SIZE||(F.DEFAULT_DB_SIZE=1024*("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")?25:4)*1024),F.avoidAutoShim||r.indexedDB&&!i||void 0===F.win.openDatabase?(r.IDBDatabase=r.IDBDatabase||"webkitIDBDatabase"in r&&r.webkitIDBDatabase,r.IDBTransaction=r.IDBTransaction||"webkitIDBTransaction"in r&&r.webkitIDBTransaction||{},r.IDBCursor=r.IDBCursor||"webkitIDBCursor"in r&&r.webkitIDBCursor,r.IDBKeyRange=r.IDBKeyRange||"webkitIDBKeyRange"in r&&r.webkitIDBKeyRange):r.shimIndexedDB.__useShim()}()})); //# sourceMappingURL=indexeddbshim.min.js.map