indexeddbshim 16.1.0 → 17.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.
Files changed (82) hide show
  1. package/README.md +65 -3
  2. package/badges/licenses-badge-dev.svg +1 -1
  3. package/badges/licenses-badge.svg +1 -1
  4. package/dist/CFG.d.ts +1 -0
  5. package/dist/CFG.d.ts.map +1 -1
  6. package/dist/DOMException.d.ts.map +1 -1
  7. package/dist/DOMStringList.d.ts.map +1 -1
  8. package/dist/IDBCursor.d.ts +12 -3
  9. package/dist/IDBCursor.d.ts.map +1 -1
  10. package/dist/IDBDatabase.d.ts +2 -1
  11. package/dist/IDBDatabase.d.ts.map +1 -1
  12. package/dist/IDBFactory.d.ts +2 -1
  13. package/dist/IDBFactory.d.ts.map +1 -1
  14. package/dist/IDBIndex.d.ts +2 -1
  15. package/dist/IDBIndex.d.ts.map +1 -1
  16. package/dist/IDBKeyRange.d.ts +1 -1
  17. package/dist/IDBKeyRange.d.ts.map +1 -1
  18. package/dist/IDBObjectStore.d.ts +2 -1
  19. package/dist/IDBObjectStore.d.ts.map +1 -1
  20. package/dist/IDBRequest.d.ts +5 -3
  21. package/dist/IDBRequest.d.ts.map +1 -1
  22. package/dist/IDBTransaction.d.ts +23 -1
  23. package/dist/IDBTransaction.d.ts.map +1 -1
  24. package/dist/Key.d.ts.map +1 -1
  25. package/dist/Sca.d.ts.map +1 -1
  26. package/dist/UnicodeIdentifiers.d.ts.map +1 -1
  27. package/dist/browser-noninvasive.d.ts.map +1 -1
  28. package/dist/indexeddbshim-Key.js +1863 -1669
  29. package/dist/indexeddbshim-Key.js.map +1 -1
  30. package/dist/indexeddbshim-Key.min.js +2 -2
  31. package/dist/indexeddbshim-Key.min.js.map +1 -1
  32. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs +2373 -1893
  33. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
  34. package/dist/indexeddbshim-UnicodeIdentifiers.js +3124 -2285
  35. package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
  36. package/dist/indexeddbshim-UnicodeIdentifiers.min.js +9 -2
  37. package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
  38. package/dist/indexeddbshim-node.cjs +2373 -1893
  39. package/dist/indexeddbshim-node.cjs.map +1 -1
  40. package/dist/indexeddbshim-noninvasive.js +3123 -2284
  41. package/dist/indexeddbshim-noninvasive.js.map +1 -1
  42. package/dist/indexeddbshim-noninvasive.min.js +9 -2
  43. package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
  44. package/dist/indexeddbshim.js +3120 -2282
  45. package/dist/indexeddbshim.js.map +1 -1
  46. package/dist/indexeddbshim.min.js +9 -2
  47. package/dist/indexeddbshim.min.js.map +1 -1
  48. package/dist/node-UnicodeIdentifiers.d.ts +2 -2
  49. package/dist/node-UnicodeIdentifiers.d.ts.map +1 -1
  50. package/dist/node.d.ts +2 -2
  51. package/dist/node.d.ts.map +1 -1
  52. package/dist/nodeSQLiteDatabase.d.ts +65 -0
  53. package/dist/nodeSQLiteDatabase.d.ts.map +1 -0
  54. package/dist/nodeWebSQL.d.ts.map +1 -1
  55. package/dist/util.d.ts +5 -0
  56. package/dist/util.d.ts.map +1 -1
  57. package/package.json +118 -106
  58. package/src/CFG.js +5 -3
  59. package/src/DOMException.js +11 -9
  60. package/src/DOMStringList.js +8 -3
  61. package/src/Event.js +2 -0
  62. package/src/IDBCursor.js +152 -95
  63. package/src/IDBDatabase.js +9 -6
  64. package/src/IDBFactory.js +31 -20
  65. package/src/IDBIndex.js +83 -79
  66. package/src/IDBKeyRange.js +42 -35
  67. package/src/IDBObjectStore.js +83 -77
  68. package/src/IDBRequest.js +28 -15
  69. package/src/IDBTransaction.js +40 -6
  70. package/src/IDBVersionChangeEvent.js +2 -0
  71. package/src/Key.js +28 -14
  72. package/src/Sca.js +2 -1
  73. package/src/UnicodeIdentifiers.js +2 -2
  74. package/src/browser-UnicodeIdentifiers.js +0 -1
  75. package/src/browser-noninvasive.js +0 -1
  76. package/src/browser.js +0 -1
  77. package/src/node-UnicodeIdentifiers.js +6 -2
  78. package/src/node.js +6 -2
  79. package/src/nodeSQLiteDatabase.js +174 -0
  80. package/src/nodeWebSQL.js +1 -3
  81. package/src/setGlobalVars.js +13 -13
  82. package/src/util.js +75 -15
