@dialecte/core 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -86,24 +86,24 @@ function la(l) {
86
86
  children: c.children ?? []
87
87
  };
88
88
  if (!u.elements.includes(h)) return q;
89
- const z = u.definition[h].attributes.sequence, H = u.definition[h].attributes.details, M = z.flatMap((J) => {
90
- const ie = H[J].required, ye = H[J]?.namespace || void 0, Y = P.find((oe) => oe.name === J)?.value || (ie ? H[J]?.default || "" : void 0);
89
+ const z = u.definition[h].attributes.sequence, H = u.definition[h].attributes.details, M = z.flatMap((Z) => {
90
+ const re = H[Z].required, ye = H[Z]?.namespace || void 0, Y = P.find((ie) => ie.name === Z)?.value || (re ? H[Z]?.default || "" : void 0);
91
91
  return Y === void 0 ? [] : [
92
92
  {
93
- name: J,
93
+ name: Z,
94
94
  value: Y,
95
95
  namespace: ye
96
96
  }
97
97
  ];
98
98
  });
99
- let k = {
99
+ let F = {
100
100
  ...q,
101
101
  namespace: u.definition[h].namespace,
102
102
  attributes: M
103
103
  };
104
- return u.hooks?.afterStandardizedRecord && (k = u.hooks.afterStandardizedRecord({
105
- record: k
106
- })), k;
104
+ return u.hooks?.afterStandardizedRecord && (F = u.hooks.afterStandardizedRecord({
105
+ record: F
106
+ })), F;
107
107
  }
108
108
  function ro(l) {
109
109
  const { attributes: c, name: u } = l;
@@ -565,7 +565,7 @@ function po() {
565
565
  function go(l, c, u) {
566
566
  const o = yo(l, c);
567
567
  for (const h of o) {
568
- const m = ha(h), y = vo(h), b = _o(h, c), P = h.endsWith("_3") ? qe.ext : qe.default, q = mo(h), G = [...q.required, ...q.optional], z = Zr(h), M = {
568
+ const m = ha(h), y = vo(h), b = _o(h, c), P = h.endsWith("_3") ? qe.ext : qe.default, q = mo(h), V = [...q.required, ...q.optional], z = Zr(h), M = {
569
569
  ...Ct,
570
570
  minOccurrence: z === 1 ? 1 : null,
571
571
  maxOccurrence: z
@@ -583,15 +583,15 @@ function go(l, c, u) {
583
583
  namespace: P,
584
584
  attributes: {
585
585
  any: !1,
586
- sequence: G,
586
+ sequence: V,
587
587
  details: Object.fromEntries(
588
- G.map((k) => {
589
- const J = q.required.includes(k), ye = k.startsWith("c") ? qe.ext : P;
588
+ V.map((F) => {
589
+ const Z = q.required.includes(F), ye = F.startsWith("c") ? qe.ext : P;
590
590
  return [
591
- k,
591
+ F,
592
592
  {
593
593
  namespace: ye,
594
- required: J,
594
+ required: Z,
595
595
  default: null,
596
596
  validation: Ct
597
597
  }
@@ -603,16 +603,16 @@ function go(l, c, u) {
603
603
  any: !1,
604
604
  sequence: b,
605
605
  details: Object.fromEntries(
606
- b.map((k) => {
607
- const J = Zr(k), ie = J === 1;
606
+ b.map((F) => {
607
+ const Z = Zr(F), re = Z === 1;
608
608
  return [
609
- k,
609
+ F,
610
610
  {
611
- required: ie,
611
+ required: re,
612
612
  validation: {
613
613
  ...Ct,
614
- minOccurrence: ie ? 1 : null,
615
- maxOccurrence: J
614
+ minOccurrence: re ? 1 : null,
615
+ maxOccurrence: Z
616
616
  },
617
617
  constraints: []
618
618
  }
@@ -760,7 +760,7 @@ function xo() {
760
760
  }
761
761
  typeof Promise > "u" || m.Promise || (m.Promise = Promise);
762
762
  var P = Object.getPrototypeOf, q = {}.hasOwnProperty;
763
- function G(e, t) {
763
+ function V(e, t) {
764
764
  return q.call(e, t);
765
765
  }
766
766
  function z(e, t) {
@@ -770,28 +770,28 @@ function xo() {
770
770
  }
771
771
  var H = Object.defineProperty;
772
772
  function M(e, t, n, r) {
773
- H(e, t, R(n && G(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, r));
773
+ H(e, t, R(n && V(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, r));
774
774
  }
775
- function k(e) {
775
+ function F(e) {
776
776
  return { from: function(t) {
777
777
  return e.prototype = Object.create(t.prototype), M(e.prototype, "constructor", e), { extend: z.bind(null, e.prototype) };
778
778
  } };
779
779
  }
780
- var J = Object.getOwnPropertyDescriptor, ie = [].slice;
780
+ var Z = Object.getOwnPropertyDescriptor, re = [].slice;
781
781
  function ye(e, t, n) {
782
- return ie.call(e, t, n);
782
+ return re.call(e, t, n);
783
783
  }
784
- function te(e, t) {
784
+ function ee(e, t) {
785
785
  return t(e);
786
786
  }
787
787
  function Y(e) {
788
788
  if (!e) throw new Error("Assertion Failed");
789
789
  }
790
- function oe(e) {
790
+ function ie(e) {
791
791
  m.setImmediate ? setImmediate(e) : setTimeout(e, 0);
792
792
  }
793
793
  function pe(e, t) {
794
- if (typeof t == "string" && G(e, t)) return e[t];
794
+ if (typeof t == "string" && V(e, t)) return e[t];
795
795
  if (!t) return e;
796
796
  if (typeof t != "string") {
797
797
  for (var n = [], r = 0, a = t.length; r < a; ++r) {
@@ -806,18 +806,18 @@ function xo() {
806
806
  return p == null ? void 0 : pe(p, t.substr(d + 1));
807
807
  }
808
808
  }
809
- function ae(e, t, n) {
809
+ function oe(e, t, n) {
810
810
  if (e && t !== void 0 && !("isFrozen" in Object && Object.isFrozen(e))) if (typeof t != "string" && "length" in t) {
811
811
  Y(typeof n != "string" && "length" in n);
812
- for (var r = 0, a = t.length; r < a; ++r) ae(e, t[r], n[r]);
812
+ for (var r = 0, a = t.length; r < a; ++r) oe(e, t[r], n[r]);
813
813
  } else {
814
814
  var i, d, p = t.indexOf(".");
815
- p !== -1 ? (i = t.substr(0, p), (d = t.substr(p + 1)) === "" ? n === void 0 ? b(e) && !isNaN(parseInt(i)) ? e.splice(i, 1) : delete e[i] : e[i] = n : ae(p = !(p = e[i]) || !G(e, i) ? e[i] = {} : p, d, n)) : n === void 0 ? b(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
815
+ p !== -1 ? (i = t.substr(0, p), (d = t.substr(p + 1)) === "" ? n === void 0 ? b(e) && !isNaN(parseInt(i)) ? e.splice(i, 1) : delete e[i] : e[i] = n : oe(p = !(p = e[i]) || !V(e, i) ? e[i] = {} : p, d, n)) : n === void 0 ? b(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
816
816
  }
817
817
  }
818
818
  function Re(e) {
819
819
  var t, n = {};
820
- for (t in e) G(e, t) && (n[t] = e[t]);
820
+ for (t in e) V(e, t) && (n[t] = e[t]);
821
821
  return n;
822
822
  }
823
823
  var I = [].concat;
@@ -844,7 +844,7 @@ function xo() {
844
844
  } else if (ze.has(n.constructor)) r = n;
845
845
  else {
846
846
  var d, p = P(n);
847
- for (d in r = p === Object.prototype ? {} : Object.create(p), de.set(n, r), n) G(n, d) && (r[d] = t(n[d]));
847
+ for (d in r = p === Object.prototype ? {} : Object.create(p), de.set(n, r), n) V(n, d) && (r[d] = t(n[d]));
848
848
  }
849
849
  return r;
850
850
  })(e), de = null, e;
@@ -863,7 +863,7 @@ function xo() {
863
863
  return t = e.indexOf(t), 0 <= t && e.splice(t, 1), 0 <= t;
864
864
  }
865
865
  var Le = {};
866
- function Fe(e) {
866
+ function ke(e) {
867
867
  var t, n, r, a;
868
868
  if (arguments.length === 1) {
869
869
  if (b(e)) return e.slice();
@@ -904,9 +904,9 @@ function xo() {
904
904
  return t[n];
905
905
  }), this.failuresByPos = t, this.message = St(e, this.failures);
906
906
  }
907
- k(Qe).from(Error).extend({ toString: function() {
907
+ F(Qe).from(Error).extend({ toString: function() {
908
908
  return this.name + ": " + this.message;
909
- } }), k(He).from(Qe), k(Ze).from(Qe);
909
+ } }), F(He).from(Qe), F(Ze).from(Qe);
910
910
  var f = Me.reduce(function(e, t) {
911
911
  return e[t] = t + "Error", e;
912
912
  }, {}), s = Qe, O = Me.reduce(function(e, t) {
@@ -915,7 +915,7 @@ function xo() {
915
915
  this.name = n, a ? typeof a == "string" ? (this.message = "".concat(a).concat(i ? `
916
916
  ` + i : ""), this.inner = i || null) : typeof a == "object" && (this.message = "".concat(a.name, " ").concat(a.message), this.inner = a) : (this.message = Pt[t] || n, this.inner = null);
917
917
  }
918
- return k(r).from(s), e[t] = r, e;
918
+ return F(r).from(s), e[t] = r, e;
919
919
  }, {});
920
920
  O.Syntax = SyntaxError, O.Type = TypeError, O.Range = RangeError;
921
921
  var B = Mt.reduce(function(e, t) {
@@ -923,7 +923,7 @@ function xo() {
923
923
  }, {}), ue = Me.reduce(function(e, t) {
924
924
  return ["Syntax", "Type", "Range"].indexOf(t) === -1 && (e[t + "Error"] = O[t]), e;
925
925
  }, {});
926
- function Z() {
926
+ function J() {
927
927
  }
928
928
  function he(e) {
929
929
  return e;
@@ -939,7 +939,7 @@ function xo() {
939
939
  };
940
940
  }
941
941
  function Je(e, t) {
942
- return e === Z ? t : function() {
942
+ return e === J ? t : function() {
943
943
  var n = e.apply(this, arguments);
944
944
  n !== void 0 && (arguments[0] = n);
945
945
  var r = this.onsuccess, a = this.onerror;
@@ -949,14 +949,14 @@ function xo() {
949
949
  };
950
950
  }
951
951
  function Ae(e, t) {
952
- return e === Z ? t : function() {
952
+ return e === J ? t : function() {
953
953
  e.apply(this, arguments);
954
954
  var n = this.onsuccess, r = this.onerror;
955
955
  this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? ve(n, this.onsuccess) : n), r && (this.onerror = this.onerror ? ve(r, this.onerror) : r);
956
956
  };
957
957
  }
958
958
  function Ke(e, t) {
959
- return e === Z ? t : function(n) {
959
+ return e === J ? t : function(n) {
960
960
  var r = e.apply(this, arguments);
961
961
  R(n, r);
962
962
  var a = this.onsuccess, i = this.onerror;
@@ -964,12 +964,12 @@ function xo() {
964
964
  };
965
965
  }
966
966
  function In(e, t) {
967
- return e === Z ? t : function() {
967
+ return e === J ? t : function() {
968
968
  return t.apply(this, arguments) !== !1 && e.apply(this, arguments);
969
969
  };
970
970
  }
971
971
  function wt(e, t) {
972
- return e === Z ? t : function() {
972
+ return e === J ? t : function() {
973
973
  var n = e.apply(this, arguments);
974
974
  if (n && typeof n.then == "function") {
975
975
  for (var r = this, a = arguments.length, i = new Array(a); a--; ) i[a] = arguments[a];
@@ -982,24 +982,24 @@ function xo() {
982
982
  }
983
983
  ue.ModifyError = He, ue.DexieError = Qe, ue.BulkError = Ze;
984
984
  var De = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
985
- function Ft(e) {
985
+ function kt(e) {
986
986
  De = e;
987
987
  }
988
- var kt = {}, _r = 100, ft = typeof Promise > "u" ? [] : (function() {
988
+ var Ft = {}, _r = 100, ft = typeof Promise > "u" ? [] : (function() {
989
989
  var e = Promise.resolve();
990
990
  if (typeof crypto > "u" || !crypto.subtle) return [e, P(e), e];
991
991
  var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
992
992
  return [t, P(t), e];
993
993
  })(), Mt = ft[0], Me = ft[1], ft = ft[2], Me = Me && Me.then, dt = Mt && Mt.constructor, Dn = !!ft, jt = function(e, t) {
994
994
  Kt.push([e, t]), Zt && (queueMicrotask(Ra), Zt = !1);
995
- }, Pn = !0, Zt = !0, ht = [], Jt = [], Sn = he, et = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: Z, pgp: !1, env: {}, finalize: Z }, Q = et, Kt = [], mt = 0, en = [];
995
+ }, Pn = !0, Zt = !0, ht = [], Jt = [], Sn = he, et = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: J, pgp: !1, env: {}, finalize: J }, Q = et, Kt = [], mt = 0, en = [];
996
996
  function X(e) {
997
997
  if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
998
998
  this._listeners = [], this._lib = !1;
999
999
  var t = this._PSD = Q;
1000
1000
  if (typeof e != "function") {
1001
- if (e !== kt) throw new TypeError("Not a function");
1002
- return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && kn(this, this._value));
1001
+ if (e !== Ft) throw new TypeError("Not a function");
1002
+ return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && Fn(this, this._value));
1003
1003
  }
1004
1004
  this._state = null, this._value = null, ++t.ref, (function n(r, a) {
1005
1005
  try {
@@ -1011,13 +1011,13 @@ function xo() {
1011
1011
  i instanceof X ? i._then(p, v) : i.then(p, v);
1012
1012
  }) : (r._state = !0, r._value = i, Cr(r)), d && Et();
1013
1013
  }
1014
- }, kn.bind(null, r));
1014
+ }, Fn.bind(null, r));
1015
1015
  } catch (i) {
1016
- kn(r, i);
1016
+ Fn(r, i);
1017
1017
  }
1018
1018
  })(this, e);
1019
1019
  }
1020
- var Fn = { get: function() {
1020
+ var kn = { get: function() {
1021
1021
  var e = Q, t = an;
1022
1022
  function n(r, a) {
1023
1023
  var i = this, d = !e.global && (e !== Q || t !== an), p = d && !nt(), v = new X(function(C, w) {
@@ -1025,16 +1025,16 @@ function xo() {
1025
1025
  });
1026
1026
  return this._consoleTask && (v._consoleTask = this._consoleTask), v;
1027
1027
  }
1028
- return n.prototype = kt, n;
1028
+ return n.prototype = Ft, n;
1029
1029
  }, set: function(e) {
1030
- M(this, "then", e && e.prototype === kt ? Fn : { get: function() {
1030
+ M(this, "then", e && e.prototype === Ft ? kn : { get: function() {
1031
1031
  return e;
1032
- }, set: Fn.set });
1032
+ }, set: kn.set });
1033
1033
  } };
1034
1034
  function br(e, t, n, r, a) {
1035
1035
  this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof t == "function" ? t : null, this.resolve = n, this.reject = r, this.psd = a;
1036
1036
  }
1037
- function kn(e, t) {
1037
+ function Fn(e, t) {
1038
1038
  var n, r;
1039
1039
  Jt.push(t), e._state === null && (n = e._lib && Bt(), t = Sn(t), e._state = !1, e._value = t, r = e, ht.some(function(a) {
1040
1040
  return a._value === r._value;
@@ -1097,7 +1097,7 @@ function xo() {
1097
1097
  for (var t = en.slice(0), n = t.length; n; ) t[--n]();
1098
1098
  }
1099
1099
  function tn(e) {
1100
- return new X(kt, !1, e);
1100
+ return new X(Ft, !1, e);
1101
1101
  }
1102
1102
  function ge(e, t) {
1103
1103
  var n = Q;
@@ -1112,7 +1112,7 @@ function xo() {
1112
1112
  }
1113
1113
  };
1114
1114
  }
1115
- z(X.prototype, { then: Fn, _then: function(e, t) {
1115
+ z(X.prototype, { then: kn, _then: function(e, t) {
1116
1116
  Mn(this, new br(null, null, e, t, Q));
1117
1117
  }, catch: function(e) {
1118
1118
  if (arguments.length === 1) return this.then(null, e);
@@ -1141,7 +1141,7 @@ function xo() {
1141
1141
  n.then(r, a).finally(clearTimeout.bind(null, i));
1142
1142
  }) : this;
1143
1143
  } }), typeof Symbol < "u" && Symbol.toStringTag && M(X.prototype, Symbol.toStringTag, "Dexie.Promise"), et.env = Ar(), z(X, { all: function() {
1144
- var e = Fe.apply(null, arguments).map(on);
1144
+ var e = ke.apply(null, arguments).map(on);
1145
1145
  return new X(function(t, n) {
1146
1146
  e.length === 0 && t([]);
1147
1147
  var r = e.length;
@@ -1154,9 +1154,9 @@ function xo() {
1154
1154
  }, resolve: function(e) {
1155
1155
  return e instanceof X ? e : e && typeof e.then == "function" ? new X(function(t, n) {
1156
1156
  e.then(t, n);
1157
- }) : new X(kt, !0, e);
1157
+ }) : new X(Ft, !0, e);
1158
1158
  }, reject: tn, race: function() {
1159
- var e = Fe.apply(null, arguments).map(on);
1159
+ var e = ke.apply(null, arguments).map(on);
1160
1160
  return new X(function(t, n) {
1161
1161
  e.map(function(r) {
1162
1162
  return X.resolve(r).then(t, n);
@@ -1193,7 +1193,7 @@ function xo() {
1193
1193
  }, t, n, r);
1194
1194
  });
1195
1195
  } }), dt && (dt.allSettled && M(X, "allSettled", function() {
1196
- var e = Fe.apply(null, arguments).map(on);
1196
+ var e = ke.apply(null, arguments).map(on);
1197
1197
  return new X(function(t) {
1198
1198
  e.length === 0 && t([]);
1199
1199
  var n = e.length, r = new Array(n);
@@ -1208,7 +1208,7 @@ function xo() {
1208
1208
  });
1209
1209
  });
1210
1210
  }), dt.any && typeof AggregateError < "u" && M(X, "any", function() {
1211
- var e = Fe.apply(null, arguments).map(on);
1211
+ var e = ke.apply(null, arguments).map(on);
1212
1212
  return new X(function(t, n) {
1213
1213
  e.length === 0 && n(new AggregateError([]));
1214
1214
  var r = e.length, a = new Array(r);
@@ -1277,7 +1277,7 @@ function xo() {
1277
1277
  function Kn(e) {
1278
1278
  Promise === dt && we.echoes === 0 ? rn === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
1279
1279
  }
1280
- ("" + Me).indexOf("[native code]") === -1 && (xt = nt = Z);
1280
+ ("" + Me).indexOf("[native code]") === -1 && (xt = nt = J);
1281
1281
  var be = X.reject, gt = "￿", Xe = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", Br = "String expected.", Tt = [], sn = "__dbnames", qn = "readonly", Ln = "readwrite";
1282
1282
  function yt(e, t) {
1283
1283
  return e ? t ? function() {
@@ -1376,7 +1376,7 @@ function xo() {
1376
1376
  if (w._state.openComplete) return be(new O.DatabaseClosed(w._state.dbOpenError));
1377
1377
  if (!w._state.isBeingOpened) {
1378
1378
  if (!w._state.autoOpen) return be(new O.DatabaseClosed());
1379
- w.open().catch(Z);
1379
+ w.open().catch(J);
1380
1380
  }
1381
1381
  return w._state.dbReadyPromise.then(function() {
1382
1382
  return C(w, g, T, _);
@@ -1492,7 +1492,7 @@ function xo() {
1492
1492
  return p.numFailures ? X.reject(p.failures[0]) : p.lastResult;
1493
1493
  }).then(function(p) {
1494
1494
  if (i) try {
1495
- ae(e, i, p);
1495
+ oe(e, i, p);
1496
1496
  } catch {
1497
1497
  }
1498
1498
  return p;
@@ -1507,7 +1507,7 @@ function xo() {
1507
1507
  return p.numFailures ? X.reject(p.failures[0]) : p.lastResult;
1508
1508
  }).then(function(p) {
1509
1509
  if (i) try {
1510
- ae(e, i, p);
1510
+ oe(e, i, p);
1511
1511
  } catch {
1512
1512
  }
1513
1513
  return p;
@@ -1581,7 +1581,7 @@ function xo() {
1581
1581
  var D = N[E], S = A[D];
1582
1582
  if (D === t.schema.primKey.keyPath) {
1583
1583
  if (se(S, _) !== 0) throw new O.Constraint("Cannot update primary key in bulkUpdate()");
1584
- } else ae(x, D, S);
1584
+ } else oe(x, D, S);
1585
1585
  }
1586
1586
  i.push(T), v.push(_), C.push(x);
1587
1587
  }
@@ -1628,7 +1628,7 @@ function xo() {
1628
1628
  if (typeof d != "object") {
1629
1629
  var C;
1630
1630
  p = p || In;
1631
- var w = { subscribers: [], fire: v = v || Z, subscribe: function(g) {
1631
+ var w = { subscribers: [], fire: v = v || J, subscribe: function(g) {
1632
1632
  w.subscribers.indexOf(g) === -1 && (w.subscribers.push(g), w.fire = p(w.fire, g));
1633
1633
  }, unsubscribe: function(g) {
1634
1634
  w.subscribers = w.subscribers.filter(function(T) {
@@ -1645,7 +1645,7 @@ function xo() {
1645
1645
  var _ = i(g, he, function() {
1646
1646
  for (var A = arguments.length, x = new Array(A); A--; ) x[A] = arguments[A];
1647
1647
  _.subscribers.forEach(function(E) {
1648
- oe(function() {
1648
+ ie(function() {
1649
1649
  E.apply(null, x);
1650
1650
  });
1651
1651
  });
@@ -1655,7 +1655,7 @@ function xo() {
1655
1655
  }
1656
1656
  }
1657
1657
  function Lt(e, t) {
1658
- return k(t).from({ prototype: e }), t;
1658
+ return F(t).from({ prototype: e }), t;
1659
1659
  }
1660
1660
  function Nt(e, t) {
1661
1661
  return !(e.filter || e.algorithm || e.or) && (t ? e.justLimit : !e.replayFilter);
@@ -1688,7 +1688,7 @@ function xo() {
1688
1688
  return v.stop(T);
1689
1689
  }, function(T) {
1690
1690
  return v.fail(T);
1691
- }) || ((g = "" + (w = v.primaryKey)) == "[object ArrayBuffer]" && (g = "" + new Uint8Array(w)), G(i, g) || (i[g] = !0, t(p, v, C)));
1691
+ }) || ((g = "" + (w = v.primaryKey)) == "[object ArrayBuffer]" && (g = "" + new Uint8Array(w)), V(i, g) || (i[g] = !0, t(p, v, C)));
1692
1692
  };
1693
1693
  return Promise.all([e.or._iterate(d, n), Ir(Rr(e, r, n), e.algorithm, d, !e.keysOnly && e.valueMapper)]);
1694
1694
  }
@@ -1706,9 +1706,9 @@ function xo() {
1706
1706
  t && !t(i, function(p) {
1707
1707
  return d = p;
1708
1708
  }, function(p) {
1709
- i.stop(p), d = Z;
1709
+ i.stop(p), d = J;
1710
1710
  }, function(p) {
1711
- i.fail(p), d = Z;
1711
+ i.fail(p), d = J;
1712
1712
  }) || a(i.value, i, function(p) {
1713
1713
  return d = p;
1714
1714
  }), d();
@@ -1904,7 +1904,7 @@ function xo() {
1904
1904
  if (!e || !e.multi) return this;
1905
1905
  var t = {};
1906
1906
  return Un(this._ctx, function(a) {
1907
- var r = a.primaryKey.toString(), a = G(t, r);
1907
+ var r = a.primaryKey.toString(), a = V(t, r);
1908
1908
  return t[r] = !0, !a;
1909
1909
  }), this;
1910
1910
  }, le.prototype.modify = function(e) {
@@ -1913,16 +1913,16 @@ function xo() {
1913
1913
  var a, i, d;
1914
1914
  d = typeof e == "function" ? e : (a = y(e), i = a.length, function(N) {
1915
1915
  for (var D = !1, S = 0; S < i; ++S) {
1916
- var F = a[S], j = e[F], U = pe(N, F);
1917
- j instanceof Ut ? (ae(N, F, j.execute(U)), D = !0) : U !== j && (ae(N, F, j), D = !0);
1916
+ var k = a[S], j = e[k], U = pe(N, k);
1917
+ j instanceof Ut ? (oe(N, k, j.execute(U)), D = !0) : U !== j && (oe(N, k, j), D = !0);
1918
1918
  }
1919
1919
  return D;
1920
1920
  });
1921
1921
  var p = n.table.core, g = p.schema.primaryKey, v = g.outbound, C = g.extractKey, w = 200, g = t.db._options.modifyChunkSize;
1922
1922
  g && (w = typeof g == "object" ? g[p.name] || g["*"] || 200 : g);
1923
- function T(N, F) {
1924
- var S = F.failures, F = F.numFailures;
1925
- A += N - F;
1923
+ function T(N, k) {
1924
+ var S = k.failures, k = k.numFailures;
1925
+ A += N - k;
1926
1926
  for (var j = 0, U = y(S); j < U.length; j++) {
1927
1927
  var K = U[j];
1928
1928
  _.push(S[K]);
@@ -1930,29 +1930,29 @@ function xo() {
1930
1930
  }
1931
1931
  var _ = [], A = 0, x = [], E = e === Pr;
1932
1932
  return t.clone().primaryKeys().then(function(N) {
1933
- function D(F) {
1934
- var j = Math.min(w, N.length - F), U = N.slice(F, F + j);
1933
+ function D(k) {
1934
+ var j = Math.min(w, N.length - k), U = N.slice(k, k + j);
1935
1935
  return (E ? Promise.resolve([]) : p.getMany({ trans: r, keys: U, cache: "immutable" })).then(function(K) {
1936
- var L = [], V = [], $ = v ? [] : null, W = E ? U : [];
1937
- if (!E) for (var re = 0; re < j; ++re) {
1938
- var ce = K[re], ne = { value: Se(ce), primKey: N[F + re] };
1939
- d.call(ne, ne.value, ne) !== !1 && (ne.value == null ? W.push(N[F + re]) : v || se(C(ce), C(ne.value)) === 0 ? (V.push(ne.value), v && $.push(N[F + re])) : (W.push(N[F + re]), L.push(ne.value)));
1936
+ var L = [], G = [], $ = v ? [] : null, W = E ? U : [];
1937
+ if (!E) for (var ae = 0; ae < j; ++ae) {
1938
+ var ce = K[ae], ne = { value: Se(ce), primKey: N[k + ae] };
1939
+ d.call(ne, ne.value, ne) !== !1 && (ne.value == null ? W.push(N[k + ae]) : v || se(C(ce), C(ne.value)) === 0 ? (G.push(ne.value), v && $.push(N[k + ae])) : (W.push(N[k + ae]), L.push(ne.value)));
1940
1940
  }
1941
1941
  return Promise.resolve(0 < L.length && p.mutate({ trans: r, type: "add", values: L }).then(function(_e) {
1942
- for (var ee in _e.failures) W.splice(parseInt(ee), 1);
1942
+ for (var te in _e.failures) W.splice(parseInt(te), 1);
1943
1943
  T(L.length, _e);
1944
1944
  })).then(function() {
1945
- return (0 < V.length || S && typeof e == "object") && p.mutate({ trans: r, type: "put", keys: $, values: V, criteria: S, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < F }).then(function(_e) {
1946
- return T(V.length, _e);
1945
+ return (0 < G.length || S && typeof e == "object") && p.mutate({ trans: r, type: "put", keys: $, values: G, criteria: S, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < k }).then(function(_e) {
1946
+ return T(G.length, _e);
1947
1947
  });
1948
1948
  }).then(function() {
1949
- return (0 < W.length || S && E) && p.mutate({ trans: r, type: "delete", keys: W, criteria: S, isAdditionalChunk: 0 < F }).then(function(_e) {
1949
+ return (0 < W.length || S && E) && p.mutate({ trans: r, type: "delete", keys: W, criteria: S, isAdditionalChunk: 0 < k }).then(function(_e) {
1950
1950
  return cn(n.table, W, _e);
1951
1951
  }).then(function(_e) {
1952
1952
  return T(W.length, _e);
1953
1953
  });
1954
1954
  }).then(function() {
1955
- return N.length > F + j && D(F + w);
1955
+ return N.length > k + j && D(k + w);
1956
1956
  });
1957
1957
  });
1958
1958
  }
@@ -1983,14 +1983,14 @@ function xo() {
1983
1983
  var Pr = function(e, t) {
1984
1984
  return t.value = null;
1985
1985
  };
1986
- function Fa(e, t) {
1986
+ function ka(e, t) {
1987
1987
  return e < t ? -1 : e === t ? 0 : 1;
1988
1988
  }
1989
- function ka(e, t) {
1989
+ function Fa(e, t) {
1990
1990
  return t < e ? -1 : e === t ? 0 : 1;
1991
1991
  }
1992
- function ke(e, t, n) {
1993
- return e = e instanceof Fr ? new e.Collection(e) : e, e._ctx.error = new (n || TypeError)(t), e;
1992
+ function Fe(e, t, n) {
1993
+ return e = e instanceof kr ? new e.Collection(e) : e, e._ctx.error = new (n || TypeError)(t), e;
1994
1994
  }
1995
1995
  function Ot(e) {
1996
1996
  return new e.Collection(e, function() {
@@ -2001,7 +2001,7 @@ function xo() {
2001
2001
  var a, i, d, p, v, C, w, g = n.length;
2002
2002
  if (!n.every(function(A) {
2003
2003
  return typeof A == "string";
2004
- })) return ke(e, Br);
2004
+ })) return Fe(e, Br);
2005
2005
  function T(A) {
2006
2006
  a = A === "next" ? function(E) {
2007
2007
  return E.toUpperCase();
@@ -2011,7 +2011,7 @@ function xo() {
2011
2011
  return E.toLowerCase();
2012
2012
  } : function(E) {
2013
2013
  return E.toUpperCase();
2014
- }, d = A === "next" ? Fa : ka;
2014
+ }, d = A === "next" ? ka : Fa;
2015
2015
  var x = n.map(function(E) {
2016
2016
  return { lower: i(E), upper: a(E) };
2017
2017
  }).sort(function(E, N) {
@@ -2034,16 +2034,16 @@ function xo() {
2034
2034
  if (typeof N != "string") return !1;
2035
2035
  var D = i(N);
2036
2036
  if (t(D, v, _)) return !0;
2037
- for (var S = null, F = _; F < g; ++F) {
2038
- var j = (function(U, K, L, V, $, W) {
2039
- for (var re = Math.min(U.length, V.length), ce = -1, ne = 0; ne < re; ++ne) {
2037
+ for (var S = null, k = _; k < g; ++k) {
2038
+ var j = (function(U, K, L, G, $, W) {
2039
+ for (var ae = Math.min(U.length, G.length), ce = -1, ne = 0; ne < ae; ++ne) {
2040
2040
  var _e = K[ne];
2041
- if (_e !== V[ne]) return $(U[ne], L[ne]) < 0 ? U.substr(0, ne) + L[ne] + L.substr(ne + 1) : $(U[ne], V[ne]) < 0 ? U.substr(0, ne) + V[ne] + L.substr(ne + 1) : 0 <= ce ? U.substr(0, ce) + K[ce] + L.substr(ce + 1) : null;
2041
+ if (_e !== G[ne]) return $(U[ne], L[ne]) < 0 ? U.substr(0, ne) + L[ne] + L.substr(ne + 1) : $(U[ne], G[ne]) < 0 ? U.substr(0, ne) + G[ne] + L.substr(ne + 1) : 0 <= ce ? U.substr(0, ce) + K[ce] + L.substr(ce + 1) : null;
2042
2042
  $(U[ne], _e) < 0 && (ce = ne);
2043
2043
  }
2044
- return re < V.length && W === "next" ? U + L.substr(U.length) : re < U.length && W === "prev" ? U.substr(0, L.length) : ce < 0 ? null : U.substr(0, ce) + V[ce] + L.substr(ce + 1);
2045
- })(N, D, p[F], v[F], d, C);
2046
- j === null && S === null ? _ = F + 1 : (S === null || 0 < d(S, j)) && (S = j);
2044
+ return ae < G.length && W === "next" ? U + L.substr(U.length) : ae < U.length && W === "prev" ? U.substr(0, L.length) : ce < 0 ? null : U.substr(0, ce) + G[ce] + L.substr(ce + 1);
2045
+ })(N, D, p[k], v[k], d, C);
2046
+ j === null && S === null ? _ = k + 1 : (S === null || 0 < d(S, j)) && (S = j);
2047
2047
  }
2048
2048
  return x(S !== null ? function() {
2049
2049
  A.continue(S + w);
@@ -2056,7 +2056,7 @@ function xo() {
2056
2056
  function Sr(e) {
2057
2057
  return { type: 1, lower: e, upper: e };
2058
2058
  }
2059
- var Fr = (Object.defineProperty(Be.prototype, "Collection", { get: function() {
2059
+ var kr = (Object.defineProperty(Be.prototype, "Collection", { get: function() {
2060
2060
  return this._ctx.table.db.Collection;
2061
2061
  }, enumerable: !1, configurable: !0 }), Be.prototype.between = function(e, t, n, r) {
2062
2062
  n = n !== !1, r = r === !0;
@@ -2065,30 +2065,30 @@ function xo() {
2065
2065
  return at(e, t, !n, !r);
2066
2066
  });
2067
2067
  } catch {
2068
- return ke(this, Xe);
2068
+ return Fe(this, Xe);
2069
2069
  }
2070
2070
  }, Be.prototype.equals = function(e) {
2071
- return e == null ? ke(this, Xe) : new this.Collection(this, function() {
2071
+ return e == null ? Fe(this, Xe) : new this.Collection(this, function() {
2072
2072
  return Sr(e);
2073
2073
  });
2074
2074
  }, Be.prototype.above = function(e) {
2075
- return e == null ? ke(this, Xe) : new this.Collection(this, function() {
2075
+ return e == null ? Fe(this, Xe) : new this.Collection(this, function() {
2076
2076
  return at(e, void 0, !0);
2077
2077
  });
2078
2078
  }, Be.prototype.aboveOrEqual = function(e) {
2079
- return e == null ? ke(this, Xe) : new this.Collection(this, function() {
2079
+ return e == null ? Fe(this, Xe) : new this.Collection(this, function() {
2080
2080
  return at(e, void 0, !1);
2081
2081
  });
2082
2082
  }, Be.prototype.below = function(e) {
2083
- return e == null ? ke(this, Xe) : new this.Collection(this, function() {
2083
+ return e == null ? Fe(this, Xe) : new this.Collection(this, function() {
2084
2084
  return at(void 0, e, !1, !0);
2085
2085
  });
2086
2086
  }, Be.prototype.belowOrEqual = function(e) {
2087
- return e == null ? ke(this, Xe) : new this.Collection(this, function() {
2087
+ return e == null ? Fe(this, Xe) : new this.Collection(this, function() {
2088
2088
  return at(void 0, e);
2089
2089
  });
2090
2090
  }, Be.prototype.startsWith = function(e) {
2091
- return typeof e != "string" ? ke(this, Br) : this.between(e, e + gt, !0, !0);
2091
+ return typeof e != "string" ? Fe(this, Br) : this.between(e, e + gt, !0, !0);
2092
2092
  }, Be.prototype.startsWithIgnoreCase = function(e) {
2093
2093
  return e === "" ? this.startsWith(e) : dn(this, function(t, n) {
2094
2094
  return t.indexOf(n[0]) === 0;
@@ -2098,23 +2098,23 @@ function xo() {
2098
2098
  return t === n[0];
2099
2099
  }, [e], "");
2100
2100
  }, Be.prototype.anyOfIgnoreCase = function() {
2101
- var e = Fe.apply(Le, arguments);
2101
+ var e = ke.apply(Le, arguments);
2102
2102
  return e.length === 0 ? Ot(this) : dn(this, function(t, n) {
2103
2103
  return n.indexOf(t) !== -1;
2104
2104
  }, e, "");
2105
2105
  }, Be.prototype.startsWithAnyOfIgnoreCase = function() {
2106
- var e = Fe.apply(Le, arguments);
2106
+ var e = ke.apply(Le, arguments);
2107
2107
  return e.length === 0 ? Ot(this) : dn(this, function(t, n) {
2108
2108
  return n.some(function(r) {
2109
2109
  return t.indexOf(r) === 0;
2110
2110
  });
2111
2111
  }, e, gt);
2112
2112
  }, Be.prototype.anyOf = function() {
2113
- var e = this, t = Fe.apply(Le, arguments), n = this._cmp;
2113
+ var e = this, t = ke.apply(Le, arguments), n = this._cmp;
2114
2114
  try {
2115
2115
  t.sort(n);
2116
2116
  } catch {
2117
- return ke(this, Xe);
2117
+ return Fe(this, Xe);
2118
2118
  }
2119
2119
  if (t.length === 0) return Ot(this);
2120
2120
  var r = new this.Collection(this, function() {
@@ -2133,12 +2133,12 @@ function xo() {
2133
2133
  }, Be.prototype.notEqual = function(e) {
2134
2134
  return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
2135
2135
  }, Be.prototype.noneOf = function() {
2136
- var e = Fe.apply(Le, arguments);
2136
+ var e = ke.apply(Le, arguments);
2137
2137
  if (e.length === 0) return new this.Collection(this);
2138
2138
  try {
2139
2139
  e.sort(this._ascending);
2140
2140
  } catch {
2141
- return ke(this, Xe);
2141
+ return Fe(this, Xe);
2142
2142
  }
2143
2143
  var t = e.reduce(function(n, r) {
2144
2144
  return n ? n.concat([[n[n.length - 1][1], r]]) : [[-1 / 0, r]];
@@ -2149,24 +2149,24 @@ function xo() {
2149
2149
  if (N.length === 0) return Ot(this);
2150
2150
  if (!N.every(function(D) {
2151
2151
  return D[0] !== void 0 && D[1] !== void 0 && a(D[0], D[1]) <= 0;
2152
- })) 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", O.InvalidArgument);
2152
+ })) return Fe(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", O.InvalidArgument);
2153
2153
  var v = !t || t.includeLowers !== !1, C = t && t.includeUppers === !0, w, g = a;
2154
2154
  function T(D, S) {
2155
2155
  return g(D[0], S[0]);
2156
2156
  }
2157
2157
  try {
2158
2158
  (w = N.reduce(function(D, S) {
2159
- for (var F = 0, j = D.length; F < j; ++F) {
2160
- var U = D[F];
2159
+ for (var k = 0, j = D.length; k < j; ++k) {
2160
+ var U = D[k];
2161
2161
  if (r(S[0], U[1]) < 0 && 0 < r(S[1], U[0])) {
2162
2162
  U[0] = d(U[0], S[0]), U[1] = p(U[1], S[1]);
2163
2163
  break;
2164
2164
  }
2165
2165
  }
2166
- return F === j && D.push(S), D;
2166
+ return k === j && D.push(S), D;
2167
2167
  }, [])).sort(T);
2168
2168
  } catch {
2169
- return ke(this, Xe);
2169
+ return Fe(this, Xe);
2170
2170
  }
2171
2171
  var _ = 0, A = C ? function(D) {
2172
2172
  return 0 < a(D, w[_][1]);
@@ -2181,19 +2181,19 @@ function xo() {
2181
2181
  });
2182
2182
  return N._ondirectionchange = function(D) {
2183
2183
  g = D === "next" ? (E = A, a) : (E = x, i), w.sort(T);
2184
- }, N._addAlgorithm(function(D, S, F) {
2185
- for (var j, U = D.key; E(U); ) if (++_ === w.length) return S(F), !1;
2184
+ }, N._addAlgorithm(function(D, S, k) {
2185
+ for (var j, U = D.key; E(U); ) if (++_ === w.length) return S(k), !1;
2186
2186
  return !A(j = U) && !x(j) || (n._cmp(U, w[_][1]) === 0 || n._cmp(U, w[_][0]) === 0 || S(function() {
2187
2187
  g === a ? D.continue(w[_][0]) : D.continue(w[_][1]);
2188
2188
  }), !1);
2189
2189
  }), N;
2190
2190
  }, Be.prototype.startsWithAnyOf = function() {
2191
- var e = Fe.apply(Le, arguments);
2191
+ var e = ke.apply(Le, arguments);
2192
2192
  return e.every(function(t) {
2193
2193
  return typeof t == "string";
2194
2194
  }) ? e.length === 0 ? Ot(this) : this.inAnyRange(e.map(function(t) {
2195
2195
  return [t, t + gt];
2196
- })) : ke(this, "startsWithAnyOf() only works with strings");
2196
+ })) : Fe(this, "startsWithAnyOf() only works with strings");
2197
2197
  }, Be);
2198
2198
  function Be() {
2199
2199
  }
@@ -2286,7 +2286,7 @@ function xo() {
2286
2286
  this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new O.Abort()));
2287
2287
  }, $e.prototype.table = function(e) {
2288
2288
  var t = this._memoizedTables || (this._memoizedTables = {});
2289
- if (G(t, e)) return t[e];
2289
+ if (V(t, e)) return t[e];
2290
2290
  var n = this.schema[e];
2291
2291
  if (!n) throw new O.NotFound("Table " + e + " not part of transaction");
2292
2292
  return n = new this.db.Table(e, n, this), n.core = this.db.core.table(e), t[e] = n;
@@ -2294,9 +2294,9 @@ function xo() {
2294
2294
  function $e() {
2295
2295
  }
2296
2296
  function Gn(e, t, n, r, a, i, d, p) {
2297
- return { name: e, keyPath: t, unique: n, multi: r, auto: a, compound: i, src: (n && !d ? "&" : "") + (r ? "*" : "") + (a ? "++" : "") + kr(t), type: p };
2297
+ return { name: e, keyPath: t, unique: n, multi: r, auto: a, compound: i, src: (n && !d ? "&" : "") + (r ? "*" : "") + (a ? "++" : "") + Fr(t), type: p };
2298
2298
  }
2299
- function kr(e) {
2299
+ function Fr(e) {
2300
2300
  return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
2301
2301
  }
2302
2302
  function Xn(e, t, n) {
@@ -2346,25 +2346,25 @@ function xo() {
2346
2346
  function a(T) {
2347
2347
  var _, A = T.name;
2348
2348
  return { name: A, schema: T, mutate: function(x) {
2349
- var E = x.trans, N = x.type, D = x.keys, S = x.values, F = x.range;
2349
+ var E = x.trans, N = x.type, D = x.keys, S = x.values, k = x.range;
2350
2350
  return new Promise(function(j, U) {
2351
2351
  j = ge(j);
2352
- var K = E.objectStore(A), L = K.keyPath == null, V = N === "put" || N === "add";
2353
- if (!V && N !== "delete" && N !== "deleteRange") throw new Error("Invalid operation type: " + N);
2352
+ var K = E.objectStore(A), L = K.keyPath == null, G = N === "put" || N === "add";
2353
+ if (!G && N !== "delete" && N !== "deleteRange") throw new Error("Invalid operation type: " + N);
2354
2354
  var $, W = (D || S || { length: 1 }).length;
2355
2355
  if (D && S && D.length !== S.length) throw new Error("Given keys array must have same length as given values array.");
2356
2356
  if (W === 0) return j({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
2357
- function re(Ie) {
2357
+ function ae(Ie) {
2358
2358
  ++_e, $t(Ie);
2359
2359
  }
2360
2360
  var ce = [], ne = [], _e = 0;
2361
2361
  if (N === "deleteRange") {
2362
- if (F.type === 4) return j({ numFailures: _e, failures: ne, results: [], lastResult: void 0 });
2363
- F.type === 3 ? ce.push($ = K.clear()) : ce.push($ = K.delete(r(F)));
2362
+ if (k.type === 4) return j({ numFailures: _e, failures: ne, results: [], lastResult: void 0 });
2363
+ k.type === 3 ? ce.push($ = K.clear()) : ce.push($ = K.delete(r(k)));
2364
2364
  } else {
2365
- var L = V ? L ? [S, D] : [S, null] : [D, null], ee = L[0], Ne = L[1];
2366
- if (V) for (var Oe = 0; Oe < W; ++Oe) ce.push($ = Ne && Ne[Oe] !== void 0 ? K[N](ee[Oe], Ne[Oe]) : K[N](ee[Oe])), $.onerror = re;
2367
- else for (Oe = 0; Oe < W; ++Oe) ce.push($ = K[N](ee[Oe])), $.onerror = re;
2365
+ var L = G ? L ? [S, D] : [S, null] : [D, null], te = L[0], Ne = L[1];
2366
+ if (G) for (var Oe = 0; Oe < W; ++Oe) ce.push($ = Ne && Ne[Oe] !== void 0 ? K[N](te[Oe], Ne[Oe]) : K[N](te[Oe])), $.onerror = ae;
2367
+ else for (Oe = 0; Oe < W; ++Oe) ce.push($ = K[N](te[Oe])), $.onerror = ae;
2368
2368
  }
2369
2369
  function Bn(Ie) {
2370
2370
  Ie = Ie.target.result, ce.forEach(function(bt, fr) {
@@ -2374,85 +2374,85 @@ function xo() {
2374
2374
  }), lastResult: Ie });
2375
2375
  }
2376
2376
  $.onerror = function(Ie) {
2377
- re(Ie), Bn(Ie);
2377
+ ae(Ie), Bn(Ie);
2378
2378
  }, $.onsuccess = Bn;
2379
2379
  });
2380
2380
  }, getMany: function(x) {
2381
2381
  var E = x.trans, N = x.keys;
2382
2382
  return new Promise(function(D, S) {
2383
2383
  D = ge(D);
2384
- for (var F, j = E.objectStore(A), U = N.length, K = new Array(U), L = 0, V = 0, $ = function(ce) {
2385
- ce = ce.target, K[ce._pos] = ce.result, ++V === L && D(K);
2386
- }, W = Ue(S), re = 0; re < U; ++re) N[re] != null && ((F = j.get(N[re]))._pos = re, F.onsuccess = $, F.onerror = W, ++L);
2384
+ for (var k, j = E.objectStore(A), U = N.length, K = new Array(U), L = 0, G = 0, $ = function(ce) {
2385
+ ce = ce.target, K[ce._pos] = ce.result, ++G === L && D(K);
2386
+ }, W = Ue(S), ae = 0; ae < U; ++ae) N[ae] != null && ((k = j.get(N[ae]))._pos = ae, k.onsuccess = $, k.onerror = W, ++L);
2387
2387
  L === 0 && D(K);
2388
2388
  });
2389
2389
  }, get: function(x) {
2390
2390
  var E = x.trans, N = x.key;
2391
2391
  return new Promise(function(D, S) {
2392
2392
  D = ge(D);
2393
- var F = E.objectStore(A).get(N);
2394
- F.onsuccess = function(j) {
2393
+ var k = E.objectStore(A).get(N);
2394
+ k.onsuccess = function(j) {
2395
2395
  return D(j.target.result);
2396
- }, F.onerror = Ue(S);
2396
+ }, k.onerror = Ue(S);
2397
2397
  });
2398
2398
  }, query: (_ = C, function(x) {
2399
2399
  return new Promise(function(E, N) {
2400
2400
  E = ge(E);
2401
- var D, S, F, L = x.trans, j = x.values, U = x.limit, $ = x.query, K = U === 1 / 0 ? void 0 : U, V = $.index, $ = $.range, L = L.objectStore(A), V = V.isPrimaryKey ? L : L.index(V.name), $ = r($);
2401
+ var D, S, k, L = x.trans, j = x.values, U = x.limit, $ = x.query, K = U === 1 / 0 ? void 0 : U, G = $.index, $ = $.range, L = L.objectStore(A), G = G.isPrimaryKey ? L : L.index(G.name), $ = r($);
2402
2402
  if (U === 0) return E({ result: [] });
2403
- _ ? ((K = j ? V.getAll($, K) : V.getAllKeys($, K)).onsuccess = function(W) {
2403
+ _ ? ((K = j ? G.getAll($, K) : G.getAllKeys($, K)).onsuccess = function(W) {
2404
2404
  return E({ result: W.target.result });
2405
- }, K.onerror = Ue(N)) : (D = 0, S = !j && "openKeyCursor" in V ? V.openKeyCursor($) : V.openCursor($), F = [], S.onsuccess = function(W) {
2406
- var re = S.result;
2407
- return re ? (F.push(j ? re.value : re.primaryKey), ++D === U ? E({ result: F }) : void re.continue()) : E({ result: F });
2405
+ }, K.onerror = Ue(N)) : (D = 0, S = !j && "openKeyCursor" in G ? G.openKeyCursor($) : G.openCursor($), k = [], S.onsuccess = function(W) {
2406
+ var ae = S.result;
2407
+ return ae ? (k.push(j ? ae.value : ae.primaryKey), ++D === U ? E({ result: k }) : void ae.continue()) : E({ result: k });
2408
2408
  }, S.onerror = Ue(N));
2409
2409
  });
2410
2410
  }), openCursor: function(x) {
2411
- var E = x.trans, N = x.values, D = x.query, S = x.reverse, F = x.unique;
2411
+ var E = x.trans, N = x.values, D = x.query, S = x.reverse, k = x.unique;
2412
2412
  return new Promise(function(j, U) {
2413
2413
  j = ge(j);
2414
- var V = D.index, K = D.range, L = E.objectStore(A), L = V.isPrimaryKey ? L : L.index(V.name), V = S ? F ? "prevunique" : "prev" : F ? "nextunique" : "next", $ = !N && "openKeyCursor" in L ? L.openKeyCursor(r(K), V) : L.openCursor(r(K), V);
2414
+ var G = D.index, K = D.range, L = E.objectStore(A), L = G.isPrimaryKey ? L : L.index(G.name), G = S ? k ? "prevunique" : "prev" : k ? "nextunique" : "next", $ = !N && "openKeyCursor" in L ? L.openKeyCursor(r(K), G) : L.openCursor(r(K), G);
2415
2415
  $.onerror = Ue(U), $.onsuccess = ge(function(W) {
2416
- var re, ce, ne, _e, ee = $.result;
2417
- ee ? (ee.___id = ++ja, ee.done = !1, re = ee.continue.bind(ee), ce = (ce = ee.continuePrimaryKey) && ce.bind(ee), ne = ee.advance.bind(ee), _e = function() {
2416
+ var ae, ce, ne, _e, te = $.result;
2417
+ te ? (te.___id = ++ja, te.done = !1, ae = te.continue.bind(te), ce = (ce = te.continuePrimaryKey) && ce.bind(te), ne = te.advance.bind(te), _e = function() {
2418
2418
  throw new Error("Cursor not stopped");
2419
- }, ee.trans = E, ee.stop = ee.continue = ee.continuePrimaryKey = ee.advance = function() {
2419
+ }, te.trans = E, te.stop = te.continue = te.continuePrimaryKey = te.advance = function() {
2420
2420
  throw new Error("Cursor not started");
2421
- }, ee.fail = ge(U), ee.next = function() {
2421
+ }, te.fail = ge(U), te.next = function() {
2422
2422
  var Ne = this, Oe = 1;
2423
2423
  return this.start(function() {
2424
2424
  return Oe-- ? Ne.continue() : Ne.stop();
2425
2425
  }).then(function() {
2426
2426
  return Ne;
2427
2427
  });
2428
- }, ee.start = function(Ne) {
2428
+ }, te.start = function(Ne) {
2429
2429
  function Oe() {
2430
2430
  if ($.result) try {
2431
2431
  Ne();
2432
2432
  } catch (Ie) {
2433
- ee.fail(Ie);
2433
+ te.fail(Ie);
2434
2434
  }
2435
- else ee.done = !0, ee.start = function() {
2435
+ else te.done = !0, te.start = function() {
2436
2436
  throw new Error("Cursor behind last entry");
2437
- }, ee.stop();
2437
+ }, te.stop();
2438
2438
  }
2439
2439
  var Bn = new Promise(function(Ie, bt) {
2440
- Ie = ge(Ie), $.onerror = Ue(bt), ee.fail = bt, ee.stop = function(fr) {
2441
- ee.stop = ee.continue = ee.continuePrimaryKey = ee.advance = _e, Ie(fr);
2440
+ Ie = ge(Ie), $.onerror = Ue(bt), te.fail = bt, te.stop = function(fr) {
2441
+ te.stop = te.continue = te.continuePrimaryKey = te.advance = _e, Ie(fr);
2442
2442
  };
2443
2443
  });
2444
2444
  return $.onsuccess = ge(function(Ie) {
2445
2445
  $.onsuccess = Oe, Oe();
2446
- }), ee.continue = re, ee.continuePrimaryKey = ce, ee.advance = ne, Oe(), Bn;
2447
- }, j(ee)) : j(null);
2446
+ }), te.continue = ae, te.continuePrimaryKey = ce, te.advance = ne, Oe(), Bn;
2447
+ }, j(te)) : j(null);
2448
2448
  }, U);
2449
2449
  });
2450
2450
  }, count: function(x) {
2451
2451
  var E = x.query, N = x.trans, D = E.index, S = E.range;
2452
- return new Promise(function(F, j) {
2452
+ return new Promise(function(k, j) {
2453
2453
  var U = N.objectStore(A), K = D.isPrimaryKey ? U : U.index(D.name), U = r(S), K = U ? K.count(U) : K.count();
2454
2454
  K.onsuccess = ge(function(L) {
2455
- return F(L.target.result);
2455
+ return k(L.target.result);
2456
2456
  }), K.onerror = Ue(j);
2457
2457
  });
2458
2458
  } };
@@ -2462,9 +2462,9 @@ function xo() {
2462
2462
  }).map(function(T) {
2463
2463
  var _ = T.keyPath, E = T.autoIncrement, A = b(_), x = {}, E = { name: T.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: _ == null, compound: A, keyPath: _, autoIncrement: E, unique: !0, extractKey: Wn(_) }, indexes: Mr(T.indexNames).map(function(N) {
2464
2464
  return T.index(N);
2465
- }).map(function(F) {
2466
- var D = F.name, S = F.unique, j = F.multiEntry, F = F.keyPath, j = { name: D, compound: b(F), keyPath: F, unique: S, multiEntry: j, extractKey: Wn(F) };
2467
- return x[Xt(F)] = j;
2465
+ }).map(function(k) {
2466
+ var D = k.name, S = k.unique, j = k.multiEntry, k = k.keyPath, j = { name: D, compound: b(k), keyPath: k, unique: S, multiEntry: j, extractKey: Wn(k) };
2467
+ return x[Xt(k)] = j;
2468
2468
  }), getIndexByKeyPath: function(N) {
2469
2469
  return x[Xt(N)];
2470
2470
  } };
@@ -2497,7 +2497,7 @@ function xo() {
2497
2497
  var i = r[a];
2498
2498
  t.forEach(function(d) {
2499
2499
  var p = (function v(C, w) {
2500
- return J(C, w) || (C = P(C)) && v(C, w);
2500
+ return Z(C, w) || (C = P(C)) && v(C, w);
2501
2501
  })(d, a);
2502
2502
  (!p || "value" in p && p.value === void 0) && (d === e.Transaction.prototype || d instanceof e.Transaction ? M(d, a, { get: function() {
2503
2503
  return this.table(a);
@@ -2531,17 +2531,17 @@ function xo() {
2531
2531
  x.push(function() {
2532
2532
  var D = E, S = N._cfg.dbschema;
2533
2533
  yn(g, D, A), yn(g, S, A), E = g._dbSchema = S;
2534
- var F = zn(D, S);
2535
- F.add.forEach(function(V) {
2536
- Qn(A, V[0], V[1].primKey, V[1].indexes);
2537
- }), F.change.forEach(function(V) {
2538
- if (V.recreate) throw new O.Upgrade("Not yet support for changing primary key");
2539
- var $ = A.objectStore(V.name);
2540
- V.add.forEach(function(W) {
2534
+ var k = zn(D, S);
2535
+ k.add.forEach(function(G) {
2536
+ Qn(A, G[0], G[1].primKey, G[1].indexes);
2537
+ }), k.change.forEach(function(G) {
2538
+ if (G.recreate) throw new O.Upgrade("Not yet support for changing primary key");
2539
+ var $ = A.objectStore(G.name);
2540
+ G.add.forEach(function(W) {
2541
2541
  return pn($, W);
2542
- }), V.change.forEach(function(W) {
2542
+ }), G.change.forEach(function(W) {
2543
2543
  $.deleteIndex(W.name), pn($, W);
2544
- }), V.del.forEach(function(W) {
2544
+ }), G.del.forEach(function(W) {
2545
2545
  return $.deleteIndex(W);
2546
2546
  });
2547
2547
  });
@@ -2549,21 +2549,21 @@ function xo() {
2549
2549
  if (j && N._cfg.version > T) {
2550
2550
  hn(g, A), _._memoizedTables = {};
2551
2551
  var U = Re(S);
2552
- F.del.forEach(function(V) {
2553
- U[V] = D[V];
2552
+ k.del.forEach(function(G) {
2553
+ U[G] = D[G];
2554
2554
  }), Yn(g, [g.Transaction.prototype]), mn(g, [g.Transaction.prototype], y(U), U), _.schema = U;
2555
2555
  var K, L = je(j);
2556
- return L && xt(), F = X.follow(function() {
2557
- var V;
2558
- (K = j(_)) && L && (V = nt.bind(null, null), K.then(V, V));
2559
- }), K && typeof K.then == "function" ? X.resolve(K) : F.then(function() {
2556
+ return L && xt(), k = X.follow(function() {
2557
+ var G;
2558
+ (K = j(_)) && L && (G = nt.bind(null, null), K.then(G, G));
2559
+ }), K && typeof K.then == "function" ? X.resolve(K) : k.then(function() {
2560
2560
  return K;
2561
2561
  });
2562
2562
  }
2563
2563
  }), x.push(function(D) {
2564
- var S, F, j = N._cfg.dbschema;
2565
- S = j, F = D, [].slice.call(F.db.objectStoreNames).forEach(function(U) {
2566
- return S[U] == null && F.db.deleteObjectStore(U);
2564
+ var S, k, j = N._cfg.dbschema;
2565
+ S = j, k = D, [].slice.call(k.db.objectStoreNames).forEach(function(U) {
2566
+ return S[U] == null && k.db.deleteObjectStore(U);
2567
2567
  }), Yn(g, [g.Transaction.prototype]), mn(g, [g.Transaction.prototype], g._storeNames, g._dbSchema), _.schema = g._dbSchema;
2568
2568
  }), x.push(function(D) {
2569
2569
  g.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(g.idbdb.version / 10) === N._cfg.version ? (g.idbdb.deleteObjectStore("$meta"), delete g._dbSchema.$meta, g._storeNames = g._storeNames.filter(function(S) {
@@ -2637,7 +2637,7 @@ function xo() {
2637
2637
  function gn(e, t, n) {
2638
2638
  var r = {};
2639
2639
  return ye(t.objectStoreNames, 0).forEach(function(a) {
2640
- for (var i = n.objectStore(a), d = Gn(kr(C = i.keyPath), C || "", !0, !1, !!i.autoIncrement, C && typeof C != "string", !0), p = [], v = 0; v < i.indexNames.length; ++v) {
2640
+ for (var i = n.objectStore(a), d = Gn(Fr(C = i.keyPath), C || "", !0, !1, !!i.autoIncrement, C && typeof C != "string", !0), p = [], v = 0; v < i.indexNames.length; ++v) {
2641
2641
  var w = i.index(i.indexNames[v]), C = w.keyPath, w = Gn(w.name, C, !!w.unique, !!w.multiEntry, !1, C && typeof C != "string", !1);
2642
2642
  p.push(w);
2643
2643
  }
@@ -2682,7 +2682,7 @@ function xo() {
2682
2682
  R(r, i._cfg.storesSource), a = i._cfg.dbschema = {}, i._parseStoresSpec(r, a);
2683
2683
  }), t._dbSchema = a, Yn(t, [t._allTables, t, t.Transaction.prototype]), mn(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], y(a), a), t._storeNames = y(a), this;
2684
2684
  }, Rt.prototype.upgrade = function(e) {
2685
- return this._cfg.contentUpgrade = wt(this._cfg.contentUpgrade || Z, e), this;
2685
+ return this._cfg.contentUpgrade = wt(this._cfg.contentUpgrade || J, e), this;
2686
2686
  }, Rt);
2687
2687
  function Rt() {
2688
2688
  }
@@ -2766,7 +2766,7 @@ function xo() {
2766
2766
  return y(t).forEach(function(n) {
2767
2767
  e[n] ? Yt(e[n], t[n]) : e[n] = (function r(a) {
2768
2768
  var i, d, p = {};
2769
- for (i in a) G(a, i) && (d = a[i], p[i] = !d || typeof d != "object" || ze.has(d.constructor) ? d : r(d));
2769
+ for (i in a) V(a, i) && (d = a[i], p[i] = !d || typeof d != "object" || ze.has(d.constructor) ? d : r(d));
2770
2770
  return p;
2771
2771
  })(t[n]);
2772
2772
  }), e;
@@ -2846,11 +2846,11 @@ function xo() {
2846
2846
  })) : (w.onerror = Ue(_), E = E.oldVersion > Math.pow(2, 62) ? 0 : E.oldVersion, g = E < 1, e.idbdb = x.result, i && $a(e, w), Ua(e, E / 10, w, _));
2847
2847
  }, _), x.onsuccess = ge(function() {
2848
2848
  w = null;
2849
- var E, N, D, S, F, j = e.idbdb = x.result, U = ye(j.objectStoreNames);
2849
+ var E, N, D, S, k, j = e.idbdb = x.result, U = ye(j.objectStoreNames);
2850
2850
  if (0 < U.length) try {
2851
2851
  var K = j.transaction((S = U).length === 1 ? S[0] : S, "readonly");
2852
2852
  if (t.autoSchema) N = j, D = K, (E = e).verno = N.version / 10, D = E._dbSchema = gn(0, N, D), E._storeNames = ye(N.objectStoreNames, 0), mn(E, [E._allTables], y(D), D);
2853
- else if (yn(e, e._dbSchema, K), ((F = zn(gn(0, (F = e).idbdb, K), F._dbSchema)).add.length || F.change.some(function(L) {
2853
+ else if (yn(e, e._dbSchema, K), ((k = zn(gn(0, (k = e).idbdb, K), k._dbSchema)).add.length || k.change.some(function(L) {
2854
2854
  return L.add.length || L.change.length;
2855
2855
  })) && !i) 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, i = !0, T(p());
2856
2856
  hn(e, K);
@@ -2860,7 +2860,7 @@ function xo() {
2860
2860
  t.vcFired = !0, e.on("versionchange").fire(L);
2861
2861
  }), j.onclose = ge(function(L) {
2862
2862
  e.on("close").fire(L);
2863
- }), g && (F = e._deps, K = A, j = F.indexedDB, F = F.IDBKeyRange, Zn(j) || K === sn || Hn(j, F).put({ name: K }).catch(Z)), T();
2863
+ }), g && (k = e._deps, K = A, j = k.indexedDB, k = k.IDBKeyRange, Zn(j) || K === sn || Hn(j, k).put({ name: K }).catch(J)), T();
2864
2864
  }, _);
2865
2865
  }).catch(function(T) {
2866
2866
  switch (T?.name) {
@@ -2886,7 +2886,7 @@ function xo() {
2886
2886
  return e.on.ready.fire(e.vip);
2887
2887
  })).then(function T() {
2888
2888
  if (0 < t.onReadyBeingFired.length) {
2889
- var _ = t.onReadyBeingFired.reduce(wt, Z);
2889
+ var _ = t.onReadyBeingFired.reduce(wt, J);
2890
2890
  return t.onReadyBeingFired = [], X.resolve(Jn(function() {
2891
2891
  return _(e.vip);
2892
2892
  })).then(T);
@@ -2980,9 +2980,9 @@ function xo() {
2980
2980
  function ir(e, t, n, r) {
2981
2981
  return n = n || {}, r = r || "", y(e).forEach(function(a) {
2982
2982
  var i, d, p;
2983
- G(t, a) ? (i = e[a], d = t[a], typeof i == "object" && typeof d == "object" && i && d ? (p = Ve(i)) !== Ve(d) ? n[r + a] = t[a] : p === "Object" ? ir(i, d, n, r + a + ".") : i !== d && (n[r + a] = t[a]) : i !== d && (n[r + a] = t[a])) : n[r + a] = void 0;
2983
+ V(t, a) ? (i = e[a], d = t[a], typeof i == "object" && typeof d == "object" && i && d ? (p = Ve(i)) !== Ve(d) ? n[r + a] = t[a] : p === "Object" ? ir(i, d, n, r + a + ".") : i !== d && (n[r + a] = t[a]) : i !== d && (n[r + a] = t[a])) : n[r + a] = void 0;
2984
2984
  }), y(t).forEach(function(a) {
2985
- G(e, a) || (n[r + a] = t[a]);
2985
+ V(e, a) || (n[r + a] = t[a]);
2986
2986
  }), n;
2987
2987
  }
2988
2988
  function sr(e, t) {
@@ -2995,22 +2995,22 @@ function xo() {
2995
2995
  var i = Q.trans, d = i.table(t).hook, p = d.deleting, v = d.creating, C = d.updating;
2996
2996
  switch (a.type) {
2997
2997
  case "add":
2998
- if (v.fire === Z) break;
2998
+ if (v.fire === J) break;
2999
2999
  return i._promise("readwrite", function() {
3000
3000
  return w(a);
3001
3001
  }, !0);
3002
3002
  case "put":
3003
- if (v.fire === Z && C.fire === Z) break;
3003
+ if (v.fire === J && C.fire === J) break;
3004
3004
  return i._promise("readwrite", function() {
3005
3005
  return w(a);
3006
3006
  }, !0);
3007
3007
  case "delete":
3008
- if (p.fire === Z) break;
3008
+ if (p.fire === J) break;
3009
3009
  return i._promise("readwrite", function() {
3010
3010
  return w(a);
3011
3011
  }, !0);
3012
3012
  case "deleteRange":
3013
- if (p.fire === Z) break;
3013
+ if (p.fire === J) break;
3014
3014
  return i._promise("readwrite", function() {
3015
3015
  return (function g(T, _, A) {
3016
3016
  return n.query({ trans: T, values: !1, query: { index: r, range: _ }, limit: A }).then(function(x) {
@@ -3027,21 +3027,21 @@ function xo() {
3027
3027
  var T, _, A, x = Q.trans, E = g.keys || sr(r, g);
3028
3028
  if (!E) throw new Error("Keys missing");
3029
3029
  return (g = g.type === "add" || g.type === "put" ? o(o({}, g), { keys: E }) : o({}, g)).type !== "delete" && (g.values = h([], g.values)), g.keys && (g.keys = h([], g.keys)), T = n, A = E, ((_ = g).type === "add" ? Promise.resolve([]) : T.getMany({ trans: _.trans, keys: A, cache: "immutable" })).then(function(N) {
3030
- var D = E.map(function(S, F) {
3031
- var j, U, K, L = N[F], V = { onerror: null, onsuccess: null };
3032
- return g.type === "delete" ? p.fire.call(V, S, L, x) : g.type === "add" || L === void 0 ? (j = v.fire.call(V, S, g.values[F], x), S == null && j != null && (g.keys[F] = S = j, r.outbound || ae(g.values[F], r.keyPath, S))) : (j = ir(L, g.values[F]), (U = C.fire.call(V, j, S, L, x)) && (K = g.values[F], Object.keys(U).forEach(function($) {
3033
- G(K, $) ? K[$] = U[$] : ae(K, $, U[$]);
3034
- }))), V;
3030
+ var D = E.map(function(S, k) {
3031
+ var j, U, K, L = N[k], G = { onerror: null, onsuccess: null };
3032
+ return g.type === "delete" ? p.fire.call(G, S, L, x) : g.type === "add" || L === void 0 ? (j = v.fire.call(G, S, g.values[k], x), S == null && j != null && (g.keys[k] = S = j, r.outbound || oe(g.values[k], r.keyPath, S))) : (j = ir(L, g.values[k]), (U = C.fire.call(G, j, S, L, x)) && (K = g.values[k], Object.keys(U).forEach(function($) {
3033
+ V(K, $) ? K[$] = U[$] : oe(K, $, U[$]);
3034
+ }))), G;
3035
3035
  });
3036
3036
  return n.mutate(g).then(function(S) {
3037
- for (var F = S.failures, j = S.results, U = S.numFailures, S = S.lastResult, K = 0; K < E.length; ++K) {
3038
- var L = (j || E)[K], V = D[K];
3039
- L == null ? V.onerror && V.onerror(F[K]) : V.onsuccess && V.onsuccess(g.type === "put" && N[K] ? g.values[K] : L);
3037
+ for (var k = S.failures, j = S.results, U = S.numFailures, S = S.lastResult, K = 0; K < E.length; ++K) {
3038
+ var L = (j || E)[K], G = D[K];
3039
+ L == null ? G.onerror && G.onerror(k[K]) : G.onsuccess && G.onsuccess(g.type === "put" && N[K] ? g.values[K] : L);
3040
3040
  }
3041
- return { failures: F, results: j, numFailures: U, lastResult: S };
3041
+ return { failures: k, results: j, numFailures: U, lastResult: S };
3042
3042
  }).catch(function(S) {
3043
- return D.forEach(function(F) {
3044
- return F.onerror && F.onerror(S);
3043
+ return D.forEach(function(k) {
3044
+ return k.onerror && k.onerror(S);
3045
3045
  }), Promise.reject(S);
3046
3046
  });
3047
3047
  });
@@ -3098,12 +3098,12 @@ function xo() {
3098
3098
  function A($) {
3099
3099
  return $ = "idb://".concat(t, "/").concat(r, "/").concat($), S[$] || (S[$] = new Te());
3100
3100
  }
3101
- var x, E, N, D = _.trans, S = _.mutatedParts || (_.mutatedParts = {}), F = A(""), j = A(":dels"), U = _.type, V = _.type === "deleteRange" ? [_.range] : _.type === "delete" ? [_.keys] : _.values.length < 50 ? [sr(d, _).filter(function($) {
3101
+ var x, E, N, D = _.trans, S = _.mutatedParts || (_.mutatedParts = {}), k = A(""), j = A(":dels"), U = _.type, G = _.type === "deleteRange" ? [_.range] : _.type === "delete" ? [_.keys] : _.values.length < 50 ? [sr(d, _).filter(function($) {
3102
3102
  return $;
3103
- }), _.values] : [], K = V[0], L = V[1], V = _.trans._cache;
3104
- return b(K) ? (F.addKeys(K), (V = U === "delete" || K.length === L.length ? Vr(K, V) : null) || j.addKeys(K), (V || L) && (x = A, E = V, N = L, i.indexes.forEach(function($) {
3103
+ }), _.values] : [], K = G[0], L = G[1], G = _.trans._cache;
3104
+ return b(K) ? (k.addKeys(K), (G = U === "delete" || K.length === L.length ? Vr(K, G) : null) || j.addKeys(K), (G || L) && (x = A, E = G, N = L, i.indexes.forEach(function($) {
3105
3105
  var W = x($.name || "");
3106
- function re(ne) {
3106
+ function ae(ne) {
3107
3107
  return ne != null ? $.extractKey(ne) : null;
3108
3108
  }
3109
3109
  function ce(ne) {
@@ -3112,19 +3112,19 @@ function xo() {
3112
3112
  }) : W.addKey(ne);
3113
3113
  }
3114
3114
  (E || N).forEach(function(ne, Ne) {
3115
- var ee = E && re(E[Ne]), Ne = N && re(N[Ne]);
3116
- se(ee, Ne) !== 0 && (ee != null && ce(ee), Ne != null && ce(Ne));
3115
+ var te = E && ae(E[Ne]), Ne = N && ae(N[Ne]);
3116
+ se(te, Ne) !== 0 && (te != null && ce(te), Ne != null && ce(Ne));
3117
3117
  });
3118
- }))) : K ? (L = { from: (L = K.lower) !== null && L !== void 0 ? L : e.MIN_KEY, to: (L = K.upper) !== null && L !== void 0 ? L : e.MAX_KEY }, j.add(L), F.add(L)) : (F.add(n), j.add(n), i.indexes.forEach(function($) {
3118
+ }))) : K ? (L = { from: (L = K.lower) !== null && L !== void 0 ? L : e.MIN_KEY, to: (L = K.upper) !== null && L !== void 0 ? L : e.MAX_KEY }, j.add(L), k.add(L)) : (k.add(n), j.add(n), i.indexes.forEach(function($) {
3119
3119
  return A($.name).add(n);
3120
3120
  })), a.mutate(_).then(function($) {
3121
- return !K || _.type !== "add" && _.type !== "put" || (F.addKeys($.results), C && C.forEach(function(W) {
3122
- for (var re = _.values.map(function(ee) {
3123
- return W.extractKey(ee);
3124
- }), ce = W.keyPath.findIndex(function(ee) {
3125
- return ee === d.keyPath;
3126
- }), ne = 0, _e = $.results.length; ne < _e; ++ne) re[ne][ce] = $.results[ne];
3127
- A(W.name).addKeys(re);
3121
+ return !K || _.type !== "add" && _.type !== "put" || (k.addKeys($.results), C && C.forEach(function(W) {
3122
+ for (var ae = _.values.map(function(te) {
3123
+ return W.extractKey(te);
3124
+ }), ce = W.keyPath.findIndex(function(te) {
3125
+ return te === d.keyPath;
3126
+ }), ne = 0, _e = $.results.length; ne < _e; ++ne) ae[ne][ce] = $.results[ne];
3127
+ A(W.name).addKeys(ae);
3128
3128
  })), D.mutatedParts = _n(D.mutatedParts || {}, S), $;
3129
3129
  });
3130
3130
  } }), g = function(A) {
@@ -3141,24 +3141,24 @@ function xo() {
3141
3141
  if (E) {
3142
3142
  var D = function(L) {
3143
3143
  return L = "idb://".concat(t, "/").concat(r, "/").concat(L), N[L] || (N[L] = new Te());
3144
- }, S = D(""), F = D(":dels"), x = T[_](A), E = x[0], x = x[1];
3145
- if ((_ === "query" && E.isPrimaryKey && !A.values ? F : D(E.name || "")).add(x), !E.isPrimaryKey) {
3144
+ }, S = D(""), k = D(":dels"), x = T[_](A), E = x[0], x = x[1];
3145
+ if ((_ === "query" && E.isPrimaryKey && !A.values ? k : D(E.name || "")).add(x), !E.isPrimaryKey) {
3146
3146
  if (_ !== "count") {
3147
3147
  var j = _ === "query" && v && A.values && a.query(o(o({}, A), { values: !1 }));
3148
3148
  return a[_].apply(this, arguments).then(function(L) {
3149
3149
  if (_ === "query") {
3150
- if (v && A.values) return j.then(function(re) {
3151
- return re = re.result, S.addKeys(re), L;
3150
+ if (v && A.values) return j.then(function(ae) {
3151
+ return ae = ae.result, S.addKeys(ae), L;
3152
3152
  });
3153
- var V = A.values ? L.result.map(p) : L.result;
3154
- (A.values ? S : F).addKeys(V);
3153
+ var G = A.values ? L.result.map(p) : L.result;
3154
+ (A.values ? S : k).addKeys(G);
3155
3155
  } else if (_ === "openCursor") {
3156
3156
  var $ = L, W = A.values;
3157
3157
  return $ && Object.create($, { key: { get: function() {
3158
- return F.addKey($.primaryKey), $.key;
3158
+ return k.addKey($.primaryKey), $.key;
3159
3159
  } }, primaryKey: { get: function() {
3160
- var re = $.primaryKey;
3161
- return F.addKey(re), re;
3160
+ var ae = $.primaryKey;
3161
+ return k.addKey(ae), ae;
3162
3162
  } }, value: { get: function() {
3163
3163
  return W && S.addKey($.primaryKey), $.value;
3164
3164
  } } });
@@ -3166,7 +3166,7 @@ function xo() {
3166
3166
  return L;
3167
3167
  });
3168
3168
  }
3169
- F.add(n);
3169
+ k.add(n);
3170
3170
  }
3171
3171
  }
3172
3172
  return a[_].apply(this, arguments);
@@ -3193,10 +3193,10 @@ function xo() {
3193
3193
  var d = t.query.index, p = d.multiEntry, v = t.query.range, C = r.schema.primaryKey.extractKey, w = d.extractKey, g = (d.lowLevelIndex || d).extractKey, T = T.reduce(function(_, A) {
3194
3194
  var x = _, E = [];
3195
3195
  if (A.type === "add" || A.type === "put") for (var N = new Te(), D = A.values.length - 1; 0 <= D; --D) {
3196
- var S, F = A.values[D], j = C(F);
3197
- N.hasKey(j) || (S = w(F), (p && b(S) ? S.some(function($) {
3196
+ var S, k = A.values[D], j = C(k);
3197
+ N.hasKey(j) || (S = w(k), (p && b(S) ? S.some(function($) {
3198
3198
  return ur($, v);
3199
- }) : ur(S, v)) && (N.addKey(j), E.push(F)));
3199
+ }) : ur(S, v)) && (N.addKey(j), E.push(k)));
3200
3200
  }
3201
3201
  switch (A.type) {
3202
3202
  case "add":
@@ -3227,9 +3227,9 @@ function xo() {
3227
3227
  });
3228
3228
  break;
3229
3229
  case "deleteRange":
3230
- var V = A.range;
3230
+ var G = A.range;
3231
3231
  x = _.filter(function(W) {
3232
- return !ur(C(W), V);
3232
+ return !ur(C(W), G);
3233
3233
  });
3234
3234
  }
3235
3235
  return x;
@@ -3290,7 +3290,7 @@ function xo() {
3290
3290
  _.optimisticOps = _.optimisticOps.filter(function(W) {
3291
3291
  return W.trans !== p;
3292
3292
  });
3293
- for (var F = 0, j = Object.values(_.queries.query); F < j.length; F++) for (var U, K, L, V = 0, $ = (U = j[F]).slice(); V < $.length; V++) (K = $[V]).res != null && p.mutatedParts && (v && !K.dirty ? (L = Object.isFrozen(K.res), L = Yr(K.res, K.req, x, A, K, L), K.dirty ? (Ge(U, K), K.subscribers.forEach(function(W) {
3293
+ for (var k = 0, j = Object.values(_.queries.query); k < j.length; k++) for (var U, K, L, G = 0, $ = (U = j[k]).slice(); G < $.length; G++) (K = $[G]).res != null && p.mutatedParts && (v && !K.dirty ? (L = Object.isFrozen(K.res), L = Yr(K.res, K.req, x, A, K, L), K.dirty ? (Ge(U, K), K.subscribers.forEach(function(W) {
3294
3294
  return C.add(W);
3295
3295
  })) : L !== K.res && (K.res = L, K.promise = X.resolve({ result: L }))) : (K.dirty && Ge(U, K), K.subscribers.forEach(function(W) {
3296
3296
  return C.add(W);
@@ -3319,7 +3319,7 @@ function xo() {
3319
3319
  })) : d.then(function(v) {
3320
3320
  var C = Wr(0, o(o({}, i), { values: i.values.map(function(w, g) {
3321
3321
  var T;
3322
- return v.failures[g] ? w : (w = (T = a.keyPath) !== null && T !== void 0 && T.includes(".") ? Se(w) : o({}, w), ae(w, a.keyPath, v.results[g]), w);
3322
+ return v.failures[g] ? w : (w = (T = a.keyPath) !== null && T !== void 0 && T.includes(".") ? Se(w) : o({}, w), oe(w, a.keyPath, v.results[g]), w);
3323
3323
  }) }), v);
3324
3324
  p.optimisticOps.push(C), queueMicrotask(function() {
3325
3325
  return i.mutatedParts && bn(i.mutatedParts);
@@ -3335,16 +3335,16 @@ function xo() {
3335
3335
  if (!S) return [null, !1, D, null];
3336
3336
  switch (E) {
3337
3337
  case "query":
3338
- var F = S.find(function(j) {
3338
+ var k = S.find(function(j) {
3339
3339
  return j.req.limit === N.limit && j.req.values === N.values && zr(j.req.query.range, N.query.range);
3340
3340
  });
3341
- return F ? [F, !0, D, S] : [S.find(function(j) {
3341
+ return k ? [k, !0, D, S] : [S.find(function(j) {
3342
3342
  return ("limit" in j.req ? j.req.limit : 1 / 0) >= N.limit && (!N.values || j.req.values) && Qa(j.req.query.range, N.query.range);
3343
3343
  }), !1, D, S];
3344
3344
  case "count":
3345
- return F = S.find(function(j) {
3345
+ return k = S.find(function(j) {
3346
3346
  return zr(j.req.query.range, N.query.range);
3347
- }), [F, !!F, D, S];
3347
+ }), [k, !!k, D, S];
3348
3348
  }
3349
3349
  })(t, n, "query", i), w = C[0], g = C[1], T = C[2], _ = C[3];
3350
3350
  return w && g ? w.obsSet = i.obsSet : (g = r.query(i).then(function(A) {
@@ -3381,7 +3381,7 @@ function xo() {
3381
3381
  if (t._state.openComplete) return r(new O.DatabaseClosed(t._state.dbOpenError));
3382
3382
  if (!t._state.isBeingOpened) {
3383
3383
  if (!t._state.autoOpen) return void r(new O.DatabaseClosed());
3384
- t.open().catch(Z);
3384
+ t.open().catch(J);
3385
3385
  }
3386
3386
  t._state.dbReadyPromise.then(n, r);
3387
3387
  }).then(e);
@@ -3428,7 +3428,7 @@ function xo() {
3428
3428
  var p = t._deps.indexedDB.deleteDatabase(t.name);
3429
3429
  p.onsuccess = ge(function() {
3430
3430
  var v, C, w;
3431
- v = t._deps, C = t.name, w = v.indexedDB, v = v.IDBKeyRange, Zn(w) || C === sn || Hn(w, v).delete(C).catch(Z), a();
3431
+ v = t._deps, C = t.name, w = v.indexedDB, v = v.IDBKeyRange, Zn(w) || C === sn || Hn(w, v).delete(C).catch(J), a();
3432
3432
  }), p.onerror = Ue(i), p.onblocked = t._fireOnBlocked;
3433
3433
  }
3434
3434
  if (n) throw new O.InvalidArgument("Invalid closeOptions argument to db.delete()");
@@ -3521,7 +3521,7 @@ function xo() {
3521
3521
  return r._whenReady(v);
3522
3522
  }) : this._whenReady(v);
3523
3523
  }, Ce.prototype.table = function(e) {
3524
- if (!G(this._allTables, e)) throw new O.InvalidTable("Table ".concat(e, " does not exist"));
3524
+ if (!V(this._allTables, e)) throw new O.InvalidTable("Table ".concat(e, " does not exist"));
3525
3525
  return this._allTables[e];
3526
3526
  }, Ce);
3527
3527
  function Ce(e, t) {
@@ -3529,18 +3529,18 @@ function xo() {
3529
3529
  this._middlewares = {}, this.verno = 0;
3530
3530
  var r = Ce.dependencies;
3531
3531
  this._options = t = o({ addons: Ce.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;
3532
- var a, i, d, p, v, C = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: Z, dbReadyPromise: null, cancelOpen: Z, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
3532
+ var a, i, d, p, v, C = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: J, dbReadyPromise: null, cancelOpen: J, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
3533
3533
  C.dbReadyPromise = new X(function(g) {
3534
3534
  C.dbReadyResolve = g;
3535
3535
  }), C.openCanceller = new X(function(g, T) {
3536
3536
  C.cancelOpen = T;
3537
- }), this._state = C, this.name = e, this.on = qt(this, "populate", "blocked", "versionchange", "close", { ready: [wt, Z] }), this.once = function(g, T) {
3537
+ }), this._state = C, this.name = e, this.on = qt(this, "populate", "blocked", "versionchange", "close", { ready: [wt, J] }), this.once = function(g, T) {
3538
3538
  var _ = function() {
3539
3539
  for (var A = [], x = 0; x < arguments.length; x++) A[x] = arguments[x];
3540
3540
  n.on(g).unsubscribe(_), T.apply(n, A);
3541
3541
  };
3542
3542
  return n.on(g, _);
3543
- }, this.on.ready.subscribe = te(this.on.ready.subscribe, function(g) {
3543
+ }, this.on.ready.subscribe = ee(this.on.ready.subscribe, function(g) {
3544
3544
  return function(T, _) {
3545
3545
  Ce.vip(function() {
3546
3546
  var A, x = n._state;
@@ -3560,7 +3560,7 @@ function xo() {
3560
3560
  var x = N._ctx, E = x.table, N = E.hook.reading.fire;
3561
3561
  this._ctx = { table: E, index: x.index, isPrimKey: !x.index || E.schema.primKey.keyPath && x.index === E.schema.primKey.name, range: _, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: A, or: x.or, valueMapper: N !== he ? N : null };
3562
3562
  })), this.Table = (i = this, Lt(Or.prototype, function(g, T, _) {
3563
- this.db = i, this._tx = _, this.name = g, this.schema = T, this.hook = i._allTables[g] ? i._allTables[g].hook : qt(null, { creating: [Je, Z], reading: [xe, he], updating: [Ke, Z], deleting: [Ae, Z] });
3563
+ this.db = i, this._tx = _, this.name = g, this.schema = T, this.hook = i._allTables[g] ? i._allTables[g].hook : qt(null, { creating: [Je, J], reading: [xe, he], updating: [Ke, J], deleting: [Ae, J] });
3564
3564
  })), this.Transaction = (d = this, Lt(Ma.prototype, function(g, T, _, A, x) {
3565
3565
  var E = this;
3566
3566
  g !== "readonly" && T.forEach(function(N) {
@@ -3577,7 +3577,7 @@ function xo() {
3577
3577
  });
3578
3578
  })), this.Version = (p = this, Lt(Va.prototype, function(g) {
3579
3579
  this.db = p, this._cfg = { version: g, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
3580
- })), this.WhereClause = (v = this, Lt(Fr.prototype, function(g, T, _) {
3580
+ })), this.WhereClause = (v = this, Lt(kr.prototype, function(g, T, _) {
3581
3581
  if (this.db = v, this._ctx = { table: g, index: T === ":id" ? null : T, or: _ }, this._cmp = this._ascending = se, this._descending = function(A, x) {
3582
3582
  return se(x, A);
3583
3583
  }, this._max = function(A, x) {
@@ -3645,14 +3645,14 @@ function xo() {
3645
3645
  var S = Bt();
3646
3646
  try {
3647
3647
  i && xt();
3648
- var F = tt(e, D);
3649
- return F = i ? F.finally(nt) : F;
3648
+ var k = tt(e, D);
3649
+ return k = i ? k.finally(nt) : k;
3650
3650
  } finally {
3651
3651
  S && Et();
3652
3652
  }
3653
3653
  })(E = { subscr: x, signal: d.signal, requery: T, querier: e, trans: null }), Promise.resolve(N).then(function(D) {
3654
3654
  n = !0, t = D, p || E.signal.aborted || (v = {}, (function(S) {
3655
- for (var F in S) if (G(S, F)) return;
3655
+ for (var k in S) if (V(S, k)) return;
3656
3656
  return 1;
3657
3657
  })(C = x) || g || (ot(Vt, _), g = !0), Kn(function() {
3658
3658
  return !p && a.next && a.next(D);
@@ -3730,12 +3730,12 @@ function xo() {
3730
3730
  }, Promise: X, debug: { get: function() {
3731
3731
  return De;
3732
3732
  }, set: function(e) {
3733
- Ft(e);
3734
- } }, derive: k, extend: R, props: z, override: te, Events: qt, on: ot, liveQuery: Qr, extendObservabilitySet: _n, getByKeyPath: pe, setByKeyPath: ae, delByKeyPath: function(e, t) {
3735
- typeof t == "string" ? ae(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
3736
- ae(e, n, void 0);
3733
+ kt(e);
3734
+ } }, derive: F, extend: R, props: z, override: ee, Events: qt, on: ot, liveQuery: Qr, extendObservabilitySet: _n, getByKeyPath: pe, setByKeyPath: oe, delByKeyPath: function(e, t) {
3735
+ typeof t == "string" ? oe(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
3736
+ oe(e, n, void 0);
3737
3737
  });
3738
- }, shallowClone: Re, deepClone: Se, getObjectDiff: ir, cmp: se, asap: oe, minKey: -1 / 0, addons: [], connections: Tt, errnames: f, dependencies: wn, cache: vt, semVer: "4.2.0", version: "4.2.0".split(".").map(function(e) {
3738
+ }, shallowClone: Re, deepClone: Se, getObjectDiff: ir, cmp: se, asap: ie, minKey: -1 / 0, addons: [], connections: Tt, errnames: f, dependencies: wn, cache: vt, semVer: "4.2.0", version: "4.2.0".split(".").map(function(e) {
3739
3739
  return parseInt(e);
3740
3740
  }).reduce(function(e, t, n) {
3741
3741
  return e + t / Math.pow(10, 2 * n);
@@ -3763,7 +3763,7 @@ function xo() {
3763
3763
  return !e || e instanceof Qe || e instanceof TypeError || e instanceof SyntaxError || !e.name || !B[e.name] ? e : (t = new B[e.name](t || e.message, e), "stack" in e && M(t, "stack", { get: function() {
3764
3764
  return this.inner.stack;
3765
3765
  } }), t);
3766
- }, Ft(De), o(We, Object.freeze({ __proto__: null, Dexie: We, liveQuery: Qr, Entity: xr, cmp: se, PropModification: Ut, replacePrefix: function(e, t) {
3766
+ }, kt(De), o(We, Object.freeze({ __proto__: null, Dexie: We, liveQuery: Qr, Entity: xr, cmp: se, PropModification: Ut, replacePrefix: function(e, t) {
3767
3767
  return new Ut({ replacePrefix: [e, t] });
3768
3768
  }, add: function(e) {
3769
3769
  return new Ut({ add: e });
@@ -3892,7 +3892,7 @@ const st = {
3892
3892
  updateEndingProgress: Po,
3893
3893
  setComplete: So
3894
3894
  };
3895
- function Fo() {
3895
+ function ko() {
3896
3896
  return On;
3897
3897
  }
3898
3898
  function ya() {
@@ -3902,7 +3902,7 @@ function ya() {
3902
3902
  progress: null
3903
3903
  });
3904
3904
  }
3905
- function ko(l) {
3905
+ function Fo(l) {
3906
3906
  ya();
3907
3907
  const { dialecteConfig: c, databaseInstance: u } = l, o = c.database.tables.xmlElements.name, h = c.rootElementName, m = Promise.resolve().then(
3908
3908
  async () => {
@@ -3962,9 +3962,9 @@ async function jo(l) {
3962
3962
  createRootIfEmpty: !0
3963
3963
  });
3964
3964
  return {
3965
- getState: Fo,
3965
+ getState: ko,
3966
3966
  getDatabaseInstance: () => o,
3967
- fromRoot: () => ko({ dialecteConfig: u, databaseInstance: o }),
3967
+ fromRoot: () => Fo({ dialecteConfig: u, databaseInstance: o }),
3968
3968
  fromElement: (h) => Mo({
3969
3969
  dialecteConfig: u,
3970
3970
  databaseInstance: o,
@@ -4057,7 +4057,7 @@ function Wo() {
4057
4057
  if (!(this instanceof o))
4058
4058
  return new o(f, s);
4059
4059
  var O = this;
4060
- m(O), O.q = O.c = "", O.bufferCheckPosition = c.MAX_BUFFER_LENGTH, O.opt = s || {}, O.opt.lowercase = O.opt.lowercase || O.opt.lowercasetags, O.looseCase = O.opt.lowercase ? "toLowerCase" : "toUpperCase", O.tags = [], O.closed = O.closedRoot = O.sawRoot = !1, O.tag = O.error = null, O.strict = !!f, O.noscript = !!(f || O.opt.noscript), O.state = I.BEGIN, O.strictEntities = O.opt.strictEntities, O.ENTITIES = O.strictEntities ? Object.create(c.XML_ENTITIES) : Object.create(c.ENTITIES), O.attribList = [], O.opt.xmlns && (O.ns = Object.create(k)), O.opt.unquotedAttributeValues === void 0 && (O.opt.unquotedAttributeValues = !f), O.trackPosition = O.opt.position !== !1, O.trackPosition && (O.position = O.line = O.column = 0), ze(O, "onready");
4060
+ m(O), O.q = O.c = "", O.bufferCheckPosition = c.MAX_BUFFER_LENGTH, O.opt = s || {}, O.opt.lowercase = O.opt.lowercase || O.opt.lowercasetags, O.looseCase = O.opt.lowercase ? "toLowerCase" : "toUpperCase", O.tags = [], O.closed = O.closedRoot = O.sawRoot = !1, O.tag = O.error = null, O.strict = !!f, O.noscript = !!(f || O.opt.noscript), O.state = I.BEGIN, O.strictEntities = O.opt.strictEntities, O.ENTITIES = O.strictEntities ? Object.create(c.XML_ENTITIES) : Object.create(c.ENTITIES), O.attribList = [], O.opt.xmlns && (O.ns = Object.create(F)), O.opt.unquotedAttributeValues === void 0 && (O.opt.unquotedAttributeValues = !f), O.trackPosition = O.opt.position !== !1, O.trackPosition && (O.position = O.line = O.column = 0), ze(O, "onready");
4061
4061
  }
4062
4062
  Object.create || (Object.create = function(f) {
4063
4063
  function s() {
@@ -4072,8 +4072,8 @@ function Wo() {
4072
4072
  });
4073
4073
  function h(f) {
4074
4074
  for (var s = Math.max(c.MAX_BUFFER_LENGTH, 10), O = 0, B = 0, ue = u.length; B < ue; B++) {
4075
- var Z = f[u[B]].length;
4076
- if (Z > s)
4075
+ var J = f[u[B]].length;
4076
+ if (J > s)
4077
4077
  switch (u[B]) {
4078
4078
  case "textNode":
4079
4079
  Se(f);
@@ -4087,7 +4087,7 @@ function Wo() {
4087
4087
  default:
4088
4088
  Ve(f, "Max buffer length exceeded: " + u[B]);
4089
4089
  }
4090
- O = Math.max(O, Z);
4090
+ O = Math.max(O, J);
4091
4091
  }
4092
4092
  var he = c.MAX_BUFFER_LENGTH - O;
4093
4093
  f.bufferCheckPosition = he + f.position;
@@ -4172,22 +4172,22 @@ function Wo() {
4172
4172
  B.splice(0, 0, f), O.emit.apply(O, B);
4173
4173
  }), b.prototype.on.call(O, f, s);
4174
4174
  };
4175
- var G = "[CDATA[", z = "DOCTYPE", H = "http://www.w3.org/XML/1998/namespace", M = "http://www.w3.org/2000/xmlns/", k = { xml: H, xmlns: M }, J = /[:_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]/, 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\u00B7\u0300-\u036F\u203F-\u2040.\d-]/, ye = /[#:_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-]/;
4175
+ var V = "[CDATA[", z = "DOCTYPE", H = "http://www.w3.org/XML/1998/namespace", M = "http://www.w3.org/2000/xmlns/", F = { xml: H, xmlns: M }, Z = /[:_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]/, re = /[:_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-]/, ye = /[#:_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]/, ee = /[#:_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-]/;
4176
4176
  function Y(f) {
4177
4177
  return f === " " || f === `
4178
4178
  ` || f === "\r" || f === " ";
4179
4179
  }
4180
- function oe(f) {
4180
+ function ie(f) {
4181
4181
  return f === '"' || f === "'";
4182
4182
  }
4183
4183
  function pe(f) {
4184
4184
  return f === ">" || Y(f);
4185
4185
  }
4186
- function ae(f, s) {
4186
+ function oe(f, s) {
4187
4187
  return f.test(s);
4188
4188
  }
4189
4189
  function Re(f, s) {
4190
- return !ae(f, s);
4190
+ return !oe(f, s);
4191
4191
  }
4192
4192
  var I = 0;
4193
4193
  c.STATE = {
@@ -4562,10 +4562,10 @@ Char: ` + f.c), s = new Error(s), f.error = s, ze(f, "onerror", s), f;
4562
4562
  f.opt.xmlns && (O.ns = s.ns), f.attribList.length = 0, de(f, "onopentagstart", O);
4563
4563
  }
4564
4564
  function Le(f, s) {
4565
- var O = f.indexOf(":"), B = O < 0 ? ["", f] : f.split(":"), ue = B[0], Z = B[1];
4566
- return s && f === "xmlns" && (ue = "xmlns", Z = ""), { prefix: ue, local: Z };
4565
+ var O = f.indexOf(":"), B = O < 0 ? ["", f] : f.split(":"), ue = B[0], J = B[1];
4566
+ return s && f === "xmlns" && (ue = "xmlns", J = ""), { prefix: ue, local: J };
4567
4567
  }
4568
- function Fe(f) {
4568
+ function ke(f) {
4569
4569
  if (f.strict || (f.attribName = f.attribName[f.looseCase]()), f.attribList.indexOf(f.attribName) !== -1 || f.tag.attributes.hasOwnProperty(f.attribName)) {
4570
4570
  f.attribName = f.attribValue = "";
4571
4571
  return;
@@ -4586,8 +4586,8 @@ Actual: ` + f.attribValue
4586
4586
  Actual: ` + f.attribValue
4587
4587
  );
4588
4588
  else {
4589
- var ue = f.tag, Z = f.tags[f.tags.length - 1] || f;
4590
- ue.ns === Z.ns && (ue.ns = Object.create(Z.ns)), ue.ns[B] = f.attribValue;
4589
+ var ue = f.tag, J = f.tags[f.tags.length - 1] || f;
4590
+ ue.ns === J.ns && (ue.ns = Object.create(J.ns)), ue.ns[B] = f.attribValue;
4591
4591
  }
4592
4592
  f.attribList.push([f.attribName, f.attribValue]);
4593
4593
  } else
@@ -4605,14 +4605,14 @@ Actual: ` + f.attribValue
4605
4605
  "Unbound namespace prefix: " + JSON.stringify(f.tagName)
4606
4606
  ), O.uri = B.prefix);
4607
4607
  var ue = f.tags[f.tags.length - 1] || f;
4608
- O.ns && ue.ns !== O.ns && Object.keys(O.ns).forEach(function(Ft) {
4608
+ O.ns && ue.ns !== O.ns && Object.keys(O.ns).forEach(function(kt) {
4609
4609
  de(f, "onopennamespace", {
4610
- prefix: Ft,
4611
- uri: O.ns[Ft]
4610
+ prefix: kt,
4611
+ uri: O.ns[kt]
4612
4612
  });
4613
4613
  });
4614
- for (var Z = 0, he = f.attribList.length; Z < he; Z++) {
4615
- var xe = f.attribList[Z], ve = xe[0], Je = xe[1], Ae = Le(ve, !0), Ke = Ae.prefix, In = Ae.local, wt = Ke === "" ? "" : O.ns[Ke] || "", De = {
4614
+ for (var J = 0, he = f.attribList.length; J < he; J++) {
4615
+ var xe = f.attribList[J], ve = xe[0], Je = xe[1], Ae = Le(ve, !0), Ke = Ae.prefix, In = Ae.local, wt = Ke === "" ? "" : O.ns[Ke] || "", De = {
4616
4616
  name: ve,
4617
4617
  value: Je,
4618
4618
  prefix: Ke,
@@ -4654,7 +4654,7 @@ Actual: ` + f.attribValue
4654
4654
  return;
4655
4655
  }
4656
4656
  f.tagName = O;
4657
- for (var Z = f.tags.length; Z-- > s; ) {
4657
+ for (var J = f.tags.length; J-- > s; ) {
4658
4658
  var he = f.tag = f.tags.pop();
4659
4659
  f.tagName = f.tag.name, de(f, "onclosetag", f.tagName);
4660
4660
  var xe = {};
@@ -4704,10 +4704,10 @@ Actual: ` + f.attribValue
4704
4704
  continue;
4705
4705
  case I.TEXT:
4706
4706
  if (s.sawRoot && !s.closedRoot) {
4707
- for (var Z = O - 1; B && B !== "<" && B !== "&"; )
4707
+ for (var J = O - 1; B && B !== "<" && B !== "&"; )
4708
4708
  B = He(f, O++), B && s.trackPosition && (s.position++, B === `
4709
4709
  ` ? (s.line++, s.column = 0) : s.column++);
4710
- s.textNode += f.substring(Z, O - 1);
4710
+ s.textNode += f.substring(J, O - 1);
4711
4711
  }
4712
4712
  B === "<" && !(s.sawRoot && s.closedRoot && !s.strict) ? (s.state = I.OPEN_WAKA, s.startTagPosition = s.position) : (!Y(B) && (!s.sawRoot || s.closedRoot) && fe(s, "Text data outside of root node."), B === "&" ? s.state = I.TEXT_ENTITY : s.textNode += B);
4713
4713
  continue;
@@ -4720,7 +4720,7 @@ Actual: ` + f.attribValue
4720
4720
  case I.OPEN_WAKA:
4721
4721
  if (B === "!")
4722
4722
  s.state = I.SGML_DECL, s.sgmlDecl = "";
4723
- else if (!Y(B)) if (ae(J, B))
4723
+ else if (!Y(B)) if (oe(Z, B))
4724
4724
  s.state = I.OPEN_TAG, s.tagName = B;
4725
4725
  else if (B === "/")
4726
4726
  s.state = I.CLOSE_TAG, s.tagName = "";
@@ -4739,22 +4739,22 @@ Actual: ` + f.attribValue
4739
4739
  s.state = I.COMMENT, s.comment = "", s.sgmlDecl = "";
4740
4740
  continue;
4741
4741
  }
4742
- s.doctype && s.doctype !== !0 && s.sgmlDecl ? (s.state = I.DOCTYPE_DTD, s.doctype += "<!" + s.sgmlDecl + B, s.sgmlDecl = "") : (s.sgmlDecl + B).toUpperCase() === G ? (de(s, "onopencdata"), s.state = I.CDATA, s.sgmlDecl = "", s.cdata = "") : (s.sgmlDecl + B).toUpperCase() === z ? (s.state = I.DOCTYPE, (s.doctype || s.sawRoot) && fe(
4742
+ s.doctype && s.doctype !== !0 && s.sgmlDecl ? (s.state = I.DOCTYPE_DTD, s.doctype += "<!" + s.sgmlDecl + B, s.sgmlDecl = "") : (s.sgmlDecl + B).toUpperCase() === V ? (de(s, "onopencdata"), s.state = I.CDATA, s.sgmlDecl = "", s.cdata = "") : (s.sgmlDecl + B).toUpperCase() === z ? (s.state = I.DOCTYPE, (s.doctype || s.sawRoot) && fe(
4743
4743
  s,
4744
4744
  "Inappropriately located doctype declaration"
4745
- ), s.doctype = "", s.sgmlDecl = "") : B === ">" ? (de(s, "onsgmldeclaration", s.sgmlDecl), s.sgmlDecl = "", s.state = I.TEXT) : (oe(B) && (s.state = I.SGML_DECL_QUOTED), s.sgmlDecl += B);
4745
+ ), s.doctype = "", s.sgmlDecl = "") : B === ">" ? (de(s, "onsgmldeclaration", s.sgmlDecl), s.sgmlDecl = "", s.state = I.TEXT) : (ie(B) && (s.state = I.SGML_DECL_QUOTED), s.sgmlDecl += B);
4746
4746
  continue;
4747
4747
  case I.SGML_DECL_QUOTED:
4748
4748
  B === s.q && (s.state = I.SGML_DECL, s.q = ""), s.sgmlDecl += B;
4749
4749
  continue;
4750
4750
  case I.DOCTYPE:
4751
- B === ">" ? (s.state = I.TEXT, de(s, "ondoctype", s.doctype), s.doctype = !0) : (s.doctype += B, B === "[" ? s.state = I.DOCTYPE_DTD : oe(B) && (s.state = I.DOCTYPE_QUOTED, s.q = B));
4751
+ B === ">" ? (s.state = I.TEXT, de(s, "ondoctype", s.doctype), s.doctype = !0) : (s.doctype += B, B === "[" ? s.state = I.DOCTYPE_DTD : ie(B) && (s.state = I.DOCTYPE_QUOTED, s.q = B));
4752
4752
  continue;
4753
4753
  case I.DOCTYPE_QUOTED:
4754
4754
  s.doctype += B, B === s.q && (s.q = "", s.state = I.DOCTYPE);
4755
4755
  continue;
4756
4756
  case I.DOCTYPE_DTD:
4757
- B === "]" ? (s.doctype += B, s.state = I.DOCTYPE) : B === "<" ? (s.state = I.OPEN_WAKA, s.startTagPosition = s.position) : oe(B) ? (s.doctype += B, s.state = I.DOCTYPE_DTD_QUOTED, s.q = B) : s.doctype += B;
4757
+ B === "]" ? (s.doctype += B, s.state = I.DOCTYPE) : B === "<" ? (s.state = I.OPEN_WAKA, s.startTagPosition = s.position) : ie(B) ? (s.doctype += B, s.state = I.DOCTYPE_DTD_QUOTED, s.q = B) : s.doctype += B;
4758
4758
  continue;
4759
4759
  case I.DOCTYPE_DTD_QUOTED:
4760
4760
  s.doctype += B, B === s.q && (s.state = I.DOCTYPE_DTD, s.q = "");
@@ -4769,10 +4769,10 @@ Actual: ` + f.attribValue
4769
4769
  B !== ">" ? (fe(s, "Malformed comment"), s.comment += "--" + B, s.state = I.COMMENT) : s.doctype && s.doctype !== !0 ? s.state = I.DOCTYPE_DTD : s.state = I.TEXT;
4770
4770
  continue;
4771
4771
  case I.CDATA:
4772
- for (var Z = O - 1; B && B !== "]"; )
4772
+ for (var J = O - 1; B && B !== "]"; )
4773
4773
  B = He(f, O++), B && s.trackPosition && (s.position++, B === `
4774
4774
  ` ? (s.line++, s.column = 0) : s.column++);
4775
- s.cdata += f.substring(Z, O - 1), B === "]" && (s.state = I.CDATA_ENDING);
4775
+ s.cdata += f.substring(J, O - 1), B === "]" && (s.state = I.CDATA_ENDING);
4776
4776
  continue;
4777
4777
  case I.CDATA_ENDING:
4778
4778
  B === "]" ? s.state = I.CDATA_ENDING_2 : (s.cdata += "]" + B, s.state = I.CDATA);
@@ -4795,7 +4795,7 @@ Actual: ` + f.attribValue
4795
4795
  }), s.procInstName = s.procInstBody = "", s.state = I.TEXT) : (s.procInstBody += "?" + B, s.state = I.PROC_INST_BODY);
4796
4796
  continue;
4797
4797
  case I.OPEN_TAG:
4798
- ae(ie, B) ? s.tagName += B : (Ge(s), B === ">" ? je(s) : B === "/" ? s.state = I.OPEN_TAG_SLASH : (Y(B) || fe(s, "Invalid character in tag name"), s.state = I.ATTRIB));
4798
+ oe(re, B) ? s.tagName += B : (Ge(s), B === ">" ? je(s) : B === "/" ? s.state = I.OPEN_TAG_SLASH : (Y(B) || fe(s, "Invalid character in tag name"), s.state = I.ATTRIB));
4799
4799
  continue;
4800
4800
  case I.OPEN_TAG_SLASH:
4801
4801
  B === ">" ? (je(s, !0), Pt(s)) : (fe(
@@ -4806,10 +4806,10 @@ Actual: ` + f.attribValue
4806
4806
  case I.ATTRIB:
4807
4807
  if (Y(B))
4808
4808
  continue;
4809
- B === ">" ? je(s) : B === "/" ? s.state = I.OPEN_TAG_SLASH : ae(J, B) ? (s.attribName = B, s.attribValue = "", s.state = I.ATTRIB_NAME) : fe(s, "Invalid attribute name");
4809
+ B === ">" ? je(s) : B === "/" ? s.state = I.OPEN_TAG_SLASH : oe(Z, B) ? (s.attribName = B, s.attribValue = "", s.state = I.ATTRIB_NAME) : fe(s, "Invalid attribute name");
4810
4810
  continue;
4811
4811
  case I.ATTRIB_NAME:
4812
- B === "=" ? s.state = I.ATTRIB_VALUE : B === ">" ? (fe(s, "Attribute without value"), s.attribValue = s.attribName, Fe(s), je(s)) : Y(B) ? s.state = I.ATTRIB_NAME_SAW_WHITE : ae(ie, B) ? s.attribName += B : fe(s, "Invalid attribute name");
4812
+ B === "=" ? s.state = I.ATTRIB_VALUE : B === ">" ? (fe(s, "Attribute without value"), s.attribValue = s.attribName, ke(s), je(s)) : Y(B) ? s.state = I.ATTRIB_NAME_SAW_WHITE : oe(re, B) ? s.attribName += B : fe(s, "Invalid attribute name");
4813
4813
  continue;
4814
4814
  case I.ATTRIB_NAME_SAW_WHITE:
4815
4815
  if (B === "=")
@@ -4820,38 +4820,38 @@ Actual: ` + f.attribValue
4820
4820
  fe(s, "Attribute without value"), s.tag.attributes[s.attribName] = "", s.attribValue = "", de(s, "onattribute", {
4821
4821
  name: s.attribName,
4822
4822
  value: ""
4823
- }), s.attribName = "", B === ">" ? je(s) : ae(J, B) ? (s.attribName = B, s.state = I.ATTRIB_NAME) : (fe(s, "Invalid attribute name"), s.state = I.ATTRIB);
4823
+ }), s.attribName = "", B === ">" ? je(s) : oe(Z, B) ? (s.attribName = B, s.state = I.ATTRIB_NAME) : (fe(s, "Invalid attribute name"), s.state = I.ATTRIB);
4824
4824
  }
4825
4825
  continue;
4826
4826
  case I.ATTRIB_VALUE:
4827
4827
  if (Y(B))
4828
4828
  continue;
4829
- oe(B) ? (s.q = B, s.state = I.ATTRIB_VALUE_QUOTED) : (s.opt.unquotedAttributeValues || Ve(s, "Unquoted attribute value"), s.state = I.ATTRIB_VALUE_UNQUOTED, s.attribValue = B);
4829
+ ie(B) ? (s.q = B, s.state = I.ATTRIB_VALUE_QUOTED) : (s.opt.unquotedAttributeValues || Ve(s, "Unquoted attribute value"), s.state = I.ATTRIB_VALUE_UNQUOTED, s.attribValue = B);
4830
4830
  continue;
4831
4831
  case I.ATTRIB_VALUE_QUOTED:
4832
4832
  if (B !== s.q) {
4833
4833
  B === "&" ? s.state = I.ATTRIB_VALUE_ENTITY_Q : s.attribValue += B;
4834
4834
  continue;
4835
4835
  }
4836
- Fe(s), s.q = "", s.state = I.ATTRIB_VALUE_CLOSED;
4836
+ ke(s), s.q = "", s.state = I.ATTRIB_VALUE_CLOSED;
4837
4837
  continue;
4838
4838
  case I.ATTRIB_VALUE_CLOSED:
4839
- Y(B) ? s.state = I.ATTRIB : B === ">" ? je(s) : B === "/" ? s.state = I.OPEN_TAG_SLASH : ae(J, B) ? (fe(s, "No whitespace between attributes"), s.attribName = B, s.attribValue = "", s.state = I.ATTRIB_NAME) : fe(s, "Invalid attribute name");
4839
+ Y(B) ? s.state = I.ATTRIB : B === ">" ? je(s) : B === "/" ? s.state = I.OPEN_TAG_SLASH : oe(Z, B) ? (fe(s, "No whitespace between attributes"), s.attribName = B, s.attribValue = "", s.state = I.ATTRIB_NAME) : fe(s, "Invalid attribute name");
4840
4840
  continue;
4841
4841
  case I.ATTRIB_VALUE_UNQUOTED:
4842
4842
  if (!pe(B)) {
4843
4843
  B === "&" ? s.state = I.ATTRIB_VALUE_ENTITY_U : s.attribValue += B;
4844
4844
  continue;
4845
4845
  }
4846
- Fe(s), B === ">" ? je(s) : s.state = I.ATTRIB;
4846
+ ke(s), B === ">" ? je(s) : s.state = I.ATTRIB;
4847
4847
  continue;
4848
4848
  case I.CLOSE_TAG:
4849
4849
  if (s.tagName)
4850
- B === ">" ? Pt(s) : ae(ie, B) ? s.tagName += B : s.script ? (s.script += "</" + s.tagName + B, s.tagName = "", s.state = I.SCRIPT) : (Y(B) || fe(s, "Invalid tagname in closing tag"), s.state = I.CLOSE_TAG_SAW_WHITE);
4850
+ B === ">" ? Pt(s) : oe(re, B) ? s.tagName += B : s.script ? (s.script += "</" + s.tagName + B, s.tagName = "", s.state = I.SCRIPT) : (Y(B) || fe(s, "Invalid tagname in closing tag"), s.state = I.CLOSE_TAG_SAW_WHITE);
4851
4851
  else {
4852
4852
  if (Y(B))
4853
4853
  continue;
4854
- Re(J, B) ? s.script ? (s.script += "</" + B, s.state = I.SCRIPT) : fe(s, "Invalid tagname in closing tag.") : s.tagName = B;
4854
+ Re(Z, B) ? s.script ? (s.script += "</" + B, s.state = I.SCRIPT) : fe(s, "Invalid tagname in closing tag.") : s.tagName = B;
4855
4855
  }
4856
4856
  continue;
4857
4857
  case I.CLOSE_TAG_SAW_WHITE:
@@ -4877,7 +4877,7 @@ Actual: ` + f.attribValue
4877
4877
  if (B === ";") {
4878
4878
  var ve = Qe(s);
4879
4879
  s.opt.unparsedEntities && !Object.values(c.XML_ENTITIES).includes(ve) ? (s.entity = "", s.state = he, s.write(ve)) : (s[xe] += ve, s.entity = "", s.state = he);
4880
- } else ae(s.entity.length ? te : ye, B) ? s.entity += B : (fe(s, "Invalid character in entity name"), s[xe] += "&" + s.entity + B, s.entity = "", s.state = he);
4880
+ } else oe(s.entity.length ? ee : ye, B) ? s.entity += B : (fe(s, "Invalid character in entity name"), s[xe] += "&" + s.entity + B, s.entity = "", s.state = he);
4881
4881
  continue;
4882
4882
  default:
4883
4883
  throw new Error(s, "Unknown state: " + s.state);
@@ -4886,7 +4886,7 @@ Actual: ` + f.attribValue
4886
4886
  }
4887
4887
  String.fromCodePoint || (function() {
4888
4888
  var f = String.fromCharCode, s = Math.floor, O = function() {
4889
- var B = 16384, ue = [], Z, he, xe = -1, ve = arguments.length;
4889
+ var B = 16384, ue = [], J, he, xe = -1, ve = arguments.length;
4890
4890
  if (!ve)
4891
4891
  return "";
4892
4892
  for (var Je = ""; ++xe < ve; ) {
@@ -4896,7 +4896,7 @@ Actual: ` + f.attribValue
4896
4896
  Ae > 1114111 || // not a valid Unicode code point
4897
4897
  s(Ae) !== Ae)
4898
4898
  throw RangeError("Invalid code point: " + Ae);
4899
- Ae <= 65535 ? ue.push(Ae) : (Ae -= 65536, Z = (Ae >> 10) + 55296, he = Ae % 1024 + 56320, ue.push(Z, he)), (xe + 1 === ve || ue.length > B) && (Je += f.apply(null, ue), ue.length = 0);
4899
+ Ae <= 65535 ? ue.push(Ae) : (Ae -= 65536, J = (Ae >> 10) + 55296, he = Ae % 1024 + 56320, ue.push(J, he)), (xe + 1 === ve || ue.length > B) && (Je += f.apply(null, ue), ue.length = 0);
4900
4900
  }
4901
4901
  return Je;
4902
4902
  };
@@ -4964,13 +4964,13 @@ function Qo(l) {
4964
4964
  const b = ni(c, m.defaultNamespace), R = oi({ attributes: c.attributes, useCustomRecordsIds: h }), P = ii({
4965
4965
  attributes: c.attributes,
4966
4966
  useCustomRecordsIds: h
4967
- }), q = ri(P), G = ai(u.stack), z = {
4967
+ }), q = ri(P), V = ai(u.stack), z = {
4968
4968
  id: R,
4969
4969
  tagName: y,
4970
4970
  namespace: b,
4971
4971
  attributes: q,
4972
4972
  value: "",
4973
- parent: G,
4973
+ parent: V,
4974
4974
  children: []
4975
4975
  };
4976
4976
  return m.stack.push(z), m;
@@ -5130,7 +5130,7 @@ async function fi(l) {
5130
5130
  });
5131
5131
  }
5132
5132
  async function mr(l) {
5133
- const { databaseInstance: c, elementsTableName: u, reader: o, sax: h, textDecoder: m, buffer: y, options: b } = l, { chunkSize: R, batchSize: P } = b, { done: q, value: G } = await o.read();
5133
+ const { databaseInstance: c, elementsTableName: u, reader: o, sax: h, textDecoder: m, buffer: y, options: b } = l, { chunkSize: R, batchSize: P } = b, { done: q, value: V } = await o.read();
5134
5134
  if (q) {
5135
5135
  if (y.length > 0) {
5136
5136
  const H = m.decode(y);
@@ -5143,10 +5143,10 @@ async function mr(l) {
5143
5143
  batchSize: 0
5144
5144
  });
5145
5145
  }
5146
- if (!G)
5146
+ if (!V)
5147
5147
  return await mr(l);
5148
- let z = new Uint8Array(y.length + G.length);
5149
- for (z.set(y), z.set(G, y.length); z.length >= R; ) {
5148
+ let z = new Uint8Array(y.length + V.length);
5149
+ for (z.set(y), z.set(V, y.length); z.length >= R; ) {
5150
5150
  const H = z.slice(0, R);
5151
5151
  z = z.slice(R);
5152
5152
  const M = m.decode(H, { stream: !0 });
@@ -5178,102 +5178,102 @@ function di() {
5178
5178
  return aa || (aa = 1, (function(l, c) {
5179
5179
  Object.defineProperty(c, "__esModule", { value: !0 }), c.ParsingError = void 0;
5180
5180
  class u extends Error {
5181
- constructor(Y, oe) {
5182
- super(Y), this.cause = oe;
5181
+ constructor(Y, ie) {
5182
+ super(Y), this.cause = ie;
5183
5183
  }
5184
5184
  }
5185
5185
  c.ParsingError = u;
5186
5186
  let o;
5187
5187
  function h() {
5188
- return R(!1) || z() || G() || q() || b();
5188
+ return R(!1) || z() || V() || q() || b();
5189
5189
  }
5190
5190
  function m() {
5191
- return k(/\s*/), R(!0) || G() || P() || b();
5191
+ return F(/\s*/), R(!0) || V() || P() || b();
5192
5192
  }
5193
5193
  function y() {
5194
- const te = b(), Y = [];
5195
- let oe, pe = m();
5194
+ const ee = b(), Y = [];
5195
+ let ie, pe = m();
5196
5196
  for (; pe; ) {
5197
5197
  if (pe.node.type === "Element") {
5198
- if (oe)
5198
+ if (ie)
5199
5199
  throw new Error("Found multiple root nodes");
5200
- oe = pe.node;
5200
+ ie = pe.node;
5201
5201
  }
5202
5202
  pe.excluded || Y.push(pe.node), pe = m();
5203
5203
  }
5204
- if (!oe)
5204
+ if (!ie)
5205
5205
  throw new u("Failed to parse XML", "Root Element not found");
5206
5206
  if (o.xml.length !== 0)
5207
5207
  throw new u("Failed to parse XML", "Not Well-Formed XML");
5208
5208
  return {
5209
- declaration: te ? te.node : null,
5210
- root: oe,
5209
+ declaration: ee ? ee.node : null,
5210
+ root: ie,
5211
5211
  children: Y
5212
5212
  };
5213
5213
  }
5214
5214
  function b() {
5215
- const te = k(/^<\?([\w-:.]+)\s*/);
5216
- if (!te)
5215
+ const ee = F(/^<\?([\w-:.]+)\s*/);
5216
+ if (!ee)
5217
5217
  return;
5218
5218
  const Y = {
5219
- name: te[1],
5219
+ name: ee[1],
5220
5220
  type: "ProcessingInstruction",
5221
5221
  content: ""
5222
- }, oe = o.xml.indexOf("?>");
5223
- if (oe > -1)
5224
- Y.content = o.xml.substring(0, oe).trim(), o.xml = o.xml.slice(oe);
5222
+ }, ie = o.xml.indexOf("?>");
5223
+ if (ie > -1)
5224
+ Y.content = o.xml.substring(0, ie).trim(), o.xml = o.xml.slice(ie);
5225
5225
  else
5226
5226
  throw new u("Failed to parse XML", "ProcessingInstruction closing tag not found");
5227
- return k(/\?>/), {
5227
+ return F(/\?>/), {
5228
5228
  excluded: o.options.filter(Y) === !1,
5229
5229
  node: Y
5230
5230
  };
5231
5231
  }
5232
- function R(te) {
5233
- const Y = k(/^<([^?!</>\s]+)\s*/);
5232
+ function R(ee) {
5233
+ const Y = F(/^<([^?!</>\s]+)\s*/);
5234
5234
  if (!Y)
5235
5235
  return;
5236
- const oe = {
5236
+ const ie = {
5237
5237
  type: "Element",
5238
5238
  name: Y[1],
5239
5239
  attributes: {},
5240
5240
  children: []
5241
- }, pe = te ? !1 : o.options.filter(oe) === !1;
5242
- for (; !(J() || ie(">") || ie("?>") || ie("/>")); ) {
5241
+ }, pe = ee ? !1 : o.options.filter(ie) === !1;
5242
+ for (; !(Z() || re(">") || re("?>") || re("/>")); ) {
5243
5243
  const Re = H();
5244
5244
  if (Re)
5245
- oe.attributes[Re.name] = Re.value;
5245
+ ie.attributes[Re.name] = Re.value;
5246
5246
  else
5247
5247
  return;
5248
5248
  }
5249
- if (k(/^\s*\/>/))
5250
- return oe.children = null, {
5249
+ if (F(/^\s*\/>/))
5250
+ return ie.children = null, {
5251
5251
  excluded: pe,
5252
- node: oe
5252
+ node: ie
5253
5253
  };
5254
- k(/\??>/);
5255
- let ae = h();
5256
- for (; ae; )
5257
- ae.excluded || oe.children.push(ae.node), ae = h();
5254
+ F(/\??>/);
5255
+ let oe = h();
5256
+ for (; oe; )
5257
+ oe.excluded || ie.children.push(oe.node), oe = h();
5258
5258
  if (o.options.strictMode) {
5259
- const Re = `</${oe.name}>`;
5259
+ const Re = `</${ie.name}>`;
5260
5260
  if (o.xml.startsWith(Re))
5261
5261
  o.xml = o.xml.slice(Re.length);
5262
5262
  else
5263
5263
  throw new u("Failed to parse XML", `Closing tag not matching "${Re}"`);
5264
5264
  } else
5265
- k(/^<\/[\w-:.\u00C0-\u00FF]+\s*>/);
5265
+ F(/^<\/[\w-:.\u00C0-\u00FF]+\s*>/);
5266
5266
  return {
5267
5267
  excluded: pe,
5268
- node: oe
5268
+ node: ie
5269
5269
  };
5270
5270
  }
5271
5271
  function P() {
5272
- const te = k(/^<!DOCTYPE\s+\S+\s+SYSTEM[^>]*>/) || k(/^<!DOCTYPE\s+\S+\s+PUBLIC[^>]*>/) || k(/^<!DOCTYPE\s+\S+\s*\[[^\]]*]>/) || k(/^<!DOCTYPE\s+\S+\s*>/);
5273
- if (te) {
5272
+ const ee = F(/^<!DOCTYPE\s+\S+\s+SYSTEM[^>]*>/) || F(/^<!DOCTYPE\s+\S+\s+PUBLIC[^>]*>/) || F(/^<!DOCTYPE\s+\S+\s*\[[^\]]*]>/) || F(/^<!DOCTYPE\s+\S+\s*>/);
5273
+ if (ee) {
5274
5274
  const Y = {
5275
5275
  type: "DocumentType",
5276
- content: te[0]
5276
+ content: ee[0]
5277
5277
  };
5278
5278
  return {
5279
5279
  excluded: o.options.filter(Y) === !1,
@@ -5283,25 +5283,25 @@ function di() {
5283
5283
  }
5284
5284
  function q() {
5285
5285
  if (o.xml.startsWith("<![CDATA[")) {
5286
- const te = o.xml.indexOf("]]>");
5287
- if (te > -1) {
5288
- const Y = te + 3, oe = {
5286
+ const ee = o.xml.indexOf("]]>");
5287
+ if (ee > -1) {
5288
+ const Y = ee + 3, ie = {
5289
5289
  type: "CDATA",
5290
5290
  content: o.xml.substring(0, Y)
5291
5291
  };
5292
5292
  return o.xml = o.xml.slice(Y), {
5293
- excluded: o.options.filter(oe) === !1,
5294
- node: oe
5293
+ excluded: o.options.filter(ie) === !1,
5294
+ node: ie
5295
5295
  };
5296
5296
  }
5297
5297
  }
5298
5298
  }
5299
- function G() {
5300
- const te = k(/^<!--[\s\S]*?-->/);
5301
- if (te) {
5299
+ function V() {
5300
+ const ee = F(/^<!--[\s\S]*?-->/);
5301
+ if (ee) {
5302
5302
  const Y = {
5303
5303
  type: "Comment",
5304
- content: te[0]
5304
+ content: ee[0]
5305
5305
  };
5306
5306
  return {
5307
5307
  excluded: o.options.filter(Y) === !1,
@@ -5310,11 +5310,11 @@ function di() {
5310
5310
  }
5311
5311
  }
5312
5312
  function z() {
5313
- const te = k(/^([^<]+)/);
5314
- if (te) {
5313
+ const ee = F(/^([^<]+)/);
5314
+ if (ee) {
5315
5315
  const Y = {
5316
5316
  type: "Text",
5317
- content: te[1]
5317
+ content: ee[1]
5318
5318
  };
5319
5319
  return {
5320
5320
  excluded: o.options.filter(Y) === !1,
@@ -5323,33 +5323,33 @@ function di() {
5323
5323
  }
5324
5324
  }
5325
5325
  function H() {
5326
- const te = k(/([^=]+)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)\s*/);
5327
- if (te)
5326
+ const ee = F(/([^=]+)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)\s*/);
5327
+ if (ee)
5328
5328
  return {
5329
- name: te[1].trim(),
5330
- value: M(te[2].trim())
5329
+ name: ee[1].trim(),
5330
+ value: M(ee[2].trim())
5331
5331
  };
5332
5332
  }
5333
- function M(te) {
5334
- return te.replace(/^['"]|['"]$/g, "");
5333
+ function M(ee) {
5334
+ return ee.replace(/^['"]|['"]$/g, "");
5335
5335
  }
5336
- function k(te) {
5337
- const Y = o.xml.match(te);
5336
+ function F(ee) {
5337
+ const Y = o.xml.match(ee);
5338
5338
  if (Y)
5339
5339
  return o.xml = o.xml.slice(Y[0].length), Y;
5340
5340
  }
5341
- function J() {
5341
+ function Z() {
5342
5342
  return o.xml.length === 0;
5343
5343
  }
5344
- function ie(te) {
5345
- return o.xml.indexOf(te) === 0;
5344
+ function re(ee) {
5345
+ return o.xml.indexOf(ee) === 0;
5346
5346
  }
5347
- function ye(te, Y = {}) {
5348
- te = te.trim();
5349
- const oe = Y.filter || (() => !0);
5347
+ function ye(ee, Y = {}) {
5348
+ ee = ee.trim();
5349
+ const ie = Y.filter || (() => !0);
5350
5350
  return o = {
5351
- xml: te,
5352
- options: Object.assign(Object.assign({}, Y), { filter: oe, strictMode: Y.strictMode === !0 })
5351
+ xml: ee,
5352
+ options: Object.assign(Object.assign({}, Y), { filter: ie, strictMode: Y.strictMode === !0 })
5353
5353
  }, y();
5354
5354
  }
5355
5355
  l.exports = ye, c.default = ye;
@@ -5367,88 +5367,88 @@ function hi() {
5367
5367
  if (!M.options.indentation && !M.options.lineSeparator)
5368
5368
  return;
5369
5369
  M.content += M.options.lineSeparator;
5370
- let k;
5371
- for (k = 0; k < M.level; k++)
5370
+ let F;
5371
+ for (F = 0; F < M.level; F++)
5372
5372
  M.content += M.options.indentation;
5373
5373
  }
5374
5374
  function m(M) {
5375
5375
  M.content = M.content.replace(/ +$/, "");
5376
- let k;
5377
- for (k = 0; k < M.level; k++)
5376
+ let F;
5377
+ for (F = 0; F < M.level; F++)
5378
5378
  M.content += M.options.indentation;
5379
5379
  }
5380
- function y(M, k) {
5381
- M.content += k;
5380
+ function y(M, F) {
5381
+ M.content += F;
5382
5382
  }
5383
- function b(M, k, J) {
5383
+ function b(M, F, Z) {
5384
5384
  if (M.type === "Element")
5385
- q(M, k, J);
5385
+ q(M, F, Z);
5386
5386
  else if (M.type === "ProcessingInstruction")
5387
- z(M, k);
5387
+ z(M, F);
5388
5388
  else if (typeof M.content == "string")
5389
- R(M.content, k, J);
5389
+ R(M.content, F, Z);
5390
5390
  else
5391
5391
  throw new Error("Unknown node type: " + M.type);
5392
5392
  }
5393
- function R(M, k, J) {
5394
- if (!J) {
5395
- const ie = M.trim();
5396
- (k.options.lineSeparator || ie.length === 0) && (M = ie);
5393
+ function R(M, F, Z) {
5394
+ if (!Z) {
5395
+ const re = M.trim();
5396
+ (F.options.lineSeparator || re.length === 0) && (M = re);
5397
5397
  }
5398
- M.length > 0 && (!J && k.content.length > 0 && h(k), y(k, M));
5398
+ M.length > 0 && (!Z && F.content.length > 0 && h(F), y(F, M));
5399
5399
  }
5400
- function P(M, k) {
5401
- const J = "/" + M.join("/"), ie = M[M.length - 1];
5402
- return k.includes(ie) || k.includes(J);
5400
+ function P(M, F) {
5401
+ const Z = "/" + M.join("/"), re = M[M.length - 1];
5402
+ return F.includes(re) || F.includes(Z);
5403
5403
  }
5404
- function q(M, k, J) {
5405
- if (k.path.push(M.name), !J && k.content.length > 0 && h(k), y(k, "<" + M.name), G(k, M.attributes), M.children === null || k.options.forceSelfClosingEmptyTag && M.children.length === 0) {
5406
- const ie = k.options.whiteSpaceAtEndOfSelfclosingTag ? " />" : "/>";
5407
- y(k, ie);
5404
+ function q(M, F, Z) {
5405
+ if (F.path.push(M.name), !Z && F.content.length > 0 && h(F), y(F, "<" + M.name), V(F, M.attributes), M.children === null || F.options.forceSelfClosingEmptyTag && M.children.length === 0) {
5406
+ const re = F.options.whiteSpaceAtEndOfSelfclosingTag ? " />" : "/>";
5407
+ y(F, re);
5408
5408
  } else if (M.children.length === 0)
5409
- y(k, "></" + M.name + ">");
5409
+ y(F, "></" + M.name + ">");
5410
5410
  else {
5411
- const ie = M.children;
5412
- y(k, ">"), k.level++;
5413
- let ye = M.attributes["xml:space"] === "preserve" || J, te = !1;
5414
- if (!ye && k.options.ignoredPaths && (te = P(k.path, k.options.ignoredPaths), ye = te), !ye && k.options.collapseContent) {
5415
- let Y = !1, oe = !1, pe = !1;
5416
- ie.forEach(function(ae, Re) {
5417
- ae.type === "Text" ? (ae.content.includes(`
5418
- `) ? (oe = !0, ae.content = ae.content.trim()) : (Re === 0 || Re === ie.length - 1) && !J && ae.content.trim().length === 0 && (ae.content = ""), (ae.content.trim().length > 0 || ie.length === 1) && (Y = !0)) : ae.type === "CDATA" ? Y = !0 : pe = !0;
5419
- }), Y && (!pe || !oe) && (ye = !0);
5411
+ const re = M.children;
5412
+ y(F, ">"), F.level++;
5413
+ let ye = M.attributes["xml:space"] === "preserve" || Z, ee = !1;
5414
+ if (!ye && F.options.ignoredPaths && (ee = P(F.path, F.options.ignoredPaths), ye = ee), !ye && F.options.collapseContent) {
5415
+ let Y = !1, ie = !1, pe = !1;
5416
+ re.forEach(function(oe, Re) {
5417
+ oe.type === "Text" ? (oe.content.includes(`
5418
+ `) ? (ie = !0, oe.content = oe.content.trim()) : (Re === 0 || Re === re.length - 1) && !Z && oe.content.trim().length === 0 && (oe.content = ""), (oe.content.trim().length > 0 || re.length === 1) && (Y = !0)) : oe.type === "CDATA" ? Y = !0 : pe = !0;
5419
+ }), Y && (!pe || !ie) && (ye = !0);
5420
5420
  }
5421
- ie.forEach(function(Y) {
5422
- b(Y, k, J || ye);
5423
- }), k.level--, !J && !ye && h(k), te && m(k), y(k, "</" + M.name + ">");
5421
+ re.forEach(function(Y) {
5422
+ b(Y, F, Z || ye);
5423
+ }), F.level--, !Z && !ye && h(F), ee && m(F), y(F, "</" + M.name + ">");
5424
5424
  }
5425
- k.path.pop();
5425
+ F.path.pop();
5426
5426
  }
5427
- function G(M, k) {
5428
- Object.keys(k).forEach(function(J) {
5429
- const ie = k[J].replace(/"/g, "&quot;");
5430
- y(M, " " + J + '="' + ie + '"');
5427
+ function V(M, F) {
5428
+ Object.keys(F).forEach(function(Z) {
5429
+ const re = F[Z].replace(/"/g, "&quot;");
5430
+ y(M, " " + Z + '="' + re + '"');
5431
5431
  });
5432
5432
  }
5433
- function z(M, k) {
5434
- k.content.length > 0 && h(k), y(k, "<?" + M.name), y(k, " " + M.content.trim()), y(k, "?>");
5433
+ function z(M, F) {
5434
+ F.content.length > 0 && h(F), y(F, "<?" + M.name), y(F, " " + M.content.trim()), y(F, "?>");
5435
5435
  }
5436
- function H(M, k = {}) {
5437
- k.indentation = "indentation" in k ? k.indentation : " ", k.collapseContent = k.collapseContent === !0, k.lineSeparator = "lineSeparator" in k ? k.lineSeparator : `\r
5438
- `, k.whiteSpaceAtEndOfSelfclosingTag = k.whiteSpaceAtEndOfSelfclosingTag === !0, k.throwOnFailure = k.throwOnFailure !== !1;
5436
+ function H(M, F = {}) {
5437
+ F.indentation = "indentation" in F ? F.indentation : " ", F.collapseContent = F.collapseContent === !0, F.lineSeparator = "lineSeparator" in F ? F.lineSeparator : `\r
5438
+ `, F.whiteSpaceAtEndOfSelfclosingTag = F.whiteSpaceAtEndOfSelfclosingTag === !0, F.throwOnFailure = F.throwOnFailure !== !1;
5439
5439
  try {
5440
- const J = (0, o.default)(M, { filter: k.filter, strictMode: k.strictMode }), ie = { content: "", level: 0, options: k, path: [] };
5441
- return J.declaration && z(J.declaration, ie), J.children.forEach(function(ye) {
5442
- b(ye, ie, !1);
5443
- }), k.lineSeparator ? ie.content.replace(/\r\n/g, `
5444
- `).replace(/\n/g, k.lineSeparator) : ie.content;
5445
- } catch (J) {
5446
- if (k.throwOnFailure)
5447
- throw J;
5440
+ const Z = (0, o.default)(M, { filter: F.filter, strictMode: F.strictMode }), re = { content: "", level: 0, options: F, path: [] };
5441
+ return Z.declaration && z(Z.declaration, re), Z.children.forEach(function(ye) {
5442
+ b(ye, re, !1);
5443
+ }), F.lineSeparator ? re.content.replace(/\r\n/g, `
5444
+ `).replace(/\n/g, F.lineSeparator) : re.content;
5445
+ } catch (Z) {
5446
+ if (F.throwOnFailure)
5447
+ throw Z;
5448
5448
  return M;
5449
5449
  }
5450
5450
  }
5451
- H.minify = (M, k = {}) => H(M, Object.assign(Object.assign({}, k), { indentation: "", lineSeparator: "" })), l.exports = H, c.default = H;
5451
+ H.minify = (M, F = {}) => H(M, Object.assign(Object.assign({}, F), { indentation: "", lineSeparator: "" })), l.exports = H, c.default = H;
5452
5452
  })(zt, zt.exports)), zt.exports;
5453
5453
  }
5454
5454
  var mi = /* @__PURE__ */ hi();
@@ -5461,7 +5461,7 @@ async function yi(l) {
5461
5461
  ` + new XMLSerializer().serializeToString(u), R = gi(b), P = new Blob([R], { type: "application/xml" });
5462
5462
  if ("showSaveFilePicker" in window)
5463
5463
  try {
5464
- const G = await (await window.showSaveFilePicker({
5464
+ const V = await (await window.showSaveFilePicker({
5465
5465
  suggestedName: o,
5466
5466
  types: [
5467
5467
  {
@@ -5470,13 +5470,13 @@ async function yi(l) {
5470
5470
  }
5471
5471
  ]
5472
5472
  })).createWritable();
5473
- await G.write(P), await G.close();
5473
+ await V.write(P), await V.close();
5474
5474
  } catch (q) {
5475
5475
  q.name !== "AbortError" && console.error("Save failed:", q);
5476
5476
  }
5477
5477
  else {
5478
- const q = URL.createObjectURL(P), G = document.createElement("a");
5479
- G.href = q, G.download = o, document.body.appendChild(G), G.click(), G.remove(), URL.revokeObjectURL(q);
5478
+ const q = URL.createObjectURL(P), V = document.createElement("a");
5479
+ V.href = q, V.download = o, document.body.appendChild(V), V.click(), V.remove(), URL.revokeObjectURL(q);
5480
5480
  }
5481
5481
  }
5482
5482
  async function Es(l) {
@@ -5564,12 +5564,12 @@ async function ba(l) {
5564
5564
  childrenRecords: q,
5565
5565
  parentRecord: y
5566
5566
  });
5567
- const G = bi({
5567
+ const V = bi({
5568
5568
  parentTagName: y.tagName,
5569
5569
  availableChildren: u.children,
5570
5570
  childrenRecords: q
5571
5571
  });
5572
- for (const z of G) {
5572
+ for (const z of V) {
5573
5573
  const H = _i({
5574
5574
  document: m,
5575
5575
  record: z,
@@ -5677,8 +5677,8 @@ async function Ns(l) {
5677
5677
  break;
5678
5678
  case "addChild":
5679
5679
  m.goTo && (o = o.goToElement(m.goTo));
5680
- const { id: y, tagName: b, attributes: R, namespace: P, value: q, setFocus: G } = m;
5681
- G ? o = o.addChild({
5680
+ const { id: y, tagName: b, attributes: R, namespace: P, value: q, setFocus: V } = m;
5681
+ V ? o = o.addChild({
5682
5682
  id: y,
5683
5683
  tagName: b,
5684
5684
  attributes: R,
@@ -5725,7 +5725,7 @@ function Bi(l) {
5725
5725
  databaseInstance: o,
5726
5726
  tagName: b,
5727
5727
  attributes: R
5728
- })).filter((G) => G.parent?.tagName === m.currentFocus.tagName && G.parent?.id === m.currentFocus.id);
5728
+ })).filter((V) => V.parent?.tagName === m.currentFocus.tagName && V.parent?.id === m.currentFocus.id);
5729
5729
  y[b] || (y[b] = []), y[b].push(...q);
5730
5730
  }
5731
5731
  return y;
@@ -5751,7 +5751,7 @@ async function Ei(l) {
5751
5751
  const { record: P, includeFilter: q } = R;
5752
5752
  if (xi({ record: P, excludeFilters: y }))
5753
5753
  return Nn({ record: P });
5754
- const G = await Ni({
5754
+ const V = await Ni({
5755
5755
  record: P,
5756
5756
  context: u,
5757
5757
  dialecteConfig: o,
@@ -5759,8 +5759,8 @@ async function Ei(l) {
5759
5759
  currentIncludeFilter: q,
5760
5760
  excludeFilters: y
5761
5761
  }), H = (await Promise.all(
5762
- G.map(
5763
- ({ record: M, includeFilter: k }) => b({ record: M, includeFilter: k })
5762
+ V.map(
5763
+ ({ record: M, includeFilter: F }) => b({ record: M, includeFilter: F })
5764
5764
  )
5765
5765
  )).filter(
5766
5766
  (M) => M !== null
@@ -5887,16 +5887,16 @@ function Si(l) {
5887
5887
  }
5888
5888
  return c;
5889
5889
  }
5890
- function Fi(l, c) {
5890
+ function ki(l, c) {
5891
5891
  const u = {};
5892
5892
  for (const o of c)
5893
5893
  u[o] = l.get(o) || [];
5894
5894
  return u;
5895
5895
  }
5896
- async function ki(l) {
5896
+ async function Fi(l) {
5897
5897
  const { context: c, dialecteConfig: u, databaseInstance: o, candidates: h, focus: m, path: y, collectTags: b } = l, R = /* @__PURE__ */ new Map();
5898
5898
  for (const q of h) {
5899
- const G = await Mi({
5899
+ const V = await Mi({
5900
5900
  candidate: q,
5901
5901
  focus: m,
5902
5902
  context: c,
@@ -5905,10 +5905,10 @@ async function ki(l) {
5905
5905
  path: y,
5906
5906
  shouldCollect: !0
5907
5907
  });
5908
- G.valid && G.ancestors && Ui(G.ancestors, b, R);
5908
+ V.valid && V.ancestors && Ui(V.ancestors, b, R);
5909
5909
  }
5910
5910
  const P = Si(R);
5911
- return Fi(P, b);
5911
+ return ki(P, b);
5912
5912
  }
5913
5913
  async function Mi(l) {
5914
5914
  const { candidate: c, focus: u, context: o, dialecteConfig: h, databaseInstance: m, path: y, shouldCollect: b } = l;
@@ -5956,8 +5956,8 @@ async function ji(l) {
5956
5956
  async function Ki(l) {
5957
5957
  const { candidate: c, focus: u, context: o, dialecteConfig: h, databaseInstance: m, path: y, shouldCollect: b } = l, R = b ? [c] : [];
5958
5958
  let P = c.parent;
5959
- for (let G = y.length - 1; G >= 0; G--) {
5960
- const z = y[G], H = await qi({
5959
+ for (let V = y.length - 1; V >= 0; V--) {
5960
+ const z = y[V], H = await qi({
5961
5961
  current: P,
5962
5962
  expected: z,
5963
5963
  context: o,
@@ -6064,7 +6064,7 @@ async function Gi(l) {
6064
6064
  tagName: b.tagName,
6065
6065
  attributes: b.attributes
6066
6066
  });
6067
- return await ki({
6067
+ return await Fi({
6068
6068
  context: c,
6069
6069
  dialecteConfig: u,
6070
6070
  databaseInstance: o,
@@ -6160,10 +6160,10 @@ function Ta(l) {
6160
6160
  }
6161
6161
  function zi(l) {
6162
6162
  return async function() {
6163
- const { contextPromise: u, dialecteConfig: o, databaseInstance: h } = l, m = o.database.tables.xmlElements.name, y = h.table(m), b = structuredClone(await u), { creates: R, updates: P, deletes: q } = Wi(b.stagedOperations), G = R.length + P.length + q.length;
6163
+ const { contextPromise: u, dialecteConfig: o, databaseInstance: h } = l, m = o.database.tables.xmlElements.name, y = h.table(m), b = structuredClone(await u), { creates: R, updates: P, deletes: q } = Wi(b.stagedOperations), V = R.length + P.length + q.length;
6164
6164
  st.updateEndingProgress({
6165
6165
  current: 0,
6166
- total: G,
6166
+ total: V,
6167
6167
  operation: "Committing changes"
6168
6168
  });
6169
6169
  try {
@@ -6171,15 +6171,15 @@ function zi(l) {
6171
6171
  let z = 0;
6172
6172
  R.length > 0 && (await y.bulkAdd(R.map((H) => H.newRecord)), z += R.length, st.updateEndingProgress({
6173
6173
  current: z,
6174
- total: G,
6174
+ total: V,
6175
6175
  operation: `Created ${R.length} elements`
6176
6176
  })), P.length > 0 && (await y.bulkPut(P.map((H) => H.newRecord)), z += P.length, st.updateEndingProgress({
6177
6177
  current: z,
6178
- total: G,
6178
+ total: V,
6179
6179
  operation: `Updated ${P.length} elements`
6180
6180
  })), q.length > 0 && (await y.bulkDelete(q.map((H) => H.oldRecord.id)), z += q.length, st.updateEndingProgress({
6181
6181
  current: z,
6182
- total: G,
6182
+ total: V,
6183
6183
  operation: `Deleted ${q.length} elements`
6184
6184
  }));
6185
6185
  }), b.stagedOperations = [], st.setComplete();
@@ -6200,32 +6200,32 @@ function zi(l) {
6200
6200
  function Qi(l) {
6201
6201
  const { chain: c, contextPromise: u, dialecteConfig: o } = l;
6202
6202
  return function(h) {
6203
- const { id: m, tagName: y, attributes: b, namespace: R, value: P, setFocus: q = !1 } = h, G = m ?? crypto.randomUUID(), z = u.then((H) => {
6203
+ const { id: m, tagName: y, attributes: b, namespace: R, value: P, setFocus: q = !1 } = h, V = m ?? crypto.randomUUID(), z = u.then((H) => {
6204
6204
  try {
6205
6205
  st.setOperation(`Creating ${y}`);
6206
6206
  const M = la({
6207
6207
  record: {
6208
- id: G,
6208
+ id: V,
6209
6209
  tagName: y,
6210
6210
  attributes: b,
6211
6211
  namespace: R,
6212
6212
  value: P
6213
6213
  },
6214
6214
  dialecteConfig: o
6215
- }), { childRecord: k, updatedParent: J } = Hi({
6215
+ }), { childRecord: F, updatedParent: Z } = Hi({
6216
6216
  record: M,
6217
6217
  context: H,
6218
6218
  dialecteConfig: o
6219
6219
  });
6220
6220
  return q ? {
6221
6221
  ...H,
6222
- currentFocus: k
6222
+ currentFocus: F
6223
6223
  } : {
6224
6224
  ...H,
6225
- currentFocus: J
6225
+ currentFocus: Z
6226
6226
  };
6227
6227
  } catch (M) {
6228
- const k = Ta({
6228
+ const F = Ta({
6229
6229
  errorKey: "CREATE_CHILD_ERROR",
6230
6230
  context: {
6231
6231
  method: "addChild",
@@ -6235,7 +6235,7 @@ function Qi(l) {
6235
6235
  originalError: M
6236
6236
  }
6237
6237
  });
6238
- throw st.setError(k), k;
6238
+ throw st.setError(F), F;
6239
6239
  }
6240
6240
  });
6241
6241
  return c(q ? {
@@ -6287,35 +6287,40 @@ function Hi(l) {
6287
6287
  };
6288
6288
  }
6289
6289
  function Zi(l) {
6290
- const { chain: c, contextPromise: u } = l;
6291
- return function(o) {
6292
- const { record: h, setFocus: m } = o, y = u.then(async (b) => {
6293
- const R = c({
6294
- contextPromise: Promise.resolve(b)
6290
+ const { chain: c, contextPromise: u, dialecteConfig: o } = l;
6291
+ return function(h) {
6292
+ const { record: m, setFocus: y } = h, b = u.then(async (R) => {
6293
+ const P = c({
6294
+ contextPromise: Promise.resolve(R)
6295
6295
  });
6296
- let P = await q({
6297
- chain: R,
6298
- childRecord: h
6296
+ let q = await V({
6297
+ chain: P,
6298
+ childRecord: m
6299
6299
  });
6300
- async function q(G) {
6301
- const { chain: z, childRecord: H } = G;
6302
- let k = z.addChild({
6303
- tagName: H.tagName,
6304
- namespace: H.namespace,
6305
- attributes: H.attributes,
6306
- value: H.value,
6307
- setFocus: !0
6308
- });
6309
- for (const J of H.tree)
6310
- k = await q({ chain: k, childRecord: J }), k = k.goToParent();
6311
- return k;
6300
+ async function V(z) {
6301
+ const { chain: H, childRecord: M } = z;
6302
+ let F = !0, Z = M, re = H;
6303
+ if (o.hooks?.beforeClone && ({ shouldBeCloned: F, transformedRecord: Z } = o.hooks.beforeClone({
6304
+ record: Z
6305
+ })), F) {
6306
+ re = H.addChild({
6307
+ tagName: Z.tagName,
6308
+ namespace: Z.namespace,
6309
+ attributes: Z.attributes,
6310
+ value: Z.value,
6311
+ setFocus: !0
6312
+ });
6313
+ for (const ee of Z.tree)
6314
+ re = await V({ chain: re, childRecord: ee }), re = re.goToParent();
6315
+ }
6316
+ return re;
6312
6317
  }
6313
- return m || (P = P.goToParent()), await P.getContext();
6318
+ return y || (q = q.goToParent()), await q.getContext();
6314
6319
  });
6315
- return c(m ? {
6316
- contextPromise: y
6320
+ return c(y ? {
6321
+ contextPromise: b
6317
6322
  } : {
6318
- contextPromise: y
6323
+ contextPromise: b
6319
6324
  });
6320
6325
  };
6321
6326
  }
@@ -6332,10 +6337,10 @@ function Ji(l) {
6332
6337
  dialecteConfig: o
6333
6338
  });
6334
6339
  q = [...P.attributes.filter(
6335
- (M) => !z.some((k) => k.name === M.name)
6340
+ (M) => !z.some((F) => F.name === M.name)
6336
6341
  ), ...z];
6337
6342
  }
6338
- const G = {
6343
+ const V = {
6339
6344
  ...P,
6340
6345
  attributes: q,
6341
6346
  value: y !== void 0 ? y : P.value
@@ -6344,10 +6349,10 @@ function Ji(l) {
6344
6349
  context: R,
6345
6350
  status: "updated",
6346
6351
  oldRecord: P,
6347
- newRecord: G
6352
+ newRecord: V
6348
6353
  }), {
6349
6354
  ...R,
6350
- currentFocus: Pe({ record: G, status: "updated" })
6355
+ currentFocus: Pe({ record: V, status: "updated" })
6351
6356
  };
6352
6357
  });
6353
6358
  return c({ contextPromise: b });
@@ -6430,18 +6435,18 @@ async function ts(l) {
6430
6435
  function ns(l) {
6431
6436
  const { chain: c, contextPromise: u, dialecteConfig: o, databaseInstance: h } = l;
6432
6437
  return function(y) {
6433
- const { tagName: b, id: R } = y, P = o.database.tables.xmlElements.name, q = u.then(async (G) => {
6438
+ const { tagName: b, id: R } = y, P = o.database.tables.xmlElements.name, q = u.then(async (V) => {
6434
6439
  const z = o.singletonElements?.includes(b), H = R ? yr({
6435
- stagedOperations: G.stagedOperations,
6440
+ stagedOperations: V.stagedOperations,
6436
6441
  id: R,
6437
6442
  tagName: b
6438
6443
  }) : null;
6439
6444
  let M = H?.status !== "deleted" ? H?.record : void 0;
6440
6445
  if (!M) {
6441
- const k = h.table(P);
6446
+ const F = h.table(P);
6442
6447
  if (!R && !z)
6443
6448
  throw new Error(`Element ${b} requires an id parameter`);
6444
- M = await (z && !R ? k.where("tagName").equals(b).first() : k.get({ id: R, tagName: b }));
6449
+ M = await (z && !R ? F.where("tagName").equals(b).first() : F.get({ id: R, tagName: b }));
6445
6450
  }
6446
6451
  return Ee(
6447
6452
  M,
@@ -6450,7 +6455,7 @@ function ns(l) {
6450
6455
  M.tagName === b,
6451
6456
  `Element tagName mismatch: expected "${b}", got "${M.tagName}"`
6452
6457
  ), {
6453
- ...G,
6458
+ ...V,
6454
6459
  currentFocus: Pe({ record: M })
6455
6460
  };
6456
6461
  });
@@ -6474,7 +6479,7 @@ function rs(l) {
6474
6479
  if (P)
6475
6480
  q = P.record;
6476
6481
  else {
6477
- const G = o.database.tables.xmlElements.name, z = await h.table(G).get({
6482
+ const V = o.database.tables.xmlElements.name, z = await h.table(V).get({
6478
6483
  id: R.id,
6479
6484
  tagName: R.tagName
6480
6485
  });
@@ -6526,7 +6531,8 @@ function as(l) {
6526
6531
  }),
6527
6532
  deepCloneChild: Zi({
6528
6533
  chain: c,
6529
- contextPromise: u
6534
+ contextPromise: u,
6535
+ dialecteConfig: o
6530
6536
  }),
6531
6537
  update: Ji({
6532
6538
  chain: c,
@@ -6622,7 +6628,7 @@ export {
6622
6628
  ci as getDatabaseName,
6623
6629
  yr as getLatestStagedRecord,
6624
6630
  Ye as getRecord,
6625
- Fo as getState,
6631
+ ko as getState,
6626
6632
  si as importXmlFiles,
6627
6633
  ss as isChainRecord,
6628
6634
  ui as isFileSupported,