@dialecte/core 0.1.13 → 0.1.14
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as qe, i as Ge } from "./index-B1qiHOqL.js";
|
|
2
|
-
import { g as fr, l as
|
|
2
|
+
import { g as fr, l as ye, o as dr, k as ur, s as ri, t as ai, C as fa, m as da } from "./merge-extensions-BWXwiKx1.js";
|
|
3
3
|
function cr(m, s) {
|
|
4
4
|
if (!m) return {};
|
|
5
5
|
const l = {};
|
|
@@ -13,7 +13,7 @@ function cr(m, s) {
|
|
|
13
13
|
}
|
|
14
14
|
return l;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function ii(m) {
|
|
17
17
|
const { stagedOperations: s, tagName: l, id: i } = m;
|
|
18
18
|
for (let d = s.length - 1; d >= 0; d--) {
|
|
19
19
|
const h = s[d];
|
|
@@ -62,7 +62,7 @@ function ti(m) {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function oi(m) {
|
|
66
66
|
const { rawRecords: s, stagedOperations: l, tagName: i } = m, d = new Map(
|
|
67
67
|
s.map((h) => [h.id, { ...h, status: "unchanged" }])
|
|
68
68
|
);
|
|
@@ -75,10 +75,10 @@ function ni(m) {
|
|
|
75
75
|
}
|
|
76
76
|
return Array.from(d.values());
|
|
77
77
|
}
|
|
78
|
-
async function
|
|
78
|
+
async function xe(m) {
|
|
79
79
|
const { context: s, ref: l } = m;
|
|
80
80
|
if (s.stagedOperations.length > 0) {
|
|
81
|
-
const d =
|
|
81
|
+
const d = ii({
|
|
82
82
|
stagedOperations: s.stagedOperations,
|
|
83
83
|
tagName: l.tagName,
|
|
84
84
|
id: l.id
|
|
@@ -97,43 +97,43 @@ async function Te(m) {
|
|
|
97
97
|
if (i)
|
|
98
98
|
return { ...i, status: "unchanged" };
|
|
99
99
|
}
|
|
100
|
-
async function
|
|
100
|
+
async function ha(m) {
|
|
101
101
|
const { context: s, refs: l } = m;
|
|
102
|
-
return Promise.all(l.map((i) =>
|
|
102
|
+
return Promise.all(l.map((i) => xe({ context: s, ref: i })));
|
|
103
103
|
}
|
|
104
|
-
async function
|
|
104
|
+
async function pa(m) {
|
|
105
105
|
const { context: s, tagName: l } = m, i = await s.store.getByTagName(l);
|
|
106
106
|
for (const d of i)
|
|
107
107
|
Xt(s) && s.recordCache.set(d.id, d);
|
|
108
|
-
return
|
|
108
|
+
return oi({ rawRecords: i, stagedOperations: s.stagedOperations, tagName: l });
|
|
109
109
|
}
|
|
110
|
-
async function
|
|
111
|
-
const { context: s, ref: l, tagName: i } = m, d = await
|
|
110
|
+
async function si(m) {
|
|
111
|
+
const { context: s, ref: l, tagName: i } = m, d = await xe({ context: s, ref: l });
|
|
112
112
|
if (!d) return;
|
|
113
113
|
const h = d.children.find((y) => y.tagName === i);
|
|
114
114
|
if (h)
|
|
115
|
-
return
|
|
115
|
+
return xe({ context: s, ref: h });
|
|
116
116
|
}
|
|
117
|
-
async function
|
|
118
|
-
const { context: s, ref: l, tagName: i } = m, d = await
|
|
117
|
+
async function ui(m) {
|
|
118
|
+
const { context: s, ref: l, tagName: i } = m, d = await xe({ context: s, ref: l });
|
|
119
119
|
if (!d) return [];
|
|
120
120
|
const h = d.children.filter((_) => _.tagName === i).map((_) => ({ tagName: i, id: _.id }));
|
|
121
|
-
return (await
|
|
121
|
+
return (await ha({ context: s, refs: h })).filter(
|
|
122
122
|
(_) => _ !== void 0
|
|
123
123
|
);
|
|
124
124
|
}
|
|
125
|
-
async function
|
|
125
|
+
async function ci(m) {
|
|
126
126
|
const { context: s, ref: l, options: i } = m, d = i?.depth ?? 1 / 0, h = i?.stopAtTagName, y = i?.order ?? "bottom-up", _ = [];
|
|
127
|
-
let D = await
|
|
127
|
+
let D = await xe({ context: s, ref: l });
|
|
128
128
|
for (; D?.parent && _.length < d; ) {
|
|
129
|
-
const F = D.parent, $ = await
|
|
129
|
+
const F = D.parent, $ = await xe({ context: s, ref: F });
|
|
130
130
|
if (!$ || (_.push($), h && $.tagName === h)) break;
|
|
131
131
|
D = $;
|
|
132
132
|
}
|
|
133
133
|
return y === "top-down" ? _.reverse() : _;
|
|
134
134
|
}
|
|
135
135
|
async function Nn(m) {
|
|
136
|
-
const { context: s, tagName: l, attributes: i } = m, d = await
|
|
136
|
+
const { context: s, tagName: l, attributes: i } = m, d = await pa({ context: s, tagName: l }), h = [];
|
|
137
137
|
for (const y of d)
|
|
138
138
|
mr({ record: y, attributeFilter: i }) && h.push(y);
|
|
139
139
|
return h;
|
|
@@ -156,50 +156,50 @@ function mr(m) {
|
|
|
156
156
|
}
|
|
157
157
|
return !0;
|
|
158
158
|
}
|
|
159
|
-
async function
|
|
159
|
+
async function li(m) {
|
|
160
160
|
const { context: s, dialecteConfig: l, ref: i, filter: d } = m;
|
|
161
|
-
return d ?
|
|
161
|
+
return d ? di({
|
|
162
162
|
context: s,
|
|
163
163
|
ref: i,
|
|
164
164
|
filter: d
|
|
165
|
-
}) :
|
|
165
|
+
}) : fi({
|
|
166
166
|
context: s,
|
|
167
167
|
dialecteConfig: l,
|
|
168
168
|
ref: i
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
|
-
async function
|
|
172
|
-
const { context: s, dialecteConfig: l, ref: i } = m, d = await
|
|
171
|
+
async function fi(m) {
|
|
172
|
+
const { context: s, dialecteConfig: l, ref: i } = m, d = await ya({ context: s, ref: i });
|
|
173
173
|
if (!d) return {};
|
|
174
|
-
const h =
|
|
174
|
+
const h = hi(d), y = [i.tagName, ...l.descendants[i.tagName]], _ = {};
|
|
175
175
|
for (const D of y)
|
|
176
176
|
_[D] = [];
|
|
177
177
|
for (const D of h)
|
|
178
178
|
_[D.tagName] && _[D.tagName].push(D);
|
|
179
179
|
return _;
|
|
180
180
|
}
|
|
181
|
-
async function
|
|
182
|
-
const { context: s, ref: l, filter: i } = m, d =
|
|
181
|
+
async function di(m) {
|
|
182
|
+
const { context: s, ref: l, filter: i } = m, d = ma(i), h = new Set(ga(i)), y = d[d.length - 1], _ = y.attributes ? await Nn({
|
|
183
183
|
context: s,
|
|
184
184
|
tagName: y.tagName,
|
|
185
185
|
attributes: y.attributes
|
|
186
|
-
}) : await
|
|
186
|
+
}) : await yi({
|
|
187
187
|
context: s,
|
|
188
188
|
tagName: y.tagName
|
|
189
189
|
}), D = /* @__PURE__ */ new Map();
|
|
190
190
|
for (const F of _) {
|
|
191
|
-
const $ = await
|
|
191
|
+
const $ = await pi({
|
|
192
192
|
context: s,
|
|
193
193
|
record: F,
|
|
194
194
|
targetRef: l
|
|
195
195
|
});
|
|
196
|
-
if ($.length !== 0 &&
|
|
196
|
+
if ($.length !== 0 && mi({ ancestry: $, conditions: d }))
|
|
197
197
|
for (const G of $)
|
|
198
198
|
h.has(G.tagName) && (D.has(G.tagName) || D.set(G.tagName, /* @__PURE__ */ new Map()), D.get(G.tagName).set(G.id, G));
|
|
199
199
|
}
|
|
200
|
-
return
|
|
200
|
+
return gi({ collected: D, collectTags: h });
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function hi(m) {
|
|
203
203
|
const s = [];
|
|
204
204
|
function l(i) {
|
|
205
205
|
if (i.tree?.length)
|
|
@@ -208,7 +208,7 @@ function ci(m) {
|
|
|
208
208
|
}
|
|
209
209
|
return l(m), s;
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function ma(m) {
|
|
212
212
|
const s = [
|
|
213
213
|
{
|
|
214
214
|
tagName: m.tagName,
|
|
@@ -217,35 +217,35 @@ function fa(m) {
|
|
|
217
217
|
}
|
|
218
218
|
];
|
|
219
219
|
return m.descendant && s.push(
|
|
220
|
-
...
|
|
220
|
+
...ma(m.descendant)
|
|
221
221
|
), s;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function ga(m) {
|
|
224
224
|
const s = [m.tagName];
|
|
225
|
-
return m.descendant && s.push(...
|
|
225
|
+
return m.descendant && s.push(...ga(m.descendant)), s;
|
|
226
226
|
}
|
|
227
|
-
async function
|
|
227
|
+
async function pi(m) {
|
|
228
228
|
const { context: s, record: l, targetRef: i } = m, d = [];
|
|
229
229
|
let h = l;
|
|
230
230
|
for (; h && h.id !== i.id; ) {
|
|
231
231
|
if (d.push(h), !h.parent) return [];
|
|
232
|
-
const y = await
|
|
232
|
+
const y = await xe({
|
|
233
233
|
context: s,
|
|
234
|
-
ref:
|
|
234
|
+
ref: ye(h.parent)
|
|
235
235
|
});
|
|
236
236
|
if (!y) return [];
|
|
237
237
|
h = y;
|
|
238
238
|
}
|
|
239
239
|
return !h || h.id !== i.id ? [] : (d.push(h), d);
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function mi(m) {
|
|
242
242
|
const { ancestry: s, conditions: l } = m;
|
|
243
243
|
return l.every((i) => s.some((h) => h.tagName !== i.tagName ? !1 : i.attributes ? mr({
|
|
244
244
|
record: h,
|
|
245
245
|
attributeFilter: i.attributes
|
|
246
246
|
}) : !0) || i.optional === !0);
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function gi(m) {
|
|
249
249
|
const { collected: s, collectTags: l } = m, i = {};
|
|
250
250
|
for (const d of l)
|
|
251
251
|
i[d] = [];
|
|
@@ -253,7 +253,7 @@ function di(m) {
|
|
|
253
253
|
l.has(d) && (i[d] = Array.from(h.values()));
|
|
254
254
|
return i;
|
|
255
255
|
}
|
|
256
|
-
async function
|
|
256
|
+
async function yi(m) {
|
|
257
257
|
const { context: s, tagName: l } = m;
|
|
258
258
|
return Nn({
|
|
259
259
|
context: s,
|
|
@@ -261,32 +261,32 @@ async function hi(m) {
|
|
|
261
261
|
attributes: {}
|
|
262
262
|
});
|
|
263
263
|
}
|
|
264
|
-
async function
|
|
264
|
+
async function Hr(m) {
|
|
265
265
|
const { context: s, ref: l, name: i } = m;
|
|
266
|
-
return ((await
|
|
266
|
+
return ((await xe({ context: s, ref: l }))?.attributes ?? []).find((_) => _.name === i)?.value ?? "";
|
|
267
267
|
}
|
|
268
|
-
async function
|
|
268
|
+
async function Zr(m) {
|
|
269
269
|
const { context: s, ref: l, name: i } = m;
|
|
270
|
-
return ((await
|
|
270
|
+
return ((await xe({ context: s, ref: l }))?.attributes ?? []).find((_) => _.name === i);
|
|
271
271
|
}
|
|
272
|
-
async function
|
|
272
|
+
async function Jr(m) {
|
|
273
273
|
const { context: s, ref: l } = m;
|
|
274
|
-
return ((await
|
|
274
|
+
return ((await xe({ context: s, ref: l }))?.attributes ?? []).reduce(
|
|
275
275
|
(h, y) => (h[y.name] = y.value ?? "", h),
|
|
276
276
|
{}
|
|
277
277
|
);
|
|
278
278
|
}
|
|
279
|
-
async function
|
|
279
|
+
async function ea(m) {
|
|
280
280
|
const { context: s, ref: l } = m;
|
|
281
|
-
return (await
|
|
281
|
+
return (await xe({ context: s, ref: l }))?.attributes ?? [];
|
|
282
282
|
}
|
|
283
|
-
async function
|
|
284
|
-
const { context: s, ref: l, options: i = {} } = m, { include: d, exclude: h, unwrap: y } = i, _ = await
|
|
283
|
+
async function ya(m) {
|
|
284
|
+
const { context: s, ref: l, options: i = {} } = m, { include: d, exclude: h, unwrap: y } = i, _ = await xe({ context: s, ref: l });
|
|
285
285
|
Ge(_, {
|
|
286
286
|
detail: "No record found for provided ref",
|
|
287
287
|
key: "ELEMENT_NOT_FOUND"
|
|
288
288
|
});
|
|
289
|
-
const D = await
|
|
289
|
+
const D = await va({
|
|
290
290
|
context: s,
|
|
291
291
|
record: _,
|
|
292
292
|
includeFilters: d ? [d] : void 0,
|
|
@@ -294,7 +294,7 @@ async function ha(m) {
|
|
|
294
294
|
});
|
|
295
295
|
return D ? y ? Ei({ tree: D, unwrapTagNames: y }) : D : dr({ record: _ });
|
|
296
296
|
}
|
|
297
|
-
async function
|
|
297
|
+
async function va(m) {
|
|
298
298
|
const { context: s, record: l, includeFilters: i, exclude: d } = m;
|
|
299
299
|
if (vi({ record: l, excludeFilters: d }))
|
|
300
300
|
return dr({ record: l });
|
|
@@ -305,7 +305,7 @@ async function pa(m) {
|
|
|
305
305
|
excludeFilters: d
|
|
306
306
|
}), _ = (await Promise.all(
|
|
307
307
|
h.map(
|
|
308
|
-
({ record: D, includeFilters: F }) =>
|
|
308
|
+
({ record: D, includeFilters: F }) => va({ context: s, record: D, includeFilters: F, exclude: d })
|
|
309
309
|
)
|
|
310
310
|
)).filter(
|
|
311
311
|
(D) => D !== null
|
|
@@ -325,9 +325,9 @@ async function wi(m) {
|
|
|
325
325
|
if (!l.children?.length) return [];
|
|
326
326
|
const _ = (await Promise.all(
|
|
327
327
|
l.children.map(
|
|
328
|
-
(D) =>
|
|
328
|
+
(D) => xe({
|
|
329
329
|
context: s,
|
|
330
|
-
ref:
|
|
330
|
+
ref: ye(D)
|
|
331
331
|
})
|
|
332
332
|
)
|
|
333
333
|
)).filter(
|
|
@@ -367,7 +367,7 @@ function Ei(m) {
|
|
|
367
367
|
}
|
|
368
368
|
return { ...s, tree: i(s.tree) };
|
|
369
369
|
}
|
|
370
|
-
class
|
|
370
|
+
class ba {
|
|
371
371
|
constructor(s, l) {
|
|
372
372
|
this.store = s, this.dialecteConfig = l;
|
|
373
373
|
}
|
|
@@ -416,7 +416,7 @@ class ma {
|
|
|
416
416
|
* ```
|
|
417
417
|
*/
|
|
418
418
|
async getRoot() {
|
|
419
|
-
const s = await
|
|
419
|
+
const s = await xe({
|
|
420
420
|
context: this.context,
|
|
421
421
|
ref: { tagName: this.dialecteConfig.rootElementName }
|
|
422
422
|
});
|
|
@@ -437,7 +437,7 @@ class ma {
|
|
|
437
437
|
* ```
|
|
438
438
|
*/
|
|
439
439
|
async getRecord(s) {
|
|
440
|
-
return
|
|
440
|
+
return xe({ context: this.context, ref: ye(s) });
|
|
441
441
|
}
|
|
442
442
|
/**
|
|
443
443
|
* Get multiple records in a single call.
|
|
@@ -451,8 +451,8 @@ class ma {
|
|
|
451
451
|
* ```
|
|
452
452
|
*/
|
|
453
453
|
async getRecords(s) {
|
|
454
|
-
const l = s.map((i) =>
|
|
455
|
-
return
|
|
454
|
+
const l = s.map((i) => ye(i));
|
|
455
|
+
return ha({ context: this.context, refs: l });
|
|
456
456
|
}
|
|
457
457
|
/**
|
|
458
458
|
* Get the first direct child of an element matching a given tag name.
|
|
@@ -468,7 +468,7 @@ class ma {
|
|
|
468
468
|
*/
|
|
469
469
|
async getChild(s, l) {
|
|
470
470
|
if (s)
|
|
471
|
-
return
|
|
471
|
+
return si({ context: this.context, ref: ye(s), tagName: l });
|
|
472
472
|
}
|
|
473
473
|
/**
|
|
474
474
|
* Get all direct children of an element matching a given tag name.
|
|
@@ -483,7 +483,7 @@ class ma {
|
|
|
483
483
|
* ```
|
|
484
484
|
*/
|
|
485
485
|
async getChildren(s, l) {
|
|
486
|
-
return s ?
|
|
486
|
+
return s ? ui({ context: this.context, ref: ye(s), tagName: l }) : [];
|
|
487
487
|
}
|
|
488
488
|
/**
|
|
489
489
|
* Get all records of a given tag name.
|
|
@@ -497,7 +497,7 @@ class ma {
|
|
|
497
497
|
* ```
|
|
498
498
|
*/
|
|
499
499
|
async getRecordsByTagName(s) {
|
|
500
|
-
return
|
|
500
|
+
return pa({ context: this.context, tagName: s });
|
|
501
501
|
}
|
|
502
502
|
/**
|
|
503
503
|
* Find all descendants of an element, grouped by tag name.
|
|
@@ -512,10 +512,10 @@ class ma {
|
|
|
512
512
|
* ```
|
|
513
513
|
*/
|
|
514
514
|
async findDescendants(s, l) {
|
|
515
|
-
return
|
|
515
|
+
return li({
|
|
516
516
|
context: this.context,
|
|
517
517
|
dialecteConfig: this.dialecteConfig,
|
|
518
|
-
ref:
|
|
518
|
+
ref: ye(s),
|
|
519
519
|
filter: l
|
|
520
520
|
});
|
|
521
521
|
}
|
|
@@ -533,7 +533,7 @@ class ma {
|
|
|
533
533
|
* ```
|
|
534
534
|
*/
|
|
535
535
|
async findAncestors(s, l) {
|
|
536
|
-
return s ?
|
|
536
|
+
return s ? ci({ context: this.context, ref: ye(s), options: l }) : [];
|
|
537
537
|
}
|
|
538
538
|
/**
|
|
539
539
|
* Build a full tree structure from an element down.
|
|
@@ -548,36 +548,23 @@ class ma {
|
|
|
548
548
|
* ```
|
|
549
549
|
*/
|
|
550
550
|
async getTree(s, l) {
|
|
551
|
-
return
|
|
551
|
+
return ya({ context: this.context, ref: ye(s), options: l });
|
|
552
552
|
}
|
|
553
553
|
async getAttribute(s, l) {
|
|
554
|
-
const i =
|
|
555
|
-
return d ?
|
|
554
|
+
const i = ye(s), { fullObject: d } = l;
|
|
555
|
+
return d ? Zr({ context: this.context, ref: i, ...l }) : Hr({ context: this.context, ref: i, ...l });
|
|
556
556
|
}
|
|
557
557
|
async getAttributes(s, l) {
|
|
558
|
-
const i =
|
|
559
|
-
return d ?
|
|
558
|
+
const i = ye(s), { fullObject: d } = l || {};
|
|
559
|
+
return d ? ea({ context: this.context, ref: i, ...l }) : Jr({ context: this.context, ref: i, ...l });
|
|
560
560
|
}
|
|
561
|
-
//== Any-typed companions (for union-element / untyped-ref call sites)
|
|
562
|
-
/**
|
|
563
|
-
* Get a single attribute value without element-type constraint.
|
|
564
|
-
* Use when the element type is a union or unknown at the call site.
|
|
565
|
-
* Returns `''` if the attribute is absent.
|
|
566
|
-
*/
|
|
567
561
|
async getAnyAttribute(s, l) {
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
{ name: l }
|
|
571
|
-
);
|
|
562
|
+
const i = ye(s), { fullObject: d } = l;
|
|
563
|
+
return d ? Zr({ context: this.context, ref: i, ...l }) : Hr({ context: this.context, ref: i, ...l });
|
|
572
564
|
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
*/
|
|
577
|
-
async getAnyAttributes(s) {
|
|
578
|
-
return await this.getAttributes(
|
|
579
|
-
s
|
|
580
|
-
);
|
|
565
|
+
async getAnyAttributes(s, l) {
|
|
566
|
+
const i = ye(s), { fullObject: d } = l || {};
|
|
567
|
+
return d ? ea({ context: this.context, ref: i, ...l }) : Jr({ context: this.context, ref: i, ...l });
|
|
581
568
|
}
|
|
582
569
|
/**
|
|
583
570
|
* Get the first direct child matching a tag name without element-type constraint.
|
|
@@ -653,13 +640,13 @@ function yr(m) {
|
|
|
653
640
|
}
|
|
654
641
|
}
|
|
655
642
|
async function vr(m) {
|
|
656
|
-
const { dialecteConfig: s, hooks: l, context: i, query: d, parentRef: h, params: y } = m, { id: _, tagName: D, attributes: F, namespace: $, value: G } = y, Q = await
|
|
643
|
+
const { dialecteConfig: s, hooks: l, context: i, query: d, parentRef: h, params: y } = m, { id: _, tagName: D, attributes: F, namespace: $, value: G } = y, Q = await xe({ context: i, ref: h });
|
|
657
644
|
Ge(Q, {
|
|
658
645
|
detail: "Parent record not found",
|
|
659
646
|
key: "ELEMENT_NOT_FOUND",
|
|
660
647
|
ref: h
|
|
661
648
|
});
|
|
662
|
-
const fe =
|
|
649
|
+
const fe = ri({
|
|
663
650
|
dialecteConfig: s,
|
|
664
651
|
hooks: l,
|
|
665
652
|
record: {
|
|
@@ -696,8 +683,8 @@ async function vr(m) {
|
|
|
696
683
|
}
|
|
697
684
|
return fe;
|
|
698
685
|
}
|
|
699
|
-
async function
|
|
700
|
-
const { dialecteConfig: s, hooks: l, context: i, query: d, parentRef: h, record: y, cumulativeCloneMappings: _ } = m, D = [], F = await
|
|
686
|
+
async function xi(m) {
|
|
687
|
+
const { dialecteConfig: s, hooks: l, context: i, query: d, parentRef: h, record: y, cumulativeCloneMappings: _ } = m, D = [], F = await wa({
|
|
701
688
|
dialecteConfig: s,
|
|
702
689
|
hooks: l,
|
|
703
690
|
context: i,
|
|
@@ -718,7 +705,7 @@ async function Ti(m) {
|
|
|
718
705
|
mappings: D
|
|
719
706
|
};
|
|
720
707
|
}
|
|
721
|
-
async function
|
|
708
|
+
async function wa(m) {
|
|
722
709
|
const { dialecteConfig: s, hooks: l, context: i, query: d, parentRef: h, record: y, mappings: _ } = m;
|
|
723
710
|
let D = !0, F = y;
|
|
724
711
|
if (l?.beforeClone) {
|
|
@@ -738,26 +725,26 @@ async function ga(m) {
|
|
|
738
725
|
attributes: F.attributes,
|
|
739
726
|
value: F.value
|
|
740
727
|
}
|
|
741
|
-
}), G =
|
|
728
|
+
}), G = ye(y);
|
|
742
729
|
_.push({
|
|
743
730
|
source: Object.assign(G, {
|
|
744
731
|
attributes: [...y.attributes]
|
|
745
732
|
}),
|
|
746
|
-
target:
|
|
733
|
+
target: ye($)
|
|
747
734
|
});
|
|
748
735
|
for (const Q of F.tree)
|
|
749
|
-
await
|
|
736
|
+
await wa({
|
|
750
737
|
dialecteConfig: s,
|
|
751
738
|
hooks: l,
|
|
752
739
|
context: i,
|
|
753
740
|
query: d,
|
|
754
|
-
parentRef:
|
|
741
|
+
parentRef: ye($),
|
|
755
742
|
record: Q,
|
|
756
743
|
mappings: _
|
|
757
744
|
});
|
|
758
745
|
return $;
|
|
759
746
|
}
|
|
760
|
-
function
|
|
747
|
+
function Ti(m) {
|
|
761
748
|
const s = /* @__PURE__ */ new Map();
|
|
762
749
|
for (const i of m) {
|
|
763
750
|
const d = (i.status === "deleted" ? i.oldRecord : i.newRecord).id, h = s.get(d);
|
|
@@ -787,7 +774,7 @@ function xi(m) {
|
|
|
787
774
|
};
|
|
788
775
|
}
|
|
789
776
|
async function Ni(m) {
|
|
790
|
-
const { stagedOperations: s, store: l, documentState: i } = m, { creates: d, updates: h, deletes: y } =
|
|
777
|
+
const { stagedOperations: s, store: l, documentState: i } = m, { creates: d, updates: h, deletes: y } = Ti(s), _ = d.length + h.length + y.length;
|
|
791
778
|
i.loading = !0, i.progress = { message: "Committing changes...", current: 0, total: _ };
|
|
792
779
|
try {
|
|
793
780
|
await l.commit({
|
|
@@ -804,7 +791,7 @@ async function Ni(m) {
|
|
|
804
791
|
i.lastUpdate = Date.now();
|
|
805
792
|
}
|
|
806
793
|
async function Ai(m) {
|
|
807
|
-
const { hooks: s, context: l, query: i, ref: d } = m, h = await
|
|
794
|
+
const { hooks: s, context: l, query: i, ref: d } = m, h = await xe({ context: l, ref: d });
|
|
808
795
|
if (Ge(h, {
|
|
809
796
|
detail: `Record not found (tagName=${d.tagName}, id=${d.id})`,
|
|
810
797
|
key: "ELEMENT_NOT_FOUND",
|
|
@@ -816,8 +803,8 @@ async function Ai(m) {
|
|
|
816
803
|
const F = await s.beforeDelete({ record: h, query: i });
|
|
817
804
|
yr({ context: l, operations: F });
|
|
818
805
|
}
|
|
819
|
-
await
|
|
820
|
-
const y =
|
|
806
|
+
await _a({ context: l, record: h }), Ze({ context: l, status: "deleted", record: h });
|
|
807
|
+
const y = ye(h.parent), _ = await xe({ context: l, ref: y });
|
|
821
808
|
Ge(_, {
|
|
822
809
|
detail: `Parent record not found (tagName=${h.parent.tagName}, id=${h.parent.id})`,
|
|
823
810
|
key: "ELEMENT_NOT_FOUND"
|
|
@@ -828,11 +815,11 @@ async function Ai(m) {
|
|
|
828
815
|
};
|
|
829
816
|
return Ze({ context: l, status: "updated", oldRecord: _, newRecord: D }), D;
|
|
830
817
|
}
|
|
831
|
-
async function
|
|
818
|
+
async function _a(m) {
|
|
832
819
|
const { context: s, record: l } = m;
|
|
833
820
|
for (const i of l.children) {
|
|
834
|
-
const d =
|
|
835
|
-
h && (h.children.length > 0 && await
|
|
821
|
+
const d = ye(i), h = await xe({ context: s, ref: d });
|
|
822
|
+
h && (h.children.length > 0 && await _a({ context: s, record: h }), Ze({ context: s, status: "deleted", record: h }));
|
|
836
823
|
}
|
|
837
824
|
}
|
|
838
825
|
async function Oi(m) {
|
|
@@ -845,7 +832,7 @@ async function Oi(m) {
|
|
|
845
832
|
});
|
|
846
833
|
if (D) return D;
|
|
847
834
|
} else {
|
|
848
|
-
const D = { tagName: y.tagName, id: y.id }, F = await
|
|
835
|
+
const D = { tagName: y.tagName, id: y.id }, F = await xe({ context: i, ref: D });
|
|
849
836
|
if (F) return F;
|
|
850
837
|
}
|
|
851
838
|
return vr({
|
|
@@ -862,7 +849,7 @@ function Ci(m) {
|
|
|
862
849
|
return Object.values(s).some((i) => i !== void 0 && i !== "") ? s : void 0;
|
|
863
850
|
}
|
|
864
851
|
async function Di(m) {
|
|
865
|
-
const { dialecteConfig: s, hooks: l, context: i, query: d, ref: h, params: y } = m, { attributes: _, value: D } = y, F = await
|
|
852
|
+
const { dialecteConfig: s, hooks: l, context: i, query: d, ref: h, params: y } = m, { attributes: _, value: D } = y, F = await xe({ context: i, ref: h });
|
|
866
853
|
Ge(F, {
|
|
867
854
|
detail: `Record not found (tagName=${h.tagName}, id=${h.id})`,
|
|
868
855
|
key: "ELEMENT_NOT_FOUND",
|
|
@@ -870,7 +857,7 @@ async function Di(m) {
|
|
|
870
857
|
});
|
|
871
858
|
let $ = F.attributes;
|
|
872
859
|
if (_) {
|
|
873
|
-
const Q =
|
|
860
|
+
const Q = ai({
|
|
874
861
|
dialecteConfig: s,
|
|
875
862
|
tagName: F.tagName,
|
|
876
863
|
attributes: _
|
|
@@ -896,7 +883,7 @@ async function Di(m) {
|
|
|
896
883
|
}
|
|
897
884
|
return G;
|
|
898
885
|
}
|
|
899
|
-
class Ii extends
|
|
886
|
+
class Ii extends ba {
|
|
900
887
|
constructor(s, l, i, d) {
|
|
901
888
|
super(s, l), this.stagedOperations = [], this.recordCache = /* @__PURE__ */ new Map(), this.cumulativeCloneMappings = [], this.documentState = i, this.hooks = d;
|
|
902
889
|
}
|
|
@@ -938,7 +925,7 @@ class Ii extends ma {
|
|
|
938
925
|
async addChild(s, l) {
|
|
939
926
|
return vr({
|
|
940
927
|
context: this.context,
|
|
941
|
-
parentRef:
|
|
928
|
+
parentRef: ye(s),
|
|
942
929
|
params: l,
|
|
943
930
|
dialecteConfig: this.dialecteConfig,
|
|
944
931
|
hooks: this.hooks,
|
|
@@ -969,7 +956,7 @@ class Ii extends ma {
|
|
|
969
956
|
async ensureChild(s, l) {
|
|
970
957
|
return Oi({
|
|
971
958
|
context: this.context,
|
|
972
|
-
parentRef:
|
|
959
|
+
parentRef: ye(s),
|
|
973
960
|
params: l,
|
|
974
961
|
dialecteConfig: this.dialecteConfig,
|
|
975
962
|
hooks: this.hooks,
|
|
@@ -993,7 +980,7 @@ class Ii extends ma {
|
|
|
993
980
|
async update(s, l) {
|
|
994
981
|
return Di({
|
|
995
982
|
context: this.context,
|
|
996
|
-
ref:
|
|
983
|
+
ref: ye(s),
|
|
997
984
|
params: l,
|
|
998
985
|
dialecteConfig: this.dialecteConfig,
|
|
999
986
|
hooks: this.hooks,
|
|
@@ -1014,7 +1001,7 @@ class Ii extends ma {
|
|
|
1014
1001
|
async delete(s) {
|
|
1015
1002
|
return Ai({
|
|
1016
1003
|
context: this.context,
|
|
1017
|
-
ref:
|
|
1004
|
+
ref: ye(s),
|
|
1018
1005
|
hooks: this.hooks,
|
|
1019
1006
|
query: this
|
|
1020
1007
|
});
|
|
@@ -1033,11 +1020,11 @@ class Ii extends ma {
|
|
|
1033
1020
|
* ```
|
|
1034
1021
|
*/
|
|
1035
1022
|
async deepClone(s, l) {
|
|
1036
|
-
return
|
|
1023
|
+
return xi({
|
|
1037
1024
|
dialecteConfig: this.dialecteConfig,
|
|
1038
1025
|
hooks: this.hooks,
|
|
1039
1026
|
context: this.context,
|
|
1040
|
-
parentRef:
|
|
1027
|
+
parentRef: ye(s),
|
|
1041
1028
|
record: l,
|
|
1042
1029
|
query: this,
|
|
1043
1030
|
cumulativeCloneMappings: this.cumulativeCloneMappings
|
|
@@ -1078,7 +1065,7 @@ class Ii extends ma {
|
|
|
1078
1065
|
function Xt(m) {
|
|
1079
1066
|
return m.recordCache !== void 0;
|
|
1080
1067
|
}
|
|
1081
|
-
class
|
|
1068
|
+
class Ea {
|
|
1082
1069
|
constructor(s, l, i, d) {
|
|
1083
1070
|
this.state = {
|
|
1084
1071
|
loading: !1,
|
|
@@ -1103,7 +1090,7 @@ class va {
|
|
|
1103
1090
|
* Override in dialecte subclass to return a domain-specific Query.
|
|
1104
1091
|
*/
|
|
1105
1092
|
createQuery() {
|
|
1106
|
-
return new
|
|
1093
|
+
return new ba(this.store, this.config);
|
|
1107
1094
|
}
|
|
1108
1095
|
get query() {
|
|
1109
1096
|
return this.withQueryExtensions(this.createQuery());
|
|
@@ -1239,7 +1226,7 @@ class va {
|
|
|
1239
1226
|
}
|
|
1240
1227
|
}
|
|
1241
1228
|
var Ri = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
1242
|
-
function
|
|
1229
|
+
function xa(m) {
|
|
1243
1230
|
return m && m.__esModule && Object.prototype.hasOwnProperty.call(m, "default") ? m.default : m;
|
|
1244
1231
|
}
|
|
1245
1232
|
function Si(m) {
|
|
@@ -1266,9 +1253,9 @@ function Si(m) {
|
|
|
1266
1253
|
});
|
|
1267
1254
|
}), l;
|
|
1268
1255
|
}
|
|
1269
|
-
var
|
|
1256
|
+
var Tn = { exports: {} }, ki = Tn.exports, ta;
|
|
1270
1257
|
function Pi() {
|
|
1271
|
-
return
|
|
1258
|
+
return ta || (ta = 1, (function(m, s) {
|
|
1272
1259
|
(function(l, i) {
|
|
1273
1260
|
m.exports = i();
|
|
1274
1261
|
})(ki, function() {
|
|
@@ -1314,7 +1301,7 @@ function Pi() {
|
|
|
1314
1301
|
} };
|
|
1315
1302
|
}
|
|
1316
1303
|
var ue = Object.getOwnPropertyDescriptor, ie = [].slice;
|
|
1317
|
-
function
|
|
1304
|
+
function Te(e, t, n) {
|
|
1318
1305
|
return ie.call(e, t, n);
|
|
1319
1306
|
}
|
|
1320
1307
|
function te(e, t) {
|
|
@@ -1389,7 +1376,7 @@ function Pi() {
|
|
|
1389
1376
|
function St(e) {
|
|
1390
1377
|
return Yt.call(e).slice(8, -1);
|
|
1391
1378
|
}
|
|
1392
|
-
var kt = typeof Symbol < "u" ? Symbol.iterator : "@@iterator",
|
|
1379
|
+
var kt = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", ve = typeof kt == "symbol" ? function(e) {
|
|
1393
1380
|
var t;
|
|
1394
1381
|
return e != null && (t = e[kt]) && t.apply(e);
|
|
1395
1382
|
} : function() {
|
|
@@ -1404,7 +1391,7 @@ function Pi() {
|
|
|
1404
1391
|
if (arguments.length === 1) {
|
|
1405
1392
|
if (_(e)) return e.slice();
|
|
1406
1393
|
if (this === ze && typeof e == "string") return [e];
|
|
1407
|
-
if (a =
|
|
1394
|
+
if (a = ve(e)) {
|
|
1408
1395
|
for (n = []; !(r = a.next()).done; ) n.push(r.value);
|
|
1409
1396
|
return n;
|
|
1410
1397
|
}
|
|
@@ -1491,7 +1478,7 @@ function Pi() {
|
|
|
1491
1478
|
this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? E(n, this.onsuccess) : n), r && (this.onerror = this.onerror ? E(r, this.onerror) : r);
|
|
1492
1479
|
};
|
|
1493
1480
|
}
|
|
1494
|
-
function
|
|
1481
|
+
function we(e, t) {
|
|
1495
1482
|
return e === c ? t : function(n) {
|
|
1496
1483
|
var r = e.apply(this, arguments);
|
|
1497
1484
|
D(n, r);
|
|
@@ -1527,7 +1514,7 @@ function Pi() {
|
|
|
1527
1514
|
var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
1528
1515
|
return [t, F(t), e];
|
|
1529
1516
|
})(), nt = Ve[0], Le = Ve[1], Ve = Ve[2], Le = Le && Le.then, Xe = nt && nt.constructor, Cn = !!Ve, Pt = function(e, t) {
|
|
1530
|
-
Ft.push([e, t]), Qt && (queueMicrotask(
|
|
1517
|
+
Ft.push([e, t]), Qt && (queueMicrotask(ka), Qt = !1);
|
|
1531
1518
|
}, Dn = !0, Qt = !0, ft = [], Ht = [], In = o, rt = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: c, pgp: !1, env: {}, finalize: c }, Y = rt, Ft = [], dt = 0, Zt = [];
|
|
1532
1519
|
function X(e) {
|
|
1533
1520
|
if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
|
|
@@ -1542,10 +1529,10 @@ function Pi() {
|
|
|
1542
1529
|
a(function(u) {
|
|
1543
1530
|
if (r._state === null) {
|
|
1544
1531
|
if (u === r) throw new TypeError("A promise cannot be resolved with itself.");
|
|
1545
|
-
var f = r._lib &&
|
|
1532
|
+
var f = r._lib && xt();
|
|
1546
1533
|
u && typeof u.then == "function" ? n(r, function(p, v) {
|
|
1547
1534
|
u instanceof X ? u._then(p, v) : u.then(p, v);
|
|
1548
|
-
}) : (r._state = !0, r._value = u, wr(r)), f &&
|
|
1535
|
+
}) : (r._state = !0, r._value = u, wr(r)), f && Tt();
|
|
1549
1536
|
}
|
|
1550
1537
|
}, Sn.bind(null, r));
|
|
1551
1538
|
} catch (u) {
|
|
@@ -1556,8 +1543,8 @@ function Pi() {
|
|
|
1556
1543
|
var Rn = { get: function() {
|
|
1557
1544
|
var e = Y, t = nn;
|
|
1558
1545
|
function n(r, a) {
|
|
1559
|
-
var u = this, f = !e.global && (e !== Y || t !== nn), p = f && !it(), v = new X(function(w,
|
|
1560
|
-
kn(u, new br(Er(r, e, f, p), Er(a, e, f, p), w,
|
|
1546
|
+
var u = this, f = !e.global && (e !== Y || t !== nn), p = f && !it(), v = new X(function(w, T) {
|
|
1547
|
+
kn(u, new br(Er(r, e, f, p), Er(a, e, f, p), w, T, e));
|
|
1561
1548
|
});
|
|
1562
1549
|
return this._consoleTask && (v._consoleTask = this._consoleTask), v;
|
|
1563
1550
|
}
|
|
@@ -1572,9 +1559,9 @@ function Pi() {
|
|
|
1572
1559
|
}
|
|
1573
1560
|
function Sn(e, t) {
|
|
1574
1561
|
var n, r;
|
|
1575
|
-
Ht.push(t), e._state === null && (n = e._lib &&
|
|
1562
|
+
Ht.push(t), e._state === null && (n = e._lib && xt(), t = In(t), e._state = !1, e._value = t, r = e, ft.some(function(a) {
|
|
1576
1563
|
return a._value === r._value;
|
|
1577
|
-
}) || ft.push(r), wr(e), n &&
|
|
1564
|
+
}) || ft.push(r), wr(e), n && Tt());
|
|
1578
1565
|
}
|
|
1579
1566
|
function wr(e) {
|
|
1580
1567
|
var t = e._listeners;
|
|
@@ -1589,10 +1576,10 @@ function Pi() {
|
|
|
1589
1576
|
if (e._state !== null) {
|
|
1590
1577
|
var n = e._state ? t.onFulfilled : t.onRejected;
|
|
1591
1578
|
if (n === null) return (e._state ? t.resolve : t.reject)(e._value);
|
|
1592
|
-
++t.psd.ref, ++dt, Pt(
|
|
1579
|
+
++t.psd.ref, ++dt, Pt(Sa, [n, e, t]);
|
|
1593
1580
|
} else e._listeners.push(t);
|
|
1594
1581
|
}
|
|
1595
|
-
function
|
|
1582
|
+
function Sa(e, t, n) {
|
|
1596
1583
|
try {
|
|
1597
1584
|
var r, a = t._value;
|
|
1598
1585
|
!t._state && Ht.length && (Ht = []), r = Ne && t._consoleTask ? t._consoleTask.run(function() {
|
|
@@ -1606,16 +1593,16 @@ function Pi() {
|
|
|
1606
1593
|
--dt == 0 && Pn(), --n.psd.ref || n.psd.finalize();
|
|
1607
1594
|
}
|
|
1608
1595
|
}
|
|
1609
|
-
function
|
|
1596
|
+
function ka() {
|
|
1610
1597
|
ht(rt, function() {
|
|
1611
|
-
|
|
1598
|
+
xt() && Tt();
|
|
1612
1599
|
});
|
|
1613
1600
|
}
|
|
1614
|
-
function
|
|
1601
|
+
function xt() {
|
|
1615
1602
|
var e = Dn;
|
|
1616
1603
|
return Qt = Dn = !1, e;
|
|
1617
1604
|
}
|
|
1618
|
-
function
|
|
1605
|
+
function Tt() {
|
|
1619
1606
|
var e, t, n;
|
|
1620
1607
|
do
|
|
1621
1608
|
for (; 0 < Ft.length; ) for (e = Ft, Ft = [], n = e.length, t = 0; t < n; ++t) {
|
|
@@ -1638,13 +1625,13 @@ function Pi() {
|
|
|
1638
1625
|
function pe(e, t) {
|
|
1639
1626
|
var n = Y;
|
|
1640
1627
|
return function() {
|
|
1641
|
-
var r =
|
|
1628
|
+
var r = xt(), a = Y;
|
|
1642
1629
|
try {
|
|
1643
1630
|
return ot(n, !0), e.apply(this, arguments);
|
|
1644
1631
|
} catch (u) {
|
|
1645
1632
|
t && t(u);
|
|
1646
1633
|
} finally {
|
|
1647
|
-
ot(a, !1), r &&
|
|
1634
|
+
ot(a, !1), r && Tt();
|
|
1648
1635
|
}
|
|
1649
1636
|
};
|
|
1650
1637
|
}
|
|
@@ -1757,15 +1744,15 @@ function Pi() {
|
|
|
1757
1744
|
});
|
|
1758
1745
|
});
|
|
1759
1746
|
}), Xe.withResolvers && (X.withResolvers = Xe.withResolvers));
|
|
1760
|
-
var Ce = { awaits: 0, echoes: 0, id: 0 },
|
|
1747
|
+
var Ce = { awaits: 0, echoes: 0, id: 0 }, Pa = 0, en = [], tn = 0, nn = 0, Fa = 0;
|
|
1761
1748
|
function at(e, t, n, r) {
|
|
1762
1749
|
var a = Y, u = Object.create(a);
|
|
1763
|
-
return u.parent = a, u.ref = 0, u.global = !1, u.id = ++
|
|
1750
|
+
return u.parent = a, u.ref = 0, u.global = !1, u.id = ++Fa, rt.env, u.env = Cn ? { Promise: X, PromiseProp: { value: X, configurable: !0, writable: !0 }, all: X.all, race: X.race, allSettled: X.allSettled, any: X.any, resolve: X.resolve, reject: X.reject } : {}, t && D(u, t), ++a.ref, u.finalize = function() {
|
|
1764
1751
|
--this.parent.ref || this.parent.finalize();
|
|
1765
1752
|
}, r = ht(u, e, n, r), u.ref === 0 && u.finalize(), r;
|
|
1766
1753
|
}
|
|
1767
1754
|
function Nt() {
|
|
1768
|
-
return Ce.id || (Ce.id = ++
|
|
1755
|
+
return Ce.id || (Ce.id = ++Pa), ++Ce.awaits, Ce.echoes += zt, Ce.id;
|
|
1769
1756
|
}
|
|
1770
1757
|
function it() {
|
|
1771
1758
|
return !!Ce.awaits && (--Ce.awaits == 0 && (Ce.id = 0), Ce.echoes = Ce.awaits * zt, !0);
|
|
@@ -1774,10 +1761,10 @@ function Pi() {
|
|
|
1774
1761
|
return Ce.echoes && e && e.constructor === Xe ? (Nt(), e.then(function(t) {
|
|
1775
1762
|
return it(), t;
|
|
1776
1763
|
}, function(t) {
|
|
1777
|
-
return it(),
|
|
1764
|
+
return it(), _e(t);
|
|
1778
1765
|
})) : e;
|
|
1779
1766
|
}
|
|
1780
|
-
function
|
|
1767
|
+
function Ba() {
|
|
1781
1768
|
var e = en[en.length - 1];
|
|
1782
1769
|
en.pop(), ot(e, !1);
|
|
1783
1770
|
}
|
|
@@ -1785,7 +1772,7 @@ function Pi() {
|
|
|
1785
1772
|
var n, r = Y;
|
|
1786
1773
|
(t ? !Ce.echoes || tn++ && e === Y : !tn || --tn && e === Y) || queueMicrotask(t ? (function(a) {
|
|
1787
1774
|
++nn, Ce.echoes && --Ce.echoes != 0 || (Ce.echoes = Ce.awaits = Ce.id = 0), en.push(Y), ot(a, !0);
|
|
1788
|
-
}).bind(null, e) :
|
|
1775
|
+
}).bind(null, e) : Ba), e !== Y && (Y = e, r === rt && (rt.env = _r()), Cn && (n = rt.env.Promise, t = e.env, (r.global || e.global) && (Object.defineProperty(h, "Promise", t.PromiseProp), n.all = t.all, n.race = t.race, n.resolve = t.resolve, n.reject = t.reject, t.allSettled && (n.allSettled = t.allSettled), t.any && (n.any = t.any))));
|
|
1789
1776
|
}
|
|
1790
1777
|
function _r() {
|
|
1791
1778
|
var e = h.Promise;
|
|
@@ -1814,13 +1801,13 @@ function Pi() {
|
|
|
1814
1801
|
Promise === Xe && Ce.echoes === 0 ? tn === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
1815
1802
|
}
|
|
1816
1803
|
("" + Le).indexOf("[native code]") === -1 && (Nt = it = c);
|
|
1817
|
-
var
|
|
1804
|
+
var _e = X.reject, pt = "", Qe = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", xr = "String expected.", At = [], an = "__dbnames", Bn = "readonly", Mn = "readwrite";
|
|
1818
1805
|
function mt(e, t) {
|
|
1819
1806
|
return e ? t ? function() {
|
|
1820
1807
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
1821
1808
|
} : e : t;
|
|
1822
1809
|
}
|
|
1823
|
-
var
|
|
1810
|
+
var Tr = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
|
|
1824
1811
|
function on(e) {
|
|
1825
1812
|
return typeof e != "string" || /\./.test(e) ? function(t) {
|
|
1826
1813
|
return t;
|
|
@@ -1848,8 +1835,8 @@ function Pi() {
|
|
|
1848
1835
|
case "Array":
|
|
1849
1836
|
return (function(a, u) {
|
|
1850
1837
|
for (var f = a.length, p = u.length, v = f < p ? f : p, w = 0; w < v; ++w) {
|
|
1851
|
-
var
|
|
1852
|
-
if (
|
|
1838
|
+
var T = re(a[w], u[w]);
|
|
1839
|
+
if (T !== 0) return T;
|
|
1853
1840
|
}
|
|
1854
1841
|
return f === p ? 0 : f < p ? -1 : 1;
|
|
1855
1842
|
})(e, t);
|
|
@@ -1877,56 +1864,56 @@ function Pi() {
|
|
|
1877
1864
|
}
|
|
1878
1865
|
var Cr = (he.prototype._trans = function(e, t, n) {
|
|
1879
1866
|
var r = this._tx || Y.trans, a = this.name, u = Ne && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
1880
|
-
function f(w,
|
|
1867
|
+
function f(w, T, g) {
|
|
1881
1868
|
if (!g.schema[a]) throw new z.NotFound("Table " + a + " not part of transaction");
|
|
1882
1869
|
return t(g.idbtrans, g);
|
|
1883
1870
|
}
|
|
1884
|
-
var p =
|
|
1871
|
+
var p = xt();
|
|
1885
1872
|
try {
|
|
1886
1873
|
var v = r && r.db._novip === this.db._novip ? r === Y.trans ? r._promise(e, f, n) : at(function() {
|
|
1887
1874
|
return r._promise(e, f, n);
|
|
1888
|
-
}, { trans: r, transless: Y.transless || Y }) : (function w(
|
|
1889
|
-
if (
|
|
1890
|
-
var
|
|
1875
|
+
}, { trans: r, transless: Y.transless || Y }) : (function w(T, g, O, b) {
|
|
1876
|
+
if (T.idbdb && (T._state.openComplete || Y.letThrough || T._vip)) {
|
|
1877
|
+
var x = T._createTransaction(g, O, T._dbSchema);
|
|
1891
1878
|
try {
|
|
1892
|
-
|
|
1879
|
+
x.create(), T._state.PR1398_maxLoop = 3;
|
|
1893
1880
|
} catch (A) {
|
|
1894
|
-
return A.name === lt.InvalidState &&
|
|
1895
|
-
return w(
|
|
1896
|
-
})) :
|
|
1881
|
+
return A.name === lt.InvalidState && T.isOpen() && 0 < --T._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), T.close({ disableAutoOpen: !1 }), T.open().then(function() {
|
|
1882
|
+
return w(T, g, O, b);
|
|
1883
|
+
})) : _e(A);
|
|
1897
1884
|
}
|
|
1898
|
-
return
|
|
1885
|
+
return x._promise(g, function(A, N) {
|
|
1899
1886
|
return at(function() {
|
|
1900
|
-
return Y.trans =
|
|
1887
|
+
return Y.trans = x, b(A, N, x);
|
|
1901
1888
|
});
|
|
1902
1889
|
}).then(function(A) {
|
|
1903
1890
|
if (g === "readwrite") try {
|
|
1904
|
-
|
|
1891
|
+
x.idbtrans.commit();
|
|
1905
1892
|
} catch {
|
|
1906
1893
|
}
|
|
1907
|
-
return g === "readonly" ? A :
|
|
1894
|
+
return g === "readonly" ? A : x._completion.then(function() {
|
|
1908
1895
|
return A;
|
|
1909
1896
|
});
|
|
1910
1897
|
});
|
|
1911
1898
|
}
|
|
1912
|
-
if (
|
|
1913
|
-
if (!
|
|
1914
|
-
if (!
|
|
1915
|
-
|
|
1899
|
+
if (T._state.openComplete) return _e(new z.DatabaseClosed(T._state.dbOpenError));
|
|
1900
|
+
if (!T._state.isBeingOpened) {
|
|
1901
|
+
if (!T._state.autoOpen) return _e(new z.DatabaseClosed());
|
|
1902
|
+
T.open().catch(c);
|
|
1916
1903
|
}
|
|
1917
|
-
return
|
|
1918
|
-
return w(
|
|
1904
|
+
return T._state.dbReadyPromise.then(function() {
|
|
1905
|
+
return w(T, g, O, b);
|
|
1919
1906
|
});
|
|
1920
1907
|
})(this.db, e, [this.name], f);
|
|
1921
1908
|
return u && (v._consoleTask = u, v = v.catch(function(w) {
|
|
1922
|
-
return console.trace(w),
|
|
1909
|
+
return console.trace(w), _e(w);
|
|
1923
1910
|
})), v;
|
|
1924
1911
|
} finally {
|
|
1925
|
-
p &&
|
|
1912
|
+
p && Tt();
|
|
1926
1913
|
}
|
|
1927
1914
|
}, he.prototype.get = function(e, t) {
|
|
1928
1915
|
var n = this;
|
|
1929
|
-
return e && e.constructor === Object ? this.where(e).first(t) : e == null ?
|
|
1916
|
+
return e && e.constructor === Object ? this.where(e).first(t) : e == null ? _e(new z.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(r) {
|
|
1930
1917
|
return n.core.get({ trans: r, key: e }).then(function(a) {
|
|
1931
1918
|
return n.hook.reading.fire(a);
|
|
1932
1919
|
});
|
|
@@ -1959,14 +1946,14 @@ function Pi() {
|
|
|
1959
1946
|
return re(p, v) === 0;
|
|
1960
1947
|
}
|
|
1961
1948
|
var f = t.reduce(function(g, v) {
|
|
1962
|
-
var w = g[0],
|
|
1963
|
-
return [w || g, w || !g ? mt(
|
|
1964
|
-
return b = de(b, v), _(b) && b.some(function(
|
|
1965
|
-
return a(O,
|
|
1949
|
+
var w = g[0], T = g[1], g = r[v], O = e[v];
|
|
1950
|
+
return [w || g, w || !g ? mt(T, g && g.multi ? function(b) {
|
|
1951
|
+
return b = de(b, v), _(b) && b.some(function(x) {
|
|
1952
|
+
return a(O, x);
|
|
1966
1953
|
});
|
|
1967
1954
|
} : function(b) {
|
|
1968
1955
|
return a(O, de(b, v));
|
|
1969
|
-
}) :
|
|
1956
|
+
}) : T];
|
|
1970
1957
|
}, [null, null]), u = f[0], f = f[1];
|
|
1971
1958
|
return u ? this.where(u.name).equals(e[u.keyPath]).filter(f) : n ? this.filter(f) : this.where(t).equals("");
|
|
1972
1959
|
}, he.prototype.filter = function(e) {
|
|
@@ -1994,10 +1981,10 @@ function Pi() {
|
|
|
1994
1981
|
}
|
|
1995
1982
|
(this.schema.mappedClass = e).prototype instanceof Nr && ((function(v, w) {
|
|
1996
1983
|
if (typeof w != "function" && w !== null) throw new TypeError("Class extends value " + String(w) + " is not a constructor or null");
|
|
1997
|
-
function
|
|
1984
|
+
function T() {
|
|
1998
1985
|
this.constructor = v;
|
|
1999
1986
|
}
|
|
2000
|
-
l(v, w), v.prototype = w === null ? Object.create(w) : (
|
|
1987
|
+
l(v, w), v.prototype = w === null ? Object.create(w) : (T.prototype = w.prototype, new T());
|
|
2001
1988
|
})(a, t = e), Object.defineProperty(a.prototype, "db", { get: function() {
|
|
2002
1989
|
return n;
|
|
2003
1990
|
}, enumerable: !1, configurable: !0 }), a.prototype.table = function() {
|
|
@@ -2008,12 +1995,12 @@ function Pi() {
|
|
|
2008
1995
|
});
|
|
2009
1996
|
function p(v) {
|
|
2010
1997
|
if (!v) return v;
|
|
2011
|
-
var w,
|
|
1998
|
+
var w, T = Object.create(e.prototype);
|
|
2012
1999
|
for (w in v) if (!u.has(w)) try {
|
|
2013
|
-
|
|
2000
|
+
T[w] = v[w];
|
|
2014
2001
|
} catch {
|
|
2015
2002
|
}
|
|
2016
|
-
return
|
|
2003
|
+
return T;
|
|
2017
2004
|
}
|
|
2018
2005
|
return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), this.schema.readHook = p, this.hook("reading", p), e;
|
|
2019
2006
|
}, he.prototype.defineClass = function() {
|
|
@@ -2034,7 +2021,7 @@ function Pi() {
|
|
|
2034
2021
|
return p;
|
|
2035
2022
|
});
|
|
2036
2023
|
}, he.prototype.update = function(e, t) {
|
|
2037
|
-
return typeof e != "object" || _(e) ? this.where(":id").equals(e).modify(t) : (e = de(e, this.schema.primKey.keyPath), e === void 0 ?
|
|
2024
|
+
return typeof e != "object" || _(e) ? this.where(":id").equals(e).modify(t) : (e = de(e, this.schema.primKey.keyPath), e === void 0 ? _e(new z.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
|
|
2038
2025
|
}, he.prototype.put = function(e, t) {
|
|
2039
2026
|
var n = this, r = this.schema.primKey, a = r.auto, u = r.keyPath, f = e;
|
|
2040
2027
|
return u && a && (f = on(u)(e)), this._trans("readwrite", function(p) {
|
|
@@ -2060,7 +2047,7 @@ function Pi() {
|
|
|
2060
2047
|
}, he.prototype.clear = function() {
|
|
2061
2048
|
var e = this;
|
|
2062
2049
|
return this._trans("readwrite", function(t) {
|
|
2063
|
-
return e.core.mutate({ trans: t, type: "deleteRange", range:
|
|
2050
|
+
return e.core.mutate({ trans: t, type: "deleteRange", range: Tr }).then(function(n) {
|
|
2064
2051
|
return sn(e, null, n);
|
|
2065
2052
|
});
|
|
2066
2053
|
}).then(function(t) {
|
|
@@ -2082,10 +2069,10 @@ function Pi() {
|
|
|
2082
2069
|
if (w && a) throw new z.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
2083
2070
|
if (a && a.length !== e.length) throw new z.InvalidArgument("Arguments objects and keys must have the same length");
|
|
2084
2071
|
var v = e.length, w = w && p ? e.map(on(w)) : e;
|
|
2085
|
-
return r.core.mutate({ trans: f, type: "add", keys: a, values: w, wantResults: u }).then(function(
|
|
2086
|
-
var g =
|
|
2072
|
+
return r.core.mutate({ trans: f, type: "add", keys: a, values: w, wantResults: u }).then(function(x) {
|
|
2073
|
+
var g = x.numFailures, O = x.results, b = x.lastResult, x = x.failures;
|
|
2087
2074
|
if (g === 0) return u ? O : b;
|
|
2088
|
-
throw new Me("".concat(r.name, ".bulkAdd(): ").concat(g, " of ").concat(v, " operations failed"),
|
|
2075
|
+
throw new Me("".concat(r.name, ".bulkAdd(): ").concat(g, " of ").concat(v, " operations failed"), x);
|
|
2089
2076
|
});
|
|
2090
2077
|
});
|
|
2091
2078
|
}, he.prototype.bulkPut = function(e, t, n) {
|
|
@@ -2095,10 +2082,10 @@ function Pi() {
|
|
|
2095
2082
|
if (w && a) throw new z.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
2096
2083
|
if (a && a.length !== e.length) throw new z.InvalidArgument("Arguments objects and keys must have the same length");
|
|
2097
2084
|
var v = e.length, w = w && p ? e.map(on(w)) : e;
|
|
2098
|
-
return r.core.mutate({ trans: f, type: "put", keys: a, values: w, wantResults: u }).then(function(
|
|
2099
|
-
var g =
|
|
2085
|
+
return r.core.mutate({ trans: f, type: "put", keys: a, values: w, wantResults: u }).then(function(x) {
|
|
2086
|
+
var g = x.numFailures, O = x.results, b = x.lastResult, x = x.failures;
|
|
2100
2087
|
if (g === 0) return u ? O : b;
|
|
2101
|
-
throw new Me("".concat(r.name, ".bulkPut(): ").concat(g, " of ").concat(v, " operations failed"),
|
|
2088
|
+
throw new Me("".concat(r.name, ".bulkPut(): ").concat(g, " of ").concat(v, " operations failed"), x);
|
|
2102
2089
|
});
|
|
2103
2090
|
});
|
|
2104
2091
|
}, he.prototype.bulkUpdate = function(e) {
|
|
@@ -2111,10 +2098,10 @@ function Pi() {
|
|
|
2111
2098
|
return n.getMany({ trans: f, keys: r, cache: "clone" }).then(function(p) {
|
|
2112
2099
|
var v = [], w = [];
|
|
2113
2100
|
e.forEach(function(g, O) {
|
|
2114
|
-
var b = g.key,
|
|
2101
|
+
var b = g.key, x = g.changes, A = p[O];
|
|
2115
2102
|
if (A) {
|
|
2116
|
-
for (var N = 0, C = Object.keys(
|
|
2117
|
-
var R = C[N], k =
|
|
2103
|
+
for (var N = 0, C = Object.keys(x); N < C.length; N++) {
|
|
2104
|
+
var R = C[N], k = x[R];
|
|
2118
2105
|
if (R === t.schema.primKey.keyPath) {
|
|
2119
2106
|
if (re(k, b) !== 0) throw new z.Constraint("Cannot update primary key in bulkUpdate()");
|
|
2120
2107
|
} else le(A, R, k);
|
|
@@ -2122,15 +2109,15 @@ function Pi() {
|
|
|
2122
2109
|
u.push(O), v.push(b), w.push(A);
|
|
2123
2110
|
}
|
|
2124
2111
|
});
|
|
2125
|
-
var
|
|
2112
|
+
var T = v.length;
|
|
2126
2113
|
return n.mutate({ trans: f, type: "put", keys: v, values: w, updates: { keys: r, changeSpecs: a } }).then(function(g) {
|
|
2127
2114
|
var O = g.numFailures, b = g.failures;
|
|
2128
|
-
if (O === 0) return
|
|
2129
|
-
for (var
|
|
2130
|
-
var N, C = A[
|
|
2115
|
+
if (O === 0) return T;
|
|
2116
|
+
for (var x = 0, A = Object.keys(b); x < A.length; x++) {
|
|
2117
|
+
var N, C = A[x], R = u[Number(C)];
|
|
2131
2118
|
R != null && (N = b[C], delete b[C], b[R] = N);
|
|
2132
2119
|
}
|
|
2133
|
-
throw new Me("".concat(t.name, ".bulkUpdate(): ").concat(O, " of ").concat(
|
|
2120
|
+
throw new Me("".concat(t.name, ".bulkUpdate(): ").concat(O, " of ").concat(T, " operations failed"), b);
|
|
2134
2121
|
});
|
|
2135
2122
|
});
|
|
2136
2123
|
});
|
|
@@ -2164,14 +2151,14 @@ function Pi() {
|
|
|
2164
2151
|
if (typeof f != "object") {
|
|
2165
2152
|
var w;
|
|
2166
2153
|
p = p || Re;
|
|
2167
|
-
var
|
|
2168
|
-
|
|
2154
|
+
var T = { subscribers: [], fire: v = v || c, subscribe: function(g) {
|
|
2155
|
+
T.subscribers.indexOf(g) === -1 && (T.subscribers.push(g), T.fire = p(T.fire, g));
|
|
2169
2156
|
}, unsubscribe: function(g) {
|
|
2170
|
-
|
|
2157
|
+
T.subscribers = T.subscribers.filter(function(O) {
|
|
2171
2158
|
return O !== g;
|
|
2172
|
-
}),
|
|
2159
|
+
}), T.fire = T.subscribers.reduce(p, v);
|
|
2173
2160
|
} };
|
|
2174
|
-
return n[f] = t[f] =
|
|
2161
|
+
return n[f] = t[f] = T;
|
|
2175
2162
|
}
|
|
2176
2163
|
y(w = f).forEach(function(g) {
|
|
2177
2164
|
var O = w[g];
|
|
@@ -2179,7 +2166,7 @@ function Pi() {
|
|
|
2179
2166
|
else {
|
|
2180
2167
|
if (O !== "asap") throw new z.InvalidArgument("Invalid event config");
|
|
2181
2168
|
var b = u(g, o, function() {
|
|
2182
|
-
for (var
|
|
2169
|
+
for (var x = arguments.length, A = new Array(x); x--; ) A[x] = arguments[x];
|
|
2183
2170
|
b.subscribers.forEach(function(N) {
|
|
2184
2171
|
Z(function() {
|
|
2185
2172
|
N.apply(null, A);
|
|
@@ -2219,12 +2206,12 @@ function Pi() {
|
|
|
2219
2206
|
var a = e.replayFilter ? mt(e.filter, e.replayFilter()) : e.filter;
|
|
2220
2207
|
if (e.or) {
|
|
2221
2208
|
var u = {}, f = function(p, v, w) {
|
|
2222
|
-
var
|
|
2209
|
+
var T, g;
|
|
2223
2210
|
a && !a(v, w, function(O) {
|
|
2224
2211
|
return v.stop(O);
|
|
2225
2212
|
}, function(O) {
|
|
2226
2213
|
return v.fail(O);
|
|
2227
|
-
}) || ((g = "" + (
|
|
2214
|
+
}) || ((g = "" + (T = v.primaryKey)) == "[object ArrayBuffer]" && (g = "" + new Uint8Array(T)), G(u, g) || (u[g] = !0, t(p, v, w)));
|
|
2228
2215
|
};
|
|
2229
2216
|
return Promise.all([e.or._iterate(f, n), Ir(Dr(e, r, n), e.algorithm, f, !e.keysOnly && e.valueMapper)]);
|
|
2230
2217
|
}
|
|
@@ -2282,12 +2269,12 @@ function Pi() {
|
|
|
2282
2269
|
function Rr(e) {
|
|
2283
2270
|
this["@@propmod"] = e;
|
|
2284
2271
|
}
|
|
2285
|
-
var
|
|
2272
|
+
var Ma = (oe.prototype._read = function(e, t) {
|
|
2286
2273
|
var n = this._ctx;
|
|
2287
|
-
return n.error ? n.table._trans(null,
|
|
2274
|
+
return n.error ? n.table._trans(null, _e.bind(null, n.error)) : n.table._trans("readonly", e).then(t);
|
|
2288
2275
|
}, oe.prototype._write = function(e) {
|
|
2289
2276
|
var t = this._ctx;
|
|
2290
|
-
return t.error ? t.table._trans(null,
|
|
2277
|
+
return t.error ? t.table._trans(null, _e.bind(null, t.error)) : t.table._trans("readwrite", e, "locked");
|
|
2291
2278
|
}, oe.prototype._addAlgorithm = function(e) {
|
|
2292
2279
|
var t = this._ctx;
|
|
2293
2280
|
t.algorithm = mt(t.algorithm, e);
|
|
@@ -2454,47 +2441,47 @@ function Pi() {
|
|
|
2454
2441
|
}
|
|
2455
2442
|
return R;
|
|
2456
2443
|
});
|
|
2457
|
-
var p = n.table.core, g = p.schema.primaryKey, v = g.outbound, w = g.extractKey,
|
|
2458
|
-
g && (
|
|
2444
|
+
var p = n.table.core, g = p.schema.primaryKey, v = g.outbound, w = g.extractKey, T = 200, g = t.db._options.modifyChunkSize;
|
|
2445
|
+
g && (T = typeof g == "object" ? g[p.name] || g["*"] || 200 : g);
|
|
2459
2446
|
function O(C, P) {
|
|
2460
2447
|
var k = P.failures, P = P.numFailures;
|
|
2461
|
-
|
|
2448
|
+
x += C - P;
|
|
2462
2449
|
for (var j = 0, L = y(k); j < L.length; j++) {
|
|
2463
2450
|
var K = L[j];
|
|
2464
2451
|
b.push(k[K]);
|
|
2465
2452
|
}
|
|
2466
2453
|
}
|
|
2467
|
-
var b = [],
|
|
2454
|
+
var b = [], x = 0, A = [], N = e === Sr;
|
|
2468
2455
|
return t.clone().primaryKeys().then(function(C) {
|
|
2469
2456
|
function R(P) {
|
|
2470
|
-
var j = Math.min(
|
|
2457
|
+
var j = Math.min(T, C.length - P), L = C.slice(P, P + j);
|
|
2471
2458
|
return (N ? Promise.resolve([]) : p.getMany({ trans: r, keys: L, cache: "immutable" })).then(function(K) {
|
|
2472
2459
|
var q = [], V = [], U = v ? [] : null, W = N ? L : [];
|
|
2473
2460
|
if (!N) for (var ne = 0; ne < j; ++ne) {
|
|
2474
2461
|
var ae = K[ne], ee = { value: Ye(ae), primKey: C[P + ne] };
|
|
2475
2462
|
f.call(ee, ee.value, ee) !== !1 && (ee.value == null ? W.push(C[P + ne]) : v || re(w(ae), w(ee.value)) === 0 ? (V.push(ee.value), v && U.push(C[P + ne])) : (W.push(C[P + ne]), q.push(ee.value)));
|
|
2476
2463
|
}
|
|
2477
|
-
return Promise.resolve(0 < q.length && p.mutate({ trans: r, type: "add", values: q }).then(function(
|
|
2478
|
-
for (var J in
|
|
2479
|
-
O(q.length,
|
|
2464
|
+
return Promise.resolve(0 < q.length && p.mutate({ trans: r, type: "add", values: q }).then(function(be) {
|
|
2465
|
+
for (var J in be.failures) W.splice(parseInt(J), 1);
|
|
2466
|
+
O(q.length, be);
|
|
2480
2467
|
})).then(function() {
|
|
2481
|
-
return (0 < V.length || k && typeof e == "object") && p.mutate({ trans: r, type: "put", keys: U, values: V, criteria: k, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < P }).then(function(
|
|
2482
|
-
return O(V.length,
|
|
2468
|
+
return (0 < V.length || k && typeof e == "object") && p.mutate({ trans: r, type: "put", keys: U, values: V, criteria: k, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < P }).then(function(be) {
|
|
2469
|
+
return O(V.length, be);
|
|
2483
2470
|
});
|
|
2484
2471
|
}).then(function() {
|
|
2485
|
-
return (0 < W.length || k && N) && p.mutate({ trans: r, type: "delete", keys: W, criteria: k, isAdditionalChunk: 0 < P }).then(function(
|
|
2486
|
-
return sn(n.table, W,
|
|
2487
|
-
}).then(function(
|
|
2488
|
-
return O(W.length,
|
|
2472
|
+
return (0 < W.length || k && N) && p.mutate({ trans: r, type: "delete", keys: W, criteria: k, isAdditionalChunk: 0 < P }).then(function(be) {
|
|
2473
|
+
return sn(n.table, W, be);
|
|
2474
|
+
}).then(function(be) {
|
|
2475
|
+
return O(W.length, be);
|
|
2489
2476
|
});
|
|
2490
2477
|
}).then(function() {
|
|
2491
|
-
return C.length > P + j && R(P +
|
|
2478
|
+
return C.length > P + j && R(P + T);
|
|
2492
2479
|
});
|
|
2493
2480
|
});
|
|
2494
2481
|
}
|
|
2495
2482
|
var k = Ot(n) && n.limit === 1 / 0 && (typeof e != "function" || N) && { index: n.index, range: n.range };
|
|
2496
2483
|
return R(0).then(function() {
|
|
2497
|
-
if (0 < b.length) throw new tt("Error modifying one or more objects", b,
|
|
2484
|
+
if (0 < b.length) throw new tt("Error modifying one or more objects", b, x, A);
|
|
2498
2485
|
return C.length;
|
|
2499
2486
|
});
|
|
2500
2487
|
});
|
|
@@ -2519,10 +2506,10 @@ function Pi() {
|
|
|
2519
2506
|
var Sr = function(e, t) {
|
|
2520
2507
|
return t.value = null;
|
|
2521
2508
|
};
|
|
2522
|
-
function
|
|
2509
|
+
function ja(e, t) {
|
|
2523
2510
|
return e < t ? -1 : e === t ? 0 : 1;
|
|
2524
2511
|
}
|
|
2525
|
-
function
|
|
2512
|
+
function Ka(e, t) {
|
|
2526
2513
|
return t < e ? -1 : e === t ? 0 : 1;
|
|
2527
2514
|
}
|
|
2528
2515
|
function Ke(e, t, n) {
|
|
@@ -2534,20 +2521,20 @@ function Pi() {
|
|
|
2534
2521
|
}).limit(0);
|
|
2535
2522
|
}
|
|
2536
2523
|
function ln(e, t, n, r) {
|
|
2537
|
-
var a, u, f, p, v, w,
|
|
2538
|
-
if (!n.every(function(
|
|
2539
|
-
return typeof
|
|
2540
|
-
})) return Ke(e,
|
|
2541
|
-
function O(
|
|
2542
|
-
a =
|
|
2524
|
+
var a, u, f, p, v, w, T, g = n.length;
|
|
2525
|
+
if (!n.every(function(x) {
|
|
2526
|
+
return typeof x == "string";
|
|
2527
|
+
})) return Ke(e, xr);
|
|
2528
|
+
function O(x) {
|
|
2529
|
+
a = x === "next" ? function(N) {
|
|
2543
2530
|
return N.toUpperCase();
|
|
2544
2531
|
} : function(N) {
|
|
2545
2532
|
return N.toLowerCase();
|
|
2546
|
-
}, u =
|
|
2533
|
+
}, u = x === "next" ? function(N) {
|
|
2547
2534
|
return N.toLowerCase();
|
|
2548
2535
|
} : function(N) {
|
|
2549
2536
|
return N.toUpperCase();
|
|
2550
|
-
}, f =
|
|
2537
|
+
}, f = x === "next" ? ja : Ka;
|
|
2551
2538
|
var A = n.map(function(N) {
|
|
2552
2539
|
return { lower: u(N), upper: a(N) };
|
|
2553
2540
|
}).sort(function(N, C) {
|
|
@@ -2557,32 +2544,32 @@ function Pi() {
|
|
|
2557
2544
|
return N.upper;
|
|
2558
2545
|
}), v = A.map(function(N) {
|
|
2559
2546
|
return N.lower;
|
|
2560
|
-
}),
|
|
2547
|
+
}), T = (w = x) === "next" ? "" : r;
|
|
2561
2548
|
}
|
|
2562
2549
|
O("next"), e = new e.Collection(e, function() {
|
|
2563
2550
|
return st(p[0], v[g - 1] + r);
|
|
2564
|
-
}), e._ondirectionchange = function(
|
|
2565
|
-
O(
|
|
2551
|
+
}), e._ondirectionchange = function(x) {
|
|
2552
|
+
O(x);
|
|
2566
2553
|
};
|
|
2567
2554
|
var b = 0;
|
|
2568
|
-
return e._addAlgorithm(function(
|
|
2569
|
-
var C =
|
|
2555
|
+
return e._addAlgorithm(function(x, A, N) {
|
|
2556
|
+
var C = x.key;
|
|
2570
2557
|
if (typeof C != "string") return !1;
|
|
2571
2558
|
var R = u(C);
|
|
2572
2559
|
if (t(R, v, b)) return !0;
|
|
2573
2560
|
for (var k = null, P = b; P < g; ++P) {
|
|
2574
2561
|
var j = (function(L, K, q, V, U, W) {
|
|
2575
2562
|
for (var ne = Math.min(L.length, V.length), ae = -1, ee = 0; ee < ne; ++ee) {
|
|
2576
|
-
var
|
|
2577
|
-
if (
|
|
2578
|
-
U(L[ee],
|
|
2563
|
+
var be = K[ee];
|
|
2564
|
+
if (be !== V[ee]) return U(L[ee], q[ee]) < 0 ? L.substr(0, ee) + q[ee] + q.substr(ee + 1) : U(L[ee], V[ee]) < 0 ? L.substr(0, ee) + V[ee] + q.substr(ee + 1) : 0 <= ae ? L.substr(0, ae) + K[ae] + q.substr(ae + 1) : null;
|
|
2565
|
+
U(L[ee], be) < 0 && (ae = ee);
|
|
2579
2566
|
}
|
|
2580
2567
|
return ne < V.length && W === "next" ? L + q.substr(L.length) : ne < L.length && W === "prev" ? L.substr(0, q.length) : ae < 0 ? null : L.substr(0, ae) + V[ae] + q.substr(ae + 1);
|
|
2581
2568
|
})(C, R, p[P], v[P], f, w);
|
|
2582
2569
|
j === null && k === null ? b = P + 1 : (k === null || 0 < f(k, j)) && (k = j);
|
|
2583
2570
|
}
|
|
2584
2571
|
return A(k !== null ? function() {
|
|
2585
|
-
|
|
2572
|
+
x.continue(k + T);
|
|
2586
2573
|
} : N), !1;
|
|
2587
2574
|
}), e;
|
|
2588
2575
|
}
|
|
@@ -2624,7 +2611,7 @@ function Pi() {
|
|
|
2624
2611
|
return st(void 0, e);
|
|
2625
2612
|
});
|
|
2626
2613
|
}, De.prototype.startsWith = function(e) {
|
|
2627
|
-
return typeof e != "string" ? Ke(this,
|
|
2614
|
+
return typeof e != "string" ? Ke(this, xr) : this.between(e, e + pt, !0, !0);
|
|
2628
2615
|
}, De.prototype.startsWithIgnoreCase = function(e) {
|
|
2629
2616
|
return e === "" ? this.startsWith(e) : ln(this, function(t, n) {
|
|
2630
2617
|
return t.indexOf(n[0]) === 0;
|
|
@@ -2686,12 +2673,12 @@ function Pi() {
|
|
|
2686
2673
|
if (!C.every(function(R) {
|
|
2687
2674
|
return R[0] !== void 0 && R[1] !== void 0 && a(R[0], R[1]) <= 0;
|
|
2688
2675
|
})) return Ke(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", z.InvalidArgument);
|
|
2689
|
-
var v = !t || t.includeLowers !== !1, w = t && t.includeUppers === !0,
|
|
2676
|
+
var v = !t || t.includeLowers !== !1, w = t && t.includeUppers === !0, T, g = a;
|
|
2690
2677
|
function O(R, k) {
|
|
2691
2678
|
return g(R[0], k[0]);
|
|
2692
2679
|
}
|
|
2693
2680
|
try {
|
|
2694
|
-
(
|
|
2681
|
+
(T = C.reduce(function(R, k) {
|
|
2695
2682
|
for (var P = 0, j = R.length; P < j; ++P) {
|
|
2696
2683
|
var L = R[P];
|
|
2697
2684
|
if (r(k[0], L[1]) < 0 && 0 < r(k[1], L[0])) {
|
|
@@ -2704,23 +2691,23 @@ function Pi() {
|
|
|
2704
2691
|
} catch {
|
|
2705
2692
|
return Ke(this, Qe);
|
|
2706
2693
|
}
|
|
2707
|
-
var b = 0,
|
|
2708
|
-
return 0 < a(R,
|
|
2694
|
+
var b = 0, x = w ? function(R) {
|
|
2695
|
+
return 0 < a(R, T[b][1]);
|
|
2709
2696
|
} : function(R) {
|
|
2710
|
-
return 0 <= a(R,
|
|
2697
|
+
return 0 <= a(R, T[b][1]);
|
|
2711
2698
|
}, A = v ? function(R) {
|
|
2712
|
-
return 0 < u(R,
|
|
2699
|
+
return 0 < u(R, T[b][0]);
|
|
2713
2700
|
} : function(R) {
|
|
2714
|
-
return 0 <= u(R,
|
|
2715
|
-
}, N =
|
|
2716
|
-
return st(
|
|
2701
|
+
return 0 <= u(R, T[b][0]);
|
|
2702
|
+
}, N = x, C = new this.Collection(this, function() {
|
|
2703
|
+
return st(T[0][0], T[T.length - 1][1], !v, !w);
|
|
2717
2704
|
});
|
|
2718
2705
|
return C._ondirectionchange = function(R) {
|
|
2719
|
-
g = R === "next" ? (N =
|
|
2706
|
+
g = R === "next" ? (N = x, a) : (N = A, u), T.sort(O);
|
|
2720
2707
|
}, C._addAlgorithm(function(R, k, P) {
|
|
2721
|
-
for (var j, L = R.key; N(L); ) if (++b ===
|
|
2722
|
-
return !
|
|
2723
|
-
g === a ? R.continue(
|
|
2708
|
+
for (var j, L = R.key; N(L); ) if (++b === T.length) return k(P), !1;
|
|
2709
|
+
return !x(j = L) && !A(j) || (n._cmp(L, T[b][1]) === 0 || n._cmp(L, T[b][0]) === 0 || k(function() {
|
|
2710
|
+
g === a ? R.continue(T[b][0]) : R.continue(T[b][1]);
|
|
2724
2711
|
}), !1);
|
|
2725
2712
|
}), C;
|
|
2726
2713
|
}, De.prototype.startsWithAnyOf = function() {
|
|
@@ -2741,7 +2728,7 @@ function Pi() {
|
|
|
2741
2728
|
function Kt(e) {
|
|
2742
2729
|
e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
|
|
2743
2730
|
}
|
|
2744
|
-
var qt = "storagemutated", qn = "x-storagemutated-1", ut = Bt(null, qt),
|
|
2731
|
+
var qt = "storagemutated", qn = "x-storagemutated-1", ut = Bt(null, qt), qa = (We.prototype._lock = function() {
|
|
2745
2732
|
return H(!Y.global), ++this._reculock, this._reculock !== 1 || Y.global || (Y.lockOwnerFor = this), this;
|
|
2746
2733
|
}, We.prototype._unlock = function() {
|
|
2747
2734
|
if (H(!Y.global), --this._reculock == 0) for (Y.global || (Y.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
|
|
@@ -2776,8 +2763,8 @@ function Pi() {
|
|
|
2776
2763
|
}), this;
|
|
2777
2764
|
}, We.prototype._promise = function(e, t, n) {
|
|
2778
2765
|
var r = this;
|
|
2779
|
-
if (e === "readwrite" && this.mode !== "readwrite") return
|
|
2780
|
-
if (!this.active) return
|
|
2766
|
+
if (e === "readwrite" && this.mode !== "readwrite") return _e(new z.ReadOnly("Transaction is readonly"));
|
|
2767
|
+
if (!this.active) return _e(new z.TransactionInactive());
|
|
2781
2768
|
if (this._locked()) return new X(function(u, f) {
|
|
2782
2769
|
r._blockedFuncs.push([function() {
|
|
2783
2770
|
r._promise(e, t, n).then(u, f);
|
|
@@ -2868,34 +2855,34 @@ function Pi() {
|
|
|
2868
2855
|
function Br(e) {
|
|
2869
2856
|
return [].slice.call(e);
|
|
2870
2857
|
}
|
|
2871
|
-
var
|
|
2858
|
+
var La = 0;
|
|
2872
2859
|
function Ut(e) {
|
|
2873
2860
|
return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
|
|
2874
2861
|
}
|
|
2875
|
-
function
|
|
2862
|
+
function Ua(e, t, v) {
|
|
2876
2863
|
function r(N) {
|
|
2877
2864
|
if (N.type === 3) return null;
|
|
2878
2865
|
if (N.type === 4) throw new Error("Cannot convert never type to IDBKeyRange");
|
|
2879
|
-
var b = N.lower,
|
|
2880
|
-
return b === void 0 ?
|
|
2866
|
+
var b = N.lower, x = N.upper, A = N.lowerOpen, N = N.upperOpen;
|
|
2867
|
+
return b === void 0 ? x === void 0 ? null : t.upperBound(x, !!N) : x === void 0 ? t.lowerBound(b, !!A) : t.bound(b, x, !!A, !!N);
|
|
2881
2868
|
}
|
|
2882
2869
|
function a(O) {
|
|
2883
|
-
var b,
|
|
2884
|
-
return { name:
|
|
2870
|
+
var b, x = O.name;
|
|
2871
|
+
return { name: x, schema: O, mutate: function(A) {
|
|
2885
2872
|
var N = A.trans, C = A.type, R = A.keys, k = A.values, P = A.range;
|
|
2886
2873
|
return new Promise(function(j, L) {
|
|
2887
2874
|
j = pe(j);
|
|
2888
|
-
var K = N.objectStore(
|
|
2875
|
+
var K = N.objectStore(x), q = K.keyPath == null, V = C === "put" || C === "add";
|
|
2889
2876
|
if (!V && C !== "delete" && C !== "deleteRange") throw new Error("Invalid operation type: " + C);
|
|
2890
2877
|
var U, W = (R || k || { length: 1 }).length;
|
|
2891
2878
|
if (R && k && R.length !== k.length) throw new Error("Given keys array must have same length as given values array.");
|
|
2892
2879
|
if (W === 0) return j({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
2893
2880
|
function ne(Be) {
|
|
2894
|
-
++
|
|
2881
|
+
++be, Kt(Be);
|
|
2895
2882
|
}
|
|
2896
|
-
var ae = [], ee = [],
|
|
2883
|
+
var ae = [], ee = [], be = 0;
|
|
2897
2884
|
if (C === "deleteRange") {
|
|
2898
|
-
if (P.type === 4) return j({ numFailures:
|
|
2885
|
+
if (P.type === 4) return j({ numFailures: be, failures: ee, results: [], lastResult: void 0 });
|
|
2899
2886
|
P.type === 3 ? ae.push(U = K.clear()) : ae.push(U = K.delete(r(P)));
|
|
2900
2887
|
} else {
|
|
2901
2888
|
var q = V ? q ? [k, R] : [k, null] : [R, null], J = q[0], ke = q[1];
|
|
@@ -2905,7 +2892,7 @@ function Pi() {
|
|
|
2905
2892
|
function En(Be) {
|
|
2906
2893
|
Be = Be.target.result, ae.forEach(function(vt, sr) {
|
|
2907
2894
|
return vt.error != null && (ee[sr] = vt.error);
|
|
2908
|
-
}), j({ numFailures:
|
|
2895
|
+
}), j({ numFailures: be, failures: ee, results: C === "delete" ? R : ae.map(function(vt) {
|
|
2909
2896
|
return vt.result;
|
|
2910
2897
|
}), lastResult: Be });
|
|
2911
2898
|
}
|
|
@@ -2917,7 +2904,7 @@ function Pi() {
|
|
|
2917
2904
|
var N = A.trans, C = A.keys;
|
|
2918
2905
|
return new Promise(function(R, k) {
|
|
2919
2906
|
R = pe(R);
|
|
2920
|
-
for (var P, j = N.objectStore(
|
|
2907
|
+
for (var P, j = N.objectStore(x), L = C.length, K = new Array(L), q = 0, V = 0, U = function(ae) {
|
|
2921
2908
|
ae = ae.target, K[ae._pos] = ae.result, ++V === q && R(K);
|
|
2922
2909
|
}, W = $e(k), ne = 0; ne < L; ++ne) C[ne] != null && ((P = j.get(C[ne]))._pos = ne, P.onsuccess = U, P.onerror = W, ++q);
|
|
2923
2910
|
q === 0 && R(K);
|
|
@@ -2926,7 +2913,7 @@ function Pi() {
|
|
|
2926
2913
|
var N = A.trans, C = A.key;
|
|
2927
2914
|
return new Promise(function(R, k) {
|
|
2928
2915
|
R = pe(R);
|
|
2929
|
-
var P = N.objectStore(
|
|
2916
|
+
var P = N.objectStore(x).get(C);
|
|
2930
2917
|
P.onsuccess = function(j) {
|
|
2931
2918
|
return R(j.target.result);
|
|
2932
2919
|
}, P.onerror = $e(k);
|
|
@@ -2934,7 +2921,7 @@ function Pi() {
|
|
|
2934
2921
|
}, query: (b = w, function(A) {
|
|
2935
2922
|
return new Promise(function(N, C) {
|
|
2936
2923
|
N = pe(N);
|
|
2937
|
-
var R, k, P, q = A.trans, j = A.values, L = A.limit, U = A.query, K = L === 1 / 0 ? void 0 : L, V = U.index, U = U.range, q = q.objectStore(
|
|
2924
|
+
var R, k, P, q = A.trans, j = A.values, L = A.limit, U = A.query, K = L === 1 / 0 ? void 0 : L, V = U.index, U = U.range, q = q.objectStore(x), V = V.isPrimaryKey ? q : q.index(V.name), U = r(U);
|
|
2938
2925
|
if (L === 0) return N({ result: [] });
|
|
2939
2926
|
b ? ((K = j ? V.getAll(U, K) : V.getAllKeys(U, K)).onsuccess = function(W) {
|
|
2940
2927
|
return N({ result: W.target.result });
|
|
@@ -2947,10 +2934,10 @@ function Pi() {
|
|
|
2947
2934
|
var N = A.trans, C = A.values, R = A.query, k = A.reverse, P = A.unique;
|
|
2948
2935
|
return new Promise(function(j, L) {
|
|
2949
2936
|
j = pe(j);
|
|
2950
|
-
var V = R.index, K = R.range, q = N.objectStore(
|
|
2937
|
+
var V = R.index, K = R.range, q = N.objectStore(x), q = V.isPrimaryKey ? q : q.index(V.name), V = k ? P ? "prevunique" : "prev" : P ? "nextunique" : "next", U = !C && "openKeyCursor" in q ? q.openKeyCursor(r(K), V) : q.openCursor(r(K), V);
|
|
2951
2938
|
U.onerror = $e(L), U.onsuccess = pe(function(W) {
|
|
2952
|
-
var ne, ae, ee,
|
|
2953
|
-
J ? (J.___id = ++
|
|
2939
|
+
var ne, ae, ee, be, J = U.result;
|
|
2940
|
+
J ? (J.___id = ++La, J.done = !1, ne = J.continue.bind(J), ae = (ae = J.continuePrimaryKey) && ae.bind(J), ee = J.advance.bind(J), be = function() {
|
|
2954
2941
|
throw new Error("Cursor not stopped");
|
|
2955
2942
|
}, J.trans = N, J.stop = J.continue = J.continuePrimaryKey = J.advance = function() {
|
|
2956
2943
|
throw new Error("Cursor not started");
|
|
@@ -2974,7 +2961,7 @@ function Pi() {
|
|
|
2974
2961
|
}
|
|
2975
2962
|
var En = new Promise(function(Be, vt) {
|
|
2976
2963
|
Be = pe(Be), U.onerror = $e(vt), J.fail = vt, J.stop = function(sr) {
|
|
2977
|
-
J.stop = J.continue = J.continuePrimaryKey = J.advance =
|
|
2964
|
+
J.stop = J.continue = J.continuePrimaryKey = J.advance = be, Be(sr);
|
|
2978
2965
|
};
|
|
2979
2966
|
});
|
|
2980
2967
|
return U.onsuccess = pe(function(Be) {
|
|
@@ -2986,17 +2973,17 @@ function Pi() {
|
|
|
2986
2973
|
}, count: function(A) {
|
|
2987
2974
|
var N = A.query, C = A.trans, R = N.index, k = N.range;
|
|
2988
2975
|
return new Promise(function(P, j) {
|
|
2989
|
-
var L = C.objectStore(
|
|
2976
|
+
var L = C.objectStore(x), K = R.isPrimaryKey ? L : L.index(R.name), L = r(k), K = L ? K.count(L) : K.count();
|
|
2990
2977
|
K.onsuccess = pe(function(q) {
|
|
2991
2978
|
return P(q.target.result);
|
|
2992
2979
|
}), K.onerror = $e(j);
|
|
2993
2980
|
});
|
|
2994
2981
|
} };
|
|
2995
2982
|
}
|
|
2996
|
-
var u, f, p,
|
|
2983
|
+
var u, f, p, T = (f = v, p = Br((u = e).objectStoreNames), { schema: { name: u.name, tables: p.map(function(O) {
|
|
2997
2984
|
return f.objectStore(O);
|
|
2998
2985
|
}).map(function(O) {
|
|
2999
|
-
var b = O.keyPath, N = O.autoIncrement,
|
|
2986
|
+
var b = O.keyPath, N = O.autoIncrement, x = _(b), A = {}, N = { name: O.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: b == null, compound: x, keyPath: b, autoIncrement: N, unique: !0, extractKey: Vn(b) }, indexes: Br(O.indexNames).map(function(C) {
|
|
3000
2987
|
return O.index(C);
|
|
3001
2988
|
}).map(function(P) {
|
|
3002
2989
|
var R = P.name, k = P.unique, j = P.multiEntry, P = P.keyPath, j = { name: R, compound: _(P), keyPath: P, unique: k, multiEntry: j, extractKey: Vn(P) };
|
|
@@ -3005,22 +2992,22 @@ function Pi() {
|
|
|
3005
2992
|
return A[Ut(C)];
|
|
3006
2993
|
} };
|
|
3007
2994
|
return A[":id"] = N.primaryKey, b != null && (A[Ut(b)] = N.primaryKey), N;
|
|
3008
|
-
}) }, hasGetAll: 0 < p.length && "getAll" in f.objectStore(p[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), v =
|
|
3009
|
-
return
|
|
2995
|
+
}) }, hasGetAll: 0 < p.length && "getAll" in f.objectStore(p[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), v = T.schema, w = T.hasGetAll, T = v.tables.map(a), g = {};
|
|
2996
|
+
return T.forEach(function(O) {
|
|
3010
2997
|
return g[O.name] = O;
|
|
3011
2998
|
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(O) {
|
|
3012
2999
|
if (!g[O]) throw new Error("Table '".concat(O, "' not found"));
|
|
3013
3000
|
return g[O];
|
|
3014
3001
|
}, MIN_KEY: -1 / 0, MAX_KEY: Lt(t), schema: v };
|
|
3015
3002
|
}
|
|
3016
|
-
function
|
|
3003
|
+
function Va(e, t, n, r) {
|
|
3017
3004
|
var a = n.IDBKeyRange;
|
|
3018
|
-
return n.indexedDB, { dbcore: (r =
|
|
3005
|
+
return n.indexedDB, { dbcore: (r = Ua(t, a, r), e.dbcore.reduce(function(u, f) {
|
|
3019
3006
|
return f = f.create, i(i({}, u), f(u));
|
|
3020
3007
|
}, r)) };
|
|
3021
3008
|
}
|
|
3022
3009
|
function fn(e, r) {
|
|
3023
|
-
var n = r.db, r =
|
|
3010
|
+
var n = r.db, r = Va(e._middlewares, n, e._deps, r);
|
|
3024
3011
|
e.core = r.dbcore, e.tables.forEach(function(a) {
|
|
3025
3012
|
var u = a.name;
|
|
3026
3013
|
e.core.schema.tables.some(function(f) {
|
|
@@ -3032,8 +3019,8 @@ function Pi() {
|
|
|
3032
3019
|
n.forEach(function(a) {
|
|
3033
3020
|
var u = r[a];
|
|
3034
3021
|
t.forEach(function(f) {
|
|
3035
|
-
var p = (function v(w,
|
|
3036
|
-
return ue(w,
|
|
3022
|
+
var p = (function v(w, T) {
|
|
3023
|
+
return ue(w, T) || (w = F(w)) && v(w, T);
|
|
3037
3024
|
})(f, a);
|
|
3038
3025
|
(!p || "value" in p && p.value === void 0) && (f === e.Transaction.prototype || f instanceof e.Transaction ? M(f, a, { get: function() {
|
|
3039
3026
|
return this.table(a);
|
|
@@ -3048,31 +3035,31 @@ function Pi() {
|
|
|
3048
3035
|
for (var r in n) n[r] instanceof e.Table && delete n[r];
|
|
3049
3036
|
});
|
|
3050
3037
|
}
|
|
3051
|
-
function
|
|
3038
|
+
function Ga(e, t) {
|
|
3052
3039
|
return e._cfg.version - t._cfg.version;
|
|
3053
3040
|
}
|
|
3054
|
-
function
|
|
3041
|
+
function Xa(e, t, n, r) {
|
|
3055
3042
|
var a = e._dbSchema;
|
|
3056
3043
|
n.objectStoreNames.contains("$meta") && !a.$meta && (a.$meta = Un("$meta", jr("")[0], []), e._storeNames.push("$meta"));
|
|
3057
3044
|
var u = e._createTransaction("readwrite", e._storeNames, a);
|
|
3058
3045
|
u.create(n), u._completion.catch(r);
|
|
3059
3046
|
var f = u._reject.bind(u), p = Y.transless || Y;
|
|
3060
3047
|
at(function() {
|
|
3061
|
-
return Y.trans = u, Y.transless = p, t !== 0 ? (fn(e, n), w = t, ((v = u).storeNames.includes("$meta") ? v.table("$meta").get("version").then(function(
|
|
3062
|
-
return
|
|
3063
|
-
}) : X.resolve(w)).then(function(
|
|
3064
|
-
return O =
|
|
3048
|
+
return Y.trans = u, Y.transless = p, t !== 0 ? (fn(e, n), w = t, ((v = u).storeNames.includes("$meta") ? v.table("$meta").get("version").then(function(T) {
|
|
3049
|
+
return T ?? w;
|
|
3050
|
+
}) : X.resolve(w)).then(function(T) {
|
|
3051
|
+
return O = T, b = u, x = n, A = [], T = (g = e)._versions, N = g._dbSchema = pn(0, g.idbdb, x), (T = T.filter(function(C) {
|
|
3065
3052
|
return C._cfg.version >= O;
|
|
3066
|
-
})).length !== 0 ? (
|
|
3053
|
+
})).length !== 0 ? (T.forEach(function(C) {
|
|
3067
3054
|
A.push(function() {
|
|
3068
3055
|
var R = N, k = C._cfg.dbschema;
|
|
3069
|
-
mn(g, R,
|
|
3056
|
+
mn(g, R, x), mn(g, k, x), N = g._dbSchema = k;
|
|
3070
3057
|
var P = Xn(R, k);
|
|
3071
3058
|
P.add.forEach(function(V) {
|
|
3072
|
-
$n(
|
|
3059
|
+
$n(x, V[0], V[1].primKey, V[1].indexes);
|
|
3073
3060
|
}), P.change.forEach(function(V) {
|
|
3074
3061
|
if (V.recreate) throw new z.Upgrade("Not yet support for changing primary key");
|
|
3075
|
-
var U =
|
|
3062
|
+
var U = x.objectStore(V.name);
|
|
3076
3063
|
V.add.forEach(function(W) {
|
|
3077
3064
|
return hn(U, W);
|
|
3078
3065
|
}), V.change.forEach(function(W) {
|
|
@@ -3083,7 +3070,7 @@ function Pi() {
|
|
|
3083
3070
|
});
|
|
3084
3071
|
var j = C._cfg.contentUpgrade;
|
|
3085
3072
|
if (j && C._cfg.version > O) {
|
|
3086
|
-
fn(g,
|
|
3073
|
+
fn(g, x), b._memoizedTables = {};
|
|
3087
3074
|
var L = me(k);
|
|
3088
3075
|
P.del.forEach(function(V) {
|
|
3089
3076
|
L[V] = R[V];
|
|
@@ -3109,18 +3096,18 @@ function Pi() {
|
|
|
3109
3096
|
}), (function C() {
|
|
3110
3097
|
return A.length ? X.resolve(A.shift()(b.idbtrans)).then(C) : X.resolve();
|
|
3111
3098
|
})().then(function() {
|
|
3112
|
-
Mr(N,
|
|
3099
|
+
Mr(N, x);
|
|
3113
3100
|
})) : X.resolve();
|
|
3114
|
-
var g, O, b,
|
|
3115
|
-
}).catch(f)) : (y(a).forEach(function(
|
|
3116
|
-
$n(n,
|
|
3101
|
+
var g, O, b, x, A, N;
|
|
3102
|
+
}).catch(f)) : (y(a).forEach(function(T) {
|
|
3103
|
+
$n(n, T, a[T].primKey, a[T].indexes);
|
|
3117
3104
|
}), fn(e, n), void X.follow(function() {
|
|
3118
3105
|
return e.on.populate.fire(u);
|
|
3119
3106
|
}).catch(f));
|
|
3120
3107
|
var v, w;
|
|
3121
3108
|
});
|
|
3122
3109
|
}
|
|
3123
|
-
function
|
|
3110
|
+
function $a(e, t) {
|
|
3124
3111
|
Mr(e._dbSchema, t), t.db.version % 10 != 0 || t.objectStoreNames.contains("$meta") || t.db.createObjectStore("$meta").add(Math.ceil(t.db.version / 10 - 1), "version");
|
|
3125
3112
|
var n = pn(0, e.idbdb, t);
|
|
3126
3113
|
mn(e, e._dbSchema, t);
|
|
@@ -3147,8 +3134,8 @@ function Pi() {
|
|
|
3147
3134
|
var p = a.idxByName, v = u.idxByName, w = void 0;
|
|
3148
3135
|
for (w in p) v[w] || f.del.push(w);
|
|
3149
3136
|
for (w in v) {
|
|
3150
|
-
var
|
|
3151
|
-
|
|
3137
|
+
var T = p[w], g = v[w];
|
|
3138
|
+
T ? T.src !== g.src && f.change.push(g) : f.add.push(g);
|
|
3152
3139
|
}
|
|
3153
3140
|
(0 < f.del.length || 0 < f.add.length || 0 < f.change.length) && r.change.push(f);
|
|
3154
3141
|
}
|
|
@@ -3172,10 +3159,10 @@ function Pi() {
|
|
|
3172
3159
|
}
|
|
3173
3160
|
function pn(e, t, n) {
|
|
3174
3161
|
var r = {};
|
|
3175
|
-
return
|
|
3162
|
+
return Te(t.objectStoreNames, 0).forEach(function(a) {
|
|
3176
3163
|
for (var u = n.objectStore(a), f = Ln(Fr(w = u.keyPath), w || "", !0, !1, !!u.autoIncrement, w && typeof w != "string", !0), p = [], v = 0; v < u.indexNames.length; ++v) {
|
|
3177
|
-
var
|
|
3178
|
-
p.push(
|
|
3164
|
+
var T = u.index(u.indexNames[v]), w = T.keyPath, T = Ln(T.name, w, !!T.unique, !!T.multiEntry, !1, w && typeof w != "string", !1);
|
|
3165
|
+
p.push(T);
|
|
3179
3166
|
}
|
|
3180
3167
|
r[a] = Un(a, f, p);
|
|
3181
3168
|
}), r;
|
|
@@ -3185,8 +3172,8 @@ function Pi() {
|
|
|
3185
3172
|
var u = r[a], f = n.objectStore(u);
|
|
3186
3173
|
e._hasGetAll = "getAll" in f;
|
|
3187
3174
|
for (var p = 0; p < f.indexNames.length; ++p) {
|
|
3188
|
-
var v = f.indexNames[p], w = f.index(v).keyPath,
|
|
3189
|
-
!t[u] || (w = t[u].idxByName[
|
|
3175
|
+
var v = f.indexNames[p], w = f.index(v).keyPath, T = typeof w == "string" ? w : "[" + Te(w).join("+") + "]";
|
|
3176
|
+
!t[u] || (w = t[u].idxByName[T]) && (w.name = v, delete t[u].idxByName[T], t[u].idxByName[v] = w);
|
|
3190
3177
|
}
|
|
3191
3178
|
}
|
|
3192
3179
|
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && h.WorkerGlobalScope && h instanceof h.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
@@ -3197,7 +3184,7 @@ function Pi() {
|
|
|
3197
3184
|
return Ln(a, u || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), _(u), n === 0, r);
|
|
3198
3185
|
});
|
|
3199
3186
|
}
|
|
3200
|
-
var
|
|
3187
|
+
var Wa = (Dt.prototype._createTableSchema = Un, Dt.prototype._parseIndexSyntax = jr, Dt.prototype._parseStoresSpec = function(e, t) {
|
|
3201
3188
|
var n = this;
|
|
3202
3189
|
y(e).forEach(function(r) {
|
|
3203
3190
|
if (e[r] !== null) {
|
|
@@ -3347,23 +3334,23 @@ function Pi() {
|
|
|
3347
3334
|
}
|
|
3348
3335
|
function Ur(e, t, n, r) {
|
|
3349
3336
|
for (var a = [], u = 0, f = Object.entries(e.queries.query); u < f.length; u++) {
|
|
3350
|
-
for (var p = f[u], v = p[0], w = [],
|
|
3351
|
-
var O = g[
|
|
3337
|
+
for (var p = f[u], v = p[0], w = [], T = 0, g = p[1]; T < g.length; T++) {
|
|
3338
|
+
var O = g[T];
|
|
3352
3339
|
Hn(t, O.obsSet) ? O.subscribers.forEach(function(N) {
|
|
3353
3340
|
return n.add(N);
|
|
3354
3341
|
}) : r && w.push(O);
|
|
3355
3342
|
}
|
|
3356
3343
|
r && a.push([v, w]);
|
|
3357
3344
|
}
|
|
3358
|
-
if (r) for (var b = 0,
|
|
3359
|
-
var A =
|
|
3345
|
+
if (r) for (var b = 0, x = a; b < x.length; b++) {
|
|
3346
|
+
var A = x[b], v = A[0], w = A[1];
|
|
3360
3347
|
e.queries.query[v] = w;
|
|
3361
3348
|
}
|
|
3362
3349
|
}
|
|
3363
|
-
function
|
|
3350
|
+
function Ya(e) {
|
|
3364
3351
|
var t = e._state, n = e._deps.indexedDB;
|
|
3365
3352
|
if (t.isBeingOpened || e.idbdb) return t.dbReadyPromise.then(function() {
|
|
3366
|
-
return t.dbOpenError ?
|
|
3353
|
+
return t.dbOpenError ? _e(t.dbOpenError) : e;
|
|
3367
3354
|
});
|
|
3368
3355
|
t.isBeingOpened = !0, t.dbOpenError = null, t.openComplete = !1;
|
|
3369
3356
|
var r = t.openCanceller, a = Math.round(10 * e.verno), u = !1;
|
|
@@ -3373,19 +3360,19 @@ function Pi() {
|
|
|
3373
3360
|
function p() {
|
|
3374
3361
|
return new X(function(O, b) {
|
|
3375
3362
|
if (f(), !n) throw new z.MissingAPI();
|
|
3376
|
-
var
|
|
3363
|
+
var x = e.name, A = t.autoSchema || !a ? n.open(x) : n.open(x, a);
|
|
3377
3364
|
if (!A) throw new z.MissingAPI();
|
|
3378
3365
|
A.onerror = $e(b), A.onblocked = pe(e._fireOnBlocked), A.onupgradeneeded = pe(function(N) {
|
|
3379
3366
|
var C;
|
|
3380
|
-
|
|
3381
|
-
b(new z.NoSuchDatabase("Database ".concat(
|
|
3382
|
-
})) : (
|
|
3367
|
+
T = A.transaction, t.autoSchema && !e._options.allowEmptyDB ? (A.onerror = Kt, T.abort(), A.result.close(), (C = n.deleteDatabase(x)).onsuccess = C.onerror = pe(function() {
|
|
3368
|
+
b(new z.NoSuchDatabase("Database ".concat(x, " doesnt exist")));
|
|
3369
|
+
})) : (T.onerror = $e(b), N = N.oldVersion > Math.pow(2, 62) ? 0 : N.oldVersion, g = N < 1, e.idbdb = A.result, u && $a(e, T), Xa(e, N / 10, T, b));
|
|
3383
3370
|
}, b), A.onsuccess = pe(function() {
|
|
3384
|
-
|
|
3385
|
-
var N, C, R, k, P, j = e.idbdb = A.result, L =
|
|
3371
|
+
T = null;
|
|
3372
|
+
var N, C, R, k, P, j = e.idbdb = A.result, L = Te(j.objectStoreNames);
|
|
3386
3373
|
if (0 < L.length) try {
|
|
3387
3374
|
var K = j.transaction((k = L).length === 1 ? k[0] : k, "readonly");
|
|
3388
|
-
if (t.autoSchema) C = j, R = K, (N = e).verno = C.version / 10, R = N._dbSchema = pn(0, C, R), N._storeNames =
|
|
3375
|
+
if (t.autoSchema) C = j, R = K, (N = e).verno = C.version / 10, R = N._dbSchema = pn(0, C, R), N._storeNames = Te(C.objectStoreNames, 0), dn(N, [N._allTables], y(R), R);
|
|
3389
3376
|
else if (mn(e, e._dbSchema, K), ((P = Xn(pn(0, (P = e).idbdb, K), P._dbSchema)).add.length || P.change.some(function(q) {
|
|
3390
3377
|
return q.add.length || q.change.length;
|
|
3391
3378
|
})) && !u) 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."), j.close(), a = j.version + 1, u = !0, O(p());
|
|
@@ -3396,7 +3383,7 @@ function Pi() {
|
|
|
3396
3383
|
t.vcFired = !0, e.on("versionchange").fire(q);
|
|
3397
3384
|
}), j.onclose = pe(function(q) {
|
|
3398
3385
|
e.on("close").fire(q);
|
|
3399
|
-
}), g && (P = e._deps, K =
|
|
3386
|
+
}), g && (P = e._deps, K = x, j = P.indexedDB, P = P.IDBKeyRange, Yn(j) || K === an || Wn(j, P).put({ name: K }).catch(c)), O();
|
|
3400
3387
|
}, b);
|
|
3401
3388
|
}).catch(function(O) {
|
|
3402
3389
|
switch (O?.name) {
|
|
@@ -3409,7 +3396,7 @@ function Pi() {
|
|
|
3409
3396
|
return X.reject(O);
|
|
3410
3397
|
});
|
|
3411
3398
|
}
|
|
3412
|
-
var v, w = t.dbReadyResolve,
|
|
3399
|
+
var v, w = t.dbReadyResolve, T = null, g = !1;
|
|
3413
3400
|
return X.race([r, (typeof navigator > "u" ? X.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(O) {
|
|
3414
3401
|
function b() {
|
|
3415
3402
|
return indexedDB.databases().finally(O);
|
|
@@ -3433,17 +3420,17 @@ function Pi() {
|
|
|
3433
3420
|
}).catch(function(O) {
|
|
3434
3421
|
t.dbOpenError = O;
|
|
3435
3422
|
try {
|
|
3436
|
-
|
|
3423
|
+
T && T.abort();
|
|
3437
3424
|
} catch {
|
|
3438
3425
|
}
|
|
3439
|
-
return r === t.openCanceller && e._close(),
|
|
3426
|
+
return r === t.openCanceller && e._close(), _e(O);
|
|
3440
3427
|
}).finally(function() {
|
|
3441
3428
|
t.openComplete = !0, w();
|
|
3442
3429
|
}).then(function() {
|
|
3443
3430
|
var O;
|
|
3444
3431
|
return g && (O = {}, e.tables.forEach(function(b) {
|
|
3445
|
-
b.schema.indexes.forEach(function(
|
|
3446
|
-
|
|
3432
|
+
b.schema.indexes.forEach(function(x) {
|
|
3433
|
+
x.name && (O["idb://".concat(e.name, "/").concat(b.name, "/").concat(x.name)] = new Se(-1 / 0, [[[]]]));
|
|
3447
3434
|
}), O["idb://".concat(e.name, "/").concat(b.name, "/")] = O["idb://".concat(e.name, "/").concat(b.name, "/:dels")] = new Se(-1 / 0, [[[]]]);
|
|
3448
3435
|
}), ut(qt).fire(O), er(O, !0)), e;
|
|
3449
3436
|
});
|
|
@@ -3467,11 +3454,11 @@ function Pi() {
|
|
|
3467
3454
|
for (var r = _(e) ? e.slice() : [e], a = 0; a < n; ++a) r.push(t);
|
|
3468
3455
|
return r;
|
|
3469
3456
|
}
|
|
3470
|
-
var
|
|
3457
|
+
var za = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
3471
3458
|
return i(i({}, e), { table: function(t) {
|
|
3472
3459
|
var n = e.table(t), r = n.schema, a = {}, u = [];
|
|
3473
3460
|
function f(g, O, b) {
|
|
3474
|
-
var
|
|
3461
|
+
var x = Ut(g), A = a[x] = a[x] || [], N = g == null ? 0 : typeof g == "string" ? 1 : g.length, C = 0 < O, C = i(i({}, b), { name: C ? "".concat(x, "(virtual-from:").concat(b.name, ")") : b.name, lowLevelIndex: b, isVirtual: C, keyTail: O, keyLength: N, extractKey: Vn(g), unique: !C && b.unique });
|
|
3475
3462
|
return A.push(C), C.isPrimaryKey || u.push(C), 1 < N && f(N === 2 ? g[0] : g.slice(0, N - 1), O + 1, b), A.sort(function(R, k) {
|
|
3476
3463
|
return R.keyTail - k.keyTail;
|
|
3477
3464
|
}), C;
|
|
@@ -3481,19 +3468,19 @@ function Pi() {
|
|
|
3481
3468
|
var w = v[p];
|
|
3482
3469
|
f(w.keyPath, 0, w);
|
|
3483
3470
|
}
|
|
3484
|
-
function
|
|
3471
|
+
function T(g) {
|
|
3485
3472
|
var O, b = g.query.index;
|
|
3486
3473
|
return b.isVirtual ? i(i({}, g), { query: { index: b.lowLevelIndex, range: (O = g.query.range, b = b.keyTail, { type: O.type === 1 ? 2 : O.type, lower: bn(O.lower, O.lowerOpen ? e.MAX_KEY : e.MIN_KEY, b), lowerOpen: !0, upper: bn(O.upper, O.upperOpen ? e.MIN_KEY : e.MAX_KEY, b), upperOpen: !0 }) } }) : g;
|
|
3487
3474
|
}
|
|
3488
3475
|
return i(i({}, n), { schema: i(i({}, r), { primaryKey: t, indexes: u, getIndexByKeyPath: function(g) {
|
|
3489
3476
|
return (g = a[Ut(g)]) && g[0];
|
|
3490
3477
|
} }), count: function(g) {
|
|
3491
|
-
return n.count(
|
|
3478
|
+
return n.count(T(g));
|
|
3492
3479
|
}, query: function(g) {
|
|
3493
|
-
return n.query(
|
|
3480
|
+
return n.query(T(g));
|
|
3494
3481
|
}, openCursor: function(g) {
|
|
3495
|
-
var O = g.query.index, b = O.keyTail,
|
|
3496
|
-
return
|
|
3482
|
+
var O = g.query.index, b = O.keyTail, x = O.isVirtual, A = O.keyLength;
|
|
3483
|
+
return x ? n.openCursor(T(g)).then(function(C) {
|
|
3497
3484
|
return C && N(C);
|
|
3498
3485
|
}) : n.openCursor(g);
|
|
3499
3486
|
function N(C) {
|
|
@@ -3524,7 +3511,7 @@ function Pi() {
|
|
|
3524
3511
|
function rr(e, t) {
|
|
3525
3512
|
return t.type === "delete" ? t.keys : t.keys || t.values.map(e.extractKey);
|
|
3526
3513
|
}
|
|
3527
|
-
var
|
|
3514
|
+
var Qa = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
3528
3515
|
return i(i({}, e), { table: function(t) {
|
|
3529
3516
|
var n = e.table(t), r = n.schema.primaryKey;
|
|
3530
3517
|
return i(i({}, n), { mutate: function(a) {
|
|
@@ -3533,36 +3520,36 @@ function Pi() {
|
|
|
3533
3520
|
case "add":
|
|
3534
3521
|
if (v.fire === c) break;
|
|
3535
3522
|
return u._promise("readwrite", function() {
|
|
3536
|
-
return
|
|
3523
|
+
return T(a);
|
|
3537
3524
|
}, !0);
|
|
3538
3525
|
case "put":
|
|
3539
3526
|
if (v.fire === c && w.fire === c) break;
|
|
3540
3527
|
return u._promise("readwrite", function() {
|
|
3541
|
-
return
|
|
3528
|
+
return T(a);
|
|
3542
3529
|
}, !0);
|
|
3543
3530
|
case "delete":
|
|
3544
3531
|
if (p.fire === c) break;
|
|
3545
3532
|
return u._promise("readwrite", function() {
|
|
3546
|
-
return
|
|
3533
|
+
return T(a);
|
|
3547
3534
|
}, !0);
|
|
3548
3535
|
case "deleteRange":
|
|
3549
3536
|
if (p.fire === c) break;
|
|
3550
3537
|
return u._promise("readwrite", function() {
|
|
3551
|
-
return (function g(O, b,
|
|
3552
|
-
return n.query({ trans: O, values: !1, query: { index: r, range: b }, limit:
|
|
3538
|
+
return (function g(O, b, x) {
|
|
3539
|
+
return n.query({ trans: O, values: !1, query: { index: r, range: b }, limit: x }).then(function(A) {
|
|
3553
3540
|
var N = A.result;
|
|
3554
|
-
return
|
|
3555
|
-
return 0 < C.numFailures ? Promise.reject(C.failures[0]) : N.length <
|
|
3541
|
+
return T({ type: "delete", keys: N, trans: O }).then(function(C) {
|
|
3542
|
+
return 0 < C.numFailures ? Promise.reject(C.failures[0]) : N.length < x ? { failures: [], numFailures: 0, lastResult: void 0 } : g(O, i(i({}, b), { lower: N[N.length - 1], lowerOpen: !0 }), x);
|
|
3556
3543
|
});
|
|
3557
3544
|
});
|
|
3558
3545
|
})(a.trans, a.range, 1e4);
|
|
3559
3546
|
}, !0);
|
|
3560
3547
|
}
|
|
3561
3548
|
return n.mutate(a);
|
|
3562
|
-
function
|
|
3563
|
-
var O, b,
|
|
3549
|
+
function T(g) {
|
|
3550
|
+
var O, b, x, A = Y.trans, N = g.keys || rr(r, g);
|
|
3564
3551
|
if (!N) throw new Error("Keys missing");
|
|
3565
|
-
return (g = g.type === "add" || g.type === "put" ? i(i({}, g), { keys: N }) : i({}, g)).type !== "delete" && (g.values = d([], g.values)), g.keys && (g.keys = d([], g.keys)), O = n,
|
|
3552
|
+
return (g = g.type === "add" || g.type === "put" ? i(i({}, g), { keys: N }) : i({}, g)).type !== "delete" && (g.values = d([], g.values)), g.keys && (g.keys = d([], g.keys)), O = n, x = N, ((b = g).type === "add" ? Promise.resolve([]) : O.getMany({ trans: b.trans, keys: x, cache: "immutable" })).then(function(C) {
|
|
3566
3553
|
var R = N.map(function(k, P) {
|
|
3567
3554
|
var j, L, K, q = C[P], V = { onerror: null, onsuccess: null };
|
|
3568
3555
|
return g.type === "delete" ? p.fire.call(V, k, q, A) : g.type === "add" || q === void 0 ? (j = v.fire.call(V, k, g.values[P], A), k == null && j != null && (g.keys[P] = k = j, r.outbound || le(g.values[P], r.keyPath, k))) : (j = nr(q, g.values[P]), (L = w.fire.call(V, j, k, q, A)) && (K = g.values[P], Object.keys(L).forEach(function(U) {
|
|
@@ -3594,7 +3581,7 @@ function Pi() {
|
|
|
3594
3581
|
return null;
|
|
3595
3582
|
}
|
|
3596
3583
|
}
|
|
3597
|
-
var
|
|
3584
|
+
var Ha = { stack: "dbcore", level: -1, create: function(e) {
|
|
3598
3585
|
return { table: function(t) {
|
|
3599
3586
|
var n = e.table(t);
|
|
3600
3587
|
return i(i({}, n), { getMany: function(r) {
|
|
@@ -3622,7 +3609,7 @@ function Pi() {
|
|
|
3622
3609
|
return !1;
|
|
3623
3610
|
}
|
|
3624
3611
|
}
|
|
3625
|
-
var
|
|
3612
|
+
var Za = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
3626
3613
|
var t = e.schema.name, n = new Se(e.MIN_KEY, e.MAX_KEY);
|
|
3627
3614
|
return i(i({}, e), { transaction: function(r, a, u) {
|
|
3628
3615
|
if (Y.subscr && a !== "readonly") throw new z.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Y.querier));
|
|
@@ -3630,21 +3617,21 @@ function Pi() {
|
|
|
3630
3617
|
}, table: function(r) {
|
|
3631
3618
|
var a = e.table(r), u = a.schema, f = u.primaryKey, g = u.indexes, p = f.extractKey, v = f.outbound, w = f.autoIncrement && g.filter(function(b) {
|
|
3632
3619
|
return b.compound && b.keyPath.includes(f.keyPath);
|
|
3633
|
-
}),
|
|
3634
|
-
function
|
|
3620
|
+
}), T = i(i({}, a), { mutate: function(b) {
|
|
3621
|
+
function x(U) {
|
|
3635
3622
|
return U = "idb://".concat(t, "/").concat(r, "/").concat(U), k[U] || (k[U] = new Se());
|
|
3636
3623
|
}
|
|
3637
|
-
var A, N, C, R = b.trans, k = b.mutatedParts || (b.mutatedParts = {}), P =
|
|
3624
|
+
var A, N, C, R = b.trans, k = b.mutatedParts || (b.mutatedParts = {}), P = x(""), j = x(":dels"), L = b.type, V = b.type === "deleteRange" ? [b.range] : b.type === "delete" ? [b.keys] : b.values.length < 50 ? [rr(f, b).filter(function(U) {
|
|
3638
3625
|
return U;
|
|
3639
3626
|
}), b.values] : [], K = V[0], q = V[1], V = b.trans._cache;
|
|
3640
|
-
return _(K) ? (P.addKeys(K), (V = L === "delete" || K.length === q.length ? Vr(K, V) : null) || j.addKeys(K), (V || q) && (A =
|
|
3627
|
+
return _(K) ? (P.addKeys(K), (V = L === "delete" || K.length === q.length ? Vr(K, V) : null) || j.addKeys(K), (V || q) && (A = x, N = V, C = q, u.indexes.forEach(function(U) {
|
|
3641
3628
|
var W = A(U.name || "");
|
|
3642
3629
|
function ne(ee) {
|
|
3643
3630
|
return ee != null ? U.extractKey(ee) : null;
|
|
3644
3631
|
}
|
|
3645
3632
|
function ae(ee) {
|
|
3646
|
-
return U.multiEntry && _(ee) ? ee.forEach(function(
|
|
3647
|
-
return W.addKey(
|
|
3633
|
+
return U.multiEntry && _(ee) ? ee.forEach(function(be) {
|
|
3634
|
+
return W.addKey(be);
|
|
3648
3635
|
}) : W.addKey(ee);
|
|
3649
3636
|
}
|
|
3650
3637
|
(N || C).forEach(function(ee, ke) {
|
|
@@ -3652,44 +3639,44 @@ function Pi() {
|
|
|
3652
3639
|
re(J, ke) !== 0 && (J != null && ae(J), ke != null && ae(ke));
|
|
3653
3640
|
});
|
|
3654
3641
|
}))) : K ? (q = { from: (q = K.lower) !== null && q !== void 0 ? q : e.MIN_KEY, to: (q = K.upper) !== null && q !== void 0 ? q : e.MAX_KEY }, j.add(q), P.add(q)) : (P.add(n), j.add(n), u.indexes.forEach(function(U) {
|
|
3655
|
-
return
|
|
3642
|
+
return x(U.name).add(n);
|
|
3656
3643
|
})), a.mutate(b).then(function(U) {
|
|
3657
3644
|
return !K || b.type !== "add" && b.type !== "put" || (P.addKeys(U.results), w && w.forEach(function(W) {
|
|
3658
3645
|
for (var ne = b.values.map(function(J) {
|
|
3659
3646
|
return W.extractKey(J);
|
|
3660
3647
|
}), ae = W.keyPath.findIndex(function(J) {
|
|
3661
3648
|
return J === f.keyPath;
|
|
3662
|
-
}), ee = 0,
|
|
3663
|
-
|
|
3649
|
+
}), ee = 0, be = U.results.length; ee < be; ++ee) ne[ee][ae] = U.results[ee];
|
|
3650
|
+
x(W.name).addKeys(ne);
|
|
3664
3651
|
})), R.mutatedParts = yn(R.mutatedParts || {}, k), U;
|
|
3665
3652
|
});
|
|
3666
|
-
} }), g = function(
|
|
3667
|
-
var A =
|
|
3668
|
-
return [
|
|
3653
|
+
} }), g = function(x) {
|
|
3654
|
+
var A = x.query, x = A.index, A = A.range;
|
|
3655
|
+
return [x, new Se((x = A.lower) !== null && x !== void 0 ? x : e.MIN_KEY, (A = A.upper) !== null && A !== void 0 ? A : e.MAX_KEY)];
|
|
3669
3656
|
}, O = { get: function(b) {
|
|
3670
3657
|
return [f, new Se(b.key)];
|
|
3671
3658
|
}, getMany: function(b) {
|
|
3672
3659
|
return [f, new Se().addKeys(b.keys)];
|
|
3673
3660
|
}, count: g, query: g, openCursor: g };
|
|
3674
3661
|
return y(O).forEach(function(b) {
|
|
3675
|
-
|
|
3676
|
-
var A = Y.subscr, N = !!A, C = Gr(Y, a) && Xr(b,
|
|
3662
|
+
T[b] = function(x) {
|
|
3663
|
+
var A = Y.subscr, N = !!A, C = Gr(Y, a) && Xr(b, x) ? x.obsSet = {} : A;
|
|
3677
3664
|
if (N) {
|
|
3678
3665
|
var R = function(q) {
|
|
3679
3666
|
return q = "idb://".concat(t, "/").concat(r, "/").concat(q), C[q] || (C[q] = new Se());
|
|
3680
|
-
}, k = R(""), P = R(":dels"), A = O[b](
|
|
3681
|
-
if ((b === "query" && N.isPrimaryKey && !
|
|
3667
|
+
}, k = R(""), P = R(":dels"), A = O[b](x), N = A[0], A = A[1];
|
|
3668
|
+
if ((b === "query" && N.isPrimaryKey && !x.values ? P : R(N.name || "")).add(A), !N.isPrimaryKey) {
|
|
3682
3669
|
if (b !== "count") {
|
|
3683
|
-
var j = b === "query" && v &&
|
|
3670
|
+
var j = b === "query" && v && x.values && a.query(i(i({}, x), { values: !1 }));
|
|
3684
3671
|
return a[b].apply(this, arguments).then(function(q) {
|
|
3685
3672
|
if (b === "query") {
|
|
3686
|
-
if (v &&
|
|
3673
|
+
if (v && x.values) return j.then(function(ne) {
|
|
3687
3674
|
return ne = ne.result, k.addKeys(ne), q;
|
|
3688
3675
|
});
|
|
3689
|
-
var V =
|
|
3690
|
-
(
|
|
3676
|
+
var V = x.values ? q.result.map(p) : q.result;
|
|
3677
|
+
(x.values ? k : P).addKeys(V);
|
|
3691
3678
|
} else if (b === "openCursor") {
|
|
3692
|
-
var U = q, W =
|
|
3679
|
+
var U = q, W = x.values;
|
|
3693
3680
|
return U && Object.create(U, { key: { get: function() {
|
|
3694
3681
|
return P.addKey(U.primaryKey), U.key;
|
|
3695
3682
|
} }, primaryKey: { get: function() {
|
|
@@ -3707,7 +3694,7 @@ function Pi() {
|
|
|
3707
3694
|
}
|
|
3708
3695
|
return a[b].apply(this, arguments);
|
|
3709
3696
|
};
|
|
3710
|
-
}),
|
|
3697
|
+
}), T;
|
|
3711
3698
|
} });
|
|
3712
3699
|
} };
|
|
3713
3700
|
function $r(e, t, n) {
|
|
@@ -3726,15 +3713,15 @@ function Pi() {
|
|
|
3726
3713
|
}
|
|
3727
3714
|
function Wr(e, t, O, r, a, u) {
|
|
3728
3715
|
if (!O || O.length === 0) return e;
|
|
3729
|
-
var f = t.query.index, p = f.multiEntry, v = t.query.range, w = r.schema.primaryKey.extractKey,
|
|
3716
|
+
var f = t.query.index, p = f.multiEntry, v = t.query.range, w = r.schema.primaryKey.extractKey, T = f.extractKey, g = (f.lowLevelIndex || f).extractKey, O = O.reduce(function(b, x) {
|
|
3730
3717
|
var A = b, N = [];
|
|
3731
|
-
if (
|
|
3732
|
-
var k, P =
|
|
3733
|
-
C.hasKey(j) || (k =
|
|
3718
|
+
if (x.type === "add" || x.type === "put") for (var C = new Se(), R = x.values.length - 1; 0 <= R; --R) {
|
|
3719
|
+
var k, P = x.values[R], j = w(P);
|
|
3720
|
+
C.hasKey(j) || (k = T(P), (p && _(k) ? k.some(function(U) {
|
|
3734
3721
|
return ar(U, v);
|
|
3735
3722
|
}) : ar(k, v)) && (C.addKey(j), N.push(P)));
|
|
3736
3723
|
}
|
|
3737
|
-
switch (
|
|
3724
|
+
switch (x.type) {
|
|
3738
3725
|
case "add":
|
|
3739
3726
|
var L = new Se().addKeys(t.values ? b.map(function(W) {
|
|
3740
3727
|
return w(W);
|
|
@@ -3747,7 +3734,7 @@ function Pi() {
|
|
|
3747
3734
|
}));
|
|
3748
3735
|
break;
|
|
3749
3736
|
case "put":
|
|
3750
|
-
var K = new Se().addKeys(
|
|
3737
|
+
var K = new Se().addKeys(x.values.map(function(W) {
|
|
3751
3738
|
return w(W);
|
|
3752
3739
|
}));
|
|
3753
3740
|
A = b.filter(function(W) {
|
|
@@ -3757,27 +3744,27 @@ function Pi() {
|
|
|
3757
3744
|
}));
|
|
3758
3745
|
break;
|
|
3759
3746
|
case "delete":
|
|
3760
|
-
var q = new Se().addKeys(
|
|
3747
|
+
var q = new Se().addKeys(x.keys);
|
|
3761
3748
|
A = b.filter(function(W) {
|
|
3762
3749
|
return !q.hasKey(t.values ? w(W) : W);
|
|
3763
3750
|
});
|
|
3764
3751
|
break;
|
|
3765
3752
|
case "deleteRange":
|
|
3766
|
-
var V =
|
|
3753
|
+
var V = x.range;
|
|
3767
3754
|
A = b.filter(function(W) {
|
|
3768
3755
|
return !ar(w(W), V);
|
|
3769
3756
|
});
|
|
3770
3757
|
}
|
|
3771
3758
|
return A;
|
|
3772
3759
|
}, e);
|
|
3773
|
-
return O === e ? e : (O.sort(function(b,
|
|
3774
|
-
return re(g(b), g(
|
|
3760
|
+
return O === e ? e : (O.sort(function(b, x) {
|
|
3761
|
+
return re(g(b), g(x)) || re(w(b), w(x));
|
|
3775
3762
|
}), t.limit && t.limit < 1 / 0 && (O.length > t.limit ? O.length = t.limit : e.length === t.limit && O.length < t.limit && (a.dirty = !0)), u ? Object.freeze(O) : O);
|
|
3776
3763
|
}
|
|
3777
3764
|
function Yr(e, t) {
|
|
3778
3765
|
return re(e.lower, t.lower) === 0 && re(e.upper, t.upper) === 0 && !!e.lowerOpen == !!t.lowerOpen && !!e.upperOpen == !!t.upperOpen;
|
|
3779
3766
|
}
|
|
3780
|
-
function
|
|
3767
|
+
function Ja(e, t) {
|
|
3781
3768
|
return (function(n, r, a, u) {
|
|
3782
3769
|
if (n === void 0) return r !== void 0 ? -1 : 0;
|
|
3783
3770
|
if (r === void 0) return 1;
|
|
@@ -3798,7 +3785,7 @@ function Pi() {
|
|
|
3798
3785
|
return r;
|
|
3799
3786
|
})(e.upper, t.upper, e.upperOpen, t.upperOpen);
|
|
3800
3787
|
}
|
|
3801
|
-
function
|
|
3788
|
+
function ei(e, t, n, r) {
|
|
3802
3789
|
e.subscribers.add(n), r.addEventListener("abort", function() {
|
|
3803
3790
|
var a, u;
|
|
3804
3791
|
e.subscribers.delete(n), e.subscribers.size === 0 && (a = e, u = t, setTimeout(function() {
|
|
@@ -3806,17 +3793,17 @@ function Pi() {
|
|
|
3806
3793
|
}, 3e3));
|
|
3807
3794
|
});
|
|
3808
3795
|
}
|
|
3809
|
-
var
|
|
3796
|
+
var ti = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
3810
3797
|
var t = e.schema.name;
|
|
3811
3798
|
return i(i({}, e), { transaction: function(n, r, a) {
|
|
3812
3799
|
var u, f, p = e.transaction(n, r, a);
|
|
3813
3800
|
return r === "readwrite" && (f = (u = new AbortController()).signal, a = function(v) {
|
|
3814
3801
|
return function() {
|
|
3815
3802
|
if (u.abort(), r === "readwrite") {
|
|
3816
|
-
for (var w = /* @__PURE__ */ new Set(),
|
|
3817
|
-
var O = g[
|
|
3803
|
+
for (var w = /* @__PURE__ */ new Set(), T = 0, g = n; T < g.length; T++) {
|
|
3804
|
+
var O = g[T], b = gt["idb://".concat(t, "/").concat(O)];
|
|
3818
3805
|
if (b) {
|
|
3819
|
-
var
|
|
3806
|
+
var x = e.table(O), A = b.optimisticOps.filter(function(W) {
|
|
3820
3807
|
return W.trans === p;
|
|
3821
3808
|
});
|
|
3822
3809
|
if (p._explicit && v && p.mutatedParts) for (var N = 0, C = Object.values(b.queries.query); N < C.length; N++) for (var R = 0, k = (L = C[N]).slice(); R < k.length; R++) Hn((K = k[R]).obsSet, p.mutatedParts) && (je(L, K), K.subscribers.forEach(function(W) {
|
|
@@ -3826,7 +3813,7 @@ function Pi() {
|
|
|
3826
3813
|
b.optimisticOps = b.optimisticOps.filter(function(W) {
|
|
3827
3814
|
return W.trans !== p;
|
|
3828
3815
|
});
|
|
3829
|
-
for (var P = 0, j = Object.values(b.queries.query); P < j.length; P++) for (var L, K, q, V = 0, U = (L = j[P]).slice(); V < U.length; V++) (K = U[V]).res != null && p.mutatedParts && (v && !K.dirty ? (q = Object.isFrozen(K.res), q = Wr(K.res, K.req, A,
|
|
3816
|
+
for (var P = 0, j = Object.values(b.queries.query); P < j.length; P++) for (var L, K, q, V = 0, U = (L = j[P]).slice(); V < U.length; V++) (K = U[V]).res != null && p.mutatedParts && (v && !K.dirty ? (q = Object.isFrozen(K.res), q = Wr(K.res, K.req, A, x, K, q), K.dirty ? (je(L, K), K.subscribers.forEach(function(W) {
|
|
3830
3817
|
return w.add(W);
|
|
3831
3818
|
})) : q !== K.res && (K.res = q, K.promise = X.resolve({ result: q }))) : (K.dirty && je(L, K), K.subscribers.forEach(function(W) {
|
|
3832
3819
|
return w.add(W);
|
|
@@ -3853,9 +3840,9 @@ function Pi() {
|
|
|
3853
3840
|
}), f.catch(function() {
|
|
3854
3841
|
je(p.optimisticOps, u), u.mutatedParts && vn(u.mutatedParts);
|
|
3855
3842
|
})) : f.then(function(v) {
|
|
3856
|
-
var w = $r(0, i(i({}, u), { values: u.values.map(function(
|
|
3843
|
+
var w = $r(0, i(i({}, u), { values: u.values.map(function(T, g) {
|
|
3857
3844
|
var O;
|
|
3858
|
-
return v.failures[g] ?
|
|
3845
|
+
return v.failures[g] ? T : (T = (O = a.keyPath) !== null && O !== void 0 && O.includes(".") ? Ye(T) : i({}, T), le(T, a.keyPath, v.results[g]), T);
|
|
3859
3846
|
}) }), v);
|
|
3860
3847
|
p.optimisticOps.push(w), queueMicrotask(function() {
|
|
3861
3848
|
return u.mutatedParts && vn(u.mutatedParts);
|
|
@@ -3863,8 +3850,8 @@ function Pi() {
|
|
|
3863
3850
|
}), f) : r.mutate(u);
|
|
3864
3851
|
}, query: function(u) {
|
|
3865
3852
|
if (!Gr(Y, r) || !Xr("query", u)) return r.query(u);
|
|
3866
|
-
var f = ((w = Y.trans) === null || w === void 0 ? void 0 : w.db._options.cache) === "immutable", g = Y, p = g.requery, v = g.signal, w = (function(
|
|
3867
|
-
var R = gt["idb://".concat(
|
|
3853
|
+
var f = ((w = Y.trans) === null || w === void 0 ? void 0 : w.db._options.cache) === "immutable", g = Y, p = g.requery, v = g.signal, w = (function(x, A, N, C) {
|
|
3854
|
+
var R = gt["idb://".concat(x, "/").concat(A)];
|
|
3868
3855
|
if (!R) return [];
|
|
3869
3856
|
if (!(A = R.queries[N])) return [null, !1, R, null];
|
|
3870
3857
|
var k = A[(C.query ? C.query.index.name : null) || ""];
|
|
@@ -3875,25 +3862,25 @@ function Pi() {
|
|
|
3875
3862
|
return j.req.limit === C.limit && j.req.values === C.values && Yr(j.req.query.range, C.query.range);
|
|
3876
3863
|
});
|
|
3877
3864
|
return P ? [P, !0, R, k] : [k.find(function(j) {
|
|
3878
|
-
return ("limit" in j.req ? j.req.limit : 1 / 0) >= C.limit && (!C.values || j.req.values) &&
|
|
3865
|
+
return ("limit" in j.req ? j.req.limit : 1 / 0) >= C.limit && (!C.values || j.req.values) && Ja(j.req.query.range, C.query.range);
|
|
3879
3866
|
}), !1, R, k];
|
|
3880
3867
|
case "count":
|
|
3881
3868
|
return P = k.find(function(j) {
|
|
3882
3869
|
return Yr(j.req.query.range, C.query.range);
|
|
3883
3870
|
}), [P, !!P, R, k];
|
|
3884
3871
|
}
|
|
3885
|
-
})(t, n, "query", u),
|
|
3886
|
-
return
|
|
3887
|
-
var A =
|
|
3888
|
-
if (
|
|
3872
|
+
})(t, n, "query", u), T = w[0], g = w[1], O = w[2], b = w[3];
|
|
3873
|
+
return T && g ? T.obsSet = u.obsSet : (g = r.query(u).then(function(x) {
|
|
3874
|
+
var A = x.result;
|
|
3875
|
+
if (T && (T.res = A), f) {
|
|
3889
3876
|
for (var N = 0, C = A.length; N < C; ++N) Object.freeze(A[N]);
|
|
3890
3877
|
Object.freeze(A);
|
|
3891
|
-
} else
|
|
3892
|
-
return
|
|
3893
|
-
}).catch(function(
|
|
3894
|
-
return b &&
|
|
3895
|
-
}),
|
|
3896
|
-
return { result: Wr(
|
|
3878
|
+
} else x.result = Ye(A);
|
|
3879
|
+
return x;
|
|
3880
|
+
}).catch(function(x) {
|
|
3881
|
+
return b && T && je(b, T), Promise.reject(x);
|
|
3882
|
+
}), T = { obsSet: u.obsSet, promise: g, subscribers: /* @__PURE__ */ new Set(), type: "query", req: u, dirty: !1 }, b ? b.push(T) : (b = [T], (O = O || (gt["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[u.query.index.name || ""] = b)), ei(T, b, p, v), T.promise.then(function(x) {
|
|
3883
|
+
return { result: Wr(x.result, u, O?.optimisticOps, r, T, f) };
|
|
3897
3884
|
});
|
|
3898
3885
|
} });
|
|
3899
3886
|
} });
|
|
@@ -3903,15 +3890,15 @@ function Pi() {
|
|
|
3903
3890
|
return r === "db" ? t : Reflect.get(n, r, a);
|
|
3904
3891
|
} });
|
|
3905
3892
|
}
|
|
3906
|
-
var He = (
|
|
3893
|
+
var He = (Ee.prototype.version = function(e) {
|
|
3907
3894
|
if (isNaN(e) || e < 0.1) throw new z.Type("Given version is not a positive number");
|
|
3908
3895
|
if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new z.Schema("Cannot add version when database is open");
|
|
3909
3896
|
this.verno = Math.max(this.verno, e);
|
|
3910
3897
|
var t = this._versions, n = t.filter(function(r) {
|
|
3911
3898
|
return r._cfg.version === e;
|
|
3912
3899
|
})[0];
|
|
3913
|
-
return n || (n = new this.Version(e), t.push(n), t.sort(
|
|
3914
|
-
},
|
|
3900
|
+
return n || (n = new this.Version(e), t.push(n), t.sort(Ga), n.stores({}), this._state.autoSchema = !1, n);
|
|
3901
|
+
}, Ee.prototype._whenReady = function(e) {
|
|
3915
3902
|
var t = this;
|
|
3916
3903
|
return this.idbdb && (this._state.openComplete || Y.letThrough || this._vip) ? e() : new X(function(n, r) {
|
|
3917
3904
|
if (t._state.openComplete) return r(new z.DatabaseClosed(t._state.dbOpenError));
|
|
@@ -3921,22 +3908,22 @@ function Pi() {
|
|
|
3921
3908
|
}
|
|
3922
3909
|
t._state.dbReadyPromise.then(n, r);
|
|
3923
3910
|
}).then(e);
|
|
3924
|
-
},
|
|
3911
|
+
}, Ee.prototype.use = function(e) {
|
|
3925
3912
|
var t = e.stack, n = e.create, r = e.level, a = e.name;
|
|
3926
3913
|
return a && this.unuse({ stack: t, name: a }), e = this._middlewares[t] || (this._middlewares[t] = []), e.push({ stack: t, create: n, level: r ?? 10, name: a }), e.sort(function(u, f) {
|
|
3927
3914
|
return u.level - f.level;
|
|
3928
3915
|
}), this;
|
|
3929
|
-
},
|
|
3916
|
+
}, Ee.prototype.unuse = function(e) {
|
|
3930
3917
|
var t = e.stack, n = e.name, r = e.create;
|
|
3931
3918
|
return t && this._middlewares[t] && (this._middlewares[t] = this._middlewares[t].filter(function(a) {
|
|
3932
3919
|
return r ? a.create !== r : !!n && a.name !== n;
|
|
3933
3920
|
})), this;
|
|
3934
|
-
},
|
|
3921
|
+
}, Ee.prototype.open = function() {
|
|
3935
3922
|
var e = this;
|
|
3936
3923
|
return ht(rt, function() {
|
|
3937
|
-
return
|
|
3924
|
+
return Ya(e);
|
|
3938
3925
|
});
|
|
3939
|
-
},
|
|
3926
|
+
}, Ee.prototype._close = function() {
|
|
3940
3927
|
this.on.close.fire(new CustomEvent("close"));
|
|
3941
3928
|
var e = this._state, t = At.indexOf(this);
|
|
3942
3929
|
if (0 <= t && At.splice(t, 1), this.idbdb) {
|
|
@@ -3951,10 +3938,10 @@ function Pi() {
|
|
|
3951
3938
|
}), e.openCanceller = new X(function(n, r) {
|
|
3952
3939
|
e.cancelOpen = r;
|
|
3953
3940
|
}));
|
|
3954
|
-
},
|
|
3941
|
+
}, Ee.prototype.close = function(n) {
|
|
3955
3942
|
var t = (n === void 0 ? { disableAutoOpen: !0 } : n).disableAutoOpen, n = this._state;
|
|
3956
3943
|
t ? (n.isBeingOpened && n.cancelOpen(new z.DatabaseClosed()), this._close(), n.autoOpen = !1, n.dbOpenError = new z.DatabaseClosed()) : (this._close(), n.autoOpen = this._options.autoOpen || n.isBeingOpened, n.openComplete = !1, n.dbOpenError = null);
|
|
3957
|
-
},
|
|
3944
|
+
}, Ee.prototype.delete = function(e) {
|
|
3958
3945
|
var t = this;
|
|
3959
3946
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
3960
3947
|
var n = 0 < arguments.length && typeof arguments[0] != "object", r = this._state;
|
|
@@ -3963,30 +3950,30 @@ function Pi() {
|
|
|
3963
3950
|
t.close(e);
|
|
3964
3951
|
var p = t._deps.indexedDB.deleteDatabase(t.name);
|
|
3965
3952
|
p.onsuccess = pe(function() {
|
|
3966
|
-
var v, w,
|
|
3967
|
-
v = t._deps, w = t.name,
|
|
3953
|
+
var v, w, T;
|
|
3954
|
+
v = t._deps, w = t.name, T = v.indexedDB, v = v.IDBKeyRange, Yn(T) || w === an || Wn(T, v).delete(w).catch(c), a();
|
|
3968
3955
|
}), p.onerror = $e(u), p.onblocked = t._fireOnBlocked;
|
|
3969
3956
|
}
|
|
3970
3957
|
if (n) throw new z.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
3971
3958
|
r.isBeingOpened ? r.dbReadyPromise.then(f) : f();
|
|
3972
3959
|
});
|
|
3973
|
-
},
|
|
3960
|
+
}, Ee.prototype.backendDB = function() {
|
|
3974
3961
|
return this.idbdb;
|
|
3975
|
-
},
|
|
3962
|
+
}, Ee.prototype.isOpen = function() {
|
|
3976
3963
|
return this.idbdb !== null;
|
|
3977
|
-
},
|
|
3964
|
+
}, Ee.prototype.hasBeenClosed = function() {
|
|
3978
3965
|
var e = this._state.dbOpenError;
|
|
3979
3966
|
return e && e.name === "DatabaseClosed";
|
|
3980
|
-
},
|
|
3967
|
+
}, Ee.prototype.hasFailed = function() {
|
|
3981
3968
|
return this._state.dbOpenError !== null;
|
|
3982
|
-
},
|
|
3969
|
+
}, Ee.prototype.dynamicallyOpened = function() {
|
|
3983
3970
|
return this._state.autoSchema;
|
|
3984
|
-
}, Object.defineProperty(
|
|
3971
|
+
}, Object.defineProperty(Ee.prototype, "tables", { get: function() {
|
|
3985
3972
|
var e = this;
|
|
3986
3973
|
return y(this._allTables).map(function(t) {
|
|
3987
3974
|
return e._allTables[t];
|
|
3988
3975
|
});
|
|
3989
|
-
}, enumerable: !1, configurable: !0 }),
|
|
3976
|
+
}, enumerable: !1, configurable: !0 }), Ee.prototype.transaction = function() {
|
|
3990
3977
|
var e = (function(t, n, r) {
|
|
3991
3978
|
var a = arguments.length;
|
|
3992
3979
|
if (a < 2) throw new z.InvalidArgument("Too few arguments");
|
|
@@ -3994,7 +3981,7 @@ function Pi() {
|
|
|
3994
3981
|
return r = u.pop(), [t, I(u), r];
|
|
3995
3982
|
}).apply(this, arguments);
|
|
3996
3983
|
return this._transaction.apply(this, e);
|
|
3997
|
-
},
|
|
3984
|
+
}, Ee.prototype._transaction = function(e, t, n) {
|
|
3998
3985
|
var r = this, a = Y.trans;
|
|
3999
3986
|
a && a.db === this && e.indexOf("!") === -1 || (a = null);
|
|
4000
3987
|
var u, f, p = e.indexOf("?") !== -1;
|
|
@@ -4021,27 +4008,27 @@ function Pi() {
|
|
|
4021
4008
|
}), p && a && !a.active && (a = null);
|
|
4022
4009
|
}
|
|
4023
4010
|
} catch (w) {
|
|
4024
|
-
return a ? a._promise(null, function(
|
|
4011
|
+
return a ? a._promise(null, function(T, g) {
|
|
4025
4012
|
g(w);
|
|
4026
|
-
}) :
|
|
4013
|
+
}) : _e(w);
|
|
4027
4014
|
}
|
|
4028
|
-
var v = (function w(
|
|
4015
|
+
var v = (function w(T, g, O, b, x) {
|
|
4029
4016
|
return X.resolve().then(function() {
|
|
4030
|
-
var A = Y.transless || Y, N =
|
|
4017
|
+
var A = Y.transless || Y, N = T._createTransaction(g, O, T._dbSchema, b);
|
|
4031
4018
|
if (N.explicit = !0, A = { trans: N, transless: A }, b) N.idbtrans = b.idbtrans;
|
|
4032
4019
|
else try {
|
|
4033
|
-
N.create(), N.idbtrans._explicit = !0,
|
|
4020
|
+
N.create(), N.idbtrans._explicit = !0, T._state.PR1398_maxLoop = 3;
|
|
4034
4021
|
} catch (k) {
|
|
4035
|
-
return k.name === lt.InvalidState &&
|
|
4036
|
-
return w(
|
|
4037
|
-
})) :
|
|
4022
|
+
return k.name === lt.InvalidState && T.isOpen() && 0 < --T._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), T.close({ disableAutoOpen: !1 }), T.open().then(function() {
|
|
4023
|
+
return w(T, g, O, null, x);
|
|
4024
|
+
})) : _e(k);
|
|
4038
4025
|
}
|
|
4039
|
-
var C, R = bt(
|
|
4026
|
+
var C, R = bt(x);
|
|
4040
4027
|
return R && Nt(), A = X.follow(function() {
|
|
4041
4028
|
var k;
|
|
4042
|
-
(C =
|
|
4029
|
+
(C = x.call(N, N)) && (R ? (k = it.bind(null, null), C.then(k, k)) : typeof C.next == "function" && typeof C.throw == "function" && (C = tr(C)));
|
|
4043
4030
|
}, A), (C && typeof C.then == "function" ? X.resolve(C).then(function(k) {
|
|
4044
|
-
return N.active ? k :
|
|
4031
|
+
return N.active ? k : _e(new z.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
4045
4032
|
}) : A.then(function() {
|
|
4046
4033
|
return C;
|
|
4047
4034
|
})).then(function(k) {
|
|
@@ -4049,22 +4036,22 @@ function Pi() {
|
|
|
4049
4036
|
return k;
|
|
4050
4037
|
});
|
|
4051
4038
|
}).catch(function(k) {
|
|
4052
|
-
return N._reject(k),
|
|
4039
|
+
return N._reject(k), _e(k);
|
|
4053
4040
|
});
|
|
4054
4041
|
});
|
|
4055
4042
|
}).bind(null, this, u, f, a, n);
|
|
4056
4043
|
return a ? a._promise(u, v, "lock") : Y.trans ? ht(Y.transless, function() {
|
|
4057
4044
|
return r._whenReady(v);
|
|
4058
4045
|
}) : this._whenReady(v);
|
|
4059
|
-
},
|
|
4046
|
+
}, Ee.prototype.table = function(e) {
|
|
4060
4047
|
if (!G(this._allTables, e)) throw new z.InvalidTable("Table ".concat(e, " does not exist"));
|
|
4061
4048
|
return this._allTables[e];
|
|
4062
|
-
},
|
|
4063
|
-
function
|
|
4049
|
+
}, Ee);
|
|
4050
|
+
function Ee(e, t) {
|
|
4064
4051
|
var n = this;
|
|
4065
4052
|
this._middlewares = {}, this.verno = 0;
|
|
4066
|
-
var r =
|
|
4067
|
-
this._options = t = i({ addons:
|
|
4053
|
+
var r = Ee.dependencies;
|
|
4054
|
+
this._options = t = i({ addons: Ee.addons, autoOpen: !0, indexedDB: r.indexedDB, IDBKeyRange: r.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, r = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
4068
4055
|
var a, u, f, p, v, w = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: c, dbReadyPromise: null, cancelOpen: c, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
4069
4056
|
w.dbReadyPromise = new X(function(g) {
|
|
4070
4057
|
w.dbReadyResolve = g;
|
|
@@ -4072,85 +4059,85 @@ function Pi() {
|
|
|
4072
4059
|
w.cancelOpen = O;
|
|
4073
4060
|
}), this._state = w, this.name = e, this.on = Bt(this, "populate", "blocked", "versionchange", "close", { ready: [Oe, c] }), this.once = function(g, O) {
|
|
4074
4061
|
var b = function() {
|
|
4075
|
-
for (var
|
|
4076
|
-
n.on(g).unsubscribe(b), O.apply(n,
|
|
4062
|
+
for (var x = [], A = 0; A < arguments.length; A++) x[A] = arguments[A];
|
|
4063
|
+
n.on(g).unsubscribe(b), O.apply(n, x);
|
|
4077
4064
|
};
|
|
4078
4065
|
return n.on(g, b);
|
|
4079
4066
|
}, this.on.ready.subscribe = te(this.on.ready.subscribe, function(g) {
|
|
4080
4067
|
return function(O, b) {
|
|
4081
|
-
|
|
4082
|
-
var
|
|
4083
|
-
A.openComplete ? (A.dbOpenError || X.resolve().then(O), b && g(O)) : A.onReadyBeingFired ? (A.onReadyBeingFired.push(O), b && g(O)) : (g(O),
|
|
4084
|
-
|
|
4068
|
+
Ee.vip(function() {
|
|
4069
|
+
var x, A = n._state;
|
|
4070
|
+
A.openComplete ? (A.dbOpenError || X.resolve().then(O), b && g(O)) : A.onReadyBeingFired ? (A.onReadyBeingFired.push(O), b && g(O)) : (g(O), x = n, b || g(function N() {
|
|
4071
|
+
x.on.ready.unsubscribe(O), x.on.ready.unsubscribe(N);
|
|
4085
4072
|
}));
|
|
4086
4073
|
});
|
|
4087
4074
|
};
|
|
4088
|
-
}), this.Collection = (a = this, Mt(
|
|
4075
|
+
}), this.Collection = (a = this, Mt(Ma.prototype, function(C, N) {
|
|
4089
4076
|
this.db = a;
|
|
4090
|
-
var b =
|
|
4077
|
+
var b = Tr, x = null;
|
|
4091
4078
|
if (N) try {
|
|
4092
4079
|
b = N();
|
|
4093
4080
|
} catch (R) {
|
|
4094
|
-
|
|
4081
|
+
x = R;
|
|
4095
4082
|
}
|
|
4096
4083
|
var A = C._ctx, N = A.table, C = N.hook.reading.fire;
|
|
4097
|
-
this._ctx = { table: N, index: A.index, isPrimKey: !A.index || N.schema.primKey.keyPath && A.index === N.schema.primKey.name, range: b, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error:
|
|
4084
|
+
this._ctx = { table: N, index: A.index, isPrimKey: !A.index || N.schema.primKey.keyPath && A.index === N.schema.primKey.name, range: b, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: x, or: A.or, valueMapper: C !== o ? C : null };
|
|
4098
4085
|
})), this.Table = (u = this, Mt(Cr.prototype, function(g, O, b) {
|
|
4099
|
-
this.db = u, this._tx = b, this.name = g, this.schema = O, this.hook = u._allTables[g] ? u._allTables[g].hook : Bt(null, { creating: [se, c], reading: [S, o], updating: [
|
|
4100
|
-
})), this.Transaction = (f = this, Mt(
|
|
4086
|
+
this.db = u, this._tx = b, this.name = g, this.schema = O, this.hook = u._allTables[g] ? u._allTables[g].hook : Bt(null, { creating: [se, c], reading: [S, o], updating: [we, c], deleting: [ge, c] });
|
|
4087
|
+
})), this.Transaction = (f = this, Mt(qa.prototype, function(g, O, b, x, A) {
|
|
4101
4088
|
var N = this;
|
|
4102
4089
|
g !== "readonly" && O.forEach(function(C) {
|
|
4103
4090
|
C = (C = b[C]) === null || C === void 0 ? void 0 : C.yProps, C && (O = O.concat(C.map(function(R) {
|
|
4104
4091
|
return R.updatesTable;
|
|
4105
4092
|
})));
|
|
4106
|
-
}), this.db = f, this.mode = g, this.storeNames = O, this.schema = b, this.chromeTransactionDurability =
|
|
4093
|
+
}), this.db = f, this.mode = g, this.storeNames = O, this.schema = b, this.chromeTransactionDurability = x, this.idbtrans = null, this.on = Bt(this, "complete", "error", "abort"), this.parent = A || 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 X(function(C, R) {
|
|
4107
4094
|
N._resolve = C, N._reject = R;
|
|
4108
4095
|
}), this._completion.then(function() {
|
|
4109
4096
|
N.active = !1, N.on.complete.fire();
|
|
4110
4097
|
}, function(C) {
|
|
4111
4098
|
var R = N.active;
|
|
4112
|
-
return N.active = !1, N.on.error.fire(C), N.parent ? N.parent._reject(C) : R && N.idbtrans && N.idbtrans.abort(),
|
|
4099
|
+
return N.active = !1, N.on.error.fire(C), N.parent ? N.parent._reject(C) : R && N.idbtrans && N.idbtrans.abort(), _e(C);
|
|
4113
4100
|
});
|
|
4114
|
-
})), this.Version = (p = this, Mt(
|
|
4101
|
+
})), this.Version = (p = this, Mt(Wa.prototype, function(g) {
|
|
4115
4102
|
this.db = p, this._cfg = { version: g, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
4116
4103
|
})), this.WhereClause = (v = this, Mt(Pr.prototype, function(g, O, b) {
|
|
4117
|
-
if (this.db = v, this._ctx = { table: g, index: O === ":id" ? null : O, or: b }, this._cmp = this._ascending = re, this._descending = function(
|
|
4118
|
-
return re(A,
|
|
4119
|
-
}, this._max = function(
|
|
4120
|
-
return 0 < re(
|
|
4121
|
-
}, this._min = function(
|
|
4122
|
-
return re(
|
|
4104
|
+
if (this.db = v, this._ctx = { table: g, index: O === ":id" ? null : O, or: b }, this._cmp = this._ascending = re, this._descending = function(x, A) {
|
|
4105
|
+
return re(A, x);
|
|
4106
|
+
}, this._max = function(x, A) {
|
|
4107
|
+
return 0 < re(x, A) ? x : A;
|
|
4108
|
+
}, this._min = function(x, A) {
|
|
4109
|
+
return re(x, A) < 0 ? x : A;
|
|
4123
4110
|
}, this._IDBKeyRange = v._deps.IDBKeyRange, !this._IDBKeyRange) throw new z.MissingAPI();
|
|
4124
4111
|
})), this.on("versionchange", function(g) {
|
|
4125
4112
|
0 < g.newVersion ? console.warn("Another connection wants to upgrade database '".concat(n.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(n.name, "'. Closing db now to resume the delete request.")), n.close({ disableAutoOpen: !1 });
|
|
4126
4113
|
}), this.on("blocked", function(g) {
|
|
4127
4114
|
!g.newVersion || g.newVersion < g.oldVersion ? console.warn("Dexie.delete('".concat(n.name, "') was blocked")) : console.warn("Upgrade '".concat(n.name, "' blocked by other connection holding version ").concat(g.oldVersion / 10));
|
|
4128
|
-
}), this._maxKey = Lt(t.IDBKeyRange), this._createTransaction = function(g, O, b,
|
|
4129
|
-
return new n.Transaction(g, O, b, n._options.chromeTransactionDurability,
|
|
4115
|
+
}), this._maxKey = Lt(t.IDBKeyRange), this._createTransaction = function(g, O, b, x) {
|
|
4116
|
+
return new n.Transaction(g, O, b, n._options.chromeTransactionDurability, x);
|
|
4130
4117
|
}, this._fireOnBlocked = function(g) {
|
|
4131
4118
|
n.on("blocked").fire(g), At.filter(function(O) {
|
|
4132
4119
|
return O.name === n.name && O !== n && !O._state.vcFired;
|
|
4133
4120
|
}).map(function(O) {
|
|
4134
4121
|
return O.on("versionchange").fire(g);
|
|
4135
4122
|
});
|
|
4136
|
-
}, this.use(
|
|
4137
|
-
var
|
|
4123
|
+
}, this.use(Ha), this.use(ti), this.use(Za), this.use(za), this.use(Qa);
|
|
4124
|
+
var T = new Proxy(this, { get: function(g, O, b) {
|
|
4138
4125
|
if (O === "_vip") return !0;
|
|
4139
4126
|
if (O === "table") return function(A) {
|
|
4140
|
-
return wn(n.table(A),
|
|
4127
|
+
return wn(n.table(A), T);
|
|
4141
4128
|
};
|
|
4142
|
-
var
|
|
4143
|
-
return
|
|
4144
|
-
return wn(A,
|
|
4129
|
+
var x = Reflect.get(g, O, b);
|
|
4130
|
+
return x instanceof Cr ? wn(x, T) : O === "tables" ? x.map(function(A) {
|
|
4131
|
+
return wn(A, T);
|
|
4145
4132
|
}) : O === "_createTransaction" ? function() {
|
|
4146
|
-
return wn(
|
|
4147
|
-
} :
|
|
4133
|
+
return wn(x.apply(this, arguments), T);
|
|
4134
|
+
} : x;
|
|
4148
4135
|
} });
|
|
4149
|
-
this.vip =
|
|
4136
|
+
this.vip = T, r.forEach(function(g) {
|
|
4150
4137
|
return g(n);
|
|
4151
4138
|
});
|
|
4152
4139
|
}
|
|
4153
|
-
var _n, Le = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable",
|
|
4140
|
+
var _n, Le = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", ni = (ir.prototype.subscribe = function(e, t, n) {
|
|
4154
4141
|
return this._subscribe(e && typeof e != "function" ? e : { next: e, error: t, complete: n });
|
|
4155
4142
|
}, ir.prototype[Le] = function() {
|
|
4156
4143
|
return this;
|
|
@@ -4164,27 +4151,27 @@ function Pi() {
|
|
|
4164
4151
|
_n = { indexedDB: null, IDBKeyRange: null };
|
|
4165
4152
|
}
|
|
4166
4153
|
function zr(e) {
|
|
4167
|
-
var t, n = !1, r = new
|
|
4168
|
-
var u = bt(e), f, p = !1, v = {}, w = {},
|
|
4154
|
+
var t, n = !1, r = new ni(function(a) {
|
|
4155
|
+
var u = bt(e), f, p = !1, v = {}, w = {}, T = { get closed() {
|
|
4169
4156
|
return p;
|
|
4170
4157
|
}, unsubscribe: function() {
|
|
4171
4158
|
p || (p = !0, f && f.abort(), g && ut.storagemutated.unsubscribe(b));
|
|
4172
4159
|
} };
|
|
4173
|
-
a.start && a.start(
|
|
4160
|
+
a.start && a.start(T);
|
|
4174
4161
|
var g = !1, O = function() {
|
|
4175
|
-
return Fn(
|
|
4162
|
+
return Fn(x);
|
|
4176
4163
|
}, b = function(A) {
|
|
4177
4164
|
yn(v, A), Hn(w, v) && O();
|
|
4178
|
-
},
|
|
4165
|
+
}, x = function() {
|
|
4179
4166
|
var A, N, C;
|
|
4180
4167
|
!p && _n.indexedDB && (v = {}, A = {}, f && f.abort(), f = new AbortController(), C = (function(R) {
|
|
4181
|
-
var k =
|
|
4168
|
+
var k = xt();
|
|
4182
4169
|
try {
|
|
4183
4170
|
u && Nt();
|
|
4184
4171
|
var P = at(e, R);
|
|
4185
4172
|
return P = u ? P.finally(it) : P;
|
|
4186
4173
|
} finally {
|
|
4187
|
-
k &&
|
|
4174
|
+
k && Tt();
|
|
4188
4175
|
}
|
|
4189
4176
|
})(N = { subscr: A, signal: f.signal, requery: O, querier: e, trans: null }), Promise.resolve(C).then(function(R) {
|
|
4190
4177
|
n = !0, t = R, p || N.signal.aborted || (v = {}, (function(k) {
|
|
@@ -4199,7 +4186,7 @@ function Pi() {
|
|
|
4199
4186
|
});
|
|
4200
4187
|
}));
|
|
4201
4188
|
};
|
|
4202
|
-
return setTimeout(O, 0),
|
|
4189
|
+
return setTimeout(O, 0), T;
|
|
4203
4190
|
});
|
|
4204
4191
|
return r.hasValue = function() {
|
|
4205
4192
|
return n;
|
|
@@ -4234,7 +4221,7 @@ function Pi() {
|
|
|
4234
4221
|
});
|
|
4235
4222
|
}) : Wn(n, t).toCollection().primaryKeys()).then(e);
|
|
4236
4223
|
} catch {
|
|
4237
|
-
return
|
|
4224
|
+
return _e(new z.MissingAPI());
|
|
4238
4225
|
}
|
|
4239
4226
|
var t, n;
|
|
4240
4227
|
}, defineClass: function() {
|
|
@@ -4249,7 +4236,7 @@ function Pi() {
|
|
|
4249
4236
|
var t = tr(e.apply(this, arguments));
|
|
4250
4237
|
return t && typeof t.then == "function" ? t : X.resolve(t);
|
|
4251
4238
|
} catch (n) {
|
|
4252
|
-
return
|
|
4239
|
+
return _e(n);
|
|
4253
4240
|
}
|
|
4254
4241
|
};
|
|
4255
4242
|
}, spawn: function(e, t, n) {
|
|
@@ -4257,7 +4244,7 @@ function Pi() {
|
|
|
4257
4244
|
var r = tr(e.apply(n, t || []));
|
|
4258
4245
|
return r && typeof r.then == "function" ? r : X.resolve(r);
|
|
4259
4246
|
} catch (a) {
|
|
4260
|
-
return
|
|
4247
|
+
return _e(a);
|
|
4261
4248
|
}
|
|
4262
4249
|
}, currentTransaction: { get: function() {
|
|
4263
4250
|
return Y.trans || null;
|
|
@@ -4307,10 +4294,10 @@ function Pi() {
|
|
|
4307
4294
|
return new jt({ remove: e });
|
|
4308
4295
|
}, default: He, RangeSet: Se, mergeRanges: Gt, rangesOverlap: Kr }), { default: He }), He;
|
|
4309
4296
|
});
|
|
4310
|
-
})(
|
|
4297
|
+
})(Tn)), Tn.exports;
|
|
4311
4298
|
}
|
|
4312
4299
|
var Fi = Pi();
|
|
4313
|
-
const hr = /* @__PURE__ */
|
|
4300
|
+
const hr = /* @__PURE__ */ xa(Fi), na = /* @__PURE__ */ Symbol.for("Dexie"), Je = globalThis[na] || (globalThis[na] = hr);
|
|
4314
4301
|
if (hr.semVer !== Je.semVer)
|
|
4315
4302
|
throw new Error(`Two different versions of Dexie loaded in the same app: ${hr.semVer} and ${Je.semVer}`);
|
|
4316
4303
|
const {
|
|
@@ -4325,7 +4312,7 @@ const {
|
|
|
4325
4312
|
add: Po,
|
|
4326
4313
|
remove: Fo,
|
|
4327
4314
|
DexieYProvider: Bo
|
|
4328
|
-
} = Je,
|
|
4315
|
+
} = Je, ra = "_changeLog", aa = "_meta";
|
|
4329
4316
|
class Bi {
|
|
4330
4317
|
constructor(s, l) {
|
|
4331
4318
|
this.name = s;
|
|
@@ -4337,7 +4324,7 @@ class Bi {
|
|
|
4337
4324
|
if (d)
|
|
4338
4325
|
for (const [y, _] of Object.entries(d))
|
|
4339
4326
|
h[y] = _.schema;
|
|
4340
|
-
h[
|
|
4327
|
+
h[ra] = "++sequenceNumber, id", h[aa] = "key", this.databaseInstance.version(1).stores(h);
|
|
4341
4328
|
}
|
|
4342
4329
|
async get(s) {
|
|
4343
4330
|
return this.databaseInstance.table(this.tableName).get(s);
|
|
@@ -4346,10 +4333,10 @@ class Bi {
|
|
|
4346
4333
|
return this.databaseInstance.table(this.tableName).where({ tagName: s }).toArray();
|
|
4347
4334
|
}
|
|
4348
4335
|
get changeLogTable() {
|
|
4349
|
-
return this.databaseInstance.table(
|
|
4336
|
+
return this.databaseInstance.table(ra);
|
|
4350
4337
|
}
|
|
4351
4338
|
get metaTable() {
|
|
4352
|
-
return this.databaseInstance.table(
|
|
4339
|
+
return this.databaseInstance.table(aa);
|
|
4353
4340
|
}
|
|
4354
4341
|
async getHead() {
|
|
4355
4342
|
return (await this.metaTable.get("head"))?.value ?? 0;
|
|
@@ -4488,7 +4475,7 @@ function Mi(m) {
|
|
|
4488
4475
|
y[_] = D.schema;
|
|
4489
4476
|
return h.version(1).stores(y), h;
|
|
4490
4477
|
}
|
|
4491
|
-
async function
|
|
4478
|
+
async function Ta(m) {
|
|
4492
4479
|
const { databaseInstance: s, elementsTableName: l, records: i } = m, d = s.table(l);
|
|
4493
4480
|
await s.transaction("rw", d, () => d.bulkAdd(i));
|
|
4494
4481
|
}
|
|
@@ -4580,9 +4567,9 @@ const Gi = {}, Xi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
4580
4567
|
__proto__: null,
|
|
4581
4568
|
default: Gi
|
|
4582
4569
|
}, Symbol.toStringTag, { value: "Module" })), $i = /* @__PURE__ */ Si(Xi);
|
|
4583
|
-
var
|
|
4570
|
+
var ia;
|
|
4584
4571
|
function Wi() {
|
|
4585
|
-
return
|
|
4572
|
+
return ia || (ia = 1, (function(m) {
|
|
4586
4573
|
(function(s) {
|
|
4587
4574
|
s.parser = function(c, o) {
|
|
4588
4575
|
return new i(c, o);
|
|
@@ -4647,25 +4634,25 @@ function Wi() {
|
|
|
4647
4634
|
je(c);
|
|
4648
4635
|
break;
|
|
4649
4636
|
case "cdata":
|
|
4650
|
-
|
|
4637
|
+
ve(c, "oncdata", c.cdata), c.cdata = "";
|
|
4651
4638
|
break;
|
|
4652
4639
|
case "script":
|
|
4653
|
-
|
|
4640
|
+
ve(c, "onscript", c.script), c.script = "";
|
|
4654
4641
|
break;
|
|
4655
4642
|
default:
|
|
4656
4643
|
Ie(c, "Max buffer length exceeded: " + l[E]);
|
|
4657
4644
|
}
|
|
4658
4645
|
S = Math.max(S, ge);
|
|
4659
4646
|
}
|
|
4660
|
-
var
|
|
4661
|
-
c.bufferCheckPosition =
|
|
4647
|
+
var we = s.MAX_BUFFER_LENGTH - S;
|
|
4648
|
+
c.bufferCheckPosition = we + c.position;
|
|
4662
4649
|
}
|
|
4663
4650
|
function h(c) {
|
|
4664
4651
|
for (var o = 0, S = l.length; o < S; o++)
|
|
4665
4652
|
c[l[o]] = "";
|
|
4666
4653
|
}
|
|
4667
4654
|
function y(c) {
|
|
4668
|
-
je(c), c.cdata !== "" && (
|
|
4655
|
+
je(c), c.cdata !== "" && (ve(c, "oncdata", c.cdata), c.cdata = ""), c.script !== "" && (ve(c, "onscript", c.script), c.script = "");
|
|
4669
4656
|
}
|
|
4670
4657
|
i.prototype = {
|
|
4671
4658
|
end: function() {
|
|
@@ -4766,7 +4753,7 @@ function Wi() {
|
|
|
4766
4753
|
E.splice(0, 0, c), S.emit.apply(S, E);
|
|
4767
4754
|
}), _.prototype.on.call(S, c, o);
|
|
4768
4755
|
};
|
|
4769
|
-
var Q = "[CDATA[", fe = "DOCTYPE", M = "http://www.w3.org/XML/1998/namespace", B = "http://www.w3.org/2000/xmlns/", ue = { xml: M, xmlns: B }, ie = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,
|
|
4756
|
+
var Q = "[CDATA[", fe = "DOCTYPE", M = "http://www.w3.org/XML/1998/namespace", B = "http://www.w3.org/2000/xmlns/", ue = { xml: M, xmlns: B }, ie = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, Te = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/, te = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, H = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
|
|
4770
4757
|
function Z(c) {
|
|
4771
4758
|
return c === " " || c === `
|
|
4772
4759
|
` || c === "\r" || c === " ";
|
|
@@ -5147,7 +5134,7 @@ function Wi() {
|
|
|
5147
5134
|
);
|
|
5148
5135
|
}
|
|
5149
5136
|
}
|
|
5150
|
-
function
|
|
5137
|
+
function ve(c, o, S) {
|
|
5151
5138
|
c.textNode && je(c), Ue(c, o, S);
|
|
5152
5139
|
}
|
|
5153
5140
|
function je(c) {
|
|
@@ -5173,7 +5160,7 @@ Char: ` + c.c), o = new Error(o), c.error = o, Ue(c, "onerror", o), c;
|
|
|
5173
5160
|
function et(c) {
|
|
5174
5161
|
c.strict || (c.tagName = c.tagName[c.looseCase]());
|
|
5175
5162
|
var o = c.tags[c.tags.length - 1] || c, S = c.tag = { name: c.tagName, attributes: {} };
|
|
5176
|
-
c.opt.xmlns && (S.ns = o.ns), c.attribList.length = 0,
|
|
5163
|
+
c.opt.xmlns && (S.ns = o.ns), c.attribList.length = 0, ve(c, "onopentagstart", S);
|
|
5177
5164
|
}
|
|
5178
5165
|
function wt(c, o) {
|
|
5179
5166
|
var S = c.indexOf(":"), E = S < 0 ? ["", c] : c.split(":"), se = E[0], ge = E[1];
|
|
@@ -5205,7 +5192,7 @@ Actual: ` + c.attribValue
|
|
|
5205
5192
|
}
|
|
5206
5193
|
c.attribList.push([c.attribName, c.attribValue]);
|
|
5207
5194
|
} else
|
|
5208
|
-
c.tag.attributes[c.attribName] = c.attribValue,
|
|
5195
|
+
c.tag.attributes[c.attribName] = c.attribValue, ve(c, "onattribute", {
|
|
5209
5196
|
name: c.attribName,
|
|
5210
5197
|
value: c.attribValue
|
|
5211
5198
|
});
|
|
@@ -5220,12 +5207,12 @@ Actual: ` + c.attribValue
|
|
|
5220
5207
|
), S.uri = E.prefix);
|
|
5221
5208
|
var se = c.tags[c.tags.length - 1] || c;
|
|
5222
5209
|
S.ns && se.ns !== S.ns && Object.keys(S.ns).forEach(function(Xe) {
|
|
5223
|
-
|
|
5210
|
+
ve(c, "onopennamespace", {
|
|
5224
5211
|
prefix: Xe,
|
|
5225
5212
|
uri: S.ns[Xe]
|
|
5226
5213
|
});
|
|
5227
5214
|
});
|
|
5228
|
-
for (var ge = 0,
|
|
5215
|
+
for (var ge = 0, we = c.attribList.length; ge < we; ge++) {
|
|
5229
5216
|
var Re = c.attribList[ge], Oe = Re[0], Ne = Re[1], Ae = wt(Oe, !0), Fe = Ae.prefix, zt = Ae.local, nt = Fe === "" ? "" : S.ns[Fe] || "", Ve = {
|
|
5230
5217
|
name: Oe,
|
|
5231
5218
|
value: Ne,
|
|
@@ -5236,11 +5223,11 @@ Actual: ` + c.attribValue
|
|
|
5236
5223
|
Fe && Fe !== "xmlns" && !nt && (ce(
|
|
5237
5224
|
c,
|
|
5238
5225
|
"Unbound namespace prefix: " + JSON.stringify(Fe)
|
|
5239
|
-
), Ve.uri = Fe), c.tag.attributes[Oe] = Ve,
|
|
5226
|
+
), Ve.uri = Fe), c.tag.attributes[Oe] = Ve, ve(c, "onattribute", Ve);
|
|
5240
5227
|
}
|
|
5241
5228
|
c.attribList.length = 0;
|
|
5242
5229
|
}
|
|
5243
|
-
c.tag.isSelfClosing = !!o, c.sawRoot = !0, c.tags.push(c.tag),
|
|
5230
|
+
c.tag.isSelfClosing = !!o, c.sawRoot = !0, c.tags.push(c.tag), ve(c, "onopentag", c.tag), o || (!c.noscript && c.tagName.toLowerCase() === "script" ? c.state = I.SCRIPT : c.state = I.TEXT, c.tag = null, c.tagName = ""), c.attribName = c.attribValue = "", c.attribList.length = 0;
|
|
5244
5231
|
}
|
|
5245
5232
|
function lt(c) {
|
|
5246
5233
|
if (!c.tagName) {
|
|
@@ -5252,7 +5239,7 @@ Actual: ` + c.attribValue
|
|
|
5252
5239
|
c.script += "</" + c.tagName + ">", c.tagName = "", c.state = I.SCRIPT;
|
|
5253
5240
|
return;
|
|
5254
5241
|
}
|
|
5255
|
-
|
|
5242
|
+
ve(c, "onscript", c.script), c.script = "";
|
|
5256
5243
|
}
|
|
5257
5244
|
var o = c.tags.length, S = c.tagName;
|
|
5258
5245
|
c.strict || (S = S[c.looseCase]());
|
|
@@ -5269,15 +5256,15 @@ Actual: ` + c.attribValue
|
|
|
5269
5256
|
}
|
|
5270
5257
|
c.tagName = S;
|
|
5271
5258
|
for (var ge = c.tags.length; ge-- > o; ) {
|
|
5272
|
-
var
|
|
5273
|
-
c.tagName = c.tag.name,
|
|
5259
|
+
var we = c.tag = c.tags.pop();
|
|
5260
|
+
c.tagName = c.tag.name, ve(c, "onclosetag", c.tagName);
|
|
5274
5261
|
var Re = {};
|
|
5275
|
-
for (var Oe in
|
|
5276
|
-
Re[Oe] =
|
|
5262
|
+
for (var Oe in we.ns)
|
|
5263
|
+
Re[Oe] = we.ns[Oe];
|
|
5277
5264
|
var Ne = c.tags[c.tags.length - 1] || c;
|
|
5278
|
-
c.opt.xmlns &&
|
|
5279
|
-
var Fe =
|
|
5280
|
-
|
|
5265
|
+
c.opt.xmlns && we.ns !== Ne.ns && Object.keys(we.ns).forEach(function(Ae) {
|
|
5266
|
+
var Fe = we.ns[Ae];
|
|
5267
|
+
ve(c, "onclosenamespace", { prefix: Ae, uri: Fe });
|
|
5281
5268
|
});
|
|
5282
5269
|
}
|
|
5283
5270
|
o === 0 && (c.closedRoot = !0), c.tagName = c.attribValue = c.attribName = "", c.attribList.length = 0, c.state = I.TEXT;
|
|
@@ -5353,16 +5340,16 @@ Actual: ` + c.attribValue
|
|
|
5353
5340
|
o.state = I.COMMENT, o.comment = "", o.sgmlDecl = "";
|
|
5354
5341
|
continue;
|
|
5355
5342
|
}
|
|
5356
|
-
o.doctype && o.doctype !== !0 && o.sgmlDecl ? (o.state = I.DOCTYPE_DTD, o.doctype += "<!" + o.sgmlDecl + E, o.sgmlDecl = "") : (o.sgmlDecl + E).toUpperCase() === Q ? (
|
|
5343
|
+
o.doctype && o.doctype !== !0 && o.sgmlDecl ? (o.state = I.DOCTYPE_DTD, o.doctype += "<!" + o.sgmlDecl + E, o.sgmlDecl = "") : (o.sgmlDecl + E).toUpperCase() === Q ? (ve(o, "onopencdata"), o.state = I.CDATA, o.sgmlDecl = "", o.cdata = "") : (o.sgmlDecl + E).toUpperCase() === fe ? (o.state = I.DOCTYPE, (o.doctype || o.sawRoot) && ce(
|
|
5357
5344
|
o,
|
|
5358
5345
|
"Inappropriately located doctype declaration"
|
|
5359
|
-
), o.doctype = "", o.sgmlDecl = "") : E === ">" ? (
|
|
5346
|
+
), o.doctype = "", o.sgmlDecl = "") : E === ">" ? (ve(o, "onsgmldeclaration", o.sgmlDecl), o.sgmlDecl = "", o.state = I.TEXT) : (de(E) && (o.state = I.SGML_DECL_QUOTED), o.sgmlDecl += E);
|
|
5360
5347
|
continue;
|
|
5361
5348
|
case I.SGML_DECL_QUOTED:
|
|
5362
5349
|
E === o.q && (o.state = I.SGML_DECL, o.q = ""), o.sgmlDecl += E;
|
|
5363
5350
|
continue;
|
|
5364
5351
|
case I.DOCTYPE:
|
|
5365
|
-
E === ">" ? (o.state = I.TEXT,
|
|
5352
|
+
E === ">" ? (o.state = I.TEXT, ve(o, "ondoctype", o.doctype), o.doctype = !0) : (o.doctype += E, E === "[" ? o.state = I.DOCTYPE_DTD : de(E) && (o.state = I.DOCTYPE_QUOTED, o.q = E));
|
|
5366
5353
|
continue;
|
|
5367
5354
|
case I.DOCTYPE_QUOTED:
|
|
5368
5355
|
o.doctype += E, E === o.q && (o.q = "", o.state = I.DOCTYPE);
|
|
@@ -5377,7 +5364,7 @@ Actual: ` + c.attribValue
|
|
|
5377
5364
|
E === "-" ? o.state = I.COMMENT_ENDING : o.comment += E;
|
|
5378
5365
|
continue;
|
|
5379
5366
|
case I.COMMENT_ENDING:
|
|
5380
|
-
E === "-" ? (o.state = I.COMMENT_ENDED, o.comment = ze(o.opt, o.comment), o.comment &&
|
|
5367
|
+
E === "-" ? (o.state = I.COMMENT_ENDED, o.comment = ze(o.opt, o.comment), o.comment && ve(o, "oncomment", o.comment), o.comment = "") : (o.comment += "-" + E, o.state = I.COMMENT);
|
|
5381
5368
|
continue;
|
|
5382
5369
|
case I.COMMENT_ENDED:
|
|
5383
5370
|
E !== ">" ? (ce(o, "Malformed comment"), o.comment += "--" + E, o.state = I.COMMENT) : o.doctype && o.doctype !== !0 ? o.state = I.DOCTYPE_DTD : o.state = I.TEXT;
|
|
@@ -5392,7 +5379,7 @@ Actual: ` + c.attribValue
|
|
|
5392
5379
|
E === "]" ? o.state = I.CDATA_ENDING_2 : (o.cdata += "]" + E, o.state = I.CDATA);
|
|
5393
5380
|
continue;
|
|
5394
5381
|
case I.CDATA_ENDING_2:
|
|
5395
|
-
E === ">" ? (o.cdata &&
|
|
5382
|
+
E === ">" ? (o.cdata && ve(o, "oncdata", o.cdata), ve(o, "onclosecdata"), o.cdata = "", o.state = I.TEXT) : E === "]" ? o.cdata += "]" : (o.cdata += "]]" + E, o.state = I.CDATA);
|
|
5396
5383
|
continue;
|
|
5397
5384
|
case I.PROC_INST:
|
|
5398
5385
|
E === "?" ? o.state = I.PROC_INST_ENDING : Z(E) ? o.state = I.PROC_INST_BODY : o.procInstName += E;
|
|
@@ -5408,12 +5395,12 @@ Actual: ` + c.attribValue
|
|
|
5408
5395
|
name: o.procInstName,
|
|
5409
5396
|
body: o.procInstBody
|
|
5410
5397
|
};
|
|
5411
|
-
kt(o, Ne),
|
|
5398
|
+
kt(o, Ne), ve(o, "onprocessinginstruction", Ne), o.procInstName = o.procInstBody = "", o.state = I.TEXT;
|
|
5412
5399
|
} else
|
|
5413
5400
|
o.procInstBody += "?" + E, o.state = I.PROC_INST_BODY;
|
|
5414
5401
|
continue;
|
|
5415
5402
|
case I.OPEN_TAG:
|
|
5416
|
-
me(
|
|
5403
|
+
me(Te, E) ? o.tagName += E : (et(o), E === ">" ? Me(o) : E === "/" ? o.state = I.OPEN_TAG_SLASH : (Z(E) || ce(o, "Invalid character in tag name"), o.state = I.ATTRIB));
|
|
5417
5404
|
continue;
|
|
5418
5405
|
case I.OPEN_TAG_SLASH:
|
|
5419
5406
|
E === ">" ? (Me(o, !0), lt(o)) : (ce(
|
|
@@ -5427,7 +5414,7 @@ Actual: ` + c.attribValue
|
|
|
5427
5414
|
E === ">" ? Me(o) : E === "/" ? o.state = I.OPEN_TAG_SLASH : me(ie, E) ? (o.attribName = E, o.attribValue = "", o.state = I.ATTRIB_NAME) : ce(o, "Invalid attribute name");
|
|
5428
5415
|
continue;
|
|
5429
5416
|
case I.ATTRIB_NAME:
|
|
5430
|
-
E === "=" ? o.state = I.ATTRIB_VALUE : E === ">" ? (ce(o, "Attribute without value"), o.attribValue = o.attribName, tt(o), Me(o)) : Z(E) ? o.state = I.ATTRIB_NAME_SAW_WHITE : me(
|
|
5417
|
+
E === "=" ? o.state = I.ATTRIB_VALUE : E === ">" ? (ce(o, "Attribute without value"), o.attribValue = o.attribName, tt(o), Me(o)) : Z(E) ? o.state = I.ATTRIB_NAME_SAW_WHITE : me(Te, E) ? o.attribName += E : ce(o, "Invalid attribute name");
|
|
5431
5418
|
continue;
|
|
5432
5419
|
case I.ATTRIB_NAME_SAW_WHITE:
|
|
5433
5420
|
if (E === "=")
|
|
@@ -5435,7 +5422,7 @@ Actual: ` + c.attribValue
|
|
|
5435
5422
|
else {
|
|
5436
5423
|
if (Z(E))
|
|
5437
5424
|
continue;
|
|
5438
|
-
ce(o, "Attribute without value"), o.tag.attributes[o.attribName] = "", o.attribValue = "",
|
|
5425
|
+
ce(o, "Attribute without value"), o.tag.attributes[o.attribName] = "", o.attribValue = "", ve(o, "onattribute", {
|
|
5439
5426
|
name: o.attribName,
|
|
5440
5427
|
value: ""
|
|
5441
5428
|
}), o.attribName = "", E === ">" ? Me(o) : me(ie, E) ? (o.attribName = E, o.state = I.ATTRIB_NAME) : (ce(o, "Invalid attribute name"), o.state = I.ATTRIB);
|
|
@@ -5465,7 +5452,7 @@ Actual: ` + c.attribValue
|
|
|
5465
5452
|
continue;
|
|
5466
5453
|
case I.CLOSE_TAG:
|
|
5467
5454
|
if (o.tagName)
|
|
5468
|
-
E === ">" ? lt(o) : me(
|
|
5455
|
+
E === ">" ? lt(o) : me(Te, E) ? o.tagName += E : o.script ? (o.script += "</" + o.tagName + E, o.tagName = "", o.state = I.SCRIPT) : (Z(E) || ce(o, "Invalid tagname in closing tag"), o.state = I.CLOSE_TAG_SAW_WHITE);
|
|
5469
5456
|
else {
|
|
5470
5457
|
if (Z(E))
|
|
5471
5458
|
continue;
|
|
@@ -5480,16 +5467,16 @@ Actual: ` + c.attribValue
|
|
|
5480
5467
|
case I.TEXT_ENTITY:
|
|
5481
5468
|
case I.ATTRIB_VALUE_ENTITY_Q:
|
|
5482
5469
|
case I.ATTRIB_VALUE_ENTITY_U:
|
|
5483
|
-
var
|
|
5470
|
+
var we, Re;
|
|
5484
5471
|
switch (o.state) {
|
|
5485
5472
|
case I.TEXT_ENTITY:
|
|
5486
|
-
|
|
5473
|
+
we = I.TEXT, Re = "textNode";
|
|
5487
5474
|
break;
|
|
5488
5475
|
case I.ATTRIB_VALUE_ENTITY_Q:
|
|
5489
|
-
|
|
5476
|
+
we = I.ATTRIB_VALUE_QUOTED, Re = "attribValue";
|
|
5490
5477
|
break;
|
|
5491
5478
|
case I.ATTRIB_VALUE_ENTITY_U:
|
|
5492
|
-
|
|
5479
|
+
we = I.ATTRIB_VALUE_UNQUOTED, Re = "attribValue";
|
|
5493
5480
|
break;
|
|
5494
5481
|
}
|
|
5495
5482
|
if (E === ";") {
|
|
@@ -5500,8 +5487,8 @@ Actual: ` + c.attribValue
|
|
|
5500
5487
|
), (o.entityDepth += 1) > o.opt.maxEntityDepth && Ie(
|
|
5501
5488
|
o,
|
|
5502
5489
|
"Parsed entity depth exceeds max entity depth"
|
|
5503
|
-
), o.entity = "", o.state =
|
|
5504
|
-
} else me(o.entity.length ? H : te, E) ? o.entity += E : (ce(o, "Invalid character in entity name"), o[Re] += "&" + o.entity + E, o.entity = "", o.state =
|
|
5490
|
+
), o.entity = "", o.state = we, o.write(Oe), o.entityDepth -= 1) : (o[Re] += Oe, o.entity = "", o.state = we);
|
|
5491
|
+
} else me(o.entity.length ? H : te, E) ? o.entity += E : (ce(o, "Invalid character in entity name"), o[Re] += "&" + o.entity + E, o.entity = "", o.state = we);
|
|
5505
5492
|
continue;
|
|
5506
5493
|
default:
|
|
5507
5494
|
throw new Error(o, "Unknown state: " + o.state);
|
|
@@ -5510,7 +5497,7 @@ Actual: ` + c.attribValue
|
|
|
5510
5497
|
}
|
|
5511
5498
|
String.fromCodePoint || (function() {
|
|
5512
5499
|
var c = String.fromCharCode, o = Math.floor, S = function() {
|
|
5513
|
-
var E = 16384, se = [], ge,
|
|
5500
|
+
var E = 16384, se = [], ge, we, Re = -1, Oe = arguments.length;
|
|
5514
5501
|
if (!Oe)
|
|
5515
5502
|
return "";
|
|
5516
5503
|
for (var Ne = ""; ++Re < Oe; ) {
|
|
@@ -5520,7 +5507,7 @@ Actual: ` + c.attribValue
|
|
|
5520
5507
|
Ae > 1114111 || // not a valid Unicode code point
|
|
5521
5508
|
o(Ae) !== Ae)
|
|
5522
5509
|
throw RangeError("Invalid code point: " + Ae);
|
|
5523
|
-
Ae <= 65535 ? se.push(Ae) : (Ae -= 65536, ge = (Ae >> 10) + 55296,
|
|
5510
|
+
Ae <= 65535 ? se.push(Ae) : (Ae -= 65536, ge = (Ae >> 10) + 55296, we = Ae % 1024 + 56320, se.push(ge, we)), (Re + 1 === Oe || se.length > E) && (Ne += c.apply(null, se), se.length = 0);
|
|
5524
5511
|
}
|
|
5525
5512
|
return Ne;
|
|
5526
5513
|
};
|
|
@@ -5677,14 +5664,14 @@ function ao(m) {
|
|
|
5677
5664
|
return s ? { id: s.id, tagName: s.tagName } : null;
|
|
5678
5665
|
}
|
|
5679
5666
|
function io(m) {
|
|
5680
|
-
const { attributes: s, useCustomRecordsIds: l } = m, i = s[
|
|
5667
|
+
const { attributes: s, useCustomRecordsIds: l } = m, i = s[fa];
|
|
5681
5668
|
return l && i && i.value ? i.value : crypto.randomUUID();
|
|
5682
5669
|
}
|
|
5683
5670
|
function oo(m) {
|
|
5684
5671
|
const { attributes: s, useCustomRecordsIds: l } = m;
|
|
5685
|
-
return l ? Object.values(s).filter((i) => i.name !==
|
|
5672
|
+
return l ? Object.values(s).filter((i) => i.name !== fa) : Object.values(s);
|
|
5686
5673
|
}
|
|
5687
|
-
const
|
|
5674
|
+
const oa = {
|
|
5688
5675
|
useBrowserApi: !0,
|
|
5689
5676
|
chunkSize: 32 * 1024,
|
|
5690
5677
|
// 32KB
|
|
@@ -5693,8 +5680,8 @@ const na = {
|
|
|
5693
5680
|
async function Ko(m) {
|
|
5694
5681
|
const { files: s, dialecteConfig: l, useCustomRecordsIds: i = !1 } = m, d = [];
|
|
5695
5682
|
if (s.length === 0) throw new Error("No files provided for import.");
|
|
5696
|
-
const { importOptions: h =
|
|
5697
|
-
...
|
|
5683
|
+
const { importOptions: h = oa, supportedFileExtensions: y } = l.io, _ = {
|
|
5684
|
+
...oa,
|
|
5698
5685
|
...h
|
|
5699
5686
|
};
|
|
5700
5687
|
for (const D of s) {
|
|
@@ -5736,7 +5723,7 @@ async function co(m) {
|
|
|
5736
5723
|
}
|
|
5737
5724
|
}), l.io.hooks?.afterImport) {
|
|
5738
5725
|
const { creates: D, updates: F, deletes: $ } = await l.io.hooks.afterImport();
|
|
5739
|
-
D?.length && await
|
|
5726
|
+
D?.length && await Ta({ databaseInstance: y, elementsTableName: _, records: D }), F?.length && await ji({ databaseInstance: y, elementsTableName: _, updates: F }), $?.length && await Ki({ databaseInstance: y, elementsTableName: _, ids: $ });
|
|
5740
5727
|
}
|
|
5741
5728
|
return h;
|
|
5742
5729
|
} catch (_) {
|
|
@@ -5767,7 +5754,7 @@ async function pr(m) {
|
|
|
5767
5754
|
const fe = h.decode(y);
|
|
5768
5755
|
d.parser.write(fe);
|
|
5769
5756
|
}
|
|
5770
|
-
return d.parser.close(), await
|
|
5757
|
+
return d.parser.close(), await sa({
|
|
5771
5758
|
databaseInstance: s,
|
|
5772
5759
|
elementsTableName: l,
|
|
5773
5760
|
sax: d,
|
|
@@ -5781,7 +5768,7 @@ async function pr(m) {
|
|
|
5781
5768
|
const fe = Q.slice(0, D);
|
|
5782
5769
|
Q = Q.slice(D);
|
|
5783
5770
|
const M = h.decode(fe, { stream: !0 });
|
|
5784
|
-
d.parser.write(M), await
|
|
5771
|
+
d.parser.write(M), await sa({
|
|
5785
5772
|
databaseInstance: s,
|
|
5786
5773
|
elementsTableName: l,
|
|
5787
5774
|
sax: d,
|
|
@@ -5790,23 +5777,23 @@ async function pr(m) {
|
|
|
5790
5777
|
}
|
|
5791
5778
|
return await pr({ ...m, buffer: Q });
|
|
5792
5779
|
}
|
|
5793
|
-
async function
|
|
5780
|
+
async function sa(m) {
|
|
5794
5781
|
const { databaseInstance: s, elementsTableName: l, sax: i, batchSize: d } = m;
|
|
5795
5782
|
if (i.getSize() >= d) {
|
|
5796
5783
|
const y = i.drainBatch(), _ = Ui({
|
|
5797
5784
|
currentBatch: y
|
|
5798
5785
|
});
|
|
5799
|
-
await
|
|
5786
|
+
await Ta({
|
|
5800
5787
|
databaseInstance: s,
|
|
5801
5788
|
elementsTableName: l,
|
|
5802
5789
|
records: _
|
|
5803
5790
|
});
|
|
5804
5791
|
}
|
|
5805
5792
|
}
|
|
5806
|
-
const
|
|
5807
|
-
var $t = { exports: {} },
|
|
5793
|
+
const Na = "_temp-idb-id";
|
|
5794
|
+
var $t = { exports: {} }, xn = { exports: {} }, ua;
|
|
5808
5795
|
function fo() {
|
|
5809
|
-
return
|
|
5796
|
+
return ua || (ua = 1, (function(m, s) {
|
|
5810
5797
|
Object.defineProperty(s, "__esModule", { value: !0 }), s.ParsingError = void 0;
|
|
5811
5798
|
class l extends Error {
|
|
5812
5799
|
constructor(H, Z) {
|
|
@@ -5975,7 +5962,7 @@ function fo() {
|
|
|
5975
5962
|
function ie(te) {
|
|
5976
5963
|
return i.xml.indexOf(te) === 0;
|
|
5977
5964
|
}
|
|
5978
|
-
function
|
|
5965
|
+
function Te(te, H = {}) {
|
|
5979
5966
|
te = te.trim();
|
|
5980
5967
|
const Z = H.filter || (() => !0);
|
|
5981
5968
|
return i = {
|
|
@@ -5983,13 +5970,13 @@ function fo() {
|
|
|
5983
5970
|
options: Object.assign(Object.assign({}, H), { filter: Z, strictMode: H.strictMode === !0 })
|
|
5984
5971
|
}, y();
|
|
5985
5972
|
}
|
|
5986
|
-
m.exports =
|
|
5987
|
-
})(
|
|
5973
|
+
m.exports = Te, s.default = Te;
|
|
5974
|
+
})(xn, xn.exports)), xn.exports;
|
|
5988
5975
|
}
|
|
5989
|
-
var
|
|
5976
|
+
var ca = $t.exports, la;
|
|
5990
5977
|
function ho() {
|
|
5991
|
-
return
|
|
5992
|
-
var l =
|
|
5978
|
+
return la || (la = 1, (function(m, s) {
|
|
5979
|
+
var l = ca && ca.__importDefault || function(M) {
|
|
5993
5980
|
return M && M.__esModule ? M : { default: M };
|
|
5994
5981
|
};
|
|
5995
5982
|
Object.defineProperty(s, "__esModule", { value: !0 });
|
|
@@ -6041,17 +6028,17 @@ function ho() {
|
|
|
6041
6028
|
else {
|
|
6042
6029
|
const ie = M.children;
|
|
6043
6030
|
y(B, ">"), B.level++;
|
|
6044
|
-
let
|
|
6045
|
-
if (!
|
|
6031
|
+
let Te = M.attributes["xml:space"] === "preserve" || ue, te = !1;
|
|
6032
|
+
if (!Te && B.options.ignoredPaths && (te = F(B.path, B.options.ignoredPaths), Te = te), !Te && B.options.collapseContent) {
|
|
6046
6033
|
let H = !1, Z = !1, de = !1;
|
|
6047
6034
|
ie.forEach(function(le, me) {
|
|
6048
6035
|
le.type === "Text" ? (le.content.includes(`
|
|
6049
6036
|
`) ? (Z = !0, le.content = le.content.trim()) : (me === 0 || me === ie.length - 1) && !ue && le.content.trim().length === 0 && (le.content = ""), (le.content.trim().length > 0 || ie.length === 1) && (H = !0)) : le.type === "CDATA" ? H = !0 : de = !0;
|
|
6050
|
-
}), H && (!de || !Z) && (
|
|
6037
|
+
}), H && (!de || !Z) && (Te = !0);
|
|
6051
6038
|
}
|
|
6052
6039
|
ie.forEach(function(H) {
|
|
6053
|
-
_(H, B, ue ||
|
|
6054
|
-
}), B.level--, !ue && !
|
|
6040
|
+
_(H, B, ue || Te);
|
|
6041
|
+
}), B.level--, !ue && !Te && d(B), te && h(B), y(B, "</" + M.name + ">");
|
|
6055
6042
|
}
|
|
6056
6043
|
B.path.pop();
|
|
6057
6044
|
}
|
|
@@ -6074,8 +6061,8 @@ function ho() {
|
|
|
6074
6061
|
`, B.whiteSpaceAtEndOfSelfclosingTag = B.whiteSpaceAtEndOfSelfclosingTag === !0, B.throwOnFailure = B.throwOnFailure !== !1, B.attributeQuotes = "attributeQuotes" in B ? B.attributeQuotes : "double";
|
|
6075
6062
|
try {
|
|
6076
6063
|
const ue = (0, i.default)(M, { filter: B.filter, strictMode: B.strictMode }), ie = { content: "", level: 0, options: B, path: [] };
|
|
6077
|
-
return ue.declaration && Q(ue.declaration, ie), ue.children.forEach(function(
|
|
6078
|
-
_(
|
|
6064
|
+
return ue.declaration && Q(ue.declaration, ie), ue.children.forEach(function(Te) {
|
|
6065
|
+
_(Te, ie, !1);
|
|
6079
6066
|
}), B.lineSeparator ? ie.content.replace(/\r\n/g, `
|
|
6080
6067
|
`).replace(/\n/g, B.lineSeparator) : ie.content;
|
|
6081
6068
|
} catch (ue) {
|
|
@@ -6088,7 +6075,7 @@ function ho() {
|
|
|
6088
6075
|
})($t, $t.exports)), $t.exports;
|
|
6089
6076
|
}
|
|
6090
6077
|
var po = /* @__PURE__ */ ho();
|
|
6091
|
-
const mo = /* @__PURE__ */
|
|
6078
|
+
const mo = /* @__PURE__ */ xa(po);
|
|
6092
6079
|
function go(m) {
|
|
6093
6080
|
return mo(m);
|
|
6094
6081
|
}
|
|
@@ -6166,13 +6153,13 @@ async function bo(m) {
|
|
|
6166
6153
|
F.namespace.uri,
|
|
6167
6154
|
F.tagName
|
|
6168
6155
|
);
|
|
6169
|
-
return $.setAttribute("xmlns", F.namespace.uri), F.attributes &&
|
|
6156
|
+
return $.setAttribute("xmlns", F.namespace.uri), F.attributes && Oa({
|
|
6170
6157
|
dialecteConfig: l,
|
|
6171
6158
|
document: D,
|
|
6172
6159
|
element: $,
|
|
6173
6160
|
attributes: F.attributes,
|
|
6174
6161
|
isRoot: !0
|
|
6175
|
-
}),
|
|
6162
|
+
}), Da({ dialecteConfig: l, rootElement: $, namespace: F.namespace }), F.value && ($.textContent = F.value.trim()), i && $.setAttribute(Na, F.id), D.appendChild($), await Aa({
|
|
6176
6163
|
databaseInstance: s,
|
|
6177
6164
|
dialecteConfig: l,
|
|
6178
6165
|
elementsTableName: _,
|
|
@@ -6183,7 +6170,7 @@ async function bo(m) {
|
|
|
6183
6170
|
});
|
|
6184
6171
|
}
|
|
6185
6172
|
}
|
|
6186
|
-
async function
|
|
6173
|
+
async function Aa(m) {
|
|
6187
6174
|
const {
|
|
6188
6175
|
databaseInstance: s,
|
|
6189
6176
|
dialecteConfig: l,
|
|
@@ -6212,7 +6199,7 @@ async function Ea(m) {
|
|
|
6212
6199
|
defaultNamespace: l.namespaces.default,
|
|
6213
6200
|
withDatabaseIds: d
|
|
6214
6201
|
});
|
|
6215
|
-
_.appendChild(fe), await
|
|
6202
|
+
_.appendChild(fe), await Aa({
|
|
6216
6203
|
databaseInstance: s,
|
|
6217
6204
|
dialecteConfig: l,
|
|
6218
6205
|
elementsTableName: i,
|
|
@@ -6227,32 +6214,32 @@ async function Ea(m) {
|
|
|
6227
6214
|
function wo(m) {
|
|
6228
6215
|
const { dialecteConfig: s, document: l, record: i, defaultNamespace: d, withDatabaseIds: h } = m;
|
|
6229
6216
|
let y;
|
|
6230
|
-
return !(i.namespace.uri === d.uri) && i.namespace.prefix && i.namespace.prefix !== "xmlns" ? (
|
|
6217
|
+
return !(i.namespace.uri === d.uri) && i.namespace.prefix && i.namespace.prefix !== "xmlns" ? (Ca({
|
|
6231
6218
|
dialecteConfig: s,
|
|
6232
6219
|
document: l,
|
|
6233
6220
|
namespace: i.namespace
|
|
6234
6221
|
}), y = l.createElementNS(
|
|
6235
6222
|
i.namespace.uri,
|
|
6236
6223
|
`${i.namespace.prefix}:${i.tagName}`
|
|
6237
|
-
)) : y = l.createElementNS(i.namespace.uri, i.tagName), i.attributes &&
|
|
6224
|
+
)) : y = l.createElementNS(i.namespace.uri, i.tagName), i.attributes && Oa({
|
|
6238
6225
|
dialecteConfig: s,
|
|
6239
6226
|
document: l,
|
|
6240
6227
|
element: y,
|
|
6241
6228
|
attributes: i.attributes,
|
|
6242
6229
|
isRoot: !1
|
|
6243
|
-
}), i.value && (y.textContent = i.value.trim()), h && y.setAttribute(
|
|
6230
|
+
}), i.value && (y.textContent = i.value.trim()), h && y.setAttribute(Na, i.id), y;
|
|
6244
6231
|
}
|
|
6245
|
-
function
|
|
6232
|
+
function Oa(m) {
|
|
6246
6233
|
const { dialecteConfig: s, document: l, element: i, attributes: d, isRoot: h } = m;
|
|
6247
6234
|
for (const y of d)
|
|
6248
|
-
if (!
|
|
6249
|
-
if (
|
|
6235
|
+
if (!xo(y))
|
|
6236
|
+
if (Ia(y)) {
|
|
6250
6237
|
const _ = y.namespace?.prefix || "";
|
|
6251
6238
|
if (!_) {
|
|
6252
6239
|
i.setAttribute(y.name, String(y.value));
|
|
6253
6240
|
continue;
|
|
6254
6241
|
}
|
|
6255
|
-
h ||
|
|
6242
|
+
h || Ca({
|
|
6256
6243
|
dialecteConfig: s,
|
|
6257
6244
|
document: l,
|
|
6258
6245
|
namespace: y.namespace
|
|
@@ -6261,13 +6248,13 @@ function Ta(m) {
|
|
|
6261
6248
|
i.setAttributeNS(y.namespace.uri, F, String(y.value));
|
|
6262
6249
|
} else i.setAttribute(y.name, String(y.value));
|
|
6263
6250
|
}
|
|
6264
|
-
function
|
|
6251
|
+
function Ca(m) {
|
|
6265
6252
|
const { dialecteConfig: s, document: l, namespace: i } = m, d = l.documentElement;
|
|
6266
6253
|
if (!d || !i.prefix || i.prefix === "xmlns") return;
|
|
6267
6254
|
const h = "http://www.w3.org/2000/xmlns/";
|
|
6268
|
-
d.getAttributeNS(h, i.prefix) === null && (d.setAttributeNS(h, `xmlns:${i.prefix}`, i.uri),
|
|
6255
|
+
d.getAttributeNS(h, i.prefix) === null && (d.setAttributeNS(h, `xmlns:${i.prefix}`, i.uri), Da({ dialecteConfig: s, rootElement: d, namespace: i }));
|
|
6269
6256
|
}
|
|
6270
|
-
function
|
|
6257
|
+
function Da(m) {
|
|
6271
6258
|
const { dialecteConfig: s, rootElement: l, namespace: i } = m, d = Object.entries(
|
|
6272
6259
|
s.definition[s.rootElementName].attributes.details
|
|
6273
6260
|
).filter(([y, _]) => i.uri === s.namespaces.default.uri ? !_.namespace : _.namespace?.prefix === i.prefix && _.namespace?.uri === i.uri);
|
|
@@ -6308,18 +6295,18 @@ function Eo(m) {
|
|
|
6308
6295
|
);
|
|
6309
6296
|
}
|
|
6310
6297
|
}
|
|
6311
|
-
function
|
|
6298
|
+
function Ia(m) {
|
|
6312
6299
|
return m !== null && typeof m == "object" && "namespace" in m && !!m.namespace;
|
|
6313
6300
|
}
|
|
6314
|
-
function
|
|
6315
|
-
return !!(m.name === "xmlns" || m.name.startsWith("xmlns:") ||
|
|
6301
|
+
function xo(m) {
|
|
6302
|
+
return !!(m.name === "xmlns" || m.name.startsWith("xmlns:") || Ia(m) && m.namespace?.prefix === "xmlns");
|
|
6316
6303
|
}
|
|
6317
6304
|
function Lo(m) {
|
|
6318
|
-
const { config: s, storage: l, extensions: i, hooks: d } = m, h =
|
|
6319
|
-
return new
|
|
6305
|
+
const { config: s, storage: l, extensions: i, hooks: d } = m, h = da({ base: i?.base, custom: i?.custom }), y = Ra(l, s);
|
|
6306
|
+
return new Ea(y, s, h, d);
|
|
6320
6307
|
}
|
|
6321
6308
|
async function Uo(m) {
|
|
6322
|
-
const { config: s, storage: l, extensions: i, hooks: d } = m, h =
|
|
6309
|
+
const { config: s, storage: l, extensions: i, hooks: d } = m, h = da({ base: i?.base, custom: i?.custom }), y = Ra(l, s), _ = s.definition[s.rootElementName], D = Object.entries(_?.attributes.details ?? {}).filter(([, F]) => F.required).map(([F, $]) => ({
|
|
6323
6310
|
name: F,
|
|
6324
6311
|
value: $.fixed ?? $.default ?? "",
|
|
6325
6312
|
...$.namespace ? { namespace: $.namespace } : {}
|
|
@@ -6340,22 +6327,22 @@ async function Uo(m) {
|
|
|
6340
6327
|
deletes: [],
|
|
6341
6328
|
onProgress: () => {
|
|
6342
6329
|
}
|
|
6343
|
-
}), new
|
|
6330
|
+
}), new Ea(y, s, h, d);
|
|
6344
6331
|
}
|
|
6345
|
-
function
|
|
6332
|
+
function Ra(m, s) {
|
|
6346
6333
|
return m.type === "local" ? new Bi(m.databaseName, s) : m.store;
|
|
6347
6334
|
}
|
|
6348
6335
|
export {
|
|
6349
|
-
|
|
6336
|
+
ya as A,
|
|
6350
6337
|
so as B,
|
|
6351
6338
|
Xt as C,
|
|
6352
6339
|
Bi as D,
|
|
6353
6340
|
mr as E,
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6341
|
+
ba as Q,
|
|
6342
|
+
Na as T,
|
|
6343
|
+
Ea as a,
|
|
6357
6344
|
Ii as b,
|
|
6358
|
-
|
|
6345
|
+
Ta as c,
|
|
6359
6346
|
Ki as d,
|
|
6360
6347
|
qo as e,
|
|
6361
6348
|
Mo as f,
|
|
@@ -6363,20 +6350,20 @@ export {
|
|
|
6363
6350
|
Uo as h,
|
|
6364
6351
|
Ko as i,
|
|
6365
6352
|
jo as j,
|
|
6366
|
-
|
|
6353
|
+
ci as k,
|
|
6367
6354
|
Nn as l,
|
|
6368
|
-
|
|
6355
|
+
li as m,
|
|
6369
6356
|
go as n,
|
|
6370
6357
|
Lo as o,
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6358
|
+
Hr as p,
|
|
6359
|
+
Zr as q,
|
|
6360
|
+
Jr as r,
|
|
6361
|
+
ea as s,
|
|
6362
|
+
si as t,
|
|
6363
|
+
ui as u,
|
|
6377
6364
|
uo as v,
|
|
6378
|
-
|
|
6365
|
+
xe as w,
|
|
6379
6366
|
mo as x,
|
|
6380
|
-
|
|
6381
|
-
|
|
6367
|
+
ha as y,
|
|
6368
|
+
pa as z
|
|
6382
6369
|
};
|