@superbright/indexeddb-orm 0.1.9 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_commonjsHelpers.cjs +2 -0
- package/dist/_virtual/_commonjsHelpers.cjs.map +1 -0
- package/dist/_virtual/_commonjsHelpers.mjs +9 -0
- package/dist/_virtual/_commonjsHelpers.mjs.map +1 -0
- package/dist/_virtual/dexie.min.cjs +2 -0
- package/dist/_virtual/dexie.min.cjs.map +1 -0
- package/dist/_virtual/dexie.min.mjs +5 -0
- package/dist/_virtual/dexie.min.mjs.map +1 -0
- package/dist/adapters/dexie.cjs +2 -0
- package/dist/adapters/dexie.cjs.map +1 -0
- package/dist/adapters/dexie.mjs +14 -0
- package/dist/adapters/dexie.mjs.map +1 -0
- package/dist/adapters/structured-store.cjs +2 -0
- package/dist/adapters/structured-store.cjs.map +1 -0
- package/dist/adapters/structured-store.mjs +50 -0
- package/dist/adapters/structured-store.mjs.map +1 -0
- package/dist/adapters/zustand-store.cjs +2 -0
- package/dist/adapters/zustand-store.cjs.map +1 -0
- package/dist/adapters/zustand-store.mjs +169 -0
- package/dist/adapters/zustand-store.mjs.map +1 -0
- package/dist/api/favorites.cjs +2 -0
- package/dist/api/favorites.cjs.map +1 -0
- package/dist/api/favorites.mjs +34 -0
- package/dist/api/favorites.mjs.map +1 -0
- package/dist/api/properties.cjs +2 -0
- package/dist/api/properties.cjs.map +1 -0
- package/dist/api/properties.mjs +197 -0
- package/dist/api/properties.mjs.map +1 -0
- package/dist/api/users.cjs +2 -0
- package/dist/api/users.cjs.map +1 -0
- package/dist/api/users.mjs +54 -0
- package/dist/api/users.mjs.map +1 -0
- package/dist/db.cjs +2 -0
- package/dist/db.cjs.map +1 -0
- package/dist/db.mjs +116 -0
- package/dist/db.mjs.map +1 -0
- package/dist/debug.cjs +2 -0
- package/dist/debug.cjs.map +1 -0
- package/dist/debug.mjs +18 -0
- package/dist/debug.mjs.map +1 -0
- package/dist/errors.cjs +2 -0
- package/dist/errors.cjs.map +1 -0
- package/dist/errors.mjs +15 -0
- package/dist/errors.mjs.map +1 -0
- package/dist/features/analytics/analytics.d.ts +520 -397
- package/dist/features/units/transformers.cjs +2 -0
- package/dist/features/units/transformers.cjs.map +1 -0
- package/dist/features/units/transformers.mjs +69 -0
- package/dist/features/units/transformers.mjs.map +1 -0
- package/dist/index.cjs +1 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +72 -14861
- package/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/dexie@4.2.0/node_modules/dexie/dist/dexie.min.cjs +4 -0
- package/dist/node_modules/.pnpm/dexie@4.2.0/node_modules/dexie/dist/dexie.min.cjs.map +1 -0
- package/dist/node_modules/.pnpm/dexie@4.2.0/node_modules/dexie/dist/dexie.min.mjs +3048 -0
- package/dist/node_modules/.pnpm/dexie@4.2.0/node_modules/dexie/dist/dexie.min.mjs.map +1 -0
- package/dist/node_modules/.pnpm/dexie@4.2.0/node_modules/dexie/import-wrapper-prod.cjs +2 -0
- package/dist/node_modules/.pnpm/dexie@4.2.0/node_modules/dexie/import-wrapper-prod.cjs.map +1 -0
- package/dist/node_modules/.pnpm/dexie@4.2.0/node_modules/dexie/import-wrapper-prod.mjs +33 -0
- package/dist/node_modules/.pnpm/dexie@4.2.0/node_modules/dexie/import-wrapper-prod.mjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.cjs +2 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.cjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.mjs +88 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.mjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.cjs +2 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.cjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.mjs +10 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.mjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.cjs +2 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.cjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.mjs +8 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.mjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.cjs +2 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.cjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.mjs +98 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.mjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.cjs +2 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.cjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.mjs +95 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.mjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.cjs +2 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.cjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.mjs +62 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.mjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.cjs +2 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.cjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.mjs +2401 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.mjs.map +1 -0
- package/dist/schema.cjs +2 -0
- package/dist/schema.cjs.map +1 -0
- package/dist/schema.d.ts +165 -0
- package/dist/schema.mjs +209 -0
- package/dist/schema.mjs.map +1 -0
- package/dist/storage.cjs +2 -0
- package/dist/storage.cjs.map +1 -0
- package/dist/storage.mjs +54 -0
- package/dist/storage.mjs.map +1 -0
- package/dist/stores/store.cjs +2 -0
- package/dist/stores/store.cjs.map +1 -0
- package/dist/stores/store.mjs +607 -0
- package/dist/stores/store.mjs.map +1 -0
- package/dist/units/favorites.cjs +2 -0
- package/dist/units/favorites.cjs.map +1 -0
- package/dist/units/favorites.mjs +19 -0
- package/dist/units/favorites.mjs.map +1 -0
- package/dist/utils/casing.d.ts +6 -0
- package/dist/utils/collections.d.ts +1 -0
- package/dist/utils/dimensions.cjs +2 -0
- package/dist/utils/dimensions.cjs.map +1 -0
- package/dist/utils/dimensions.d.ts +26 -0
- package/dist/utils/dimensions.mjs +26 -0
- package/dist/utils/dimensions.mjs.map +1 -0
- package/dist/validation.cjs +2 -0
- package/dist/validation.cjs.map +1 -0
- package/dist/validation.mjs +18 -0
- package/dist/validation.mjs.map +1 -0
- package/package.json +23 -4
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";const Pt=require("../../../../../../_virtual/_commonjsHelpers.cjs"),pr=require("../../../../../../_virtual/dexie.min.cjs");(function(yr,ti){(function(Mn,C){yr.exports=C()})(Pt.commonjsGlobal,function(){var Mn=function(e,n){return(Mn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])})(e,n)},C=function(){return(C=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e}).apply(this,arguments)};function cn(e,n,t){for(var r,i=0,o=n.length;i<o;i++)!r&&i in n||((r=r||Array.prototype.slice.call(n,0,i))[i]=n[i]);return e.concat(r||Array.prototype.slice.call(n))}var G=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Pt.commonjsGlobal,W=Object.keys,L=Array.isArray;function ee(e,n){return typeof n!="object"||W(n).forEach(function(t){e[t]=n[t]}),e}typeof Promise>"u"||G.Promise||(G.Promise=Promise);var Te=Object.getPrototypeOf,vr={}.hasOwnProperty;function Z(e,n){return vr.call(e,n)}function qe(e,n){typeof n=="function"&&(n=n(Te(e))),(typeof Reflect>"u"?W:Reflect.ownKeys)(n).forEach(function(t){fe(e,t,n[t])})}var Et=Object.defineProperty;function fe(e,n,t,r){Et(e,n,ee(t&&Z(t,"get")&&typeof t.get=="function"?{get:t.get,set:t.set,configurable:!0}:{value:t,configurable:!0,writable:!0},r))}function Ie(e){return{from:function(n){return e.prototype=Object.create(n.prototype),fe(e.prototype,"constructor",e),{extend:qe.bind(null,e.prototype)}}}}var mr=Object.getOwnPropertyDescriptor,gr=[].slice;function ln(e,n,t){return gr.call(e,n,t)}function Kt(e,n){return n(e)}function Ye(e){if(!e)throw new Error("Assertion Failed")}function St(e){G.setImmediate?setImmediate(e):setTimeout(e,0)}function ue(e,n){if(typeof n=="string"&&Z(e,n))return e[n];if(!n)return e;if(typeof n!="string"){for(var t=[],r=0,i=n.length;r<i;++r){var o=ue(e,n[r]);t.push(o)}return t}var a=n.indexOf(".");if(a!==-1){var u=e[n.substr(0,a)];return u==null?void 0:ue(u,n.substr(a+1))}}function ne(e,n,t){if(e&&n!==void 0&&!("isFrozen"in Object&&Object.isFrozen(e)))if(typeof n!="string"&&"length"in n){Ye(typeof t!="string"&&"length"in t);for(var r=0,i=n.length;r<i;++r)ne(e,n[r],t[r])}else{var o,a,u=n.indexOf(".");u!==-1?(o=n.substr(0,u),(a=n.substr(u+1))===""?t===void 0?L(e)&&!isNaN(parseInt(o))?e.splice(o,1):delete e[o]:e[o]=t:ne(u=!(u=e[o])||!Z(e,o)?e[o]={}:u,a,t)):t===void 0?L(e)&&!isNaN(parseInt(n))?e.splice(n,1):delete e[n]:e[n]=t}}function jt(e){var n,t={};for(n in e)Z(e,n)&&(t[n]=e[n]);return t}var br=[].concat;function At(e){return br.apply([],e)}var xe="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(At([8,16,32,64].map(function(e){return["Int","Uint","Float"].map(function(n){return n+e+"Array"})}))).filter(function(e){return G[e]}),Ct=new Set(xe.map(function(e){return G[e]})),$e=null;function be(e){return $e=new WeakMap,e=function n(t){if(!t||typeof t!="object")return t;var r=$e.get(t);if(r)return r;if(L(t)){r=[],$e.set(t,r);for(var i=0,o=t.length;i<o;++i)r.push(n(t[i]))}else if(Ct.has(t.constructor))r=t;else{var a,u=Te(t);for(a in r=u===Object.prototype?{}:Object.create(u),$e.set(t,r),t)Z(t,a)&&(r[a]=n(t[a]))}return r}(e),$e=null,e}var wr={}.toString;function Nn(e){return wr.call(e).slice(8,-1)}var Ln=typeof Symbol<"u"?Symbol.iterator:"@@iterator",_r=typeof Ln=="symbol"?function(e){var n;return e!=null&&(n=e[Ln])&&n.apply(e)}:function(){return null};function we(e,n){return n=e.indexOf(n),0<=n&&e.splice(n,1),0<=n}var De={};function se(e){var n,t,r,i;if(arguments.length===1){if(L(e))return e.slice();if(this===De&&typeof e=="string")return[e];if(i=_r(e)){for(t=[];!(r=i.next()).done;)t.push(r.value);return t}if(e==null)return[e];if(typeof(n=e.length)!="number")return[e];for(t=new Array(n);n--;)t[n]=e[n];return t}for(n=arguments.length,t=new Array(n);n--;)t[n]=arguments[n];return t}var Un=typeof Symbol<"u"?function(e){return e[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},Xe=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],re=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Xe),xr={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function Be(e,n){this.name=e,this.message=n}function Tt(e,n){return e+". Errors: "+Object.keys(n).map(function(t){return n[t].toString()}).filter(function(t,r,i){return i.indexOf(t)===r}).join(`
|
|
2
|
+
`)}function fn(e,n,t,r){this.failures=n,this.failedKeys=r,this.successCount=t,this.message=Tt(e,n)}function Re(e,n){this.name="BulkError",this.failures=Object.keys(n).map(function(t){return n[t]}),this.failuresByPos=n,this.message=Tt(e,this.failures)}Ie(Be).from(Error).extend({toString:function(){return this.name+": "+this.message}}),Ie(fn).from(Be),Ie(Re).from(Be);var Vn=re.reduce(function(e,n){return e[n]=n+"Error",e},{}),kr=Be,A=re.reduce(function(e,n){var t=n+"Error";function r(i,o){this.name=t,i?typeof i=="string"?(this.message="".concat(i).concat(o?`
|
|
3
|
+
`+o:""),this.inner=o||null):typeof i=="object"&&(this.message="".concat(i.name," ").concat(i.message),this.inner=i):(this.message=xr[n]||t,this.inner=null)}return Ie(r).from(kr),e[n]=r,e},{});A.Syntax=SyntaxError,A.Type=TypeError,A.Range=RangeError;var qt=Xe.reduce(function(e,n){return e[n+"Error"]=A[n],e},{}),hn=re.reduce(function(e,n){return["Syntax","Type","Range"].indexOf(n)===-1&&(e[n+"Error"]=A[n]),e},{});function F(){}function Ge(e){return e}function Or(e,n){return e==null||e===Ge?n:function(t){return n(e(t))}}function _e(e,n){return function(){e.apply(this,arguments),n.apply(this,arguments)}}function Pr(e,n){return e===F?n:function(){var t=e.apply(this,arguments);t!==void 0&&(arguments[0]=t);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=n.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?_e(r,this.onsuccess):r),i&&(this.onerror=this.onerror?_e(i,this.onerror):i),o!==void 0?o:t}}function Er(e,n){return e===F?n:function(){e.apply(this,arguments);var t=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,n.apply(this,arguments),t&&(this.onsuccess=this.onsuccess?_e(t,this.onsuccess):t),r&&(this.onerror=this.onerror?_e(r,this.onerror):r)}}function Kr(e,n){return e===F?n:function(t){var r=e.apply(this,arguments);ee(t,r);var i=this.onsuccess,o=this.onerror;return this.onsuccess=null,this.onerror=null,t=n.apply(this,arguments),i&&(this.onsuccess=this.onsuccess?_e(i,this.onsuccess):i),o&&(this.onerror=this.onerror?_e(o,this.onerror):o),r===void 0?t===void 0?void 0:t:ee(r,t)}}function Sr(e,n){return e===F?n:function(){return n.apply(this,arguments)!==!1&&e.apply(this,arguments)}}function zn(e,n){return e===F?n:function(){var t=e.apply(this,arguments);if(t&&typeof t.then=="function"){for(var r=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return t.then(function(){return n.apply(r,o)})}return n.apply(this,arguments)}}hn.ModifyError=fn,hn.DexieError=Be,hn.BulkError=Re;var ie=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function It(e){ie=e}var Qe={},Dt=100,xe=typeof Promise>"u"?[]:function(){var e=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[e,Te(e),e];var n=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[n,Te(n),e]}(),Xe=xe[0],re=xe[1],xe=xe[2],re=re&&re.then,ke=Xe&&Xe.constructor,Wn=!!xe,He=function(e,n){Je.push([e,n]),dn&&(queueMicrotask(Ar),dn=!1)},Yn=!0,dn=!0,Oe=[],pn=[],$n=Ge,he={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:F,pgp:!1,env:{},finalize:F},j=he,Je=[],Pe=0,yn=[];function K(e){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var n=this._PSD=j;if(typeof e!="function"){if(e!==Qe)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Qn(this,this._value))}this._state=null,this._value=null,++n.ref,function t(r,i){try{i(function(o){if(r._state===null){if(o===r)throw new TypeError("A promise cannot be resolved with itself.");var a=r._lib&&Fe();o&&typeof o.then=="function"?t(r,function(u,c){o instanceof K?o._then(u,c):o.then(u,c)}):(r._state=!0,r._value=o,Rt(r)),a&&Me()}},Qn.bind(null,r))}catch(o){Qn(r,o)}}(this,e)}var Gn={get:function(){var e=j,n=bn;function t(r,i){var o=this,a=!e.global&&(e!==j||n!==bn),u=a&&!pe(),c=new K(function(f,d){Xn(o,new Bt(Mt(r,e,a,u),Mt(i,e,a,u),f,d,e))});return this._consoleTask&&(c._consoleTask=this._consoleTask),c}return t.prototype=Qe,t},set:function(e){fe(this,"then",e&&e.prototype===Qe?Gn:{get:function(){return e},set:Gn.set})}};function Bt(e,n,t,r,i){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof n=="function"?n:null,this.resolve=t,this.reject=r,this.psd=i}function Qn(e,n){var t,r;pn.push(n),e._state===null&&(t=e._lib&&Fe(),n=$n(n),e._state=!1,e._value=n,r=e,Oe.some(function(i){return i._value===r._value})||Oe.push(r),Rt(e),t&&Me())}function Rt(e){var n=e._listeners;e._listeners=[];for(var t=0,r=n.length;t<r;++t)Xn(e,n[t]);var i=e._PSD;--i.ref||i.finalize(),Pe===0&&(++Pe,He(function(){--Pe==0&&Hn()},[]))}function Xn(e,n){if(e._state!==null){var t=e._state?n.onFulfilled:n.onRejected;if(t===null)return(e._state?n.resolve:n.reject)(e._value);++n.psd.ref,++Pe,He(jr,[t,e,n])}else e._listeners.push(n)}function jr(e,n,t){try{var r,i=n._value;!n._state&&pn.length&&(pn=[]),r=ie&&n._consoleTask?n._consoleTask.run(function(){return e(i)}):e(i),n._state||pn.indexOf(i)!==-1||function(o){for(var a=Oe.length;a;)if(Oe[--a]._value===o._value)return Oe.splice(a,1)}(n),t.resolve(r)}catch(o){t.reject(o)}finally{--Pe==0&&Hn(),--t.psd.ref||t.psd.finalize()}}function Ar(){Ee(he,function(){Fe()&&Me()})}function Fe(){var e=Yn;return dn=Yn=!1,e}function Me(){var e,n,t;do for(;0<Je.length;)for(e=Je,Je=[],t=e.length,n=0;n<t;++n){var r=e[n];r[0].apply(null,r[1])}while(0<Je.length);dn=Yn=!0}function Hn(){var e=Oe;Oe=[],e.forEach(function(r){r._PSD.onunhandled.call(null,r._value,r)});for(var n=yn.slice(0),t=n.length;t;)n[--t]()}function vn(e){return new K(Qe,!1,e)}function N(e,n){var t=j;return function(){var r=Fe(),i=j;try{return ye(t,!0),e.apply(this,arguments)}catch(o){n&&n(o)}finally{ye(i,!1),r&&Me()}}}qe(K.prototype,{then:Gn,_then:function(e,n){Xn(this,new Bt(null,null,e,n,j))},catch:function(e){if(arguments.length===1)return this.then(null,e);var n=e,t=arguments[1];return typeof n=="function"?this.then(null,function(r){return(r instanceof n?t:vn)(r)}):this.then(null,function(r){return(r&&r.name===n?t:vn)(r)})},finally:function(e){return this.then(function(n){return K.resolve(e()).then(function(){return n})},function(n){return K.resolve(e()).then(function(){return vn(n)})})},timeout:function(e,n){var t=this;return e<1/0?new K(function(r,i){var o=setTimeout(function(){return i(new A.Timeout(n))},e);t.then(r,i).finally(clearTimeout.bind(null,o))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&fe(K.prototype,Symbol.toStringTag,"Dexie.Promise"),he.env=Ft(),qe(K,{all:function(){var e=se.apply(null,arguments).map(wn);return new K(function(n,t){e.length===0&&n([]);var r=e.length;e.forEach(function(i,o){return K.resolve(i).then(function(a){e[o]=a,--r||n(e)},t)})})},resolve:function(e){return e instanceof K?e:e&&typeof e.then=="function"?new K(function(n,t){e.then(n,t)}):new K(Qe,!0,e)},reject:vn,race:function(){var e=se.apply(null,arguments).map(wn);return new K(function(n,t){e.map(function(r){return K.resolve(r).then(n,t)})})},PSD:{get:function(){return j},set:function(e){return j=e}},totalEchoes:{get:function(){return bn}},newPSD:de,usePSD:Ee,scheduler:{get:function(){return He},set:function(e){He=e}},rejectionMapper:{get:function(){return $n},set:function(e){$n=e}},follow:function(e,n){return new K(function(t,r){return de(function(i,o){var a=j;a.unhandleds=[],a.onunhandled=o,a.finalize=_e(function(){var u,c=this;u=function(){c.unhandleds.length===0?i():o(c.unhandleds[0])},yn.push(function f(){u(),yn.splice(yn.indexOf(f),1)}),++Pe,He(function(){--Pe==0&&Hn()},[])},a.finalize),e()},n,t,r)})}}),ke&&(ke.allSettled&&fe(K,"allSettled",function(){var e=se.apply(null,arguments).map(wn);return new K(function(n){e.length===0&&n([]);var t=e.length,r=new Array(t);e.forEach(function(i,o){return K.resolve(i).then(function(a){return r[o]={status:"fulfilled",value:a}},function(a){return r[o]={status:"rejected",reason:a}}).then(function(){return--t||n(r)})})})}),ke.any&&typeof AggregateError<"u"&&fe(K,"any",function(){var e=se.apply(null,arguments).map(wn);return new K(function(n,t){e.length===0&&t(new AggregateError([]));var r=e.length,i=new Array(r);e.forEach(function(o,a){return K.resolve(o).then(function(u){return n(u)},function(u){i[a]=u,--r||t(new AggregateError(i))})})})}),ke.withResolvers&&(K.withResolvers=ke.withResolvers));var Y={awaits:0,echoes:0,id:0},Cr=0,mn=[],gn=0,bn=0,Tr=0;function de(e,n,t,r){var i=j,o=Object.create(i);return o.parent=i,o.ref=0,o.global=!1,o.id=++Tr,he.env,o.env=Wn?{Promise:K,PromiseProp:{value:K,configurable:!0,writable:!0},all:K.all,race:K.race,allSettled:K.allSettled,any:K.any,resolve:K.resolve,reject:K.reject}:{},n&&ee(o,n),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()},r=Ee(o,e,t,r),o.ref===0&&o.finalize(),r}function Ne(){return Y.id||(Y.id=++Cr),++Y.awaits,Y.echoes+=Dt,Y.id}function pe(){return!!Y.awaits&&(--Y.awaits==0&&(Y.id=0),Y.echoes=Y.awaits*Dt,!0)}function wn(e){return Y.echoes&&e&&e.constructor===ke?(Ne(),e.then(function(n){return pe(),n},function(n){return pe(),V(n)})):e}function qr(){var e=mn[mn.length-1];mn.pop(),ye(e,!1)}function ye(e,n){var t,r=j;(n?!Y.echoes||gn++&&e===j:!gn||--gn&&e===j)||queueMicrotask(n?(function(i){++bn,Y.echoes&&--Y.echoes!=0||(Y.echoes=Y.awaits=Y.id=0),mn.push(j),ye(i,!0)}).bind(null,e):qr),e!==j&&(j=e,r===he&&(he.env=Ft()),Wn&&(t=he.env.Promise,n=e.env,(r.global||e.global)&&(Object.defineProperty(G,"Promise",n.PromiseProp),t.all=n.all,t.race=n.race,t.resolve=n.resolve,t.reject=n.reject,n.allSettled&&(t.allSettled=n.allSettled),n.any&&(t.any=n.any))))}function Ft(){var e=G.Promise;return Wn?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(G,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function Ee(e,n,t,r,i){var o=j;try{return ye(e,!0),n(t,r,i)}finally{ye(o,!1)}}function Mt(e,n,t,r){return typeof e!="function"?e:function(){var i=j;t&&Ne(),ye(n,!0);try{return e.apply(this,arguments)}finally{ye(i,!1),r&&queueMicrotask(pe)}}}function Jn(e){Promise===ke&&Y.echoes===0?gn===0?e():enqueueNativeMicroTask(e):setTimeout(e,0)}(""+re).indexOf("[native code]")===-1&&(Ne=pe=F);var V=K.reject,Ke="",ce="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Nt="String expected.",Le=[],_n="__dbnames",Zn="readonly",et="readwrite";function Se(e,n){return e?n?function(){return e.apply(this,arguments)&&n.apply(this,arguments)}:e:n}var Lt={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function xn(e){return typeof e!="string"||/\./.test(e)?function(n){return n}:function(n){return n[e]===void 0&&e in n&&delete(n=be(n))[e],n}}function Ut(){throw A.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function D(e,n){try{var t=Vt(e),r=Vt(n);if(t!==r)return t==="Array"?1:r==="Array"?-1:t==="binary"?1:r==="binary"?-1:t==="string"?1:r==="string"?-1:t==="Date"?1:r!=="Date"?NaN:-1;switch(t){case"number":case"Date":case"string":return n<e?1:e<n?-1:0;case"binary":return function(i,o){for(var a=i.length,u=o.length,c=a<u?a:u,f=0;f<c;++f)if(i[f]!==o[f])return i[f]<o[f]?-1:1;return a===u?0:a<u?-1:1}(zt(e),zt(n));case"Array":return function(i,o){for(var a=i.length,u=o.length,c=a<u?a:u,f=0;f<c;++f){var d=D(i[f],o[f]);if(d!==0)return d}return a===u?0:a<u?-1:1}(e,n)}}catch{}return NaN}function Vt(e){var n=typeof e;return n!="object"?n:ArrayBuffer.isView(e)?"binary":(e=Nn(e),e==="ArrayBuffer"?"binary":e)}function zt(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}function kn(e,n,t){var r=e.schema.yProps;return r?(n&&0<t.numFailures&&(n=n.filter(function(i,o){return!t.failures[o]})),Promise.all(r.map(function(i){return i=i.updatesTable,n?e.db.table(i).where("k").anyOf(n).delete():e.db.table(i).clear()})).then(function(){return t})):t}var Wt=(M.prototype._trans=function(e,n,t){var r=this._tx||j.trans,i=this.name,o=ie&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(e==="readonly"?"read":"write"," ").concat(this.name));function a(f,d,s){if(!s.schema[i])throw new A.NotFound("Table "+i+" not part of transaction");return n(s.idbtrans,s)}var u=Fe();try{var c=r&&r.db._novip===this.db._novip?r===j.trans?r._promise(e,a,t):de(function(){return r._promise(e,a,t)},{trans:r,transless:j.transless||j}):function f(d,s,v,l){if(d.idbdb&&(d._state.openComplete||j.letThrough||d._vip)){var h=d._createTransaction(s,v,d._dbSchema);try{h.create(),d._state.PR1398_maxLoop=3}catch(y){return y.name===Vn.InvalidState&&d.isOpen()&&0<--d._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),d.close({disableAutoOpen:!1}),d.open().then(function(){return f(d,s,v,l)})):V(y)}return h._promise(s,function(y,p){return de(function(){return j.trans=h,l(y,p,h)})}).then(function(y){if(s==="readwrite")try{h.idbtrans.commit()}catch{}return s==="readonly"?y:h._completion.then(function(){return y})})}if(d._state.openComplete)return V(new A.DatabaseClosed(d._state.dbOpenError));if(!d._state.isBeingOpened){if(!d._state.autoOpen)return V(new A.DatabaseClosed);d.open().catch(F)}return d._state.dbReadyPromise.then(function(){return f(d,s,v,l)})}(this.db,e,[this.name],a);return o&&(c._consoleTask=o,c=c.catch(function(f){return console.trace(f),V(f)})),c}finally{u&&Me()}},M.prototype.get=function(e,n){var t=this;return e&&e.constructor===Object?this.where(e).first(n):e==null?V(new A.Type("Invalid argument to Table.get()")):this._trans("readonly",function(r){return t.core.get({trans:r,key:e}).then(function(i){return t.hook.reading.fire(i)})}).then(n)},M.prototype.where=function(e){if(typeof e=="string")return new this.db.WhereClause(this,e);if(L(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var n=W(e);if(n.length===1)return this.where(n[0]).equals(e[n[0]]);var t=this.schema.indexes.concat(this.schema.primKey).filter(function(u){if(u.compound&&n.every(function(f){return 0<=u.keyPath.indexOf(f)})){for(var c=0;c<n.length;++c)if(n.indexOf(u.keyPath[c])===-1)return!1;return!0}return!1}).sort(function(u,c){return u.keyPath.length-c.keyPath.length})[0];if(t&&this.db._maxKey!==Ke){var o=t.keyPath.slice(0,n.length);return this.where(o).equals(o.map(function(c){return e[c]}))}!t&&ie&&console.warn("The query ".concat(JSON.stringify(e)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(n.join("+"),"]"));var r=this.schema.idxByName;function i(u,c){return D(u,c)===0}var a=n.reduce(function(s,c){var f=s[0],d=s[1],s=r[c],v=e[c];return[f||s,f||!s?Se(d,s&&s.multi?function(l){return l=ue(l,c),L(l)&&l.some(function(h){return i(v,h)})}:function(l){return i(v,ue(l,c))}):d]},[null,null]),o=a[0],a=a[1];return o?this.where(o.name).equals(e[o.keyPath]).filter(a):t?this.filter(a):this.where(n).equals("")},M.prototype.filter=function(e){return this.toCollection().and(e)},M.prototype.count=function(e){return this.toCollection().count(e)},M.prototype.offset=function(e){return this.toCollection().offset(e)},M.prototype.limit=function(e){return this.toCollection().limit(e)},M.prototype.each=function(e){return this.toCollection().each(e)},M.prototype.toArray=function(e){return this.toCollection().toArray(e)},M.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},M.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,L(e)?"[".concat(e.join("+"),"]"):e))},M.prototype.reverse=function(){return this.toCollection().reverse()},M.prototype.mapToClass=function(e){var n,t=this.db,r=this.name;function i(){return n!==null&&n.apply(this,arguments)||this}(this.schema.mappedClass=e).prototype instanceof Ut&&(function(c,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");function d(){this.constructor=c}Mn(c,f),c.prototype=f===null?Object.create(f):(d.prototype=f.prototype,new d)}(i,n=e),Object.defineProperty(i.prototype,"db",{get:function(){return t},enumerable:!1,configurable:!0}),i.prototype.table=function(){return r},e=i);for(var o=new Set,a=e.prototype;a;a=Te(a))Object.getOwnPropertyNames(a).forEach(function(c){return o.add(c)});function u(c){if(!c)return c;var f,d=Object.create(e.prototype);for(f in c)if(!o.has(f))try{d[f]=c[f]}catch{}return d}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=u,this.hook("reading",u),e},M.prototype.defineClass=function(){return this.mapToClass(function(e){ee(this,e)})},M.prototype.add=function(e,n){var t=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,a=e;return o&&i&&(a=xn(o)(e)),this._trans("readwrite",function(u){return t.core.mutate({trans:u,type:"add",keys:n!=null?[n]:null,values:[a]})}).then(function(u){return u.numFailures?K.reject(u.failures[0]):u.lastResult}).then(function(u){if(o)try{ne(e,o,u)}catch{}return u})},M.prototype.update=function(e,n){return typeof e!="object"||L(e)?this.where(":id").equals(e).modify(n):(e=ue(e,this.schema.primKey.keyPath),e===void 0?V(new A.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(e).modify(n))},M.prototype.put=function(e,n){var t=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,a=e;return o&&i&&(a=xn(o)(e)),this._trans("readwrite",function(u){return t.core.mutate({trans:u,type:"put",values:[a],keys:n!=null?[n]:null})}).then(function(u){return u.numFailures?K.reject(u.failures[0]):u.lastResult}).then(function(u){if(o)try{ne(e,o,u)}catch{}return u})},M.prototype.delete=function(e){var n=this;return this._trans("readwrite",function(t){return n.core.mutate({trans:t,type:"delete",keys:[e]}).then(function(r){return kn(n,[e],r)}).then(function(r){return r.numFailures?K.reject(r.failures[0]):void 0})})},M.prototype.clear=function(){var e=this;return this._trans("readwrite",function(n){return e.core.mutate({trans:n,type:"deleteRange",range:Lt}).then(function(t){return kn(e,null,t)})}).then(function(n){return n.numFailures?K.reject(n.failures[0]):void 0})},M.prototype.bulkGet=function(e){var n=this;return this._trans("readonly",function(t){return n.core.getMany({keys:e,trans:t}).then(function(r){return r.map(function(i){return n.hook.reading.fire(i)})})})},M.prototype.bulkAdd=function(e,n,t){var r=this,i=Array.isArray(n)?n:void 0,o=(t=t||(i?void 0:n))?t.allKeys:void 0;return this._trans("readwrite",function(a){var f=r.schema.primKey,u=f.auto,f=f.keyPath;if(f&&i)throw new A.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new A.InvalidArgument("Arguments objects and keys must have the same length");var c=e.length,f=f&&u?e.map(xn(f)):e;return r.core.mutate({trans:a,type:"add",keys:i,values:f,wantResults:o}).then(function(h){var s=h.numFailures,v=h.results,l=h.lastResult,h=h.failures;if(s===0)return o?v:l;throw new Re("".concat(r.name,".bulkAdd(): ").concat(s," of ").concat(c," operations failed"),h)})})},M.prototype.bulkPut=function(e,n,t){var r=this,i=Array.isArray(n)?n:void 0,o=(t=t||(i?void 0:n))?t.allKeys:void 0;return this._trans("readwrite",function(a){var f=r.schema.primKey,u=f.auto,f=f.keyPath;if(f&&i)throw new A.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new A.InvalidArgument("Arguments objects and keys must have the same length");var c=e.length,f=f&&u?e.map(xn(f)):e;return r.core.mutate({trans:a,type:"put",keys:i,values:f,wantResults:o}).then(function(h){var s=h.numFailures,v=h.results,l=h.lastResult,h=h.failures;if(s===0)return o?v:l;throw new Re("".concat(r.name,".bulkPut(): ").concat(s," of ").concat(c," operations failed"),h)})})},M.prototype.bulkUpdate=function(e){var n=this,t=this.core,r=e.map(function(a){return a.key}),i=e.map(function(a){return a.changes}),o=[];return this._trans("readwrite",function(a){return t.getMany({trans:a,keys:r,cache:"clone"}).then(function(u){var c=[],f=[];e.forEach(function(s,v){var l=s.key,h=s.changes,y=u[v];if(y){for(var p=0,m=Object.keys(h);p<m.length;p++){var g=m[p],b=h[g];if(g===n.schema.primKey.keyPath){if(D(b,l)!==0)throw new A.Constraint("Cannot update primary key in bulkUpdate()")}else ne(y,g,b)}o.push(v),c.push(l),f.push(y)}});var d=c.length;return t.mutate({trans:a,type:"put",keys:c,values:f,updates:{keys:r,changeSpecs:i}}).then(function(s){var v=s.numFailures,l=s.failures;if(v===0)return d;for(var h=0,y=Object.keys(l);h<y.length;h++){var p,m=y[h],g=o[Number(m)];g!=null&&(p=l[m],delete l[m],l[g]=p)}throw new Re("".concat(n.name,".bulkUpdate(): ").concat(v," of ").concat(d," operations failed"),l)})})})},M.prototype.bulkDelete=function(e){var n=this,t=e.length;return this._trans("readwrite",function(r){return n.core.mutate({trans:r,type:"delete",keys:e}).then(function(i){return kn(n,e,i)})}).then(function(a){var i=a.numFailures,o=a.lastResult,a=a.failures;if(i===0)return o;throw new Re("".concat(n.name,".bulkDelete(): ").concat(i," of ").concat(t," operations failed"),a)})},M);function M(){}function Ze(e){function n(a,u){if(u){for(var c=arguments.length,f=new Array(c-1);--c;)f[c-1]=arguments[c];return t[a].subscribe.apply(null,f),e}if(typeof a=="string")return t[a]}var t={};n.addEventType=o;for(var r=1,i=arguments.length;r<i;++r)o(arguments[r]);return n;function o(a,u,c){if(typeof a!="object"){var f;u=u||Sr;var d={subscribers:[],fire:c=c||F,subscribe:function(s){d.subscribers.indexOf(s)===-1&&(d.subscribers.push(s),d.fire=u(d.fire,s))},unsubscribe:function(s){d.subscribers=d.subscribers.filter(function(v){return v!==s}),d.fire=d.subscribers.reduce(u,c)}};return t[a]=n[a]=d}W(f=a).forEach(function(s){var v=f[s];if(L(v))o(s,f[s][0],f[s][1]);else{if(v!=="asap")throw new A.InvalidArgument("Invalid event config");var l=o(s,Ge,function(){for(var h=arguments.length,y=new Array(h);h--;)y[h]=arguments[h];l.subscribers.forEach(function(p){St(function(){p.apply(null,y)})})})}})}}function en(e,n){return Ie(n).from({prototype:e}),n}function Ue(e,n){return!(e.filter||e.algorithm||e.or)&&(n?e.justLimit:!e.replayFilter)}function nt(e,n){e.filter=Se(e.filter,n)}function tt(e,n,t){var r=e.replayFilter;e.replayFilter=r?function(){return Se(r(),n())}:n,e.justLimit=t&&!r}function On(e,n){if(e.isPrimKey)return n.primaryKey;var t=n.getIndexByKeyPath(e.index);if(!t)throw new A.Schema("KeyPath "+e.index+" on object store "+n.name+" is not indexed");return t}function Yt(e,n,t){var r=On(e,n.schema);return n.openCursor({trans:t,values:!e.keysOnly,reverse:e.dir==="prev",unique:!!e.unique,query:{index:r,range:e.range}})}function Pn(e,n,t,r){var i=e.replayFilter?Se(e.filter,e.replayFilter()):e.filter;if(e.or){var o={},a=function(u,c,f){var d,s;i&&!i(c,f,function(v){return c.stop(v)},function(v){return c.fail(v)})||((s=""+(d=c.primaryKey))=="[object ArrayBuffer]"&&(s=""+new Uint8Array(d)),Z(o,s)||(o[s]=!0,n(u,c,f)))};return Promise.all([e.or._iterate(a,t),$t(Yt(e,r,t),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return $t(Yt(e,r,t),Se(e.algorithm,i),n,!e.keysOnly&&e.valueMapper)}function $t(e,n,t,r){var i=N(r?function(o,a,u){return t(r(o),a,u)}:t);return e.then(function(o){if(o)return o.start(function(){var a=function(){return o.continue()};n&&!n(o,function(u){return a=u},function(u){o.stop(u),a=F},function(u){o.fail(u),a=F})||i(o.value,o,function(u){return a=u}),a()})})}var nn=(Gt.prototype.execute=function(e){var n=this["@@propmod"];if(n.add!==void 0){var t=n.add;if(L(t))return cn(cn([],L(e)?e:[],!0),t).sort();if(typeof t=="number")return(Number(e)||0)+t;if(typeof t=="bigint")try{return BigInt(e)+t}catch{return BigInt(0)+t}throw new TypeError("Invalid term ".concat(t))}if(n.remove!==void 0){var r=n.remove;if(L(r))return L(e)?e.filter(function(i){return!r.includes(i)}).sort():[];if(typeof r=="number")return Number(e)-r;if(typeof r=="bigint")try{return BigInt(e)-r}catch{return BigInt(0)-r}throw new TypeError("Invalid subtrahend ".concat(r))}return t=(t=n.replacePrefix)===null||t===void 0?void 0:t[0],t&&typeof e=="string"&&e.startsWith(t)?n.replacePrefix[1]+e.substring(t.length):e},Gt);function Gt(e){this["@@propmod"]=e}var Ir=(R.prototype._read=function(e,n){var t=this._ctx;return t.error?t.table._trans(null,V.bind(null,t.error)):t.table._trans("readonly",e).then(n)},R.prototype._write=function(e){var n=this._ctx;return n.error?n.table._trans(null,V.bind(null,n.error)):n.table._trans("readwrite",e,"locked")},R.prototype._addAlgorithm=function(e){var n=this._ctx;n.algorithm=Se(n.algorithm,e)},R.prototype._iterate=function(e,n){return Pn(this._ctx,e,n,this._ctx.table.core)},R.prototype.clone=function(e){var n=Object.create(this.constructor.prototype),t=Object.create(this._ctx);return e&&ee(t,e),n._ctx=t,n},R.prototype.raw=function(){return this._ctx.valueMapper=null,this},R.prototype.each=function(e){var n=this._ctx;return this._read(function(t){return Pn(n,e,t,n.table.core)})},R.prototype.count=function(e){var n=this;return this._read(function(t){var r=n._ctx,i=r.table.core;if(Ue(r,!0))return i.count({trans:t,query:{index:On(r,i.schema),range:r.range}}).then(function(a){return Math.min(a,r.limit)});var o=0;return Pn(r,function(){return++o,!1},t,i).then(function(){return o})}).then(e)},R.prototype.sortBy=function(e,n){var t=e.split(".").reverse(),r=t[0],i=t.length-1;function o(c,f){return f?o(c[t[f]],f-1):c[r]}var a=this._ctx.dir==="next"?1:-1;function u(c,f){return D(o(c,i),o(f,i))*a}return this.toArray(function(c){return c.sort(u)}).then(n)},R.prototype.toArray=function(e){var n=this;return this._read(function(t){var r=n._ctx;if(r.dir==="next"&&Ue(r,!0)&&0<r.limit){var i=r.valueMapper,o=On(r,r.table.core.schema);return r.table.core.query({trans:t,limit:r.limit,values:!0,query:{index:o,range:r.range}}).then(function(u){return u=u.result,i?u.map(i):u})}var a=[];return Pn(r,function(u){return a.push(u)},t,r.table.core).then(function(){return a})},e)},R.prototype.offset=function(e){var n=this._ctx;return e<=0||(n.offset+=e,Ue(n)?tt(n,function(){var t=e;return function(r,i){return t===0||(t===1?--t:i(function(){r.advance(t),t=0}),!1)}}):tt(n,function(){var t=e;return function(){return--t<0}})),this},R.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),tt(this._ctx,function(){var n=e;return function(t,r,i){return--n<=0&&r(i),0<=n}},!0),this},R.prototype.until=function(e,n){return nt(this._ctx,function(t,r,i){return!e(t.value)||(r(i),n)}),this},R.prototype.first=function(e){return this.limit(1).toArray(function(n){return n[0]}).then(e)},R.prototype.last=function(e){return this.reverse().first(e)},R.prototype.filter=function(e){var n;return nt(this._ctx,function(t){return e(t.value)}),(n=this._ctx).isMatch=Se(n.isMatch,e),this},R.prototype.and=function(e){return this.filter(e)},R.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},R.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},R.prototype.desc=function(){return this.reverse()},R.prototype.eachKey=function(e){var n=this._ctx;return n.keysOnly=!n.isMatch,this.each(function(t,r){e(r.key,r)})},R.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},R.prototype.eachPrimaryKey=function(e){var n=this._ctx;return n.keysOnly=!n.isMatch,this.each(function(t,r){e(r.primaryKey,r)})},R.prototype.keys=function(e){var n=this._ctx;n.keysOnly=!n.isMatch;var t=[];return this.each(function(r,i){t.push(i.key)}).then(function(){return t}).then(e)},R.prototype.primaryKeys=function(e){var n=this._ctx;if(n.dir==="next"&&Ue(n,!0)&&0<n.limit)return this._read(function(r){var i=On(n,n.table.core.schema);return n.table.core.query({trans:r,values:!1,limit:n.limit,query:{index:i,range:n.range}})}).then(function(r){return r.result}).then(e);n.keysOnly=!n.isMatch;var t=[];return this.each(function(r,i){t.push(i.primaryKey)}).then(function(){return t}).then(e)},R.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},R.prototype.firstKey=function(e){return this.limit(1).keys(function(n){return n[0]}).then(e)},R.prototype.lastKey=function(e){return this.reverse().firstKey(e)},R.prototype.distinct=function(){var e=this._ctx,e=e.index&&e.table.schema.idxByName[e.index];if(!e||!e.multi)return this;var n={};return nt(this._ctx,function(i){var r=i.primaryKey.toString(),i=Z(n,r);return n[r]=!0,!i}),this},R.prototype.modify=function(e){var n=this,t=this._ctx;return this._write(function(r){var i,o,a;a=typeof e=="function"?e:(i=W(e),o=i.length,function(m){for(var g=!1,b=0;b<o;++b){var w=i[b],_=e[w],O=ue(m,w);_ instanceof nn?(ne(m,w,_.execute(O)),g=!0):O!==_&&(ne(m,w,_),g=!0)}return g});var u=t.table.core,s=u.schema.primaryKey,c=s.outbound,f=s.extractKey,d=200,s=n.db._options.modifyChunkSize;s&&(d=typeof s=="object"?s[u.name]||s["*"]||200:s);function v(m,w){var b=w.failures,w=w.numFailures;h+=m-w;for(var _=0,O=W(b);_<O.length;_++){var x=O[_];l.push(b[x])}}var l=[],h=0,y=[],p=e===Qt;return n.clone().primaryKeys().then(function(m){function g(w){var _=Math.min(d,m.length-w),O=m.slice(w,w+_);return(p?Promise.resolve([]):u.getMany({trans:r,keys:O,cache:"immutable"})).then(function(x){var k=[],E=[],P=c?[]:null,S=p?O:[];if(!p)for(var I=0;I<_;++I){var B=x[I],q={value:be(B),primKey:m[w+I]};a.call(q,q.value,q)!==!1&&(q.value==null?S.push(m[w+I]):c||D(f(B),f(q.value))===0?(E.push(q.value),c&&P.push(m[w+I])):(S.push(m[w+I]),k.push(q.value)))}return Promise.resolve(0<k.length&&u.mutate({trans:r,type:"add",values:k}).then(function(U){for(var T in U.failures)S.splice(parseInt(T),1);v(k.length,U)})).then(function(){return(0<E.length||b&&typeof e=="object")&&u.mutate({trans:r,type:"put",keys:P,values:E,criteria:b,changeSpec:typeof e!="function"&&e,isAdditionalChunk:0<w}).then(function(U){return v(E.length,U)})}).then(function(){return(0<S.length||b&&p)&&u.mutate({trans:r,type:"delete",keys:S,criteria:b,isAdditionalChunk:0<w}).then(function(U){return kn(t.table,S,U)}).then(function(U){return v(S.length,U)})}).then(function(){return m.length>w+_&&g(w+d)})})}var b=Ue(t)&&t.limit===1/0&&(typeof e!="function"||p)&&{index:t.index,range:t.range};return g(0).then(function(){if(0<l.length)throw new fn("Error modifying one or more objects",l,h,y);return m.length})})})},R.prototype.delete=function(){var e=this._ctx,n=e.range;return!Ue(e)||e.table.schema.yProps||!e.isPrimKey&&n.type!==3?this.modify(Qt):this._write(function(t){var r=e.table.core.schema.primaryKey,i=n;return e.table.core.count({trans:t,query:{index:r,range:i}}).then(function(o){return e.table.core.mutate({trans:t,type:"deleteRange",range:i}).then(function(c){var u=c.failures,c=c.numFailures;if(c)throw new fn("Could not delete some values",Object.keys(u).map(function(f){return u[f]}),o-c);return o-c})})})},R);function R(){}var Qt=function(e,n){return n.value=null};function Dr(e,n){return e<n?-1:e===n?0:1}function Br(e,n){return n<e?-1:e===n?0:1}function te(e,n,t){return e=e instanceof Ht?new e.Collection(e):e,e._ctx.error=new(t||TypeError)(n),e}function Ve(e){return new e.Collection(e,function(){return Xt("")}).limit(0)}function En(e,n,t,r){var i,o,a,u,c,f,d,s=t.length;if(!t.every(function(h){return typeof h=="string"}))return te(e,Nt);function v(h){i=h==="next"?function(p){return p.toUpperCase()}:function(p){return p.toLowerCase()},o=h==="next"?function(p){return p.toLowerCase()}:function(p){return p.toUpperCase()},a=h==="next"?Dr:Br;var y=t.map(function(p){return{lower:o(p),upper:i(p)}}).sort(function(p,m){return a(p.lower,m.lower)});u=y.map(function(p){return p.upper}),c=y.map(function(p){return p.lower}),d=(f=h)==="next"?"":r}v("next"),e=new e.Collection(e,function(){return ve(u[0],c[s-1]+r)}),e._ondirectionchange=function(h){v(h)};var l=0;return e._addAlgorithm(function(h,y,p){var m=h.key;if(typeof m!="string")return!1;var g=o(m);if(n(g,c,l))return!0;for(var b=null,w=l;w<s;++w){var _=function(O,x,k,E,P,S){for(var I=Math.min(O.length,E.length),B=-1,q=0;q<I;++q){var U=x[q];if(U!==E[q])return P(O[q],k[q])<0?O.substr(0,q)+k[q]+k.substr(q+1):P(O[q],E[q])<0?O.substr(0,q)+E[q]+k.substr(q+1):0<=B?O.substr(0,B)+x[B]+k.substr(B+1):null;P(O[q],U)<0&&(B=q)}return I<E.length&&S==="next"?O+k.substr(O.length):I<O.length&&S==="prev"?O.substr(0,k.length):B<0?null:O.substr(0,B)+E[B]+k.substr(B+1)}(m,g,u[w],c[w],a,f);_===null&&b===null?l=w+1:(b===null||0<a(b,_))&&(b=_)}return y(b!==null?function(){h.continue(b+d)}:p),!1}),e}function ve(e,n,t,r){return{type:2,lower:e,upper:n,lowerOpen:t,upperOpen:r}}function Xt(e){return{type:1,lower:e,upper:e}}var Ht=(Object.defineProperty($.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),$.prototype.between=function(e,n,t,r){t=t!==!1,r=r===!0;try{return 0<this._cmp(e,n)||this._cmp(e,n)===0&&(t||r)&&(!t||!r)?Ve(this):new this.Collection(this,function(){return ve(e,n,!t,!r)})}catch{return te(this,ce)}},$.prototype.equals=function(e){return e==null?te(this,ce):new this.Collection(this,function(){return Xt(e)})},$.prototype.above=function(e){return e==null?te(this,ce):new this.Collection(this,function(){return ve(e,void 0,!0)})},$.prototype.aboveOrEqual=function(e){return e==null?te(this,ce):new this.Collection(this,function(){return ve(e,void 0,!1)})},$.prototype.below=function(e){return e==null?te(this,ce):new this.Collection(this,function(){return ve(void 0,e,!1,!0)})},$.prototype.belowOrEqual=function(e){return e==null?te(this,ce):new this.Collection(this,function(){return ve(void 0,e)})},$.prototype.startsWith=function(e){return typeof e!="string"?te(this,Nt):this.between(e,e+Ke,!0,!0)},$.prototype.startsWithIgnoreCase=function(e){return e===""?this.startsWith(e):En(this,function(n,t){return n.indexOf(t[0])===0},[e],Ke)},$.prototype.equalsIgnoreCase=function(e){return En(this,function(n,t){return n===t[0]},[e],"")},$.prototype.anyOfIgnoreCase=function(){var e=se.apply(De,arguments);return e.length===0?Ve(this):En(this,function(n,t){return t.indexOf(n)!==-1},e,"")},$.prototype.startsWithAnyOfIgnoreCase=function(){var e=se.apply(De,arguments);return e.length===0?Ve(this):En(this,function(n,t){return t.some(function(r){return n.indexOf(r)===0})},e,Ke)},$.prototype.anyOf=function(){var e=this,n=se.apply(De,arguments),t=this._cmp;try{n.sort(t)}catch{return te(this,ce)}if(n.length===0)return Ve(this);var r=new this.Collection(this,function(){return ve(n[0],n[n.length-1])});r._ondirectionchange=function(o){t=o==="next"?e._ascending:e._descending,n.sort(t)};var i=0;return r._addAlgorithm(function(o,a,u){for(var c=o.key;0<t(c,n[i]);)if(++i===n.length)return a(u),!1;return t(c,n[i])===0||(a(function(){o.continue(n[i])}),!1)}),r},$.prototype.notEqual=function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},$.prototype.noneOf=function(){var e=se.apply(De,arguments);if(e.length===0)return new this.Collection(this);try{e.sort(this._ascending)}catch{return te(this,ce)}var n=e.reduce(function(t,r){return t?t.concat([[t[t.length-1][1],r]]):[[-1/0,r]]},null);return n.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(n,{includeLowers:!1,includeUppers:!1})},$.prototype.inAnyRange=function(m,n){var t=this,r=this._cmp,i=this._ascending,o=this._descending,a=this._min,u=this._max;if(m.length===0)return Ve(this);if(!m.every(function(g){return g[0]!==void 0&&g[1]!==void 0&&i(g[0],g[1])<=0}))return te(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",A.InvalidArgument);var c=!n||n.includeLowers!==!1,f=n&&n.includeUppers===!0,d,s=i;function v(g,b){return s(g[0],b[0])}try{(d=m.reduce(function(g,b){for(var w=0,_=g.length;w<_;++w){var O=g[w];if(r(b[0],O[1])<0&&0<r(b[1],O[0])){O[0]=a(O[0],b[0]),O[1]=u(O[1],b[1]);break}}return w===_&&g.push(b),g},[])).sort(v)}catch{return te(this,ce)}var l=0,h=f?function(g){return 0<i(g,d[l][1])}:function(g){return 0<=i(g,d[l][1])},y=c?function(g){return 0<o(g,d[l][0])}:function(g){return 0<=o(g,d[l][0])},p=h,m=new this.Collection(this,function(){return ve(d[0][0],d[d.length-1][1],!c,!f)});return m._ondirectionchange=function(g){s=g==="next"?(p=h,i):(p=y,o),d.sort(v)},m._addAlgorithm(function(g,b,w){for(var _,O=g.key;p(O);)if(++l===d.length)return b(w),!1;return!h(_=O)&&!y(_)||(t._cmp(O,d[l][1])===0||t._cmp(O,d[l][0])===0||b(function(){s===i?g.continue(d[l][0]):g.continue(d[l][1])}),!1)}),m},$.prototype.startsWithAnyOf=function(){var e=se.apply(De,arguments);return e.every(function(n){return typeof n=="string"})?e.length===0?Ve(this):this.inAnyRange(e.map(function(n){return[n,n+Ke]})):te(this,"startsWithAnyOf() only works with strings")},$);function $(){}function oe(e){return N(function(n){return tn(n),e(n.target.error),!1})}function tn(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var rn="storagemutated",rt="x-storagemutated-1",me=Ze(null,rn),Rr=(ae.prototype._lock=function(){return Ye(!j.global),++this._reculock,this._reculock!==1||j.global||(j.lockOwnerFor=this),this},ae.prototype._unlock=function(){if(Ye(!j.global),--this._reculock==0)for(j.global||(j.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var e=this._blockedFuncs.shift();try{Ee(e[1],e[0])}catch{}}return this},ae.prototype._locked=function(){return this._reculock&&j.lockOwnerFor!==this},ae.prototype.create=function(e){var n=this;if(!this.mode)return this;var t=this.db.idbdb,r=this.db._state.dbOpenError;if(Ye(!this.idbtrans),!e&&!t)switch(r&&r.name){case"DatabaseClosedError":throw new A.DatabaseClosed(r);case"MissingAPIError":throw new A.MissingAPI(r.message,r);default:throw new A.OpenFailed(r)}if(!this.active)throw new A.TransactionInactive;return Ye(this._completion._state===null),(e=this.idbtrans=e||(this.db.core||t).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=N(function(i){tn(i),n._reject(e.error)}),e.onabort=N(function(i){tn(i),n.active&&n._reject(new A.Abort(e.error)),n.active=!1,n.on("abort").fire(i)}),e.oncomplete=N(function(){n.active=!1,n._resolve(),"mutatedParts"in e&&me.storagemutated.fire(e.mutatedParts)}),this},ae.prototype._promise=function(e,n,t){var r=this;if(e==="readwrite"&&this.mode!=="readwrite")return V(new A.ReadOnly("Transaction is readonly"));if(!this.active)return V(new A.TransactionInactive);if(this._locked())return new K(function(o,a){r._blockedFuncs.push([function(){r._promise(e,n,t).then(o,a)},j])});if(t)return de(function(){var o=new K(function(a,u){r._lock();var c=n(a,u,r);c&&c.then&&c.then(a,u)});return o.finally(function(){return r._unlock()}),o._lib=!0,o});var i=new K(function(o,a){var u=n(o,a,r);u&&u.then&&u.then(o,a)});return i._lib=!0,i},ae.prototype._root=function(){return this.parent?this.parent._root():this},ae.prototype.waitFor=function(e){var n,t=this._root(),r=K.resolve(e);t._waitingFor?t._waitingFor=t._waitingFor.then(function(){return r}):(t._waitingFor=r,t._waitingQueue=[],n=t.idbtrans.objectStore(t.storeNames[0]),function o(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(n.get(-1/0).onsuccess=o)}());var i=t._waitingFor;return new K(function(o,a){r.then(function(u){return t._waitingQueue.push(N(o.bind(null,u)))},function(u){return t._waitingQueue.push(N(a.bind(null,u)))}).finally(function(){t._waitingFor===i&&(t._waitingFor=null)})})},ae.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new A.Abort))},ae.prototype.table=function(e){var n=this._memoizedTables||(this._memoizedTables={});if(Z(n,e))return n[e];var t=this.schema[e];if(!t)throw new A.NotFound("Table "+e+" not part of transaction");return t=new this.db.Table(e,t,this),t.core=this.db.core.table(e),n[e]=t},ae);function ae(){}function it(e,n,t,r,i,o,a,u){return{name:e,keyPath:n,unique:t,multi:r,auto:i,compound:o,src:(t&&!a?"&":"")+(r?"*":"")+(i?"++":"")+Jt(n),type:u}}function Jt(e){return typeof e=="string"?e:e?"["+[].join.call(e,"+")+"]":""}function ot(e,n,t){return{name:e,primKey:n,indexes:t,mappedClass:null,idxByName:(r=function(i){return[i.name,i]},t.reduce(function(i,o,a){return a=r(o,a),a&&(i[a[0]]=a[1]),i},{}))};var r}var on=function(e){try{return e.only([[]]),on=function(){return[[]]},[[]]}catch{return on=function(){return Ke},Ke}};function at(e){return e==null?function(){}:typeof e=="string"?(n=e).split(".").length===1?function(t){return t[n]}:function(t){return ue(t,n)}:function(t){return ue(t,e)};var n}function Zt(e){return[].slice.call(e)}var Fr=0;function an(e){return e==null?":id":typeof e=="string"?e:"[".concat(e.join("+"),"]")}function Mr(e,n,c){function r(p){if(p.type===3)return null;if(p.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var l=p.lower,h=p.upper,y=p.lowerOpen,p=p.upperOpen;return l===void 0?h===void 0?null:n.upperBound(h,!!p):h===void 0?n.lowerBound(l,!!y):n.bound(l,h,!!y,!!p)}function i(v){var l,h=v.name;return{name:h,schema:v,mutate:function(y){var p=y.trans,m=y.type,g=y.keys,b=y.values,w=y.range;return new Promise(function(_,O){_=N(_);var x=p.objectStore(h),k=x.keyPath==null,E=m==="put"||m==="add";if(!E&&m!=="delete"&&m!=="deleteRange")throw new Error("Invalid operation type: "+m);var P,S=(g||b||{length:1}).length;if(g&&b&&g.length!==b.length)throw new Error("Given keys array must have same length as given values array.");if(S===0)return _({numFailures:0,failures:{},results:[],lastResult:void 0});function I(J){++U,tn(J)}var B=[],q=[],U=0;if(m==="deleteRange"){if(w.type===4)return _({numFailures:U,failures:q,results:[],lastResult:void 0});w.type===3?B.push(P=x.clear()):B.push(P=x.delete(r(w)))}else{var k=E?k?[b,g]:[b,null]:[g,null],T=k[0],X=k[1];if(E)for(var H=0;H<S;++H)B.push(P=X&&X[H]!==void 0?x[m](T[H],X[H]):x[m](T[H])),P.onerror=I;else for(H=0;H<S;++H)B.push(P=x[m](T[H])),P.onerror=I}function Fn(J){J=J.target.result,B.forEach(function(Ce,Ot){return Ce.error!=null&&(q[Ot]=Ce.error)}),_({numFailures:U,failures:q,results:m==="delete"?g:B.map(function(Ce){return Ce.result}),lastResult:J})}P.onerror=function(J){I(J),Fn(J)},P.onsuccess=Fn})},getMany:function(y){var p=y.trans,m=y.keys;return new Promise(function(g,b){g=N(g);for(var w,_=p.objectStore(h),O=m.length,x=new Array(O),k=0,E=0,P=function(B){B=B.target,x[B._pos]=B.result,++E===k&&g(x)},S=oe(b),I=0;I<O;++I)m[I]!=null&&((w=_.get(m[I]))._pos=I,w.onsuccess=P,w.onerror=S,++k);k===0&&g(x)})},get:function(y){var p=y.trans,m=y.key;return new Promise(function(g,b){g=N(g);var w=p.objectStore(h).get(m);w.onsuccess=function(_){return g(_.target.result)},w.onerror=oe(b)})},query:(l=f,function(y){return new Promise(function(p,m){p=N(p);var g,b,w,k=y.trans,_=y.values,O=y.limit,P=y.query,x=O===1/0?void 0:O,E=P.index,P=P.range,k=k.objectStore(h),E=E.isPrimaryKey?k:k.index(E.name),P=r(P);if(O===0)return p({result:[]});l?((x=_?E.getAll(P,x):E.getAllKeys(P,x)).onsuccess=function(S){return p({result:S.target.result})},x.onerror=oe(m)):(g=0,b=!_&&"openKeyCursor"in E?E.openKeyCursor(P):E.openCursor(P),w=[],b.onsuccess=function(S){var I=b.result;return I?(w.push(_?I.value:I.primaryKey),++g===O?p({result:w}):void I.continue()):p({result:w})},b.onerror=oe(m))})}),openCursor:function(y){var p=y.trans,m=y.values,g=y.query,b=y.reverse,w=y.unique;return new Promise(function(_,O){_=N(_);var E=g.index,x=g.range,k=p.objectStore(h),k=E.isPrimaryKey?k:k.index(E.name),E=b?w?"prevunique":"prev":w?"nextunique":"next",P=!m&&"openKeyCursor"in k?k.openKeyCursor(r(x),E):k.openCursor(r(x),E);P.onerror=oe(O),P.onsuccess=N(function(S){var I,B,q,U,T=P.result;T?(T.___id=++Fr,T.done=!1,I=T.continue.bind(T),B=(B=T.continuePrimaryKey)&&B.bind(T),q=T.advance.bind(T),U=function(){throw new Error("Cursor not stopped")},T.trans=p,T.stop=T.continue=T.continuePrimaryKey=T.advance=function(){throw new Error("Cursor not started")},T.fail=N(O),T.next=function(){var X=this,H=1;return this.start(function(){return H--?X.continue():X.stop()}).then(function(){return X})},T.start=function(X){function H(){if(P.result)try{X()}catch(J){T.fail(J)}else T.done=!0,T.start=function(){throw new Error("Cursor behind last entry")},T.stop()}var Fn=new Promise(function(J,Ce){J=N(J),P.onerror=oe(Ce),T.fail=Ce,T.stop=function(Ot){T.stop=T.continue=T.continuePrimaryKey=T.advance=U,J(Ot)}});return P.onsuccess=N(function(J){P.onsuccess=H,H()}),T.continue=I,T.continuePrimaryKey=B,T.advance=q,H(),Fn},_(T)):_(null)},O)})},count:function(y){var p=y.query,m=y.trans,g=p.index,b=p.range;return new Promise(function(w,_){var O=m.objectStore(h),x=g.isPrimaryKey?O:O.index(g.name),O=r(b),x=O?x.count(O):x.count();x.onsuccess=N(function(k){return w(k.target.result)}),x.onerror=oe(_)})}}}var o,a,u,d=(a=c,u=Zt((o=e).objectStoreNames),{schema:{name:o.name,tables:u.map(function(v){return a.objectStore(v)}).map(function(v){var l=v.keyPath,p=v.autoIncrement,h=L(l),y={},p={name:v.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:l==null,compound:h,keyPath:l,autoIncrement:p,unique:!0,extractKey:at(l)},indexes:Zt(v.indexNames).map(function(m){return v.index(m)}).map(function(w){var g=w.name,b=w.unique,_=w.multiEntry,w=w.keyPath,_={name:g,compound:L(w),keyPath:w,unique:b,multiEntry:_,extractKey:at(w)};return y[an(w)]=_}),getIndexByKeyPath:function(m){return y[an(m)]}};return y[":id"]=p.primaryKey,l!=null&&(y[an(l)]=p.primaryKey),p})},hasGetAll:0<u.length&&"getAll"in a.objectStore(u[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),c=d.schema,f=d.hasGetAll,d=c.tables.map(i),s={};return d.forEach(function(v){return s[v.name]=v}),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(v){if(!s[v])throw new Error("Table '".concat(v,"' not found"));return s[v]},MIN_KEY:-1/0,MAX_KEY:on(n),schema:c}}function Nr(e,n,t,r){var i=t.IDBKeyRange;return t.indexedDB,{dbcore:(r=Mr(n,i,r),e.dbcore.reduce(function(o,a){return a=a.create,C(C({},o),a(o))},r))}}function Kn(e,r){var t=r.db,r=Nr(e._middlewares,t,e._deps,r);e.core=r.dbcore,e.tables.forEach(function(i){var o=i.name;e.core.schema.tables.some(function(a){return a.name===o})&&(i.core=e.core.table(o),e[o]instanceof e.Table&&(e[o].core=i.core))})}function Sn(e,n,t,r){t.forEach(function(i){var o=r[i];n.forEach(function(a){var u=function c(f,d){return mr(f,d)||(f=Te(f))&&c(f,d)}(a,i);(!u||"value"in u&&u.value===void 0)&&(a===e.Transaction.prototype||a instanceof e.Transaction?fe(a,i,{get:function(){return this.table(i)},set:function(c){Et(this,i,{value:c,writable:!0,configurable:!0,enumerable:!0})}}):a[i]=new e.Table(i,o))})})}function ut(e,n){n.forEach(function(t){for(var r in t)t[r]instanceof e.Table&&delete t[r]})}function Lr(e,n){return e._cfg.version-n._cfg.version}function Ur(e,n,t,r){var i=e._dbSchema;t.objectStoreNames.contains("$meta")&&!i.$meta&&(i.$meta=ot("$meta",nr("")[0],[]),e._storeNames.push("$meta"));var o=e._createTransaction("readwrite",e._storeNames,i);o.create(t),o._completion.catch(r);var a=o._reject.bind(o),u=j.transless||j;de(function(){return j.trans=o,j.transless=u,n!==0?(Kn(e,t),f=n,((c=o).storeNames.includes("$meta")?c.table("$meta").get("version").then(function(d){return d??f}):K.resolve(f)).then(function(d){return v=d,l=o,h=t,y=[],d=(s=e)._versions,p=s._dbSchema=An(0,s.idbdb,h),(d=d.filter(function(m){return m._cfg.version>=v})).length!==0?(d.forEach(function(m){y.push(function(){var g=p,b=m._cfg.dbschema;Cn(s,g,h),Cn(s,b,h),p=s._dbSchema=b;var w=st(g,b);w.add.forEach(function(E){ct(h,E[0],E[1].primKey,E[1].indexes)}),w.change.forEach(function(E){if(E.recreate)throw new A.Upgrade("Not yet support for changing primary key");var P=h.objectStore(E.name);E.add.forEach(function(S){return jn(P,S)}),E.change.forEach(function(S){P.deleteIndex(S.name),jn(P,S)}),E.del.forEach(function(S){return P.deleteIndex(S)})});var _=m._cfg.contentUpgrade;if(_&&m._cfg.version>v){Kn(s,h),l._memoizedTables={};var O=jt(b);w.del.forEach(function(E){O[E]=g[E]}),ut(s,[s.Transaction.prototype]),Sn(s,[s.Transaction.prototype],W(O),O),l.schema=O;var x,k=Un(_);return k&&Ne(),w=K.follow(function(){var E;(x=_(l))&&k&&(E=pe.bind(null,null),x.then(E,E))}),x&&typeof x.then=="function"?K.resolve(x):w.then(function(){return x})}}),y.push(function(g){var b,w,_=m._cfg.dbschema;b=_,w=g,[].slice.call(w.db.objectStoreNames).forEach(function(O){return b[O]==null&&w.db.deleteObjectStore(O)}),ut(s,[s.Transaction.prototype]),Sn(s,[s.Transaction.prototype],s._storeNames,s._dbSchema),l.schema=s._dbSchema}),y.push(function(g){s.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(s.idbdb.version/10)===m._cfg.version?(s.idbdb.deleteObjectStore("$meta"),delete s._dbSchema.$meta,s._storeNames=s._storeNames.filter(function(b){return b!=="$meta"})):g.objectStore("$meta").put(m._cfg.version,"version"))})}),function m(){return y.length?K.resolve(y.shift()(l.idbtrans)).then(m):K.resolve()}().then(function(){er(p,h)})):K.resolve();var s,v,l,h,y,p}).catch(a)):(W(i).forEach(function(d){ct(t,d,i[d].primKey,i[d].indexes)}),Kn(e,t),void K.follow(function(){return e.on.populate.fire(o)}).catch(a));var c,f})}function Vr(e,n){er(e._dbSchema,n),n.db.version%10!=0||n.objectStoreNames.contains("$meta")||n.db.createObjectStore("$meta").add(Math.ceil(n.db.version/10-1),"version");var t=An(0,e.idbdb,n);Cn(e,e._dbSchema,n);for(var r=0,i=st(t,e._dbSchema).change;r<i.length;r++){var o=function(a){if(a.change.length||a.recreate)return console.warn("Unable to patch indexes of table ".concat(a.name," because it has changes on the type of index or primary key.")),{value:void 0};var u=n.objectStore(a.name);a.add.forEach(function(c){ie&&console.debug("Dexie upgrade patch: Creating missing index ".concat(a.name,".").concat(c.src)),jn(u,c)})}(i[r]);if(typeof o=="object")return o.value}}function st(e,n){var t,r={del:[],add:[],change:[]};for(t in e)n[t]||r.del.push(t);for(t in n){var i=e[t],o=n[t];if(i){var a={name:t,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(o.primKey.keyPath||"")||i.primKey.auto!==o.primKey.auto)a.recreate=!0,r.change.push(a);else{var u=i.idxByName,c=o.idxByName,f=void 0;for(f in u)c[f]||a.del.push(f);for(f in c){var d=u[f],s=c[f];d?d.src!==s.src&&a.change.push(s):a.add.push(s)}(0<a.del.length||0<a.add.length||0<a.change.length)&&r.change.push(a)}}else r.add.push([t,o])}return r}function ct(e,n,t,r){var i=e.db.createObjectStore(n,t.keyPath?{keyPath:t.keyPath,autoIncrement:t.auto}:{autoIncrement:t.auto});return r.forEach(function(o){return jn(i,o)}),i}function er(e,n){W(e).forEach(function(t){n.db.objectStoreNames.contains(t)||(ie&&console.debug("Dexie: Creating missing table",t),ct(n,t,e[t].primKey,e[t].indexes))})}function jn(e,n){e.createIndex(n.name,n.keyPath,{unique:n.unique,multiEntry:n.multi})}function An(e,n,t){var r={};return ln(n.objectStoreNames,0).forEach(function(i){for(var o=t.objectStore(i),a=it(Jt(f=o.keyPath),f||"",!0,!1,!!o.autoIncrement,f&&typeof f!="string",!0),u=[],c=0;c<o.indexNames.length;++c){var d=o.index(o.indexNames[c]),f=d.keyPath,d=it(d.name,f,!!d.unique,!!d.multiEntry,!1,f&&typeof f!="string",!1);u.push(d)}r[i]=ot(i,a,u)}),r}function Cn(e,n,t){for(var r=t.db.objectStoreNames,i=0;i<r.length;++i){var o=r[i],a=t.objectStore(o);e._hasGetAll="getAll"in a;for(var u=0;u<a.indexNames.length;++u){var c=a.indexNames[u],f=a.index(c).keyPath,d=typeof f=="string"?f:"["+ln(f).join("+")+"]";!n[o]||(f=n[o].idxByName[d])&&(f.name=c,delete n[o].idxByName[d],n[o].idxByName[c]=f)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&G.WorkerGlobalScope&&G instanceof G.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function nr(e){return e.split(",").map(function(n,t){var o=n.split(":"),r=(i=o[1])===null||i===void 0?void 0:i.trim(),i=(n=o[0].trim()).replace(/([&*]|\+\+)/g,""),o=/^\[/.test(i)?i.match(/^\[(.*)\]$/)[1].split("+"):i;return it(i,o||null,/\&/.test(n),/\*/.test(n),/\+\+/.test(n),L(o),t===0,r)})}var zr=(ze.prototype._createTableSchema=ot,ze.prototype._parseIndexSyntax=nr,ze.prototype._parseStoresSpec=function(e,n){var t=this;W(e).forEach(function(r){if(e[r]!==null){var i=t._parseIndexSyntax(e[r]),o=i.shift();if(!o)throw new A.Schema("Invalid schema for table "+r+": "+e[r]);if(o.unique=!0,o.multi)throw new A.Schema("Primary key cannot be multiEntry*");i.forEach(function(a){if(a.auto)throw new A.Schema("Only primary key can be marked as autoIncrement (++)");if(!a.keyPath)throw new A.Schema("Index must have a name and cannot be an empty string")}),i=t._createTableSchema(r,o,i),n[r]=i}})},ze.prototype.stores=function(t){var n=this.db;this._cfg.storesSource=this._cfg.storesSource?ee(this._cfg.storesSource,t):t;var t=n._versions,r={},i={};return t.forEach(function(o){ee(r,o._cfg.storesSource),i=o._cfg.dbschema={},o._parseStoresSpec(r,i)}),n._dbSchema=i,ut(n,[n._allTables,n,n.Transaction.prototype]),Sn(n,[n._allTables,n,n.Transaction.prototype,this._cfg.tables],W(i),i),n._storeNames=W(i),this},ze.prototype.upgrade=function(e){return this._cfg.contentUpgrade=zn(this._cfg.contentUpgrade||F,e),this},ze);function ze(){}function lt(e,n){var t=e._dbNamesDB;return t||(t=e._dbNamesDB=new le(_n,{addons:[],indexedDB:e,IDBKeyRange:n})).version(1).stores({dbnames:"name"}),t.table("dbnames")}function ft(e){return e&&typeof e.databases=="function"}function ht(e){return de(function(){return j.letThrough=!0,e()})}function dt(e){return!("from"in e)}var Q=function(e,n){if(!this){var t=new Q;return e&&"d"in e&&ee(t,e),t}ee(this,arguments.length?{d:1,from:e,to:1<arguments.length?n:e}:{d:0})};function un(e,n,t){var r=D(n,t);if(!isNaN(r)){if(0<r)throw RangeError();if(dt(e))return ee(e,{from:n,to:t,d:1});var i=e.l,r=e.r;if(D(t,e.from)<0)return i?un(i,n,t):e.l={from:n,to:t,d:1,l:null,r:null},rr(e);if(0<D(n,e.to))return r?un(r,n,t):e.r={from:n,to:t,d:1,l:null,r:null},rr(e);D(n,e.from)<0&&(e.from=n,e.l=null,e.d=r?r.d+1:1),0<D(t,e.to)&&(e.to=t,e.r=null,e.d=e.l?e.l.d+1:1),t=!e.r,i&&!e.l&&sn(e,i),r&&t&&sn(e,r)}}function sn(e,n){dt(n)||function t(r,c){var o=c.from,a=c.to,u=c.l,c=c.r;un(r,o,a),u&&t(r,u),c&&t(r,c)}(e,n)}function tr(e,n){var t=Tn(n),r=t.next();if(r.done)return!1;for(var i=r.value,o=Tn(e),a=o.next(i.from),u=a.value;!r.done&&!a.done;){if(D(u.from,i.to)<=0&&0<=D(u.to,i.from))return!0;D(i.from,u.from)<0?i=(r=t.next(u.from)).value:u=(a=o.next(i.from)).value}return!1}function Tn(e){var n=dt(e)?null:{s:0,n:e};return{next:function(t){for(var r=0<arguments.length;n;)switch(n.s){case 0:if(n.s=1,r)for(;n.n.l&&D(t,n.n.from)<0;)n={up:n,n:n.n.l,s:1};else for(;n.n.l;)n={up:n,n:n.n.l,s:1};case 1:if(n.s=2,!r||D(t,n.n.to)<=0)return{value:n.n,done:!1};case 2:if(n.n.r){n.s=3,n={up:n,n:n.n.r,s:0};continue}case 3:n=n.up}return{done:!0}}}}function rr(e){var n,t,r=(((n=e.r)===null||n===void 0?void 0:n.d)||0)-(((t=e.l)===null||t===void 0?void 0:t.d)||0),i=1<r?"r":r<-1?"l":"";i&&(n=i=="r"?"l":"r",t=C({},e),r=e[i],e.from=r.from,e.to=r.to,e[i]=r[i],t[i]=r[n],(e[n]=t).d=ir(t)),e.d=ir(e)}function ir(t){var n=t.r,t=t.l;return(n?t?Math.max(n.d,t.d):n.d:t?t.d:0)+1}function qn(e,n){return W(n).forEach(function(t){e[t]?sn(e[t],n[t]):e[t]=function r(i){var o,a,u={};for(o in i)Z(i,o)&&(a=i[o],u[o]=!a||typeof a!="object"||Ct.has(a.constructor)?a:r(a));return u}(n[t])}),e}function pt(e,n){return e.all||n.all||Object.keys(e).some(function(t){return n[t]&&tr(n[t],e[t])})}qe(Q.prototype,((re={add:function(e){return sn(this,e),this},addKey:function(e){return un(this,e,e),this},addKeys:function(e){var n=this;return e.forEach(function(t){return un(n,t,t)}),this},hasKey:function(e){var n=Tn(this).next(e).value;return n&&D(n.from,e)<=0&&0<=D(n.to,e)}})[Ln]=function(){return Tn(this)},re));var je={},yt={},vt=!1;function In(e){qn(yt,e),vt||(vt=!0,setTimeout(function(){vt=!1,mt(yt,!(yt={}))},0))}function mt(e,n){n===void 0&&(n=!1);var t=new Set;if(e.all)for(var r=0,i=Object.values(je);r<i.length;r++)or(a=i[r],e,t,n);else for(var o in e){var a,u=/^idb\:\/\/(.*)\/(.*)\//.exec(o);u&&(o=u[1],u=u[2],(a=je["idb://".concat(o,"/").concat(u)])&&or(a,e,t,n))}t.forEach(function(c){return c()})}function or(e,n,t,r){for(var i=[],o=0,a=Object.entries(e.queries.query);o<a.length;o++){for(var u=a[o],c=u[0],f=[],d=0,s=u[1];d<s.length;d++){var v=s[d];pt(n,v.obsSet)?v.subscribers.forEach(function(p){return t.add(p)}):r&&f.push(v)}r&&i.push([c,f])}if(r)for(var l=0,h=i;l<h.length;l++){var y=h[l],c=y[0],f=y[1];e.queries.query[c]=f}}function Wr(e){var n=e._state,t=e._deps.indexedDB;if(n.isBeingOpened||e.idbdb)return n.dbReadyPromise.then(function(){return n.dbOpenError?V(n.dbOpenError):e});n.isBeingOpened=!0,n.dbOpenError=null,n.openComplete=!1;var r=n.openCanceller,i=Math.round(10*e.verno),o=!1;function a(){if(n.openCanceller!==r)throw new A.DatabaseClosed("db.open() was cancelled")}function u(){return new K(function(v,l){if(a(),!t)throw new A.MissingAPI;var h=e.name,y=n.autoSchema||!i?t.open(h):t.open(h,i);if(!y)throw new A.MissingAPI;y.onerror=oe(l),y.onblocked=N(e._fireOnBlocked),y.onupgradeneeded=N(function(p){var m;d=y.transaction,n.autoSchema&&!e._options.allowEmptyDB?(y.onerror=tn,d.abort(),y.result.close(),(m=t.deleteDatabase(h)).onsuccess=m.onerror=N(function(){l(new A.NoSuchDatabase("Database ".concat(h," doesnt exist")))})):(d.onerror=oe(l),p=p.oldVersion>Math.pow(2,62)?0:p.oldVersion,s=p<1,e.idbdb=y.result,o&&Vr(e,d),Ur(e,p/10,d,l))},l),y.onsuccess=N(function(){d=null;var p,m,g,b,w,_=e.idbdb=y.result,O=ln(_.objectStoreNames);if(0<O.length)try{var x=_.transaction((b=O).length===1?b[0]:b,"readonly");if(n.autoSchema)m=_,g=x,(p=e).verno=m.version/10,g=p._dbSchema=An(0,m,g),p._storeNames=ln(m.objectStoreNames,0),Sn(p,[p._allTables],W(g),g);else if(Cn(e,e._dbSchema,x),((w=st(An(0,(w=e).idbdb,x),w._dbSchema)).add.length||w.change.some(function(k){return k.add.length||k.change.length}))&&!o)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),_.close(),i=_.version+1,o=!0,v(u());Kn(e,x)}catch{}Le.push(e),_.onversionchange=N(function(k){n.vcFired=!0,e.on("versionchange").fire(k)}),_.onclose=N(function(k){e.on("close").fire(k)}),s&&(w=e._deps,x=h,_=w.indexedDB,w=w.IDBKeyRange,ft(_)||x===_n||lt(_,w).put({name:x}).catch(F)),v()},l)}).catch(function(v){switch(v==null?void 0:v.name){case"UnknownError":if(0<n.PR1398_maxLoop)return n.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),u();break;case"VersionError":if(0<i)return i=0,u()}return K.reject(v)})}var c,f=n.dbReadyResolve,d=null,s=!1;return K.race([r,(typeof navigator>"u"?K.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(v){function l(){return indexedDB.databases().finally(v)}c=setInterval(l,100),l()}).finally(function(){return clearInterval(c)}):Promise.resolve()).then(u)]).then(function(){return a(),n.onReadyBeingFired=[],K.resolve(ht(function(){return e.on.ready.fire(e.vip)})).then(function v(){if(0<n.onReadyBeingFired.length){var l=n.onReadyBeingFired.reduce(zn,F);return n.onReadyBeingFired=[],K.resolve(ht(function(){return l(e.vip)})).then(v)}})}).finally(function(){n.openCanceller===r&&(n.onReadyBeingFired=null,n.isBeingOpened=!1)}).catch(function(v){n.dbOpenError=v;try{d&&d.abort()}catch{}return r===n.openCanceller&&e._close(),V(v)}).finally(function(){n.openComplete=!0,f()}).then(function(){var v;return s&&(v={},e.tables.forEach(function(l){l.schema.indexes.forEach(function(h){h.name&&(v["idb://".concat(e.name,"/").concat(l.name,"/").concat(h.name)]=new Q(-1/0,[[[]]]))}),v["idb://".concat(e.name,"/").concat(l.name,"/")]=v["idb://".concat(e.name,"/").concat(l.name,"/:dels")]=new Q(-1/0,[[[]]])}),me(rn).fire(v),mt(v,!0)),e})}function gt(e){function n(o){return e.next(o)}var t=i(n),r=i(function(o){return e.throw(o)});function i(o){return function(c){var u=o(c),c=u.value;return u.done?c:c&&typeof c.then=="function"?c.then(t,r):L(c)?Promise.all(c).then(t,r):t(c)}}return i(n)()}function Dn(e,n,t){for(var r=L(e)?e.slice():[e],i=0;i<t;++i)r.push(n);return r}var Yr={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return C(C({},e),{table:function(n){var t=e.table(n),r=t.schema,i={},o=[];function a(s,v,l){var h=an(s),y=i[h]=i[h]||[],p=s==null?0:typeof s=="string"?1:s.length,m=0<v,m=C(C({},l),{name:m?"".concat(h,"(virtual-from:").concat(l.name,")"):l.name,lowLevelIndex:l,isVirtual:m,keyTail:v,keyLength:p,extractKey:at(s),unique:!m&&l.unique});return y.push(m),m.isPrimaryKey||o.push(m),1<p&&a(p===2?s[0]:s.slice(0,p-1),v+1,l),y.sort(function(g,b){return g.keyTail-b.keyTail}),m}n=a(r.primaryKey.keyPath,0,r.primaryKey),i[":id"]=[n];for(var u=0,c=r.indexes;u<c.length;u++){var f=c[u];a(f.keyPath,0,f)}function d(s){var v,l=s.query.index;return l.isVirtual?C(C({},s),{query:{index:l.lowLevelIndex,range:(v=s.query.range,l=l.keyTail,{type:v.type===1?2:v.type,lower:Dn(v.lower,v.lowerOpen?e.MAX_KEY:e.MIN_KEY,l),lowerOpen:!0,upper:Dn(v.upper,v.upperOpen?e.MIN_KEY:e.MAX_KEY,l),upperOpen:!0})}}):s}return C(C({},t),{schema:C(C({},r),{primaryKey:n,indexes:o,getIndexByKeyPath:function(s){return(s=i[an(s)])&&s[0]}}),count:function(s){return t.count(d(s))},query:function(s){return t.query(d(s))},openCursor:function(s){var v=s.query.index,l=v.keyTail,h=v.isVirtual,y=v.keyLength;return h?t.openCursor(d(s)).then(function(m){return m&&p(m)}):t.openCursor(s);function p(m){return Object.create(m,{continue:{value:function(g){g!=null?m.continue(Dn(g,s.reverse?e.MAX_KEY:e.MIN_KEY,l)):s.unique?m.continue(m.key.slice(0,y).concat(s.reverse?e.MIN_KEY:e.MAX_KEY,l)):m.continue()}},continuePrimaryKey:{value:function(g,b){m.continuePrimaryKey(Dn(g,e.MAX_KEY,l),b)}},primaryKey:{get:function(){return m.primaryKey}},key:{get:function(){var g=m.key;return y===1?g[0]:g.slice(0,y)}},value:{get:function(){return m.value}}})}}})}})}};function bt(e,n,t,r){return t=t||{},r=r||"",W(e).forEach(function(i){var o,a,u;Z(n,i)?(o=e[i],a=n[i],typeof o=="object"&&typeof a=="object"&&o&&a?(u=Nn(o))!==Nn(a)?t[r+i]=n[i]:u==="Object"?bt(o,a,t,r+i+"."):o!==a&&(t[r+i]=n[i]):o!==a&&(t[r+i]=n[i])):t[r+i]=void 0}),W(n).forEach(function(i){Z(e,i)||(t[r+i]=n[i])}),t}function wt(e,n){return n.type==="delete"?n.keys:n.keys||n.values.map(e.extractKey)}var $r={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return C(C({},e),{table:function(n){var t=e.table(n),r=t.schema.primaryKey;return C(C({},t),{mutate:function(i){var o=j.trans,a=o.table(n).hook,u=a.deleting,c=a.creating,f=a.updating;switch(i.type){case"add":if(c.fire===F)break;return o._promise("readwrite",function(){return d(i)},!0);case"put":if(c.fire===F&&f.fire===F)break;return o._promise("readwrite",function(){return d(i)},!0);case"delete":if(u.fire===F)break;return o._promise("readwrite",function(){return d(i)},!0);case"deleteRange":if(u.fire===F)break;return o._promise("readwrite",function(){return function s(v,l,h){return t.query({trans:v,values:!1,query:{index:r,range:l},limit:h}).then(function(y){var p=y.result;return d({type:"delete",keys:p,trans:v}).then(function(m){return 0<m.numFailures?Promise.reject(m.failures[0]):p.length<h?{failures:[],numFailures:0,lastResult:void 0}:s(v,C(C({},l),{lower:p[p.length-1],lowerOpen:!0}),h)})})}(i.trans,i.range,1e4)},!0)}return t.mutate(i);function d(s){var v,l,h,y=j.trans,p=s.keys||wt(r,s);if(!p)throw new Error("Keys missing");return(s=s.type==="add"||s.type==="put"?C(C({},s),{keys:p}):C({},s)).type!=="delete"&&(s.values=cn([],s.values)),s.keys&&(s.keys=cn([],s.keys)),v=t,h=p,((l=s).type==="add"?Promise.resolve([]):v.getMany({trans:l.trans,keys:h,cache:"immutable"})).then(function(m){var g=p.map(function(b,w){var _,O,x,k=m[w],E={onerror:null,onsuccess:null};return s.type==="delete"?u.fire.call(E,b,k,y):s.type==="add"||k===void 0?(_=c.fire.call(E,b,s.values[w],y),b==null&&_!=null&&(s.keys[w]=b=_,r.outbound||ne(s.values[w],r.keyPath,b))):(_=bt(k,s.values[w]),(O=f.fire.call(E,_,b,k,y))&&(x=s.values[w],Object.keys(O).forEach(function(P){Z(x,P)?x[P]=O[P]:ne(x,P,O[P])}))),E});return t.mutate(s).then(function(b){for(var w=b.failures,_=b.results,O=b.numFailures,b=b.lastResult,x=0;x<p.length;++x){var k=(_||p)[x],E=g[x];k==null?E.onerror&&E.onerror(w[x]):E.onsuccess&&E.onsuccess(s.type==="put"&&m[x]?s.values[x]:k)}return{failures:w,results:_,numFailures:O,lastResult:b}}).catch(function(b){return g.forEach(function(w){return w.onerror&&w.onerror(b)}),Promise.reject(b)})})}}})}})}};function ar(e,n,t){try{if(!n||n.keys.length<e.length)return null;for(var r=[],i=0,o=0;i<n.keys.length&&o<e.length;++i)D(n.keys[i],e[o])===0&&(r.push(t?be(n.values[i]):n.values[i]),++o);return r.length===e.length?r:null}catch{return null}}var Gr={stack:"dbcore",level:-1,create:function(e){return{table:function(n){var t=e.table(n);return C(C({},t),{getMany:function(r){if(!r.cache)return t.getMany(r);var i=ar(r.keys,r.trans._cache,r.cache==="clone");return i?K.resolve(i):t.getMany(r).then(function(o){return r.trans._cache={keys:r.keys,values:r.cache==="clone"?be(o):o},o})},mutate:function(r){return r.type!=="add"&&(r.trans._cache=null),t.mutate(r)}})}}}};function ur(e,n){return e.trans.mode==="readonly"&&!!e.subscr&&!e.trans.explicit&&e.trans.db._options.cache!=="disabled"&&!n.schema.primaryKey.outbound}function sr(e,n){switch(e){case"query":return n.values&&!n.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Qr={stack:"dbcore",level:0,name:"Observability",create:function(e){var n=e.schema.name,t=new Q(e.MIN_KEY,e.MAX_KEY);return C(C({},e),{transaction:function(r,i,o){if(j.subscr&&i!=="readonly")throw new A.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(j.querier));return e.transaction(r,i,o)},table:function(r){var i=e.table(r),o=i.schema,a=o.primaryKey,s=o.indexes,u=a.extractKey,c=a.outbound,f=a.autoIncrement&&s.filter(function(l){return l.compound&&l.keyPath.includes(a.keyPath)}),d=C(C({},i),{mutate:function(l){function h(P){return P="idb://".concat(n,"/").concat(r,"/").concat(P),b[P]||(b[P]=new Q)}var y,p,m,g=l.trans,b=l.mutatedParts||(l.mutatedParts={}),w=h(""),_=h(":dels"),O=l.type,E=l.type==="deleteRange"?[l.range]:l.type==="delete"?[l.keys]:l.values.length<50?[wt(a,l).filter(function(P){return P}),l.values]:[],x=E[0],k=E[1],E=l.trans._cache;return L(x)?(w.addKeys(x),(E=O==="delete"||x.length===k.length?ar(x,E):null)||_.addKeys(x),(E||k)&&(y=h,p=E,m=k,o.indexes.forEach(function(P){var S=y(P.name||"");function I(q){return q!=null?P.extractKey(q):null}function B(q){return P.multiEntry&&L(q)?q.forEach(function(U){return S.addKey(U)}):S.addKey(q)}(p||m).forEach(function(q,X){var T=p&&I(p[X]),X=m&&I(m[X]);D(T,X)!==0&&(T!=null&&B(T),X!=null&&B(X))})}))):x?(k={from:(k=x.lower)!==null&&k!==void 0?k:e.MIN_KEY,to:(k=x.upper)!==null&&k!==void 0?k:e.MAX_KEY},_.add(k),w.add(k)):(w.add(t),_.add(t),o.indexes.forEach(function(P){return h(P.name).add(t)})),i.mutate(l).then(function(P){return!x||l.type!=="add"&&l.type!=="put"||(w.addKeys(P.results),f&&f.forEach(function(S){for(var I=l.values.map(function(T){return S.extractKey(T)}),B=S.keyPath.findIndex(function(T){return T===a.keyPath}),q=0,U=P.results.length;q<U;++q)I[q][B]=P.results[q];h(S.name).addKeys(I)})),g.mutatedParts=qn(g.mutatedParts||{},b),P})}}),s=function(h){var y=h.query,h=y.index,y=y.range;return[h,new Q((h=y.lower)!==null&&h!==void 0?h:e.MIN_KEY,(y=y.upper)!==null&&y!==void 0?y:e.MAX_KEY)]},v={get:function(l){return[a,new Q(l.key)]},getMany:function(l){return[a,new Q().addKeys(l.keys)]},count:s,query:s,openCursor:s};return W(v).forEach(function(l){d[l]=function(h){var y=j.subscr,p=!!y,m=ur(j,i)&&sr(l,h)?h.obsSet={}:y;if(p){var g=function(k){return k="idb://".concat(n,"/").concat(r,"/").concat(k),m[k]||(m[k]=new Q)},b=g(""),w=g(":dels"),y=v[l](h),p=y[0],y=y[1];if((l==="query"&&p.isPrimaryKey&&!h.values?w:g(p.name||"")).add(y),!p.isPrimaryKey){if(l!=="count"){var _=l==="query"&&c&&h.values&&i.query(C(C({},h),{values:!1}));return i[l].apply(this,arguments).then(function(k){if(l==="query"){if(c&&h.values)return _.then(function(I){return I=I.result,b.addKeys(I),k});var E=h.values?k.result.map(u):k.result;(h.values?b:w).addKeys(E)}else if(l==="openCursor"){var P=k,S=h.values;return P&&Object.create(P,{key:{get:function(){return w.addKey(P.primaryKey),P.key}},primaryKey:{get:function(){var I=P.primaryKey;return w.addKey(I),I}},value:{get:function(){return S&&b.addKey(P.primaryKey),P.value}}})}return k})}w.add(t)}}return i[l].apply(this,arguments)}}),d}})}};function cr(e,n,t){if(t.numFailures===0)return n;if(n.type==="deleteRange")return null;var r=n.keys?n.keys.length:"values"in n&&n.values?n.values.length:1;return t.numFailures===r?null:(n=C({},n),L(n.keys)&&(n.keys=n.keys.filter(function(i,o){return!(o in t.failures)})),"values"in n&&L(n.values)&&(n.values=n.values.filter(function(i,o){return!(o in t.failures)})),n)}function _t(e,n){return t=e,((r=n).lower===void 0||(r.lowerOpen?0<D(t,r.lower):0<=D(t,r.lower)))&&(e=e,(n=n).upper===void 0||(n.upperOpen?D(e,n.upper)<0:D(e,n.upper)<=0));var t,r}function lr(e,n,v,r,i,o){if(!v||v.length===0)return e;var a=n.query.index,u=a.multiEntry,c=n.query.range,f=r.schema.primaryKey.extractKey,d=a.extractKey,s=(a.lowLevelIndex||a).extractKey,v=v.reduce(function(l,h){var y=l,p=[];if(h.type==="add"||h.type==="put")for(var m=new Q,g=h.values.length-1;0<=g;--g){var b,w=h.values[g],_=f(w);m.hasKey(_)||(b=d(w),(u&&L(b)?b.some(function(P){return _t(P,c)}):_t(b,c))&&(m.addKey(_),p.push(w)))}switch(h.type){case"add":var O=new Q().addKeys(n.values?l.map(function(S){return f(S)}):l),y=l.concat(n.values?p.filter(function(S){return S=f(S),!O.hasKey(S)&&(O.addKey(S),!0)}):p.map(function(S){return f(S)}).filter(function(S){return!O.hasKey(S)&&(O.addKey(S),!0)}));break;case"put":var x=new Q().addKeys(h.values.map(function(S){return f(S)}));y=l.filter(function(S){return!x.hasKey(n.values?f(S):S)}).concat(n.values?p:p.map(function(S){return f(S)}));break;case"delete":var k=new Q().addKeys(h.keys);y=l.filter(function(S){return!k.hasKey(n.values?f(S):S)});break;case"deleteRange":var E=h.range;y=l.filter(function(S){return!_t(f(S),E)})}return y},e);return v===e?e:(v.sort(function(l,h){return D(s(l),s(h))||D(f(l),f(h))}),n.limit&&n.limit<1/0&&(v.length>n.limit?v.length=n.limit:e.length===n.limit&&v.length<n.limit&&(i.dirty=!0)),o?Object.freeze(v):v)}function fr(e,n){return D(e.lower,n.lower)===0&&D(e.upper,n.upper)===0&&!!e.lowerOpen==!!n.lowerOpen&&!!e.upperOpen==!!n.upperOpen}function Xr(e,n){return function(t,r,i,o){if(t===void 0)return r!==void 0?-1:0;if(r===void 0)return 1;if((r=D(t,r))===0){if(i&&o)return 0;if(i)return 1;if(o)return-1}return r}(e.lower,n.lower,e.lowerOpen,n.lowerOpen)<=0&&0<=function(t,r,i,o){if(t===void 0)return r!==void 0?1:0;if(r===void 0)return-1;if((r=D(t,r))===0){if(i&&o)return 0;if(i)return-1;if(o)return 1}return r}(e.upper,n.upper,e.upperOpen,n.upperOpen)}function Hr(e,n,t,r){e.subscribers.add(t),r.addEventListener("abort",function(){var i,o;e.subscribers.delete(t),e.subscribers.size===0&&(i=e,o=n,setTimeout(function(){i.subscribers.size===0&&we(o,i)},3e3))})}var Jr={stack:"dbcore",level:0,name:"Cache",create:function(e){var n=e.schema.name;return C(C({},e),{transaction:function(t,r,i){var o,a,u=e.transaction(t,r,i);return r==="readwrite"&&(a=(o=new AbortController).signal,i=function(c){return function(){if(o.abort(),r==="readwrite"){for(var f=new Set,d=0,s=t;d<s.length;d++){var v=s[d],l=je["idb://".concat(n,"/").concat(v)];if(l){var h=e.table(v),y=l.optimisticOps.filter(function(S){return S.trans===u});if(u._explicit&&c&&u.mutatedParts)for(var p=0,m=Object.values(l.queries.query);p<m.length;p++)for(var g=0,b=(O=m[p]).slice();g<b.length;g++)pt((x=b[g]).obsSet,u.mutatedParts)&&(we(O,x),x.subscribers.forEach(function(S){return f.add(S)}));else if(0<y.length){l.optimisticOps=l.optimisticOps.filter(function(S){return S.trans!==u});for(var w=0,_=Object.values(l.queries.query);w<_.length;w++)for(var O,x,k,E=0,P=(O=_[w]).slice();E<P.length;E++)(x=P[E]).res!=null&&u.mutatedParts&&(c&&!x.dirty?(k=Object.isFrozen(x.res),k=lr(x.res,x.req,y,h,x,k),x.dirty?(we(O,x),x.subscribers.forEach(function(S){return f.add(S)})):k!==x.res&&(x.res=k,x.promise=K.resolve({result:k}))):(x.dirty&&we(O,x),x.subscribers.forEach(function(S){return f.add(S)})))}}}f.forEach(function(S){return S()})}}},u.addEventListener("abort",i(!1),{signal:a}),u.addEventListener("error",i(!1),{signal:a}),u.addEventListener("complete",i(!0),{signal:a})),u},table:function(t){var r=e.table(t),i=r.schema.primaryKey;return C(C({},r),{mutate:function(o){var a=j.trans;if(i.outbound||a.db._options.cache==="disabled"||a.explicit||a.idbtrans.mode!=="readwrite")return r.mutate(o);var u=je["idb://".concat(n,"/").concat(t)];return u?(a=r.mutate(o),o.type!=="add"&&o.type!=="put"||!(50<=o.values.length||wt(i,o).some(function(c){return c==null}))?(u.optimisticOps.push(o),o.mutatedParts&&In(o.mutatedParts),a.then(function(c){0<c.numFailures&&(we(u.optimisticOps,o),(c=cr(0,o,c))&&u.optimisticOps.push(c),o.mutatedParts&&In(o.mutatedParts))}),a.catch(function(){we(u.optimisticOps,o),o.mutatedParts&&In(o.mutatedParts)})):a.then(function(c){var f=cr(0,C(C({},o),{values:o.values.map(function(d,s){var v;return c.failures[s]?d:(d=(v=i.keyPath)!==null&&v!==void 0&&v.includes(".")?be(d):C({},d),ne(d,i.keyPath,c.results[s]),d)})}),c);u.optimisticOps.push(f),queueMicrotask(function(){return o.mutatedParts&&In(o.mutatedParts)})}),a):r.mutate(o)},query:function(o){if(!ur(j,r)||!sr("query",o))return r.query(o);var a=((f=j.trans)===null||f===void 0?void 0:f.db._options.cache)==="immutable",s=j,u=s.requery,c=s.signal,f=function(h,y,p,m){var g=je["idb://".concat(h,"/").concat(y)];if(!g)return[];if(!(y=g.queries[p]))return[null,!1,g,null];var b=y[(m.query?m.query.index.name:null)||""];if(!b)return[null,!1,g,null];switch(p){case"query":var w=b.find(function(_){return _.req.limit===m.limit&&_.req.values===m.values&&fr(_.req.query.range,m.query.range)});return w?[w,!0,g,b]:[b.find(function(_){return("limit"in _.req?_.req.limit:1/0)>=m.limit&&(!m.values||_.req.values)&&Xr(_.req.query.range,m.query.range)}),!1,g,b];case"count":return w=b.find(function(_){return fr(_.req.query.range,m.query.range)}),[w,!!w,g,b]}}(n,t,"query",o),d=f[0],s=f[1],v=f[2],l=f[3];return d&&s?d.obsSet=o.obsSet:(s=r.query(o).then(function(h){var y=h.result;if(d&&(d.res=y),a){for(var p=0,m=y.length;p<m;++p)Object.freeze(y[p]);Object.freeze(y)}else h.result=be(y);return h}).catch(function(h){return l&&d&&we(l,d),Promise.reject(h)}),d={obsSet:o.obsSet,promise:s,subscribers:new Set,type:"query",req:o,dirty:!1},l?l.push(d):(l=[d],(v=v||(je["idb://".concat(n,"/").concat(t)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[o.query.index.name||""]=l)),Hr(d,l,u,c),d.promise.then(function(h){return{result:lr(h.result,o,v==null?void 0:v.optimisticOps,r,d,a)}})}})}})}};function Bn(e,n){return new Proxy(e,{get:function(t,r,i){return r==="db"?n:Reflect.get(t,r,i)}})}var le=(z.prototype.version=function(e){if(isNaN(e)||e<.1)throw new A.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new A.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var n=this._versions,t=n.filter(function(r){return r._cfg.version===e})[0];return t||(t=new this.Version(e),n.push(t),n.sort(Lr),t.stores({}),this._state.autoSchema=!1,t)},z.prototype._whenReady=function(e){var n=this;return this.idbdb&&(this._state.openComplete||j.letThrough||this._vip)?e():new K(function(t,r){if(n._state.openComplete)return r(new A.DatabaseClosed(n._state.dbOpenError));if(!n._state.isBeingOpened){if(!n._state.autoOpen)return void r(new A.DatabaseClosed);n.open().catch(F)}n._state.dbReadyPromise.then(t,r)}).then(e)},z.prototype.use=function(e){var n=e.stack,t=e.create,r=e.level,i=e.name;return i&&this.unuse({stack:n,name:i}),e=this._middlewares[n]||(this._middlewares[n]=[]),e.push({stack:n,create:t,level:r??10,name:i}),e.sort(function(o,a){return o.level-a.level}),this},z.prototype.unuse=function(e){var n=e.stack,t=e.name,r=e.create;return n&&this._middlewares[n]&&(this._middlewares[n]=this._middlewares[n].filter(function(i){return r?i.create!==r:!!t&&i.name!==t})),this},z.prototype.open=function(){var e=this;return Ee(he,function(){return Wr(e)})},z.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var e=this._state,n=Le.indexOf(this);if(0<=n&&Le.splice(n,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new K(function(t){e.dbReadyResolve=t}),e.openCanceller=new K(function(t,r){e.cancelOpen=r}))},z.prototype.close=function(t){var n=(t===void 0?{disableAutoOpen:!0}:t).disableAutoOpen,t=this._state;n?(t.isBeingOpened&&t.cancelOpen(new A.DatabaseClosed),this._close(),t.autoOpen=!1,t.dbOpenError=new A.DatabaseClosed):(this._close(),t.autoOpen=this._options.autoOpen||t.isBeingOpened,t.openComplete=!1,t.dbOpenError=null)},z.prototype.delete=function(e){var n=this;e===void 0&&(e={disableAutoOpen:!0});var t=0<arguments.length&&typeof arguments[0]!="object",r=this._state;return new K(function(i,o){function a(){n.close(e);var u=n._deps.indexedDB.deleteDatabase(n.name);u.onsuccess=N(function(){var c,f,d;c=n._deps,f=n.name,d=c.indexedDB,c=c.IDBKeyRange,ft(d)||f===_n||lt(d,c).delete(f).catch(F),i()}),u.onerror=oe(o),u.onblocked=n._fireOnBlocked}if(t)throw new A.InvalidArgument("Invalid closeOptions argument to db.delete()");r.isBeingOpened?r.dbReadyPromise.then(a):a()})},z.prototype.backendDB=function(){return this.idbdb},z.prototype.isOpen=function(){return this.idbdb!==null},z.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&e.name==="DatabaseClosed"},z.prototype.hasFailed=function(){return this._state.dbOpenError!==null},z.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(z.prototype,"tables",{get:function(){var e=this;return W(this._allTables).map(function(n){return e._allTables[n]})},enumerable:!1,configurable:!0}),z.prototype.transaction=function(){var e=(function(n,t,r){var i=arguments.length;if(i<2)throw new A.InvalidArgument("Too few arguments");for(var o=new Array(i-1);--i;)o[i-1]=arguments[i];return r=o.pop(),[n,At(o),r]}).apply(this,arguments);return this._transaction.apply(this,e)},z.prototype._transaction=function(e,n,t){var r=this,i=j.trans;i&&i.db===this&&e.indexOf("!")===-1||(i=null);var o,a,u=e.indexOf("?")!==-1;e=e.replace("!","").replace("?","");try{if(a=n.map(function(f){if(f=f instanceof r.Table?f.name:f,typeof f!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return f}),e=="r"||e===Zn)o=Zn;else{if(e!="rw"&&e!=et)throw new A.InvalidArgument("Invalid transaction mode: "+e);o=et}if(i){if(i.mode===Zn&&o===et){if(!u)throw new A.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");i=null}i&&a.forEach(function(f){if(i&&i.storeNames.indexOf(f)===-1){if(!u)throw new A.SubTransaction("Table "+f+" not included in parent transaction.");i=null}}),u&&i&&!i.active&&(i=null)}}catch(f){return i?i._promise(null,function(d,s){s(f)}):V(f)}var c=(function f(d,s,v,l,h){return K.resolve().then(function(){var y=j.transless||j,p=d._createTransaction(s,v,d._dbSchema,l);if(p.explicit=!0,y={trans:p,transless:y},l)p.idbtrans=l.idbtrans;else try{p.create(),p.idbtrans._explicit=!0,d._state.PR1398_maxLoop=3}catch(b){return b.name===Vn.InvalidState&&d.isOpen()&&0<--d._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),d.close({disableAutoOpen:!1}),d.open().then(function(){return f(d,s,v,null,h)})):V(b)}var m,g=Un(h);return g&&Ne(),y=K.follow(function(){var b;(m=h.call(p,p))&&(g?(b=pe.bind(null,null),m.then(b,b)):typeof m.next=="function"&&typeof m.throw=="function"&&(m=gt(m)))},y),(m&&typeof m.then=="function"?K.resolve(m).then(function(b){return p.active?b:V(new A.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):y.then(function(){return m})).then(function(b){return l&&p._resolve(),p._completion.then(function(){return b})}).catch(function(b){return p._reject(b),V(b)})})}).bind(null,this,o,a,i,t);return i?i._promise(o,c,"lock"):j.trans?Ee(j.transless,function(){return r._whenReady(c)}):this._whenReady(c)},z.prototype.table=function(e){if(!Z(this._allTables,e))throw new A.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]},z);function z(e,n){var t=this;this._middlewares={},this.verno=0;var r=z.dependencies;this._options=n=C({addons:z.addons,autoOpen:!0,indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange,cache:"cloned"},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange},r=n.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var i,o,a,u,c,f={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:F,dbReadyPromise:null,cancelOpen:F,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:n.autoOpen};f.dbReadyPromise=new K(function(s){f.dbReadyResolve=s}),f.openCanceller=new K(function(s,v){f.cancelOpen=v}),this._state=f,this.name=e,this.on=Ze(this,"populate","blocked","versionchange","close",{ready:[zn,F]}),this.once=function(s,v){var l=function(){for(var h=[],y=0;y<arguments.length;y++)h[y]=arguments[y];t.on(s).unsubscribe(l),v.apply(t,h)};return t.on(s,l)},this.on.ready.subscribe=Kt(this.on.ready.subscribe,function(s){return function(v,l){z.vip(function(){var h,y=t._state;y.openComplete?(y.dbOpenError||K.resolve().then(v),l&&s(v)):y.onReadyBeingFired?(y.onReadyBeingFired.push(v),l&&s(v)):(s(v),h=t,l||s(function p(){h.on.ready.unsubscribe(v),h.on.ready.unsubscribe(p)}))})}}),this.Collection=(i=this,en(Ir.prototype,function(m,p){this.db=i;var l=Lt,h=null;if(p)try{l=p()}catch(g){h=g}var y=m._ctx,p=y.table,m=p.hook.reading.fire;this._ctx={table:p,index:y.index,isPrimKey:!y.index||p.schema.primKey.keyPath&&y.index===p.schema.primKey.name,range:l,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:h,or:y.or,valueMapper:m!==Ge?m:null}})),this.Table=(o=this,en(Wt.prototype,function(s,v,l){this.db=o,this._tx=l,this.name=s,this.schema=v,this.hook=o._allTables[s]?o._allTables[s].hook:Ze(null,{creating:[Pr,F],reading:[Or,Ge],updating:[Kr,F],deleting:[Er,F]})})),this.Transaction=(a=this,en(Rr.prototype,function(s,v,l,h,y){var p=this;s!=="readonly"&&v.forEach(function(m){m=(m=l[m])===null||m===void 0?void 0:m.yProps,m&&(v=v.concat(m.map(function(g){return g.updatesTable})))}),this.db=a,this.mode=s,this.storeNames=v,this.schema=l,this.chromeTransactionDurability=h,this.idbtrans=null,this.on=Ze(this,"complete","error","abort"),this.parent=y||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new K(function(m,g){p._resolve=m,p._reject=g}),this._completion.then(function(){p.active=!1,p.on.complete.fire()},function(m){var g=p.active;return p.active=!1,p.on.error.fire(m),p.parent?p.parent._reject(m):g&&p.idbtrans&&p.idbtrans.abort(),V(m)})})),this.Version=(u=this,en(zr.prototype,function(s){this.db=u,this._cfg={version:s,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(c=this,en(Ht.prototype,function(s,v,l){if(this.db=c,this._ctx={table:s,index:v===":id"?null:v,or:l},this._cmp=this._ascending=D,this._descending=function(h,y){return D(y,h)},this._max=function(h,y){return 0<D(h,y)?h:y},this._min=function(h,y){return D(h,y)<0?h:y},this._IDBKeyRange=c._deps.IDBKeyRange,!this._IDBKeyRange)throw new A.MissingAPI})),this.on("versionchange",function(s){0<s.newVersion?console.warn("Another connection wants to upgrade database '".concat(t.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(t.name,"'. Closing db now to resume the delete request.")),t.close({disableAutoOpen:!1})}),this.on("blocked",function(s){!s.newVersion||s.newVersion<s.oldVersion?console.warn("Dexie.delete('".concat(t.name,"') was blocked")):console.warn("Upgrade '".concat(t.name,"' blocked by other connection holding version ").concat(s.oldVersion/10))}),this._maxKey=on(n.IDBKeyRange),this._createTransaction=function(s,v,l,h){return new t.Transaction(s,v,l,t._options.chromeTransactionDurability,h)},this._fireOnBlocked=function(s){t.on("blocked").fire(s),Le.filter(function(v){return v.name===t.name&&v!==t&&!v._state.vcFired}).map(function(v){return v.on("versionchange").fire(s)})},this.use(Gr),this.use(Jr),this.use(Qr),this.use(Yr),this.use($r);var d=new Proxy(this,{get:function(s,v,l){if(v==="_vip")return!0;if(v==="table")return function(y){return Bn(t.table(y),d)};var h=Reflect.get(s,v,l);return h instanceof Wt?Bn(h,d):v==="tables"?h.map(function(y){return Bn(y,d)}):v==="_createTransaction"?function(){return Bn(h.apply(this,arguments),d)}:h}});this.vip=d,r.forEach(function(s){return s(t)})}var Rn,re=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Zr=(xt.prototype.subscribe=function(e,n,t){return this._subscribe(e&&typeof e!="function"?e:{next:e,error:n,complete:t})},xt.prototype[re]=function(){return this},xt);function xt(e){this._subscribe=e}try{Rn={indexedDB:G.indexedDB||G.mozIndexedDB||G.webkitIndexedDB||G.msIndexedDB,IDBKeyRange:G.IDBKeyRange||G.webkitIDBKeyRange}}catch{Rn={indexedDB:null,IDBKeyRange:null}}function hr(e){var n,t=!1,r=new Zr(function(i){var o=Un(e),a,u=!1,c={},f={},d={get closed(){return u},unsubscribe:function(){u||(u=!0,a&&a.abort(),s&&me.storagemutated.unsubscribe(l))}};i.start&&i.start(d);var s=!1,v=function(){return Jn(h)},l=function(y){qn(c,y),pt(f,c)&&v()},h=function(){var y,p,m;!u&&Rn.indexedDB&&(c={},y={},a&&a.abort(),a=new AbortController,m=function(g){var b=Fe();try{o&&Ne();var w=de(e,g);return w=o?w.finally(pe):w}finally{b&&Me()}}(p={subscr:y,signal:a.signal,requery:v,querier:e,trans:null}),Promise.resolve(m).then(function(g){t=!0,n=g,u||p.signal.aborted||(c={},function(b){for(var w in b)if(Z(b,w))return;return 1}(f=y)||s||(me(rn,l),s=!0),Jn(function(){return!u&&i.next&&i.next(g)}))},function(g){t=!1,["DatabaseClosedError","AbortError"].includes(g==null?void 0:g.name)||u||Jn(function(){u||i.error&&i.error(g)})}))};return setTimeout(v,0),d});return r.hasValue=function(){return t},r.getValue=function(){return n},r}var Ae=le;function kt(e){var n=ge;try{ge=!0,me.storagemutated.fire(e),mt(e,!0)}finally{ge=n}}qe(Ae,C(C({},hn),{delete:function(e){return new Ae(e,{addons:[]}).delete()},exists:function(e){return new Ae(e,{addons:[]}).open().then(function(n){return n.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(e){try{return n=Ae.dependencies,t=n.indexedDB,n=n.IDBKeyRange,(ft(t)?Promise.resolve(t.databases()).then(function(r){return r.map(function(i){return i.name}).filter(function(i){return i!==_n})}):lt(t,n).toCollection().primaryKeys()).then(e)}catch{return V(new A.MissingAPI)}var n,t},defineClass:function(){return function(e){ee(this,e)}},ignoreTransaction:function(e){return j.trans?Ee(j.transless,e):e()},vip:ht,async:function(e){return function(){try{var n=gt(e.apply(this,arguments));return n&&typeof n.then=="function"?n:K.resolve(n)}catch(t){return V(t)}}},spawn:function(e,n,t){try{var r=gt(e.apply(t,n||[]));return r&&typeof r.then=="function"?r:K.resolve(r)}catch(i){return V(i)}},currentTransaction:{get:function(){return j.trans||null}},waitFor:function(e,n){return n=K.resolve(typeof e=="function"?Ae.ignoreTransaction(e):e).timeout(n||6e4),j.trans?j.trans.waitFor(n):n},Promise:K,debug:{get:function(){return ie},set:function(e){It(e)}},derive:Ie,extend:ee,props:qe,override:Kt,Events:Ze,on:me,liveQuery:hr,extendObservabilitySet:qn,getByKeyPath:ue,setByKeyPath:ne,delByKeyPath:function(e,n){typeof n=="string"?ne(e,n,void 0):"length"in n&&[].map.call(n,function(t){ne(e,t,void 0)})},shallowClone:jt,deepClone:be,getObjectDiff:bt,cmp:D,asap:St,minKey:-1/0,addons:[],connections:Le,errnames:Vn,dependencies:Rn,cache:je,semVer:"4.2.0",version:"4.2.0".split(".").map(function(e){return parseInt(e)}).reduce(function(e,n,t){return e+n/Math.pow(10,2*t)})})),Ae.maxKey=on(Ae.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(me(rn,function(e){ge||(e=new CustomEvent(rt,{detail:e}),ge=!0,dispatchEvent(e),ge=!1)}),addEventListener(rt,function(e){e=e.detail,ge||kt(e)}));var We,ge=!1,dr=function(){};return typeof BroadcastChannel<"u"&&((dr=function(){(We=new BroadcastChannel(rt)).onmessage=function(e){return e.data&&kt(e.data)}})(),typeof We.unref=="function"&&We.unref(),me(rn,function(e){ge||We.postMessage(e)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(e){if(!le.disableBfCache&&e.persisted){ie&&console.debug("Dexie: handling persisted pagehide"),We!=null&&We.close();for(var n=0,t=Le;n<t.length;n++)t[n].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(e){!le.disableBfCache&&e.persisted&&(ie&&console.debug("Dexie: handling persisted pageshow"),dr(),kt({all:new Q(-1/0,[[]])}))})),K.rejectionMapper=function(e,n){return!e||e instanceof Be||e instanceof TypeError||e instanceof SyntaxError||!e.name||!qt[e.name]?e:(n=new qt[e.name](n||e.message,e),"stack"in e&&fe(n,"stack",{get:function(){return this.inner.stack}}),n)},It(ie),C(le,Object.freeze({__proto__:null,Dexie:le,liveQuery:hr,Entity:Ut,cmp:D,PropModification:nn,replacePrefix:function(e,n){return new nn({replacePrefix:[e,n]})},add:function(e){return new nn({add:e})},remove:function(e){return new nn({remove:e})},default:le,RangeSet:Q,mergeRanges:sn,rangesOverlap:tr}),{default:le}),le})})(pr.__module);var ei=pr.__module.exports;const ni=Pt.getDefaultExportFromCjs(ei);module.exports=ni;
|
|
4
|
+
//# sourceMappingURL=dexie.min.cjs.map
|