pinia-plugin-persist-state 0.1.1-beta.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,8 +9,8 @@ class Re {
|
|
|
9
9
|
}
|
|
10
10
|
async getItem(e) {
|
|
11
11
|
return new Promise((s, r) => {
|
|
12
|
-
const
|
|
13
|
-
s(
|
|
12
|
+
const n = this._storage.getItem(e.toString());
|
|
13
|
+
s(n ? JSON.parse(n) : void 0);
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
removeItem(e) {
|
|
@@ -30,8 +30,8 @@ const ae = "pinia-plugin-persist-state";
|
|
|
30
30
|
class ve extends Ve {
|
|
31
31
|
_pluginName = ae;
|
|
32
32
|
}
|
|
33
|
-
const
|
|
34
|
-
let
|
|
33
|
+
const b = new ve();
|
|
34
|
+
let ne = class {
|
|
35
35
|
_db;
|
|
36
36
|
_localStorageVersionKey = "IDBVersion";
|
|
37
37
|
_name = "persistStore";
|
|
@@ -67,13 +67,13 @@ let oe = class {
|
|
|
67
67
|
return new Promise((s) => {
|
|
68
68
|
const r = () => {
|
|
69
69
|
if (this._objectStore) {
|
|
70
|
-
const
|
|
71
|
-
this.requestEventsHandler(
|
|
70
|
+
const n = this._objectStore.get(e);
|
|
71
|
+
this.requestEventsHandler(n, {
|
|
72
72
|
error: () => this.onError(
|
|
73
|
-
|
|
73
|
+
n.error,
|
|
74
74
|
() => s(void 0)
|
|
75
75
|
),
|
|
76
|
-
success: () => s(
|
|
76
|
+
success: () => s(n.result)
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
};
|
|
@@ -82,7 +82,7 @@ let oe = class {
|
|
|
82
82
|
}
|
|
83
83
|
async getObjectStoreItem(e, s) {
|
|
84
84
|
return new Promise((r) => {
|
|
85
|
-
const
|
|
85
|
+
const n = () => {
|
|
86
86
|
if (this._objectStore) {
|
|
87
87
|
const i = this._objectStore.index(e).get(s);
|
|
88
88
|
this.requestEventsHandler(i, {
|
|
@@ -91,7 +91,7 @@ let oe = class {
|
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
|
-
this.open({ success:
|
|
94
|
+
this.open({ success: n });
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
getStoredVersionNumber() {
|
|
@@ -101,7 +101,7 @@ let oe = class {
|
|
|
101
101
|
return e ? parseInt(e) : 1;
|
|
102
102
|
}
|
|
103
103
|
handleDeleteRequest(e, s) {
|
|
104
|
-
e.onerror = () =>
|
|
104
|
+
e.onerror = () => b.error(`IndexedDB - Item "${s}" remove`, e.error);
|
|
105
105
|
}
|
|
106
106
|
onError(e, s) {
|
|
107
107
|
s && s(e);
|
|
@@ -109,18 +109,18 @@ let oe = class {
|
|
|
109
109
|
open(e) {
|
|
110
110
|
const s = indexedDB.open(this._name, this._version), r = () => {
|
|
111
111
|
this._db = s.result;
|
|
112
|
-
},
|
|
112
|
+
}, n = (i) => {
|
|
113
113
|
try {
|
|
114
114
|
if (r(), !this._db) return;
|
|
115
115
|
const c = this._db.transaction(this._objectStoreName, this._transactionMode);
|
|
116
116
|
c.onerror = () => this.onError(c.error), this._objectStore = c.objectStore(this._objectStoreName), this._objectStore && i();
|
|
117
117
|
} catch (c) {
|
|
118
|
-
|
|
118
|
+
b.error("indexedDB - transaction error", [c]);
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
121
|
if (e?.success) {
|
|
122
122
|
const i = e.success;
|
|
123
|
-
e.success = () =>
|
|
123
|
+
e.success = () => n(i);
|
|
124
124
|
}
|
|
125
125
|
if (e?.upgrade) {
|
|
126
126
|
const i = e.upgrade.bind(this);
|
|
@@ -128,7 +128,7 @@ let oe = class {
|
|
|
128
128
|
r(), i();
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
|
-
const
|
|
131
|
+
const o = () => {
|
|
132
132
|
const i = (c) => {
|
|
133
133
|
if (c?.name === "VersionError") {
|
|
134
134
|
this._version++, this.saveVersion(), this.open(e);
|
|
@@ -138,7 +138,7 @@ let oe = class {
|
|
|
138
138
|
};
|
|
139
139
|
this.onError(s.error, i);
|
|
140
140
|
};
|
|
141
|
-
return e && this.openRequestEventsHandler(s, { ...e, error:
|
|
141
|
+
return e && this.openRequestEventsHandler(s, { ...e, error: o }), s;
|
|
142
142
|
}
|
|
143
143
|
openRequestEventsHandler(e, s) {
|
|
144
144
|
this.requestEventsHandler(e, s), s.upgrade && (e.onupgradeneeded = s.upgrade);
|
|
@@ -155,22 +155,22 @@ let oe = class {
|
|
|
155
155
|
removeItems(e) {
|
|
156
156
|
const s = () => {
|
|
157
157
|
if (this._objectStore) {
|
|
158
|
-
const r = this._objectStore.getAllKeys(),
|
|
158
|
+
const r = this._objectStore.getAllKeys(), n = () => {
|
|
159
159
|
r.result.forEach((c) => {
|
|
160
160
|
if (this._objectStore && (!e || !e.includes(c))) {
|
|
161
161
|
const l = this._objectStore.delete(c);
|
|
162
162
|
this.handleDeleteRequest(l, c);
|
|
163
163
|
}
|
|
164
164
|
});
|
|
165
|
-
},
|
|
166
|
-
this.requestEventsHandler(r, { error:
|
|
165
|
+
}, o = () => b.error("IndexedDB - removeItems", [r.error]);
|
|
166
|
+
this.requestEventsHandler(r, { error: o, success: n });
|
|
167
167
|
}
|
|
168
168
|
};
|
|
169
169
|
this.open({ success: s });
|
|
170
170
|
}
|
|
171
171
|
requestEventsHandler(e, s) {
|
|
172
|
-
const { error: r, success:
|
|
173
|
-
r && (e.onerror = r),
|
|
172
|
+
const { error: r, success: n } = s;
|
|
173
|
+
r && (e.onerror = r), n && (e.onsuccess = n);
|
|
174
174
|
}
|
|
175
175
|
saveVersion() {
|
|
176
176
|
localStorage && localStorage.setItem(this._localStorageVersionKey, this._version.toString());
|
|
@@ -178,24 +178,24 @@ let oe = class {
|
|
|
178
178
|
setItem(e, s) {
|
|
179
179
|
const r = () => {
|
|
180
180
|
if (this._objectStore) {
|
|
181
|
-
const
|
|
181
|
+
const o = this._objectStore.add(e);
|
|
182
182
|
if (s) {
|
|
183
183
|
const i = () => {
|
|
184
184
|
s.forEach((l) => {
|
|
185
|
-
this._objectStore?.createIndex(l, l, { unique: !0 }),
|
|
185
|
+
this._objectStore?.createIndex(l, l, { unique: !0 }), b.log(`"${l}" index created`);
|
|
186
186
|
});
|
|
187
|
-
}, c = () => this.onError(
|
|
188
|
-
this.requestEventsHandler(
|
|
187
|
+
}, c = () => this.onError(o.error);
|
|
188
|
+
this.requestEventsHandler(o, { error: c, success: i });
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
},
|
|
192
|
-
this.open({ success: r, upgrade:
|
|
191
|
+
}, n = this.createObjectStore;
|
|
192
|
+
this.open({ success: r, upgrade: n });
|
|
193
193
|
}
|
|
194
194
|
updateItem(e) {
|
|
195
195
|
const s = () => {
|
|
196
196
|
if (this._objectStore) {
|
|
197
197
|
const r = this._objectStore.put(e);
|
|
198
|
-
r.onerror = () =>
|
|
198
|
+
r.onerror = () => b.error("update item", [r.error, e]);
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
201
|
this.open({ success: s });
|
|
@@ -214,14 +214,14 @@ class X {
|
|
|
214
214
|
}
|
|
215
215
|
defineDb() {
|
|
216
216
|
const { keyPath: e, name: s } = this._db_options;
|
|
217
|
-
return s === "localStorage" || s === "sessionStorage" ? new Re(s) : new
|
|
217
|
+
return s === "localStorage" || s === "sessionStorage" ? new Re(s) : new ne(s, { keyPath: e });
|
|
218
218
|
}
|
|
219
219
|
getItem(e) {
|
|
220
220
|
return new Promise((s, r) => {
|
|
221
221
|
try {
|
|
222
|
-
return this._db.getItem(e).then((
|
|
223
|
-
} catch (
|
|
224
|
-
r(
|
|
222
|
+
return this._db.getItem(e).then((n) => s(n));
|
|
223
|
+
} catch (n) {
|
|
224
|
+
r(n);
|
|
225
225
|
}
|
|
226
226
|
});
|
|
227
227
|
}
|
|
@@ -229,13 +229,13 @@ class X {
|
|
|
229
229
|
this._db.removeItem(e);
|
|
230
230
|
}
|
|
231
231
|
setItem(e, s) {
|
|
232
|
-
if (this._db instanceof
|
|
232
|
+
if (this._db instanceof ne)
|
|
233
233
|
try {
|
|
234
234
|
this._db.getItem(e).then((r) => {
|
|
235
235
|
r ? this._db.updateItem(r) : this._db.setItem({ storeName: e, ...s });
|
|
236
236
|
});
|
|
237
237
|
} catch (r) {
|
|
238
|
-
|
|
238
|
+
b.error("Persister - setItem Error", r), this._db.setItem({ storename: e, ...s });
|
|
239
239
|
}
|
|
240
240
|
else
|
|
241
241
|
this._db.setItem(s, e);
|
|
@@ -319,15 +319,15 @@ class R {
|
|
|
319
319
|
* @returns {string} decrypted item
|
|
320
320
|
*/
|
|
321
321
|
async decrypt(e) {
|
|
322
|
-
const [s, r] = e.split(":"),
|
|
322
|
+
const [s, r] = e.split(":"), n = await crypto.subtle.decrypt(
|
|
323
323
|
{
|
|
324
324
|
name: "AES-GCM",
|
|
325
|
-
iv: Uint8Array.from(atob(s), (
|
|
325
|
+
iv: Uint8Array.from(atob(s), (o) => o.charCodeAt(0))
|
|
326
326
|
},
|
|
327
327
|
await this.getKey(R.DECRYPT),
|
|
328
|
-
Uint8Array.from(atob(r), (
|
|
328
|
+
Uint8Array.from(atob(r), (o) => o.charCodeAt(0))
|
|
329
329
|
);
|
|
330
|
-
return new TextDecoder().decode(
|
|
330
|
+
return new TextDecoder().decode(n);
|
|
331
331
|
}
|
|
332
332
|
/**
|
|
333
333
|
* Encrypt string passed in parameter
|
|
@@ -353,20 +353,20 @@ const Y = process.env.NODE_ENV !== "production" ? Object.freeze({}) : {};
|
|
|
353
353
|
process.env.NODE_ENV !== "production" && Object.freeze([]);
|
|
354
354
|
const le = () => {
|
|
355
355
|
}, Me = (t) => t.charCodeAt(0) === 111 && t.charCodeAt(1) === 110 && // uppercase letter
|
|
356
|
-
(t.charCodeAt(2) > 122 || t.charCodeAt(2) < 97), Fe = (t) => t.startsWith("onUpdate:"), L = Object.assign, p = Array.isArray,
|
|
357
|
-
let
|
|
358
|
-
const U = () =>
|
|
356
|
+
(t.charCodeAt(2) > 122 || t.charCodeAt(2) < 97), Fe = (t) => t.startsWith("onUpdate:"), L = Object.assign, p = Array.isArray, N = (t) => typeof t == "function", y = (t) => typeof t == "string", Ae = (t) => typeof t == "symbol", P = (t) => t !== null && typeof t == "object";
|
|
357
|
+
let oe;
|
|
358
|
+
const U = () => oe || (oe = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
|
|
359
359
|
function Z(t) {
|
|
360
360
|
if (p(t)) {
|
|
361
361
|
const e = {};
|
|
362
362
|
for (let s = 0; s < t.length; s++) {
|
|
363
|
-
const r = t[s],
|
|
364
|
-
if (
|
|
365
|
-
for (const
|
|
366
|
-
e[
|
|
363
|
+
const r = t[s], n = y(r) ? Le(r) : Z(r);
|
|
364
|
+
if (n)
|
|
365
|
+
for (const o in n)
|
|
366
|
+
e[o] = n[o];
|
|
367
367
|
}
|
|
368
368
|
return e;
|
|
369
|
-
} else if (y(t) ||
|
|
369
|
+
} else if (y(t) || P(t))
|
|
370
370
|
return t;
|
|
371
371
|
}
|
|
372
372
|
const Ke = /;(?![^(]*\))/g, He = /:([^]+)/, qe = /\/\*[^]*?\*\//g;
|
|
@@ -388,7 +388,7 @@ function ee(t) {
|
|
|
388
388
|
const r = ee(t[s]);
|
|
389
389
|
r && (e += r + " ");
|
|
390
390
|
}
|
|
391
|
-
else if (
|
|
391
|
+
else if (P(t))
|
|
392
392
|
for (const s in t)
|
|
393
393
|
t[s] && (e += s + " ");
|
|
394
394
|
return e.trim();
|
|
@@ -416,26 +416,26 @@ function Q(t) {
|
|
|
416
416
|
return t ? !!t.__v_raw : !1;
|
|
417
417
|
}
|
|
418
418
|
// @__NO_SIDE_EFFECTS__
|
|
419
|
-
function
|
|
419
|
+
function E(t) {
|
|
420
420
|
const e = t && t.__v_raw;
|
|
421
|
-
return e ? /* @__PURE__ */
|
|
421
|
+
return e ? /* @__PURE__ */ E(e) : t;
|
|
422
422
|
}
|
|
423
423
|
// @__NO_SIDE_EFFECTS__
|
|
424
424
|
function te(t) {
|
|
425
425
|
return t ? t.__v_isRef === !0 : !1;
|
|
426
426
|
}
|
|
427
|
-
const
|
|
427
|
+
const O = [];
|
|
428
428
|
function Ue(t) {
|
|
429
|
-
|
|
429
|
+
O.push(t);
|
|
430
430
|
}
|
|
431
431
|
function Be() {
|
|
432
|
-
|
|
432
|
+
O.pop();
|
|
433
433
|
}
|
|
434
434
|
let W = !1;
|
|
435
|
-
function
|
|
435
|
+
function w(t, ...e) {
|
|
436
436
|
if (W) return;
|
|
437
437
|
W = !0;
|
|
438
|
-
const s =
|
|
438
|
+
const s = O.length ? O[O.length - 1].component : null, r = s && s.appContext.config.warnHandler, n = We();
|
|
439
439
|
if (r)
|
|
440
440
|
se(
|
|
441
441
|
r,
|
|
@@ -443,27 +443,27 @@ function E(t, ...e) {
|
|
|
443
443
|
11,
|
|
444
444
|
[
|
|
445
445
|
// eslint-disable-next-line no-restricted-syntax
|
|
446
|
-
t + e.map((
|
|
446
|
+
t + e.map((o) => {
|
|
447
447
|
var i, c;
|
|
448
|
-
return (c = (i =
|
|
448
|
+
return (c = (i = o.toString) == null ? void 0 : i.call(o)) != null ? c : JSON.stringify(o);
|
|
449
449
|
}).join(""),
|
|
450
450
|
s && s.proxy,
|
|
451
|
-
|
|
452
|
-
({ vnode:
|
|
451
|
+
n.map(
|
|
452
|
+
({ vnode: o }) => `at <${Ce(s, o.type)}>`
|
|
453
453
|
).join(`
|
|
454
454
|
`),
|
|
455
|
-
|
|
455
|
+
n
|
|
456
456
|
]
|
|
457
457
|
);
|
|
458
458
|
else {
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
`, ...ze(
|
|
459
|
+
const o = [`[Vue warn]: ${t}`, ...e];
|
|
460
|
+
n.length && o.push(`
|
|
461
|
+
`, ...ze(n)), console.warn(...o);
|
|
462
462
|
}
|
|
463
463
|
W = !1;
|
|
464
464
|
}
|
|
465
465
|
function We() {
|
|
466
|
-
let t =
|
|
466
|
+
let t = O[O.length - 1];
|
|
467
467
|
if (!t)
|
|
468
468
|
return [];
|
|
469
469
|
const e = [];
|
|
@@ -486,12 +486,12 @@ function ze(t) {
|
|
|
486
486
|
}), e;
|
|
487
487
|
}
|
|
488
488
|
function Je({ vnode: t, recurseCount: e }) {
|
|
489
|
-
const s = e > 0 ? `... (${e} recursive calls)` : "", r = t.component ? t.component.parent == null : !1,
|
|
489
|
+
const s = e > 0 ? `... (${e} recursive calls)` : "", r = t.component ? t.component.parent == null : !1, n = ` at <${Ce(
|
|
490
490
|
t.component,
|
|
491
491
|
t.type,
|
|
492
492
|
r
|
|
493
|
-
)}`,
|
|
494
|
-
return t.props ? [
|
|
493
|
+
)}`, o = ">" + s;
|
|
494
|
+
return t.props ? [n, ...Ye(t.props), o] : [n + o];
|
|
495
495
|
}
|
|
496
496
|
function Ye(t) {
|
|
497
497
|
const e = [], s = Object.keys(t);
|
|
@@ -500,7 +500,7 @@ function Ye(t) {
|
|
|
500
500
|
}), s.length > 3 && e.push(" ..."), e;
|
|
501
501
|
}
|
|
502
502
|
function fe(t, e, s) {
|
|
503
|
-
return y(e) ? (e = JSON.stringify(e), s ? e : [`${t}=${e}`]) : typeof e == "number" || typeof e == "boolean" || e == null ? s ? e : [`${t}=${e}`] : /* @__PURE__ */ te(e) ? (e = fe(t, /* @__PURE__ */
|
|
503
|
+
return y(e) ? (e = JSON.stringify(e), s ? e : [`${t}=${e}`]) : typeof e == "number" || typeof e == "boolean" || e == null ? s ? e : [`${t}=${e}`] : /* @__PURE__ */ te(e) ? (e = fe(t, /* @__PURE__ */ E(e.value), !0), s ? e : [`${t}=Ref<`, e, ">"]) : N(e) ? [`${t}=fn${e.name ? `<${e.name}>` : ""}`] : (e = /* @__PURE__ */ E(e), s ? e : [`${t}=`, e]);
|
|
504
504
|
}
|
|
505
505
|
const de = {
|
|
506
506
|
sp: "serverPrefetch hook",
|
|
@@ -538,12 +538,12 @@ const de = {
|
|
|
538
538
|
function se(t, e, s, r) {
|
|
539
539
|
try {
|
|
540
540
|
return r ? t(...r) : t();
|
|
541
|
-
} catch (
|
|
542
|
-
he(
|
|
541
|
+
} catch (n) {
|
|
542
|
+
he(n, e, s);
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
function he(t, e, s, r = !0) {
|
|
546
|
-
const
|
|
546
|
+
const n = e ? e.vnode : null, { errorHandler: o, throwUnhandledErrorInProduction: i } = e && e.appContext.config || Y;
|
|
547
547
|
if (e) {
|
|
548
548
|
let c = e.parent;
|
|
549
549
|
const l = e.proxy, f = process.env.NODE_ENV !== "production" ? de[s] : `https://vuejs.org/error-reference/#runtime-${s}`;
|
|
@@ -556,8 +556,8 @@ function he(t, e, s, r = !0) {
|
|
|
556
556
|
}
|
|
557
557
|
c = c.parent;
|
|
558
558
|
}
|
|
559
|
-
if (
|
|
560
|
-
se(
|
|
559
|
+
if (o) {
|
|
560
|
+
se(o, null, 10, [
|
|
561
561
|
t,
|
|
562
562
|
l,
|
|
563
563
|
f
|
|
@@ -565,16 +565,16 @@ function he(t, e, s, r = !0) {
|
|
|
565
565
|
return;
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
|
-
Ge(t, s,
|
|
568
|
+
Ge(t, s, n, r, i);
|
|
569
569
|
}
|
|
570
|
-
function Ge(t, e, s, r = !0,
|
|
570
|
+
function Ge(t, e, s, r = !0, n = !1) {
|
|
571
571
|
if (process.env.NODE_ENV !== "production") {
|
|
572
|
-
const
|
|
573
|
-
if (s && Ue(s),
|
|
572
|
+
const o = de[e];
|
|
573
|
+
if (s && Ue(s), w(`Unhandled error${o ? ` during execution of ${o}` : ""}`), s && Be(), r)
|
|
574
574
|
throw t;
|
|
575
575
|
console.error(t);
|
|
576
576
|
} else {
|
|
577
|
-
if (
|
|
577
|
+
if (n)
|
|
578
578
|
throw t;
|
|
579
579
|
console.error(t);
|
|
580
580
|
}
|
|
@@ -593,8 +593,8 @@ function Xe(t) {
|
|
|
593
593
|
function Ze(t) {
|
|
594
594
|
let e = g + 1, s = h.length;
|
|
595
595
|
for (; e < s; ) {
|
|
596
|
-
const r = e + s >>> 1,
|
|
597
|
-
|
|
596
|
+
const r = e + s >>> 1, n = h[r], o = v(n);
|
|
597
|
+
o < t || o === t && n.flags & 2 ? e = r + 1 : s = r;
|
|
598
598
|
}
|
|
599
599
|
return e;
|
|
600
600
|
}
|
|
@@ -661,9 +661,9 @@ function _e(t) {
|
|
|
661
661
|
function ge(t, e) {
|
|
662
662
|
const s = t.get(e) || 0;
|
|
663
663
|
if (s > Qe) {
|
|
664
|
-
const r = e.i,
|
|
664
|
+
const r = e.i, n = r && Ie(r.type);
|
|
665
665
|
return he(
|
|
666
|
-
`Maximum recursive updates exceeded${
|
|
666
|
+
`Maximum recursive updates exceeded${n ? ` in component <${n}>` : ""}. 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.`,
|
|
667
667
|
null,
|
|
668
668
|
10
|
|
669
669
|
), !0;
|
|
@@ -673,8 +673,8 @@ function ge(t, e) {
|
|
|
673
673
|
const z = /* @__PURE__ */ new Map();
|
|
674
674
|
process.env.NODE_ENV !== "production" && (U().__VUE_HMR_RUNTIME__ = {
|
|
675
675
|
createRecord: J(rt),
|
|
676
|
-
rerender: J(
|
|
677
|
-
reload: J(
|
|
676
|
+
rerender: J(nt),
|
|
677
|
+
reload: J(ot)
|
|
678
678
|
});
|
|
679
679
|
const M = /* @__PURE__ */ new Map();
|
|
680
680
|
function rt(t, e) {
|
|
@@ -686,25 +686,25 @@ function rt(t, e) {
|
|
|
686
686
|
function F(t) {
|
|
687
687
|
return Te(t) ? t.__vccOpts : t;
|
|
688
688
|
}
|
|
689
|
-
function
|
|
689
|
+
function nt(t, e) {
|
|
690
690
|
const s = M.get(t);
|
|
691
691
|
s && (s.initialDef.render = e, [...s.instances].forEach((r) => {
|
|
692
692
|
e && (r.render = e, F(r.type).render = e), r.renderCache = [], r.job.flags & 8 || r.update();
|
|
693
693
|
}));
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function ot(t, e) {
|
|
696
696
|
const s = M.get(t);
|
|
697
697
|
if (!s) return;
|
|
698
698
|
e = F(e), ie(s.initialDef, e);
|
|
699
699
|
const r = [...s.instances];
|
|
700
|
-
for (let
|
|
701
|
-
const
|
|
700
|
+
for (let n = 0; n < r.length; n++) {
|
|
701
|
+
const o = r[n], i = F(o.type);
|
|
702
702
|
let c = z.get(i);
|
|
703
|
-
c || (i !== s.initialDef && ie(i, e), z.set(i, c = /* @__PURE__ */ new Set())), c.add(
|
|
704
|
-
|
|
705
|
-
}) :
|
|
703
|
+
c || (i !== s.initialDef && ie(i, e), z.set(i, c = /* @__PURE__ */ 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(e.styles), c.delete(o)) : o.parent ? et(() => {
|
|
704
|
+
o.job.flags & 8 || (o.parent.update(), c.delete(o));
|
|
705
|
+
}) : o.appContext.reload ? o.appContext.reload() : typeof window < "u" ? window.location.reload() : console.warn(
|
|
706
706
|
"[HMR] Root or manually mounted instance modified. Full reload required."
|
|
707
|
-
),
|
|
707
|
+
), o.root.ce && o !== o.root && o.root.ce._removeChildStyle(i);
|
|
708
708
|
}
|
|
709
709
|
tt(() => {
|
|
710
710
|
z.clear();
|
|
@@ -729,11 +729,11 @@ function J(t) {
|
|
|
729
729
|
let T, j = [];
|
|
730
730
|
function ye(t, e) {
|
|
731
731
|
var s, r;
|
|
732
|
-
T = t, T ? (T.enabled = !0, j.forEach(({ event:
|
|
732
|
+
T = t, T ? (T.enabled = !0, j.forEach(({ event: n, args: o }) => T.emit(n, ...o)), j = []) : /* handle late devtools injection - only do this if we are in an actual */ /* browser environment to avoid the timer handle stalling test runner exit */ /* (#4815) */ typeof window < "u" && // some envs mock window but not fully
|
|
733
733
|
window.HTMLElement && // also exclude jsdom
|
|
734
734
|
// eslint-disable-next-line no-restricted-syntax
|
|
735
|
-
!((r = (s = window.navigator) == null ? void 0 : s.userAgent) != null && r.includes("jsdom")) ? ((e.__VUE_DEVTOOLS_HOOK_REPLAY__ = e.__VUE_DEVTOOLS_HOOK_REPLAY__ || []).push((
|
|
736
|
-
ye(
|
|
735
|
+
!((r = (s = window.navigator) == null ? void 0 : s.userAgent) != null && r.includes("jsdom")) ? ((e.__VUE_DEVTOOLS_HOOK_REPLAY__ = e.__VUE_DEVTOOLS_HOOK_REPLAY__ || []).push((o) => {
|
|
736
|
+
ye(o, e);
|
|
737
737
|
}), setTimeout(() => {
|
|
738
738
|
T || (e.__VUE_DEVTOOLS_HOOK_REPLAY__ = null, j = []);
|
|
739
739
|
}, 3e3)) : j = [];
|
|
@@ -747,7 +747,7 @@ function ct(t) {
|
|
|
747
747
|
for (const r of t)
|
|
748
748
|
if (r.type !== we) {
|
|
749
749
|
if (process.env.NODE_ENV !== "production" && s) {
|
|
750
|
-
|
|
750
|
+
w(
|
|
751
751
|
"<transition> can only be used on a single element or component. Use <transition-group> for lists."
|
|
752
752
|
);
|
|
753
753
|
break;
|
|
@@ -766,7 +766,7 @@ function at(t) {
|
|
|
766
766
|
if (s) {
|
|
767
767
|
if (e & 16)
|
|
768
768
|
return s[0];
|
|
769
|
-
if (e & 32 &&
|
|
769
|
+
if (e & 32 && N(s.default))
|
|
770
770
|
return s.default();
|
|
771
771
|
}
|
|
772
772
|
}
|
|
@@ -783,21 +783,21 @@ function Se(t, e) {
|
|
|
783
783
|
U().requestIdleCallback;
|
|
784
784
|
U().cancelIdleCallback;
|
|
785
785
|
const lt = (t) => t.type.__isKeepAlive, ut = /* @__PURE__ */ Symbol.for("v-ndc"), ft = {};
|
|
786
|
-
process.env.NODE_ENV !== "production" && (ft.ownKeys = (t) => (
|
|
786
|
+
process.env.NODE_ENV !== "production" && (ft.ownKeys = (t) => (w(
|
|
787
787
|
"Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."
|
|
788
788
|
), Reflect.ownKeys(t)));
|
|
789
789
|
const dt = {}, be = (t) => Object.getPrototypeOf(t) === dt, ht = (t) => t.__isSuspense, Ee = /* @__PURE__ */ Symbol.for("v-fgt"), pt = /* @__PURE__ */ Symbol.for("v-txt"), we = /* @__PURE__ */ Symbol.for("v-cmt");
|
|
790
790
|
function mt(t) {
|
|
791
791
|
return t ? t.__v_isVNode === !0 : !1;
|
|
792
792
|
}
|
|
793
|
-
const _t = (...t) =>
|
|
793
|
+
const _t = (...t) => Pe(
|
|
794
794
|
...t
|
|
795
795
|
), Ne = ({ key: t }) => t ?? null, $ = ({
|
|
796
796
|
ref: t,
|
|
797
797
|
ref_key: e,
|
|
798
798
|
ref_for: s
|
|
799
|
-
}) => (typeof t == "number" && (t = "" + t), t != null ? y(t) || /* @__PURE__ */ te(t) ||
|
|
800
|
-
function gt(t, e = null, s = null, r = 0,
|
|
799
|
+
}) => (typeof t == "number" && (t = "" + t), t != null ? y(t) || /* @__PURE__ */ te(t) || N(t) ? { i: A, r: t, k: e, f: !!s } : t : null);
|
|
800
|
+
function gt(t, e = null, s = null, r = 0, n = null, o = t === Ee ? 0 : 1, i = !1, c = !1) {
|
|
801
801
|
const l = {
|
|
802
802
|
__v_isVNode: !0,
|
|
803
803
|
__v_skip: !0,
|
|
@@ -820,16 +820,16 @@ function gt(t, e = null, s = null, r = 0, o = null, n = t === Ee ? 0 : 1, i = !1
|
|
|
820
820
|
targetStart: null,
|
|
821
821
|
targetAnchor: null,
|
|
822
822
|
staticCount: 0,
|
|
823
|
-
shapeFlag:
|
|
823
|
+
shapeFlag: o,
|
|
824
824
|
patchFlag: r,
|
|
825
|
-
dynamicProps:
|
|
825
|
+
dynamicProps: n,
|
|
826
826
|
dynamicChildren: null,
|
|
827
827
|
appContext: null,
|
|
828
828
|
ctx: A
|
|
829
829
|
};
|
|
830
|
-
if (c ? (H(l, s),
|
|
830
|
+
if (c ? (H(l, s), o & 128 && t.normalize(l)) : s && (l.shapeFlag |= y(s) ? 8 : 16), process.env.NODE_ENV !== "production" && l.key !== l.key && w("VNode created with invalid key (NaN). VNode type:", l.type), process.env.NODE_ENV !== "production" && e && l.shapeFlag & 1) {
|
|
831
831
|
const f = e.innerHTML != null ? "innerHTML" : e.textContent != null ? "textContent" : null;
|
|
832
|
-
f && yt(l.children) &&
|
|
832
|
+
f && yt(l.children) && w(
|
|
833
833
|
`The \`${f}\` prop on <${l.type}> will override its children. Remove either the \`${f}\` prop or the children.`
|
|
834
834
|
);
|
|
835
835
|
}
|
|
@@ -838,9 +838,9 @@ function gt(t, e = null, s = null, r = 0, o = null, n = t === Ee ? 0 : 1, i = !1
|
|
|
838
838
|
function yt(t) {
|
|
839
839
|
return y(t) ? t !== "" : p(t) ? t.length > 0 : !1;
|
|
840
840
|
}
|
|
841
|
-
const St = process.env.NODE_ENV !== "production" ? _t :
|
|
842
|
-
function
|
|
843
|
-
if ((!t || t === ut) && (process.env.NODE_ENV !== "production" && !t &&
|
|
841
|
+
const St = process.env.NODE_ENV !== "production" ? _t : Pe;
|
|
842
|
+
function Pe(t, e = null, s = null, r = 0, n = null, o = !1) {
|
|
843
|
+
if ((!t || t === ut) && (process.env.NODE_ENV !== "production" && !t && w(`Invalid vnode type when creating vnode: ${t}.`), t = we), mt(t)) {
|
|
844
844
|
const c = K(
|
|
845
845
|
t,
|
|
846
846
|
e,
|
|
@@ -852,10 +852,10 @@ function Oe(t, e = null, s = null, r = 0, o = null, n = !1) {
|
|
|
852
852
|
if (Te(t) && (t = t.__vccOpts), e) {
|
|
853
853
|
e = bt(e);
|
|
854
854
|
let { class: c, style: l } = e;
|
|
855
|
-
c && !y(c) && (e.class = ee(c)),
|
|
855
|
+
c && !y(c) && (e.class = ee(c)), P(l) && (/* @__PURE__ */ Q(l) && !p(l) && (l = L({}, l)), e.style = Z(l));
|
|
856
856
|
}
|
|
857
|
-
const i = y(t) ? 1 : ht(t) ? 128 : re(t) ? 64 :
|
|
858
|
-
return process.env.NODE_ENV !== "production" && i & 4 && /* @__PURE__ */ Q(t) && (t = /* @__PURE__ */
|
|
857
|
+
const i = y(t) ? 1 : ht(t) ? 128 : re(t) ? 64 : P(t) ? 4 : N(t) ? 2 : 0;
|
|
858
|
+
return process.env.NODE_ENV !== "production" && i & 4 && /* @__PURE__ */ Q(t) && (t = /* @__PURE__ */ E(t), w(
|
|
859
859
|
"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`.",
|
|
860
860
|
`
|
|
861
861
|
Component that was made reactive: `,
|
|
@@ -865,9 +865,9 @@ Component that was made reactive: `,
|
|
|
865
865
|
e,
|
|
866
866
|
s,
|
|
867
867
|
r,
|
|
868
|
-
o,
|
|
869
|
-
i,
|
|
870
868
|
n,
|
|
869
|
+
i,
|
|
870
|
+
o,
|
|
871
871
|
!0
|
|
872
872
|
);
|
|
873
873
|
}
|
|
@@ -875,7 +875,7 @@ function bt(t) {
|
|
|
875
875
|
return t ? /* @__PURE__ */ Q(t) || be(t) ? L({}, t) : t : null;
|
|
876
876
|
}
|
|
877
877
|
function K(t, e, s = !1, r = !1) {
|
|
878
|
-
const { props:
|
|
878
|
+
const { props: n, ref: o, patchFlag: i, children: c, transition: l } = t, f = e ? wt(n || {}, e) : n, _ = {
|
|
879
879
|
__v_isVNode: !0,
|
|
880
880
|
__v_skip: !0,
|
|
881
881
|
type: t.type,
|
|
@@ -885,11 +885,11 @@ function K(t, e, s = !1, r = !1) {
|
|
|
885
885
|
// #2078 in the case of <component :is="vnode" ref="extra"/>
|
|
886
886
|
// if the vnode itself already has a ref, cloneVNode will need to merge
|
|
887
887
|
// the refs so the single vnode can be set on multiple refs
|
|
888
|
-
s &&
|
|
889
|
-
) :
|
|
888
|
+
s && o ? p(o) ? o.concat($(e)) : [o, $(e)] : $(e)
|
|
889
|
+
) : o,
|
|
890
890
|
scopeId: t.scopeId,
|
|
891
891
|
slotScopeIds: t.slotScopeIds,
|
|
892
|
-
children: process.env.NODE_ENV !== "production" && i === -1 && p(c) ? c.map(
|
|
892
|
+
children: process.env.NODE_ENV !== "production" && i === -1 && p(c) ? c.map(Oe) : c,
|
|
893
893
|
target: t.target,
|
|
894
894
|
targetStart: t.targetStart,
|
|
895
895
|
targetAnchor: t.targetAnchor,
|
|
@@ -924,9 +924,9 @@ function K(t, e, s = !1, r = !1) {
|
|
|
924
924
|
l.clone(_)
|
|
925
925
|
), _;
|
|
926
926
|
}
|
|
927
|
-
function
|
|
927
|
+
function Oe(t) {
|
|
928
928
|
const e = K(t);
|
|
929
|
-
return p(t.children) && (e.children = t.children.map(
|
|
929
|
+
return p(t.children) && (e.children = t.children.map(Oe)), e;
|
|
930
930
|
}
|
|
931
931
|
function Et(t = " ", e = 0) {
|
|
932
932
|
return St(pt, null, t, e);
|
|
@@ -940,12 +940,12 @@ function H(t, e) {
|
|
|
940
940
|
s = 16;
|
|
941
941
|
else if (typeof e == "object")
|
|
942
942
|
if (r & 65) {
|
|
943
|
-
const
|
|
944
|
-
|
|
943
|
+
const n = e.default;
|
|
944
|
+
n && (n._c && (n._d = !1), H(t, n()), n._c && (n._d = !0));
|
|
945
945
|
return;
|
|
946
946
|
} else
|
|
947
947
|
s = 32, !e._ && !be(e) && (e._ctx = A);
|
|
948
|
-
else if (
|
|
948
|
+
else if (N(e)) {
|
|
949
949
|
if (r & 65) {
|
|
950
950
|
H(t, { default: e });
|
|
951
951
|
return;
|
|
@@ -959,25 +959,25 @@ function wt(...t) {
|
|
|
959
959
|
const e = {};
|
|
960
960
|
for (let s = 0; s < t.length; s++) {
|
|
961
961
|
const r = t[s];
|
|
962
|
-
for (const
|
|
963
|
-
if (
|
|
962
|
+
for (const n in r)
|
|
963
|
+
if (n === "class")
|
|
964
964
|
e.class !== r.class && (e.class = ee([e.class, r.class]));
|
|
965
|
-
else if (
|
|
965
|
+
else if (n === "style")
|
|
966
966
|
e.style = Z([e.style, r.style]);
|
|
967
|
-
else if (Me(
|
|
968
|
-
const
|
|
969
|
-
i &&
|
|
967
|
+
else if (Me(n)) {
|
|
968
|
+
const o = e[n], i = r[n];
|
|
969
|
+
i && o !== i && !(p(o) && o.includes(i)) ? e[n] = o ? [].concat(o, i) : i : i == null && o == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
|
|
970
970
|
// the model listener.
|
|
971
|
-
!Fe(
|
|
972
|
-
} else
|
|
971
|
+
!Fe(n) && (e[n] = i);
|
|
972
|
+
} else n !== "" && (e[n] = r[n]);
|
|
973
973
|
}
|
|
974
974
|
return e;
|
|
975
975
|
}
|
|
976
976
|
{
|
|
977
977
|
const t = U(), e = (s, r) => {
|
|
978
|
-
let
|
|
979
|
-
return (
|
|
980
|
-
|
|
978
|
+
let n;
|
|
979
|
+
return (n = t[s]) || (n = t[s] = []), n.push(r), (o) => {
|
|
980
|
+
n.length > 1 ? n.forEach((i) => i(o)) : n[0](o);
|
|
981
981
|
};
|
|
982
982
|
};
|
|
983
983
|
e(
|
|
@@ -989,38 +989,38 @@ function wt(...t) {
|
|
|
989
989
|
);
|
|
990
990
|
}
|
|
991
991
|
process.env.NODE_ENV;
|
|
992
|
-
const Nt = /(?:^|[-_])\w/g,
|
|
992
|
+
const Nt = /(?:^|[-_])\w/g, Pt = (t) => t.replace(Nt, (e) => e.toUpperCase()).replace(/[-_]/g, "");
|
|
993
993
|
function Ie(t, e = !0) {
|
|
994
|
-
return
|
|
994
|
+
return N(t) ? t.displayName || t.name : t.name || e && t.__name;
|
|
995
995
|
}
|
|
996
996
|
function Ce(t, e, s = !1) {
|
|
997
997
|
let r = Ie(e);
|
|
998
998
|
if (!r && e.__file) {
|
|
999
|
-
const
|
|
1000
|
-
|
|
999
|
+
const n = e.__file.match(/([^/\\]+)\.\w+$/);
|
|
1000
|
+
n && (r = n[1]);
|
|
1001
1001
|
}
|
|
1002
1002
|
if (!r && t) {
|
|
1003
|
-
const
|
|
1004
|
-
for (const i in
|
|
1005
|
-
if (
|
|
1003
|
+
const n = (o) => {
|
|
1004
|
+
for (const i in o)
|
|
1005
|
+
if (o[i] === e)
|
|
1006
1006
|
return i;
|
|
1007
1007
|
};
|
|
1008
|
-
r =
|
|
1008
|
+
r = n(t.components) || t.parent && n(
|
|
1009
1009
|
t.parent.type.components
|
|
1010
|
-
) ||
|
|
1010
|
+
) || n(t.appContext.components);
|
|
1011
1011
|
}
|
|
1012
|
-
return r ?
|
|
1012
|
+
return r ? Pt(r) : s ? "App" : "Anonymous";
|
|
1013
1013
|
}
|
|
1014
1014
|
function Te(t) {
|
|
1015
|
-
return
|
|
1015
|
+
return N(t) && "__vccOpts" in t;
|
|
1016
1016
|
}
|
|
1017
|
-
function
|
|
1017
|
+
function Ot() {
|
|
1018
1018
|
if (process.env.NODE_ENV === "production" || typeof window > "u")
|
|
1019
1019
|
return;
|
|
1020
|
-
const t = { style: "color:#3ba776" }, e = { style: "color:#1677ff" }, s = { style: "color:#f5222d" }, r = { style: "color:#eb2f96" },
|
|
1020
|
+
const t = { style: "color:#3ba776" }, e = { style: "color:#1677ff" }, s = { style: "color:#f5222d" }, r = { style: "color:#eb2f96" }, n = {
|
|
1021
1021
|
__vue_custom_formatter: !0,
|
|
1022
1022
|
header(a) {
|
|
1023
|
-
if (!
|
|
1023
|
+
if (!P(a))
|
|
1024
1024
|
return null;
|
|
1025
1025
|
if (a.__isVue)
|
|
1026
1026
|
return ["div", t, "VueInstance"];
|
|
@@ -1064,13 +1064,13 @@ function Pt() {
|
|
|
1064
1064
|
return [
|
|
1065
1065
|
"div",
|
|
1066
1066
|
{},
|
|
1067
|
-
...
|
|
1067
|
+
...o(a.$)
|
|
1068
1068
|
];
|
|
1069
1069
|
}
|
|
1070
1070
|
};
|
|
1071
|
-
function
|
|
1071
|
+
function o(a) {
|
|
1072
1072
|
const u = [];
|
|
1073
|
-
a.type.props && a.props && u.push(i("props", /* @__PURE__ */
|
|
1073
|
+
a.type.props && a.props && u.push(i("props", /* @__PURE__ */ E(a.props))), a.setupState !== Y && u.push(i("setup", a.setupState)), a.data !== Y && u.push(i("data", /* @__PURE__ */ E(a.data)));
|
|
1074
1074
|
const d = l(a, "computed");
|
|
1075
1075
|
d && u.push(i("computed", d));
|
|
1076
1076
|
const m = l(a, "inject");
|
|
@@ -1113,11 +1113,11 @@ function Pt() {
|
|
|
1113
1113
|
] : ["span", {}];
|
|
1114
1114
|
}
|
|
1115
1115
|
function c(a, u = !0) {
|
|
1116
|
-
return typeof a == "number" ? ["span", e, a] : typeof a == "string" ? ["span", s, JSON.stringify(a)] : typeof a == "boolean" ? ["span", r, a] :
|
|
1116
|
+
return typeof a == "number" ? ["span", e, a] : typeof a == "string" ? ["span", s, JSON.stringify(a)] : typeof a == "boolean" ? ["span", r, a] : P(a) ? ["object", { object: u ? /* @__PURE__ */ E(a) : a }] : ["span", s, String(a)];
|
|
1117
1117
|
}
|
|
1118
1118
|
function l(a, u) {
|
|
1119
1119
|
const d = a.type;
|
|
1120
|
-
if (
|
|
1120
|
+
if (N(d))
|
|
1121
1121
|
return;
|
|
1122
1122
|
const m = {};
|
|
1123
1123
|
for (const x in a.ctx)
|
|
@@ -1126,19 +1126,19 @@ function Pt() {
|
|
|
1126
1126
|
}
|
|
1127
1127
|
function f(a, u, d) {
|
|
1128
1128
|
const m = a[d];
|
|
1129
|
-
if (p(m) && m.includes(u) ||
|
|
1129
|
+
if (p(m) && m.includes(u) || P(m) && u in m || a.extends && f(a.extends, u, d) || a.mixins && a.mixins.some((x) => f(x, u, d)))
|
|
1130
1130
|
return !0;
|
|
1131
1131
|
}
|
|
1132
1132
|
function _(a) {
|
|
1133
1133
|
return /* @__PURE__ */ B(a) ? "ShallowRef" : a.effect ? "ComputedRef" : "Ref";
|
|
1134
1134
|
}
|
|
1135
|
-
window.devtoolsFormatters ? window.devtoolsFormatters.push(
|
|
1135
|
+
window.devtoolsFormatters ? window.devtoolsFormatters.push(n) : window.devtoolsFormatters = [n];
|
|
1136
1136
|
}
|
|
1137
1137
|
process.env.NODE_ENV;
|
|
1138
1138
|
process.env.NODE_ENV;
|
|
1139
1139
|
process.env.NODE_ENV;
|
|
1140
1140
|
function It() {
|
|
1141
|
-
|
|
1141
|
+
Ot();
|
|
1142
1142
|
}
|
|
1143
1143
|
process.env.NODE_ENV !== "production" && It();
|
|
1144
1144
|
const Ct = [
|
|
@@ -1160,10 +1160,10 @@ class ce extends xe {
|
|
|
1160
1160
|
_persister;
|
|
1161
1161
|
_propertiesToEncrypt;
|
|
1162
1162
|
_watchedStore;
|
|
1163
|
-
constructor(e, s, r,
|
|
1164
|
-
super(e, s, r,
|
|
1165
|
-
const { crypt:
|
|
1166
|
-
this._excludedKeys = this.initExcludedKeys(), this.definePersister(i), this._propertiesToEncrypt = new Set(this.getPropertiesToEncrypt()), this._watchedStore = c,
|
|
1163
|
+
constructor(e, s, r, n) {
|
|
1164
|
+
super(e, s, r, n);
|
|
1165
|
+
const { crypt: o, persister: i, watchedStore: c } = s;
|
|
1166
|
+
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.debugLog("StorePersister constructor", {
|
|
1167
1167
|
toBeWatched: this.toBeWatched(),
|
|
1168
1168
|
watchedStore: c,
|
|
1169
1169
|
persister: i,
|
|
@@ -1172,35 +1172,35 @@ class ce extends xe {
|
|
|
1172
1172
|
}), this.toBeWatched() && (this._watchedStore.add(this.store.$id), this.storeSubscribe = this.storeSubscription.bind(this));
|
|
1173
1173
|
}
|
|
1174
1174
|
hydrate() {
|
|
1175
|
-
return typeof window > "u" ? Promise.resolve(
|
|
1175
|
+
return typeof window > "u" ? Promise.resolve() : this.remember();
|
|
1176
1176
|
}
|
|
1177
1177
|
augmentStore() {
|
|
1178
1178
|
const { isEncrypted: e, persistedPropertiesToEncrypt: s, watchMutation: r } = this.options;
|
|
1179
|
-
e === void 0 && (this.options.isEncrypted = !1), s === void 0 && (this.options.persistedPropertiesToEncrypt = []), r === 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;
|
|
1179
|
+
e === void 0 && (this.options.isEncrypted = !1), s === void 0 && (this.options.persistedPropertiesToEncrypt = []), r === 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.bind(this), this.store.stopWatch = this.stopWatch.bind(this), this.store.hydrate = this.hydrate.bind(this);
|
|
1180
1180
|
}
|
|
1181
1181
|
async cryptProperty(e, s, r = !1) {
|
|
1182
1182
|
return r ? await e.decrypt(s) : await e.encrypt(s);
|
|
1183
1183
|
}
|
|
1184
1184
|
async cryptState(e, s = !1) {
|
|
1185
1185
|
return await new Promise(async (r) => {
|
|
1186
|
-
const
|
|
1186
|
+
const n = this._crypt, o = this.getPropertiesToEncrypt(), i = this.isEncrypted();
|
|
1187
1187
|
if (this.debugLog(`cryptState - ${this.store.$id} ${s ? "decrypt" : "crypt"}`, {
|
|
1188
|
-
can: this._propertiesToEncrypt.size > 0 && i === s && !!
|
|
1189
|
-
Crypt:
|
|
1188
|
+
can: this._propertiesToEncrypt.size > 0 && i === s && !!n,
|
|
1189
|
+
Crypt: n,
|
|
1190
1190
|
state: e
|
|
1191
|
-
}), this._propertiesToEncrypt.size > 0 &&
|
|
1191
|
+
}), this._propertiesToEncrypt.size > 0 && n) {
|
|
1192
1192
|
const c = {};
|
|
1193
|
-
for (const l of
|
|
1193
|
+
for (const l of o) {
|
|
1194
1194
|
const f = this.getValue(e[l]);
|
|
1195
|
-
f && (c[l] = await this.cryptProperty(
|
|
1195
|
+
f && (c[l] = await this.cryptProperty(n, f, s));
|
|
1196
1196
|
}
|
|
1197
1197
|
this.debugLog(`cryptState - ${this.store.$id}`, { encryptedState: c }), D(c) || (e = { ...e, ...c }, this.options && (this.options.isEncrypted = !s));
|
|
1198
1198
|
}
|
|
1199
1199
|
r(e);
|
|
1200
1200
|
});
|
|
1201
1201
|
}
|
|
1202
|
-
static customizeStore(e, s, r,
|
|
1203
|
-
return !s.storeOptions?.persist && s.storeOptions?.watchMutation && (s.storeOptions.persist = !0), super.customizeStore(e, s, r,
|
|
1202
|
+
static customizeStore(e, s, r, n) {
|
|
1203
|
+
return !s.storeOptions?.persist && s.storeOptions?.watchMutation && (s.storeOptions.persist = !0), super.customizeStore(e, s, r, n);
|
|
1204
1204
|
}
|
|
1205
1205
|
definePersister(e) {
|
|
1206
1206
|
this._persister = this.options.dbName ? new X({ name: this.options.dbName, keyPath: "storeName" }) : e;
|
|
@@ -1221,15 +1221,15 @@ class ce extends xe {
|
|
|
1221
1221
|
}
|
|
1222
1222
|
}
|
|
1223
1223
|
async getStateToPersist() {
|
|
1224
|
-
const e = this._excludedKeys, s = this.state, r = this._propertiesToEncrypt.size > 0,
|
|
1225
|
-
r && await
|
|
1226
|
-
const
|
|
1224
|
+
const e = this._excludedKeys, s = this.state, r = this._propertiesToEncrypt.size > 0, n = this._crypt;
|
|
1225
|
+
r && await n.init();
|
|
1226
|
+
const o = {};
|
|
1227
1227
|
for (const i of Object.keys(s))
|
|
1228
1228
|
if (!this.hasDeniedFirstChar(i[0]) && !e.has(i)) {
|
|
1229
1229
|
const c = s[i];
|
|
1230
|
-
D(c) || (r && this._propertiesToEncrypt.has(i) ?
|
|
1230
|
+
D(c) || (r && this._propertiesToEncrypt.has(i) ? o[i] = await this.cryptProperty(n, c, !1) : o[i] = /* @__PURE__ */ E(c));
|
|
1231
1231
|
}
|
|
1232
|
-
return
|
|
1232
|
+
return o;
|
|
1233
1233
|
}
|
|
1234
1234
|
getWatchMutation() {
|
|
1235
1235
|
return this.options.watchMutation;
|
|
@@ -1253,7 +1253,7 @@ class ce extends xe {
|
|
|
1253
1253
|
async remember() {
|
|
1254
1254
|
return this.state.isLoading = !0, new Promise(async (e) => {
|
|
1255
1255
|
let s = await this.getPersistedState();
|
|
1256
|
-
return s && !D(s) && this.store.$patch(s), this.state.isLoading = !1, e(
|
|
1256
|
+
return s && !D(s) && this.store.$patch(s), this.state.isLoading = !1, e();
|
|
1257
1257
|
});
|
|
1258
1258
|
}
|
|
1259
1259
|
removePersistedState() {
|
|
@@ -1297,7 +1297,7 @@ class Tt extends De {
|
|
|
1297
1297
|
super(
|
|
1298
1298
|
ae,
|
|
1299
1299
|
ce.customizeStore.bind(ce),
|
|
1300
|
-
|
|
1300
|
+
b
|
|
1301
1301
|
), this.execution = {
|
|
1302
1302
|
environment: "client",
|
|
1303
1303
|
hydration: "immediate"
|
|
@@ -1308,7 +1308,7 @@ class Tt extends De {
|
|
|
1308
1308
|
hydrate() {
|
|
1309
1309
|
typeof window > "u" || this.hydrationScheduler?.(() => {
|
|
1310
1310
|
const e = this.storeInstance?.hydrate?.();
|
|
1311
|
-
e && typeof e.catch == "function" && e.catch((s) =>
|
|
1311
|
+
e && typeof e.catch == "function" && e.catch((s) => b.error("PersistPiniaState hydration error", s));
|
|
1312
1312
|
});
|
|
1313
1313
|
}
|
|
1314
1314
|
}
|
|
@@ -1318,13 +1318,13 @@ function Rt(t, e) {
|
|
|
1318
1318
|
}
|
|
1319
1319
|
function Vt(t, e) {
|
|
1320
1320
|
let s, r;
|
|
1321
|
-
const
|
|
1321
|
+
const n = /* @__PURE__ */ new Set();
|
|
1322
1322
|
try {
|
|
1323
1323
|
if (typeof window < "u")
|
|
1324
|
-
return !D(t) && t && (s = new X({ name: t, keyPath: "storeName" })), e && (r = new R(e)), { persister: s, crypt: r, watchedStore:
|
|
1324
|
+
return !D(t) && t && (s = new X({ name: t, keyPath: "storeName" })), e && (r = new R(e)), { persister: s, crypt: r, watchedStore: n };
|
|
1325
1325
|
} catch {
|
|
1326
1326
|
}
|
|
1327
|
-
return { persister: s, crypt: r, watchedStore:
|
|
1327
|
+
return { persister: s, crypt: r, watchedStore: n };
|
|
1328
1328
|
}
|
|
1329
1329
|
function vt(t, e) {
|
|
1330
1330
|
let s;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(_,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("pinia-plugin-subscription")):typeof define=="function"&&define.amd?define(["exports","pinia-plugin-subscription"],d):(_=typeof globalThis<"u"?globalThis:_||self,d(_["pinia-plugin-persist-state"]={},_.PiniaPluginSubscription))})(this,(function(_,d){"use strict";class xe{_storage;constructor(e){this._storage=e==="localStorage"?localStorage:sessionStorage}clear(){this._storage.clear()}async getItem(e){return new Promise((s,r)=>{const n=this._storage.getItem(e.toString());s(n?JSON.parse(n):void 0)})}removeItem(e){this._storage.removeItem(e.toString())}removeItems(e){for(let s=0;s<this._storage.length;s++){const r=this._storage.key(s);r&&(!e||!e.includes(r))&&this._storage.removeItem(r)}}setItem(e,s){this._storage.setItem(s,JSON.stringify(e))}}const W="pinia-plugin-persist-state";class Re extends d.CustomConsole{_pluginName=W}const
|
|
1
|
+
(function(_,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("pinia-plugin-subscription")):typeof define=="function"&&define.amd?define(["exports","pinia-plugin-subscription"],d):(_=typeof globalThis<"u"?globalThis:_||self,d(_["pinia-plugin-persist-state"]={},_.PiniaPluginSubscription))})(this,(function(_,d){"use strict";class xe{_storage;constructor(e){this._storage=e==="localStorage"?localStorage:sessionStorage}clear(){this._storage.clear()}async getItem(e){return new Promise((s,r)=>{const n=this._storage.getItem(e.toString());s(n?JSON.parse(n):void 0)})}removeItem(e){this._storage.removeItem(e.toString())}removeItems(e){for(let s=0;s<this._storage.length;s++){const r=this._storage.key(s);r&&(!e||!e.includes(r))&&this._storage.removeItem(r)}}setItem(e,s){this._storage.setItem(s,JSON.stringify(e))}}const W="pinia-plugin-persist-state";class Re extends d.CustomConsole{_pluginName=W}const E=new Re;let ie=class{_db;_localStorageVersionKey="IDBVersion";_name="persistStore";_objectStore;_objectStoreOptions;_objectStoreName;_transactionMode="readwrite";_version;constructor(e,s,r){this._objectStoreName=e,this._version=this.getStoredVersionNumber(),s&&(this._objectStoreOptions=s),r&&(this._transactionMode=r)}clear(){const e=()=>{if(this._objectStore){const s=this._objectStore.clear();this.requestEventsHandler(s,{error:()=>this.onError(s.error)})}};this.open({success:e})}createObjectStore(){this._db&&!this._db.objectStoreNames.contains(this._objectStoreName)&&this._db.createObjectStore(this._objectStoreName,this._objectStoreOptions)}deleteObjectStore(){const e=()=>{this._db?.deleteObjectStore(this._objectStoreName)};this.open({success:e})}async getItem(e){return new Promise(s=>{const r=()=>{if(this._objectStore){const n=this._objectStore.get(e);this.requestEventsHandler(n,{error:()=>this.onError(n.error,()=>s(void 0)),success:()=>s(n.result)})}};this.open({success:r})})}async getObjectStoreItem(e,s){return new Promise(r=>{const n=()=>{if(this._objectStore){const i=this._objectStore.index(e).get(s);this.requestEventsHandler(i,{error:()=>r(void 0),success:()=>r(i.result)})}};this.open({success:n})})}getStoredVersionNumber(){if(!localStorage)return 1;const e=localStorage.getItem(this._localStorageVersionKey);return e?parseInt(e):1}handleDeleteRequest(e,s){e.onerror=()=>E.error(`IndexedDB - Item "${s}" remove`,e.error)}onError(e,s){s&&s(e)}open(e){const s=indexedDB.open(this._name,this._version),r=()=>{this._db=s.result},n=i=>{try{if(r(),!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){E.error("indexedDB - transaction error",[c])}};if(e?.success){const i=e.success;e.success=()=>n(i)}if(e?.upgrade){const i=e.upgrade.bind(this);e.upgrade=()=>{r(),i()}}const o=()=>{const i=c=>{if(c?.name==="VersionError"){this._version++,this.saveVersion(),this.open(e);return}e?.error&&e.error(c)};this.onError(s.error,i)};return e&&this.openRequestEventsHandler(s,{...e,error:o}),s}openRequestEventsHandler(e,s){this.requestEventsHandler(e,s),s.upgrade&&(e.onupgradeneeded=s.upgrade)}removeItem(e){const s=()=>{if(this._objectStore){const r=this._objectStore.delete(e);this.handleDeleteRequest(r,e)}};this.open({success:s})}removeItems(e){const s=()=>{if(this._objectStore){const r=this._objectStore.getAllKeys(),n=()=>{r.result.forEach(c=>{if(this._objectStore&&(!e||!e.includes(c))){const l=this._objectStore.delete(c);this.handleDeleteRequest(l,c)}})},o=()=>E.error("IndexedDB - removeItems",[r.error]);this.requestEventsHandler(r,{error:o,success:n})}};this.open({success:s})}requestEventsHandler(e,s){const{error:r,success:n}=s;r&&(e.onerror=r),n&&(e.onsuccess=n)}saveVersion(){localStorage&&localStorage.setItem(this._localStorageVersionKey,this._version.toString())}setItem(e,s){const r=()=>{if(this._objectStore){const o=this._objectStore.add(e);if(s){const i=()=>{s.forEach(l=>{this._objectStore?.createIndex(l,l,{unique:!0}),E.log(`"${l}" index created`)})},c=()=>this.onError(o.error);this.requestEventsHandler(o,{error:c,success:i})}}},n=this.createObjectStore;this.open({success:r,upgrade:n})}updateItem(e){const s=()=>{if(this._objectStore){const r=this._objectStore.put(e);r.onerror=()=>E.error("update item",[r.error,e])}};this.open({success:s})}};class z{_db;_db_options;get dbName(){return this._db_options.name}constructor(e){if(!e)throw new Error("DbOptions is required");this._db_options=e,this._db=this.defineDb()}defineDb(){const{keyPath:e,name:s}=this._db_options;return s==="localStorage"||s==="sessionStorage"?new xe(s):new ie(s,{keyPath:e})}getItem(e){return new Promise((s,r)=>{try{return this._db.getItem(e).then(n=>s(n))}catch(n){r(n)}})}removeItem(e){this._db.removeItem(e)}setItem(e,s){if(this._db instanceof ie)try{this._db.getItem(e).then(r=>{r?this._db.updateItem(r):this._db.setItem({storeName:e,...s})})}catch(r){E.error("Persister - setItem Error",r),this._db.setItem({storename:e,...s})}else this._db.setItem(s,e)}}class ve{_store=new Map;clear(){this._store.clear()}keyToString(e){return typeof e=="number"?e.toString():e}async getItem(e){return this._store.get(this.keyToString(e))}removeItem(e){this._store.delete(this.keyToString(e))}removeItems(e){if(e)for(const s of this._store.keys())e.includes(s)||this._store.delete(s);else this._store.clear()}setItem(e,s){this._store.set(s,e)}}let T={};const je={clear:()=>T={},getItem:async t=>new Promise(e=>e(T[t])),removeItem:t=>delete T[t],removeItems:t=>t?t.forEach(e=>delete T[e]):T={},setItem:(t,e)=>{T[e]=t}};class ce extends z{defineDb(){return this.dbName==="localStorage"||this.dbName==="sessionStorage"?je:new ve}}class R{_encoder=new TextEncoder;_key;_materialKey;static DECRYPT="decrypt";static ENCRYPT="encrypt";constructor(e){this._key=e}async getKey(e){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,[e])}async setKeyMaterial(e){this._materialKey=await crypto.subtle.importKey("raw",this._encoder.encode(e),{name:"PBKDF2"},!1,["deriveKey"])}async decrypt(e){const[s,r]=e.split(":"),n=await crypto.subtle.decrypt({name:"AES-GCM",iv:Uint8Array.from(atob(s),o=>o.charCodeAt(0))},await this.getKey(R.DECRYPT),Uint8Array.from(atob(r),o=>o.charCodeAt(0)));return new TextDecoder().decode(n)}async encrypt(e){const s=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.encrypt({name:"AES-GCM",iv:s},await this.getKey(R.ENCRYPT),this._encoder.encode(e));return btoa(String.fromCharCode(...new Uint8Array(s)))+":"+btoa(String.fromCharCode(...new Uint8Array(r)))}async init(){this._materialKey||await this.setKeyMaterial(this._key)}}const J=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const ae=()=>{},ke=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),$e=t=>t.startsWith("onUpdate:"),k=Object.assign,m=Array.isArray,w=t=>typeof t=="function",g=t=>typeof t=="string",Me=t=>typeof t=="symbol",I=t=>t!==null&&typeof t=="object";let le;const $=()=>le||(le=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Y(t){if(m(t)){const e={};for(let s=0;s<t.length;s++){const r=t[s],n=g(r)?He(r):Y(r);if(n)for(const o in n)e[o]=n[o]}return e}else if(g(t)||I(t))return t}const Fe=/;(?![^(]*\))/g,Ae=/:([^]+)/,Ke=/\/\*[^]*?\*\//g;function He(t){const e={};return t.replace(Ke,"").split(Fe).forEach(s=>{if(s){const r=s.split(Ae);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function G(t){let e="";if(g(t))e=t;else if(m(t))for(let s=0;s<t.length;s++){const r=G(t[s]);r&&(e+=r+" ")}else if(I(t))for(const s in t)t[s]&&(e+=s+" ");return e.trim()}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV,new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Me));function ue(t){return Q(t)?ue(t.__v_raw):!!(t&&t.__v_isReactive)}function Q(t){return!!(t&&t.__v_isReadonly)}function X(t){return!!(t&&t.__v_isShallow)}function Z(t){return t?!!t.__v_raw:!1}function N(t){const e=t&&t.__v_raw;return e?N(e):t}function ee(t){return t?t.__v_isRef===!0:!1}const C=[];function qe(t){C.push(t)}function Le(){C.pop()}let te=!1;function P(t,...e){if(te)return;te=!0;const s=C.length?C[C.length-1].component:null,r=s&&s.appContext.config.warnHandler,n=Ue();if(r)se(r,s,11,[t+e.map(o=>{var i,c;return(c=(i=o.toString)==null?void 0:i.call(o))!=null?c:JSON.stringify(o)}).join(""),s&&s.proxy,n.map(({vnode:o})=>`at <${Te(s,o.type)}>`).join(`
|
|
2
2
|
`),n]);else{const o=[`[Vue warn]: ${t}`,...e];n.length&&o.push(`
|
|
3
3
|
`,...Be(n)),console.warn(...o)}te=!1}function Ue(){let t=C[C.length-1];if(!t)return[];const e=[];for(;t;){const s=e[0];s&&s.vnode===t?s.recurseCount++:e.push({vnode:t,recurseCount:0});const r=t.component&&t.component.parent;t=r&&r.vnode}return e}function Be(t){const e=[];return t.forEach((s,r)=>{e.push(...r===0?[]:[`
|
|
4
|
-
`],...We(s))}),e}function We({vnode:t,recurseCount:e}){const s=e>0?`... (${e} recursive calls)`:"",r=t.component?t.component.parent==null:!1,n=` at <${Te(t.component,t.type,r)}`,o=">"+s;return t.props?[n,...ze(t.props),o]:[n+o]}function ze(t){const e=[],s=Object.keys(t);return s.slice(0,3).forEach(r=>{e.push(...fe(r,t[r]))}),s.length>3&&e.push(" ..."),e}function fe(t,e,s){return
|
|
5
|
-
Component that was made reactive: `,t)),mt(t,e,s,r,n,i,o,!0)}function yt(t){return t?Z(t)||Ee(t)?k({},t):t:null}function L(t,e,s=!1,r=!1){const{props:n,ref:o,patchFlag:i,children:c,transition:l}=t,f=e?bt(n||{},e):n,b={__v_isVNode:!0,__v_skip:!0,type:t.type,props:f,key:f&&Oe(f),ref:e&&e.ref?s&&o?m(o)?o.concat(q(e)):[o,q(e)]:q(e):o,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:process.env.NODE_ENV!=="production"&&i===-1&&m(c)?c.map(Ie):c,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==we?i===-1?16:i|16:i,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&L(t.ssContent),ssFallback:t.ssFallback&&L(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&r&&be(b,l.clone(b)),b}function Ie(t){const e=L(t);return m(t.children)&&(e.children=t.children.map(Ie)),e}function St(t=" ",e=0){return gt(dt,null,t,e)}function U(t,e){let s=0;const{shapeFlag:r}=t;if(e==null)e=null;else if(m(e))s=16;else if(typeof e=="object")if(r&65){const n=e.default;n&&(n._c&&(n._d=!1),U(t,n()),n._c&&(n._d=!0));return}else s=32,!e._&&!Ee(e)&&(e._ctx=H);else if(E(e)){if(r&65){U(t,{default:e});return}e={default:e,_ctx:H},s=32}else e=String(e),r&64?(s=16,e=[St(e)]):s=8;t.children=e,t.shapeFlag|=s}function bt(...t){const e={};for(let s=0;s<t.length;s++){const r=t[s];for(const n in r)if(n==="class")e.class!==r.class&&(e.class=G([e.class,r.class]));else if(n==="style")e.style=Y([e.style,r.style]);else if(ke(n)){const o=e[n],i=r[n];i&&o!==i&&!(m(o)&&o.includes(i))?e[n]=o?[].concat(o,i):i:i==null&&o==null&&!$e(n)&&(e[n]=i)}else n!==""&&(e[n]=r[n])}return e}{const t=$(),e=(s,r)=>{let n;return(n=t[s])||(n=t[s]=[]),n.push(r),o=>{n.length>1?n.forEach(i=>i(o)):n[0](o)}};e("__VUE_INSTANCE_SETTERS__",s=>s),e("__VUE_SSR_SETTERS__",s=>s)}process.env.NODE_ENV;const Et=/(?:^|[-_])\w/g,wt=t=>t.replace(Et,e=>e.toUpperCase()).replace(/[-_]/g,"");function Ce(t,e=!0){return E(t)?t.displayName||t.name:t.name||e&&t.__name}function Te(t,e,s=!1){let r=Ce(e);if(!r&&e.__file){const n=e.__file.match(/([^/\\]+)\.\w+$/);n&&(r=n[1])}if(!r&&t){const n=o=>{for(const i in o)if(o[i]===e)return i};r=n(t.components)||t.parent&&n(t.parent.type.components)||n(t.appContext.components)}return r?wt(r):s?"App":"Anonymous"}function Ve(t){return E(t)&&"__vccOpts"in t}function Nt(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const t={style:"color:#3ba776"},e={style:"color:#1677ff"},s={style:"color:#f5222d"},r={style:"color:#eb2f96"},n={__vue_custom_formatter:!0,header(a){if(!I(a))return null;if(a.__isVue)return["div",t,"VueInstance"];if(ee(a)){const u=a.value;return["div",{},["span",t,b(a)],"<",c(u),">"]}else{if(ue(a))return["div",{},["span",t,X(a)?"ShallowReactive":"Reactive"],"<",c(a),`>${Q(a)?" (readonly)":""}`];if(Q(a))return["div",{},["span",t,X(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",w(a.props))),a.setupState!==J&&u.push(i("setup",a.setupState)),a.data!==J&&u.push(i("data",w(a.data)));const p=l(a,"computed");p&&u.push(i("computed",p));const g=l(a,"inject");return g&&u.push(i("injected",g)),u.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:a}]]),u}function i(a,u){return u=k({},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(p=>["div",{},["span",r,p+": "],c(u[p],!1)])]]:["span",{}]}function c(a,u=!0){return typeof a=="number"?["span",e,a]:typeof a=="string"?["span",s,JSON.stringify(a)]:typeof a=="boolean"?["span",r,a]:I(a)?["object",{object:u?w(a):a}]:["span",s,String(a)]}function l(a,u){const p=a.type;if(E(p))return;const g={};for(const j in a.ctx)f(p,j,u)&&(g[j]=a.ctx[j]);return g}function f(a,u,p){const g=a[p];if(m(g)&&g.includes(u)||I(g)&&u in g||a.extends&&f(a.extends,u,p)||a.mixins&&a.mixins.some(j=>f(j,u,p)))return!0}function b(a){return X(a)?"ShallowRef":a.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(n):window.devtoolsFormatters=[n]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function Ot(){Nt()}process.env.NODE_ENV!=="production"&&Ot();const Pt=["@context","activeLink","computed","dep","excludedKeys","fn","isEncrypted","isLoading","subs","version"];class De extends d.Store{_className="StorePersister";_crypt;_excludedKeys;_persister;_propertiesToEncrypt;_watchedStore;constructor(e,s,r,n){super(e,s,r,n);const{crypt:o,persister:i,watchedStore:c}=s;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.debugLog("StorePersister constructor",{toBeWatched:this.toBeWatched(),watchedStore:c,persister:i,store:e,options:s}),this.toBeWatched()&&(this._watchedStore.add(this.store.$id),this.storeSubscribe=this.storeSubscription.bind(this))}hydrate(){return typeof window>"u"?Promise.resolve(!1):this.remember()}augmentStore(){const{isEncrypted:e,persistedPropertiesToEncrypt:s,watchMutation:r}=this.options;e===void 0&&(this.options.isEncrypted=!1),s===void 0&&(this.options.persistedPropertiesToEncrypt=[]),r===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(e,s,r=!1){return r?await e.decrypt(s):await e.encrypt(s)}async cryptState(e,s=!1){return await new Promise(async r=>{const n=this._crypt,o=this.getPropertiesToEncrypt(),i=this.isEncrypted();if(this.debugLog(`cryptState - ${this.store.$id} ${s?"decrypt":"crypt"}`,{can:this._propertiesToEncrypt.size>0&&i===s&&!!n,Crypt:n,state:e}),this._propertiesToEncrypt.size>0&&n){const c={};for(const l of o){const f=this.getValue(e[l]);f&&(c[l]=await this.cryptProperty(n,f,s))}this.debugLog(`cryptState - ${this.store.$id}`,{encryptedState:c}),d.isEmpty(c)||(e={...e,...c},this.options&&(this.options.isEncrypted=!s))}r(e)})}static customizeStore(e,s,r,n){return!s.storeOptions?.persist&&s.storeOptions?.watchMutation&&(s.storeOptions.persist=!0),super.customizeStore(e,s,r,n)}definePersister(e){this._persister=this.options.dbName?new z({name:this.options.dbName,keyPath:"storeName"}):e}isEncrypted(){return this.options.isEncrypted}getPropertiesToEncrypt(){return this.options?.persistedPropertiesToEncrypt??[]}async getPersistedState(e=!0){const s=this.store.$id;try{let r=await this._persister.getItem(s);return e&&this.toBeCrypted()&&r&&(await this._crypt?.init(),r=await this.cryptState(r,!0)),this.debugLog(`getPersistedState ${s}`,{persistedState:r,state:this.state}),r}catch(r){this.logError("getPersistedState()",{storeName:s,e:r})}}async getStateToPersist(){const e=this._excludedKeys,s=this.state,r=this._propertiesToEncrypt.size>0,n=this._crypt;r&&await n.init();const o={};for(const i of Object.keys(s))if(!this.hasDeniedFirstChar(i[0])&&!e.has(i)){const c=s[i];d.isEmpty(c)||(r&&this._propertiesToEncrypt.has(i)?o[i]=await this.cryptProperty(n,c,!1):o[i]=w(c))}return o}getWatchMutation(){return this.options.watchMutation}static hasRequiredKeys(e){return!!e?.persist||!!e?.watchMutation}initExcludedKeys(){return new Set([...Pt,...this.options.excludedKeys??[]])}async persist(){const e=await this.getStateToPersist();this.debugLog(`persist() ${this.store.$id} - stateToPersist:`,{state:e}),d.isEmpty(e)||this._persister.setItem(this.store.$id,e)}propertyShouldBePersisted(e){return!this._excludedKeys.has(e)}async remember(){return this.state.isLoading=!0,new Promise(async e=>{let s=await this.getPersistedState();return s&&!d.isEmpty(s)&&this.store.$patch(s),this.state.isLoading=!1,e(!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(e){this.debugLog(`store.storeSubscription() ${this.store.$id}`,["mutation type !== patch object: ",e.type!=="patch object","watchMutation: ",this.getWatchMutation(),"mutation:",e,"state:",this.state,"store:",this.store]),e.type!=="patch object"&&this.getWatchMutation()&&this.persist().then(()=>{this.store.mutationCallback&&this.store.mutationCallback(this.state,e)})}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 It extends d.PluginSubscriber{_resetStoreCallback=e=>{const{removePersistedState:s}=e;typeof s=="function"&&s()};constructor(){super(W,De.customizeStore.bind(De),P),this.execution={environment:"client",hydration:"immediate"},this.hydrationScheduler=e=>{Ge(()=>e())}}hydrate(){typeof window>"u"||this.hydrationScheduler?.(()=>{const e=this.storeInstance?.hydrate?.();e&&typeof e.catch=="function"&&e.catch(s=>this.logError(s))})}}const B=new It;function Ct(t,e){return B.pluginOptions=Tt(t,e),B}function Tt(t,e){let s,r;const n=new Set;try{if(typeof window<"u")return!d.isEmpty(t)&&t&&(s=new z({name:t,keyPath:"storeName"})),e&&(r=new R(e)),{persister:s,crypt:r,watchedStore:n}}catch{}return{persister:s,crypt:r,watchedStore:n}}function Vt(t,e){let s;return e&&(s=new R(e)),B.pluginOptions={persister:new ce({name:t}),crypt:s,watchedStore:new Set},B}_.PLUGIN_NAME=W,_.PersisterMock=ce,_.createPersistStatePlugin=Ct,_.createPluginMock=Vt,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})}));
|
|
4
|
+
`],...We(s))}),e}function We({vnode:t,recurseCount:e}){const s=e>0?`... (${e} recursive calls)`:"",r=t.component?t.component.parent==null:!1,n=` at <${Te(t.component,t.type,r)}`,o=">"+s;return t.props?[n,...ze(t.props),o]:[n+o]}function ze(t){const e=[],s=Object.keys(t);return s.slice(0,3).forEach(r=>{e.push(...fe(r,t[r]))}),s.length>3&&e.push(" ..."),e}function fe(t,e,s){return g(e)?(e=JSON.stringify(e),s?e:[`${t}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?s?e:[`${t}=${e}`]:ee(e)?(e=fe(t,N(e.value),!0),s?e:[`${t}=Ref<`,e,">"]):w(e)?[`${t}=fn${e.name?`<${e.name}>`:""}`]:(e=N(e),s?e:[`${t}=`,e])}const de={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 se(t,e,s,r){try{return r?t(...r):t()}catch(n){he(n,e,s)}}function he(t,e,s,r=!0){const n=e?e.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=e&&e.appContext.config||J;if(e){let c=e.parent;const l=e.proxy,f=process.env.NODE_ENV!=="production"?de[s]:`https://vuejs.org/error-reference/#runtime-${s}`;for(;c;){const b=c.ec;if(b){for(let a=0;a<b.length;a++)if(b[a](t,l,f)===!1)return}c=c.parent}if(o){se(o,null,10,[t,l,f]);return}}Je(t,s,n,r,i)}function Je(t,e,s,r=!0,n=!1){if(process.env.NODE_ENV!=="production"){const o=de[e];if(s&&qe(s),P(`Unhandled error${o?` during execution of ${o}`:""}`),s&&Le(),r)throw t;console.error(t)}else{if(n)throw t;console.error(t)}}const h=[];let S=-1;const V=[];let O=null,D=0;const pe=Promise.resolve();let M=null;const Ye=100;function Ge(t){const e=M||pe;return t?e.then(this?t.bind(this):t):e}function Qe(t){let e=S+1,s=h.length;for(;e<s;){const r=e+s>>>1,n=h[r],o=v(n);o<t||o===t&&n.flags&2?e=r+1:s=r}return e}function Xe(t){if(!(t.flags&1)){const e=v(t),s=h[h.length-1];!s||!(t.flags&2)&&e>=v(s)?h.push(t):h.splice(Qe(e),0,t),t.flags|=1,me()}}function me(){M||(M=pe.then(_e))}function Ze(t){if(!m(t))O&&t.id===-1?O.splice(D+1,0,t):t.flags&1||(V.push(t),t.flags|=1);else for(let e=0;e<t.length;e++)V.push(t[e]);me()}function et(t){if(V.length){const e=[...new Set(V)].sort((s,r)=>v(s)-v(r));if(V.length=0,O){for(let s=0;s<e.length;s++)O.push(e[s]);return}for(O=e,process.env.NODE_ENV!=="production"&&(t=t||new Map),D=0;D<O.length;D++){const s=O[D];process.env.NODE_ENV!=="production"&&ye(t,s)||(s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2)}O=null,D=0}}const v=t=>t.id==null?t.flags&2?-1:1/0:t.id;function _e(t){process.env.NODE_ENV!=="production"&&(t=t||new Map);const e=process.env.NODE_ENV!=="production"?s=>ye(t,s):ae;try{for(S=0;S<h.length;S++){const s=h[S];if(s&&!(s.flags&8)){if(process.env.NODE_ENV!=="production"&&e(s))continue;s.flags&4&&(s.flags&=-2),se(s,s.i,s.i?15:14),s.flags&4||(s.flags&=-2)}}}finally{for(;S<h.length;S++){const s=h[S];s&&(s.flags&=-2)}S=-1,h.length=0,et(t),M=null,(h.length||V.length)&&_e(t)}}function ye(t,e){const s=t.get(e)||0;if(s>Ye){const r=e.i,n=r&&Ce(r.type);return he(`Maximum recursive updates exceeded${n?` in component <${n}>`:""}. 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 t.set(e,s+1),!1}const re=new Map;process.env.NODE_ENV!=="production"&&($().__VUE_HMR_RUNTIME__={createRecord:ne(tt),rerender:ne(st),reload:ne(rt)});const F=new Map;function tt(t,e){return F.has(t)?!1:(F.set(t,{initialDef:A(e),instances:new Set}),!0)}function A(t){return Ve(t)?t.__vccOpts:t}function st(t,e){const s=F.get(t);s&&(s.initialDef.render=e,[...s.instances].forEach(r=>{e&&(r.render=e,A(r.type).render=e),r.renderCache=[],r.job.flags&8||r.update()}))}function rt(t,e){const s=F.get(t);if(!s)return;e=A(e),ge(s.initialDef,e);const r=[...s.instances];for(let n=0;n<r.length;n++){const o=r[n],i=A(o.type);let c=re.get(i);c||(i!==s.initialDef&&ge(i,e),re.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(e.styles),c.delete(o)):o.parent?Xe(()=>{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)}Ze(()=>{re.clear()})}function ge(t,e){k(t,e);for(const s in t)s!=="__file"&&!(s in e)&&delete t[s]}function ne(t){return(e,s)=>{try{return t(e,s)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let x,K=[];function Se(t,e){var s,r;x=t,x?(x.enabled=!0,K.forEach(({event:n,args:o})=>x.emit(n,...o)),K=[]):typeof window<"u"&&window.HTMLElement&&!((r=(s=window.navigator)==null?void 0:s.userAgent)!=null&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{Se(o,e)}),setTimeout(()=>{x||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,K=[])},3e3)):K=[]}let H=null,nt=null;const oe=t=>t.__isTeleport;function ot(t){let e=t[0];if(t.length>1){let s=!1;for(const r of t)if(r.type!==Ne){if(process.env.NODE_ENV!=="production"&&s){P("<transition> can only be used on a single element or component. Use <transition-group> for lists.");break}if(e=r,s=!0,process.env.NODE_ENV==="production")break}}return e}function it(t){if(!ct(t))return oe(t.type)&&t.children?ot(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:s}=t;if(s){if(e&16)return s[0];if(e&32&&w(s.default))return s.default()}}function be(t,e){if(t.shapeFlag&6&&t.component){t.transition=e;const s=t.component.subTree;be(oe(s.type)&&it(s)||s,e)}else t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}$().requestIdleCallback,$().cancelIdleCallback;const ct=t=>t.type.__isKeepAlive,at=Symbol.for("v-ndc"),lt={};process.env.NODE_ENV!=="production"&&(lt.ownKeys=t=>(P("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(t)));const ut={},Ee=t=>Object.getPrototypeOf(t)===ut,ft=t=>t.__isSuspense,we=Symbol.for("v-fgt"),dt=Symbol.for("v-txt"),Ne=Symbol.for("v-cmt");function ht(t){return t?t.__v_isVNode===!0:!1}const pt=(...t)=>Oe(...t),Pe=({key:t})=>t??null,q=({ref:t,ref_key:e,ref_for:s})=>(typeof t=="number"&&(t=""+t),t!=null?g(t)||ee(t)||w(t)?{i:H,r:t,k:e,f:!!s}:t:null);function mt(t,e=null,s=null,r=0,n=null,o=t===we?0:1,i=!1,c=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Pe(e),ref:e&&q(e),scopeId:nt,slotScopeIds:null,children:s,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:r,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:H};if(c?(U(l,s),o&128&&t.normalize(l)):s&&(l.shapeFlag|=g(s)?8:16),process.env.NODE_ENV!=="production"&&l.key!==l.key&&P("VNode created with invalid key (NaN). VNode type:",l.type),process.env.NODE_ENV!=="production"&&e&&l.shapeFlag&1){const f=e.innerHTML!=null?"innerHTML":e.textContent!=null?"textContent":null;f&&_t(l.children)&&P(`The \`${f}\` prop on <${l.type}> will override its children. Remove either the \`${f}\` prop or the children.`)}return l}function _t(t){return g(t)?t!=="":m(t)?t.length>0:!1}const yt=process.env.NODE_ENV!=="production"?pt:Oe;function Oe(t,e=null,s=null,r=0,n=null,o=!1){if((!t||t===at)&&(process.env.NODE_ENV!=="production"&&!t&&P(`Invalid vnode type when creating vnode: ${t}.`),t=Ne),ht(t)){const c=L(t,e,!0);return s&&U(c,s),c.patchFlag=-2,c}if(Ve(t)&&(t=t.__vccOpts),e){e=gt(e);let{class:c,style:l}=e;c&&!g(c)&&(e.class=G(c)),I(l)&&(Z(l)&&!m(l)&&(l=k({},l)),e.style=Y(l))}const i=g(t)?1:ft(t)?128:oe(t)?64:I(t)?4:w(t)?2:0;return process.env.NODE_ENV!=="production"&&i&4&&Z(t)&&(t=N(t),P("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: `,t)),mt(t,e,s,r,n,i,o,!0)}function gt(t){return t?Z(t)||Ee(t)?k({},t):t:null}function L(t,e,s=!1,r=!1){const{props:n,ref:o,patchFlag:i,children:c,transition:l}=t,f=e?bt(n||{},e):n,b={__v_isVNode:!0,__v_skip:!0,type:t.type,props:f,key:f&&Pe(f),ref:e&&e.ref?s&&o?m(o)?o.concat(q(e)):[o,q(e)]:q(e):o,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:process.env.NODE_ENV!=="production"&&i===-1&&m(c)?c.map(Ie):c,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==we?i===-1?16:i|16:i,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&L(t.ssContent),ssFallback:t.ssFallback&&L(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&r&&be(b,l.clone(b)),b}function Ie(t){const e=L(t);return m(t.children)&&(e.children=t.children.map(Ie)),e}function St(t=" ",e=0){return yt(dt,null,t,e)}function U(t,e){let s=0;const{shapeFlag:r}=t;if(e==null)e=null;else if(m(e))s=16;else if(typeof e=="object")if(r&65){const n=e.default;n&&(n._c&&(n._d=!1),U(t,n()),n._c&&(n._d=!0));return}else s=32,!e._&&!Ee(e)&&(e._ctx=H);else if(w(e)){if(r&65){U(t,{default:e});return}e={default:e,_ctx:H},s=32}else e=String(e),r&64?(s=16,e=[St(e)]):s=8;t.children=e,t.shapeFlag|=s}function bt(...t){const e={};for(let s=0;s<t.length;s++){const r=t[s];for(const n in r)if(n==="class")e.class!==r.class&&(e.class=G([e.class,r.class]));else if(n==="style")e.style=Y([e.style,r.style]);else if(ke(n)){const o=e[n],i=r[n];i&&o!==i&&!(m(o)&&o.includes(i))?e[n]=o?[].concat(o,i):i:i==null&&o==null&&!$e(n)&&(e[n]=i)}else n!==""&&(e[n]=r[n])}return e}{const t=$(),e=(s,r)=>{let n;return(n=t[s])||(n=t[s]=[]),n.push(r),o=>{n.length>1?n.forEach(i=>i(o)):n[0](o)}};e("__VUE_INSTANCE_SETTERS__",s=>s),e("__VUE_SSR_SETTERS__",s=>s)}process.env.NODE_ENV;const Et=/(?:^|[-_])\w/g,wt=t=>t.replace(Et,e=>e.toUpperCase()).replace(/[-_]/g,"");function Ce(t,e=!0){return w(t)?t.displayName||t.name:t.name||e&&t.__name}function Te(t,e,s=!1){let r=Ce(e);if(!r&&e.__file){const n=e.__file.match(/([^/\\]+)\.\w+$/);n&&(r=n[1])}if(!r&&t){const n=o=>{for(const i in o)if(o[i]===e)return i};r=n(t.components)||t.parent&&n(t.parent.type.components)||n(t.appContext.components)}return r?wt(r):s?"App":"Anonymous"}function Ve(t){return w(t)&&"__vccOpts"in t}function Nt(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const t={style:"color:#3ba776"},e={style:"color:#1677ff"},s={style:"color:#f5222d"},r={style:"color:#eb2f96"},n={__vue_custom_formatter:!0,header(a){if(!I(a))return null;if(a.__isVue)return["div",t,"VueInstance"];if(ee(a)){const u=a.value;return["div",{},["span",t,b(a)],"<",c(u),">"]}else{if(ue(a))return["div",{},["span",t,X(a)?"ShallowReactive":"Reactive"],"<",c(a),`>${Q(a)?" (readonly)":""}`];if(Q(a))return["div",{},["span",t,X(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",N(a.props))),a.setupState!==J&&u.push(i("setup",a.setupState)),a.data!==J&&u.push(i("data",N(a.data)));const p=l(a,"computed");p&&u.push(i("computed",p));const y=l(a,"inject");return y&&u.push(i("injected",y)),u.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:a}]]),u}function i(a,u){return u=k({},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(p=>["div",{},["span",r,p+": "],c(u[p],!1)])]]:["span",{}]}function c(a,u=!0){return typeof a=="number"?["span",e,a]:typeof a=="string"?["span",s,JSON.stringify(a)]:typeof a=="boolean"?["span",r,a]:I(a)?["object",{object:u?N(a):a}]:["span",s,String(a)]}function l(a,u){const p=a.type;if(w(p))return;const y={};for(const j in a.ctx)f(p,j,u)&&(y[j]=a.ctx[j]);return y}function f(a,u,p){const y=a[p];if(m(y)&&y.includes(u)||I(y)&&u in y||a.extends&&f(a.extends,u,p)||a.mixins&&a.mixins.some(j=>f(j,u,p)))return!0}function b(a){return X(a)?"ShallowRef":a.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(n):window.devtoolsFormatters=[n]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function Pt(){Nt()}process.env.NODE_ENV!=="production"&&Pt();const Ot=["@context","activeLink","computed","dep","excludedKeys","fn","isEncrypted","isLoading","subs","version"];class De extends d.Store{_className="StorePersister";_crypt;_excludedKeys;_persister;_propertiesToEncrypt;_watchedStore;constructor(e,s,r,n){super(e,s,r,n);const{crypt:o,persister:i,watchedStore:c}=s;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.debugLog("StorePersister constructor",{toBeWatched:this.toBeWatched(),watchedStore:c,persister:i,store:e,options:s}),this.toBeWatched()&&(this._watchedStore.add(this.store.$id),this.storeSubscribe=this.storeSubscription.bind(this))}hydrate(){return typeof window>"u"?Promise.resolve():this.remember()}augmentStore(){const{isEncrypted:e,persistedPropertiesToEncrypt:s,watchMutation:r}=this.options;e===void 0&&(this.options.isEncrypted=!1),s===void 0&&(this.options.persistedPropertiesToEncrypt=[]),r===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.bind(this),this.store.stopWatch=this.stopWatch.bind(this),this.store.hydrate=this.hydrate.bind(this)}async cryptProperty(e,s,r=!1){return r?await e.decrypt(s):await e.encrypt(s)}async cryptState(e,s=!1){return await new Promise(async r=>{const n=this._crypt,o=this.getPropertiesToEncrypt(),i=this.isEncrypted();if(this.debugLog(`cryptState - ${this.store.$id} ${s?"decrypt":"crypt"}`,{can:this._propertiesToEncrypt.size>0&&i===s&&!!n,Crypt:n,state:e}),this._propertiesToEncrypt.size>0&&n){const c={};for(const l of o){const f=this.getValue(e[l]);f&&(c[l]=await this.cryptProperty(n,f,s))}this.debugLog(`cryptState - ${this.store.$id}`,{encryptedState:c}),d.isEmpty(c)||(e={...e,...c},this.options&&(this.options.isEncrypted=!s))}r(e)})}static customizeStore(e,s,r,n){return!s.storeOptions?.persist&&s.storeOptions?.watchMutation&&(s.storeOptions.persist=!0),super.customizeStore(e,s,r,n)}definePersister(e){this._persister=this.options.dbName?new z({name:this.options.dbName,keyPath:"storeName"}):e}isEncrypted(){return this.options.isEncrypted}getPropertiesToEncrypt(){return this.options?.persistedPropertiesToEncrypt??[]}async getPersistedState(e=!0){const s=this.store.$id;try{let r=await this._persister.getItem(s);return e&&this.toBeCrypted()&&r&&(await this._crypt?.init(),r=await this.cryptState(r,!0)),this.debugLog(`getPersistedState ${s}`,{persistedState:r,state:this.state}),r}catch(r){this.logError("getPersistedState()",{storeName:s,e:r})}}async getStateToPersist(){const e=this._excludedKeys,s=this.state,r=this._propertiesToEncrypt.size>0,n=this._crypt;r&&await n.init();const o={};for(const i of Object.keys(s))if(!this.hasDeniedFirstChar(i[0])&&!e.has(i)){const c=s[i];d.isEmpty(c)||(r&&this._propertiesToEncrypt.has(i)?o[i]=await this.cryptProperty(n,c,!1):o[i]=N(c))}return o}getWatchMutation(){return this.options.watchMutation}static hasRequiredKeys(e){return!!e?.persist||!!e?.watchMutation}initExcludedKeys(){return new Set([...Ot,...this.options.excludedKeys??[]])}async persist(){const e=await this.getStateToPersist();this.debugLog(`persist() ${this.store.$id} - stateToPersist:`,{state:e}),d.isEmpty(e)||this._persister.setItem(this.store.$id,e)}propertyShouldBePersisted(e){return!this._excludedKeys.has(e)}async remember(){return this.state.isLoading=!0,new Promise(async e=>{let s=await this.getPersistedState();return s&&!d.isEmpty(s)&&this.store.$patch(s),this.state.isLoading=!1,e()})}removePersistedState(){this._persister.removeItem(this.store.$id)}stopWatch(){this.options?.watchMutation&&(this.options&&(this.options.watchMutation=!1),this._watchedStore.delete(this.store.$id))}storeSubscription(e){this.debugLog(`store.storeSubscription() ${this.store.$id}`,["mutation type !== patch object: ",e.type!=="patch object","watchMutation: ",this.getWatchMutation(),"mutation:",e,"state:",this.state,"store:",this.store]),e.type!=="patch object"&&this.getWatchMutation()&&this.persist().then(()=>{this.store.mutationCallback&&this.store.mutationCallback(this.state,e)})}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 It extends d.PluginSubscriber{_resetStoreCallback=e=>{const{removePersistedState:s}=e;typeof s=="function"&&s()};constructor(){super(W,De.customizeStore.bind(De),E),this.execution={environment:"client",hydration:"immediate"},this.hydrationScheduler=e=>{Ge(()=>e())}}hydrate(){typeof window>"u"||this.hydrationScheduler?.(()=>{const e=this.storeInstance?.hydrate?.();e&&typeof e.catch=="function"&&e.catch(s=>E.error("PersistPiniaState hydration error",s))})}}const B=new It;function Ct(t,e){return B.pluginOptions=Tt(t,e),B}function Tt(t,e){let s,r;const n=new Set;try{if(typeof window<"u")return!d.isEmpty(t)&&t&&(s=new z({name:t,keyPath:"storeName"})),e&&(r=new R(e)),{persister:s,crypt:r,watchedStore:n}}catch{}return{persister:s,crypt:r,watchedStore:n}}function Vt(t,e){let s;return e&&(s=new R(e)),B.pluginOptions={persister:new ce({name:t}),crypt:s,watchedStore:new Set},B}_.PLUGIN_NAME=W,_.PersisterMock=ce,_.createPersistStatePlugin=Ct,_.createPluginMock=Vt,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pinia-plugin-persist-state",
|
|
3
3
|
"description": "Pinia plugin for persisting store state",
|
|
4
|
-
"version": "0.1.1
|
|
4
|
+
"version": "0.1.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Alexandre Bidaud <alexbidaud85@gmail.com> (https://github.com/AlxBDo)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"coverage": "vitest run --coverage"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"pinia-plugin-subscription": "^0.1.6
|
|
46
|
+
"pinia-plugin-subscription": "^0.1.6"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"pinia": "^2.0.0 || ^3.0.0",
|
|
@@ -52,14 +52,15 @@
|
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/node": "^24.10.1",
|
|
54
54
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
55
|
-
"@vitest/coverage-v8": "^4.
|
|
55
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
56
|
+
"@vitest/ui": "^4.1.11",
|
|
56
57
|
"@vue/tsconfig": "^0.8.1",
|
|
58
|
+
"pinia": "^3.0.2",
|
|
57
59
|
"typescript": "~5.9.3",
|
|
58
60
|
"vite": "^7.2.4",
|
|
59
61
|
"vitest": "^4.0.16",
|
|
60
|
-
"vue
|
|
61
|
-
"
|
|
62
|
-
"vue": "^3.5.24"
|
|
62
|
+
"vue": "^3.5.24",
|
|
63
|
+
"vue-tsc": "^3.1.4"
|
|
63
64
|
},
|
|
64
65
|
"keywords": [
|
|
65
66
|
"pinia",
|