@stonecrop/stonecrop 0.3.7 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/stonecrop.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var vr = Object.defineProperty;
2
2
  var yr = (e, t, n) => t in e ? vr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var x = (e, t, n) => yr(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { effectScope as _n, ref as se, markRaw as fe, toRaw as Ce, watch as Me, unref as de, hasInjectionContext as _r, inject as pe, getCurrentInstance as bt, reactive as En, isRef as Ae, isReactive as wt, toRef as Xe, nextTick as ct, computed as z, getCurrentScope as Er, onScopeDispose as br, toRefs as jt, onBeforeMount as wr, shallowRef as Sr, shallowReactive as Or, defineComponent as bn, h as wn, provide as Ze, watchEffect as Nr } from "vue";
4
+ import { effectScope as _n, ref as se, markRaw as fe, toRaw as Ce, watch as Me, unref as de, hasInjectionContext as _r, inject as pe, getCurrentInstance as wt, reactive as En, isRef as Ae, isReactive as bt, toRef as Xe, nextTick as ct, computed as z, getCurrentScope as Er, onScopeDispose as wr, toRefs as jt, onBeforeMount as br, shallowRef as Sr, shallowReactive as Or, defineComponent as wn, h as bn, provide as Ze, watchEffect as Nr } from "vue";
5
5
  function ut(e) {
6
6
  this.message = e || "";
7
7
  }
@@ -14,7 +14,7 @@ ut.prototype = Object.create(Error.prototype, {
14
14
  }
15
15
  }
16
16
  });
17
- const we = class we {
17
+ const be = class be {
18
18
  /**
19
19
  * @param registry - The immutable registry
20
20
  * @param store - The mutable Pinia store
@@ -57,6 +57,10 @@ const we = class we {
57
57
  * @see {@link DoctypeMeta}
58
58
  */
59
59
  x(this, "registry");
60
+ /**
61
+ * The Pinia store that manages the mutable records
62
+ */
63
+ x(this, "store");
60
64
  /**
61
65
  * schema - The Stonecrop schema; the schema is a subset of the registry
62
66
  * @example
@@ -83,13 +87,9 @@ const we = class we {
83
87
  * The actions are a subset of the registry
84
88
  */
85
89
  x(this, "actions");
86
- /**
87
- * The Pinia store that manages the mutable records
88
- */
89
- x(this, "store");
90
- if (we._root)
91
- return we._root;
92
- we._root = this, this.registry = t, this.store = n, this.schema = r, this.workflow = o, this.actions = s;
90
+ if (be._root)
91
+ return be._root;
92
+ be._root = this, this.registry = t, this.store = n, this.schema = r, this.workflow = o, this.actions = s;
93
93
  }
94
94
  /**
95
95
  * Sets up the Stonecrop instance with the given doctype
@@ -207,17 +207,21 @@ const we = class we {
207
207
  * ```
208
208
  */
209
209
  runAction(t, n, r) {
210
- const s = this.registry.registry[t.slug].actions.get(n), { initialState: i } = this.workflow;
211
- this.workflow.transition(i, { type: n }), s.length > 0 && s.forEach((a) => {
212
- new Function(a)(r);
213
- });
210
+ var i;
211
+ const s = (i = this.registry.registry[t.slug].actions) == null ? void 0 : i.get(n);
212
+ if (this.workflow) {
213
+ const { initialState: a } = this.workflow;
214
+ this.workflow.transition(a, { type: n }), s && s.length > 0 && s.forEach((c) => {
215
+ new Function(c)(r);
216
+ });
217
+ }
214
218
  }
215
219
  };
216
220
  /**
217
221
  * The root Stonecrop instance
218
222
  */
219
- x(we, "_root");
220
- let lt = we;
223
+ x(be, "_root");
224
+ let lt = be;
221
225
  var Sn = !1;
222
226
  function je(e, t, n) {
223
227
  return Array.isArray(e) ? (e.length = Math.max(e.length, t), e.splice(t, 1, n), n) : (e[t] = n, n);
@@ -895,7 +899,7 @@ function Dn(e, t) {
895
899
  if (!(n in e))
896
900
  continue;
897
901
  const o = e[n];
898
- me(o) && me(r) && !Ae(r) && !wt(r) ? e[n] = Dn(o, r) : e[n] = r;
902
+ me(o) && me(r) && !Ae(r) && !bt(r) ? e[n] = Dn(o, r) : e[n] = r;
899
903
  }
900
904
  return e;
901
905
  }
@@ -907,7 +911,7 @@ function Ut(e, t, n, r = Mn) {
907
911
  const s = e.indexOf(t);
908
912
  s > -1 && (e.splice(s, 1), r());
909
913
  };
910
- return !n && Er() && br(o), o;
914
+ return !n && Er() && wr(o), o;
911
915
  }
