pinia-plugin-subscription 0.1.6-beta.0 → 0.1.6-beta.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.
- package/CHANGELOG.md +3 -0
- package/README.md +14 -0
- package/dist/pinia-plugin-subscription.js +165 -148
- package/dist/pinia-plugin-subscription.umd.cjs +4 -4
- package/dist/types/index.d.ts +7 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -11,13 +11,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
11
11
|
- Added `execution` and `hydrationScheduler` support on `PluginSubscriber` / `PluginSubscriberInterface`.
|
|
12
12
|
- Added `createHydrationPlugin()` as the dedicated Nuxt / SSR hydration helper.
|
|
13
13
|
- Added `PluginSubscriptionOptions` for hydration-specific runtime overrides without changing the default `createPlugin()` API.
|
|
14
|
+
- Added optional `hydrate()` and `afterHydration()` lifecycle hooks to the subscriber and base `Store` contract for SSR-safe initialization logic.
|
|
14
15
|
|
|
15
16
|
### Changed
|
|
16
17
|
- The execution policy now defaults to the subscriber itself, with framework-specific overrides available only through the hydration helper.
|
|
17
18
|
- `PluginSubscription` resolves hydration timing from the subscriber before falling back to the global runtime scheduler.
|
|
19
|
+
- The base `Store` class now exposes lifecycle stubs so browser-only bootstrap code can be triggered after the plugin is accepted for execution instead of during construction.
|
|
18
20
|
|
|
19
21
|
### Fixed
|
|
20
22
|
- Avoided SSR hydration crashes by allowing client-only Pinia plugins to be skipped on the server or deferred on the client.
|
|
23
|
+
- Prevented browser-only initialization from running during server-side store creation by moving hydration bootstrap behind the subscriber lifecycle hooks.
|
|
21
24
|
|
|
22
25
|
## [0.1.5]
|
|
23
26
|
|
package/README.md
CHANGED
|
@@ -165,6 +165,9 @@ When `storeOptions.debug` is `true`, setup-context map size transitions are logg
|
|
|
165
165
|
An object with at least an `invoke(context: PiniaPluginContext, debug?: boolean)` method, plus optional properties:
|
|
166
166
|
|
|
167
167
|
- `execution?: { environment?: 'both' | 'client' | 'server'; hydration?: 'immediate' | 'defer' }`
|
|
168
|
+
- `hydrationScheduler?: (run: () => void) => void`
|
|
169
|
+
- `hydrate?: (context, debug) => void | Promise<void>` — optional hook for SSR-safe store initialization after the subscriber is accepted for execution
|
|
170
|
+
- `afterHydration?: (context, debug) => void | Promise<void>` — optional lifecycle hook for post-hydration work
|
|
168
171
|
- `resetStoreCallback?: (store?: any) => void`
|
|
169
172
|
- `storeOnActionSubscription?: { store, callback }` (getter)
|
|
170
173
|
- `storeMutationSubscription?: { store, callback }` (getter)
|
|
@@ -186,6 +189,7 @@ The project provides an abstract `PluginSubscriber` implementation (see [src/plu
|
|
|
186
189
|
**Example:**
|
|
187
190
|
|
|
188
191
|
```typescript
|
|
192
|
+
import { nextTick } from 'vue'
|
|
189
193
|
import PluginSubscriber from 'pinia-plugin-subscription'
|
|
190
194
|
import StoreExtension from './src/extending-pinia-store/core/StoreExtension'
|
|
191
195
|
import { addStore } from './src/extending-pinia-store/plugins/stores'
|
|
@@ -207,6 +211,15 @@ class ExtendingStoreSubscriber extends PluginSubscriber<StoreExtension> {
|
|
|
207
211
|
|
|
208
212
|
this.pluginCreated = addStore
|
|
209
213
|
}
|
|
214
|
+
|
|
215
|
+
override hydrate() {
|
|
216
|
+
if (typeof window === 'undefined') {
|
|
217
|
+
return
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// Safe browser-only initialization. This is only called when the policy allows it.
|
|
221
|
+
return this.storeInstance?.hydrate?.()
|
|
222
|
+
}
|
|
210
223
|
}
|
|
211
224
|
|
|
212
225
|
export const extendingStoreSubscriber = new ExtendingStoreSubscriber()
|
|
@@ -217,6 +230,7 @@ This example shows the recommended pattern for SSR / Nuxt-safe plugins:
|
|
|
217
230
|
- `execution.environment` restricts the subscriber to `'both'`, `'client'`, or `'server'`
|
|
218
231
|
- `execution.hydration` is `'immediate'` by default and can be set to `'defer'` when the plugin must wait for client hydration
|
|
219
232
|
- `hydrationScheduler` lets you override the runtime scheduling behavior, for example with Nuxt/Vue `nextTick()`
|
|
233
|
+
- `hydrate()` / `afterHydration()` are optional lifecycle hooks for browser-only initialization and post-hydration work; they help keep SSR-sensitive logic out of constructors
|
|
220
234
|
|
|
221
235
|
## The `Store` Class — Summary
|
|
222
236
|
|
|
@@ -18,6 +18,9 @@ class tr {
|
|
|
18
18
|
get name() {
|
|
19
19
|
return this._name;
|
|
20
20
|
}
|
|
21
|
+
get storeInstance() {
|
|
22
|
+
return this._storeInstance;
|
|
23
|
+
}
|
|
21
24
|
get pluginOptions() {
|
|
22
25
|
return this._pluginOptions ?? {};
|
|
23
26
|
}
|
|
@@ -42,11 +45,15 @@ class tr {
|
|
|
42
45
|
constructor(t, n, s) {
|
|
43
46
|
this._name = t, this._createInstance = n, s && (this._console = s);
|
|
44
47
|
}
|
|
48
|
+
hydrate(t, n) {
|
|
49
|
+
}
|
|
50
|
+
afterHydration(t, n) {
|
|
51
|
+
}
|
|
45
52
|
invoke({ store: t, options: n }, s) {
|
|
46
53
|
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;
|
|
47
54
|
}
|
|
48
55
|
}
|
|
49
|
-
class
|
|
56
|
+
class He {
|
|
50
57
|
_console;
|
|
51
58
|
_debug = !1;
|
|
52
59
|
get console() {
|
|
@@ -71,7 +78,7 @@ class je {
|
|
|
71
78
|
this.console.error(...t);
|
|
72
79
|
}
|
|
73
80
|
}
|
|
74
|
-
const
|
|
81
|
+
const je = "pinia-plugin-subscription", yt = (e, t = "white") => `background-color: ${e}; color: ${t}; padding: 1px; margin-right: 5px; font-size: 12px`;
|
|
75
82
|
function Et(e, t) {
|
|
76
83
|
if (!e)
|
|
77
84
|
throw new Error("Style instructions are required");
|
|
@@ -94,7 +101,7 @@ class wt {
|
|
|
94
101
|
info: { bgColor: this._bgColor, color: this._color, icon: this._icon }
|
|
95
102
|
};
|
|
96
103
|
formatMessage(t, n) {
|
|
97
|
-
return ` [${n} ${
|
|
104
|
+
return ` [${n} ${je}] - ${t} `;
|
|
98
105
|
}
|
|
99
106
|
generateStyle(t) {
|
|
100
107
|
return yt(t.bgColor, t.color);
|
|
@@ -128,7 +135,7 @@ class wt {
|
|
|
128
135
|
}
|
|
129
136
|
}
|
|
130
137
|
class Ot extends wt {
|
|
131
|
-
_pluginName =
|
|
138
|
+
_pluginName = je;
|
|
132
139
|
}
|
|
133
140
|
const vt = new Ot();
|
|
134
141
|
function be(e) {
|
|
@@ -138,17 +145,17 @@ const Ve = "PluginSubscription", Nt = {
|
|
|
138
145
|
environment: "both",
|
|
139
146
|
hydration: "immediate"
|
|
140
147
|
};
|
|
141
|
-
function
|
|
148
|
+
function Ct(e) {
|
|
142
149
|
if (typeof window < "u" && typeof window.requestAnimationFrame == "function") {
|
|
143
150
|
window.requestAnimationFrame(() => globalThis.setTimeout(e, 0));
|
|
144
151
|
return;
|
|
145
152
|
}
|
|
146
153
|
globalThis.setTimeout(e, 0);
|
|
147
154
|
}
|
|
148
|
-
function
|
|
155
|
+
function xt(e) {
|
|
149
156
|
return e !== void 0 && !Array.isArray(e);
|
|
150
157
|
}
|
|
151
|
-
class Le extends
|
|
158
|
+
class Le extends He {
|
|
152
159
|
_className = Ve;
|
|
153
160
|
_hydrationScheduler;
|
|
154
161
|
_options;
|
|
@@ -168,8 +175,8 @@ class Le extends je {
|
|
|
168
175
|
return this._subscriptions;
|
|
169
176
|
}
|
|
170
177
|
constructor(t, n, s) {
|
|
171
|
-
const r = Array.isArray(n) ? n : void 0, i =
|
|
172
|
-
super(Array.isArray(r) && !!r?.includes(Ve), vt), this._hydrationScheduler = i?.hydrationScheduler ??
|
|
178
|
+
const r = Array.isArray(n) ? n : void 0, i = xt(n) ? n : s;
|
|
179
|
+
super(Array.isArray(r) && !!r?.includes(Ve), vt), this._hydrationScheduler = i?.hydrationScheduler ?? Ct, this._options = i, this._pluginDebug = Array.isArray(r) ? r : void 0, this._subscribers = t;
|
|
173
180
|
}
|
|
174
181
|
addResetStoreCallback(t) {
|
|
175
182
|
this._resetStoreCallback.push(t);
|
|
@@ -201,11 +208,17 @@ class Le extends je {
|
|
|
201
208
|
this._resetStoreCallback.forEach((n) => n(t));
|
|
202
209
|
}
|
|
203
210
|
executeSubscriber(t, n) {
|
|
204
|
-
const s = this.defineSubscriberKey(n, t.store);
|
|
205
|
-
this._subscribersDelivered.has(s) || n.invoke(
|
|
211
|
+
const s = this.defineSubscriberKey(n, t.store), r = this.definePluginDebug(n);
|
|
212
|
+
if (this._subscribersDelivered.has(s) || !n.invoke(
|
|
206
213
|
t,
|
|
207
|
-
|
|
208
|
-
)
|
|
214
|
+
r
|
|
215
|
+
))
|
|
216
|
+
return;
|
|
217
|
+
this._subscribersDelivered.add(s);
|
|
218
|
+
const i = n.hydrate?.(t, r);
|
|
219
|
+
i && typeof i.then == "function" && i.catch((c) => this.logError(c, t.store, t.options));
|
|
220
|
+
const o = n.afterHydration?.(t, r);
|
|
221
|
+
o && typeof o.then == "function" && o.catch((c) => this.logError(c, t.store, t.options)), n.subscriptions && this.subscriptionDelivery(t, n.subscriptions), n.storeMutationSubscription && this.storeMutationSubscription(n.storeMutationSubscription), n.storeOnActionSubscription && this.storeOnActionSubscription(n.storeOnActionSubscription), n.resetStoreCallback && this.addResetStoreCallback(n.resetStoreCallback);
|
|
209
222
|
}
|
|
210
223
|
executeSubscriberSafely(t, n) {
|
|
211
224
|
try {
|
|
@@ -302,20 +315,20 @@ class Le extends je {
|
|
|
302
315
|
"stores:",
|
|
303
316
|
c
|
|
304
317
|
]);
|
|
305
|
-
const
|
|
318
|
+
const a = {
|
|
306
319
|
storeOptions: { ...n?.storeOptions ?? {}, ...o }
|
|
307
320
|
};
|
|
308
321
|
i.invoke(
|
|
309
|
-
{ store: t, options: { ...n, ...
|
|
322
|
+
{ store: t, options: { ...n, ...a } },
|
|
310
323
|
this.debug
|
|
311
324
|
), this._subscriptionsDelivered.add(this.defineSubscriptionKey(s, t)), be(c) || c?.forEach(
|
|
312
|
-
(
|
|
325
|
+
(l) => i.invoke(
|
|
313
326
|
{
|
|
314
|
-
store:
|
|
327
|
+
store: l,
|
|
315
328
|
options: {
|
|
316
329
|
...n,
|
|
317
|
-
...
|
|
318
|
-
...
|
|
330
|
+
...a,
|
|
331
|
+
...l?.storeOptions ?? {}
|
|
319
332
|
}
|
|
320
333
|
},
|
|
321
334
|
this.debug
|
|
@@ -336,7 +349,7 @@ const Se = process.env.NODE_ENV !== "production" ? Object.freeze({}) : {};
|
|
|
336
349
|
process.env.NODE_ENV !== "production" && Object.freeze([]);
|
|
337
350
|
const We = () => {
|
|
338
351
|
}, At = (e) => e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && // uppercase letter
|
|
339
|
-
(e.charCodeAt(2) > 122 || e.charCodeAt(2) < 97), It = (e) => e.startsWith("onUpdate:"), P = Object.assign, Dt = Object.prototype.hasOwnProperty, me = (e, t) => Dt.call(e, t), p = Array.isArray, z = (e) => ze(e) === "[object Map]", I = (e) => typeof e == "function",
|
|
352
|
+
(e.charCodeAt(2) > 122 || e.charCodeAt(2) < 97), It = (e) => e.startsWith("onUpdate:"), P = Object.assign, Dt = Object.prototype.hasOwnProperty, me = (e, t) => Dt.call(e, t), p = Array.isArray, z = (e) => ze(e) === "[object Map]", I = (e) => typeof e == "function", C = (e) => typeof e == "string", T = (e) => typeof e == "symbol", g = (e) => e !== null && typeof e == "object", $t = Object.prototype.toString, ze = (e) => $t.call(e), qe = (e) => ze(e).slice(8, -1), ce = (e) => C(e) && e !== "NaN" && e[0] !== "-" && "" + parseInt(e, 10) === e, Vt = (e) => {
|
|
340
353
|
const t = /* @__PURE__ */ Object.create(null);
|
|
341
354
|
return ((n) => t[n] || (t[n] = e(n)));
|
|
342
355
|
}, Tt = Vt((e) => e.charAt(0).toUpperCase() + e.slice(1)), D = (e, t) => !Object.is(e, t);
|
|
@@ -346,13 +359,13 @@ function Ne(e) {
|
|
|
346
359
|
if (p(e)) {
|
|
347
360
|
const t = {};
|
|
348
361
|
for (let n = 0; n < e.length; n++) {
|
|
349
|
-
const s = e[n], r =
|
|
362
|
+
const s = e[n], r = C(s) ? kt(s) : Ne(s);
|
|
350
363
|
if (r)
|
|
351
364
|
for (const i in r)
|
|
352
365
|
t[i] = r[i];
|
|
353
366
|
}
|
|
354
367
|
return t;
|
|
355
|
-
} else if (
|
|
368
|
+
} else if (C(e) || g(e))
|
|
356
369
|
return e;
|
|
357
370
|
}
|
|
358
371
|
const Pt = /;(?![^(]*\))/g, Mt = /:([^]+)/, Ft = /\/\*[^]*?\*\//g;
|
|
@@ -365,13 +378,13 @@ function kt(e) {
|
|
|
365
378
|
}
|
|
366
379
|
}), t;
|
|
367
380
|
}
|
|
368
|
-
function
|
|
381
|
+
function Ce(e) {
|
|
369
382
|
let t = "";
|
|
370
|
-
if (
|
|
383
|
+
if (C(e))
|
|
371
384
|
t = e;
|
|
372
385
|
else if (p(e))
|
|
373
386
|
for (let n = 0; n < e.length; n++) {
|
|
374
|
-
const s =
|
|
387
|
+
const s = Ce(e[n]);
|
|
375
388
|
s && (t += s + " ");
|
|
376
389
|
}
|
|
377
390
|
else if (g(e))
|
|
@@ -379,11 +392,11 @@ function xe(e) {
|
|
|
379
392
|
e[n] && (t += n + " ");
|
|
380
393
|
return t.trim();
|
|
381
394
|
}
|
|
382
|
-
function
|
|
395
|
+
function H(e, ...t) {
|
|
383
396
|
console.warn(`[Vue warn] ${e}`, ...t);
|
|
384
397
|
}
|
|
385
398
|
let Kt, Ue = 0, fe;
|
|
386
|
-
function
|
|
399
|
+
function xe() {
|
|
387
400
|
Ue++;
|
|
388
401
|
}
|
|
389
402
|
function Re() {
|
|
@@ -407,10 +420,10 @@ function Re() {
|
|
|
407
420
|
}
|
|
408
421
|
let ee = !0;
|
|
409
422
|
const Be = [];
|
|
410
|
-
function
|
|
423
|
+
function ae() {
|
|
411
424
|
Be.push(ee), ee = !1;
|
|
412
425
|
}
|
|
413
|
-
function
|
|
426
|
+
function le() {
|
|
414
427
|
const e = Be.pop();
|
|
415
428
|
ee = e === void 0 ? !0 : e;
|
|
416
429
|
}
|
|
@@ -425,7 +438,7 @@ class Je {
|
|
|
425
438
|
this.version++, this.notify(t);
|
|
426
439
|
}
|
|
427
440
|
notify(t) {
|
|
428
|
-
|
|
441
|
+
xe();
|
|
429
442
|
try {
|
|
430
443
|
if (process.env.NODE_ENV !== "production")
|
|
431
444
|
for (let n = this.subsHead; n; n = n.nextSub)
|
|
@@ -467,32 +480,32 @@ function A(e, t, n, s, r, i) {
|
|
|
467
480
|
const o = te.get(e);
|
|
468
481
|
if (!o)
|
|
469
482
|
return;
|
|
470
|
-
const c = (
|
|
471
|
-
|
|
483
|
+
const c = (a) => {
|
|
484
|
+
a && (process.env.NODE_ENV !== "production" ? a.trigger({
|
|
472
485
|
target: e,
|
|
473
486
|
type: t,
|
|
474
487
|
key: n,
|
|
475
488
|
newValue: s,
|
|
476
489
|
oldValue: r,
|
|
477
490
|
oldTarget: i
|
|
478
|
-
}) :
|
|
491
|
+
}) : a.trigger());
|
|
479
492
|
};
|
|
480
|
-
if (
|
|
493
|
+
if (xe(), t === "clear")
|
|
481
494
|
o.forEach(c);
|
|
482
495
|
else {
|
|
483
|
-
const
|
|
484
|
-
if (
|
|
496
|
+
const a = p(e), l = a && ce(n);
|
|
497
|
+
if (a && n === "length") {
|
|
485
498
|
const d = Number(s);
|
|
486
499
|
o.forEach((u, f) => {
|
|
487
500
|
(f === "length" || f === q || !T(f) && f >= d) && c(u);
|
|
488
501
|
});
|
|
489
502
|
} else
|
|
490
|
-
switch ((n !== void 0 || o.has(void 0)) && c(o.get(n)),
|
|
503
|
+
switch ((n !== void 0 || o.has(void 0)) && c(o.get(n)), l && c(o.get(q)), t) {
|
|
491
504
|
case "add":
|
|
492
|
-
|
|
505
|
+
a ? l && c(o.get("length")) : (c(o.get($)), z(e) && c(o.get(ye)));
|
|
493
506
|
break;
|
|
494
507
|
case "delete":
|
|
495
|
-
|
|
508
|
+
a || (c(o.get($)), z(e) && c(o.get(ye)));
|
|
496
509
|
break;
|
|
497
510
|
case "set":
|
|
498
511
|
z(e) && c(o.get($));
|
|
@@ -501,21 +514,21 @@ function A(e, t, n, s, r, i) {
|
|
|
501
514
|
}
|
|
502
515
|
Re();
|
|
503
516
|
}
|
|
504
|
-
function
|
|
517
|
+
function Ht(e, t) {
|
|
505
518
|
const n = te.get(e);
|
|
506
519
|
return n && n.get(t);
|
|
507
520
|
}
|
|
508
521
|
function M(e) {
|
|
509
522
|
const t = /* @__PURE__ */ h(e);
|
|
510
|
-
return t === e ? t : (_(t, "iterate", q), /* @__PURE__ */ y(e) ? t : t.map(
|
|
523
|
+
return t === e ? t : (_(t, "iterate", q), /* @__PURE__ */ y(e) ? t : t.map(x));
|
|
511
524
|
}
|
|
512
525
|
function Ae(e) {
|
|
513
526
|
return _(e = /* @__PURE__ */ h(e), "iterate", q), e;
|
|
514
527
|
}
|
|
515
528
|
function w(e, t) {
|
|
516
|
-
return /* @__PURE__ */ O(e) ? B(/* @__PURE__ */ Ie(e) ?
|
|
529
|
+
return /* @__PURE__ */ O(e) ? B(/* @__PURE__ */ Ie(e) ? x(t) : t) : x(t);
|
|
517
530
|
}
|
|
518
|
-
const
|
|
531
|
+
const jt = {
|
|
519
532
|
__proto__: null,
|
|
520
533
|
[Symbol.iterator]() {
|
|
521
534
|
return he(this, Symbol.iterator, (e) => w(this, e));
|
|
@@ -634,30 +647,30 @@ function he(e, t, n) {
|
|
|
634
647
|
}
|
|
635
648
|
const Lt = Array.prototype;
|
|
636
649
|
function v(e, t, n, s, r, i) {
|
|
637
|
-
const o = Ae(e), c = o !== e && !/* @__PURE__ */ y(e),
|
|
638
|
-
if (
|
|
639
|
-
const u =
|
|
640
|
-
return c ?
|
|
650
|
+
const o = Ae(e), c = o !== e && !/* @__PURE__ */ y(e), a = o[t];
|
|
651
|
+
if (a !== Lt[t]) {
|
|
652
|
+
const u = a.apply(e, i);
|
|
653
|
+
return c ? x(u) : u;
|
|
641
654
|
}
|
|
642
|
-
let
|
|
643
|
-
o !== e && (c ?
|
|
655
|
+
let l = n;
|
|
656
|
+
o !== e && (c ? l = function(u, f) {
|
|
644
657
|
return n.call(this, w(e, u), f, e);
|
|
645
|
-
} : n.length > 2 && (
|
|
658
|
+
} : n.length > 2 && (l = function(u, f) {
|
|
646
659
|
return n.call(this, u, f, e);
|
|
647
660
|
}));
|
|
648
|
-
const d =
|
|
661
|
+
const d = a.call(o, l, s);
|
|
649
662
|
return c && r ? r(d) : d;
|
|
650
663
|
}
|
|
651
664
|
function Pe(e, t, n, s) {
|
|
652
665
|
const r = Ae(e), i = r !== e && !/* @__PURE__ */ y(e);
|
|
653
666
|
let o = n, c = !1;
|
|
654
|
-
r !== e && (i ? (c = s.length === 0, o = function(
|
|
655
|
-
return c && (c = !1,
|
|
656
|
-
}) : n.length > 3 && (o = function(
|
|
657
|
-
return n.call(this,
|
|
667
|
+
r !== e && (i ? (c = s.length === 0, o = function(l, d, u) {
|
|
668
|
+
return c && (c = !1, l = w(e, l)), n.call(this, l, w(e, d), u, e);
|
|
669
|
+
}) : n.length > 3 && (o = function(l, d, u) {
|
|
670
|
+
return n.call(this, l, d, u, e);
|
|
658
671
|
}));
|
|
659
|
-
const
|
|
660
|
-
return c ? w(e,
|
|
672
|
+
const a = r[t](o, ...s);
|
|
673
|
+
return c ? w(e, a) : a;
|
|
661
674
|
}
|
|
662
675
|
function de(e, t, n) {
|
|
663
676
|
const s = /* @__PURE__ */ h(e);
|
|
@@ -666,9 +679,9 @@ function de(e, t, n) {
|
|
|
666
679
|
return (r === -1 || r === !1) && /* @__PURE__ */ U(n[0]) ? (n[0] = /* @__PURE__ */ h(n[0]), s[t](...n)) : r;
|
|
667
680
|
}
|
|
668
681
|
function W(e, t, n = []) {
|
|
669
|
-
|
|
682
|
+
ae(), xe();
|
|
670
683
|
const s = (/* @__PURE__ */ h(e))[t].apply(e, n);
|
|
671
|
-
return Re(),
|
|
684
|
+
return Re(), le(), s;
|
|
672
685
|
}
|
|
673
686
|
const Wt = /* @__PURE__ */ Rt("__proto__,__v_isRef,__isVue"), Ye = new Set(
|
|
674
687
|
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((e) => e !== "arguments" && e !== "caller").map((e) => Symbol[e]).filter(T)
|
|
@@ -697,9 +710,9 @@ class Ge {
|
|
|
697
710
|
Object.getPrototypeOf(t) === Object.getPrototypeOf(s) ? t : void 0;
|
|
698
711
|
const o = p(t);
|
|
699
712
|
if (!r) {
|
|
700
|
-
let
|
|
701
|
-
if (o && (
|
|
702
|
-
return
|
|
713
|
+
let a;
|
|
714
|
+
if (o && (a = jt[n]))
|
|
715
|
+
return a;
|
|
703
716
|
if (n === "hasOwnProperty")
|
|
704
717
|
return zt;
|
|
705
718
|
}
|
|
@@ -714,8 +727,8 @@ class Ge {
|
|
|
714
727
|
if ((T(n) ? Ye.has(n) : Wt(n)) || (r || _(t, "get", n), i))
|
|
715
728
|
return c;
|
|
716
729
|
if (/* @__PURE__ */ b(c)) {
|
|
717
|
-
const
|
|
718
|
-
return r && g(
|
|
730
|
+
const a = o && ce(n) ? c : c.value;
|
|
731
|
+
return r && g(a) ? /* @__PURE__ */ we(a) : a;
|
|
719
732
|
}
|
|
720
733
|
return g(c) ? r ? /* @__PURE__ */ we(c) : /* @__PURE__ */ et(c) : c;
|
|
721
734
|
}
|
|
@@ -728,20 +741,20 @@ class qt extends Ge {
|
|
|
728
741
|
let i = t[n];
|
|
729
742
|
const o = p(t) && ce(n);
|
|
730
743
|
if (!this._isShallow) {
|
|
731
|
-
const
|
|
744
|
+
const l = /* @__PURE__ */ O(i);
|
|
732
745
|
if (!/* @__PURE__ */ y(s) && !/* @__PURE__ */ O(s) && (i = /* @__PURE__ */ h(i), s = /* @__PURE__ */ h(s)), !o && /* @__PURE__ */ b(i) && !/* @__PURE__ */ b(s))
|
|
733
|
-
return
|
|
746
|
+
return l ? (process.env.NODE_ENV !== "production" && H(
|
|
734
747
|
`Set operation on key "${String(n)}" failed: target is readonly.`,
|
|
735
748
|
t[n]
|
|
736
749
|
), !0) : (i.value = s, !0);
|
|
737
750
|
}
|
|
738
|
-
const c = o ? Number(n) < t.length : me(t, n),
|
|
751
|
+
const c = o ? Number(n) < t.length : me(t, n), a = Reflect.set(
|
|
739
752
|
t,
|
|
740
753
|
n,
|
|
741
754
|
s,
|
|
742
755
|
/* @__PURE__ */ b(t) ? t : r
|
|
743
756
|
);
|
|
744
|
-
return t === /* @__PURE__ */ h(r) &&
|
|
757
|
+
return t === /* @__PURE__ */ h(r) && a && (c ? D(s, i) && A(t, "set", n, s, i) : A(t, "add", n, s)), a;
|
|
745
758
|
}
|
|
746
759
|
deleteProperty(t, n) {
|
|
747
760
|
const s = me(t, n), r = t[n], i = Reflect.deleteProperty(t, n);
|
|
@@ -764,13 +777,13 @@ class Ut extends Ge {
|
|
|
764
777
|
super(!0, t);
|
|
765
778
|
}
|
|
766
779
|
set(t, n) {
|
|
767
|
-
return process.env.NODE_ENV !== "production" &&
|
|
780
|
+
return process.env.NODE_ENV !== "production" && H(
|
|
768
781
|
`Set operation on key "${String(n)}" failed: target is readonly.`,
|
|
769
782
|
t
|
|
770
783
|
), !0;
|
|
771
784
|
}
|
|
772
785
|
deleteProperty(t, n) {
|
|
773
|
-
return process.env.NODE_ENV !== "production" &&
|
|
786
|
+
return process.env.NODE_ENV !== "production" && H(
|
|
774
787
|
`Delete operation on key "${String(n)}" failed: target is readonly.`,
|
|
775
788
|
t
|
|
776
789
|
), !0;
|
|
@@ -779,18 +792,18 @@ class Ut extends Ge {
|
|
|
779
792
|
const Bt = /* @__PURE__ */ new qt(), Jt = /* @__PURE__ */ new Ut(), Ee = (e) => e, G = (e) => Reflect.getPrototypeOf(e);
|
|
780
793
|
function Yt(e, t, n) {
|
|
781
794
|
return function(...s) {
|
|
782
|
-
const r = this.__v_raw, i = /* @__PURE__ */ h(r), o = z(i), c = e === "entries" || e === Symbol.iterator && o,
|
|
795
|
+
const r = this.__v_raw, i = /* @__PURE__ */ h(r), o = z(i), c = e === "entries" || e === Symbol.iterator && o, a = e === "keys" && o, l = r[e](...s), d = n ? Ee : t ? B : x;
|
|
783
796
|
return !t && _(
|
|
784
797
|
i,
|
|
785
798
|
"iterate",
|
|
786
|
-
|
|
799
|
+
a ? ye : $
|
|
787
800
|
), P(
|
|
788
801
|
// inheriting all iterator properties
|
|
789
|
-
Object.create(
|
|
802
|
+
Object.create(l),
|
|
790
803
|
{
|
|
791
804
|
// iterator protocol
|
|
792
805
|
next() {
|
|
793
|
-
const { value: u, done: f } =
|
|
806
|
+
const { value: u, done: f } = l.next();
|
|
794
807
|
return f ? { value: u, done: f } : {
|
|
795
808
|
value: c ? [d(u[0]), d(u[1])] : d(u),
|
|
796
809
|
done: f
|
|
@@ -804,7 +817,7 @@ function Q(e) {
|
|
|
804
817
|
return function(...t) {
|
|
805
818
|
if (process.env.NODE_ENV !== "production") {
|
|
806
819
|
const n = t[0] ? `on key "${t[0]}" ` : "";
|
|
807
|
-
|
|
820
|
+
H(
|
|
808
821
|
`${Tt(e)} operation ${n}failed: target is readonly.`,
|
|
809
822
|
/* @__PURE__ */ h(this)
|
|
810
823
|
);
|
|
@@ -817,11 +830,11 @@ function Gt(e, t) {
|
|
|
817
830
|
get(r) {
|
|
818
831
|
const i = this.__v_raw, o = /* @__PURE__ */ h(i), c = /* @__PURE__ */ h(r);
|
|
819
832
|
e || (D(r, c) && _(o, "get", r), _(o, "get", c));
|
|
820
|
-
const { has:
|
|
821
|
-
if (
|
|
822
|
-
return
|
|
823
|
-
if (
|
|
824
|
-
return
|
|
833
|
+
const { has: a } = G(o), l = t ? Ee : e ? B : x;
|
|
834
|
+
if (a.call(o, r))
|
|
835
|
+
return l(i.get(r));
|
|
836
|
+
if (a.call(o, c))
|
|
837
|
+
return l(i.get(c));
|
|
825
838
|
i !== o && i.get(r);
|
|
826
839
|
},
|
|
827
840
|
get size() {
|
|
@@ -833,8 +846,8 @@ function Gt(e, t) {
|
|
|
833
846
|
return e || (D(r, c) && _(o, "has", r), _(o, "has", c)), r === c ? i.has(r) : i.has(r) || i.has(c);
|
|
834
847
|
},
|
|
835
848
|
forEach(r, i) {
|
|
836
|
-
const o = this, c = o.__v_raw,
|
|
837
|
-
return !e && _(
|
|
849
|
+
const o = this, c = o.__v_raw, a = /* @__PURE__ */ h(c), l = t ? Ee : e ? B : x;
|
|
850
|
+
return !e && _(a, "iterate", $), c.forEach((d, u) => r.call(i, l(d), l(u), o));
|
|
838
851
|
}
|
|
839
852
|
};
|
|
840
853
|
return P(
|
|
@@ -846,23 +859,23 @@ function Gt(e, t) {
|
|
|
846
859
|
clear: Q("clear")
|
|
847
860
|
} : {
|
|
848
861
|
add(r) {
|
|
849
|
-
const i = /* @__PURE__ */ h(this), o = G(i), c = /* @__PURE__ */ h(r),
|
|
850
|
-
return o.has.call(i,
|
|
862
|
+
const i = /* @__PURE__ */ h(this), o = G(i), c = /* @__PURE__ */ h(r), a = !t && !/* @__PURE__ */ y(r) && !/* @__PURE__ */ O(r) ? c : r;
|
|
863
|
+
return o.has.call(i, a) || D(r, a) && o.has.call(i, r) || D(c, a) && o.has.call(i, c) || (i.add(a), A(i, "add", a, a)), this;
|
|
851
864
|
},
|
|
852
865
|
set(r, i) {
|
|
853
866
|
!t && !/* @__PURE__ */ y(i) && !/* @__PURE__ */ O(i) && (i = /* @__PURE__ */ h(i));
|
|
854
|
-
const o = /* @__PURE__ */ h(this), { has: c, get:
|
|
855
|
-
let
|
|
856
|
-
|
|
857
|
-
const d =
|
|
858
|
-
return o.set(r, i),
|
|
867
|
+
const o = /* @__PURE__ */ h(this), { has: c, get: a } = G(o);
|
|
868
|
+
let l = c.call(o, r);
|
|
869
|
+
l ? process.env.NODE_ENV !== "production" && Me(o, c, r) : (r = /* @__PURE__ */ h(r), l = c.call(o, r));
|
|
870
|
+
const d = a.call(o, r);
|
|
871
|
+
return o.set(r, i), l ? D(i, d) && A(o, "set", r, i, d) : A(o, "add", r, i), this;
|
|
859
872
|
},
|
|
860
873
|
delete(r) {
|
|
861
874
|
const i = /* @__PURE__ */ h(this), { has: o, get: c } = G(i);
|
|
862
|
-
let
|
|
863
|
-
|
|
864
|
-
const
|
|
865
|
-
return
|
|
875
|
+
let a = o.call(i, r);
|
|
876
|
+
a ? process.env.NODE_ENV !== "production" && Me(i, o, r) : (r = /* @__PURE__ */ h(r), a = o.call(i, r));
|
|
877
|
+
const l = c ? c.call(i, r) : void 0, d = i.delete(r);
|
|
878
|
+
return a && A(i, "delete", r, void 0, l), d;
|
|
866
879
|
},
|
|
867
880
|
clear() {
|
|
868
881
|
const r = /* @__PURE__ */ h(this), i = r.size !== 0, o = process.env.NODE_ENV !== "production" ? z(r) ? new Map(r) : new Set(r) : void 0, c = r.clear();
|
|
@@ -901,7 +914,7 @@ function Me(e, t, n) {
|
|
|
901
914
|
const s = /* @__PURE__ */ h(n);
|
|
902
915
|
if (s !== n && t.call(e, s)) {
|
|
903
916
|
const r = qe(e);
|
|
904
|
-
|
|
917
|
+
H(
|
|
905
918
|
`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.`
|
|
906
919
|
);
|
|
907
920
|
}
|
|
@@ -943,7 +956,7 @@ function we(e) {
|
|
|
943
956
|
}
|
|
944
957
|
function tt(e, t, n, s, r) {
|
|
945
958
|
if (!g(e))
|
|
946
|
-
return process.env.NODE_ENV !== "production" &&
|
|
959
|
+
return process.env.NODE_ENV !== "production" && H(
|
|
947
960
|
`value cannot be made ${t ? "readonly" : "reactive"}: ${String(
|
|
948
961
|
e
|
|
949
962
|
)}`
|
|
@@ -983,7 +996,7 @@ function h(e) {
|
|
|
983
996
|
const t = e && e.__v_raw;
|
|
984
997
|
return t ? /* @__PURE__ */ h(t) : e;
|
|
985
998
|
}
|
|
986
|
-
const
|
|
999
|
+
const x = (e) => g(e) ? /* @__PURE__ */ et(e) : e, B = (e) => g(e) ? /* @__PURE__ */ we(e) : e;
|
|
987
1000
|
// @__NO_SIDE_EFFECTS__
|
|
988
1001
|
function b(e) {
|
|
989
1002
|
return e ? e.__v_isRef === !0 : !1;
|
|
@@ -997,7 +1010,7 @@ function nn(e, t) {
|
|
|
997
1010
|
}
|
|
998
1011
|
class rn {
|
|
999
1012
|
constructor(t, n) {
|
|
1000
|
-
this.dep = new Je(), this.__v_isRef = !0, this.__v_isShallow = !1, this._rawValue = n ? t : /* @__PURE__ */ h(t), this._value = n ? t :
|
|
1013
|
+
this.dep = new Je(), this.__v_isRef = !0, this.__v_isShallow = !1, this._rawValue = n ? t : /* @__PURE__ */ h(t), this._value = n ? t : x(t), this.__v_isShallow = n;
|
|
1001
1014
|
}
|
|
1002
1015
|
get value() {
|
|
1003
1016
|
return process.env.NODE_ENV !== "production" ? this.dep.track({
|
|
@@ -1008,7 +1021,7 @@ class rn {
|
|
|
1008
1021
|
}
|
|
1009
1022
|
set value(t) {
|
|
1010
1023
|
const n = this._rawValue, s = this.__v_isShallow || /* @__PURE__ */ y(t) || /* @__PURE__ */ O(t);
|
|
1011
|
-
t = s ? t : /* @__PURE__ */ h(t), D(t, n) && (this._rawValue = t, this._value = s ? t :
|
|
1024
|
+
t = s ? t : /* @__PURE__ */ h(t), D(t, n) && (this._rawValue = t, this._value = s ? t : x(t), process.env.NODE_ENV !== "production" ? this.dep.trigger({
|
|
1012
1025
|
target: this,
|
|
1013
1026
|
type: "set",
|
|
1014
1027
|
key: "value",
|
|
@@ -1045,7 +1058,7 @@ class on {
|
|
|
1045
1058
|
this._object[this._key] = t;
|
|
1046
1059
|
}
|
|
1047
1060
|
get dep() {
|
|
1048
|
-
return
|
|
1061
|
+
return Ht(this._raw, this._key);
|
|
1049
1062
|
}
|
|
1050
1063
|
}
|
|
1051
1064
|
class cn {
|
|
@@ -1058,22 +1071,22 @@ class cn {
|
|
|
1058
1071
|
}
|
|
1059
1072
|
// @__NO_SIDE_EFFECTS__
|
|
1060
1073
|
function un(e, t, n) {
|
|
1061
|
-
return /* @__PURE__ */ b(e) ? e : I(e) ? new cn(e) : g(e) && arguments.length > 1 ?
|
|
1074
|
+
return /* @__PURE__ */ b(e) ? e : I(e) ? new cn(e) : g(e) && arguments.length > 1 ? an(e, t, n) : /* @__PURE__ */ nt(e);
|
|
1062
1075
|
}
|
|
1063
|
-
function
|
|
1076
|
+
function an(e, t, n) {
|
|
1064
1077
|
return new on(e, t, n);
|
|
1065
1078
|
}
|
|
1066
1079
|
const V = [];
|
|
1067
|
-
function
|
|
1080
|
+
function ln(e) {
|
|
1068
1081
|
V.push(e);
|
|
1069
1082
|
}
|
|
1070
1083
|
function fn() {
|
|
1071
1084
|
V.pop();
|
|
1072
1085
|
}
|
|
1073
1086
|
let pe = !1;
|
|
1074
|
-
function
|
|
1087
|
+
function j(e, ...t) {
|
|
1075
1088
|
if (pe) return;
|
|
1076
|
-
pe = !0,
|
|
1089
|
+
pe = !0, ae();
|
|
1077
1090
|
const n = V.length ? V[V.length - 1].component : null, s = n && n.appContext.config.warnHandler, r = hn();
|
|
1078
1091
|
if (s)
|
|
1079
1092
|
De(
|
|
@@ -1099,7 +1112,7 @@ function H(e, ...t) {
|
|
|
1099
1112
|
r.length && i.push(`
|
|
1100
1113
|
`, ...dn(r)), console.warn(...i);
|
|
1101
1114
|
}
|
|
1102
|
-
|
|
1115
|
+
le(), pe = !1;
|
|
1103
1116
|
}
|
|
1104
1117
|
function hn() {
|
|
1105
1118
|
let e = V[V.length - 1];
|
|
@@ -1139,7 +1152,7 @@ function _n(e) {
|
|
|
1139
1152
|
}), n.length > 3 && t.push(" ..."), t;
|
|
1140
1153
|
}
|
|
1141
1154
|
function rt(e, t, n) {
|
|
1142
|
-
return
|
|
1155
|
+
return C(t) ? (t = JSON.stringify(t), n ? t : [`${e}=${t}`]) : typeof t == "number" || typeof t == "boolean" || t == null ? n ? t : [`${e}=${t}`] : /* @__PURE__ */ b(t) ? (t = rt(e, /* @__PURE__ */ h(t.value), !0), n ? t : [`${e}=Ref<`, t, ">"]) : I(t) ? [`${e}=fn${t.name ? `<${t.name}>` : ""}`] : (t = /* @__PURE__ */ h(t), n ? t : [`${e}=`, t]);
|
|
1143
1156
|
}
|
|
1144
1157
|
const st = {
|
|
1145
1158
|
sp: "serverPrefetch hook",
|
|
@@ -1185,22 +1198,22 @@ function it(e, t, n, s = !0) {
|
|
|
1185
1198
|
const r = t ? t.vnode : null, { errorHandler: i, throwUnhandledErrorInProduction: o } = t && t.appContext.config || Se;
|
|
1186
1199
|
if (t) {
|
|
1187
1200
|
let c = t.parent;
|
|
1188
|
-
const
|
|
1201
|
+
const a = t.proxy, l = process.env.NODE_ENV !== "production" ? st[n] : `https://vuejs.org/error-reference/#runtime-${n}`;
|
|
1189
1202
|
for (; c; ) {
|
|
1190
1203
|
const d = c.ec;
|
|
1191
1204
|
if (d) {
|
|
1192
1205
|
for (let u = 0; u < d.length; u++)
|
|
1193
|
-
if (d[u](e,
|
|
1206
|
+
if (d[u](e, a, l) === !1)
|
|
1194
1207
|
return;
|
|
1195
1208
|
}
|
|
1196
1209
|
c = c.parent;
|
|
1197
1210
|
}
|
|
1198
1211
|
if (i) {
|
|
1199
|
-
|
|
1212
|
+
ae(), De(i, null, 10, [
|
|
1200
1213
|
e,
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
]),
|
|
1214
|
+
a,
|
|
1215
|
+
l
|
|
1216
|
+
]), le();
|
|
1204
1217
|
return;
|
|
1205
1218
|
}
|
|
1206
1219
|
}
|
|
@@ -1209,7 +1222,7 @@ function it(e, t, n, s = !0) {
|
|
|
1209
1222
|
function gn(e, t, n, s = !0, r = !1) {
|
|
1210
1223
|
if (process.env.NODE_ENV !== "production") {
|
|
1211
1224
|
const i = st[t];
|
|
1212
|
-
if (n &&
|
|
1225
|
+
if (n && ln(n), j(`Unhandled error${i ? ` during execution of ${i}` : ""}`), n && fn(), s)
|
|
1213
1226
|
throw e;
|
|
1214
1227
|
console.error(e);
|
|
1215
1228
|
} else {
|
|
@@ -1356,26 +1369,26 @@ function ge(e) {
|
|
|
1356
1369
|
};
|
|
1357
1370
|
}
|
|
1358
1371
|
let k, X = [];
|
|
1359
|
-
function
|
|
1372
|
+
function at(e, t) {
|
|
1360
1373
|
var n, s;
|
|
1361
1374
|
k = e, k ? (k.enabled = !0, X.forEach(({ event: r, args: i }) => k.emit(r, ...i)), X = []) : /* 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
|
|
1362
1375
|
window.HTMLElement && // also exclude jsdom
|
|
1363
1376
|
// eslint-disable-next-line no-restricted-syntax
|
|
1364
1377
|
!((s = (n = window.navigator) == null ? void 0 : n.userAgent) != null && s.includes("jsdom")) ? ((t.__VUE_DEVTOOLS_HOOK_REPLAY__ = t.__VUE_DEVTOOLS_HOOK_REPLAY__ || []).push((i) => {
|
|
1365
|
-
|
|
1378
|
+
at(i, t);
|
|
1366
1379
|
}), setTimeout(() => {
|
|
1367
1380
|
k || (t.__VUE_DEVTOOLS_HOOK_REPLAY__ = null, X = []);
|
|
1368
1381
|
}, 3e3)) : X = [];
|
|
1369
1382
|
}
|
|
1370
|
-
let se = null,
|
|
1371
|
-
const
|
|
1372
|
-
function
|
|
1373
|
-
e.shapeFlag & 6 && e.component ? (e.transition = t,
|
|
1383
|
+
let se = null, Cn = null;
|
|
1384
|
+
const xn = (e) => e.__isTeleport;
|
|
1385
|
+
function lt(e, t) {
|
|
1386
|
+
e.shapeFlag & 6 && e.component ? (e.transition = t, lt(e.component.subTree, t)) : e.shapeFlag & 128 ? (e.ssContent.transition = t.clone(e.ssContent), e.ssFallback.transition = t.clone(e.ssFallback)) : e.transition = t;
|
|
1374
1387
|
}
|
|
1375
1388
|
ue().requestIdleCallback;
|
|
1376
1389
|
ue().cancelIdleCallback;
|
|
1377
1390
|
const Rn = /* @__PURE__ */ Symbol.for("v-ndc"), An = {};
|
|
1378
|
-
process.env.NODE_ENV !== "production" && (An.ownKeys = (e) => (
|
|
1391
|
+
process.env.NODE_ENV !== "production" && (An.ownKeys = (e) => (j(
|
|
1379
1392
|
"Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."
|
|
1380
1393
|
), Reflect.ownKeys(e)));
|
|
1381
1394
|
const In = {}, ft = (e) => Object.getPrototypeOf(e) === In, Dn = (e) => e.__isSuspense, ht = /* @__PURE__ */ Symbol.for("v-fgt"), $n = /* @__PURE__ */ Symbol.for("v-txt"), Vn = /* @__PURE__ */ Symbol.for("v-cmt");
|
|
@@ -1388,16 +1401,16 @@ const Pn = (...e) => pt(
|
|
|
1388
1401
|
ref: e,
|
|
1389
1402
|
ref_key: t,
|
|
1390
1403
|
ref_for: n
|
|
1391
|
-
}) => (typeof e == "number" && (e = "" + e), e != null ?
|
|
1404
|
+
}) => (typeof e == "number" && (e = "" + e), e != null ? C(e) || /* @__PURE__ */ b(e) || I(e) ? { i: se, r: e, k: t, f: !!n } : e : null);
|
|
1392
1405
|
function Mn(e, t = null, n = null, s = 0, r = null, i = e === ht ? 0 : 1, o = !1, c = !1) {
|
|
1393
|
-
const
|
|
1406
|
+
const a = {
|
|
1394
1407
|
__v_isVNode: !0,
|
|
1395
1408
|
__v_skip: !0,
|
|
1396
1409
|
type: e,
|
|
1397
1410
|
props: t,
|
|
1398
1411
|
key: t && dt(t),
|
|
1399
1412
|
ref: t && Z(t),
|
|
1400
|
-
scopeId:
|
|
1413
|
+
scopeId: Cn,
|
|
1401
1414
|
slotScopeIds: null,
|
|
1402
1415
|
children: n,
|
|
1403
1416
|
component: null,
|
|
@@ -1419,11 +1432,11 @@ function Mn(e, t = null, n = null, s = 0, r = null, i = e === ht ? 0 : 1, o = !1
|
|
|
1419
1432
|
appContext: null,
|
|
1420
1433
|
ctx: se
|
|
1421
1434
|
};
|
|
1422
|
-
return c ? (oe(
|
|
1435
|
+
return c ? (oe(a, n), i & 128 && e.normalize(a)) : n && (a.shapeFlag |= C(n) ? 8 : 16), process.env.NODE_ENV !== "production" && a.key !== a.key && j("VNode created with invalid key (NaN). VNode type:", a.type), a;
|
|
1423
1436
|
}
|
|
1424
1437
|
const Fn = process.env.NODE_ENV !== "production" ? Pn : pt;
|
|
1425
1438
|
function pt(e, t = null, n = null, s = 0, r = null, i = !1) {
|
|
1426
|
-
if ((!e || e === Rn) && (process.env.NODE_ENV !== "production" && !e &&
|
|
1439
|
+
if ((!e || e === Rn) && (process.env.NODE_ENV !== "production" && !e && j(`Invalid vnode type when creating vnode: ${e}.`), e = Vn), Tn(e)) {
|
|
1427
1440
|
const c = ie(
|
|
1428
1441
|
e,
|
|
1429
1442
|
t,
|
|
@@ -1434,11 +1447,11 @@ function pt(e, t = null, n = null, s = 0, r = null, i = !1) {
|
|
|
1434
1447
|
}
|
|
1435
1448
|
if (St(e) && (e = e.__vccOpts), t) {
|
|
1436
1449
|
t = kn(t);
|
|
1437
|
-
let { class: c, style:
|
|
1438
|
-
c && !
|
|
1450
|
+
let { class: c, style: a } = t;
|
|
1451
|
+
c && !C(c) && (t.class = Ce(c)), g(a) && (/* @__PURE__ */ U(a) && !p(a) && (a = P({}, a)), t.style = Ne(a));
|
|
1439
1452
|
}
|
|
1440
|
-
const o =
|
|
1441
|
-
return process.env.NODE_ENV !== "production" && o & 4 && /* @__PURE__ */ U(e) && (e = /* @__PURE__ */ h(e),
|
|
1453
|
+
const o = C(e) ? 1 : Dn(e) ? 128 : xn(e) ? 64 : g(e) ? 4 : I(e) ? 2 : 0;
|
|
1454
|
+
return process.env.NODE_ENV !== "production" && o & 4 && /* @__PURE__ */ U(e) && (e = /* @__PURE__ */ h(e), j(
|
|
1442
1455
|
"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`.",
|
|
1443
1456
|
`
|
|
1444
1457
|
Component that was made reactive: `,
|
|
@@ -1458,12 +1471,12 @@ function kn(e) {
|
|
|
1458
1471
|
return e ? /* @__PURE__ */ U(e) || ft(e) ? P({}, e) : e : null;
|
|
1459
1472
|
}
|
|
1460
1473
|
function ie(e, t, n = !1, s = !1) {
|
|
1461
|
-
const { props: r, ref: i, patchFlag: o, children: c, transition:
|
|
1474
|
+
const { props: r, ref: i, patchFlag: o, children: c, transition: a } = e, l = t ? Hn(r || {}, t) : r, d = {
|
|
1462
1475
|
__v_isVNode: !0,
|
|
1463
1476
|
__v_skip: !0,
|
|
1464
1477
|
type: e.type,
|
|
1465
|
-
props:
|
|
1466
|
-
key:
|
|
1478
|
+
props: l,
|
|
1479
|
+
key: l && dt(l),
|
|
1467
1480
|
ref: t && t.ref ? (
|
|
1468
1481
|
// #2078 in the case of <component :is="vnode" ref="extra"/>
|
|
1469
1482
|
// if the vnode itself already has a ref, cloneVNode will need to merge
|
|
@@ -1487,7 +1500,7 @@ function ie(e, t, n = !1, s = !1) {
|
|
|
1487
1500
|
dynamicChildren: e.dynamicChildren,
|
|
1488
1501
|
appContext: e.appContext,
|
|
1489
1502
|
dirs: e.dirs,
|
|
1490
|
-
transition:
|
|
1503
|
+
transition: a,
|
|
1491
1504
|
// These should technically only be non-null on mounted VNodes. However,
|
|
1492
1505
|
// they *should* be copied for kept-alive vnodes. So we just always copy
|
|
1493
1506
|
// them since them being non-null during a mount doesn't affect the logic as
|
|
@@ -1502,9 +1515,9 @@ function ie(e, t, n = !1, s = !1) {
|
|
|
1502
1515
|
ctx: e.ctx,
|
|
1503
1516
|
ce: e.ce
|
|
1504
1517
|
};
|
|
1505
|
-
return
|
|
1518
|
+
return a && s && lt(
|
|
1506
1519
|
d,
|
|
1507
|
-
|
|
1520
|
+
a.clone(d)
|
|
1508
1521
|
), d;
|
|
1509
1522
|
}
|
|
1510
1523
|
function _t(e) {
|
|
@@ -1538,13 +1551,13 @@ function oe(e, t) {
|
|
|
1538
1551
|
t = String(t), s & 64 ? (n = 16, t = [Kn(t)]) : n = 8;
|
|
1539
1552
|
e.children = t, e.shapeFlag |= n;
|
|
1540
1553
|
}
|
|
1541
|
-
function
|
|
1554
|
+
function Hn(...e) {
|
|
1542
1555
|
const t = {};
|
|
1543
1556
|
for (let n = 0; n < e.length; n++) {
|
|
1544
1557
|
const s = e[n];
|
|
1545
1558
|
for (const r in s)
|
|
1546
1559
|
if (r === "class")
|
|
1547
|
-
t.class !== s.class && (t.class =
|
|
1560
|
+
t.class !== s.class && (t.class = Ce([t.class, s.class]));
|
|
1548
1561
|
else if (r === "style")
|
|
1549
1562
|
t.style = Ne([t.style, s.style]);
|
|
1550
1563
|
else if (At(r)) {
|
|
@@ -1572,7 +1585,7 @@ function jn(...e) {
|
|
|
1572
1585
|
);
|
|
1573
1586
|
}
|
|
1574
1587
|
process.env.NODE_ENV;
|
|
1575
|
-
const
|
|
1588
|
+
const jn = /(?:^|[-_])\w/g, Ln = (e) => e.replace(jn, (t) => t.toUpperCase()).replace(/[-_]/g, "");
|
|
1576
1589
|
function gt(e, t = !0) {
|
|
1577
1590
|
return I(e) ? e.displayName || e.name : e.name || t && e.__name;
|
|
1578
1591
|
}
|
|
@@ -1608,9 +1621,9 @@ function Wn() {
|
|
|
1608
1621
|
if (u.__isVue)
|
|
1609
1622
|
return ["div", e, "VueInstance"];
|
|
1610
1623
|
if (/* @__PURE__ */ b(u)) {
|
|
1611
|
-
|
|
1624
|
+
ae();
|
|
1612
1625
|
const f = u.value;
|
|
1613
|
-
return
|
|
1626
|
+
return le(), [
|
|
1614
1627
|
"div",
|
|
1615
1628
|
{},
|
|
1616
1629
|
["span", e, d(u)],
|
|
@@ -1655,9 +1668,9 @@ function Wn() {
|
|
|
1655
1668
|
function i(u) {
|
|
1656
1669
|
const f = [];
|
|
1657
1670
|
u.type.props && u.props && f.push(o("props", /* @__PURE__ */ h(u.props))), u.setupState !== Se && f.push(o("setup", u.setupState)), u.data !== Se && f.push(o("data", /* @__PURE__ */ h(u.data)));
|
|
1658
|
-
const S =
|
|
1671
|
+
const S = a(u, "computed");
|
|
1659
1672
|
S && f.push(o("computed", S));
|
|
1660
|
-
const E =
|
|
1673
|
+
const E = a(u, "inject");
|
|
1661
1674
|
return E && f.push(o("injected", E)), f.push([
|
|
1662
1675
|
"div",
|
|
1663
1676
|
{},
|
|
@@ -1699,18 +1712,18 @@ function Wn() {
|
|
|
1699
1712
|
function c(u, f = !0) {
|
|
1700
1713
|
return typeof u == "number" ? ["span", t, u] : typeof u == "string" ? ["span", n, JSON.stringify(u)] : typeof u == "boolean" ? ["span", s, u] : g(u) ? ["object", { object: f ? /* @__PURE__ */ h(u) : u }] : ["span", n, String(u)];
|
|
1701
1714
|
}
|
|
1702
|
-
function
|
|
1715
|
+
function a(u, f) {
|
|
1703
1716
|
const S = u.type;
|
|
1704
1717
|
if (I(S))
|
|
1705
1718
|
return;
|
|
1706
1719
|
const E = {};
|
|
1707
1720
|
for (const L in u.ctx)
|
|
1708
|
-
|
|
1721
|
+
l(S, L, f) && (E[L] = u.ctx[L]);
|
|
1709
1722
|
return E;
|
|
1710
1723
|
}
|
|
1711
|
-
function
|
|
1724
|
+
function l(u, f, S) {
|
|
1712
1725
|
const E = u[S];
|
|
1713
|
-
if (p(E) && E.includes(f) || g(E) && f in E || u.extends &&
|
|
1726
|
+
if (p(E) && E.includes(f) || g(E) && f in E || u.extends && l(u.extends, f, S) || u.mixins && u.mixins.some((L) => l(L, f, S)))
|
|
1714
1727
|
return !0;
|
|
1715
1728
|
}
|
|
1716
1729
|
function d(u) {
|
|
@@ -1794,7 +1807,7 @@ function Zn(e, t) {
|
|
|
1794
1807
|
function sr(e) {
|
|
1795
1808
|
return Xn(e);
|
|
1796
1809
|
}
|
|
1797
|
-
class ir extends
|
|
1810
|
+
class ir extends He {
|
|
1798
1811
|
_className = "Store";
|
|
1799
1812
|
_onAction;
|
|
1800
1813
|
_options;
|
|
@@ -1824,6 +1837,10 @@ class ir extends je {
|
|
|
1824
1837
|
get store() {
|
|
1825
1838
|
return this._store;
|
|
1826
1839
|
}
|
|
1840
|
+
hydrate() {
|
|
1841
|
+
}
|
|
1842
|
+
afterHydration() {
|
|
1843
|
+
}
|
|
1827
1844
|
get storeSubscribe() {
|
|
1828
1845
|
if (this._storeSubscribe)
|
|
1829
1846
|
return () => ({
|
|
@@ -1906,7 +1923,7 @@ function cr(e, t) {
|
|
|
1906
1923
|
}
|
|
1907
1924
|
export {
|
|
1908
1925
|
wt as CustomConsole,
|
|
1909
|
-
|
|
1926
|
+
je as PLUGIN_NAME,
|
|
1910
1927
|
tr as PluginSubscriber,
|
|
1911
1928
|
Le as PluginSubscription,
|
|
1912
1929
|
ir as Store,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(p,F){typeof exports=="object"&&typeof module<"u"?F(exports,require("pinia")):typeof define=="function"&&define.amd?define(["exports","pinia"],F):(p=typeof globalThis<"u"?globalThis:p||self,F(p["pinia-plugin-subscription"]={},p.Pinia))})(this,(function(p,F){"use strict";class Nt{_console;_createInstance;_name;_pluginOptions;_storeInstance;_resetStoreCallback;_storeOnActionSubscription;_storeMutationSubscription;_subscriptions;pluginCreated;execution;hydrationScheduler;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 Fe{_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 pe="pinia-plugin-subscription",Ct=(e,t="white")=>`background-color: ${e}; color: ${t}; padding: 1px; margin-right: 5px; font-size: 12px`;function Rt(e,t){if(!e)throw new Error("Style instructions are required");console.log("%c%s",e,t.shift(),...t)}class ke{_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} ${pe}] - ${t} `}generateStyle(t){return Ct(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){Rt(this.generateStyle(t),this.rebuildArgs(n,t.icon))}}class xt extends ke{_pluginName=pe}const At=new xt;function X(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")}const Ke="PluginSubscription",Dt={environment:"both",hydration:"immediate"};function It(e){if(typeof window<"u"&&typeof window.requestAnimationFrame=="function"){window.requestAnimationFrame(()=>globalThis.setTimeout(e,0));return}globalThis.setTimeout(e,0)}function $t(e){return e!==void 0&&!Array.isArray(e)}class _e extends Fe{_className=Ke;_hydrationScheduler;_options;_pluginDebug;_resetStoreCallback=[];_subscribers=[];_subscribersDelivered=new Set;_subscribersScheduled=new Set;_subscriptions=[];_subscriptionsDelivered=new Set;_subscriptionsScheduled=new Set;set subscribers(t){this._subscribers=t}get subscriptions(){if(!X(this._subscriptions))return this._subscriptions}constructor(t,n,s){const r=Array.isArray(n)?n:void 0,i=$t(n)?n:s;super(Array.isArray(r)&&!!r?.includes(Ke),At),this._hydrationScheduler=i?.hydrationScheduler??It,this._options=i,this._pluginDebug=Array.isArray(r)?r:void 0,this._subscribers=t}addResetStoreCallback(t){this._resetStoreCallback.push(t)}defineCurrentEnvironment(){return this._options?.runtimeEnvironment??(typeof window>"u"?"server":"client")}definePluginDebug(t){return!!this._pluginDebug?.includes(t.name)}definePluginExecution(t){return{...Dt,...this._options?.execution??{},...t.execution??{},...this._options?.subscriberExecution?.[t.name]??{}}}defineHydrationScheduler(t){return t.hydrationScheduler??this._hydrationScheduler}defineSubscriberKey(t,n){return`${t.name}-${n.$id}`}defineSubscriptionKey(t,n){return`${t}-${n.$id}`}executeResetStoreCallbacks(t){this._resetStoreCallback.forEach(n=>n(t))}executeSubscriber(t,n){const s=this.defineSubscriberKey(n,t.store);this._subscribersDelivered.has(s)||n.invoke(t,this.definePluginDebug(n))&&(this._subscribersDelivered.add(s),n.subscriptions&&this.subscriptionDelivery(t,n.subscriptions),n.storeMutationSubscription&&this.storeMutationSubscription(n.storeMutationSubscription),n.storeOnActionSubscription&&this.storeOnActionSubscription(n.storeOnActionSubscription),n.resetStoreCallback&&this.addResetStoreCallback(n.resetStoreCallback))}executeSubscriberSafely(t,n){try{this.executeSubscriber(t,n)}catch(s){this.logError(s,t.store,t.options)}}queueSubscriberExecution(t,n,s){const r=this.defineHydrationScheduler(n);this._subscribersScheduled.add(s),r(()=>{this._subscribersScheduled.delete(s),this.executeSubscriberSafely(t,n)})}shouldInvokePlugin(t){const n=this.defineCurrentEnvironment();return t.environment==="both"||t.environment===n}shouldScheduleAfterHydration(t){return this.defineCurrentEnvironment()==="client"&&t.hydration==="defer"}plugin({store:t,options:n}){if(this._subscribers.length){this.debugLog(`plugin() - ${t.$id}`,["subscriber:",this._subscribers,"store:",t,"options:",n]);try{this._subscribers.forEach(s=>{const r=this.defineSubscriberKey(s,t),i=this.definePluginExecution(s);if(!(this._subscribersDelivered.has(r)||this._subscribersScheduled.has(r))&&this.shouldInvokePlugin(i)){if(this.shouldScheduleAfterHydration(i)){this.queueSubscriberExecution({store:t,options:n},s,r);return}this.executeSubscriber({store:t,options:n},s)}}),this.rewriteResetStore({store:t},JSON.stringify(t.$state),Object.assign({},t))}catch(s){this.logError(s,t,n)}}}rewriteResetStore({store:t},n,s){t.$reset=()=>{this.debugLog("rewriteResetStore()",{initState:n,store:t,customStore:s}),this.executeResetStoreCallbacks(t),t.$patch(JSON.parse(n))}}storeOnActionSubscription(t){const{store:n,callback:s}=t();n.$onAction(({after:r,args:i,name:o})=>{this.debugLog(`storeOnActionSubscription ${n.$id}`,{after:r,args:i,name:o,store:n}),s({after:r,args:i,name:o})})}storeMutationSubscription(t){const{store:n,callback:s}=t();n.$subscribe(r=>{this.debugLog(`$subscribe ${n.$id}`,{mutation:r,store:n}),s(r)})}subscriptionDelivery(t,n){Object.entries(n).forEach(([s,r])=>{const i=this.defineSubscriptionKey(s,t.store),o=this.definePluginExecution(r.subscription);if(!(this._subscriptionsDelivered.has(i)||this._subscriptionsScheduled.has(i))&&this.shouldInvokePlugin(o)){if(this.shouldScheduleAfterHydration(o)){const c=this.defineHydrationScheduler(r.subscription);this._subscriptionsScheduled.add(i),c(()=>{this._subscriptionsScheduled.delete(i),this.subscriptionDeliverySafely(t,s,r)});return}this.subscriptionDeliverySafely(t,s,r)}})}subscriptionDeliverySafely({store:t,options:n},s,r){try{if(this._subscriptionsDelivered.has(this.defineSubscriptionKey(s,t)))return;const{subscription:i,subscriptionOptions:o,stores:c}=r;this.debugLog(`subscriptionDelivery() - store: ${t.$id}`,["pluginName:",s,"subscription:",i,"options:",r,"stores:",c]);const l={storeOptions:{...n?.storeOptions??{},...o}};i.invoke({store:t,options:{...n,...l}},this.debug),this._subscriptionsDelivered.add(this.defineSubscriptionKey(s,t)),X(c)||c?.forEach(a=>i.invoke({store:a,options:{...n,...l,...a?.storeOptions??{}}},this.debug))}catch(i){this.logError("subscriptionDelivery()",i,t,n)}}}function Vt(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ge=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const je=()=>{},Tt=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Pt=e=>e.startsWith("onUpdate:"),$=Object.assign,Mt=Object.prototype.hasOwnProperty,be=(e,t)=>Mt.call(e,t),_=Array.isArray,z=e=>He(e)==="[object Map]",A=e=>typeof e=="function",N=e=>typeof e=="string",V=e=>typeof e=="symbol",b=e=>e!==null&&typeof e=="object",Ft=Object.prototype.toString,He=e=>Ft.call(e),Le=e=>He(e).slice(8,-1),Z=e=>N(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,kt=(e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))})(e=>e.charAt(0).toUpperCase()+e.slice(1)),T=(e,t)=>!Object.is(e,t);let We;const ee=()=>We||(We=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Se(e){if(_(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=N(s)?Lt(s):Se(s);if(r)for(const i in r)t[i]=r[i]}return t}else if(N(e)||b(e))return e}const Kt=/;(?![^(]*\))/g,jt=/:([^]+)/,Ht=/\/\*[^]*?\*\//g;function Lt(e){const t={};return e.replace(Ht,"").split(Kt).forEach(n=>{if(n){const s=n.split(jt);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function me(e){let t="";if(N(e))t=e;else if(_(e))for(let n=0;n<e.length;n++){const s=me(e[n]);s&&(t+=s+" ")}else if(b(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function k(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let Wt,ze=0,ye;function Ee(){ze++}function we(){if(--ze>0)return;let e;for(;ye;){let t=ye;for(ye=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}let te=!0;const qe=[];function ne(){qe.push(te),te=!1}function re(){const e=qe.pop();te=e===void 0?!0:e}class Ue{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){Ee();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($({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{we()}}}const se=new WeakMap,P=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Oe=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),q=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function g(e,t,n){if(te&&Wt){let s=se.get(e);s||se.set(e,s=new Map);let r=s.get(n);r||(s.set(n,r=new Ue),r.map=s,r.key=n),process.env.NODE_ENV!=="production"?r.track({target:e,type:t,key:n}):r.track()}}function D(e,t,n,s,r,i){const o=se.get(e);if(!o)return;const c=l=>{l&&(process.env.NODE_ENV!=="production"?l.trigger({target:e,type:t,key:n,newValue:s,oldValue:r,oldTarget:i}):l.trigger())};if(Ee(),t==="clear")o.forEach(c);else{const l=_(e),a=l&&Z(n);if(l&&n==="length"){const h=Number(s);o.forEach((u,f)=>{(f==="length"||f===q||!V(f)&&f>=h)&&c(u)})}else switch((n!==void 0||o.has(void 0))&&c(o.get(n)),a&&c(o.get(q)),t){case"add":l?a&&c(o.get("length")):(c(o.get(P)),z(e)&&c(o.get(Oe)));break;case"delete":l||(c(o.get(P)),z(e)&&c(o.get(Oe)));break;case"set":z(e)&&c(o.get(P));break}}we()}function zt(e,t){const n=se.get(e);return n&&n.get(t)}function K(e){const t=d(e);return t===e?t:(g(t,"iterate",q),m(e)?t:t.map(R))}function ve(e){return g(e=d(e),"iterate",q),e}function w(e,t){return O(e)?J(Ae(e)?R(t):t):R(t)}const qt={__proto__:null,[Symbol.iterator](){return Ne(this,Symbol.iterator,e=>w(this,e))},concat(...e){return K(this).concat(...e.map(t=>_(t)?K(t):t))},entries(){return Ne(this,"entries",e=>(e[1]=w(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=>w(this,s)),arguments)},find(e,t){return C(this,"find",e,t,n=>w(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=>w(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 Ce(this,"includes",e)},indexOf(...e){return Ce(this,"indexOf",e)},join(e){return K(this).join(e)},lastIndexOf(...e){return Ce(this,"lastIndexOf",e)},map(e,t){return C(this,"map",e,t,void 0,arguments)},pop(){return U(this,"pop")},push(...e){return U(this,"push",e)},reduce(e,...t){return Be(this,"reduce",e,t)},reduceRight(e,...t){return Be(this,"reduceRight",e,t)},shift(){return U(this,"shift")},some(e,t){return C(this,"some",e,t,void 0,arguments)},splice(...e){return U(this,"splice",e)},toReversed(){return K(this).toReversed()},toSorted(e){return K(this).toSorted(e)},toSpliced(...e){return K(this).toSpliced(...e)},unshift(...e){return U(this,"unshift",e)},values(){return Ne(this,"values",e=>w(this,e))}};function Ne(e,t,n){const s=ve(e),r=s[t]();return s!==e&&!m(e)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.done||(i.value=n(i.value)),i}),r}const Ut=Array.prototype;function C(e,t,n,s,r,i){const o=ve(e),c=o!==e&&!m(e),l=o[t];if(l!==Ut[t]){const u=l.apply(e,i);return c?R(u):u}let a=n;o!==e&&(c?a=function(u,f){return n.call(this,w(e,u),f,e)}:n.length>2&&(a=function(u,f){return n.call(this,u,f,e)}));const h=l.call(o,a,s);return c&&r?r(h):h}function Be(e,t,n,s){const r=ve(e),i=r!==e&&!m(e);let o=n,c=!1;r!==e&&(i?(c=s.length===0,o=function(a,h,u){return c&&(c=!1,a=w(e,a)),n.call(this,a,w(e,h),u,e)}):n.length>3&&(o=function(a,h,u){return n.call(this,a,h,u,e)}));const l=r[t](o,...s);return c?w(e,l):l}function Ce(e,t,n){const s=d(e);g(s,"iterate",q);const r=s[t](...n);return(r===-1||r===!1)&&B(n[0])?(n[0]=d(n[0]),s[t](...n)):r}function U(e,t,n=[]){ne(),Ee();const s=d(e)[t].apply(e,n);return we(),re(),s}const Bt=Vt("__proto__,__v_isRef,__isVue"),Je=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(V));function Jt(e){V(e)||(e=String(e));const t=d(this);return g(t,"has",e),t.hasOwnProperty(e)}class Ye{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,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(r?i?sn:Ze:i?rn:Xe).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=_(t);if(!r){let l;if(o&&(l=qt[n]))return l;if(n==="hasOwnProperty")return Jt}const c=Reflect.get(t,n,S(t)?t:s);if((V(n)?Je.has(n):Bt(n))||(r||g(t,"get",n),i))return c;if(S(c)){const l=o&&Z(n)?c:c.value;return r&&b(l)?xe(l):l}return b(c)?r?xe(c):et(c):c}}class Yt extends Ye{constructor(t=!1){super(!1,t)}set(t,n,s,r){let i=t[n];const o=_(t)&&Z(n);if(!this._isShallow){const a=O(i);if(!m(s)&&!O(s)&&(i=d(i),s=d(s)),!o&&S(i)&&!S(s))return a?(process.env.NODE_ENV!=="production"&&k(`Set operation on key "${String(n)}" failed: target is readonly.`,t[n]),!0):(i.value=s,!0)}const c=o?Number(n)<t.length:be(t,n),l=Reflect.set(t,n,s,S(t)?t:r);return t===d(r)&&l&&(c?T(s,i)&&D(t,"set",n,s,i):D(t,"add",n,s)),l}deleteProperty(t,n){const s=be(t,n),r=t[n],i=Reflect.deleteProperty(t,n);return i&&s&&D(t,"delete",n,void 0,r),i}has(t,n){const s=Reflect.has(t,n);return(!V(n)||!Je.has(n))&&g(t,"has",n),s}ownKeys(t){return g(t,"iterate",_(t)?"length":P),Reflect.ownKeys(t)}}class Gt extends Ye{constructor(t=!1){super(!0,t)}set(t,n){return process.env.NODE_ENV!=="production"&&k(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return process.env.NODE_ENV!=="production"&&k(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const Qt=new Yt,Xt=new Gt,Re=e=>e,ie=e=>Reflect.getPrototypeOf(e);function Zt(e,t,n){return function(...s){const r=this.__v_raw,i=d(r),o=z(i),c=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,a=r[e](...s),h=n?Re:t?J:R;return!t&&g(i,"iterate",l?Oe:P),$(Object.create(a),{next(){const{value:u,done:f}=a.next();return f?{value:u,done:f}:{value:c?[h(u[0]),h(u[1])]:h(u),done:f}}})}}function oe(e){return function(...t){if(process.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";k(`${kt(e)} operation ${n}failed: target is readonly.`,d(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function en(e,t){const n={get(r){const i=this.__v_raw,o=d(i),c=d(r);e||(T(r,c)&&g(o,"get",r),g(o,"get",c));const{has:l}=ie(o),a=t?Re:e?J:R;if(l.call(o,r))return a(i.get(r));if(l.call(o,c))return a(i.get(c));i!==o&&i.get(r)},get size(){const r=this.__v_raw;return!e&&g(d(r),"iterate",P),r.size},has(r){const i=this.__v_raw,o=d(i),c=d(r);return e||(T(r,c)&&g(o,"has",r),g(o,"has",c)),r===c?i.has(r):i.has(r)||i.has(c)},forEach(r,i){const o=this,c=o.__v_raw,l=d(c),a=t?Re:e?J:R;return!e&&g(l,"iterate",P),c.forEach((h,u)=>r.call(i,a(h),a(u),o))}};return $(n,e?{add:oe("add"),set:oe("set"),delete:oe("delete"),clear:oe("clear")}:{add(r){const i=d(this),o=ie(i),c=d(r),l=!t&&!m(r)&&!O(r)?c:r;return o.has.call(i,l)||T(r,l)&&o.has.call(i,r)||T(c,l)&&o.has.call(i,c)||(i.add(l),D(i,"add",l,l)),this},set(r,i){!t&&!m(i)&&!O(i)&&(i=d(i));const o=d(this),{has:c,get:l}=ie(o);let a=c.call(o,r);a?process.env.NODE_ENV!=="production"&&Qe(o,c,r):(r=d(r),a=c.call(o,r));const h=l.call(o,r);return o.set(r,i),a?T(i,h)&&D(o,"set",r,i,h):D(o,"add",r,i),this},delete(r){const i=d(this),{has:o,get:c}=ie(i);let l=o.call(i,r);l?process.env.NODE_ENV!=="production"&&Qe(i,o,r):(r=d(r),l=o.call(i,r));const a=c?c.call(i,r):void 0,h=i.delete(r);return l&&D(i,"delete",r,void 0,a),h},clear(){const r=d(this),i=r.size!==0,o=process.env.NODE_ENV!=="production"?z(r)?new Map(r):new Set(r):void 0,c=r.clear();return i&&D(r,"clear",void 0,void 0,o),c}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=Zt(r,e,t)}),n}function Ge(e,t){const n=en(e,t);return(s,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(be(n,r)&&r in s?n:s,r,i)}const tn={get:Ge(!1,!1)},nn={get:Ge(!0,!1)};function Qe(e,t,n){const s=d(n);if(s!==n&&t.call(e,s)){const r=Le(e);k(`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 Xe=new WeakMap,rn=new WeakMap,Ze=new WeakMap,sn=new WeakMap;function on(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function et(e){return O(e)?e:tt(e,!1,Qt,tn,Xe)}function xe(e){return tt(e,!0,Xt,nn,Ze)}function tt(e,t,n,s,r){if(!b(e))return process.env.NODE_ENV!=="production"&&k(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=r.get(e);if(i)return i;const o=on(Le(e));if(o===0)return e;const c=new Proxy(e,o===2?s:n);return r.set(e,c),c}function Ae(e){return O(e)?Ae(e.__v_raw):!!(e&&e.__v_isReactive)}function O(e){return!!(e&&e.__v_isReadonly)}function m(e){return!!(e&&e.__v_isShallow)}function B(e){return e?!!e.__v_raw:!1}function d(e){const t=e&&e.__v_raw;return t?d(t):e}const R=e=>b(e)?et(e):e,J=e=>b(e)?xe(e):e;function S(e){return e?e.__v_isRef===!0:!1}function nt(e){return cn(e,!1)}function cn(e,t){return S(e)?e:new un(e,t)}class un{constructor(t,n){this.dep=new Ue,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:d(t),this._value=n?t:R(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||m(t)||O(t);t=s?t:d(t),T(t,n)&&(this._rawValue=t,this._value=s?t:R(t),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:n}):this.dep.trigger())}}function ln(e){return S(e)?e.value:e}class an{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=V(n)?n:String(n),this._raw=d(t);let r=!0,i=t;if(!_(t)||V(this._key)||!Z(this._key))do r=!B(i)||m(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let t=this._object[this._key];return this._shallow&&(t=ln(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&S(this._raw[this._key])){const n=this._object[this._key];if(S(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return zt(this._raw,this._key)}}class fn{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 dn(e,t,n){return S(e)?e:A(e)?new fn(e):b(e)&&arguments.length>1?hn(e,t,n):nt(e)}function hn(e,t,n){return new an(e,t,n)}const M=[];function pn(e){M.push(e)}function _n(){M.pop()}let De=!1;function j(e,...t){if(De)return;De=!0,ne();const n=M.length?M[M.length-1].component:null,s=n&&n.appContext.config.warnHandler,r=gn();if(s)Ie(s,n,11,[e+t.map(i=>{var o,c;return(c=(o=i.toString)==null?void 0:o.call(i))!=null?c:JSON.stringify(i)}).join(""),n&&n.proxy,r.map(({vnode:i})=>`at <${St(n,i.type)}>`).join(`
|
|
1
|
+
(function(p,F){typeof exports=="object"&&typeof module<"u"?F(exports,require("pinia")):typeof define=="function"&&define.amd?define(["exports","pinia"],F):(p=typeof globalThis<"u"?globalThis:p||self,F(p["pinia-plugin-subscription"]={},p.Pinia))})(this,(function(p,F){"use strict";class Nt{_console;_createInstance;_name;_pluginOptions;_storeInstance;_resetStoreCallback;_storeOnActionSubscription;_storeMutationSubscription;_subscriptions;pluginCreated;execution;hydrationScheduler;get console(){return this._console??console}get name(){return this._name}get storeInstance(){return this._storeInstance}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)}hydrate(t,n){}afterHydration(t,n){}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 Fe{_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 pe="pinia-plugin-subscription",Ct=(e,t="white")=>`background-color: ${e}; color: ${t}; padding: 1px; margin-right: 5px; font-size: 12px`;function Rt(e,t){if(!e)throw new Error("Style instructions are required");console.log("%c%s",e,t.shift(),...t)}class ke{_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} ${pe}] - ${t} `}generateStyle(t){return Ct(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){Rt(this.generateStyle(t),this.rebuildArgs(n,t.icon))}}class At extends ke{_pluginName=pe}const xt=new At;function X(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")}const Ke="PluginSubscription",It={environment:"both",hydration:"immediate"};function Dt(e){if(typeof window<"u"&&typeof window.requestAnimationFrame=="function"){window.requestAnimationFrame(()=>globalThis.setTimeout(e,0));return}globalThis.setTimeout(e,0)}function $t(e){return e!==void 0&&!Array.isArray(e)}class _e extends Fe{_className=Ke;_hydrationScheduler;_options;_pluginDebug;_resetStoreCallback=[];_subscribers=[];_subscribersDelivered=new Set;_subscribersScheduled=new Set;_subscriptions=[];_subscriptionsDelivered=new Set;_subscriptionsScheduled=new Set;set subscribers(t){this._subscribers=t}get subscriptions(){if(!X(this._subscriptions))return this._subscriptions}constructor(t,n,s){const r=Array.isArray(n)?n:void 0,i=$t(n)?n:s;super(Array.isArray(r)&&!!r?.includes(Ke),xt),this._hydrationScheduler=i?.hydrationScheduler??Dt,this._options=i,this._pluginDebug=Array.isArray(r)?r:void 0,this._subscribers=t}addResetStoreCallback(t){this._resetStoreCallback.push(t)}defineCurrentEnvironment(){return this._options?.runtimeEnvironment??(typeof window>"u"?"server":"client")}definePluginDebug(t){return!!this._pluginDebug?.includes(t.name)}definePluginExecution(t){return{...It,...this._options?.execution??{},...t.execution??{},...this._options?.subscriberExecution?.[t.name]??{}}}defineHydrationScheduler(t){return t.hydrationScheduler??this._hydrationScheduler}defineSubscriberKey(t,n){return`${t.name}-${n.$id}`}defineSubscriptionKey(t,n){return`${t}-${n.$id}`}executeResetStoreCallbacks(t){this._resetStoreCallback.forEach(n=>n(t))}executeSubscriber(t,n){const s=this.defineSubscriberKey(n,t.store),r=this.definePluginDebug(n);if(this._subscribersDelivered.has(s)||!n.invoke(t,r))return;this._subscribersDelivered.add(s);const i=n.hydrate?.(t,r);i&&typeof i.then=="function"&&i.catch(c=>this.logError(c,t.store,t.options));const o=n.afterHydration?.(t,r);o&&typeof o.then=="function"&&o.catch(c=>this.logError(c,t.store,t.options)),n.subscriptions&&this.subscriptionDelivery(t,n.subscriptions),n.storeMutationSubscription&&this.storeMutationSubscription(n.storeMutationSubscription),n.storeOnActionSubscription&&this.storeOnActionSubscription(n.storeOnActionSubscription),n.resetStoreCallback&&this.addResetStoreCallback(n.resetStoreCallback)}executeSubscriberSafely(t,n){try{this.executeSubscriber(t,n)}catch(s){this.logError(s,t.store,t.options)}}queueSubscriberExecution(t,n,s){const r=this.defineHydrationScheduler(n);this._subscribersScheduled.add(s),r(()=>{this._subscribersScheduled.delete(s),this.executeSubscriberSafely(t,n)})}shouldInvokePlugin(t){const n=this.defineCurrentEnvironment();return t.environment==="both"||t.environment===n}shouldScheduleAfterHydration(t){return this.defineCurrentEnvironment()==="client"&&t.hydration==="defer"}plugin({store:t,options:n}){if(this._subscribers.length){this.debugLog(`plugin() - ${t.$id}`,["subscriber:",this._subscribers,"store:",t,"options:",n]);try{this._subscribers.forEach(s=>{const r=this.defineSubscriberKey(s,t),i=this.definePluginExecution(s);if(!(this._subscribersDelivered.has(r)||this._subscribersScheduled.has(r))&&this.shouldInvokePlugin(i)){if(this.shouldScheduleAfterHydration(i)){this.queueSubscriberExecution({store:t,options:n},s,r);return}this.executeSubscriber({store:t,options:n},s)}}),this.rewriteResetStore({store:t},JSON.stringify(t.$state),Object.assign({},t))}catch(s){this.logError(s,t,n)}}}rewriteResetStore({store:t},n,s){t.$reset=()=>{this.debugLog("rewriteResetStore()",{initState:n,store:t,customStore:s}),this.executeResetStoreCallbacks(t),t.$patch(JSON.parse(n))}}storeOnActionSubscription(t){const{store:n,callback:s}=t();n.$onAction(({after:r,args:i,name:o})=>{this.debugLog(`storeOnActionSubscription ${n.$id}`,{after:r,args:i,name:o,store:n}),s({after:r,args:i,name:o})})}storeMutationSubscription(t){const{store:n,callback:s}=t();n.$subscribe(r=>{this.debugLog(`$subscribe ${n.$id}`,{mutation:r,store:n}),s(r)})}subscriptionDelivery(t,n){Object.entries(n).forEach(([s,r])=>{const i=this.defineSubscriptionKey(s,t.store),o=this.definePluginExecution(r.subscription);if(!(this._subscriptionsDelivered.has(i)||this._subscriptionsScheduled.has(i))&&this.shouldInvokePlugin(o)){if(this.shouldScheduleAfterHydration(o)){const c=this.defineHydrationScheduler(r.subscription);this._subscriptionsScheduled.add(i),c(()=>{this._subscriptionsScheduled.delete(i),this.subscriptionDeliverySafely(t,s,r)});return}this.subscriptionDeliverySafely(t,s,r)}})}subscriptionDeliverySafely({store:t,options:n},s,r){try{if(this._subscriptionsDelivered.has(this.defineSubscriptionKey(s,t)))return;const{subscription:i,subscriptionOptions:o,stores:c}=r;this.debugLog(`subscriptionDelivery() - store: ${t.$id}`,["pluginName:",s,"subscription:",i,"options:",r,"stores:",c]);const a={storeOptions:{...n?.storeOptions??{},...o}};i.invoke({store:t,options:{...n,...a}},this.debug),this._subscriptionsDelivered.add(this.defineSubscriptionKey(s,t)),X(c)||c?.forEach(l=>i.invoke({store:l,options:{...n,...a,...l?.storeOptions??{}}},this.debug))}catch(i){this.logError("subscriptionDelivery()",i,t,n)}}}function Vt(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ge=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const He=()=>{},Tt=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Pt=e=>e.startsWith("onUpdate:"),$=Object.assign,Mt=Object.prototype.hasOwnProperty,be=(e,t)=>Mt.call(e,t),_=Array.isArray,z=e=>je(e)==="[object Map]",x=e=>typeof e=="function",N=e=>typeof e=="string",V=e=>typeof e=="symbol",b=e=>e!==null&&typeof e=="object",Ft=Object.prototype.toString,je=e=>Ft.call(e),Le=e=>je(e).slice(8,-1),Z=e=>N(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,kt=(e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))})(e=>e.charAt(0).toUpperCase()+e.slice(1)),T=(e,t)=>!Object.is(e,t);let We;const ee=()=>We||(We=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Se(e){if(_(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=N(s)?Lt(s):Se(s);if(r)for(const i in r)t[i]=r[i]}return t}else if(N(e)||b(e))return e}const Kt=/;(?![^(]*\))/g,Ht=/:([^]+)/,jt=/\/\*[^]*?\*\//g;function Lt(e){const t={};return e.replace(jt,"").split(Kt).forEach(n=>{if(n){const s=n.split(Ht);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function ye(e){let t="";if(N(e))t=e;else if(_(e))for(let n=0;n<e.length;n++){const s=ye(e[n]);s&&(t+=s+" ")}else if(b(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function k(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let Wt,ze=0,me;function Ee(){ze++}function we(){if(--ze>0)return;let e;for(;me;){let t=me;for(me=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}let te=!0;const qe=[];function ne(){qe.push(te),te=!1}function re(){const e=qe.pop();te=e===void 0?!0:e}class Ue{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){Ee();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($({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{we()}}}const se=new WeakMap,P=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Oe=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),q=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function g(e,t,n){if(te&&Wt){let s=se.get(e);s||se.set(e,s=new Map);let r=s.get(n);r||(s.set(n,r=new Ue),r.map=s,r.key=n),process.env.NODE_ENV!=="production"?r.track({target:e,type:t,key:n}):r.track()}}function I(e,t,n,s,r,i){const o=se.get(e);if(!o)return;const c=a=>{a&&(process.env.NODE_ENV!=="production"?a.trigger({target:e,type:t,key:n,newValue:s,oldValue:r,oldTarget:i}):a.trigger())};if(Ee(),t==="clear")o.forEach(c);else{const a=_(e),l=a&&Z(n);if(a&&n==="length"){const h=Number(s);o.forEach((u,f)=>{(f==="length"||f===q||!V(f)&&f>=h)&&c(u)})}else switch((n!==void 0||o.has(void 0))&&c(o.get(n)),l&&c(o.get(q)),t){case"add":a?l&&c(o.get("length")):(c(o.get(P)),z(e)&&c(o.get(Oe)));break;case"delete":a||(c(o.get(P)),z(e)&&c(o.get(Oe)));break;case"set":z(e)&&c(o.get(P));break}}we()}function zt(e,t){const n=se.get(e);return n&&n.get(t)}function K(e){const t=d(e);return t===e?t:(g(t,"iterate",q),y(e)?t:t.map(R))}function ve(e){return g(e=d(e),"iterate",q),e}function w(e,t){return O(e)?J(xe(e)?R(t):t):R(t)}const qt={__proto__:null,[Symbol.iterator](){return Ne(this,Symbol.iterator,e=>w(this,e))},concat(...e){return K(this).concat(...e.map(t=>_(t)?K(t):t))},entries(){return Ne(this,"entries",e=>(e[1]=w(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=>w(this,s)),arguments)},find(e,t){return C(this,"find",e,t,n=>w(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=>w(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 Ce(this,"includes",e)},indexOf(...e){return Ce(this,"indexOf",e)},join(e){return K(this).join(e)},lastIndexOf(...e){return Ce(this,"lastIndexOf",e)},map(e,t){return C(this,"map",e,t,void 0,arguments)},pop(){return U(this,"pop")},push(...e){return U(this,"push",e)},reduce(e,...t){return Be(this,"reduce",e,t)},reduceRight(e,...t){return Be(this,"reduceRight",e,t)},shift(){return U(this,"shift")},some(e,t){return C(this,"some",e,t,void 0,arguments)},splice(...e){return U(this,"splice",e)},toReversed(){return K(this).toReversed()},toSorted(e){return K(this).toSorted(e)},toSpliced(...e){return K(this).toSpliced(...e)},unshift(...e){return U(this,"unshift",e)},values(){return Ne(this,"values",e=>w(this,e))}};function Ne(e,t,n){const s=ve(e),r=s[t]();return s!==e&&!y(e)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.done||(i.value=n(i.value)),i}),r}const Ut=Array.prototype;function C(e,t,n,s,r,i){const o=ve(e),c=o!==e&&!y(e),a=o[t];if(a!==Ut[t]){const u=a.apply(e,i);return c?R(u):u}let l=n;o!==e&&(c?l=function(u,f){return n.call(this,w(e,u),f,e)}:n.length>2&&(l=function(u,f){return n.call(this,u,f,e)}));const h=a.call(o,l,s);return c&&r?r(h):h}function Be(e,t,n,s){const r=ve(e),i=r!==e&&!y(e);let o=n,c=!1;r!==e&&(i?(c=s.length===0,o=function(l,h,u){return c&&(c=!1,l=w(e,l)),n.call(this,l,w(e,h),u,e)}):n.length>3&&(o=function(l,h,u){return n.call(this,l,h,u,e)}));const a=r[t](o,...s);return c?w(e,a):a}function Ce(e,t,n){const s=d(e);g(s,"iterate",q);const r=s[t](...n);return(r===-1||r===!1)&&B(n[0])?(n[0]=d(n[0]),s[t](...n)):r}function U(e,t,n=[]){ne(),Ee();const s=d(e)[t].apply(e,n);return we(),re(),s}const Bt=Vt("__proto__,__v_isRef,__isVue"),Je=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(V));function Jt(e){V(e)||(e=String(e));const t=d(this);return g(t,"has",e),t.hasOwnProperty(e)}class Ye{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,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(r?i?sn:Ze:i?rn:Xe).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=_(t);if(!r){let a;if(o&&(a=qt[n]))return a;if(n==="hasOwnProperty")return Jt}const c=Reflect.get(t,n,S(t)?t:s);if((V(n)?Je.has(n):Bt(n))||(r||g(t,"get",n),i))return c;if(S(c)){const a=o&&Z(n)?c:c.value;return r&&b(a)?Ae(a):a}return b(c)?r?Ae(c):et(c):c}}class Yt extends Ye{constructor(t=!1){super(!1,t)}set(t,n,s,r){let i=t[n];const o=_(t)&&Z(n);if(!this._isShallow){const l=O(i);if(!y(s)&&!O(s)&&(i=d(i),s=d(s)),!o&&S(i)&&!S(s))return l?(process.env.NODE_ENV!=="production"&&k(`Set operation on key "${String(n)}" failed: target is readonly.`,t[n]),!0):(i.value=s,!0)}const c=o?Number(n)<t.length:be(t,n),a=Reflect.set(t,n,s,S(t)?t:r);return t===d(r)&&a&&(c?T(s,i)&&I(t,"set",n,s,i):I(t,"add",n,s)),a}deleteProperty(t,n){const s=be(t,n),r=t[n],i=Reflect.deleteProperty(t,n);return i&&s&&I(t,"delete",n,void 0,r),i}has(t,n){const s=Reflect.has(t,n);return(!V(n)||!Je.has(n))&&g(t,"has",n),s}ownKeys(t){return g(t,"iterate",_(t)?"length":P),Reflect.ownKeys(t)}}class Gt extends Ye{constructor(t=!1){super(!0,t)}set(t,n){return process.env.NODE_ENV!=="production"&&k(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return process.env.NODE_ENV!=="production"&&k(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const Qt=new Yt,Xt=new Gt,Re=e=>e,ie=e=>Reflect.getPrototypeOf(e);function Zt(e,t,n){return function(...s){const r=this.__v_raw,i=d(r),o=z(i),c=e==="entries"||e===Symbol.iterator&&o,a=e==="keys"&&o,l=r[e](...s),h=n?Re:t?J:R;return!t&&g(i,"iterate",a?Oe:P),$(Object.create(l),{next(){const{value:u,done:f}=l.next();return f?{value:u,done:f}:{value:c?[h(u[0]),h(u[1])]:h(u),done:f}}})}}function oe(e){return function(...t){if(process.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";k(`${kt(e)} operation ${n}failed: target is readonly.`,d(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function en(e,t){const n={get(r){const i=this.__v_raw,o=d(i),c=d(r);e||(T(r,c)&&g(o,"get",r),g(o,"get",c));const{has:a}=ie(o),l=t?Re:e?J:R;if(a.call(o,r))return l(i.get(r));if(a.call(o,c))return l(i.get(c));i!==o&&i.get(r)},get size(){const r=this.__v_raw;return!e&&g(d(r),"iterate",P),r.size},has(r){const i=this.__v_raw,o=d(i),c=d(r);return e||(T(r,c)&&g(o,"has",r),g(o,"has",c)),r===c?i.has(r):i.has(r)||i.has(c)},forEach(r,i){const o=this,c=o.__v_raw,a=d(c),l=t?Re:e?J:R;return!e&&g(a,"iterate",P),c.forEach((h,u)=>r.call(i,l(h),l(u),o))}};return $(n,e?{add:oe("add"),set:oe("set"),delete:oe("delete"),clear:oe("clear")}:{add(r){const i=d(this),o=ie(i),c=d(r),a=!t&&!y(r)&&!O(r)?c:r;return o.has.call(i,a)||T(r,a)&&o.has.call(i,r)||T(c,a)&&o.has.call(i,c)||(i.add(a),I(i,"add",a,a)),this},set(r,i){!t&&!y(i)&&!O(i)&&(i=d(i));const o=d(this),{has:c,get:a}=ie(o);let l=c.call(o,r);l?process.env.NODE_ENV!=="production"&&Qe(o,c,r):(r=d(r),l=c.call(o,r));const h=a.call(o,r);return o.set(r,i),l?T(i,h)&&I(o,"set",r,i,h):I(o,"add",r,i),this},delete(r){const i=d(this),{has:o,get:c}=ie(i);let a=o.call(i,r);a?process.env.NODE_ENV!=="production"&&Qe(i,o,r):(r=d(r),a=o.call(i,r));const l=c?c.call(i,r):void 0,h=i.delete(r);return a&&I(i,"delete",r,void 0,l),h},clear(){const r=d(this),i=r.size!==0,o=process.env.NODE_ENV!=="production"?z(r)?new Map(r):new Set(r):void 0,c=r.clear();return i&&I(r,"clear",void 0,void 0,o),c}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=Zt(r,e,t)}),n}function Ge(e,t){const n=en(e,t);return(s,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(be(n,r)&&r in s?n:s,r,i)}const tn={get:Ge(!1,!1)},nn={get:Ge(!0,!1)};function Qe(e,t,n){const s=d(n);if(s!==n&&t.call(e,s)){const r=Le(e);k(`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 Xe=new WeakMap,rn=new WeakMap,Ze=new WeakMap,sn=new WeakMap;function on(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function et(e){return O(e)?e:tt(e,!1,Qt,tn,Xe)}function Ae(e){return tt(e,!0,Xt,nn,Ze)}function tt(e,t,n,s,r){if(!b(e))return process.env.NODE_ENV!=="production"&&k(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=r.get(e);if(i)return i;const o=on(Le(e));if(o===0)return e;const c=new Proxy(e,o===2?s:n);return r.set(e,c),c}function xe(e){return O(e)?xe(e.__v_raw):!!(e&&e.__v_isReactive)}function O(e){return!!(e&&e.__v_isReadonly)}function y(e){return!!(e&&e.__v_isShallow)}function B(e){return e?!!e.__v_raw:!1}function d(e){const t=e&&e.__v_raw;return t?d(t):e}const R=e=>b(e)?et(e):e,J=e=>b(e)?Ae(e):e;function S(e){return e?e.__v_isRef===!0:!1}function nt(e){return cn(e,!1)}function cn(e,t){return S(e)?e:new un(e,t)}class un{constructor(t,n){this.dep=new Ue,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:d(t),this._value=n?t:R(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||y(t)||O(t);t=s?t:d(t),T(t,n)&&(this._rawValue=t,this._value=s?t:R(t),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:n}):this.dep.trigger())}}function an(e){return S(e)?e.value:e}class ln{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=V(n)?n:String(n),this._raw=d(t);let r=!0,i=t;if(!_(t)||V(this._key)||!Z(this._key))do r=!B(i)||y(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let t=this._object[this._key];return this._shallow&&(t=an(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&S(this._raw[this._key])){const n=this._object[this._key];if(S(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return zt(this._raw,this._key)}}class fn{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 dn(e,t,n){return S(e)?e:x(e)?new fn(e):b(e)&&arguments.length>1?hn(e,t,n):nt(e)}function hn(e,t,n){return new ln(e,t,n)}const M=[];function pn(e){M.push(e)}function _n(){M.pop()}let Ie=!1;function H(e,...t){if(Ie)return;Ie=!0,ne();const n=M.length?M[M.length-1].component:null,s=n&&n.appContext.config.warnHandler,r=gn();if(s)De(s,n,11,[e+t.map(i=>{var o,c;return(c=(o=i.toString)==null?void 0:o.call(i))!=null?c:JSON.stringify(i)}).join(""),n&&n.proxy,r.map(({vnode:i})=>`at <${St(n,i.type)}>`).join(`
|
|
2
2
|
`),r]);else{const i=[`[Vue warn]: ${e}`,...t];r.length&&i.push(`
|
|
3
|
-
`,...bn(r)),console.warn(...i)}re(),
|
|
4
|
-
`],...Sn(n))}),t}function Sn({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",s=e.component?e.component.parent==null:!1,r=` at <${St(e.component,e.type,s)}`,i=">"+n;return e.props?[r,...
|
|
5
|
-
Component that was made reactive: `,e)),
|
|
3
|
+
`,...bn(r)),console.warn(...i)}re(),Ie=!1}function gn(){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 bn(e){const t=[];return e.forEach((n,s)=>{t.push(...s===0?[]:[`
|
|
4
|
+
`],...Sn(n))}),t}function Sn({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",s=e.component?e.component.parent==null:!1,r=` at <${St(e.component,e.type,s)}`,i=">"+n;return e.props?[r,...yn(e.props),i]:[r+i]}function yn(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(s=>{t.push(...rt(s,e[s]))}),n.length>3&&t.push(" ..."),t}function rt(e,t,n){return N(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:S(t)?(t=rt(e,d(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):x(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=d(t),n?t:[`${e}=`,t])}const st={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 De(e,t,n,s){try{return s?e(...s):e()}catch(r){it(r,t,n)}}function it(e,t,n,s=!0){const r=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||ge;if(t){let c=t.parent;const a=t.proxy,l=process.env.NODE_ENV!=="production"?st[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;c;){const h=c.ec;if(h){for(let u=0;u<h.length;u++)if(h[u](e,a,l)===!1)return}c=c.parent}if(i){ne(),De(i,null,10,[e,a,l]),re();return}}mn(e,n,r,s,o)}function mn(e,t,n,s=!0,r=!1){if(process.env.NODE_ENV!=="production"){const i=st[t];if(n&&pn(n),H(`Unhandled error${i?` during execution of ${i}`:""}`),n&&_n(),s)throw e;console.error(e)}else{if(r)throw e;console.error(e)}}const m=[];let A=-1;const j=[];let D=null,L=0;const En=Promise.resolve();let $e=null;const wn=100;function On(e){let t=A+1,n=m.length;for(;t<n;){const s=t+n>>>1,r=m[s],i=Y(r);i<e||i===e&&r.flags&2?t=s+1:n=s}return t}function vn(e){if(!(e.flags&1)){const t=Y(e),n=m[m.length-1];!n||!(e.flags&2)&&t>=Y(n)?m.push(e):m.splice(On(t),0,e),e.flags|=1,ot()}}function ot(){$e||($e=En.then(ct))}function Nn(e){_(e)?j.push(...e):D&&e.id===-1?D.splice(L+1,0,e):e.flags&1||(j.push(e),e.flags|=1),ot()}function Cn(e){if(j.length){const t=[...new Set(j)].sort((n,s)=>Y(n)-Y(s));if(j.length=0,D){D.push(...t);return}for(D=t,process.env.NODE_ENV!=="production"&&(e=e||new Map),L=0;L<D.length;L++){const n=D[L];process.env.NODE_ENV!=="production"&&ut(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}D=null,L=0}}const Y=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ct(e){process.env.NODE_ENV!=="production"&&(e=e||new Map);const t=process.env.NODE_ENV!=="production"?n=>ut(e,n):He;try{for(A=0;A<m.length;A++){const n=m[A];if(n&&!(n.flags&8)){if(process.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),De(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;A<m.length;A++){const n=m[A];n&&(n.flags&=-2)}A=-1,m.length=0,Cn(e),$e=null,(m.length||j.length)&&ct(e)}}function ut(e,t){const n=e.get(t)||0;if(n>wn){const s=t.i,r=s&&bt(s.type);return it(`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 Ve=new Map;process.env.NODE_ENV!=="production"&&(ee().__VUE_HMR_RUNTIME__={createRecord:Te(Rn),rerender:Te(An),reload:Te(xn)});const ce=new Map;function Rn(e,t){return ce.has(e)?!1:(ce.set(e,{initialDef:ue(t),instances:new Set}),!0)}function ue(e){return yt(e)?e.__vccOpts:e}function An(e,t){const n=ce.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(s=>{t&&(s.render=t,ue(s.type).render=t),s.renderCache=[],s.job.flags&8||s.update()}))}function xn(e,t){const n=ce.get(e);if(!n)return;t=ue(t),at(n.initialDef,t);const s=[...n.instances];for(let r=0;r<s.length;r++){const i=s[r],o=ue(i.type);let c=Ve.get(o);c||(o!==n.initialDef&&at(o,t),Ve.set(o,c=new Set)),c.add(i),i.appContext.propsCache.delete(i.type),i.appContext.emitsCache.delete(i.type),i.appContext.optionsCache.delete(i.type),i.ceReload?(c.add(i),i.ceReload(t.styles),c.delete(i)):i.parent?vn(()=>{i.job.flags&8||(i.parent.update(),c.delete(i))}):i.appContext.reload?i.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),i.root.ce&&i!==i.root&&i.root.ce._removeChildStyle(o)}Nn(()=>{Ve.clear()})}function at(e,t){$(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function Te(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 W,ae=[];function lt(e,t){var n,s;W=e,W?(W.enabled=!0,ae.forEach(({event:r,args:i})=>W.emit(r,...i)),ae=[]):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(i=>{lt(i,t)}),setTimeout(()=>{W||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ae=[])},3e3)):ae=[]}let le=null,In=null;const Dn=e=>e.__isTeleport;function ft(e,t){e.shapeFlag&6&&e.component?(e.transition=t,ft(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}ee().requestIdleCallback,ee().cancelIdleCallback;const $n=Symbol.for("v-ndc"),Vn={};process.env.NODE_ENV!=="production"&&(Vn.ownKeys=e=>(H("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 Tn={},dt=e=>Object.getPrototypeOf(e)===Tn,Pn=e=>e.__isSuspense,ht=Symbol.for("v-fgt"),Mn=Symbol.for("v-txt"),Fn=Symbol.for("v-cmt");function kn(e){return e?e.__v_isVNode===!0:!1}const Kn=(...e)=>_t(...e),pt=({key:e})=>e??null,fe=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?N(e)||S(e)||x(e)?{i:le,r:e,k:t,f:!!n}:e:null);function Hn(e,t=null,n=null,s=0,r=null,i=e===ht?0:1,o=!1,c=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&pt(t),ref:t&&fe(t),scopeId:In,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:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:le};return c?(he(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=N(n)?8:16),process.env.NODE_ENV!=="production"&&a.key!==a.key&&H("VNode created with invalid key (NaN). VNode type:",a.type),a}const jn=process.env.NODE_ENV!=="production"?Kn:_t;function _t(e,t=null,n=null,s=0,r=null,i=!1){if((!e||e===$n)&&(process.env.NODE_ENV!=="production"&&!e&&H(`Invalid vnode type when creating vnode: ${e}.`),e=Fn),kn(e)){const c=de(e,t,!0);return n&&he(c,n),c.patchFlag=-2,c}if(yt(e)&&(e=e.__vccOpts),t){t=Ln(t);let{class:c,style:a}=t;c&&!N(c)&&(t.class=ye(c)),b(a)&&(B(a)&&!_(a)&&(a=$({},a)),t.style=Se(a))}const o=N(e)?1:Pn(e)?128:Dn(e)?64:b(e)?4:x(e)?2:0;return process.env.NODE_ENV!=="production"&&o&4&&B(e)&&(e=d(e),H("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)),Hn(e,t,n,s,r,o,i,!0)}function Ln(e){return e?B(e)||dt(e)?$({},e):e:null}function de(e,t,n=!1,s=!1){const{props:r,ref:i,patchFlag:o,children:c,transition:a}=e,l=t?zn(r||{},t):r,h={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&pt(l),ref:t&&t.ref?n&&i?_(i)?i.concat(fe(t)):[i,fe(t)]:fe(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&o===-1&&_(c)?c.map(gt):c,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ht?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&de(e.ssContent),ssFallback:e.ssFallback&&de(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&ft(h,a.clone(h)),h}function gt(e){const t=de(e);return _(e.children)&&(t.children=e.children.map(gt)),t}function Wn(e=" ",t=0){return jn(Mn,null,e,t)}function he(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(_(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),he(e,r()),r._c&&(r._d=!0));return}else n=32,!t._&&!dt(t)&&(t._ctx=le);else if(x(t)){if(s&65){he(e,{default:t});return}t={default:t,_ctx:le},n=32}else t=String(t),s&64?(n=16,t=[Wn(t)]):n=8;e.children=t,e.shapeFlag|=n}function zn(...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=ye([t.class,s.class]));else if(r==="style")t.style=Se([t.style,s.style]);else if(Tt(r)){const i=t[r],o=s[r];o&&i!==o&&!(_(i)&&i.includes(o))?t[r]=i?[].concat(i,o):o:o==null&&i==null&&!Pt(r)&&(t[r]=o)}else r!==""&&(t[r]=s[r])}return t}{const e=ee(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),i=>{r.length>1?r.forEach(o=>o(i)):r[0](i)}};t("__VUE_INSTANCE_SETTERS__",n=>n),t("__VUE_SSR_SETTERS__",n=>n)}process.env.NODE_ENV;const qn=/(?:^|[-_])\w/g,Un=e=>e.replace(qn,t=>t.toUpperCase()).replace(/[-_]/g,"");function bt(e,t=!0){return x(e)?e.displayName||e.name:e.name||t&&e.__name}function St(e,t,n=!1){let s=bt(t);if(!s&&t.__file){const r=t.__file.match(/([^/\\]+)\.\w+$/);r&&(s=r[1])}if(!s&&e){const r=i=>{for(const o in i)if(i[o]===t)return o};s=r(e.components)||e.parent&&r(e.parent.type.components)||r(e.appContext.components)}return s?Un(s):n?"App":"Anonymous"}function yt(e){return x(e)&&"__vccOpts"in e}function Bn(){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(u){if(!b(u))return null;if(u.__isVue)return["div",e,"VueInstance"];if(S(u)){ne();const f=u.value;return re(),["div",{},["span",e,h(u)],"<",c(f),">"]}else{if(xe(u))return["div",{},["span",e,y(u)?"ShallowReactive":"Reactive"],"<",c(u),`>${O(u)?" (readonly)":""}`];if(O(u))return["div",{},["span",e,y(u)?"ShallowReadonly":"Readonly"],"<",c(u),">"]}return null},hasBody(u){return u&&u.__isVue},body(u){if(u&&u.__isVue)return["div",{},...i(u.$)]}};function i(u){const f=[];u.type.props&&u.props&&f.push(o("props",d(u.props))),u.setupState!==ge&&f.push(o("setup",u.setupState)),u.data!==ge&&f.push(o("data",d(u.data)));const E=a(u,"computed");E&&f.push(o("computed",E));const v=a(u,"inject");return v&&f.push(o("injected",v)),f.push(["div",{},["span",{style:s.style+";opacity:0.66"},"$ (internal): "],["object",{object:u}]]),f}function o(u,f){return f=$({},f),Object.keys(f).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},u],["div",{style:"padding-left:1.25em"},...Object.keys(f).map(E=>["div",{},["span",s,E+": "],c(f[E],!1)])]]:["span",{}]}function c(u,f=!0){return typeof u=="number"?["span",t,u]:typeof u=="string"?["span",n,JSON.stringify(u)]:typeof u=="boolean"?["span",s,u]:b(u)?["object",{object:f?d(u):u}]:["span",n,String(u)]}function a(u,f){const E=u.type;if(x(E))return;const v={};for(const Q in u.ctx)l(E,Q,f)&&(v[Q]=u.ctx[Q]);return v}function l(u,f,E){const v=u[E];if(_(v)&&v.includes(f)||b(v)&&f in v||u.extends&&l(u.extends,f,E)||u.mixins&&u.mixins.some(Q=>l(Q,f,E)))return!0}function h(u){return y(u)?"ShallowRef":u.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 Jn(){Bn()}process.env.NODE_ENV!=="production"&&Jn();const Pe=new WeakMap,G=new Map,mt=new WeakSet,Yn=50;function Gn(e){return e?.storeOptions?.debug===!0}function Me(e,t,n){if(!Gn(t))return;const s=G.size;console.debug(`[defineAStoreSetup] ${e} - ${n} (contextsById=${s})`),s>=Yn&&console.warn(`[defineAStoreSetup] contextsById reached ${s} entries`)}function Qn(e,t,n){if(mt.has(e)||typeof e.$dispose!="function")return;const s=e.$dispose;e.$dispose=(...r)=>(Pe.delete(e),G.delete(t),Me(t,n,"dispose cleanup"),s.apply(e,r)),mt.add(e)}function Xn(e,t,n){const s=n?{storeOptions:n}:{};return typeof t=="function"?Et(e,t,s):er(e,t,s)}function Zn(e,t,n){const s=n?{storeOptions:{...n,enhancedStore:!0}}:{storeOptions:{enhancedStore:!0}};return Et(e,t,s)}function Et(e,t,n){const s={id:e,extensions:{}},r=n?.storeOptions?.enhancedStore===!0,i=F.defineStore(e,()=>t(s),n);return Object.assign(((...o)=>{r&&(G.set(e,s),Me(e,n,"registered context by id"));const c=i(...o);return r&&(Pe.set(c,s),G.delete(e),Me(e,n,"moved context to weak map"),Qn(c,e,n)),c}),i)}function er(e,t,n){return n&&(t={...t,...n??{}}),F.defineStore(e,t)}const tr=new Set(["_","$"]);function nr(e){return tr.has(e[0])}function wt(e){return Pe.get(e)??(typeof e?.$id=="string"?G.get(e.$id):void 0)}function Ot(e){const t=e.extensions.enhancedStore??e.extensions.extending;if(!t)throw new Error(`${e.id}Store - getEnhancedStore - Error: enhanced store is required`);return t}function vt(e,t){e.extensions.enhancedStore=t,e.extensions.extending=t}function rr(e){return Ot(e)}class sr extends Fe{_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}hydrate(){}afterHydration(){}get storeSubscribe(){if(this._storeSubscribe)return()=>({store:this.store,callback:this._storeSubscribe})}set storeSubscribe(t){this._storeSubscribe=t}constructor(t,n,s=!1,r){if(super(s,r),this._options=n.storeOptions,this._store=t,this._options?.enhancedStore){const i=wt(this.store);i&&vt(i,this.store)}}addToState(t,n){this.isOptionApi()||n?.value||(n=nt(n)),this.state[t]=n,this.store[t]=dn(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 nr(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(!X(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)}}function ir(e,t){const n=new _e(e,t);return n.plugin.bind(n)}function or(e,t){const n=new _e(e,t?.debug,{execution:t?.execution,hydrationScheduler:t?.hydrationScheduler,runtimeEnvironment:t?.runtimeEnvironment,subscriberExecution:t?.subscriberExecution});return n.plugin.bind(n)}p.CustomConsole=ke,p.PLUGIN_NAME=pe,p.PluginSubscriber=Nt,p.PluginSubscription=_e,p.Store=sr,p.createHydrationPlugin=or,p.createPlugin=ir,p.defineAStore=Xn,p.defineAStoreCtx=Zn,p.getDefineAStoreSetupContext=wt,p.getEnhancedStore=Ot,p.getExtendingStore=rr,p.isEmpty=X,p.setEnhancedStore=vt,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/types/index.d.ts
CHANGED
|
@@ -65,6 +65,7 @@ export interface StoreOnActionCallbackParameters {
|
|
|
65
65
|
export interface PluginSubscriberInterface {
|
|
66
66
|
console?: Console;
|
|
67
67
|
execution?: PluginExecutionOptions;
|
|
68
|
+
hydrate?: (context: PiniaPluginContext, debug: boolean) => void | Promise<void>;
|
|
68
69
|
hydrationScheduler?: PluginHydrationScheduler;
|
|
69
70
|
invoke: (context: PiniaPluginContext, debug: boolean) => boolean;
|
|
70
71
|
name: string;
|
|
@@ -72,6 +73,7 @@ export interface PluginSubscriberInterface {
|
|
|
72
73
|
storeOnActionSubscription?: StoreOnActionSubscription;
|
|
73
74
|
storeMutationSubscription?: StoreMutationSubscription;
|
|
74
75
|
subscriptions?: PluginSubscriptions;
|
|
76
|
+
afterHydration?: (context: PiniaPluginContext, debug: boolean) => void | Promise<void>;
|
|
75
77
|
}
|
|
76
78
|
export interface PluginSubscriptionDefinition {
|
|
77
79
|
stores?: PiniaStore[];
|
|
@@ -121,6 +123,7 @@ export declare abstract class CustomConsole implements Console {
|
|
|
121
123
|
export declare abstract class PluginSubscriber<Instance extends Store> implements PluginSubscriberInterface {
|
|
122
124
|
console: Console;
|
|
123
125
|
execution?: PluginExecutionOptions;
|
|
126
|
+
hydrate(context: PiniaPluginContext, debug: boolean): void | Promise<void>;
|
|
124
127
|
hydrationScheduler?: PluginHydrationScheduler;
|
|
125
128
|
name: string;
|
|
126
129
|
pluginOptions: AnyObject;
|
|
@@ -128,10 +131,12 @@ export declare abstract class PluginSubscriber<Instance extends Store> implement
|
|
|
128
131
|
storeOnActionSubscription?: StoreOnActionSubscription;
|
|
129
132
|
storeMutationSubscription?: StoreMutationSubscription;
|
|
130
133
|
subscriptions?: PluginSubscriptions;
|
|
134
|
+
afterHydration(context: PiniaPluginContext, debug: boolean): void | Promise<void>;
|
|
131
135
|
protected pluginCreated?: (store: PiniaStore) => void;
|
|
132
136
|
protected _resetStoreCallback?: (store?: PiniaStore) => void;
|
|
133
137
|
constructor(pluginName: string, createInstanceFunction: (store: PiniaStore, options: AnyObject, debug: boolean, customConsole?: Console) => Instance | undefined, pluginConsole?: Console);
|
|
134
138
|
invoke(context: PiniaPluginContext, debug: boolean): boolean;
|
|
139
|
+
get storeInstance(): Instance | undefined;
|
|
135
140
|
}
|
|
136
141
|
export declare class PluginSubscription extends Debug {
|
|
137
142
|
protected _className: string;
|
|
@@ -146,6 +151,8 @@ export declare class Store extends Debug {
|
|
|
146
151
|
state: StateTree;
|
|
147
152
|
storeSubscribe: StoreMutationSubscriptionCallback | undefined;
|
|
148
153
|
readonly store: AnyObject;
|
|
154
|
+
hydrate(): void | Promise<void>;
|
|
155
|
+
afterHydration(): void | Promise<void>;
|
|
149
156
|
constructor(store: PiniaStore, options: AnyObject, debug?: boolean, customConsole?: Console);
|
|
150
157
|
addSubscription(pluginName: string, subscription: PluginSubscriberInterface, options?: {
|
|
151
158
|
subscriptionOptions?: StoreOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pinia-plugin-subscription",
|
|
3
|
-
"version": "0.1.6-beta.
|
|
3
|
+
"version": "0.1.6-beta.1",
|
|
4
4
|
"description": "Pinia plugin for Vue.js that helps building Pinia plugins by centralizing subscriber registration and providing a Store base class for store helpers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|