@superbright/indexeddb-orm 0.1.9 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/MixpanelProvider.cjs +2 -0
- package/dist/features/analytics/MixpanelProvider.cjs.map +1 -0
- package/dist/features/analytics/MixpanelProvider.mjs +40 -0
- package/dist/features/analytics/MixpanelProvider.mjs.map +1 -0
- package/dist/features/analytics/analytics.cjs +2 -0
- package/dist/features/analytics/analytics.cjs.map +1 -0
- package/dist/features/analytics/analytics.d.ts +520 -397
- package/dist/features/analytics/analytics.mjs +230 -0
- package/dist/features/analytics/analytics.mjs.map +1 -0
- package/dist/features/analytics/generateUserUUID.cjs +2 -0
- package/dist/features/analytics/generateUserUUID.cjs.map +1 -0
- package/dist/features/analytics/generateUserUUID.mjs +6 -0
- package/dist/features/analytics/generateUserUUID.mjs.map +1 -0
- 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 -0
- package/dist/index.mjs +84 -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 +2402 -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.cjs +2 -0
- package/dist/utils/casing.cjs.map +1 -0
- package/dist/utils/casing.d.ts +6 -0
- package/dist/utils/casing.mjs +12 -0
- package/dist/utils/casing.mjs.map +1 -0
- package/dist/utils/collections.cjs +2 -0
- package/dist/utils/collections.cjs.map +1 -0
- package/dist/utils/collections.d.ts +1 -0
- package/dist/utils/collections.mjs +13 -0
- package/dist/utils/collections.mjs.map +1 -0
- package/dist/utils/dimensions.cjs +2 -0
- package/dist/utils/dimensions.cjs.map +1 -0
- package/dist/utils/dimensions.d.ts +32 -0
- package/dist/utils/dimensions.mjs +29 -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 +18 -4
|
@@ -0,0 +1,3048 @@
|
|
|
1
|
+
import { getDefaultExportFromCjs as ei, commonjsGlobal as dr } from "../../../../../../_virtual/_commonjsHelpers.mjs";
|
|
2
|
+
import { __module as pr } from "../../../../../../_virtual/dexie.min.mjs";
|
|
3
|
+
(function(yr, ti) {
|
|
4
|
+
(function(Mn, C) {
|
|
5
|
+
yr.exports = C();
|
|
6
|
+
})(dr, function() {
|
|
7
|
+
var Mn = function(e, n) {
|
|
8
|
+
return (Mn = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, r) {
|
|
9
|
+
t.__proto__ = r;
|
|
10
|
+
} || function(t, r) {
|
|
11
|
+
for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (t[i] = r[i]);
|
|
12
|
+
})(e, n);
|
|
13
|
+
}, C = function() {
|
|
14
|
+
return (C = Object.assign || function(e) {
|
|
15
|
+
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]);
|
|
16
|
+
return e;
|
|
17
|
+
}).apply(this, arguments);
|
|
18
|
+
};
|
|
19
|
+
function cn(e, n, t) {
|
|
20
|
+
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]);
|
|
21
|
+
return e.concat(r || Array.prototype.slice.call(n));
|
|
22
|
+
}
|
|
23
|
+
var G = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : dr, W = Object.keys, L = Array.isArray;
|
|
24
|
+
function ee(e, n) {
|
|
25
|
+
return typeof n != "object" || W(n).forEach(function(t) {
|
|
26
|
+
e[t] = n[t];
|
|
27
|
+
}), e;
|
|
28
|
+
}
|
|
29
|
+
typeof Promise > "u" || G.Promise || (G.Promise = Promise);
|
|
30
|
+
var Te = Object.getPrototypeOf, vr = {}.hasOwnProperty;
|
|
31
|
+
function Z(e, n) {
|
|
32
|
+
return vr.call(e, n);
|
|
33
|
+
}
|
|
34
|
+
function Ie(e, n) {
|
|
35
|
+
typeof n == "function" && (n = n(Te(e))), (typeof Reflect > "u" ? W : Reflect.ownKeys)(n).forEach(function(t) {
|
|
36
|
+
fe(e, t, n[t]);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
var Pt = Object.defineProperty;
|
|
40
|
+
function fe(e, n, t, r) {
|
|
41
|
+
Pt(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));
|
|
42
|
+
}
|
|
43
|
+
function De(e) {
|
|
44
|
+
return { from: function(n) {
|
|
45
|
+
return e.prototype = Object.create(n.prototype), fe(e.prototype, "constructor", e), { extend: Ie.bind(null, e.prototype) };
|
|
46
|
+
} };
|
|
47
|
+
}
|
|
48
|
+
var mr = Object.getOwnPropertyDescriptor, gr = [].slice;
|
|
49
|
+
function ln(e, n, t) {
|
|
50
|
+
return gr.call(e, n, t);
|
|
51
|
+
}
|
|
52
|
+
function Et(e, n) {
|
|
53
|
+
return n(e);
|
|
54
|
+
}
|
|
55
|
+
function Ye(e) {
|
|
56
|
+
if (!e) throw new Error("Assertion Failed");
|
|
57
|
+
}
|
|
58
|
+
function Kt(e) {
|
|
59
|
+
G.setImmediate ? setImmediate(e) : setTimeout(e, 0);
|
|
60
|
+
}
|
|
61
|
+
function ue(e, n) {
|
|
62
|
+
if (typeof n == "string" && Z(e, n)) return e[n];
|
|
63
|
+
if (!n) return e;
|
|
64
|
+
if (typeof n != "string") {
|
|
65
|
+
for (var t = [], r = 0, i = n.length; r < i; ++r) {
|
|
66
|
+
var o = ue(e, n[r]);
|
|
67
|
+
t.push(o);
|
|
68
|
+
}
|
|
69
|
+
return t;
|
|
70
|
+
}
|
|
71
|
+
var a = n.indexOf(".");
|
|
72
|
+
if (a !== -1) {
|
|
73
|
+
var u = e[n.substr(0, a)];
|
|
74
|
+
return u == null ? void 0 : ue(u, n.substr(a + 1));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function ne(e, n, t) {
|
|
78
|
+
if (e && n !== void 0 && !("isFrozen" in Object && Object.isFrozen(e))) if (typeof n != "string" && "length" in n) {
|
|
79
|
+
Ye(typeof t != "string" && "length" in t);
|
|
80
|
+
for (var r = 0, i = n.length; r < i; ++r) ne(e, n[r], t[r]);
|
|
81
|
+
} else {
|
|
82
|
+
var o, a, u = n.indexOf(".");
|
|
83
|
+
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;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function St(e) {
|
|
87
|
+
var n, t = {};
|
|
88
|
+
for (n in e) Z(e, n) && (t[n] = e[n]);
|
|
89
|
+
return t;
|
|
90
|
+
}
|
|
91
|
+
var br = [].concat;
|
|
92
|
+
function jt(e) {
|
|
93
|
+
return br.apply([], e);
|
|
94
|
+
}
|
|
95
|
+
var xe = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(jt([8, 16, 32, 64].map(function(e) {
|
|
96
|
+
return ["Int", "Uint", "Float"].map(function(n) {
|
|
97
|
+
return n + e + "Array";
|
|
98
|
+
});
|
|
99
|
+
}))).filter(function(e) {
|
|
100
|
+
return G[e];
|
|
101
|
+
}), At = new Set(xe.map(function(e) {
|
|
102
|
+
return G[e];
|
|
103
|
+
})), $e = null;
|
|
104
|
+
function be(e) {
|
|
105
|
+
return $e = /* @__PURE__ */ new WeakMap(), e = function n(t) {
|
|
106
|
+
if (!t || typeof t != "object") return t;
|
|
107
|
+
var r = $e.get(t);
|
|
108
|
+
if (r) return r;
|
|
109
|
+
if (L(t)) {
|
|
110
|
+
r = [], $e.set(t, r);
|
|
111
|
+
for (var i = 0, o = t.length; i < o; ++i) r.push(n(t[i]));
|
|
112
|
+
} else if (At.has(t.constructor)) r = t;
|
|
113
|
+
else {
|
|
114
|
+
var a, u = Te(t);
|
|
115
|
+
for (a in r = u === Object.prototype ? {} : Object.create(u), $e.set(t, r), t) Z(t, a) && (r[a] = n(t[a]));
|
|
116
|
+
}
|
|
117
|
+
return r;
|
|
118
|
+
}(e), $e = null, e;
|
|
119
|
+
}
|
|
120
|
+
var wr = {}.toString;
|
|
121
|
+
function Nn(e) {
|
|
122
|
+
return wr.call(e).slice(8, -1);
|
|
123
|
+
}
|
|
124
|
+
var Ln = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", _r = typeof Ln == "symbol" ? function(e) {
|
|
125
|
+
var n;
|
|
126
|
+
return e != null && (n = e[Ln]) && n.apply(e);
|
|
127
|
+
} : function() {
|
|
128
|
+
return null;
|
|
129
|
+
};
|
|
130
|
+
function we(e, n) {
|
|
131
|
+
return n = e.indexOf(n), 0 <= n && e.splice(n, 1), 0 <= n;
|
|
132
|
+
}
|
|
133
|
+
var qe = {};
|
|
134
|
+
function se(e) {
|
|
135
|
+
var n, t, r, i;
|
|
136
|
+
if (arguments.length === 1) {
|
|
137
|
+
if (L(e)) return e.slice();
|
|
138
|
+
if (this === qe && typeof e == "string") return [e];
|
|
139
|
+
if (i = _r(e)) {
|
|
140
|
+
for (t = []; !(r = i.next()).done; ) t.push(r.value);
|
|
141
|
+
return t;
|
|
142
|
+
}
|
|
143
|
+
if (e == null) return [e];
|
|
144
|
+
if (typeof (n = e.length) != "number") return [e];
|
|
145
|
+
for (t = new Array(n); n--; ) t[n] = e[n];
|
|
146
|
+
return t;
|
|
147
|
+
}
|
|
148
|
+
for (n = arguments.length, t = new Array(n); n--; ) t[n] = arguments[n];
|
|
149
|
+
return t;
|
|
150
|
+
}
|
|
151
|
+
var Un = typeof Symbol < "u" ? function(e) {
|
|
152
|
+
return e[Symbol.toStringTag] === "AsyncFunction";
|
|
153
|
+
} : function() {
|
|
154
|
+
return !1;
|
|
155
|
+
}, 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" };
|
|
156
|
+
function Be(e, n) {
|
|
157
|
+
this.name = e, this.message = n;
|
|
158
|
+
}
|
|
159
|
+
function Ct(e, n) {
|
|
160
|
+
return e + ". Errors: " + Object.keys(n).map(function(t) {
|
|
161
|
+
return n[t].toString();
|
|
162
|
+
}).filter(function(t, r, i) {
|
|
163
|
+
return i.indexOf(t) === r;
|
|
164
|
+
}).join(`
|
|
165
|
+
`);
|
|
166
|
+
}
|
|
167
|
+
function fn(e, n, t, r) {
|
|
168
|
+
this.failures = n, this.failedKeys = r, this.successCount = t, this.message = Ct(e, n);
|
|
169
|
+
}
|
|
170
|
+
function Re(e, n) {
|
|
171
|
+
this.name = "BulkError", this.failures = Object.keys(n).map(function(t) {
|
|
172
|
+
return n[t];
|
|
173
|
+
}), this.failuresByPos = n, this.message = Ct(e, this.failures);
|
|
174
|
+
}
|
|
175
|
+
De(Be).from(Error).extend({ toString: function() {
|
|
176
|
+
return this.name + ": " + this.message;
|
|
177
|
+
} }), De(fn).from(Be), De(Re).from(Be);
|
|
178
|
+
var Vn = re.reduce(function(e, n) {
|
|
179
|
+
return e[n] = n + "Error", e;
|
|
180
|
+
}, {}), kr = Be, A = re.reduce(function(e, n) {
|
|
181
|
+
var t = n + "Error";
|
|
182
|
+
function r(i, o) {
|
|
183
|
+
this.name = t, i ? typeof i == "string" ? (this.message = "".concat(i).concat(o ? `
|
|
184
|
+
` + 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);
|
|
185
|
+
}
|
|
186
|
+
return De(r).from(kr), e[n] = r, e;
|
|
187
|
+
}, {});
|
|
188
|
+
A.Syntax = SyntaxError, A.Type = TypeError, A.Range = RangeError;
|
|
189
|
+
var Tt = Xe.reduce(function(e, n) {
|
|
190
|
+
return e[n + "Error"] = A[n], e;
|
|
191
|
+
}, {}), hn = re.reduce(function(e, n) {
|
|
192
|
+
return ["Syntax", "Type", "Range"].indexOf(n) === -1 && (e[n + "Error"] = A[n]), e;
|
|
193
|
+
}, {});
|
|
194
|
+
function F() {
|
|
195
|
+
}
|
|
196
|
+
function Ge(e) {
|
|
197
|
+
return e;
|
|
198
|
+
}
|
|
199
|
+
function Or(e, n) {
|
|
200
|
+
return e == null || e === Ge ? n : function(t) {
|
|
201
|
+
return n(e(t));
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
function _e(e, n) {
|
|
205
|
+
return function() {
|
|
206
|
+
e.apply(this, arguments), n.apply(this, arguments);
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
function Pr(e, n) {
|
|
210
|
+
return e === F ? n : function() {
|
|
211
|
+
var t = e.apply(this, arguments);
|
|
212
|
+
t !== void 0 && (arguments[0] = t);
|
|
213
|
+
var r = this.onsuccess, i = this.onerror;
|
|
214
|
+
this.onsuccess = null, this.onerror = null;
|
|
215
|
+
var o = n.apply(this, arguments);
|
|
216
|
+
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;
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
function Er(e, n) {
|
|
220
|
+
return e === F ? n : function() {
|
|
221
|
+
e.apply(this, arguments);
|
|
222
|
+
var t = this.onsuccess, r = this.onerror;
|
|
223
|
+
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);
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
function Kr(e, n) {
|
|
227
|
+
return e === F ? n : function(t) {
|
|
228
|
+
var r = e.apply(this, arguments);
|
|
229
|
+
ee(t, r);
|
|
230
|
+
var i = this.onsuccess, o = this.onerror;
|
|
231
|
+
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);
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
function Sr(e, n) {
|
|
235
|
+
return e === F ? n : function() {
|
|
236
|
+
return n.apply(this, arguments) !== !1 && e.apply(this, arguments);
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
function zn(e, n) {
|
|
240
|
+
return e === F ? n : function() {
|
|
241
|
+
var t = e.apply(this, arguments);
|
|
242
|
+
if (t && typeof t.then == "function") {
|
|
243
|
+
for (var r = this, i = arguments.length, o = new Array(i); i--; ) o[i] = arguments[i];
|
|
244
|
+
return t.then(function() {
|
|
245
|
+
return n.apply(r, o);
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
return n.apply(this, arguments);
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
hn.ModifyError = fn, hn.DexieError = Be, hn.BulkError = Re;
|
|
252
|
+
var ie = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
|
|
253
|
+
function It(e) {
|
|
254
|
+
ie = e;
|
|
255
|
+
}
|
|
256
|
+
var Qe = {}, Dt = 100, xe = typeof Promise > "u" ? [] : function() {
|
|
257
|
+
var e = Promise.resolve();
|
|
258
|
+
if (typeof crypto > "u" || !crypto.subtle) return [e, Te(e), e];
|
|
259
|
+
var n = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
260
|
+
return [n, Te(n), e];
|
|
261
|
+
}(), Xe = xe[0], re = xe[1], xe = xe[2], re = re && re.then, ke = Xe && Xe.constructor, Wn = !!xe, He = function(e, n) {
|
|
262
|
+
Je.push([e, n]), dn && (queueMicrotask(Ar), dn = !1);
|
|
263
|
+
}, 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 = [];
|
|
264
|
+
function K(e) {
|
|
265
|
+
if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
|
|
266
|
+
this._listeners = [], this._lib = !1;
|
|
267
|
+
var n = this._PSD = j;
|
|
268
|
+
if (typeof e != "function") {
|
|
269
|
+
if (e !== Qe) throw new TypeError("Not a function");
|
|
270
|
+
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && Qn(this, this._value));
|
|
271
|
+
}
|
|
272
|
+
this._state = null, this._value = null, ++n.ref, function t(r, i) {
|
|
273
|
+
try {
|
|
274
|
+
i(function(o) {
|
|
275
|
+
if (r._state === null) {
|
|
276
|
+
if (o === r) throw new TypeError("A promise cannot be resolved with itself.");
|
|
277
|
+
var a = r._lib && Fe();
|
|
278
|
+
o && typeof o.then == "function" ? t(r, function(u, c) {
|
|
279
|
+
o instanceof K ? o._then(u, c) : o.then(u, c);
|
|
280
|
+
}) : (r._state = !0, r._value = o, Bt(r)), a && Me();
|
|
281
|
+
}
|
|
282
|
+
}, Qn.bind(null, r));
|
|
283
|
+
} catch (o) {
|
|
284
|
+
Qn(r, o);
|
|
285
|
+
}
|
|
286
|
+
}(this, e);
|
|
287
|
+
}
|
|
288
|
+
var Gn = { get: function() {
|
|
289
|
+
var e = j, n = bn;
|
|
290
|
+
function t(r, i) {
|
|
291
|
+
var o = this, a = !e.global && (e !== j || n !== bn), u = a && !pe(), c = new K(function(f, d) {
|
|
292
|
+
Xn(o, new qt(Ft(r, e, a, u), Ft(i, e, a, u), f, d, e));
|
|
293
|
+
});
|
|
294
|
+
return this._consoleTask && (c._consoleTask = this._consoleTask), c;
|
|
295
|
+
}
|
|
296
|
+
return t.prototype = Qe, t;
|
|
297
|
+
}, set: function(e) {
|
|
298
|
+
fe(this, "then", e && e.prototype === Qe ? Gn : { get: function() {
|
|
299
|
+
return e;
|
|
300
|
+
}, set: Gn.set });
|
|
301
|
+
} };
|
|
302
|
+
function qt(e, n, t, r, i) {
|
|
303
|
+
this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof n == "function" ? n : null, this.resolve = t, this.reject = r, this.psd = i;
|
|
304
|
+
}
|
|
305
|
+
function Qn(e, n) {
|
|
306
|
+
var t, r;
|
|
307
|
+
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) {
|
|
308
|
+
return i._value === r._value;
|
|
309
|
+
}) || Oe.push(r), Bt(e), t && Me());
|
|
310
|
+
}
|
|
311
|
+
function Bt(e) {
|
|
312
|
+
var n = e._listeners;
|
|
313
|
+
e._listeners = [];
|
|
314
|
+
for (var t = 0, r = n.length; t < r; ++t) Xn(e, n[t]);
|
|
315
|
+
var i = e._PSD;
|
|
316
|
+
--i.ref || i.finalize(), Pe === 0 && (++Pe, He(function() {
|
|
317
|
+
--Pe == 0 && Hn();
|
|
318
|
+
}, []));
|
|
319
|
+
}
|
|
320
|
+
function Xn(e, n) {
|
|
321
|
+
if (e._state !== null) {
|
|
322
|
+
var t = e._state ? n.onFulfilled : n.onRejected;
|
|
323
|
+
if (t === null) return (e._state ? n.resolve : n.reject)(e._value);
|
|
324
|
+
++n.psd.ref, ++Pe, He(jr, [t, e, n]);
|
|
325
|
+
} else e._listeners.push(n);
|
|
326
|
+
}
|
|
327
|
+
function jr(e, n, t) {
|
|
328
|
+
try {
|
|
329
|
+
var r, i = n._value;
|
|
330
|
+
!n._state && pn.length && (pn = []), r = ie && n._consoleTask ? n._consoleTask.run(function() {
|
|
331
|
+
return e(i);
|
|
332
|
+
}) : e(i), n._state || pn.indexOf(i) !== -1 || function(o) {
|
|
333
|
+
for (var a = Oe.length; a; ) if (Oe[--a]._value === o._value) return Oe.splice(a, 1);
|
|
334
|
+
}(n), t.resolve(r);
|
|
335
|
+
} catch (o) {
|
|
336
|
+
t.reject(o);
|
|
337
|
+
} finally {
|
|
338
|
+
--Pe == 0 && Hn(), --t.psd.ref || t.psd.finalize();
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
function Ar() {
|
|
342
|
+
Ee(he, function() {
|
|
343
|
+
Fe() && Me();
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
function Fe() {
|
|
347
|
+
var e = Yn;
|
|
348
|
+
return dn = Yn = !1, e;
|
|
349
|
+
}
|
|
350
|
+
function Me() {
|
|
351
|
+
var e, n, t;
|
|
352
|
+
do
|
|
353
|
+
for (; 0 < Je.length; ) for (e = Je, Je = [], t = e.length, n = 0; n < t; ++n) {
|
|
354
|
+
var r = e[n];
|
|
355
|
+
r[0].apply(null, r[1]);
|
|
356
|
+
}
|
|
357
|
+
while (0 < Je.length);
|
|
358
|
+
dn = Yn = !0;
|
|
359
|
+
}
|
|
360
|
+
function Hn() {
|
|
361
|
+
var e = Oe;
|
|
362
|
+
Oe = [], e.forEach(function(r) {
|
|
363
|
+
r._PSD.onunhandled.call(null, r._value, r);
|
|
364
|
+
});
|
|
365
|
+
for (var n = yn.slice(0), t = n.length; t; ) n[--t]();
|
|
366
|
+
}
|
|
367
|
+
function vn(e) {
|
|
368
|
+
return new K(Qe, !1, e);
|
|
369
|
+
}
|
|
370
|
+
function N(e, n) {
|
|
371
|
+
var t = j;
|
|
372
|
+
return function() {
|
|
373
|
+
var r = Fe(), i = j;
|
|
374
|
+
try {
|
|
375
|
+
return ye(t, !0), e.apply(this, arguments);
|
|
376
|
+
} catch (o) {
|
|
377
|
+
n && n(o);
|
|
378
|
+
} finally {
|
|
379
|
+
ye(i, !1), r && Me();
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
Ie(K.prototype, { then: Gn, _then: function(e, n) {
|
|
384
|
+
Xn(this, new qt(null, null, e, n, j));
|
|
385
|
+
}, catch: function(e) {
|
|
386
|
+
if (arguments.length === 1) return this.then(null, e);
|
|
387
|
+
var n = e, t = arguments[1];
|
|
388
|
+
return typeof n == "function" ? this.then(null, function(r) {
|
|
389
|
+
return (r instanceof n ? t : vn)(r);
|
|
390
|
+
}) : this.then(null, function(r) {
|
|
391
|
+
return (r && r.name === n ? t : vn)(r);
|
|
392
|
+
});
|
|
393
|
+
}, finally: function(e) {
|
|
394
|
+
return this.then(function(n) {
|
|
395
|
+
return K.resolve(e()).then(function() {
|
|
396
|
+
return n;
|
|
397
|
+
});
|
|
398
|
+
}, function(n) {
|
|
399
|
+
return K.resolve(e()).then(function() {
|
|
400
|
+
return vn(n);
|
|
401
|
+
});
|
|
402
|
+
});
|
|
403
|
+
}, timeout: function(e, n) {
|
|
404
|
+
var t = this;
|
|
405
|
+
return e < 1 / 0 ? new K(function(r, i) {
|
|
406
|
+
var o = setTimeout(function() {
|
|
407
|
+
return i(new A.Timeout(n));
|
|
408
|
+
}, e);
|
|
409
|
+
t.then(r, i).finally(clearTimeout.bind(null, o));
|
|
410
|
+
}) : this;
|
|
411
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && fe(K.prototype, Symbol.toStringTag, "Dexie.Promise"), he.env = Rt(), Ie(K, { all: function() {
|
|
412
|
+
var e = se.apply(null, arguments).map(wn);
|
|
413
|
+
return new K(function(n, t) {
|
|
414
|
+
e.length === 0 && n([]);
|
|
415
|
+
var r = e.length;
|
|
416
|
+
e.forEach(function(i, o) {
|
|
417
|
+
return K.resolve(i).then(function(a) {
|
|
418
|
+
e[o] = a, --r || n(e);
|
|
419
|
+
}, t);
|
|
420
|
+
});
|
|
421
|
+
});
|
|
422
|
+
}, resolve: function(e) {
|
|
423
|
+
return e instanceof K ? e : e && typeof e.then == "function" ? new K(function(n, t) {
|
|
424
|
+
e.then(n, t);
|
|
425
|
+
}) : new K(Qe, !0, e);
|
|
426
|
+
}, reject: vn, race: function() {
|
|
427
|
+
var e = se.apply(null, arguments).map(wn);
|
|
428
|
+
return new K(function(n, t) {
|
|
429
|
+
e.map(function(r) {
|
|
430
|
+
return K.resolve(r).then(n, t);
|
|
431
|
+
});
|
|
432
|
+
});
|
|
433
|
+
}, PSD: { get: function() {
|
|
434
|
+
return j;
|
|
435
|
+
}, set: function(e) {
|
|
436
|
+
return j = e;
|
|
437
|
+
} }, totalEchoes: { get: function() {
|
|
438
|
+
return bn;
|
|
439
|
+
} }, newPSD: de, usePSD: Ee, scheduler: { get: function() {
|
|
440
|
+
return He;
|
|
441
|
+
}, set: function(e) {
|
|
442
|
+
He = e;
|
|
443
|
+
} }, rejectionMapper: { get: function() {
|
|
444
|
+
return $n;
|
|
445
|
+
}, set: function(e) {
|
|
446
|
+
$n = e;
|
|
447
|
+
} }, follow: function(e, n) {
|
|
448
|
+
return new K(function(t, r) {
|
|
449
|
+
return de(function(i, o) {
|
|
450
|
+
var a = j;
|
|
451
|
+
a.unhandleds = [], a.onunhandled = o, a.finalize = _e(function() {
|
|
452
|
+
var u, c = this;
|
|
453
|
+
u = function() {
|
|
454
|
+
c.unhandleds.length === 0 ? i() : o(c.unhandleds[0]);
|
|
455
|
+
}, yn.push(function f() {
|
|
456
|
+
u(), yn.splice(yn.indexOf(f), 1);
|
|
457
|
+
}), ++Pe, He(function() {
|
|
458
|
+
--Pe == 0 && Hn();
|
|
459
|
+
}, []);
|
|
460
|
+
}, a.finalize), e();
|
|
461
|
+
}, n, t, r);
|
|
462
|
+
});
|
|
463
|
+
} }), ke && (ke.allSettled && fe(K, "allSettled", function() {
|
|
464
|
+
var e = se.apply(null, arguments).map(wn);
|
|
465
|
+
return new K(function(n) {
|
|
466
|
+
e.length === 0 && n([]);
|
|
467
|
+
var t = e.length, r = new Array(t);
|
|
468
|
+
e.forEach(function(i, o) {
|
|
469
|
+
return K.resolve(i).then(function(a) {
|
|
470
|
+
return r[o] = { status: "fulfilled", value: a };
|
|
471
|
+
}, function(a) {
|
|
472
|
+
return r[o] = { status: "rejected", reason: a };
|
|
473
|
+
}).then(function() {
|
|
474
|
+
return --t || n(r);
|
|
475
|
+
});
|
|
476
|
+
});
|
|
477
|
+
});
|
|
478
|
+
}), ke.any && typeof AggregateError < "u" && fe(K, "any", function() {
|
|
479
|
+
var e = se.apply(null, arguments).map(wn);
|
|
480
|
+
return new K(function(n, t) {
|
|
481
|
+
e.length === 0 && t(new AggregateError([]));
|
|
482
|
+
var r = e.length, i = new Array(r);
|
|
483
|
+
e.forEach(function(o, a) {
|
|
484
|
+
return K.resolve(o).then(function(u) {
|
|
485
|
+
return n(u);
|
|
486
|
+
}, function(u) {
|
|
487
|
+
i[a] = u, --r || t(new AggregateError(i));
|
|
488
|
+
});
|
|
489
|
+
});
|
|
490
|
+
});
|
|
491
|
+
}), ke.withResolvers && (K.withResolvers = ke.withResolvers));
|
|
492
|
+
var Y = { awaits: 0, echoes: 0, id: 0 }, Cr = 0, mn = [], gn = 0, bn = 0, Tr = 0;
|
|
493
|
+
function de(e, n, t, r) {
|
|
494
|
+
var i = j, o = Object.create(i);
|
|
495
|
+
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() {
|
|
496
|
+
--this.parent.ref || this.parent.finalize();
|
|
497
|
+
}, r = Ee(o, e, t, r), o.ref === 0 && o.finalize(), r;
|
|
498
|
+
}
|
|
499
|
+
function Ne() {
|
|
500
|
+
return Y.id || (Y.id = ++Cr), ++Y.awaits, Y.echoes += Dt, Y.id;
|
|
501
|
+
}
|
|
502
|
+
function pe() {
|
|
503
|
+
return !!Y.awaits && (--Y.awaits == 0 && (Y.id = 0), Y.echoes = Y.awaits * Dt, !0);
|
|
504
|
+
}
|
|
505
|
+
function wn(e) {
|
|
506
|
+
return Y.echoes && e && e.constructor === ke ? (Ne(), e.then(function(n) {
|
|
507
|
+
return pe(), n;
|
|
508
|
+
}, function(n) {
|
|
509
|
+
return pe(), V(n);
|
|
510
|
+
})) : e;
|
|
511
|
+
}
|
|
512
|
+
function Ir() {
|
|
513
|
+
var e = mn[mn.length - 1];
|
|
514
|
+
mn.pop(), ye(e, !1);
|
|
515
|
+
}
|
|
516
|
+
function ye(e, n) {
|
|
517
|
+
var t, r = j;
|
|
518
|
+
(n ? !Y.echoes || gn++ && e === j : !gn || --gn && e === j) || queueMicrotask(n ? (function(i) {
|
|
519
|
+
++bn, Y.echoes && --Y.echoes != 0 || (Y.echoes = Y.awaits = Y.id = 0), mn.push(j), ye(i, !0);
|
|
520
|
+
}).bind(null, e) : Ir), e !== j && (j = e, r === he && (he.env = Rt()), 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))));
|
|
521
|
+
}
|
|
522
|
+
function Rt() {
|
|
523
|
+
var e = G.Promise;
|
|
524
|
+
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 } : {};
|
|
525
|
+
}
|
|
526
|
+
function Ee(e, n, t, r, i) {
|
|
527
|
+
var o = j;
|
|
528
|
+
try {
|
|
529
|
+
return ye(e, !0), n(t, r, i);
|
|
530
|
+
} finally {
|
|
531
|
+
ye(o, !1);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
function Ft(e, n, t, r) {
|
|
535
|
+
return typeof e != "function" ? e : function() {
|
|
536
|
+
var i = j;
|
|
537
|
+
t && Ne(), ye(n, !0);
|
|
538
|
+
try {
|
|
539
|
+
return e.apply(this, arguments);
|
|
540
|
+
} finally {
|
|
541
|
+
ye(i, !1), r && queueMicrotask(pe);
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
function Jn(e) {
|
|
546
|
+
Promise === ke && Y.echoes === 0 ? gn === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
547
|
+
}
|
|
548
|
+
("" + re).indexOf("[native code]") === -1 && (Ne = pe = F);
|
|
549
|
+
var V = K.reject, Ke = "", ce = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", Mt = "String expected.", Le = [], _n = "__dbnames", Zn = "readonly", et = "readwrite";
|
|
550
|
+
function Se(e, n) {
|
|
551
|
+
return e ? n ? function() {
|
|
552
|
+
return e.apply(this, arguments) && n.apply(this, arguments);
|
|
553
|
+
} : e : n;
|
|
554
|
+
}
|
|
555
|
+
var Nt = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
|
|
556
|
+
function xn(e) {
|
|
557
|
+
return typeof e != "string" || /\./.test(e) ? function(n) {
|
|
558
|
+
return n;
|
|
559
|
+
} : function(n) {
|
|
560
|
+
return n[e] === void 0 && e in n && delete (n = be(n))[e], n;
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
function Lt() {
|
|
564
|
+
throw A.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.");
|
|
565
|
+
}
|
|
566
|
+
function q(e, n) {
|
|
567
|
+
try {
|
|
568
|
+
var t = Ut(e), r = Ut(n);
|
|
569
|
+
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;
|
|
570
|
+
switch (t) {
|
|
571
|
+
case "number":
|
|
572
|
+
case "Date":
|
|
573
|
+
case "string":
|
|
574
|
+
return n < e ? 1 : e < n ? -1 : 0;
|
|
575
|
+
case "binary":
|
|
576
|
+
return function(i, o) {
|
|
577
|
+
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;
|
|
578
|
+
return a === u ? 0 : a < u ? -1 : 1;
|
|
579
|
+
}(Vt(e), Vt(n));
|
|
580
|
+
case "Array":
|
|
581
|
+
return function(i, o) {
|
|
582
|
+
for (var a = i.length, u = o.length, c = a < u ? a : u, f = 0; f < c; ++f) {
|
|
583
|
+
var d = q(i[f], o[f]);
|
|
584
|
+
if (d !== 0) return d;
|
|
585
|
+
}
|
|
586
|
+
return a === u ? 0 : a < u ? -1 : 1;
|
|
587
|
+
}(e, n);
|
|
588
|
+
}
|
|
589
|
+
} catch {
|
|
590
|
+
}
|
|
591
|
+
return NaN;
|
|
592
|
+
}
|
|
593
|
+
function Ut(e) {
|
|
594
|
+
var n = typeof e;
|
|
595
|
+
return n != "object" ? n : ArrayBuffer.isView(e) ? "binary" : (e = Nn(e), e === "ArrayBuffer" ? "binary" : e);
|
|
596
|
+
}
|
|
597
|
+
function Vt(e) {
|
|
598
|
+
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
599
|
+
}
|
|
600
|
+
function kn(e, n, t) {
|
|
601
|
+
var r = e.schema.yProps;
|
|
602
|
+
return r ? (n && 0 < t.numFailures && (n = n.filter(function(i, o) {
|
|
603
|
+
return !t.failures[o];
|
|
604
|
+
})), Promise.all(r.map(function(i) {
|
|
605
|
+
return i = i.updatesTable, n ? e.db.table(i).where("k").anyOf(n).delete() : e.db.table(i).clear();
|
|
606
|
+
})).then(function() {
|
|
607
|
+
return t;
|
|
608
|
+
})) : t;
|
|
609
|
+
}
|
|
610
|
+
var zt = (M.prototype._trans = function(e, n, t) {
|
|
611
|
+
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));
|
|
612
|
+
function a(f, d, s) {
|
|
613
|
+
if (!s.schema[i]) throw new A.NotFound("Table " + i + " not part of transaction");
|
|
614
|
+
return n(s.idbtrans, s);
|
|
615
|
+
}
|
|
616
|
+
var u = Fe();
|
|
617
|
+
try {
|
|
618
|
+
var c = r && r.db._novip === this.db._novip ? r === j.trans ? r._promise(e, a, t) : de(function() {
|
|
619
|
+
return r._promise(e, a, t);
|
|
620
|
+
}, { trans: r, transless: j.transless || j }) : function f(d, s, v, l) {
|
|
621
|
+
if (d.idbdb && (d._state.openComplete || j.letThrough || d._vip)) {
|
|
622
|
+
var h = d._createTransaction(s, v, d._dbSchema);
|
|
623
|
+
try {
|
|
624
|
+
h.create(), d._state.PR1398_maxLoop = 3;
|
|
625
|
+
} catch (y) {
|
|
626
|
+
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() {
|
|
627
|
+
return f(d, s, v, l);
|
|
628
|
+
})) : V(y);
|
|
629
|
+
}
|
|
630
|
+
return h._promise(s, function(y, p) {
|
|
631
|
+
return de(function() {
|
|
632
|
+
return j.trans = h, l(y, p, h);
|
|
633
|
+
});
|
|
634
|
+
}).then(function(y) {
|
|
635
|
+
if (s === "readwrite") try {
|
|
636
|
+
h.idbtrans.commit();
|
|
637
|
+
} catch {
|
|
638
|
+
}
|
|
639
|
+
return s === "readonly" ? y : h._completion.then(function() {
|
|
640
|
+
return y;
|
|
641
|
+
});
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
if (d._state.openComplete) return V(new A.DatabaseClosed(d._state.dbOpenError));
|
|
645
|
+
if (!d._state.isBeingOpened) {
|
|
646
|
+
if (!d._state.autoOpen) return V(new A.DatabaseClosed());
|
|
647
|
+
d.open().catch(F);
|
|
648
|
+
}
|
|
649
|
+
return d._state.dbReadyPromise.then(function() {
|
|
650
|
+
return f(d, s, v, l);
|
|
651
|
+
});
|
|
652
|
+
}(this.db, e, [this.name], a);
|
|
653
|
+
return o && (c._consoleTask = o, c = c.catch(function(f) {
|
|
654
|
+
return console.trace(f), V(f);
|
|
655
|
+
})), c;
|
|
656
|
+
} finally {
|
|
657
|
+
u && Me();
|
|
658
|
+
}
|
|
659
|
+
}, M.prototype.get = function(e, n) {
|
|
660
|
+
var t = this;
|
|
661
|
+
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) {
|
|
662
|
+
return t.core.get({ trans: r, key: e }).then(function(i) {
|
|
663
|
+
return t.hook.reading.fire(i);
|
|
664
|
+
});
|
|
665
|
+
}).then(n);
|
|
666
|
+
}, M.prototype.where = function(e) {
|
|
667
|
+
if (typeof e == "string") return new this.db.WhereClause(this, e);
|
|
668
|
+
if (L(e)) return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
669
|
+
var n = W(e);
|
|
670
|
+
if (n.length === 1) return this.where(n[0]).equals(e[n[0]]);
|
|
671
|
+
var t = this.schema.indexes.concat(this.schema.primKey).filter(function(u) {
|
|
672
|
+
if (u.compound && n.every(function(f) {
|
|
673
|
+
return 0 <= u.keyPath.indexOf(f);
|
|
674
|
+
})) {
|
|
675
|
+
for (var c = 0; c < n.length; ++c) if (n.indexOf(u.keyPath[c]) === -1) return !1;
|
|
676
|
+
return !0;
|
|
677
|
+
}
|
|
678
|
+
return !1;
|
|
679
|
+
}).sort(function(u, c) {
|
|
680
|
+
return u.keyPath.length - c.keyPath.length;
|
|
681
|
+
})[0];
|
|
682
|
+
if (t && this.db._maxKey !== Ke) {
|
|
683
|
+
var o = t.keyPath.slice(0, n.length);
|
|
684
|
+
return this.where(o).equals(o.map(function(c) {
|
|
685
|
+
return e[c];
|
|
686
|
+
}));
|
|
687
|
+
}
|
|
688
|
+
!t && ie && console.warn("The query ".concat(JSON.stringify(e), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(n.join("+"), "]"));
|
|
689
|
+
var r = this.schema.idxByName;
|
|
690
|
+
function i(u, c) {
|
|
691
|
+
return q(u, c) === 0;
|
|
692
|
+
}
|
|
693
|
+
var a = n.reduce(function(s, c) {
|
|
694
|
+
var f = s[0], d = s[1], s = r[c], v = e[c];
|
|
695
|
+
return [f || s, f || !s ? Se(d, s && s.multi ? function(l) {
|
|
696
|
+
return l = ue(l, c), L(l) && l.some(function(h) {
|
|
697
|
+
return i(v, h);
|
|
698
|
+
});
|
|
699
|
+
} : function(l) {
|
|
700
|
+
return i(v, ue(l, c));
|
|
701
|
+
}) : d];
|
|
702
|
+
}, [null, null]), o = a[0], a = a[1];
|
|
703
|
+
return o ? this.where(o.name).equals(e[o.keyPath]).filter(a) : t ? this.filter(a) : this.where(n).equals("");
|
|
704
|
+
}, M.prototype.filter = function(e) {
|
|
705
|
+
return this.toCollection().and(e);
|
|
706
|
+
}, M.prototype.count = function(e) {
|
|
707
|
+
return this.toCollection().count(e);
|
|
708
|
+
}, M.prototype.offset = function(e) {
|
|
709
|
+
return this.toCollection().offset(e);
|
|
710
|
+
}, M.prototype.limit = function(e) {
|
|
711
|
+
return this.toCollection().limit(e);
|
|
712
|
+
}, M.prototype.each = function(e) {
|
|
713
|
+
return this.toCollection().each(e);
|
|
714
|
+
}, M.prototype.toArray = function(e) {
|
|
715
|
+
return this.toCollection().toArray(e);
|
|
716
|
+
}, M.prototype.toCollection = function() {
|
|
717
|
+
return new this.db.Collection(new this.db.WhereClause(this));
|
|
718
|
+
}, M.prototype.orderBy = function(e) {
|
|
719
|
+
return new this.db.Collection(new this.db.WhereClause(this, L(e) ? "[".concat(e.join("+"), "]") : e));
|
|
720
|
+
}, M.prototype.reverse = function() {
|
|
721
|
+
return this.toCollection().reverse();
|
|
722
|
+
}, M.prototype.mapToClass = function(e) {
|
|
723
|
+
var n, t = this.db, r = this.name;
|
|
724
|
+
function i() {
|
|
725
|
+
return n !== null && n.apply(this, arguments) || this;
|
|
726
|
+
}
|
|
727
|
+
(this.schema.mappedClass = e).prototype instanceof Lt && (function(c, f) {
|
|
728
|
+
if (typeof f != "function" && f !== null) throw new TypeError("Class extends value " + String(f) + " is not a constructor or null");
|
|
729
|
+
function d() {
|
|
730
|
+
this.constructor = c;
|
|
731
|
+
}
|
|
732
|
+
Mn(c, f), c.prototype = f === null ? Object.create(f) : (d.prototype = f.prototype, new d());
|
|
733
|
+
}(i, n = e), Object.defineProperty(i.prototype, "db", { get: function() {
|
|
734
|
+
return t;
|
|
735
|
+
}, enumerable: !1, configurable: !0 }), i.prototype.table = function() {
|
|
736
|
+
return r;
|
|
737
|
+
}, e = i);
|
|
738
|
+
for (var o = /* @__PURE__ */ new Set(), a = e.prototype; a; a = Te(a)) Object.getOwnPropertyNames(a).forEach(function(c) {
|
|
739
|
+
return o.add(c);
|
|
740
|
+
});
|
|
741
|
+
function u(c) {
|
|
742
|
+
if (!c) return c;
|
|
743
|
+
var f, d = Object.create(e.prototype);
|
|
744
|
+
for (f in c) if (!o.has(f)) try {
|
|
745
|
+
d[f] = c[f];
|
|
746
|
+
} catch {
|
|
747
|
+
}
|
|
748
|
+
return d;
|
|
749
|
+
}
|
|
750
|
+
return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), this.schema.readHook = u, this.hook("reading", u), e;
|
|
751
|
+
}, M.prototype.defineClass = function() {
|
|
752
|
+
return this.mapToClass(function(e) {
|
|
753
|
+
ee(this, e);
|
|
754
|
+
});
|
|
755
|
+
}, M.prototype.add = function(e, n) {
|
|
756
|
+
var t = this, r = this.schema.primKey, i = r.auto, o = r.keyPath, a = e;
|
|
757
|
+
return o && i && (a = xn(o)(e)), this._trans("readwrite", function(u) {
|
|
758
|
+
return t.core.mutate({ trans: u, type: "add", keys: n != null ? [n] : null, values: [a] });
|
|
759
|
+
}).then(function(u) {
|
|
760
|
+
return u.numFailures ? K.reject(u.failures[0]) : u.lastResult;
|
|
761
|
+
}).then(function(u) {
|
|
762
|
+
if (o) try {
|
|
763
|
+
ne(e, o, u);
|
|
764
|
+
} catch {
|
|
765
|
+
}
|
|
766
|
+
return u;
|
|
767
|
+
});
|
|
768
|
+
}, M.prototype.update = function(e, n) {
|
|
769
|
+
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));
|
|
770
|
+
}, M.prototype.put = function(e, n) {
|
|
771
|
+
var t = this, r = this.schema.primKey, i = r.auto, o = r.keyPath, a = e;
|
|
772
|
+
return o && i && (a = xn(o)(e)), this._trans("readwrite", function(u) {
|
|
773
|
+
return t.core.mutate({ trans: u, type: "put", values: [a], keys: n != null ? [n] : null });
|
|
774
|
+
}).then(function(u) {
|
|
775
|
+
return u.numFailures ? K.reject(u.failures[0]) : u.lastResult;
|
|
776
|
+
}).then(function(u) {
|
|
777
|
+
if (o) try {
|
|
778
|
+
ne(e, o, u);
|
|
779
|
+
} catch {
|
|
780
|
+
}
|
|
781
|
+
return u;
|
|
782
|
+
});
|
|
783
|
+
}, M.prototype.delete = function(e) {
|
|
784
|
+
var n = this;
|
|
785
|
+
return this._trans("readwrite", function(t) {
|
|
786
|
+
return n.core.mutate({ trans: t, type: "delete", keys: [e] }).then(function(r) {
|
|
787
|
+
return kn(n, [e], r);
|
|
788
|
+
}).then(function(r) {
|
|
789
|
+
return r.numFailures ? K.reject(r.failures[0]) : void 0;
|
|
790
|
+
});
|
|
791
|
+
});
|
|
792
|
+
}, M.prototype.clear = function() {
|
|
793
|
+
var e = this;
|
|
794
|
+
return this._trans("readwrite", function(n) {
|
|
795
|
+
return e.core.mutate({ trans: n, type: "deleteRange", range: Nt }).then(function(t) {
|
|
796
|
+
return kn(e, null, t);
|
|
797
|
+
});
|
|
798
|
+
}).then(function(n) {
|
|
799
|
+
return n.numFailures ? K.reject(n.failures[0]) : void 0;
|
|
800
|
+
});
|
|
801
|
+
}, M.prototype.bulkGet = function(e) {
|
|
802
|
+
var n = this;
|
|
803
|
+
return this._trans("readonly", function(t) {
|
|
804
|
+
return n.core.getMany({ keys: e, trans: t }).then(function(r) {
|
|
805
|
+
return r.map(function(i) {
|
|
806
|
+
return n.hook.reading.fire(i);
|
|
807
|
+
});
|
|
808
|
+
});
|
|
809
|
+
});
|
|
810
|
+
}, M.prototype.bulkAdd = function(e, n, t) {
|
|
811
|
+
var r = this, i = Array.isArray(n) ? n : void 0, o = (t = t || (i ? void 0 : n)) ? t.allKeys : void 0;
|
|
812
|
+
return this._trans("readwrite", function(a) {
|
|
813
|
+
var f = r.schema.primKey, u = f.auto, f = f.keyPath;
|
|
814
|
+
if (f && i) throw new A.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
815
|
+
if (i && i.length !== e.length) throw new A.InvalidArgument("Arguments objects and keys must have the same length");
|
|
816
|
+
var c = e.length, f = f && u ? e.map(xn(f)) : e;
|
|
817
|
+
return r.core.mutate({ trans: a, type: "add", keys: i, values: f, wantResults: o }).then(function(h) {
|
|
818
|
+
var s = h.numFailures, v = h.results, l = h.lastResult, h = h.failures;
|
|
819
|
+
if (s === 0) return o ? v : l;
|
|
820
|
+
throw new Re("".concat(r.name, ".bulkAdd(): ").concat(s, " of ").concat(c, " operations failed"), h);
|
|
821
|
+
});
|
|
822
|
+
});
|
|
823
|
+
}, M.prototype.bulkPut = function(e, n, t) {
|
|
824
|
+
var r = this, i = Array.isArray(n) ? n : void 0, o = (t = t || (i ? void 0 : n)) ? t.allKeys : void 0;
|
|
825
|
+
return this._trans("readwrite", function(a) {
|
|
826
|
+
var f = r.schema.primKey, u = f.auto, f = f.keyPath;
|
|
827
|
+
if (f && i) throw new A.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
828
|
+
if (i && i.length !== e.length) throw new A.InvalidArgument("Arguments objects and keys must have the same length");
|
|
829
|
+
var c = e.length, f = f && u ? e.map(xn(f)) : e;
|
|
830
|
+
return r.core.mutate({ trans: a, type: "put", keys: i, values: f, wantResults: o }).then(function(h) {
|
|
831
|
+
var s = h.numFailures, v = h.results, l = h.lastResult, h = h.failures;
|
|
832
|
+
if (s === 0) return o ? v : l;
|
|
833
|
+
throw new Re("".concat(r.name, ".bulkPut(): ").concat(s, " of ").concat(c, " operations failed"), h);
|
|
834
|
+
});
|
|
835
|
+
});
|
|
836
|
+
}, M.prototype.bulkUpdate = function(e) {
|
|
837
|
+
var n = this, t = this.core, r = e.map(function(a) {
|
|
838
|
+
return a.key;
|
|
839
|
+
}), i = e.map(function(a) {
|
|
840
|
+
return a.changes;
|
|
841
|
+
}), o = [];
|
|
842
|
+
return this._trans("readwrite", function(a) {
|
|
843
|
+
return t.getMany({ trans: a, keys: r, cache: "clone" }).then(function(u) {
|
|
844
|
+
var c = [], f = [];
|
|
845
|
+
e.forEach(function(s, v) {
|
|
846
|
+
var l = s.key, h = s.changes, y = u[v];
|
|
847
|
+
if (y) {
|
|
848
|
+
for (var p = 0, m = Object.keys(h); p < m.length; p++) {
|
|
849
|
+
var g = m[p], b = h[g];
|
|
850
|
+
if (g === n.schema.primKey.keyPath) {
|
|
851
|
+
if (q(b, l) !== 0) throw new A.Constraint("Cannot update primary key in bulkUpdate()");
|
|
852
|
+
} else ne(y, g, b);
|
|
853
|
+
}
|
|
854
|
+
o.push(v), c.push(l), f.push(y);
|
|
855
|
+
}
|
|
856
|
+
});
|
|
857
|
+
var d = c.length;
|
|
858
|
+
return t.mutate({ trans: a, type: "put", keys: c, values: f, updates: { keys: r, changeSpecs: i } }).then(function(s) {
|
|
859
|
+
var v = s.numFailures, l = s.failures;
|
|
860
|
+
if (v === 0) return d;
|
|
861
|
+
for (var h = 0, y = Object.keys(l); h < y.length; h++) {
|
|
862
|
+
var p, m = y[h], g = o[Number(m)];
|
|
863
|
+
g != null && (p = l[m], delete l[m], l[g] = p);
|
|
864
|
+
}
|
|
865
|
+
throw new Re("".concat(n.name, ".bulkUpdate(): ").concat(v, " of ").concat(d, " operations failed"), l);
|
|
866
|
+
});
|
|
867
|
+
});
|
|
868
|
+
});
|
|
869
|
+
}, M.prototype.bulkDelete = function(e) {
|
|
870
|
+
var n = this, t = e.length;
|
|
871
|
+
return this._trans("readwrite", function(r) {
|
|
872
|
+
return n.core.mutate({ trans: r, type: "delete", keys: e }).then(function(i) {
|
|
873
|
+
return kn(n, e, i);
|
|
874
|
+
});
|
|
875
|
+
}).then(function(a) {
|
|
876
|
+
var i = a.numFailures, o = a.lastResult, a = a.failures;
|
|
877
|
+
if (i === 0) return o;
|
|
878
|
+
throw new Re("".concat(n.name, ".bulkDelete(): ").concat(i, " of ").concat(t, " operations failed"), a);
|
|
879
|
+
});
|
|
880
|
+
}, M);
|
|
881
|
+
function M() {
|
|
882
|
+
}
|
|
883
|
+
function Ze(e) {
|
|
884
|
+
function n(a, u) {
|
|
885
|
+
if (u) {
|
|
886
|
+
for (var c = arguments.length, f = new Array(c - 1); --c; ) f[c - 1] = arguments[c];
|
|
887
|
+
return t[a].subscribe.apply(null, f), e;
|
|
888
|
+
}
|
|
889
|
+
if (typeof a == "string") return t[a];
|
|
890
|
+
}
|
|
891
|
+
var t = {};
|
|
892
|
+
n.addEventType = o;
|
|
893
|
+
for (var r = 1, i = arguments.length; r < i; ++r) o(arguments[r]);
|
|
894
|
+
return n;
|
|
895
|
+
function o(a, u, c) {
|
|
896
|
+
if (typeof a != "object") {
|
|
897
|
+
var f;
|
|
898
|
+
u = u || Sr;
|
|
899
|
+
var d = { subscribers: [], fire: c = c || F, subscribe: function(s) {
|
|
900
|
+
d.subscribers.indexOf(s) === -1 && (d.subscribers.push(s), d.fire = u(d.fire, s));
|
|
901
|
+
}, unsubscribe: function(s) {
|
|
902
|
+
d.subscribers = d.subscribers.filter(function(v) {
|
|
903
|
+
return v !== s;
|
|
904
|
+
}), d.fire = d.subscribers.reduce(u, c);
|
|
905
|
+
} };
|
|
906
|
+
return t[a] = n[a] = d;
|
|
907
|
+
}
|
|
908
|
+
W(f = a).forEach(function(s) {
|
|
909
|
+
var v = f[s];
|
|
910
|
+
if (L(v)) o(s, f[s][0], f[s][1]);
|
|
911
|
+
else {
|
|
912
|
+
if (v !== "asap") throw new A.InvalidArgument("Invalid event config");
|
|
913
|
+
var l = o(s, Ge, function() {
|
|
914
|
+
for (var h = arguments.length, y = new Array(h); h--; ) y[h] = arguments[h];
|
|
915
|
+
l.subscribers.forEach(function(p) {
|
|
916
|
+
Kt(function() {
|
|
917
|
+
p.apply(null, y);
|
|
918
|
+
});
|
|
919
|
+
});
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
function en(e, n) {
|
|
926
|
+
return De(n).from({ prototype: e }), n;
|
|
927
|
+
}
|
|
928
|
+
function Ue(e, n) {
|
|
929
|
+
return !(e.filter || e.algorithm || e.or) && (n ? e.justLimit : !e.replayFilter);
|
|
930
|
+
}
|
|
931
|
+
function nt(e, n) {
|
|
932
|
+
e.filter = Se(e.filter, n);
|
|
933
|
+
}
|
|
934
|
+
function tt(e, n, t) {
|
|
935
|
+
var r = e.replayFilter;
|
|
936
|
+
e.replayFilter = r ? function() {
|
|
937
|
+
return Se(r(), n());
|
|
938
|
+
} : n, e.justLimit = t && !r;
|
|
939
|
+
}
|
|
940
|
+
function On(e, n) {
|
|
941
|
+
if (e.isPrimKey) return n.primaryKey;
|
|
942
|
+
var t = n.getIndexByKeyPath(e.index);
|
|
943
|
+
if (!t) throw new A.Schema("KeyPath " + e.index + " on object store " + n.name + " is not indexed");
|
|
944
|
+
return t;
|
|
945
|
+
}
|
|
946
|
+
function Wt(e, n, t) {
|
|
947
|
+
var r = On(e, n.schema);
|
|
948
|
+
return n.openCursor({ trans: t, values: !e.keysOnly, reverse: e.dir === "prev", unique: !!e.unique, query: { index: r, range: e.range } });
|
|
949
|
+
}
|
|
950
|
+
function Pn(e, n, t, r) {
|
|
951
|
+
var i = e.replayFilter ? Se(e.filter, e.replayFilter()) : e.filter;
|
|
952
|
+
if (e.or) {
|
|
953
|
+
var o = {}, a = function(u, c, f) {
|
|
954
|
+
var d, s;
|
|
955
|
+
i && !i(c, f, function(v) {
|
|
956
|
+
return c.stop(v);
|
|
957
|
+
}, function(v) {
|
|
958
|
+
return c.fail(v);
|
|
959
|
+
}) || ((s = "" + (d = c.primaryKey)) == "[object ArrayBuffer]" && (s = "" + new Uint8Array(d)), Z(o, s) || (o[s] = !0, n(u, c, f)));
|
|
960
|
+
};
|
|
961
|
+
return Promise.all([e.or._iterate(a, t), Yt(Wt(e, r, t), e.algorithm, a, !e.keysOnly && e.valueMapper)]);
|
|
962
|
+
}
|
|
963
|
+
return Yt(Wt(e, r, t), Se(e.algorithm, i), n, !e.keysOnly && e.valueMapper);
|
|
964
|
+
}
|
|
965
|
+
function Yt(e, n, t, r) {
|
|
966
|
+
var i = N(r ? function(o, a, u) {
|
|
967
|
+
return t(r(o), a, u);
|
|
968
|
+
} : t);
|
|
969
|
+
return e.then(function(o) {
|
|
970
|
+
if (o) return o.start(function() {
|
|
971
|
+
var a = function() {
|
|
972
|
+
return o.continue();
|
|
973
|
+
};
|
|
974
|
+
n && !n(o, function(u) {
|
|
975
|
+
return a = u;
|
|
976
|
+
}, function(u) {
|
|
977
|
+
o.stop(u), a = F;
|
|
978
|
+
}, function(u) {
|
|
979
|
+
o.fail(u), a = F;
|
|
980
|
+
}) || i(o.value, o, function(u) {
|
|
981
|
+
return a = u;
|
|
982
|
+
}), a();
|
|
983
|
+
});
|
|
984
|
+
});
|
|
985
|
+
}
|
|
986
|
+
var nn = ($t.prototype.execute = function(e) {
|
|
987
|
+
var n = this["@@propmod"];
|
|
988
|
+
if (n.add !== void 0) {
|
|
989
|
+
var t = n.add;
|
|
990
|
+
if (L(t)) return cn(cn([], L(e) ? e : [], !0), t).sort();
|
|
991
|
+
if (typeof t == "number") return (Number(e) || 0) + t;
|
|
992
|
+
if (typeof t == "bigint") try {
|
|
993
|
+
return BigInt(e) + t;
|
|
994
|
+
} catch {
|
|
995
|
+
return BigInt(0) + t;
|
|
996
|
+
}
|
|
997
|
+
throw new TypeError("Invalid term ".concat(t));
|
|
998
|
+
}
|
|
999
|
+
if (n.remove !== void 0) {
|
|
1000
|
+
var r = n.remove;
|
|
1001
|
+
if (L(r)) return L(e) ? e.filter(function(i) {
|
|
1002
|
+
return !r.includes(i);
|
|
1003
|
+
}).sort() : [];
|
|
1004
|
+
if (typeof r == "number") return Number(e) - r;
|
|
1005
|
+
if (typeof r == "bigint") try {
|
|
1006
|
+
return BigInt(e) - r;
|
|
1007
|
+
} catch {
|
|
1008
|
+
return BigInt(0) - r;
|
|
1009
|
+
}
|
|
1010
|
+
throw new TypeError("Invalid subtrahend ".concat(r));
|
|
1011
|
+
}
|
|
1012
|
+
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;
|
|
1013
|
+
}, $t);
|
|
1014
|
+
function $t(e) {
|
|
1015
|
+
this["@@propmod"] = e;
|
|
1016
|
+
}
|
|
1017
|
+
var Dr = (R.prototype._read = function(e, n) {
|
|
1018
|
+
var t = this._ctx;
|
|
1019
|
+
return t.error ? t.table._trans(null, V.bind(null, t.error)) : t.table._trans("readonly", e).then(n);
|
|
1020
|
+
}, R.prototype._write = function(e) {
|
|
1021
|
+
var n = this._ctx;
|
|
1022
|
+
return n.error ? n.table._trans(null, V.bind(null, n.error)) : n.table._trans("readwrite", e, "locked");
|
|
1023
|
+
}, R.prototype._addAlgorithm = function(e) {
|
|
1024
|
+
var n = this._ctx;
|
|
1025
|
+
n.algorithm = Se(n.algorithm, e);
|
|
1026
|
+
}, R.prototype._iterate = function(e, n) {
|
|
1027
|
+
return Pn(this._ctx, e, n, this._ctx.table.core);
|
|
1028
|
+
}, R.prototype.clone = function(e) {
|
|
1029
|
+
var n = Object.create(this.constructor.prototype), t = Object.create(this._ctx);
|
|
1030
|
+
return e && ee(t, e), n._ctx = t, n;
|
|
1031
|
+
}, R.prototype.raw = function() {
|
|
1032
|
+
return this._ctx.valueMapper = null, this;
|
|
1033
|
+
}, R.prototype.each = function(e) {
|
|
1034
|
+
var n = this._ctx;
|
|
1035
|
+
return this._read(function(t) {
|
|
1036
|
+
return Pn(n, e, t, n.table.core);
|
|
1037
|
+
});
|
|
1038
|
+
}, R.prototype.count = function(e) {
|
|
1039
|
+
var n = this;
|
|
1040
|
+
return this._read(function(t) {
|
|
1041
|
+
var r = n._ctx, i = r.table.core;
|
|
1042
|
+
if (Ue(r, !0)) return i.count({ trans: t, query: { index: On(r, i.schema), range: r.range } }).then(function(a) {
|
|
1043
|
+
return Math.min(a, r.limit);
|
|
1044
|
+
});
|
|
1045
|
+
var o = 0;
|
|
1046
|
+
return Pn(r, function() {
|
|
1047
|
+
return ++o, !1;
|
|
1048
|
+
}, t, i).then(function() {
|
|
1049
|
+
return o;
|
|
1050
|
+
});
|
|
1051
|
+
}).then(e);
|
|
1052
|
+
}, R.prototype.sortBy = function(e, n) {
|
|
1053
|
+
var t = e.split(".").reverse(), r = t[0], i = t.length - 1;
|
|
1054
|
+
function o(c, f) {
|
|
1055
|
+
return f ? o(c[t[f]], f - 1) : c[r];
|
|
1056
|
+
}
|
|
1057
|
+
var a = this._ctx.dir === "next" ? 1 : -1;
|
|
1058
|
+
function u(c, f) {
|
|
1059
|
+
return q(o(c, i), o(f, i)) * a;
|
|
1060
|
+
}
|
|
1061
|
+
return this.toArray(function(c) {
|
|
1062
|
+
return c.sort(u);
|
|
1063
|
+
}).then(n);
|
|
1064
|
+
}, R.prototype.toArray = function(e) {
|
|
1065
|
+
var n = this;
|
|
1066
|
+
return this._read(function(t) {
|
|
1067
|
+
var r = n._ctx;
|
|
1068
|
+
if (r.dir === "next" && Ue(r, !0) && 0 < r.limit) {
|
|
1069
|
+
var i = r.valueMapper, o = On(r, r.table.core.schema);
|
|
1070
|
+
return r.table.core.query({ trans: t, limit: r.limit, values: !0, query: { index: o, range: r.range } }).then(function(u) {
|
|
1071
|
+
return u = u.result, i ? u.map(i) : u;
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
var a = [];
|
|
1075
|
+
return Pn(r, function(u) {
|
|
1076
|
+
return a.push(u);
|
|
1077
|
+
}, t, r.table.core).then(function() {
|
|
1078
|
+
return a;
|
|
1079
|
+
});
|
|
1080
|
+
}, e);
|
|
1081
|
+
}, R.prototype.offset = function(e) {
|
|
1082
|
+
var n = this._ctx;
|
|
1083
|
+
return e <= 0 || (n.offset += e, Ue(n) ? tt(n, function() {
|
|
1084
|
+
var t = e;
|
|
1085
|
+
return function(r, i) {
|
|
1086
|
+
return t === 0 || (t === 1 ? --t : i(function() {
|
|
1087
|
+
r.advance(t), t = 0;
|
|
1088
|
+
}), !1);
|
|
1089
|
+
};
|
|
1090
|
+
}) : tt(n, function() {
|
|
1091
|
+
var t = e;
|
|
1092
|
+
return function() {
|
|
1093
|
+
return --t < 0;
|
|
1094
|
+
};
|
|
1095
|
+
})), this;
|
|
1096
|
+
}, R.prototype.limit = function(e) {
|
|
1097
|
+
return this._ctx.limit = Math.min(this._ctx.limit, e), tt(this._ctx, function() {
|
|
1098
|
+
var n = e;
|
|
1099
|
+
return function(t, r, i) {
|
|
1100
|
+
return --n <= 0 && r(i), 0 <= n;
|
|
1101
|
+
};
|
|
1102
|
+
}, !0), this;
|
|
1103
|
+
}, R.prototype.until = function(e, n) {
|
|
1104
|
+
return nt(this._ctx, function(t, r, i) {
|
|
1105
|
+
return !e(t.value) || (r(i), n);
|
|
1106
|
+
}), this;
|
|
1107
|
+
}, R.prototype.first = function(e) {
|
|
1108
|
+
return this.limit(1).toArray(function(n) {
|
|
1109
|
+
return n[0];
|
|
1110
|
+
}).then(e);
|
|
1111
|
+
}, R.prototype.last = function(e) {
|
|
1112
|
+
return this.reverse().first(e);
|
|
1113
|
+
}, R.prototype.filter = function(e) {
|
|
1114
|
+
var n;
|
|
1115
|
+
return nt(this._ctx, function(t) {
|
|
1116
|
+
return e(t.value);
|
|
1117
|
+
}), (n = this._ctx).isMatch = Se(n.isMatch, e), this;
|
|
1118
|
+
}, R.prototype.and = function(e) {
|
|
1119
|
+
return this.filter(e);
|
|
1120
|
+
}, R.prototype.or = function(e) {
|
|
1121
|
+
return new this.db.WhereClause(this._ctx.table, e, this);
|
|
1122
|
+
}, R.prototype.reverse = function() {
|
|
1123
|
+
return this._ctx.dir = this._ctx.dir === "prev" ? "next" : "prev", this._ondirectionchange && this._ondirectionchange(this._ctx.dir), this;
|
|
1124
|
+
}, R.prototype.desc = function() {
|
|
1125
|
+
return this.reverse();
|
|
1126
|
+
}, R.prototype.eachKey = function(e) {
|
|
1127
|
+
var n = this._ctx;
|
|
1128
|
+
return n.keysOnly = !n.isMatch, this.each(function(t, r) {
|
|
1129
|
+
e(r.key, r);
|
|
1130
|
+
});
|
|
1131
|
+
}, R.prototype.eachUniqueKey = function(e) {
|
|
1132
|
+
return this._ctx.unique = "unique", this.eachKey(e);
|
|
1133
|
+
}, R.prototype.eachPrimaryKey = function(e) {
|
|
1134
|
+
var n = this._ctx;
|
|
1135
|
+
return n.keysOnly = !n.isMatch, this.each(function(t, r) {
|
|
1136
|
+
e(r.primaryKey, r);
|
|
1137
|
+
});
|
|
1138
|
+
}, R.prototype.keys = function(e) {
|
|
1139
|
+
var n = this._ctx;
|
|
1140
|
+
n.keysOnly = !n.isMatch;
|
|
1141
|
+
var t = [];
|
|
1142
|
+
return this.each(function(r, i) {
|
|
1143
|
+
t.push(i.key);
|
|
1144
|
+
}).then(function() {
|
|
1145
|
+
return t;
|
|
1146
|
+
}).then(e);
|
|
1147
|
+
}, R.prototype.primaryKeys = function(e) {
|
|
1148
|
+
var n = this._ctx;
|
|
1149
|
+
if (n.dir === "next" && Ue(n, !0) && 0 < n.limit) return this._read(function(r) {
|
|
1150
|
+
var i = On(n, n.table.core.schema);
|
|
1151
|
+
return n.table.core.query({ trans: r, values: !1, limit: n.limit, query: { index: i, range: n.range } });
|
|
1152
|
+
}).then(function(r) {
|
|
1153
|
+
return r.result;
|
|
1154
|
+
}).then(e);
|
|
1155
|
+
n.keysOnly = !n.isMatch;
|
|
1156
|
+
var t = [];
|
|
1157
|
+
return this.each(function(r, i) {
|
|
1158
|
+
t.push(i.primaryKey);
|
|
1159
|
+
}).then(function() {
|
|
1160
|
+
return t;
|
|
1161
|
+
}).then(e);
|
|
1162
|
+
}, R.prototype.uniqueKeys = function(e) {
|
|
1163
|
+
return this._ctx.unique = "unique", this.keys(e);
|
|
1164
|
+
}, R.prototype.firstKey = function(e) {
|
|
1165
|
+
return this.limit(1).keys(function(n) {
|
|
1166
|
+
return n[0];
|
|
1167
|
+
}).then(e);
|
|
1168
|
+
}, R.prototype.lastKey = function(e) {
|
|
1169
|
+
return this.reverse().firstKey(e);
|
|
1170
|
+
}, R.prototype.distinct = function() {
|
|
1171
|
+
var e = this._ctx, e = e.index && e.table.schema.idxByName[e.index];
|
|
1172
|
+
if (!e || !e.multi) return this;
|
|
1173
|
+
var n = {};
|
|
1174
|
+
return nt(this._ctx, function(i) {
|
|
1175
|
+
var r = i.primaryKey.toString(), i = Z(n, r);
|
|
1176
|
+
return n[r] = !0, !i;
|
|
1177
|
+
}), this;
|
|
1178
|
+
}, R.prototype.modify = function(e) {
|
|
1179
|
+
var n = this, t = this._ctx;
|
|
1180
|
+
return this._write(function(r) {
|
|
1181
|
+
var i, o, a;
|
|
1182
|
+
a = typeof e == "function" ? e : (i = W(e), o = i.length, function(m) {
|
|
1183
|
+
for (var g = !1, b = 0; b < o; ++b) {
|
|
1184
|
+
var w = i[b], _ = e[w], O = ue(m, w);
|
|
1185
|
+
_ instanceof nn ? (ne(m, w, _.execute(O)), g = !0) : O !== _ && (ne(m, w, _), g = !0);
|
|
1186
|
+
}
|
|
1187
|
+
return g;
|
|
1188
|
+
});
|
|
1189
|
+
var u = t.table.core, s = u.schema.primaryKey, c = s.outbound, f = s.extractKey, d = 200, s = n.db._options.modifyChunkSize;
|
|
1190
|
+
s && (d = typeof s == "object" ? s[u.name] || s["*"] || 200 : s);
|
|
1191
|
+
function v(m, w) {
|
|
1192
|
+
var b = w.failures, w = w.numFailures;
|
|
1193
|
+
h += m - w;
|
|
1194
|
+
for (var _ = 0, O = W(b); _ < O.length; _++) {
|
|
1195
|
+
var x = O[_];
|
|
1196
|
+
l.push(b[x]);
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
var l = [], h = 0, y = [], p = e === Gt;
|
|
1200
|
+
return n.clone().primaryKeys().then(function(m) {
|
|
1201
|
+
function g(w) {
|
|
1202
|
+
var _ = Math.min(d, m.length - w), O = m.slice(w, w + _);
|
|
1203
|
+
return (p ? Promise.resolve([]) : u.getMany({ trans: r, keys: O, cache: "immutable" })).then(function(x) {
|
|
1204
|
+
var k = [], E = [], P = c ? [] : null, S = p ? O : [];
|
|
1205
|
+
if (!p) for (var D = 0; D < _; ++D) {
|
|
1206
|
+
var B = x[D], I = { value: be(B), primKey: m[w + D] };
|
|
1207
|
+
a.call(I, I.value, I) !== !1 && (I.value == null ? S.push(m[w + D]) : c || q(f(B), f(I.value)) === 0 ? (E.push(I.value), c && P.push(m[w + D])) : (S.push(m[w + D]), k.push(I.value)));
|
|
1208
|
+
}
|
|
1209
|
+
return Promise.resolve(0 < k.length && u.mutate({ trans: r, type: "add", values: k }).then(function(U) {
|
|
1210
|
+
for (var T in U.failures) S.splice(parseInt(T), 1);
|
|
1211
|
+
v(k.length, U);
|
|
1212
|
+
})).then(function() {
|
|
1213
|
+
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) {
|
|
1214
|
+
return v(E.length, U);
|
|
1215
|
+
});
|
|
1216
|
+
}).then(function() {
|
|
1217
|
+
return (0 < S.length || b && p) && u.mutate({ trans: r, type: "delete", keys: S, criteria: b, isAdditionalChunk: 0 < w }).then(function(U) {
|
|
1218
|
+
return kn(t.table, S, U);
|
|
1219
|
+
}).then(function(U) {
|
|
1220
|
+
return v(S.length, U);
|
|
1221
|
+
});
|
|
1222
|
+
}).then(function() {
|
|
1223
|
+
return m.length > w + _ && g(w + d);
|
|
1224
|
+
});
|
|
1225
|
+
});
|
|
1226
|
+
}
|
|
1227
|
+
var b = Ue(t) && t.limit === 1 / 0 && (typeof e != "function" || p) && { index: t.index, range: t.range };
|
|
1228
|
+
return g(0).then(function() {
|
|
1229
|
+
if (0 < l.length) throw new fn("Error modifying one or more objects", l, h, y);
|
|
1230
|
+
return m.length;
|
|
1231
|
+
});
|
|
1232
|
+
});
|
|
1233
|
+
});
|
|
1234
|
+
}, R.prototype.delete = function() {
|
|
1235
|
+
var e = this._ctx, n = e.range;
|
|
1236
|
+
return !Ue(e) || e.table.schema.yProps || !e.isPrimKey && n.type !== 3 ? this.modify(Gt) : this._write(function(t) {
|
|
1237
|
+
var r = e.table.core.schema.primaryKey, i = n;
|
|
1238
|
+
return e.table.core.count({ trans: t, query: { index: r, range: i } }).then(function(o) {
|
|
1239
|
+
return e.table.core.mutate({ trans: t, type: "deleteRange", range: i }).then(function(c) {
|
|
1240
|
+
var u = c.failures, c = c.numFailures;
|
|
1241
|
+
if (c) throw new fn("Could not delete some values", Object.keys(u).map(function(f) {
|
|
1242
|
+
return u[f];
|
|
1243
|
+
}), o - c);
|
|
1244
|
+
return o - c;
|
|
1245
|
+
});
|
|
1246
|
+
});
|
|
1247
|
+
});
|
|
1248
|
+
}, R);
|
|
1249
|
+
function R() {
|
|
1250
|
+
}
|
|
1251
|
+
var Gt = function(e, n) {
|
|
1252
|
+
return n.value = null;
|
|
1253
|
+
};
|
|
1254
|
+
function qr(e, n) {
|
|
1255
|
+
return e < n ? -1 : e === n ? 0 : 1;
|
|
1256
|
+
}
|
|
1257
|
+
function Br(e, n) {
|
|
1258
|
+
return n < e ? -1 : e === n ? 0 : 1;
|
|
1259
|
+
}
|
|
1260
|
+
function te(e, n, t) {
|
|
1261
|
+
return e = e instanceof Xt ? new e.Collection(e) : e, e._ctx.error = new (t || TypeError)(n), e;
|
|
1262
|
+
}
|
|
1263
|
+
function Ve(e) {
|
|
1264
|
+
return new e.Collection(e, function() {
|
|
1265
|
+
return Qt("");
|
|
1266
|
+
}).limit(0);
|
|
1267
|
+
}
|
|
1268
|
+
function En(e, n, t, r) {
|
|
1269
|
+
var i, o, a, u, c, f, d, s = t.length;
|
|
1270
|
+
if (!t.every(function(h) {
|
|
1271
|
+
return typeof h == "string";
|
|
1272
|
+
})) return te(e, Mt);
|
|
1273
|
+
function v(h) {
|
|
1274
|
+
i = h === "next" ? function(p) {
|
|
1275
|
+
return p.toUpperCase();
|
|
1276
|
+
} : function(p) {
|
|
1277
|
+
return p.toLowerCase();
|
|
1278
|
+
}, o = h === "next" ? function(p) {
|
|
1279
|
+
return p.toLowerCase();
|
|
1280
|
+
} : function(p) {
|
|
1281
|
+
return p.toUpperCase();
|
|
1282
|
+
}, a = h === "next" ? qr : Br;
|
|
1283
|
+
var y = t.map(function(p) {
|
|
1284
|
+
return { lower: o(p), upper: i(p) };
|
|
1285
|
+
}).sort(function(p, m) {
|
|
1286
|
+
return a(p.lower, m.lower);
|
|
1287
|
+
});
|
|
1288
|
+
u = y.map(function(p) {
|
|
1289
|
+
return p.upper;
|
|
1290
|
+
}), c = y.map(function(p) {
|
|
1291
|
+
return p.lower;
|
|
1292
|
+
}), d = (f = h) === "next" ? "" : r;
|
|
1293
|
+
}
|
|
1294
|
+
v("next"), e = new e.Collection(e, function() {
|
|
1295
|
+
return ve(u[0], c[s - 1] + r);
|
|
1296
|
+
}), e._ondirectionchange = function(h) {
|
|
1297
|
+
v(h);
|
|
1298
|
+
};
|
|
1299
|
+
var l = 0;
|
|
1300
|
+
return e._addAlgorithm(function(h, y, p) {
|
|
1301
|
+
var m = h.key;
|
|
1302
|
+
if (typeof m != "string") return !1;
|
|
1303
|
+
var g = o(m);
|
|
1304
|
+
if (n(g, c, l)) return !0;
|
|
1305
|
+
for (var b = null, w = l; w < s; ++w) {
|
|
1306
|
+
var _ = function(O, x, k, E, P, S) {
|
|
1307
|
+
for (var D = Math.min(O.length, E.length), B = -1, I = 0; I < D; ++I) {
|
|
1308
|
+
var U = x[I];
|
|
1309
|
+
if (U !== E[I]) return P(O[I], k[I]) < 0 ? O.substr(0, I) + k[I] + k.substr(I + 1) : P(O[I], E[I]) < 0 ? O.substr(0, I) + E[I] + k.substr(I + 1) : 0 <= B ? O.substr(0, B) + x[B] + k.substr(B + 1) : null;
|
|
1310
|
+
P(O[I], U) < 0 && (B = I);
|
|
1311
|
+
}
|
|
1312
|
+
return D < E.length && S === "next" ? O + k.substr(O.length) : D < O.length && S === "prev" ? O.substr(0, k.length) : B < 0 ? null : O.substr(0, B) + E[B] + k.substr(B + 1);
|
|
1313
|
+
}(m, g, u[w], c[w], a, f);
|
|
1314
|
+
_ === null && b === null ? l = w + 1 : (b === null || 0 < a(b, _)) && (b = _);
|
|
1315
|
+
}
|
|
1316
|
+
return y(b !== null ? function() {
|
|
1317
|
+
h.continue(b + d);
|
|
1318
|
+
} : p), !1;
|
|
1319
|
+
}), e;
|
|
1320
|
+
}
|
|
1321
|
+
function ve(e, n, t, r) {
|
|
1322
|
+
return { type: 2, lower: e, upper: n, lowerOpen: t, upperOpen: r };
|
|
1323
|
+
}
|
|
1324
|
+
function Qt(e) {
|
|
1325
|
+
return { type: 1, lower: e, upper: e };
|
|
1326
|
+
}
|
|
1327
|
+
var Xt = (Object.defineProperty($.prototype, "Collection", { get: function() {
|
|
1328
|
+
return this._ctx.table.db.Collection;
|
|
1329
|
+
}, enumerable: !1, configurable: !0 }), $.prototype.between = function(e, n, t, r) {
|
|
1330
|
+
t = t !== !1, r = r === !0;
|
|
1331
|
+
try {
|
|
1332
|
+
return 0 < this._cmp(e, n) || this._cmp(e, n) === 0 && (t || r) && (!t || !r) ? Ve(this) : new this.Collection(this, function() {
|
|
1333
|
+
return ve(e, n, !t, !r);
|
|
1334
|
+
});
|
|
1335
|
+
} catch {
|
|
1336
|
+
return te(this, ce);
|
|
1337
|
+
}
|
|
1338
|
+
}, $.prototype.equals = function(e) {
|
|
1339
|
+
return e == null ? te(this, ce) : new this.Collection(this, function() {
|
|
1340
|
+
return Qt(e);
|
|
1341
|
+
});
|
|
1342
|
+
}, $.prototype.above = function(e) {
|
|
1343
|
+
return e == null ? te(this, ce) : new this.Collection(this, function() {
|
|
1344
|
+
return ve(e, void 0, !0);
|
|
1345
|
+
});
|
|
1346
|
+
}, $.prototype.aboveOrEqual = function(e) {
|
|
1347
|
+
return e == null ? te(this, ce) : new this.Collection(this, function() {
|
|
1348
|
+
return ve(e, void 0, !1);
|
|
1349
|
+
});
|
|
1350
|
+
}, $.prototype.below = function(e) {
|
|
1351
|
+
return e == null ? te(this, ce) : new this.Collection(this, function() {
|
|
1352
|
+
return ve(void 0, e, !1, !0);
|
|
1353
|
+
});
|
|
1354
|
+
}, $.prototype.belowOrEqual = function(e) {
|
|
1355
|
+
return e == null ? te(this, ce) : new this.Collection(this, function() {
|
|
1356
|
+
return ve(void 0, e);
|
|
1357
|
+
});
|
|
1358
|
+
}, $.prototype.startsWith = function(e) {
|
|
1359
|
+
return typeof e != "string" ? te(this, Mt) : this.between(e, e + Ke, !0, !0);
|
|
1360
|
+
}, $.prototype.startsWithIgnoreCase = function(e) {
|
|
1361
|
+
return e === "" ? this.startsWith(e) : En(this, function(n, t) {
|
|
1362
|
+
return n.indexOf(t[0]) === 0;
|
|
1363
|
+
}, [e], Ke);
|
|
1364
|
+
}, $.prototype.equalsIgnoreCase = function(e) {
|
|
1365
|
+
return En(this, function(n, t) {
|
|
1366
|
+
return n === t[0];
|
|
1367
|
+
}, [e], "");
|
|
1368
|
+
}, $.prototype.anyOfIgnoreCase = function() {
|
|
1369
|
+
var e = se.apply(qe, arguments);
|
|
1370
|
+
return e.length === 0 ? Ve(this) : En(this, function(n, t) {
|
|
1371
|
+
return t.indexOf(n) !== -1;
|
|
1372
|
+
}, e, "");
|
|
1373
|
+
}, $.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1374
|
+
var e = se.apply(qe, arguments);
|
|
1375
|
+
return e.length === 0 ? Ve(this) : En(this, function(n, t) {
|
|
1376
|
+
return t.some(function(r) {
|
|
1377
|
+
return n.indexOf(r) === 0;
|
|
1378
|
+
});
|
|
1379
|
+
}, e, Ke);
|
|
1380
|
+
}, $.prototype.anyOf = function() {
|
|
1381
|
+
var e = this, n = se.apply(qe, arguments), t = this._cmp;
|
|
1382
|
+
try {
|
|
1383
|
+
n.sort(t);
|
|
1384
|
+
} catch {
|
|
1385
|
+
return te(this, ce);
|
|
1386
|
+
}
|
|
1387
|
+
if (n.length === 0) return Ve(this);
|
|
1388
|
+
var r = new this.Collection(this, function() {
|
|
1389
|
+
return ve(n[0], n[n.length - 1]);
|
|
1390
|
+
});
|
|
1391
|
+
r._ondirectionchange = function(o) {
|
|
1392
|
+
t = o === "next" ? e._ascending : e._descending, n.sort(t);
|
|
1393
|
+
};
|
|
1394
|
+
var i = 0;
|
|
1395
|
+
return r._addAlgorithm(function(o, a, u) {
|
|
1396
|
+
for (var c = o.key; 0 < t(c, n[i]); ) if (++i === n.length) return a(u), !1;
|
|
1397
|
+
return t(c, n[i]) === 0 || (a(function() {
|
|
1398
|
+
o.continue(n[i]);
|
|
1399
|
+
}), !1);
|
|
1400
|
+
}), r;
|
|
1401
|
+
}, $.prototype.notEqual = function(e) {
|
|
1402
|
+
return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
1403
|
+
}, $.prototype.noneOf = function() {
|
|
1404
|
+
var e = se.apply(qe, arguments);
|
|
1405
|
+
if (e.length === 0) return new this.Collection(this);
|
|
1406
|
+
try {
|
|
1407
|
+
e.sort(this._ascending);
|
|
1408
|
+
} catch {
|
|
1409
|
+
return te(this, ce);
|
|
1410
|
+
}
|
|
1411
|
+
var n = e.reduce(function(t, r) {
|
|
1412
|
+
return t ? t.concat([[t[t.length - 1][1], r]]) : [[-1 / 0, r]];
|
|
1413
|
+
}, null);
|
|
1414
|
+
return n.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(n, { includeLowers: !1, includeUppers: !1 });
|
|
1415
|
+
}, $.prototype.inAnyRange = function(m, n) {
|
|
1416
|
+
var t = this, r = this._cmp, i = this._ascending, o = this._descending, a = this._min, u = this._max;
|
|
1417
|
+
if (m.length === 0) return Ve(this);
|
|
1418
|
+
if (!m.every(function(g) {
|
|
1419
|
+
return g[0] !== void 0 && g[1] !== void 0 && i(g[0], g[1]) <= 0;
|
|
1420
|
+
})) 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);
|
|
1421
|
+
var c = !n || n.includeLowers !== !1, f = n && n.includeUppers === !0, d, s = i;
|
|
1422
|
+
function v(g, b) {
|
|
1423
|
+
return s(g[0], b[0]);
|
|
1424
|
+
}
|
|
1425
|
+
try {
|
|
1426
|
+
(d = m.reduce(function(g, b) {
|
|
1427
|
+
for (var w = 0, _ = g.length; w < _; ++w) {
|
|
1428
|
+
var O = g[w];
|
|
1429
|
+
if (r(b[0], O[1]) < 0 && 0 < r(b[1], O[0])) {
|
|
1430
|
+
O[0] = a(O[0], b[0]), O[1] = u(O[1], b[1]);
|
|
1431
|
+
break;
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
return w === _ && g.push(b), g;
|
|
1435
|
+
}, [])).sort(v);
|
|
1436
|
+
} catch {
|
|
1437
|
+
return te(this, ce);
|
|
1438
|
+
}
|
|
1439
|
+
var l = 0, h = f ? function(g) {
|
|
1440
|
+
return 0 < i(g, d[l][1]);
|
|
1441
|
+
} : function(g) {
|
|
1442
|
+
return 0 <= i(g, d[l][1]);
|
|
1443
|
+
}, y = c ? function(g) {
|
|
1444
|
+
return 0 < o(g, d[l][0]);
|
|
1445
|
+
} : function(g) {
|
|
1446
|
+
return 0 <= o(g, d[l][0]);
|
|
1447
|
+
}, p = h, m = new this.Collection(this, function() {
|
|
1448
|
+
return ve(d[0][0], d[d.length - 1][1], !c, !f);
|
|
1449
|
+
});
|
|
1450
|
+
return m._ondirectionchange = function(g) {
|
|
1451
|
+
s = g === "next" ? (p = h, i) : (p = y, o), d.sort(v);
|
|
1452
|
+
}, m._addAlgorithm(function(g, b, w) {
|
|
1453
|
+
for (var _, O = g.key; p(O); ) if (++l === d.length) return b(w), !1;
|
|
1454
|
+
return !h(_ = O) && !y(_) || (t._cmp(O, d[l][1]) === 0 || t._cmp(O, d[l][0]) === 0 || b(function() {
|
|
1455
|
+
s === i ? g.continue(d[l][0]) : g.continue(d[l][1]);
|
|
1456
|
+
}), !1);
|
|
1457
|
+
}), m;
|
|
1458
|
+
}, $.prototype.startsWithAnyOf = function() {
|
|
1459
|
+
var e = se.apply(qe, arguments);
|
|
1460
|
+
return e.every(function(n) {
|
|
1461
|
+
return typeof n == "string";
|
|
1462
|
+
}) ? e.length === 0 ? Ve(this) : this.inAnyRange(e.map(function(n) {
|
|
1463
|
+
return [n, n + Ke];
|
|
1464
|
+
})) : te(this, "startsWithAnyOf() only works with strings");
|
|
1465
|
+
}, $);
|
|
1466
|
+
function $() {
|
|
1467
|
+
}
|
|
1468
|
+
function oe(e) {
|
|
1469
|
+
return N(function(n) {
|
|
1470
|
+
return tn(n), e(n.target.error), !1;
|
|
1471
|
+
});
|
|
1472
|
+
}
|
|
1473
|
+
function tn(e) {
|
|
1474
|
+
e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
|
|
1475
|
+
}
|
|
1476
|
+
var rn = "storagemutated", rt = "x-storagemutated-1", me = Ze(null, rn), Rr = (ae.prototype._lock = function() {
|
|
1477
|
+
return Ye(!j.global), ++this._reculock, this._reculock !== 1 || j.global || (j.lockOwnerFor = this), this;
|
|
1478
|
+
}, ae.prototype._unlock = function() {
|
|
1479
|
+
if (Ye(!j.global), --this._reculock == 0) for (j.global || (j.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
|
|
1480
|
+
var e = this._blockedFuncs.shift();
|
|
1481
|
+
try {
|
|
1482
|
+
Ee(e[1], e[0]);
|
|
1483
|
+
} catch {
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
return this;
|
|
1487
|
+
}, ae.prototype._locked = function() {
|
|
1488
|
+
return this._reculock && j.lockOwnerFor !== this;
|
|
1489
|
+
}, ae.prototype.create = function(e) {
|
|
1490
|
+
var n = this;
|
|
1491
|
+
if (!this.mode) return this;
|
|
1492
|
+
var t = this.db.idbdb, r = this.db._state.dbOpenError;
|
|
1493
|
+
if (Ye(!this.idbtrans), !e && !t) switch (r && r.name) {
|
|
1494
|
+
case "DatabaseClosedError":
|
|
1495
|
+
throw new A.DatabaseClosed(r);
|
|
1496
|
+
case "MissingAPIError":
|
|
1497
|
+
throw new A.MissingAPI(r.message, r);
|
|
1498
|
+
default:
|
|
1499
|
+
throw new A.OpenFailed(r);
|
|
1500
|
+
}
|
|
1501
|
+
if (!this.active) throw new A.TransactionInactive();
|
|
1502
|
+
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) {
|
|
1503
|
+
tn(i), n._reject(e.error);
|
|
1504
|
+
}), e.onabort = N(function(i) {
|
|
1505
|
+
tn(i), n.active && n._reject(new A.Abort(e.error)), n.active = !1, n.on("abort").fire(i);
|
|
1506
|
+
}), e.oncomplete = N(function() {
|
|
1507
|
+
n.active = !1, n._resolve(), "mutatedParts" in e && me.storagemutated.fire(e.mutatedParts);
|
|
1508
|
+
}), this;
|
|
1509
|
+
}, ae.prototype._promise = function(e, n, t) {
|
|
1510
|
+
var r = this;
|
|
1511
|
+
if (e === "readwrite" && this.mode !== "readwrite") return V(new A.ReadOnly("Transaction is readonly"));
|
|
1512
|
+
if (!this.active) return V(new A.TransactionInactive());
|
|
1513
|
+
if (this._locked()) return new K(function(o, a) {
|
|
1514
|
+
r._blockedFuncs.push([function() {
|
|
1515
|
+
r._promise(e, n, t).then(o, a);
|
|
1516
|
+
}, j]);
|
|
1517
|
+
});
|
|
1518
|
+
if (t) return de(function() {
|
|
1519
|
+
var o = new K(function(a, u) {
|
|
1520
|
+
r._lock();
|
|
1521
|
+
var c = n(a, u, r);
|
|
1522
|
+
c && c.then && c.then(a, u);
|
|
1523
|
+
});
|
|
1524
|
+
return o.finally(function() {
|
|
1525
|
+
return r._unlock();
|
|
1526
|
+
}), o._lib = !0, o;
|
|
1527
|
+
});
|
|
1528
|
+
var i = new K(function(o, a) {
|
|
1529
|
+
var u = n(o, a, r);
|
|
1530
|
+
u && u.then && u.then(o, a);
|
|
1531
|
+
});
|
|
1532
|
+
return i._lib = !0, i;
|
|
1533
|
+
}, ae.prototype._root = function() {
|
|
1534
|
+
return this.parent ? this.parent._root() : this;
|
|
1535
|
+
}, ae.prototype.waitFor = function(e) {
|
|
1536
|
+
var n, t = this._root(), r = K.resolve(e);
|
|
1537
|
+
t._waitingFor ? t._waitingFor = t._waitingFor.then(function() {
|
|
1538
|
+
return r;
|
|
1539
|
+
}) : (t._waitingFor = r, t._waitingQueue = [], n = t.idbtrans.objectStore(t.storeNames[0]), function o() {
|
|
1540
|
+
for (++t._spinCount; t._waitingQueue.length; ) t._waitingQueue.shift()();
|
|
1541
|
+
t._waitingFor && (n.get(-1 / 0).onsuccess = o);
|
|
1542
|
+
}());
|
|
1543
|
+
var i = t._waitingFor;
|
|
1544
|
+
return new K(function(o, a) {
|
|
1545
|
+
r.then(function(u) {
|
|
1546
|
+
return t._waitingQueue.push(N(o.bind(null, u)));
|
|
1547
|
+
}, function(u) {
|
|
1548
|
+
return t._waitingQueue.push(N(a.bind(null, u)));
|
|
1549
|
+
}).finally(function() {
|
|
1550
|
+
t._waitingFor === i && (t._waitingFor = null);
|
|
1551
|
+
});
|
|
1552
|
+
});
|
|
1553
|
+
}, ae.prototype.abort = function() {
|
|
1554
|
+
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new A.Abort()));
|
|
1555
|
+
}, ae.prototype.table = function(e) {
|
|
1556
|
+
var n = this._memoizedTables || (this._memoizedTables = {});
|
|
1557
|
+
if (Z(n, e)) return n[e];
|
|
1558
|
+
var t = this.schema[e];
|
|
1559
|
+
if (!t) throw new A.NotFound("Table " + e + " not part of transaction");
|
|
1560
|
+
return t = new this.db.Table(e, t, this), t.core = this.db.core.table(e), n[e] = t;
|
|
1561
|
+
}, ae);
|
|
1562
|
+
function ae() {
|
|
1563
|
+
}
|
|
1564
|
+
function it(e, n, t, r, i, o, a, u) {
|
|
1565
|
+
return { name: e, keyPath: n, unique: t, multi: r, auto: i, compound: o, src: (t && !a ? "&" : "") + (r ? "*" : "") + (i ? "++" : "") + Ht(n), type: u };
|
|
1566
|
+
}
|
|
1567
|
+
function Ht(e) {
|
|
1568
|
+
return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
|
|
1569
|
+
}
|
|
1570
|
+
function ot(e, n, t) {
|
|
1571
|
+
return { name: e, primKey: n, indexes: t, mappedClass: null, idxByName: (r = function(i) {
|
|
1572
|
+
return [i.name, i];
|
|
1573
|
+
}, t.reduce(function(i, o, a) {
|
|
1574
|
+
return a = r(o, a), a && (i[a[0]] = a[1]), i;
|
|
1575
|
+
}, {})) };
|
|
1576
|
+
var r;
|
|
1577
|
+
}
|
|
1578
|
+
var on = function(e) {
|
|
1579
|
+
try {
|
|
1580
|
+
return e.only([[]]), on = function() {
|
|
1581
|
+
return [[]];
|
|
1582
|
+
}, [[]];
|
|
1583
|
+
} catch {
|
|
1584
|
+
return on = function() {
|
|
1585
|
+
return Ke;
|
|
1586
|
+
}, Ke;
|
|
1587
|
+
}
|
|
1588
|
+
};
|
|
1589
|
+
function at(e) {
|
|
1590
|
+
return e == null ? function() {
|
|
1591
|
+
} : typeof e == "string" ? (n = e).split(".").length === 1 ? function(t) {
|
|
1592
|
+
return t[n];
|
|
1593
|
+
} : function(t) {
|
|
1594
|
+
return ue(t, n);
|
|
1595
|
+
} : function(t) {
|
|
1596
|
+
return ue(t, e);
|
|
1597
|
+
};
|
|
1598
|
+
var n;
|
|
1599
|
+
}
|
|
1600
|
+
function Jt(e) {
|
|
1601
|
+
return [].slice.call(e);
|
|
1602
|
+
}
|
|
1603
|
+
var Fr = 0;
|
|
1604
|
+
function an(e) {
|
|
1605
|
+
return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
|
|
1606
|
+
}
|
|
1607
|
+
function Mr(e, n, c) {
|
|
1608
|
+
function r(p) {
|
|
1609
|
+
if (p.type === 3) return null;
|
|
1610
|
+
if (p.type === 4) throw new Error("Cannot convert never type to IDBKeyRange");
|
|
1611
|
+
var l = p.lower, h = p.upper, y = p.lowerOpen, p = p.upperOpen;
|
|
1612
|
+
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);
|
|
1613
|
+
}
|
|
1614
|
+
function i(v) {
|
|
1615
|
+
var l, h = v.name;
|
|
1616
|
+
return { name: h, schema: v, mutate: function(y) {
|
|
1617
|
+
var p = y.trans, m = y.type, g = y.keys, b = y.values, w = y.range;
|
|
1618
|
+
return new Promise(function(_, O) {
|
|
1619
|
+
_ = N(_);
|
|
1620
|
+
var x = p.objectStore(h), k = x.keyPath == null, E = m === "put" || m === "add";
|
|
1621
|
+
if (!E && m !== "delete" && m !== "deleteRange") throw new Error("Invalid operation type: " + m);
|
|
1622
|
+
var P, S = (g || b || { length: 1 }).length;
|
|
1623
|
+
if (g && b && g.length !== b.length) throw new Error("Given keys array must have same length as given values array.");
|
|
1624
|
+
if (S === 0) return _({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
1625
|
+
function D(J) {
|
|
1626
|
+
++U, tn(J);
|
|
1627
|
+
}
|
|
1628
|
+
var B = [], I = [], U = 0;
|
|
1629
|
+
if (m === "deleteRange") {
|
|
1630
|
+
if (w.type === 4) return _({ numFailures: U, failures: I, results: [], lastResult: void 0 });
|
|
1631
|
+
w.type === 3 ? B.push(P = x.clear()) : B.push(P = x.delete(r(w)));
|
|
1632
|
+
} else {
|
|
1633
|
+
var k = E ? k ? [b, g] : [b, null] : [g, null], T = k[0], X = k[1];
|
|
1634
|
+
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 = D;
|
|
1635
|
+
else for (H = 0; H < S; ++H) B.push(P = x[m](T[H])), P.onerror = D;
|
|
1636
|
+
}
|
|
1637
|
+
function Fn(J) {
|
|
1638
|
+
J = J.target.result, B.forEach(function(Ce, Ot) {
|
|
1639
|
+
return Ce.error != null && (I[Ot] = Ce.error);
|
|
1640
|
+
}), _({ numFailures: U, failures: I, results: m === "delete" ? g : B.map(function(Ce) {
|
|
1641
|
+
return Ce.result;
|
|
1642
|
+
}), lastResult: J });
|
|
1643
|
+
}
|
|
1644
|
+
P.onerror = function(J) {
|
|
1645
|
+
D(J), Fn(J);
|
|
1646
|
+
}, P.onsuccess = Fn;
|
|
1647
|
+
});
|
|
1648
|
+
}, getMany: function(y) {
|
|
1649
|
+
var p = y.trans, m = y.keys;
|
|
1650
|
+
return new Promise(function(g, b) {
|
|
1651
|
+
g = N(g);
|
|
1652
|
+
for (var w, _ = p.objectStore(h), O = m.length, x = new Array(O), k = 0, E = 0, P = function(B) {
|
|
1653
|
+
B = B.target, x[B._pos] = B.result, ++E === k && g(x);
|
|
1654
|
+
}, S = oe(b), D = 0; D < O; ++D) m[D] != null && ((w = _.get(m[D]))._pos = D, w.onsuccess = P, w.onerror = S, ++k);
|
|
1655
|
+
k === 0 && g(x);
|
|
1656
|
+
});
|
|
1657
|
+
}, get: function(y) {
|
|
1658
|
+
var p = y.trans, m = y.key;
|
|
1659
|
+
return new Promise(function(g, b) {
|
|
1660
|
+
g = N(g);
|
|
1661
|
+
var w = p.objectStore(h).get(m);
|
|
1662
|
+
w.onsuccess = function(_) {
|
|
1663
|
+
return g(_.target.result);
|
|
1664
|
+
}, w.onerror = oe(b);
|
|
1665
|
+
});
|
|
1666
|
+
}, query: (l = f, function(y) {
|
|
1667
|
+
return new Promise(function(p, m) {
|
|
1668
|
+
p = N(p);
|
|
1669
|
+
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);
|
|
1670
|
+
if (O === 0) return p({ result: [] });
|
|
1671
|
+
l ? ((x = _ ? E.getAll(P, x) : E.getAllKeys(P, x)).onsuccess = function(S) {
|
|
1672
|
+
return p({ result: S.target.result });
|
|
1673
|
+
}, x.onerror = oe(m)) : (g = 0, b = !_ && "openKeyCursor" in E ? E.openKeyCursor(P) : E.openCursor(P), w = [], b.onsuccess = function(S) {
|
|
1674
|
+
var D = b.result;
|
|
1675
|
+
return D ? (w.push(_ ? D.value : D.primaryKey), ++g === O ? p({ result: w }) : void D.continue()) : p({ result: w });
|
|
1676
|
+
}, b.onerror = oe(m));
|
|
1677
|
+
});
|
|
1678
|
+
}), openCursor: function(y) {
|
|
1679
|
+
var p = y.trans, m = y.values, g = y.query, b = y.reverse, w = y.unique;
|
|
1680
|
+
return new Promise(function(_, O) {
|
|
1681
|
+
_ = N(_);
|
|
1682
|
+
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);
|
|
1683
|
+
P.onerror = oe(O), P.onsuccess = N(function(S) {
|
|
1684
|
+
var D, B, I, U, T = P.result;
|
|
1685
|
+
T ? (T.___id = ++Fr, T.done = !1, D = T.continue.bind(T), B = (B = T.continuePrimaryKey) && B.bind(T), I = T.advance.bind(T), U = function() {
|
|
1686
|
+
throw new Error("Cursor not stopped");
|
|
1687
|
+
}, T.trans = p, T.stop = T.continue = T.continuePrimaryKey = T.advance = function() {
|
|
1688
|
+
throw new Error("Cursor not started");
|
|
1689
|
+
}, T.fail = N(O), T.next = function() {
|
|
1690
|
+
var X = this, H = 1;
|
|
1691
|
+
return this.start(function() {
|
|
1692
|
+
return H-- ? X.continue() : X.stop();
|
|
1693
|
+
}).then(function() {
|
|
1694
|
+
return X;
|
|
1695
|
+
});
|
|
1696
|
+
}, T.start = function(X) {
|
|
1697
|
+
function H() {
|
|
1698
|
+
if (P.result) try {
|
|
1699
|
+
X();
|
|
1700
|
+
} catch (J) {
|
|
1701
|
+
T.fail(J);
|
|
1702
|
+
}
|
|
1703
|
+
else T.done = !0, T.start = function() {
|
|
1704
|
+
throw new Error("Cursor behind last entry");
|
|
1705
|
+
}, T.stop();
|
|
1706
|
+
}
|
|
1707
|
+
var Fn = new Promise(function(J, Ce) {
|
|
1708
|
+
J = N(J), P.onerror = oe(Ce), T.fail = Ce, T.stop = function(Ot) {
|
|
1709
|
+
T.stop = T.continue = T.continuePrimaryKey = T.advance = U, J(Ot);
|
|
1710
|
+
};
|
|
1711
|
+
});
|
|
1712
|
+
return P.onsuccess = N(function(J) {
|
|
1713
|
+
P.onsuccess = H, H();
|
|
1714
|
+
}), T.continue = D, T.continuePrimaryKey = B, T.advance = I, H(), Fn;
|
|
1715
|
+
}, _(T)) : _(null);
|
|
1716
|
+
}, O);
|
|
1717
|
+
});
|
|
1718
|
+
}, count: function(y) {
|
|
1719
|
+
var p = y.query, m = y.trans, g = p.index, b = p.range;
|
|
1720
|
+
return new Promise(function(w, _) {
|
|
1721
|
+
var O = m.objectStore(h), x = g.isPrimaryKey ? O : O.index(g.name), O = r(b), x = O ? x.count(O) : x.count();
|
|
1722
|
+
x.onsuccess = N(function(k) {
|
|
1723
|
+
return w(k.target.result);
|
|
1724
|
+
}), x.onerror = oe(_);
|
|
1725
|
+
});
|
|
1726
|
+
} };
|
|
1727
|
+
}
|
|
1728
|
+
var o, a, u, d = (a = c, u = Jt((o = e).objectStoreNames), { schema: { name: o.name, tables: u.map(function(v) {
|
|
1729
|
+
return a.objectStore(v);
|
|
1730
|
+
}).map(function(v) {
|
|
1731
|
+
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: Jt(v.indexNames).map(function(m) {
|
|
1732
|
+
return v.index(m);
|
|
1733
|
+
}).map(function(w) {
|
|
1734
|
+
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) };
|
|
1735
|
+
return y[an(w)] = _;
|
|
1736
|
+
}), getIndexByKeyPath: function(m) {
|
|
1737
|
+
return y[an(m)];
|
|
1738
|
+
} };
|
|
1739
|
+
return y[":id"] = p.primaryKey, l != null && (y[an(l)] = p.primaryKey), p;
|
|
1740
|
+
}) }, 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 = {};
|
|
1741
|
+
return d.forEach(function(v) {
|
|
1742
|
+
return s[v.name] = v;
|
|
1743
|
+
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(v) {
|
|
1744
|
+
if (!s[v]) throw new Error("Table '".concat(v, "' not found"));
|
|
1745
|
+
return s[v];
|
|
1746
|
+
}, MIN_KEY: -1 / 0, MAX_KEY: on(n), schema: c };
|
|
1747
|
+
}
|
|
1748
|
+
function Nr(e, n, t, r) {
|
|
1749
|
+
var i = t.IDBKeyRange;
|
|
1750
|
+
return t.indexedDB, { dbcore: (r = Mr(n, i, r), e.dbcore.reduce(function(o, a) {
|
|
1751
|
+
return a = a.create, C(C({}, o), a(o));
|
|
1752
|
+
}, r)) };
|
|
1753
|
+
}
|
|
1754
|
+
function Kn(e, r) {
|
|
1755
|
+
var t = r.db, r = Nr(e._middlewares, t, e._deps, r);
|
|
1756
|
+
e.core = r.dbcore, e.tables.forEach(function(i) {
|
|
1757
|
+
var o = i.name;
|
|
1758
|
+
e.core.schema.tables.some(function(a) {
|
|
1759
|
+
return a.name === o;
|
|
1760
|
+
}) && (i.core = e.core.table(o), e[o] instanceof e.Table && (e[o].core = i.core));
|
|
1761
|
+
});
|
|
1762
|
+
}
|
|
1763
|
+
function Sn(e, n, t, r) {
|
|
1764
|
+
t.forEach(function(i) {
|
|
1765
|
+
var o = r[i];
|
|
1766
|
+
n.forEach(function(a) {
|
|
1767
|
+
var u = function c(f, d) {
|
|
1768
|
+
return mr(f, d) || (f = Te(f)) && c(f, d);
|
|
1769
|
+
}(a, i);
|
|
1770
|
+
(!u || "value" in u && u.value === void 0) && (a === e.Transaction.prototype || a instanceof e.Transaction ? fe(a, i, { get: function() {
|
|
1771
|
+
return this.table(i);
|
|
1772
|
+
}, set: function(c) {
|
|
1773
|
+
Pt(this, i, { value: c, writable: !0, configurable: !0, enumerable: !0 });
|
|
1774
|
+
} }) : a[i] = new e.Table(i, o));
|
|
1775
|
+
});
|
|
1776
|
+
});
|
|
1777
|
+
}
|
|
1778
|
+
function ut(e, n) {
|
|
1779
|
+
n.forEach(function(t) {
|
|
1780
|
+
for (var r in t) t[r] instanceof e.Table && delete t[r];
|
|
1781
|
+
});
|
|
1782
|
+
}
|
|
1783
|
+
function Lr(e, n) {
|
|
1784
|
+
return e._cfg.version - n._cfg.version;
|
|
1785
|
+
}
|
|
1786
|
+
function Ur(e, n, t, r) {
|
|
1787
|
+
var i = e._dbSchema;
|
|
1788
|
+
t.objectStoreNames.contains("$meta") && !i.$meta && (i.$meta = ot("$meta", er("")[0], []), e._storeNames.push("$meta"));
|
|
1789
|
+
var o = e._createTransaction("readwrite", e._storeNames, i);
|
|
1790
|
+
o.create(t), o._completion.catch(r);
|
|
1791
|
+
var a = o._reject.bind(o), u = j.transless || j;
|
|
1792
|
+
de(function() {
|
|
1793
|
+
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) {
|
|
1794
|
+
return d ?? f;
|
|
1795
|
+
}) : K.resolve(f)).then(function(d) {
|
|
1796
|
+
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) {
|
|
1797
|
+
return m._cfg.version >= v;
|
|
1798
|
+
})).length !== 0 ? (d.forEach(function(m) {
|
|
1799
|
+
y.push(function() {
|
|
1800
|
+
var g = p, b = m._cfg.dbschema;
|
|
1801
|
+
Cn(s, g, h), Cn(s, b, h), p = s._dbSchema = b;
|
|
1802
|
+
var w = st(g, b);
|
|
1803
|
+
w.add.forEach(function(E) {
|
|
1804
|
+
ct(h, E[0], E[1].primKey, E[1].indexes);
|
|
1805
|
+
}), w.change.forEach(function(E) {
|
|
1806
|
+
if (E.recreate) throw new A.Upgrade("Not yet support for changing primary key");
|
|
1807
|
+
var P = h.objectStore(E.name);
|
|
1808
|
+
E.add.forEach(function(S) {
|
|
1809
|
+
return jn(P, S);
|
|
1810
|
+
}), E.change.forEach(function(S) {
|
|
1811
|
+
P.deleteIndex(S.name), jn(P, S);
|
|
1812
|
+
}), E.del.forEach(function(S) {
|
|
1813
|
+
return P.deleteIndex(S);
|
|
1814
|
+
});
|
|
1815
|
+
});
|
|
1816
|
+
var _ = m._cfg.contentUpgrade;
|
|
1817
|
+
if (_ && m._cfg.version > v) {
|
|
1818
|
+
Kn(s, h), l._memoizedTables = {};
|
|
1819
|
+
var O = St(b);
|
|
1820
|
+
w.del.forEach(function(E) {
|
|
1821
|
+
O[E] = g[E];
|
|
1822
|
+
}), ut(s, [s.Transaction.prototype]), Sn(s, [s.Transaction.prototype], W(O), O), l.schema = O;
|
|
1823
|
+
var x, k = Un(_);
|
|
1824
|
+
return k && Ne(), w = K.follow(function() {
|
|
1825
|
+
var E;
|
|
1826
|
+
(x = _(l)) && k && (E = pe.bind(null, null), x.then(E, E));
|
|
1827
|
+
}), x && typeof x.then == "function" ? K.resolve(x) : w.then(function() {
|
|
1828
|
+
return x;
|
|
1829
|
+
});
|
|
1830
|
+
}
|
|
1831
|
+
}), y.push(function(g) {
|
|
1832
|
+
var b, w, _ = m._cfg.dbschema;
|
|
1833
|
+
b = _, w = g, [].slice.call(w.db.objectStoreNames).forEach(function(O) {
|
|
1834
|
+
return b[O] == null && w.db.deleteObjectStore(O);
|
|
1835
|
+
}), ut(s, [s.Transaction.prototype]), Sn(s, [s.Transaction.prototype], s._storeNames, s._dbSchema), l.schema = s._dbSchema;
|
|
1836
|
+
}), y.push(function(g) {
|
|
1837
|
+
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) {
|
|
1838
|
+
return b !== "$meta";
|
|
1839
|
+
})) : g.objectStore("$meta").put(m._cfg.version, "version"));
|
|
1840
|
+
});
|
|
1841
|
+
}), function m() {
|
|
1842
|
+
return y.length ? K.resolve(y.shift()(l.idbtrans)).then(m) : K.resolve();
|
|
1843
|
+
}().then(function() {
|
|
1844
|
+
Zt(p, h);
|
|
1845
|
+
})) : K.resolve();
|
|
1846
|
+
var s, v, l, h, y, p;
|
|
1847
|
+
}).catch(a)) : (W(i).forEach(function(d) {
|
|
1848
|
+
ct(t, d, i[d].primKey, i[d].indexes);
|
|
1849
|
+
}), Kn(e, t), void K.follow(function() {
|
|
1850
|
+
return e.on.populate.fire(o);
|
|
1851
|
+
}).catch(a));
|
|
1852
|
+
var c, f;
|
|
1853
|
+
});
|
|
1854
|
+
}
|
|
1855
|
+
function Vr(e, n) {
|
|
1856
|
+
Zt(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");
|
|
1857
|
+
var t = An(0, e.idbdb, n);
|
|
1858
|
+
Cn(e, e._dbSchema, n);
|
|
1859
|
+
for (var r = 0, i = st(t, e._dbSchema).change; r < i.length; r++) {
|
|
1860
|
+
var o = function(a) {
|
|
1861
|
+
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 };
|
|
1862
|
+
var u = n.objectStore(a.name);
|
|
1863
|
+
a.add.forEach(function(c) {
|
|
1864
|
+
ie && console.debug("Dexie upgrade patch: Creating missing index ".concat(a.name, ".").concat(c.src)), jn(u, c);
|
|
1865
|
+
});
|
|
1866
|
+
}(i[r]);
|
|
1867
|
+
if (typeof o == "object") return o.value;
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
function st(e, n) {
|
|
1871
|
+
var t, r = { del: [], add: [], change: [] };
|
|
1872
|
+
for (t in e) n[t] || r.del.push(t);
|
|
1873
|
+
for (t in n) {
|
|
1874
|
+
var i = e[t], o = n[t];
|
|
1875
|
+
if (i) {
|
|
1876
|
+
var a = { name: t, def: o, recreate: !1, del: [], add: [], change: [] };
|
|
1877
|
+
if ("" + (i.primKey.keyPath || "") != "" + (o.primKey.keyPath || "") || i.primKey.auto !== o.primKey.auto) a.recreate = !0, r.change.push(a);
|
|
1878
|
+
else {
|
|
1879
|
+
var u = i.idxByName, c = o.idxByName, f = void 0;
|
|
1880
|
+
for (f in u) c[f] || a.del.push(f);
|
|
1881
|
+
for (f in c) {
|
|
1882
|
+
var d = u[f], s = c[f];
|
|
1883
|
+
d ? d.src !== s.src && a.change.push(s) : a.add.push(s);
|
|
1884
|
+
}
|
|
1885
|
+
(0 < a.del.length || 0 < a.add.length || 0 < a.change.length) && r.change.push(a);
|
|
1886
|
+
}
|
|
1887
|
+
} else r.add.push([t, o]);
|
|
1888
|
+
}
|
|
1889
|
+
return r;
|
|
1890
|
+
}
|
|
1891
|
+
function ct(e, n, t, r) {
|
|
1892
|
+
var i = e.db.createObjectStore(n, t.keyPath ? { keyPath: t.keyPath, autoIncrement: t.auto } : { autoIncrement: t.auto });
|
|
1893
|
+
return r.forEach(function(o) {
|
|
1894
|
+
return jn(i, o);
|
|
1895
|
+
}), i;
|
|
1896
|
+
}
|
|
1897
|
+
function Zt(e, n) {
|
|
1898
|
+
W(e).forEach(function(t) {
|
|
1899
|
+
n.db.objectStoreNames.contains(t) || (ie && console.debug("Dexie: Creating missing table", t), ct(n, t, e[t].primKey, e[t].indexes));
|
|
1900
|
+
});
|
|
1901
|
+
}
|
|
1902
|
+
function jn(e, n) {
|
|
1903
|
+
e.createIndex(n.name, n.keyPath, { unique: n.unique, multiEntry: n.multi });
|
|
1904
|
+
}
|
|
1905
|
+
function An(e, n, t) {
|
|
1906
|
+
var r = {};
|
|
1907
|
+
return ln(n.objectStoreNames, 0).forEach(function(i) {
|
|
1908
|
+
for (var o = t.objectStore(i), a = it(Ht(f = o.keyPath), f || "", !0, !1, !!o.autoIncrement, f && typeof f != "string", !0), u = [], c = 0; c < o.indexNames.length; ++c) {
|
|
1909
|
+
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);
|
|
1910
|
+
u.push(d);
|
|
1911
|
+
}
|
|
1912
|
+
r[i] = ot(i, a, u);
|
|
1913
|
+
}), r;
|
|
1914
|
+
}
|
|
1915
|
+
function Cn(e, n, t) {
|
|
1916
|
+
for (var r = t.db.objectStoreNames, i = 0; i < r.length; ++i) {
|
|
1917
|
+
var o = r[i], a = t.objectStore(o);
|
|
1918
|
+
e._hasGetAll = "getAll" in a;
|
|
1919
|
+
for (var u = 0; u < a.indexNames.length; ++u) {
|
|
1920
|
+
var c = a.indexNames[u], f = a.index(c).keyPath, d = typeof f == "string" ? f : "[" + ln(f).join("+") + "]";
|
|
1921
|
+
!n[o] || (f = n[o].idxByName[d]) && (f.name = c, delete n[o].idxByName[d], n[o].idxByName[c] = f);
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
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);
|
|
1925
|
+
}
|
|
1926
|
+
function er(e) {
|
|
1927
|
+
return e.split(",").map(function(n, t) {
|
|
1928
|
+
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;
|
|
1929
|
+
return it(i, o || null, /\&/.test(n), /\*/.test(n), /\+\+/.test(n), L(o), t === 0, r);
|
|
1930
|
+
});
|
|
1931
|
+
}
|
|
1932
|
+
var zr = (ze.prototype._createTableSchema = ot, ze.prototype._parseIndexSyntax = er, ze.prototype._parseStoresSpec = function(e, n) {
|
|
1933
|
+
var t = this;
|
|
1934
|
+
W(e).forEach(function(r) {
|
|
1935
|
+
if (e[r] !== null) {
|
|
1936
|
+
var i = t._parseIndexSyntax(e[r]), o = i.shift();
|
|
1937
|
+
if (!o) throw new A.Schema("Invalid schema for table " + r + ": " + e[r]);
|
|
1938
|
+
if (o.unique = !0, o.multi) throw new A.Schema("Primary key cannot be multiEntry*");
|
|
1939
|
+
i.forEach(function(a) {
|
|
1940
|
+
if (a.auto) throw new A.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
1941
|
+
if (!a.keyPath) throw new A.Schema("Index must have a name and cannot be an empty string");
|
|
1942
|
+
}), i = t._createTableSchema(r, o, i), n[r] = i;
|
|
1943
|
+
}
|
|
1944
|
+
});
|
|
1945
|
+
}, ze.prototype.stores = function(t) {
|
|
1946
|
+
var n = this.db;
|
|
1947
|
+
this._cfg.storesSource = this._cfg.storesSource ? ee(this._cfg.storesSource, t) : t;
|
|
1948
|
+
var t = n._versions, r = {}, i = {};
|
|
1949
|
+
return t.forEach(function(o) {
|
|
1950
|
+
ee(r, o._cfg.storesSource), i = o._cfg.dbschema = {}, o._parseStoresSpec(r, i);
|
|
1951
|
+
}), 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;
|
|
1952
|
+
}, ze.prototype.upgrade = function(e) {
|
|
1953
|
+
return this._cfg.contentUpgrade = zn(this._cfg.contentUpgrade || F, e), this;
|
|
1954
|
+
}, ze);
|
|
1955
|
+
function ze() {
|
|
1956
|
+
}
|
|
1957
|
+
function lt(e, n) {
|
|
1958
|
+
var t = e._dbNamesDB;
|
|
1959
|
+
return t || (t = e._dbNamesDB = new le(_n, { addons: [], indexedDB: e, IDBKeyRange: n })).version(1).stores({ dbnames: "name" }), t.table("dbnames");
|
|
1960
|
+
}
|
|
1961
|
+
function ft(e) {
|
|
1962
|
+
return e && typeof e.databases == "function";
|
|
1963
|
+
}
|
|
1964
|
+
function ht(e) {
|
|
1965
|
+
return de(function() {
|
|
1966
|
+
return j.letThrough = !0, e();
|
|
1967
|
+
});
|
|
1968
|
+
}
|
|
1969
|
+
function dt(e) {
|
|
1970
|
+
return !("from" in e);
|
|
1971
|
+
}
|
|
1972
|
+
var Q = function(e, n) {
|
|
1973
|
+
if (!this) {
|
|
1974
|
+
var t = new Q();
|
|
1975
|
+
return e && "d" in e && ee(t, e), t;
|
|
1976
|
+
}
|
|
1977
|
+
ee(this, arguments.length ? { d: 1, from: e, to: 1 < arguments.length ? n : e } : { d: 0 });
|
|
1978
|
+
};
|
|
1979
|
+
function un(e, n, t) {
|
|
1980
|
+
var r = q(n, t);
|
|
1981
|
+
if (!isNaN(r)) {
|
|
1982
|
+
if (0 < r) throw RangeError();
|
|
1983
|
+
if (dt(e)) return ee(e, { from: n, to: t, d: 1 });
|
|
1984
|
+
var i = e.l, r = e.r;
|
|
1985
|
+
if (q(t, e.from) < 0) return i ? un(i, n, t) : e.l = { from: n, to: t, d: 1, l: null, r: null }, tr(e);
|
|
1986
|
+
if (0 < q(n, e.to)) return r ? un(r, n, t) : e.r = { from: n, to: t, d: 1, l: null, r: null }, tr(e);
|
|
1987
|
+
q(n, e.from) < 0 && (e.from = n, e.l = null, e.d = r ? r.d + 1 : 1), 0 < q(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);
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
function sn(e, n) {
|
|
1991
|
+
dt(n) || function t(r, c) {
|
|
1992
|
+
var o = c.from, a = c.to, u = c.l, c = c.r;
|
|
1993
|
+
un(r, o, a), u && t(r, u), c && t(r, c);
|
|
1994
|
+
}(e, n);
|
|
1995
|
+
}
|
|
1996
|
+
function nr(e, n) {
|
|
1997
|
+
var t = Tn(n), r = t.next();
|
|
1998
|
+
if (r.done) return !1;
|
|
1999
|
+
for (var i = r.value, o = Tn(e), a = o.next(i.from), u = a.value; !r.done && !a.done; ) {
|
|
2000
|
+
if (q(u.from, i.to) <= 0 && 0 <= q(u.to, i.from)) return !0;
|
|
2001
|
+
q(i.from, u.from) < 0 ? i = (r = t.next(u.from)).value : u = (a = o.next(i.from)).value;
|
|
2002
|
+
}
|
|
2003
|
+
return !1;
|
|
2004
|
+
}
|
|
2005
|
+
function Tn(e) {
|
|
2006
|
+
var n = dt(e) ? null : { s: 0, n: e };
|
|
2007
|
+
return { next: function(t) {
|
|
2008
|
+
for (var r = 0 < arguments.length; n; ) switch (n.s) {
|
|
2009
|
+
case 0:
|
|
2010
|
+
if (n.s = 1, r) for (; n.n.l && q(t, n.n.from) < 0; ) n = { up: n, n: n.n.l, s: 1 };
|
|
2011
|
+
else for (; n.n.l; ) n = { up: n, n: n.n.l, s: 1 };
|
|
2012
|
+
case 1:
|
|
2013
|
+
if (n.s = 2, !r || q(t, n.n.to) <= 0) return { value: n.n, done: !1 };
|
|
2014
|
+
case 2:
|
|
2015
|
+
if (n.n.r) {
|
|
2016
|
+
n.s = 3, n = { up: n, n: n.n.r, s: 0 };
|
|
2017
|
+
continue;
|
|
2018
|
+
}
|
|
2019
|
+
case 3:
|
|
2020
|
+
n = n.up;
|
|
2021
|
+
}
|
|
2022
|
+
return { done: !0 };
|
|
2023
|
+
} };
|
|
2024
|
+
}
|
|
2025
|
+
function tr(e) {
|
|
2026
|
+
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" : "";
|
|
2027
|
+
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 = rr(t)), e.d = rr(e);
|
|
2028
|
+
}
|
|
2029
|
+
function rr(t) {
|
|
2030
|
+
var n = t.r, t = t.l;
|
|
2031
|
+
return (n ? t ? Math.max(n.d, t.d) : n.d : t ? t.d : 0) + 1;
|
|
2032
|
+
}
|
|
2033
|
+
function In(e, n) {
|
|
2034
|
+
return W(n).forEach(function(t) {
|
|
2035
|
+
e[t] ? sn(e[t], n[t]) : e[t] = function r(i) {
|
|
2036
|
+
var o, a, u = {};
|
|
2037
|
+
for (o in i) Z(i, o) && (a = i[o], u[o] = !a || typeof a != "object" || At.has(a.constructor) ? a : r(a));
|
|
2038
|
+
return u;
|
|
2039
|
+
}(n[t]);
|
|
2040
|
+
}), e;
|
|
2041
|
+
}
|
|
2042
|
+
function pt(e, n) {
|
|
2043
|
+
return e.all || n.all || Object.keys(e).some(function(t) {
|
|
2044
|
+
return n[t] && nr(n[t], e[t]);
|
|
2045
|
+
});
|
|
2046
|
+
}
|
|
2047
|
+
Ie(Q.prototype, ((re = { add: function(e) {
|
|
2048
|
+
return sn(this, e), this;
|
|
2049
|
+
}, addKey: function(e) {
|
|
2050
|
+
return un(this, e, e), this;
|
|
2051
|
+
}, addKeys: function(e) {
|
|
2052
|
+
var n = this;
|
|
2053
|
+
return e.forEach(function(t) {
|
|
2054
|
+
return un(n, t, t);
|
|
2055
|
+
}), this;
|
|
2056
|
+
}, hasKey: function(e) {
|
|
2057
|
+
var n = Tn(this).next(e).value;
|
|
2058
|
+
return n && q(n.from, e) <= 0 && 0 <= q(n.to, e);
|
|
2059
|
+
} })[Ln] = function() {
|
|
2060
|
+
return Tn(this);
|
|
2061
|
+
}, re));
|
|
2062
|
+
var je = {}, yt = {}, vt = !1;
|
|
2063
|
+
function Dn(e) {
|
|
2064
|
+
In(yt, e), vt || (vt = !0, setTimeout(function() {
|
|
2065
|
+
vt = !1, mt(yt, !(yt = {}));
|
|
2066
|
+
}, 0));
|
|
2067
|
+
}
|
|
2068
|
+
function mt(e, n) {
|
|
2069
|
+
n === void 0 && (n = !1);
|
|
2070
|
+
var t = /* @__PURE__ */ new Set();
|
|
2071
|
+
if (e.all) for (var r = 0, i = Object.values(je); r < i.length; r++) ir(a = i[r], e, t, n);
|
|
2072
|
+
else for (var o in e) {
|
|
2073
|
+
var a, u = /^idb\:\/\/(.*)\/(.*)\//.exec(o);
|
|
2074
|
+
u && (o = u[1], u = u[2], (a = je["idb://".concat(o, "/").concat(u)]) && ir(a, e, t, n));
|
|
2075
|
+
}
|
|
2076
|
+
t.forEach(function(c) {
|
|
2077
|
+
return c();
|
|
2078
|
+
});
|
|
2079
|
+
}
|
|
2080
|
+
function ir(e, n, t, r) {
|
|
2081
|
+
for (var i = [], o = 0, a = Object.entries(e.queries.query); o < a.length; o++) {
|
|
2082
|
+
for (var u = a[o], c = u[0], f = [], d = 0, s = u[1]; d < s.length; d++) {
|
|
2083
|
+
var v = s[d];
|
|
2084
|
+
pt(n, v.obsSet) ? v.subscribers.forEach(function(p) {
|
|
2085
|
+
return t.add(p);
|
|
2086
|
+
}) : r && f.push(v);
|
|
2087
|
+
}
|
|
2088
|
+
r && i.push([c, f]);
|
|
2089
|
+
}
|
|
2090
|
+
if (r) for (var l = 0, h = i; l < h.length; l++) {
|
|
2091
|
+
var y = h[l], c = y[0], f = y[1];
|
|
2092
|
+
e.queries.query[c] = f;
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
function Wr(e) {
|
|
2096
|
+
var n = e._state, t = e._deps.indexedDB;
|
|
2097
|
+
if (n.isBeingOpened || e.idbdb) return n.dbReadyPromise.then(function() {
|
|
2098
|
+
return n.dbOpenError ? V(n.dbOpenError) : e;
|
|
2099
|
+
});
|
|
2100
|
+
n.isBeingOpened = !0, n.dbOpenError = null, n.openComplete = !1;
|
|
2101
|
+
var r = n.openCanceller, i = Math.round(10 * e.verno), o = !1;
|
|
2102
|
+
function a() {
|
|
2103
|
+
if (n.openCanceller !== r) throw new A.DatabaseClosed("db.open() was cancelled");
|
|
2104
|
+
}
|
|
2105
|
+
function u() {
|
|
2106
|
+
return new K(function(v, l) {
|
|
2107
|
+
if (a(), !t) throw new A.MissingAPI();
|
|
2108
|
+
var h = e.name, y = n.autoSchema || !i ? t.open(h) : t.open(h, i);
|
|
2109
|
+
if (!y) throw new A.MissingAPI();
|
|
2110
|
+
y.onerror = oe(l), y.onblocked = N(e._fireOnBlocked), y.onupgradeneeded = N(function(p) {
|
|
2111
|
+
var m;
|
|
2112
|
+
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() {
|
|
2113
|
+
l(new A.NoSuchDatabase("Database ".concat(h, " doesnt exist")));
|
|
2114
|
+
})) : (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));
|
|
2115
|
+
}, l), y.onsuccess = N(function() {
|
|
2116
|
+
d = null;
|
|
2117
|
+
var p, m, g, b, w, _ = e.idbdb = y.result, O = ln(_.objectStoreNames);
|
|
2118
|
+
if (0 < O.length) try {
|
|
2119
|
+
var x = _.transaction((b = O).length === 1 ? b[0] : b, "readonly");
|
|
2120
|
+
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);
|
|
2121
|
+
else if (Cn(e, e._dbSchema, x), ((w = st(An(0, (w = e).idbdb, x), w._dbSchema)).add.length || w.change.some(function(k) {
|
|
2122
|
+
return k.add.length || k.change.length;
|
|
2123
|
+
})) && !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());
|
|
2124
|
+
Kn(e, x);
|
|
2125
|
+
} catch {
|
|
2126
|
+
}
|
|
2127
|
+
Le.push(e), _.onversionchange = N(function(k) {
|
|
2128
|
+
n.vcFired = !0, e.on("versionchange").fire(k);
|
|
2129
|
+
}), _.onclose = N(function(k) {
|
|
2130
|
+
e.on("close").fire(k);
|
|
2131
|
+
}), s && (w = e._deps, x = h, _ = w.indexedDB, w = w.IDBKeyRange, ft(_) || x === _n || lt(_, w).put({ name: x }).catch(F)), v();
|
|
2132
|
+
}, l);
|
|
2133
|
+
}).catch(function(v) {
|
|
2134
|
+
switch (v == null ? void 0 : v.name) {
|
|
2135
|
+
case "UnknownError":
|
|
2136
|
+
if (0 < n.PR1398_maxLoop) return n.PR1398_maxLoop--, console.warn("Dexie: Workaround for Chrome UnknownError on open()"), u();
|
|
2137
|
+
break;
|
|
2138
|
+
case "VersionError":
|
|
2139
|
+
if (0 < i) return i = 0, u();
|
|
2140
|
+
}
|
|
2141
|
+
return K.reject(v);
|
|
2142
|
+
});
|
|
2143
|
+
}
|
|
2144
|
+
var c, f = n.dbReadyResolve, d = null, s = !1;
|
|
2145
|
+
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) {
|
|
2146
|
+
function l() {
|
|
2147
|
+
return indexedDB.databases().finally(v);
|
|
2148
|
+
}
|
|
2149
|
+
c = setInterval(l, 100), l();
|
|
2150
|
+
}).finally(function() {
|
|
2151
|
+
return clearInterval(c);
|
|
2152
|
+
}) : Promise.resolve()).then(u)]).then(function() {
|
|
2153
|
+
return a(), n.onReadyBeingFired = [], K.resolve(ht(function() {
|
|
2154
|
+
return e.on.ready.fire(e.vip);
|
|
2155
|
+
})).then(function v() {
|
|
2156
|
+
if (0 < n.onReadyBeingFired.length) {
|
|
2157
|
+
var l = n.onReadyBeingFired.reduce(zn, F);
|
|
2158
|
+
return n.onReadyBeingFired = [], K.resolve(ht(function() {
|
|
2159
|
+
return l(e.vip);
|
|
2160
|
+
})).then(v);
|
|
2161
|
+
}
|
|
2162
|
+
});
|
|
2163
|
+
}).finally(function() {
|
|
2164
|
+
n.openCanceller === r && (n.onReadyBeingFired = null, n.isBeingOpened = !1);
|
|
2165
|
+
}).catch(function(v) {
|
|
2166
|
+
n.dbOpenError = v;
|
|
2167
|
+
try {
|
|
2168
|
+
d && d.abort();
|
|
2169
|
+
} catch {
|
|
2170
|
+
}
|
|
2171
|
+
return r === n.openCanceller && e._close(), V(v);
|
|
2172
|
+
}).finally(function() {
|
|
2173
|
+
n.openComplete = !0, f();
|
|
2174
|
+
}).then(function() {
|
|
2175
|
+
var v;
|
|
2176
|
+
return s && (v = {}, e.tables.forEach(function(l) {
|
|
2177
|
+
l.schema.indexes.forEach(function(h) {
|
|
2178
|
+
h.name && (v["idb://".concat(e.name, "/").concat(l.name, "/").concat(h.name)] = new Q(-1 / 0, [[[]]]));
|
|
2179
|
+
}), v["idb://".concat(e.name, "/").concat(l.name, "/")] = v["idb://".concat(e.name, "/").concat(l.name, "/:dels")] = new Q(-1 / 0, [[[]]]);
|
|
2180
|
+
}), me(rn).fire(v), mt(v, !0)), e;
|
|
2181
|
+
});
|
|
2182
|
+
}
|
|
2183
|
+
function gt(e) {
|
|
2184
|
+
function n(o) {
|
|
2185
|
+
return e.next(o);
|
|
2186
|
+
}
|
|
2187
|
+
var t = i(n), r = i(function(o) {
|
|
2188
|
+
return e.throw(o);
|
|
2189
|
+
});
|
|
2190
|
+
function i(o) {
|
|
2191
|
+
return function(c) {
|
|
2192
|
+
var u = o(c), c = u.value;
|
|
2193
|
+
return u.done ? c : c && typeof c.then == "function" ? c.then(t, r) : L(c) ? Promise.all(c).then(t, r) : t(c);
|
|
2194
|
+
};
|
|
2195
|
+
}
|
|
2196
|
+
return i(n)();
|
|
2197
|
+
}
|
|
2198
|
+
function qn(e, n, t) {
|
|
2199
|
+
for (var r = L(e) ? e.slice() : [e], i = 0; i < t; ++i) r.push(n);
|
|
2200
|
+
return r;
|
|
2201
|
+
}
|
|
2202
|
+
var Yr = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2203
|
+
return C(C({}, e), { table: function(n) {
|
|
2204
|
+
var t = e.table(n), r = t.schema, i = {}, o = [];
|
|
2205
|
+
function a(s, v, l) {
|
|
2206
|
+
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 });
|
|
2207
|
+
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) {
|
|
2208
|
+
return g.keyTail - b.keyTail;
|
|
2209
|
+
}), m;
|
|
2210
|
+
}
|
|
2211
|
+
n = a(r.primaryKey.keyPath, 0, r.primaryKey), i[":id"] = [n];
|
|
2212
|
+
for (var u = 0, c = r.indexes; u < c.length; u++) {
|
|
2213
|
+
var f = c[u];
|
|
2214
|
+
a(f.keyPath, 0, f);
|
|
2215
|
+
}
|
|
2216
|
+
function d(s) {
|
|
2217
|
+
var v, l = s.query.index;
|
|
2218
|
+
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: qn(v.lower, v.lowerOpen ? e.MAX_KEY : e.MIN_KEY, l), lowerOpen: !0, upper: qn(v.upper, v.upperOpen ? e.MIN_KEY : e.MAX_KEY, l), upperOpen: !0 }) } }) : s;
|
|
2219
|
+
}
|
|
2220
|
+
return C(C({}, t), { schema: C(C({}, r), { primaryKey: n, indexes: o, getIndexByKeyPath: function(s) {
|
|
2221
|
+
return (s = i[an(s)]) && s[0];
|
|
2222
|
+
} }), count: function(s) {
|
|
2223
|
+
return t.count(d(s));
|
|
2224
|
+
}, query: function(s) {
|
|
2225
|
+
return t.query(d(s));
|
|
2226
|
+
}, openCursor: function(s) {
|
|
2227
|
+
var v = s.query.index, l = v.keyTail, h = v.isVirtual, y = v.keyLength;
|
|
2228
|
+
return h ? t.openCursor(d(s)).then(function(m) {
|
|
2229
|
+
return m && p(m);
|
|
2230
|
+
}) : t.openCursor(s);
|
|
2231
|
+
function p(m) {
|
|
2232
|
+
return Object.create(m, { continue: { value: function(g) {
|
|
2233
|
+
g != null ? m.continue(qn(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();
|
|
2234
|
+
} }, continuePrimaryKey: { value: function(g, b) {
|
|
2235
|
+
m.continuePrimaryKey(qn(g, e.MAX_KEY, l), b);
|
|
2236
|
+
} }, primaryKey: { get: function() {
|
|
2237
|
+
return m.primaryKey;
|
|
2238
|
+
} }, key: { get: function() {
|
|
2239
|
+
var g = m.key;
|
|
2240
|
+
return y === 1 ? g[0] : g.slice(0, y);
|
|
2241
|
+
} }, value: { get: function() {
|
|
2242
|
+
return m.value;
|
|
2243
|
+
} } });
|
|
2244
|
+
}
|
|
2245
|
+
} });
|
|
2246
|
+
} });
|
|
2247
|
+
} };
|
|
2248
|
+
function bt(e, n, t, r) {
|
|
2249
|
+
return t = t || {}, r = r || "", W(e).forEach(function(i) {
|
|
2250
|
+
var o, a, u;
|
|
2251
|
+
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;
|
|
2252
|
+
}), W(n).forEach(function(i) {
|
|
2253
|
+
Z(e, i) || (t[r + i] = n[i]);
|
|
2254
|
+
}), t;
|
|
2255
|
+
}
|
|
2256
|
+
function wt(e, n) {
|
|
2257
|
+
return n.type === "delete" ? n.keys : n.keys || n.values.map(e.extractKey);
|
|
2258
|
+
}
|
|
2259
|
+
var $r = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2260
|
+
return C(C({}, e), { table: function(n) {
|
|
2261
|
+
var t = e.table(n), r = t.schema.primaryKey;
|
|
2262
|
+
return C(C({}, t), { mutate: function(i) {
|
|
2263
|
+
var o = j.trans, a = o.table(n).hook, u = a.deleting, c = a.creating, f = a.updating;
|
|
2264
|
+
switch (i.type) {
|
|
2265
|
+
case "add":
|
|
2266
|
+
if (c.fire === F) break;
|
|
2267
|
+
return o._promise("readwrite", function() {
|
|
2268
|
+
return d(i);
|
|
2269
|
+
}, !0);
|
|
2270
|
+
case "put":
|
|
2271
|
+
if (c.fire === F && f.fire === F) break;
|
|
2272
|
+
return o._promise("readwrite", function() {
|
|
2273
|
+
return d(i);
|
|
2274
|
+
}, !0);
|
|
2275
|
+
case "delete":
|
|
2276
|
+
if (u.fire === F) break;
|
|
2277
|
+
return o._promise("readwrite", function() {
|
|
2278
|
+
return d(i);
|
|
2279
|
+
}, !0);
|
|
2280
|
+
case "deleteRange":
|
|
2281
|
+
if (u.fire === F) break;
|
|
2282
|
+
return o._promise("readwrite", function() {
|
|
2283
|
+
return function s(v, l, h) {
|
|
2284
|
+
return t.query({ trans: v, values: !1, query: { index: r, range: l }, limit: h }).then(function(y) {
|
|
2285
|
+
var p = y.result;
|
|
2286
|
+
return d({ type: "delete", keys: p, trans: v }).then(function(m) {
|
|
2287
|
+
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);
|
|
2288
|
+
});
|
|
2289
|
+
});
|
|
2290
|
+
}(i.trans, i.range, 1e4);
|
|
2291
|
+
}, !0);
|
|
2292
|
+
}
|
|
2293
|
+
return t.mutate(i);
|
|
2294
|
+
function d(s) {
|
|
2295
|
+
var v, l, h, y = j.trans, p = s.keys || wt(r, s);
|
|
2296
|
+
if (!p) throw new Error("Keys missing");
|
|
2297
|
+
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) {
|
|
2298
|
+
var g = p.map(function(b, w) {
|
|
2299
|
+
var _, O, x, k = m[w], E = { onerror: null, onsuccess: null };
|
|
2300
|
+
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) {
|
|
2301
|
+
Z(x, P) ? x[P] = O[P] : ne(x, P, O[P]);
|
|
2302
|
+
}))), E;
|
|
2303
|
+
});
|
|
2304
|
+
return t.mutate(s).then(function(b) {
|
|
2305
|
+
for (var w = b.failures, _ = b.results, O = b.numFailures, b = b.lastResult, x = 0; x < p.length; ++x) {
|
|
2306
|
+
var k = (_ || p)[x], E = g[x];
|
|
2307
|
+
k == null ? E.onerror && E.onerror(w[x]) : E.onsuccess && E.onsuccess(s.type === "put" && m[x] ? s.values[x] : k);
|
|
2308
|
+
}
|
|
2309
|
+
return { failures: w, results: _, numFailures: O, lastResult: b };
|
|
2310
|
+
}).catch(function(b) {
|
|
2311
|
+
return g.forEach(function(w) {
|
|
2312
|
+
return w.onerror && w.onerror(b);
|
|
2313
|
+
}), Promise.reject(b);
|
|
2314
|
+
});
|
|
2315
|
+
});
|
|
2316
|
+
}
|
|
2317
|
+
} });
|
|
2318
|
+
} });
|
|
2319
|
+
} };
|
|
2320
|
+
function or(e, n, t) {
|
|
2321
|
+
try {
|
|
2322
|
+
if (!n || n.keys.length < e.length) return null;
|
|
2323
|
+
for (var r = [], i = 0, o = 0; i < n.keys.length && o < e.length; ++i) q(n.keys[i], e[o]) === 0 && (r.push(t ? be(n.values[i]) : n.values[i]), ++o);
|
|
2324
|
+
return r.length === e.length ? r : null;
|
|
2325
|
+
} catch {
|
|
2326
|
+
return null;
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
var Gr = { stack: "dbcore", level: -1, create: function(e) {
|
|
2330
|
+
return { table: function(n) {
|
|
2331
|
+
var t = e.table(n);
|
|
2332
|
+
return C(C({}, t), { getMany: function(r) {
|
|
2333
|
+
if (!r.cache) return t.getMany(r);
|
|
2334
|
+
var i = or(r.keys, r.trans._cache, r.cache === "clone");
|
|
2335
|
+
return i ? K.resolve(i) : t.getMany(r).then(function(o) {
|
|
2336
|
+
return r.trans._cache = { keys: r.keys, values: r.cache === "clone" ? be(o) : o }, o;
|
|
2337
|
+
});
|
|
2338
|
+
}, mutate: function(r) {
|
|
2339
|
+
return r.type !== "add" && (r.trans._cache = null), t.mutate(r);
|
|
2340
|
+
} });
|
|
2341
|
+
} };
|
|
2342
|
+
} };
|
|
2343
|
+
function ar(e, n) {
|
|
2344
|
+
return e.trans.mode === "readonly" && !!e.subscr && !e.trans.explicit && e.trans.db._options.cache !== "disabled" && !n.schema.primaryKey.outbound;
|
|
2345
|
+
}
|
|
2346
|
+
function ur(e, n) {
|
|
2347
|
+
switch (e) {
|
|
2348
|
+
case "query":
|
|
2349
|
+
return n.values && !n.unique;
|
|
2350
|
+
case "get":
|
|
2351
|
+
case "getMany":
|
|
2352
|
+
case "count":
|
|
2353
|
+
case "openCursor":
|
|
2354
|
+
return !1;
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
var Qr = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2358
|
+
var n = e.schema.name, t = new Q(e.MIN_KEY, e.MAX_KEY);
|
|
2359
|
+
return C(C({}, e), { transaction: function(r, i, o) {
|
|
2360
|
+
if (j.subscr && i !== "readonly") throw new A.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(j.querier));
|
|
2361
|
+
return e.transaction(r, i, o);
|
|
2362
|
+
}, table: function(r) {
|
|
2363
|
+
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) {
|
|
2364
|
+
return l.compound && l.keyPath.includes(a.keyPath);
|
|
2365
|
+
}), d = C(C({}, i), { mutate: function(l) {
|
|
2366
|
+
function h(P) {
|
|
2367
|
+
return P = "idb://".concat(n, "/").concat(r, "/").concat(P), b[P] || (b[P] = new Q());
|
|
2368
|
+
}
|
|
2369
|
+
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) {
|
|
2370
|
+
return P;
|
|
2371
|
+
}), l.values] : [], x = E[0], k = E[1], E = l.trans._cache;
|
|
2372
|
+
return L(x) ? (w.addKeys(x), (E = O === "delete" || x.length === k.length ? or(x, E) : null) || _.addKeys(x), (E || k) && (y = h, p = E, m = k, o.indexes.forEach(function(P) {
|
|
2373
|
+
var S = y(P.name || "");
|
|
2374
|
+
function D(I) {
|
|
2375
|
+
return I != null ? P.extractKey(I) : null;
|
|
2376
|
+
}
|
|
2377
|
+
function B(I) {
|
|
2378
|
+
return P.multiEntry && L(I) ? I.forEach(function(U) {
|
|
2379
|
+
return S.addKey(U);
|
|
2380
|
+
}) : S.addKey(I);
|
|
2381
|
+
}
|
|
2382
|
+
(p || m).forEach(function(I, X) {
|
|
2383
|
+
var T = p && D(p[X]), X = m && D(m[X]);
|
|
2384
|
+
q(T, X) !== 0 && (T != null && B(T), X != null && B(X));
|
|
2385
|
+
});
|
|
2386
|
+
}))) : 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) {
|
|
2387
|
+
return h(P.name).add(t);
|
|
2388
|
+
})), i.mutate(l).then(function(P) {
|
|
2389
|
+
return !x || l.type !== "add" && l.type !== "put" || (w.addKeys(P.results), f && f.forEach(function(S) {
|
|
2390
|
+
for (var D = l.values.map(function(T) {
|
|
2391
|
+
return S.extractKey(T);
|
|
2392
|
+
}), B = S.keyPath.findIndex(function(T) {
|
|
2393
|
+
return T === a.keyPath;
|
|
2394
|
+
}), I = 0, U = P.results.length; I < U; ++I) D[I][B] = P.results[I];
|
|
2395
|
+
h(S.name).addKeys(D);
|
|
2396
|
+
})), g.mutatedParts = In(g.mutatedParts || {}, b), P;
|
|
2397
|
+
});
|
|
2398
|
+
} }), s = function(h) {
|
|
2399
|
+
var y = h.query, h = y.index, y = y.range;
|
|
2400
|
+
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)];
|
|
2401
|
+
}, v = { get: function(l) {
|
|
2402
|
+
return [a, new Q(l.key)];
|
|
2403
|
+
}, getMany: function(l) {
|
|
2404
|
+
return [a, new Q().addKeys(l.keys)];
|
|
2405
|
+
}, count: s, query: s, openCursor: s };
|
|
2406
|
+
return W(v).forEach(function(l) {
|
|
2407
|
+
d[l] = function(h) {
|
|
2408
|
+
var y = j.subscr, p = !!y, m = ar(j, i) && ur(l, h) ? h.obsSet = {} : y;
|
|
2409
|
+
if (p) {
|
|
2410
|
+
var g = function(k) {
|
|
2411
|
+
return k = "idb://".concat(n, "/").concat(r, "/").concat(k), m[k] || (m[k] = new Q());
|
|
2412
|
+
}, b = g(""), w = g(":dels"), y = v[l](h), p = y[0], y = y[1];
|
|
2413
|
+
if ((l === "query" && p.isPrimaryKey && !h.values ? w : g(p.name || "")).add(y), !p.isPrimaryKey) {
|
|
2414
|
+
if (l !== "count") {
|
|
2415
|
+
var _ = l === "query" && c && h.values && i.query(C(C({}, h), { values: !1 }));
|
|
2416
|
+
return i[l].apply(this, arguments).then(function(k) {
|
|
2417
|
+
if (l === "query") {
|
|
2418
|
+
if (c && h.values) return _.then(function(D) {
|
|
2419
|
+
return D = D.result, b.addKeys(D), k;
|
|
2420
|
+
});
|
|
2421
|
+
var E = h.values ? k.result.map(u) : k.result;
|
|
2422
|
+
(h.values ? b : w).addKeys(E);
|
|
2423
|
+
} else if (l === "openCursor") {
|
|
2424
|
+
var P = k, S = h.values;
|
|
2425
|
+
return P && Object.create(P, { key: { get: function() {
|
|
2426
|
+
return w.addKey(P.primaryKey), P.key;
|
|
2427
|
+
} }, primaryKey: { get: function() {
|
|
2428
|
+
var D = P.primaryKey;
|
|
2429
|
+
return w.addKey(D), D;
|
|
2430
|
+
} }, value: { get: function() {
|
|
2431
|
+
return S && b.addKey(P.primaryKey), P.value;
|
|
2432
|
+
} } });
|
|
2433
|
+
}
|
|
2434
|
+
return k;
|
|
2435
|
+
});
|
|
2436
|
+
}
|
|
2437
|
+
w.add(t);
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
return i[l].apply(this, arguments);
|
|
2441
|
+
};
|
|
2442
|
+
}), d;
|
|
2443
|
+
} });
|
|
2444
|
+
} };
|
|
2445
|
+
function sr(e, n, t) {
|
|
2446
|
+
if (t.numFailures === 0) return n;
|
|
2447
|
+
if (n.type === "deleteRange") return null;
|
|
2448
|
+
var r = n.keys ? n.keys.length : "values" in n && n.values ? n.values.length : 1;
|
|
2449
|
+
return t.numFailures === r ? null : (n = C({}, n), L(n.keys) && (n.keys = n.keys.filter(function(i, o) {
|
|
2450
|
+
return !(o in t.failures);
|
|
2451
|
+
})), "values" in n && L(n.values) && (n.values = n.values.filter(function(i, o) {
|
|
2452
|
+
return !(o in t.failures);
|
|
2453
|
+
})), n);
|
|
2454
|
+
}
|
|
2455
|
+
function _t(e, n) {
|
|
2456
|
+
return t = e, ((r = n).lower === void 0 || (r.lowerOpen ? 0 < q(t, r.lower) : 0 <= q(t, r.lower))) && (e = e, (n = n).upper === void 0 || (n.upperOpen ? q(e, n.upper) < 0 : q(e, n.upper) <= 0));
|
|
2457
|
+
var t, r;
|
|
2458
|
+
}
|
|
2459
|
+
function cr(e, n, v, r, i, o) {
|
|
2460
|
+
if (!v || v.length === 0) return e;
|
|
2461
|
+
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) {
|
|
2462
|
+
var y = l, p = [];
|
|
2463
|
+
if (h.type === "add" || h.type === "put") for (var m = new Q(), g = h.values.length - 1; 0 <= g; --g) {
|
|
2464
|
+
var b, w = h.values[g], _ = f(w);
|
|
2465
|
+
m.hasKey(_) || (b = d(w), (u && L(b) ? b.some(function(P) {
|
|
2466
|
+
return _t(P, c);
|
|
2467
|
+
}) : _t(b, c)) && (m.addKey(_), p.push(w)));
|
|
2468
|
+
}
|
|
2469
|
+
switch (h.type) {
|
|
2470
|
+
case "add":
|
|
2471
|
+
var O = new Q().addKeys(n.values ? l.map(function(S) {
|
|
2472
|
+
return f(S);
|
|
2473
|
+
}) : l), y = l.concat(n.values ? p.filter(function(S) {
|
|
2474
|
+
return S = f(S), !O.hasKey(S) && (O.addKey(S), !0);
|
|
2475
|
+
}) : p.map(function(S) {
|
|
2476
|
+
return f(S);
|
|
2477
|
+
}).filter(function(S) {
|
|
2478
|
+
return !O.hasKey(S) && (O.addKey(S), !0);
|
|
2479
|
+
}));
|
|
2480
|
+
break;
|
|
2481
|
+
case "put":
|
|
2482
|
+
var x = new Q().addKeys(h.values.map(function(S) {
|
|
2483
|
+
return f(S);
|
|
2484
|
+
}));
|
|
2485
|
+
y = l.filter(function(S) {
|
|
2486
|
+
return !x.hasKey(n.values ? f(S) : S);
|
|
2487
|
+
}).concat(n.values ? p : p.map(function(S) {
|
|
2488
|
+
return f(S);
|
|
2489
|
+
}));
|
|
2490
|
+
break;
|
|
2491
|
+
case "delete":
|
|
2492
|
+
var k = new Q().addKeys(h.keys);
|
|
2493
|
+
y = l.filter(function(S) {
|
|
2494
|
+
return !k.hasKey(n.values ? f(S) : S);
|
|
2495
|
+
});
|
|
2496
|
+
break;
|
|
2497
|
+
case "deleteRange":
|
|
2498
|
+
var E = h.range;
|
|
2499
|
+
y = l.filter(function(S) {
|
|
2500
|
+
return !_t(f(S), E);
|
|
2501
|
+
});
|
|
2502
|
+
}
|
|
2503
|
+
return y;
|
|
2504
|
+
}, e);
|
|
2505
|
+
return v === e ? e : (v.sort(function(l, h) {
|
|
2506
|
+
return q(s(l), s(h)) || q(f(l), f(h));
|
|
2507
|
+
}), 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);
|
|
2508
|
+
}
|
|
2509
|
+
function lr(e, n) {
|
|
2510
|
+
return q(e.lower, n.lower) === 0 && q(e.upper, n.upper) === 0 && !!e.lowerOpen == !!n.lowerOpen && !!e.upperOpen == !!n.upperOpen;
|
|
2511
|
+
}
|
|
2512
|
+
function Xr(e, n) {
|
|
2513
|
+
return function(t, r, i, o) {
|
|
2514
|
+
if (t === void 0) return r !== void 0 ? -1 : 0;
|
|
2515
|
+
if (r === void 0) return 1;
|
|
2516
|
+
if ((r = q(t, r)) === 0) {
|
|
2517
|
+
if (i && o) return 0;
|
|
2518
|
+
if (i) return 1;
|
|
2519
|
+
if (o) return -1;
|
|
2520
|
+
}
|
|
2521
|
+
return r;
|
|
2522
|
+
}(e.lower, n.lower, e.lowerOpen, n.lowerOpen) <= 0 && 0 <= function(t, r, i, o) {
|
|
2523
|
+
if (t === void 0) return r !== void 0 ? 1 : 0;
|
|
2524
|
+
if (r === void 0) return -1;
|
|
2525
|
+
if ((r = q(t, r)) === 0) {
|
|
2526
|
+
if (i && o) return 0;
|
|
2527
|
+
if (i) return -1;
|
|
2528
|
+
if (o) return 1;
|
|
2529
|
+
}
|
|
2530
|
+
return r;
|
|
2531
|
+
}(e.upper, n.upper, e.upperOpen, n.upperOpen);
|
|
2532
|
+
}
|
|
2533
|
+
function Hr(e, n, t, r) {
|
|
2534
|
+
e.subscribers.add(t), r.addEventListener("abort", function() {
|
|
2535
|
+
var i, o;
|
|
2536
|
+
e.subscribers.delete(t), e.subscribers.size === 0 && (i = e, o = n, setTimeout(function() {
|
|
2537
|
+
i.subscribers.size === 0 && we(o, i);
|
|
2538
|
+
}, 3e3));
|
|
2539
|
+
});
|
|
2540
|
+
}
|
|
2541
|
+
var Jr = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
2542
|
+
var n = e.schema.name;
|
|
2543
|
+
return C(C({}, e), { transaction: function(t, r, i) {
|
|
2544
|
+
var o, a, u = e.transaction(t, r, i);
|
|
2545
|
+
return r === "readwrite" && (a = (o = new AbortController()).signal, i = function(c) {
|
|
2546
|
+
return function() {
|
|
2547
|
+
if (o.abort(), r === "readwrite") {
|
|
2548
|
+
for (var f = /* @__PURE__ */ new Set(), d = 0, s = t; d < s.length; d++) {
|
|
2549
|
+
var v = s[d], l = je["idb://".concat(n, "/").concat(v)];
|
|
2550
|
+
if (l) {
|
|
2551
|
+
var h = e.table(v), y = l.optimisticOps.filter(function(S) {
|
|
2552
|
+
return S.trans === u;
|
|
2553
|
+
});
|
|
2554
|
+
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) {
|
|
2555
|
+
return f.add(S);
|
|
2556
|
+
}));
|
|
2557
|
+
else if (0 < y.length) {
|
|
2558
|
+
l.optimisticOps = l.optimisticOps.filter(function(S) {
|
|
2559
|
+
return S.trans !== u;
|
|
2560
|
+
});
|
|
2561
|
+
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 = cr(x.res, x.req, y, h, x, k), x.dirty ? (we(O, x), x.subscribers.forEach(function(S) {
|
|
2562
|
+
return f.add(S);
|
|
2563
|
+
})) : k !== x.res && (x.res = k, x.promise = K.resolve({ result: k }))) : (x.dirty && we(O, x), x.subscribers.forEach(function(S) {
|
|
2564
|
+
return f.add(S);
|
|
2565
|
+
})));
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2568
|
+
}
|
|
2569
|
+
f.forEach(function(S) {
|
|
2570
|
+
return S();
|
|
2571
|
+
});
|
|
2572
|
+
}
|
|
2573
|
+
};
|
|
2574
|
+
}, u.addEventListener("abort", i(!1), { signal: a }), u.addEventListener("error", i(!1), { signal: a }), u.addEventListener("complete", i(!0), { signal: a })), u;
|
|
2575
|
+
}, table: function(t) {
|
|
2576
|
+
var r = e.table(t), i = r.schema.primaryKey;
|
|
2577
|
+
return C(C({}, r), { mutate: function(o) {
|
|
2578
|
+
var a = j.trans;
|
|
2579
|
+
if (i.outbound || a.db._options.cache === "disabled" || a.explicit || a.idbtrans.mode !== "readwrite") return r.mutate(o);
|
|
2580
|
+
var u = je["idb://".concat(n, "/").concat(t)];
|
|
2581
|
+
return u ? (a = r.mutate(o), o.type !== "add" && o.type !== "put" || !(50 <= o.values.length || wt(i, o).some(function(c) {
|
|
2582
|
+
return c == null;
|
|
2583
|
+
})) ? (u.optimisticOps.push(o), o.mutatedParts && Dn(o.mutatedParts), a.then(function(c) {
|
|
2584
|
+
0 < c.numFailures && (we(u.optimisticOps, o), (c = sr(0, o, c)) && u.optimisticOps.push(c), o.mutatedParts && Dn(o.mutatedParts));
|
|
2585
|
+
}), a.catch(function() {
|
|
2586
|
+
we(u.optimisticOps, o), o.mutatedParts && Dn(o.mutatedParts);
|
|
2587
|
+
})) : a.then(function(c) {
|
|
2588
|
+
var f = sr(0, C(C({}, o), { values: o.values.map(function(d, s) {
|
|
2589
|
+
var v;
|
|
2590
|
+
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);
|
|
2591
|
+
}) }), c);
|
|
2592
|
+
u.optimisticOps.push(f), queueMicrotask(function() {
|
|
2593
|
+
return o.mutatedParts && Dn(o.mutatedParts);
|
|
2594
|
+
});
|
|
2595
|
+
}), a) : r.mutate(o);
|
|
2596
|
+
}, query: function(o) {
|
|
2597
|
+
if (!ar(j, r) || !ur("query", o)) return r.query(o);
|
|
2598
|
+
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) {
|
|
2599
|
+
var g = je["idb://".concat(h, "/").concat(y)];
|
|
2600
|
+
if (!g) return [];
|
|
2601
|
+
if (!(y = g.queries[p])) return [null, !1, g, null];
|
|
2602
|
+
var b = y[(m.query ? m.query.index.name : null) || ""];
|
|
2603
|
+
if (!b) return [null, !1, g, null];
|
|
2604
|
+
switch (p) {
|
|
2605
|
+
case "query":
|
|
2606
|
+
var w = b.find(function(_) {
|
|
2607
|
+
return _.req.limit === m.limit && _.req.values === m.values && lr(_.req.query.range, m.query.range);
|
|
2608
|
+
});
|
|
2609
|
+
return w ? [w, !0, g, b] : [b.find(function(_) {
|
|
2610
|
+
return ("limit" in _.req ? _.req.limit : 1 / 0) >= m.limit && (!m.values || _.req.values) && Xr(_.req.query.range, m.query.range);
|
|
2611
|
+
}), !1, g, b];
|
|
2612
|
+
case "count":
|
|
2613
|
+
return w = b.find(function(_) {
|
|
2614
|
+
return lr(_.req.query.range, m.query.range);
|
|
2615
|
+
}), [w, !!w, g, b];
|
|
2616
|
+
}
|
|
2617
|
+
}(n, t, "query", o), d = f[0], s = f[1], v = f[2], l = f[3];
|
|
2618
|
+
return d && s ? d.obsSet = o.obsSet : (s = r.query(o).then(function(h) {
|
|
2619
|
+
var y = h.result;
|
|
2620
|
+
if (d && (d.res = y), a) {
|
|
2621
|
+
for (var p = 0, m = y.length; p < m; ++p) Object.freeze(y[p]);
|
|
2622
|
+
Object.freeze(y);
|
|
2623
|
+
} else h.result = be(y);
|
|
2624
|
+
return h;
|
|
2625
|
+
}).catch(function(h) {
|
|
2626
|
+
return l && d && we(l, d), Promise.reject(h);
|
|
2627
|
+
}), d = { obsSet: o.obsSet, promise: s, subscribers: /* @__PURE__ */ 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: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[o.query.index.name || ""] = l)), Hr(d, l, u, c), d.promise.then(function(h) {
|
|
2628
|
+
return { result: cr(h.result, o, v == null ? void 0 : v.optimisticOps, r, d, a) };
|
|
2629
|
+
});
|
|
2630
|
+
} });
|
|
2631
|
+
} });
|
|
2632
|
+
} };
|
|
2633
|
+
function Bn(e, n) {
|
|
2634
|
+
return new Proxy(e, { get: function(t, r, i) {
|
|
2635
|
+
return r === "db" ? n : Reflect.get(t, r, i);
|
|
2636
|
+
} });
|
|
2637
|
+
}
|
|
2638
|
+
var le = (z.prototype.version = function(e) {
|
|
2639
|
+
if (isNaN(e) || e < 0.1) throw new A.Type("Given version is not a positive number");
|
|
2640
|
+
if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new A.Schema("Cannot add version when database is open");
|
|
2641
|
+
this.verno = Math.max(this.verno, e);
|
|
2642
|
+
var n = this._versions, t = n.filter(function(r) {
|
|
2643
|
+
return r._cfg.version === e;
|
|
2644
|
+
})[0];
|
|
2645
|
+
return t || (t = new this.Version(e), n.push(t), n.sort(Lr), t.stores({}), this._state.autoSchema = !1, t);
|
|
2646
|
+
}, z.prototype._whenReady = function(e) {
|
|
2647
|
+
var n = this;
|
|
2648
|
+
return this.idbdb && (this._state.openComplete || j.letThrough || this._vip) ? e() : new K(function(t, r) {
|
|
2649
|
+
if (n._state.openComplete) return r(new A.DatabaseClosed(n._state.dbOpenError));
|
|
2650
|
+
if (!n._state.isBeingOpened) {
|
|
2651
|
+
if (!n._state.autoOpen) return void r(new A.DatabaseClosed());
|
|
2652
|
+
n.open().catch(F);
|
|
2653
|
+
}
|
|
2654
|
+
n._state.dbReadyPromise.then(t, r);
|
|
2655
|
+
}).then(e);
|
|
2656
|
+
}, z.prototype.use = function(e) {
|
|
2657
|
+
var n = e.stack, t = e.create, r = e.level, i = e.name;
|
|
2658
|
+
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) {
|
|
2659
|
+
return o.level - a.level;
|
|
2660
|
+
}), this;
|
|
2661
|
+
}, z.prototype.unuse = function(e) {
|
|
2662
|
+
var n = e.stack, t = e.name, r = e.create;
|
|
2663
|
+
return n && this._middlewares[n] && (this._middlewares[n] = this._middlewares[n].filter(function(i) {
|
|
2664
|
+
return r ? i.create !== r : !!t && i.name !== t;
|
|
2665
|
+
})), this;
|
|
2666
|
+
}, z.prototype.open = function() {
|
|
2667
|
+
var e = this;
|
|
2668
|
+
return Ee(he, function() {
|
|
2669
|
+
return Wr(e);
|
|
2670
|
+
});
|
|
2671
|
+
}, z.prototype._close = function() {
|
|
2672
|
+
this.on.close.fire(new CustomEvent("close"));
|
|
2673
|
+
var e = this._state, n = Le.indexOf(this);
|
|
2674
|
+
if (0 <= n && Le.splice(n, 1), this.idbdb) {
|
|
2675
|
+
try {
|
|
2676
|
+
this.idbdb.close();
|
|
2677
|
+
} catch {
|
|
2678
|
+
}
|
|
2679
|
+
this.idbdb = null;
|
|
2680
|
+
}
|
|
2681
|
+
e.isBeingOpened || (e.dbReadyPromise = new K(function(t) {
|
|
2682
|
+
e.dbReadyResolve = t;
|
|
2683
|
+
}), e.openCanceller = new K(function(t, r) {
|
|
2684
|
+
e.cancelOpen = r;
|
|
2685
|
+
}));
|
|
2686
|
+
}, z.prototype.close = function(t) {
|
|
2687
|
+
var n = (t === void 0 ? { disableAutoOpen: !0 } : t).disableAutoOpen, t = this._state;
|
|
2688
|
+
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);
|
|
2689
|
+
}, z.prototype.delete = function(e) {
|
|
2690
|
+
var n = this;
|
|
2691
|
+
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
2692
|
+
var t = 0 < arguments.length && typeof arguments[0] != "object", r = this._state;
|
|
2693
|
+
return new K(function(i, o) {
|
|
2694
|
+
function a() {
|
|
2695
|
+
n.close(e);
|
|
2696
|
+
var u = n._deps.indexedDB.deleteDatabase(n.name);
|
|
2697
|
+
u.onsuccess = N(function() {
|
|
2698
|
+
var c, f, d;
|
|
2699
|
+
c = n._deps, f = n.name, d = c.indexedDB, c = c.IDBKeyRange, ft(d) || f === _n || lt(d, c).delete(f).catch(F), i();
|
|
2700
|
+
}), u.onerror = oe(o), u.onblocked = n._fireOnBlocked;
|
|
2701
|
+
}
|
|
2702
|
+
if (t) throw new A.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
2703
|
+
r.isBeingOpened ? r.dbReadyPromise.then(a) : a();
|
|
2704
|
+
});
|
|
2705
|
+
}, z.prototype.backendDB = function() {
|
|
2706
|
+
return this.idbdb;
|
|
2707
|
+
}, z.prototype.isOpen = function() {
|
|
2708
|
+
return this.idbdb !== null;
|
|
2709
|
+
}, z.prototype.hasBeenClosed = function() {
|
|
2710
|
+
var e = this._state.dbOpenError;
|
|
2711
|
+
return e && e.name === "DatabaseClosed";
|
|
2712
|
+
}, z.prototype.hasFailed = function() {
|
|
2713
|
+
return this._state.dbOpenError !== null;
|
|
2714
|
+
}, z.prototype.dynamicallyOpened = function() {
|
|
2715
|
+
return this._state.autoSchema;
|
|
2716
|
+
}, Object.defineProperty(z.prototype, "tables", { get: function() {
|
|
2717
|
+
var e = this;
|
|
2718
|
+
return W(this._allTables).map(function(n) {
|
|
2719
|
+
return e._allTables[n];
|
|
2720
|
+
});
|
|
2721
|
+
}, enumerable: !1, configurable: !0 }), z.prototype.transaction = function() {
|
|
2722
|
+
var e = (function(n, t, r) {
|
|
2723
|
+
var i = arguments.length;
|
|
2724
|
+
if (i < 2) throw new A.InvalidArgument("Too few arguments");
|
|
2725
|
+
for (var o = new Array(i - 1); --i; ) o[i - 1] = arguments[i];
|
|
2726
|
+
return r = o.pop(), [n, jt(o), r];
|
|
2727
|
+
}).apply(this, arguments);
|
|
2728
|
+
return this._transaction.apply(this, e);
|
|
2729
|
+
}, z.prototype._transaction = function(e, n, t) {
|
|
2730
|
+
var r = this, i = j.trans;
|
|
2731
|
+
i && i.db === this && e.indexOf("!") === -1 || (i = null);
|
|
2732
|
+
var o, a, u = e.indexOf("?") !== -1;
|
|
2733
|
+
e = e.replace("!", "").replace("?", "");
|
|
2734
|
+
try {
|
|
2735
|
+
if (a = n.map(function(f) {
|
|
2736
|
+
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");
|
|
2737
|
+
return f;
|
|
2738
|
+
}), e == "r" || e === Zn) o = Zn;
|
|
2739
|
+
else {
|
|
2740
|
+
if (e != "rw" && e != et) throw new A.InvalidArgument("Invalid transaction mode: " + e);
|
|
2741
|
+
o = et;
|
|
2742
|
+
}
|
|
2743
|
+
if (i) {
|
|
2744
|
+
if (i.mode === Zn && o === et) {
|
|
2745
|
+
if (!u) throw new A.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
2746
|
+
i = null;
|
|
2747
|
+
}
|
|
2748
|
+
i && a.forEach(function(f) {
|
|
2749
|
+
if (i && i.storeNames.indexOf(f) === -1) {
|
|
2750
|
+
if (!u) throw new A.SubTransaction("Table " + f + " not included in parent transaction.");
|
|
2751
|
+
i = null;
|
|
2752
|
+
}
|
|
2753
|
+
}), u && i && !i.active && (i = null);
|
|
2754
|
+
}
|
|
2755
|
+
} catch (f) {
|
|
2756
|
+
return i ? i._promise(null, function(d, s) {
|
|
2757
|
+
s(f);
|
|
2758
|
+
}) : V(f);
|
|
2759
|
+
}
|
|
2760
|
+
var c = (function f(d, s, v, l, h) {
|
|
2761
|
+
return K.resolve().then(function() {
|
|
2762
|
+
var y = j.transless || j, p = d._createTransaction(s, v, d._dbSchema, l);
|
|
2763
|
+
if (p.explicit = !0, y = { trans: p, transless: y }, l) p.idbtrans = l.idbtrans;
|
|
2764
|
+
else try {
|
|
2765
|
+
p.create(), p.idbtrans._explicit = !0, d._state.PR1398_maxLoop = 3;
|
|
2766
|
+
} catch (b) {
|
|
2767
|
+
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() {
|
|
2768
|
+
return f(d, s, v, null, h);
|
|
2769
|
+
})) : V(b);
|
|
2770
|
+
}
|
|
2771
|
+
var m, g = Un(h);
|
|
2772
|
+
return g && Ne(), y = K.follow(function() {
|
|
2773
|
+
var b;
|
|
2774
|
+
(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)));
|
|
2775
|
+
}, y), (m && typeof m.then == "function" ? K.resolve(m).then(function(b) {
|
|
2776
|
+
return p.active ? b : V(new A.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
2777
|
+
}) : y.then(function() {
|
|
2778
|
+
return m;
|
|
2779
|
+
})).then(function(b) {
|
|
2780
|
+
return l && p._resolve(), p._completion.then(function() {
|
|
2781
|
+
return b;
|
|
2782
|
+
});
|
|
2783
|
+
}).catch(function(b) {
|
|
2784
|
+
return p._reject(b), V(b);
|
|
2785
|
+
});
|
|
2786
|
+
});
|
|
2787
|
+
}).bind(null, this, o, a, i, t);
|
|
2788
|
+
return i ? i._promise(o, c, "lock") : j.trans ? Ee(j.transless, function() {
|
|
2789
|
+
return r._whenReady(c);
|
|
2790
|
+
}) : this._whenReady(c);
|
|
2791
|
+
}, z.prototype.table = function(e) {
|
|
2792
|
+
if (!Z(this._allTables, e)) throw new A.InvalidTable("Table ".concat(e, " does not exist"));
|
|
2793
|
+
return this._allTables[e];
|
|
2794
|
+
}, z);
|
|
2795
|
+
function z(e, n) {
|
|
2796
|
+
var t = this;
|
|
2797
|
+
this._middlewares = {}, this.verno = 0;
|
|
2798
|
+
var r = z.dependencies;
|
|
2799
|
+
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;
|
|
2800
|
+
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 };
|
|
2801
|
+
f.dbReadyPromise = new K(function(s) {
|
|
2802
|
+
f.dbReadyResolve = s;
|
|
2803
|
+
}), f.openCanceller = new K(function(s, v) {
|
|
2804
|
+
f.cancelOpen = v;
|
|
2805
|
+
}), this._state = f, this.name = e, this.on = Ze(this, "populate", "blocked", "versionchange", "close", { ready: [zn, F] }), this.once = function(s, v) {
|
|
2806
|
+
var l = function() {
|
|
2807
|
+
for (var h = [], y = 0; y < arguments.length; y++) h[y] = arguments[y];
|
|
2808
|
+
t.on(s).unsubscribe(l), v.apply(t, h);
|
|
2809
|
+
};
|
|
2810
|
+
return t.on(s, l);
|
|
2811
|
+
}, this.on.ready.subscribe = Et(this.on.ready.subscribe, function(s) {
|
|
2812
|
+
return function(v, l) {
|
|
2813
|
+
z.vip(function() {
|
|
2814
|
+
var h, y = t._state;
|
|
2815
|
+
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() {
|
|
2816
|
+
h.on.ready.unsubscribe(v), h.on.ready.unsubscribe(p);
|
|
2817
|
+
}));
|
|
2818
|
+
});
|
|
2819
|
+
};
|
|
2820
|
+
}), this.Collection = (i = this, en(Dr.prototype, function(m, p) {
|
|
2821
|
+
this.db = i;
|
|
2822
|
+
var l = Nt, h = null;
|
|
2823
|
+
if (p) try {
|
|
2824
|
+
l = p();
|
|
2825
|
+
} catch (g) {
|
|
2826
|
+
h = g;
|
|
2827
|
+
}
|
|
2828
|
+
var y = m._ctx, p = y.table, m = p.hook.reading.fire;
|
|
2829
|
+
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 };
|
|
2830
|
+
})), this.Table = (o = this, en(zt.prototype, function(s, v, l) {
|
|
2831
|
+
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] });
|
|
2832
|
+
})), this.Transaction = (a = this, en(Rr.prototype, function(s, v, l, h, y) {
|
|
2833
|
+
var p = this;
|
|
2834
|
+
s !== "readonly" && v.forEach(function(m) {
|
|
2835
|
+
m = (m = l[m]) === null || m === void 0 ? void 0 : m.yProps, m && (v = v.concat(m.map(function(g) {
|
|
2836
|
+
return g.updatesTable;
|
|
2837
|
+
})));
|
|
2838
|
+
}), 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) {
|
|
2839
|
+
p._resolve = m, p._reject = g;
|
|
2840
|
+
}), this._completion.then(function() {
|
|
2841
|
+
p.active = !1, p.on.complete.fire();
|
|
2842
|
+
}, function(m) {
|
|
2843
|
+
var g = p.active;
|
|
2844
|
+
return p.active = !1, p.on.error.fire(m), p.parent ? p.parent._reject(m) : g && p.idbtrans && p.idbtrans.abort(), V(m);
|
|
2845
|
+
});
|
|
2846
|
+
})), this.Version = (u = this, en(zr.prototype, function(s) {
|
|
2847
|
+
this.db = u, this._cfg = { version: s, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
2848
|
+
})), this.WhereClause = (c = this, en(Xt.prototype, function(s, v, l) {
|
|
2849
|
+
if (this.db = c, this._ctx = { table: s, index: v === ":id" ? null : v, or: l }, this._cmp = this._ascending = q, this._descending = function(h, y) {
|
|
2850
|
+
return q(y, h);
|
|
2851
|
+
}, this._max = function(h, y) {
|
|
2852
|
+
return 0 < q(h, y) ? h : y;
|
|
2853
|
+
}, this._min = function(h, y) {
|
|
2854
|
+
return q(h, y) < 0 ? h : y;
|
|
2855
|
+
}, this._IDBKeyRange = c._deps.IDBKeyRange, !this._IDBKeyRange) throw new A.MissingAPI();
|
|
2856
|
+
})), this.on("versionchange", function(s) {
|
|
2857
|
+
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 });
|
|
2858
|
+
}), this.on("blocked", function(s) {
|
|
2859
|
+
!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));
|
|
2860
|
+
}), this._maxKey = on(n.IDBKeyRange), this._createTransaction = function(s, v, l, h) {
|
|
2861
|
+
return new t.Transaction(s, v, l, t._options.chromeTransactionDurability, h);
|
|
2862
|
+
}, this._fireOnBlocked = function(s) {
|
|
2863
|
+
t.on("blocked").fire(s), Le.filter(function(v) {
|
|
2864
|
+
return v.name === t.name && v !== t && !v._state.vcFired;
|
|
2865
|
+
}).map(function(v) {
|
|
2866
|
+
return v.on("versionchange").fire(s);
|
|
2867
|
+
});
|
|
2868
|
+
}, this.use(Gr), this.use(Jr), this.use(Qr), this.use(Yr), this.use($r);
|
|
2869
|
+
var d = new Proxy(this, { get: function(s, v, l) {
|
|
2870
|
+
if (v === "_vip") return !0;
|
|
2871
|
+
if (v === "table") return function(y) {
|
|
2872
|
+
return Bn(t.table(y), d);
|
|
2873
|
+
};
|
|
2874
|
+
var h = Reflect.get(s, v, l);
|
|
2875
|
+
return h instanceof zt ? Bn(h, d) : v === "tables" ? h.map(function(y) {
|
|
2876
|
+
return Bn(y, d);
|
|
2877
|
+
}) : v === "_createTransaction" ? function() {
|
|
2878
|
+
return Bn(h.apply(this, arguments), d);
|
|
2879
|
+
} : h;
|
|
2880
|
+
} });
|
|
2881
|
+
this.vip = d, r.forEach(function(s) {
|
|
2882
|
+
return s(t);
|
|
2883
|
+
});
|
|
2884
|
+
}
|
|
2885
|
+
var Rn, re = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", Zr = (xt.prototype.subscribe = function(e, n, t) {
|
|
2886
|
+
return this._subscribe(e && typeof e != "function" ? e : { next: e, error: n, complete: t });
|
|
2887
|
+
}, xt.prototype[re] = function() {
|
|
2888
|
+
return this;
|
|
2889
|
+
}, xt);
|
|
2890
|
+
function xt(e) {
|
|
2891
|
+
this._subscribe = e;
|
|
2892
|
+
}
|
|
2893
|
+
try {
|
|
2894
|
+
Rn = { indexedDB: G.indexedDB || G.mozIndexedDB || G.webkitIndexedDB || G.msIndexedDB, IDBKeyRange: G.IDBKeyRange || G.webkitIDBKeyRange };
|
|
2895
|
+
} catch {
|
|
2896
|
+
Rn = { indexedDB: null, IDBKeyRange: null };
|
|
2897
|
+
}
|
|
2898
|
+
function fr(e) {
|
|
2899
|
+
var n, t = !1, r = new Zr(function(i) {
|
|
2900
|
+
var o = Un(e), a, u = !1, c = {}, f = {}, d = { get closed() {
|
|
2901
|
+
return u;
|
|
2902
|
+
}, unsubscribe: function() {
|
|
2903
|
+
u || (u = !0, a && a.abort(), s && me.storagemutated.unsubscribe(l));
|
|
2904
|
+
} };
|
|
2905
|
+
i.start && i.start(d);
|
|
2906
|
+
var s = !1, v = function() {
|
|
2907
|
+
return Jn(h);
|
|
2908
|
+
}, l = function(y) {
|
|
2909
|
+
In(c, y), pt(f, c) && v();
|
|
2910
|
+
}, h = function() {
|
|
2911
|
+
var y, p, m;
|
|
2912
|
+
!u && Rn.indexedDB && (c = {}, y = {}, a && a.abort(), a = new AbortController(), m = function(g) {
|
|
2913
|
+
var b = Fe();
|
|
2914
|
+
try {
|
|
2915
|
+
o && Ne();
|
|
2916
|
+
var w = de(e, g);
|
|
2917
|
+
return w = o ? w.finally(pe) : w;
|
|
2918
|
+
} finally {
|
|
2919
|
+
b && Me();
|
|
2920
|
+
}
|
|
2921
|
+
}(p = { subscr: y, signal: a.signal, requery: v, querier: e, trans: null }), Promise.resolve(m).then(function(g) {
|
|
2922
|
+
t = !0, n = g, u || p.signal.aborted || (c = {}, function(b) {
|
|
2923
|
+
for (var w in b) if (Z(b, w)) return;
|
|
2924
|
+
return 1;
|
|
2925
|
+
}(f = y) || s || (me(rn, l), s = !0), Jn(function() {
|
|
2926
|
+
return !u && i.next && i.next(g);
|
|
2927
|
+
}));
|
|
2928
|
+
}, function(g) {
|
|
2929
|
+
t = !1, ["DatabaseClosedError", "AbortError"].includes(g == null ? void 0 : g.name) || u || Jn(function() {
|
|
2930
|
+
u || i.error && i.error(g);
|
|
2931
|
+
});
|
|
2932
|
+
}));
|
|
2933
|
+
};
|
|
2934
|
+
return setTimeout(v, 0), d;
|
|
2935
|
+
});
|
|
2936
|
+
return r.hasValue = function() {
|
|
2937
|
+
return t;
|
|
2938
|
+
}, r.getValue = function() {
|
|
2939
|
+
return n;
|
|
2940
|
+
}, r;
|
|
2941
|
+
}
|
|
2942
|
+
var Ae = le;
|
|
2943
|
+
function kt(e) {
|
|
2944
|
+
var n = ge;
|
|
2945
|
+
try {
|
|
2946
|
+
ge = !0, me.storagemutated.fire(e), mt(e, !0);
|
|
2947
|
+
} finally {
|
|
2948
|
+
ge = n;
|
|
2949
|
+
}
|
|
2950
|
+
}
|
|
2951
|
+
Ie(Ae, C(C({}, hn), { delete: function(e) {
|
|
2952
|
+
return new Ae(e, { addons: [] }).delete();
|
|
2953
|
+
}, exists: function(e) {
|
|
2954
|
+
return new Ae(e, { addons: [] }).open().then(function(n) {
|
|
2955
|
+
return n.close(), !0;
|
|
2956
|
+
}).catch("NoSuchDatabaseError", function() {
|
|
2957
|
+
return !1;
|
|
2958
|
+
});
|
|
2959
|
+
}, getDatabaseNames: function(e) {
|
|
2960
|
+
try {
|
|
2961
|
+
return n = Ae.dependencies, t = n.indexedDB, n = n.IDBKeyRange, (ft(t) ? Promise.resolve(t.databases()).then(function(r) {
|
|
2962
|
+
return r.map(function(i) {
|
|
2963
|
+
return i.name;
|
|
2964
|
+
}).filter(function(i) {
|
|
2965
|
+
return i !== _n;
|
|
2966
|
+
});
|
|
2967
|
+
}) : lt(t, n).toCollection().primaryKeys()).then(e);
|
|
2968
|
+
} catch {
|
|
2969
|
+
return V(new A.MissingAPI());
|
|
2970
|
+
}
|
|
2971
|
+
var n, t;
|
|
2972
|
+
}, defineClass: function() {
|
|
2973
|
+
return function(e) {
|
|
2974
|
+
ee(this, e);
|
|
2975
|
+
};
|
|
2976
|
+
}, ignoreTransaction: function(e) {
|
|
2977
|
+
return j.trans ? Ee(j.transless, e) : e();
|
|
2978
|
+
}, vip: ht, async: function(e) {
|
|
2979
|
+
return function() {
|
|
2980
|
+
try {
|
|
2981
|
+
var n = gt(e.apply(this, arguments));
|
|
2982
|
+
return n && typeof n.then == "function" ? n : K.resolve(n);
|
|
2983
|
+
} catch (t) {
|
|
2984
|
+
return V(t);
|
|
2985
|
+
}
|
|
2986
|
+
};
|
|
2987
|
+
}, spawn: function(e, n, t) {
|
|
2988
|
+
try {
|
|
2989
|
+
var r = gt(e.apply(t, n || []));
|
|
2990
|
+
return r && typeof r.then == "function" ? r : K.resolve(r);
|
|
2991
|
+
} catch (i) {
|
|
2992
|
+
return V(i);
|
|
2993
|
+
}
|
|
2994
|
+
}, currentTransaction: { get: function() {
|
|
2995
|
+
return j.trans || null;
|
|
2996
|
+
} }, waitFor: function(e, n) {
|
|
2997
|
+
return n = K.resolve(typeof e == "function" ? Ae.ignoreTransaction(e) : e).timeout(n || 6e4), j.trans ? j.trans.waitFor(n) : n;
|
|
2998
|
+
}, Promise: K, debug: { get: function() {
|
|
2999
|
+
return ie;
|
|
3000
|
+
}, set: function(e) {
|
|
3001
|
+
It(e);
|
|
3002
|
+
} }, derive: De, extend: ee, props: Ie, override: Et, Events: Ze, on: me, liveQuery: fr, extendObservabilitySet: In, getByKeyPath: ue, setByKeyPath: ne, delByKeyPath: function(e, n) {
|
|
3003
|
+
typeof n == "string" ? ne(e, n, void 0) : "length" in n && [].map.call(n, function(t) {
|
|
3004
|
+
ne(e, t, void 0);
|
|
3005
|
+
});
|
|
3006
|
+
}, shallowClone: St, deepClone: be, getObjectDiff: bt, cmp: q, asap: Kt, minKey: -1 / 0, addons: [], connections: Le, errnames: Vn, dependencies: Rn, cache: je, semVer: "4.2.0", version: "4.2.0".split(".").map(function(e) {
|
|
3007
|
+
return parseInt(e);
|
|
3008
|
+
}).reduce(function(e, n, t) {
|
|
3009
|
+
return e + n / Math.pow(10, 2 * t);
|
|
3010
|
+
}) })), Ae.maxKey = on(Ae.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (me(rn, function(e) {
|
|
3011
|
+
ge || (e = new CustomEvent(rt, { detail: e }), ge = !0, dispatchEvent(e), ge = !1);
|
|
3012
|
+
}), addEventListener(rt, function(e) {
|
|
3013
|
+
e = e.detail, ge || kt(e);
|
|
3014
|
+
}));
|
|
3015
|
+
var We, ge = !1, hr = function() {
|
|
3016
|
+
};
|
|
3017
|
+
return typeof BroadcastChannel < "u" && ((hr = function() {
|
|
3018
|
+
(We = new BroadcastChannel(rt)).onmessage = function(e) {
|
|
3019
|
+
return e.data && kt(e.data);
|
|
3020
|
+
};
|
|
3021
|
+
})(), typeof We.unref == "function" && We.unref(), me(rn, function(e) {
|
|
3022
|
+
ge || We.postMessage(e);
|
|
3023
|
+
})), typeof addEventListener < "u" && (addEventListener("pagehide", function(e) {
|
|
3024
|
+
if (!le.disableBfCache && e.persisted) {
|
|
3025
|
+
ie && console.debug("Dexie: handling persisted pagehide"), We != null && We.close();
|
|
3026
|
+
for (var n = 0, t = Le; n < t.length; n++) t[n].close({ disableAutoOpen: !1 });
|
|
3027
|
+
}
|
|
3028
|
+
}), addEventListener("pageshow", function(e) {
|
|
3029
|
+
!le.disableBfCache && e.persisted && (ie && console.debug("Dexie: handling persisted pageshow"), hr(), kt({ all: new Q(-1 / 0, [[]]) }));
|
|
3030
|
+
})), K.rejectionMapper = function(e, n) {
|
|
3031
|
+
return !e || e instanceof Be || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Tt[e.name] ? e : (n = new Tt[e.name](n || e.message, e), "stack" in e && fe(n, "stack", { get: function() {
|
|
3032
|
+
return this.inner.stack;
|
|
3033
|
+
} }), n);
|
|
3034
|
+
}, It(ie), C(le, Object.freeze({ __proto__: null, Dexie: le, liveQuery: fr, Entity: Lt, cmp: q, PropModification: nn, replacePrefix: function(e, n) {
|
|
3035
|
+
return new nn({ replacePrefix: [e, n] });
|
|
3036
|
+
}, add: function(e) {
|
|
3037
|
+
return new nn({ add: e });
|
|
3038
|
+
}, remove: function(e) {
|
|
3039
|
+
return new nn({ remove: e });
|
|
3040
|
+
}, default: le, RangeSet: Q, mergeRanges: sn, rangesOverlap: nr }), { default: le }), le;
|
|
3041
|
+
});
|
|
3042
|
+
})(pr);
|
|
3043
|
+
var ni = pr.exports;
|
|
3044
|
+
const oi = /* @__PURE__ */ ei(ni);
|
|
3045
|
+
export {
|
|
3046
|
+
oi as default
|
|
3047
|
+
};
|
|
3048
|
+
//# sourceMappingURL=dexie.min.mjs.map
|