912
916
  function _e(e, ...t) {
913
917
  e.slice().forEach((n) => {
@@ -921,7 +925,7 @@ function dt(e, t) {
921
925
  if (!t.hasOwnProperty(n))
922
926
  continue;
923
927
  const r = t[n], o = e[n];
924
- me(o) && me(r) && e.hasOwnProperty(n) && !Ae(r) && !wt(r) ? e[n] = dt(o, r) : e[n] = r;
928
+ me(o) && me(r) && e.hasOwnProperty(n) && !Ae(r) && !bt(r) ? e[n] = dt(o, r) : e[n] = r;
925
929
  }
926
930
  return e;
927
931
  }
@@ -960,11 +964,11 @@ function ht(e, t, n = {}, r, o, s) {
960
964
  throw new Error("Pinia destroyed");
961
965
  const c = { deep: !0 };
962
966
  process.env.NODE_ENV !== "production" && !Sn && (c.onTrigger = (y) => {
963
- l ? p = y : l == !1 && !w._hotUpdating && (Array.isArray(p) ? p.push(y) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."));
967
+ l ? p = y : l == !1 && !b._hotUpdating && (Array.isArray(p) ? p.push(y) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."));
964
968
  });
965
969
  let l, f, u = [], d = [], p;
966
- const b = r.state.value[e];
967
- !s && !b && (process.env.NODE_ENV === "production" || !o) && (r.state.value[e] = {});
970
+ const w = r.state.value[e];
971
+ !s && !w && (process.env.NODE_ENV === "production" || !o) && (r.state.value[e] = {});
968
972
  const S = se({});
969
973
  let E;
970
974
  function R(y) {
@@ -1013,13 +1017,13 @@ function ht(e, t, n = {}, r, o, s) {
1013
1017
  _e(d, {
1014
1018
  args: V,
1015
1019
  name: A[tt],
1016
- store: w,
1020
+ store: b,
1017
1021
  after: Ve,
1018
1022
  onError: ge
1019
1023
  });
1020
1024
  let Q;
1021
1025
  try {
1022
- Q = y.apply(this && this.$id === e ? this : w, V);
1026
+ Q = y.apply(this && this.$id === e ? this : b, V);
1023
1027
  } catch (F) {
1024
1028
  throw _e(ce, F), F;
1025
1029
  }
@@ -1049,7 +1053,7 @@ function ht(e, t, n = {}, r, o, s) {
1049
1053
  return A;
1050
1054
  },
1051
1055
  $dispose: P
1052
- }, w = En(process.env.NODE_ENV !== "production" || process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && re ? G(
1056
+ }, b = En(process.env.NODE_ENV !== "production" || process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && re ? G(
1053
1057
  {
1054
1058
  _hmrPayload: B,
1055
1059
  _customProperties: fe(/* @__PURE__ */ new Set())
@@ -1059,12 +1063,12 @@ function ht(e, t, n = {}, r, o, s) {
1059
1063
  // must be added later
1060
1064
  // setupStore
1061
1065
  ) : q);
1062
- r._s.set(e, w);
1066
+ r._s.set(e, b);
1063
1067
  const W = (r._a && r._a.runWithContext || Yr)(() => r._e.run(() => (i = _n()).run(() => t({ action: M }))));
1064
1068
  for (const y in W) {
1065
1069
  const v = W[y];
1066
- if (Ae(v) && !Ht(v) || wt(v))
1067
- process.env.NODE_ENV !== "production" && o ? je(S.value, y, Xe(W, y)) : s || (b && Zr(v) && (Ae(v) ? v.value = b[y] : dt(v, b[y])), r.state.value[e][y] = v), process.env.NODE_ENV !== "production" && B.state.push(y);
1070
+ if (Ae(v) && !Ht(v) || bt(v))
1071
+ process.env.NODE_ENV !== "production" && o ? je(S.value, y, Xe(W, y)) : s || (w && Zr(v) && (Ae(v) ? v.value = w[y] : dt(v, w[y])), r.state.value[e][y] = v), process.env.NODE_ENV !== "production" && B.state.push(y);
1068
1072
  else if (typeof v == "function") {
1069
1073
  const A = process.env.NODE_ENV !== "production" && o ? v : M(v, y);
1070
1074
  W[y] = A, process.env.NODE_ENV !== "production" && (B.actions[y] = v), a.actions[y] = v;
@@ -1074,7 +1078,7 @@ function ht(e, t, n = {}, r, o, s) {
1074
1078
  ) : v, re && (W._getters || // @ts-expect-error: same
1075
1079
  (W._getters = fe([]))).push(y));
1076
1080
  }
1077
- if (G(w, W), G(Ce(w), W), Object.defineProperty(w, "$state", {
1081
+ if (G(b, W), G(Ce(b), W), Object.defineProperty(b, "$state", {
1078
1082
  get: () => process.env.NODE_ENV !== "production" && o ? S.value : r.state.value[e],
1079
1083
  set: (y) => {
1080
1084
  if (process.env.NODE_ENV !== "production" && o)
@@ -1083,34 +1087,34 @@ function ht(e, t, n = {}, r, o, s) {
1083
1087
  G(v, y);
1084
1088
  });
1085
1089
  }
1086
- }), process.env.NODE_ENV !== "production" && (w._hotUpdate = fe((y) => {
1087
- w._hotUpdating = !0, y._hmrPayload.state.forEach((v) => {
1088
- if (v in w.$state) {
1089
- const A = y.$state[v], V = w.$state[v];
1090
+ }), process.env.NODE_ENV !== "production" && (b._hotUpdate = fe((y) => {
1091
+ b._hotUpdating = !0, y._hmrPayload.state.forEach((v) => {
1092
+ if (v in b.$state) {
1093
+ const A = y.$state[v], V = b.$state[v];
1090
1094
  typeof A == "object" && me(A) && me(V) ? Dn(A, V) : y.$state[v] = V;
1091
1095
  }
1092
- je(w, v, Xe(y.$state, v));
1093
- }), Object.keys(w.$state).forEach((v) => {
1094
- v in y.$state || et(w, v);
1096
+ je(b, v, Xe(y.$state, v));
1097
+ }), Object.keys(b.$state).forEach((v) => {
1098
+ v in y.$state || et(b, v);
1095
1099
  }), l = !1, f = !1, r.state.value[e] = Xe(y._hmrPayload, "hotState"), f = !0, ct().then(() => {
1096
1100
  l = !0;
1097
1101
  });
1098
1102
  for (const v in y._hmrPayload.actions) {
1099
1103
  const A = y[v];
1100
- je(w, v, M(A, v));
1104
+ je(b, v, M(A, v));
1101
1105
  }
1102
1106
  for (const v in y._hmrPayload.getters) {
1103
1107
  const A = y._hmrPayload.getters[v], V = s ? (
1104
1108
  // special handling of options api
1105
- z(() => (Te(r), A.call(w, w)))
1109
+ z(() => (Te(r), A.call(b, b)))
1106
1110
  ) : A;
1107
- je(w, v, V);
1111
+ je(b, v, V);
1108
1112
  }
1109
- Object.keys(w._hmrPayload.getters).forEach((v) => {
1110
- v in y._hmrPayload.getters || et(w, v);
1111
- }), Object.keys(w._hmrPayload.actions).forEach((v) => {
1112
- v in y._hmrPayload.actions || et(w, v);
1113
- }), w._hmrPayload = y._hmrPayload, w._getters = y._getters, w._hotUpdating = !1;
1113
+ Object.keys(b._hmrPayload.getters).forEach((v) => {
1114
+ v in y._hmrPayload.getters || et(b, v);
1115
+ }), Object.keys(b._hmrPayload.actions).forEach((v) => {
1116
+ v in y._hmrPayload.actions || et(b, v);
1117
+ }), b._hmrPayload = y._hmrPayload, b._getters = y._getters, b._hotUpdating = !1;
1114
1118
  })), process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && re) {
1115
1119
  const y = {
1116
1120
  writable: !0,
@@ -1119,28 +1123,28 @@ function ht(e, t, n = {}, r, o, s) {
1119
1123
  enumerable: !1
1120
1124
  };
1121
1125
  ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((v) => {
1122
- Object.defineProperty(w, v, G({ value: w[v] }, y));
1126
+ Object.defineProperty(b, v, G({ value: b[v] }, y));
1123
1127
  });
1124
1128
  }
1125
1129
  return r._p.forEach((y) => {
1126
1130
  if (process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && re) {
1127
1131
  const v = i.run(() => y({
1128
- store: w,
1132
+ store: b,
1129
1133
  app: r._a,
1130
1134
  pinia: r,
1131
1135
  options: a
1132
1136
  }));
1133
- Object.keys(v || {}).forEach((A) => w._customProperties.add(A)), G(w, v);
1137
+ Object.keys(v || {}).forEach((A) => b._customProperties.add(A)), G(b, v);
1134
1138
  } else
1135
- G(w, i.run(() => y({
1136
- store: w,
1139
+ G(b, i.run(() => y({
1140
+ store: b,
1137
1141
  app: r._a,
1138
1142
  pinia: r,
1139
1143
  options: a
1140
1144
  })));
1141
- }), process.env.NODE_ENV !== "production" && w.$state && typeof w.$state == "object" && typeof w.$state.constructor == "function" && !w.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
1145
+ }), process.env.NODE_ENV !== "production" && b.$state && typeof b.$state == "object" && typeof b.$state.constructor == "function" && !b.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
1142
1146
  state: () => new MyClass()
1143
- Found in store "${w.$id}".`), b && s && n.hydrate && n.hydrate(w.$state, b), l = !0, f = !0, w;
1147
+ Found in store "${b.$id}".`), w && s && n.hydrate && n.hydrate(b.$state, w), l = !0, f = !0, b;
1144
1148
  }
1145
1149
  /*! #__NO_SIDE_EFFECTS__ */
1146
1150
  // @__NO_SIDE_EFFECTS__
@@ -1163,7 +1167,7 @@ This will fail in production.`);
1163
1167
  c._hotUpdate(d), delete a.state.value[u], a._s.delete(u);
1164
1168
  }
1165
1169
  if (process.env.NODE_ENV !== "production" && re) {
1166
- const u = bt();
1170
+ const u = wt();
1167
1171
  if (u && u.proxy && // avoid adding stores that are just built for hot module replacement
1168
1172
  !c) {
1169
1173
  const d = u.proxy, p = "_pStores" in d ? d._pStores : d._pStores = {};
@@ -1187,13 +1191,14 @@ function Mi(e) {
1187
1191
  throw new Error("Please enable the Stonecrop plugin before using the Stonecrop composable");
1188
1192
  }
1189
1193
  const n = se(new lt(e, t)), r = se(!1);
1190
- return wr(async () => {
1191
- var c, l;
1194
+ return br(async () => {
1195
+ var c, l, f;
1196
+ if (!e) return;
1192
1197
  const o = e.router.currentRoute.value, s = (c = o.params.records) == null ? void 0 : c.toString().toLowerCase(), i = (l = o.params.record) == null ? void 0 : l.toString().toLowerCase();
1193
1198
  if (!s && !i)
1194
1199
  return;
1195
- const a = await e.getMeta(s);
1196
- e.addDoctype(a), n.value.setup(a), s && (i ? await n.value.getRecord(a, i) : await n.value.getRecords(a)), n.value.runAction(a, "LOAD", i ? [i] : void 0), r.value = !0;
1200
+ const a = await ((f = e.getMeta) == null ? void 0 : f.call(e, s));
1201
+ a && (e.addDoctype(a), n.value.setup(a), s && (i ? await n.value.getRecord(a, i) : await n.value.getRecords(a)), n.value.runAction(a, "LOAD", i ? [i] : void 0)), r.value = !0;
1197
1202
  }), { stonecrop: n, isReady: r };
1198
1203
  }
1199
1204
  class Vi {
@@ -1275,7 +1280,7 @@ const Se = class Se {
1275
1280
  * @see {@link DoctypeMeta}
1276
1281
  */
1277
1282
  addDoctype(t) {
1278
- t.doctype in Object.keys(this.registry) || (this.registry[t.slug] = t), this.router.hasRoute(t.doctype) || this.router.addRoute({
1283
+ t.doctype in Object.keys(this.registry) || (this.registry[t.slug] = t), !this.router.hasRoute(t.doctype) && t.component && this.router.addRoute({
1279
1284
  path: `/${t.slug}`,
1280
1285
  name: t.slug,
1281
1286
  component: t.component
@@ -1348,7 +1353,7 @@ function rt(e, t, n = "/") {
1348
1353
  let r, o = {}, s = "", i = "";
1349
1354
  const a = t.indexOf("#");
1350
1355
  let c = t.indexOf("?");
1351
- return a < c && a >= 0 && (c = -1), c > -1 && (r = t.slice(0, c), s = t.slice(c + 1, a > -1 ? a : t.length), o = e(s)), a > -1 && (r = r || t.slice(0, a), i = t.slice(a, t.length)), r = bo(r ?? t, n), {
1356
+ return a < c && a >= 0 && (c = -1), c > -1 && (r = t.slice(0, c), s = t.slice(c + 1, a > -1 ? a : t.length), o = e(s)), a > -1 && (r = r || t.slice(0, a), i = t.slice(a, t.length)), r = wo(r ?? t, n), {
1352
1357
  fullPath: r + (s && "?") + s + i,
1353
1358
  path: r,
1354
1359
  query: o,
@@ -1383,7 +1388,7 @@ function Eo(e, t) {
1383
1388
  function qt(e, t) {
1384
1389
  return H(t) ? e.length === t.length && e.every((n, r) => n === t[r]) : e.length === 1 && e[0] === t;
1385
1390
  }
1386
- function bo(e, t) {
1391
+ function wo(e, t) {
1387
1392
  if (e.startsWith("/"))
1388
1393
  return e;
1389
1394
  if (process.env.NODE_ENV !== "production" && !t.startsWith("/"))
@@ -1421,7 +1426,7 @@ var Ie;
1421
1426
  (function(e) {
1422
1427
  e.back = "back", e.forward = "forward", e.unknown = "";
1423
1428
  })(Ie || (Ie = {}));
1424
- function wo(e) {
1429
+ function bo(e) {
1425
1430
  if (!e)
1426
1431
  if (Z) {
1427
1432
  const t = document.querySelector("base");
@@ -1494,10 +1499,10 @@ function Hn(e, t) {
1494
1499
  function Io(e, t, n, r) {
1495
1500
  let o = [], s = [], i = null;
1496
1501
  const a = ({ state: d }) => {
1497
- const p = Hn(e, location), b = n.value, S = t.value;
1502
+ const p = Hn(e, location), w = n.value, S = t.value;
1498
1503
  let E = 0;
1499
1504
  if (d) {
1500
- if (n.value = p, t.value = d, i && i === b) {
1505
+ if (n.value = p, t.value = d, i && i === w) {
1501
1506
  i = null;
1502
1507
  return;
1503
1508
  }
@@ -1505,7 +1510,7 @@ function Io(e, t, n, r) {
1505
1510
  } else
1506
1511
  r(p);
1507
1512
  o.forEach((R) => {
1508
- R(n.value, b, {
1513
+ R(n.value, w, {
1509
1514
  delta: E,
1510
1515
  type: De.pop,
1511
1516
  direction: E ? E > 0 ? Ie.forward : Ie.back : Ie.unknown
@@ -1518,8 +1523,8 @@ function Io(e, t, n, r) {
1518
1523
  function l(d) {
1519
1524
  o.push(d);
1520
1525
  const p = () => {
1521
- const b = o.indexOf(d);
1522
- b > -1 && o.splice(b, 1);
1526
+ const w = o.indexOf(d);
1527
+ w > -1 && o.splice(w, 1);
1523
1528
  };
1524
1529
  return s.push(p), p;
1525
1530
  }
@@ -1612,7 +1617,7 @@ You can find more information at https://router.vuejs.org/guide/migration/#Usage
1612
1617
  };
1613
1618
  }
1614
1619
  function Ao(e) {
1615
- e = wo(e);
1620
+ e = bo(e);
1616
1621
  const t = Co(e), n = Io(e, t.state, t.location, t.replace);
1617
1622
  function r(s, i = !0) {
1618
1623
  i || n.pauseListeners(), history.go(s);
@@ -1708,9 +1713,9 @@ function jo(e, t) {
1708
1713
  if (d.type === 0)
1709
1714
  u || (o += "/"), o += d.value.replace(xo, "\\$&"), p += 40;
1710
1715
  else if (d.type === 1) {
1711
- const { value: b, repeatable: S, optional: E, regexp: R } = d;
1716
+ const { value: w, repeatable: S, optional: E, regexp: R } = d;
1712
1717
  s.push({
1713
- name: b,
1718
+ name: w,
1714
1719
  repeatable: S,
1715
1720
  optional: E
1716
1721
  });
@@ -1720,7 +1725,7 @@ function jo(e, t) {
1720
1725
  try {
1721
1726
  new RegExp(`(${k})`);
1722
1727
  } catch (M) {
1723
- throw new Error(`Invalid custom RegExp for param "${b}" (${k}): ` + M.message);
1728
+ throw new Error(`Invalid custom RegExp for param "${w}" (${k}): ` + M.message);
1724
1729
  }
1725
1730
  }
1726
1731
  let P = S ? `((?:${k})(?:/(?:${k}))*)` : `(${k})`;
@@ -1743,8 +1748,8 @@ function jo(e, t) {
1743
1748
  if (!f)
1744
1749
  return null;
1745
1750
  for (let d = 1; d < f.length; d++) {
1746
- const p = f[d] || "", b = s[d - 1];
1747
- u[b.name] = p && b.repeatable ? p.split("/") : p;
1751
+ const p = f[d] || "", w = s[d - 1];
1752
+ u[w.name] = p && w.repeatable ? p.split("/") : p;
1748
1753
  }
1749
1754
  return u;
1750
1755
  }
@@ -1756,15 +1761,15 @@ function jo(e, t) {
1756
1761
  if (p.type === 0)
1757
1762
  f += p.value;
1758
1763
  else if (p.type === 1) {
1759
- const { value: b, repeatable: S, optional: E } = p, R = b in l ? l[b] : "";
1764
+ const { value: w, repeatable: S, optional: E } = p, R = w in l ? l[w] : "";
1760
1765
  if (H(R) && !S)
1761
- throw new Error(`Provided param "${b}" is an array but it is not repeatable (* or + modifiers)`);
1766
+ throw new Error(`Provided param "${w}" is an array but it is not repeatable (* or + modifiers)`);
1762
1767
  const k = H(R) ? R.join("/") : R;
1763
1768
  if (!k)
1764
1769
  if (E)
1765
1770
  d.length < 2 && (f.endsWith("/") ? f = f.slice(0, -1) : u = !0);
1766
1771
  else
1767
- throw new Error(`Missing required param "${b}"`);
1772
+ throw new Error(`Missing required param "${w}"`);
1768
1773
  f += k;
1769
1774
  }
1770
1775
  }
@@ -1896,7 +1901,7 @@ function Wo(e, t) {
1896
1901
  return r.get(u);
1897
1902
  }
1898
1903
  function s(u, d, p) {
1899
- const b = !p, S = en(u);
1904
+ const w = !p, S = en(u);
1900
1905
  process.env.NODE_ENV !== "production" && Jo(S, d), S.aliasOf = p && p.record;
1901
1906
  const E = nn(t, u), R = [S];
1902
1907
  if ("alias" in u) {
@@ -1921,16 +1926,16 @@ function Wo(e, t) {
1921
1926
  for (const M of R) {
1922
1927
  const { path: B } = M;
1923
1928
  if (d && B[0] !== "/") {
1924
- const q = d.record.path, w = q[q.length - 1] === "/" ? "" : "/";
1925
- M.path = d.record.path + (B && w + B);
1929
+ const q = d.record.path, b = q[q.length - 1] === "/" ? "" : "/";
1930
+ M.path = d.record.path + (B && b + B);
1926
1931
  }
1927
1932
  if (process.env.NODE_ENV !== "production" && M.path === "*")
1928
1933
  throw new Error(`Catch all routes ("*") must now be defined using a param with a custom regexp.
1929
1934
  See more at https://router.vuejs.org/guide/migration/#Removed-star-or-catch-all-routes.`);
1930
- if (k = Ho(M, d, E), process.env.NODE_ENV !== "production" && d && B[0] === "/" && Qo(k, d), p ? (p.alias.push(k), process.env.NODE_ENV !== "production" && qo(p, k)) : (P = P || k, P !== k && P.alias.push(k), b && u.name && !tn(k) && (process.env.NODE_ENV !== "production" && Ko(u, d), i(u.name))), zn(k) && c(k), S.children) {
1935
+ if (k = Ho(M, d, E), process.env.NODE_ENV !== "production" && d && B[0] === "/" && Qo(k, d), p ? (p.alias.push(k), process.env.NODE_ENV !== "production" && qo(p, k)) : (P = P || k, P !== k && P.alias.push(k), w && u.name && !tn(k) && (process.env.NODE_ENV !== "production" && Ko(u, d), i(u.name))), zn(k) && c(k), S.children) {
1931
1936
  const q = S.children;
1932
- for (let w = 0; w < q.length; w++)
1933
- s(q[w], k, p && p.children[w]);
1937
+ for (let b = 0; b < q.length; b++)
1938
+ s(q[b], k, p && p.children[b]);
1934
1939
  }
1935
1940
  p = p || k;
1936
1941
  }
@@ -1955,7 +1960,7 @@ See more at https://router.vuejs.org/guide/migration/#Removed-star-or-catch-all-
1955
1960
  n.splice(d, 0, u), u.record.name && !tn(u) && r.set(u.record.name, u);
1956
1961
  }
1957
1962
  function l(u, d) {
1958
- let p, b = {}, S, E;
1963
+ let p, w = {}, S, E;
1959
1964
  if ("name" in u && u.name) {
1960
1965
  if (p = r.get(u.name), !p)
1961
1966
  throw Ne(1, {
@@ -1965,7 +1970,7 @@ See more at https://router.vuejs.org/guide/migration/#Removed-star-or-catch-all-
1965
1970
  const P = Object.keys(u.params || {}).filter((M) => !p.keys.find((B) => B.name === M));
1966
1971
  P.length && O(`Discarded invalid param(s) "${P.join('", "')}" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`);
1967
1972
  }
1968
- E = p.record.name, b = I(
1973
+ E = p.record.name, w = I(
1969
1974
  // paramsFromLocation is a new object
1970
1975
  Zt(
1971
1976
  d.params,
@@ -1976,16 +1981,16 @@ See more at https://router.vuejs.org/guide/migration/#Removed-star-or-catch-all-
1976
1981
  // discard any existing params in the current location that do not exist here
1977
1982
  // #1497 this ensures better active/exact matching
1978
1983
  u.params && Zt(u.params, p.keys.map((P) => P.name))
1979
- ), S = p.stringify(b);
1984
+ ), S = p.stringify(w);
1980
1985
  } else if (u.path != null)
1981
- S = u.path, process.env.NODE_ENV !== "production" && !S.startsWith("/") && O(`The Matcher cannot resolve relative paths but received "${S}". Unless you directly called \`matcher.resolve("${S}")\`, this is probably a bug in vue-router. Please open an issue at https://github.com/vuejs/router/issues/new/choose.`), p = n.find((P) => P.re.test(S)), p && (b = p.parse(S), E = p.record.name);
1986
+ S = u.path, process.env.NODE_ENV !== "production" && !S.startsWith("/") && O(`The Matcher cannot resolve relative paths but received "${S}". Unless you directly called \`matcher.resolve("${S}")\`, this is probably a bug in vue-router. Please open an issue at https://github.com/vuejs/router/issues/new/choose.`), p = n.find((P) => P.re.test(S)), p && (w = p.parse(S), E = p.record.name);
1982
1987
  else {
1983
1988
  if (p = d.name ? r.get(d.name) : n.find((P) => P.re.test(d.path)), !p)
1984
1989
  throw Ne(1, {
1985
1990
  location: u,
1986
1991
  currentLocation: d
1987
1992
  });
1988
- E = p.record.name, b = I({}, d.params, u.params), S = p.stringify(b);
1993
+ E = p.record.name, w = I({}, d.params, u.params), S = p.stringify(w);
1989
1994
  }
1990
1995
  const R = [];
1991
1996
  let k = p;
@@ -1994,7 +1999,7 @@ See more at https://router.vuejs.org/guide/migration/#Removed-star-or-catch-all-
1994
1999
  return {
1995
2000
  name: E,
1996
2001
  path: S,
1997
- params: b,
2002
+ params: w,
1998
2003
  matched: R,
1999
2004
  meta: zo(R)
2000
2005
  };
@@ -2248,9 +2253,9 @@ function sn(e) {
2248
2253
  const { matched: f } = s.value, { length: u } = f, d = f[u - 1], p = n.matched;
2249
2254
  if (!d || !p.length)
2250
2255
  return -1;
2251
- const b = p.findIndex(ie.bind(null, d));
2252
- if (b > -1)
2253
- return b;
2256
+ const w = p.findIndex(ie.bind(null, d));
2257
+ if (w > -1)
2258
+ return w;
2254
2259
  const S = an(f[u - 2]);
2255
2260
  return (
2256
2261
  // we are dealing with nested routes
@@ -2258,7 +2263,7 @@ function sn(e) {
2258
2263
  // referring to the empty child. Or we currently are on a different
2259
2264
  // child of the same parent
2260
2265
  an(d) === S && // avoid comparing the child with its parent
2261
- p[p.length - 1].path !== S ? p.findIndex(ie.bind(null, f[u - 2])) : b
2266
+ p[p.length - 1].path !== S ? p.findIndex(ie.bind(null, f[u - 2])) : w
2262
2267
  );
2263
2268
  }), a = z(() => i.value > -1 && as(n.params, s.value.params)), c = z(() => i.value > -1 && i.value === n.matched.length - 1 && Fn(n.params, s.value.params));
2264
2269
  function l(f = {}) {
@@ -2272,7 +2277,7 @@ function sn(e) {
2272
2277
  return Promise.resolve();
2273
2278
  }
2274
2279
  if (process.env.NODE_ENV !== "production" && Z) {
2275
- const f = bt();
2280
+ const f = wt();
2276
2281
  if (f) {
2277
2282
  const u = {
2278
2283
  route: s.value,
@@ -2296,7 +2301,7 @@ function sn(e) {
2296
2301
  function rs(e) {
2297
2302
  return e.length === 1 ? e[0] : e;
2298
2303
  }
2299
- const os = /* @__PURE__ */ bn({
2304
+ const os = /* @__PURE__ */ wn({
2300
2305
  name: "RouterLink",
2301
2306
  compatConfig: { MODE: 3 },
2302
2307
  props: {
@@ -2327,7 +2332,7 @@ const os = /* @__PURE__ */ bn({
2327
2332
  }));
2328
2333
  return () => {
2329
2334
  const s = t.default && rs(t.default(n));
2330
- return e.custom ? s : wn("a", {
2335
+ return e.custom ? s : bn("a", {
2331
2336
  "aria-current": n.isExactActive ? e.ariaCurrentValue : null,
2332
2337
  href: n.href,
2333
2338
  // this would override user added attrs but Vue will still add
@@ -2362,7 +2367,7 @@ function as(e, t) {
2362
2367
  function an(e) {
2363
2368
  return e ? e.aliasOf ? e.aliasOf.path : e.path : "";
2364
2369
  }
2365
- const cn = (e, t, n) => e ?? t ?? n, cs = /* @__PURE__ */ bn({
2370
+ const cn = (e, t, n) => e ?? t ?? n, cs = /* @__PURE__ */ wn({
2366
2371
  name: "RouterView",
2367
2372
  // #674 we manually inherit them
2368
2373
  inheritAttrs: !1,
@@ -2388,7 +2393,7 @@ const cn = (e, t, n) => e ?? t ?? n, cs = /* @__PURE__ */ bn({
2388
2393
  }), a = z(() => o.value.matched[i.value]);
2389
2394
  Ze(on, z(() => i.value + 1)), Ze(ts, a), Ze(_t, o);
2390
2395
  const c = se();
2391
- return Me(() => [c.value, a.value, e.name], ([l, f, u], [d, p, b]) => {
2396
+ return Me(() => [c.value, a.value, e.name], ([l, f, u], [d, p, w]) => {
2392
2397
  f && (f.instances[u] = l, p && p !== f && l && l === d && (f.leaveGuards.size || (f.leaveGuards = p.leaveGuards), f.updateGuards.size || (f.updateGuards = p.updateGuards))), l && f && // if there is no instance but to and from are the same this might be
2393
2398
  // the first visit
2394
2399
  (!p || !ie(f, p) || !d) && (f.enterCallbacks[u] || []).forEach((S) => S(l));
@@ -2396,7 +2401,7 @@ const cn = (e, t, n) => e ?? t ?? n, cs = /* @__PURE__ */ bn({
2396
2401
  const l = o.value, f = e.name, u = a.value, d = u && u.components[f];
2397
2402
  if (!d)
2398
2403
  return un(n.default, { Component: d, route: l });
2399
- const p = u.props[f], b = p ? p === !0 ? l.params : typeof p == "function" ? p(l) : p : null, E = wn(d, I({}, b, t, {
2404
+ const p = u.props[f], w = p ? p === !0 ? l.params : typeof p == "function" ? p(l) : p : null, E = bn(d, I({}, w, t, {
2400
2405
  onVnodeUnmounted: (R) => {
2401
2406
  R.component.isUnmounted && (u.instances[f] = null);
2402
2407
  },
@@ -2429,7 +2434,7 @@ function un(e, t) {
2429
2434
  }
2430
2435
  const us = cs;
2431
2436
  function ls() {
2432
- const e = bt(), t = e.parent && e.parent.type.name, n = e.parent && e.parent.subTree && e.parent.subTree.type;
2437
+ const e = wt(), t = e.parent && e.parent.type.name, n = e.parent && e.parent.subTree && e.parent.subTree.type;
2433
2438
  if (t && (t === "KeepAlive" || t.includes("Transition")) && typeof n == "object" && n.name === "RouterView") {
2434
2439
  const r = t === "KeepAlive" ? "keep-alive" : "transition";
2435
2440
  O(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.
@@ -2445,7 +2450,7 @@ Use slot props instead:
2445
2450
  function Pe(e, t) {
2446
2451
  const n = I({}, e, {
2447
2452
  // remove variables that can contain vue instances
2448
- matched: e.matched.map((r) => bs(r, ["instances", "children", "aliasOf"]))
2453
+ matched: e.matched.map((r) => ws(r, ["instances", "children", "aliasOf"]))
2449
2454
  });
2450
2455
  return {
2451
2456
  _custom: {
@@ -2497,12 +2502,12 @@ function ds(e, t, n) {
2497
2502
  });
2498
2503
  }
2499
2504
  H(u.__vrl_devtools) && (u.__devtoolsApi = o, u.__vrl_devtools.forEach((d) => {
2500
- let p = d.route.path, b = Yn, S = "", E = 0;
2501
- d.error ? (p = d.error, b = vs, E = ys) : d.isExactActive ? (b = Qn, S = "This is exactly active") : d.isActive && (b = Kn, S = "This link is active"), f.tags.push({
2505
+ let p = d.route.path, w = Yn, S = "", E = 0;
2506
+ d.error ? (p = d.error, w = vs, E = ys) : d.isExactActive ? (w = Qn, S = "This is exactly active") : d.isActive && (w = Kn, S = "This link is active"), f.tags.push({
2502
2507
  label: p,
2503
2508
  textColor: E,
2504
2509
  tooltip: S,
2505
- backgroundColor: b
2510
+ backgroundColor: w
2506
2511
  });
2507
2512
  }));
2508
2513
  }), Me(t.currentRoute, () => {
@@ -2704,13 +2709,13 @@ function Et(e, t) {
2704
2709
  const o = e.record.path.toLowerCase(), s = Oe(o);
2705
2710
  return !t.startsWith("/") && (s.includes(t) || o.includes(t)) || s.startsWith(t) || o.startsWith(t) || e.record.name && String(e.record.name).includes(t) ? !0 : e.children.some((i) => Et(i, t));
2706
2711
  }
2707
- function bs(e, t) {
2712
+ function ws(e, t) {
2708
2713
  const n = {};
2709
2714
  for (const r in e)
2710
2715
  t.includes(r) || (n[r] = e[r]);
2711
2716
  return n;
2712
2717
  }
2713
- function ws(e) {
2718
+ function bs(e) {
2714
2719
  const t = Wo(e.routes, e), n = e.parseQuery || Zo, r = e.stringifyQuery || rn, o = e.history;
2715
2720
  if (process.env.NODE_ENV !== "production" && !o)
2716
2721
  throw new Error('Provide the "history" option when calling "createRouter()": https://router.vuejs.org/api/interfaces/RouterOptions.html#history');
@@ -2725,7 +2730,7 @@ function ws(e) {
2725
2730
  let m, _;
2726
2731
  return Wn(h) ? (m = t.getRecordMatcher(h), process.env.NODE_ENV !== "production" && !m && O(`Parent route "${String(h)}" not found when adding child route`, g), _ = g) : _ = h, t.addRoute(_, m);
2727
2732
  }
2728
- function b(h) {
2733
+ function w(h) {
2729
2734
  const g = t.getRecordMatcher(h);
2730
2735
  g ? t.removeRoute(g) : process.env.NODE_ENV !== "production" && O(`Cannot remove non-existent route "${String(h)}"`);
2731
2736
  }
@@ -2797,7 +2802,7 @@ function ws(e) {
2797
2802
  });
2798
2803
  }
2799
2804
  function M(h) {
2800
- return w(h);
2805
+ return b(h);
2801
2806
  }
2802
2807
  function B(h) {
2803
2808
  return M(I(k(h), { replace: !0 }));
@@ -2822,10 +2827,10 @@ ${JSON.stringify(_, null, 2)}
2822
2827
  }, _);
2823
2828
  }
2824
2829
  }
2825
- function w(h, g) {
2830
+ function b(h, g) {
2826
2831
  const m = l = R(h), _ = c.value, C = h.state, D = h.force, $ = h.replace === !0, N = q(m);
2827
2832
  if (N)
2828
- return w(
2833
+ return b(
2829
2834
  I(k(N), {
2830
2835
  state: typeof N == "object" ? I({}, C, N.state) : C,
2831
2836
  force: D,
@@ -2870,7 +2875,7 @@ ${JSON.stringify(_, null, 2)}
2870
2875
  // @ts-expect-error
2871
2876
  g._count + 1
2872
2877
  ) : 1) > 30 ? (O(`Detected a possibly infinite redirection in a navigation guard when going from "${_.fullPath}" to "${T.fullPath}". Aborting to avoid a Stack Overflow.
2873
- Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`), Promise.reject(new Error("Infinite redirect in navigation guard"))) : w(
2878
+ Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`), Promise.reject(new Error("Infinite redirect in navigation guard"))) : b(
2874
2879
  // keep options
2875
2880
  I({
2876
2881
  // preserve an existing replacement but allow the redirect to override it
@@ -2956,7 +2961,7 @@ ${JSON.stringify(_, null, 2)}
2956
2961
  return;
2957
2962
  const _ = R(h), C = q(_);
2958
2963
  if (C) {
2959
- w(I(C, { replace: !0, force: !0 }), _).catch(Re);
2964
+ b(I(C, { replace: !0, force: !0 }), _).catch(Re);
2960
2965
  return;
2961
2966
  }
2962
2967
  l = _;
@@ -2969,7 +2974,7 @@ ${JSON.stringify(_, null, 2)}
2969
2974
  $,
2970
2975
  2
2971
2976
  /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
2972
- ) ? (w(
2977
+ ) ? (b(
2973
2978
  I(k($.to), {
2974
2979
  force: !0
2975
2980
  }),
@@ -3028,7 +3033,7 @@ ${JSON.stringify(_, null, 2)}
3028
3033
  currentRoute: c,
3029
3034
  listening: !0,
3030
3035
  addRoute: p,
3031
- removeRoute: b,
3036
+ removeRoute: w,
3032
3037
  clearRoutes: t.clearRoutes,
3033
3038
  hasRoute: E,
3034
3039
  getRoutes: S,
@@ -3082,7 +3087,7 @@ function Ss(e, t) {
3082
3087
  }
3083
3088
  return [n, r, o];
3084
3089
  }
3085
- const Os = ws({
3090
+ const Os = bs({
3086
3091
  history: Ao(),
3087
3092
  routes: []
3088
3093
  });
@@ -3535,11 +3540,11 @@ function Ei(e) {
3535
3540
  return o.type;
3536
3541
  })));
3537
3542
  }
3538
- var lr = /* @__PURE__ */ new Set(), bi = 0, At = function(t, n) {
3539
- this.id = bi++, lr.add(this), this.name = t, dn && (n = dn), this.options = Rt(n), this.method = Ei(this.options), this._iL = !1, this._onML = null, this._addEL = {
3543
+ var lr = /* @__PURE__ */ new Set(), wi = 0, At = function(t, n) {
3544
+ this.id = wi++, lr.add(this), this.name = t, dn && (n = dn), this.options = Rt(n), this.method = Ei(this.options), this._iL = !1, this._onML = null, this._addEL = {
3540
3545
  message: [],
3541
3546
  internal: []
3542
- }, this._uMP = /* @__PURE__ */ new Set(), this._befC = [], this._prepP = null, wi(this);
3547
+ }, this._uMP = /* @__PURE__ */ new Set(), this._befC = [], this._prepP = null, bi(this);
3543
3548
  };
3544
3549
  At._pubkey = !0;
3545
3550
  var dn;
@@ -3613,7 +3618,7 @@ function hn(e, t, n) {
3613
3618
  }), i;
3614
3619
  });
3615
3620
  }
3616
- function wi(e) {
3621
+ function bi(e) {
3617
3622
  var t = e.method.create(e.name, e.options);
3618
3623
  Ns(t) ? (e._prepP = t, t.then(function(n) {
3619
3624
  e._state = n;
@@ -3699,7 +3704,7 @@ function $i(e) {
3699
3704
  return e < " " ? `\\u${e.charCodeAt(0).toString(16).padStart(4, "0")}` : "";
3700
3705
  }
3701
3706
  }
3702
- function be(e) {
3707
+ function we(e) {
3703
3708
  let t = "", n = 0;
3704
3709
  const r = e.length;
3705
3710
  for (let o = 0; o < r; o += 1) {
@@ -3806,9 +3811,9 @@ function yn(e, t) {
3806
3811
  const f = i++;
3807
3812
  r.set(l, f);
3808
3813
  for (const { key: d, fn: p } of o) {
3809
- const b = p(l);
3810
- if (b)
3811
- return n[f] = `["${d}",${a(b)}]`, f;
3814
+ const w = p(l);
3815
+ if (w)
3816
+ return n[f] = `["${d}",${a(w)}]`, f;
3812
3817
  }
3813
3818
  let u = "";
3814
3819
  if (gn(l))
@@ -3827,8 +3832,8 @@ function yn(e, t) {
3827
3832
  u = `["Date","${!isNaN(l.getDate()) ? l.toISOString() : ""}"]`;
3828
3833
  break;
3829
3834
  case "RegExp":
3830
- const { source: b, flags: S } = l;
3831
- u = S ? `["RegExp",${be(b)},"${S}"]` : `["RegExp",${be(b)}]`;
3835
+ const { source: w, flags: S } = l;
3836
+ u = S ? `["RegExp",${we(w)},"${S}"]` : `["RegExp",${we(w)}]`;
3832
3837
  break;
3833
3838
  case "Array":
3834
3839
  u = "[";
@@ -3864,13 +3869,13 @@ function yn(e, t) {
3864
3869
  if (Object.getPrototypeOf(l) === null) {
3865
3870
  u = '["null"';
3866
3871
  for (const E in l)
3867
- s.push(`.${E}`), u += `,${be(E)},${a(l[E])}`, s.pop();
3872
+ s.push(`.${E}`), u += `,${we(E)},${a(l[E])}`, s.pop();
3868
3873
  u += "]";
3869
3874
  } else {
3870
3875
  u = "{";
3871
3876
  let E = !1;
3872
3877
  for (const R in l)
3873
- E && (u += ","), E = !0, s.push(`.${R}`), u += `${be(R)}:${a(l[R])}`, s.pop();
3878
+ E && (u += ","), E = !0, s.push(`.${R}`), u += `${we(R)}:${a(l[R])}`, s.pop();
3874
3879
  u += "}";
3875
3880
  }
3876
3881
  }
@@ -3881,7 +3886,7 @@ function yn(e, t) {
3881
3886
  }
3882
3887
  function at(e) {
3883
3888
  const t = typeof e;
3884
- return t === "string" ? be(e) : e instanceof String ? be(e.toString()) : e === void 0 ? Tt.toString() : e === 0 && 1 / e < 0 ? Dt.toString() : t === "bigint" ? `["BigInt","${e}"]` : String(e);
3889
+ return t === "string" ? we(e) : e instanceof String ? we(e.toString()) : e === void 0 ? Tt.toString() : e === 0 && 1 / e < 0 ? Dt.toString() : t === "bigint" ? `["BigInt","${e}"]` : String(e);
3885
3890
  }
3886
3891
  function Ii(e, t, { initialize: n, type: r }) {
3887
3892
  let o = `${t.$id}-${e.toString()}`, s = new At(o, { type: r }), i = !1, a = 0;