pinia-plugin-persist-state 0.0.0-beta.2 → 0.0.0-beta.3
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.
|
@@ -68,7 +68,7 @@ class un {
|
|
|
68
68
|
this._name = t, this._createInstance = n, s && (this._console = s);
|
|
69
69
|
}
|
|
70
70
|
invoke({ store: t, options: n }, s) {
|
|
71
|
-
return this._storeInstance = this._createInstance(t, { ...n, ...this.pluginOptions }, s, this.console), this._storeInstance ? (this._subscriptions = this._storeInstance.getSubscriptions(), this._storeMutationSubscription = this._storeInstance.storeSubscribe, this._storeOnActionSubscription = this._storeInstance.onAction, this.pluginCreated && this.pluginCreated(t), !0) : !1;
|
|
71
|
+
return this._storeInstance = this._createInstance(t, { ...n, ...this.pluginOptions }, s, this.console), this._storeInstance ? (this._storeInstance.resetCallback && (this._resetStoreCallback = this._storeInstance.resetCallback), this._subscriptions = this._storeInstance.getSubscriptions(), this._storeMutationSubscription = this._storeInstance.storeSubscribe, this._storeOnActionSubscription = this._storeInstance.onAction, this.pluginCreated && this.pluginCreated(t), !0) : !1;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
class fn {
|
|
@@ -169,7 +169,7 @@ const Ae = process.env.NODE_ENV !== "production" ? Object.freeze({}) : {};
|
|
|
169
169
|
process.env.NODE_ENV !== "production" && Object.freeze([]);
|
|
170
170
|
const bn = () => {
|
|
171
171
|
}, Sn = (e) => e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && // uppercase letter
|
|
172
|
-
(e.charCodeAt(2) > 122 || e.charCodeAt(2) < 97), X = Object.assign, vn = Object.prototype.hasOwnProperty, Me = (e, t) => vn.call(e, t), g = Array.isArray, ee = (e) => gt(e) === "[object Map]", T = (e) => typeof e == "function",
|
|
172
|
+
(e.charCodeAt(2) > 122 || e.charCodeAt(2) < 97), X = Object.assign, vn = Object.prototype.hasOwnProperty, Me = (e, t) => vn.call(e, t), g = Array.isArray, ee = (e) => gt(e) === "[object Map]", T = (e) => typeof e == "function", V = (e) => typeof e == "string", ce = (e) => typeof e == "symbol", y = (e) => e !== null && typeof e == "object", wn = Object.prototype.toString, gt = (e) => wn.call(e), yt = (e) => gt(e).slice(8, -1), we = (e) => V(e) && e !== "NaN" && e[0] !== "-" && "" + parseInt(e, 10) === e, En = (e) => {
|
|
173
173
|
const t = /* @__PURE__ */ Object.create(null);
|
|
174
174
|
return ((n) => t[n] || (t[n] = e(n)));
|
|
175
175
|
}, Nn = En((e) => e.charAt(0).toUpperCase() + e.slice(1)), ze = (e, t) => !Object.is(e, t);
|
|
@@ -179,28 +179,28 @@ function Be(e) {
|
|
|
179
179
|
if (g(e)) {
|
|
180
180
|
const t = {};
|
|
181
181
|
for (let n = 0; n < e.length; n++) {
|
|
182
|
-
const s = e[n], r =
|
|
182
|
+
const s = e[n], r = V(s) ? Vn(s) : Be(s);
|
|
183
183
|
if (r)
|
|
184
184
|
for (const o in r)
|
|
185
185
|
t[o] = r[o];
|
|
186
186
|
}
|
|
187
187
|
return t;
|
|
188
|
-
} else if (
|
|
188
|
+
} else if (V(e) || y(e))
|
|
189
189
|
return e;
|
|
190
190
|
}
|
|
191
|
-
const On = /;(?![^(]*\))/g,
|
|
192
|
-
function
|
|
191
|
+
const On = /;(?![^(]*\))/g, kn = /:([^]+)/, Cn = /\/\*[^]*?\*\//g;
|
|
192
|
+
function Vn(e) {
|
|
193
193
|
const t = {};
|
|
194
|
-
return e.replace(
|
|
194
|
+
return e.replace(Cn, "").split(On).forEach((n) => {
|
|
195
195
|
if (n) {
|
|
196
|
-
const s = n.split(
|
|
196
|
+
const s = n.split(kn);
|
|
197
197
|
s.length > 1 && (t[s[0].trim()] = s[1].trim());
|
|
198
198
|
}
|
|
199
199
|
}), t;
|
|
200
200
|
}
|
|
201
201
|
function We(e) {
|
|
202
202
|
let t = "";
|
|
203
|
-
if (
|
|
203
|
+
if (V(e))
|
|
204
204
|
t = e;
|
|
205
205
|
else if (g(e))
|
|
206
206
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -215,7 +215,7 @@ function We(e) {
|
|
|
215
215
|
function G(e, ...t) {
|
|
216
216
|
console.warn(`[Vue warn] ${e}`, ...t);
|
|
217
217
|
}
|
|
218
|
-
let mt = 0,
|
|
218
|
+
let mt = 0, ke;
|
|
219
219
|
function Je() {
|
|
220
220
|
mt++;
|
|
221
221
|
}
|
|
@@ -223,9 +223,9 @@ function Ye() {
|
|
|
223
223
|
if (--mt > 0)
|
|
224
224
|
return;
|
|
225
225
|
let e;
|
|
226
|
-
for (;
|
|
227
|
-
let t =
|
|
228
|
-
for (
|
|
226
|
+
for (; ke; ) {
|
|
227
|
+
let t = ke;
|
|
228
|
+
for (ke = void 0; t; ) {
|
|
229
229
|
const n = t.next;
|
|
230
230
|
if (t.next = void 0, t.flags &= -9, t.flags & 1)
|
|
231
231
|
try {
|
|
@@ -238,7 +238,7 @@ function Ye() {
|
|
|
238
238
|
}
|
|
239
239
|
if (e) throw e;
|
|
240
240
|
}
|
|
241
|
-
class
|
|
241
|
+
class In {
|
|
242
242
|
// TODO isolatedDeclarations "__v_skip"
|
|
243
243
|
constructor(t) {
|
|
244
244
|
this.computed = t, this.version = 0, this.activeLink = void 0, this.subs = void 0, this.map = void 0, this.key = void 0, this.sc = 0, this.__v_skip = !0, process.env.NODE_ENV !== "production" && (this.subsHead = void 0);
|
|
@@ -268,7 +268,7 @@ class xn {
|
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
const bt = /* @__PURE__ */ new WeakMap(),
|
|
271
|
+
const bt = /* @__PURE__ */ new WeakMap(), Ce = /* @__PURE__ */ Symbol(
|
|
272
272
|
process.env.NODE_ENV !== "production" ? "Object iterate" : ""
|
|
273
273
|
), ct = /* @__PURE__ */ Symbol(
|
|
274
274
|
process.env.NODE_ENV !== "production" ? "Map keys iterate" : ""
|
|
@@ -301,36 +301,36 @@ function P(e, t, n, s, r, o) {
|
|
|
301
301
|
} else
|
|
302
302
|
switch ((n !== void 0 || i.has(void 0)) && c(i.get(n)), f && c(i.get(at)), t) {
|
|
303
303
|
case "add":
|
|
304
|
-
l ? f && c(i.get("length")) : (c(i.get(
|
|
304
|
+
l ? f && c(i.get("length")) : (c(i.get(Ce)), ee(e) && c(i.get(ct)));
|
|
305
305
|
break;
|
|
306
306
|
case "delete":
|
|
307
|
-
l || (c(i.get(
|
|
307
|
+
l || (c(i.get(Ce)), ee(e) && c(i.get(ct)));
|
|
308
308
|
break;
|
|
309
309
|
case "set":
|
|
310
|
-
ee(e) && c(i.get(
|
|
310
|
+
ee(e) && c(i.get(Ce));
|
|
311
311
|
break;
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
Ye();
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function xn(e, t) {
|
|
317
317
|
const n = bt.get(e);
|
|
318
318
|
return n && n.get(t);
|
|
319
319
|
}
|
|
320
320
|
function q(e) {
|
|
321
321
|
const t = p(e);
|
|
322
|
-
return t === e || v(e) ? t : t.map(
|
|
322
|
+
return t === e || v(e) ? t : t.map(I);
|
|
323
323
|
}
|
|
324
324
|
function Ge(e) {
|
|
325
325
|
return e = p(e), e;
|
|
326
326
|
}
|
|
327
|
-
function
|
|
328
|
-
return E(e) ? Qe(e) ? ne(
|
|
327
|
+
function x(e, t) {
|
|
328
|
+
return E(e) ? Qe(e) ? ne(I(t)) : ne(t) : I(t);
|
|
329
329
|
}
|
|
330
330
|
const Rn = {
|
|
331
331
|
__proto__: null,
|
|
332
332
|
[Symbol.iterator]() {
|
|
333
|
-
return
|
|
333
|
+
return Ve(this, Symbol.iterator, (e) => x(this, e));
|
|
334
334
|
},
|
|
335
335
|
concat(...e) {
|
|
336
336
|
return q(this).concat(
|
|
@@ -338,7 +338,7 @@ const Rn = {
|
|
|
338
338
|
);
|
|
339
339
|
},
|
|
340
340
|
entries() {
|
|
341
|
-
return
|
|
341
|
+
return Ve(this, "entries", (e) => (e[1] = x(this, e[1]), e));
|
|
342
342
|
},
|
|
343
343
|
every(e, t) {
|
|
344
344
|
return O(this, "every", e, t, void 0, arguments);
|
|
@@ -349,7 +349,7 @@ const Rn = {
|
|
|
349
349
|
"filter",
|
|
350
350
|
e,
|
|
351
351
|
t,
|
|
352
|
-
(n) => n.map((s) =>
|
|
352
|
+
(n) => n.map((s) => x(this, s)),
|
|
353
353
|
arguments
|
|
354
354
|
);
|
|
355
355
|
},
|
|
@@ -359,7 +359,7 @@ const Rn = {
|
|
|
359
359
|
"find",
|
|
360
360
|
e,
|
|
361
361
|
t,
|
|
362
|
-
(n) =>
|
|
362
|
+
(n) => x(this, n),
|
|
363
363
|
arguments
|
|
364
364
|
);
|
|
365
365
|
},
|
|
@@ -372,7 +372,7 @@ const Rn = {
|
|
|
372
372
|
"findLast",
|
|
373
373
|
e,
|
|
374
374
|
t,
|
|
375
|
-
(n) =>
|
|
375
|
+
(n) => x(this, n),
|
|
376
376
|
arguments
|
|
377
377
|
);
|
|
378
378
|
},
|
|
@@ -384,17 +384,17 @@ const Rn = {
|
|
|
384
384
|
return O(this, "forEach", e, t, void 0, arguments);
|
|
385
385
|
},
|
|
386
386
|
includes(...e) {
|
|
387
|
-
return
|
|
387
|
+
return Ie(this, "includes", e);
|
|
388
388
|
},
|
|
389
389
|
indexOf(...e) {
|
|
390
|
-
return
|
|
390
|
+
return Ie(this, "indexOf", e);
|
|
391
391
|
},
|
|
392
392
|
join(e) {
|
|
393
393
|
return q(this).join(e);
|
|
394
394
|
},
|
|
395
395
|
// keys() iterator only reads `length`, no optimization required
|
|
396
396
|
lastIndexOf(...e) {
|
|
397
|
-
return
|
|
397
|
+
return Ie(this, "lastIndexOf", e);
|
|
398
398
|
},
|
|
399
399
|
map(e, t) {
|
|
400
400
|
return O(this, "map", e, t, void 0, arguments);
|
|
@@ -434,10 +434,10 @@ const Rn = {
|
|
|
434
434
|
return Z(this, "unshift", e);
|
|
435
435
|
},
|
|
436
436
|
values() {
|
|
437
|
-
return
|
|
437
|
+
return Ve(this, "values", (e) => x(this, e));
|
|
438
438
|
}
|
|
439
439
|
};
|
|
440
|
-
function
|
|
440
|
+
function Ve(e, t, n) {
|
|
441
441
|
const s = Ge(e), r = s[t]();
|
|
442
442
|
return s !== e && !v(e) && (r._next = r.next, r.next = () => {
|
|
443
443
|
const o = r._next();
|
|
@@ -449,11 +449,11 @@ function O(e, t, n, s, r, o) {
|
|
|
449
449
|
const i = Ge(e), c = i !== e && !v(e), l = i[t];
|
|
450
450
|
if (l !== Dn[t]) {
|
|
451
451
|
const a = l.apply(e, o);
|
|
452
|
-
return c ?
|
|
452
|
+
return c ? I(a) : a;
|
|
453
453
|
}
|
|
454
454
|
let f = n;
|
|
455
455
|
i !== e && (c ? f = function(a, u) {
|
|
456
|
-
return n.call(this,
|
|
456
|
+
return n.call(this, x(e, a), u, e);
|
|
457
457
|
} : n.length > 2 && (f = function(a, u) {
|
|
458
458
|
return n.call(this, a, u, e);
|
|
459
459
|
}));
|
|
@@ -466,10 +466,10 @@ function lt(e, t, n, s) {
|
|
|
466
466
|
return r !== e && (v(e) ? n.length > 3 && (o = function(i, c, l) {
|
|
467
467
|
return n.call(this, i, c, l, e);
|
|
468
468
|
}) : o = function(i, c, l) {
|
|
469
|
-
return n.call(this, i,
|
|
469
|
+
return n.call(this, i, x(e, c), l, e);
|
|
470
470
|
}), r[t](o, ...s);
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function Ie(e, t, n) {
|
|
473
473
|
const s = p(e), r = s[t](...n);
|
|
474
474
|
return (r === -1 || r === !1) && te(n[0]) ? (n[0] = p(n[0]), s[t](...n)) : r;
|
|
475
475
|
}
|
|
@@ -581,7 +581,7 @@ class Tn extends vt {
|
|
|
581
581
|
const An = /* @__PURE__ */ new $n(), Mn = /* @__PURE__ */ new Tn(), ae = (e) => Reflect.getPrototypeOf(e);
|
|
582
582
|
function Fn(e, t, n) {
|
|
583
583
|
return function(...s) {
|
|
584
|
-
const r = this.__v_raw, o = p(r), i = ee(o), c = e === "entries" || e === Symbol.iterator && i, l = r[e](...s), f = t ? ne :
|
|
584
|
+
const r = this.__v_raw, o = p(r), i = ee(o), c = e === "entries" || e === Symbol.iterator && i, l = r[e](...s), f = t ? ne : I;
|
|
585
585
|
return {
|
|
586
586
|
// iterator protocol
|
|
587
587
|
next() {
|
|
@@ -613,7 +613,7 @@ function le(e) {
|
|
|
613
613
|
function Kn(e, t) {
|
|
614
614
|
const n = {
|
|
615
615
|
get(s) {
|
|
616
|
-
const r = this.__v_raw, o = p(r), i = p(s), { has: c } = ae(o), l = e ? ne :
|
|
616
|
+
const r = this.__v_raw, o = p(r), i = p(s), { has: c } = ae(o), l = e ? ne : I;
|
|
617
617
|
if (c.call(o, s))
|
|
618
618
|
return l(r.get(s));
|
|
619
619
|
if (c.call(o, i))
|
|
@@ -633,7 +633,7 @@ function Kn(e, t) {
|
|
|
633
633
|
forEach(s, r) {
|
|
634
634
|
const o = this, i = o.__v_raw;
|
|
635
635
|
p(i);
|
|
636
|
-
const c = e ? ne :
|
|
636
|
+
const c = e ? ne : I;
|
|
637
637
|
return i.forEach((l, f) => s.call(r, c(l), c(f), o));
|
|
638
638
|
}
|
|
639
639
|
};
|
|
@@ -726,7 +726,7 @@ function Bn(e) {
|
|
|
726
726
|
return e.__v_skip || !Object.isExtensible(e) ? 0 : zn(yt(e));
|
|
727
727
|
}
|
|
728
728
|
function Ot(e) {
|
|
729
|
-
return E(e) ? e :
|
|
729
|
+
return E(e) ? e : kt(
|
|
730
730
|
e,
|
|
731
731
|
!1,
|
|
732
732
|
An,
|
|
@@ -735,7 +735,7 @@ function Ot(e) {
|
|
|
735
735
|
);
|
|
736
736
|
}
|
|
737
737
|
function Fe(e) {
|
|
738
|
-
return
|
|
738
|
+
return kt(
|
|
739
739
|
e,
|
|
740
740
|
!0,
|
|
741
741
|
Mn,
|
|
@@ -743,7 +743,7 @@ function Fe(e) {
|
|
|
743
743
|
Nt
|
|
744
744
|
);
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function kt(e, t, n, s, r) {
|
|
747
747
|
if (!y(e))
|
|
748
748
|
return process.env.NODE_ENV !== "production" && G(
|
|
749
749
|
`value cannot be made ${t ? "readonly" : "reactive"}: ${String(
|
|
@@ -780,11 +780,11 @@ function p(e) {
|
|
|
780
780
|
const t = e && e.__v_raw;
|
|
781
781
|
return t ? p(t) : e;
|
|
782
782
|
}
|
|
783
|
-
const
|
|
783
|
+
const I = (e) => y(e) ? Ot(e) : e, ne = (e) => y(e) ? Fe(e) : e;
|
|
784
784
|
function m(e) {
|
|
785
785
|
return e ? e.__v_isRef === !0 : !1;
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function Ct(e) {
|
|
788
788
|
return Wn(e, !1);
|
|
789
789
|
}
|
|
790
790
|
function Wn(e, t) {
|
|
@@ -792,7 +792,7 @@ function Wn(e, t) {
|
|
|
792
792
|
}
|
|
793
793
|
class Jn {
|
|
794
794
|
constructor(t, n) {
|
|
795
|
-
this.dep = new
|
|
795
|
+
this.dep = new In(), this.__v_isRef = !0, this.__v_isShallow = !1, this._rawValue = n ? t : p(t), this._value = n ? t : I(t), this.__v_isShallow = n;
|
|
796
796
|
}
|
|
797
797
|
get value() {
|
|
798
798
|
return process.env.NODE_ENV !== "production" ? this.dep.track({
|
|
@@ -803,7 +803,7 @@ class Jn {
|
|
|
803
803
|
}
|
|
804
804
|
set value(t) {
|
|
805
805
|
const n = this._rawValue, s = this.__v_isShallow || v(t) || E(t);
|
|
806
|
-
t = s ? t : p(t), ze(t, n) && (this._rawValue = t, this._value = s ? t :
|
|
806
|
+
t = s ? t : p(t), ze(t, n) && (this._rawValue = t, this._value = s ? t : I(t), process.env.NODE_ENV !== "production" ? this.dep.trigger({
|
|
807
807
|
target: this,
|
|
808
808
|
type: "set",
|
|
809
809
|
key: "value",
|
|
@@ -840,7 +840,7 @@ class Gn {
|
|
|
840
840
|
this._object[this._key] = t;
|
|
841
841
|
}
|
|
842
842
|
get dep() {
|
|
843
|
-
return
|
|
843
|
+
return xn(this._raw, this._key);
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
846
|
class Qn {
|
|
@@ -852,7 +852,7 @@ class Qn {
|
|
|
852
852
|
}
|
|
853
853
|
}
|
|
854
854
|
function Xn(e, t, n) {
|
|
855
|
-
return m(e) ? e : T(e) ? new Qn(e) : y(e) && arguments.length > 1 ? Zn(e, t, n) :
|
|
855
|
+
return m(e) ? e : T(e) ? new Qn(e) : y(e) && arguments.length > 1 ? Zn(e, t, n) : Ct(e);
|
|
856
856
|
}
|
|
857
857
|
function Zn(e, t, n) {
|
|
858
858
|
return new Gn(e, t, n);
|
|
@@ -864,10 +864,10 @@ function es(e) {
|
|
|
864
864
|
function ts() {
|
|
865
865
|
M.pop();
|
|
866
866
|
}
|
|
867
|
-
let
|
|
867
|
+
let xe = !1;
|
|
868
868
|
function se(e, ...t) {
|
|
869
|
-
if (
|
|
870
|
-
|
|
869
|
+
if (xe) return;
|
|
870
|
+
xe = !0;
|
|
871
871
|
const n = M.length ? M[M.length - 1].component : null, s = n && n.appContext.config.warnHandler, r = ns();
|
|
872
872
|
if (s)
|
|
873
873
|
Xe(
|
|
@@ -893,7 +893,7 @@ function se(e, ...t) {
|
|
|
893
893
|
r.length && o.push(`
|
|
894
894
|
`, ...ss(r)), console.warn(...o);
|
|
895
895
|
}
|
|
896
|
-
|
|
896
|
+
xe = !1;
|
|
897
897
|
}
|
|
898
898
|
function ns() {
|
|
899
899
|
let e = M[M.length - 1];
|
|
@@ -929,13 +929,13 @@ function rs({ vnode: e, recurseCount: t }) {
|
|
|
929
929
|
function os(e) {
|
|
930
930
|
const t = [], n = Object.keys(e);
|
|
931
931
|
return n.slice(0, 3).forEach((s) => {
|
|
932
|
-
t.push(...
|
|
932
|
+
t.push(...Vt(s, e[s]));
|
|
933
933
|
}), n.length > 3 && t.push(" ..."), t;
|
|
934
934
|
}
|
|
935
|
-
function
|
|
936
|
-
return
|
|
935
|
+
function Vt(e, t, n) {
|
|
936
|
+
return V(t) ? (t = JSON.stringify(t), n ? t : [`${e}=${t}`]) : typeof t == "number" || typeof t == "boolean" || t == null ? n ? t : [`${e}=${t}`] : m(t) ? (t = Vt(e, p(t.value), !0), n ? t : [`${e}=Ref<`, t, ">"]) : T(t) ? [`${e}=fn${t.name ? `<${t.name}>` : ""}`] : (t = p(t), n ? t : [`${e}=`, t]);
|
|
937
937
|
}
|
|
938
|
-
const
|
|
938
|
+
const It = {
|
|
939
939
|
sp: "serverPrefetch hook",
|
|
940
940
|
bc: "beforeCreate hook",
|
|
941
941
|
c: "created hook",
|
|
@@ -972,14 +972,14 @@ function Xe(e, t, n, s) {
|
|
|
972
972
|
try {
|
|
973
973
|
return s ? e(...s) : e();
|
|
974
974
|
} catch (r) {
|
|
975
|
-
|
|
975
|
+
xt(r, t, n);
|
|
976
976
|
}
|
|
977
977
|
}
|
|
978
|
-
function
|
|
978
|
+
function xt(e, t, n, s = !0) {
|
|
979
979
|
const r = t ? t.vnode : null, { errorHandler: o, throwUnhandledErrorInProduction: i } = t && t.appContext.config || Ae;
|
|
980
980
|
if (t) {
|
|
981
981
|
let c = t.parent;
|
|
982
|
-
const l = t.proxy, f = process.env.NODE_ENV !== "production" ?
|
|
982
|
+
const l = t.proxy, f = process.env.NODE_ENV !== "production" ? It[n] : `https://vuejs.org/error-reference/#runtime-${n}`;
|
|
983
983
|
for (; c; ) {
|
|
984
984
|
const h = c.ec;
|
|
985
985
|
if (h) {
|
|
@@ -1002,7 +1002,7 @@ function It(e, t, n, s = !0) {
|
|
|
1002
1002
|
}
|
|
1003
1003
|
function is(e, t, n, s = !0, r = !1) {
|
|
1004
1004
|
if (process.env.NODE_ENV !== "production") {
|
|
1005
|
-
const o =
|
|
1005
|
+
const o = It[t];
|
|
1006
1006
|
if (n && es(n), se(`Unhandled error${o ? ` during execution of ${o}` : ""}`), n && ts(), s)
|
|
1007
1007
|
throw e;
|
|
1008
1008
|
console.error(e);
|
|
@@ -1013,14 +1013,14 @@ function is(e, t, n, s = !0, r = !1) {
|
|
|
1013
1013
|
}
|
|
1014
1014
|
}
|
|
1015
1015
|
const b = [];
|
|
1016
|
-
let
|
|
1016
|
+
let k = -1;
|
|
1017
1017
|
const J = [];
|
|
1018
1018
|
let R = null, U = 0;
|
|
1019
1019
|
const cs = /* @__PURE__ */ Promise.resolve();
|
|
1020
1020
|
let Ke = null;
|
|
1021
1021
|
const as = 100;
|
|
1022
1022
|
function ls(e) {
|
|
1023
|
-
let t =
|
|
1023
|
+
let t = k + 1, n = b.length;
|
|
1024
1024
|
for (; t < n; ) {
|
|
1025
1025
|
const s = t + n >>> 1, r = b[s], o = re(r);
|
|
1026
1026
|
o < e || o === e && r.flags & 2 ? t = s + 1 : n = s;
|
|
@@ -1061,8 +1061,8 @@ function Dt(e) {
|
|
|
1061
1061
|
process.env.NODE_ENV !== "production" && (e = e || /* @__PURE__ */ new Map());
|
|
1062
1062
|
const t = process.env.NODE_ENV !== "production" ? (n) => Pt(e, n) : bn;
|
|
1063
1063
|
try {
|
|
1064
|
-
for (
|
|
1065
|
-
const n = b[
|
|
1064
|
+
for (k = 0; k < b.length; k++) {
|
|
1065
|
+
const n = b[k];
|
|
1066
1066
|
if (n && !(n.flags & 8)) {
|
|
1067
1067
|
if (process.env.NODE_ENV !== "production" && t(n))
|
|
1068
1068
|
continue;
|
|
@@ -1074,18 +1074,18 @@ function Dt(e) {
|
|
|
1074
1074
|
}
|
|
1075
1075
|
}
|
|
1076
1076
|
} finally {
|
|
1077
|
-
for (;
|
|
1078
|
-
const n = b[
|
|
1077
|
+
for (; k < b.length; k++) {
|
|
1078
|
+
const n = b[k];
|
|
1079
1079
|
n && (n.flags &= -2);
|
|
1080
1080
|
}
|
|
1081
|
-
|
|
1081
|
+
k = -1, b.length = 0, ps(e), Ke = null, (b.length || J.length) && Dt(e);
|
|
1082
1082
|
}
|
|
1083
1083
|
}
|
|
1084
1084
|
function Pt(e, t) {
|
|
1085
1085
|
const n = e.get(t) || 0;
|
|
1086
1086
|
if (n > as) {
|
|
1087
1087
|
const s = t.i, r = s && Kt(s.type);
|
|
1088
|
-
return
|
|
1088
|
+
return xt(
|
|
1089
1089
|
`Maximum recursive updates exceeded${r ? ` in component <${r}>` : ""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
|
|
1090
1090
|
null,
|
|
1091
1091
|
10
|
|
@@ -1168,7 +1168,7 @@ const Ns = (...e) => Mt(
|
|
|
1168
1168
|
ref: e,
|
|
1169
1169
|
ref_key: t,
|
|
1170
1170
|
ref_for: n
|
|
1171
|
-
}) => (typeof e == "number" && (e = "" + e), e != null ?
|
|
1171
|
+
}) => (typeof e == "number" && (e = "" + e), e != null ? V(e) || m(e) || T(e) ? { i: _e, r: e, k: t, f: !!n } : e : null);
|
|
1172
1172
|
function Os(e, t = null, n = null, s = 0, r = null, o = e === Tt ? 0 : 1, i = !1, c = !1) {
|
|
1173
1173
|
const l = {
|
|
1174
1174
|
__v_isVNode: !0,
|
|
@@ -1199,9 +1199,9 @@ function Os(e, t = null, n = null, s = 0, r = null, o = e === Tt ? 0 : 1, i = !1
|
|
|
1199
1199
|
appContext: null,
|
|
1200
1200
|
ctx: _e
|
|
1201
1201
|
};
|
|
1202
|
-
return c ? (Ze(l, n), o & 128 && e.normalize(l)) : n && (l.shapeFlag |=
|
|
1202
|
+
return c ? (Ze(l, n), o & 128 && e.normalize(l)) : n && (l.shapeFlag |= V(n) ? 8 : 16), process.env.NODE_ENV !== "production" && l.key !== l.key && se("VNode created with invalid key (NaN). VNode type:", l.type), l;
|
|
1203
1203
|
}
|
|
1204
|
-
const
|
|
1204
|
+
const ks = process.env.NODE_ENV !== "production" ? Ns : Mt;
|
|
1205
1205
|
function Mt(e, t = null, n = null, s = 0, r = null, o = !1) {
|
|
1206
1206
|
if ((!e || e === ms) && (process.env.NODE_ENV !== "production" && !e && se(`Invalid vnode type when creating vnode: ${e}.`), e = ws), Es(e)) {
|
|
1207
1207
|
const c = ge(
|
|
@@ -1213,11 +1213,11 @@ function Mt(e, t = null, n = null, s = 0, r = null, o = !1) {
|
|
|
1213
1213
|
return n && Ze(c, n), c.patchFlag = -2, c;
|
|
1214
1214
|
}
|
|
1215
1215
|
if (qt(e) && (e = e.__vccOpts), t) {
|
|
1216
|
-
t =
|
|
1216
|
+
t = Cs(t);
|
|
1217
1217
|
let { class: c, style: l } = t;
|
|
1218
|
-
c && !
|
|
1218
|
+
c && !V(c) && (t.class = We(c)), y(l) && (te(l) && !g(l) && (l = X({}, l)), t.style = Be(l));
|
|
1219
1219
|
}
|
|
1220
|
-
const i =
|
|
1220
|
+
const i = V(e) ? 1 : Ss(e) ? 128 : ys(e) ? 64 : y(e) ? 4 : T(e) ? 2 : 0;
|
|
1221
1221
|
return process.env.NODE_ENV !== "production" && i & 4 && te(e) && (e = p(e), se(
|
|
1222
1222
|
"Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",
|
|
1223
1223
|
`
|
|
@@ -1234,11 +1234,11 @@ Component that was made reactive: `,
|
|
|
1234
1234
|
!0
|
|
1235
1235
|
);
|
|
1236
1236
|
}
|
|
1237
|
-
function
|
|
1237
|
+
function Cs(e) {
|
|
1238
1238
|
return e ? te(e) || $t(e) ? X({}, e) : e : null;
|
|
1239
1239
|
}
|
|
1240
1240
|
function ge(e, t, n = !1, s = !1) {
|
|
1241
|
-
const { props: r, ref: o, patchFlag: i, children: c, transition: l } = e, f = t ?
|
|
1241
|
+
const { props: r, ref: o, patchFlag: i, children: c, transition: l } = e, f = t ? Is(r || {}, t) : r, h = {
|
|
1242
1242
|
__v_isVNode: !0,
|
|
1243
1243
|
__v_skip: !0,
|
|
1244
1244
|
type: e.type,
|
|
@@ -1291,8 +1291,8 @@ function Ft(e) {
|
|
|
1291
1291
|
const t = ge(e);
|
|
1292
1292
|
return g(e.children) && (t.children = e.children.map(Ft)), t;
|
|
1293
1293
|
}
|
|
1294
|
-
function
|
|
1295
|
-
return
|
|
1294
|
+
function Vs(e = " ", t = 0) {
|
|
1295
|
+
return ks(vs, null, e, t);
|
|
1296
1296
|
}
|
|
1297
1297
|
function Ze(e, t) {
|
|
1298
1298
|
let n = 0;
|
|
@@ -1308,10 +1308,10 @@ function Ze(e, t) {
|
|
|
1308
1308
|
return;
|
|
1309
1309
|
} else
|
|
1310
1310
|
n = 32, !t._ && !$t(t) && (t._ctx = _e);
|
|
1311
|
-
else T(t) ? (t = { default: t, _ctx: _e }, n = 32) : (t = String(t), s & 64 ? (n = 16, t = [
|
|
1311
|
+
else T(t) ? (t = { default: t, _ctx: _e }, n = 32) : (t = String(t), s & 64 ? (n = 16, t = [Vs(t)]) : n = 8);
|
|
1312
1312
|
e.children = t, e.shapeFlag |= n;
|
|
1313
1313
|
}
|
|
1314
|
-
function
|
|
1314
|
+
function Is(...e) {
|
|
1315
1315
|
const t = {};
|
|
1316
1316
|
for (let n = 0; n < e.length; n++) {
|
|
1317
1317
|
const s = e[n];
|
|
@@ -1343,7 +1343,7 @@ function xs(...e) {
|
|
|
1343
1343
|
);
|
|
1344
1344
|
}
|
|
1345
1345
|
process.env.NODE_ENV;
|
|
1346
|
-
const
|
|
1346
|
+
const xs = /(?:^|[-_])\w/g, Rs = (e) => e.replace(xs, (t) => t.toUpperCase()).replace(/[-_]/g, "");
|
|
1347
1347
|
function Kt(e, t = !0) {
|
|
1348
1348
|
return T(e) ? e.displayName || e.name : e.name || t && e.__name;
|
|
1349
1349
|
}
|
|
@@ -1499,6 +1499,7 @@ class js extends fn {
|
|
|
1499
1499
|
_className = "Store";
|
|
1500
1500
|
_onAction;
|
|
1501
1501
|
_options;
|
|
1502
|
+
_resetCallback;
|
|
1502
1503
|
_store;
|
|
1503
1504
|
_subscriptions = {};
|
|
1504
1505
|
_storeSubscribe;
|
|
@@ -1516,6 +1517,12 @@ class js extends fn {
|
|
|
1516
1517
|
get options() {
|
|
1517
1518
|
return this._options;
|
|
1518
1519
|
}
|
|
1520
|
+
get resetCallback() {
|
|
1521
|
+
return this._resetCallback;
|
|
1522
|
+
}
|
|
1523
|
+
set resetCallback(t) {
|
|
1524
|
+
this._resetCallback = t;
|
|
1525
|
+
}
|
|
1519
1526
|
get state() {
|
|
1520
1527
|
return this._store.$state;
|
|
1521
1528
|
}
|
|
@@ -1544,7 +1551,7 @@ class js extends fn {
|
|
|
1544
1551
|
* @param value
|
|
1545
1552
|
*/
|
|
1546
1553
|
addToState(t, n) {
|
|
1547
|
-
this.isOptionApi() || n?.value || (n =
|
|
1554
|
+
this.isOptionApi() || n?.value || (n = Ct(n)), this.state[t] = n, this.store[t] = Xn(this.state, t);
|
|
1548
1555
|
}
|
|
1549
1556
|
addSubscription(t, n, s) {
|
|
1550
1557
|
this._subscriptions[t] = { subscription: n, ...s ?? {} };
|
|
@@ -2143,14 +2150,14 @@ function Qs(e, t, n, s = !0, r = !1) {
|
|
|
2143
2150
|
}
|
|
2144
2151
|
}
|
|
2145
2152
|
const S = [];
|
|
2146
|
-
let
|
|
2153
|
+
let C = -1;
|
|
2147
2154
|
const Y = [];
|
|
2148
2155
|
let D = null, z = 0;
|
|
2149
2156
|
const Xs = /* @__PURE__ */ Promise.resolve();
|
|
2150
2157
|
let Ue = null;
|
|
2151
2158
|
const Zs = 100;
|
|
2152
2159
|
function er(e) {
|
|
2153
|
-
let t =
|
|
2160
|
+
let t = C + 1, n = S.length;
|
|
2154
2161
|
for (; t < n; ) {
|
|
2155
2162
|
const s = t + n >>> 1, r = S[s], o = ie(r);
|
|
2156
2163
|
o < e || o === e && r.flags & 2 ? t = s + 1 : n = s;
|
|
@@ -2191,8 +2198,8 @@ function Gt(e) {
|
|
|
2191
2198
|
process.env.NODE_ENV !== "production" && (e = e || /* @__PURE__ */ new Map());
|
|
2192
2199
|
const t = process.env.NODE_ENV !== "production" ? (n) => Qt(e, n) : Ut;
|
|
2193
2200
|
try {
|
|
2194
|
-
for (
|
|
2195
|
-
const n = S[
|
|
2201
|
+
for (C = 0; C < S.length; C++) {
|
|
2202
|
+
const n = S[C];
|
|
2196
2203
|
if (n && !(n.flags & 8)) {
|
|
2197
2204
|
if (process.env.NODE_ENV !== "production" && t(n))
|
|
2198
2205
|
continue;
|
|
@@ -2204,11 +2211,11 @@ function Gt(e) {
|
|
|
2204
2211
|
}
|
|
2205
2212
|
}
|
|
2206
2213
|
} finally {
|
|
2207
|
-
for (;
|
|
2208
|
-
const n = S[
|
|
2214
|
+
for (; C < S.length; C++) {
|
|
2215
|
+
const n = S[C];
|
|
2209
2216
|
n && (n.flags &= -2);
|
|
2210
2217
|
}
|
|
2211
|
-
|
|
2218
|
+
C = -1, S.length = 0, sr(e), Ue = null, (S.length || Y.length) && Gt(e);
|
|
2212
2219
|
}
|
|
2213
2220
|
}
|
|
2214
2221
|
function Qt(e, t) {
|
|
@@ -2639,7 +2646,7 @@ function Or() {
|
|
|
2639
2646
|
Nr();
|
|
2640
2647
|
}
|
|
2641
2648
|
process.env.NODE_ENV !== "production" && Or();
|
|
2642
|
-
const
|
|
2649
|
+
const kr = [
|
|
2643
2650
|
"@context",
|
|
2644
2651
|
"activeLink",
|
|
2645
2652
|
"computed",
|
|
@@ -2667,11 +2674,11 @@ class _t extends js {
|
|
|
2667
2674
|
persister: i,
|
|
2668
2675
|
store: t,
|
|
2669
2676
|
options: n
|
|
2670
|
-
}), this.toBeWatched() && (this._watchedStore.add(this.store.$id), this.storeSubscribe = this.storeSubscription.bind(this));
|
|
2677
|
+
}), this.toBeWatched() && (this._watchedStore.add(this.store.$id), this.storeSubscribe = this.storeSubscription.bind(this)), this.resetCallback = this.removePersistedState.bind(this);
|
|
2671
2678
|
}
|
|
2672
2679
|
augmentStore() {
|
|
2673
2680
|
const { isEncrypted: t, persistedPropertiesToEncrypt: n, watchMutation: s } = this.options;
|
|
2674
|
-
t === void 0 && (this.options.isEncrypted = !1), n === void 0 && (this.options.persistedPropertiesToEncrypt = []), s === void 0 && (this.options.watchMutation = !1), this.stateHas("isLoading") || this.addToState("isLoading", !1), this.store.persistState = async () => await this.persist(), this.store.remember = async () => await this.remember(), this.store.removePersistedState =
|
|
2681
|
+
t === void 0 && (this.options.isEncrypted = !1), n === void 0 && (this.options.persistedPropertiesToEncrypt = []), s === void 0 && (this.options.watchMutation = !1), this.stateHas("isLoading") || this.addToState("isLoading", !1), this.store.persistState = async () => await this.persist(), this.store.remember = async () => await this.remember(), this.store.removePersistedState = this.removePersistedState.bind(this), this.store.watch = this.watch, this.store.stopWatch = this.stopWatch;
|
|
2675
2682
|
}
|
|
2676
2683
|
async cryptProperty(t, n, s = !1) {
|
|
2677
2684
|
return s ? await t.decrypt(n) : await t.encrypt(n);
|
|
@@ -2731,7 +2738,7 @@ class _t extends js {
|
|
|
2731
2738
|
}
|
|
2732
2739
|
initExcludedKeys() {
|
|
2733
2740
|
return /* @__PURE__ */ new Set([
|
|
2734
|
-
...
|
|
2741
|
+
...kr,
|
|
2735
2742
|
...this.options.excludedKeys ?? []
|
|
2736
2743
|
]);
|
|
2737
2744
|
}
|
|
@@ -2748,11 +2755,14 @@ class _t extends js {
|
|
|
2748
2755
|
return n && !W(n) && this.store.$patch(n), this.state.isLoading = !1, t(!0);
|
|
2749
2756
|
});
|
|
2750
2757
|
}
|
|
2758
|
+
removePersistedState() {
|
|
2759
|
+
this._persister.removeItem(this.store.$id);
|
|
2760
|
+
}
|
|
2751
2761
|
stopWatch() {
|
|
2752
2762
|
this.options?.watchMutation && (this.options && (this.options.watchMutation = !1), this._watchedStore.delete(this.store.$id));
|
|
2753
2763
|
}
|
|
2754
2764
|
storeSubscription(t) {
|
|
2755
|
-
this.debugLog(`store
|
|
2765
|
+
this.debugLog(`store.storeSubscription() ${this.store.$id}`, [
|
|
2756
2766
|
"mutation type !== patch object: ",
|
|
2757
2767
|
t.type !== "patch object",
|
|
2758
2768
|
"watchMutation: ",
|
|
@@ -2777,7 +2787,7 @@ class _t extends js {
|
|
|
2777
2787
|
this.toBeWatched() && (this.options && (this.options.watchMutation = !0), this.storeSubscribe = this.storeSubscription.bind(this));
|
|
2778
2788
|
}
|
|
2779
2789
|
}
|
|
2780
|
-
class
|
|
2790
|
+
class Cr extends un {
|
|
2781
2791
|
constructor() {
|
|
2782
2792
|
super(
|
|
2783
2793
|
Lt,
|
|
@@ -2786,11 +2796,11 @@ class kr extends un {
|
|
|
2786
2796
|
);
|
|
2787
2797
|
}
|
|
2788
2798
|
}
|
|
2789
|
-
const ve = new
|
|
2799
|
+
const ve = new Cr();
|
|
2790
2800
|
function Rr(e, t) {
|
|
2791
|
-
return ve.pluginOptions =
|
|
2801
|
+
return ve.pluginOptions = Vr(e, t), ve;
|
|
2792
2802
|
}
|
|
2793
|
-
function
|
|
2803
|
+
function Vr(e, t) {
|
|
2794
2804
|
let n, s;
|
|
2795
2805
|
const r = /* @__PURE__ */ new Set();
|
|
2796
2806
|
try {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(O,ee){typeof exports=="object"&&typeof module<"u"?ee(exports,require("pinia")):typeof define=="function"&&define.amd?define(["exports","pinia"],ee):(O=typeof globalThis<"u"?globalThis:O||self,ee(O["pinia-plugin-persist-state"]={}))})(this,(function(O){"use strict";class ee{_storage;constructor(t){this._storage=t==="localStorage"?localStorage:sessionStorage}clear(){this._storage.clear()}async getItem(t){return new Promise((n,s)=>{const r=this._storage.getItem(t.toString());n(r?JSON.parse(r):void 0)})}removeItem(t){this._storage.removeItem(t.toString())}removeItems(t){for(let n=0;n<this._storage.length;n++){const s=this._storage.key(n);s&&(!t||!t.includes(s))&&this._storage.removeItem(s)}}setItem(t,n){this._storage.setItem(n,JSON.stringify(t))}}class pn{_console;_createInstance;_name;_pluginOptions;_storeInstance;_resetStoreCallback;_storeOnActionSubscription;_storeMutationSubscription;_subscriptions;pluginCreated;get console(){return this._console??console}get name(){return this._name}get pluginOptions(){return this._pluginOptions??{}}set pluginOptions(t){this._pluginOptions=t}get resetStoreCallback(){return this._resetStoreCallback}get storeOnActionSubscription(){return this._storeOnActionSubscription}get storeMutationSubscription(){return this._storeMutationSubscription}get subscriptions(){return this._subscriptions}set subscriptions(t){this._subscriptions=t}constructor(t,n,s){this._name=t,this._createInstance=n,s&&(this._console=s)}invoke({store:t,options:n},s){return this._storeInstance=this._createInstance(t,{...n,...this.pluginOptions},s,this.console),this._storeInstance?(this._subscriptions=this._storeInstance.getSubscriptions(),this._storeMutationSubscription=this._storeInstance.storeSubscribe,this._storeOnActionSubscription=this._storeInstance.onAction,this.pluginCreated&&this.pluginCreated(t),!0):!1}}class hn{_console;_debug=!1;get console(){return this._console??console}set console(t){this._console=t}get debug(){return this._debug}set debug(t){this._debug=t}constructor(t,n){this._debug=t,n&&(this._console=n)}debugLog(...t){this._debug&&(Array.isArray(t)&&(t[0]=`${this._className} - ${t[0]}`),this.console.log(...t))}logError(...t){this.console.error(...t)}}const dn="pinia-plugin-subscription",_n=(e,t="white")=>`background-color: ${e}; color: ${t}; padding: 1px; margin-right: 5px; font-size: 12px`;function gn(e,t){if(!e)throw new Error("Style instructions are required");console.log("%c%s",e,t.shift(),...t)}class yn{_bgColor="#ffec73";_color="green";_icon="🍍⚡";_errorBgColor="#d24545";_errorColor="white";_errorIcon="🍍⚠️";_styles={error:{bgColor:this._errorBgColor,color:this._errorColor,icon:this._errorIcon},info:{bgColor:this._bgColor,color:this._color,icon:this._icon}};formatMessage(t,n){return` [${n} ${dn}] - ${t} `}generateStyle(t){return _n(t.bgColor,t.color)}getStyleDefinition(t){return this._styles[t??"info"]}log(...t){this.useLog(this.getStyleDefinition(),t)}error(...t){this.useLog(this.getStyleDefinition("error"),t)}rebuildArgs(t,n){if(typeof t=="string")return[this.formatMessage(t,n)];if(Array.isArray(t))return[this.formatMessage(t.shift(),n),...t??[]]}useLog(t,n){gn(this.generateStyle(t),this.rebuildArgs(n,t.icon))}}const mn=new Set(["_","$"]);function bn(e){return mn.has(e[0])}function L(e){return e?Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:typeof e=="string"?e.trim()==="":!1:!(typeof e=="boolean"||typeof e=="number")}function Sn(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Ce=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const vn=()=>{},wn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),U=Object.assign,En=Object.prototype.hasOwnProperty,Ie=(e,t)=>En.call(e,t),g=Array.isArray,te=e=>lt(e)==="[object Map]",x=e=>typeof e=="function",V=e=>typeof e=="string",ne=e=>typeof e=="symbol",y=e=>e!==null&&typeof e=="object",Nn=Object.prototype.toString,lt=e=>Nn.call(e),ut=e=>lt(e).slice(8,-1),ue=e=>V(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,On=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Vn=On(e=>e.charAt(0).toUpperCase()+e.slice(1)),Re=(e,t)=>!Object.is(e,t);let ft;const fe=()=>ft||(ft=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function xe(e){if(g(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=V(s)?Rn(s):xe(s);if(r)for(const o in r)t[o]=r[o]}return t}else if(V(e)||y(e))return e}const kn=/;(?![^(]*\))/g,Cn=/:([^]+)/,In=/\/\*[^]*?\*\//g;function Rn(e){const t={};return e.replace(In,"").split(kn).forEach(n=>{if(n){const s=n.split(Cn);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Pe(e){let t="";if(V(e))t=e;else if(g(e))for(let n=0;n<e.length;n++){const s=Pe(e[n]);s&&(t+=s+" ")}else if(y(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function z(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let pt=0,De;function je(){pt++}function $e(){if(--pt>0)return;let e;for(;De;){let t=De;for(De=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}class xn{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){}trigger(t){this.version++,this.notify(t)}notify(t){je();try{if(process.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(U({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{$e()}}}const ht=new WeakMap,Te=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),dt=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),_t=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function P(e,t,n,s,r,o){const i=ht.get(e);if(!i)return;const c=l=>{l&&(process.env.NODE_ENV!=="production"?l.trigger({target:e,type:t,key:n,newValue:s,oldValue:r,oldTarget:o}):l.trigger())};if(je(),t==="clear")i.forEach(c);else{const l=g(e),f=l&&ue(n);if(l&&n==="length"){const h=Number(s);i.forEach((a,u)=>{(u==="length"||u===_t||!ne(u)&&u>=h)&&c(a)})}else switch((n!==void 0||i.has(void 0))&&c(i.get(n)),f&&c(i.get(_t)),t){case"add":l?f&&c(i.get("length")):(c(i.get(Te)),te(e)&&c(i.get(dt)));break;case"delete":l||(c(i.get(Te)),te(e)&&c(i.get(dt)));break;case"set":te(e)&&c(i.get(Te));break}}$e()}function Pn(e,t){const n=ht.get(e);return n&&n.get(t)}function B(e){const t=p(e);return t===e||b(e)?t:t.map(C)}function Ae(e){return e=p(e),e}function D(e,t){return E(e)?He(e)?oe(C(t)):oe(t):C(t)}const Dn={__proto__:null,[Symbol.iterator](){return Me(this,Symbol.iterator,e=>D(this,e))},concat(...e){return B(this).concat(...e.map(t=>g(t)?B(t):t))},entries(){return Me(this,"entries",e=>(e[1]=D(this,e[1]),e))},every(e,t){return k(this,"every",e,t,void 0,arguments)},filter(e,t){return k(this,"filter",e,t,n=>n.map(s=>D(this,s)),arguments)},find(e,t){return k(this,"find",e,t,n=>D(this,n),arguments)},findIndex(e,t){return k(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return k(this,"findLast",e,t,n=>D(this,n),arguments)},findLastIndex(e,t){return k(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return k(this,"forEach",e,t,void 0,arguments)},includes(...e){return Fe(this,"includes",e)},indexOf(...e){return Fe(this,"indexOf",e)},join(e){return B(this).join(e)},lastIndexOf(...e){return Fe(this,"lastIndexOf",e)},map(e,t){return k(this,"map",e,t,void 0,arguments)},pop(){return se(this,"pop")},push(...e){return se(this,"push",e)},reduce(e,...t){return gt(this,"reduce",e,t)},reduceRight(e,...t){return gt(this,"reduceRight",e,t)},shift(){return se(this,"shift")},some(e,t){return k(this,"some",e,t,void 0,arguments)},splice(...e){return se(this,"splice",e)},toReversed(){return B(this).toReversed()},toSorted(e){return B(this).toSorted(e)},toSpliced(...e){return B(this).toSpliced(...e)},unshift(...e){return se(this,"unshift",e)},values(){return Me(this,"values",e=>D(this,e))}};function Me(e,t,n){const s=Ae(e),r=s[t]();return s!==e&&!b(e)&&(r._next=r.next,r.next=()=>{const o=r._next();return o.done||(o.value=n(o.value)),o}),r}const jn=Array.prototype;function k(e,t,n,s,r,o){const i=Ae(e),c=i!==e&&!b(e),l=i[t];if(l!==jn[t]){const a=l.apply(e,o);return c?C(a):a}let f=n;i!==e&&(c?f=function(a,u){return n.call(this,D(e,a),u,e)}:n.length>2&&(f=function(a,u){return n.call(this,a,u,e)}));const h=l.call(i,f,s);return c&&r?r(h):h}function gt(e,t,n,s){const r=Ae(e);let o=n;return r!==e&&(b(e)?n.length>3&&(o=function(i,c,l){return n.call(this,i,c,l,e)}):o=function(i,c,l){return n.call(this,i,D(e,c),l,e)}),r[t](o,...s)}function Fe(e,t,n){const s=p(e),r=s[t](...n);return(r===-1||r===!1)&&re(n[0])?(n[0]=p(n[0]),s[t](...n)):r}function se(e,t,n=[]){je();const s=p(e)[t].apply(e,n);return $e(),s}const $n=Sn("__proto__,__v_isRef,__isVue"),yt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ne));function Tn(e){return ne(e)||(e=String(e)),p(this).hasOwnProperty(e)}class mt{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return o;if(n==="__v_raw")return s===(r?o?Bn:wt:o?zn:vt).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const i=g(t);if(!r){let l;if(i&&(l=Dn[n]))return l;if(n==="hasOwnProperty")return Tn}const c=Reflect.get(t,n,m(t)?t:s);if((ne(n)?yt.has(n):$n(n))||o)return c;if(m(c)){const l=i&&ue(n)?c:c.value;return r&&y(l)?Ke(l):l}return y(c)?r?Ke(c):Et(c):c}}class An extends mt{constructor(t=!1){super(!1,t)}set(t,n,s,r){let o=t[n];const i=g(t)&&ue(n);if(!this._isShallow){const f=E(o);if(!b(s)&&!E(s)&&(o=p(o),s=p(s)),!i&&m(o)&&!m(s))return f?(process.env.NODE_ENV!=="production"&&z(`Set operation on key "${String(n)}" failed: target is readonly.`,t[n]),!0):(o.value=s,!0)}const c=i?Number(n)<t.length:Ie(t,n),l=Reflect.set(t,n,s,m(t)?t:r);return t===p(r)&&(c?Re(s,o)&&P(t,"set",n,s,o):P(t,"add",n,s)),l}deleteProperty(t,n){const s=Ie(t,n),r=t[n],o=Reflect.deleteProperty(t,n);return o&&s&&P(t,"delete",n,void 0,r),o}has(t,n){const s=Reflect.has(t,n);return!ne(n)||yt.has(n),s}ownKeys(t){return Reflect.ownKeys(t)}}class Mn extends mt{constructor(t=!1){super(!0,t)}set(t,n){return process.env.NODE_ENV!=="production"&&z(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return process.env.NODE_ENV!=="production"&&z(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const Fn=new An,Kn=new Mn,pe=e=>Reflect.getPrototypeOf(e);function Hn(e,t,n){return function(...s){const r=this.__v_raw,o=p(r),i=te(o),c=e==="entries"||e===Symbol.iterator&&i,l=r[e](...s),f=t?oe:C;return{next(){const{value:h,done:a}=l.next();return a?{value:h,done:a}:{value:c?[f(h[0]),f(h[1])]:f(h),done:a}},[Symbol.iterator](){return this}}}}function he(e){return function(...t){if(process.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";z(`${Vn(e)} operation ${n}failed: target is readonly.`,p(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function qn(e,t){const n={get(s){const r=this.__v_raw,o=p(r),i=p(s),{has:c}=pe(o),l=e?oe:C;if(c.call(o,s))return l(r.get(s));if(c.call(o,i))return l(r.get(i));r!==o&&r.get(s)},get size(){const s=this.__v_raw;return!e&&p(s),s.size},has(s){const r=this.__v_raw;p(r);const o=p(s);return s===o?r.has(s):r.has(s)||r.has(o)},forEach(s,r){const o=this,i=o.__v_raw;p(i);const c=e?oe:C;return i.forEach((l,f)=>s.call(r,c(l),c(f),o))}};return U(n,e?{add:he("add"),set:he("set"),delete:he("delete"),clear:he("clear")}:{add(s){!b(s)&&!E(s)&&(s=p(s));const r=p(this);return pe(r).has.call(r,s)||(r.add(s),P(r,"add",s,s)),this},set(s,r){!b(r)&&!E(r)&&(r=p(r));const o=p(this),{has:i,get:c}=pe(o);let l=i.call(o,s);l?process.env.NODE_ENV!=="production"&&St(o,i,s):(s=p(s),l=i.call(o,s));const f=c.call(o,s);return o.set(s,r),l?Re(r,f)&&P(o,"set",s,r,f):P(o,"add",s,r),this},delete(s){const r=p(this),{has:o,get:i}=pe(r);let c=o.call(r,s);c?process.env.NODE_ENV!=="production"&&St(r,o,s):(s=p(s),c=o.call(r,s));const l=i?i.call(r,s):void 0,f=r.delete(s);return c&&P(r,"delete",s,void 0,l),f},clear(){const s=p(this),r=s.size!==0,o=process.env.NODE_ENV!=="production"?te(s)?new Map(s):new Set(s):void 0,i=s.clear();return r&&P(s,"clear",void 0,void 0,o),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Hn(s,e)}),n}function bt(e,t){const n=qn(e);return(s,r,o)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(Ie(n,r)&&r in s?n:s,r,o)}const Ln={get:bt(!1)},Un={get:bt(!0)};function St(e,t,n){const s=p(n);if(s!==n&&t.call(e,s)){const r=ut(e);z(`Reactive ${r} contains both the raw and reactive versions of the same object${r==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const vt=new WeakMap,zn=new WeakMap,wt=new WeakMap,Bn=new WeakMap;function Wn(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Jn(e){return e.__v_skip||!Object.isExtensible(e)?0:Wn(ut(e))}function Et(e){return E(e)?e:Nt(e,!1,Fn,Ln,vt)}function Ke(e){return Nt(e,!0,Kn,Un,wt)}function Nt(e,t,n,s,r){if(!y(e))return process.env.NODE_ENV!=="production"&&z(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Jn(e);if(o===0)return e;const i=r.get(e);if(i)return i;const c=new Proxy(e,o===2?s:n);return r.set(e,c),c}function He(e){return E(e)?He(e.__v_raw):!!(e&&e.__v_isReactive)}function E(e){return!!(e&&e.__v_isReadonly)}function b(e){return!!(e&&e.__v_isShallow)}function re(e){return e?!!e.__v_raw:!1}function p(e){const t=e&&e.__v_raw;return t?p(t):e}const C=e=>y(e)?Et(e):e,oe=e=>y(e)?Ke(e):e;function m(e){return e?e.__v_isRef===!0:!1}function Ot(e){return Yn(e,!1)}function Yn(e,t){return m(e)?e:new Gn(e,t)}class Gn{constructor(t,n){this.dep=new xn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:p(t),this._value=n?t:C(t),this.__v_isShallow=n}get value(){return process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||b(t)||E(t);t=s?t:p(t),Re(t,n)&&(this._rawValue=t,this._value=s?t:C(t),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:n}):this.dep.trigger())}}function Qn(e){return m(e)?e.value:e}class Xn{constructor(t,n,s){this._object=t,this._key=n,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._raw=p(t);let r=!0,o=t;if(!g(t)||!ue(String(n)))do r=!re(o)||b(o);while(r&&(o=o.__v_raw));this._shallow=r}get value(){let t=this._object[this._key];return this._shallow&&(t=Qn(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&m(this._raw[this._key])){const n=this._object[this._key];if(m(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return Pn(this._raw,this._key)}}class Zn{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function es(e,t,n){return m(e)?e:x(e)?new Zn(e):y(e)&&arguments.length>1?ts(e,t,n):Ot(e)}function ts(e,t,n){return new Xn(e,t,n)}const M=[];function ns(e){M.push(e)}function ss(){M.pop()}let qe=!1;function ie(e,...t){if(qe)return;qe=!0;const n=M.length?M[M.length-1].component:null,s=n&&n.appContext.config.warnHandler,r=rs();if(s)Le(s,n,11,[e+t.map(o=>{var i,c;return(c=(i=o.toString)==null?void 0:i.call(o))!=null?c:JSON.stringify(o)}).join(""),n&&n.proxy,r.map(({vnode:o})=>`at <${Kt(n,o.type)}>`).join(`
|
|
1
|
+
(function(O,ee){typeof exports=="object"&&typeof module<"u"?ee(exports,require("pinia")):typeof define=="function"&&define.amd?define(["exports","pinia"],ee):(O=typeof globalThis<"u"?globalThis:O||self,ee(O["pinia-plugin-persist-state"]={}))})(this,(function(O){"use strict";class ee{_storage;constructor(t){this._storage=t==="localStorage"?localStorage:sessionStorage}clear(){this._storage.clear()}async getItem(t){return new Promise((n,s)=>{const r=this._storage.getItem(t.toString());n(r?JSON.parse(r):void 0)})}removeItem(t){this._storage.removeItem(t.toString())}removeItems(t){for(let n=0;n<this._storage.length;n++){const s=this._storage.key(n);s&&(!t||!t.includes(s))&&this._storage.removeItem(s)}}setItem(t,n){this._storage.setItem(n,JSON.stringify(t))}}class pn{_console;_createInstance;_name;_pluginOptions;_storeInstance;_resetStoreCallback;_storeOnActionSubscription;_storeMutationSubscription;_subscriptions;pluginCreated;get console(){return this._console??console}get name(){return this._name}get pluginOptions(){return this._pluginOptions??{}}set pluginOptions(t){this._pluginOptions=t}get resetStoreCallback(){return this._resetStoreCallback}get storeOnActionSubscription(){return this._storeOnActionSubscription}get storeMutationSubscription(){return this._storeMutationSubscription}get subscriptions(){return this._subscriptions}set subscriptions(t){this._subscriptions=t}constructor(t,n,s){this._name=t,this._createInstance=n,s&&(this._console=s)}invoke({store:t,options:n},s){return this._storeInstance=this._createInstance(t,{...n,...this.pluginOptions},s,this.console),this._storeInstance?(this._storeInstance.resetCallback&&(this._resetStoreCallback=this._storeInstance.resetCallback),this._subscriptions=this._storeInstance.getSubscriptions(),this._storeMutationSubscription=this._storeInstance.storeSubscribe,this._storeOnActionSubscription=this._storeInstance.onAction,this.pluginCreated&&this.pluginCreated(t),!0):!1}}class hn{_console;_debug=!1;get console(){return this._console??console}set console(t){this._console=t}get debug(){return this._debug}set debug(t){this._debug=t}constructor(t,n){this._debug=t,n&&(this._console=n)}debugLog(...t){this._debug&&(Array.isArray(t)&&(t[0]=`${this._className} - ${t[0]}`),this.console.log(...t))}logError(...t){this.console.error(...t)}}const dn="pinia-plugin-subscription",_n=(e,t="white")=>`background-color: ${e}; color: ${t}; padding: 1px; margin-right: 5px; font-size: 12px`;function gn(e,t){if(!e)throw new Error("Style instructions are required");console.log("%c%s",e,t.shift(),...t)}class yn{_bgColor="#ffec73";_color="green";_icon="🍍⚡";_errorBgColor="#d24545";_errorColor="white";_errorIcon="🍍⚠️";_styles={error:{bgColor:this._errorBgColor,color:this._errorColor,icon:this._errorIcon},info:{bgColor:this._bgColor,color:this._color,icon:this._icon}};formatMessage(t,n){return` [${n} ${dn}] - ${t} `}generateStyle(t){return _n(t.bgColor,t.color)}getStyleDefinition(t){return this._styles[t??"info"]}log(...t){this.useLog(this.getStyleDefinition(),t)}error(...t){this.useLog(this.getStyleDefinition("error"),t)}rebuildArgs(t,n){if(typeof t=="string")return[this.formatMessage(t,n)];if(Array.isArray(t))return[this.formatMessage(t.shift(),n),...t??[]]}useLog(t,n){gn(this.generateStyle(t),this.rebuildArgs(n,t.icon))}}const mn=new Set(["_","$"]);function bn(e){return mn.has(e[0])}function L(e){return e?Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:typeof e=="string"?e.trim()==="":!1:!(typeof e=="boolean"||typeof e=="number")}function Sn(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Ve=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const vn=()=>{},wn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),U=Object.assign,En=Object.prototype.hasOwnProperty,Ie=(e,t)=>En.call(e,t),g=Array.isArray,te=e=>lt(e)==="[object Map]",R=e=>typeof e=="function",k=e=>typeof e=="string",ne=e=>typeof e=="symbol",y=e=>e!==null&&typeof e=="object",Nn=Object.prototype.toString,lt=e=>Nn.call(e),ut=e=>lt(e).slice(8,-1),ue=e=>k(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,On=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},kn=On(e=>e.charAt(0).toUpperCase()+e.slice(1)),Pe=(e,t)=>!Object.is(e,t);let ft;const fe=()=>ft||(ft=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Re(e){if(g(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=k(s)?Pn(s):Re(s);if(r)for(const o in r)t[o]=r[o]}return t}else if(k(e)||y(e))return e}const Cn=/;(?![^(]*\))/g,Vn=/:([^]+)/,In=/\/\*[^]*?\*\//g;function Pn(e){const t={};return e.replace(In,"").split(Cn).forEach(n=>{if(n){const s=n.split(Vn);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function xe(e){let t="";if(k(e))t=e;else if(g(e))for(let n=0;n<e.length;n++){const s=xe(e[n]);s&&(t+=s+" ")}else if(y(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function z(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let pt=0,De;function je(){pt++}function $e(){if(--pt>0)return;let e;for(;De;){let t=De;for(De=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}class Rn{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){}trigger(t){this.version++,this.notify(t)}notify(t){je();try{if(process.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(U({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{$e()}}}const ht=new WeakMap,Te=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),dt=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),_t=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function x(e,t,n,s,r,o){const i=ht.get(e);if(!i)return;const c=l=>{l&&(process.env.NODE_ENV!=="production"?l.trigger({target:e,type:t,key:n,newValue:s,oldValue:r,oldTarget:o}):l.trigger())};if(je(),t==="clear")i.forEach(c);else{const l=g(e),f=l&&ue(n);if(l&&n==="length"){const h=Number(s);i.forEach((a,u)=>{(u==="length"||u===_t||!ne(u)&&u>=h)&&c(a)})}else switch((n!==void 0||i.has(void 0))&&c(i.get(n)),f&&c(i.get(_t)),t){case"add":l?f&&c(i.get("length")):(c(i.get(Te)),te(e)&&c(i.get(dt)));break;case"delete":l||(c(i.get(Te)),te(e)&&c(i.get(dt)));break;case"set":te(e)&&c(i.get(Te));break}}$e()}function xn(e,t){const n=ht.get(e);return n&&n.get(t)}function B(e){const t=p(e);return t===e||b(e)?t:t.map(V)}function Ae(e){return e=p(e),e}function D(e,t){return E(e)?He(e)?oe(V(t)):oe(t):V(t)}const Dn={__proto__:null,[Symbol.iterator](){return Me(this,Symbol.iterator,e=>D(this,e))},concat(...e){return B(this).concat(...e.map(t=>g(t)?B(t):t))},entries(){return Me(this,"entries",e=>(e[1]=D(this,e[1]),e))},every(e,t){return C(this,"every",e,t,void 0,arguments)},filter(e,t){return C(this,"filter",e,t,n=>n.map(s=>D(this,s)),arguments)},find(e,t){return C(this,"find",e,t,n=>D(this,n),arguments)},findIndex(e,t){return C(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return C(this,"findLast",e,t,n=>D(this,n),arguments)},findLastIndex(e,t){return C(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return C(this,"forEach",e,t,void 0,arguments)},includes(...e){return Fe(this,"includes",e)},indexOf(...e){return Fe(this,"indexOf",e)},join(e){return B(this).join(e)},lastIndexOf(...e){return Fe(this,"lastIndexOf",e)},map(e,t){return C(this,"map",e,t,void 0,arguments)},pop(){return se(this,"pop")},push(...e){return se(this,"push",e)},reduce(e,...t){return gt(this,"reduce",e,t)},reduceRight(e,...t){return gt(this,"reduceRight",e,t)},shift(){return se(this,"shift")},some(e,t){return C(this,"some",e,t,void 0,arguments)},splice(...e){return se(this,"splice",e)},toReversed(){return B(this).toReversed()},toSorted(e){return B(this).toSorted(e)},toSpliced(...e){return B(this).toSpliced(...e)},unshift(...e){return se(this,"unshift",e)},values(){return Me(this,"values",e=>D(this,e))}};function Me(e,t,n){const s=Ae(e),r=s[t]();return s!==e&&!b(e)&&(r._next=r.next,r.next=()=>{const o=r._next();return o.done||(o.value=n(o.value)),o}),r}const jn=Array.prototype;function C(e,t,n,s,r,o){const i=Ae(e),c=i!==e&&!b(e),l=i[t];if(l!==jn[t]){const a=l.apply(e,o);return c?V(a):a}let f=n;i!==e&&(c?f=function(a,u){return n.call(this,D(e,a),u,e)}:n.length>2&&(f=function(a,u){return n.call(this,a,u,e)}));const h=l.call(i,f,s);return c&&r?r(h):h}function gt(e,t,n,s){const r=Ae(e);let o=n;return r!==e&&(b(e)?n.length>3&&(o=function(i,c,l){return n.call(this,i,c,l,e)}):o=function(i,c,l){return n.call(this,i,D(e,c),l,e)}),r[t](o,...s)}function Fe(e,t,n){const s=p(e),r=s[t](...n);return(r===-1||r===!1)&&re(n[0])?(n[0]=p(n[0]),s[t](...n)):r}function se(e,t,n=[]){je();const s=p(e)[t].apply(e,n);return $e(),s}const $n=Sn("__proto__,__v_isRef,__isVue"),yt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ne));function Tn(e){return ne(e)||(e=String(e)),p(this).hasOwnProperty(e)}class mt{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return o;if(n==="__v_raw")return s===(r?o?Bn:wt:o?zn:vt).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const i=g(t);if(!r){let l;if(i&&(l=Dn[n]))return l;if(n==="hasOwnProperty")return Tn}const c=Reflect.get(t,n,m(t)?t:s);if((ne(n)?yt.has(n):$n(n))||o)return c;if(m(c)){const l=i&&ue(n)?c:c.value;return r&&y(l)?Ke(l):l}return y(c)?r?Ke(c):Et(c):c}}class An extends mt{constructor(t=!1){super(!1,t)}set(t,n,s,r){let o=t[n];const i=g(t)&&ue(n);if(!this._isShallow){const f=E(o);if(!b(s)&&!E(s)&&(o=p(o),s=p(s)),!i&&m(o)&&!m(s))return f?(process.env.NODE_ENV!=="production"&&z(`Set operation on key "${String(n)}" failed: target is readonly.`,t[n]),!0):(o.value=s,!0)}const c=i?Number(n)<t.length:Ie(t,n),l=Reflect.set(t,n,s,m(t)?t:r);return t===p(r)&&(c?Pe(s,o)&&x(t,"set",n,s,o):x(t,"add",n,s)),l}deleteProperty(t,n){const s=Ie(t,n),r=t[n],o=Reflect.deleteProperty(t,n);return o&&s&&x(t,"delete",n,void 0,r),o}has(t,n){const s=Reflect.has(t,n);return!ne(n)||yt.has(n),s}ownKeys(t){return Reflect.ownKeys(t)}}class Mn extends mt{constructor(t=!1){super(!0,t)}set(t,n){return process.env.NODE_ENV!=="production"&&z(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return process.env.NODE_ENV!=="production"&&z(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const Fn=new An,Kn=new Mn,pe=e=>Reflect.getPrototypeOf(e);function Hn(e,t,n){return function(...s){const r=this.__v_raw,o=p(r),i=te(o),c=e==="entries"||e===Symbol.iterator&&i,l=r[e](...s),f=t?oe:V;return{next(){const{value:h,done:a}=l.next();return a?{value:h,done:a}:{value:c?[f(h[0]),f(h[1])]:f(h),done:a}},[Symbol.iterator](){return this}}}}function he(e){return function(...t){if(process.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";z(`${kn(e)} operation ${n}failed: target is readonly.`,p(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function qn(e,t){const n={get(s){const r=this.__v_raw,o=p(r),i=p(s),{has:c}=pe(o),l=e?oe:V;if(c.call(o,s))return l(r.get(s));if(c.call(o,i))return l(r.get(i));r!==o&&r.get(s)},get size(){const s=this.__v_raw;return!e&&p(s),s.size},has(s){const r=this.__v_raw;p(r);const o=p(s);return s===o?r.has(s):r.has(s)||r.has(o)},forEach(s,r){const o=this,i=o.__v_raw;p(i);const c=e?oe:V;return i.forEach((l,f)=>s.call(r,c(l),c(f),o))}};return U(n,e?{add:he("add"),set:he("set"),delete:he("delete"),clear:he("clear")}:{add(s){!b(s)&&!E(s)&&(s=p(s));const r=p(this);return pe(r).has.call(r,s)||(r.add(s),x(r,"add",s,s)),this},set(s,r){!b(r)&&!E(r)&&(r=p(r));const o=p(this),{has:i,get:c}=pe(o);let l=i.call(o,s);l?process.env.NODE_ENV!=="production"&&St(o,i,s):(s=p(s),l=i.call(o,s));const f=c.call(o,s);return o.set(s,r),l?Pe(r,f)&&x(o,"set",s,r,f):x(o,"add",s,r),this},delete(s){const r=p(this),{has:o,get:i}=pe(r);let c=o.call(r,s);c?process.env.NODE_ENV!=="production"&&St(r,o,s):(s=p(s),c=o.call(r,s));const l=i?i.call(r,s):void 0,f=r.delete(s);return c&&x(r,"delete",s,void 0,l),f},clear(){const s=p(this),r=s.size!==0,o=process.env.NODE_ENV!=="production"?te(s)?new Map(s):new Set(s):void 0,i=s.clear();return r&&x(s,"clear",void 0,void 0,o),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Hn(s,e)}),n}function bt(e,t){const n=qn(e);return(s,r,o)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(Ie(n,r)&&r in s?n:s,r,o)}const Ln={get:bt(!1)},Un={get:bt(!0)};function St(e,t,n){const s=p(n);if(s!==n&&t.call(e,s)){const r=ut(e);z(`Reactive ${r} contains both the raw and reactive versions of the same object${r==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const vt=new WeakMap,zn=new WeakMap,wt=new WeakMap,Bn=new WeakMap;function Wn(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Jn(e){return e.__v_skip||!Object.isExtensible(e)?0:Wn(ut(e))}function Et(e){return E(e)?e:Nt(e,!1,Fn,Ln,vt)}function Ke(e){return Nt(e,!0,Kn,Un,wt)}function Nt(e,t,n,s,r){if(!y(e))return process.env.NODE_ENV!=="production"&&z(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Jn(e);if(o===0)return e;const i=r.get(e);if(i)return i;const c=new Proxy(e,o===2?s:n);return r.set(e,c),c}function He(e){return E(e)?He(e.__v_raw):!!(e&&e.__v_isReactive)}function E(e){return!!(e&&e.__v_isReadonly)}function b(e){return!!(e&&e.__v_isShallow)}function re(e){return e?!!e.__v_raw:!1}function p(e){const t=e&&e.__v_raw;return t?p(t):e}const V=e=>y(e)?Et(e):e,oe=e=>y(e)?Ke(e):e;function m(e){return e?e.__v_isRef===!0:!1}function Ot(e){return Yn(e,!1)}function Yn(e,t){return m(e)?e:new Gn(e,t)}class Gn{constructor(t,n){this.dep=new Rn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:p(t),this._value=n?t:V(t),this.__v_isShallow=n}get value(){return process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||b(t)||E(t);t=s?t:p(t),Pe(t,n)&&(this._rawValue=t,this._value=s?t:V(t),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:n}):this.dep.trigger())}}function Qn(e){return m(e)?e.value:e}class Xn{constructor(t,n,s){this._object=t,this._key=n,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._raw=p(t);let r=!0,o=t;if(!g(t)||!ue(String(n)))do r=!re(o)||b(o);while(r&&(o=o.__v_raw));this._shallow=r}get value(){let t=this._object[this._key];return this._shallow&&(t=Qn(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&m(this._raw[this._key])){const n=this._object[this._key];if(m(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return xn(this._raw,this._key)}}class Zn{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function es(e,t,n){return m(e)?e:R(e)?new Zn(e):y(e)&&arguments.length>1?ts(e,t,n):Ot(e)}function ts(e,t,n){return new Xn(e,t,n)}const M=[];function ns(e){M.push(e)}function ss(){M.pop()}let qe=!1;function ie(e,...t){if(qe)return;qe=!0;const n=M.length?M[M.length-1].component:null,s=n&&n.appContext.config.warnHandler,r=rs();if(s)Le(s,n,11,[e+t.map(o=>{var i,c;return(c=(i=o.toString)==null?void 0:i.call(o))!=null?c:JSON.stringify(o)}).join(""),n&&n.proxy,r.map(({vnode:o})=>`at <${Kt(n,o.type)}>`).join(`
|
|
2
2
|
`),r]);else{const o=[`[Vue warn]: ${e}`,...t];r.length&&o.push(`
|
|
3
3
|
`,...os(r)),console.warn(...o)}qe=!1}function rs(){let e=M[M.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const s=e.component&&e.component.parent;e=s&&s.vnode}return t}function os(e){const t=[];return e.forEach((n,s)=>{t.push(...s===0?[]:[`
|
|
4
|
-
`],...is(n))}),t}function is({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",s=e.component?e.component.parent==null:!1,r=` at <${Kt(e.component,e.type,s)}`,o=">"+n;return e.props?[r,...cs(e.props),o]:[r+o]}function cs(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(s=>{t.push(...
|
|
5
|
-
Component that was made reactive: `,e)),ks(e,t,n,s,r,i,o,!0)}function Is(e){return e?re(e)||jt(e)?U({},e):e:null}function me(e,t,n=!1,s=!1){const{props:r,ref:o,patchFlag:i,children:c,transition:l}=e,f=t?xs(r||{},t):r,h={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&Tt(f),ref:t&&t.ref?n&&o?g(o)?o.concat(ye(t)):[o,ye(t)]:ye(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&i===-1&&g(c)?c.map(Mt):c,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==$t?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&me(e.ssContent),ssFallback:e.ssFallback&&me(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&s&&Dt(h,l.clone(h)),h}function Mt(e){const t=me(e);return g(e.children)&&(t.children=e.children.map(Mt)),t}function Rs(e=" ",t=0){return Cs(Es,null,e,t)}function We(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(g(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),We(e,r()),r._c&&(r._d=!0));return}else n=32,!t._&&!jt(t)&&(t._ctx=ge);else x(t)?(t={default:t,_ctx:ge},n=32):(t=String(t),s&64?(n=16,t=[Rs(t)]):n=8);e.children=t,e.shapeFlag|=n}function xs(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const r in s)if(r==="class")t.class!==s.class&&(t.class=Pe([t.class,s.class]));else if(r==="style")t.style=xe([t.style,s.style]);else if(wn(r)){const o=t[r],i=s[r];i&&o!==i&&!(g(o)&&o.includes(i))&&(t[r]=o?[].concat(o,i):i)}else r!==""&&(t[r]=s[r])}return t}{const e=fe(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),o=>{r.length>1?r.forEach(i=>i(o)):r[0](o)}};t("__VUE_INSTANCE_SETTERS__",n=>n),t("__VUE_SSR_SETTERS__",n=>n)}process.env.NODE_ENV;const Ps=/(?:^|[-_])\w/g,Ds=e=>e.replace(Ps,t=>t.toUpperCase()).replace(/[-_]/g,"");function Ft(e,t=!0){return x(e)?e.displayName||e.name:e.name||t&&e.__name}function Kt(e,t,n=!1){let s=Ft(t);if(!s&&t.__file){const r=t.__file.match(/([^/\\]+)\.\w+$/);r&&(s=r[1])}if(!s&&e){const r=o=>{for(const i in o)if(o[i]===t)return i};s=r(e.components)||e.parent&&r(e.parent.type.components)||r(e.appContext.components)}return s?Ds(s):n?"App":"Anonymous"}function Ht(e){return x(e)&&"__vccOpts"in e}function js(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},n={style:"color:#f5222d"},s={style:"color:#eb2f96"},r={__vue_custom_formatter:!0,header(a){if(!y(a))return null;if(a.__isVue)return["div",e,"VueInstance"];if(m(a)){const u=a.value;return["div",{},["span",e,h(a)],"<",c(u),">"]}else{if(He(a))return["div",{},["span",e,b(a)?"ShallowReactive":"Reactive"],"<",c(a),`>${E(a)?" (readonly)":""}`];if(E(a))return["div",{},["span",e,b(a)?"ShallowReadonly":"Readonly"],"<",c(a),">"]}return null},hasBody(a){return a&&a.__isVue},body(a){if(a&&a.__isVue)return["div",{},...o(a.$)]}};function o(a){const u=[];a.type.props&&a.props&&u.push(i("props",p(a.props))),a.setupState!==Ce&&u.push(i("setup",a.setupState)),a.data!==Ce&&u.push(i("data",p(a.data)));const d=l(a,"computed");d&&u.push(i("computed",d));const _=l(a,"inject");return _&&u.push(i("injected",_)),u.push(["div",{},["span",{style:s.style+";opacity:0.66"},"$ (internal): "],["object",{object:a}]]),u}function i(a,u){return u=U({},u),Object.keys(u).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},a],["div",{style:"padding-left:1.25em"},...Object.keys(u).map(d=>["div",{},["span",s,d+": "],c(u[d],!1)])]]:["span",{}]}function c(a,u=!0){return typeof a=="number"?["span",t,a]:typeof a=="string"?["span",n,JSON.stringify(a)]:typeof a=="boolean"?["span",s,a]:y(a)?["object",{object:u?p(a):a}]:["span",n,String(a)]}function l(a,u){const d=a.type;if(x(d))return;const _={};for(const w in a.ctx)f(d,w,u)&&(_[w]=a.ctx[w]);return _}function f(a,u,d){const _=a[d];if(g(_)&&_.includes(u)||y(_)&&u in _||a.extends&&f(a.extends,u,d)||a.mixins&&a.mixins.some(w=>f(w,u,d)))return!0}function h(a){return b(a)?"ShallowRef":a.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(r):window.devtoolsFormatters=[r]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function $s(){js()}process.env.NODE_ENV!=="production"&&$s();class Ts extends hn{_className="Store";_onAction;_options;_store;_subscriptions={};_storeSubscribe;static _requiredKeys;get onAction(){if(this._onAction)return()=>({store:this.store,callback:this._onAction})}set onAction(t){this._onAction=t}get options(){return this._options}get state(){return this._store.$state}set state(t){this._store.$state=t}get store(){return this._store}get storeSubscribe(){if(this._storeSubscribe)return()=>({store:this.store,callback:this._storeSubscribe})}set storeSubscribe(t){this._storeSubscribe=t}constructor(t,n,s=!1,r){super(s,r),this._options=n.storeOptions,this._store=t}addToState(t,n){this.isOptionApi()||n?.value||(n=Ot(n)),this.state[t]=n,this.store[t]=es(this.state,t)}addSubscription(t,n,s){this._subscriptions[t]={subscription:n,...s??{}}}static customizeStore(t,n,s=!1,r){if(n.storeOptions&&this.hasRequiredKeys(n.storeOptions))return new this(t,n,s,r)}hasDeniedFirstChar(t){return bn(t[0])}static hasRequiredKeys(t){return this._requiredKeys===void 0||this._requiredKeys?.every(n=>!!t[n])}getOption(t){return this.options&&this.options[t]}getStatePropertyValue(t){return this.getValue(this.state[t])}getSubscriptions(){if(!L(this._subscriptions))return this._subscriptions}getValue(t){return t?.__v_isRef?t.value:t}isOptionApi(){return this.store._isOptionsAPI}stateHas(t){return this.state.hasOwnProperty(t)}storeHas(t){return this.store.hasOwnProperty(t)}}const Je="pinia-plugin-persist-state";class As extends yn{_pluginName=Je}const F=new As;let qt=class{_db;_localStorageVersionKey="IDBVersion";_name="persistStore";_objectStore;_objectStoreOptions;_objectStoreName;_transactionMode="readwrite";_version;constructor(t,n,s){this._objectStoreName=t,this._version=this.getStoredVersionNumber(),n&&(this._objectStoreOptions=n),s&&(this._transactionMode=s)}clear(){const t=()=>{if(this._objectStore){const n=this._objectStore.clear();this.requestEventsHandler(n,{error:()=>this.onError(n.error)})}};this.open({success:t})}createObjectStore(){this._db&&!this._db.objectStoreNames.contains(this._objectStoreName)&&this._db.createObjectStore(this._objectStoreName,this._objectStoreOptions)}deleteObjectStore(){const t=()=>{this._db?.deleteObjectStore(this._objectStoreName)};this.open({success:t})}async getItem(t){return new Promise(n=>{const s=()=>{if(this._objectStore){const r=this._objectStore.get(t);this.requestEventsHandler(r,{error:()=>this.onError(r.error,()=>n(void 0)),success:()=>n(r.result)})}};this.open({success:s})})}async getObjectStoreItem(t,n){return new Promise(s=>{const r=()=>{if(this._objectStore){const i=this._objectStore.index(t).get(n);this.requestEventsHandler(i,{error:()=>s(void 0),success:()=>s(i.result)})}};this.open({success:r})})}getStoredVersionNumber(){if(!localStorage)return 1;const t=localStorage.getItem(this._localStorageVersionKey);return t?parseInt(t):1}handleDeleteRequest(t,n){t.onerror=()=>F.error(`IndexedDB - Item "${n}" remove`,t.error)}onError(t,n){n&&n(t)}open(t){const n=indexedDB.open(this._name,this._version),s=()=>{this._db=n.result},r=i=>{try{if(s(),!this._db)return;const c=this._db.transaction(this._objectStoreName,this._transactionMode);c.onerror=()=>this.onError(c.error),this._objectStore=c.objectStore(this._objectStoreName),this._objectStore&&i()}catch(c){F.error("indexedDB - transaction error",[c])}};if(t?.success){const i=t.success;t.success=()=>r(i)}if(t?.upgrade){const i=t.upgrade.bind(this);t.upgrade=()=>{s(),i()}}const o=()=>{const i=c=>{if(c?.name==="VersionError"){this._version++,this.saveVersion(),this.open(t);return}t?.error&&t.error(c)};this.onError(n.error,i)};return t&&this.openRequestEventsHandler(n,{...t,error:o}),n}openRequestEventsHandler(t,n){this.requestEventsHandler(t,n),n.upgrade&&(t.onupgradeneeded=n.upgrade)}removeItem(t){const n=()=>{if(this._objectStore){const s=this._objectStore.delete(t);this.handleDeleteRequest(s,t)}};this.open({success:n})}removeItems(t){const n=()=>{if(this._objectStore){const s=this._objectStore.getAllKeys(),r=()=>{s.result.forEach(c=>{if(this._objectStore&&(!t||!t.includes(c))){const l=this._objectStore.delete(c);this.handleDeleteRequest(l,c)}})},o=()=>F.error("IndexedDB - removeItems",[s.error]);this.requestEventsHandler(s,{error:o,success:r})}};this.open({success:n})}requestEventsHandler(t,n){const{error:s,success:r}=n;s&&(t.onerror=s),r&&(t.onsuccess=r)}saveVersion(){localStorage&&localStorage.setItem(this._localStorageVersionKey,this._version.toString())}setItem(t,n){const s=()=>{if(this._objectStore){const o=this._objectStore.add(t);if(n){const i=()=>{n.forEach(l=>{this._objectStore?.createIndex(l,l,{unique:!0}),F.log(`"${l}" index created`)})},c=()=>this.onError(o.error);this.requestEventsHandler(o,{error:c,success:i})}}},r=this.createObjectStore;this.open({success:s,upgrade:r})}updateItem(t){const n=()=>{if(this._objectStore){const s=this._objectStore.put(t);s.onerror=()=>F.error("update item",[s.error,t])}};this.open({success:n})}};class Ye{_db;_db_options;get dbName(){return this._db_options.name}constructor(t){if(!t)throw new Error("DbOptions is required");this._db_options=t,this._db=this.defineDb()}defineDb(){const{keyPath:t,name:n}=this._db_options;return n==="localStorage"||n==="sessionStorage"?new ee(n):new qt(n,{keyPath:t})}getItem(t){return new Promise((n,s)=>{try{return this._db.getItem(t).then(r=>n(r))}catch(r){s(r)}})}removeItem(t){this._db.removeItem(t)}setItem(t,n){if(console.log("Persister - setItem",[t,n,this._db]),this._db instanceof qt)try{this._db.getItem(t).then(s=>{s?this._db.updateItem(s):this._db.setItem({storeName:t,...n})})}catch(s){F.error("Persister - setItem Error",s),this._db.setItem({storename:t,...n})}else this._db.setItem(n,t)}}class Ms{_store=new Map;clear(){this._store.clear()}keyToString(t){return typeof t=="number"?t.toString():t}async getItem(t){return this._store.get(this.keyToString(t))}removeItem(t){this._store.delete(this.keyToString(t))}removeItems(t){if(t)for(const n of this._store.keys())t.includes(n)||this._store.delete(n);else this._store.clear()}setItem(t,n){this._store.set(n,t)}}let Y={};const Fs={clear:()=>Y={},getItem:async e=>new Promise(t=>t(Y[e])),removeItem:e=>delete Y[e],removeItems:e=>e?e.forEach(t=>delete Y[t]):Y={},setItem:(e,t)=>{Y[t]=e}};class Lt extends Ye{defineDb(){return this.dbName==="localStorage"||this.dbName==="sessionStorage"?Fs:new Ms}}class ae{_encoder=new TextEncoder;_key;_materialKey;static DECRYPT="decrypt";static ENCRYPT="encrypt";constructor(t){this._key=t}async getKey(t){return await crypto.subtle.deriveKey({name:"PBKDF2",salt:this._encoder.encode("salt"),iterations:1e5,hash:"SHA-256"},this._materialKey,{name:"AES-GCM",length:256},!1,[t])}async setKeyMaterial(t){this._materialKey=await crypto.subtle.importKey("raw",this._encoder.encode(t),{name:"PBKDF2"},!1,["deriveKey"])}async decrypt(t){const[n,s]=t.split(":"),r=await crypto.subtle.decrypt({name:"AES-GCM",iv:Uint8Array.from(atob(n),o=>o.charCodeAt(0))},await this.getKey(ae.DECRYPT),Uint8Array.from(atob(s),o=>o.charCodeAt(0)));return new TextDecoder().decode(r)}async encrypt(t){const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},await this.getKey(ae.ENCRYPT),this._encoder.encode(t));return btoa(String.fromCharCode(...new Uint8Array(n)))+":"+btoa(String.fromCharCode(...new Uint8Array(s)))}async init(){this._materialKey||await this.setKeyMaterial(this._key)}}const Ge=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Ut=()=>{},Ks=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),be=Object.assign,N=Array.isArray,K=e=>typeof e=="function",$=e=>typeof e=="string",Hs=e=>typeof e=="symbol",H=e=>e!==null&&typeof e=="object";let zt;const Se=()=>zt||(zt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Qe(e){if(N(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=$(s)?zs(s):Qe(s);if(r)for(const o in r)t[o]=r[o]}return t}else if($(e)||H(e))return e}const qs=/;(?![^(]*\))/g,Ls=/:([^]+)/,Us=/\/\*[^]*?\*\//g;function zs(e){const t={};return e.replace(Us,"").split(qs).forEach(n=>{if(n){const s=n.split(Ls);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Xe(e){let t="";if($(e))t=e;else if(N(e))for(let n=0;n<e.length;n++){const s=Xe(e[n]);s&&(t+=s+" ")}else if(H(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV,new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Hs));function Bt(e){return Ze(e)?Bt(e.__v_raw):!!(e&&e.__v_isReactive)}function Ze(e){return!!(e&&e.__v_isReadonly)}function et(e){return!!(e&&e.__v_isShallow)}function tt(e){return e?!!e.__v_raw:!1}function T(e){const t=e&&e.__v_raw;return t?T(t):e}function nt(e){return e?e.__v_isRef===!0:!1}const q=[];function Bs(e){q.push(e)}function Ws(){q.pop()}let st=!1;function G(e,...t){if(st)return;st=!0;const n=q.length?q[q.length-1].component:null,s=n&&n.appContext.config.warnHandler,r=Js();if(s)rt(s,n,11,[e+t.map(o=>{var i,c;return(c=(i=o.toString)==null?void 0:i.call(o))!=null?c:JSON.stringify(o)}).join(""),n&&n.proxy,r.map(({vnode:o})=>`at <${ln(n,o.type)}>`).join(`
|
|
4
|
+
`],...is(n))}),t}function is({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",s=e.component?e.component.parent==null:!1,r=` at <${Kt(e.component,e.type,s)}`,o=">"+n;return e.props?[r,...cs(e.props),o]:[r+o]}function cs(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(s=>{t.push(...kt(s,e[s]))}),n.length>3&&t.push(" ..."),t}function kt(e,t,n){return k(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:m(t)?(t=kt(e,p(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):R(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=p(t),n?t:[`${e}=`,t])}const Ct={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Le(e,t,n,s){try{return s?e(...s):e()}catch(r){Vt(r,t,n)}}function Vt(e,t,n,s=!0){const r=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||Ve;if(t){let c=t.parent;const l=t.proxy,f=process.env.NODE_ENV!=="production"?Ct[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;c;){const h=c.ec;if(h){for(let a=0;a<h.length;a++)if(h[a](e,l,f)===!1)return}c=c.parent}if(o){Le(o,null,10,[e,l,f]);return}}as(e,n,r,s,i)}function as(e,t,n,s=!0,r=!1){if(process.env.NODE_ENV!=="production"){const o=Ct[t];if(n&&ns(n),ie(`Unhandled error${o?` during execution of ${o}`:""}`),n&&ss(),s)throw e;console.error(e)}else{if(r)throw e;console.error(e)}}const S=[];let I=-1;const W=[];let j=null,J=0;const ls=Promise.resolve();let Ue=null;const us=100;function fs(e){let t=I+1,n=S.length;for(;t<n;){const s=t+n>>>1,r=S[s],o=ce(r);o<e||o===e&&r.flags&2?t=s+1:n=s}return t}function ps(e){if(!(e.flags&1)){const t=ce(e),n=S[S.length-1];!n||!(e.flags&2)&&t>=ce(n)?S.push(e):S.splice(fs(t),0,e),e.flags|=1,It()}}function It(){Ue||(Ue=ls.then(Pt))}function hs(e){g(e)?W.push(...e):j&&e.id===-1?j.splice(J+1,0,e):e.flags&1||(W.push(e),e.flags|=1),It()}function ds(e){if(W.length){const t=[...new Set(W)].sort((n,s)=>ce(n)-ce(s));if(W.length=0,j){j.push(...t);return}for(j=t,process.env.NODE_ENV!=="production"&&(e=e||new Map),J=0;J<j.length;J++){const n=j[J];process.env.NODE_ENV!=="production"&&Rt(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}j=null,J=0}}const ce=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Pt(e){process.env.NODE_ENV!=="production"&&(e=e||new Map);const t=process.env.NODE_ENV!=="production"?n=>Rt(e,n):vn;try{for(I=0;I<S.length;I++){const n=S[I];if(n&&!(n.flags&8)){if(process.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),Le(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;I<S.length;I++){const n=S[I];n&&(n.flags&=-2)}I=-1,S.length=0,ds(e),Ue=null,(S.length||W.length)&&Pt(e)}}function Rt(e,t){const n=e.get(t)||0;if(n>us){const s=t.i,r=s&&Ft(s.type);return Vt(`Maximum recursive updates exceeded${r?` in component <${r}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,n+1),!1}const ze=new Map;process.env.NODE_ENV!=="production"&&(fe().__VUE_HMR_RUNTIME__={createRecord:Be(_s),rerender:Be(gs),reload:Be(ys)});const de=new Map;function _s(e,t){return de.has(e)?!1:(de.set(e,{initialDef:_e(t),instances:new Set}),!0)}function _e(e){return Ht(e)?e.__vccOpts:e}function gs(e,t){const n=de.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(s=>{t&&(s.render=t,_e(s.type).render=t),s.renderCache=[],s.job.flags&8||s.update()}))}function ys(e,t){const n=de.get(e);if(!n)return;t=_e(t),xt(n.initialDef,t);const s=[...n.instances];for(let r=0;r<s.length;r++){const o=s[r],i=_e(o.type);let c=ze.get(i);c||(i!==n.initialDef&&xt(i,t),ze.set(i,c=new Set)),c.add(o),o.appContext.propsCache.delete(o.type),o.appContext.emitsCache.delete(o.type),o.appContext.optionsCache.delete(o.type),o.ceReload?(c.add(o),o.ceReload(t.styles),c.delete(o)):o.parent?ps(()=>{o.job.flags&8||(o.parent.update(),c.delete(o))}):o.appContext.reload?o.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),o.root.ce&&o!==o.root&&o.root.ce._removeChildStyle(i)}hs(()=>{ze.clear()})}function xt(e,t){U(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function Be(e){return(t,n)=>{try{return e(t,n)}catch(s){console.error(s),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let ge=null,ms=null;const bs=e=>e.__isTeleport;function Dt(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Dt(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}fe().requestIdleCallback,fe().cancelIdleCallback;const Ss=Symbol.for("v-ndc");process.env.NODE_ENV;const vs={},jt=e=>Object.getPrototypeOf(e)===vs,ws=e=>e.__isSuspense,$t=Symbol.for("v-fgt"),Es=Symbol.for("v-txt"),Ns=Symbol.for("v-cmt");function Os(e){return e?e.__v_isVNode===!0:!1}const ks=(...e)=>At(...e),Tt=({key:e})=>e??null,ye=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?k(e)||m(e)||R(e)?{i:ge,r:e,k:t,f:!!n}:e:null);function Cs(e,t=null,n=null,s=0,r=null,o=e===$t?0:1,i=!1,c=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Tt(t),ref:t&&ye(t),scopeId:ms,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:ge};return c?(We(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=k(n)?8:16),process.env.NODE_ENV!=="production"&&l.key!==l.key&&ie("VNode created with invalid key (NaN). VNode type:",l.type),l}const Vs=process.env.NODE_ENV!=="production"?ks:At;function At(e,t=null,n=null,s=0,r=null,o=!1){if((!e||e===Ss)&&(process.env.NODE_ENV!=="production"&&!e&&ie(`Invalid vnode type when creating vnode: ${e}.`),e=Ns),Os(e)){const c=me(e,t,!0);return n&&We(c,n),c.patchFlag=-2,c}if(Ht(e)&&(e=e.__vccOpts),t){t=Is(t);let{class:c,style:l}=t;c&&!k(c)&&(t.class=xe(c)),y(l)&&(re(l)&&!g(l)&&(l=U({},l)),t.style=Re(l))}const i=k(e)?1:ws(e)?128:bs(e)?64:y(e)?4:R(e)?2:0;return process.env.NODE_ENV!=="production"&&i&4&&re(e)&&(e=p(e),ie("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
5
|
+
Component that was made reactive: `,e)),Cs(e,t,n,s,r,i,o,!0)}function Is(e){return e?re(e)||jt(e)?U({},e):e:null}function me(e,t,n=!1,s=!1){const{props:r,ref:o,patchFlag:i,children:c,transition:l}=e,f=t?Rs(r||{},t):r,h={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&Tt(f),ref:t&&t.ref?n&&o?g(o)?o.concat(ye(t)):[o,ye(t)]:ye(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&i===-1&&g(c)?c.map(Mt):c,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==$t?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&me(e.ssContent),ssFallback:e.ssFallback&&me(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&s&&Dt(h,l.clone(h)),h}function Mt(e){const t=me(e);return g(e.children)&&(t.children=e.children.map(Mt)),t}function Ps(e=" ",t=0){return Vs(Es,null,e,t)}function We(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(g(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),We(e,r()),r._c&&(r._d=!0));return}else n=32,!t._&&!jt(t)&&(t._ctx=ge);else R(t)?(t={default:t,_ctx:ge},n=32):(t=String(t),s&64?(n=16,t=[Ps(t)]):n=8);e.children=t,e.shapeFlag|=n}function Rs(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const r in s)if(r==="class")t.class!==s.class&&(t.class=xe([t.class,s.class]));else if(r==="style")t.style=Re([t.style,s.style]);else if(wn(r)){const o=t[r],i=s[r];i&&o!==i&&!(g(o)&&o.includes(i))&&(t[r]=o?[].concat(o,i):i)}else r!==""&&(t[r]=s[r])}return t}{const e=fe(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),o=>{r.length>1?r.forEach(i=>i(o)):r[0](o)}};t("__VUE_INSTANCE_SETTERS__",n=>n),t("__VUE_SSR_SETTERS__",n=>n)}process.env.NODE_ENV;const xs=/(?:^|[-_])\w/g,Ds=e=>e.replace(xs,t=>t.toUpperCase()).replace(/[-_]/g,"");function Ft(e,t=!0){return R(e)?e.displayName||e.name:e.name||t&&e.__name}function Kt(e,t,n=!1){let s=Ft(t);if(!s&&t.__file){const r=t.__file.match(/([^/\\]+)\.\w+$/);r&&(s=r[1])}if(!s&&e){const r=o=>{for(const i in o)if(o[i]===t)return i};s=r(e.components)||e.parent&&r(e.parent.type.components)||r(e.appContext.components)}return s?Ds(s):n?"App":"Anonymous"}function Ht(e){return R(e)&&"__vccOpts"in e}function js(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},n={style:"color:#f5222d"},s={style:"color:#eb2f96"},r={__vue_custom_formatter:!0,header(a){if(!y(a))return null;if(a.__isVue)return["div",e,"VueInstance"];if(m(a)){const u=a.value;return["div",{},["span",e,h(a)],"<",c(u),">"]}else{if(He(a))return["div",{},["span",e,b(a)?"ShallowReactive":"Reactive"],"<",c(a),`>${E(a)?" (readonly)":""}`];if(E(a))return["div",{},["span",e,b(a)?"ShallowReadonly":"Readonly"],"<",c(a),">"]}return null},hasBody(a){return a&&a.__isVue},body(a){if(a&&a.__isVue)return["div",{},...o(a.$)]}};function o(a){const u=[];a.type.props&&a.props&&u.push(i("props",p(a.props))),a.setupState!==Ve&&u.push(i("setup",a.setupState)),a.data!==Ve&&u.push(i("data",p(a.data)));const d=l(a,"computed");d&&u.push(i("computed",d));const _=l(a,"inject");return _&&u.push(i("injected",_)),u.push(["div",{},["span",{style:s.style+";opacity:0.66"},"$ (internal): "],["object",{object:a}]]),u}function i(a,u){return u=U({},u),Object.keys(u).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},a],["div",{style:"padding-left:1.25em"},...Object.keys(u).map(d=>["div",{},["span",s,d+": "],c(u[d],!1)])]]:["span",{}]}function c(a,u=!0){return typeof a=="number"?["span",t,a]:typeof a=="string"?["span",n,JSON.stringify(a)]:typeof a=="boolean"?["span",s,a]:y(a)?["object",{object:u?p(a):a}]:["span",n,String(a)]}function l(a,u){const d=a.type;if(R(d))return;const _={};for(const w in a.ctx)f(d,w,u)&&(_[w]=a.ctx[w]);return _}function f(a,u,d){const _=a[d];if(g(_)&&_.includes(u)||y(_)&&u in _||a.extends&&f(a.extends,u,d)||a.mixins&&a.mixins.some(w=>f(w,u,d)))return!0}function h(a){return b(a)?"ShallowRef":a.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(r):window.devtoolsFormatters=[r]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function $s(){js()}process.env.NODE_ENV!=="production"&&$s();class Ts extends hn{_className="Store";_onAction;_options;_resetCallback;_store;_subscriptions={};_storeSubscribe;static _requiredKeys;get onAction(){if(this._onAction)return()=>({store:this.store,callback:this._onAction})}set onAction(t){this._onAction=t}get options(){return this._options}get resetCallback(){return this._resetCallback}set resetCallback(t){this._resetCallback=t}get state(){return this._store.$state}set state(t){this._store.$state=t}get store(){return this._store}get storeSubscribe(){if(this._storeSubscribe)return()=>({store:this.store,callback:this._storeSubscribe})}set storeSubscribe(t){this._storeSubscribe=t}constructor(t,n,s=!1,r){super(s,r),this._options=n.storeOptions,this._store=t}addToState(t,n){this.isOptionApi()||n?.value||(n=Ot(n)),this.state[t]=n,this.store[t]=es(this.state,t)}addSubscription(t,n,s){this._subscriptions[t]={subscription:n,...s??{}}}static customizeStore(t,n,s=!1,r){if(n.storeOptions&&this.hasRequiredKeys(n.storeOptions))return new this(t,n,s,r)}hasDeniedFirstChar(t){return bn(t[0])}static hasRequiredKeys(t){return this._requiredKeys===void 0||this._requiredKeys?.every(n=>!!t[n])}getOption(t){return this.options&&this.options[t]}getStatePropertyValue(t){return this.getValue(this.state[t])}getSubscriptions(){if(!L(this._subscriptions))return this._subscriptions}getValue(t){return t?.__v_isRef?t.value:t}isOptionApi(){return this.store._isOptionsAPI}stateHas(t){return this.state.hasOwnProperty(t)}storeHas(t){return this.store.hasOwnProperty(t)}}const Je="pinia-plugin-persist-state";class As extends yn{_pluginName=Je}const F=new As;let qt=class{_db;_localStorageVersionKey="IDBVersion";_name="persistStore";_objectStore;_objectStoreOptions;_objectStoreName;_transactionMode="readwrite";_version;constructor(t,n,s){this._objectStoreName=t,this._version=this.getStoredVersionNumber(),n&&(this._objectStoreOptions=n),s&&(this._transactionMode=s)}clear(){const t=()=>{if(this._objectStore){const n=this._objectStore.clear();this.requestEventsHandler(n,{error:()=>this.onError(n.error)})}};this.open({success:t})}createObjectStore(){this._db&&!this._db.objectStoreNames.contains(this._objectStoreName)&&this._db.createObjectStore(this._objectStoreName,this._objectStoreOptions)}deleteObjectStore(){const t=()=>{this._db?.deleteObjectStore(this._objectStoreName)};this.open({success:t})}async getItem(t){return new Promise(n=>{const s=()=>{if(this._objectStore){const r=this._objectStore.get(t);this.requestEventsHandler(r,{error:()=>this.onError(r.error,()=>n(void 0)),success:()=>n(r.result)})}};this.open({success:s})})}async getObjectStoreItem(t,n){return new Promise(s=>{const r=()=>{if(this._objectStore){const i=this._objectStore.index(t).get(n);this.requestEventsHandler(i,{error:()=>s(void 0),success:()=>s(i.result)})}};this.open({success:r})})}getStoredVersionNumber(){if(!localStorage)return 1;const t=localStorage.getItem(this._localStorageVersionKey);return t?parseInt(t):1}handleDeleteRequest(t,n){t.onerror=()=>F.error(`IndexedDB - Item "${n}" remove`,t.error)}onError(t,n){n&&n(t)}open(t){const n=indexedDB.open(this._name,this._version),s=()=>{this._db=n.result},r=i=>{try{if(s(),!this._db)return;const c=this._db.transaction(this._objectStoreName,this._transactionMode);c.onerror=()=>this.onError(c.error),this._objectStore=c.objectStore(this._objectStoreName),this._objectStore&&i()}catch(c){F.error("indexedDB - transaction error",[c])}};if(t?.success){const i=t.success;t.success=()=>r(i)}if(t?.upgrade){const i=t.upgrade.bind(this);t.upgrade=()=>{s(),i()}}const o=()=>{const i=c=>{if(c?.name==="VersionError"){this._version++,this.saveVersion(),this.open(t);return}t?.error&&t.error(c)};this.onError(n.error,i)};return t&&this.openRequestEventsHandler(n,{...t,error:o}),n}openRequestEventsHandler(t,n){this.requestEventsHandler(t,n),n.upgrade&&(t.onupgradeneeded=n.upgrade)}removeItem(t){const n=()=>{if(this._objectStore){const s=this._objectStore.delete(t);this.handleDeleteRequest(s,t)}};this.open({success:n})}removeItems(t){const n=()=>{if(this._objectStore){const s=this._objectStore.getAllKeys(),r=()=>{s.result.forEach(c=>{if(this._objectStore&&(!t||!t.includes(c))){const l=this._objectStore.delete(c);this.handleDeleteRequest(l,c)}})},o=()=>F.error("IndexedDB - removeItems",[s.error]);this.requestEventsHandler(s,{error:o,success:r})}};this.open({success:n})}requestEventsHandler(t,n){const{error:s,success:r}=n;s&&(t.onerror=s),r&&(t.onsuccess=r)}saveVersion(){localStorage&&localStorage.setItem(this._localStorageVersionKey,this._version.toString())}setItem(t,n){const s=()=>{if(this._objectStore){const o=this._objectStore.add(t);if(n){const i=()=>{n.forEach(l=>{this._objectStore?.createIndex(l,l,{unique:!0}),F.log(`"${l}" index created`)})},c=()=>this.onError(o.error);this.requestEventsHandler(o,{error:c,success:i})}}},r=this.createObjectStore;this.open({success:s,upgrade:r})}updateItem(t){const n=()=>{if(this._objectStore){const s=this._objectStore.put(t);s.onerror=()=>F.error("update item",[s.error,t])}};this.open({success:n})}};class Ye{_db;_db_options;get dbName(){return this._db_options.name}constructor(t){if(!t)throw new Error("DbOptions is required");this._db_options=t,this._db=this.defineDb()}defineDb(){const{keyPath:t,name:n}=this._db_options;return n==="localStorage"||n==="sessionStorage"?new ee(n):new qt(n,{keyPath:t})}getItem(t){return new Promise((n,s)=>{try{return this._db.getItem(t).then(r=>n(r))}catch(r){s(r)}})}removeItem(t){this._db.removeItem(t)}setItem(t,n){if(console.log("Persister - setItem",[t,n,this._db]),this._db instanceof qt)try{this._db.getItem(t).then(s=>{s?this._db.updateItem(s):this._db.setItem({storeName:t,...n})})}catch(s){F.error("Persister - setItem Error",s),this._db.setItem({storename:t,...n})}else this._db.setItem(n,t)}}class Ms{_store=new Map;clear(){this._store.clear()}keyToString(t){return typeof t=="number"?t.toString():t}async getItem(t){return this._store.get(this.keyToString(t))}removeItem(t){this._store.delete(this.keyToString(t))}removeItems(t){if(t)for(const n of this._store.keys())t.includes(n)||this._store.delete(n);else this._store.clear()}setItem(t,n){this._store.set(n,t)}}let Y={};const Fs={clear:()=>Y={},getItem:async e=>new Promise(t=>t(Y[e])),removeItem:e=>delete Y[e],removeItems:e=>e?e.forEach(t=>delete Y[t]):Y={},setItem:(e,t)=>{Y[t]=e}};class Lt extends Ye{defineDb(){return this.dbName==="localStorage"||this.dbName==="sessionStorage"?Fs:new Ms}}class ae{_encoder=new TextEncoder;_key;_materialKey;static DECRYPT="decrypt";static ENCRYPT="encrypt";constructor(t){this._key=t}async getKey(t){return await crypto.subtle.deriveKey({name:"PBKDF2",salt:this._encoder.encode("salt"),iterations:1e5,hash:"SHA-256"},this._materialKey,{name:"AES-GCM",length:256},!1,[t])}async setKeyMaterial(t){this._materialKey=await crypto.subtle.importKey("raw",this._encoder.encode(t),{name:"PBKDF2"},!1,["deriveKey"])}async decrypt(t){const[n,s]=t.split(":"),r=await crypto.subtle.decrypt({name:"AES-GCM",iv:Uint8Array.from(atob(n),o=>o.charCodeAt(0))},await this.getKey(ae.DECRYPT),Uint8Array.from(atob(s),o=>o.charCodeAt(0)));return new TextDecoder().decode(r)}async encrypt(t){const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},await this.getKey(ae.ENCRYPT),this._encoder.encode(t));return btoa(String.fromCharCode(...new Uint8Array(n)))+":"+btoa(String.fromCharCode(...new Uint8Array(s)))}async init(){this._materialKey||await this.setKeyMaterial(this._key)}}const Ge=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Ut=()=>{},Ks=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),be=Object.assign,N=Array.isArray,K=e=>typeof e=="function",$=e=>typeof e=="string",Hs=e=>typeof e=="symbol",H=e=>e!==null&&typeof e=="object";let zt;const Se=()=>zt||(zt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Qe(e){if(N(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=$(s)?zs(s):Qe(s);if(r)for(const o in r)t[o]=r[o]}return t}else if($(e)||H(e))return e}const qs=/;(?![^(]*\))/g,Ls=/:([^]+)/,Us=/\/\*[^]*?\*\//g;function zs(e){const t={};return e.replace(Us,"").split(qs).forEach(n=>{if(n){const s=n.split(Ls);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Xe(e){let t="";if($(e))t=e;else if(N(e))for(let n=0;n<e.length;n++){const s=Xe(e[n]);s&&(t+=s+" ")}else if(H(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV,new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Hs));function Bt(e){return Ze(e)?Bt(e.__v_raw):!!(e&&e.__v_isReactive)}function Ze(e){return!!(e&&e.__v_isReadonly)}function et(e){return!!(e&&e.__v_isShallow)}function tt(e){return e?!!e.__v_raw:!1}function T(e){const t=e&&e.__v_raw;return t?T(t):e}function nt(e){return e?e.__v_isRef===!0:!1}const q=[];function Bs(e){q.push(e)}function Ws(){q.pop()}let st=!1;function G(e,...t){if(st)return;st=!0;const n=q.length?q[q.length-1].component:null,s=n&&n.appContext.config.warnHandler,r=Js();if(s)rt(s,n,11,[e+t.map(o=>{var i,c;return(c=(i=o.toString)==null?void 0:i.call(o))!=null?c:JSON.stringify(o)}).join(""),n&&n.proxy,r.map(({vnode:o})=>`at <${ln(n,o.type)}>`).join(`
|
|
6
6
|
`),r]);else{const o=[`[Vue warn]: ${e}`,...t];r.length&&o.push(`
|
|
7
7
|
`,...Ys(r)),console.warn(...o)}st=!1}function Js(){let e=q[q.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const s=e.component&&e.component.parent;e=s&&s.vnode}return t}function Ys(e){const t=[];return e.forEach((n,s)=>{t.push(...s===0?[]:[`
|
|
8
|
-
`],...Gs(n))}),t}function Gs({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",s=e.component?e.component.parent==null:!1,r=` at <${ln(e.component,e.type,s)}`,o=">"+n;return e.props?[r,...Qs(e.props),o]:[r+o]}function Qs(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(s=>{t.push(...Wt(s,e[s]))}),n.length>3&&t.push(" ..."),t}function Wt(e,t,n){return $(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:nt(t)?(t=Wt(e,T(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):K(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=T(t),n?t:[`${e}=`,t])}const Jt={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function rt(e,t,n,s){try{return s?e(...s):e()}catch(r){Yt(r,t,n)}}function Yt(e,t,n,s=!0){const r=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||Ge;if(t){let c=t.parent;const l=t.proxy,f=process.env.NODE_ENV!=="production"?Jt[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;c;){const h=c.ec;if(h){for(let a=0;a<h.length;a++)if(h[a](e,l,f)===!1)return}c=c.parent}if(o){rt(o,null,10,[e,l,f]);return}}Xs(e,n,r,s,i)}function Xs(e,t,n,s=!0,r=!1){if(process.env.NODE_ENV!=="production"){const o=Jt[t];if(n&&Bs(n),G(`Unhandled error${o?` during execution of ${o}`:""}`),n&&Ws(),s)throw e;console.error(e)}else{if(r)throw e;console.error(e)}}const v=[];let
|
|
9
|
-
Component that was made reactive: `,e)),mr(e,t,n,s,r,i,o,!0)}function Sr(e){return e?tt(e)||nn(e)?be({},e):e:null}function
|
|
8
|
+
`],...Gs(n))}),t}function Gs({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",s=e.component?e.component.parent==null:!1,r=` at <${ln(e.component,e.type,s)}`,o=">"+n;return e.props?[r,...Qs(e.props),o]:[r+o]}function Qs(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(s=>{t.push(...Wt(s,e[s]))}),n.length>3&&t.push(" ..."),t}function Wt(e,t,n){return $(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:nt(t)?(t=Wt(e,T(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):K(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=T(t),n?t:[`${e}=`,t])}const Jt={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function rt(e,t,n,s){try{return s?e(...s):e()}catch(r){Yt(r,t,n)}}function Yt(e,t,n,s=!0){const r=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||Ge;if(t){let c=t.parent;const l=t.proxy,f=process.env.NODE_ENV!=="production"?Jt[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;c;){const h=c.ec;if(h){for(let a=0;a<h.length;a++)if(h[a](e,l,f)===!1)return}c=c.parent}if(o){rt(o,null,10,[e,l,f]);return}}Xs(e,n,r,s,i)}function Xs(e,t,n,s=!0,r=!1){if(process.env.NODE_ENV!=="production"){const o=Jt[t];if(n&&Bs(n),G(`Unhandled error${o?` during execution of ${o}`:""}`),n&&Ws(),s)throw e;console.error(e)}else{if(r)throw e;console.error(e)}}const v=[];let P=-1;const Q=[];let A=null,X=0;const Zs=Promise.resolve();let ot=null;const er=100;function tr(e){let t=P+1,n=v.length;for(;t<n;){const s=t+n>>>1,r=v[s],o=le(r);o<e||o===e&&r.flags&2?t=s+1:n=s}return t}function nr(e){if(!(e.flags&1)){const t=le(e),n=v[v.length-1];!n||!(e.flags&2)&&t>=le(n)?v.push(e):v.splice(tr(t),0,e),e.flags|=1,Gt()}}function Gt(){ot||(ot=Zs.then(Qt))}function sr(e){N(e)?Q.push(...e):A&&e.id===-1?A.splice(X+1,0,e):e.flags&1||(Q.push(e),e.flags|=1),Gt()}function rr(e){if(Q.length){const t=[...new Set(Q)].sort((n,s)=>le(n)-le(s));if(Q.length=0,A){A.push(...t);return}for(A=t,process.env.NODE_ENV!=="production"&&(e=e||new Map),X=0;X<A.length;X++){const n=A[X];process.env.NODE_ENV!=="production"&&Xt(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}A=null,X=0}}const le=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Qt(e){process.env.NODE_ENV!=="production"&&(e=e||new Map);const t=process.env.NODE_ENV!=="production"?n=>Xt(e,n):Ut;try{for(P=0;P<v.length;P++){const n=v[P];if(n&&!(n.flags&8)){if(process.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),rt(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;P<v.length;P++){const n=v[P];n&&(n.flags&=-2)}P=-1,v.length=0,rr(e),ot=null,(v.length||Q.length)&&Qt(e)}}function Xt(e,t){const n=e.get(t)||0;if(n>er){const s=t.i,r=s&&an(s.type);return Yt(`Maximum recursive updates exceeded${r?` in component <${r}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,n+1),!1}const it=new Map;process.env.NODE_ENV!=="production"&&(Se().__VUE_HMR_RUNTIME__={createRecord:ct(or),rerender:ct(ir),reload:ct(cr)});const ve=new Map;function or(e,t){return ve.has(e)?!1:(ve.set(e,{initialDef:we(t),instances:new Set}),!0)}function we(e){return un(e)?e.__vccOpts:e}function ir(e,t){const n=ve.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(s=>{t&&(s.render=t,we(s.type).render=t),s.renderCache=[],s.job.flags&8||s.update()}))}function cr(e,t){const n=ve.get(e);if(!n)return;t=we(t),Zt(n.initialDef,t);const s=[...n.instances];for(let r=0;r<s.length;r++){const o=s[r],i=we(o.type);let c=it.get(i);c||(i!==n.initialDef&&Zt(i,t),it.set(i,c=new Set)),c.add(o),o.appContext.propsCache.delete(o.type),o.appContext.emitsCache.delete(o.type),o.appContext.optionsCache.delete(o.type),o.ceReload?(c.add(o),o.ceReload(t.styles),c.delete(o)):o.parent?nr(()=>{o.job.flags&8||(o.parent.update(),c.delete(o))}):o.appContext.reload?o.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),o.root.ce&&o!==o.root&&o.root.ce._removeChildStyle(i)}sr(()=>{it.clear()})}function Zt(e,t){be(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function ct(e){return(t,n)=>{try{return e(t,n)}catch(s){console.error(s),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let Z,Ee=[];function en(e,t){var n,s;Z=e,Z?(Z.enabled=!0,Ee.forEach(({event:r,args:o})=>Z.emit(r,...o)),Ee=[]):typeof window<"u"&&window.HTMLElement&&!((s=(n=window.navigator)==null?void 0:n.userAgent)!=null&&s.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{en(o,t)}),setTimeout(()=>{Z||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Ee=[])},3e3)):Ee=[]}let Ne=null,ar=null;const lr=e=>e.__isTeleport;function tn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,tn(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}Se().requestIdleCallback,Se().cancelIdleCallback;const ur=Symbol.for("v-ndc"),fr={};process.env.NODE_ENV!=="production"&&(fr.ownKeys=e=>(G("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));const pr={},nn=e=>Object.getPrototypeOf(e)===pr,hr=e=>e.__isSuspense,sn=Symbol.for("v-fgt"),dr=Symbol.for("v-txt"),_r=Symbol.for("v-cmt");function gr(e){return e?e.__v_isVNode===!0:!1}const yr=(...e)=>on(...e),rn=({key:e})=>e??null,Oe=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?$(e)||nt(e)||K(e)?{i:Ne,r:e,k:t,f:!!n}:e:null);function mr(e,t=null,n=null,s=0,r=null,o=e===sn?0:1,i=!1,c=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&rn(t),ref:t&&Oe(t),scopeId:ar,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Ne};return c?(at(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=$(n)?8:16),process.env.NODE_ENV!=="production"&&l.key!==l.key&&G("VNode created with invalid key (NaN). VNode type:",l.type),l}const br=process.env.NODE_ENV!=="production"?yr:on;function on(e,t=null,n=null,s=0,r=null,o=!1){if((!e||e===ur)&&(process.env.NODE_ENV!=="production"&&!e&&G(`Invalid vnode type when creating vnode: ${e}.`),e=_r),gr(e)){const c=ke(e,t,!0);return n&&at(c,n),c.patchFlag=-2,c}if(un(e)&&(e=e.__vccOpts),t){t=Sr(t);let{class:c,style:l}=t;c&&!$(c)&&(t.class=Xe(c)),H(l)&&(tt(l)&&!N(l)&&(l=be({},l)),t.style=Qe(l))}const i=$(e)?1:hr(e)?128:lr(e)?64:H(e)?4:K(e)?2:0;return process.env.NODE_ENV!=="production"&&i&4&&tt(e)&&(e=T(e),G("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
9
|
+
Component that was made reactive: `,e)),mr(e,t,n,s,r,i,o,!0)}function Sr(e){return e?tt(e)||nn(e)?be({},e):e:null}function ke(e,t,n=!1,s=!1){const{props:r,ref:o,patchFlag:i,children:c,transition:l}=e,f=t?wr(r||{},t):r,h={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&rn(f),ref:t&&t.ref?n&&o?N(o)?o.concat(Oe(t)):[o,Oe(t)]:Oe(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&i===-1&&N(c)?c.map(cn):c,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==sn?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ke(e.ssContent),ssFallback:e.ssFallback&&ke(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&s&&tn(h,l.clone(h)),h}function cn(e){const t=ke(e);return N(e.children)&&(t.children=e.children.map(cn)),t}function vr(e=" ",t=0){return br(dr,null,e,t)}function at(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(N(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),at(e,r()),r._c&&(r._d=!0));return}else n=32,!t._&&!nn(t)&&(t._ctx=Ne);else K(t)?(t={default:t,_ctx:Ne},n=32):(t=String(t),s&64?(n=16,t=[vr(t)]):n=8);e.children=t,e.shapeFlag|=n}function wr(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const r in s)if(r==="class")t.class!==s.class&&(t.class=Xe([t.class,s.class]));else if(r==="style")t.style=Qe([t.style,s.style]);else if(Ks(r)){const o=t[r],i=s[r];i&&o!==i&&!(N(o)&&o.includes(i))&&(t[r]=o?[].concat(o,i):i)}else r!==""&&(t[r]=s[r])}return t}{const e=Se(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),o=>{r.length>1?r.forEach(i=>i(o)):r[0](o)}};t("__VUE_INSTANCE_SETTERS__",n=>n),t("__VUE_SSR_SETTERS__",n=>n)}process.env.NODE_ENV;const Er=/(?:^|[-_])\w/g,Nr=e=>e.replace(Er,t=>t.toUpperCase()).replace(/[-_]/g,"");function an(e,t=!0){return K(e)?e.displayName||e.name:e.name||t&&e.__name}function ln(e,t,n=!1){let s=an(t);if(!s&&t.__file){const r=t.__file.match(/([^/\\]+)\.\w+$/);r&&(s=r[1])}if(!s&&e){const r=o=>{for(const i in o)if(o[i]===t)return i};s=r(e.components)||e.parent&&r(e.parent.type.components)||r(e.appContext.components)}return s?Nr(s):n?"App":"Anonymous"}function un(e){return K(e)&&"__vccOpts"in e}function Or(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},n={style:"color:#f5222d"},s={style:"color:#eb2f96"},r={__vue_custom_formatter:!0,header(a){if(!H(a))return null;if(a.__isVue)return["div",e,"VueInstance"];if(nt(a)){const u=a.value;return["div",{},["span",e,h(a)],"<",c(u),">"]}else{if(Bt(a))return["div",{},["span",e,et(a)?"ShallowReactive":"Reactive"],"<",c(a),`>${Ze(a)?" (readonly)":""}`];if(Ze(a))return["div",{},["span",e,et(a)?"ShallowReadonly":"Readonly"],"<",c(a),">"]}return null},hasBody(a){return a&&a.__isVue},body(a){if(a&&a.__isVue)return["div",{},...o(a.$)]}};function o(a){const u=[];a.type.props&&a.props&&u.push(i("props",T(a.props))),a.setupState!==Ge&&u.push(i("setup",a.setupState)),a.data!==Ge&&u.push(i("data",T(a.data)));const d=l(a,"computed");d&&u.push(i("computed",d));const _=l(a,"inject");return _&&u.push(i("injected",_)),u.push(["div",{},["span",{style:s.style+";opacity:0.66"},"$ (internal): "],["object",{object:a}]]),u}function i(a,u){return u=be({},u),Object.keys(u).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},a],["div",{style:"padding-left:1.25em"},...Object.keys(u).map(d=>["div",{},["span",s,d+": "],c(u[d],!1)])]]:["span",{}]}function c(a,u=!0){return typeof a=="number"?["span",t,a]:typeof a=="string"?["span",n,JSON.stringify(a)]:typeof a=="boolean"?["span",s,a]:H(a)?["object",{object:u?T(a):a}]:["span",n,String(a)]}function l(a,u){const d=a.type;if(K(d))return;const _={};for(const w in a.ctx)f(d,w,u)&&(_[w]=a.ctx[w]);return _}function f(a,u,d){const _=a[d];if(N(_)&&_.includes(u)||H(_)&&u in _||a.extends&&f(a.extends,u,d)||a.mixins&&a.mixins.some(w=>f(w,u,d)))return!0}function h(a){return et(a)?"ShallowRef":a.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(r):window.devtoolsFormatters=[r]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function kr(){Or()}process.env.NODE_ENV!=="production"&&kr();const Cr=["@context","activeLink","computed","dep","excludedKeys","fn","isEncrypted","isLoading","subs","version"];class fn extends Ts{_className="StorePersister";_crypt;_excludedKeys;_persister;_propertiesToEncrypt;_watchedStore;constructor(t,n,s,r){super(t,n,s,r);const{crypt:o,persister:i,watchedStore:c}=n;this._excludedKeys=this.initExcludedKeys(),this.definePersister(i),this._propertiesToEncrypt=new Set(this.getPropertiesToEncrypt()),this._watchedStore=c,o&&(this._crypt=o,this.options&&(this.options.isEncrypted=!1)),this.augmentStore(),this.remember(),this.debugLog("StorePersister constructor",{toBeWatched:this.toBeWatched(),watchedStore:c,persister:i,store:t,options:n}),this.toBeWatched()&&(this._watchedStore.add(this.store.$id),this.storeSubscribe=this.storeSubscription.bind(this)),this.resetCallback=this.removePersistedState.bind(this)}augmentStore(){const{isEncrypted:t,persistedPropertiesToEncrypt:n,watchMutation:s}=this.options;t===void 0&&(this.options.isEncrypted=!1),n===void 0&&(this.options.persistedPropertiesToEncrypt=[]),s===void 0&&(this.options.watchMutation=!1),this.stateHas("isLoading")||this.addToState("isLoading",!1),this.store.persistState=async()=>await this.persist(),this.store.remember=async()=>await this.remember(),this.store.removePersistedState=this.removePersistedState.bind(this),this.store.watch=this.watch,this.store.stopWatch=this.stopWatch}async cryptProperty(t,n,s=!1){return s?await t.decrypt(n):await t.encrypt(n)}async cryptState(t,n=!1){return await new Promise(async s=>{const r=this._crypt,o=this.getPropertiesToEncrypt(),i=this.isEncrypted();if(this.debugLog(`cryptState - ${this.store.$id} ${n?"decrypt":"crypt"}`,{can:this._propertiesToEncrypt.size>0&&i===n&&!!r,Crypt:r,state:t}),this._propertiesToEncrypt.size>0&&r){const c={};for(const l of o){const f=this.getValue(t[l]);f&&(c[l]=await this.cryptProperty(r,f,n))}this.debugLog(`cryptState - ${this.store.$id}`,{encryptedState:c}),L(c)||(t={...t,...c},this.options&&(this.options.isEncrypted=!n))}s(t)})}static customizeStore(t,n,s,r){return!n.storeOptions?.persist&&n.storeOptions?.watchMutation&&(n.storeOptions.persist=!0),super.customizeStore(t,n,s,r)}definePersister(t){this._persister=this.options.dbName?new Ye({name:this.options.dbName,keyPath:"storeName"}):t}isEncrypted(){return this.options.isEncrypted}getPropertiesToEncrypt(){return this.options?.persistedPropertiesToEncrypt??[]}async getPersistedState(t=!0){const n=this.store.$id;try{let s=await this._persister.getItem(n);return t&&this.toBeCrypted()&&s&&(await this._crypt?.init(),s=await this.cryptState(s,!0)),this.debugLog(`getPersistedState ${n}`,{persistedState:s,state:this.state}),s}catch(s){this.logError("getPersistedState()",{storeName:n,e:s})}}async getStateToPersist(){const t=this._excludedKeys,n=this.state,s=this._propertiesToEncrypt.size>0,r=this._crypt;s&&await r.init();const o={};for(const i of Object.keys(n))if(!this.hasDeniedFirstChar(i[0])&&!t.has(i)){const c=n[i];L(c)||(s&&this._propertiesToEncrypt.has(i)?o[i]=await this.cryptProperty(r,c,!1):o[i]=T(c))}return o}getWatchMutation(){return this.options.watchMutation}initExcludedKeys(){return new Set([...Cr,...this.options.excludedKeys??[]])}async persist(){const t=await this.getStateToPersist();this.debugLog(`persist() ${this.store.$id} - stateToPersist:`,{state:t}),L(t)||this._persister.setItem(this.store.$id,t)}propertyShouldBePersisted(t){return!this._excludedKeys.has(t)}async remember(){return this.state.isLoading=!0,new Promise(async t=>{let n=await this.getPersistedState();return n&&!L(n)&&this.store.$patch(n),this.state.isLoading=!1,t(!0)})}removePersistedState(){this._persister.removeItem(this.store.$id)}stopWatch(){this.options?.watchMutation&&(this.options&&(this.options.watchMutation=!1),this._watchedStore.delete(this.store.$id))}storeSubscription(t){this.debugLog(`store.storeSubscription() ${this.store.$id}`,["mutation type !== patch object: ",t.type!=="patch object","watchMutation: ",this.getWatchMutation(),"mutation:",t,"state:",this.state,"store:",this.store]),t.type!=="patch object"&&this.getWatchMutation()&&this.persist().then(()=>{this.store.mutationCallback&&this.store.mutationCallback(this.state,t)})}toBeCrypted(){return!!(this._crypt&&this.getPropertiesToEncrypt())}toBeWatched(){return!this._watchedStore.has(this.store.$id)}watch(){this.toBeWatched()&&(this.options&&(this.options.watchMutation=!0),this.storeSubscribe=this.storeSubscription.bind(this))}}class Vr extends pn{constructor(){super(Je,fn.customizeStore.bind(fn),F)}}const Ce=new Vr;function Ir(e,t){return Ce.pluginOptions=Pr(e,t),Ce}function Pr(e,t){let n,s;const r=new Set;try{if(window)return!L(e)&&e&&(n=new Ye({name:e,keyPath:"storeName"})),t&&(s=new ae(t)),{persister:n,crypt:s,watchedStore:r}}catch{}return{persister:n,crypt:s,watchedStore:r}}function Rr(e,t){let n;return t&&(n=new ae(t)),Ce.pluginOptions={persister:new Lt({name:e}),crypt:n,watchedStore:new Set},Ce}O.PLUGIN_NAME=Je,O.PersisterMock=Lt,O.createPersistStatePlugin=Ir,O.createPluginMock=Rr,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "Alexandre Bidaud <alexbidaud85@gmail.com> (https://github.com/AlxBDo)",
|
|
3
3
|
"name": "pinia-plugin-persist-state",
|
|
4
4
|
"description": "Pinia plugin for persisting store state",
|
|
5
|
-
"version": "0.0.0-beta.
|
|
5
|
+
"version": "0.0.0-beta.3",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|