@@ -1,3 +1,10 @@
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()}()}));
1
+ /*! indexeddbshim - v17.1.0 - 8/6/2026 */
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){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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,v(r.key),r)}}function i(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=g(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 u(e,t,n,r){var o={configurable:!0,enumerable:!0};return o[e]=r,Object.defineProperty(t,n,o)}function c(e,t,n){return(t=v(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(s=function(){return!!e})()}function l(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 f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){c(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _(){
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,_={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,u=0,c=e,_.n=n,a}};function d(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]<=d&&((o=n<2&&d<i[1])?(u=0,_.v=r,_.n=i[1]):d<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,_.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&&d(l,p),u=l,c=p;(t=u<2?e:c)||!f;){i||(u?u<3?(u>1&&(_.n=-1),d(u,c)):_.n=c:_.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=_.n<0)?c:n.call(r,_))!==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),f=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(f),e}return c.prototype=s,d(f,"constructor",s),d(s,"constructor",c),c.displayName="GeneratorFunction",d(s,o,"GeneratorFunction"),d(f),d(f,o,"Generator"),d(f,r,function(){return this}),d(f,"toString",function(){return"[object Generator]"}),(_=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){function i(t,n){d(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},d(e,t,n,r)}function p(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)||g(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 h(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function y(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)||g(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 v(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 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)}function g(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 m(e){return m="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},m(e)}var E=0,w=1,D=2,O=3,S="undefined"==typeof DOMException?function(e,t){var n=new Error(e);return n.name=t,n}:DOMException,I=new WeakMap,T=new WeakMap,A=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),T.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},{}))};A.prototype.preventDefault=function(){if(!(this instanceof A))throw new TypeError("Illegal invocation");var e=I.get(this),t=T.get(this);this.cancelable&&!t._passive&&(t.defaultPrevented=!0,"function"==typeof e.preventDefault&&e.preventDefault())},A.prototype.stopImmediatePropagation=function(){T.get(this)._stopImmediatePropagation=!0},A.prototype.stopPropagation=function(){T.get(this)._stopPropagation=!0},A.prototype.initEvent=function(e,t,n){var r=T.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(A.prototype,e,{enumerable:!0,configurable:!0,get:function(){throw new TypeError("Illegal invocation")}})}),["eventPhase","defaultPrevented","bubbles","cancelable","timeStamp"].forEach(function(e){Object.defineProperty(A.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(A,e,{enumerable:!0,writable:!1,value:t}),Object.defineProperty(A.prototype,e,{writable:!1,value:t})}),A[Symbol.toStringTag]="Function",A.prototype[Symbol.toStringTag]="EventPrototype",Object.defineProperty(A,"prototype",{writable:!1});var N=function(e){var t=Array.prototype.slice.call(arguments),n=t[1],r=t[2];A.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 x(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(N.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:N}),N.prototype.initCustomEvent=function(e,t,n,r){if(!(this instanceof N))throw new TypeError("Illegal invocation");var o=T.get(this);N.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}}))},N[Symbol.toStringTag]="Function",N.prototype[Symbol.toStringTag]="CustomEventPrototype",Object.defineProperty(N.prototype,"detail",{enumerable:!0,configurable:!0,get:function(){throw new TypeError("Illegal invocation")}}),Object.defineProperty(N,"prototype",{writable:!1});var B={addListener:function(e,t,n,r){var o=x(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=x(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 x(e,n,r).listenersByTypeOptions.some(function(e){return e.listener===t})}};function F(){throw new TypeError("Illegal constructor")}Object.assign(F.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 S("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:{}}),B[n+"Listener"](this[i],r,e,o)}}),e},{})),Object.assign(F.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=T.get(e);if(o&&t&&o._dispatched)throw new S("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 N(o,{bubbles:t,cancelable:n,detail:r},e):new A(o,{bubbles:t,cancelable:n},e)}(e),(o=T.get(r))._dispatched=!0,this._extraProperties.forEach(function(t){t in e&&(r[t]=e[t])}));var i=r.type;function a(){o.eventPhase=E,o.currentTarget=null,delete o._children}function u(){o._stopImmediatePropagation=void 0,o._stopPropagation=void 0,r.defaultPrevented&&o.cancelable||(o.eventPhase=D,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=D,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 w: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=D),s&&(s._defaultSync=this._defaultSync),(s||this)._dispatchEvent(r,!1);case D:return o._stopPropagation?c():(this.invokeCurrentListeners(this._listeners,r,i,!0),o.bubbles?(o.eventPhase=O,this._dispatchEvent(r,!1)):c());case O: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=D,this.invokeCurrentListeners(this._earlyListeners,r,i),!("__getParent"in this))return o.eventPhase=D,this._dispatchEvent(r,!1);for(var f=this,_=this;f.__getParent&&null!==(f=f.__getParent());)o._children||(o._children=[]),o._children.push(_),_=f;return _._defaultSync=this._defaultSync,o.eventPhase=w,_._dispatchEvent(r,!1)}},invokeCurrentListeners:function(e,t,n,r){var o=this,i=T.get(t);i.currentTarget=this;var a=x(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,_=s.capture;if(i._passive=f,_&&t.target!==t.currentTarget&&t.eventPhase===w||t.eventPhase===D||!_&&t.target!==t.currentTarget&&t.eventPhase===O){var d=e.listener;o.tryCatch(t,function(){d.call(t.currentTarget,t)}),l&&o.removeEventListener(n,d,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":m(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)}}),F.prototype[Symbol.toStringTag]="EventTargetPrototype",Object.defineProperty(F,"prototype",{writable:!1});var j=F,C={createInstance:function(e){var t=function(){this.__setOptions(e)};return t.prototype=j.prototype,new t}};F.ShimEvent=A,F.ShimCustomEvent=N,F.ShimDOMException=S,F.ShimEventTarget=F,F.EventTargetFactory=C;var P,k,R={},L={};function q(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","escapeNULForSQLiteStatements","createIndexes"].forEach(function(e){var t;if(Array.isArray(e)){var n=p(e,2);e=n[0],t=n[1]}Object.defineProperty(L,e,{get:function(){return R[e]},set:function(n){t&&t(n),R[e]=n}})});var U=q(k?P:(k=1,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]|\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 M(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 K(e){return"_"+M(e.replaceAll("^","^^").replaceAll("\0","^0").replaceAll(/([A-Z])/g,"^$1"))}function V(e){var t=e.replaceAll("^","^^");return M(!1===L.escapeNULForSQLiteStatements?t:t.replaceAll("\0","^0"))}function G(e){var t=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);return!1===L.escapeNULForSQLiteStatements?t.replaceAll("^^","^"):t.replaceAll(/(\^+)0/g,function(e,t){return t.length%2?t.slice(1)+"\0":e}).replaceAll("^^","^")}function H(e){return'"'+function(e){return e.replaceAll('"','""')}(e)+'"'}function Q(e){if(L.escapeDatabaseName)return L.escapeDatabaseName(V(e));if(e="D"+K(e),!1!==L.escapeNFDForDatabaseNames&&(e=e.replaceAll(new RegExp(U,"gu"),function(e){return"^4"+e.codePointAt(0).toString(16).padStart(6,"0")})),!1!==L.databaseCharacterEscapeList&&(e=e.replace(L.databaseCharacterEscapeList?new RegExp(L.databaseCharacterEscapeList,"gu"):/[\0-\x1F"\*\/:<>\?\\\|\x7F]/g,function(e){return"^1"+e.charCodeAt(0).toString(16).padStart(2,"0")})),!1!==L.databaseNameLengthLimit&&e.length>=(L.databaseNameLengthLimit||254)-(!1!==L.addSQLiteExtension?7:0))throw new Error("Unexpectedly long database name supplied; length limit required for Node compatibility; passed length: "+e.length+"; length limit setting: "+(L.databaseNameLengthLimit||254)+".");return e+(!1!==L.addSQLiteExtension?".sqlite":"")}function W(e){return H("S"+K(e))}function z(e){return H("I"+K(e))}function $(e){return"I"+K(e)}function J(e){return e.replaceAll("^","^^")}function X(e,t){return t[Symbol.hasInstance](e)}function Y(e){return null!==e&&"object"===b(e)}function Z(e){return Y(e)&&Symbol.iterator in e&&"function"==typeof e[Symbol.iterator]}function ee(e,t){t.forEach(function(t){var n=u("set",u("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 te(e,t){t.forEach(function(t){var n=u("get",{},t,function(){throw new TypeError("Illegal invocation")}),r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r)})}function ne(e,t){(t="string"==typeof t?[t]:t).forEach(function(t){var n=u("set",u("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 re(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&&Object.hasOwn(n,t)?r=n[t]:(Object.defineProperty(e,"__"+t,{enumerable:!1,configurable:!1,writable:!0}),r=u("get",{},t,function(){return this["__"+t]}));var o=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,o)})}function oe(e){var t=L.UnicodeIDStart||"[$A-Z_a-z]",n=L.UnicodeIDContinue||"[$0-9A-Z_a-z]";return new RegExp("^"+("(?:"+t+"|[$_])")+("(?:"+n+"|[$_‌‍])")+"*$","u").test(e)}function ie(e){return"string"==typeof e&&(""===e||oe(e)||e.split(".").every(function(e){return oe(e)}))}function ae(e){return ie(e)||Array.isArray(e)&&Boolean(e.length)&&y(e).every(function(e){return ie(e)})}function ue(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 ce(e,t){return null===e&&t?"":se(e)}function se(e){return""+e}function le(e){return Z(e)?y(e).map(function(e){return se(e)}):se(e)}function fe(e){return null==e}var _e={queue:null};function de(e){if(_e.queue)_e.queue.push(e);else{var t=[e];_e.queue=t;try{for(;t.length;){t.shift()()}}finally{_e.queue=null}}}function pe(e,t,n){var r=new A(e,n);return r.debug=t,r}Object.defineProperty(A,Symbol.hasInstance,{value:function(e){return Y(e)&&"target"in e&&"bubbles"in e&&"boolean"==typeof e.bubbles}});function he(e){A.call(this,e),this[Symbol.toStringTag]="IDBVersionChangeEvent",this.toString=function(){return"[object IDBVersionChangeEvent]"},this.__eventInitDict=arguments[1]||{}}function ye(e,t){return new DOMException.prototype.constructor(t,e||"DOMException")}he.prototype=Object.create(A.prototype),he.prototype[Symbol.toStringTag]="IDBVersionChangeEventPrototype",["oldVersion","newVersion"].forEach(function(e){var t=u("get",{},e,function(){if(!(this instanceof he))throw new TypeError("Illegal invocation");return this.__eventInitDict&&this.__eventInitDict[e]||("oldVersion"===e?0:null)}),n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(he.prototype,e,n)}),Object.defineProperty(he,Symbol.hasInstance,{value:function(e){return Y(e)&&"oldVersion"in e&&"defaultPrevented"in e&&"boolean"==typeof e.defaultPrevented}}),Object.defineProperty(he.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:he}),Object.defineProperty(he,"prototype",{writable:!1});var ve={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},be={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 ge=function(){function e(e,t){this[Symbol.toStringTag]="DOMException",this._code=Object.hasOwn(ve,t)?ve[t]:be[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(ve).forEach(function(t){Object.defineProperty(e.prototype,t,{enumerable:!0,configurable:!1,value:ve[t]}),Object.defineProperty(e,t,{enumerable:!0,configurable:!1,value:ve[t]})}),Object.keys(be).forEach(function(t){Object.defineProperty(e.prototype,t,{enumerable:!0,configurable:!1,value:be[t]}),Object.defineProperty(e,t,{enumerable:!0,configurable:!1,value:be[t]})}),Object.defineProperty(e.prototype,"constructor",{writable:!0,configurable:!0,enumerable:!1,value:e}),e}();function me(e,t,n){if(L.DEBUG){var r=n&&"object"===b(n)&&n.message?n.message:n,o="function"==typeof console.error?"error":"log";console[o](e+": "+t+". "+(r||"")),console.trace&&console.trace()}}function Ee(e){return e&&"object"===b(e)&&"string"==typeof e.name}function we(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=Se(t,n);return r.sqlError=e,r}var De,Oe=!1;try{Ee(De=ye("test name","test message"))&&"test name"===De.name&&"test message"===De.message&&(Oe=!0)}catch(e){}var Se=Oe?function(e,t,n){return me(e,t,n),ye(e,t)}:function(e,t,n){return me(e,t,n),function(e,t){return new ge(t,e)}(e,t)},Ie=Oe?DOMException:ge,Te=["onsuccess","onerror"],Ae=["source","transaction","readyState"],Ne=["result","error"];function xe(){throw new TypeError("Illegal constructor")}xe.__super=function(){var e=this;this[Symbol.toStringTag]="IDBRequest",this.__setOptions({legacyOutputDidListenersThrowFlag:!0}),Ne.forEach(function(t){Object.defineProperties(e,c(c({},"__"+t,{enumerable:!1,configurable:!1,writable:!0}),t,{enumerable:!0,configurable:!0,get:function(){if(!this.__done)throw Se("InvalidStateError","Can't get "+t+"; the request is still pending.");return this["__"+t]}}))}),re(this,Ae,{readyState:{get readyState(){return this.__done?"done":"pending"}}}),ne(this,Te),this.__result=void 0,this.__error=this.__source=this.__transaction=null,this.__done=!1},xe.__createInstance=function(){return new xe.__super},xe.prototype=C.createInstance({extraProperties:["debug"]}),xe.prototype[Symbol.toStringTag]="IDBRequestPrototype",xe.prototype.__getParent=function(){return"[object IDBOpenDBRequest]"===this.toString()?null:this.__transaction},te(xe.prototype,Ae),te(xe.prototype,Ne),ee(xe.prototype,Te),Object.defineProperty(xe.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:xe}),xe.__super.prototype=xe.prototype,Object.defineProperty(xe,"prototype",{writable:!1});var Be=["onblocked","onupgradeneeded"];function Fe(){throw new TypeError("Illegal constructor")}Fe.prototype=Object.create(xe.prototype),Object.defineProperty(Fe.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:Fe});var je=Fe;function Ce(e){return e&&"function"==typeof e.then}function Pe(e,t){e.then(null,t)}Fe.__createInstance=function(){function e(){xe.__super.call(this),this[Symbol.toStringTag]="IDBOpenDBRequest",this.__setOptions({legacyOutputDidListenersThrowFlag:!0,extraProperties:["oldVersion","newVersion","debug"]}),ne(this,Be)}return e.prototype=je.prototype,new e},ee(Fe.prototype,Be),Fe.prototype[Symbol.toStringTag]="IDBOpenDBRequestPrototype",Object.defineProperty(Fe,"prototype",{writable:!1});var ke,Re,Le=function(){function e(t){var n=this;r(this,e),c(this,"v",0),this.s=2,this.c=[[],[]];var o=function(e,t){n.v=e,n.s=t,n.c[t].forEach(function(t){t(e)}),n.c[t].length&&(n.c=null)},i=function(e){n.c&&(Ce(e)?Pe(e.then(i),a):o(e,0))},a=function(e){n.c&&(Ce(e)?Pe(e.then(a),a):o(e,1))};try{t(i,a)}catch(e){a(e)}}return i(e,[{key:"then",value:function(t,n){var r=this;return new e(function(e,o){var i="function"==typeof n?n:o,a=function(){try{e(t?t(r.v):r.v)}catch(e){i(e)}};0===r.s?a():1===r.s?i(r.v):(r.c[0].push(a),r.c[1].push(i))})}},{key:"catch",value:function(t){var n=this;return new e(function(e,r){var o=function(){try{e(t(n.v))}catch(e){r(e)}};1===n.s?o():0===n.s?e(n.v):(n.c[1].push(o),n.c[0].push(e))})}}],[{key:"all",value:function(t){return new e(function(e,n){var r=t.length,o=[];r?t.forEach(function(i,a){Ce(i)?Pe(i.then(function(t){o[a]=t,--r||e(o)}),n):(o[a]=i,--r||e(t))}):e(o)})}},{key:"race",value:function(t){var n=!1;return new e(function(e,r){t.some(function(t){return Ce(t)?(Pe(t.then(function(t){n||(e(t),n=!0)}),r),!1):(e(t),n=!0,!0)})})}},{key:"resolve",value:function(t){return new e(function(e){e(t)})}},{key:"reject",value:function(t){return new e(function(e,n){n(t)})}}])}();function qe(e,t){var n=ft(e),r=ft(t),o=n>r?1:n===r?0:-1;if(L.DEBUG){var i=_t(n),a=_t(r);"object"===b(e)&&(e=JSON.stringify(e),i=JSON.stringify(i)),"object"===b(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}var Ue={invalid:100,number:200,date:300,string:400,binary:500,array:600},Me=Object.keys(Ue);Me.forEach(function(e){Ue[e]=String.fromCodePoint(Ue[e])});var Ke=Me.reduce(function(e,t){return e[Ue[t]]=t,e},{}),Ve=["negativeInfinity","bigNegative","smallNegative","smallPositive","bigPositive","positiveInfinity"],Ge={invalid:{encode:function(){return Ue.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=Ve.indexOf("smallNegative"),n=He(a)):(t=Ve.indexOf("bigNegative"),n=We(He(-1!==i?i:o.length))),r=We(Qe(o))):e<1?(t=Ve.indexOf("smallPositive"),n=We(He(a)),r=Qe(o)):(t=Ve.indexOf("bigPositive"),n=He(-1!==i?i:o.length),r=Qe(o)):(n=Je(2),r=Je(11),t=Ve.indexOf(e>0?"positiveInfinity":"negativeInfinity")),Ue.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(Ve[t]){case"negativeInfinity":return-1/0;case"positiveInfinity":return 1/0;case"bigPositive":return ze(r,n);case"smallPositive":return ze(r,n=Xe(We(n)));case"smallNegative":return n=Xe(n),-ze(r=We(r),n);case"bigNegative":return n=We(n),-ze(r=We(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")+" "),Ue.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=a(e.entries());try{for(r.s();!(t=r.n()).done;){var o=p(t.value,2),i=o[0],u=ft(o[1],!0);n[i]=u}}catch(e){r.e(e)}finally{r.f()}n.push(Ue.invalid+"-");var c=JSON.stringify(n);return!1===L.escapeNULForSQLiteStatements&&(c=c.replaceAll(String.raw(ke||(ke=h(["\0"],["\\u0000"]))),"\0")),Ue.array+"-"+c},decode:function(e){var t=e.slice(2);!1===L.escapeNULForSQLiteStatements&&(t=t.replaceAll("\0",String.raw(Re||(Re=h(["\0"],["\\u0000"])))));var n=JSON.parse(t);n.pop();for(var r=0;r<n.length;r++){var o=_t(n[r],!0);n[r]=o}return n}},date:{encode:function(e){return Ue.date+"-"+e.toJSON()},decode:function(e){return new Date(e.slice(2))}},binary:{encode:function(e){return Ue.binary+"-"+(e.byteLength?y(et(e)).map(function(e){return String(e).padStart(3,"0")}):"")},decode:function(e){var t=e.slice(2),n=t.length?t.split(",").map(Number):[],r=new ArrayBuffer(n.length);return new Uint8Array(r).set(n),r}}};function He(e){var t=e.toString(32);return 1===t.length?"0"+t:t}function Qe(e){return(e+Je(11)).slice(0,11)}function We(e){var t,n="",r=a(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 ze(e,t){var n=Number.parseInt(t,32);if(n<0)return $e(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 $e(o+Number.parseInt(i,32)*Math.pow(32,n-11))}var a=e+Je(n-11);return Number.parseInt(a,32)}function $e(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;return Number(e.toPrecision(t))}function Je(e){return"0".repeat(e)}function Xe(e){return"-"+e}function Ye(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=b(e);return["string","number"].includes(n)?n:"invalid"}function Ze(e,t){return tt(e,t,!1,!0)}function et(e){var t,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.");n=e.byteOffset,t=e.byteLength}else t=e.byteLength;return new Uint8Array("buffer"in e&&e.buffer||e,n,t)}function tt(e,t,n,r){if(t||(t=[]),t.includes(e))return{type:"array",invalid:!0,message:"An array key cannot be circular"};var o=Ye(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:et(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=tt(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!==qe(t,e.value)})||r&&s.every(function(t){return 0!==qe(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 _=e;return Number.isNaN(_.getTime())?{type:o,invalid:!0,message:"Not a valid date"}:r?{type:o,value:_.getTime()}:{type:o,value:new Date(_)};default:var d=null===e?"null":b(e);return{type:d,invalid:!0,message:"Not a valid key; type "+d}}}function nt(e,t){return tt(e,null,!0,t)}function rt(e,t){var n=Ze(e,t);if(n.invalid)throw Se("DataError",n.message||"Not a valid key; type: "+n.type);return n}function ot(e,t,n,r){var o=it(e,t);return o.failure?o:n?nt(o.value,r):tt(o.value,null,!1,r)}function it(e,t,n,r){if(Array.isArray(t)){var o=[];return t.some(function(t){var n=it(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 at(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 ut(e,t){var n=t.split(".");n.pop();var r,o=a(n);try{for(o.s();!(r=o.n()).done;){var i=r.value;if(!Y(e))return!1;if(!Object.hasOwn(e,i))return!0;e=e[i]}}catch(e){o.e(e)}finally{o.f()}return Y(e)}function ct(e,t,n){var r=void 0===t.lower,o=void 0===t.upper,i=ft(e,!0),a=n?t.__lowerCached:ft(t.lower,!0),u=n?t.__upperCached:ft(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 st(e,t){return"array"===Ke[t.slice(0,1)]?t.indexOf(e)>1:t===e}function lt(e,t){var n=[];if(Array.isArray(e)){var r,o=a(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){lt(i,t).length>0&&n.push(i);continue}i=i[0]}(fe(t)||ct(i,t,!0))&&n.push(i)}}catch(e){o.e(e)}finally{o.f()}}else(fe(t)||ct(e,t,!0))&&n.push(e);return n}function ft(e,t){return void 0===e?null:Ge[Ye(e)].encode(e,t)}function _t(e,t){if("string"==typeof e)return Ge[Ke[e.slice(0,1)]].decode(e,t)}function dt(e,t){return _t(ft(e,t),t)}var pt=9007199254740992;function ht(e,t,n,r){e.executeSql('SELECT "currNum" FROM __sys__ WHERE "name" = ?',[V(t.__currentName)],function(e,t){1!==t.rows.length?n(1):n(t.rows.item(0).currNum)},function(e,t){return r(Se("DataError","Could not get the auto increment value for key",t)),!1})}function yt(e,t,n,r,o){var i='UPDATE __sys__ SET "currNum" = ? WHERE "name" = ?',a=[n,V(t.__currentName)];L.DEBUG&&console.log(i,a),e.executeSql(i,a,function(){r(n)},function(e,t){return o(Se("UnknownError","Could not set the auto increment value for key",t)),!1})}function vt(e,t,n,r,o){return yt(e,t,n=1+(n===pt?n+1:n),r,o)}function bt(e,t,n,r){ht(e,t,function(o){o>pt?n("failure"):vt(e,t,o,function(){n(null,o,o)},r)},r)}function gt(e,t,n,r,o){"number"!=typeof n||n<1?r():ht(e,t,function(i){var a=Math.floor(Math.min(n,pt));a>=i?vt(e,t,a,function(){r(i)},o):r()},o)}var mt=Object.freeze({__proto__:null,assignCurrentNumber:yt,checkKeyCouldBeInjectedIntoValue:ut,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:Ze,convertValueToKeyRethrowingAndIfInvalid:rt,convertValueToKeyValueDecoded:tt,convertValueToMultiEntryKey:function(e){return tt(e,null,!0,!0)},convertValueToMultiEntryKeyDecoded:nt,decode:_t,encode:ft,evaluateKeyPathOnValue:function(e,t,n){return it(e,t)},extractKeyFromValueUsingKeyPath:function(e,t,n){return ot(e,t,n,!0)},extractKeyValueDecodedFromValueUsingKeyPath:ot,findMultiEntryMatches:lt,generateKeyForStore:bt,injectKeyIntoValueUsingKeyPath:at,isKeyInRange:ct,isMultiEntryMatch:st,possiblyUpdateKeyGenerator:gt,roundTrip:dt});function Et(){throw this.__lowerOpen=!1,this.__upperOpen=!1,new TypeError("Illegal constructor")}var wt=Et;function Dt(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:ft(e.lower)),s&&(u=i?e.__upperCached:ft(e.upper)),c){if(r.push(V(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(V(u)))}}function Ot(e,t){if(X(e,Et))return"[object IDBKeyRange]"!==e.toString()?Et.__createInstance(e.lower,e.upper,e.lowerOpen,e.upperOpen):e;if(!fe(e))return rt(e),Et.only(e);if(t)throw Se("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 Se("DataError","Both arguments to the key range method cannot be undefined");var o,i;if(void 0!==e&&(o=dt(e),rt(e)),void 0!==t&&(i=dt(t),rt(t)),void 0!==e&&void 0!==t&&e!==t&&ft(e)>ft(t))throw Se("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=wt.prototype,new o},Et.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 rt(e),ct(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(function(e){Object.defineProperty(Et.prototype,"__"+e,{enumerable:!1,configurable:!1,writable:!0});var t=u("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(Et.prototype,e,n)}),Object.defineProperties(Et,c(c({},Symbol.hasInstance,{value:function(e){return Y(e)&&"upper"in e&&"lowerOpen"in e&&"boolean"==typeof e.lowerOpen}}),"prototype",{writable:!1}));var St=!1,It={test:!0};if(Object.defineProperty)try{Object.defineProperty(It,"test",{enumerable:!1}),It.test&&(St=!0)}catch(e){}var Tt=function(){throw this._items=[],this._length=0,new TypeError("Illegal constructor")};Tt.prototype=c(c({constructor:Tt,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=Tt.__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(Math.trunc(Number(t)))&&delete this[t];this.sortList()}},Symbol.toStringTag,"DOMStringListPrototype"),Symbol.iterator,_().m(function e(){var t;return _().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(Tt,Symbol.hasInstance,{value:function(e){return"DOMStringListPrototype"===Object.prototype.toString.call(e)}});var At=Tt;if(Object.defineProperty(Tt,"__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=At.prototype,new e}}),St){Object.defineProperty(Tt,"prototype",{writable:!1});["addIndexes","sortList","forEach","map","indexOf","push","splice","constructor","__createInstance"].forEach(function(e){Object.defineProperty(Tt.prototype,e,{enumerable:!1})}),Object.defineProperty(Tt.prototype,"length",{configurable:!0,enumerable:!0,get:function(){throw new TypeError("Illegal invocation")}});["_items","_length"].forEach(function(e){Object.defineProperty(Tt.prototype,e,{enumerable:!1,writable:!0})})}var Nt=0,xt=["onabort","oncomplete","onerror"],Bt=["objectStoreNames","mode","db","error"];function Ft(){throw new TypeError("Illegal constructor")}var jt=Ft;Ft.__createInstance=function(e,t,n){function r(){var r=this,o=this;o[Symbol.toStringTag]="IDBTransaction",re(o,Bt),o.__id=++Nt,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}),Bt.forEach(function(e){Object.defineProperty(r,e,{configurable:!0})}),ne(this,xt),o.__storeHandles={},setTimeout(function(){o.__executeRequests()},0)}return r.prototype=jt.prototype,new r},Ft.prototype=C.createInstance({defaultSync:!0,extraProperties:["complete"]}),Ft.prototype.__transFinishedCb=function(e,t){t(Boolean(e))},Ft.prototype.__callTransFinishedCb=function(e,t){var n=this;n.__transFinishedCb!==Ft.prototype.__transFinishedCb?n.__transFinishedCb(e,t):setTimeout(function(){n.__callTransFinishedCb(e,t)},0)},Ft.prototype.__executeRequests=function(){var e=this;e.__running?L.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=pe("success");if(n.req.dispatchEvent(o),o.__legacyOutputDidListenersThrowError)return me("Error","An error occurred in a success handler attached to request chain",o.__legacyOutputDidListenersThrowError),void e.__abortTransaction(Se("AbortError","A request was aborted (in user handler after success)."));de(u)}}function i(){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 i=function(e){var t;if(e){if(1===e.length)return e[0];var n,r=a(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(Ee(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=i,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=pe("error",i,{bubbles:!0,cancelable:!0});n.req.dispatchEvent(c),c.__legacyOutputDidListenersThrowError&&(me("Error","An error occurred in an error handler attached to request chain",c.__legacyOutputDidListenersThrowError),c.preventDefault(),e.__abortTransaction(Se("AbortError","A request was aborted (in user handler after error).")))}else e.__abortTransaction(i)}}function u(){if(!e.__errored&&!e.__requestsFinished)if(++r>=e.__requests.length)e.__requests=[],e.__active&&function(){function t(){e.__completed=!0,L.DEBUG&&console.log("Transaction completed");var t=pe("complete");try{e.__internal=!0,e.dispatchEvent(t),e.__internal=!1,e.dispatchEvent(pe("__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=pe("__beforecomplete");n.complete=t,e.dispatchEvent(n)}();else try{if(!(n=e.__requests[r]).req)return void n.op(t,n.args,function(){return de(u)},i);if(n.req.__done)return;n.op(t,n.args,o,i,u)}catch(e){i(e)}}u()},function(t){if(!0!==t){var n=we(t);e.__abortTransaction(n)}},function(){e.__transFinishedCb===Ft.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)}))},Ft.prototype.__createRequest=function(e){var t=xe.__createInstance();return t.__source=void 0!==e?e:this.db,t.__transaction=this,t},Ft.prototype.__addToTransactionQueue=function(e,t,n){var r=this.__createRequest(n);return this.__pushToQueue(r,e,t),r},Ft.prototype.__addNonRequestToTransactionQueue=function(e,t){this.__pushToQueue(null,e,t)},Ft.prototype.__pushToQueue=function(e,t,n){this.__assertActive(),this.__requests.push({op:t,args:n,req:e})},Ft.prototype.__assertActive=function(){if(!this.__active)throw Se("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished")},Ft.prototype.__assertWritable=function(){if("readonly"===this.mode)throw Se("ReadOnlyError","The transaction is read only")},Ft.prototype.__assertVersionChange=function(){Ft.__assertVersionChange(this)},Ft.prototype.objectStore=function(e){var t=this;if(!(t instanceof Ft))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No object store name was specified");if(Ft.__assertNotFinished(t),-1===t.__objectStoreNames.indexOf(e))throw Se("NotFoundError",e+" is not participating in this transaction");var n=t.db.__objectStores[e];if(!n)throw Se("NotFoundError",e+" does not exist in "+t.db.name);return(!Object.hasOwn(t.__storeHandles,e)||t.__storeHandles[e].__pendingDelete||t.__storeHandles[e].__deleted)&&(t.__storeHandles[e]=rr.__clone(n,t)),t.__storeHandles[e]},Ft.prototype.__abortTransaction=function(e){var t=this;function n(n,r){n?r&&"code"in r&&"number"==typeof r.code?L.DEBUG&&console.log("Rollback erred; feature is probably not supported as per WebSQL",t):L.DEBUG&&console.log("Rollback succeeded",t):L.DEBUG&&console.log("Rollback not possible due to missing transaction",t),t.dispatchEvent(pe("__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=Se("AbortError","A request was aborted (an unfinished request).");var e=pe("error",t.req.__error,{bubbles:!0,cancelable:!0});return new Le(function(n){setTimeout(function(){if(!t.req)throw new Error("Missing request");t.req.dispatchEvent(e),n()},0)})})},Le.resolve(void 0)).then(function(){var n=pe("abort",e,{bubbles:!0,cancelable:!1});setTimeout(function(){t.__abortFinished=!0,t.dispatchEvent(n),t.__storeHandles={},t.dispatchEvent(pe("__abort"))},0)}).catch(function(e){throw console.log("Abort error"),e})}me("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})}))},Ft.prototype.abort=function(){var e=this;if(!(e instanceof Ft))throw new TypeError("Illegal invocation");L.DEBUG&&console.log("The transaction was aborted",e),Ft.__assertNotFinished(e),e.__abortTransaction(null)},Ft.prototype[Symbol.toStringTag]="IDBTransactionPrototype",Ft.__assertVersionChange=function(e){if(!e||"versionchange"!==e.mode)throw Se("InvalidStateError","Not a version transaction")},Ft.__assertNotVersionChange=function(e){if(e&&"versionchange"===e.mode)throw Se("InvalidStateError","Cannot be called during a version transaction")},Ft.__assertNotFinished=function(e){if(!e||e.__completed||e.__abortFinished||e.__errored)throw Se("InvalidStateError","Transaction finished by commit or abort")},Ft.__assertNotFinishedObjectStoreMethod=function(e){try{Ft.__assertNotFinished(e)}catch(t){if(e&&!e.__completed&&!e.__abortFinished)throw Se("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished");throw t}},Ft.__assertActive=function(e){if(!e||!e.__active)throw Se("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished")},Ft.prototype.__getParent=function(){return this.db},ee(Ft.prototype,xt),te(Ft.prototype,Bt),Object.defineProperty(Ft.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:Ft}),Object.defineProperty(Ft,"prototype",{writable:!1});var Ct=i(function e(t){r(this,e),this.p=new Promise(t)});Ct.__typeson__type__="TypesonPromise","undefined"!=typeof Symbol&&Object.defineProperty(Ct.prototype,Symbol.toStringTag,{get:function(){return"TypesonPromise"}}),Ct.prototype.then=function(e,t){var n=this;return new Ct(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)})},Ct.prototype.catch=function(e){return this.then(function(){},e)},Ct.resolve=function(e){return new Ct(function(t){t(e)})},Ct.reject=function(e){return new Ct(function(t,n){n(e)})},Ct.all=function(e){return new Ct(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)})},Ct.race=function(e){return new Ct(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)})},Ct.allSettled=function(e){return new Ct(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 Pt=Object.hasOwn,kt=Object.getPrototypeOf;function Rt(e,t){return Kt(e)&&"function"==typeof e.then&&!0}function Lt(e){return Object.prototype.toString.call(e).slice(8,-1)}function qt(e,t){if(!e||"object"!=b(e))return!1;var n=kt(e);if(!n)return null===t;var r=Pt(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 Ut(e){return!(!e||"Object"!==Lt(e))&&(!kt(e)||qt(e,Object))}function Mt(e){if(!e||"Object"!==Lt(e))return!1;var t=kt(e);return!t||qt(e,Object)||Mt(t)}function Kt(e){return null!==e&&"object"==b(e)}function Vt(e){return e.replaceAll("''","''''").replace(/^$/,"''").replaceAll("~","~0").replaceAll(".","~1")}function Gt(e){return e.replaceAll("~1",".").replaceAll("~0","~").replace(/^''$/,"").replaceAll("''''","''")}function Ht(e,t){if(""===t)return e;if(null===e||"object"!=b(e))throw new TypeError("Unexpected non-object type");var n=t.indexOf(".");if(-1!==n){var r=e[Gt(t.slice(0,n))];return void 0===r?void 0:Ht(r,t.slice(n+1))}return e[Gt(t)]}function Qt(e,t,n){if(""===t)return n;for(var r=e,o=t;;){if(!r||"object"!=b(r))throw new TypeError("Unexpected non-object type");if("__proto__"===o)throw new TypeError("Invalid property");var i=o.indexOf(".");if(-1===i)return r[Gt(o)]=n,e;r=r[Gt(o.slice(0,i))],o=o.slice(i+1)}}function Wt(e){return null===e?"null":Array.isArray(e)?"array":b(e)}
5
+ /**
6
+ * @file Typeson - JSON with types.
7
+ * @license The MIT License (MIT)
8
+ * @copyright (c) 2016-2018 David Fahlander, Brett Zamir
9
+ */var zt=Object.keys,$t=Object.hasOwn,Jt=Array.isArray,Xt=["type","replaced","iterateIn","iterateUnsetNumeric","addLength"];function Yt(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 Zt=function(){return i(function e(t){r(this,e),this.options=t,this.plainObjectReplacers=[],this.nonplainObjectReplacers=[],this.revivers={},this.types={}},[{key:"stringify",value:function(e,t,n,r){r=f(f(f({},this.options),r),{},{stringification:!0});var o=this.encapsulate(e,null,r);return Jt(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,f(f({throwOnBadSyncType:!0},r),{},{sync:!0}))}},{key:"stringifyAsync",value:function(e,t,n,r){return this.stringify(e,t,n,f(f({throwOnBadSyncType:!0},r),{},{sync:!1}))}},{key:"parse",value:function(e,t,n){return n=f(f(f({},this.options),n),{},{parse:!0}),this.revive(JSON.parse(e,t),n)}},{key:"parseSync",value:function(e,t,n){return this.parse(e,t,f(f({throwOnBadSyncType:!0},n),{},{sync:!0}))}},{key:"parseAsync",value:function(e,t,n){return this.parse(e,t,f(f({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,r){var o=this,i=f(f({sync:!0},this.options),r),a=i.sync,u={},c=[],s=[],l=[],d=!("cyclic"in i)||i.cyclic,h=i.encapsulateObserver,v=function(e){var t=Object.values(u);if(i.iterateNone)return t.length?t[0]:Wt(e);if(t.length){if(i.returnTypeNames)return y(new Set(t));e&&Ut(e)&&!$t(e,"$types")?e.$types=u:e={$:e,$types:{$:u}}}else Kt(e)&&$t(e,"$types")&&(e={$:e,$types:!0});return!i.returnTypeNames&&e},g=function(){var e=n(_().m(function e(t,r){var o;return _().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Promise.all(r.map(function(e){return e[1].p}));case 1:return o=e.v,e.n=2,Promise.all(o.map(function(){var e=n(_().m(function e(n){var o,i,a,u,c,s,l,f,d,h,y,v,b,m;return _().w(function(e){for(;;)switch(e.n){case 0:if(o=[],i=r.splice(0,1),a=p(i,1),u=a[0],c=p(u,7),s=c[0],l=c[2],f=c[3],d=c[4],h=c[5],y=c[6],v=E(s,n,l,f,o,!0,y),b=qt(v,Ct),!s||!b){e.n=2;break}return e.n=1,v.p;case 1:return m=e.v,e.a(2,(d[h]=m,g(t,o)));case 2:return e.a(2,(s?d[h]=v:t=b?v.p:v,g(t,o)))}},e)}));return function(t){return e.apply(this,arguments)}}()));case 2:return e.a(2,t)}},e)}));return function(t,n){return e.apply(this,arguments)}}(),m=function(e,t,n){Object.assign(e,t);var r=Xt.map(function(t){var n=e[t];return delete e[t],n});n(),Xt.forEach(function(t,n){e[t]=r[n]})},E=function(e,t,n,r,a,l,f){var _,d={},p=h?function(o){var i,u=null!==(i=null!=f?f:r.type)&&void 0!==i?i:Wt(t);h(Object.assign(null!=o?o:d,{keypath:e,value:t,cyclic:n,stateObj:r,promisesData:a,resolvingTypesonPromise:l,awaitingTypesonPromise:qt(t,Ct)},{type:u}))}:null;if(["string","boolean","number","undefined"].includes(b(t)))return void 0===t||t===1/0||0===t||t===-1/0||Number.isNaN(t)?(_=r.replaced?t:w(e,t,r,a,!1,l,p))!==t&&(d={replaced:_}):_=t,p&&p(),_;if(null===t)return p&&p(),t;if(n&&t&&"object"==b(t)&&!r.iterateIn&&!r.iterateUnsetNumeric){var y=c.indexOf(t);if(-1!==y)return u[e]="#",p&&p({cyclicKeypath:s[y]}),"#"+s[y];!0===n&&(c.push(t),s.push(e))}var v,g=Ut(t),D=Jt(t),O=(g||D)&&(!o.plainObjectReplacers.length||r.replaced)||r.iterateIn?t:w(e,t,r,a,g||D,null,p);if(O!==t?(_=O,d={replaced:O}):""===e&&qt(t,Ct)?(a.push([e,t,n,r,void 0,void 0,r.type]),_=t):D&&"object"!==r.iterateIn||"array"===r.iterateIn?(v=new Array(t.length),d={clone:v}):!g&&(["function","symbol"].includes(b(t))||"toJSON"in t||qt(t,Ct)||qt(t,Promise)||qt(t,ArrayBuffer))&&"object"!==r.iterateIn?_=t:(v={},r.addLength&&(v.length=t.length),d={clone:v}),p&&p(),i.iterateNone)return null!=v?v:_;if(!v)return _;if(r.iterateIn){var S=function(o){var i={ownKeys:$t(t,o)};m(r,i,function(){var i=e+(e?".":"")+Vt(o),u=E(i,t[o],Boolean(n),r,a,l);qt(u,Ct)?a.push([i,u,Boolean(n),r,v,o,r.type]):void 0!==u&&(v[o]=u)})};for(var I in t)S(I);p&&p({endIterateIn:!0,end:!0})}else zt(t).forEach(function(o){var i=e+(e?".":"")+Vt(o);m(r,{ownKeys:!0},function(){var e=E(i,t[o],Boolean(n),r,a,l);qt(e,Ct)?a.push([i,e,Boolean(n),r,v,o,r.type]):void 0!==e&&(v[o]=e)})}),p&&p({endIterateOwn:!0,end:!0});if(r.iterateUnsetNumeric){for(var T=t.length,A=function(o){if(o in t)return 1;var i="".concat(e).concat(e?".":"").concat(String(o));m(r,{ownKeys:!1},function(){var e=E(i,void 0,Boolean(n),r,a,l);qt(e,Ct)?a.push([i,e,Boolean(n),r,v,o,r.type]):void 0!==e&&(v[o]=e)})},N=0;N<T;N++)A(N);p&&p({endIterateUnsetNumeric:!0,end:!0})}return v},w=function(e,t,n,r,i,c,s){for(var l=i?o.plainObjectReplacers:o.nonplainObjectReplacers,f=l.length;f--;){var _=l[f];if(_.test(t,n)){var p=_.type;if(Object.hasOwn(o.revivers,p)){var h=u[e];u[e]=h?[p].concat(h):p}if(Object.assign(n,{type:p,replaced:!0}),(a||!_.replaceAsync)&&!_.replace)return s&&s({typeDetected:!0}),E(e,t,d&&"readonly",n,r,c,p);var y=void 0;if(s&&s({replacing:!0}),a||!_.replaceAsync){if(void 0===_.replace)throw new TypeError("Missing replacer");y=_.replace(t,n)}else y=_.replaceAsync(t,n);return E(e,y,d&&"readonly",n,r,c,p)}}return t},D=E("",e,d,null!=t?t:{},l);if(l.length)return a&&i.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Promise.resolve(g(D,l)).then(v);if(!a&&i.throwOnBadSyncType)throw new TypeError("Async method requested but sync result obtained");return a&&i.stringification?[v(D)]:a?v(D):Promise.resolve(v(D))}},{key:"encapsulateSync",value:function(e,t,n){return this.encapsulate(e,t,f(f({throwOnBadSyncType:!0},n),{},{sync:!0}))}},{key:"encapsulateAsync",value:function(e,t,n){return this.encapsulate(e,t,f(f({throwOnBadSyncType:!0},n),{},{sync:!1}))}},{key:"revive",value:function(e,t){var n=this,r=f(f({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"!=b(e)||Array.isArray(e))return i(e);var a=e.$types;if(!0===a)return i(e.$);if(!a||"object"!=b(a)||Array.isArray(a))return i(e);var u=[],c=Object.create(null),s={},l=!0;a.$&&Ut(a.$)&&(e=e.$,a=a.$,l=!1);var _=function(e,t){var r,i=p(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,s);if(i.revive)return i.revive(t,s);throw new Error("Missing reviver")},d=[];function h(e){return qt(e,en)?void 0:e}var y,v=function(){if(!a)throw new Error("Found bad `types`");var t=[];if(Object.entries(a).forEach(function(e){var r=p(e,2),o=r[0],i=r[1];"#"!==i&&[].concat(i).forEach(function(e){var r;p(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(Yt),t.reduce(function t(n,r){var o=r.keypath,i=r.type;if(Rt(n))return n.then(function(e){return t(e,{keypath:o,type:i})});var a=Ht(e,o);if(qt(a=_(i,a),Ct))return a.then(function(t){var n=Qt(e,o,t);n===t&&(e=n)});var u=Qt(e,o,a);u===a&&(e=u)},void 0)}();return qt(v,Ct)?y=v.then(function(){return e}):(y=function e(t,n,r,i,s){if(!l||"$types"!==t){var f=d.length,h=a[t],y=Jt(n);if(y||Ut(n)){var v=y?new Array(n.length):{};for(zt(n).forEach(function(o){var i=e(t+(t?".":"")+Vt(o),n[o],null!=r?r:v,v,o),a=function(e){return qt(e,en)?v[o]=void 0:void 0!==e&&(v[o]=e),e};qt(i,Ct)?d.push(i.then(function(e){return a(e)})):a(i)}),n=v;u.length;){var b=p(u[0],4),g=b[0],m=b[1],E=b[2],w=b[3],D=$t(c,m),O=D?c[m]:Ht(g,m);if(!D&&void 0===O)break;E[w]=O,u.shift()}}if(!h)return c[t]=n,n;if("#"===h){var S=n.slice(1),I=$t(c,S),T=I?c[S]:Ht(r,S);return I||void 0!==T||u.push([r,S,i,s]),T}var A=function(e){var n=[].concat(h).reduce(function e(t,n){if(qt(t,Ct))return t.then(function(t){return e(t,n)});if("string"!=typeof n)throw new TypeError("Bad type JSON");return _(n,t)},e);return qt(n,Ct)?n.then(function(e){return c[t]=e,e}):(c[t]=n,n)};return!o&&d.length>f?Ct.all(d.slice(f)).then(function(){return A(n)}):A(n)}}("",e,null),d.length&&(y=Ct.resolve(y).then(function(e){return Ct.all([e].concat(d))}).then(function(e){return p(e,1)[0]}))),Rt(y)?o&&r.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():qt(y,Ct)?y.p.then(h):y:!o&&r.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():o?h(y):Promise.resolve(h(y))}},{key:"reviveSync",value:function(e,t){return this.revive(e,f(f({throwOnBadSyncType:!0},t),{},{sync:!0}))}},{key:"reviveAsync",value:function(e,t){return this.revive(e,f(f({throwOnBadSyncType:!0},t),{},{sync:!1}))}},{key:"register",value:function(e,t){var n=this,r=null!=t?t:{},o=function(e){Jt(e)?e.forEach(function(e){o(e)}):zt(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(tn.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,u=a.filter(function(e){return e.type===t});if(u.length&&(a.splice(a.indexOf(u[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 f({},e)},revive:function(e){return Object.assign(Object.create(c.prototype),e)}}}else if(Jt(i)){var s=p(i,3);i={test:s[0],replace:s[1],revive:s[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:1/0;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}}])}(),en=i(function e(){r(this,e)});en.__typeson__type__="TypesonUndefined";for(var tn=["null","boolean","number","string","array","object"],nn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rn=new Uint8Array(256),on=0;on<64;on++)rn[nn.codePointAt(on)]=on;var an=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+=nn[r[a]>>2],i+=nn[(3&r[a])<<4|r[a+1]>>4],i+=nn[(15&r[a+1])<<2|r[a+2]>>6],i+=nn[63&r[a+2]];return o%3==2?i=i.slice(0,-1)+"=":o%3==1&&(i=i.slice(0,-2)+"=="),i},un=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=rn[e.codePointAt(f)],o=rn[e.codePointAt(f+1)],i=rn[e.codePointAt(f+2)],a=rn[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},cn={arraybuffer:{test:function(e){return"ArrayBuffer"===Lt(e)},replace:function(e,t){t.buffers||(t.buffers=[]);var n=t.buffers.indexOf(e);return-1!==n?{index:n}:(t.buffers.push(e),{s:an(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=un(e.s,e.resizable?{maxByteLength:e.maxByteLength}:void 0);return t.buffers.push(n),n}}},sn={bigintObject:{test:function(e){return"object"==b(e)&&qt(e,BigInt)},replace:String,revive:function(e){return new Object(BigInt(e))}}},ln={bigint:{test:function(e){return"bigint"==typeof e},replace:String,revive:function(e){return BigInt(e)}}};function fn(e){return new Uint8Array(e).reduce(function(e,t){return e+String.fromCodePoint(t)},"")}function _n(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t.buffer}var dn={blob:{test:function(e){return"Blob"===Lt(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([_n(n)],{type:t})},replaceAsync:function(e){return new Ct(function(t,n){var r=new FileReader;r.addEventListener("load",function(){t({type:e.type,stringContents:fn(r.result)})}),r.addEventListener("error",function(){n(r.error)}),r.readAsArrayBuffer(e)})}}},pn={cryptokey:{test:function(e){return"CryptoKey"===Lt(e)&&e.extractable},replaceAsync:function(e){return new Ct(function(){var t=n(_().m(function t(n,r){var o,i;return _().w(function(t){for(;;)switch(t.p=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)}}},hn={dataview:{test:function(e){return"DataView"===Lt(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-1!==i?{index:i,byteOffset:r,byteLength:o}:(t.buffers.push(n),{encoded:an(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=un(i,c?{maxByteLength:u}:u),t.buffers.push(n)),new DataView(n,r,o)}}},yn={date:{test:function(e){return"Date"===Lt(e)},replace:function(e){var t=e.getTime();return Number.isNaN(t)?"NaN":t},revive:function(e){return"NaN"===e?new Date(NaN):new Date(e)}}},vn={domexception:{test:function(e){return"DOMException"===Lt(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)}}},bn={};function gn(e){bn[e.name.toLowerCase()]={test:function(t){return Lt(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&&gn(DOMMatrix),"undefined"!=typeof DOMMatrixReadOnly&&gn(DOMMatrixReadOnly);var mn={};function En(e){mn[e.name.toLowerCase()]={test:function(t){return Lt(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&&En(DOMPoint),"undefined"!=typeof DOMPointReadOnly&&En(DOMPointReadOnly);var wn={domquad:{test:function(e){return"DOMQuad"===Lt(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)}}},Dn={};function On(e){Dn[e.name.toLowerCase()]={test:function(t){return Lt(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&&On(DOMRect),"undefined"!=typeof DOMRectReadOnly&&On(DOMRectReadOnly);var Sn={error:{test:function(e){return"Error"===Lt(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}}},In={};function Tn(e){In[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 Tn(e)}),"undefined"!=typeof AggregateError&&Tn(AggregateError),"function"==typeof InternalError&&Tn(InternalError);var An={file:{test:function(e){return"File"===Lt(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([_n(r)],t,{type:n,lastModified:o})},replaceAsync:function(e){return new Ct(function(t,n){var r=new FileReader;r.addEventListener("load",function(){t({type:e.type,stringContents:fn(r.result),name:e.name,lastModified:e.lastModified})}),r.addEventListener("error",function(){n(r.error)}),r.readAsArrayBuffer(e)})}}},Nn={file:An.file,filelist:{test:function(e){return"FileList"===Lt(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 i(function e(){r(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)}}},xn={imagebitmap:{test:function(e){return"ImageBitmap"===Lt(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 Ct(function(){var e=n(_().m(function e(n,r){var o,i;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,o=n,e.n=1,createImageBitmap(t);case 1:o(e.v),e.n=3;break;case 2:e.p=2,i=e.v,r(i);case 3:return e.a(2)}},e,null,[[0,2]])}));return function(t,n){return e.apply(this,arguments)}}())}}},Bn={imagedata:{test:function(e){return"ImageData"===Lt(e)},replace:function(e){return{array:y(e.data),width:e.width,height:e.height}},revive:function(e){return new ImageData(new Uint8ClampedArray(e.array),e.width,e.height)}}},Fn={map:{test:function(e){return"Map"===Lt(e)},replace:function(e){return e.entries().toArray()},revive:function(e){return new Map(e)}}},jn={nan:{test:function(e){return Number.isNaN(e)},replace:function(){return"NaN"},revive:function(){return NaN}}},Cn={negativeZero:{test:function(e){return Object.is(e,-0)},replace:function(){return 0},revive:function(){return-0}}},Pn={StringObject:{test:function(e){return"String"===Lt(e)&&"object"==b(e)},replace:String,revive:function(e){return new String(e)}},BooleanObject:{test:function(e){return"Boolean"===Lt(e)&&"object"==b(e)},replace:function(e){return e.valueOf()},revive:function(e){return new Boolean(e)}},NumberObject:{test:function(e){return"Number"===Lt(e)&&"object"==b(e)},replace:Number,revive:function(e){return new Number(e)}}},kn={regexp:{test:function(e){return"RegExp"===Lt(e)},replace:function(e){return{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:function(e){var t=e.source,n=e.flags;return new RegExp(t,n)}}},Rn={set:{test:function(e){return"Set"===Lt(e)},replace:function(e){return e.values().toArray()},revive:function(e){return new Set(e)}}},Ln={};"function"==typeof Int8Array&&[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array].concat(y("function"==typeof BigInt64Array?[BigInt64Array,BigUint64Array]:[])).forEach(function(e){return function(e){var t=e.name;Ln[t.toLowerCase()]={test:function(e){return Lt(e)===t},replace:function(e){return(0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e:e.slice(0)).buffer},revive:function(t){return"ArrayBuffer"===Lt(t)?new e(t):t}}}(e)});var qn={};"function"==typeof Int8Array&&[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array].concat(y("function"==typeof BigInt64Array?[BigInt64Array,BigUint64Array]:[])).forEach(function(e){return function(e){var t=e.name;qn[t.toLowerCase()]={test:function(e){return Lt(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-1!==i?{index:i,byteOffset:r,length:o}:(t.buffers.push(n),{maxByteLength:n.maxByteLength,resizable:n.resizable,encoded:an(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=un(a,s?{maxByteLength:c}:void 0),n.buffers.push(r)),new e(r,o,i)}}}(e)});var Un={undef:{test:function(e,t){return void 0===e&&(t.ownKeys||!("ownKeys"in t))},replace:function(){return 0},revive:function(){return new en}}},Mn={userObject:{test:function(e){return Mt(e)},replace:function(e){return f({},e)},revive:function(e){return e}}},Kn=[{arrayNonindexKeys:{testPlainObjects:!0,test:function(e,t){return!!Array.isArray(e)&&(Object.keys(e).some(function(e){return String(Number(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=p(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(){}}}],Vn=[jn,{infinity:{test:function(e){return e===1/0},replace:function(){return"Infinity"},revive:function(){return 1/0}}},{negativeInfinity:{test:function(e){return e===-1/0},replace:function(){return"-Infinity"},revive:function(){return-1/0}}},Cn],Gn=[Mn,Un,Kn,Pn,Vn,yn,kn,Bn,xn,An,Nn,dn,Sn,In].concat("function"==typeof Map?Fn:[],"function"==typeof Set?Rn:[],"function"==typeof ArrayBuffer?cn:[],"function"==typeof Uint8Array?qn:[],"function"==typeof DataView?hn:[],"undefined"!=typeof crypto?pn:[],"undefined"!=typeof BigInt?[ln,sn]:[],"undefined"!=typeof DOMException?vn:[],"undefined"!=typeof DOMRect?Dn:[],"undefined"!=typeof DOMPoint?mn:[],"undefined"!=typeof DOMQuad?wn:[],"undefined"!=typeof DOMMatrix?bn:[]).concat({checkDataCloneException:{test:function(e){var t={}.toString.call(e).slice(8,-1);if(["symbol","function"].includes(b(e))||["Arguments","Module","Promise","WeakMap","WeakSet","Event","MessageChannel"].includes(t)||e&&"object"==b(e)&&"number"==typeof e.nodeType&&"function"==typeof e.insertBefore)throw new DOMException("The object cannot be cloned.","DataCloneError");return!1}}}),Hn=(new Zt).register(Gn);function Qn(e){Hn=(new Zt).register(e(Gn))}function Wn(e,t){var n;try{n=Hn.stringifySync(e)}catch(e){if(qt(e,ReferenceError)||qt(e,Ie))throw Se("DataCloneError","The object cannot be cloned.");throw e}return t&&t(n),n}function zn(e){return Hn.parse(e)}function $n(e){return zn(Wn(e))}var Jn=Object.freeze({__proto__:null,clone:$n,decode:zn,encode:Wn,register:Qn}),Xn=["objectStore","keyPath","multiEntry","unique"];function Yn(){throw new TypeError("Illegal constructor")}var Zn=Yn;function er(e,t,n,r,o,i,a,u,c,s,l,f,_){t&&(e=1),e&&u.push("LIMIT",String(e));var d="count"===i;L.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=d?function(){}:"key"===i?function(e){return _t(G(e.key))}:function(e){return zn(G(e.value))};if(n.multiEntry)for(var _=$(n.name),p=ft(o,n.multiEntry),h=function(){var e,n=u.rows.item(y),i=_t(n[_]);if(r&&(a&&o.some(function(e){return i.includes(e)})||st(JSON.stringify(p).slice(1,-1),n[_]))?(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;y<u.rows.length&&!h();y++);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(d?s:0===s?t?void 0:[]:t?c[0]:c)},_)}function tr(e,t,n,r,o){var i=e||!fe(n),a=["SELECT",H("count"===r?"key":r)+(t.multiEntry?", "+z(t.name):""),"FROM",W(t.objectStore.__currentName),"WHERE",z(t.name),"NOT NULL"],u=[];if(i)if(o)a.push("AND ("),n.forEach(function(e,n){n>0&&a.push("OR"),a.push(z(t.name),"LIKE ? ESCAPE '^' "),u.push("%"+J(ft(e,t.multiEntry))+"%")}),a.push(")");else if(t.multiEntry)a.push("AND",z(t.name),"LIKE ? ESCAPE '^'"),Array.isArray(n)?u.push("%"+J(JSON.stringify(ft(n,t.multiEntry)).slice(1,-1))+"%"):u.push("%"+J(ft(n,t.multiEntry))+"%");else{Dt(Ot(n,e),z(t.name),a,u,!0,!1)}return[e,t,i,n,r,o,a,u]}Yn.__createInstance=function(e,t){function n(){var n=this;n[Symbol.toStringTag]="IDBIndex",re(n,Xn),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.defineProperties(n,{__currentName:{get:function(){return"__pendingName"in n?n.__pendingName:n.name}},name:{enumerable:!1,configurable:!1,get:function(){return this.__name},set:function(t){var n=this;t=ce(t);var r=n.name;if(Ft.__assertVersionChange(n.objectStore.transaction),Ft.__assertActive(n.objectStore.transaction),Zn.__invalidStateIfDeleted(n),rr.__invalidStateIfDeleted(n),t!==r){if(Object.hasOwn(n.objectStore.__indexes,t)&&!n.objectStore.__indexes[t].__deleted&&!n.objectStore.__indexes[t].__pendingDelete)throw Se("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(y(o.indexNames).filter(function(e){return e!==t}).map(function(e){return[z(e),"BLOB"]}));n.__renameIndex(o,r,t,u,function(t,n){Zn.__updateIndexList(e,t,function(e){delete i.__pendingName,n(e)})})}}}})}return n.prototype=Zn.prototype,new n},Yn.__invalidStateIfDeleted=function(e,t){if(e.__deleted||e.__pendingDelete||e.__pendingCreate&&e.objectStore.transaction&&e.objectStore.transaction.__errored)throw Se("InvalidStateError",t||"This index has been deleted")},Yn.__clone=function(e,t){var n=Yn.__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},Yn.__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]=Yn.__clone(t,e)),e.transaction.__addNonRequestToTransactionQueue(function(a,u,c,s){var l=o&&(o.__deleted||o.__recreated),f={};function _(e,t){s(Se("UnknownError",'Could not create index "'+n+'"'+t.code+"::"+t.message,t))}function d(o){Yn.__updateIndexList(e,o,function(){o.executeSql('SELECT "key", "value" FROM '+W(r),[],function(o,a){L.DEBUG&&console.log("Adding existing "+r+" records to the "+n+" index"),function u(l){if(l<a.rows.length)try{var d=ot(zn(G(a.rows.item(l).value)),t.keyPath,t.multiEntry);if("invalid"in d&&d.invalid||"failure"in d&&d.failure)throw new Error("Go to catch; ignore bad indexKey");var p=ft(d.value,t.multiEntry);if(t.unique){if(Object.hasOwn(f,p))return f={},void s(Se("ConstraintError","Duplicate values already exist within the store"));f[p]=!0}o.executeSql("UPDATE "+W(r)+" SET "+z(n)+' = ? WHERE "key" = ?',[V(p),a.rows.item(l).key],function(){u(l+1)},_)}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)},_)},_)}var p=W(r),h=z(t.name);if(l)d(a);else{var y=["ALTER TABLE",p,"ADD",h,"BLOB"].join(" ");L.DEBUG&&console.log(y),a.executeSql(y,[],function(e){L.useSQLiteIndexes?e.executeSql('CREATE INDEX IF NOT EXISTS "'+p.slice(1,-1)+"^5"+h.slice(1,-1)+'" ON '+p+"("+h+")",[],d,_):d(e)},_)}})},Yn.__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(Se("UnknownError",'Could not delete index "'+t.name+'"',n))}function c(){Yn.__updateIndexList(e,r,function(e){delete t.__pendingDelete,delete t.__recreated,t.__deleted=!0,n&&(n.__deleted=!0,delete n.__pendingDelete),i(e)},u)}L.useSQLiteIndexes?r.executeSql("DROP INDEX IF EXISTS "+H(W(e.name).slice(1,-1)+"^5"+z(t.name).slice(1,-1)),[],c,u):c()})},Yn.__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)}}L.DEBUG&&console.log("Updating the index list for "+e.__currentName,o),t.executeSql('UPDATE __sys__ SET "indexList" = ? WHERE "name" = ?',[JSON.stringify(o),V(e.__currentName)],function(){n(e)},r)},Yn.prototype.__fetchIndexData=function(e,t,n,r){var o=this;if(void 0!==r&&(r=ue(r,"unsigned long")),Yn.__invalidStateIfDeleted(o),rr.__invalidStateIfDeleted(o.objectStore),o.objectStore.__deleted)throw Se("InvalidStateError","This index's object store has been deleted");if(Ft.__assertActive(o.objectStore.transaction),n&&fe(e))throw Se("DataError","No key or range was specified");var i=tr(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];er.apply(void 0,[r].concat(y(i),t))},void 0,o)},Yn.prototype.openCursor=function(){var e=this,t=Array.prototype.slice.call(arguments),n=t[0],r=t[1],o=Rr.__createInstance(n,r,e.objectStore,e,$(e.name),"value");return e.__objectStore.__cursors.push(o),o.__request},Yn.prototype.openKeyCursor=function(){var e=this,t=Array.prototype.slice.call(arguments),n=t[0],r=t[1],o=Cr.__createInstance(n,r,e.objectStore,e,$(e.name),"key");return e.__objectStore.__cursors.push(o),o.__request},Yn.prototype.get=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBIndex.get`.");return this.__fetchIndexData(e,"value",!0)},Yn.prototype.getKey=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBIndex.getKey`.");return this.__fetchIndexData(e,"key",!0)},Yn.prototype.getAll=function(){var e=Array.prototype.slice.call(arguments),t=e[0],n=e[1];return this.__fetchIndexData(t,"value",!1,n)},Yn.prototype.getAllKeys=function(){var e=Array.prototype.slice.call(arguments),t=e[0],n=e[1];return this.__fetchIndexData(t,"key",!1,n)},Yn.prototype.count=function(){var e=this,t=arguments[0];return X(t,Et)?Rr.__createInstance(t,"next",e.objectStore,e,$(e.name),"value",!0).__request:e.__fetchIndexData(t,"count",!1)},Yn.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=W(i),u=z(n),c=H("tmp_"+W(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(", ")+", ":"",_=s.length?s.join(", ")+", ":"";e.transaction.__addNonRequestToTransactionQueue(function(e,n,r,i){function l(e,t){i(t)}function d(){o?o(e,r):r()}var p="CREATE TABLE "+c+"("+f+u+" BLOB)";L.DEBUG&&console.log(p),e.executeSql(p,[],function(){var n="INSERT INTO "+c+"("+_+u+") SELECT "+_+z(t)+" FROM "+a;L.DEBUG&&console.log(n),e.executeSql(n,[],function(){var t="DROP TABLE "+a;L.DEBUG&&console.log(t),e.executeSql(t,[],function(){var t="ALTER TABLE "+c+" RENAME TO "+a;L.DEBUG&&console.log(t),e.executeSql(t,[],function(e){if(L.useSQLiteIndexes){var t=s.slice(2).map(function(t){return new Le(function(n,r){var o="CREATE INDEX "+H(a.slice(1,-1)+"^5"+t.slice(1,-1))+" ON "+a+"("+t+")";L.DEBUG&&console.log(o),e.executeSql(o,[],n,function(e,t){r(t)})})});t.push(new Le(function(t,n){var r=H("sk_"+a.slice(1,-1)),o="DROP INDEX IF EXISTS "+r;L.DEBUG&&console.log(o),e.executeSql(o,[],function(){var o="CREATE INDEX "+r+" ON "+a+'("key")';L.DEBUG&&console.log(o),e.executeSql(o,[],t,function(e,t){n(t)})},function(e,t){n(t)})})),Le.all(t).then(d).catch(i).catch(function(e){throw console.log("Index rename error"),e})}else d()},l)},l)},l)},l)})},Object.defineProperty(Yn,Symbol.hasInstance,{value:function(e){return Y(e)&&"openCursor"in e&&"function"==typeof e.openCursor&&"multiEntry"in e&&"boolean"==typeof e.multiEntry}}),te(Yn.prototype,Xn),ee(Yn.prototype,["name"]),Yn.prototype[Symbol.toStringTag]="IDBIndexPrototype",Object.defineProperty(Yn,"prototype",{writable:!1});var nr=["keyPath","indexNames","transaction","autoIncrement"];function rr(){throw new TypeError("Illegal constructor")}var or=rr;function ir(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}rr.__createInstance=function(e,t){function n(){var n=this;n[Symbol.toStringTag]="IDBObjectStore",re(this,nr),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=Tt.__createInstance();var r=e.indexList;for(var o in r)if(Object.hasOwn(r,o)){var i=Yn.__createInstance(n,r[o]);n.__indexes[i.name]=i,i.__deleted||n.indexNames.push(i.name)}n.__oldIndexNames=n.indexNames.clone(),Object.defineProperties(this,{__currentName:{get:function(){return"__pendingName"in this?this.__pendingName:this.name}},name:{enumerable:!1,configurable:!1,get:function(){return this.__name},set:function(e){var t=this;e=ce(e);var n=t.name;if(or.__invalidStateIfDeleted(t),Ft.__assertVersionChange(t.transaction),Ft.__assertActive(t.transaction),n!==e){if(Object.hasOwn(t.__idbdb.__objectStores,e)&&!t.__idbdb.__objectStores[e].__pendingDelete)throw Se("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=[V(e),V(n)];L.DEBUG&&console.log(i,a),t.transaction.__addNonRequestToTransactionQueue(function(r,o,u,c){r.executeSql(i,a,function(r){var o="ALTER TABLE "+W(n)+" RENAME TO "+W(e);L.DEBUG&&console.log(o),r.executeSql(o,[],function(){delete t.__pendingName,u()})},function(e,t){return c(t),!1})})}}}})}return n.prototype=or.prototype,new n},rr.__clone=function(e,t){var n=rr.__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},rr.__invalidStateIfDeleted=function(e,t){if(e.__deleted||e.__pendingDelete||e.__pendingCreate&&"transaction"in e&&e.transaction&&e.transaction.__errored)throw Se("InvalidStateError",t||"This store has been deleted")},rr.__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(!Object.hasOwn(o,n)||o[n].__pendingDelete||o[n].__deleted)&&(o[n]=rr.__clone(t,r)),r.__addNonRequestToTransactionQueue(function(e,r,o,i){function a(e,t){return L.DEBUG&&console.log(t),i(Se("UnknownError",'Could not create object store "'+n+'"',t)),!1}var u=W(n),c=["CREATE TABLE",u,"(key BLOB",t.autoIncrement?"UNIQUE, inc INTEGER PRIMARY KEY AUTOINCREMENT":"PRIMARY KEY",", value BLOB)"].join(" ");L.DEBUG&&console.log(c),e.executeSql(c,[],function(e){function r(){var r=JSON.stringify(t.keyPath);e.executeSql("INSERT INTO __sys__ VALUES (?,?,?,?,?)",[V(n),r,Number(t.autoIncrement),"{}",1],function(){delete t.__pendingCreate,delete t.__deleted,o(t)},a)}L.useSQLiteIndexes?e.executeSql("CREATE INDEX IF NOT EXISTS "+H("sk_"+u.slice(1,-1))+" ON "+u+'("key")',[],r,a):r()},a)}),o[n]},rr.__deleteObjectStore=function(e,t){t.__pendingDelete=!0,t.__indexNames=Tt.__createInstance(),e.objectStoreNames.splice(e.objectStoreNames.indexOf(t.__currentName),1);var n=e.__versionTransaction.__storeHandles[t.__currentName];n&&(n.__indexNames=Tt.__createInstance(),n.__pendingDelete=!0),e.__versionTransaction.__addNonRequestToTransactionQueue(function(e,r,o,i){function a(e,t){return L.DEBUG&&console.log(t),i(Se("UnknownError","Could not delete ObjectStore",t)),!1}e.executeSql('SELECT "name" FROM __sys__ WHERE "name" = ?',[V(t.__currentName)],function(e,r){r.rows.length>0&&e.executeSql("DROP TABLE "+W(t.__currentName),[],function(){e.executeSql('DELETE FROM __sys__ WHERE "name" = ?',[V(t.__currentName)],function(){delete t.__pendingDelete,t.__deleted=!0,n&&(delete n.__pendingDelete,n.__deleted=!0),o()},a)},a)})})},rr.prototype.__validateKeyAndValueAndCloneValue=function(e,t,n){var r=this;if(null!==r.keyPath){if(void 0!==t)throw Se("DataError","The object store uses in-line keys and the key parameter was provided");var o=$n(e);if((t=ot(o,r.keyPath)).invalid)throw Se("DataError","KeyPath was specified, but key was invalid.");if(t.failure){if(!n){if(!r.autoIncrement)throw Se("DataError","Could not evaluate a key from keyPath and there is no key generator");if(!ut(o,r.keyPath))throw Se("DataError","A key could not be injected into a value");return[void 0,o]}throw Se("DataError","Could not evaluate a key from keyPath")}return[t.value,o]}if(void 0===t){if(!r.autoIncrement)throw Se("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 rt(t);return[t,$n(e)]},rr.prototype.__deriveKey=function(e,t,n,r,o){var i=this;function a(e){Wn(n,function(t){t=zn(t),r(t,e)})}i.autoIncrement?void 0===n?bt(e,i,function(e,n,a){e?o(Se("ConstraintError","The key generator's current number has reached the maximum safe integer limit")):(null!==i.keyPath&&at(t,n,i.keyPath),r(n,a))},o):gt(e,i,n,a,o):a()},rr.prototype.__insertData=function(e,t,n,r,o,i,a){var u=this,c={},s=Object.keys(u.__indexes).map(function(t){return new Le(function(r,o){var i=u.__indexes[t];if(i.__pendingCreate||i.__deleted)r(void 0);else{var a;try{if("invalid"in(a=ot(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=tr(!0,i,a,"key",s);er.apply(void 0,[null].concat(y(l),[e,null,function(e){if(void 0===e)return f(i),void r(void 0);o(Se("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]=ft(a,e.multiEntry))}})});return Le.all(s).then(function(){var n=["INSERT INTO",W(u.__currentName),"("],o=[" VALUES ("],s=[];void 0!==r&&(n.push(H("key"),","),o.push("?,"),s.push(V(ft(r)))),Object.entries(c).forEach(function(e){var t=p(e,2),r=t[0],i=t[1];n.push(z(r)+","),o.push("?,"),s.push(V(i))}),n.push(H("value")+" )"),o.push("?)"),s.push(V(t));var l=n.join(" ")+o.join(" ");L.DEBUG&&console.log("SQL for adding",l,s),e.executeSql(l,s,function(){i(r)},function(e,t){return a(Se("ConstraintError",t.message,t)),!1})}).catch(function(t){function n(){a(t)}return"number"==typeof o?(yt(e,u,o,n,n),null):(n(),null)})},rr.prototype.add=function(e){var t=this,n=arguments[1];if(!(t instanceof rr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No value was specified");rr.__invalidStateIfDeleted(t),Ft.__assertActive(t.transaction),t.transaction.__assertWritable();var r=t.transaction.__createRequest(t),o=p(t.__validateKeyAndValueAndCloneValue(e,n,!1),2),i=o[0],a=o[1];return rr.__storingRecordObjectStore(r,t,!0,a,!0,i),r},rr.prototype.put=function(e){var t=this,n=arguments[1];if(!(t instanceof rr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No value was specified");rr.__invalidStateIfDeleted(t),Ft.__assertActive(t.transaction),t.transaction.__assertWritable();var r=t.transaction.__createRequest(t),o=p(t.__validateKeyAndValueAndCloneValue(e,n,!1),2),i=o[0],a=o[1];return rr.__storingRecordObjectStore(r,t,!0,a,!1,i),r},rr.prototype.__overwrite=function(e,t,n,r){var o="DELETE FROM "+W(this.__currentName)+' WHERE "key" = ?',i=ft(t);e.executeSql(o,[V(i)],function(e,r){L.DEBUG&&console.log("Did the row with the",t,"exist?",r.rowsAffected),n(e)},function(e,t){return r(t),!1})},rr.__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){Wn(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)})},rr.prototype.__get=function(e,t,n,r){var o=this;void 0!==r&&(r=ue(r,"unsigned long")),rr.__invalidStateIfDeleted(o),Ft.__assertActive(o.transaction);var i=Ot(e,!n),a=["SELECT",H(t?"key":"value"),"FROM",W(o.__currentName)],u=[];if(void 0!==i&&(a.push("WHERE"),Dt(i,H("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){L.DEBUG&&console.log("Fetching",o.__currentName,u),e.executeSql(c,u,function(e,r){var o;L.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(_t(G(r.rows.item(a).key),!1));else for(var u=0;u<r.rows.length;u++)o.push(zn(G(r.rows.item(u).value)));n||(o=o[0])}catch(e){L.DEBUG&&console.log(e)}i(o)},function(e,t){return a(t),!1})},void 0,o)},rr.prototype.get=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBObjectStore.get`.");return this.__get(e)},rr.prototype.getKey=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBObjectStore.getKey`.");return this.__get(e,!0)},rr.prototype.getAll=function(){var e=Array.prototype.slice.call(arguments),t=e[0],n=e[1];return this.__get(t,!1,!0,n)},rr.prototype.getAllKeys=function(){var e=Array.prototype.slice.call(arguments),t=e[0],n=e[1];return this.__get(t,!0,!0,n)},rr.prototype.delete=function(e){var t=this;if(!(this instanceof rr))throw new TypeError("Illegal invocation");if(!arguments.length)throw new TypeError("A parameter was missing for `IDBObjectStore.delete`.");rr.__invalidStateIfDeleted(t),Ft.__assertActive(t.transaction),t.transaction.__assertWritable();var n=Ot(e,!0),r=["DELETE FROM",W(t.__currentName),"WHERE"],o=[];Dt(n,H("key"),r,o);var i=r.join(" ");return t.transaction.__addToTransactionQueue(function(e,n,r,a){L.DEBUG&&console.log("Deleting",t.__currentName,o),e.executeSql(i,o,function(e,n){L.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)},rr.prototype.clear=function(){var e=this;if(!(this instanceof rr))throw new TypeError("Illegal invocation");return rr.__invalidStateIfDeleted(e),Ft.__assertActive(e.transaction),e.transaction.__assertWritable(),e.transaction.__addToTransactionQueue(function(t,n,r,o){t.executeSql("DELETE FROM "+W(e.__currentName),[],function(t,n){L.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)},rr.prototype.count=function(){var e=this,t=arguments[0];if(!(e instanceof rr))throw new TypeError("Illegal invocation");return rr.__invalidStateIfDeleted(e),Ft.__assertActive(e.transaction),Rr.__createInstance(t,"next",e,e,"key","value",!0).__request},rr.prototype.openCursor=function(){var e=this,t=Array.prototype.slice.call(arguments),n=t[0],r=t[1];if(!(e instanceof rr))throw new TypeError("Illegal invocation");rr.__invalidStateIfDeleted(e);var o=Rr.__createInstance(n,r,e,e,"key","value");return e.__cursors.push(o),o.__request},rr.prototype.openKeyCursor=function(){var e=this;if(!(e instanceof rr))throw new TypeError("Illegal invocation");rr.__invalidStateIfDeleted(e);var t=Array.prototype.slice.call(arguments),n=t[0],r=t[1],o=Cr.__createInstance(n,r,e,e,"key","key");return e.__cursors.push(o),o.__request},rr.prototype.index=function(e){var t=this;if(!(t instanceof rr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No index name was specified");rr.__invalidStateIfDeleted(t),Ft.__assertNotFinished(t.transaction);var n=t.__indexes[e];if(!n||n.__deleted)throw Se("NotFoundError",'Index "'+e+'" does not exist on '+t.__currentName);return(!Object.hasOwn(t.__indexHandles,e)||t.__indexes[e].__pendingDelete||t.__indexes[e].__deleted)&&(t.__indexHandles[e]=Yn.__clone(n,t)),t.__indexHandles[e]},rr.prototype.createIndex=function(e,t){var n=this,r=arguments[2];if(!(n instanceof rr))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(Ft.__assertVersionChange(n.transaction),rr.__invalidStateIfDeleted(n),Ft.__assertActive(n.transaction),Object.hasOwn(n.__indexes,e)&&!n.__indexes[e].__deleted&&!n.__indexes[e].__pendingDelete)throw Se("ConstraintError",'Index "'+e+'" already exists on '+n.__currentName);if(!ae(t=le(t)))throw Se("SyntaxError","A valid keyPath must be supplied");if(Array.isArray(t)&&r&&r.multiEntry)throw Se("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=Yn.__createInstance(n,o);return Yn.__createIndex(n,i),i},rr.prototype.deleteIndex=function(e){var t=this;if(!(t instanceof rr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No index name was specified");Ft.__assertVersionChange(t.transaction),rr.__invalidStateIfDeleted(t),Ft.__assertActive(t.transaction);var n=t.__indexes[e];if(!n)throw Se("NotFoundError",'Index "'+e+'" does not exist on '+t.__currentName);Yn.__deleteIndex(t,n)},te(rr.prototype,nr),ee(rr.prototype,["name"]),rr.prototype[Symbol.toStringTag]="IDBObjectStorePrototype",Object.defineProperty(rr,"prototype",{writable:!1});var ar=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,ur=function(e){return ar.exec(e).slice(1)};function cr(){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=ir(_r(e.split("/"),function(e){return!!e}),!t).join("/"),(t?"/":"")+e||"."}function sr(e){var t=lr(e),n="/"===dr(e,-1);return e=ir(_r(e.split("/"),function(e){return!!e}),!t).join("/"),e||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e}function lr(e){return"/"===e.charAt(0)}var fr={extname:function(e){return ur(e)[3]},basename:function(e,t){var n=ur(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},dirname:function(e){var t=ur(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=cr(e).substr(1),t=cr(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 sr(_r(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:lr,normalize:sr,resolve:cr};function _r(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)},pr=["onabort","onclose","onerror","onversionchange"],hr=["name","version","objectStoreNames"];function yr(){throw this.__versionTransaction=null,this.__objectStores=null,this.__transactions=[],new TypeError("Illegal constructor")}var vr,br=yr;yr.__createInstance=function(e,t,n,r,o){function i(){var i=this;this[Symbol.toStringTag]="IDBDatabase",re(this,hr),this.__db=e,this.__closePending=!1,this.__oldVersion=n,this.__version=r,this.__name=t,this.__upgradeTransaction=null,ne(this,pr),this.__setOptions({legacyOutputDidListenersThrowFlag:!0}),this.__transactions=[],this.__objectStores={},this.__objectStoreNames=Tt.__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=rr.__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=br.prototype,new i},yr.prototype=C.createInstance(),yr.prototype[Symbol.toStringTag]="IDBDatabasePrototype",yr.prototype.createObjectStore=function(e){var t=arguments[1];if(e=String(e),!(this instanceof yr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No object store name was specified");Ft.__assertVersionChange(this.__versionTransaction),this.throwIfUpgradeTransactionNull(),Ft.__assertActive(this.__versionTransaction);var n=(t=f({},t)).keyPath;if(null!==(n=void 0===n?null:le(n))&&!ae(n))throw Se("SyntaxError","The keyPath argument contains an invalid key path.");if(Object.hasOwn(this.__objectStores,e)&&!this.__objectStores[e].__pendingDelete)throw Se("ConstraintError",'Object store "'+e+'" already exists in '+this.name);var r=t.autoIncrement;if(r&&(""===n||Array.isArray(n)))throw Se("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=rr.__createInstance(o,this.__versionTransaction);return rr.__createObjectStore(this,i)},yr.prototype.deleteObjectStore=function(e){if(!(this instanceof yr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No object store name was specified");Ft.__assertVersionChange(this.__versionTransaction),this.throwIfUpgradeTransactionNull(),Ft.__assertActive(this.__versionTransaction);var t=this.__objectStores[e];if(!t)throw Se("NotFoundError",'Object store "'+e+'" does not exist in '+this.name);rr.__deleteObjectStore(this,t)},yr.prototype.close=function(){if(!(this instanceof yr))throw new TypeError("Illegal invocation");this.__closePending=!0,this.__unblocking&&this.__unblocking.check(),this.__transactions=[]},yr.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=Z(e)?y(new Set(le(e))).toSorted():[ce(e)],n||(n="readonly"),Ft.__assertNotVersionChange(this.__versionTransaction),this.__closePending)throw Se("InvalidStateError","An attempt was made to start a new transaction on a database connection that is not open");var r=Tt.__createInstance();if(e.forEach(function(e){if(!t.objectStoreNames.contains(e))throw Se("NotFoundError",'The "'+e+'" object store does not exist');r.push(e)}),0===e.length)throw Se("InvalidAccessError","No valid object store names were specified");if("readonly"!==n&&"readwrite"!==n)throw new TypeError("Invalid transaction mode: "+n);var o=Ft.__createInstance(this,r,n);return this.__transactions.push(o),o},yr.prototype.throwIfUpgradeTransactionNull=function(){if(null===this.__upgradeTransaction)throw Se("InvalidStateError","No upgrade transaction associated with database.")},yr.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=pe("close");setTimeout(function(){t.dispatchEvent(e)},0)}},r.__abortTransaction(Se("AbortError","The connection was force-closed: "+(e||"")))}),t.__transactions=[]},ee(yr.prototype,pr),te(yr.prototype,hr),Object.defineProperty(yr.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:yr}),Object.defineProperty(yr,"prototype",{writable:!1});var gr=function(){return"object"===("undefined"==typeof location?"undefined":b(location))&&location?location.origin:"null"},mr=function(){return!1!==L.checkOrigin&&"null"===gr()},Er={};function wr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gr(),n=Er[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(),wr(e,t)}}function Dr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:gr(),r=arguments.length>3?arguments[3]:void 0;Object.hasOwn(Er[n],t)||(Er[n][t]=[]),Er[n][t].push({req:e,cb:r}),1===Er[n][t].length&&wr(t,n)}function Or(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 he("versionchange",{oldVersion:n,newVersion:r});return new Le(function(n){setTimeout(function(){t.dispatchEvent(e),n(void 0)},0)})}})},Le.resolve(void 0)).then(function(){if(!i())return new Le(function(a){var u={check:function(){i()&&a(void 0)}},c=new he("blocked",{oldVersion:n,newVersion:r});setTimeout(function(){t.dispatchEvent(c),i()?a(void 0):e.forEach(function(e){o(e)||(e.__unblocking=u)})},0)})})}var Sr,Ir={},Tr=0;function Ar(e){return Object.keys(Ir[e]).map(Number).reduce(function(e,t){return Math.max(t,e)},0)}function Nr(e,t,n,r,o){if("string"==typeof L.memoryDatabase){var i=Object.hasOwn(Ir,t)?function(e){return Ir[e]&&Ir[e][Ar(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")}vr&&!1!==L.deleteDatabaseFiles?vr.unlink(fr.join(L.databaseBasePath||"",n),function(e){e&&"ENOENT"!==e.code?o({code:0,message:"Error removing database file: "+n+" "+e}):r()}):e(fr.join(L.databaseBasePath||"",n),"1",t,L.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 "+W(G(n.item(i).name)),[],function(){t(i+1)},function(){return t(i+1),!1})}(0)},function(){return r(),!1})})}function xr(e,t,n){function r(e,t){var r=we(t||e);L.DEBUG&&console.log("Error in sysdb transaction - when creating dbVersions",t),n(r)}Sr?t():(Sr=e("string"==typeof L.memoryDatabase?L.memoryDatabase:fr.join("string"==typeof L.sysDatabaseBasePath?L.sysDatabaseBasePath:L.databaseBasePath||"","__sysdb__"+(!1!==L.addSQLiteExtension?".sqlite":"")),"1","System Database",L.DEFAULT_DB_SIZE)).transaction(function(e){e.executeSql("CREATE TABLE IF NOT EXISTS dbVersions (name BLOB, version INT);",[],function(e){L.useSQLiteIndexes?e.executeSql("CREATE INDEX IF NOT EXISTS dbvname ON dbVersions(name)",[],t,r):t()},r)},r)}function Br(){throw new TypeError("Illegal constructor")}var Fr=Br;Br.__createInstance=function(){function e(){this[Symbol.toStringTag]="IDBFactory",this.__connections={}}return e.prototype=Fr.prototype,new e},Br.prototype.open=function(e){var t=this;if(!(t instanceof Br))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=ue(n,"unsigned long long")))throw new TypeError("Version cannot be 0");if(mr())throw Se("SecurityError","Cannot open an IndexedDB database from an opaque origin.");var r=Fe.__createInstance(),o=!1;L.autoName&&""===e&&(e="autoNamedDatabase_"+Tr++);var i,a=V(e=String(e)),u="string"==typeof L.memoryDatabase,c=!1!==L.cacheDatabaseInstances||u;try{i=Q(e)}catch(e){throw e}function s(e,t){if(o)return!1;var n=t?we(t):e;o=!0;var i=pe("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(void 0===n&&(n=o||1),(u||c)&&Object.hasOwn(Ir,e)&&Object.hasOwn(Ir[e],n)?l=Ir[e][n]:(l=t.__openDatabase(u?L.memoryDatabase:fr.join(L.databaseBasePath||"",i),"1",e,L.DEFAULT_DB_SIZE),c&&(Object.hasOwn(Ir,e)||(Ir[e]={}),Ir[e][n]=l)),o>n){var f=Se("VersionError","An attempt was made to open a database using a lower version than the existing version.",n);c?setTimeout(function(){s(f)},0):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 _(){r.__result=d,r.__done=!0}var d=yr.__createInstance(u,e,l,n,f);if(Object.hasOwn(t.__connections,e)||(t.__connections[e]=[]),t.__connections[e].push(d),l<n)Or(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){Sr.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()};Sr.transaction(function(u){function f(){var a=new he("upgradeneeded",{oldVersion:l,newVersion:n});r.__result=d,d.__upgradeTransaction=r.__transaction=r.__result.__versionTransaction=Ft.__createInstance(r.__result,r.__result.objectStoreNames,"versionchange"),r.__done=!0,r.transaction.__addNonRequestToTransactionQueue(function(e,t,n){if(r.dispatchEvent(a),a.__legacyOutputDidListenersThrowError)return me("Error","An error occurred in an upgradeneeded handler attached to request chain",a.__legacyOutputDidListenersThrowError),void r.transaction.__abortTransaction(Se("AbortError","A request was aborted."));n()}),r.transaction.on__beforecomplete=function(e){d.__upgradeTransaction=null,r.__result.__versionTransaction=null,o(u,!1,function(){return r.transaction.__callTransFinishedCb(!1,function(){e.complete(),r.__transaction=null}),!1})},r.transaction.on__preabort=function(){d.__upgradeTransaction=null,c&&Object.hasOwn(Ir,e)&&delete Ir[e][n]},r.transaction.on__abort=function(){r.__transaction=null,r.__result=void 0,r.__done=!1,d.close(),setTimeout(function(){var n=Se("AbortError","The upgrade transaction was aborted.");o(u,n,function(r){return 0===l?(Nr(t.__openDatabase,e,i,s.bind(null,n),r||s),!1):(s(n),!1)})},0)},r.transaction.on__complete=function(){var e=d.__transactions.indexOf(r.transaction);if(-1!==e&&d.__transactions.splice(e,1),r.__result.__closePending)return r.__transaction=null,void s(Se("AbortError","The connection has been closed."));_(),r.__transaction=null;var t=pe("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{_();var p=pe("success");r.dispatchEvent(p)}},s)}(u,l,o)}L.createIndexes?u.executeSql("CREATE INDEX IF NOT EXISTS sysname ON __sys__(name)",[],f,s):f()},s)},s)}return Dr(r,e,void 0,function(){var n;c&&(Object.hasOwn(Ir,e)||(Ir[e]={}),n=Ar(e)),n?l(n):xr(t.__openDatabase,function(){Sr.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},Br.prototype.deleteDatabase=function(e){var t=this;if(!(t instanceof Br))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("Database name is required");if(mr())throw Se("SecurityError","Cannot delete an IndexedDB database from an opaque origin.");var n,r=V(e=String(e));try{n=Q(e)}catch(e){throw e}var o="string"==typeof L.memoryDatabase,i=!1!==L.cacheDatabaseInstances||o,a=Fe.__createInstance(),u=!1,c=0,s=function(e,t){t(e)};function l(e,t){if(u||!0===t)return!1;var n=we(t||e);return s(!0,function(){a.__done=!0,a.__error=n,a.__result=void 0;var e=pe("error",n,{bubbles:!0,cancelable:!0});a.dispatchEvent(e),u=!0}),!1}return Dr(a,e,void 0,function(o){xr(t.__openDatabase,function(){function a(){o.__result=void 0,o.__done=!0;var e=new he("success",{oldVersion:c,newVersion:null});o.dispatchEvent(e)}function u(){s(!1,function(){i&&Object.hasOwn(Ir,e)&&delete Ir[e],delete t.__connections[e],a()})}Sr.readTransaction(function(i){i.executeSql('SELECT "version" FROM dbVersions WHERE "name" = ?',[r],function(i,f){if(0!==f.rows.length){var _=f.rows.item(0);c=_.version,Or(t.__connections[e]||[],o,c,null).then(function(){Sr.transaction(function(o){o.executeSql('DELETE FROM dbVersions WHERE "name" = ? ',[r],function(){Nr(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)})}).catch(l)}else a()},l)})},l)}),a},Br.prototype.cmp=function(e,t){if(!(this instanceof Br))throw new TypeError("Illegal invocation");if(arguments.length<2)throw new TypeError("You must provide two keys to be compared");return rt(e),rt(t),qe(e,t)},Br.prototype.databases=function(){var e=this,t=!1;return new Promise(function(n,r){if(!(e instanceof Br))throw new TypeError("Illegal invocation");if(mr())throw Se("SecurityError","Cannot get IndexedDB database names from an opaque origin.");function o(e,n){if(t)return!1;var o=n?we(n):e;return t=!0,r(o),!1}xr(e.__openDatabase,function(){Sr.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:G(a),version:u})}n(r)},o)},o)},o)})},Br.prototype.__forceClose=function(e,t,n){var r=this;function o(e){e.__forceClose(n)}if(fe(e))Object.values(r.__connections).forEach(function(e){e.forEach(function(e){o(e)})});else if(Object.hasOwn(r.__connections,e))if(fe(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")},Br.prototype.__setConnectionQueueOrigin=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gr();Er[e]={}},Br.prototype[Symbol.toStringTag]="IDBFactoryPrototype",Object.defineProperty(Br,"prototype",{writable:!1});var jr=Br.__createInstance();function Cr(){throw new TypeError("Illegal constructor")}var Pr=Cr;Cr.__super=function(e,t,n,r,o,i,a){this[Symbol.toStringTag]="IDBCursor",re(this,["key","primaryKey","request"]),rr.__invalidStateIfDeleted(n),this.__indexSource=X(r,Yn),this.__indexSource&&Yn.__invalidStateIfDeleted(r),Ft.__assertActive(n.transaction);var u=Ot(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=xe.__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?mt:Jn,this.__count=a,this.__prefetchedIndex=-1,this.__continuationKey=void 0,this.__continuationPrimaryKey=void 0,this.__multiEntryExhausted=!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&&ft(u.lower,this.__multiEntryIndex),u.__upperCached=void 0!==u.upper&&ft(u.upper,this.__multiEntryIndex)),this.__gotValue=!0,this.continue()},Cr.__createInstance=function(){var e=Pr.__super;e.prototype=Pr.prototype;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t,n){if(s())return Reflect.construct.apply(null,arguments);var r=[null];return r.push.apply(r,t),new(e.bind.apply(e,r))}(e,n)},Cr.prototype.__find=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0],o=t[1],i=t[2],a=t[3],u=t[4],c=t[5];this.__multiEntryIndex?this.__findMultiEntry(r,o,i,a,u,c):this.__findBasic(r,o,i,a,u,c)},Cr.prototype.__findBasic=function(e,t,n,r,o,i){var a=void 0!==i;i||(i=1);var u=this,c=H(u.__keyColumnName),s=H("key"),l=["SELECT * FROM",W(u.__store.__currentName)],f=[];l.push("WHERE",c,"NOT NULL"),Dt(u.__range,c,l,f,!0,!0);var _=u.__sqlDirection,d="ASC"===_?">":"<";void 0!==t&&(l.push("AND",s,d+"= ?"),f.push(ft(t))),void 0!==e?(l.push("AND",c,d+"= ?"),f.push(ft(e))):a&&void 0!==u.__key&&(l.push("AND",c,d+" ?"),f.push(ft(u.__key))),u.__count||(l.push("ORDER BY",c,_),"key"!==u.__keyColumnName&&(u.__unique?"prevunique"===u.direction&&l.push(",",s,"ASC"):l.push(",",s,_)),!u.__unique&&u.__indexSource&&l.push(",",H(u.__valueColumnName),_),l.push("LIMIT",String(i)));var p=l.join(" ");L.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,L.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):(L.DEBUG&&console.log("Reached end of cursors"),r(void 0,void 0,void 0))},function(e,t){return L.DEBUG&&console.log("Could not execute Cursor.continue",p,f),o(t),!1})};var kr=/\[/g;function Rr(){throw new TypeError("Illegal constructor")}Cr.prototype.__findMultiEntry=function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,u=this;if(u.__multiEntryExhausted)return L.DEBUG&&console.log("[multiEntry] Reached end of multiEntry cursor (already exhausted)"),void r(void 0,void 0,void 0);var s=H(u.__keyColumnName),l=H("key"),f=u.__sqlDirection,_="ASC"===f?">":"<";!function d(){var p=["SELECT * FROM",W(u.__store.__currentName)],h=[];if(p.push("WHERE",s,"NOT NULL"),u.__range&&void 0!==u.__range.lower&&Array.isArray(u.__range.upper)&&0===u.__range.upper.indexOf(u.__range.lower)&&(p.push("AND",s,"LIKE ? ESCAPE '^'"),h.push("%"+J(u.__range.__lowerCached.slice(0,-1))+"%")),void 0!==t&&(p.push("AND",l,_+"= ?"),h.push(ft(t))),void 0!==e)p.push("AND",s,_+"= ?"),h.push(ft(e));else if(void 0!==u.__continuationKey){p.push("AND (",s,_,"?","OR (",s,"= ?","AND",l,_,"?))");var y=ft(u.__continuationKey,!0);h.push(y,y,ft(u.__continuationPrimaryKey))}u.__count||(p.push("ORDER BY",s,f),u.__unique||"key"===u.__keyColumnName||p.push(",",H("key"),f),!u.__unique&&u.__indexSource&&p.push(",",H(u.__valueColumnName),f),p.push("LIMIT",String(i)));var v=p.join(" ");L.DEBUG&&console.log("[multiEntry] query",v,h),n.executeSql(v,h,function(e,t){if(0===t.rows.length)return u.__multiEntryExhausted=!0,L.DEBUG&&console.log("[multiEntry] Reached end of multiEntry cursor (no more rows)"),void r(void 0,void 0,void 0);if(u.__count){for(var n=0,o=0;o<t.rows.length;o++){n+=lt(_t(t.rows.item(o)[u.__keyColumnName],!0),u.__range).length}r(void 0,n,void 0)}else{var s=t.rows.item(t.rows.length-1);u.__continuationKey=_t(s[u.__keyColumnName],!0),u.__continuationPrimaryKey=_t(s.key),t.rows.length<i&&(u.__multiEntryExhausted=!0);for(var l=[],f=0;f<t.rows.length;f++){var _,p=t.rows.item(f),h=a(lt(_t(p[u.__keyColumnName],!0),u.__range));try{for(h.s();!(_=h.n()).done;){var y=c(c({matchingKey:ft(_.value,!0),key:p.key},u.__keyColumnName,p[u.__keyColumnName]),u.__valueColumnName,p[u.__valueColumnName]);l.push(y)}}catch(e){h.e(e)}finally{h.f()}}if(0===l.length)return u.__multiEntryExhausted?(L.DEBUG&&console.log("[multiEntry] Reached end of multiEntry cursor (last batch had no matches)"),void r(void 0,void 0,void 0)):(L.DEBUG&&console.log("[multiEntry] batch had no matches; fetching next batch"),void d());var v=0===u.direction.indexOf("prev");l.sort(function(e,t){return e.matchingKey.replaceAll(kr,"z")<t.matchingKey.replaceAll(kr,"z")?v?1:-1:e.matchingKey.replaceAll(kr,"z")>t.matchingKey.replaceAll(kr,"z")?v?-1:1:e.key<t.key?"prev"===u.direction?1:-1:e.key>t.key?"prev"===u.direction?-1:1:0}),u.__prefetchedIndex=0,u.__prefetchedData={data:l,length:l.length,item:function(e){return this.data[e]}},L.DEBUG&&console.log("[multiEntry] Preloaded "+u.__prefetchedData.length+" records for multiEntry cursor"),u.__decode(l[0],r)}},function(e,t){return L.DEBUG&&console.log("[multiEntry] Could not execute Cursor.continue",v,h),o(t),!1})}()},Cr.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))}},Cr.prototype.__decode=function(e,t){var n=this;if(n.__multiEntryIndex&&n.__unique){if(n.__matchedKeys||(n.__matchedKeys={}),!0===n.__matchedKeys[e.matchingKey])return void t(void 0,void 0,void 0);n.__matchedKeys[e.matchingKey]=!0}var r=G(n.__multiEntryIndex?e.matchingKey:e[n.__keyColumnName]),o=G(e[n.__valueColumnName]),i=G(e.key);t(_t(r,n.__multiEntryIndex),n.__valueDecoder.decode(o),_t(i),r)},Cr.prototype.__sourceOrEffectiveObjStoreDeleted=function(){rr.__invalidStateIfDeleted(this.__store,"The cursor's effective object store has been deleted"),this.__indexSource&&Yn.__invalidStateIfDeleted(this.source,"The cursor's index source has been deleted")},Cr.prototype.__invalidateCache=function(){this.__prefetchedData=null,this.__multiEntryExhausted=!1},Cr.prototype.__continue=function(e,t){var n=this,r=void 0!==n.__advanceCount;if(Ft.__assertActive(n.__store.transaction),n.__sourceOrEffectiveObjStoreDeleted(),!n.__gotValue&&!t)throw Se("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(void 0!==e){rt(e);var o=qe(e,n.key);if(0===o||n.direction.includes("next")&&-1===o||n.direction.includes("prev")&&1===o)throw Se("DataError","Cannot "+(r?"advance":"continue")+" the cursor in an unexpected direction")}this.__continueFinish(e,void 0,r)},Cr.prototype.__continueFinish=function(e,t,n){var r=this,o=r.__advanceCount||L.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 de(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,_){var d;!r.__unique||r.__multiEntryIndex||_!==ft(r.key,r.__multiEntryIndex)?(d=Number(void 0===e)||qe(n,e))>0||0===d&&(r.__unique||void 0===t||qe(l,t)>=0)?f(n,o,l):de(function(){return i(a,u,c,s)}):de(function(){return 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)})},Cr.prototype.continue=function(){this.__continue(arguments[0])},Cr.prototype.continuePrimaryKey=function(e,t){var n=this;if(Ft.__assertActive(n.__store.transaction),n.__sourceOrEffectiveObjStoreDeleted(),!n.__indexSource)throw Se("InvalidAccessError","`continuePrimaryKey` may only be called on an index source.");if(!["next","prev"].includes(n.direction))throw Se("InvalidAccessError","`continuePrimaryKey` may not be called with unique cursors.");if(!n.__gotValue)throw Se("InvalidStateError","The cursor is being iterated or has iterated past its end.");rt(e),rt(t);var r=qe(e,n.key);if("next"===n.direction&&-1===r||"prev"===n.direction&&1===r)throw Se("DataError","Cannot continue the cursor in an unexpected direction");function o(){n.__continueFinish(e,t,!1)}0===r?Wn(t,function(e){Wn(n.primaryKey,function(t){if(e===t||"next"===n.direction&&e<t||"prev"===n.direction&&e>t)throw Se("DataError","Cannot continue the cursor in an unexpected direction");o()})}):o()},Cr.prototype.advance=function(e){var t=this;if(0===(e=ue(e,"unsigned long")))throw new TypeError("Calling advance() with count argument 0");t.__gotValue&&(t.__advanceCount=e),t.__continue()},Cr.prototype.update=function(e){var t=this;if(!arguments.length)throw new TypeError("A value must be passed to update()");if(Ft.__assertActive(t.__store.transaction),t.__store.transaction.__assertWritable(),t.__sourceOrEffectiveObjStoreDeleted(),!t.__gotValue)throw Se("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(t.__keyOnly)throw Se("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){rr.__storingRecordObjectStore(n,t.__store,!1,e,!1,r)}if(null!==t.__store.keyPath){var i=p(t.__store.__validateKeyAndValueAndCloneValue(e,void 0,!0),2),a=i[0],u=i[1];if(0!==qe(t.primaryKey,a))throw Se("DataError","The key of the supplied value to `update` is not equal to the cursor's effective key");o(u)}else{o($n(e))}return n},Cr.prototype.delete=function(){var e=this;if(Ft.__assertActive(e.__store.transaction),e.__store.transaction.__assertWritable(),e.__sourceOrEffectiveObjStoreDeleted(),!e.__gotValue)throw Se("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(e.__keyOnly)throw Se("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 "+W(e.__store.__currentName)+' WHERE "key" = ?';L.DEBUG&&console.log(u,n,a),t.executeSql(u,[V(ft(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)},Cr.prototype[Symbol.toStringTag]="IDBCursorPrototype",te(Cr.prototype,["source","direction","key","primaryKey","request"]),Object.defineProperty(Cr,"prototype",{writable:!1}),Rr.prototype=Object.create(Cr.prototype),Object.defineProperty(Rr.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:Rr});var Lr=Rr;function qr(e,t){if(e&&"object"===b(e))Object.entries(e).forEach(function(e){var t=p(e,2);qr(t[0],t[1])});else{if(!Object.hasOwn(L,e))throw new Error(e+" is not a valid configuration property");L[e]=t,"registerSCA"===e&&"function"==typeof t&&Qn(t)}}Rr.__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];Cr.__super.call(this,e,n,r,o,i,a,u),this[Symbol.toStringTag]="IDBCursorWithValue",re(this,"value")}return r.prototype=Lr.prototype,new r},te(Rr.prototype,["value"]),Rr.prototype[Symbol.toStringTag]="IDBCursorWithValuePrototype",Object.defineProperty(Rr,"prototype",{writable:!1}),L.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=u("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!==L.win.openDatabase&&t("shimIndexedDB",jr,{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",Ie),t(e+"DOMStringList",Tt,{enumerable:!1,configurable:!0,writable:!0,value:Tt}),t(e+"Event",A,{configurable:!0,writable:!0,value:A,enumerable:!1}),t(e+"CustomEvent",N,{configurable:!0,writable:!0,value:N,enumerable:!1}),t(e+"EventTarget",F,{configurable:!0,writable:!0,value:F,enumerable:!1})}var r,o=Br;if(void 0!==L.win.openDatabase){if(jr.__openDatabase=L.win.openDatabase.bind(L.win),t("indexedDB",jr,{enumerable:!0,configurable:!0,get:function(){if(this!==e&&!fe(this)&&!this.shimNS)throw new TypeError("Illegal invocation");return jr}}),[["IDBFactory",o],["IDBDatabase",yr],["IDBObjectStore",rr],["IDBIndex",Yn],["IDBTransaction",Ft],["IDBCursor",Cr],["IDBCursorWithValue",Rr],["IDBKeyRange",Et],["IDBRequest",xe],["IDBOpenDBRequest",Fe],["IDBVersionChangeEvent",he]].forEach(function(e){var n=p(e,2);t(n[0],n[1],{enumerable:!1,configurable:!0})}),L.fs&&(r=L.fs,vr=r),L.fullIDLSupport&&(Object.setPrototypeOf(e.IDBOpenDBRequest,e.IDBRequest),Object.setPrototypeOf(e.IDBCursorWithValue,e.IDBCursor),Object.setPrototypeOf(yr,F),Object.setPrototypeOf(xe,F),Object.setPrototypeOf(Ft,F),Object.setPrototypeOf(he,A),Object.setPrototypeOf(Ie,Error),Object.setPrototypeOf(Ie.prototype,Error.prototype),Object.setPrototypeOf(N,A),Object.setPrototypeOf(N.prototype,A.prototype)),e.indexedDB&&!e.indexedDB.toString().includes("[native code]")&&(L.addNonIDBGlobals&&n("Shim"),L.replaceNonIDBGlobals&&n()),!e.shimIndexedDB)return;e.shimIndexedDB.__setConnectionQueueOrigin()}},e.shimIndexedDB.__debug=function(e){L.DEBUG=e},e.shimIndexedDB.__setConfig=qr,e.shimIndexedDB.__getConfig=function(e){if(!Object.hasOwn(L,e))throw new Error(e+" is not a valid configuration property");return L[e]},e.shimIndexedDB.__setUnicodeIdentifiers=function(e){qr({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="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));L.DEFAULT_DB_SIZE||(L.DEFAULT_DB_SIZE=1024*("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")?25:4)*1024),L.avoidAutoShim||e.indexedDB&&!n||void 0===L.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()}()});
3
10
  //# sourceMappingURL=indexeddbshim.min.js.map